Skip to content

Commit

Permalink
Add support for textureLod with sampler2DArrayShadow (#6009)
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusikkala authored Jan 6, 2025
1 parent 22dab44 commit bc76c6e
Showing 1 changed file with 19 additions and 0 deletions.
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

0 comments on commit bc76c6e

Please sign in to comment.