It's the same thing, just shifted.
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
int address = word->address;
- if (word->op == midgard_op_ld_uniform_32) {
- /* Uniforms use their own addressing scheme */
+ if (OP_IS_UBO_READ(word->op)) {
+ /* UBOs use their own addressing scheme */
int lo = word->varying_parameters >> 7;
int hi = word->address;
)
#define OP_IS_UBO_READ(op) ( \
- op == midgard_op_ld_uniform_32 || \
- op == midgard_op_ld_uniform_16 || \
- op == midgard_op_ld_uniform_32i \
+ op == midgard_op_ld_ubo_char || \
+ op == midgard_op_ld_ubo_char2 || \
+ op == midgard_op_ld_ubo_char4 || \
+ op == midgard_op_ld_ubo_short4 || \
+ op == midgard_op_ld_ubo_int4 \
)
#define OP_IS_CSEL(op) ( \
midgard_op_ld_vary_32i = 0x9B,
midgard_op_ld_color_buffer_16 = 0x9D,
- midgard_op_ld_uniform_16 = 0xAC,
- midgard_op_ld_uniform_32i = 0xA8,
+ /* The distinction between these ops is the alignment requirement /
+ * accompanying shift. Thus, the offset to ld_ubo_int4 is in 16-byte
+ * units and can load 128-bit. The offset to ld_ubo_short4 is in 8-byte
+ * units; ld_ubo_char4 in 4-byte units. ld_ubo_char/ld_ubo_char2 are
+ * purely theoretical (never seen in the wild) since int8/int16/fp16
+ * UBOs don't really exist. The ops are still listed to maintain
+ * symmetry with generic I/O ops. */
+
+ midgard_op_ld_ubo_char = 0xA0, /* theoretical */
+ midgard_op_ld_ubo_char2 = 0xA4, /* theoretical */
+ midgard_op_ld_ubo_char4 = 0xA8,
+ midgard_op_ld_ubo_short4 = 0xAC,
+ midgard_op_ld_ubo_int4 = 0xB0,
- midgard_op_ld_uniform_32 = 0xB0,
midgard_op_ld_color_buffer_8 = 0xBA,
midgard_op_st_char = 0xC0,
M_LOAD(ld_attr_32);
//M_LOAD(ld_vary_16);
M_LOAD(ld_vary_32);
-//M_LOAD(ld_uniform_16);
-M_LOAD(ld_uniform_32);
+M_LOAD(ld_ubo_int4);
M_LOAD(ld_int4);
M_STORE(st_int4);
M_LOAD(ld_color_buffer_8);
{
/* TODO: half-floats */
- midgard_instruction ins = m_ld_uniform_32(dest, offset);
+ midgard_instruction ins = m_ld_ubo_int4(dest, offset);
/* TODO: Don't split */
ins.load_store.varying_parameters = (offset & 7) << 7;
[midgard_op_ld_vary_32i] = "ld_vary_32i",
[midgard_op_ld_vary_32u] = "ld_vary_32u",
+ [midgard_op_ld_color_buffer_8] = "ld_color_buffer_8",
[midgard_op_ld_color_buffer_16] = "ld_color_buffer_16",
- [midgard_op_ld_uniform_16] = "ld_uniform_16",
- [midgard_op_ld_uniform_32] = "ld_uniform_32",
- [midgard_op_ld_uniform_32i] = "ld_uniform_32i",
- [midgard_op_ld_color_buffer_8] = "ld_color_buffer_8",
+ [midgard_op_ld_ubo_char] = "ld_ubo_char",
+ [midgard_op_ld_ubo_char2] = "ld_ubo_char2",
+ [midgard_op_ld_ubo_char4] = "ld_ubo_char4",
+ [midgard_op_ld_ubo_short4] = "ld_ubo_short4",
+ [midgard_op_ld_ubo_int4] = "ld_ubo_int4",
[midgard_op_st_char] = "st_char",
[midgard_op_st_char2] = "st_char2",