Commit 19c6e591 by Rex Xu

Fix an issue related with texelFetchOffset

parent 86e60813
...@@ -41,6 +41,7 @@ void main() ...@@ -41,6 +41,7 @@ void main()
v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D);
v += texelFetch(s3D, ic3D, ic1D); v += texelFetch(s3D, ic3D, ic1D);
v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); v += texelFetchOffset(s2D, ic2D, 4, ivec2(3));
v += texelFetchOffset(sr, ic2D, ivec2(4));
v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3));
v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3));
v += textureGrad(sCube, c3D, c3D, c3D); v += textureGrad(sCube, c3D, c3D, c3D);
...@@ -62,7 +63,6 @@ void main() ...@@ -62,7 +63,6 @@ void main()
v += vec4(iv); v += vec4(iv);
iv = texelFetch(is2DArray, ic3D, ic1D); iv = texelFetch(is2DArray, ic3D, ic1D);
v += vec4(iv); v += vec4(iv);
iv += texelFetch(is2Dms, ic2D, ic1D); iv += texelFetch(is2Dms, ic2D, ic1D);
v += vec4(iv); v += vec4(iv);
v += texelFetch(sb, ic1D); v += texelFetch(sb, ic1D);
......
#version 430 #version 430
uniform sampler2D s2D; uniform sampler2D s2D;
uniform sampler2DRect sr;
uniform sampler3D s3D; uniform sampler3D s3D;
uniform samplerCube sCube; uniform samplerCube sCube;
uniform samplerCubeShadow sCubeShadow; uniform samplerCubeShadow sCubeShadow;
...@@ -39,6 +40,7 @@ void main() ...@@ -39,6 +40,7 @@ void main()
v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D); v.y += textureOffset(s2DShadow, c3D, ivec2(3), c1D);
v += texelFetch(s3D, ic3D, ic1D); v += texelFetch(s3D, ic3D, ic1D);
v += texelFetchOffset(s2D, ic2D, 4, ivec2(3)); v += texelFetchOffset(s2D, ic2D, 4, ivec2(3));
v += texelFetchOffset(sr, ic2D, ivec2(4));
v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3)); v.y += textureLodOffset(s2DShadow, c3D, c1D, ivec2(3));
v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3)); v += textureProjLodOffset(s2D, c3D, c1D, ivec2(3));
v += textureGrad(sCube, c3D, c3D, c3D); v += textureGrad(sCube, c3D, c3D, c3D);
......
...@@ -1431,7 +1431,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan ...@@ -1431,7 +1431,7 @@ void TParseContext::builtInOpCheck(const TSourceLoc& loc, const TFunction& fnCan
int arg = -1; int arg = -1;
switch (callNode.getOp()) { switch (callNode.getOp()) {
case EOpTextureOffset: arg = 2; break; case EOpTextureOffset: arg = 2; break;
case EOpTextureFetchOffset: arg = 3; break; case EOpTextureFetchOffset: arg = (arg0->getType().getSampler().dim != EsdRect) ? 3 : 2; break;
case EOpTextureProjOffset: arg = 2; break; case EOpTextureProjOffset: arg = 2; break;
case EOpTextureLodOffset: arg = 3; break; case EOpTextureLodOffset: arg = 3; break;
case EOpTextureProjLodOffset: arg = 3; break; case EOpTextureProjLodOffset: arg = 3; break;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment