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

textureQueryLOD was not supported at #extension ARB_texture_query_lod. #2713

Closed
ZhiqianXia opened this issue Jul 29, 2021 · 2 comments
Closed

Comments

@ZhiqianXia
Copy link
Contributor

ZhiqianXia commented Jul 29, 2021

textureQueryLOD function was supported at ARB_texture_query_lod , and textureQueryLod is was supported at the core specification. But the glslang didn't Support the textureQueryLOD functions. By the way, The ARB_texture_query_lod extension had merged into glslang. #2194

https://www.khronos.org/registry/OpenGL/extensions/ARB/ARB_texture_query_lod.txt says:

The "Lod" spelling is the correct spelling for the core specification and the preferred spelling for use. However, use of
"LOD" also exists, as the extension predated the core specification, so this extension won't remove use of "LOD".

shader

#version 150

#ifdef GL_ARB_texture_query_lod
#extension GL_ARB_texture_query_lod : enable
#endif
#ifdef GL_ARB_gpu_shader5
#extension GL_ARB_gpu_shader5 : enable
#endif

#ifdef GL_ES
precision highp float;
#endif

in vec2 vUV; // vert->frag
out vec4 color; // frag->fb
#define UV vUV

#define bias 1.5
#define TEX 128.0
#define offset ivec2(1,1)
uniform highp sampler2DShadow sampler;
uniform int funct;

void main (void)
{
    switch (funct)
    {
    case 0:
        ivec2 iv2 = textureSize(sampler, 0);
#ifdef GL_ARB_texture_query_lod
        vec2 fv2 = textureQueryLOD(sampler, vec2(0.0, 0.0));
#endif
		color = vec4(iv2,fv2);
        break;
    default:
        color = vec4(1.0, 1.0, 1.0, 1.0);
        break;
    }
}
@ZhiqianXia
Copy link
Contributor Author

@greg-lunarg kindly review the PR.

@greg-lunarg
Copy link
Contributor

Fixed by #2723

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

2 participants