summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Ekstrand <jason@jlekstrand.net>2021-05-02 17:55:15 -0500
committerMarge Bot <eric+marge@anholt.net>2021-05-19 14:38:13 +0000
commitc01354d5c4433452164e70a54e7bbfabf2443b50 (patch)
tree94821bb4bd7215518a841ddb1d9d7c5356bd9b02
parent24b3e71fa9038972292e10d236b8c27ec2fcef4f (diff)
anv: Support pushing shader constants
Usually, nir_opt_constant_folding will get rid of any load_constant intrinsics which might possibly be pushed but there are rare cases where we can still end up with them. Better to handle them. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10571>
-rw-r--r--src/intel/vulkan/genX_cmd_buffer.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/intel/vulkan/genX_cmd_buffer.c b/src/intel/vulkan/genX_cmd_buffer.c
index 17badd5375f..54b76406cfe 100644
--- a/src/intel/vulkan/genX_cmd_buffer.c
+++ b/src/intel/vulkan/genX_cmd_buffer.c
@@ -3013,6 +3013,13 @@ get_push_range_address(struct anv_cmd_buffer *cmd_buffer,
};
}
+ case ANV_DESCRIPTOR_SET_SHADER_CONSTANTS:
+ return (struct anv_address) {
+ .bo = cmd_buffer->device->instruction_state_pool.block_pool.bo,
+ .offset = shader->kernel.offset +
+ shader->prog_data->const_data_offset,
+ };
+
default: {
assert(range->set < MAX_SETS);
struct anv_descriptor_set *set =
@@ -3075,6 +3082,9 @@ get_push_range_bound_size(struct anv_cmd_buffer *cmd_buffer,
case ANV_DESCRIPTOR_SET_PUSH_CONSTANTS:
return (range->start + range->length) * 32;
+ case ANV_DESCRIPTOR_SET_SHADER_CONSTANTS:
+ return ALIGN(shader->prog_data->const_data_size, ANV_UBO_ALIGNMENT);
+
default: {
assert(range->set < MAX_SETS);
struct anv_descriptor_set *set =