diff options
author | Charmaine Lee <[email protected]> | 2017-04-04 12:47:49 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-04-07 13:46:43 -0600 |
commit | b4c4ee076244d0518af98e0beca1c12942c4bc36 (patch) | |
tree | a0327146039bbd592ab502ce6291be85e82a9f98 /src/gallium/drivers/svga/svga_context.h | |
parent | fed72ff6cb85fa6044335cfc41d8492458f53750 (diff) |
svga: disable rasterization if rasterizer_discard is set or FS undefined
With this patch, rasterization will be disabled if the
rasterizer_discard flag is set or the fragment shader
is undefined due to missing position output from the
vertex/geometry shader.
Tested with piglit test glsl-1.50-geometry-primitive-id-restart.
Also tested with full MTT glretrace and piglit.
v2: As suggested by Roland, to properly disable rasterization, besides
setting FS to NULL, we will also need to disable depth and stencil test.
v3: As suggested by Brian, set SVGA_NEW_DEPTH_STENCIL_ALPHA dirty bit
in svga_bind_rasterizer_state() if the rasterizer_discard flag is
changed.
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/gallium/drivers/svga/svga_context.h')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.h b/src/gallium/drivers/svga/svga_context.h index 40966e9b52e..2b95a787870 100644 --- a/src/gallium/drivers/svga/svga_context.h +++ b/src/gallium/drivers/svga/svga_context.h @@ -399,6 +399,8 @@ struct svga_hw_draw_state /* used for rebinding */ unsigned default_constbuf_size[PIPE_SHADER_TYPES]; + + boolean rasterizer_discard; /* set if rasterization is disabled */ }; @@ -583,6 +585,9 @@ struct svga_context /** Alternate rasterizer states created for point sprite */ struct svga_rasterizer_state *rasterizer_no_cull[2]; + /** Depth stencil state created to disable depth stencil test */ + struct svga_depth_stencil_state *depthstencil_disable; + /** Current conditional rendering predicate */ struct { SVGA3dQueryId query_id; @@ -590,6 +595,7 @@ struct svga_context } pred; boolean render_condition; + boolean disable_rasterizer; /* Set if to disable rasterization */ }; /* A flag for each state_tracker state object: |