diff options
author | Rob Clark <[email protected]> | 2015-09-15 09:23:21 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2015-09-15 17:29:01 -0400 |
commit | 9124a49d54af5d7bd8230af4ba3eebfb167a7655 (patch) | |
tree | 2459d22c222a38509fa4c2ba126b5c0f0296f9bb /src/gallium/drivers/freedreno/freedreno_texture.h | |
parent | 76977222af3dcf6c0915830c7b7af06505f8cd9a (diff) |
freedreno: helper for a3xx/a4xx border-colors
Both use the same layout for the buffer containing border-color values,
so rather than duplicating the logic in a4xx, split it out into a
helper.
Signed-off-by: Rob Clark <[email protected]>
Diffstat (limited to 'src/gallium/drivers/freedreno/freedreno_texture.h')
-rw-r--r-- | src/gallium/drivers/freedreno/freedreno_texture.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/gallium/drivers/freedreno/freedreno_texture.h b/src/gallium/drivers/freedreno/freedreno_texture.h index 43571a9fa61..fa27d1c32af 100644 --- a/src/gallium/drivers/freedreno/freedreno_texture.h +++ b/src/gallium/drivers/freedreno/freedreno_texture.h @@ -41,4 +41,35 @@ void fd_set_sampler_views(struct pipe_context *pctx, unsigned shader, void fd_texture_init(struct pipe_context *pctx); +struct fd_texture_stateobj; + +/* Both a3xx/a4xx share the same layout for the border-color buffer, + * which contains the pre-swizzled (based on texture format) border + * color value, with the following layout (per sampler): + * + * offset | description + * -------+------------- + * 0x00: | fp16[0] \ + * | fp16[1] |___ swizzled fp16 channel values for "small float" + * | fp16[2] | formats (<= 16 bits per component, !integer) + * | fp16[3] / + * 0x08: | padding + * 0x10: | int16[0] \ + * | int16[1] |___ swizzled int16 channels for for "small integer" + * | int16[2] | formats (<= 16 bits per component, integer) + * | int16[3] / + * 0x18: | padding + * 0x20: | fp32[0] \ + * | fp32[1] |___ swizzled fp32 channel values for "large float" + * | fp32[2] | formats (> 16 bits per component, !integer) + * | fp32[3] / + * 0x30: | int32[0] \ + * | int32[1] |___ swizzled int32 channel values for "large int" + * | int32[2] | formats (> 16 bits per component, integer) + * | int32[3] / + */ +#define BORDERCOLOR_SIZE 0x40 +void fd_setup_border_colors(struct fd_texture_stateobj *tex, void *ptr, + unsigned offset); + #endif /* FREEDRENO_TEXTURE_H_ */ |