diff options
author | Eric Anholt <[email protected]> | 2019-12-02 16:44:52 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2019-12-04 20:32:15 -0800 |
commit | 1f4e8f3c46c8ca348e127eff2078bf0ae77a2a49 (patch) | |
tree | 34a18a37a208252d7b47f591fcdd4818e42afa32 /src | |
parent | 5b23671f6a3f5737c2fff9554214cbfd143e4ff9 (diff) |
turnip: Reuse tu6_stage2opcode() more.
A bit of cleanup for adding more stages later.
Reviewed-by: Jonathan Marek <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/freedreno/vulkan/tu_cmd_buffer.c | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/src/freedreno/vulkan/tu_cmd_buffer.c b/src/freedreno/vulkan/tu_cmd_buffer.c index b5da64627ef..516bbc19e5b 100644 --- a/src/freedreno/vulkan/tu_cmd_buffer.c +++ b/src/freedreno/vulkan/tu_cmd_buffer.c @@ -2413,27 +2413,24 @@ tu6_emit_textures(struct tu_device *device, struct tu_cs *draw_state, if (!size) return (struct tu_cs_entry) {}; - unsigned opcode, tex_samp_reg, tex_const_reg, tex_count_reg; + unsigned tex_samp_reg, tex_const_reg, tex_count_reg; enum a6xx_state_block sb; switch (type) { case MESA_SHADER_VERTEX: sb = SB6_VS_TEX; - opcode = CP_LOAD_STATE6_GEOM; tex_samp_reg = REG_A6XX_SP_VS_TEX_SAMP_LO; tex_const_reg = REG_A6XX_SP_VS_TEX_CONST_LO; tex_count_reg = REG_A6XX_SP_VS_TEX_COUNT; break; case MESA_SHADER_FRAGMENT: sb = SB6_FS_TEX; - opcode = CP_LOAD_STATE6_FRAG; tex_samp_reg = REG_A6XX_SP_FS_TEX_SAMP_LO; tex_const_reg = REG_A6XX_SP_FS_TEX_CONST_LO; tex_count_reg = REG_A6XX_SP_FS_TEX_COUNT; break; case MESA_SHADER_COMPUTE: sb = SB6_CS_TEX; - opcode = CP_LOAD_STATE6_FRAG; tex_samp_reg = REG_A6XX_SP_CS_TEX_SAMP_LO; tex_const_reg = REG_A6XX_SP_CS_TEX_CONST_LO; tex_count_reg = REG_A6XX_SP_CS_TEX_COUNT; @@ -2469,7 +2466,7 @@ tu6_emit_textures(struct tu_device *device, struct tu_cs *draw_state, tu_cs_begin_sub_stream(device, draw_state, 64, &cs); /* output sampler state: */ - tu_cs_emit_pkt7(&cs, opcode, 3); + tu_cs_emit_pkt7(&cs, tu6_stage2opcode(type), 3); tu_cs_emit(&cs, CP_LOAD_STATE6_0_DST_OFF(0) | CP_LOAD_STATE6_0_STATE_TYPE(ST6_SHADER) | CP_LOAD_STATE6_0_STATE_SRC(SS6_INDIRECT) | @@ -2481,7 +2478,7 @@ tu6_emit_textures(struct tu_device *device, struct tu_cs *draw_state, tu_cs_emit_qw(&cs, samp_addr); /* SRC_ADDR_LO/HI */ /* emit texture state: */ - tu_cs_emit_pkt7(&cs, opcode, 3); + tu_cs_emit_pkt7(&cs, tu6_stage2opcode(type), 3); tu_cs_emit(&cs, CP_LOAD_STATE6_0_DST_OFF(0) | CP_LOAD_STATE6_0_STATE_TYPE(ST6_CONSTANTS) | CP_LOAD_STATE6_0_STATE_SRC(SS6_INDIRECT) | |