Commit 5abe82b1 authored by Icecream95's avatar Icecream95
Browse files

panfrost: Rename panfrost_ubo_word to panfrost_ubo_range

parent 1a0aa38a
......@@ -1169,7 +1169,7 @@ panfrost_emit_const_buf(struct panfrost_batch *batch,
*push_constants = push_transfer.gpu;
for (unsigned i = 0; i < ss->info.push.count; ++i) {
struct panfrost_ubo_word src = ss->info.push.words[i];
struct panfrost_ubo_range src = ss->info.push.ranges[i];
/* Map the UBO, this should be cheap. However this is reading
* from write-combine memory which is _very_ slow. It might pay
......
......@@ -1103,7 +1103,7 @@ get_push_uniforms(struct pan_pool *pool,
uint8_t *in = (uint8_t *)inputs;
for (unsigned i = 0; i < shader->push.count; ++i)
memcpy(out + i, in + shader->push.words[i].offset, 4);
memcpy(out + i, in + shader->push.ranges[i].offset, 4);
return push_consts_buf.gpu;
}
......
......@@ -988,10 +988,10 @@ mir_demote_uniforms(compiler_context *ctx, unsigned new_cutoff)
.swizzle = SWIZZLE_IDENTITY_4,
.op = midgard_op_ld_ubo_u128,
.load_store = {
.arg_1 = ctx->info->push.words[idx].ubo,
.arg_1 = ctx->info->push.ranges[idx].ubo,
.arg_2 = 0x1E,
},
.constants.u32[0] = ctx->info->push.words[idx].offset
.constants.u32[0] = ctx->info->push.ranges[idx].offset
};
mir_insert_instruction_before_scheduled(ctx, block, before, ld);
......
......@@ -135,13 +135,13 @@ pan_print_alu_type(nir_alu_type t, FILE *fp)
unsigned
pan_lookup_pushed_ubo(struct panfrost_ubo_push *push, unsigned ubo, unsigned offs)
{
struct panfrost_ubo_word word = {
struct panfrost_ubo_range range = {
.ubo = ubo,
.offset = offs
};
for (unsigned i = 0; i < push->count; ++i) {
if (memcmp(push->words + i, &word, sizeof(word)) == 0)
if (memcmp(push->ranges + i, &range, sizeof(range)) == 0)
return i;
}
......@@ -152,10 +152,10 @@ pan_lookup_pushed_ubo(struct panfrost_ubo_push *push, unsigned ubo, unsigned off
void
pan_add_pushed_ubo(struct panfrost_ubo_push *push, unsigned ubo, unsigned offs)
{
struct panfrost_ubo_word word = {
struct panfrost_ubo_range range = {
.ubo = ubo,
.offset = offs,
};
push->words[push->count++] = word;
push->ranges[push->count++] = range;
}
......@@ -89,14 +89,15 @@ struct panfrost_sysvals {
/* Architectural invariants (Midgard and Bifrost): UBO must be <= 2^16 bytes so
* an offset to a word must be < 2^16. There are less than 2^8 UBOs */
struct panfrost_ubo_word {
uint16_t ubo;
struct panfrost_ubo_range {
uint8_t ubo;
uint8_t size;
uint16_t offset;
};
struct panfrost_ubo_push {
unsigned count;
struct panfrost_ubo_word words[PAN_MAX_PUSH];
struct panfrost_ubo_range ranges[PAN_MAX_PUSH];
};
/* Helper for searching the above. Note this is O(N) to the number of pushed
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment