[Mesa-dev] [PATCH 04/17] gallium: disable compute shaders for meta ops

Alex Deucher alexdeucher at gmail.com
Mon Jan 25 21:17:16 PST 2016


On Mon, Jan 25, 2016 at 6:35 PM, Nicolai Hähnle <nhaehnle at gmail.com> wrote:
> On 24.01.2016 16:09, Samuel Pitoiset wrote:
>>
>> Loosely based on tessellation shaders.
>
>
> Do we actually need this? The graphics pipeline and the compute pipeline are
> separate; draw commands should be unaffected by the currently set compute
> shader. Or am I missing something?

IIRC, on at least some pre-GCN hardware, there are some pipeline state
dependencies between compute and gfx.

Alex

>
> Cheers,
> Nicolai
>
>
>>
>> Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
>> ---
>>   src/gallium/auxiliary/hud/hud_context.c    | 3 +++
>>   src/gallium/auxiliary/postprocess/pp_run.c | 3 +++
>>   src/gallium/auxiliary/util/u_blit.c        | 3 +++
>>   src/mesa/state_tracker/st_cb_bitmap.c      | 3 +++
>>   src/mesa/state_tracker/st_cb_clear.c       | 3 +++
>>   src/mesa/state_tracker/st_cb_drawpixels.c  | 3 +++
>>   src/mesa/state_tracker/st_cb_drawtex.c     | 3 +++
>>   7 files changed, 21 insertions(+)
>>
>> diff --git a/src/gallium/auxiliary/hud/hud_context.c
>> b/src/gallium/auxiliary/hud/hud_context.c
>> index 75afebe..6387638 100644
>> --- a/src/gallium/auxiliary/hud/hud_context.c
>> +++ b/src/gallium/auxiliary/hud/hud_context.c
>> @@ -472,6 +472,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource
>> *tex)
>>      cso_save_viewport(cso);
>>      cso_save_stream_outputs(cso);
>>      cso_save_geometry_shader(cso);
>> +   cso_save_compute_shader(cso);
>>      cso_save_tessctrl_shader(cso);
>>      cso_save_tesseval_shader(cso);
>>      cso_save_vertex_shader(cso);
>> @@ -510,6 +511,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource
>> *tex)
>>      cso_set_tessctrl_shader_handle(cso, NULL);
>>      cso_set_tesseval_shader_handle(cso, NULL);
>>      cso_set_geometry_shader_handle(cso, NULL);
>> +   cso_set_compute_shader_handle(cso, NULL);
>>      cso_set_vertex_shader_handle(cso, hud->vs);
>>      cso_set_vertex_elements(cso, 2, hud->velems);
>>      cso_set_render_condition(cso, NULL, FALSE, 0);
>> @@ -606,6 +608,7 @@ hud_draw(struct hud_context *hud, struct pipe_resource
>> *tex)
>>      cso_restore_tessctrl_shader(cso);
>>      cso_restore_tesseval_shader(cso);
>>      cso_restore_geometry_shader(cso);
>> +   cso_restore_compute_shader(cso);
>>      cso_restore_vertex_shader(cso);
>>      cso_restore_vertex_elements(cso);
>>      cso_restore_aux_vertex_buffer_slot(cso);
>> diff --git a/src/gallium/auxiliary/postprocess/pp_run.c
>> b/src/gallium/auxiliary/postprocess/pp_run.c
>> index c6c7b88..58abef1 100644
>> --- a/src/gallium/auxiliary/postprocess/pp_run.c
>> +++ b/src/gallium/auxiliary/postprocess/pp_run.c
>> @@ -122,6 +122,7 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource
>> *in,
>>      cso_save_tessctrl_shader(cso);
>>      cso_save_tesseval_shader(cso);
>>      cso_save_geometry_shader(cso);
>> +   cso_save_compute_shader(cso);
>>      cso_save_rasterizer(cso);
>>      cso_save_sample_mask(cso);
>>      cso_save_min_samples(cso);
>> @@ -144,6 +145,7 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource
>> *in,
>>      cso_set_tessctrl_shader_handle(cso, NULL);
>>      cso_set_tesseval_shader_handle(cso, NULL);
>>      cso_set_geometry_shader_handle(cso, NULL);
>> +   cso_set_compute_shader_handle(cso, NULL);
>>      cso_set_render_condition(cso, NULL, FALSE, 0);
>>
>>      // Kept only for this frame.
>> @@ -193,6 +195,7 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource
>> *in,
>>      cso_restore_tessctrl_shader(cso);
>>      cso_restore_tesseval_shader(cso);
>>      cso_restore_geometry_shader(cso);
>> +   cso_restore_compute_shader(cso);
>>      cso_restore_rasterizer(cso);
>>      cso_restore_sample_mask(cso);
>>      cso_restore_min_samples(cso);
>> diff --git a/src/gallium/auxiliary/util/u_blit.c
>> b/src/gallium/auxiliary/util/u_blit.c
>> index 9737c94..ffb7b88 100644
>> --- a/src/gallium/auxiliary/util/u_blit.c
>> +++ b/src/gallium/auxiliary/util/u_blit.c
>> @@ -556,6 +556,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
>>      cso_save_tessctrl_shader(ctx->cso);
>>      cso_save_tesseval_shader(ctx->cso);
>>      cso_save_geometry_shader(ctx->cso);
>> +   cso_save_compute_shader(ctx->cso);
>>      cso_save_vertex_elements(ctx->cso);
>>      cso_save_aux_vertex_buffer_slot(ctx->cso);
>>
>> @@ -597,6 +598,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
>>      cso_set_tessctrl_shader_handle(ctx->cso, NULL);
>>      cso_set_tesseval_shader_handle(ctx->cso, NULL);
>>      cso_set_geometry_shader_handle(ctx->cso, NULL);
>> +   cso_set_compute_shader_handle(ctx->cso, NULL);
>>
>>      /* drawing dest */
>>      memset(&fb, 0, sizeof(fb));
>> @@ -639,6 +641,7 @@ util_blit_pixels_tex(struct blit_state *ctx,
>>      cso_restore_tessctrl_shader(ctx->cso);
>>      cso_restore_tesseval_shader(ctx->cso);
>>      cso_restore_geometry_shader(ctx->cso);
>> +   cso_restore_compute_shader(ctx->cso);
>>      cso_restore_vertex_elements(ctx->cso);
>>      cso_restore_aux_vertex_buffer_slot(ctx->cso);
>>      cso_restore_stream_outputs(ctx->cso);
>> diff --git a/src/mesa/state_tracker/st_cb_bitmap.c
>> b/src/mesa/state_tracker/st_cb_bitmap.c
>> index d8c3dbd..3242644 100644
>> --- a/src/mesa/state_tracker/st_cb_bitmap.c
>> +++ b/src/mesa/state_tracker/st_cb_bitmap.c
>> @@ -312,6 +312,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_save_tessctrl_shader(cso);
>>      cso_save_tesseval_shader(cso);
>>      cso_save_geometry_shader(cso);
>> +   cso_save_compute_shader(cso);
>>      cso_save_vertex_elements(cso);
>>      cso_save_aux_vertex_buffer_slot(cso);
>>
>> @@ -329,6 +330,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_set_tessctrl_shader_handle(cso, NULL);
>>      cso_set_tesseval_shader_handle(cso, NULL);
>>      cso_set_geometry_shader_handle(cso, NULL);
>> +   cso_set_compute_shader_handle(cso, NULL);
>>
>>      /* user samplers, plus our bitmap sampler */
>>      {
>> @@ -400,6 +402,7 @@ draw_bitmap_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_restore_tessctrl_shader(cso);
>>      cso_restore_tesseval_shader(cso);
>>      cso_restore_geometry_shader(cso);
>> +   cso_restore_compute_shader(cso);
>>      cso_restore_vertex_elements(cso);
>>      cso_restore_aux_vertex_buffer_slot(cso);
>>      cso_restore_stream_outputs(cso);
>> diff --git a/src/mesa/state_tracker/st_cb_clear.c
>> b/src/mesa/state_tracker/st_cb_clear.c
>> index 7b6d10e..14928b0 100644
>> --- a/src/mesa/state_tracker/st_cb_clear.c
>> +++ b/src/mesa/state_tracker/st_cb_clear.c
>> @@ -270,6 +270,7 @@ clear_with_quad(struct gl_context *ctx, unsigned
>> clear_buffers)
>>      cso_save_tessctrl_shader(st->cso_context);
>>      cso_save_tesseval_shader(st->cso_context);
>>      cso_save_geometry_shader(st->cso_context);
>> +   cso_save_compute_shader(st->cso_context);
>>      cso_save_vertex_elements(st->cso_context);
>>      cso_save_aux_vertex_buffer_slot(st->cso_context);
>>
>> @@ -353,6 +354,7 @@ clear_with_quad(struct gl_context *ctx, unsigned
>> clear_buffers)
>>      set_fragment_shader(st);
>>      cso_set_tessctrl_shader_handle(st->cso_context, NULL);
>>      cso_set_tesseval_shader_handle(st->cso_context, NULL);
>> +   cso_set_compute_shader_handle(st->cso_context, NULL);
>>
>>      if (num_layers > 1)
>>         set_vertex_shader_layered(st);
>> @@ -380,6 +382,7 @@ clear_with_quad(struct gl_context *ctx, unsigned
>> clear_buffers)
>>      cso_restore_tessctrl_shader(st->cso_context);
>>      cso_restore_tesseval_shader(st->cso_context);
>>      cso_restore_geometry_shader(st->cso_context);
>> +   cso_restore_compute_shader(st->cso_context);
>>      cso_restore_vertex_elements(st->cso_context);
>>      cso_restore_aux_vertex_buffer_slot(st->cso_context);
>>      cso_restore_stream_outputs(st->cso_context);
>> diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c
>> b/src/mesa/state_tracker/st_cb_drawpixels.c
>> index 04a9de0..351edbc 100644
>> --- a/src/mesa/state_tracker/st_cb_drawpixels.c
>> +++ b/src/mesa/state_tracker/st_cb_drawpixels.c
>> @@ -577,6 +577,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_save_tessctrl_shader(cso);
>>      cso_save_tesseval_shader(cso);
>>      cso_save_geometry_shader(cso);
>> +   cso_save_compute_shader(cso);
>>      cso_save_vertex_elements(cso);
>>      cso_save_aux_vertex_buffer_slot(cso);
>>      if (write_stencil) {
>> @@ -633,6 +634,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_set_tessctrl_shader_handle(cso, NULL);
>>      cso_set_tesseval_shader_handle(cso, NULL);
>>      cso_set_geometry_shader_handle(cso, NULL);
>> +   cso_set_compute_shader_handle(cso, NULL);
>>
>>      /* user samplers, plus the drawpix samplers */
>>      {
>> @@ -733,6 +735,7 @@ draw_textured_quad(struct gl_context *ctx, GLint x,
>> GLint y, GLfloat z,
>>      cso_restore_tessctrl_shader(cso);
>>      cso_restore_tesseval_shader(cso);
>>      cso_restore_geometry_shader(cso);
>> +   cso_restore_compute_shader(cso);
>>      cso_restore_vertex_elements(cso);
>>      cso_restore_aux_vertex_buffer_slot(cso);
>>      cso_restore_stream_outputs(cso);
>> diff --git a/src/mesa/state_tracker/st_cb_drawtex.c
>> b/src/mesa/state_tracker/st_cb_drawtex.c
>> index e6ab77f..a336363 100644
>> --- a/src/mesa/state_tracker/st_cb_drawtex.c
>> +++ b/src/mesa/state_tracker/st_cb_drawtex.c
>> @@ -236,6 +236,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat
>> y, GLfloat z,
>>      cso_save_tessctrl_shader(cso);
>>      cso_save_tesseval_shader(cso);
>>      cso_save_geometry_shader(cso);
>> +   cso_save_compute_shader(cso);
>>      cso_save_vertex_elements(cso);
>>      cso_save_aux_vertex_buffer_slot(cso);
>>
>> @@ -247,6 +248,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat
>> y, GLfloat z,
>>      cso_set_tessctrl_shader_handle(cso, NULL);
>>      cso_set_tesseval_shader_handle(cso, NULL);
>>      cso_set_geometry_shader_handle(cso, NULL);
>> +   cso_set_compute_shader_handle(cso, NULL);
>>
>>      for (i = 0; i < numAttribs; i++) {
>>         velements[i].src_offset = i * 4 * sizeof(float);
>> @@ -290,6 +292,7 @@ st_DrawTex(struct gl_context *ctx, GLfloat x, GLfloat
>> y, GLfloat z,
>>      cso_restore_tessctrl_shader(cso);
>>      cso_restore_tesseval_shader(cso);
>>      cso_restore_geometry_shader(cso);
>> +   cso_restore_compute_shader(cso);
>>      cso_restore_vertex_elements(cso);
>>      cso_restore_aux_vertex_buffer_slot(cso);
>>      cso_restore_stream_outputs(cso);
>>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list