r300: Z16 polygon offset fixes

The way I understand the HW docs is that the polygon offset is applied
always in 24bit depth domain (there are no polygon offset depth format
control registers like r600 has), so we need to manually rescale for
16bit buffers.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/39196>
This commit is contained in:
Pavel Ondračka 2026-01-02 16:44:52 +01:00
parent 399c0d22f3
commit 83d636fc74
5 changed files with 3 additions and 10 deletions

View file

@ -41,7 +41,6 @@ dEQP-GLES2.functional.fragment_ops.random.63,Fail
dEQP-GLES2.functional.fragment_ops.random.66,Fail dEQP-GLES2.functional.fragment_ops.random.66,Fail
dEQP-GLES2.functional.fragment_ops.random.81,Fail dEQP-GLES2.functional.fragment_ops.random.81,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.rasterization.primitives.line_loop_wide,Fail dEQP-GLES2.functional.rasterization.primitives.line_loop_wide,Fail
dEQP-GLES2.functional.rasterization.primitives.line_strip_wide,Fail dEQP-GLES2.functional.rasterization.primitives.line_strip_wide,Fail
dEQP-GLES2.functional.rasterization.primitives.points,Fail dEQP-GLES2.functional.rasterization.primitives.points,Fail
@ -485,7 +484,6 @@ KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_linear,Fail
KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail
# New failures with ES CTS 3.2.12.0 # New failures with ES CTS 3.2.12.0
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail
dEQP-GLES2.functional.uniform_api.info_query.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.info_query.nested_structs_arrays.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.get_uniform.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.get_uniform.nested_structs_arrays.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_both,Fail

View file

@ -1,7 +1,5 @@
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail
dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail
dEQP-GLES2.functional.shaders.conversions.vector_combine.vec2_bool_to_ivec3_fragment,Fail dEQP-GLES2.functional.shaders.conversions.vector_combine.vec2_bool_to_ivec3_fragment,Fail
dEQP-GLES2.functional.shaders.conversions.vector_combine.vec2_bvec2_to_ivec4_fragment,Fail dEQP-GLES2.functional.shaders.conversions.vector_combine.vec2_bvec2_to_ivec4_fragment,Fail

View file

@ -29,7 +29,6 @@ dEQP-GLES2.functional.fragment_ops.random.66,Fail
dEQP-GLES2.functional.fragment_ops.random.81,Fail dEQP-GLES2.functional.fragment_ops.random.81,Fail
dEQP-GLES2.functional.fragment_ops.random.77,Fail dEQP-GLES2.functional.fragment_ops.random.77,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.rasterization.primitives.line_loop_wide,Fail dEQP-GLES2.functional.rasterization.primitives.line_loop_wide,Fail
dEQP-GLES2.functional.rasterization.primitives.line_strip_wide,Fail dEQP-GLES2.functional.rasterization.primitives.line_strip_wide,Fail
dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail dEQP-GLES2.functional.shaders.builtin_variable.frontfacing,Fail
@ -474,7 +473,6 @@ KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_linear,Fail
KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail KHR-GLES2.texture_3d.filtering.sizes.63x63x63_nearest_mipmap_nearest,Fail
# New failures with ES CTS 3.2.12.0 # New failures with ES CTS 3.2.12.0
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail
dEQP-GLES2.functional.uniform_api.info_query.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.info_query.nested_structs_arrays.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.get_uniform.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.get_uniform.nested_structs_arrays.mat4_mat2_both,Fail
dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_both,Fail dEQP-GLES2.functional.uniform_api.value.assigned.by_pointer.render.nested_structs_arrays.mat4_mat2_both,Fail

View file

@ -2,8 +2,6 @@
dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail dEQP-GLES2.functional.fbo.completeness.renderable.texture.color0.rgb_half_float_oes,Fail
dEQP-GLES2.functional.polygon_offset.default_factor_1_slope,Fail dEQP-GLES2.functional.polygon_offset.default_factor_1_slope,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_displacement_with_units,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units,Fail
dEQP-GLES2.functional.polygon_offset.fixed16_factor_1_slope,Fail dEQP-GLES2.functional.polygon_offset.fixed16_factor_1_slope,Fail
dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.mixed_break_continue_fragment,Fail dEQP-GLES2.functional.shaders.loops.do_while_dynamic_iterations.mixed_break_continue_fragment,Fail

View file

@ -1503,8 +1503,8 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
/* Build the two command buffers for polygon offset setup. */ /* Build the two command buffers for polygon offset setup. */
if (polygon_offset_enable) { if (polygon_offset_enable) {
float scale = state->offset_scale * 12; float scale = state->offset_scale * 256 * 12;
float offset = state->offset_units * 4; float offset = state->offset_units * 256 * 2;
BEGIN_CB(rs->cb_poly_offset_zb16, 5); BEGIN_CB(rs->cb_poly_offset_zb16, 5);
OUT_CB_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 4); OUT_CB_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 4);
@ -1515,6 +1515,7 @@ static void* r300_create_rs_state(struct pipe_context* pipe,
END_CB; END_CB;
offset = state->offset_units * 2; offset = state->offset_units * 2;
scale = state->offset_scale * 12;
BEGIN_CB(rs->cb_poly_offset_zb24, 5); BEGIN_CB(rs->cb_poly_offset_zb24, 5);
OUT_CB_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 4); OUT_CB_REG_SEQ(R300_SU_POLY_OFFSET_FRONT_SCALE, 4);