r600: fix pa_su_vtx_cntl rounding mode

This is the backport of 9c49550163. This rounding functionality
is available on all the gpus of the r600 family.

This change was tested on rv770, palm and cayman. This change fixes
at least the "turn-on-off" tests on all these gpus and it does not
add any regression. Here are the tests fixed on palm:
spec/ext_framebuffer_multisample/interpolation 6 centroid-edges: fail pass
spec/ext_framebuffer_multisample/interpolation 8 centroid-edges: fail pass
spec/ext_framebuffer_multisample/turn-on-off 2: fail pass
spec/ext_framebuffer_multisample/turn-on-off 4: fail pass
spec/ext_framebuffer_multisample/turn-on-off 6: fail pass
spec/ext_framebuffer_multisample/turn-on-off 8: fail pass

Cc: mesa-stable
Signed-off-by: Patrick Lerda <patrick9876@free.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34403>
This commit is contained in:
Patrick Lerda 2025-04-04 15:05:57 +02:00 committed by Marge Bot
parent 4d17f8d10a
commit 8fc01db1ac
6 changed files with 15 additions and 12 deletions

View file

@ -825,10 +825,6 @@ spec@ext_framebuffer_multisample@no-color 8 depth-computed combined,Fail
spec@ext_framebuffer_multisample@no-color 8 depth-computed single,Fail
spec@ext_framebuffer_multisample@no-color 8 stencil combined,Fail
spec@ext_framebuffer_multisample@no-color 8 stencil single,Fail
spec@ext_framebuffer_multisample@turn-on-off 2,Fail
spec@ext_framebuffer_multisample@turn-on-off 4,Fail
spec@ext_framebuffer_multisample@turn-on-off 6,Fail
spec@ext_framebuffer_multisample@turn-on-off 8,Fail
spec@ext_framebuffer_object@fbo-blending-formats,Fail
spec@ext_framebuffer_object@fbo-blending-formats@3,Fail

View file

@ -1255,14 +1255,6 @@ spec@ext_framebuffer_multisample@accuracy all_samples stencil_resolve small dept
spec@ext_framebuffer_multisample@blit-mismatched-formats,Fail
spec@ext_framebuffer_multisample@interpolation 6 centroid-edges,Fail
spec@ext_framebuffer_multisample@interpolation 8 centroid-edges,Fail
spec@ext_framebuffer_multisample@turn-on-off 2,Fail
spec@ext_framebuffer_multisample@turn-on-off 4,Fail
spec@ext_framebuffer_multisample@turn-on-off 6,Fail
spec@ext_framebuffer_multisample@turn-on-off 8,Fail
spec@ext_framebuffer_object@fbo-blending-formats,Fail
spec@ext_framebuffer_object@fbo-blending-formats@3,Fail
spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB,Fail

View file

@ -555,10 +555,12 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
if (rctx->b.gfx_level == CAYMAN) {
r600_store_context_reg(&rs->buffer, CM_R_028BE4_PA_SU_VTX_CNTL,
S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_ROUND_MODE(V_028C08_X_ROUND_TO_EVEN) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
} else {
r600_store_context_reg(&rs->buffer, R_028C08_PA_SU_VTX_CNTL,
S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_ROUND_MODE(V_028C08_X_ROUND_TO_EVEN) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
}

View file

@ -2402,6 +2402,12 @@
#define S_028C08_PIX_CENTER_HALF(x) (((unsigned)(x) & 0x1) << 0)
#define G_028C08_PIX_CENTER_HALF(x) (((x) >> 0) & 0x1)
#define C_028C08_PIX_CENTER_HALF 0xFFFFFFFE
#define S_028C08_ROUND_MODE(x) (((unsigned)(x) & 0x03) << 1)
#define G_028C08_ROUND_MODE(x) (((x) >> 1) & 0x03)
#define V_028C08_X_TRUNCATE 0x00
#define V_028C08_X_ROUND 0x01
#define V_028C08_X_ROUND_TO_EVEN 0x02
#define V_028C08_X_ROUND_TO_ODD 0x03
#define S_028C08_QUANT_MODE(x) (((unsigned)(x) & 0x7) << 3)
#define G_028C08_QUANT_MODE(x) (((x) >> 3) & 0x7)
#define C_028C08_QUANT_MODE 0xFFFFFFC7

View file

@ -539,6 +539,7 @@ static void *r600_create_rs_state(struct pipe_context *ctx,
r600_store_context_reg(&rs->buffer, R_028A4C_PA_SC_MODE_CNTL, sc_mode_cntl);
r600_store_context_reg(&rs->buffer, R_028C08_PA_SU_VTX_CNTL,
S_028C08_PIX_CENTER_HALF(state->half_pixel_center) |
S_028C08_ROUND_MODE(V_028C08_X_ROUND_TO_EVEN) |
S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
r600_store_context_reg(&rs->buffer, R_028DFC_PA_SU_POLY_OFFSET_CLAMP, fui(state->offset_clamp));

View file

@ -2279,6 +2279,12 @@
#define S_028C08_PIX_CENTER_HALF(x) (((unsigned)(x) & 0x1) << 0)
#define G_028C08_PIX_CENTER_HALF(x) (((x) >> 0) & 0x1)
#define C_028C08_PIX_CENTER_HALF 0xFFFFFFFE
#define S_028C08_ROUND_MODE(x) (((unsigned)(x) & 0x03) << 1)
#define G_028C08_ROUND_MODE(x) (((x) >> 1) & 0x03)
#define V_028C08_X_TRUNCATE 0x00
#define V_028C08_X_ROUND 0x01
#define V_028C08_X_ROUND_TO_EVEN 0x02
#define V_028C08_X_ROUND_TO_ODD 0x03
#define S_028C08_QUANT_MODE(x) (((unsigned)(x) & 0x7) << 3)
#define G_028C08_QUANT_MODE(x) (((x) >> 3) & 0x7)
#define C_028C08_QUANT_MODE 0xFFFFFFC7