Whether the first return value of opimagequerylod add baselevel when baselevel !=0

As the vulkan spec said,

  • 16.10.2. Lod Query
    OpImageQueryLod returns the Lod parameters that would be used in an image operation with the given image and coordinates. The steps described in this chapter are performed as if for OpImageSampleImplicitLod, up to Scale Factor Operation, Level-of-Detail Operation and Image Level(s) Selection. The return value is the vector (λ’, dl). These values may be subject to implementation-specific maxima and minima for very large, out-of-range values.

and


The dl is not relative to base level as the spec said.
but i test on nvidia and amd gpu, the return value is relative to baselevel ,which means that it won’t be added by baselevel. For example: If the calculated lod is 0.4 relative to baselevel and baselevel equals 2 and mipmapfilter is nearest, the op should return(2,0.4) according to the vulkan spec. But on gpu, i got a (0,0.4) as return value.
Is it a spec bug?

1 Like

It is a vulkan spec bug. It will be corrected.

1 Like

What is the correct behavior then?

The correct behaviour is same as texturequerylod in opengl. Two values are relative to base level. registry.khronos.org/OpenGL/extensions/EXT/EXT_texture_query_lod.txt
The result is from this issue. whether the first return value of opimagequerylod add baselevel when baselevel !=0? · Issue #2383 · KhronosGroup/Vulkan-Docs (github.com)