panfrost: Multiply offset_units by 2
authorTomeu Vizoso <tomeu.vizoso@collabora.com>
Wed, 13 Nov 2019 07:42:34 +0000 (08:42 +0100)
committerTomeu Vizoso <tomeu.vizoso@collabora.com>
Fri, 15 Nov 2019 13:45:29 +0000 (14:45 +0100)
Per the spec, the units passed to glPolygonOffset are to be multiplied
by an implementation-defined constant.

On Midgard, this constant seems to be 2.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
.gitlab-ci/deqp-panfrost-t760-fails.txt
.gitlab-ci/deqp-panfrost-t860-fails.txt
src/gallium/drivers/panfrost/pan_context.c

index efade45201a5d98a33860f0ce1e02b60e0414cda..9b2ba77a800cd0e5be10adabb0741c32b6185126 100644 (file)
@@ -26,7 +26,5 @@ dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb565_depth_component16
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgba_depth_component16 Fail
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgb_depth_component16 Fail
 dEQP-GLES2.functional.fragment_ops.interaction.basic_shader.6  Fail
-dEQP-GLES2.functional.polygon_offset.default_render_with_units Fail
-dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units Fail
 dEQP-GLES2.functional.shaders.scoping.valid.local_variable_hides_function_parameter_fragment Fail
 dEQP-GLES2.functional.shaders.scoping.valid.local_variable_hides_function_parameter_vertex Fail
index a0cddcc8c86b10bac7a25d09d88d36c5e1f62ddd..cf49e8e73f0f66b6b5ea4e021bf8fc3959968578 100644 (file)
@@ -25,7 +25,5 @@ dEQP-GLES2.functional.fbo.render.shared_colorbuffer.tex2d_rgb_depth_component16
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.rbo_rgb565_depth_component16 Fail
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgba_depth_component16 Fail
 dEQP-GLES2.functional.fbo.render.shared_depthbuffer.tex2d_rgb_depth_component16 Fail
-dEQP-GLES2.functional.polygon_offset.default_render_with_units Fail
-dEQP-GLES2.functional.polygon_offset.fixed16_render_with_units Fail
 dEQP-GLES2.functional.shaders.scoping.valid.local_variable_hides_function_parameter_fragment Fail
 dEQP-GLES2.functional.shaders.scoping.valid.local_variable_hides_function_parameter_vertex Fail
index dba2517c92a05ef12b7af84fb9cde5a793c3abf2..556909613cb11ca9c9bc3c981205cf7b5c05eb90 100644 (file)
@@ -1706,7 +1706,7 @@ panfrost_bind_rasterizer_state(
         ctx->rasterizer = hwcso;
         ctx->dirty |= PAN_DIRTY_RASTERIZER;
 
-        ctx->fragment_shader_core.depth_units = ctx->rasterizer->base.offset_units;
+        ctx->fragment_shader_core.depth_units = ctx->rasterizer->base.offset_units * 2.0f;
         ctx->fragment_shader_core.depth_factor = ctx->rasterizer->base.offset_scale;
 
         /* Gauranteed with the core GL call, so don't expose ARB_polygon_offset */