diff options
author | Kristian H. Kristensen <[email protected]> | 2019-06-05 21:35:35 -0700 |
---|---|---|
committer | Rob Clark <[email protected]> | 2019-06-07 07:33:03 -0700 |
commit | 0ef00ceb2e686dda38dbc4d057fd30460e7f52d5 (patch) | |
tree | 0ece7c2ef71836b2ff9a36a7656dcfd09a6db5da /src/gallium/drivers/freedreno/a6xx/fd6_emit.h | |
parent | 4552162e2d4aa03078d2c7ac7d903ff92126640b (diff) |
freedreno/a6xx: Share shader_t_to_opcode
We have a similar function in fd6_program.c. Move to fd6_emit.h and
share.
Reviewed-by: Rob Clark <[email protected]>
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/a6xx/fd6_emit.h')
-rw-r--r-- | src/gallium/drivers/freedreno/a6xx/fd6_emit.h | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h index 5c86b992740..691467a0786 100644 --- a/src/gallium/drivers/freedreno/a6xx/fd6_emit.h +++ b/src/gallium/drivers/freedreno/a6xx/fd6_emit.h @@ -186,6 +186,24 @@ fd6_emit_lrz_flush(struct fd_ringbuffer *ring) OUT_RING(ring, LRZ_FLUSH); } +static inline uint32_t +fd6_stage2opcode(gl_shader_stage type) +{ + switch (type) { + case MESA_SHADER_VERTEX: + case MESA_SHADER_TESS_CTRL: + case MESA_SHADER_TESS_EVAL: + case MESA_SHADER_GEOMETRY: + return CP_LOAD_STATE6_GEOM; + case MESA_SHADER_FRAGMENT: + case MESA_SHADER_COMPUTE: + case MESA_SHADER_KERNEL: + return CP_LOAD_STATE6_FRAG; + default: + unreachable("bad shader type"); + } +} + static inline enum a6xx_state_block fd6_stage2shadersb(gl_shader_stage type) { |