anv/cmd_buffer: Enable render pass awareness
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 27 Feb 2017 22:09:03 +0000 (14:09 -0800)
committerNanley Chery <nanley.g.chery@intel.com>
Thu, 2 Mar 2017 21:17:55 +0000 (13:17 -0800)
v2: Update cmd_state_reset (Jason Ekstrand)

Signed-off-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
src/intel/vulkan/anv_cmd_buffer.c
src/intel/vulkan/genX_cmd_buffer.c

index ef369c10f5b883edd59b24682f22bfa92540898c..cab1dd7305a3b2c783a300488840f3cb7dab4682 100644 (file)
@@ -131,6 +131,9 @@ anv_cmd_state_reset(struct anv_cmd_buffer *cmd_buffer)
    state->descriptors_dirty = 0;
    state->push_constants_dirty = 0;
    state->pipeline = NULL;
+   state->framebuffer = NULL;
+   state->pass = NULL;
+   state->subpass = NULL;
    state->push_constant_stages = 0;
    state->restart_index = UINT32_MAX;
    state->dynamic = default_dynamic_state;
index 7f1f4a7558779d617767976c171d7259f116db29..85d6267277ef3671996925499b860b3614961ac9 100644 (file)
@@ -2452,4 +2452,11 @@ void genX(CmdEndRenderPass)(
 #ifndef NDEBUG
    anv_dump_add_framebuffer(cmd_buffer, cmd_buffer->state.framebuffer);
 #endif
+
+   /* Remove references to render pass specific state. This enables us to
+    * detect whether or not we're in a renderpass.
+    */
+   cmd_buffer->state.framebuffer = NULL;
+   cmd_buffer->state.pass = NULL;
+   cmd_buffer->state.subpass = NULL;
 }