Skip to content
Commit dfa57d01 authored by Kenneth Graunke's avatar Kenneth Graunke Committed by Andres Gomez
Browse files

i965: properly initialize brw->cs.base.stage to MESA_SHADER_COMPUTE



This has a bit of a surprising effect:

For the render pipeline, the upload_sampler_state_table atom emits
3DSTATE_BINDING_TABLE_POINTERS_XS.  It tries to avoid this for compute:

   if (GEN_GEN >= 7 && stage_state->stage != MESA_SHADER_COMPUTE) {
      /* Emit a 3DSTATE_SAMPLER_STATE_POINTERS_XS packet. */
      genX(emit_sampler_state_pointers_xs)(brw, stage_state);
   } ...

However, we were failing to initialize brw->cs.base.stage, so it was
left as 0 (MESA_SHADER_VERTEX), causing this condition to break.  We
then emitted 3DSTATE_SAMPLER_STATE_POINTERS_VS in GPGPU mode, when
trying to upload CS samplers.  Nothing good can come of this.

Found by inspection while debugging a GPU hang.  Jordan believes this
helps the Deus Ex: Mankind Divided benchmark mode's stability when
running with shader cache.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: default avatarJason Ekstrand <jason@jlekstrand.net>
Reviewed-by: default avatarJordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit a16dc04a)
[Andres Gomez: resolve trivial conflicts]
Signed-off-by: default avatarAndres Gomez <agomez@igalia.com>

Conflicts:
	src/mesa/drivers/dri/i965/brw_context.c
parent 7d61bf50
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment