aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/radeonsi/si_descriptors.c
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2017-12-31 22:58:57 +0100
committerMarek Olšák <[email protected]>2018-02-17 04:52:17 +0100
commit5722cd408400196eeaf02b0dba0885a536097422 (patch)
treec80a0b57002cf0fe592a6415e4a45a6d3023b96c /src/gallium/drivers/radeonsi/si_descriptors.c
parentd790b6cecea7c5df5465e76ba63b6e7e9d6e1f5e (diff)
radeonsi: disallow constant buffers with a 64-bit address in slot 0
State trackers must use a user buffer or const_uploader, or set pipe_resource::flags same as const_uploader->flags. Reviewed-by: Samuel Pitoiset <[email protected]>
Diffstat (limited to 'src/gallium/drivers/radeonsi/si_descriptors.c')
-rw-r--r--src/gallium/drivers/radeonsi/si_descriptors.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/radeonsi/si_descriptors.c b/src/gallium/drivers/radeonsi/si_descriptors.c
index 009e8031058..96525fd21b0 100644
--- a/src/gallium/drivers/radeonsi/si_descriptors.c
+++ b/src/gallium/drivers/radeonsi/si_descriptors.c
@@ -1214,6 +1214,12 @@ static void si_pipe_set_constant_buffer(struct pipe_context *ctx,
if (shader >= SI_NUM_SHADERS)
return;
+ if (slot == 0 && input && input->buffer &&
+ !(r600_resource(input->buffer)->flags & RADEON_FLAG_32BIT)) {
+ assert(!"constant buffer 0 must have a 32-bit VM address, use const_uploader");
+ return;
+ }
+
slot = si_get_constbuf_slot(slot);
si_set_constant_buffer(sctx, &sctx->const_and_shader_buffers[shader],
si_const_and_shader_buffer_descriptors_idx(shader),