From 5586e5c3db500886506e66c5c21f5bbadbcaaa8a Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Gardou?= Date: Tue, 1 Oct 2013 13:27:57 +0000 Subject: [PATCH] [MESA] - leaner build part 1 of X - Get rid of some fancy formats svn path=/trunk/; revision=60488 --- .../opengl/mesa/src/mesa/main/CMakeLists.txt | 1 - .../opengl/mesa/src/mesa/main/extensions.c | 4 - .../dll/opengl/mesa/src/mesa/main/fbobject.c | 15 +- .../opengl/mesa/src/mesa/main/format_pack.c | 59 ----- .../opengl/mesa/src/mesa/main/format_unpack.c | 40 --- .../dll/opengl/mesa/src/mesa/main/formats.c | 49 ---- .../dll/opengl/mesa/src/mesa/main/formats.h | 5 - .../dll/opengl/mesa/src/mesa/main/glheader.h | 4 - reactos/dll/opengl/mesa/src/mesa/main/image.c | 19 -- .../dll/opengl/mesa/src/mesa/main/mtypes.h | 3 - .../opengl/mesa/src/mesa/main/texcompress.c | 22 -- .../mesa/src/mesa/main/texcompress_etc.c | 71 ------ .../mesa/src/mesa/main/texcompress_etc.h | 40 --- .../mesa/src/mesa/main/texcompress_etc_tmp.h | 136 ---------- .../dll/opengl/mesa/src/mesa/main/texformat.c | 30 --- .../dll/opengl/mesa/src/mesa/main/teximage.c | 70 ------ .../dll/opengl/mesa/src/mesa/main/texparam.c | 6 - .../dll/opengl/mesa/src/mesa/main/texstore.c | 110 --------- .../mesa/src/mesa/main/u_format_r11g11b10f.h | 232 ------------------ .../mesa/src/mesa/main/u_format_rgb9e5.h | 164 ------------- .../dll/opengl/mesa/src/mesa/main/version.c | 2 - .../opengl/mesa/src/mesa/swrast/s_texfetch.c | 26 -- .../mesa/src/mesa/swrast/s_texfetch_tmp.h | 28 --- 23 files changed, 2 insertions(+), 1134 deletions(-) delete mode 100644 reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.c delete mode 100644 reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.h delete mode 100644 reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc_tmp.h delete mode 100644 reactos/dll/opengl/mesa/src/mesa/main/u_format_r11g11b10f.h delete mode 100644 reactos/dll/opengl/mesa/src/mesa/main/u_format_rgb9e5.h diff --git a/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt b/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt index 0d00a668079..db3197f4645 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt +++ b/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt @@ -81,7 +81,6 @@ list(APPEND SOURCE texcompress_rgtc.c texcompress_s3tc.c texcompress_fxt1.c - texcompress_etc.c texenv.c texformat.c texgen.c diff --git a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c index b7b1e448046..a62599f6d5d 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c @@ -170,7 +170,6 @@ static const struct extension extension_table[] = { { "GL_EXT_gpu_shader4", o(EXT_gpu_shader4), GL, 2006 }, { "GL_EXT_multi_draw_arrays", o(dummy_true), GL | ES1 | ES2, 1999 }, { "GL_EXT_packed_depth_stencil", o(EXT_packed_depth_stencil), GL, 2005 }, - { "GL_EXT_packed_float", o(EXT_packed_float), GL, 2004 }, { "GL_EXT_packed_pixels", o(EXT_packed_pixels), GL, 1997 }, { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), GL, 2004 }, { "GL_EXT_point_parameters", o(EXT_point_parameters), GL, 1997 }, @@ -203,7 +202,6 @@ static const struct extension extension_table[] = { { "GL_EXT_texture_object", o(dummy_true), GL, 1995 }, { "GL_EXT_texture", o(dummy_true), GL, 1996 }, { "GL_EXT_texture_rectangle", o(NV_texture_rectangle), GL, 2004 }, - { "GL_EXT_texture_shared_exponent", o(EXT_texture_shared_exponent), GL, 2004 }, { "GL_EXT_texture_snorm", o(EXT_texture_snorm), GL, 2009 }, { "GL_EXT_texture_sRGB", o(EXT_texture_sRGB), GL, 2004 }, { "GL_EXT_texture_sRGB_decode", o(EXT_texture_sRGB_decode), GL, 2006 }, @@ -219,7 +217,6 @@ static const struct extension extension_table[] = { { "GL_OES_blend_func_separate", o(EXT_blend_func_separate), ES1, 2009 }, { "GL_OES_blend_subtract", o(dummy_true), ES1, 2009 }, { "GL_OES_byte_coordinates", o(dummy_true), ES1, 2002 }, - { "GL_OES_compressed_ETC1_RGB8_texture", o(OES_compressed_ETC1_RGB8_texture), ES1 | ES2, 2005 }, { "GL_OES_compressed_paletted_texture", o(dummy_true), ES1, 2003 }, { "GL_OES_depth24", o(EXT_framebuffer_object), ES1 | ES2, 2005 }, { "GL_OES_depth32", o(dummy_false), DISABLE, 2005 }, @@ -478,7 +475,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE; ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; - ctx->Extensions.EXT_texture_shared_exponent = GL_TRUE; #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c b/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c index 64f592a14bc..18a934f7540 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c @@ -461,15 +461,8 @@ _mesa_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb) fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; return; - default: - switch (rb->Format) { - /* XXX This list is likely incomplete. */ - case MESA_FORMAT_RGB9_E5_FLOAT: - fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED; - return; - default:; - /* render buffer format is supported by software rendering */ - } + default:; + /* render buffer format is supported by software rendering */ } } } @@ -1234,10 +1227,6 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) case GL_INTENSITY32F_ARB: return ctx->Extensions.ARB_texture_float && ctx->Extensions.ARB_framebuffer_object ? GL_INTENSITY : 0; - case GL_RGB9_E5: - return ctx->Extensions.EXT_texture_shared_exponent ? GL_RGB : 0; - case GL_R11F_G11F_B10F: - return ctx->Extensions.EXT_packed_float ? GL_RGB : 0; case GL_RGBA8UI_EXT: case GL_RGBA16UI_EXT: diff --git a/reactos/dll/opengl/mesa/src/mesa/main/format_pack.c b/reactos/dll/opengl/mesa/src/mesa/main/format_pack.c index 1dee04249ec..e980425b40a 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/format_pack.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/format_pack.c @@ -38,13 +38,6 @@ #include "colormac.h" #include "format_pack.h" #include "macros.h" -#if 0 -#include "../../gallium/auxiliary/util/u_format_rgb9e5.h" -#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" -#else -#include "u_format_rgb9e5.h" -#include "u_format_r11g11b10f.h" -#endif typedef void (*pack_ubyte_rgba_row_func)(GLuint n, @@ -1593,53 +1586,6 @@ pack_float_SIGNED_AL1616(const GLfloat src[4], void *dst) } -/* - * MESA_FORMAT_RGB9_E5_FLOAT; - */ - -static void -pack_float_RGB9_E5_FLOAT(const GLfloat src[4], void *dst) -{ - GLuint *d = (GLuint *) dst; - *d = float3_to_rgb9e5(src); -} - -static void -pack_ubyte_RGB9_E5_FLOAT(const GLubyte src[4], void *dst) -{ - GLuint *d = (GLuint *) dst; - GLfloat rgb[3]; - rgb[0] = UBYTE_TO_FLOAT(src[RCOMP]); - rgb[1] = UBYTE_TO_FLOAT(src[GCOMP]); - rgb[2] = UBYTE_TO_FLOAT(src[BCOMP]); - *d = float3_to_rgb9e5(rgb); -} - - - -/* - * MESA_FORMAT_R11_G11_B10_FLOAT; - */ - -static void -pack_ubyte_R11_G11_B10_FLOAT(const GLubyte src[4], void *dst) -{ - GLuint *d = (GLuint *) dst; - GLfloat rgb[3]; - rgb[0] = UBYTE_TO_FLOAT(src[RCOMP]); - rgb[1] = UBYTE_TO_FLOAT(src[GCOMP]); - rgb[2] = UBYTE_TO_FLOAT(src[BCOMP]); - *d = float3_to_r11g11b10f(rgb); -} - -static void -pack_float_R11_G11_B10_FLOAT(const GLfloat src[4], void *dst) -{ - GLuint *d = (GLuint *) dst; - *d = float3_to_r11g11b10f(src); -} - - /** * Return a function that can pack a GLubyte rgba[4] color. @@ -1774,9 +1720,6 @@ _mesa_get_pack_ubyte_rgba_function(gl_format format) table[MESA_FORMAT_RGBA_16] = pack_ubyte_RGBA_16; - table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_ubyte_RGB9_E5_FLOAT; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_ubyte_R11_G11_B10_FLOAT; - initialized = GL_TRUE; } @@ -1915,8 +1858,6 @@ _mesa_get_pack_float_rgba_function(gl_format format) table[MESA_FORMAT_SIGNED_AL1616] = pack_float_SIGNED_AL1616; table[MESA_FORMAT_SIGNED_I16] = pack_float_SIGNED_L16; /* reused */ - table[MESA_FORMAT_RGB9_E5_FLOAT] = pack_float_RGB9_E5_FLOAT; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = pack_float_R11_G11_B10_FLOAT; initialized = GL_TRUE; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c b/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c index 7eab1e310d7..98b838defe4 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c @@ -25,13 +25,6 @@ #include "colormac.h" #include "format_unpack.h" #include "macros.h" -#if 0 -#include "../../gallium/auxiliary/util/u_format_rgb9e5.h" -#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" -#else -#include "u_format_rgb9e5.h" -#include "u_format_r11g11b10f.h" -#endif @@ -1314,12 +1307,6 @@ unpack_SIGNED_LA_LATC2(const void *src, GLfloat dst[][4], GLuint n) /* XXX to do */ } -static void -unpack_ETC1_RGB8(const void *src, GLfloat dst[][4], GLuint n) -{ - /* XXX to do */ -} - static void unpack_SIGNED_A8(const void *src, GLfloat dst[][4], GLuint n) { @@ -1424,28 +1411,6 @@ unpack_SIGNED_I16(const void *src, GLfloat dst[][4], GLuint n) } } -static void -unpack_RGB9_E5_FLOAT(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLuint *s = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i++) { - rgb9e5_to_float3(s[i], dst[i]); - dst[i][ACOMP] = 1.0F; - } -} - -static void -unpack_R11_G11_B10_FLOAT(const void *src, GLfloat dst[][4], GLuint n) -{ - const GLuint *s = (const GLuint *) src; - GLuint i; - for (i = 0; i < n; i++) { - r11g11b10f_to_float3(s[i], dst[i]); - dst[i][ACOMP] = 1.0F; - } -} - /** * Return the unpacker function for the given format. @@ -1567,8 +1532,6 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_LA_LATC2] = unpack_LA_LATC2; table[MESA_FORMAT_SIGNED_LA_LATC2] = unpack_SIGNED_LA_LATC2; - table[MESA_FORMAT_ETC1_RGB8] = unpack_ETC1_RGB8; - table[MESA_FORMAT_SIGNED_A8] = unpack_SIGNED_A8; table[MESA_FORMAT_SIGNED_L8] = unpack_SIGNED_L8; table[MESA_FORMAT_SIGNED_AL88] = unpack_SIGNED_AL88; @@ -1578,9 +1541,6 @@ get_unpack_rgba_function(gl_format format) table[MESA_FORMAT_SIGNED_AL1616] = unpack_SIGNED_AL1616; table[MESA_FORMAT_SIGNED_I16] = unpack_SIGNED_I16; - table[MESA_FORMAT_RGB9_E5_FLOAT] = unpack_RGB9_E5_FLOAT; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = unpack_R11_G11_B10_FLOAT; - table[MESA_FORMAT_Z32_FLOAT] = unpack_Z32_FLOAT; table[MESA_FORMAT_Z32_FLOAT_X24S8] = unpack_Z32_FLOAT_X24S8; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/formats.c b/reactos/dll/opengl/mesa/src/mesa/main/formats.c index d11b167f900..c839be998d8 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/formats.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/formats.c @@ -1387,16 +1387,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 4, 4, 16 /* 16 bytes per 4x4 block */ }, - { - MESA_FORMAT_ETC1_RGB8, - "MESA_FORMAT_ETC1_RGB8", - GL_RGB, - GL_UNSIGNED_NORMALIZED, - 8, 8, 8, 0, - 0, 0, 0, 0, 0, - 4, 4, 8 /* 8 bytes per 4x4 block */ - }, - /* Signed formats from EXT_texture_snorm that are not in GL3.1 */ { MESA_FORMAT_SIGNED_A8, @@ -1470,24 +1460,6 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 16, 0, 0, 0, 1, 1, 2 }, - { - MESA_FORMAT_RGB9_E5_FLOAT, - "MESA_FORMAT_RGB9_E5", - GL_RGB, - GL_FLOAT, - 9, 9, 9, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 - }, - { - MESA_FORMAT_R11_G11_B10_FLOAT, - "MESA_FORMAT_R11_G11_B10_FLOAT", - GL_RGB, - GL_FLOAT, - 11, 11, 10, 0, - 0, 0, 0, 0, 0, - 1, 1, 4 - }, /* ARB_depth_buffer_float */ { MESA_FORMAT_Z32_FLOAT, /* Name */ @@ -1818,8 +1790,6 @@ _mesa_get_uncompressed_format(gl_format format) return MESA_FORMAT_AL88; case MESA_FORMAT_SIGNED_LA_LATC2: return MESA_FORMAT_SIGNED_AL88; - case MESA_FORMAT_ETC1_RGB8: - return MESA_FORMAT_RGB888; default: #ifdef DEBUG assert(!_mesa_is_format_compressed(format)); @@ -2270,7 +2240,6 @@ _mesa_format_to_type_and_comps(gl_format format, case MESA_FORMAT_SIGNED_L_LATC1: case MESA_FORMAT_LA_LATC2: case MESA_FORMAT_SIGNED_LA_LATC2: - case MESA_FORMAT_ETC1_RGB8: /* XXX generate error instead? */ *datatype = GL_UNSIGNED_BYTE; *comps = 0; @@ -2482,16 +2451,6 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; - case MESA_FORMAT_RGB9_E5_FLOAT: - *datatype = GL_UNSIGNED_INT_5_9_9_9_REV; - *comps = 3; - return; - - case MESA_FORMAT_R11_G11_B10_FLOAT: - *datatype = GL_UNSIGNED_INT_10F_11F_11F_REV; - *comps = 3; - return; - case MESA_FORMAT_ARGB2101010_UINT: *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; *comps = 4; @@ -2808,9 +2767,6 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_SIGNED_LA_LATC2: return GL_FALSE; - case MESA_FORMAT_ETC1_RGB8: - return GL_FALSE; - case MESA_FORMAT_SIGNED_A8: case MESA_FORMAT_SIGNED_L8: case MESA_FORMAT_SIGNED_AL88: @@ -2825,11 +2781,6 @@ _mesa_format_matches_format_and_type(gl_format gl_format, case MESA_FORMAT_ARGB2101010_UINT: return GL_FALSE; - case MESA_FORMAT_RGB9_E5_FLOAT: - return format == GL_RGB && type == GL_UNSIGNED_INT_5_9_9_9_REV; - case MESA_FORMAT_R11_G11_B10_FLOAT: - return format == GL_RGB && type == GL_UNSIGNED_INT_10F_11F_11F_REV; - case MESA_FORMAT_Z32_FLOAT: return format == GL_DEPTH_COMPONENT && type == GL_FLOAT; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/formats.h b/reactos/dll/opengl/mesa/src/mesa/main/formats.h index 9609343387f..a29372204df 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/formats.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/formats.h @@ -258,8 +258,6 @@ typedef enum MESA_FORMAT_SIGNED_LA_LATC2, /*@}*/ - MESA_FORMAT_ETC1_RGB8, - MESA_FORMAT_SIGNED_A8, /* AAAA AAAA */ MESA_FORMAT_SIGNED_L8, /* LLLL LLLL */ MESA_FORMAT_SIGNED_AL88, /* AAAA AAAA LLLL LLLL */ @@ -269,9 +267,6 @@ typedef enum MESA_FORMAT_SIGNED_AL1616, /* AAAA AAAA AAAA AAAA LLLL LLLL LLLL LLLL */ MESA_FORMAT_SIGNED_I16, /* IIII IIII IIII IIII */ - MESA_FORMAT_RGB9_E5_FLOAT, - MESA_FORMAT_R11_G11_B10_FLOAT, - MESA_FORMAT_Z32_FLOAT, MESA_FORMAT_Z32_FLOAT_X24S8, diff --git a/reactos/dll/opengl/mesa/src/mesa/main/glheader.h b/reactos/dll/opengl/mesa/src/mesa/main/glheader.h index d2bca9bf444..372b6fdadf3 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/glheader.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/glheader.h @@ -139,10 +139,6 @@ typedef void *GLeglImageOES; #define GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI 0x8837 #endif -#ifndef GL_OES_compressed_ETC1_RGB8_texture -#define GL_ETC1_RGB8_OES 0x8D64 -#endif - /** * Internal token to represent a GLSL shader program (a collection of diff --git a/reactos/dll/opengl/mesa/src/mesa/main/image.c b/reactos/dll/opengl/mesa/src/mesa/main/image.c index b6c2645e9b0..63ae8cda9d9 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/image.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/image.c @@ -428,15 +428,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, } return GL_NO_ERROR; - case GL_UNSIGNED_INT_10F_11F_11F_REV: - if (!ctx->Extensions.EXT_packed_float) { - return GL_INVALID_ENUM; - } - if (format != GL_RGB) { - return GL_INVALID_OPERATION; - } - return GL_NO_ERROR; - default: ; /* fall-through */ } @@ -524,12 +515,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, case GL_HALF_FLOAT: return ctx->Extensions.ARB_half_float_pixel ? GL_NO_ERROR : GL_INVALID_ENUM; - case GL_UNSIGNED_INT_5_9_9_9_REV: - return ctx->Extensions.EXT_texture_shared_exponent - ? GL_NO_ERROR : GL_INVALID_ENUM; - case GL_UNSIGNED_INT_10F_11F_11F_REV: - return ctx->Extensions.EXT_packed_float - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -848,7 +833,6 @@ _mesa_is_color_format(GLenum format) case GL_COMPRESSED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: - case GL_ETC1_RGB8_OES: /* generic integer formats */ case GL_RED_INTEGER_EXT: case GL_GREEN_INTEGER_EXT: @@ -935,7 +919,6 @@ _mesa_is_color_format(GLenum format) case GL_INTENSITY_SNORM: case GL_INTENSITY8_SNORM: case GL_INTENSITY16_SNORM: - case GL_RGB9_E5: case GL_R11F_G11F_B10F: case GL_RGB10_A2UI: return GL_TRUE; @@ -1172,8 +1155,6 @@ _mesa_is_compressed_format(struct gl_context *ctx, GLenum format) return ctx->Extensions.EXT_texture_compression_latc; case GL_COMPRESSED_LUMINANCE_ALPHA_3DC_ATI: return ctx->Extensions.ATI_texture_compression_3dc; - case GL_ETC1_RGB8_OES: - return ctx->Extensions.OES_compressed_ETC1_RGB8_texture; #if FEATURE_ES case GL_PALETTE4_RGB8_OES: case GL_PALETTE4_RGBA8_OES: diff --git a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h index b86aeb6c1f1..15e16dae5f9 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h @@ -2928,7 +2928,6 @@ struct gl_extensions GLboolean EXT_gpu_program_parameters; GLboolean EXT_gpu_shader4; GLboolean EXT_packed_depth_stencil; - GLboolean EXT_packed_float; GLboolean EXT_packed_pixels; GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; @@ -2947,7 +2946,6 @@ struct gl_extensions GLboolean EXT_texture_filter_anisotropic; GLboolean EXT_texture_integer; GLboolean EXT_texture_mirror_clamp; - GLboolean EXT_texture_shared_exponent; GLboolean EXT_texture_snorm; GLboolean EXT_texture_sRGB; GLboolean EXT_texture_sRGB_decode; @@ -2993,7 +2991,6 @@ struct gl_extensions GLboolean OES_EGL_image; GLboolean OES_draw_texture; GLboolean OES_EGL_image_external; - GLboolean OES_compressed_ETC1_RGB8_texture; GLboolean extension_sentinel; /** The extension string */ const GLubyte *String; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texcompress.c b/reactos/dll/opengl/mesa/src/mesa/main/texcompress.c index 44590ea96db..8d2b2a2c2f7 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texcompress.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texcompress.c @@ -40,7 +40,6 @@ #include "texcompress_fxt1.h" #include "texcompress_rgtc.h" #include "texcompress_s3tc.h" -#include "texcompress_etc.h" #include "swrast/s_context.h" @@ -91,7 +90,6 @@ _mesa_gl_compressed_format_base_format(GLenum format) case GL_COMPRESSED_RGB_S3TC_DXT1_EXT: case GL_COMPRESSED_RGB_FXT1_3DFX: case GL_COMPRESSED_SRGB_S3TC_DXT1_EXT: - case GL_ETC1_RGB8_OES: return GL_RGB; case GL_COMPRESSED_RGBA: @@ -266,15 +264,6 @@ _mesa_get_compressed_formats(struct gl_context *ctx, GLint *formats) } } - if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) { - if (formats) { - formats[n++] = GL_ETC1_RGB8_OES; - } - else { - n += 1; - } - } - #if FEATURE_ES1 if (ctx->API == API_OPENGLES) { if (formats) { @@ -352,9 +341,6 @@ _mesa_glenum_to_compressed_format(GLenum format) case GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT: return MESA_FORMAT_SIGNED_LA_LATC2; - case GL_ETC1_RGB8_OES: - return MESA_FORMAT_ETC1_RGB8; - default: return MESA_FORMAT_NONE; } @@ -420,9 +406,6 @@ _mesa_compressed_format_to_glenum(struct gl_context *ctx, GLuint mesaFormat) case MESA_FORMAT_SIGNED_LA_LATC2: return GL_COMPRESSED_SIGNED_LUMINANCE_ALPHA_LATC2_EXT; - case MESA_FORMAT_ETC1_RGB8: - return GL_ETC1_RGB8_OES; - default: _mesa_problem(ctx, "Unexpected mesa texture format in" " _mesa_compressed_format_to_glenum()"); @@ -532,11 +515,6 @@ _mesa_decompress_image(gl_format format, GLuint width, GLuint height, fetch = _mesa_fetch_texel_2d_f_signed_la_latc2; break; - /* ETC1 formats */ - case MESA_FORMAT_ETC1_RGB8: - fetch = _mesa_fetch_texel_2d_f_etc1_rgb8; - break; - default: _mesa_problem(NULL, "Unexpected format in _mesa_decompress_image()"); return; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.c b/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.c deleted file mode 100644 index 5b331a92a14..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.c +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (C) 2011 LunarG, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/** - * \file texcompress_etc.c - * GL_OES_compressed_ETC1_RGB8_texture support. - */ - - -#include "mfeatures.h" -#include "texcompress.h" -#include "texcompress_etc.h" -#include "texstore.h" -#include "macros.h" -#include "swrast/s_context.h" - -GLboolean -_mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS) -{ - /* GL_ETC1_RGB8_OES is only valid in glCompressedTexImage2D */ - ASSERT(0); - - return GL_FALSE; -} - -/* define etc1_parse_block and etc. */ -#define UINT8_TYPE GLubyte -#define TAG(x) x -#include "texcompress_etc_tmp.h" -#undef TAG -#undef UINT8_TYPE - -void -_mesa_fetch_texel_2d_f_etc1_rgb8(const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel) -{ - struct etc1_block block; - GLubyte dst[3]; - const GLubyte *src; - - src = (const GLubyte *) texImage->Map + - (((texImage->RowStride + 3) / 4) * (j / 4) + (i / 4)) * 8; - - etc1_parse_block(&block, src); - etc1_fetch_texel(&block, i % 4, j % 4, dst); - - texel[RCOMP] = UBYTE_TO_FLOAT(dst[0]); - texel[GCOMP] = UBYTE_TO_FLOAT(dst[1]); - texel[BCOMP] = UBYTE_TO_FLOAT(dst[2]); - texel[ACOMP] = 1.0f; -} diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.h b/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.h deleted file mode 100644 index 4e166b2b1fc..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc.h +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (C) 2011 LunarG, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -#ifndef TEXCOMPRESS_ETC1_H -#define TEXCOMPRESS_ETC1_H - -#include "glheader.h" -#include "mfeatures.h" -#include "texstore.h" - -struct swrast_texture_image; - -extern GLboolean -_mesa_texstore_etc1_rgb8(TEXSTORE_PARAMS); - -extern void -_mesa_fetch_texel_2d_f_etc1_rgb8(const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel); - -#endif diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc_tmp.h b/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc_tmp.h deleted file mode 100644 index 5c8c6decf8d..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/texcompress_etc_tmp.h +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (C) 2011 LunarG, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* - * Included by texcompress_etc1 and gallium to define ETC1 decoding routines. - */ - -struct TAG(etc1_block) { - uint32_t pixel_indices; - int flipped; - const int *modifier_tables[2]; - UINT8_TYPE base_colors[2][3]; -}; - -static UINT8_TYPE -TAG(etc1_base_color_diff_hi)(UINT8_TYPE in) -{ - return (in & 0xf8) | (in >> 5); -} - -static UINT8_TYPE -TAG(etc1_base_color_diff_lo)(UINT8_TYPE in) -{ - static const int lookup[8] = { 0, 1, 2, 3, -4, -3, -2, -1 }; - - in = (in >> 3) + lookup[in & 0x7]; - - return (in << 3) | (in >> 2); -} - -static UINT8_TYPE -TAG(etc1_base_color_ind_hi)(UINT8_TYPE in) -{ - return (in & 0xf0) | ((in & 0xf0) >> 4); -} - -static UINT8_TYPE -TAG(etc1_base_color_ind_lo)(UINT8_TYPE in) -{ - return ((in & 0xf) << 4) | (in & 0xf); -} - -static UINT8_TYPE -TAG(etc1_clamp)(UINT8_TYPE base, int modifier) -{ - int tmp = (int) base + modifier; - - /* CLAMP(tmp, 0, 255) */ - return (UINT8_TYPE) ((tmp < 0) ? 0 : ((tmp > 255) ? 255 : tmp)); -} - -static const int TAG(etc1_modifier_tables)[8][4] = { - { 2, 8, -2, -8}, - { 5, 17, -5, -17}, - { 9, 29, -9, -29}, - { 13, 42, -13, -42}, - { 18, 60, -18, -60}, - { 24, 80, -24, -80}, - { 33, 106, -33, -106}, - { 47, 183, -47, -183} -}; - -static void -TAG(etc1_parse_block)(struct TAG(etc1_block) *block, const UINT8_TYPE *src) -{ - if (src[3] & 0x2) { - /* differential mode */ - block->base_colors[0][0] = (int) TAG(etc1_base_color_diff_hi)(src[0]); - block->base_colors[1][0] = (int) TAG(etc1_base_color_diff_lo)(src[0]); - block->base_colors[0][1] = (int) TAG(etc1_base_color_diff_hi)(src[1]); - block->base_colors[1][1] = (int) TAG(etc1_base_color_diff_lo)(src[1]); - block->base_colors[0][2] = (int) TAG(etc1_base_color_diff_hi)(src[2]); - block->base_colors[1][2] = (int) TAG(etc1_base_color_diff_lo)(src[2]); - } - else { - /* individual mode */ - block->base_colors[0][0] = (int) TAG(etc1_base_color_ind_hi)(src[0]); - block->base_colors[1][0] = (int) TAG(etc1_base_color_ind_lo)(src[0]); - block->base_colors[0][1] = (int) TAG(etc1_base_color_ind_hi)(src[1]); - block->base_colors[1][1] = (int) TAG(etc1_base_color_ind_lo)(src[1]); - block->base_colors[0][2] = (int) TAG(etc1_base_color_ind_hi)(src[2]); - block->base_colors[1][2] = (int) TAG(etc1_base_color_ind_lo)(src[2]); - } - - /* pick modifier tables */ - block->modifier_tables[0] = TAG(etc1_modifier_tables)[(src[3] >> 5) & 0x7]; - block->modifier_tables[1] = TAG(etc1_modifier_tables)[(src[3] >> 2) & 0x7]; - - block->flipped = (src[3] & 0x1); - - block->pixel_indices = - (src[4] << 24) | (src[5] << 16) | (src[6] << 8) | src[7]; -} - -static void -TAG(etc1_fetch_texel)(const struct TAG(etc1_block) *block, - int x, int y, UINT8_TYPE *dst) -{ - const UINT8_TYPE *base_color; - int modifier, bit, idx, blk; - - /* get pixel index */ - bit = y + x * 4; - idx = ((block->pixel_indices >> (15 + bit)) & 0x2) | - ((block->pixel_indices >> (bit)) & 0x1); - - /* get subblock */ - blk = (block->flipped) ? (y >= 2) : (x >= 2); - - base_color = block->base_colors[blk]; - modifier = block->modifier_tables[blk][idx]; - - dst[0] = TAG(etc1_clamp)(base_color[0], modifier); - dst[1] = TAG(etc1_clamp)(base_color[1], modifier); - dst[2] = TAG(etc1_clamp)(base_color[2], modifier); -} diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texformat.c b/reactos/dll/opengl/mesa/src/mesa/main/texformat.c index 5fdc2ab1f79..38c4a9cb423 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texformat.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texformat.c @@ -393,26 +393,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, } } - if (ctx->Extensions.EXT_texture_shared_exponent) { - switch (internalFormat) { - case GL_RGB9_E5: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_RGB9_E5_FLOAT]); - return MESA_FORMAT_RGB9_E5_FLOAT; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_float) { - switch (internalFormat) { - case GL_R11F_G11F_B10F: - ASSERT(ctx->TextureFormatSupported[MESA_FORMAT_R11_G11_B10_FLOAT]); - return MESA_FORMAT_R11_G11_B10_FLOAT; - default: - ; /* fallthrough */ - } - } - if (ctx->Extensions.EXT_packed_depth_stencil) { switch (internalFormat) { case GL_DEPTH_STENCIL_EXT: @@ -943,16 +923,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, } } - if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) { - switch (internalFormat) { - case GL_ETC1_RGB8_OES: - RETURN_IF_SUPPORTED(MESA_FORMAT_ETC1_RGB8); - break; - default: - ; /* fallthrough */ - } - } - _mesa_problem(ctx, "unexpected format %s in _mesa_choose_tex_format()", _mesa_lookup_enum_by_nr(internalFormat)); return MESA_FORMAT_NONE; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/teximage.c b/reactos/dll/opengl/mesa/src/mesa/main/teximage.c index 077c1960f1a..d2db7501e19 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/teximage.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/teximage.c @@ -435,24 +435,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } - if (ctx->Extensions.EXT_texture_shared_exponent) { - switch (internalFormat) { - case GL_RGB9_E5_EXT: - return GL_RGB; - default: - ; /* fallthrough */ - } - } - - if (ctx->Extensions.EXT_packed_float) { - switch (internalFormat) { - case GL_R11F_G11F_B10F_EXT: - return GL_RGB; - default: - ; /* fallthrough */ - } - } - if (ctx->Extensions.ARB_depth_buffer_float) { switch (internalFormat) { case GL_DEPTH_COMPONENT32F: @@ -499,15 +481,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } - if (ctx->Extensions.OES_compressed_ETC1_RGB8_texture) { - switch (internalFormat) { - case GL_ETC1_RGB8_OES: - return GL_RGB; - default: - ; /* fallthrough */ - } - } - if (ctx->API == API_OPENGLES) { switch (internalFormat) { case GL_PALETTE4_RGB8_OES: @@ -1380,21 +1353,6 @@ legal_texture_size(struct gl_context *ctx, gl_format format, } -/** - * Return true if the format is only valid for glCompressedTexImage. - */ -static GLboolean -compressedteximage_only_format(const struct gl_context *ctx, GLenum format) -{ - switch (format) { - case GL_ETC1_RGB8_OES: - return GL_TRUE; - default: - return GL_FALSE; - } -} - - /** * Helper function to determine whether a target and specific compression * format are supported. @@ -1740,11 +1698,6 @@ texture_error_check( struct gl_context *ctx, "glTexImage%dD(target)", dimensions); return GL_TRUE; } - if (compressedteximage_only_format(ctx, internalFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexImage%dD(no compression for format)", dimensions); - return GL_TRUE; - } if (border != 0) { if (!isProxy) { _mesa_error(ctx, GL_INVALID_OPERATION, @@ -1897,12 +1850,6 @@ subtexture_error_check2( struct gl_context *ctx, GLuint dimensions, if (_mesa_is_format_compressed(destTex->TexFormat)) { GLuint bw, bh; - if (compressedteximage_only_format(ctx, destTex->InternalFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glTexSubImage%dD(no compression for format)", dimensions); - return GL_TRUE; - } - /* do tests which depend on compression block size */ _mesa_get_format_block_size(destTex->TexFormat, &bw, &bh); @@ -2069,11 +2016,6 @@ copytexture_error_check( struct gl_context *ctx, GLuint dimensions, "glCopyTexImage%dD(target)", dimensions); return GL_TRUE; } - if (compressedteximage_only_format(ctx, internalFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexImage%dD(no compression for format)", dimensions); - return GL_TRUE; - } if (border != 0) { _mesa_error(ctx, GL_INVALID_OPERATION, "glCopyTexImage%dD(border!=0)", dimensions); @@ -2220,11 +2162,6 @@ copytexsubimage_error_check2( struct gl_context *ctx, GLuint dimensions, } if (_mesa_is_format_compressed(teximage->TexFormat)) { - if (compressedteximage_only_format(ctx, teximage->InternalFormat)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCopyTexSubImage%dD(no compression for format)", dimensions); - return GL_TRUE; - } /* offset must be multiple of 4 */ if ((xoffset & 3) || (yoffset & 3)) { _mesa_error(ctx, GL_INVALID_VALUE, @@ -3432,13 +3369,6 @@ compressed_subtexture_error_check2(struct gl_context *ctx, GLuint dims, return GL_TRUE; } - if (compressedteximage_only_format(ctx, format)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glCompressedTexSubImage%uD(format=0x%x cannot be updated)" - , dims, format); - return GL_TRUE; - } - if (((width == 1 || width == 2) && width != (GLsizei) texImage->Width) || (width > (GLsizei) texImage->Width)) { diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texparam.c b/reactos/dll/opengl/mesa/src/mesa/main/texparam.c index 0f92a5b988e..137e8564a9c 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texparam.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texparam.c @@ -1015,12 +1015,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, goto invalid_pname; *params = _mesa_get_format_bits(texFormat, pname); break; - case GL_TEXTURE_SHARED_SIZE: - if (ctx->VersionMajor < 3 && - !ctx->Extensions.EXT_texture_shared_exponent) - goto invalid_pname; - *params = texFormat == MESA_FORMAT_RGB9_E5_FLOAT ? 5 : 0; - break; /* GL_ARB_texture_compression */ case GL_TEXTURE_COMPRESSED_IMAGE_SIZE: diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texstore.c b/reactos/dll/opengl/mesa/src/mesa/main/texstore.c index a23b270442f..08cbcee136a 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texstore.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texstore.c @@ -67,17 +67,9 @@ #include "texcompress_fxt1.h" #include "texcompress_rgtc.h" #include "texcompress_s3tc.h" -#include "texcompress_etc.h" #include "teximage.h" #include "texstore.h" #include "enums.h" -#if 0 -#include "../../gallium/auxiliary/util/u_format_rgb9e5.h" -#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" -#else -#include "u_format_rgb9e5.h" -#include "u_format_r11g11b10f.h" -#endif enum { @@ -3958,105 +3950,6 @@ _mesa_texstore_sla8(TEXSTORE_PARAMS) #endif /* FEATURE_EXT_texture_sRGB */ -static GLboolean -_mesa_texstore_rgb9_e5(TEXSTORE_PARAMS) -{ - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - - ASSERT(dstFormat == MESA_FORMAT_RGB9_E5_FLOAT); - ASSERT(baseInternalFormat == GL_RGB); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcFormat == GL_RGB && - srcType == GL_UNSIGNED_INT_5_9_9_9_REV) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, - dstRowStride, dstSlices, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking, - ctx->_ImageTransferState); - const GLfloat *srcRow = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = dstSlices[img]; - for (row = 0; row < srcHeight; row++) { - GLuint *dstUI = (GLuint*)dstRow; - for (col = 0; col < srcWidth; col++) { - dstUI[col] = float3_to_rgb9e5(&srcRow[col * 3]); - } - dstRow += dstRowStride; - srcRow += srcWidth * 3; - } - } - - free((void *) tempImage); - } - return GL_TRUE; -} - -static GLboolean -_mesa_texstore_r11_g11_b10f(TEXSTORE_PARAMS) -{ - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - - ASSERT(dstFormat == MESA_FORMAT_R11_G11_B10_FLOAT); - ASSERT(baseInternalFormat == GL_RGB); - - if (!ctx->_ImageTransferState && - !srcPacking->SwapBytes && - srcFormat == GL_RGB && - srcType == GL_UNSIGNED_INT_10F_11F_11F_REV) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, - dstRowStride, dstSlices, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLfloat *tempImage = _mesa_make_temp_float_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, srcDepth, - srcFormat, srcType, srcAddr, - srcPacking, - ctx->_ImageTransferState); - const GLfloat *srcRow = tempImage; - GLint img, row, col; - if (!tempImage) - return GL_FALSE; - for (img = 0; img < srcDepth; img++) { - GLubyte *dstRow = dstSlices[img]; - for (row = 0; row < srcHeight; row++) { - GLuint *dstUI = (GLuint*)dstRow; - for (col = 0; col < srcWidth; col++) { - dstUI[col] = float3_to_r11g11b10f(&srcRow[col * 3]); - } - dstRow += dstRowStride; - srcRow += srcWidth * 3; - } - } - - free((void *) tempImage); - } - return GL_TRUE; -} - - static GLboolean _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS) { @@ -4299,7 +4192,6 @@ _mesa_get_texstore_func(gl_format format) table[MESA_FORMAT_SIGNED_L_LATC1] = _mesa_texstore_signed_red_rgtc1; table[MESA_FORMAT_LA_LATC2] = _mesa_texstore_rg_rgtc2; table[MESA_FORMAT_SIGNED_LA_LATC2] = _mesa_texstore_signed_rg_rgtc2; - table[MESA_FORMAT_ETC1_RGB8] = _mesa_texstore_etc1_rgb8; table[MESA_FORMAT_SIGNED_A8] = _mesa_texstore_snorm8; table[MESA_FORMAT_SIGNED_L8] = _mesa_texstore_snorm8; table[MESA_FORMAT_SIGNED_AL88] = _mesa_texstore_snorm88; @@ -4308,8 +4200,6 @@ _mesa_get_texstore_func(gl_format format) 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_RGB9_E5_FLOAT] = _mesa_texstore_rgb9_e5; - table[MESA_FORMAT_R11_G11_B10_FLOAT] = _mesa_texstore_r11_g11_b10f; table[MESA_FORMAT_Z32_FLOAT] = _mesa_texstore_z32; table[MESA_FORMAT_Z32_FLOAT_X24S8] = _mesa_texstore_z32f_x24s8; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/u_format_r11g11b10f.h b/reactos/dll/opengl/mesa/src/mesa/main/u_format_r11g11b10f.h deleted file mode 100644 index 146f4fbe87f..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/u_format_r11g11b10f.h +++ /dev/null @@ -1,232 +0,0 @@ -/* - * Copyright (C) 2011 Marek Olšák - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* Based on code from The OpenGL Programming Guide / 7th Edition, Appendix J. - * Available here: http://www.opengl-redbook.com/appendices/ - * The algorithm in the book contains a bug though, which is fixed in the code - * below. - */ - -#define UF11(e, m) ((e << 6) | (m)) -#define UF11_EXPONENT_BIAS 15 -#define UF11_EXPONENT_BITS 0x1F -#define UF11_EXPONENT_SHIFT 6 -#define UF11_MANTISSA_BITS 0x3F -#define UF11_MANTISSA_SHIFT (23 - UF11_EXPONENT_SHIFT) -#define UF11_MAX_EXPONENT (UF11_EXPONENT_BITS << UF11_EXPONENT_SHIFT) - -#define UF10(e, m) ((e << 5) | (m)) -#define UF10_EXPONENT_BIAS 15 -#define UF10_EXPONENT_BITS 0x1F -#define UF10_EXPONENT_SHIFT 5 -#define UF10_MANTISSA_BITS 0x1F -#define UF10_MANTISSA_SHIFT (23 - UF10_EXPONENT_SHIFT) -#define UF10_MAX_EXPONENT (UF10_EXPONENT_BITS << UF10_EXPONENT_SHIFT) - -#define F32_INFINITY 0x7f800000 - -static INLINE unsigned f32_to_uf11(float val) -{ - union { - float f; - uint32_t ui; - } f32 = {val}; - - uint16_t uf11 = 0; - - /* Decode little-endian 32-bit floating-point value */ - int sign = (f32.ui >> 16) & 0x8000; - /* Map exponent to the range [-127,128] */ - int exponent = ((f32.ui >> 23) & 0xff) - 127; - int mantissa = f32.ui & 0x007fffff; - - if (exponent == 128) { /* Infinity or NaN */ - /* From the GL_EXT_packed_float spec: - * - * "Additionally: negative infinity is converted to zero; positive - * infinity is converted to positive infinity; and both positive and - * negative NaN are converted to positive NaN." - */ - uf11 = UF11_MAX_EXPONENT; - if (mantissa) { - uf11 |= 1; /* NaN */ - } else { - if (sign) - uf11 = 0; /* 0.0 */ - } - } else if (sign) { - return 0; - } else if (val > 65024.0f) { - /* From the GL_EXT_packed_float spec: - * - * "Likewise, finite positive values greater than 65024 (the maximum - * finite representable unsigned 11-bit floating-point value) are - * converted to 65024." - */ - uf11 = UF11(30, 63); - } - else if (exponent > -15) { /* Representable value */ - exponent += UF11_EXPONENT_BIAS; - mantissa >>= UF11_MANTISSA_SHIFT; - uf11 = exponent << UF11_EXPONENT_SHIFT | mantissa; - } - - return uf11; -} - -static INLINE float uf11_to_f32(uint16_t val) -{ - union { - float f; - uint32_t ui; - } f32; - - int exponent = (val & 0x07c0) >> UF11_EXPONENT_SHIFT; - int mantissa = (val & 0x003f); - - f32.f = 0.0; - - if (exponent == 0) { - if (mantissa != 0) { - const float scale = 1.0 / (1 << 20); - f32.f = scale * mantissa; - } - } - else if (exponent == 31) { - f32.ui = F32_INFINITY | mantissa; - } - else { - float scale, decimal; - exponent -= 15; - if (exponent < 0) { - scale = 1.0f / (1 << -exponent); - } - else { - scale = (float) (1 << exponent); - } - decimal = 1.0f + (float) mantissa / 64; - f32.f = scale * decimal; - } - - return f32.f; -} - -static INLINE unsigned f32_to_uf10(float val) -{ - union { - float f; - uint32_t ui; - } f32 = {val}; - - uint16_t uf10 = 0; - - /* Decode little-endian 32-bit floating-point value */ - int sign = (f32.ui >> 16) & 0x8000; - /* Map exponent to the range [-127,128] */ - int exponent = ((f32.ui >> 23) & 0xff) - 127; - int mantissa = f32.ui & 0x007fffff; - - if (exponent == 128) { - /* From the GL_EXT_packed_float spec: - * - * "Additionally: negative infinity is converted to zero; positive - * infinity is converted to positive infinity; and both positive and - * negative NaN are converted to positive NaN." - */ - uf10 = UF10_MAX_EXPONENT; - if (mantissa) { - uf10 |= 1; /* NaN */ - } else { - if (sign) - uf10 = 0; /* 0.0 */ - } - } else if (sign) { - return 0; - } else if (val > 64512.0f) { /* Overflow - flush to Infinity */ - /* From the GL_EXT_packed_float spec: - * - * "Likewise, finite positive values greater than 64512 (the maximum - * finite representable unsigned 10-bit floating-point value) are - * converted to 64512." - */ - uf10 = UF10(30, 31); - } - else if (exponent > -15) { /* Representable value */ - exponent += UF10_EXPONENT_BIAS; - mantissa >>= UF10_MANTISSA_SHIFT; - uf10 = exponent << UF10_EXPONENT_SHIFT | mantissa; - } - - return uf10; -} - -static INLINE float uf10_to_f32(uint16_t val) -{ - union { - float f; - uint32_t ui; - } f32; - - int exponent = (val & 0x03e0) >> UF10_EXPONENT_SHIFT; - int mantissa = (val & 0x001f); - - f32.f = 0.0; - - if (exponent == 0) { - if (mantissa != 0) { - const float scale = 1.0 / (1 << 20); - f32.f = scale * mantissa; - } - } - else if (exponent == 31) { - f32.ui = F32_INFINITY | mantissa; - } - else { - float scale, decimal; - exponent -= 15; - if (exponent < 0) { - scale = 1.0 / (1 << -exponent); - } - else { - scale = (float) (1 << exponent); - } - decimal = 1.0f + (float) mantissa / 32; - f32.f = scale * decimal; - } - - return f32.f; -} - -static INLINE unsigned float3_to_r11g11b10f(const float rgb[3]) -{ - return ( f32_to_uf11(rgb[0]) & 0x7ff) | - ((f32_to_uf11(rgb[1]) & 0x7ff) << 11) | - ((f32_to_uf10(rgb[2]) & 0x3ff) << 22); -} - -static INLINE void r11g11b10f_to_float3(unsigned rgb, float retval[3]) -{ - retval[0] = uf11_to_f32( rgb & 0x7ff); - retval[1] = uf11_to_f32((rgb >> 11) & 0x7ff); - retval[2] = uf10_to_f32((rgb >> 22) & 0x3ff); -} \ No newline at end of file diff --git a/reactos/dll/opengl/mesa/src/mesa/main/u_format_rgb9e5.h b/reactos/dll/opengl/mesa/src/mesa/main/u_format_rgb9e5.h deleted file mode 100644 index d47c75f4fe0..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/u_format_rgb9e5.h +++ /dev/null @@ -1,164 +0,0 @@ -/* - * Copyright (C) 2011 Marek Olšák - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING - * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER - * DEALINGS IN THE SOFTWARE. - */ - -/* Copied from EXT_texture_shared_exponent and edited. */ - -#ifndef RGB9E5_H -#define RGB9E5_H - -#include -#include - -#define RGB9E5_EXPONENT_BITS 5 -#define RGB9E5_MANTISSA_BITS 9 -#define RGB9E5_EXP_BIAS 15 -#define RGB9E5_MAX_VALID_BIASED_EXP 31 - -#define MAX_RGB9E5_EXP (RGB9E5_MAX_VALID_BIASED_EXP - RGB9E5_EXP_BIAS) -#define RGB9E5_MANTISSA_VALUES (1< 0.0) { - if (x >= MAX_RGB9E5) { - return MAX_RGB9E5; - } else { - return x; - } - } else { - /* NaN gets here too since comparisons with NaN always fail! */ - return 0.0; - } -} - -/* Ok, FloorLog2 is not correct for the denorm and zero values, but we - are going to do a max of this value with the minimum rgb9e5 exponent - that will hide these problem cases. */ -static INLINE int rgb9e5_FloorLog2(float x) -{ - float754 f; - - f.value = x; - return (f.field.biasedexponent - 127); -} - -static INLINE unsigned float3_to_rgb9e5(const float rgb[3]) -{ - rgb9e5 retval; - float maxrgb; - int rm, gm, bm; - float rc, gc, bc; - int exp_shared, maxm; - double denom; - - rc = rgb9e5_ClampRange(rgb[0]); - gc = rgb9e5_ClampRange(rgb[1]); - bc = rgb9e5_ClampRange(rgb[2]); - - maxrgb = MAX3(rc, gc, bc); - exp_shared = MAX2(-RGB9E5_EXP_BIAS-1, rgb9e5_FloorLog2(maxrgb)) + 1 + RGB9E5_EXP_BIAS; - assert(exp_shared <= RGB9E5_MAX_VALID_BIASED_EXP); - assert(exp_shared >= 0); - /* This pow function could be replaced by a table. */ - denom = pow(2, exp_shared - RGB9E5_EXP_BIAS - RGB9E5_MANTISSA_BITS); - - maxm = (int) floor(maxrgb / denom + 0.5); - if (maxm == MAX_RGB9E5_MANTISSA+1) { - denom *= 2; - exp_shared += 1; - assert(exp_shared <= RGB9E5_MAX_VALID_BIASED_EXP); - } else { - assert(maxm <= MAX_RGB9E5_MANTISSA); - } - - rm = (int) floor(rc / denom + 0.5); - gm = (int) floor(gc / denom + 0.5); - bm = (int) floor(bc / denom + 0.5); - - assert(rm <= MAX_RGB9E5_MANTISSA); - assert(gm <= MAX_RGB9E5_MANTISSA); - assert(bm <= MAX_RGB9E5_MANTISSA); - assert(rm >= 0); - assert(gm >= 0); - assert(bm >= 0); - - retval.field.r = rm; - retval.field.g = gm; - retval.field.b = bm; - retval.field.biasedexponent = exp_shared; - - return retval.raw; -} - -static INLINE void rgb9e5_to_float3(unsigned rgb, float retval[3]) -{ - rgb9e5 v; - int exponent; - float scale; - - v.raw = rgb; - exponent = v.field.biasedexponent - RGB9E5_EXP_BIAS - RGB9E5_MANTISSA_BITS; - scale = (float) pow(2, exponent); - - retval[0] = v.field.r * scale; - retval[1] = v.field.g * scale; - retval[2] = v.field.b * scale; -} - -#endif \ No newline at end of file diff --git a/reactos/dll/opengl/mesa/src/mesa/main/version.c b/reactos/dll/opengl/mesa/src/mesa/main/version.c index de08e81bf0f..a2e826aa4c1 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/version.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/version.c @@ -139,9 +139,7 @@ compute_version(struct gl_context *ctx) ctx->Extensions.EXT_draw_buffers2 && ctx->Extensions.ARB_framebuffer_object && ctx->Extensions.EXT_framebuffer_sRGB && - ctx->Extensions.EXT_packed_float && ctx->Extensions.EXT_texture_array && - ctx->Extensions.EXT_texture_shared_exponent && ctx->Extensions.EXT_transform_feedback && ctx->Extensions.NV_conditional_render); const GLboolean ver_3_1 = (ver_3_0 && diff --git a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c index 27f6b71c2cd..aa4142ac567 100644 --- a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c +++ b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c @@ -39,17 +39,9 @@ #include "main/texcompress_fxt1.h" #include "main/texcompress_s3tc.h" #include "main/texcompress_rgtc.h" -#include "main/texcompress_etc.h" #include "main/teximage.h" #include "s_context.h" #include "s_texfetch.h" -#if 0 -#include "../../gallium/auxiliary/util/u_format_rgb9e5.h" -#include "../../gallium/auxiliary/util/u_format_r11g11b10f.h" -#else -#include "../main/u_format_rgb9e5.h" -#include "../main/u_format_r11g11b10f.h" -#endif /** @@ -1026,12 +1018,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] = _mesa_fetch_texel_2d_f_signed_la_latc2, NULL }, - { - MESA_FORMAT_ETC1_RGB8, - NULL, - _mesa_fetch_texel_2d_f_etc1_rgb8, - NULL - }, { MESA_FORMAT_SIGNED_A8, fetch_texel_1d_signed_a8, @@ -1080,18 +1066,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_2d_signed_i16, fetch_texel_3d_signed_i16 }, - { - MESA_FORMAT_RGB9_E5_FLOAT, - fetch_texel_1d_rgb9_e5, - fetch_texel_2d_rgb9_e5, - fetch_texel_3d_rgb9_e5 - }, - { - MESA_FORMAT_R11_G11_B10_FLOAT, - fetch_texel_1d_r11_g11_b10f, - fetch_texel_2d_r11_g11_b10f, - fetch_texel_3d_r11_g11_b10f - }, { MESA_FORMAT_Z32_FLOAT, fetch_texel_1d_f_r_f32, /* Reuse the R32F functions. */ diff --git a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch_tmp.h b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch_tmp.h index b65d33f0410..8fee10f5b96 100644 --- a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch_tmp.h +++ b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch_tmp.h @@ -1525,34 +1525,6 @@ static void FETCH(f_s8_z24)( const struct swrast_texture_image *texImage, } - - -/* MESA_FORMAT_RGB9_E5 ******************************************************/ - -static void FETCH(rgb9_e5)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - rgb9e5_to_float3(*src, texel); - texel[ACOMP] = 1.0F; -} - - - - -/* MESA_FORMAT_R11_G11_B10_FLOAT *********************************************/ - -static void FETCH(r11_g11_b10f)( const struct swrast_texture_image *texImage, - GLint i, GLint j, GLint k, GLfloat *texel ) -{ - const GLuint *src = TEXEL_ADDR(GLuint, texImage, i, j, k, 1); - r11g11b10f_to_float3(*src, texel); - texel[ACOMP] = 1.0F; -} - - - - /* MESA_FORMAT_Z32_FLOAT_X24S8 ***********************************************/ static void FETCH(z32f_x24s8)(const struct swrast_texture_image *texImage, -- 2.17.1