Merge pull request #1942 from KhronosGroup/no-fetch-grad-workaround

GLSL: Don't apply Grad LOD workarounds for fetch.
This commit is contained in:
Hans-Kristian Arntzen 2022-05-13 16:35:19 +02:00 committed by GitHub
commit d0c8dc3045
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -7101,7 +7101,7 @@ string CompilerGLSL::to_function_name(const TextureFunctionNameArguments &args)
// This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube.
bool workaround_lod_array_shadow_as_grad = false;
if (((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) &&
is_depth_image(imgtype, tex) && args.lod)
is_depth_image(imgtype, tex) && args.lod && !args.base.is_fetch)
{
if (!expression_is_constant_null(args.lod))
{
@ -7245,7 +7245,7 @@ string CompilerGLSL::to_function_args(const TextureFunctionArguments &args, bool
// This happens for HLSL SampleCmpLevelZero on Texture2DArray and TextureCube.
bool workaround_lod_array_shadow_as_grad =
((imgtype.image.arrayed && imgtype.image.dim == Dim2D) || imgtype.image.dim == DimCube) &&
is_depth_image(imgtype, img) && args.lod != 0;
is_depth_image(imgtype, img) && args.lod != 0 && !args.base.is_fetch;
if (args.dref)
{