mirror of
https://github.com/RPCS3/glslang.git
synced 2025-02-14 15:50:26 +00:00
Skip dummy unused second component for 1D non-array shadows.
git-svn-id: https://cvs.khronos.org/svn/repos/ogl/trunk/ecosystem/public/sdk/tools/glslang@20704 e7fa87d3-cd2b-0410-9028-fcbf551c1848
This commit is contained in:
parent
b3338b307f
commit
df807514b6
@ -28,32 +28,31 @@ in ivec2 ic2D;
|
|||||||
in ivec3 ic3D;
|
in ivec3 ic3D;
|
||||||
in ivec4 ic4D;
|
in ivec4 ic4D;
|
||||||
|
|
||||||
out vec4 FragData;
|
|
||||||
|
|
||||||
void main()
|
void main()
|
||||||
{
|
{
|
||||||
vec4 v = texture(s2D, c2D);
|
float f;
|
||||||
v += textureProj(s3D, c4D);
|
vec4 v;
|
||||||
v += textureLod(s2DArray, c3D, 1.2);
|
v = texture(s2D, c2D);
|
||||||
v.y += textureOffset(s2DShadow, c3D, ic2D, c1D);
|
v = textureProj(s3D, c4D);
|
||||||
v += texelFetch(s3D, ic3D, ic1D);
|
v = textureLod(s2DArray, c3D, 1.2);
|
||||||
v += texelFetchOffset(s2D, ic2D, 4, ic2D);
|
f = textureOffset(s2DShadow, c3D, ic2D, c1D);
|
||||||
v.y += textureLodOffset(s2DShadow, c3D, c1D, ic2D);
|
v = texelFetch(s3D, ic3D, ic1D);
|
||||||
v += textureProjLodOffset(s2D, c3D, c1D, ic2D);
|
v = texelFetchOffset(s2D, ic2D, 4, ic2D);
|
||||||
v += textureGrad(sCube, c3D, c3D, c3D);
|
f = textureLodOffset(s2DShadow, c3D, c1D, ic2D);
|
||||||
v.x += textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
|
v = textureProjLodOffset(s2D, c3D, c1D, ic2D);
|
||||||
v += textureProjGrad(s3D, c4D, c3D, c3D);
|
v = textureGrad(sCube, c3D, c3D, c3D);
|
||||||
v += textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
|
f = textureGradOffset(s2DArrayShadow, c4D, c2D, c2D, ic2D);
|
||||||
|
v = textureProjGrad(s3D, c4D, c3D, c3D);
|
||||||
|
v = textureProjGradOffset(s2D, c3D, c2D, c2D, ic2D);
|
||||||
|
|
||||||
ivec4 iv = texture(is2D, c2D);
|
ivec4 iv;
|
||||||
iv += textureProjOffset(is2D, c4D, ic2D);
|
iv = texture(is2D, c2D);
|
||||||
iv += textureProjLod(is2D, c3D, c1D);
|
iv = textureProjOffset(is2D, c4D, ic2D);
|
||||||
iv += textureProjGrad(is2D, c3D, c2D, c2D);
|
iv = textureProjLod(is2D, c3D, c1D);
|
||||||
iv += texture(is3D, c3D, 4.2);
|
iv = textureProjGrad(is2D, c3D, c2D, c2D);
|
||||||
iv += textureLod(isCube, c3D, c1D);
|
iv = texture(is3D, c3D, 4.2);
|
||||||
iv += texelFetch(is2DArray, ic3D, ic1D);
|
iv = textureLod(isCube, c3D, c1D);
|
||||||
|
iv = texelFetch(is2DArray, ic3D, ic1D);
|
||||||
|
|
||||||
iv.xy += textureSize(sCubeShadow, 2);
|
iv.xy = textureSize(sCubeShadow, 2);
|
||||||
|
|
||||||
FragData = v + vec4(iv);
|
|
||||||
}
|
}
|
||||||
|
@ -986,7 +986,11 @@ void TBuiltIns::addSamplingFunctions(TSampler sampler, TString& typeName, int ve
|
|||||||
|
|
||||||
for (int extraProj = 0; extraProj <= 1; ++extraProj) {
|
for (int extraProj = 0; extraProj <= 1; ++extraProj) {
|
||||||
bool compare = false;
|
bool compare = false;
|
||||||
int totalDims = dimMap[sampler.dim] + proj + (sampler.arrayed ? 1 : 0) + (sampler.shadow ? 1 : 0);
|
int totalDims = dimMap[sampler.dim] + (sampler.arrayed ? 1 : 0);
|
||||||
|
// skip dummy unused second component for 1D non-array shadows
|
||||||
|
if (sampler.shadow && totalDims < 2)
|
||||||
|
totalDims = 2;
|
||||||
|
totalDims += (sampler.shadow ? 1 : 0) + proj;
|
||||||
if (totalDims > 4 && sampler.shadow) {
|
if (totalDims > 4 && sampler.shadow) {
|
||||||
compare = true;
|
compare = true;
|
||||||
totalDims = 4;
|
totalDims = 4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user