diff --git a/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c b/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c index 1df8381737f..61731bc18eb 100644 --- a/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c +++ b/reactos/dll/opengl/mesa/src/mesa/drivers/common/driverfuncs.c @@ -42,7 +42,6 @@ #include "main/texstore.h" #include "main/bufferobj.h" #include "main/fbobject.h" -#include "main/samplerobj.h" #include "main/syncobj.h" #include "main/texturebarrier.h" #include "main/transformfeedback.h" @@ -199,8 +198,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) _mesa_init_transform_feedback_functions(driver); - _mesa_init_sampler_object_functions(driver); - /* T&L stuff */ driver->CurrentExecPrimitive = 0; driver->CurrentSavePrimitive = 0; diff --git a/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c b/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c index 82bbbf36f03..ddb7ea19bde 100644 --- a/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c +++ b/reactos/dll/opengl/mesa/src/mesa/drivers/common/meta.c @@ -1329,7 +1329,6 @@ blitframebuffer_texture(struct gl_context *ctx, const GLint maxLevelSave = texObj->MaxLevel; const GLenum wrapSSave = texObj->Sampler.WrapS; const GLenum wrapTSave = texObj->Sampler.WrapT; - const GLenum srgbSave = texObj->Sampler.sRGBDecode; const GLenum fbo_srgb_save = ctx->Color.sRGBEnabled; const GLenum target = texObj->Target; @@ -1364,10 +1363,6 @@ blitframebuffer_texture(struct gl_context *ctx, _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); /* Always do our blits with no sRGB decode or encode.*/ - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, - GL_SKIP_DECODE_EXT); - } if (ctx->Extensions.EXT_framebuffer_sRGB) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE); } @@ -1433,9 +1428,6 @@ blitframebuffer_texture(struct gl_context *ctx, } _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave); - } if (ctx->Extensions.EXT_framebuffer_sRGB && fbo_srgb_save) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE); } @@ -2297,14 +2289,7 @@ _mesa_meta_DrawPixels(struct gl_context *ctx, } } else if (_mesa_is_depth_format(format)) { - if (ctx->Extensions.ARB_depth_texture && - ctx->Extensions.ARB_fragment_program) { - texIntFormat = GL_DEPTH_COMPONENT; - metaExtraSave = (MESA_META_SHADER); - } - else { - fallback = GL_TRUE; - } + fallback = GL_TRUE; } else { fallback = GL_TRUE; @@ -2682,8 +2667,7 @@ _mesa_meta_check_generate_mipmap_fallback(struct gl_context *ctx, GLenum target, return GL_TRUE; } - if (_mesa_get_format_color_encoding(baseImage->TexFormat) == GL_SRGB && - !ctx->Extensions.EXT_texture_sRGB_decode) { + if (_mesa_get_format_color_encoding(baseImage->TexFormat) == GL_SRGB) { /* The texture format is sRGB but we can't turn off sRGB->linear * texture sample conversion. So we won't be able to generate the * right colors when rendering. Need to use a fallback. @@ -2908,7 +2892,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, const GLenum wrapSSave = texObj->Sampler.WrapS; const GLenum wrapTSave = texObj->Sampler.WrapT; const GLenum wrapRSave = texObj->Sampler.WrapR; - const GLenum srgbDecodeSave = texObj->Sampler.sRGBDecode; const GLenum srgbBufferSave = ctx->Color.sRGBEnabled; const GLuint fboSave = ctx->DrawBuffer->Name; const GLuint original_active_unit = ctx->Texture.CurrentUnit; @@ -2973,10 +2956,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_TexParameteri(target, GL_TEXTURE_WRAP_R, GL_CLAMP_TO_EDGE); /* We don't want to encode or decode sRGB values; treat them as linear */ - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, - GL_SKIP_DECODE_EXT); - } if (ctx->Extensions.EXT_framebuffer_sRGB) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE); } @@ -3102,10 +3081,6 @@ _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, _mesa_DrawArrays(GL_TRIANGLE_FAN, 0, 4); } - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, - srgbDecodeSave); - } if (ctx->Extensions.EXT_framebuffer_sRGB && srgbBufferSave) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_TRUE); } @@ -3415,7 +3390,6 @@ decompress_texture_image(struct gl_context *ctx, const GLint maxLevelSave = texObj->MaxLevel; const GLenum wrapSSave = texObj->Sampler.WrapS; const GLenum wrapTSave = texObj->Sampler.WrapT; - const GLenum srgbSave = texObj->Sampler.sRGBDecode; /* restrict sampling to the texture level of interest */ _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, texImage->Level); @@ -3424,11 +3398,6 @@ decompress_texture_image(struct gl_context *ctx, _mesa_TexParameteri(target, GL_TEXTURE_MIN_FILTER, GL_NEAREST); _mesa_TexParameteri(target, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - /* No sRGB decode or encode.*/ - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, - GL_SKIP_DECODE_EXT); - } if (ctx->Extensions.EXT_framebuffer_sRGB) { _mesa_set_enable(ctx, GL_FRAMEBUFFER_SRGB_EXT, GL_FALSE); } @@ -3447,9 +3416,6 @@ decompress_texture_image(struct gl_context *ctx, } _mesa_TexParameteri(target, GL_TEXTURE_WRAP_S, wrapSSave); _mesa_TexParameteri(target, GL_TEXTURE_WRAP_T, wrapTSave); - if (ctx->Extensions.EXT_texture_sRGB_decode) { - _mesa_TexParameteri(target, GL_TEXTURE_SRGB_DECODE_EXT, srgbSave); - } } /* read pixels from renderbuffer */ diff --git a/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt b/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt index db3197f4645..8fa198d5cc7 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt +++ b/reactos/dll/opengl/mesa/src/mesa/main/CMakeLists.txt @@ -2,13 +2,10 @@ list(APPEND SOURCE api_arrayelt.c api_exec.c - # api_exec_es1.c - # api_exec_es2.c api_loopback.c api_validate.c accum.c arbprogram.c - # atifragshader.c attrib.c arrayobj.c blend.c @@ -54,7 +51,6 @@ list(APPEND SOURCE mipmap.c mm.c multisample.c - # nvprogram.c pack.c pbo.c pixel.c @@ -68,7 +64,6 @@ list(APPEND SOURCE readpix.c remap.c renderbuffer.c - samplerobj.c scissor.c shaderapi.c shaderobj.c diff --git a/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c b/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c index 605af381d7a..46c731091ea 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/api_exec.c @@ -76,9 +76,6 @@ #include "polygon.h" #include "queryobj.h" #include "readpix.h" -#if FEATURE_ARB_sampler_objects -#include "samplerobj.h" -#endif #include "scissor.h" #include "stencil.h" #include "texenv.h" @@ -747,10 +744,6 @@ _mesa_create_exec_table(void) SET_TextureStorage2DEXT(exec, _mesa_TextureStorage2DEXT); SET_TextureStorage3DEXT(exec, _mesa_TextureStorage3DEXT); -#if FEATURE_ARB_sampler_objects - _mesa_init_sampler_object_dispatch(exec); -#endif - return exec; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/attrib.c b/reactos/dll/opengl/mesa/src/mesa/main/attrib.c index ca816026e16..c9d1e45a1f6 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/attrib.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/attrib.c @@ -795,18 +795,6 @@ pop_texture_group(struct gl_context *ctx, struct texture_state *texstate) _mesa_TexParameterf(target, GL_TEXTURE_MAX_ANISOTROPY_EXT, samp->MaxAnisotropy); } - if (ctx->Extensions.ARB_shadow_ambient) { - _mesa_TexParameterf(target, GL_TEXTURE_COMPARE_FAIL_VALUE_ARB, - samp->CompareFailValue); - } - if (ctx->Extensions.ARB_shadow) { - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_MODE, - samp->CompareMode); - _mesa_TexParameteri(target, GL_TEXTURE_COMPARE_FUNC, - samp->CompareFunc); - } - if (ctx->Extensions.ARB_depth_texture) - _mesa_TexParameteri(target, GL_DEPTH_TEXTURE_MODE, samp->DepthMode); } /* remove saved references to the texture objects */ diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dd.h b/reactos/dll/opengl/mesa/src/mesa/main/dd.h index 10ef9b2d2ae..407cadb7bd4 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dd.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/dd.h @@ -929,14 +929,6 @@ struct dd_function_table { * \name GL_NV_texture_barrier interface */ void (*TextureBarrier)(struct gl_context *ctx); - - /** - * \name GL_ARB_sampler_objects - */ - struct gl_sampler_object * (*NewSamplerObject)(struct gl_context *ctx, - GLuint name); - void (*DeleteSamplerObject)(struct gl_context *ctx, - struct gl_sampler_object *samp); }; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h b/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h index ca19fcee49d..df1068144a2 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h @@ -669,20 +669,6 @@ #define _gloffset_BlendEquationiARB 598 #define _gloffset_BlendFuncSeparateiARB 599 #define _gloffset_BlendFunciARB 600 -#define _gloffset_BindSampler 601 -#define _gloffset_DeleteSamplers 602 -#define _gloffset_GenSamplers 603 -#define _gloffset_GetSamplerParameterIiv 604 -#define _gloffset_GetSamplerParameterIuiv 605 -#define _gloffset_GetSamplerParameterfv 606 -#define _gloffset_GetSamplerParameteriv 607 -#define _gloffset_IsSampler 608 -#define _gloffset_SamplerParameterIiv 609 -#define _gloffset_SamplerParameterIuiv 610 -#define _gloffset_SamplerParameterf 611 -#define _gloffset_SamplerParameterfv 612 -#define _gloffset_SamplerParameteri 613 -#define _gloffset_SamplerParameteriv 614 #define _gloffset_BindTransformFeedback 653 #define _gloffset_DeleteTransformFeedbacks 654 #define _gloffset_DrawTransformFeedback 655 @@ -999,8 +985,6 @@ #define _gloffset_StencilFuncSeparateATI 966 #define _gloffset_ProgramEnvParameters4fvEXT 967 #define _gloffset_ProgramLocalParameters4fvEXT 968 -#define _gloffset_GetQueryObjecti64vEXT 969 -#define _gloffset_GetQueryObjectui64vEXT 970 #define _gloffset_EGLImageTargetRenderbufferStorageOES 971 #define _gloffset_EGLImageTargetTexture2DOES 972 @@ -1202,20 +1186,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define BlendEquationiARB_remap_index 190 #define BlendFuncSeparateiARB_remap_index 191 #define BlendFunciARB_remap_index 192 -#define BindSampler_remap_index 193 -#define DeleteSamplers_remap_index 194 -#define GenSamplers_remap_index 195 -#define GetSamplerParameterIiv_remap_index 196 -#define GetSamplerParameterIuiv_remap_index 197 -#define GetSamplerParameterfv_remap_index 198 -#define GetSamplerParameteriv_remap_index 199 -#define IsSampler_remap_index 200 -#define SamplerParameterIiv_remap_index 201 -#define SamplerParameterIuiv_remap_index 202 -#define SamplerParameterf_remap_index 203 -#define SamplerParameterfv_remap_index 204 -#define SamplerParameteri_remap_index 205 -#define SamplerParameteriv_remap_index 206 #define BindTransformFeedback_remap_index 245 #define DeleteTransformFeedbacks_remap_index 246 #define DrawTransformFeedback_remap_index 247 @@ -1532,8 +1502,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define StencilFuncSeparateATI_remap_index 558 #define ProgramEnvParameters4fvEXT_remap_index 559 #define ProgramLocalParameters4fvEXT_remap_index 560 -#define GetQueryObjecti64vEXT_remap_index 561 -#define GetQueryObjectui64vEXT_remap_index 562 #define EGLImageTargetRenderbufferStorageOES_remap_index 563 #define EGLImageTargetTexture2DOES_remap_index 564 @@ -1730,20 +1698,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index] #define _gloffset_BlendFuncSeparateiARB driDispatchRemapTable[BlendFuncSeparateiARB_remap_index] #define _gloffset_BlendFunciARB driDispatchRemapTable[BlendFunciARB_remap_index] -#define _gloffset_BindSampler driDispatchRemapTable[BindSampler_remap_index] -#define _gloffset_DeleteSamplers driDispatchRemapTable[DeleteSamplers_remap_index] -#define _gloffset_GenSamplers driDispatchRemapTable[GenSamplers_remap_index] -#define _gloffset_GetSamplerParameterIiv driDispatchRemapTable[GetSamplerParameterIiv_remap_index] -#define _gloffset_GetSamplerParameterIuiv driDispatchRemapTable[GetSamplerParameterIuiv_remap_index] -#define _gloffset_GetSamplerParameterfv driDispatchRemapTable[GetSamplerParameterfv_remap_index] -#define _gloffset_GetSamplerParameteriv driDispatchRemapTable[GetSamplerParameteriv_remap_index] -#define _gloffset_IsSampler driDispatchRemapTable[IsSampler_remap_index] -#define _gloffset_SamplerParameterIiv driDispatchRemapTable[SamplerParameterIiv_remap_index] -#define _gloffset_SamplerParameterIuiv driDispatchRemapTable[SamplerParameterIuiv_remap_index] -#define _gloffset_SamplerParameterf driDispatchRemapTable[SamplerParameterf_remap_index] -#define _gloffset_SamplerParameterfv driDispatchRemapTable[SamplerParameterfv_remap_index] -#define _gloffset_SamplerParameteri driDispatchRemapTable[SamplerParameteri_remap_index] -#define _gloffset_SamplerParameteriv driDispatchRemapTable[SamplerParameteriv_remap_index] #define _gloffset_BindTransformFeedback driDispatchRemapTable[BindTransformFeedback_remap_index] #define _gloffset_DeleteTransformFeedbacks driDispatchRemapTable[DeleteTransformFeedbacks_remap_index] #define _gloffset_DrawTransformFeedback driDispatchRemapTable[DrawTransformFeedback_remap_index] @@ -2060,8 +2014,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index] #define _gloffset_ProgramEnvParameters4fvEXT driDispatchRemapTable[ProgramEnvParameters4fvEXT_remap_index] #define _gloffset_ProgramLocalParameters4fvEXT driDispatchRemapTable[ProgramLocalParameters4fvEXT_remap_index] -#define _gloffset_GetQueryObjecti64vEXT driDispatchRemapTable[GetQueryObjecti64vEXT_remap_index] -#define _gloffset_GetQueryObjectui64vEXT driDispatchRemapTable[GetQueryObjectui64vEXT_remap_index] #define _gloffset_EGLImageTargetRenderbufferStorageOES driDispatchRemapTable[EGLImageTargetRenderbufferStorageOES_remap_index] #define _gloffset_EGLImageTargetTexture2DOES driDispatchRemapTable[EGLImageTargetTexture2DOES_remap_index] @@ -8678,160 +8630,6 @@ static inline void SET_BlendFunciARB(struct _glapi_table *disp, void (GLAPIENTRY SET_by_offset(disp, _gloffset_BlendFunciARB, fn); } -typedef void (GLAPIENTRYP _glptr_BindSampler)(GLuint, GLuint); -#define CALL_BindSampler(disp, parameters) \ - (* GET_BindSampler(disp)) parameters -static inline _glptr_BindSampler GET_BindSampler(struct _glapi_table *disp) { - return (_glptr_BindSampler) (GET_by_offset(disp, _gloffset_BindSampler)); -} - -static inline void SET_BindSampler(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLuint)) { - SET_by_offset(disp, _gloffset_BindSampler, fn); -} - -typedef void (GLAPIENTRYP _glptr_DeleteSamplers)(GLsizei, const GLuint *); -#define CALL_DeleteSamplers(disp, parameters) \ - (* GET_DeleteSamplers(disp)) parameters -static inline _glptr_DeleteSamplers GET_DeleteSamplers(struct _glapi_table *disp) { - return (_glptr_DeleteSamplers) (GET_by_offset(disp, _gloffset_DeleteSamplers)); -} - -static inline void SET_DeleteSamplers(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, const GLuint *)) { - SET_by_offset(disp, _gloffset_DeleteSamplers, fn); -} - -typedef void (GLAPIENTRYP _glptr_GenSamplers)(GLsizei, GLuint *); -#define CALL_GenSamplers(disp, parameters) \ - (* GET_GenSamplers(disp)) parameters -static inline _glptr_GenSamplers GET_GenSamplers(struct _glapi_table *disp) { - return (_glptr_GenSamplers) (GET_by_offset(disp, _gloffset_GenSamplers)); -} - -static inline void SET_GenSamplers(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, GLuint *)) { - SET_by_offset(disp, _gloffset_GenSamplers, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetSamplerParameterIiv)(GLuint, GLenum, GLint *); -#define CALL_GetSamplerParameterIiv(disp, parameters) \ - (* GET_GetSamplerParameterIiv(disp)) parameters -static inline _glptr_GetSamplerParameterIiv GET_GetSamplerParameterIiv(struct _glapi_table *disp) { - return (_glptr_GetSamplerParameterIiv) (GET_by_offset(disp, _gloffset_GetSamplerParameterIiv)); -} - -static inline void SET_GetSamplerParameterIiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetSamplerParameterIiv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetSamplerParameterIuiv)(GLuint, GLenum, GLuint *); -#define CALL_GetSamplerParameterIuiv(disp, parameters) \ - (* GET_GetSamplerParameterIuiv(disp)) parameters -static inline _glptr_GetSamplerParameterIuiv GET_GetSamplerParameterIuiv(struct _glapi_table *disp) { - return (_glptr_GetSamplerParameterIuiv) (GET_by_offset(disp, _gloffset_GetSamplerParameterIuiv)); -} - -static inline void SET_GetSamplerParameterIuiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLuint *)) { - SET_by_offset(disp, _gloffset_GetSamplerParameterIuiv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetSamplerParameterfv)(GLuint, GLenum, GLfloat *); -#define CALL_GetSamplerParameterfv(disp, parameters) \ - (* GET_GetSamplerParameterfv(disp)) parameters -static inline _glptr_GetSamplerParameterfv GET_GetSamplerParameterfv(struct _glapi_table *disp) { - return (_glptr_GetSamplerParameterfv) (GET_by_offset(disp, _gloffset_GetSamplerParameterfv)); -} - -static inline void SET_GetSamplerParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetSamplerParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetSamplerParameteriv)(GLuint, GLenum, GLint *); -#define CALL_GetSamplerParameteriv(disp, parameters) \ - (* GET_GetSamplerParameteriv(disp)) parameters -static inline _glptr_GetSamplerParameteriv GET_GetSamplerParameteriv(struct _glapi_table *disp) { - return (_glptr_GetSamplerParameteriv) (GET_by_offset(disp, _gloffset_GetSamplerParameteriv)); -} - -static inline void SET_GetSamplerParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint *)) { - SET_by_offset(disp, _gloffset_GetSamplerParameteriv, fn); -} - -typedef GLboolean (GLAPIENTRYP _glptr_IsSampler)(GLuint); -#define CALL_IsSampler(disp, parameters) \ - (* GET_IsSampler(disp)) parameters -static inline _glptr_IsSampler GET_IsSampler(struct _glapi_table *disp) { - return (_glptr_IsSampler) (GET_by_offset(disp, _gloffset_IsSampler)); -} - -static inline void SET_IsSampler(struct _glapi_table *disp, GLboolean (GLAPIENTRYP fn)(GLuint)) { - SET_by_offset(disp, _gloffset_IsSampler, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameterIiv)(GLuint, GLenum, const GLint *); -#define CALL_SamplerParameterIiv(disp, parameters) \ - (* GET_SamplerParameterIiv(disp)) parameters -static inline _glptr_SamplerParameterIiv GET_SamplerParameterIiv(struct _glapi_table *disp) { - return (_glptr_SamplerParameterIiv) (GET_by_offset(disp, _gloffset_SamplerParameterIiv)); -} - -static inline void SET_SamplerParameterIiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLint *)) { - SET_by_offset(disp, _gloffset_SamplerParameterIiv, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameterIuiv)(GLuint, GLenum, const GLuint *); -#define CALL_SamplerParameterIuiv(disp, parameters) \ - (* GET_SamplerParameterIuiv(disp)) parameters -static inline _glptr_SamplerParameterIuiv GET_SamplerParameterIuiv(struct _glapi_table *disp) { - return (_glptr_SamplerParameterIuiv) (GET_by_offset(disp, _gloffset_SamplerParameterIuiv)); -} - -static inline void SET_SamplerParameterIuiv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLuint *)) { - SET_by_offset(disp, _gloffset_SamplerParameterIuiv, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameterf)(GLuint, GLenum, GLfloat); -#define CALL_SamplerParameterf(disp, parameters) \ - (* GET_SamplerParameterf(disp)) parameters -static inline _glptr_SamplerParameterf GET_SamplerParameterf(struct _glapi_table *disp) { - return (_glptr_SamplerParameterf) (GET_by_offset(disp, _gloffset_SamplerParameterf)); -} - -static inline void SET_SamplerParameterf(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLfloat)) { - SET_by_offset(disp, _gloffset_SamplerParameterf, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameterfv)(GLuint, GLenum, const GLfloat *); -#define CALL_SamplerParameterfv(disp, parameters) \ - (* GET_SamplerParameterfv(disp)) parameters -static inline _glptr_SamplerParameterfv GET_SamplerParameterfv(struct _glapi_table *disp) { - return (_glptr_SamplerParameterfv) (GET_by_offset(disp, _gloffset_SamplerParameterfv)); -} - -static inline void SET_SamplerParameterfv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLfloat *)) { - SET_by_offset(disp, _gloffset_SamplerParameterfv, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameteri)(GLuint, GLenum, GLint); -#define CALL_SamplerParameteri(disp, parameters) \ - (* GET_SamplerParameteri(disp)) parameters -static inline _glptr_SamplerParameteri GET_SamplerParameteri(struct _glapi_table *disp) { - return (_glptr_SamplerParameteri) (GET_by_offset(disp, _gloffset_SamplerParameteri)); -} - -static inline void SET_SamplerParameteri(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint)) { - SET_by_offset(disp, _gloffset_SamplerParameteri, fn); -} - -typedef void (GLAPIENTRYP _glptr_SamplerParameteriv)(GLuint, GLenum, const GLint *); -#define CALL_SamplerParameteriv(disp, parameters) \ - (* GET_SamplerParameteriv(disp)) parameters -static inline _glptr_SamplerParameteriv GET_SamplerParameteriv(struct _glapi_table *disp) { - return (_glptr_SamplerParameteriv) (GET_by_offset(disp, _gloffset_SamplerParameteriv)); -} - -static inline void SET_SamplerParameteriv(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, const GLint *)) { - SET_by_offset(disp, _gloffset_SamplerParameteriv, fn); -} - typedef void (GLAPIENTRYP _glptr_BindTransformFeedback)(GLenum, GLuint); #define CALL_BindTransformFeedback(disp, parameters) \ (* GET_BindTransformFeedback(disp)) parameters @@ -12308,28 +12106,6 @@ static inline void SET_ProgramLocalParameters4fvEXT(struct _glapi_table *disp, v SET_by_offset(disp, _gloffset_ProgramLocalParameters4fvEXT, fn); } -typedef void (GLAPIENTRYP _glptr_GetQueryObjecti64vEXT)(GLuint, GLenum, GLint64EXT *); -#define CALL_GetQueryObjecti64vEXT(disp, parameters) \ - (* GET_GetQueryObjecti64vEXT(disp)) parameters -static inline _glptr_GetQueryObjecti64vEXT GET_GetQueryObjecti64vEXT(struct _glapi_table *disp) { - return (_glptr_GetQueryObjecti64vEXT) (GET_by_offset(disp, _gloffset_GetQueryObjecti64vEXT)); -} - -static inline void SET_GetQueryObjecti64vEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLint64EXT *)) { - SET_by_offset(disp, _gloffset_GetQueryObjecti64vEXT, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetQueryObjectui64vEXT)(GLuint, GLenum, GLuint64EXT *); -#define CALL_GetQueryObjectui64vEXT(disp, parameters) \ - (* GET_GetQueryObjectui64vEXT(disp)) parameters -static inline _glptr_GetQueryObjectui64vEXT GET_GetQueryObjectui64vEXT(struct _glapi_table *disp) { - return (_glptr_GetQueryObjectui64vEXT) (GET_by_offset(disp, _gloffset_GetQueryObjectui64vEXT)); -} - -static inline void SET_GetQueryObjectui64vEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLuint, GLenum, GLuint64EXT *)) { - SET_by_offset(disp, _gloffset_GetQueryObjectui64vEXT, fn); -} - typedef void (GLAPIENTRYP _glptr_EGLImageTargetRenderbufferStorageOES)(GLenum, GLvoid *); #define CALL_EGLImageTargetRenderbufferStorageOES(disp, parameters) \ (* GET_EGLImageTargetRenderbufferStorageOES(disp)) parameters diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dlist.c b/reactos/dll/opengl/mesa/src/mesa/main/dlist.c index c74e7dae4ff..45db66aebcd 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dlist.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/dlist.c @@ -58,7 +58,6 @@ #include "pack.h" #include "pbo.h" #include "queryobj.h" -#include "samplerobj.h" #include "shaderapi.h" #include "syncobj.h" #include "teximage.h" @@ -450,13 +449,6 @@ typedef enum /* GL_NV_texture_barrier */ OPCODE_TEXTURE_BARRIER_NV, - /* GL_ARB_sampler_object */ - OPCODE_BIND_SAMPLER, - OPCODE_SAMPLER_PARAMETERIV, - OPCODE_SAMPLER_PARAMETERFV, - OPCODE_SAMPLER_PARAMETERIIV, - OPCODE_SAMPLER_PARAMETERUIV, - /* GL_ARB_geometry_shader4 */ OPCODE_PROGRAM_PARAMETERI, OPCODE_FRAMEBUFFER_TEXTURE, @@ -7173,136 +7165,6 @@ save_TextureBarrierNV(void) } } - -/* GL_ARB_sampler_objects */ -static void GLAPIENTRY -save_BindSampler(GLuint unit, GLuint sampler) -{ - Node *n; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_BIND_SAMPLER, 2); - if (n) { - n[1].ui = unit; - n[2].ui = sampler; - } - if (ctx->ExecuteFlag) { - CALL_BindSampler(ctx->Exec, (unit, sampler)); - } -} - -static void GLAPIENTRY -save_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params) -{ - Node *n; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIV, 6); - if (n) { - n[1].ui = sampler; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - else { - n[4].i = n[5].i = n[6].i = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_SamplerParameteriv(ctx->Exec, (sampler, pname, params)); - } -} - -static void GLAPIENTRY -save_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) -{ - save_SamplerParameteriv(sampler, pname, ¶m); -} - -static void GLAPIENTRY -save_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params) -{ - Node *n; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERFV, 6); - if (n) { - n[1].ui = sampler; - n[2].e = pname; - n[3].f = params[0]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - n[4].f = params[1]; - n[5].f = params[2]; - n[6].f = params[3]; - } - else { - n[4].f = n[5].f = n[6].f = 0.0F; - } - } - if (ctx->ExecuteFlag) { - CALL_SamplerParameterfv(ctx->Exec, (sampler, pname, params)); - } -} - -static void GLAPIENTRY -save_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) -{ - save_SamplerParameterfv(sampler, pname, ¶m); -} - -static void GLAPIENTRY -save_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params) -{ - Node *n; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERIIV, 6); - if (n) { - n[1].ui = sampler; - n[2].e = pname; - n[3].i = params[0]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - n[4].i = params[1]; - n[5].i = params[2]; - n[6].i = params[3]; - } - else { - n[4].i = n[5].i = n[6].i = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_SamplerParameterIiv(ctx->Exec, (sampler, pname, params)); - } -} - -static void GLAPIENTRY -save_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params) -{ - Node *n; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_SAMPLER_PARAMETERUIV, 6); - if (n) { - n[1].ui = sampler; - n[2].e = pname; - n[3].ui = params[0]; - if (pname == GL_TEXTURE_BORDER_COLOR) { - n[4].ui = params[1]; - n[5].ui = params[2]; - n[6].ui = params[3]; - } - else { - n[4].ui = n[5].ui = n[6].ui = 0; - } - } - if (ctx->ExecuteFlag) { - CALL_SamplerParameterIuiv(ctx->Exec, (sampler, pname, params)); - } -} - /* GL_ARB_geometry_shader4 */ static void GLAPIENTRY save_ProgramParameteri(GLuint program, GLenum pname, GLint value) @@ -8610,51 +8472,6 @@ execute_list(struct gl_context *ctx, GLuint list) CALL_DrawTransformFeedback(ctx->Exec, (n[1].e, n[2].ui)); break; - - case OPCODE_BIND_SAMPLER: - CALL_BindSampler(ctx->Exec, (n[1].ui, n[2].ui)); - break; - case OPCODE_SAMPLER_PARAMETERIV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_SamplerParameteriv(ctx->Exec, (n[1].ui, n[2].e, params)); - } - break; - case OPCODE_SAMPLER_PARAMETERFV: - { - GLfloat params[4]; - params[0] = n[3].f; - params[1] = n[4].f; - params[2] = n[5].f; - params[3] = n[6].f; - CALL_SamplerParameterfv(ctx->Exec, (n[1].ui, n[2].e, params)); - } - break; - case OPCODE_SAMPLER_PARAMETERIIV: - { - GLint params[4]; - params[0] = n[3].i; - params[1] = n[4].i; - params[2] = n[5].i; - params[3] = n[6].i; - CALL_SamplerParameterIiv(ctx->Exec, (n[1].ui, n[2].e, params)); - } - break; - case OPCODE_SAMPLER_PARAMETERUIV: - { - GLuint params[4]; - params[0] = n[3].ui; - params[1] = n[4].ui; - params[2] = n[5].ui; - params[3] = n[6].ui; - CALL_SamplerParameterIuiv(ctx->Exec, (n[1].ui, n[2].e, params)); - } - break; - /* GL_ARB_geometry_shader4 */ case OPCODE_PROGRAM_PARAMETERI: CALL_ProgramParameteriARB(ctx->Exec, (n[1].ui, n[2].e, n[3].i)); @@ -10390,16 +10207,6 @@ _mesa_create_save_table(void) /* GL_NV_texture_barrier */ SET_TextureBarrierNV(table, save_TextureBarrierNV); - /* GL_ARB_sampler_objects */ - _mesa_init_sampler_object_dispatch(table); /* plug in Gen/Get/etc functions */ - SET_BindSampler(table, save_BindSampler); - SET_SamplerParameteri(table, save_SamplerParameteri); - SET_SamplerParameterf(table, save_SamplerParameterf); - SET_SamplerParameteriv(table, save_SamplerParameteriv); - SET_SamplerParameterfv(table, save_SamplerParameterfv); - SET_SamplerParameterIiv(table, save_SamplerParameterIiv); - SET_SamplerParameterIuiv(table, save_SamplerParameterIuiv); - /* GL_ARB_draw_buffer_blend */ SET_BlendFunciARB(table, save_BlendFunci); SET_BlendFuncSeparateiARB(table, save_BlendFuncSeparatei); diff --git a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c index 73c679b079e..82bf3469bae 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c @@ -84,7 +84,6 @@ static const struct extension extension_table[] = { { "GL_ARB_conservative_depth", o(ARB_conservative_depth), GL, 2011 }, { "GL_ARB_depth_buffer_float", o(ARB_depth_buffer_float), GL, 2008 }, { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 }, - { "GL_ARB_depth_texture", o(ARB_depth_texture), GL, 2001 }, { "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 }, { "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 }, { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 }, @@ -109,14 +108,11 @@ static const struct extension extension_table[] = { { "GL_ARB_point_sprite", o(ARB_point_sprite), GL, 2003 }, { "GL_ARB_provoking_vertex", o(EXT_provoking_vertex), GL, 2009 }, { "GL_ARB_robustness", o(dummy_true), GL, 2010 }, - { "GL_ARB_sampler_objects", o(ARB_sampler_objects), GL, 2009 }, { "GL_ARB_seamless_cube_map", o(ARB_seamless_cube_map), GL, 2009 }, { "GL_ARB_shader_objects", o(ARB_shader_objects), GL, 2002 }, { "GL_ARB_shader_stencil_export", o(ARB_shader_stencil_export), GL, 2009 }, { "GL_ARB_shader_texture_lod", o(ARB_shader_texture_lod), GL, 2009 }, { "GL_ARB_shading_language_100", o(ARB_shading_language_100), GL, 2003 }, - { "GL_ARB_shadow_ambient", o(ARB_shadow_ambient), GL, 2001 }, - { "GL_ARB_shadow", o(ARB_shadow), GL, 2001 }, { "GL_ARB_sync", o(ARB_sync), GL, 2003 }, { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), GL, 2000 }, { "GL_ARB_texture_buffer_object", o(ARB_texture_buffer_object), GL, 2008 }, @@ -132,7 +128,6 @@ static const struct extension extension_table[] = { { "GL_ARB_texture_multisample", o(ARB_texture_multisample), GL, 2009 }, { "GL_ARB_texture_non_power_of_two", o(ARB_texture_non_power_of_two), GL, 2003 }, { "GL_ARB_texture_rectangle", o(NV_texture_rectangle), GL, 2004 }, - { "GL_ARB_texture_rgb10_a2ui", o(ARB_texture_rgb10_a2ui), GL, 2009 }, { "GL_ARB_texture_rg", o(ARB_texture_rg), GL, 2008 }, { "GL_ARB_texture_storage", o(ARB_texture_storage), GL, 2011 }, { "GL_ARB_transform_feedback2", o(ARB_transform_feedback2), GL, 2010 }, @@ -202,9 +197,7 @@ static const struct extension extension_table[] = { { "GL_EXT_texture_rectangle", o(NV_texture_rectangle), 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 }, { "GL_EXT_texture_type_2_10_10_10_REV", o(dummy_true), ES2, 2008 }, - { "GL_EXT_timer_query", o(EXT_timer_query), GL, 2006 }, { "GL_EXT_transform_feedback", o(EXT_transform_feedback), GL, 2011 }, { "GL_EXT_vertex_array_bgra", o(EXT_vertex_array_bgra), GL, 2008 }, { "GL_EXT_vertex_array", o(dummy_true), GL, 1995 }, @@ -217,7 +210,6 @@ static const struct extension extension_table[] = { { "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 }, - { "GL_OES_depth_texture", o(ARB_depth_texture), ES2, 2006 }, #if FEATURE_OES_draw_texture { "GL_OES_draw_texture", o(OES_draw_texture), ES1 | ES2, 2004 }, #endif @@ -374,7 +366,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) { /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/ ctx->Extensions.ARB_depth_clamp = GL_TRUE; - ctx->Extensions.ARB_depth_texture = GL_TRUE; ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; ctx->Extensions.ARB_draw_instanced = GL_TRUE; ctx->Extensions.ARB_explicit_attrib_location = GL_TRUE; @@ -408,8 +399,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) #if FEATURE_ARB_shading_language_100 ctx->Extensions.ARB_shading_language_100 = GL_TRUE; #endif - ctx->Extensions.ARB_shadow = GL_TRUE; - ctx->Extensions.ARB_shadow_ambient = GL_TRUE; ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; @@ -474,7 +463,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; #if FEATURE_EXT_texture_sRGB ctx->Extensions.EXT_texture_sRGB = GL_TRUE; - ctx->Extensions.EXT_texture_sRGB_decode = GL_TRUE; #endif #if FEATURE_EXT_transform_feedback /*ctx->Extensions.EXT_transform_feedback = GL_TRUE;*/ @@ -540,8 +528,6 @@ _mesa_enable_1_3_extensions(struct gl_context *ctx) void _mesa_enable_1_4_extensions(struct gl_context *ctx) { - ctx->Extensions.ARB_depth_texture = GL_TRUE; - ctx->Extensions.ARB_shadow = GL_TRUE; ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; ctx->Extensions.ARB_window_pos = GL_TRUE; ctx->Extensions.EXT_blend_color = 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 18a934f7540..610269fe264 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/fbobject.c @@ -602,11 +602,6 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, if (baseFormat == GL_DEPTH_COMPONENT) { /* OK */ } - else if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } else { att->Complete = GL_FALSE; att_incomplete("bad depth format"); @@ -614,13 +609,7 @@ test_attachment_completeness(const struct gl_context *ctx, GLenum format, } } else { - ASSERT(format == GL_STENCIL); - if (ctx->Extensions.EXT_packed_depth_stencil && - ctx->Extensions.ARB_depth_texture && - baseFormat == GL_DEPTH_STENCIL_EXT) { - /* OK */ - } - else { + { /* no such thing as stencil-only textures */ att_incomplete("illegal stencil texture"); att->Complete = GL_FALSE; @@ -1293,8 +1282,6 @@ _mesa_base_fbo_format(struct gl_context *ctx, GLenum internalFormat) return ctx->Extensions.EXT_texture_integer && ctx->Extensions.ARB_framebuffer_object ? GL_LUMINANCE_ALPHA : 0; - case GL_RGB10_A2UI: - return ctx->Extensions.ARB_texture_rgb10_a2ui ? GL_RGBA : 0; default: return 0; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp b/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp index b53b7171da5..556c315a6a4 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp +++ b/reactos/dll/opengl/mesa/src/mesa/main/ff_fragment_shader.cpp @@ -110,7 +110,6 @@ struct state_key { struct { GLuint enabled:1; GLuint source_index:4; /**< TEXTURE_x_INDEX */ - GLuint shadow:1; GLuint ScaleShiftRGB:2; GLuint ScaleShiftA:2; @@ -440,11 +439,6 @@ static GLuint make_state_key( struct gl_context *ctx, struct state_key *key ) key->unit[i].source_index = translate_tex_src_bit(texUnit->_ReallyEnabled); - key->unit[i].shadow = - ((texObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE) && - ((format == GL_DEPTH_COMPONENT) || - (format == GL_DEPTH_STENCIL_EXT))); - key->unit[i].NumArgsRGB = comb->_NumArgsRGB; key->unit[i].NumArgsA = comb->_NumArgsA; @@ -1006,54 +1000,34 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit ) switch (texTarget) { case TEXTURE_1D_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler1DShadow"); - else sampler_type = p->shader->symbols->get_type("sampler1D"); coords = 1; break; case TEXTURE_1D_ARRAY_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler1DArrayShadow"); - else sampler_type = p->shader->symbols->get_type("sampler1DArray"); coords = 2; break; case TEXTURE_2D_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DShadow"); - else sampler_type = p->shader->symbols->get_type("sampler2D"); coords = 2; break; case TEXTURE_2D_ARRAY_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DArrayShadow"); - else sampler_type = p->shader->symbols->get_type("sampler2DArray"); coords = 3; break; case TEXTURE_RECT_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("sampler2DRectShadow"); - else sampler_type = p->shader->symbols->get_type("sampler2DRect"); coords = 2; break; case TEXTURE_3D_INDEX: - assert(!p->state->unit[unit].shadow); sampler_type = p->shader->symbols->get_type("sampler3D"); coords = 3; break; case TEXTURE_CUBE_INDEX: - if (p->state->unit[unit].shadow) - sampler_type = p->shader->symbols->get_type("samplerCubeShadow"); - else sampler_type = p->shader->symbols->get_type("samplerCube"); coords = 3; break; case TEXTURE_EXTERNAL_INDEX: - assert(!p->state->unit[unit].shadow); sampler_type = p->shader->symbols->get_type("samplerExternalOES"); coords = 2; break; @@ -1077,14 +1051,6 @@ static void load_texture( struct texenv_fragment_program *p, GLuint unit ) tex->coordinate = new(p->mem_ctx) ir_swizzle(texcoord, 0, 1, 2, 3, coords); - if (p->state->unit[unit].shadow) { - texcoord = texcoord->clone(p->mem_ctx, NULL); - tex->shadow_comparitor = new(p->mem_ctx) ir_swizzle(texcoord, - coords, 0, 0, 0, - 1); - coords++; - } - texcoord = texcoord->clone(p->mem_ctx, NULL); tex->projector = new(p->mem_ctx) ir_swizzle(texcoord, 3, 0, 0, 0, 1); 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 98b838defe4..c16bf59203c 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/format_unpack.c @@ -2507,20 +2507,6 @@ unpack_int_rgba_INTENSITY_INT8(const GLbyte *src, GLuint dst[][4], GLuint n) } } -static void -unpack_int_rgba_ARGB2101010_UINT(const GLuint *src, GLuint dst[][4], GLuint n) -{ - unsigned int i; - - for (i = 0; i < n; i++) { - GLuint tmp = src[i]; - dst[i][0] = (tmp >> 20) & 0x3ff; - dst[i][1] = (tmp >> 10) & 0x3ff; - dst[i][2] = (tmp >> 0) & 0x3ff; - dst[i][3] = (tmp >> 30) & 0x3; - } -} - void _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, const void *src, GLuint dst[][4]) @@ -2680,9 +2666,6 @@ _mesa_unpack_uint_rgba_row(gl_format format, GLuint n, unpack_int_rgba_INTENSITY_INT8(src, dst, n); break; - case MESA_FORMAT_ARGB2101010_UINT: - unpack_int_rgba_ARGB2101010_UINT(src, dst, n); - break; default: _mesa_problem(NULL, "%s: bad format %s", __FUNCTION__, _mesa_get_format_name(format)); diff --git a/reactos/dll/opengl/mesa/src/mesa/main/formats.c b/reactos/dll/opengl/mesa/src/mesa/main/formats.c index c839be998d8..34366bcd377 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/formats.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/formats.c @@ -1481,16 +1481,7 @@ static struct gl_format_info format_info[MESA_FORMAT_COUNT] = 0, 0, 0, 0, /* Red/Green/Blue/AlphaBits */ 0, 0, 0, 32, 8, /* Lum/Int/Index/Depth/StencilBits */ 1, 1, 8 /* BlockWidth/Height,Bytes */ - }, - { - MESA_FORMAT_ARGB2101010_UINT, - "MESA_FORMAT_ARGB2101010_UINT", - GL_RGBA, - GL_UNSIGNED_INT, - 10, 10, 10, 2, - 0, 0, 0, 0, 0, - 1, 1, 4 - }, + } }; @@ -2451,11 +2442,6 @@ _mesa_format_to_type_and_comps(gl_format format, *comps = 4; return; - case MESA_FORMAT_ARGB2101010_UINT: - *datatype = GL_UNSIGNED_INT_2_10_10_10_REV; - *comps = 4; - return; - case MESA_FORMAT_COUNT: assert(0); return; @@ -2778,9 +2764,6 @@ _mesa_format_matches_format_and_type(gl_format gl_format, /* FINISHME: SNORM */ return GL_FALSE; - case MESA_FORMAT_ARGB2101010_UINT: - return GL_FALSE; - 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 a29372204df..514de58fd14 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/formats.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/formats.h @@ -270,8 +270,6 @@ typedef enum MESA_FORMAT_Z32_FLOAT, MESA_FORMAT_Z32_FLOAT_X24S8, - MESA_FORMAT_ARGB2101010_UINT, - MESA_FORMAT_COUNT } gl_format; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/get.c b/reactos/dll/opengl/mesa/src/mesa/main/get.c index 5ad601242f4..847867d3497 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/get.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/get.c @@ -283,11 +283,6 @@ static const int extra_GLSL_130[] = { EXTRA_END }; -static const int extra_ARB_sampler_objects[] = { - EXT(ARB_sampler_objects), - EXTRA_END -}; - EXTRA_EXT(ARB_ES2_compatibility); EXTRA_EXT(ARB_texture_cube_map); @@ -1267,10 +1262,6 @@ static const struct value_desc values[] = { { GL_TEXTURE_BUFFER_ARB, LOC_CUSTOM, TYPE_INT, 0, extra_ARB_texture_buffer_object }, - /* GL_ARB_sampler_objects / GL 3.3 */ - { GL_SAMPLER_BINDING, - LOC_CUSTOM, TYPE_INT, GL_SAMPLER_BINDING, extra_ARB_sampler_objects }, - /* GL 3.0 */ { GL_NUM_EXTENSIONS, LOC_CUSTOM, TYPE_INT, 0, extra_version_30 }, { GL_MAJOR_VERSION, CONTEXT_INT(VersionMajor), extra_version_30 }, @@ -1738,15 +1729,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = ctx->Texture.Unit[ctx->Texture.CurrentUnit] .CurrentTex[TEXTURE_BUFFER_INDEX]->BufferObjectFormat; break; - - /* GL_ARB_sampler_objects */ - case GL_SAMPLER_BINDING: - { - struct gl_sampler_object *samp = - ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler; - v->value_int = samp ? samp->Name : 0; - } - break; } } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/image.c b/reactos/dll/opengl/mesa/src/mesa/main/image.c index 63ae8cda9d9..40352f35d4a 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/image.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/image.c @@ -385,10 +385,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, if (format == GL_RGB) { break; /* OK */ } - if (format == GL_RGB_INTEGER_EXT && - ctx->Extensions.ARB_texture_rgb10_a2ui) { - break; /* OK */ - } return GL_INVALID_OPERATION; case GL_UNSIGNED_SHORT_4_4_4_4: @@ -404,10 +400,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, format == GL_ABGR_EXT) { break; /* OK */ } - if ((format == GL_RGBA_INTEGER_EXT || format == GL_BGRA_INTEGER_EXT) && - ctx->Extensions.ARB_texture_rgb10_a2ui) { - break; /* OK */ - } return GL_INVALID_OPERATION; case GL_UNSIGNED_INT_24_8: @@ -633,12 +625,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; - case GL_UNSIGNED_BYTE_3_3_2: - case GL_UNSIGNED_BYTE_2_3_3_REV: - case GL_UNSIGNED_SHORT_5_6_5: - case GL_UNSIGNED_SHORT_5_6_5_REV: - return ctx->Extensions.ARB_texture_rgb10_a2ui - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } @@ -671,16 +657,6 @@ _mesa_error_check_format_and_type(const struct gl_context *ctx, return (ctx->VersionMajor >= 3 || ctx->Extensions.EXT_texture_integer) ? GL_NO_ERROR : GL_INVALID_ENUM; - case GL_UNSIGNED_SHORT_4_4_4_4: - case GL_UNSIGNED_SHORT_4_4_4_4_REV: - case GL_UNSIGNED_SHORT_5_5_5_1: - case GL_UNSIGNED_SHORT_1_5_5_5_REV: - case GL_UNSIGNED_INT_8_8_8_8: - case GL_UNSIGNED_INT_8_8_8_8_REV: - case GL_UNSIGNED_INT_10_10_10_2: - case GL_UNSIGNED_INT_2_10_10_10_REV: - return ctx->Extensions.ARB_texture_rgb10_a2ui - ? GL_NO_ERROR : GL_INVALID_ENUM; default: return GL_INVALID_ENUM; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h index 52d0582d604..7ca935e4c07 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h @@ -1306,7 +1306,6 @@ typedef enum MAX_FACES = 6 } gl_face_index; - /** * Sampler object state. These objects are new with GL_ARB_sampler_objects * and OpenGL 3.3. Legacy texture objects also contain a sampler object. @@ -1326,14 +1325,8 @@ struct gl_sampler_object GLfloat MaxLod; /**< max lambda, OpenGL 1.2 */ GLfloat LodBias; /**< OpenGL 1.4 */ GLfloat MaxAnisotropy; /**< GL_EXT_texture_filter_anisotropic */ - GLenum CompareMode; /**< GL_ARB_shadow */ - GLenum CompareFunc; /**< GL_ARB_shadow */ - GLfloat CompareFailValue; /**< GL_ARB_shadow_ambient */ - GLenum sRGBDecode; /**< GL_DECODE_EXT or GL_SKIP_DECODE_EXT */ GLboolean CubeMapSeamless; /**< GL_AMD_seamless_cubemap_per_texture */ - /* deprecated sampler state */ - GLenum DepthMode; /**< GL_ARB_depth_texture */ }; @@ -1434,9 +1427,6 @@ struct gl_texture_unit GLenum BumpTarget; GLfloat RotMatrix[4]; /* 2x2 matrix */ - /** Current sampler object (GL_ARB_sampler_objects) */ - struct gl_sampler_object *Sampler; - /** * \name GL_EXT_texture_env_combine */ @@ -2144,7 +2134,6 @@ struct gl_query_state { struct _mesa_HashTable *QueryObjects; struct gl_query_object *CurrentOcclusionObject; /* GL_ARB_occlusion_query */ - struct gl_query_object *CurrentTimerObject; /* GL_EXT_timer_query */ /** GL_NV_conditional_render */ struct gl_query_object *CondRenderQuery; @@ -2521,9 +2510,6 @@ struct gl_shared_state /* GL_ARB_sync */ struct simple_node SyncObjects; - /** GL_ARB_sampler_objects */ - struct _mesa_HashTable *SamplerObjects; - void *DriverData; /**< Device driver shared state */ }; @@ -2860,7 +2846,6 @@ struct gl_extensions GLboolean ARB_copy_buffer; GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; - GLboolean ARB_depth_texture; GLboolean ARB_draw_buffers_blend; GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_draw_instanced; @@ -2878,14 +2863,11 @@ struct gl_extensions GLboolean ARB_occlusion_query; GLboolean ARB_occlusion_query2; GLboolean ARB_point_sprite; - GLboolean ARB_sampler_objects; GLboolean ARB_seamless_cube_map; GLboolean ARB_shader_objects; GLboolean ARB_shader_stencil_export; GLboolean ARB_shader_texture_lod; GLboolean ARB_shading_language_100; - GLboolean ARB_shadow; - GLboolean ARB_shadow_ambient; GLboolean ARB_sync; GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_buffer_object; @@ -2898,9 +2880,7 @@ struct gl_extensions GLboolean ARB_texture_multisample; GLboolean ARB_texture_non_power_of_two; GLboolean ARB_texture_rg; - GLboolean ARB_texture_rgb10_a2ui; - GLboolean ARB_texture_storage; - GLboolean ARB_timer_query; + GLboolean ARB_texture_storage;; GLboolean ARB_transform_feedback2; GLboolean ARB_transpose_matrix; GLboolean ARB_uniform_buffer_object; @@ -2945,7 +2925,6 @@ struct gl_extensions GLboolean EXT_texture_mirror_clamp; GLboolean EXT_texture_snorm; GLboolean EXT_texture_sRGB; - GLboolean EXT_texture_sRGB_decode; GLboolean EXT_transform_feedback; GLboolean EXT_timer_query; GLboolean EXT_vertex_array_bgra; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c b/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c index f0a9a7922b2..e1e1016d73e 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/queryobj.c @@ -150,11 +150,6 @@ get_query_binding_point(struct gl_context *ctx, GLenum target) return &ctx->Query.CurrentOcclusionObject; else return NULL; - case GL_TIME_ELAPSED_EXT: - if (ctx->Extensions.EXT_timer_query) - return &ctx->Query.CurrentTimerObject; - else - return NULL; #if FEATURE_EXT_transform_feedback case GL_PRIMITIVES_GENERATED: if (ctx->Extensions.EXT_transform_feedback) @@ -189,8 +184,7 @@ _mesa_GenQueriesARB(GLsizei n, GLuint *ids) } /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { + if (ctx->Query.CurrentOcclusionObject) { _mesa_error(ctx, GL_INVALID_OPERATION, "glGenQueriesARB"); return; } @@ -229,8 +223,7 @@ _mesa_DeleteQueriesARB(GLsizei n, const GLuint *ids) } /* No query objects can be active at this time! */ - if (ctx->Query.CurrentOcclusionObject || - ctx->Query.CurrentTimerObject) { + if (ctx->Query.CurrentOcclusionObject) { _mesa_error(ctx, GL_INVALID_OPERATION, "glDeleteQueriesARB"); return; } @@ -488,88 +481,6 @@ _mesa_GetQueryObjectuivARB(GLuint id, GLenum pname, GLuint *params) } -/** - * New with GL_EXT_timer_query - */ -static void GLAPIENTRY -_mesa_GetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetQueryObjecti64v(%u, %s)\n", id, - _mesa_lookup_enum_by_nr(pname)); - - if (id) - q = _mesa_lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjecti64vARB(pname)"); - return; - } -} - - -/** - * New with GL_EXT_timer_query - */ -static void GLAPIENTRY -_mesa_GetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64EXT *params) -{ - struct gl_query_object *q = NULL; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetQueryObjectui64v(%u, %s)\n", id, - _mesa_lookup_enum_by_nr(pname)); - - if (id) - q = _mesa_lookup_query_object(ctx, id); - - if (!q || q->Active) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetQueryObjectuui64vARB(id=%d is invalid or active)", id); - return; - } - - switch (pname) { - case GL_QUERY_RESULT_ARB: - if (!q->Ready) - ctx->Driver.WaitQuery(ctx, q); - *params = q->Result; - break; - case GL_QUERY_RESULT_AVAILABLE_ARB: - if (!q->Ready) - ctx->Driver.CheckQuery( ctx, q ); - *params = q->Ready; - break; - default: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetQueryObjectui64vARB(pname)"); - return; - } -} - - void _mesa_init_queryobj_dispatch(struct _glapi_table *disp) { @@ -581,9 +492,6 @@ _mesa_init_queryobj_dispatch(struct _glapi_table *disp) SET_GetQueryivARB(disp, _mesa_GetQueryivARB); SET_GetQueryObjectivARB(disp, _mesa_GetQueryObjectivARB); SET_GetQueryObjectuivARB(disp, _mesa_GetQueryObjectuivARB); - - SET_GetQueryObjecti64vEXT(disp, _mesa_GetQueryObjecti64vEXT); - SET_GetQueryObjectui64vEXT(disp, _mesa_GetQueryObjectui64vEXT); } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.c b/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.c deleted file mode 100644 index 7cf0654ada2..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.c +++ /dev/null @@ -1,1412 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2011 VMware, Inc. All Rights Reserved. - * - * 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 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 - * BRIAN PAUL 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 samplerobj.c - * \brief Functions for the GL_ARB_sampler_objects extension. - * \author Brian Paul - */ - - -#include "main/glheader.h" -#include "main/context.h" -#include "main/dispatch.h" -#include "main/enums.h" -#include "main/hash.h" -#include "main/macros.h" -#include "main/mfeatures.h" -#include "main/mtypes.h" -#include "main/samplerobj.h" - - -static struct gl_sampler_object * -_mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name) -{ - if (name == 0) - return NULL; - else - return (struct gl_sampler_object *) - _mesa_HashLookup(ctx->Shared->SamplerObjects, name); -} - - -/** - * Handle reference counting. - */ -void -_mesa_reference_sampler_object(struct gl_context *ctx, - struct gl_sampler_object **ptr, - struct gl_sampler_object *samp) -{ - if (*ptr == samp) - return; - - if (*ptr) { - /* Unreference the old sampler */ - GLboolean deleteFlag = GL_FALSE; - struct gl_sampler_object *oldSamp = *ptr; - - /*_glthread_LOCK_MUTEX(oldSamp->Mutex);*/ - ASSERT(oldSamp->RefCount > 0); - oldSamp->RefCount--; -#if 0 - printf("SamplerObj %p %d DECR to %d\n", - (void *) oldSamp, oldSamp->Name, oldSamp->RefCount); -#endif - deleteFlag = (oldSamp->RefCount == 0); - /*_glthread_UNLOCK_MUTEX(oldSamp->Mutex);*/ - - if (deleteFlag) { - ASSERT(ctx->Driver.DeleteSamplerObject); - ctx->Driver.DeleteSamplerObject(ctx, oldSamp); - } - - *ptr = NULL; - } - ASSERT(!*ptr); - - if (samp) { - /* reference new sampler */ - /*_glthread_LOCK_MUTEX(samp->Mutex);*/ - if (samp->RefCount == 0) { - /* this sampler's being deleted (look just above) */ - /* Not sure this can every really happen. Warn if it does. */ - _mesa_problem(NULL, "referencing deleted sampler object"); - *ptr = NULL; - } - else { - samp->RefCount++; -#if 0 - printf("SamplerObj %p %d INCR to %d\n", - (void *) samp, samp->Name, samp->RefCount); -#endif - *ptr = samp; - } - /*_glthread_UNLOCK_MUTEX(samp->Mutex);*/ - } -} - - -/** - * Initialize the fields of the given sampler object. - */ -void -_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name) -{ - sampObj->Name = name; - sampObj->RefCount = 1; - sampObj->WrapS = GL_REPEAT; - sampObj->WrapT = GL_REPEAT; - sampObj->WrapR = GL_REPEAT; - sampObj->MinFilter = GL_NEAREST_MIPMAP_LINEAR; - sampObj->MagFilter = GL_LINEAR; - sampObj->BorderColor.f[0] = 0.0; - sampObj->BorderColor.f[1] = 0.0; - sampObj->BorderColor.f[2] = 0.0; - sampObj->BorderColor.f[3] = 0.0; - sampObj->MinLod = -1000.0F; - sampObj->MaxLod = 1000.0F; - sampObj->LodBias = 0.0F; - sampObj->MaxAnisotropy = 1.0F; - sampObj->CompareMode = GL_NONE; - sampObj->CompareFunc = GL_LEQUAL; - sampObj->CompareFailValue = 0.0; - sampObj->sRGBDecode = GL_DECODE_EXT; - sampObj->CubeMapSeamless = GL_FALSE; - sampObj->DepthMode = 0; -} - - -/** - * Fallback for ctx->Driver.NewSamplerObject(); - */ -struct gl_sampler_object * -_mesa_new_sampler_object(struct gl_context *ctx, GLuint name) -{ - struct gl_sampler_object *sampObj = CALLOC_STRUCT(gl_sampler_object); - if (sampObj) { - _mesa_init_sampler_object(sampObj, name); - } - return sampObj; -} - - -/** - * Fallback for ctx->Driver.DeleteSamplerObject(); - */ -void -_mesa_delete_sampler_object(struct gl_context *ctx, - struct gl_sampler_object *sampObj) -{ - FREE(sampObj); -} - - -static void GLAPIENTRY -_mesa_GenSamplers(GLsizei count, GLuint *samplers) -{ - GET_CURRENT_CONTEXT(ctx); - GLuint first; - GLint i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGenSamplers(%d)\n", count); - - if (count < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGenSamplers"); - return; - } - - if (!samplers) - return; - - first = _mesa_HashFindFreeKeyBlock(ctx->Shared->SamplerObjects, count); - - /* Insert the ID and pointer to new sampler object into hash table */ - for (i = 0; i < count; i++) { - struct gl_sampler_object *sampObj = - ctx->Driver.NewSamplerObject(ctx, first + i); - _mesa_HashInsert(ctx->Shared->SamplerObjects, first + i, sampObj); - samplers[i] = first + i; - } -} - - -static void GLAPIENTRY -_mesa_DeleteSamplers(GLsizei count, const GLuint *samplers) -{ - GET_CURRENT_CONTEXT(ctx); - GLsizei i; - - ASSERT_OUTSIDE_BEGIN_END(ctx); - FLUSH_VERTICES(ctx, 0); - - if (count < 0) { - _mesa_error(ctx, GL_INVALID_VALUE, "glDeleteSamplers(count)"); - return; - } - - _glthread_LOCK_MUTEX(ctx->Shared->Mutex); - - for (i = 0; i < count; i++) { - if (samplers[i]) { - struct gl_sampler_object *sampObj = - _mesa_lookup_samplerobj(ctx, samplers[i]); - if (sampObj) { - /* The ID is immediately freed for re-use */ - _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]); - /* But the object exists until its reference count goes to zero */ - _mesa_reference_sampler_object(ctx, &sampObj, NULL); - } - } - } - - _glthread_UNLOCK_MUTEX(ctx->Shared->Mutex); -} - - -static GLboolean GLAPIENTRY -_mesa_IsSampler(GLuint sampler) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); - - if (sampler == 0) - return GL_FALSE; - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - - return sampObj != NULL; -} - - -static void GLAPIENTRY -_mesa_BindSampler(GLuint unit, GLuint sampler) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - if (unit >= ctx->Const.MaxCombinedTextureImageUnits) { - _mesa_error(ctx, GL_INVALID_VALUE, "glBindSampler(unit %u)", unit); - return; - } - - if (sampler == 0) { - /* Use the default sampler object, the one contained in the texture - * object. - */ - sampObj = NULL; - } - else { - /* user-defined sampler object */ - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glBindSampler(sampler)"); - return; - } - } - - if (ctx->Texture.Unit[unit].Sampler != sampObj) { - FLUSH_VERTICES(ctx, _NEW_TEXTURE); - } - - /* bind new sampler */ - _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[unit].Sampler, - sampObj); -} - - -/** - * Check if a coordinate wrap mode is legal. - * \return GL_TRUE if legal, GL_FALSE otherwise - */ -static GLboolean -validate_texture_wrap_mode(struct gl_context *ctx, GLenum wrap) -{ - const struct gl_extensions * const e = &ctx->Extensions; - - switch (wrap) { - case GL_CLAMP: - case GL_CLAMP_TO_EDGE: - case GL_REPEAT: - case GL_MIRRORED_REPEAT: - return GL_TRUE; - case GL_CLAMP_TO_BORDER: - return e->ARB_texture_border_clamp; - case GL_MIRROR_CLAMP_EXT: - return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp; - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - return e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - return e->EXT_texture_mirror_clamp; - default: - return GL_FALSE; - } -} - - -/** - * This is called just prior to changing any sampler object state. - */ -static inline void -flush(struct gl_context *ctx) -{ - FLUSH_VERTICES(ctx, _NEW_TEXTURE); -} - - -#define INVALID_PARAM 0x100 -#define INVALID_PNAME 0x101 -#define INVALID_VALUE 0x102 - -static GLuint -set_sampler_wrap_s(struct gl_context *ctx, struct gl_sampler_object *samp, - GLint param) -{ - if (samp->WrapS == param) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, param)) { - flush(ctx); - samp->WrapS = param; - return GL_TRUE; - } - return INVALID_PARAM; -} - - -static GLuint -set_sampler_wrap_t(struct gl_context *ctx, struct gl_sampler_object *samp, - GLint param) -{ - if (samp->WrapT == param) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, param)) { - flush(ctx); - samp->WrapT = param; - return GL_TRUE; - } - return INVALID_PARAM; -} - - -static GLuint -set_sampler_wrap_r(struct gl_context *ctx, struct gl_sampler_object *samp, - GLint param) -{ - if (samp->WrapR == param) - return GL_FALSE; - if (validate_texture_wrap_mode(ctx, param)) { - flush(ctx); - samp->WrapR = param; - return GL_TRUE; - } - return INVALID_PARAM; -} - - -static GLuint -set_sampler_min_filter(struct gl_context *ctx, struct gl_sampler_object *samp, - GLint param) -{ - if (samp->MinFilter == param) - return GL_FALSE; - - switch (param) { - case GL_NEAREST: - case GL_LINEAR: - case GL_NEAREST_MIPMAP_NEAREST: - case GL_LINEAR_MIPMAP_NEAREST: - case GL_NEAREST_MIPMAP_LINEAR: - case GL_LINEAR_MIPMAP_LINEAR: - flush(ctx); - samp->MinFilter = param; - return GL_TRUE; - default: - return INVALID_PARAM; - } -} - - -static GLuint -set_sampler_mag_filter(struct gl_context *ctx, struct gl_sampler_object *samp, - GLint param) -{ - if (samp->MagFilter == param) - return GL_FALSE; - - switch (param) { - case GL_NEAREST: - case GL_LINEAR: - flush(ctx); - samp->MagFilter = param; - return GL_TRUE; - default: - return INVALID_PARAM; - } -} - - -static GLuint -set_sampler_lod_bias(struct gl_context *ctx, struct gl_sampler_object *samp, - GLfloat param) -{ - if (samp->LodBias == param) - return GL_FALSE; - - flush(ctx); - samp->LodBias = param; - return GL_TRUE; -} - - -static GLuint -set_sampler_border_colorf(struct gl_context *ctx, - struct gl_sampler_object *samp, - const GLfloat params[4]) -{ - flush(ctx); - samp->BorderColor.f[RCOMP] = params[0]; - samp->BorderColor.f[GCOMP] = params[1]; - samp->BorderColor.f[BCOMP] = params[2]; - samp->BorderColor.f[ACOMP] = params[3]; - return GL_TRUE; -} - - -static GLuint -set_sampler_border_colori(struct gl_context *ctx, - struct gl_sampler_object *samp, - const GLint params[4]) -{ - flush(ctx); - samp->BorderColor.i[RCOMP] = params[0]; - samp->BorderColor.i[GCOMP] = params[1]; - samp->BorderColor.i[BCOMP] = params[2]; - samp->BorderColor.i[ACOMP] = params[3]; - return GL_TRUE; -} - - -static GLuint -set_sampler_border_colorui(struct gl_context *ctx, - struct gl_sampler_object *samp, - const GLuint params[4]) -{ - flush(ctx); - samp->BorderColor.ui[RCOMP] = params[0]; - samp->BorderColor.ui[GCOMP] = params[1]; - samp->BorderColor.ui[BCOMP] = params[2]; - samp->BorderColor.ui[ACOMP] = params[3]; - return GL_TRUE; -} - - -static GLuint -set_sampler_min_lod(struct gl_context *ctx, struct gl_sampler_object *samp, - GLfloat param) -{ - if (samp->MinLod == param) - return GL_FALSE; - - flush(ctx); - samp->MinLod = param; - return GL_TRUE; -} - - -static GLuint -set_sampler_max_lod(struct gl_context *ctx, struct gl_sampler_object *samp, - GLfloat param) -{ - if (samp->MaxLod == param) - return GL_FALSE; - - flush(ctx); - samp->MaxLod = param; - return GL_TRUE; -} - - -static GLuint -set_sampler_compare_mode(struct gl_context *ctx, - struct gl_sampler_object *samp, GLint param) -{ - if (!ctx->Extensions.ARB_shadow) - return INVALID_PNAME; - - if (samp->CompareMode == param) - return GL_FALSE; - - if (param == GL_NONE || - param == GL_COMPARE_R_TO_TEXTURE_ARB) { - flush(ctx); - samp->CompareMode = param; - return GL_TRUE; - } - - return INVALID_PARAM; -} - - -static GLuint -set_sampler_compare_func(struct gl_context *ctx, - struct gl_sampler_object *samp, GLint param) -{ - if (!ctx->Extensions.ARB_shadow) - return INVALID_PNAME; - - if (samp->CompareFunc == param) - return GL_FALSE; - - switch (param) { - case GL_LEQUAL: - case GL_GEQUAL: - flush(ctx); - samp->CompareFunc = param; - return GL_TRUE; - case GL_EQUAL: - case GL_NOTEQUAL: - case GL_LESS: - case GL_GREATER: - case GL_ALWAYS: - case GL_NEVER: - if (ctx->Extensions.EXT_shadow_funcs) { - flush(ctx); - samp->CompareFunc = param; - return GL_TRUE; - } - /* fall-through */ - default: - return INVALID_PARAM; - } -} - - -static GLuint -set_sampler_max_anisotropy(struct gl_context *ctx, - struct gl_sampler_object *samp, GLfloat param) -{ - if (!ctx->Extensions.EXT_texture_filter_anisotropic) - return INVALID_PNAME; - - if (samp->MaxAnisotropy == param) - return GL_FALSE; - - if (param < 1.0) - return INVALID_VALUE; - - flush(ctx); - /* clamp to max, that's what NVIDIA does */ - samp->MaxAnisotropy = MIN2(param, ctx->Const.MaxTextureMaxAnisotropy); - return GL_TRUE; -} - - -static GLuint -set_sampler_cube_map_seamless(struct gl_context *ctx, - struct gl_sampler_object *samp, GLboolean param) -{ - if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) - return INVALID_PNAME; - - if (samp->CubeMapSeamless == param) - return GL_FALSE; - - if (param != GL_TRUE && param != GL_FALSE) - return INVALID_VALUE; - - flush(ctx); - samp->CubeMapSeamless = param; - return GL_TRUE; -} - - -static void GLAPIENTRY -_mesa_SamplerParameteri(GLuint sampler, GLenum pname, GLint param) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, param); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, param); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, param); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, param); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, param); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, (GLfloat) param); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, (GLfloat) param); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) param); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, param); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, param); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) param); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, param); - break; - case GL_TEXTURE_BORDER_COLOR: - /* fall-through */ - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteri(param=%d)\n", - param); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteri(param=%d)\n", - param); - break; - default: - ; - } -} - - -static void GLAPIENTRY -_mesa_SamplerParameterf(GLuint sampler, GLenum pname, GLfloat param) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, param); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, param); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, param); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, (GLint) param); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, param); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) param); - break; - case GL_TEXTURE_BORDER_COLOR: - /* fall-through */ - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterf(param=%f)\n", - param); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterf(param=%f)\n", - param); - break; - default: - ; - } -} - -static void GLAPIENTRY -_mesa_SamplerParameteriv(GLuint sampler, GLenum pname, const GLint *params) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_BORDER_COLOR: - { - GLfloat c[4]; - c[0] = INT_TO_FLOAT(params[0]); - c[1] = INT_TO_FLOAT(params[1]); - c[2] = INT_TO_FLOAT(params[2]); - c[3] = INT_TO_FLOAT(params[3]); - res = set_sampler_border_colorf(ctx, sampObj, c); - } - break; - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameteriv(param=%d)\n", - params[0]); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameteriv(param=%d)\n", - params[0]); - break; - default: - ; - } -} - -static void GLAPIENTRY -_mesa_SamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat *params) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - ASSERT_OUTSIDE_BEGIN_END(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, (GLint) params[0]); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, (GLboolean) params[0]); - break; - case GL_TEXTURE_BORDER_COLOR: - res = set_sampler_border_colorf(ctx, sampObj, params); - break; - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterfv(param=%f)\n", - params[0]); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterfv(param=%f)\n", - params[0]); - break; - default: - ; - } -} - -static void GLAPIENTRY -_mesa_SamplerParameterIiv(GLuint sampler, GLenum pname, const GLint *params) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_BORDER_COLOR: - res = set_sampler_border_colori(ctx, sampObj, params); - break; - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIiv(param=%d)\n", - params[0]); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIiv(param=%d)\n", - params[0]); - break; - default: - ; - } -} - - -static void GLAPIENTRY -_mesa_SamplerParameterIuiv(GLuint sampler, GLenum pname, const GLuint *params) -{ - struct gl_sampler_object *sampObj; - GLuint res; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - res = set_sampler_wrap_s(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_T: - res = set_sampler_wrap_t(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_WRAP_R: - res = set_sampler_wrap_r(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_FILTER: - res = set_sampler_min_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAG_FILTER: - res = set_sampler_mag_filter(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MIN_LOD: - res = set_sampler_min_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_MAX_LOD: - res = set_sampler_max_lod(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_LOD_BIAS: - res = set_sampler_lod_bias(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_COMPARE_MODE: - res = set_sampler_compare_mode(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_COMPARE_FUNC: - res = set_sampler_compare_func(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - res = set_sampler_max_anisotropy(ctx, sampObj, (GLfloat) params[0]); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - res = set_sampler_cube_map_seamless(ctx, sampObj, params[0]); - break; - case GL_TEXTURE_BORDER_COLOR: - res = set_sampler_border_colorui(ctx, sampObj, params); - break; - default: - res = INVALID_PNAME; - } - - switch (res) { - case GL_FALSE: - /* no change */ - break; - case GL_TRUE: - /* state change - we do nothing special at this time */ - break; - case INVALID_PNAME: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(pname=%s)\n", - _mesa_lookup_enum_by_nr(pname)); - break; - case INVALID_PARAM: - _mesa_error(ctx, GL_INVALID_ENUM, "glSamplerParameterIuiv(param=%u)\n", - params[0]); - break; - case INVALID_VALUE: - _mesa_error(ctx, GL_INVALID_VALUE, "glSamplerParameterIuiv(param=%u)\n", - params[0]); - break; - default: - ; - } -} - - -static void GLAPIENTRY -_mesa_GetSamplerParameteriv(GLuint sampler, GLenum pname, GLint *params) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameteriv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - *params = sampObj->WrapS; - break; - case GL_TEXTURE_WRAP_T: - *params = sampObj->WrapT; - break; - case GL_TEXTURE_WRAP_R: - *params = sampObj->WrapR; - break; - case GL_TEXTURE_MIN_FILTER: - *params = sampObj->MinFilter; - break; - case GL_TEXTURE_MAG_FILTER: - *params = sampObj->MagFilter; - break; - case GL_TEXTURE_MIN_LOD: - *params = (GLint) sampObj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = (GLint) sampObj->MaxLod; - break; - case GL_TEXTURE_LOD_BIAS: - *params = (GLint) sampObj->LodBias; - break; - case GL_TEXTURE_COMPARE_MODE: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareFunc; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - *params = (GLint) sampObj->MaxAnisotropy; - break; - case GL_TEXTURE_BORDER_COLOR: - params[0] = FLOAT_TO_INT(sampObj->BorderColor.f[0]); - params[1] = FLOAT_TO_INT(sampObj->BorderColor.f[1]); - params[2] = FLOAT_TO_INT(sampObj->BorderColor.f[2]); - params[3] = FLOAT_TO_INT(sampObj->BorderColor.f[3]); - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) - goto invalid_pname; - *params = sampObj->CubeMapSeamless; - break; - default: - goto invalid_pname; - } - return; - -invalid_pname: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameteriv(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); -} - - -static void GLAPIENTRY -_mesa_GetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat *params) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, "glGetSamplerParameterfv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - *params = (GLfloat) sampObj->WrapS; - break; - case GL_TEXTURE_WRAP_T: - *params = (GLfloat) sampObj->WrapT; - break; - case GL_TEXTURE_WRAP_R: - *params = (GLfloat) sampObj->WrapR; - break; - case GL_TEXTURE_MIN_FILTER: - *params = (GLfloat) sampObj->MinFilter; - break; - case GL_TEXTURE_MAG_FILTER: - *params = (GLfloat) sampObj->MagFilter; - break; - case GL_TEXTURE_MIN_LOD: - *params = sampObj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = sampObj->MaxLod; - break; - case GL_TEXTURE_LOD_BIAS: - *params = sampObj->LodBias; - break; - case GL_TEXTURE_COMPARE_MODE: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLfloat) sampObj->CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLfloat) sampObj->CompareFunc; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - *params = sampObj->MaxAnisotropy; - break; - case GL_TEXTURE_BORDER_COLOR: - params[0] = sampObj->BorderColor.f[0]; - params[1] = sampObj->BorderColor.f[1]; - params[2] = sampObj->BorderColor.f[2]; - params[3] = sampObj->BorderColor.f[3]; - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) - goto invalid_pname; - *params = (GLfloat) sampObj->CubeMapSeamless; - break; - default: - goto invalid_pname; - } - return; - -invalid_pname: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterfv(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); -} - - -static void GLAPIENTRY -_mesa_GetSamplerParameterIiv(GLuint sampler, GLenum pname, GLint *params) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetSamplerParameterIiv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - *params = sampObj->WrapS; - break; - case GL_TEXTURE_WRAP_T: - *params = sampObj->WrapT; - break; - case GL_TEXTURE_WRAP_R: - *params = sampObj->WrapR; - break; - case GL_TEXTURE_MIN_FILTER: - *params = sampObj->MinFilter; - break; - case GL_TEXTURE_MAG_FILTER: - *params = sampObj->MagFilter; - break; - case GL_TEXTURE_MIN_LOD: - *params = (GLint) sampObj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = (GLint) sampObj->MaxLod; - break; - case GL_TEXTURE_LOD_BIAS: - *params = (GLint) sampObj->LodBias; - break; - case GL_TEXTURE_COMPARE_MODE: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareFunc; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - *params = (GLint) sampObj->MaxAnisotropy; - break; - case GL_TEXTURE_BORDER_COLOR: - params[0] = sampObj->BorderColor.i[0]; - params[1] = sampObj->BorderColor.i[1]; - params[2] = sampObj->BorderColor.i[2]; - params[3] = sampObj->BorderColor.i[3]; - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) - goto invalid_pname; - *params = sampObj->CubeMapSeamless; - break; - default: - goto invalid_pname; - } - return; - -invalid_pname: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIiv(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); -} - - -static void GLAPIENTRY -_mesa_GetSamplerParameterIuiv(GLuint sampler, GLenum pname, GLuint *params) -{ - struct gl_sampler_object *sampObj; - GET_CURRENT_CONTEXT(ctx); - - sampObj = _mesa_lookup_samplerobj(ctx, sampler); - if (!sampObj) { - _mesa_error(ctx, GL_INVALID_VALUE, - "glGetSamplerParameterIuiv(sampler %u)", - sampler); - return; - } - - switch (pname) { - case GL_TEXTURE_WRAP_S: - *params = sampObj->WrapS; - break; - case GL_TEXTURE_WRAP_T: - *params = sampObj->WrapT; - break; - case GL_TEXTURE_WRAP_R: - *params = sampObj->WrapR; - break; - case GL_TEXTURE_MIN_FILTER: - *params = sampObj->MinFilter; - break; - case GL_TEXTURE_MAG_FILTER: - *params = sampObj->MagFilter; - break; - case GL_TEXTURE_MIN_LOD: - *params = (GLuint) sampObj->MinLod; - break; - case GL_TEXTURE_MAX_LOD: - *params = (GLuint) sampObj->MaxLod; - break; - case GL_TEXTURE_LOD_BIAS: - *params = (GLuint) sampObj->LodBias; - break; - case GL_TEXTURE_COMPARE_MODE: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = sampObj->CompareFunc; - break; - case GL_TEXTURE_MAX_ANISOTROPY_EXT: - *params = (GLuint) sampObj->MaxAnisotropy; - break; - case GL_TEXTURE_BORDER_COLOR: - params[0] = sampObj->BorderColor.ui[0]; - params[1] = sampObj->BorderColor.ui[1]; - params[2] = sampObj->BorderColor.ui[2]; - params[3] = sampObj->BorderColor.ui[3]; - break; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: - if (!ctx->Extensions.AMD_seamless_cubemap_per_texture) - goto invalid_pname; - *params = sampObj->CubeMapSeamless; - break; - default: - goto invalid_pname; - } - return; - -invalid_pname: - _mesa_error(ctx, GL_INVALID_ENUM, "glGetSamplerParameterIuiv(pname=%s)", - _mesa_lookup_enum_by_nr(pname)); -} - - -void -_mesa_init_sampler_object_functions(struct dd_function_table *driver) -{ - driver->NewSamplerObject = _mesa_new_sampler_object; - driver->DeleteSamplerObject = _mesa_delete_sampler_object; -} - - -void -_mesa_init_sampler_object_dispatch(struct _glapi_table *disp) -{ - SET_GenSamplers(disp, _mesa_GenSamplers); - SET_DeleteSamplers(disp, _mesa_DeleteSamplers); - SET_IsSampler(disp, _mesa_IsSampler); - SET_BindSampler(disp, _mesa_BindSampler); - SET_SamplerParameteri(disp, _mesa_SamplerParameteri); - SET_SamplerParameterf(disp, _mesa_SamplerParameterf); - SET_SamplerParameteriv(disp, _mesa_SamplerParameteriv); - SET_SamplerParameterfv(disp, _mesa_SamplerParameterfv); - SET_SamplerParameterIiv(disp, _mesa_SamplerParameterIiv); - SET_SamplerParameterIuiv(disp, _mesa_SamplerParameterIuiv); - SET_GetSamplerParameteriv(disp, _mesa_GetSamplerParameteriv); - SET_GetSamplerParameterfv(disp, _mesa_GetSamplerParameterfv); - SET_GetSamplerParameterIiv(disp, _mesa_GetSamplerParameterIiv); - SET_GetSamplerParameterIuiv(disp, _mesa_GetSamplerParameterIuiv); -} diff --git a/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.h b/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.h deleted file mode 100644 index fe7d5a7d3b6..00000000000 --- a/reactos/dll/opengl/mesa/src/mesa/main/samplerobj.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2011 VMware, Inc. All Rights Reserved. - * - * 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 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 - * BRIAN PAUL 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 SAMPLEROBJ_H -#define SAMPLEROBJ_H - -struct dd_function_table; - -static inline struct gl_sampler_object * -_mesa_get_samplerobj(struct gl_context *ctx, GLuint unit) -{ - if (ctx->Texture.Unit[unit].Sampler) - return ctx->Texture.Unit[unit].Sampler; - else - return &ctx->Texture.Unit[unit]._Current->Sampler; -} - -extern void -_mesa_reference_sampler_object(struct gl_context *ctx, - struct gl_sampler_object **ptr, - struct gl_sampler_object *samp); - -extern void -_mesa_init_sampler_object(struct gl_sampler_object *sampObj, GLuint name); - -extern struct gl_sampler_object * -_mesa_new_sampler_object(struct gl_context *ctx, GLuint name); - -extern void -_mesa_delete_sampler_object(struct gl_context *ctx, - struct gl_sampler_object *sampObj); - -extern void -_mesa_init_sampler_object_functions(struct dd_function_table *driver); - -extern void -_mesa_init_sampler_object_dispatch(struct _glapi_table *disp); - - -#endif /* SAMPLEROBJ_H */ diff --git a/reactos/dll/opengl/mesa/src/mesa/main/shared.c b/reactos/dll/opengl/mesa/src/mesa/main/shared.c index c07ce823846..deefc3455e5 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/shared.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/shared.c @@ -38,9 +38,6 @@ #include "shared.h" #include "program/program.h" #include "dlist.h" -#if FEATURE_ARB_sampler_objects -#include "samplerobj.h" -#endif #include "shaderobj.h" #include "syncobj.h" @@ -91,11 +88,6 @@ _mesa_alloc_shared_state(struct gl_context *ctx) shared->BufferObjects = _mesa_NewHashTable(); -#if FEATURE_ARB_sampler_objects - /* GL_ARB_sampler_objects */ - shared->SamplerObjects = _mesa_NewHashTable(); -#endif - /* Allocate the default buffer object */ shared->NullBufferObj = ctx->Driver.NewBufferObject(ctx, 0, 0); @@ -276,20 +268,6 @@ delete_renderbuffer_cb(GLuint id, void *data, void *userData) } -#if FEATURE_ARB_sampler_objects -/** - * Callback for deleting a sampler object. Called by _mesa_HashDeleteAll() - */ -static void -delete_sampler_object_cb(GLuint id, void *data, void *userData) -{ - struct gl_context *ctx = (struct gl_context *) userData; - struct gl_sampler_object *sampObj = (struct gl_sampler_object *) data; - _mesa_reference_sampler_object(ctx, &sampObj, NULL); -} -#endif - - /** * Deallocate a shared state object and all children structures. * @@ -361,11 +339,6 @@ free_shared_state(struct gl_context *ctx, struct gl_shared_state *shared) } } -#if FEATURE_ARB_sampler_objects - _mesa_HashDeleteAll(shared->SamplerObjects, delete_sampler_object_cb, ctx); - _mesa_DeleteHashTable(shared->SamplerObjects); -#endif - /* * Free texture objects (after FBOs since some textures might have * been bound to FBOs). diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texformat.c b/reactos/dll/opengl/mesa/src/mesa/main/texformat.c index 38c4a9cb423..4944d60474d 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texformat.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texformat.c @@ -204,24 +204,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, ; /* fallthrough */ } - if (ctx->Extensions.ARB_depth_texture) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z32); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); - break; - case GL_DEPTH_COMPONENT16: - RETURN_IF_SUPPORTED(MESA_FORMAT_Z16); - RETURN_IF_SUPPORTED(MESA_FORMAT_X8_Z24); - RETURN_IF_SUPPORTED(MESA_FORMAT_S8_Z24); - default: - ; /* fallthrough */ - } - } - switch (internalFormat) { case GL_COMPRESSED_ALPHA_ARB: RETURN_IF_SUPPORTED(MESA_FORMAT_A8); @@ -853,15 +835,6 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat, } } - if (ctx->Extensions.ARB_texture_rgb10_a2ui) { - switch (internalFormat) { - case GL_RGB10_A2UI: - RETURN_IF_SUPPORTED(MESA_FORMAT_ARGB2101010_UINT); - break; - default: - break; - } - } /* GL_BGRA can be an internal format *only* in OpenGL ES (1.x or 2.0). */ if (ctx->API != API_OPENGL) { diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c b/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c index 411a92402a3..b18c9bbd9bd 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texgetimage.c @@ -715,7 +715,7 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, return GL_TRUE; } - if (!ctx->Extensions.ARB_depth_texture && _mesa_is_depth_format(format)) { + if (_mesa_is_depth_format(format)) { _mesa_error(ctx, GL_INVALID_ENUM, "glGetTexImage(format)"); return GL_TRUE; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/teximage.c b/reactos/dll/opengl/mesa/src/mesa/main/teximage.c index d2db7501e19..5e2480cc094 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/teximage.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/teximage.c @@ -139,18 +139,6 @@ _mesa_base_tex_format( struct gl_context *ctx, GLint internalFormat ) } } - if (ctx->Extensions.ARB_depth_texture) { - switch (internalFormat) { - case GL_DEPTH_COMPONENT: - case GL_DEPTH_COMPONENT16: - case GL_DEPTH_COMPONENT24: - case GL_DEPTH_COMPONENT32: - return GL_DEPTH_COMPONENT; - default: - ; /* fallthrough */ - } - } - switch (internalFormat) { case GL_COMPRESSED_ALPHA: return GL_ALPHA; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texobj.c b/reactos/dll/opengl/mesa/src/mesa/main/texobj.c index 1f64e1ec082..be101e12620 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texobj.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texobj.c @@ -142,12 +142,7 @@ _mesa_initialize_texture_object( struct gl_texture_object *obj, obj->Sampler.MaxLod = 1000.0; obj->Sampler.LodBias = 0.0; obj->Sampler.MaxAnisotropy = 1.0; - obj->Sampler.CompareMode = GL_NONE; /* ARB_shadow */ - obj->Sampler.CompareFunc = GL_LEQUAL; /* ARB_shadow */ - obj->Sampler.CompareFailValue = 0.0F; /* ARB_shadow_ambient */ - obj->Sampler.DepthMode = GL_LUMINANCE; /* ARB_depth_texture */ obj->Sampler.CubeMapSeamless = GL_FALSE; - obj->Sampler.sRGBDecode = GL_DECODE_EXT; } @@ -248,12 +243,7 @@ _mesa_copy_texture_object( struct gl_texture_object *dest, dest->BaseLevel = src->BaseLevel; dest->MaxLevel = src->MaxLevel; dest->Sampler.MaxAnisotropy = src->Sampler.MaxAnisotropy; - dest->Sampler.CompareMode = src->Sampler.CompareMode; - dest->Sampler.CompareFunc = src->Sampler.CompareFunc; - dest->Sampler.CompareFailValue = src->Sampler.CompareFailValue; dest->Sampler.CubeMapSeamless = src->Sampler.CubeMapSeamless; - dest->Sampler.DepthMode = src->Sampler.DepthMode; - dest->Sampler.sRGBDecode = src->Sampler.sRGBDecode; dest->_MaxLevel = src->_MaxLevel; dest->_MaxLambda = src->_MaxLambda; dest->GenerateMipmap = src->GenerateMipmap; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texparam.c b/reactos/dll/opengl/mesa/src/mesa/main/texparam.c index 3284af1dcdd..f9a7faf5dae 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texparam.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texparam.c @@ -300,64 +300,6 @@ set_tex_parameteri(struct gl_context *ctx, } return GL_FALSE; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (ctx->Extensions.ARB_shadow) { - if (texObj->Sampler.CompareMode == params[0]) - return GL_FALSE; - if (params[0] == GL_NONE || - params[0] == GL_COMPARE_R_TO_TEXTURE_ARB) { - flush(ctx); - texObj->Sampler.CompareMode = params[0]; - return GL_TRUE; - } - goto invalid_param; - } - goto invalid_pname; - - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (ctx->Extensions.ARB_shadow) { - if (texObj->Sampler.CompareFunc == params[0]) - return GL_FALSE; - switch (params[0]) { - case GL_LEQUAL: - case GL_GEQUAL: - flush(ctx); - texObj->Sampler.CompareFunc = params[0]; - return GL_TRUE; - case GL_EQUAL: - case GL_NOTEQUAL: - case GL_LESS: - case GL_GREATER: - case GL_ALWAYS: - case GL_NEVER: - if (ctx->Extensions.EXT_shadow_funcs) { - flush(ctx); - texObj->Sampler.CompareFunc = params[0]; - return GL_TRUE; - } - /* fall-through */ - default: - goto invalid_param; - } - } - goto invalid_pname; - - case GL_DEPTH_TEXTURE_MODE_ARB: - if (ctx->Extensions.ARB_depth_texture) { - if (texObj->Sampler.DepthMode == params[0]) - return GL_FALSE; - if (params[0] == GL_LUMINANCE || - params[0] == GL_INTENSITY || - params[0] == GL_ALPHA || - (ctx->Extensions.ARB_texture_rg && params[0] == GL_RED)) { - flush(ctx); - texObj->Sampler.DepthMode = params[0]; - return GL_TRUE; - } - goto invalid_param; - } - goto invalid_pname; - #if FEATURE_OES_draw_texture case GL_TEXTURE_CROP_RECT_OES: texObj->CropRect[0] = params[0]; @@ -367,19 +309,6 @@ set_tex_parameteri(struct gl_context *ctx, return GL_TRUE; #endif - case GL_TEXTURE_SRGB_DECODE_EXT: - if (ctx->Extensions.EXT_texture_sRGB_decode) { - GLenum decode = params[0]; - if (decode == GL_DECODE_EXT || decode == GL_SKIP_DECODE_EXT) { - if (texObj->Sampler.sRGBDecode != decode) { - flush(ctx); - texObj->Sampler.sRGBDecode = decode; - } - return GL_TRUE; - } - } - goto invalid_pname; - case GL_TEXTURE_CUBE_MAP_SEAMLESS: if (ctx->Extensions.AMD_seamless_cubemap_per_texture) { GLenum param = params[0]; @@ -461,20 +390,6 @@ set_tex_parameterf(struct gl_context *ctx, } return GL_FALSE; - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: - if (ctx->Extensions.ARB_shadow_ambient) { - if (texObj->Sampler.CompareFailValue != params[0]) { - flush(ctx); - texObj->Sampler.CompareFailValue = CLAMP(params[0], 0.0F, 1.0F); - return GL_TRUE; - } - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, - "glTexParameter(pname=GL_TEXTURE_COMPARE_FAIL_VALUE_ARB)"); - } - return GL_FALSE; - case GL_TEXTURE_LOD_BIAS: /* NOTE: this is really part of OpenGL 1.4, not EXT_texture_lod_bias */ if (texObj->Sampler.LodBias != params[0]) { @@ -531,7 +446,6 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: case GL_DEPTH_TEXTURE_MODE_ARB: - case GL_TEXTURE_SRGB_DECODE_EXT: case GL_TEXTURE_CUBE_MAP_SEAMLESS: { /* convert float param to int */ @@ -592,7 +506,6 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_TEXTURE_COMPARE_MODE_ARB: case GL_TEXTURE_COMPARE_FUNC_ARB: case GL_DEPTH_TEXTURE_MODE_ARB: - case GL_TEXTURE_SRGB_DECODE_EXT: case GL_TEXTURE_CUBE_MAP_SEAMLESS: { /* convert float param to int */ @@ -924,11 +837,6 @@ _mesa_GetTexLevelParameteriv( GLenum target, GLint level, *params = 0; } break; - case GL_TEXTURE_DEPTH_SIZE_ARB: - if (!ctx->Extensions.ARB_depth_texture) - goto invalid_pname; - *params = _mesa_get_format_bits(texFormat, pname); - break; case GL_TEXTURE_STENCIL_SIZE_EXT: if (!ctx->Extensions.EXT_packed_depth_stencil && !ctx->Extensions.ARB_framebuffer_object) @@ -1050,29 +958,9 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) goto invalid_pname; *params = obj->Sampler.MaxAnisotropy; break; - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: - if (!ctx->Extensions.ARB_shadow_ambient) - goto invalid_pname; - *params = obj->Sampler.CompareFailValue; - break; case GL_GENERATE_MIPMAP_SGIS: *params = (GLfloat) obj->GenerateMipmap; break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLfloat) obj->Sampler.CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLfloat) obj->Sampler.CompareFunc; - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (!ctx->Extensions.ARB_depth_texture) - goto invalid_pname; - *params = (GLfloat) obj->Sampler.DepthMode; - break; case GL_TEXTURE_LOD_BIAS: *params = obj->Sampler.LodBias; break; @@ -1175,29 +1063,9 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) goto invalid_pname; *params = (GLint) obj->Sampler.MaxAnisotropy; break; - case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: - if (!ctx->Extensions.ARB_shadow_ambient) - goto invalid_pname; - *params = (GLint) FLOAT_TO_INT(obj->Sampler.CompareFailValue); - break; case GL_GENERATE_MIPMAP_SGIS: *params = (GLint) obj->GenerateMipmap; break; - case GL_TEXTURE_COMPARE_MODE_ARB: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLint) obj->Sampler.CompareMode; - break; - case GL_TEXTURE_COMPARE_FUNC_ARB: - if (!ctx->Extensions.ARB_shadow) - goto invalid_pname; - *params = (GLint) obj->Sampler.CompareFunc; - break; - case GL_DEPTH_TEXTURE_MODE_ARB: - if (!ctx->Extensions.ARB_depth_texture) - goto invalid_pname; - *params = (GLint) obj->Sampler.DepthMode; - break; case GL_TEXTURE_LOD_BIAS: *params = (GLint) obj->Sampler.LodBias; break; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texstate.c b/reactos/dll/opengl/mesa/src/mesa/main/texstate.c index cc49916a92c..63451ca81f2 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texstate.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texstate.c @@ -402,9 +402,6 @@ update_tex_combine(struct gl_context *ctx, struct gl_texture_unit *texUnit) const struct gl_texture_object *texObj = texUnit->_Current; GLenum format = texObj->Image[0][texObj->BaseLevel]->_BaseFormat; - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - format = texObj->Sampler.DepthMode; - } calculate_derived_texenv(&texUnit->_EnvMode, texUnit->EnvMode, format); texUnit->_CurrentCombine = & texUnit->_EnvMode; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/texstore.c b/reactos/dll/opengl/mesa/src/mesa/main/texstore.c index 08cbcee136a..416b32f7fc8 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/texstore.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/texstore.c @@ -4012,61 +4012,6 @@ _mesa_texstore_z32f_x24s8(TEXSTORE_PARAMS) return GL_TRUE; } -static GLboolean -_mesa_texstore_argb2101010_uint(TEXSTORE_PARAMS) -{ - const GLenum baseFormat = _mesa_get_format_base_format(dstFormat); - - ASSERT(dstFormat == MESA_FORMAT_ARGB2101010_UINT); - ASSERT(_mesa_get_format_bytes(dstFormat) == 4); - - if (!srcPacking->SwapBytes && - dstFormat == MESA_FORMAT_ARGB2101010_UINT && - srcFormat == GL_BGRA_INTEGER_EXT && - srcType == GL_UNSIGNED_INT_2_10_10_10_REV && - baseInternalFormat == GL_RGBA) { - /* simple memcpy path */ - memcpy_texture(ctx, dims, - dstFormat, - dstRowStride, dstSlices, - srcWidth, srcHeight, srcDepth, srcFormat, srcType, - srcAddr, srcPacking); - } - else { - /* general path */ - const GLuint *tempImage = make_temp_uint_image(ctx, dims, - baseInternalFormat, - baseFormat, - srcWidth, srcHeight, - srcDepth, srcFormat, - srcType, srcAddr, - srcPacking); - const GLuint *src = 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++) { - GLushort a,r,g,b; - r = src[RCOMP]; - g = src[GCOMP]; - b = src[BCOMP]; - a = src[ACOMP]; - dstUI[col] = (a << 30) | (r << 20) | (g << 10) | (b); - src += 4; - } - dstRow += dstRowStride; - } - } - free((void *) tempImage); - } - return GL_TRUE; -} - static GLboolean _mesa_texstore_null(TEXSTORE_PARAMS) { @@ -4257,7 +4202,6 @@ _mesa_get_texstore_func(gl_format format) table[MESA_FORMAT_RGB_UINT32] = _mesa_texstore_rgba_uint32; table[MESA_FORMAT_RGBA_UINT32] = _mesa_texstore_rgba_uint32; - table[MESA_FORMAT_ARGB2101010_UINT] = _mesa_texstore_argb2101010_uint; initialized = GL_TRUE; } diff --git a/reactos/dll/opengl/mesa/src/mesa/main/version.c b/reactos/dll/opengl/mesa/src/mesa/main/version.c index 695eed46231..710850f6a5a 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/version.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/version.c @@ -90,8 +90,6 @@ compute_version(struct gl_context *ctx) ctx->Extensions.ARB_texture_env_combine && ctx->Extensions.ARB_texture_env_dot3); const GLboolean ver_1_4 = (ver_1_3 && - ctx->Extensions.ARB_depth_texture && - ctx->Extensions.ARB_shadow && ctx->Extensions.ARB_texture_env_crossbar && ctx->Extensions.ARB_window_pos && ctx->Extensions.EXT_blend_color && @@ -168,10 +166,7 @@ compute_version(struct gl_context *ctx) ctx->Extensions.ARB_blend_func_extended && ctx->Extensions.ARB_explicit_attrib_location && ctx->Extensions.ARB_instanced_arrays && - ctx->Extensions.ARB_occlusion_query2 && - ctx->Extensions.ARB_sampler_objects && - ctx->Extensions.ARB_texture_rgb10_a2ui && - ctx->Extensions.ARB_timer_query); + ctx->Extensions.ARB_occlusion_query2); if (ver_3_3) { major = 3; diff --git a/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c b/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c index f34a6d3609d..0f751a32755 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c +++ b/reactos/dll/opengl/mesa/src/mesa/program/prog_statevars.c @@ -573,20 +573,6 @@ _mesa_fetch_state(struct gl_context *ctx, const gl_state_index state[], value[3] = ctx->Pixel.AlphaBias; return; - case STATE_SHADOW_AMBIENT: - { - const int unit = (int) state[2]; - const struct gl_texture_object *texObj - = ctx->Texture.Unit[unit]._Current; - if (texObj) { - value[0] = - value[1] = - value[2] = - value[3] = texObj->Sampler.CompareFailValue; - } - } - return; - case STATE_FB_SIZE: value[0] = (GLfloat) (ctx->DrawBuffer->Width - 1); value[1] = (GLfloat) (ctx->DrawBuffer->Height - 1); 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 aa4142ac567..70c1ce9212e 100644 --- a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c +++ b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfetch.c @@ -1077,12 +1077,6 @@ texfetch_funcs[MESA_FORMAT_COUNT] = fetch_texel_1d_z32f_x24s8, fetch_texel_2d_z32f_x24s8, fetch_texel_3d_z32f_x24s8 - }, - { - MESA_FORMAT_ARGB2101010_UINT, - NULL, - NULL, - NULL } }; @@ -1126,8 +1120,7 @@ set_fetch_functions(struct swrast_texture_image *texImage, GLuint dims) ASSERT(dims == 1 || dims == 2 || dims == 3); - if (texImage->Base.TexObject->Sampler.sRGBDecode == GL_SKIP_DECODE_EXT && - _mesa_get_format_color_encoding(format) == GL_SRGB) { + if (_mesa_get_format_color_encoding(format) == GL_SRGB) { format = _mesa_get_srgb_format_linear(format); } diff --git a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c index d142d3d0762..0ed0711ddf7 100644 --- a/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c +++ b/reactos/dll/opengl/mesa/src/mesa/swrast/s_texfilter.c @@ -3384,203 +3384,6 @@ shadow_compare4(GLenum function, GLfloat coord, } } - -/** - * Choose the mipmap level to use when sampling from a depth texture. - */ -static int -choose_depth_texture_level(const struct gl_texture_object *tObj, GLfloat lambda) -{ - GLint level; - - if (tObj->Sampler.MinFilter == GL_NEAREST || tObj->Sampler.MinFilter == GL_LINEAR) { - /* no mipmapping - use base level */ - level = tObj->BaseLevel; - } - else { - /* choose mipmap level */ - lambda = CLAMP(lambda, tObj->Sampler.MinLod, tObj->Sampler.MaxLod); - level = (GLint) lambda; - level = CLAMP(level, tObj->BaseLevel, tObj->_MaxLevel); - } - - return level; -} - - -/** - * Sample a shadow/depth texture. This function is incomplete. It doesn't - * check for minification vs. magnification, etc. - */ -static void -sample_depth_texture( struct gl_context *ctx, - const struct gl_texture_object *tObj, GLuint n, - const GLfloat texcoords[][4], const GLfloat lambda[], - GLfloat texel[][4] ) -{ - const GLint level = choose_depth_texture_level(tObj, lambda[0]); - const struct gl_texture_image *img = tObj->Image[0][level]; - const struct swrast_texture_image *swImg = swrast_texture_image_const(img); - const GLint width = img->Width; - const GLint height = img->Height; - const GLint depth = img->Depth; - const GLuint compare_coord = (tObj->Target == GL_TEXTURE_2D_ARRAY_EXT) - ? 3 : 2; - GLfloat ambient; - GLenum function; - GLfloat result; - - ASSERT(img->_BaseFormat == GL_DEPTH_COMPONENT || - img->_BaseFormat == GL_DEPTH_STENCIL_EXT); - - ASSERT(tObj->Target == GL_TEXTURE_1D || - tObj->Target == GL_TEXTURE_2D || - tObj->Target == GL_TEXTURE_RECTANGLE_NV || - tObj->Target == GL_TEXTURE_1D_ARRAY_EXT || - tObj->Target == GL_TEXTURE_2D_ARRAY_EXT || - tObj->Target == GL_TEXTURE_CUBE_MAP); - - ambient = tObj->Sampler.CompareFailValue; - - /* XXXX if tObj->Sampler.MinFilter != tObj->Sampler.MagFilter, we're ignoring lambda */ - - function = (tObj->Sampler.CompareMode == GL_COMPARE_R_TO_TEXTURE_ARB) ? - tObj->Sampler.CompareFunc : GL_NONE; - - if (tObj->Sampler.MagFilter == GL_NEAREST) { - GLuint i; - for (i = 0; i < n; i++) { - GLfloat depthSample, depthRef; - GLint col, row, slice; - - nearest_texcoord(tObj, level, texcoords[i], &col, &row, &slice); - - if (col >= 0 && row >= 0 && col < width && row < height && - slice >= 0 && slice < depth) { - swImg->FetchTexel(swImg, col, row, slice, &depthSample); - } - else { - depthSample = tObj->Sampler.BorderColor.f[0]; - } - - depthRef = CLAMP(texcoords[i][compare_coord], 0.0F, 1.0F); - - result = shadow_compare(function, depthRef, depthSample, ambient); - - switch (tObj->Sampler.DepthMode) { - case GL_LUMINANCE: - ASSIGN_4V(texel[i], result, result, result, 1.0F); - break; - case GL_INTENSITY: - ASSIGN_4V(texel[i], result, result, result, result); - break; - case GL_ALPHA: - ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); - break; - case GL_RED: - ASSIGN_4V(texel[i], result, 0.0F, 0.0F, 1.0F); - break; - default: - _mesa_problem(ctx, "Bad depth texture mode"); - break; - } - } - } - else { - GLuint i; - ASSERT(tObj->Sampler.MagFilter == GL_LINEAR); - for (i = 0; i < n; i++) { - GLfloat depth00, depth01, depth10, depth11, depthRef; - GLint i0, i1, j0, j1; - GLint slice; - GLfloat wi, wj; - GLuint useBorderTexel; - - linear_texcoord(tObj, level, texcoords[i], &i0, &i1, &j0, &j1, &slice, - &wi, &wj); - - useBorderTexel = 0; - if (img->Border) { - i0 += img->Border; - i1 += img->Border; - if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { - j0 += img->Border; - j1 += img->Border; - } - } - else { - if (i0 < 0 || i0 >= (GLint) width) useBorderTexel |= I0BIT; - if (i1 < 0 || i1 >= (GLint) width) useBorderTexel |= I1BIT; - if (j0 < 0 || j0 >= (GLint) height) useBorderTexel |= J0BIT; - if (j1 < 0 || j1 >= (GLint) height) useBorderTexel |= J1BIT; - } - - if (slice < 0 || slice >= (GLint) depth) { - depth00 = tObj->Sampler.BorderColor.f[0]; - depth01 = tObj->Sampler.BorderColor.f[0]; - depth10 = tObj->Sampler.BorderColor.f[0]; - depth11 = tObj->Sampler.BorderColor.f[0]; - } - else { - /* get four depth samples from the texture */ - if (useBorderTexel & (I0BIT | J0BIT)) { - depth00 = tObj->Sampler.BorderColor.f[0]; - } - else { - swImg->FetchTexel(swImg, i0, j0, slice, &depth00); - } - if (useBorderTexel & (I1BIT | J0BIT)) { - depth10 = tObj->Sampler.BorderColor.f[0]; - } - else { - swImg->FetchTexel(swImg, i1, j0, slice, &depth10); - } - - if (tObj->Target != GL_TEXTURE_1D_ARRAY_EXT) { - if (useBorderTexel & (I0BIT | J1BIT)) { - depth01 = tObj->Sampler.BorderColor.f[0]; - } - else { - swImg->FetchTexel(swImg, i0, j1, slice, &depth01); - } - if (useBorderTexel & (I1BIT | J1BIT)) { - depth11 = tObj->Sampler.BorderColor.f[0]; - } - else { - swImg->FetchTexel(swImg, i1, j1, slice, &depth11); - } - } - else { - depth01 = depth00; - depth11 = depth10; - } - } - - depthRef = CLAMP(texcoords[i][compare_coord], 0.0F, 1.0F); - - result = shadow_compare4(function, depthRef, - depth00, depth01, depth10, depth11, - ambient, wi, wj); - - switch (tObj->Sampler.DepthMode) { - case GL_LUMINANCE: - ASSIGN_4V(texel[i], result, result, result, 1.0F); - break; - case GL_INTENSITY: - ASSIGN_4V(texel[i], result, result, result, result); - break; - case GL_ALPHA: - ASSIGN_4V(texel[i], 0.0F, 0.0F, 0.0F, result); - break; - default: - _mesa_problem(ctx, "Bad depth texture mode"); - } - - } /* for */ - } /* if filter */ -} - - /** * We use this function when a texture object is in an "incomplete" state. * When a fragment program attempts to sample an incomplete texture we @@ -3620,14 +3423,10 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, else { const GLboolean needLambda = (GLboolean) (t->Sampler.MinFilter != t->Sampler.MagFilter); - const GLenum format = t->Image[0][t->BaseLevel]->_BaseFormat; switch (t->Target) { case GL_TEXTURE_1D: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { return &sample_lambda_1d; } else if (t->Sampler.MinFilter == GL_LINEAR) { @@ -3638,10 +3437,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_nearest_1d; } case GL_TEXTURE_2D: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { /* Anisotropic filtering extension. Activated only if mipmaps are used */ if (t->Sampler.MaxAnisotropy > 1.0 && t->Sampler.MinFilter == GL_LINEAR_MIPMAP_LINEAR) { @@ -3685,10 +3481,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_nearest_3d; } case GL_TEXTURE_CUBE_MAP: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { return &sample_lambda_cube; } else if (t->Sampler.MinFilter == GL_LINEAR) { @@ -3699,10 +3492,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_nearest_cube; } case GL_TEXTURE_RECTANGLE_NV: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { return &sample_lambda_rect; } else if (t->Sampler.MinFilter == GL_LINEAR) { @@ -3713,10 +3503,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_nearest_rect; } case GL_TEXTURE_1D_ARRAY_EXT: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { return &sample_lambda_1d_array; } else if (t->Sampler.MinFilter == GL_LINEAR) { @@ -3727,10 +3514,7 @@ _swrast_choose_texture_sample_func( struct gl_context *ctx, return &sample_nearest_1d_array; } case GL_TEXTURE_2D_ARRAY_EXT: - if (format == GL_DEPTH_COMPONENT || format == GL_DEPTH_STENCIL_EXT) { - return &sample_depth_texture; - } - else if (needLambda) { + if (needLambda) { return &sample_lambda_2d_array; } else if (t->Sampler.MinFilter == GL_LINEAR) {