Skip to content

r600/sfn: Remove sampler_index usage in emit_tex_txs and emit_tex_lod

emit_tex_txs calculates the resource — not sampler — ID from sampler_index currently rather than texture_index. While they're equal in OpenGL, they may differ in Vulkan and Direct3D 10, and the sampler ID is not needed for texture/buffer size queries in them. The documentation in nir.h also specifies that sampler_index should be ignored for txs as it doesn't require one.

In emit_tex_lod, it's used only to construct an unused variable.

On a semi-related note, the GET_BUFFER_RESINFO wrapper, QueryBufferSizeInstr, currently doesn't accept a dynamic offset for the resource index unlike FetchInstr even though both use the vertex fetch instruction format. The Cayman ISA documentation lists BIM in the microcode bit table for GET_BUFFER_RESINFO, the Evergreen ISA documentation though has the BIM bits in "Reserved" for both GET_BUFFER_RESINFO and FETCH, but that's probably an oversight since SFN appears to support BIM for FETCH on Evergreen (though not sure if that's tested at all, but GL_ARB_gpu_shader5 (OpenGL 4.0) and GL_EXT_gpu_shader5 (OpenGL ES 3.2) require dynamic indexing support). Does dynamic indexing actually work for GET_BUFFER_RESINFO on the hardware, and can it thus be exposed by QueryBufferSizeInstr?

Edited by Triang3l (Vitaliy Kuzmin)

Merge request reports