vk: Set cb_state to NULL at cmd buffer create time
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Wed, 3 Jun 2015 05:51:42 +0000 (22:51 -0700)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Wed, 3 Jun 2015 05:57:42 +0000 (22:57 -0700)
Dynamic color/blend state can be NULL in case we're not rendering to
color targets (only output to depth and/or stencil). Initialize
cmd_buffer->cb_state to NULL so we can reliably detect whether it's been
set or not.

src/vulkan/device.c

index e44f063237fa797879bc5b5d0c0f3ec5216d1f5d..091d9280792136cb2e097e9dd991a0fa7bce8ad1 100644 (file)
@@ -2297,6 +2297,7 @@ VkResult anv_CreateCommandBuffer(
    cmd_buffer->device = device;
    cmd_buffer->rs_state = NULL;
    cmd_buffer->vp_state = NULL;
+   cmd_buffer->cb_state = NULL;
    memset(&cmd_buffer->descriptors, 0, sizeof(cmd_buffer->descriptors));
 
    result = anv_batch_bo_create(device, &cmd_buffer->last_batch_bo);