summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/lima/lima_texture.c
diff options
context:
space:
mode:
authorVasily Khoruzhick <[email protected]>2019-04-06 22:55:36 -0700
committerQiang Yu <[email protected]>2019-04-14 01:16:00 +0000
commitfef2f10cc2ad298f179d5a5aa0a210fbea02d95f (patch)
tree884a908a3647f88aaf99f84d99238ea860a03fd3 /src/gallium/drivers/lima/lima_texture.c
parenta817f0fec6e3d3bbbfb8df0349c0085710b5aad4 (diff)
lima: add support for depth/stencil fbo attachments and textures
Hardware supports writing back Z/S buffers and sampling from them, so add support for that. Signed-off-by: Vasily Khoruzhick <[email protected]> Reviewed-by: Qiang Yu <[email protected]> Tested-by: Icenowy Zheng <[email protected]>
Diffstat (limited to 'src/gallium/drivers/lima/lima_texture.c')
-rw-r--r--src/gallium/drivers/lima/lima_texture.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/gallium/drivers/lima/lima_texture.c b/src/gallium/drivers/lima/lima_texture.c
index 548d9839ff0..90af0dec74b 100644
--- a/src/gallium/drivers/lima/lima_texture.c
+++ b/src/gallium/drivers/lima/lima_texture.c
@@ -40,9 +40,11 @@
#include <drm-uapi/lima_drm.h>
#define LIMA_TEXEL_FORMAT_BGR_565 0x0e
+#define LIMA_TEXEL_FORMAT_Z16 0x12
#define LIMA_TEXEL_FORMAT_RGB_888 0x15
#define LIMA_TEXEL_FORMAT_RGBA_8888 0x16
#define LIMA_TEXEL_FORMAT_RGBX_8888 0x17
+#define LIMA_TEXEL_FORMAT_Z24S8 0x2c
#define lima_tex_list_size 64
@@ -68,6 +70,13 @@ static uint32_t pipe_format_to_lima(enum pipe_format pformat)
case PIPE_FORMAT_B5G6R5_UNORM:
format = LIMA_TEXEL_FORMAT_BGR_565;
break;
+ case PIPE_FORMAT_Z24_UNORM_S8_UINT:
+ case PIPE_FORMAT_Z24X8_UNORM:
+ format = LIMA_TEXEL_FORMAT_Z24S8;
+ break;
+ case PIPE_FORMAT_Z16_UNORM:
+ format = LIMA_TEXEL_FORMAT_Z16;
+ break;
default:
assert(0);
break;