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

Add support for textureLod with sampler2DArrayShadow in GLSL compatibility mode #6009

Merged
Merged
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
19 changes: 19 additions & 0 deletions source/slang/glsl.meta.slang
Original file line number Diff line number Diff line change
Expand Up @@ -2440,6 +2440,25 @@ public float textureLod(sampler2DShadow sampler, vec3 p, float lod)
}
}

[ForceInline]
[require(glsl_hlsl_spirv, texture_shadowlod)]
public float textureLod(sampler2DArrayShadow sampler, vec4 p, float lod)
{
__target_switch
{
case glsl: __intrinsic_asm "textureLod";
case spirv:
{
float compareValue = p.w;
return spirv_asm {
result:$$float = OpImageSampleDrefExplicitLod $sampler $p $compareValue Lod $lod
};
}
default:
return sampler.SampleCmp(p.xyz, p.w);
}
}

[ForceInline]
[require(glsl_hlsl_spirv, texture_shadowlod)]
public float textureLod(sampler1DShadow sampler, vec3 p, float lod)
Expand Down
Loading