diff options
Diffstat (limited to 'mesalib/src/mesa/state_tracker/st_format.c')
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_format.c | 42 |
1 files changed, 23 insertions, 19 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index de30b4fc6..dc8551dfe 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -595,6 +595,14 @@ struct format_mapping PIPE_FORMAT_A8B8G8R8_SRGB, \ 0 +#define DEFAULT_DEPTH_FORMATS \ + PIPE_FORMAT_Z24X8_UNORM, \ + PIPE_FORMAT_X8Z24_UNORM, \ + PIPE_FORMAT_Z16_UNORM, \ + PIPE_FORMAT_Z24_UNORM_S8_USCALED, \ + PIPE_FORMAT_S8_USCALED_Z24_UNORM, \ + 0 + /** * This table maps OpenGL texture format enums to Gallium pipe_format enums. * Multiple GL enums might map to multiple pipe_formats. @@ -604,7 +612,7 @@ static struct format_mapping format_map[] = { /* Basic RGB, RGBA formats */ { { GL_RGB10, GL_RGB10_A2, 0 }, - { PIPE_FORMAT_B10G10R10A2_UNORM, 0 } + { PIPE_FORMAT_B10G10R10A2_UNORM, DEFAULT_RGBA_FORMATS } }, { { 4, GL_RGBA, GL_RGBA8, 0 }, @@ -612,7 +620,7 @@ static struct format_mapping format_map[] = { }, { { GL_BGRA, 0 }, - { PIPE_FORMAT_B8G8R8A8_UNORM, DEFAULT_RGB_FORMATS, 0 } + { PIPE_FORMAT_B8G8R8A8_UNORM, DEFAULT_RGBA_FORMATS } }, { { 3, GL_RGB, GL_RGB8, 0 }, @@ -620,7 +628,7 @@ static struct format_mapping format_map[] = { }, { { GL_RGB12, GL_RGB16, GL_RGBA12, GL_RGBA16, 0 }, - { PIPE_FORMAT_R16G16B16A16_UNORM, DEFAULT_RGB_FORMATS, 0 } + { PIPE_FORMAT_R16G16B16A16_UNORM, DEFAULT_RGBA_FORMATS } }, { { GL_RGBA4, GL_RGBA2, 0 }, @@ -628,7 +636,7 @@ static struct format_mapping format_map[] = { }, { { GL_RGB5_A1, 0 }, - { PIPE_FORMAT_B5G5R5A1_UNORM, DEFAULT_RGBA_FORMATS, 0 } + { PIPE_FORMAT_B5G5R5A1_UNORM, DEFAULT_RGBA_FORMATS } }, { { GL_R3_G3_B2, 0 }, @@ -655,11 +663,11 @@ static struct format_mapping format_map[] = { /* basic Luminance formats */ { { GL_LUMINANCE12, GL_LUMINANCE16, 0 }, - { PIPE_FORMAT_L16_UNORM, PIPE_FORMAT_L8_UNORM, DEFAULT_RGBA_FORMATS, 0 } + { PIPE_FORMAT_L16_UNORM, PIPE_FORMAT_L8_UNORM, DEFAULT_RGB_FORMATS } }, { { 1, GL_LUMINANCE, GL_LUMINANCE4, GL_LUMINANCE8, 0 }, - { PIPE_FORMAT_L8_UNORM, DEFAULT_RGBA_FORMATS } + { PIPE_FORMAT_L8_UNORM, DEFAULT_RGB_FORMATS } }, /* basic Luminance/Alpha formats */ @@ -667,7 +675,7 @@ static struct format_mapping format_map[] = { { GL_LUMINANCE12_ALPHA4, GL_LUMINANCE12_ALPHA12, GL_LUMINANCE16_ALPHA16, 0}, { PIPE_FORMAT_L16A16_UNORM, PIPE_FORMAT_L8A8_UNORM, - PIPE_FORMAT_L8A8_UNORM, DEFAULT_RGBA_FORMATS } + DEFAULT_RGBA_FORMATS } }, { { 2, GL_LUMINANCE_ALPHA, GL_LUMINANCE6_ALPHA2, GL_LUMINANCE8_ALPHA8, 0 }, @@ -675,7 +683,7 @@ static struct format_mapping format_map[] = { }, { { GL_LUMINANCE4_ALPHA4, 0 }, - { PIPE_FORMAT_L4A4_UNORM, PIPE_FORMAT_L4A4_UNORM, + { PIPE_FORMAT_L4A4_UNORM, PIPE_FORMAT_L8A8_UNORM, DEFAULT_RGBA_FORMATS } }, @@ -699,11 +707,11 @@ static struct format_mapping format_map[] = { /* compressed formats */ /* XXX PIPE_BIND_SAMPLER_VIEW only */ { { GL_COMPRESSED_RGB, 0 }, - { PIPE_FORMAT_DXT1_RGB, 0 } + { PIPE_FORMAT_DXT1_RGB, DEFAULT_RGB_FORMATS } }, { { GL_COMPRESSED_RGBA, 0 }, - { PIPE_FORMAT_DXT5_RGBA, 0 } + { PIPE_FORMAT_DXT5_RGBA, DEFAULT_RGBA_FORMATS } }, { { GL_RGB_S3TC, GL_RGB4_S3TC, GL_COMPRESSED_RGB_S3TC_DXT1_EXT, 0 }, @@ -729,31 +737,27 @@ static struct format_mapping format_map[] = { }, { { GL_COMPRESSED_RGBA_FXT1_3DFX, 0 }, - { PIPE_FORMAT_RGB_FXT1, 0 } + { PIPE_FORMAT_RGBA_FXT1, 0 } }, #endif /* Depth formats */ { { GL_DEPTH_COMPONENT16, 0 }, - { PIPE_FORMAT_Z16_UNORM, PIPE_FORMAT_Z24_UNORM_S8_USCALED, - PIPE_FORMAT_S8_USCALED_Z24_UNORM, PIPE_FORMAT_Z32_UNORM, 0 } + { PIPE_FORMAT_Z16_UNORM, DEFAULT_DEPTH_FORMATS } }, { { GL_DEPTH_COMPONENT24, 0 }, { PIPE_FORMAT_Z24X8_UNORM, PIPE_FORMAT_X8Z24_UNORM, - PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_S8_USCALED_Z24_UNORM, - PIPE_FORMAT_Z32_UNORM, 0 } + DEFAULT_DEPTH_FORMATS } }, { { GL_DEPTH_COMPONENT32, 0 }, - { PIPE_FORMAT_Z32_UNORM, 0 } + { PIPE_FORMAT_Z32_UNORM, DEFAULT_DEPTH_FORMATS } }, { { GL_DEPTH_COMPONENT, 0 }, - { PIPE_FORMAT_Z24X8_UNORM, PIPE_FORMAT_X8Z24_UNORM, - PIPE_FORMAT_Z32_UNORM, PIPE_FORMAT_Z16_UNORM, - PIPE_FORMAT_Z24_UNORM_S8_USCALED, PIPE_FORMAT_S8_USCALED_Z24_UNORM, 0 } + { DEFAULT_DEPTH_FORMATS } }, /* stencil formats */ |