Commit 5cc9ac85 by Gregoire Payen de La Garanderie Committed by Jamie Madill

Fix shadow samplers with textureProj and vertex shaders.

Fixes: dEQP-GLES3.functional.shaders.texture_functions.textureproj.sampler2dshadow_fragment dEQP-GLES3.functional.shaders.texture_functions.textureproj.sampler2dshadow_bias_fragment dEQP-GLES3.functional.shaders.texture_functions.textureprojoffset.sampler2dshadow_fragment dEQP-GLES3.functional.shaders.texture_functions.textureprojoffset.sampler2dshadow_bias_fragment and some of: dEQP-GLES3.functional.shaders.texture_functions.texture*.sampler2dshadow_vertex BUG=angle:925 Change-Id: I080e379ded95469f0486ae9c8bb1756842118a2d Reviewed-on: https://chromium-review.googlesource.com/251530Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Reviewed-by: 's avatarNicolas Capens <capn@chromium.org> Tested-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 36c79011
...@@ -1014,7 +1014,15 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat ...@@ -1014,7 +1014,15 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat
} }
else if (IsShadowSampler(textureFunction->sampler)) else if (IsShadowSampler(textureFunction->sampler))
{ {
out << "x.SampleCmp(s, "; switch(textureFunction->method)
{
case TextureFunction::IMPLICIT: out << "x.SampleCmp(s, "; break;
case TextureFunction::BIAS: out << "x.SampleCmp(s, "; break;
case TextureFunction::LOD: out << "x.SampleCmp(s, "; break;
case TextureFunction::LOD0: out << "x.SampleCmpLevelZero(s, "; break;
case TextureFunction::LOD0BIAS: out << "x.SampleCmpLevelZero(s, "; break;
default: UNREACHABLE();
}
} }
else else
{ {
...@@ -1145,11 +1153,20 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat ...@@ -1145,11 +1153,20 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat
else if (IsShadowSampler(textureFunction->sampler)) else if (IsShadowSampler(textureFunction->sampler))
{ {
// Compare value // Compare value
switch(textureFunction->coords) if (textureFunction->proj)
{ {
case 3: out << "), t.z"; break; // According to ESSL 3.00.4 sec 8.8 p95 on textureProj:
case 4: out << "), t.w"; break; // The resulting third component of P' in the shadow forms is used as Dref
default: UNREACHABLE(); out << "), t.z" << proj;
}
else
{
switch(textureFunction->coords)
{
case 3: out << "), t.z"; break;
case 4: out << "), t.w"; break;
default: UNREACHABLE();
}
} }
} }
else else
...@@ -1165,11 +1182,20 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat ...@@ -1165,11 +1182,20 @@ void OutputHLSL::header(const BuiltInFunctionEmulatorHLSL *builtInFunctionEmulat
else if (IsShadowSampler(textureFunction->sampler)) else if (IsShadowSampler(textureFunction->sampler))
{ {
// Compare value // Compare value
switch(textureFunction->coords) if (textureFunction->proj)
{ {
case 3: out << "), t.z"; break; // According to ESSL 3.00.4 sec 8.8 p95 on textureProj:
case 4: out << "), t.w"; break; // The resulting third component of P' in the shadow forms is used as Dref
default: UNREACHABLE(); out << "), t.z" << proj;
}
else
{
switch(textureFunction->coords)
{
case 3: out << "), t.z"; break;
case 4: out << "), t.w"; break;
default: UNREACHABLE();
}
} }
} }
else else
......
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