summaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/genX_cmd_buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/intel/vulkan/genX_cmd_buffer.c')
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c25
1 files changed, 18 insertions, 7 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 03ea91aa0f9..0bf46db0a5e 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -2006,6 +2006,7 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
gl_shader_stage stage,
struct anv_state *bt_state)
{
+ const struct gen_device_info *devinfo = &cmd_buffer->device->info;
struct anv_subpass *subpass = cmd_buffer->state.subpass;
struct anv_cmd_pipeline_state *pipe_state;
struct anv_pipeline *pipeline;
@@ -2063,7 +2064,8 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
if (map->surface_count == 0)
goto out;
- if (map->image_count > 0) {
+ /* We only use push constant space for images before gen9 */
+ if (map->image_count > 0 && devinfo->gen < 9) {
VkResult result =
anv_cmd_buffer_ensure_push_constant_field(cmd_buffer, stage, images);
if (result != VK_SUCCESS)
@@ -2176,11 +2178,16 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
surface_state = sstate.state;
assert(surface_state.alloc_size);
add_surface_state_relocs(cmd_buffer, sstate);
+ image++;
- struct brw_image_param *image_param =
- &cmd_buffer->state.push_constants[stage]->images[image++];
+ if (devinfo->gen < 9) {
+ assert(image < MAX_GEN8_IMAGES);
+ struct brw_image_param *image_param =
+ &cmd_buffer->state.push_constants[stage]->images[image];
- *image_param = desc->image_view->planes[binding->plane].storage_image_param;
+ *image_param =
+ desc->image_view->planes[binding->plane].storage_image_param;
+ }
break;
}
@@ -2225,11 +2232,15 @@ emit_binding_table(struct anv_cmd_buffer *cmd_buffer,
assert(surface_state.alloc_size);
add_surface_reloc(cmd_buffer, surface_state,
desc->buffer_view->address);
+ image++;
- struct brw_image_param *image_param =
- &cmd_buffer->state.push_constants[stage]->images[image++];
+ if (devinfo->gen < 9) {
+ assert(image < MAX_GEN8_IMAGES);
+ struct brw_image_param *image_param =
+ &cmd_buffer->state.push_constants[stage]->images[image];
- *image_param = desc->buffer_view->storage_image_param;
+ *image_param = desc->buffer_view->storage_image_param;
+ }
break;
default: