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.c | |
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.c')
-rw-r--r-- | src/gallium/drivers/svga/svga_context.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/drivers/svga/svga_context.c b/src/gallium/drivers/svga/svga_context.c index ec86073ccc9..04466fb7dee 100644 --- a/src/gallium/drivers/svga/svga_context.c +++ b/src/gallium/drivers/svga/svga_context.c @@ -67,6 +67,11 @@ svga_destroy(struct pipe_context *pipe) } } + /* free depthstencil_disable state */ + if (svga->depthstencil_disable) { + pipe->delete_depth_stencil_alpha_state(pipe, svga->depthstencil_disable); + } + /* free HW constant buffers */ for (shader = 0; shader < ARRAY_SIZE(svga->state.hw_draw.constbuf); shader++) { pipe_resource_reference(&svga->state.hw_draw.constbuf[shader], NULL); @@ -248,6 +253,7 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags) svga->state.hw_draw.num_views = 0; svga->state.hw_draw.num_rendertargets = 0; svga->state.hw_draw.dsv = NULL; + svga->state.hw_draw.rasterizer_discard = FALSE; /* Initialize the shader pointers */ svga->state.hw_draw.vs = NULL; @@ -289,6 +295,7 @@ svga_context_create(struct pipe_screen *screen, void *priv, unsigned flags) svga->dirty = ~0; svga->pred.query_id = SVGA3D_INVALID_ID; + svga->disable_rasterizer = FALSE; return &svga->pipe; |