glsl: Minor cleanups after previous commit
I think it's more clear to only call emit_access once. The only difference between the two calls is the value of size_mul used for the offset parameter... but you really have to look at it to be sure. The s/is_64bit/is_double/ change is because there are no int64_t or uint64_t matrix types. Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
This commit is contained in:
parent
c18d8c61d6
commit
9c53b80ff9
|
@ -111,24 +111,17 @@ lower_buffer_access::emit_access(void *mem_ctx,
|
||||||
ir_dereference *col_deref =
|
ir_dereference *col_deref =
|
||||||
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), col);
|
new(mem_ctx) ir_dereference_array(deref->clone(mem_ctx, NULL), col);
|
||||||
|
|
||||||
if (row_major) {
|
/* For a row-major matrix, the next column starts at the next
|
||||||
/* For a row-major matrix, the next column starts at the next
|
* element. Otherwise it is offset by the matrix stride.
|
||||||
* element.
|
*/
|
||||||
*/
|
const unsigned size_mul = row_major
|
||||||
int size_mul = deref->type->is_64bit() ? 8 : 4;
|
? (deref->type->is_double() ? 8 : 4)
|
||||||
emit_access(mem_ctx, is_write, col_deref, base_offset,
|
: link_calculate_matrix_stride(deref->type, row_major, packing);
|
||||||
deref_offset + i * size_mul,
|
|
||||||
row_major, deref->type, packing,
|
|
||||||
writemask_for_size(col_deref->type->vector_elements));
|
|
||||||
} else {
|
|
||||||
const int size_mul =
|
|
||||||
link_calculate_matrix_stride(deref->type, row_major, packing);
|
|
||||||
|
|
||||||
emit_access(mem_ctx, is_write, col_deref, base_offset,
|
emit_access(mem_ctx, is_write, col_deref, base_offset,
|
||||||
deref_offset + i * size_mul,
|
deref_offset + i * size_mul,
|
||||||
row_major, deref->type, packing,
|
row_major, deref->type, packing,
|
||||||
writemask_for_size(col_deref->type->vector_elements));
|
writemask_for_size(col_deref->type->vector_elements));
|
||||||
}
|
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue