nir: Add lowering for fround_even on r300.
When we put NIR in the compiler stack for r300, indirect addressing broke for gallium nine. DX's array indirects round the float value, so the DX shader gets mapped to a TGSI "ARR ADDR[0] src.x" instruction. Translating that to NIR maps to r0[f2i32(fround(src.x))]. While we might hope that in translation back using nir-to-tgsi after optimization we would recognize the construct and emit ARR again, that's going to be error prone (think "what if src.x is in a NIR register?") so we need a fallback plan. r300 will be able to handle this lowering, so get it in place first to fix the regression. Fixes: #6297 Fixes: 7d2ea9b0 ("r300: Request NIR shaders from mesa/st and use NIR-to-TGSI.") Reviewed-by:Marek Olšák <marek.olsak@amd.com> Part-of: <mesa/mesa!15870> (cherry picked from commit 6947016b)
Showing
- .pick_status.json 1 addition, 1 deletion.pick_status.json
- src/compiler/nir/nir.h 8 additions, 0 deletionssrc/compiler/nir/nir.h
- src/compiler/nir/nir_opt_algebraic.py 8 additions, 0 deletionssrc/compiler/nir/nir_opt_algebraic.py
- src/gallium/drivers/r300/r300_screen.c 4 additions, 0 deletionssrc/gallium/drivers/r300/r300_screen.c
Loading
Please register or sign in to comment