aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorRob Clark <[email protected]>2019-05-02 09:37:21 -0700
committerRob Clark <[email protected]>2019-05-02 11:19:22 -0700
commitca3eb5db665cbcc2de5a5d3158e3dc68f86e5822 (patch)
treeefef1d5fd96eb368b3f1aa7ede612ffa3a45aeec /src/gallium/drivers
parente941faf3e83fa0d5ce0bd6e67119e8d6bf975502 (diff)
freedreno/ir3: add some ubo range related asserts
And a comment.. since we are mixing units of bytes/dwords/vec4, hopefully this will avoid some unit confusion. Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/freedreno/ir3/ir3_gallium.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
index 65fb7565de1..0f4427f3028 100644
--- a/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
+++ b/src/gallium/drivers/freedreno/ir3/ir3_gallium.c
@@ -265,10 +265,13 @@ emit_user_consts(struct fd_context *ctx, const struct ir3_shader_variant *v,
if (state->range[i].start < state->range[i].end &&
constbuf->enabled_mask & (1 << i)) {
+ uint32_t size = state->range[i].end - state->range[i].start;
+ uint32_t offset = cb->buffer_offset + state->range[i].start;
+ debug_assert((state->range[i].offset % 16) == 0);
+ debug_assert((size % 16) == 0);
+ debug_assert((offset % 16) == 0);
ctx->emit_const(ring, v->type, state->range[i].offset / 4,
- cb->buffer_offset + state->range[i].start,
- (state->range[i].end - state->range[i].start) / 4,
- cb->user_buffer, cb->buffer);
+ offset, size / 4, cb->user_buffer, cb->buffer);
}
}
}