i965: execution of frag-shader when it has atomic buffer
authorKevin Rogovin <kevin.rogovin@intel.com>
Wed, 17 Jun 2015 10:29:57 +0000 (13:29 +0300)
committerMartin Peres <martin.peres@linux.intel.com>
Wed, 17 Jun 2015 11:39:03 +0000 (14:39 +0300)
Ensure that the GPU spawns the fragment shader thread for those
fragment shaders with atomic buffer access.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Kevin Rogovin <kevin.rogovin@intel.com>
src/mesa/drivers/dri/i965/gen7_wm_state.c
src/mesa/drivers/dri/i965/gen8_ps_state.c

index 1c470769c7f34063aaa0fd7c8aa77fe36fa575f3..ea11ae845e3adf3f9fd2bec5b19aa0a59d64a2a8 100644 (file)
@@ -77,6 +77,10 @@ upload_wm_state(struct brw_context *brw)
       dw1 |= GEN7_WM_KILL_ENABLE;
    }
 
+   if (_mesa_active_fragment_shader_has_atomic_ops(&brw->ctx)) {
+      dw1 |= GEN7_WM_DISPATCH_ENABLE;
+   }
+
    /* _NEW_BUFFERS | _NEW_COLOR */
    if (brw_color_buffer_write_enabled(brw) || writes_depth ||
        dw1 & GEN7_WM_KILL_ENABLE) {
index 6b9489bf7f69997f79081ae6a0b63d34f260ae11..a88f109c691a6c1bf4c39b6644eaf086cc515f0d 100644 (file)
@@ -58,6 +58,9 @@ gen8_upload_ps_extra(struct brw_context *brw,
    if (prog_data->uses_omask)
       dw1 |= GEN8_PSX_OMASK_TO_RENDER_TARGET;
 
+   if (_mesa_active_fragment_shader_has_atomic_ops(&brw->ctx))
+      dw1 |= GEN8_PSX_SHADER_HAS_UAV;
+
    BEGIN_BATCH(2);
    OUT_BATCH(_3DSTATE_PS_EXTRA << 16 | (2 - 2));
    OUT_BATCH(dw1);