Hello, TXS is needed to support the OpenGL textureSize() function but not only. TXS instructions are also used by nir_lower_tex() to lower a RECT texture sampling into a 2D one, which I wanted to have working to test gallium-hud on panfrost.
Note that I decided to add a new generic lowering step to nir_lower_tex() to lower a TXS(LOD) instruction into max(1, TXS(0) >> LOD), which is what V3D is doing internally and would be duplicated in the panfrost driver if we go for a non-generic approach (see patch 2 for more details). Let me know if you think that's preferable to have this logic moved to the panfrost driver. Regards, Boris Changes in v2: * Drop the patch adding nir_imm_ivec3() * Rework the emit_tex() logic to avoid duplicate the switch(texop) statement * Split options for the first and second tex lowering passes Boris Brezillon (5): nir/lower_tex: Add a way to lower TXS(non-0-LOD) instructions panfrost: Make the sysval logic more generic panfrost: Move sysval upload logic out of panfrost_emit_for_draw() panfrost: Prepare things to support non-native texture ops panfrost: Add support for TXS instructions src/compiler/nir/nir.h | 6 + src/compiler/nir/nir_lower_tex.c | 46 +++++++ .../panfrost/midgard/midgard_compile.c | 125 ++++++++++++------ .../panfrost/midgard/midgard_compile.h | 12 +- src/gallium/drivers/panfrost/pan_context.c | 96 +++++++++++--- 5 files changed, 226 insertions(+), 59 deletions(-) -- 2.20.1 _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
