aboutsummaryrefslogtreecommitdiffstats
path: root/src/freedreno
diff options
context:
space:
mode:
authorJonathan Marek <[email protected]>2019-10-06 21:07:57 -0400
committerJonathan Marek <[email protected]>2019-10-15 07:56:20 -0400
commite3360768384f34df38abc25d037e329599211d21 (patch)
treeda23a062d5e9f324da6b854b3e4710c1a6624e88 /src/freedreno
parent29464712ce959f9cc009e8663bd33c98069581f8 (diff)
turnip: fixup consts
Fix some mistakes in previous series. Signed-off-by: Jonathan Marek <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]>
Diffstat (limited to 'src/freedreno')
-rw-r--r--src/freedreno/vulkan/tu_cmd_buffer.c5
-rw-r--r--src/freedreno/vulkan/tu_pipeline.c6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c
index e1b4589451b..d701ae5fba7 100644
--- a/src/freedreno/vulkan/tu_cmd_buffer.c
+++ b/src/freedreno/vulkan/tu_cmd_buffer.c
@@ -2209,16 +2209,13 @@ tu6_emit_user_consts(struct tu_cs *cs, const struct tu_pipeline *pipeline,
debug_assert((size % 16) == 0);
debug_assert((offset % 16) == 0);
- uint64_t addr = (uint64_t) ptr[1] << 32 | ptr[0];
- addr += state->range[i].offset;
-
tu_cs_emit_pkt7(cs, tu6_stage2opcode(type), 3);
tu_cs_emit(cs, CP_LOAD_STATE6_0_DST_OFF(state->range[i].offset / 16) |
CP_LOAD_STATE6_0_STATE_TYPE(ST6_CONSTANTS) |
CP_LOAD_STATE6_0_STATE_SRC(SS6_INDIRECT) |
CP_LOAD_STATE6_0_STATE_BLOCK(tu6_stage2shadersb(type)) |
CP_LOAD_STATE6_0_NUM_UNIT(size / 16));
- tu_cs_emit_qw(cs, addr);
+ tu_cs_emit_qw(cs, ((uint64_t) ptr[1] << 32 | ptr[0]) + offset);
}
}
}
diff --git a/src/freedreno/vulkan/tu_pipeline.c b/src/freedreno/vulkan/tu_pipeline.c
index 54239280daa..667c106b6ac 100644
--- a/src/freedreno/vulkan/tu_pipeline.c
+++ b/src/freedreno/vulkan/tu_pipeline.c
@@ -904,6 +904,10 @@ static void
tu6_emit_immediates(struct tu_cs *cs, const struct ir3_shader_variant *v,
uint32_t opcode, enum a6xx_state_block block)
{
+ /* dummy variant */
+ if (!v->shader)
+ return;
+
const struct ir3_const_state *const_state = &v->shader->const_state;
uint32_t base = const_state->offsets.immediate;
int size = const_state->immediates_count;
@@ -920,7 +924,7 @@ tu6_emit_immediates(struct tu_cs *cs, const struct ir3_shader_variant *v,
tu_cs_emit(cs, CP_LOAD_STATE6_0_DST_OFF(base) |
CP_LOAD_STATE6_0_STATE_TYPE(ST6_CONSTANTS) |
CP_LOAD_STATE6_0_STATE_SRC(SS6_DIRECT) |
- CP_LOAD_STATE6_0_STATE_BLOCK(SB6_FS_SHADER) |
+ CP_LOAD_STATE6_0_STATE_BLOCK(block) |
CP_LOAD_STATE6_0_NUM_UNIT(size));
tu_cs_emit(cs, CP_LOAD_STATE6_1_EXT_SRC_ADDR(0));
tu_cs_emit(cs, CP_LOAD_STATE6_2_EXT_SRC_ADDR_HI(0));