From: Jason Ekstrand Date: Sat, 16 May 2015 17:23:09 +0000 (-0700) Subject: vk/device: Simplify surface_count calculation X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=4223de769ea9ced73771f4b0233fe320f4c2212d;p=mesa.git vk/device: Simplify surface_count calculation --- diff --git a/src/vulkan/device.c b/src/vulkan/device.c index 18e3c0559d8..8e60398373b 100644 --- a/src/vulkan/device.c +++ b/src/vulkan/device.c @@ -2253,7 +2253,6 @@ flush_descriptor_sets(struct anv_cmd_buffer *cmd_buffer) struct anv_pipeline_layout *layout = cmd_buffer->pipeline->layout; struct anv_bindings *bindings = cmd_buffer->bindings; uint32_t layers = cmd_buffer->framebuffer->layers; - uint32_t surface_count; for (uint32_t s = 0; s < VK_NUM_SHADER_STAGE; s++) { uint32_t bias; @@ -2269,10 +2268,7 @@ flush_descriptor_sets(struct anv_cmd_buffer *cmd_buffer) /* This is a little awkward: layout can be NULL but we still have to * allocate and set a binding table for the PS stage for render * targets. */ - if (layout) - surface_count = layout->stage[s].surface_count; - else - surface_count = 0; + uint32_t surface_count = layout ? layout->stage[s].surface_count : 0; if (layers + surface_count > 0) { struct anv_state state;