OSDN Git Service

radv: Handle GFX9 merged shaders in radv_flush_constants()
authorAlex Smith <asmith@feralinteractive.com>
Thu, 31 May 2018 14:28:27 +0000 (15:28 +0100)
committerAlex Smith <asmith@feralinteractive.com>
Fri, 1 Jun 2018 07:53:34 +0000 (08:53 +0100)
commitdfff9fb6f8d4b4ecd087cc01e9841244a83558b6
treec22bcdbeb32aec6e27674871edeb5c043380616b
parent7ca0167ae97def827d66205b7c873ceb360224ab
radv: Handle GFX9 merged shaders in radv_flush_constants()

This was not previously handled correctly. For example,
push_constant_stages might only contain MESA_SHADER_VERTEX because
only that stage was changed by CmdPushConstants or
CmdBindDescriptorSets.

In that case, if vertex has been merged with tess control, then the
push constant address wouldn't be updated since
pipeline->shaders[MESA_SHADER_VERTEX] would be NULL.

Use radv_get_shader() instead of getting the shader directly so that
we get the right shader if merged. Also, skip emitting the address
redundantly - if two merged stages are set in push_constant_stages
this change would have made the address get emitted twice.

Signed-off-by: Alex Smith <asmith@feralinteractive.com>
Cc: "18.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_cmd_buffer.c