[Mesa-dev] [PATCH] anv: do not flush push constants on inactive stages

Jacek Konieczny jajcus at jajcus.net
Tue May 17 08:23:12 UTC 2016


This was causing crashes in The Talos Principle, on a pipeline without
a fragment shader stage.

Signed-off-by: Jacek Konieczny <jajcus at jajcus.net>
---
This was my attempt to fix The Talos Principle on Vulkan on Intel Haswell, the
problem described in https://bugs.freedesktop.org/show_bug.cgi?id=94831

I don't quite understand the code I have changed, but it seems this change
should help. And indeed, it does help a bit, but the game still crashes later,
deep in the NIR compiler, which is over my abilities to comprehend.


 src/intel/vulkan/genX_cmd_buffer.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 0a5c404..925e894 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -288,7 +288,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer)
 
    VkShaderStageFlags flushed = 0;
 
-   anv_foreach_stage(stage, cmd_buffer->state.push_constants_dirty) {
+   anv_foreach_stage(stage, cmd_buffer->state.push_constants_dirty & cmd_buffer->state.pipeline->active_stages) {
       if (stage == MESA_SHADER_COMPUTE)
          continue;
 
-- 
2.7.3



More information about the mesa-dev mailing list