diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/formats.c | 26 | ||||
-rw-r--r-- | src/mesa/main/formats.csv | 12 | ||||
-rw-r--r-- | src/mesa/main/formats.h | 12 | ||||
-rw-r--r-- | src/mesa/main/framebuffer.c | 3 | ||||
-rw-r--r-- | src/mesa/main/shaderimage.c | 24 | ||||
-rw-r--r-- | src/mesa/main/texcompress_rgtc.c | 3 | ||||
-rw-r--r-- | src/mesa/main/texformat.c | 10 | ||||
-rw-r--r-- | src/mesa/main/teximage.c | 4 |
8 files changed, 32 insertions, 62 deletions
diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index 80f3048e112..7767249c190 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -710,9 +710,9 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_R_RGTC1_SNORM: return MESA_FORMAT_R_SNORM8; case MESA_FORMAT_RG_RGTC2_UNORM: - return MESA_FORMAT_R8G8_UNORM; + return MESA_FORMAT_RG_UNORM8; case MESA_FORMAT_RG_RGTC2_SNORM: - return MESA_FORMAT_R8G8_SNORM; + return MESA_FORMAT_RG_SNORM8; case MESA_FORMAT_L_LATC1_UNORM: return MESA_FORMAT_L_UNORM8; case MESA_FORMAT_L_LATC1_SNORM: @@ -738,7 +738,7 @@ _mesa_get_uncompressed_format(mesa_format format) return MESA_FORMAT_R_UNORM16; case MESA_FORMAT_ETC2_RG11_EAC: case MESA_FORMAT_ETC2_SIGNED_RG11_EAC: - return MESA_FORMAT_R16G16_UNORM; + return MESA_FORMAT_RG_UNORM16; case MESA_FORMAT_BPTC_RGBA_UNORM: case MESA_FORMAT_BPTC_SRGB_ALPHA_UNORM: return MESA_FORMAT_A8B8G8R8_UNORM; @@ -947,15 +947,13 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format, return; case MESA_FORMAT_LA_UNORM8: - case MESA_FORMAT_R8G8_UNORM: - case MESA_FORMAT_G8R8_UNORM: + case MESA_FORMAT_RG_UNORM8: *datatype = GL_UNSIGNED_BYTE; *comps = 2; return; case MESA_FORMAT_LA_UNORM16: - case MESA_FORMAT_R16G16_UNORM: - case MESA_FORMAT_G16R16_UNORM: + case MESA_FORMAT_RG_UNORM16: *datatype = GL_UNSIGNED_SHORT; *comps = 2; return; @@ -1068,7 +1066,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format, *datatype = GL_BYTE; *comps = 1; return; - case MESA_FORMAT_R8G8_SNORM: + case MESA_FORMAT_RG_SNORM8: case MESA_FORMAT_LA_SNORM8: *datatype = GL_BYTE; *comps = 2; @@ -1092,7 +1090,7 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format, *datatype = GL_SHORT; *comps = 1; return; - case MESA_FORMAT_R16G16_SNORM: + case MESA_FORMAT_RG_SNORM16: case MESA_FORMAT_LA_SNORM16: *datatype = GL_SHORT; *comps = 2; @@ -1405,16 +1403,6 @@ _mesa_uncompressed_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_G8R8_SNORM: - *datatype = GL_BYTE; - *comps = 2; - return; - - case MESA_FORMAT_G16R16_SNORM: - *datatype = GL_SHORT; - *comps = 2; - return; - case MESA_FORMAT_B8G8R8X8_SRGB: case MESA_FORMAT_X8R8G8B8_SRGB: *datatype = GL_UNSIGNED_BYTE; diff --git a/src/mesa/main/formats.csv b/src/mesa/main/formats.csv index 764134d25f5..bd0975a9192 100644 --- a/src/mesa/main/formats.csv +++ b/src/mesa/main/formats.csv @@ -70,13 +70,9 @@ MESA_FORMAT_X1B5G5R5_UNORM , packed, 1, 1, 1, x1 , un5 , un5 , u MESA_FORMAT_B5G5R5A1_UNORM , packed, 1, 1, 1, un5 , un5 , un5 , un1 , zyxw, rgb MESA_FORMAT_B5G5R5X1_UNORM , packed, 1, 1, 1, un5 , un5 , un5 , x1 , zyx1, rgb MESA_FORMAT_A1R5G5B5_UNORM , packed, 1, 1, 1, un1 , un5 , un5 , un5 , yzwx, rgb -MESA_FORMAT_R8G8_UNORM , packed, 1, 1, 1, un8 , un8 , , , xy01, rgb -MESA_FORMAT_G8R8_UNORM , packed, 1, 1, 1, un8 , un8 , , , yx01, rgb MESA_FORMAT_L4A4_UNORM , packed, 1, 1, 1, un4 , un4 , , , xxxy, rgb MESA_FORMAT_B2G3R3_UNORM , packed, 1, 1, 1, un2 , un3 , un3 , , zyx1, rgb -MESA_FORMAT_R16G16_UNORM , packed, 1, 1, 1, un16, un16, , , xy01, rgb -MESA_FORMAT_G16R16_UNORM , packed, 1, 1, 1, un16, un16, , , yx01, rgb MESA_FORMAT_B10G10R10A2_UNORM , packed, 1, 1, 1, un10, un10, un10, un2 , zyxw, rgb MESA_FORMAT_B10G10R10X2_UNORM , packed, 1, 1, 1, un10, un10, un10, x2 , zyx1, rgb MESA_FORMAT_R10G10B10A2_UNORM , packed, 1, 1, 1, un10, un10, un10, un2 , xyzw, rgb @@ -108,6 +104,8 @@ MESA_FORMAT_I_UNORM8 , array , 1, 1, 1, un8 , , , MESA_FORMAT_I_UNORM16 , array , 1, 1, 1, un16, , , , xxxx, rgb MESA_FORMAT_R_UNORM8 , array , 1, 1, 1, un8 , , , , x001, rgb MESA_FORMAT_R_UNORM16 , array , 1, 1, 1, un16, , , , x001, rgb +MESA_FORMAT_RG_UNORM8 , array , 1, 1, 1, un8 , un8 , , , xy01, rgb +MESA_FORMAT_RG_UNORM16 , array , 1, 1, 1, un16, un16, , , xy01, rgb MESA_FORMAT_BGR_UNORM8 , array , 1, 1, 1, un8 , un8 , un8 , , zyx1, rgb MESA_FORMAT_RGB_UNORM8 , array , 1, 1, 1, un8 , un8 , un8 , , xyz1, rgb MESA_FORMAT_RGBA_UNORM16 , array , 1, 1, 1, un16, un16, un16, un16, xyzw, rgb @@ -122,10 +120,6 @@ MESA_FORMAT_A8B8G8R8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , s MESA_FORMAT_X8B8G8R8_SNORM , packed, 1, 1, 1, x8 , sn8 , sn8 , sn8 , wzy1, rgb MESA_FORMAT_R8G8B8A8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , sn8 , xyzw, rgb MESA_FORMAT_R8G8B8X8_SNORM , packed, 1, 1, 1, sn8 , sn8 , sn8 , x8 , xyz1, rgb -MESA_FORMAT_R16G16_SNORM , packed, 1, 1, 1, sn16, sn16, , , xy01, rgb -MESA_FORMAT_G16R16_SNORM , packed, 1, 1, 1, sn16, sn16, , , yx01, rgb -MESA_FORMAT_R8G8_SNORM , packed, 1, 1, 1, sn8 , sn8 , , , xy01, rgb -MESA_FORMAT_G8R8_SNORM , packed, 1, 1, 1, sn8 , sn8 , , , yx01, rgb # Array signed/normalized formats MESA_FORMAT_A_SNORM8 , array , 1, 1, 1, sn8 , , , , 000x, rgb @@ -138,6 +132,8 @@ MESA_FORMAT_R_SNORM8 , array , 1, 1, 1, sn8 , , , MESA_FORMAT_R_SNORM16 , array , 1, 1, 1, sn16, , , , x001, rgb MESA_FORMAT_LA_SNORM8 , array , 1, 1, 1, sn8 , sn8 , , , xxxy, rgb MESA_FORMAT_LA_SNORM16 , array , 1, 1, 1, sn16, sn16, , , xxxy, rgb +MESA_FORMAT_RG_SNORM8 , array , 1, 1, 1, sn8 , sn8 , , , xy01, rgb +MESA_FORMAT_RG_SNORM16 , array , 1, 1, 1, sn16, sn16, , , xy01, rgb MESA_FORMAT_RGB_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, , xyz1, rgb MESA_FORMAT_RGBA_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, sn16, xyzw, rgb MESA_FORMAT_RGBX_SNORM16 , array , 1, 1, 1, sn16, sn16, sn16, x16 , xyz1, rgb diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index 404447b7fc4..2f0768c0828 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -367,13 +367,9 @@ typedef enum MESA_FORMAT_B5G5R5A1_UNORM, /* ARRR RRGG GGGB BBBB */ MESA_FORMAT_B5G5R5X1_UNORM, /* xRRR RRGG GGGB BBBB */ MESA_FORMAT_A1R5G5B5_UNORM, /* BBBB BGGG GGRR RRRA */ - MESA_FORMAT_R8G8_UNORM, /* GGGG GGGG RRRR RRRR */ - MESA_FORMAT_G8R8_UNORM, /* RRRR RRRR GGGG GGGG */ MESA_FORMAT_L4A4_UNORM, /* AAAA LLLL */ MESA_FORMAT_B2G3R3_UNORM, /* RRRG GGBB */ - MESA_FORMAT_R16G16_UNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ - MESA_FORMAT_G16R16_UNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ MESA_FORMAT_B10G10R10A2_UNORM,/* AARR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ MESA_FORMAT_B10G10R10X2_UNORM,/* xxRR RRRR RRRR GGGG GGGG GGBB BBBB BBBB */ MESA_FORMAT_R10G10B10A2_UNORM,/* AABB BBBB BBBB GGGG GGGG GGRR RRRR RRRR */ @@ -406,6 +402,8 @@ typedef enum MESA_FORMAT_I_UNORM16, /* ushort[i] = I */ MESA_FORMAT_R_UNORM8, /* ubyte[i] = R */ MESA_FORMAT_R_UNORM16, /* ushort[i] = R */ + MESA_FORMAT_RG_UNORM8, /* ubyte[i * 2] = R, [i * 2 + 1] = G */ + MESA_FORMAT_RG_UNORM16, /* ushort[i * 2] = R, [i * 2 + 1] = G */ MESA_FORMAT_BGR_UNORM8, /* ubyte[i*3] = B, [i*3+1] = G, [i*3+2] = R */ MESA_FORMAT_RGB_UNORM8, /* ubyte[i*3] = R, [i*3+1] = G, [i*3+2] = B */ MESA_FORMAT_RGBA_UNORM16, /* ushort[i] = R, [1] = G, [2] = B, [3] = A */ @@ -422,10 +420,6 @@ typedef enum MESA_FORMAT_X8B8G8R8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ MESA_FORMAT_R8G8B8A8_SNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ MESA_FORMAT_R8G8B8X8_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ - MESA_FORMAT_R16G16_SNORM, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ - MESA_FORMAT_G16R16_SNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ - MESA_FORMAT_R8G8_SNORM, /* GGGG GGGG RRRR RRRR */ - MESA_FORMAT_G8R8_SNORM, /* RRRR RRRR GGGG GGGG */ /* Array signed/normalized formats */ MESA_FORMAT_A_SNORM8, /* byte[i] = A */ @@ -438,6 +432,8 @@ typedef enum MESA_FORMAT_R_SNORM16, /* short[i] = R */ MESA_FORMAT_LA_SNORM8, /* byte[i * 2] = L, [i * 2 + 1] = A */ MESA_FORMAT_LA_SNORM16, /* short[i * 2] = L, [i * 2 + 1] = A */ + MESA_FORMAT_RG_SNORM8, /* byte[i * 2] = R, [i * 2 + 1] = G */ + MESA_FORMAT_RG_SNORM16, /* short[i * 2] = R, [i * 2 + 1] = G */ MESA_FORMAT_RGB_SNORM16, /* short[i*3] = R, [i*3+1] = G, [i*3+2] = B */ MESA_FORMAT_RGBA_SNORM16, /* ... */ MESA_FORMAT_RGBX_SNORM16, /* ... */ diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 9246a0465a6..8e7778019f8 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -852,8 +852,7 @@ _mesa_get_color_read_format(struct gl_context *ctx, return GL_RGB; case MESA_FORMAT_RG_FLOAT32: case MESA_FORMAT_RG_FLOAT16: - case MESA_FORMAT_R8G8_UNORM: - case MESA_FORMAT_R8G8_SNORM: + case MESA_FORMAT_RG_UNORM8: return GL_RG; case MESA_FORMAT_RG_SINT32: case MESA_FORMAT_RG_UINT32: diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index a5e85b02afc..3f5dc16f2ff 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -45,18 +45,10 @@ */ #ifdef MESA_BIG_ENDIAN # define MESA_FORMAT_RGBA_8 MESA_FORMAT_A8B8G8R8_UNORM -# define MESA_FORMAT_RG_16 MESA_FORMAT_G16R16_UNORM -# define MESA_FORMAT_RG_8 MESA_FORMAT_G8R8_UNORM # define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_A8B8G8R8_SNORM -# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_G16R16_SNORM -# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_G8R8_SNORM #else # define MESA_FORMAT_RGBA_8 MESA_FORMAT_R8G8B8A8_UNORM -# define MESA_FORMAT_RG_16 MESA_FORMAT_R16G16_UNORM -# define MESA_FORMAT_RG_8 MESA_FORMAT_R8G8_UNORM # define MESA_FORMAT_SIGNED_RGBA_8 MESA_FORMAT_R8G8B8A8_SNORM -# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_R16G16_SNORM -# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_R8G8_SNORM #endif mesa_format @@ -151,10 +143,10 @@ _mesa_get_shader_image_format(GLenum format) return MESA_FORMAT_RGBA_8; case GL_RG16: - return MESA_FORMAT_RG_16; + return MESA_FORMAT_RG_UNORM16; case GL_RG8: - return MESA_FORMAT_RG_8; + return MESA_FORMAT_RG_UNORM8; case GL_R16: return MESA_FORMAT_R_UNORM16; @@ -169,10 +161,10 @@ _mesa_get_shader_image_format(GLenum format) return MESA_FORMAT_SIGNED_RGBA_8; case GL_RG16_SNORM: - return MESA_FORMAT_SIGNED_RG_16; + return MESA_FORMAT_RG_SNORM16; case GL_RG8_SNORM: - return MESA_FORMAT_SIGNED_RG_8; + return MESA_FORMAT_RG_SNORM8; case GL_R16_SNORM: return MESA_FORMAT_R_SNORM16; @@ -297,10 +289,10 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_RGBA_8: return IMAGE_FORMAT_CLASS_4X8; - case MESA_FORMAT_RG_16: + case MESA_FORMAT_RG_UNORM16: return IMAGE_FORMAT_CLASS_2X16; - case MESA_FORMAT_RG_8: + case MESA_FORMAT_RG_UNORM8: return IMAGE_FORMAT_CLASS_2X8; case MESA_FORMAT_R_UNORM16: @@ -315,10 +307,10 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_SIGNED_RGBA_8: return IMAGE_FORMAT_CLASS_4X8; - case MESA_FORMAT_SIGNED_RG_16: + case MESA_FORMAT_RG_SNORM16: return IMAGE_FORMAT_CLASS_2X16; - case MESA_FORMAT_SIGNED_RG_8: + case MESA_FORMAT_RG_SNORM8: return IMAGE_FORMAT_CLASS_2X8; case MESA_FORMAT_R_SNORM16: diff --git a/src/mesa/main/texcompress_rgtc.c b/src/mesa/main/texcompress_rgtc.c index 089646d4e9b..ef5c2bbfd8d 100644 --- a/src/mesa/main/texcompress_rgtc.c +++ b/src/mesa/main/texcompress_rgtc.c @@ -197,8 +197,7 @@ _mesa_texstore_rg_rgtc2(TEXSTORE_PARAMS) dstFormat == MESA_FORMAT_LA_LATC2_UNORM); if (baseInternalFormat == GL_RG) - tempFormat = _mesa_little_endian() ? MESA_FORMAT_R8G8_UNORM - : MESA_FORMAT_G8R8_UNORM; + tempFormat = MESA_FORMAT_RG_UNORM8; else tempFormat = MESA_FORMAT_LA_UNORM8; diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 0968832889d..c7765bcdb2f 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -379,7 +379,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, break; case GL_RG_SNORM: case GL_RG8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_SNORM8); break; case GL_RGB_SNORM: case GL_RGB8_SNORM: @@ -423,7 +423,7 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, RETURN_IF_SUPPORTED(MESA_FORMAT_R_SNORM16); break; case GL_RG16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_SNORM16); break; case GL_RGB16_SNORM: RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_SNORM16); @@ -677,17 +677,17 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RG: case GL_RG8: - RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM8); break; case GL_COMPRESSED_RG: if (target != GL_TEXTURE_1D && target != GL_TEXTURE_1D_ARRAY) RETURN_IF_SUPPORTED(MESA_FORMAT_RG_RGTC2_UNORM); - RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM8); break; case GL_RG16: - RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_UNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_RG_UNORM16); break; case GL_R16F: diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 77e57e6d250..5e7f4f767fd 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -6089,11 +6089,11 @@ _mesa_get_texbuffer_format(const struct gl_context *ctx, GLenum internalFormat) return MESA_FORMAT_RGBA_UINT32; case GL_RG8: - return MESA_FORMAT_R8G8_UNORM; + return MESA_FORMAT_RG_UNORM8; case GL_RG16: if (_mesa_is_gles(ctx) && !_mesa_has_EXT_texture_norm16(ctx)) return MESA_FORMAT_NONE; - return MESA_FORMAT_R16G16_UNORM; + return MESA_FORMAT_RG_UNORM16; case GL_RG16F: return MESA_FORMAT_RG_FLOAT16; case GL_RG32F: |