mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 04:38:03 +02:00
st/xa: Support a couple of new formats
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com> Reviewed-by: Brian Paul <brianp@vmware.com>
This commit is contained in:
parent
258d20152a
commit
e1298def9f
2 changed files with 29 additions and 9 deletions
|
|
@ -89,6 +89,15 @@ xa_get_pipe_format(struct xa_tracker *xa, enum xa_formats xa_format)
|
|||
fdesc.xa_format = xa_format;
|
||||
|
||||
switch (xa_format) {
|
||||
case xa_format_a8:
|
||||
if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
|
||||
PIPE_TEXTURE_2D, 0, 0,
|
||||
stype_bind[xa_type_a] |
|
||||
PIPE_BIND_RENDER_TARGET))
|
||||
fdesc.format = PIPE_FORMAT_R8_UNORM;
|
||||
else
|
||||
fdesc.format = PIPE_FORMAT_L8_UNORM;
|
||||
break;
|
||||
case xa_format_a8r8g8b8:
|
||||
fdesc.format = PIPE_FORMAT_B8G8R8A8_UNORM;
|
||||
break;
|
||||
|
|
@ -101,15 +110,21 @@ xa_get_pipe_format(struct xa_tracker *xa, enum xa_formats xa_format)
|
|||
case xa_format_x1r5g5b5:
|
||||
fdesc.format = PIPE_FORMAT_B5G5R5A1_UNORM;
|
||||
break;
|
||||
case xa_format_a8:
|
||||
if (xa->screen->is_format_supported(xa->screen, PIPE_FORMAT_R8_UNORM,
|
||||
PIPE_TEXTURE_2D, 0, 0,
|
||||
stype_bind[xa_type_a] |
|
||||
PIPE_BIND_RENDER_TARGET))
|
||||
fdesc.format = PIPE_FORMAT_R8_UNORM;
|
||||
else
|
||||
fdesc.format = PIPE_FORMAT_L8_UNORM;
|
||||
break;
|
||||
case xa_format_a4r4g4b4:
|
||||
fdesc.format = PIPE_FORMAT_B4G4R4A4_UNORM;
|
||||
break;
|
||||
case xa_format_a2b10g10r10:
|
||||
fdesc.format = PIPE_FORMAT_R10G10B10A2_UNORM;
|
||||
break;
|
||||
case xa_format_x2b10g10r10:
|
||||
fdesc.format = PIPE_FORMAT_R10G10B10X2_UNORM;
|
||||
break;
|
||||
case xa_format_b8g8r8a8:
|
||||
fdesc.format = PIPE_FORMAT_A8R8G8B8_UNORM;
|
||||
break;
|
||||
case xa_format_b8g8r8x8:
|
||||
fdesc.format = PIPE_FORMAT_X8R8G8B8_UNORM;
|
||||
break;
|
||||
case xa_format_z24:
|
||||
fdesc.format = PIPE_FORMAT_Z24X8_UNORM;
|
||||
break;
|
||||
|
|
|
|||
|
|
@ -126,6 +126,11 @@ enum xa_formats {
|
|||
xa_format_x8r8g8b8 = xa_format(32, xa_type_argb, 0, 8, 8, 8),
|
||||
xa_format_r5g6b5 = xa_format(16, xa_type_argb, 0, 5, 6, 5),
|
||||
xa_format_x1r5g5b5 = xa_format(16, xa_type_argb, 0, 5, 5, 5),
|
||||
xa_format_a4r4g4b4 = xa_format(16, xa_type_argb, 4, 4, 4, 4),
|
||||
xa_format_a2b10g10r10 = xa_format(32, xa_type_abgr, 2, 10, 10, 10),
|
||||
xa_format_x2b10g10r10 = xa_format(32, xa_type_abgr, 0, 10, 10, 10),
|
||||
xa_format_b8g8r8a8 = xa_format(32, xa_type_bgra, 8, 8, 8, 8),
|
||||
xa_format_b8g8r8x8 = xa_format(32, xa_type_bgra, 0, 8, 8, 8),
|
||||
|
||||
xa_format_z16 = xa_format_c(16, xa_type_z, 16, 0),
|
||||
xa_format_z32 = xa_format_c(32, xa_type_z, 32, 0),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue