vk: Allow NULL as a valid pipeline layout
authorKristian Høgsberg <kristian.h.kristensen@intel.com>
Tue, 12 May 2015 05:12:56 +0000 (22:12 -0700)
committerKristian Høgsberg <kristian.h.kristensen@intel.com>
Tue, 12 May 2015 05:12:56 +0000 (22:12 -0700)
Vertex buffers and render targets aren't part of the layout so having
an empty layout is pretty common.

src/vulkan/compiler.cpp

index d7428d8a877b97ae4a8cf04db34eb4312b4d517f..39858426cf423f44aaa3a91639c651d134c08e1c 100644 (file)
@@ -61,6 +61,10 @@ set_binding_table_layout(struct brw_stage_prog_data *prog_data,
 
    struct anv_pipeline_layout_entry *entries;
 
+   /* No layout is valid for shaders that don't bind any resources. */
+   if (pipeline->layout == NULL)
+      return VK_SUCCESS;
+
    if (stage == VK_SHADER_STAGE_FRAGMENT)
       bias = MAX_RTS;
    else