diff options
Diffstat (limited to 'src/mesa/main')
-rw-r--r-- | src/mesa/main/accum.c | 8 | ||||
-rw-r--r-- | src/mesa/main/format_pack.c | 106 | ||||
-rw-r--r-- | src/mesa/main/format_unpack.c | 38 | ||||
-rw-r--r-- | src/mesa/main/formats.c | 160 | ||||
-rw-r--r-- | src/mesa/main/formats.h | 40 | ||||
-rw-r--r-- | src/mesa/main/shaderimage.c | 24 | ||||
-rw-r--r-- | src/mesa/main/texformat.c | 74 | ||||
-rw-r--r-- | src/mesa/main/texstore.c | 96 |
8 files changed, 273 insertions, 273 deletions
diff --git a/src/mesa/main/accum.c b/src/mesa/main/accum.c index 421fe6cc5ab..ef74468f426 100644 --- a/src/mesa/main/accum.c +++ b/src/mesa/main/accum.c @@ -138,7 +138,7 @@ _mesa_clear_accum_buffer(struct gl_context *ctx) return; } - if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) { + if (accRb->Format == MESA_FORMAT_RGBA_SNORM16) { const GLshort clearR = FLOAT_TO_SHORT(ctx->Accum.ClearColor[0]); const GLshort clearG = FLOAT_TO_SHORT(ctx->Accum.ClearColor[1]); const GLshort clearB = FLOAT_TO_SHORT(ctx->Accum.ClearColor[2]); @@ -193,7 +193,7 @@ accum_scale_or_bias(struct gl_context *ctx, GLfloat value, return; } - if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) { + if (accRb->Format == MESA_FORMAT_RGBA_SNORM16) { const GLshort incr = (GLshort) (value * 32767.0f); GLint i, j; if (bias) { @@ -271,7 +271,7 @@ accum_or_load(struct gl_context *ctx, GLfloat value, return; } - if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) { + if (accRb->Format == MESA_FORMAT_RGBA_SNORM16) { const GLfloat scale = value * 32767.0f; GLint i, j; GLfloat (*rgba)[4]; @@ -363,7 +363,7 @@ accum_return(struct gl_context *ctx, GLfloat value, continue; } - if (accRb->Format == MESA_FORMAT_SIGNED_RGBA_16) { + if (accRb->Format == MESA_FORMAT_RGBA_SNORM16) { const GLfloat scale = value / 32767.0f; GLint i, j; GLfloat (*rgba)[4], (*dest)[4]; diff --git a/src/mesa/main/format_pack.c b/src/mesa/main/format_pack.c index 624f1a62cd2..69014325abd 100644 --- a/src/mesa/main/format_pack.c +++ b/src/mesa/main/format_pack.c @@ -1419,7 +1419,7 @@ pack_float_RGBA_16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_R8 + * MESA_FORMAT_R_SNORM8 */ static void @@ -1431,7 +1431,7 @@ pack_float_SIGNED_R8(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RG88_REV + * MESA_FORMAT_R8G8_SNORM */ static void @@ -1445,7 +1445,7 @@ pack_float_SIGNED_RG88_REV(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RGBX8888 + * MESA_FORMAT_X8B8G8R8_SNORM */ static void @@ -1461,7 +1461,7 @@ pack_float_SIGNED_RGBX8888(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RGBA8888 + * MESA_FORMAT_A8B8G8R8_SNORM */ static void @@ -1477,7 +1477,7 @@ pack_float_SIGNED_RGBA8888(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RGBA8888_REV + * MESA_FORMAT_R8G8B8A8_SNORM */ static void @@ -1493,7 +1493,7 @@ pack_float_SIGNED_RGBA8888_REV(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_R16 + * MESA_FORMAT_R_SNORM16 */ static void @@ -1505,7 +1505,7 @@ pack_float_SIGNED_R16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_GR1616 + * MESA_FORMAT_R16G16_SNORM */ static void @@ -1519,7 +1519,7 @@ pack_float_SIGNED_GR1616(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RGB_16 + * MESA_FORMAT_RGB_SNORM16 */ static void @@ -1533,7 +1533,7 @@ pack_float_SIGNED_RGB_16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_RGBA_16 + * MESA_FORMAT_RGBA_SNORM16 */ static void @@ -1548,7 +1548,7 @@ pack_float_SIGNED_RGBA_16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_A8 + * MESA_FORMAT_A_SNORM8 */ static void @@ -1560,7 +1560,7 @@ pack_float_SIGNED_A8(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_L8 + * MESA_FORMAT_L_SNORM8 */ static void @@ -1572,7 +1572,7 @@ pack_float_SIGNED_L8(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_AL88 + * MESA_FORMAT_L8A8_SNORM */ static void @@ -1586,7 +1586,7 @@ pack_float_SIGNED_AL88(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_A16 + * MESA_FORMAT_A_SNORM16 */ static void @@ -1598,7 +1598,7 @@ pack_float_SIGNED_A16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_L16 + * MESA_FORMAT_L_SNORM16 */ static void @@ -1610,7 +1610,7 @@ pack_float_SIGNED_L16(const GLfloat src[4], void *dst) /* - * MESA_FORMAT_SIGNED_AL1616 + * MESA_FORMAT_LA_SNORM16 */ static void @@ -1850,7 +1850,7 @@ pack_float_ABGR2101010(const GLfloat src[4], void *dst) } /* - * MESA_FORMAT_SIGNED_RG88 + * MESA_FORMAT_G8R8_SNORM */ static void @@ -1863,7 +1863,7 @@ pack_float_SIGNED_RG88(const GLfloat src[4], void *dst) } /* - * MESA_FORMAT_SIGNED_RG1616 + * MESA_FORMAT_G16R16_SNORM */ static void @@ -1987,23 +1987,23 @@ _mesa_get_pack_ubyte_rgba_function(mesa_format format) table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16; /* n/a */ - table[MESA_FORMAT_SIGNED_R8] = NULL; - table[MESA_FORMAT_SIGNED_RG88_REV] = NULL; - table[MESA_FORMAT_SIGNED_RGBX8888] = NULL; - table[MESA_FORMAT_SIGNED_RGBA8888] = NULL; - table[MESA_FORMAT_SIGNED_RGBA8888_REV] = NULL; - table[MESA_FORMAT_SIGNED_R16] = NULL; - table[MESA_FORMAT_SIGNED_GR1616] = NULL; - table[MESA_FORMAT_SIGNED_RGB_16] = NULL; - table[MESA_FORMAT_SIGNED_RGBA_16] = NULL; - table[MESA_FORMAT_SIGNED_A8] = NULL; - table[MESA_FORMAT_SIGNED_L8] = NULL; - table[MESA_FORMAT_SIGNED_AL88] = NULL; - table[MESA_FORMAT_SIGNED_I8] = NULL; - table[MESA_FORMAT_SIGNED_A16] = NULL; - table[MESA_FORMAT_SIGNED_L16] = NULL; - table[MESA_FORMAT_SIGNED_AL1616] = NULL; - table[MESA_FORMAT_SIGNED_I16] = NULL; + table[MESA_FORMAT_R_SNORM8] = NULL; + table[MESA_FORMAT_R8G8_SNORM] = NULL; + table[MESA_FORMAT_X8B8G8R8_SNORM] = NULL; + table[MESA_FORMAT_A8B8G8R8_SNORM] = NULL; + table[MESA_FORMAT_R8G8B8A8_SNORM] = NULL; + table[MESA_FORMAT_R_SNORM16] = NULL; + table[MESA_FORMAT_R16G16_SNORM] = NULL; + table[MESA_FORMAT_RGB_SNORM16] = NULL; + table[MESA_FORMAT_RGBA_SNORM16] = NULL; + table[MESA_FORMAT_A_SNORM8] = NULL; + table[MESA_FORMAT_L_SNORM8] = NULL; + table[MESA_FORMAT_L8A8_SNORM] = NULL; + table[MESA_FORMAT_I_SNORM8] = NULL; + table[MESA_FORMAT_A_SNORM16] = NULL; + table[MESA_FORMAT_L_SNORM16] = NULL; + table[MESA_FORMAT_LA_SNORM16] = NULL; + table[MESA_FORMAT_I_SNORM16] = NULL; table[MESA_FORMAT_RGBA_UNORM16] = pack_ubyte_RGBA_16; @@ -2150,23 +2150,23 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_RGBA_UNORM16] = pack_float_RGBA_16; - table[MESA_FORMAT_SIGNED_R8] = pack_float_SIGNED_R8; - table[MESA_FORMAT_SIGNED_RG88_REV] = pack_float_SIGNED_RG88_REV; - table[MESA_FORMAT_SIGNED_RGBX8888] = pack_float_SIGNED_RGBX8888; - table[MESA_FORMAT_SIGNED_RGBA8888] = pack_float_SIGNED_RGBA8888; - table[MESA_FORMAT_SIGNED_RGBA8888_REV] = pack_float_SIGNED_RGBA8888_REV; - table[MESA_FORMAT_SIGNED_R16] = pack_float_SIGNED_R16; - table[MESA_FORMAT_SIGNED_GR1616] = pack_float_SIGNED_GR1616; - table[MESA_FORMAT_SIGNED_RGB_16] = pack_float_SIGNED_RGB_16; - table[MESA_FORMAT_SIGNED_RGBA_16] = pack_float_SIGNED_RGBA_16; - table[MESA_FORMAT_SIGNED_A8] = pack_float_SIGNED_A8; - table[MESA_FORMAT_SIGNED_L8] = pack_float_SIGNED_L8; - table[MESA_FORMAT_SIGNED_AL88] = pack_float_SIGNED_AL88; - table[MESA_FORMAT_SIGNED_I8] = pack_float_SIGNED_L8; /* reused */ - table[MESA_FORMAT_SIGNED_A16] = pack_float_SIGNED_A16; - table[MESA_FORMAT_SIGNED_L16] = pack_float_SIGNED_L16; - table[MESA_FORMAT_SIGNED_AL1616] = pack_float_SIGNED_AL1616; - table[MESA_FORMAT_SIGNED_I16] = pack_float_SIGNED_L16; /* reused */ + table[MESA_FORMAT_R_SNORM8] = pack_float_SIGNED_R8; + table[MESA_FORMAT_R8G8_SNORM] = pack_float_SIGNED_RG88_REV; + table[MESA_FORMAT_X8B8G8R8_SNORM] = pack_float_SIGNED_RGBX8888; + table[MESA_FORMAT_A8B8G8R8_SNORM] = pack_float_SIGNED_RGBA8888; + table[MESA_FORMAT_R8G8B8A8_SNORM] = pack_float_SIGNED_RGBA8888_REV; + table[MESA_FORMAT_R_SNORM16] = pack_float_SIGNED_R16; + table[MESA_FORMAT_R16G16_SNORM] = pack_float_SIGNED_GR1616; + table[MESA_FORMAT_RGB_SNORM16] = pack_float_SIGNED_RGB_16; + table[MESA_FORMAT_RGBA_SNORM16] = pack_float_SIGNED_RGBA_16; + table[MESA_FORMAT_A_SNORM8] = pack_float_SIGNED_A8; + table[MESA_FORMAT_L_SNORM8] = pack_float_SIGNED_L8; + table[MESA_FORMAT_L8A8_SNORM] = pack_float_SIGNED_AL88; + table[MESA_FORMAT_I_SNORM8] = pack_float_SIGNED_L8; /* reused */ + table[MESA_FORMAT_A_SNORM16] = pack_float_SIGNED_A16; + table[MESA_FORMAT_L_SNORM16] = pack_float_SIGNED_L16; + table[MESA_FORMAT_LA_SNORM16] = pack_float_SIGNED_AL1616; + table[MESA_FORMAT_I_SNORM16] = pack_float_SIGNED_L16; /* reused */ table[MESA_FORMAT_R9G9B9E5_FLOAT] = pack_float_RGB9_E5_FLOAT; table[MESA_FORMAT_R11G11B10_FLOAT] = pack_float_R11_G11_B10_FLOAT; @@ -2189,8 +2189,8 @@ _mesa_get_pack_float_rgba_function(mesa_format format) table[MESA_FORMAT_R10G10B10A2_UNORM] = pack_float_ABGR2101010; - table[MESA_FORMAT_SIGNED_RG88] = pack_float_SIGNED_RG88; - table[MESA_FORMAT_SIGNED_RG1616] = pack_float_SIGNED_RG1616; + table[MESA_FORMAT_G8R8_SNORM] = pack_float_SIGNED_RG88; + table[MESA_FORMAT_G16R16_SNORM] = pack_float_SIGNED_RG1616; initialized = GL_TRUE; } diff --git a/src/mesa/main/format_unpack.c b/src/mesa/main/format_unpack.c index b9b8d0e2146..a81628312ae 100644 --- a/src/mesa/main/format_unpack.c +++ b/src/mesa/main/format_unpack.c @@ -2454,15 +2454,15 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_RGBA_UINT32] = unpack_RGBA_UINT32; table[MESA_FORMAT_DUDV8] = unpack_DUDV8; - table[MESA_FORMAT_SIGNED_R8] = unpack_SIGNED_R8; - table[MESA_FORMAT_SIGNED_RG88_REV] = unpack_SIGNED_RG88_REV; - table[MESA_FORMAT_SIGNED_RGBX8888] = unpack_SIGNED_RGBX8888; - table[MESA_FORMAT_SIGNED_RGBA8888] = unpack_SIGNED_RGBA8888; - table[MESA_FORMAT_SIGNED_RGBA8888_REV] = unpack_SIGNED_RGBA8888_REV; - table[MESA_FORMAT_SIGNED_R16] = unpack_SIGNED_R16; - table[MESA_FORMAT_SIGNED_GR1616] = unpack_SIGNED_GR1616; - table[MESA_FORMAT_SIGNED_RGB_16] = unpack_SIGNED_RGB_16; - table[MESA_FORMAT_SIGNED_RGBA_16] = unpack_SIGNED_RGBA_16; + table[MESA_FORMAT_R_SNORM8] = unpack_SIGNED_R8; + table[MESA_FORMAT_R8G8_SNORM] = unpack_SIGNED_RG88_REV; + table[MESA_FORMAT_X8B8G8R8_SNORM] = unpack_SIGNED_RGBX8888; + table[MESA_FORMAT_A8B8G8R8_SNORM] = unpack_SIGNED_RGBA8888; + table[MESA_FORMAT_R8G8B8A8_SNORM] = unpack_SIGNED_RGBA8888_REV; + table[MESA_FORMAT_R_SNORM16] = unpack_SIGNED_R16; + table[MESA_FORMAT_R16G16_SNORM] = unpack_SIGNED_GR1616; + table[MESA_FORMAT_RGB_SNORM16] = unpack_SIGNED_RGB_16; + table[MESA_FORMAT_RGBA_SNORM16] = unpack_SIGNED_RGBA_16; table[MESA_FORMAT_RGBA_UNORM16] = unpack_RGBA_16; table[MESA_FORMAT_RED_RGTC1] = unpack_RED_RGTC1; @@ -2488,14 +2488,14 @@ get_unpack_rgba_function(mesa_format format) unpack_ETC2_RGB8_PUNCHTHROUGH_ALPHA1; table[MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = unpack_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1; - table[MESA_FORMAT_SIGNED_A8] = unpack_SIGNED_A8; - table[MESA_FORMAT_SIGNED_L8] = unpack_SIGNED_L8; - table[MESA_FORMAT_SIGNED_AL88] = unpack_SIGNED_AL88; - table[MESA_FORMAT_SIGNED_I8] = unpack_SIGNED_I8; - table[MESA_FORMAT_SIGNED_A16] = unpack_SIGNED_A16; - table[MESA_FORMAT_SIGNED_L16] = unpack_SIGNED_L16; - table[MESA_FORMAT_SIGNED_AL1616] = unpack_SIGNED_AL1616; - table[MESA_FORMAT_SIGNED_I16] = unpack_SIGNED_I16; + table[MESA_FORMAT_A_SNORM8] = unpack_SIGNED_A8; + table[MESA_FORMAT_L_SNORM8] = unpack_SIGNED_L8; + table[MESA_FORMAT_L8A8_SNORM] = unpack_SIGNED_AL88; + table[MESA_FORMAT_I_SNORM8] = unpack_SIGNED_I8; + table[MESA_FORMAT_A_SNORM16] = unpack_SIGNED_A16; + table[MESA_FORMAT_L_SNORM16] = unpack_SIGNED_L16; + table[MESA_FORMAT_LA_SNORM16] = unpack_SIGNED_AL1616; + table[MESA_FORMAT_I_SNORM16] = unpack_SIGNED_I16; table[MESA_FORMAT_R9G9B9E5_FLOAT] = unpack_RGB9_E5_FLOAT; table[MESA_FORMAT_R11G11B10_FLOAT] = unpack_R11_G11_B10_FLOAT; @@ -2521,8 +2521,8 @@ get_unpack_rgba_function(mesa_format format) table[MESA_FORMAT_R10G10B10A2_UNORM] = unpack_ABGR2101010; - table[MESA_FORMAT_SIGNED_RG88] = unpack_SIGNED_RG88; - table[MESA_FORMAT_SIGNED_RG1616] = unpack_SIGNED_RG1616; + table[MESA_FORMAT_G8R8_SNORM] = unpack_SIGNED_RG88; + table[MESA_FORMAT_G16R16_SNORM] = unpack_SIGNED_RG1616; initialized = GL_TRUE; } diff --git a/src/mesa/main/formats.c b/src/mesa/main/formats.c index fc6a3f6fd1c..ca0f0a96dfa 100644 --- a/src/mesa/main/formats.c +++ b/src/mesa/main/formats.c @@ -1223,8 +1223,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = /* Signed 8 bits / channel */ { - MESA_FORMAT_SIGNED_R8, /* Name */ - "MESA_FORMAT_SIGNED_R8", /* StrName */ + MESA_FORMAT_R_SNORM8, /* Name */ + "MESA_FORMAT_R_SNORM8", /* StrName */ GL_RED, /* BaseFormat */ GL_SIGNED_NORMALIZED, /* DataType */ 8, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ @@ -1232,8 +1232,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 /* BlockWidth/Height,Bytes */ }, { - MESA_FORMAT_SIGNED_RG88_REV, - "MESA_FORMAT_SIGNED_RG88_REV", + MESA_FORMAT_R8G8_SNORM, + "MESA_FORMAT_R8G8_SNORM", GL_RG, GL_SIGNED_NORMALIZED, 8, 8, 0, 0, @@ -1241,8 +1241,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_RGBX8888, - "MESA_FORMAT_SIGNED_RGBX8888", + MESA_FORMAT_X8B8G8R8_SNORM, + "MESA_FORMAT_X8B8G8R8_SNORM", GL_RGB, GL_SIGNED_NORMALIZED, 8, 8, 8, 0, @@ -1250,8 +1250,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 /* 4 bpp, but no alpha */ }, { - MESA_FORMAT_SIGNED_RGBA8888, - "MESA_FORMAT_SIGNED_RGBA8888", + MESA_FORMAT_A8B8G8R8_SNORM, + "MESA_FORMAT_A8B8G8R8_SNORM", GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, @@ -1259,8 +1259,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SIGNED_RGBA8888_REV, - "MESA_FORMAT_SIGNED_RGBA8888_REV", + MESA_FORMAT_R8G8B8A8_SNORM, + "MESA_FORMAT_R8G8B8A8_SNORM", GL_RGBA, GL_SIGNED_NORMALIZED, 8, 8, 8, 8, @@ -1270,8 +1270,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = /* Signed 16 bits / channel */ { - MESA_FORMAT_SIGNED_R16, - "MESA_FORMAT_SIGNED_R16", + MESA_FORMAT_R_SNORM16, + "MESA_FORMAT_R_SNORM16", GL_RED, GL_SIGNED_NORMALIZED, 16, 0, 0, 0, @@ -1279,8 +1279,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_GR1616, - "MESA_FORMAT_SIGNED_GR1616", + MESA_FORMAT_R16G16_SNORM, + "MESA_FORMAT_R16G16_SNORM", GL_RG, GL_SIGNED_NORMALIZED, 16, 16, 0, 0, @@ -1288,8 +1288,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SIGNED_RGB_16, - "MESA_FORMAT_SIGNED_RGB_16", + MESA_FORMAT_RGB_SNORM16, + "MESA_FORMAT_RGB_SNORM16", GL_RGB, GL_SIGNED_NORMALIZED, 16, 16, 16, 0, @@ -1297,8 +1297,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 6 }, { - MESA_FORMAT_SIGNED_RGBA_16, - "MESA_FORMAT_SIGNED_RGBA_16", + MESA_FORMAT_RGBA_SNORM16, + "MESA_FORMAT_RGBA_SNORM16", GL_RGBA, GL_SIGNED_NORMALIZED, 16, 16, 16, 16, @@ -1499,8 +1499,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = /* Signed formats from EXT_texture_snorm that are not in GL3.1 */ { - MESA_FORMAT_SIGNED_A8, - "MESA_FORMAT_SIGNED_A8", + MESA_FORMAT_A_SNORM8, + "MESA_FORMAT_A_SNORM8", GL_ALPHA, GL_SIGNED_NORMALIZED, 0, 0, 0, 8, @@ -1508,8 +1508,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 }, { - MESA_FORMAT_SIGNED_L8, - "MESA_FORMAT_SIGNED_L8", + MESA_FORMAT_L_SNORM8, + "MESA_FORMAT_L_SNORM8", GL_LUMINANCE, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, @@ -1517,8 +1517,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 }, { - MESA_FORMAT_SIGNED_AL88, - "MESA_FORMAT_SIGNED_AL88", + MESA_FORMAT_L8A8_SNORM, + "MESA_FORMAT_L8A8_SNORM", GL_LUMINANCE_ALPHA, GL_SIGNED_NORMALIZED, 0, 0, 0, 8, @@ -1526,8 +1526,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_I8, - "MESA_FORMAT_SIGNED_I8", + MESA_FORMAT_I_SNORM8, + "MESA_FORMAT_I_SNORM8", GL_INTENSITY, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, @@ -1535,8 +1535,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 1 }, { - MESA_FORMAT_SIGNED_A16, - "MESA_FORMAT_SIGNED_A16", + MESA_FORMAT_A_SNORM16, + "MESA_FORMAT_A_SNORM16", GL_ALPHA, GL_SIGNED_NORMALIZED, 0, 0, 0, 16, @@ -1544,8 +1544,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_L16, - "MESA_FORMAT_SIGNED_L16", + MESA_FORMAT_L_SNORM16, + "MESA_FORMAT_L_SNORM16", GL_LUMINANCE, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, @@ -1553,8 +1553,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_AL1616, - "MESA_FORMAT_SIGNED_AL1616", + MESA_FORMAT_LA_SNORM16, + "MESA_FORMAT_LA_SNORM16", GL_LUMINANCE_ALPHA, GL_SIGNED_NORMALIZED, 0, 0, 0, 16, @@ -1562,8 +1562,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SIGNED_I16, - "MESA_FORMAT_SIGNED_I16", + MESA_FORMAT_I_SNORM16, + "MESA_FORMAT_I_SNORM16", GL_INTENSITY, GL_SIGNED_NORMALIZED, 0, 0, 0, 0, @@ -1773,8 +1773,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 4 }, { - MESA_FORMAT_SIGNED_RG88, - "MESA_FORMAT_SIGNED_RG88", + MESA_FORMAT_G8R8_SNORM, + "MESA_FORMAT_G8R8_SNORM", GL_RG, GL_SIGNED_NORMALIZED, 8, 8, 0, 0, @@ -1782,8 +1782,8 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 1, 1, 2 }, { - MESA_FORMAT_SIGNED_RG1616, - "MESA_FORMAT_SIGNED_RG1616", + MESA_FORMAT_G16R16_SNORM, + "MESA_FORMAT_G16R16_SNORM", GL_RG, GL_SIGNED_NORMALIZED, 16, 16, 0, 0, @@ -2123,19 +2123,19 @@ _mesa_get_uncompressed_format(mesa_format format) case MESA_FORMAT_RED_RGTC1: return MESA_FORMAT_R_UNORM8; case MESA_FORMAT_SIGNED_RED_RGTC1: - return MESA_FORMAT_SIGNED_R8; + return MESA_FORMAT_R_SNORM8; case MESA_FORMAT_RG_RGTC2: return MESA_FORMAT_R8G8_UNORM; case MESA_FORMAT_SIGNED_RG_RGTC2: - return MESA_FORMAT_SIGNED_RG88_REV; + return MESA_FORMAT_R8G8_SNORM; case MESA_FORMAT_L_LATC1: return MESA_FORMAT_L_UNORM8; case MESA_FORMAT_SIGNED_L_LATC1: - return MESA_FORMAT_SIGNED_L8; + return MESA_FORMAT_L_SNORM8; case MESA_FORMAT_LA_LATC2: return MESA_FORMAT_L8A8_UNORM; case MESA_FORMAT_SIGNED_LA_LATC2: - return MESA_FORMAT_SIGNED_AL88; + return MESA_FORMAT_L8A8_SNORM; case MESA_FORMAT_ETC1_RGB8: case MESA_FORMAT_ETC2_RGB8: case MESA_FORMAT_ETC2_SRGB8: @@ -2512,21 +2512,21 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 2; return; - case MESA_FORMAT_SIGNED_R8: - case MESA_FORMAT_SIGNED_A8: - case MESA_FORMAT_SIGNED_L8: - case MESA_FORMAT_SIGNED_I8: + case MESA_FORMAT_R_SNORM8: + case MESA_FORMAT_A_SNORM8: + case MESA_FORMAT_L_SNORM8: + case MESA_FORMAT_I_SNORM8: *datatype = GL_BYTE; *comps = 1; return; - case MESA_FORMAT_SIGNED_RG88_REV: - case MESA_FORMAT_SIGNED_AL88: + case MESA_FORMAT_R8G8_SNORM: + case MESA_FORMAT_L8A8_SNORM: *datatype = GL_BYTE; *comps = 2; return; - case MESA_FORMAT_SIGNED_RGBA8888: - case MESA_FORMAT_SIGNED_RGBA8888_REV: - case MESA_FORMAT_SIGNED_RGBX8888: + case MESA_FORMAT_A8B8G8R8_SNORM: + case MESA_FORMAT_R8G8B8A8_SNORM: + case MESA_FORMAT_X8B8G8R8_SNORM: *datatype = GL_BYTE; *comps = 4; return; @@ -2536,23 +2536,23 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_SIGNED_R16: - case MESA_FORMAT_SIGNED_A16: - case MESA_FORMAT_SIGNED_L16: - case MESA_FORMAT_SIGNED_I16: + case MESA_FORMAT_R_SNORM16: + case MESA_FORMAT_A_SNORM16: + case MESA_FORMAT_L_SNORM16: + case MESA_FORMAT_I_SNORM16: *datatype = GL_SHORT; *comps = 1; return; - case MESA_FORMAT_SIGNED_GR1616: - case MESA_FORMAT_SIGNED_AL1616: + case MESA_FORMAT_R16G16_SNORM: + case MESA_FORMAT_LA_SNORM16: *datatype = GL_SHORT; *comps = 2; return; - case MESA_FORMAT_SIGNED_RGB_16: + case MESA_FORMAT_RGB_SNORM16: *datatype = GL_SHORT; *comps = 3; return; - case MESA_FORMAT_SIGNED_RGBA_16: + case MESA_FORMAT_RGBA_SNORM16: *datatype = GL_SHORT; *comps = 4; return; @@ -2885,12 +2885,12 @@ _mesa_format_to_type_and_comps(mesa_format format, *comps = 4; return; - case MESA_FORMAT_SIGNED_RG88: + case MESA_FORMAT_G8R8_SNORM: *datatype = GL_BYTE; *comps = 2; return; - case MESA_FORMAT_SIGNED_RG1616: + case MESA_FORMAT_G16R16_SNORM: *datatype = GL_SHORT; *comps = 2; return; @@ -3311,15 +3311,15 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return (format == GL_DU8DV8_ATI || format == GL_DUDV_ATI) && type == GL_BYTE && littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_R8: + case MESA_FORMAT_R_SNORM8: return format == GL_RED && type == GL_BYTE; - case MESA_FORMAT_SIGNED_RG88_REV: + case MESA_FORMAT_R8G8_SNORM: return format == GL_RG && type == GL_BYTE && littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_RGBX8888: + case MESA_FORMAT_X8B8G8R8_SNORM: return GL_FALSE; - case MESA_FORMAT_SIGNED_RGBA8888: + case MESA_FORMAT_A8B8G8R8_SNORM: if (format == GL_RGBA && type == GL_BYTE && !littleEndian) return GL_TRUE; @@ -3328,7 +3328,7 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return GL_FALSE; - case MESA_FORMAT_SIGNED_RGBA8888_REV: + case MESA_FORMAT_R8G8B8A8_SNORM: if (format == GL_RGBA && type == GL_BYTE && littleEndian) return GL_TRUE; @@ -3337,14 +3337,14 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return GL_FALSE; - case MESA_FORMAT_SIGNED_R16: + case MESA_FORMAT_R_SNORM16: return format == GL_RED && type == GL_SHORT && !swapBytes; - case MESA_FORMAT_SIGNED_GR1616: + case MESA_FORMAT_R16G16_SNORM: return format == GL_RG && type == GL_SHORT && littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_RGB_16: + case MESA_FORMAT_RGB_SNORM16: return format == GL_RGB && type == GL_SHORT && !swapBytes; - case MESA_FORMAT_SIGNED_RGBA_16: + case MESA_FORMAT_RGBA_SNORM16: return format == GL_RGBA && type == GL_SHORT && !swapBytes; case MESA_FORMAT_RGBA_UNORM16: return format == GL_RGBA && type == GL_UNSIGNED_SHORT && @@ -3375,23 +3375,23 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, case MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1: return GL_FALSE; - case MESA_FORMAT_SIGNED_A8: + case MESA_FORMAT_A_SNORM8: return format == GL_ALPHA && type == GL_BYTE; - case MESA_FORMAT_SIGNED_L8: + case MESA_FORMAT_L_SNORM8: return format == GL_LUMINANCE && type == GL_BYTE; - case MESA_FORMAT_SIGNED_AL88: + case MESA_FORMAT_L8A8_SNORM: return format == GL_LUMINANCE_ALPHA && type == GL_BYTE && littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_I8: + case MESA_FORMAT_I_SNORM8: return format == GL_INTENSITY && type == GL_BYTE; - case MESA_FORMAT_SIGNED_A16: + case MESA_FORMAT_A_SNORM16: return format == GL_ALPHA && type == GL_SHORT && !swapBytes; - case MESA_FORMAT_SIGNED_L16: + case MESA_FORMAT_L_SNORM16: return format == GL_LUMINANCE && type == GL_SHORT && !swapBytes; - case MESA_FORMAT_SIGNED_AL1616: + case MESA_FORMAT_LA_SNORM16: return format == GL_LUMINANCE_ALPHA && type == GL_SHORT && littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_I16: + case MESA_FORMAT_I_SNORM16: return format == GL_INTENSITY && type == GL_SHORT && littleEndian && !swapBytes; @@ -3441,11 +3441,11 @@ _mesa_format_matches_format_and_type(mesa_format mesa_format, return format == GL_RGBA && type == GL_UNSIGNED_INT_2_10_10_10_REV && !swapBytes; - case MESA_FORMAT_SIGNED_RG88: + case MESA_FORMAT_G8R8_SNORM: return format == GL_RG && type == GL_BYTE && !littleEndian && !swapBytes; - case MESA_FORMAT_SIGNED_RG1616: + case MESA_FORMAT_G16R16_SNORM: return format == GL_RG && type == GL_SHORT && !littleEndian && !swapBytes; } diff --git a/src/mesa/main/formats.h b/src/mesa/main/formats.h index c7e99a2f332..d2eedc1cf41 100644 --- a/src/mesa/main/formats.h +++ b/src/mesa/main/formats.h @@ -540,24 +540,24 @@ typedef enum MESA_FORMAT_DUDV8, /* DUDU DUDU DVDV DVDV */ /* Type A format(s) */ - MESA_FORMAT_SIGNED_R8, /* RRRR RRRR */ + MESA_FORMAT_R_SNORM8, /* char[i] = R */ /* Type P formats */ - MESA_FORMAT_SIGNED_RG88_REV, /* GGGG GGGG RRRR RRRR */ - MESA_FORMAT_SIGNED_RGBX8888, /* RRRR RRRR GGGG GGGG BBBB BBBB xxxx xxxx */ - MESA_FORMAT_SIGNED_RGBA8888, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ - MESA_FORMAT_SIGNED_RGBA8888_REV,/*AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_R8G8_SNORM, /* RRRR RRRR GGGG GGGG */ + MESA_FORMAT_X8B8G8R8_SNORM, /* xxxx xxxx BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_A8B8G8R8_SNORM, /* AAAA AAAA BBBB BBBB GGGG GGGG RRRR RRRR */ + MESA_FORMAT_R8G8B8A8_SNORM, /* RRRR RRRR GGGG GGGG BBBB BBBB AAAA AAAA */ /* Type A format(s) */ - MESA_FORMAT_SIGNED_R16, /* RRRR RRRR RRRR RRRR */ + MESA_FORMAT_R_SNORM16, /* short[i] = R */ /* Type P format(s) */ - MESA_FORMAT_SIGNED_GR1616, /* GGGG GGGG GGGG GGGG RRRR RRRR RRRR RRRR */ + MESA_FORMAT_R16G16_SNORM, /* RRRR RRRR RRRR RRRR GGGG GGGG GGGG GGGG */ /* Type A format(s) */ - MESA_FORMAT_SIGNED_RGB_16, /* ushort[0]=R, ushort[1]=G, ushort[2]=B */ - MESA_FORMAT_SIGNED_RGBA_16, /* ... */ - MESA_FORMAT_RGBA_UNORM16, /* ... */ + MESA_FORMAT_RGB_SNORM16, /* short[i * 3] = R, [i * 3 + 1] = G, [i *3 + 2] = B */ + MESA_FORMAT_RGBA_SNORM16, /* ... */ + MESA_FORMAT_RGBA_UNORM16, /* ... */ /*@}*/ /*@{*/ @@ -588,18 +588,18 @@ typedef enum MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1, /* Type A format(s) */ - MESA_FORMAT_SIGNED_A8, /* AAAA AAAA */ - MESA_FORMAT_SIGNED_L8, /* LLLL LLLL */ + MESA_FORMAT_A_SNORM8, /* char[i] = A */ + MESA_FORMAT_L_SNORM8, /* char[i] = L */ /* Type P format(s) */ - MESA_FORMAT_SIGNED_AL88, /* AAAA AAAA LLLL LLLL */ + MESA_FORMAT_L8A8_SNORM, /* LLLL LLLL AAAA AAAA */ /* Type A format(s) */ - MESA_FORMAT_SIGNED_I8, /* IIII IIII */ - MESA_FORMAT_SIGNED_A16, /* AAAA AAAA AAAA AAAA */ - MESA_FORMAT_SIGNED_L16, /* LLLL LLLL LLLL LLLL */ - MESA_FORMAT_SIGNED_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ - MESA_FORMAT_SIGNED_I16, /* IIII IIII IIII IIII */ + MESA_FORMAT_I_SNORM8, /* char[i] = I */ + MESA_FORMAT_A_SNORM16, /* short[i] = A */ + MESA_FORMAT_L_SNORM16, /* short[i] = L */ + MESA_FORMAT_LA_SNORM16, /* short[i * 2] = L, [i * 2 + 1] = A */ + MESA_FORMAT_I_SNORM16, /* short[i] = I */ /* Type P format(s) */ MESA_FORMAT_R9G9B9E5_FLOAT, @@ -639,8 +639,8 @@ typedef enum /* Type P formats */ MESA_FORMAT_R10G10B10A2_UNORM, - MESA_FORMAT_SIGNED_RG88, - MESA_FORMAT_SIGNED_RG1616, + MESA_FORMAT_G8R8_SNORM, + MESA_FORMAT_G16R16_SNORM, MESA_FORMAT_COUNT } mesa_format; diff --git a/src/mesa/main/shaderimage.c b/src/mesa/main/shaderimage.c index 05362325213..a7776b7745c 100644 --- a/src/mesa/main/shaderimage.c +++ b/src/mesa/main/shaderimage.c @@ -45,16 +45,16 @@ # 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_SIGNED_RGBA8888 -# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_RG1616 -# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88 +# 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_SIGNED_RGBA8888_REV -# define MESA_FORMAT_SIGNED_RG_16 MESA_FORMAT_SIGNED_GR1616 -# define MESA_FORMAT_SIGNED_RG_8 MESA_FORMAT_SIGNED_RG88_REV +# 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 static mesa_format @@ -161,7 +161,7 @@ get_image_format(GLenum format) return MESA_FORMAT_R_UNORM8; case GL_RGBA16_SNORM: - return MESA_FORMAT_SIGNED_RGBA_16; + return MESA_FORMAT_RGBA_SNORM16; case GL_RGBA8_SNORM: return MESA_FORMAT_SIGNED_RGBA_8; @@ -173,10 +173,10 @@ get_image_format(GLenum format) return MESA_FORMAT_SIGNED_RG_8; case GL_R16_SNORM: - return MESA_FORMAT_SIGNED_R16; + return MESA_FORMAT_R_SNORM16; case GL_R8_SNORM: - return MESA_FORMAT_SIGNED_R8; + return MESA_FORMAT_R_SNORM8; default: return MESA_FORMAT_NONE; @@ -307,7 +307,7 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_R_UNORM8: return IMAGE_FORMAT_CLASS_1X8; - case MESA_FORMAT_SIGNED_RGBA_16: + case MESA_FORMAT_RGBA_SNORM16: return IMAGE_FORMAT_CLASS_4X16; case MESA_FORMAT_SIGNED_RGBA_8: @@ -319,10 +319,10 @@ get_image_format_class(mesa_format format) case MESA_FORMAT_SIGNED_RG_8: return IMAGE_FORMAT_CLASS_2X8; - case MESA_FORMAT_SIGNED_R16: + case MESA_FORMAT_R_SNORM16: return IMAGE_FORMAT_CLASS_1X16; - case MESA_FORMAT_SIGNED_R8: + case MESA_FORMAT_R_SNORM8: return IMAGE_FORMAT_CLASS_1X8; default: diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c index 45102242c73..5b6eb7dc1a9 100644 --- a/src/mesa/main/texformat.c +++ b/src/mesa/main/texformat.c @@ -443,81 +443,81 @@ _mesa_choose_tex_format(struct gl_context *ctx, GLenum target, case GL_RED_SNORM: case GL_R8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R8); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_SNORM8); break; case GL_RG_SNORM: case GL_RG8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RG88_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8_SNORM); break; case GL_RGB_SNORM: case GL_RGB8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); + RETURN_IF_SUPPORTED(MESA_FORMAT_X8B8G8R8_SNORM); /* FALLTHROUGH */ case GL_RGBA_SNORM: case GL_RGBA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_ALPHA_SNORM: case GL_ALPHA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_SNORM8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_LUMINANCE_SNORM: case GL_LUMINANCE8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBX8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_SNORM8); + RETURN_IF_SUPPORTED(MESA_FORMAT_X8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_LUMINANCE_ALPHA_SNORM: case GL_LUMINANCE8_ALPHA8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL88); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_L8A8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_INTENSITY_SNORM: case GL_INTENSITY8_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I8); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_SNORM8); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_R16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_R16); + RETURN_IF_SUPPORTED(MESA_FORMAT_R_SNORM16); break; case GL_RG16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_GR1616); + RETURN_IF_SUPPORTED(MESA_FORMAT_R16G16_SNORM); break; case GL_RGB16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGB_16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB_SNORM16); RETURN_IF_SUPPORTED(MESA_FORMAT_RGBX_SNORM16); /* FALLTHROUGH */ case GL_RGBA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_ALPHA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_A16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_A_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_LUMINANCE16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_L16); + RETURN_IF_SUPPORTED(MESA_FORMAT_L_SNORM16); /* FALLTHROUGH */ case GL_LUMINANCE16_ALPHA16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_AL1616); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_LA_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_INTENSITY16_SNORM: - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_I16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA_16); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888); - RETURN_IF_SUPPORTED(MESA_FORMAT_SIGNED_RGBA8888_REV); + RETURN_IF_SUPPORTED(MESA_FORMAT_I_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_RGBA_SNORM16); + RETURN_IF_SUPPORTED(MESA_FORMAT_A8B8G8R8_SNORM); + RETURN_IF_SUPPORTED(MESA_FORMAT_R8G8B8A8_SNORM); break; case GL_SRGB_EXT: diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 7c478e79e63..80b0fd30441 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -1874,8 +1874,8 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGB_16 || - dstFormat == MESA_FORMAT_SIGNED_RGBA_16 || + ASSERT(dstFormat == MESA_FORMAT_RGB_SNORM16 || + dstFormat == MESA_FORMAT_RGBA_SNORM16 || dstFormat == MESA_FORMAT_RGBX_SNORM16); { @@ -1901,7 +1901,7 @@ _mesa_texstore_signed_rgba_16(TEXSTORE_PARAMS) GLubyte *dstRow = dstSlices[img]; for (row = 0; row < srcHeight; row++) { GLshort *dstRowS = (GLshort *) dstRow; - if (dstFormat == MESA_FORMAT_SIGNED_RGBA_16) { + if (dstFormat == MESA_FORMAT_RGBA_SNORM16) { for (col = 0; col < srcWidth; col++) { GLuint c; for (c = 0; c < comps; c++) { @@ -2147,10 +2147,10 @@ _mesa_texstore_snorm8(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_A8 || - dstFormat == MESA_FORMAT_SIGNED_L8 || - dstFormat == MESA_FORMAT_SIGNED_I8 || - dstFormat == MESA_FORMAT_SIGNED_R8); + ASSERT(dstFormat == MESA_FORMAT_A_SNORM8 || + dstFormat == MESA_FORMAT_L_SNORM8 || + dstFormat == MESA_FORMAT_I_SNORM8 || + dstFormat == MESA_FORMAT_R_SNORM8); ASSERT(_mesa_get_format_bytes(dstFormat) == 1); { @@ -2190,9 +2190,9 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL88 || - dstFormat == MESA_FORMAT_SIGNED_RG88 || - dstFormat == MESA_FORMAT_SIGNED_RG88_REV); + ASSERT(dstFormat == MESA_FORMAT_L8A8_SNORM || + dstFormat == MESA_FORMAT_G8R8_SNORM || + dstFormat == MESA_FORMAT_R8G8_SNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); { @@ -2213,8 +2213,8 @@ _mesa_texstore_snorm88(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLushort *dst = (GLushort *) dstRow; - if (dstFormat == MESA_FORMAT_SIGNED_AL88 || - dstFormat == MESA_FORMAT_SIGNED_RG88_REV) { + if (dstFormat == MESA_FORMAT_L8A8_SNORM || + dstFormat == MESA_FORMAT_R8G8_SNORM) { for (col = 0; col < srcWidth; col++) { GLubyte l = FLOAT_TO_BYTE_TEX(src[0]); GLubyte a = FLOAT_TO_BYTE_TEX(src[1]); @@ -2246,10 +2246,10 @@ _mesa_texstore_snorm16(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_R16 || - dstFormat == MESA_FORMAT_SIGNED_A16 || - dstFormat == MESA_FORMAT_SIGNED_L16 || - dstFormat == MESA_FORMAT_SIGNED_I16); + ASSERT(dstFormat == MESA_FORMAT_R_SNORM16 || + dstFormat == MESA_FORMAT_A_SNORM16 || + dstFormat == MESA_FORMAT_L_SNORM16 || + dstFormat == MESA_FORMAT_I_SNORM16); ASSERT(_mesa_get_format_bytes(dstFormat) == 2); { @@ -2292,9 +2292,9 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_AL1616 || - dstFormat == MESA_FORMAT_SIGNED_RG1616 || - dstFormat == MESA_FORMAT_SIGNED_GR1616); + ASSERT(dstFormat == MESA_FORMAT_LA_SNORM16 || + dstFormat == MESA_FORMAT_G16R16_SNORM || + dstFormat == MESA_FORMAT_R16G16_SNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -2315,8 +2315,8 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) for (row = 0; row < srcHeight; row++) { GLuint *dst = (GLuint *) dstRow; - if (dstFormat == MESA_FORMAT_SIGNED_AL1616 || - dstFormat == MESA_FORMAT_SIGNED_GR1616) { + if (dstFormat == MESA_FORMAT_LA_SNORM16 || + dstFormat == MESA_FORMAT_R16G16_SNORM) { for (col = 0; col < srcWidth; col++) { GLushort l, a; @@ -2345,7 +2345,7 @@ _mesa_texstore_snorm1616(TEXSTORE_PARAMS) } /** - * Store a texture in MESA_FORMAT_SIGNED_RGBX8888 or + * Store a texture in MESA_FORMAT_X8B8G8R8_SNORM or * MESA_FORMAT_R8G8B8X8_SNORM. */ static GLboolean @@ -2353,7 +2353,7 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBX8888 || + ASSERT(dstFormat == MESA_FORMAT_X8B8G8R8_SNORM || dstFormat == MESA_FORMAT_R8G8B8X8_SNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); @@ -2374,7 +2374,7 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) GLbyte *dstRow = (GLbyte *) dstSlices[img]; for (row = 0; row < srcHeight; row++) { GLbyte *dst = dstRow; - if (dstFormat == MESA_FORMAT_SIGNED_RGBX8888) { + if (dstFormat == MESA_FORMAT_X8B8G8R8_SNORM) { for (col = 0; col < srcWidth; col++) { dst[3] = FLOAT_TO_BYTE_TEX(srcRow[RCOMP]); dst[2] = FLOAT_TO_BYTE_TEX(srcRow[GCOMP]); @@ -2405,16 +2405,16 @@ _mesa_texstore_signed_rgbx8888(TEXSTORE_PARAMS) /** - * Store a texture in MESA_FORMAT_SIGNED_RGBA8888 or - * MESA_FORMAT_SIGNED_RGBA8888_REV + * Store a texture in MESA_FORMAT_A8B8G8R8_SNORM or + * MESA_FORMAT_R8G8B8A8_SNORM */ static GLboolean _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) { const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - ASSERT(dstFormat == MESA_FORMAT_SIGNED_RGBA8888 || - dstFormat == MESA_FORMAT_SIGNED_RGBA8888_REV); + ASSERT(dstFormat == MESA_FORMAT_A8B8G8R8_SNORM || + dstFormat == MESA_FORMAT_R8G8B8A8_SNORM); ASSERT(_mesa_get_format_bytes(dstFormat) == 4); { @@ -2434,7 +2434,7 @@ _mesa_texstore_signed_rgba8888(TEXSTORE_PARAMS) GLbyte *dstRow = (GLbyte *) dstSlices[img]; for (row = 0; row < srcHeight; row++) { GLbyte *dst = dstRow; - if (dstFormat == MESA_FORMAT_SIGNED_RGBA8888) { + if (dstFormat == MESA_FORMAT_A8B8G8R8_SNORM) { for (col = 0; col < srcWidth; col++) { dst[3] = FLOAT_TO_BYTE_TEX(srcRow[RCOMP]); dst[2] = FLOAT_TO_BYTE_TEX(srcRow[GCOMP]); @@ -3737,15 +3737,15 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_RG_FLOAT32] = _mesa_texstore_rgba_float32; table[MESA_FORMAT_RG_FLOAT16] = _mesa_texstore_rgba_float16; table[MESA_FORMAT_DUDV8] = _mesa_texstore_dudv8; - table[MESA_FORMAT_SIGNED_R8] = _mesa_texstore_snorm8; - table[MESA_FORMAT_SIGNED_RG88_REV] = _mesa_texstore_snorm88; - table[MESA_FORMAT_SIGNED_RGBX8888] = _mesa_texstore_signed_rgbx8888; - table[MESA_FORMAT_SIGNED_RGBA8888] = _mesa_texstore_signed_rgba8888; - table[MESA_FORMAT_SIGNED_RGBA8888_REV] = _mesa_texstore_signed_rgba8888; - table[MESA_FORMAT_SIGNED_R16] = _mesa_texstore_snorm16; - table[MESA_FORMAT_SIGNED_GR1616] = _mesa_texstore_snorm1616; - table[MESA_FORMAT_SIGNED_RGB_16] = _mesa_texstore_signed_rgba_16; - table[MESA_FORMAT_SIGNED_RGBA_16] = _mesa_texstore_signed_rgba_16; + table[MESA_FORMAT_R_SNORM8] = _mesa_texstore_snorm8; + table[MESA_FORMAT_R8G8_SNORM] = _mesa_texstore_snorm88; + table[MESA_FORMAT_X8B8G8R8_SNORM] = _mesa_texstore_signed_rgbx8888; + table[MESA_FORMAT_A8B8G8R8_SNORM] = _mesa_texstore_signed_rgba8888; + table[MESA_FORMAT_R8G8B8A8_SNORM] = _mesa_texstore_signed_rgba8888; + table[MESA_FORMAT_R_SNORM16] = _mesa_texstore_snorm16; + table[MESA_FORMAT_R16G16_SNORM] = _mesa_texstore_snorm1616; + table[MESA_FORMAT_RGB_SNORM16] = _mesa_texstore_signed_rgba_16; + table[MESA_FORMAT_RGBA_SNORM16] = _mesa_texstore_signed_rgba_16; table[MESA_FORMAT_RGBA_UNORM16] = _mesa_texstore_rgba_16; table[MESA_FORMAT_RED_RGTC1] = _mesa_texstore_red_rgtc1; table[MESA_FORMAT_SIGNED_RED_RGTC1] = _mesa_texstore_signed_red_rgtc1; @@ -3768,14 +3768,14 @@ _mesa_get_texstore_func(mesa_format format) _mesa_texstore_etc2_rgb8_punchthrough_alpha1; table[MESA_FORMAT_ETC2_SRGB8_PUNCHTHROUGH_ALPHA1] = _mesa_texstore_etc2_srgb8_punchthrough_alpha1; - table[MESA_FORMAT_SIGNED_A8] = _mesa_texstore_snorm8; - table[MESA_FORMAT_SIGNED_L8] = _mesa_texstore_snorm8; - table[MESA_FORMAT_SIGNED_AL88] = _mesa_texstore_snorm88; - table[MESA_FORMAT_SIGNED_I8] = _mesa_texstore_snorm8; - table[MESA_FORMAT_SIGNED_A16] = _mesa_texstore_snorm16; - table[MESA_FORMAT_SIGNED_L16] = _mesa_texstore_snorm16; - table[MESA_FORMAT_SIGNED_AL1616] = _mesa_texstore_snorm1616; - table[MESA_FORMAT_SIGNED_I16] = _mesa_texstore_snorm16; + table[MESA_FORMAT_A_SNORM8] = _mesa_texstore_snorm8; + table[MESA_FORMAT_L_SNORM8] = _mesa_texstore_snorm8; + table[MESA_FORMAT_L8A8_SNORM] = _mesa_texstore_snorm88; + table[MESA_FORMAT_I_SNORM8] = _mesa_texstore_snorm8; + table[MESA_FORMAT_A_SNORM16] = _mesa_texstore_snorm16; + table[MESA_FORMAT_L_SNORM16] = _mesa_texstore_snorm16; + table[MESA_FORMAT_LA_SNORM16] = _mesa_texstore_snorm1616; + table[MESA_FORMAT_I_SNORM16] = _mesa_texstore_snorm16; table[MESA_FORMAT_R9G9B9E5_FLOAT] = _mesa_texstore_rgb9_e5; table[MESA_FORMAT_R11G11B10_FLOAT] = _mesa_texstore_r11_g11_b10f; table[MESA_FORMAT_Z_FLOAT32] = _mesa_texstore_z32; @@ -3856,8 +3856,8 @@ _mesa_get_texstore_func(mesa_format format) table[MESA_FORMAT_R10G10B10A2_UNORM] = _mesa_texstore_abgr2101010; - table[MESA_FORMAT_SIGNED_RG88] = _mesa_texstore_snorm88; - table[MESA_FORMAT_SIGNED_RG1616] = _mesa_texstore_snorm1616; + table[MESA_FORMAT_G8R8_SNORM] = _mesa_texstore_snorm88; + table[MESA_FORMAT_G16R16_SNORM] = _mesa_texstore_snorm1616; initialized = GL_TRUE; } |