summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.c
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2019-02-06 18:02:30 -0600
committerJason Ekstrand <[email protected]>2019-03-05 10:06:50 -0600
commit4c50b7c92cd0800e184d2448fbe6b1c5466f5c95 (patch)
tree4356e524182771e17508ca734fb0d5a98c5c3c4a /src/intel/vulkan/genX_cmd_buffer.c
parent3822c7495a096195c81652b5a813b6571ae652d4 (diff)
anv: Count image param entries rather than images
This is what we're actually storing in the descriptor set and consuming when we bind surface states. This commit renames image_count to image_param_count a few places and moves the decision to not count image params on gen9+ into anv_descriptor_set.c when we build the layout. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index a7e63a6db83..b5fc8be9475 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -2070,7 +2070,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
return VK_ERROR_OUT_OF_DEVICE_MEMORY;
/* We only use push constant space for images before gen9 */
- if (map->image_count > 0 && devinfo->gen < 9) {
+ if (map->image_param_count > 0) {
VkResult result =
anv_cmd_buffer_ensure_push_constant_field(cmd_buffer, stage, images);
if (result != VK_SUCCESS)
@@ -2203,14 +2203,17 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
assert(surface_state.alloc_size);
add_surface_state_relocs(cmd_buffer, sstate);
if (devinfo->gen < 9) {
+ /* We only need the image params on gen8 and earlier. No image
+ * workarounds that require tiling information are required on
+ * SKL and above.
+ */
assert(image < MAX_GEN8_IMAGES);
struct brw_image_param *image_param =
- &cmd_buffer->state.push_constants[stage]->images[image];
+ &cmd_buffer->state.push_constants[stage]->images[image++];
*image_param =
desc->image_view->planes[binding->plane].storage_image_param;
}
- image++;
break;
}
@@ -2258,11 +2261,10 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
if (devinfo->gen < 9) {
assert(image < MAX_GEN8_IMAGES);
struct brw_image_param *image_param =
- &cmd_buffer->state.push_constants[stage]->images[image];
+ &cmd_buffer->state.push_constants[stage]->images[image++];
*image_param = desc->buffer_view->storage_image_param;
}
- image++;
break;
default:
@@ -2272,7 +2274,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
bt_map[s] = surface_state.offset + state_offset;
}
- assert(image == map->image_count);
+ assert(image == map->image_param_count);
#if GEN_GEN >= 11
/* The PIPE_CONTROL command description says: