[Mesa-dev,PATCHv2,11/14] i965/gen7: Enable fragment shader dispatch if the program has image uniforms.

Submitted by Francisco Jerez on Feb. 9, 2015, 7:11 p.m.

Details

Message ID 1423509078-26383-1-git-send-email-currojerez@riseup.net
State New
Headers show

Not browsing as part of any series.

Commit Message

Francisco Jerez Feb. 9, 2015, 7:11 p.m.
Shaders with image uniforms may have side effects.  Make sure that
fragment shader threads are dispatched if the shader has any image
uniforms.

v2: Use brw_stage_state::nr_image_params to find out if the shader has
    image uniforms instead of checking core mesa data structures (Ken).
---
 src/mesa/drivers/dri/i965/gen7_wm_state.c | 1 +
 1 file changed, 1 insertion(+)

Patch hide | download patch | download mbox

diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c
index 923414e..e426b30 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
@@ -78,6 +78,7 @@  upload_wm_state(struct brw_context *brw)
 
    /* _NEW_BUFFERS | _NEW_COLOR */
    if (brw_color_buffer_write_enabled(brw) || writes_depth ||
+       brw->wm.base.nr_image_params ||
        dw1 & GEN7_WM_KILL_ENABLE) {
       dw1 |= GEN7_WM_DISPATCH_ENABLE;
    }

Comments

On Monday, February 09, 2015 09:11:18 PM Francisco Jerez wrote:
> Shaders with image uniforms may have side effects.  Make sure that
> fragment shader threads are dispatched if the shader has any image
> uniforms.
> 
> v2: Use brw_stage_state::nr_image_params to find out if the shader has
>     image uniforms instead of checking core mesa data structures (Ken).
> ---
>  src/mesa/drivers/dri/i965/gen7_wm_state.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/src/mesa/drivers/dri/i965/gen7_wm_state.c b/src/mesa/drivers/dri/i965/gen7_wm_state.c
> index 923414e..e426b30 100644
> --- a/src/mesa/drivers/dri/i965/gen7_wm_state.c
> +++ b/src/mesa/drivers/dri/i965/gen7_wm_state.c
> @@ -78,6 +78,7 @@ upload_wm_state(struct brw_context *brw)
>  
>     /* _NEW_BUFFERS | _NEW_COLOR */
>     if (brw_color_buffer_write_enabled(brw) || writes_depth ||
> +       brw->wm.base.nr_image_params ||
>         dw1 & GEN7_WM_KILL_ENABLE) {
>        dw1 |= GEN7_WM_DISPATCH_ENABLE;
>     }
> 

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>