Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GLSLNodeBuilder: Check texture type when declaring usampler3D/sampler3D uniforms #30608

Open
wants to merge 1 commit into
base: dev
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 7 additions & 8 deletions src/renderers/webgl-fallback/nodes/GLSLNodeBuilder.js
Original file line number Diff line number Diff line change
Expand Up @@ -524,14 +524,13 @@ ${ flowData.code }
let snippet = null;
let group = false;

if ( uniform.type === 'texture' ) {
if ( uniform.type === 'texture' || uniform.type === 'texture3D' ) {

const texture = uniform.node.value;

let typePrefix = '';

if ( texture.isDataTexture === true ) {

if ( texture.isDataTexture === true || texture.isData3DTexture === true ) {

if ( texture.type === UnsignedIntType ) {

Expand All @@ -553,6 +552,10 @@ ${ flowData.code }

snippet = `${typePrefix}sampler2DArray ${ uniform.name };`;

} else if ( uniform.type === 'texture3D' ) {

snippet = `${typePrefix}sampler3D ${ uniform.name };`;

} else {

snippet = `${typePrefix}sampler2D ${ uniform.name };`;
Expand All @@ -563,10 +566,6 @@ ${ flowData.code }

snippet = `samplerCube ${ uniform.name };`;

} else if ( uniform.type === 'texture3D' ) {

snippet = `sampler3D ${ uniform.name };`;

} else if ( uniform.type === 'buffer' ) {

const bufferNode = uniform.node;
Expand Down Expand Up @@ -1115,7 +1114,7 @@ ${vars}

${ this.getSignature() }

// extensions
// extensions
${shaderData.extensions}

// precision
Expand Down
Loading