diff options
author | Jason Ekstrand <[email protected]> | 2019-11-25 11:05:42 -0600 |
---|---|---|
committer | Jason Ekstrand <[email protected]> | 2019-11-26 22:15:54 +0000 |
commit | a8965c076b468a90a62360d18496d8f75b5c193c (patch) | |
tree | 5c9ac8090b521b62349b122eed729ff644d76086 | |
parent | a24d6fbae60c01a39fe5a026fb568ab7facc6fbb (diff) |
anv: Push constants are relative to dynamic state on IVB
Fixes: aecde2351 "anv: Pre-compute push ranges for graphics pipelines"
Closes: #2136
Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r-- | src/intel/vulkan/genX_cmd_buffer.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c index 7c48938fca6..42d5b452699 100644 --- a/src/intel/vulkan/genX_cmd_buffer.c +++ b/src/intel/vulkan/genX_cmd_buffer.c @@ -2535,6 +2535,7 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, const struct anv_pipeline_bind_map *bind_map = &pipeline->shaders[stage]->bind_map; +#if GEN_GEN >= 8 || GEN_IS_HASWELL for (unsigned i = 0; i < 4; i++) { const struct anv_push_range *range = &bind_map->push_ranges[i]; if (range->length == 0) @@ -2588,6 +2589,22 @@ cmd_buffer_flush_push_constants(struct anv_cmd_buffer *cmd_buffer, c.ConstantBody.Buffer[i] = anv_address_add(addr, range->start * 32); } +#else + /* For Ivy Bridge, push constants are relative to dynamic state + * base address and we only ever push actual push constants. + */ + if (bind_map->push_ranges[0].length > 0) { + assert(bind_map->push_ranges[0].set == + ANV_DESCRIPTOR_SET_PUSH_CONSTANTS); + struct anv_state state = + anv_cmd_buffer_push_constants(cmd_buffer, stage); + c.ConstantBody.ReadLength[0] = bind_map->push_ranges[0].length; + c.ConstantBody.Buffer[0].offset = state.offset; + } + assert(bind_map->push_ranges[1].length == 0); + assert(bind_map->push_ranges[2].length == 0); + assert(bind_map->push_ranges[3].length == 0); +#endif } } |