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

Implement GL_EXT_texture_shadow_lod #1269

Closed
Ralith opened this issue Sep 25, 2022 · 2 comments
Closed

Implement GL_EXT_texture_shadow_lod #1269

Ralith opened this issue Sep 25, 2022 · 2 comments

Comments

@Ralith
Copy link

Ralith commented Sep 25, 2022

GL_EXT_texture_shadow_lod provides various missing overloads for sampling sampler2DArrayShadows. Their absence in GLSL is baffling and an awkward constraint in e.g. cascading shadow map implementations.

In theory you can work around this with textureGrad, but this seems to have significantly worse performance than technically-UB use of texture on my 970, accounting for more than 1ms of frametime.

@Ralith
Copy link
Author

Ralith commented Oct 2, 2022

I've successfully worked around this (and recovered expected performance) with the following:

spirv_instruction(id = 90) float imageSampleDrefExplicitLod1(sampler2DArrayShadow t, vec3 P, float dref, spirv_literal uint ops, float arg);
float textureLod(sampler2DArrayShadow t, vec4 p, float lod) {
    return imageSampleDrefExplicitLod1(t, p.xyz, p.w, 0x2, lod);
}

@Ralith
Copy link
Author

Ralith commented Oct 1, 2023

Looks like this was fixed by KhronosGroup/glslang@ffefbcd, which was brought in with #1372.

@Ralith Ralith closed this as completed Oct 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant