diff options
author | Rob Clark <[email protected]> | 2017-04-05 19:43:31 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-04-17 14:00:05 -0400 |
commit | 3c5d309477c2667ad3cbc370ad0566480f39b95d (patch) | |
tree | 1a8106af9ec0d723620bde422db56dd6df0a0f76 /src/gallium/drivers/freedreno/freedreno_util.h | |
parent | 9567beab36f3ac0f0d326e0e81f370d80e56a5a8 (diff) |
freedreno: extract helper for stage->sb for a4xx+
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_util.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_util.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_util.h b/src/gallium/drivers/freedreno/freedreno_util.h index a9b38c93759..e6444337900 100644 --- a/src/gallium/drivers/freedreno/freedreno_util.h +++ b/src/gallium/drivers/freedreno/freedreno_util.h @@ -449,4 +449,27 @@ pack_rgba(enum pipe_format format, const float *rgba) #define foreach_bit(b, mask) \ for (uint32_t _m = (mask); _m && ({(b) = u_bit_scan(&_m); 1;});) + +#define BIT(bit) (1u << bit) + +/* + * a4xx+ helpers: + */ + +static inline enum a4xx_state_block +fd4_stage2shadersb(enum shader_t type) +{ + switch (type) { + case SHADER_VERTEX: + return SB4_VS_SHADER; + case SHADER_FRAGMENT: + return SB4_FS_SHADER; + case SHADER_COMPUTE: + return SB4_CS_SHADER; + default: + unreachable("bad shader type"); + return ~0; + } +} + #endif /* FREEDRENO_UTIL_H_ */ |