diff --git a/reactos/dll/opengl/mesa/drivers/common/driverfuncs.c b/reactos/dll/opengl/mesa/drivers/common/driverfuncs.c index bb273bf0b5c..25261d24ac9 100644 --- a/reactos/dll/opengl/mesa/drivers/common/driverfuncs.c +++ b/reactos/dll/opengl/mesa/drivers/common/driverfuncs.c @@ -137,9 +137,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->RenderMode = NULL; driver->Scissor = NULL; driver->ShadeModel = NULL; - driver->StencilFuncSeparate = NULL; - driver->StencilOpSeparate = NULL; - driver->StencilMaskSeparate = NULL; driver->TexGen = NULL; driver->TexEnv = NULL; driver->TexParameter = NULL; diff --git a/reactos/dll/opengl/mesa/drivers/common/meta.c b/reactos/dll/opengl/mesa/drivers/common/meta.c index 7ddc03cd021..19bf52a825e 100644 --- a/reactos/dll/opengl/mesa/drivers/common/meta.c +++ b/reactos/dll/opengl/mesa/drivers/common/meta.c @@ -48,7 +48,6 @@ #include "main/macros.h" #include "main/matrix.h" #include "main/pixel.h" -#include "main/pbo.h" #include "main/polygon.h" #include "main/readpix.h" #include "main/scissor.h" @@ -563,30 +562,11 @@ _mesa_meta_end(struct gl_context *ctx) _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled); _mesa_ClearStencil(stencil->Clear); - if (ctx->Extensions.EXT_stencil_two_side) { - _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, - stencil->TestTwoSide); - _mesa_ActiveStencilFaceEXT(stencil->ActiveFace - ? GL_BACK : GL_FRONT); - } - /* front state */ - _mesa_StencilFuncSeparate(GL_FRONT, - stencil->Function[0], - stencil->Ref[0], - stencil->ValueMask[0]); - _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]); - _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0], - stencil->ZFailFunc[0], - stencil->ZPassFunc[0]); - /* back state */ - _mesa_StencilFuncSeparate(GL_BACK, - stencil->Function[1], - stencil->Ref[1], - stencil->ValueMask[1]); - _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]); - _mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1], - stencil->ZFailFunc[1], - stencil->ZPassFunc[1]); + _mesa_StencilFunc(stencil->Function, + stencil->Ref, + stencil->ValueMask); + _mesa_StencilMask(stencil->WriteMask); + _mesa_StencilOp(stencil->FailFunc, stencil->ZFailFunc, stencil->ZPassFunc); } if (state & MESA_META_TEXTURE) { diff --git a/reactos/dll/opengl/mesa/main/CMakeLists.txt b/reactos/dll/opengl/mesa/main/CMakeLists.txt index c61aebb0969..e327a1bd991 100644 --- a/reactos/dll/opengl/mesa/main/CMakeLists.txt +++ b/reactos/dll/opengl/mesa/main/CMakeLists.txt @@ -44,7 +44,6 @@ list(APPEND SOURCE mm.c multisample.c pack.c - pbo.c pixel.c pixelstore.c pixeltransfer.c diff --git a/reactos/dll/opengl/mesa/main/api_exec.c b/reactos/dll/opengl/mesa/main/api_exec.c index 9fa7d4fbe58..cb673769063 100644 --- a/reactos/dll/opengl/mesa/main/api_exec.c +++ b/reactos/dll/opengl/mesa/main/api_exec.c @@ -276,11 +276,6 @@ _mesa_create_exec_table(void) _mesa_init_convolve_dispatch(exec); _mesa_init_histogram_dispatch(exec); - /* OpenGL 2.0 */ - SET_StencilFuncSeparate(exec, _mesa_StencilFuncSeparate); - SET_StencilMaskSeparate(exec, _mesa_StencilMaskSeparate); - SET_StencilOpSeparate(exec, _mesa_StencilOpSeparate); - /* 2. GL_EXT_blend_color */ #if 0 /* SET_BlendColorEXT(exec, _mesa_BlendColorEXT); */ @@ -344,11 +339,6 @@ _mesa_create_exec_table(void) SET_UnlockArraysEXT(exec, _mesa_UnlockArraysEXT); #endif - /* 148. GL_EXT_multi_draw_arrays */ -#if _HAVE_FULL_GL - SET_MultiDrawArraysEXT(exec, _mesa_MultiDrawArraysEXT); -#endif - /* 173. GL_INGR_blend_func_separate */ #if _HAVE_FULL_GL SET_BlendFuncSeparateEXT(exec, _mesa_BlendFuncSeparateEXT); @@ -406,11 +396,6 @@ _mesa_create_exec_table(void) SET_PointParameterivNV(exec, _mesa_PointParameteriv); #endif - /* 268. GL_EXT_stencil_two_side */ -#if _HAVE_FULL_GL - SET_ActiveStencilFaceEXT(exec, _mesa_ActiveStencilFaceEXT); -#endif - /* ???. GL_EXT_depth_bounds_test */ SET_DepthBoundsEXT(exec, _mesa_DepthBoundsEXT); @@ -443,15 +428,6 @@ _mesa_create_exec_table(void) SET_MapBufferARB(exec, _mesa_MapBufferARB); SET_UnmapBufferARB(exec, _mesa_UnmapBufferARB); - /* ARB 104. GL_ARB_robustness */ - SET_GetGraphicsResetStatusARB(exec, _mesa_GetGraphicsResetStatusARB); - SET_GetnPolygonStippleARB(exec, _mesa_GetnPolygonStippleARB); - SET_GetnTexImageARB(exec, _mesa_GetnTexImageARB); - SET_ReadnPixelsARB(exec, _mesa_ReadnPixelsARB); - - /* GL_ATI_separate_stencil */ - SET_StencilFuncSeparateATI(exec, _mesa_StencilFuncSeparateATI); - #if FEATURE_ARB_map_buffer_range SET_MapBufferRange(exec, _mesa_MapBufferRange); SET_FlushMappedBufferRange(exec, _mesa_FlushMappedBufferRange); diff --git a/reactos/dll/opengl/mesa/main/attrib.c b/reactos/dll/opengl/mesa/main/attrib.c index faf9d505b26..23156bc7b9e 100644 --- a/reactos/dll/opengl/mesa/main/attrib.c +++ b/reactos/dll/opengl/mesa/main/attrib.c @@ -113,7 +113,6 @@ struct gl_enable_attrib GLboolean RescaleNormals; GLboolean Scissor; GLboolean Stencil; - GLboolean StencilTwoSide; /* GL_EXT_stencil_two_side */ GLboolean MultisampleEnabled; /* GL_ARB_multisample */ GLboolean SampleAlphaToCoverage; /* GL_ARB_multisample */ GLboolean SampleAlphaToOne; /* GL_ARB_multisample */ @@ -293,7 +292,6 @@ _mesa_PushAttrib(GLbitfield mask) attr->RescaleNormals = ctx->Transform.RescaleNormals; attr->Scissor = ctx->Scissor.Enabled; attr->Stencil = ctx->Stencil.Enabled; - attr->StencilTwoSide = ctx->Stencil.TestTwoSide; attr->MultisampleEnabled = ctx->Multisample.Enabled; attr->SampleAlphaToCoverage = ctx->Multisample.SampleAlphaToCoverage; attr->SampleAlphaToOne = ctx->Multisample.SampleAlphaToOne; @@ -548,9 +546,6 @@ pop_enable_group(struct gl_context *ctx, const struct gl_enable_attrib *enable) GL_POLYGON_STIPPLE); TEST_AND_UPDATE(ctx->Scissor.Enabled, enable->Scissor, GL_SCISSOR_TEST); TEST_AND_UPDATE(ctx->Stencil.Enabled, enable->Stencil, GL_STENCIL_TEST); - if (ctx->Extensions.EXT_stencil_two_side) { - TEST_AND_UPDATE(ctx->Stencil.TestTwoSide, enable->StencilTwoSide, GL_STENCIL_TEST_TWO_SIDE_EXT); - } TEST_AND_UPDATE(ctx->Multisample.Enabled, enable->MultisampleEnabled, GL_MULTISAMPLE_ARB); TEST_AND_UPDATE(ctx->Multisample.SampleAlphaToCoverage, @@ -983,30 +978,13 @@ _mesa_PopAttrib(void) stencil = (const struct gl_stencil_attrib *) attr->data; _mesa_set_enable(ctx, GL_STENCIL_TEST, stencil->Enabled); _mesa_ClearStencil(stencil->Clear); - if (ctx->Extensions.EXT_stencil_two_side) { - _mesa_set_enable(ctx, GL_STENCIL_TEST_TWO_SIDE_EXT, - stencil->TestTwoSide); - _mesa_ActiveStencilFaceEXT(stencil->ActiveFace - ? GL_BACK : GL_FRONT); - } - /* front state */ - _mesa_StencilFuncSeparate(GL_FRONT, - stencil->Function[0], - stencil->Ref[0], - stencil->ValueMask[0]); - _mesa_StencilMaskSeparate(GL_FRONT, stencil->WriteMask[0]); - _mesa_StencilOpSeparate(GL_FRONT, stencil->FailFunc[0], - stencil->ZFailFunc[0], - stencil->ZPassFunc[0]); - /* back state */ - _mesa_StencilFuncSeparate(GL_BACK, - stencil->Function[1], - stencil->Ref[1], - stencil->ValueMask[1]); - _mesa_StencilMaskSeparate(GL_BACK, stencil->WriteMask[1]); - _mesa_StencilOpSeparate(GL_BACK, stencil->FailFunc[1], - stencil->ZFailFunc[1], - stencil->ZPassFunc[1]); + _mesa_StencilFunc(stencil->Function, + stencil->Ref, + stencil->ValueMask); + _mesa_StencilMask(stencil->WriteMask); + _mesa_StencilOp(stencil->FailFunc, + stencil->ZFailFunc, + stencil->ZPassFunc); } break; case GL_TRANSFORM_BIT: @@ -1111,7 +1089,6 @@ copy_pixelstore(struct gl_context *ctx, dst->SwapBytes = src->SwapBytes; dst->LsbFirst = src->LsbFirst; dst->Invert = src->Invert; - _mesa_reference_buffer_object(ctx, &dst->BufferObj, src->BufferObj); } @@ -1344,7 +1321,6 @@ _mesa_PopClientAttrib(void) struct gl_pixelstore_attrib *store = (struct gl_pixelstore_attrib *) node->data; copy_pixelstore(ctx, &ctx->Pack, store); - _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } ctx->NewState |= _NEW_PACKUNPACK; break; @@ -1353,7 +1329,6 @@ _mesa_PopClientAttrib(void) struct gl_pixelstore_attrib *store = (struct gl_pixelstore_attrib *) node->data; copy_pixelstore(ctx, &ctx->Unpack, store); - _mesa_reference_buffer_object(ctx, &store->BufferObj, NULL); } ctx->NewState |= _NEW_PACKUNPACK; break; diff --git a/reactos/dll/opengl/mesa/main/bufferobj.c b/reactos/dll/opengl/mesa/main/bufferobj.c index 311f8d33071..ddbdcba9e7f 100644 --- a/reactos/dll/opengl/mesa/main/bufferobj.c +++ b/reactos/dll/opengl/mesa/main/bufferobj.c @@ -70,10 +70,6 @@ get_buffer_target(struct gl_context *ctx, GLenum target) return &ctx->Array.ArrayBufferObj; case GL_ELEMENT_ARRAY_BUFFER_ARB: return &ctx->Array.ArrayObj->ElementArrayBufferObj; - case GL_PIXEL_PACK_BUFFER_EXT: - return &ctx->Pack.BufferObj; - case GL_PIXEL_UNPACK_BUFFER_EXT: - return &ctx->Unpack.BufferObj; default: return NULL; } @@ -572,8 +568,6 @@ _mesa_update_default_objects_buffer_objects(struct gl_context *ctx) */ bind_buffer_object( ctx, GL_ARRAY_BUFFER_ARB, 0); bind_buffer_object( ctx, GL_ELEMENT_ARRAY_BUFFER_ARB, 0); - bind_buffer_object( ctx, GL_PIXEL_PACK_BUFFER_ARB, 0); - bind_buffer_object( ctx, GL_PIXEL_UNPACK_BUFFER_ARB, 0); } @@ -699,14 +693,6 @@ _mesa_DeleteBuffersARB(GLsizei n, const GLuint *ids) _mesa_BindBufferARB( GL_ELEMENT_ARRAY_BUFFER_ARB, 0 ); } - /* unbind any pixel pack/unpack pointers bound to this buffer */ - if (ctx->Pack.BufferObj == bufObj) { - _mesa_BindBufferARB( GL_PIXEL_PACK_BUFFER_EXT, 0 ); - } - if (ctx->Unpack.BufferObj == bufObj) { - _mesa_BindBufferARB( GL_PIXEL_UNPACK_BUFFER_EXT, 0 ); - } - /* The ID is immediately freed for re-use */ _mesa_HashRemove(ctx->Shared->BufferObjects, ids[i]); /* Make sure we do not run into the classic ABA problem on bind. diff --git a/reactos/dll/opengl/mesa/main/colortab.c b/reactos/dll/opengl/mesa/main/colortab.c index f20dee67789..68553abfedb 100644 --- a/reactos/dll/opengl/mesa/main/colortab.c +++ b/reactos/dll/opengl/mesa/main/colortab.c @@ -32,7 +32,6 @@ #include "mfeatures.h" #include "mtypes.h" #include "pack.h" -#include "pbo.h" #include "state.h" #include "teximage.h" #include "texstate.h" @@ -86,17 +85,6 @@ _mesa_CopyColorSubTable(GLenum target, GLsizei start, } - -static void GLAPIENTRY -_mesa_GetnColorTableARB( GLenum target, GLenum format, GLenum type, - GLsizei bufSize, GLvoid *data ) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - _mesa_error(ctx, GL_INVALID_ENUM, "glGetnColorTableARB(target)"); -} - - static void GLAPIENTRY _mesa_GetColorTable( GLenum target, GLenum format, GLenum type, GLvoid *data ) @@ -160,9 +148,6 @@ _mesa_init_colortable_dispatch(struct _glapi_table *disp) SET_GetColorTable(disp, _mesa_GetColorTable); SET_GetColorTableParameterfv(disp, _mesa_GetColorTableParameterfv); SET_GetColorTableParameteriv(disp, _mesa_GetColorTableParameteriv); - - /* GL_ARB_robustness */ - SET_GetnColorTableARB(disp, _mesa_GetnColorTableARB); } diff --git a/reactos/dll/opengl/mesa/main/context.c b/reactos/dll/opengl/mesa/main/context.c index 255c2928ccc..c2d10b8ee3f 100644 --- a/reactos/dll/opengl/mesa/main/context.c +++ b/reactos/dll/opengl/mesa/main/context.c @@ -467,9 +467,6 @@ _mesa_init_constants(struct gl_context *ctx) /* GL 3.2: hard-coded for now: */ ctx->Const.ProfileMask = GL_CONTEXT_COMPATIBILITY_PROFILE_BIT; - - /* GL_ARB_robustness */ - ctx->Const.ResetStrategy = GL_NO_RESET_NOTIFICATION_ARB; } @@ -554,8 +551,6 @@ init_attrib_groups(struct gl_context *ctx) /* Miscellaneous */ ctx->NewState = _NEW_ALL; ctx->ErrorValue = (GLenum) GL_NO_ERROR; - ctx->ResetStatus = (GLenum) GL_NO_ERROR; - ctx->varying_vp_inputs = VERT_BIT_ALL; return GL_TRUE; } @@ -805,12 +800,6 @@ _mesa_free_context_data( struct gl_context *ctx ) _mesa_delete_array_object(ctx, ctx->Array.DefaultArrayObj); -#if FEATURE_ARB_pixel_buffer_object - _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, NULL); - _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, NULL); - _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, NULL); -#endif - _mesa_reference_buffer_object(ctx, &ctx->Array.ArrayBufferObj, NULL); /* free dispatch tables */ diff --git a/reactos/dll/opengl/mesa/main/convolve.c b/reactos/dll/opengl/mesa/main/convolve.c index 74f28da87ee..96f5156728c 100644 --- a/reactos/dll/opengl/mesa/main/convolve.c +++ b/reactos/dll/opengl/mesa/main/convolve.c @@ -115,8 +115,8 @@ _mesa_CopyConvolutionFilter2D(GLenum target, GLenum internalFormat, GLint x, GLi static void GLAPIENTRY -_mesa_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type, - GLsizei bufSize, GLvoid *image) +_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, + GLvoid *image) { GET_CURRENT_CONTEXT(ctx); @@ -124,14 +124,6 @@ _mesa_GetnConvolutionFilterARB(GLenum target, GLenum format, GLenum type, } -static void GLAPIENTRY -_mesa_GetConvolutionFilter(GLenum target, GLenum format, GLenum type, - GLvoid *image) -{ - _mesa_GetnConvolutionFilterARB(target, format, type, INT_MAX, image); -} - - static void GLAPIENTRY _mesa_GetConvolutionParameterfv(GLenum target, GLenum pname, GLfloat *params) { @@ -151,10 +143,9 @@ _mesa_GetConvolutionParameteriv(GLenum target, GLenum pname, GLint *params) static void GLAPIENTRY -_mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type, - GLsizei rowBufSize, GLvoid *row, - GLsizei columnBufSize, GLvoid *column, - GLvoid *span) +_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, + GLvoid *row, GLvoid *column, + GLvoid *span) { GET_CURRENT_CONTEXT(ctx); @@ -162,15 +153,6 @@ _mesa_GetnSeparableFilterARB(GLenum target, GLenum format, GLenum type, } -static void GLAPIENTRY -_mesa_GetSeparableFilter(GLenum target, GLenum format, GLenum type, - GLvoid *row, GLvoid *column, GLvoid *span) -{ - _mesa_GetnSeparableFilterARB(target, format, type, INT_MAX, row, - INT_MAX, column, span); -} - - static void GLAPIENTRY _mesa_SeparableFilter2D(GLenum target, GLenum internalFormat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column) { @@ -195,10 +177,6 @@ _mesa_init_convolve_dispatch(struct _glapi_table *disp) SET_GetConvolutionParameteriv(disp, _mesa_GetConvolutionParameteriv); SET_SeparableFilter2D(disp, _mesa_SeparableFilter2D); SET_GetSeparableFilter(disp, _mesa_GetSeparableFilter); - - /* GL_ARB_robustness */ - SET_GetnConvolutionFilterARB(disp, _mesa_GetnConvolutionFilterARB); - SET_GetnSeparableFilterARB(disp, _mesa_GetnSeparableFilterARB); } diff --git a/reactos/dll/opengl/mesa/main/dd.h b/reactos/dll/opengl/mesa/main/dd.h index 547b64d51bb..1af1c0ffad7 100644 --- a/reactos/dll/opengl/mesa/main/dd.h +++ b/reactos/dll/opengl/mesa/main/dd.h @@ -567,14 +567,6 @@ struct dd_function_table { void (*Scissor)(struct gl_context *ctx, GLint x, GLint y, GLsizei w, GLsizei h); /** Select flat or smooth shading */ void (*ShadeModel)(struct gl_context *ctx, GLenum mode); - /** OpenGL 2.0 two-sided StencilFunc */ - void (*StencilFuncSeparate)(struct gl_context *ctx, GLenum face, GLenum func, - GLint ref, GLuint mask); - /** OpenGL 2.0 two-sided StencilMask */ - void (*StencilMaskSeparate)(struct gl_context *ctx, GLenum face, GLuint mask); - /** OpenGL 2.0 two-sided StencilOp */ - void (*StencilOpSeparate)(struct gl_context *ctx, GLenum face, GLenum fail, - GLenum zfail, GLenum zpass); /** Control the generation of texture coordinates */ void (*TexGen)(struct gl_context *ctx, GLenum coord, GLenum pname, const GLfloat *params); diff --git a/reactos/dll/opengl/mesa/main/dispatch.h b/reactos/dll/opengl/mesa/main/dispatch.h index 8e3476e07c3..f9ecac92781 100644 --- a/reactos/dll/opengl/mesa/main/dispatch.h +++ b/reactos/dll/opengl/mesa/main/dispatch.h @@ -444,9 +444,6 @@ typedef PROC _glapi_proc; #if !FEATURE_remap_table -#define _gloffset_StencilFuncSeparate 421 -#define _gloffset_StencilMaskSeparate 422 -#define _gloffset_StencilOpSeparate 423 #define _gloffset_GetStringi 435 #define _gloffset_GetBufferParameteri64v 438 #define _gloffset_GetInteger64i_v 439 @@ -486,21 +483,6 @@ typedef PROC _glapi_proc; #define _gloffset_MapBufferRange 581 #define _gloffset_BindVertexArray 583 #define _gloffset_GenVertexArrays 584 -#define _gloffset_GetGraphicsResetStatusARB 665 -#define _gloffset_GetnColorTableARB 666 -#define _gloffset_GetnConvolutionFilterARB 668 -#define _gloffset_GetnHistogramARB 669 -#define _gloffset_GetnMapdvARB 670 -#define _gloffset_GetnMapfvARB 671 -#define _gloffset_GetnMapivARB 672 -#define _gloffset_GetnMinmaxARB 673 -#define _gloffset_GetnPixelMapfvARB 674 -#define _gloffset_GetnPixelMapuivARB 675 -#define _gloffset_GetnPixelMapusvARB 676 -#define _gloffset_GetnPolygonStippleARB 677 -#define _gloffset_GetnSeparableFilterARB 678 -#define _gloffset_GetnTexImageARB 679 -#define _gloffset_ReadnPixelsARB 684 #define _gloffset_TexStorage1D 685 #define _gloffset_TexStorage2D 686 #define _gloffset_TexStorage3D 687 @@ -537,7 +519,6 @@ typedef PROC _glapi_proc; #define _gloffset_SecondaryColor3usEXT 724 #define _gloffset_SecondaryColor3usvEXT 725 #define _gloffset_SecondaryColorPointerEXT 726 -#define _gloffset_MultiDrawArraysEXT 727 #define _gloffset_FogCoordPointerEXT 729 #define _gloffset_FogCoorddEXT 730 #define _gloffset_FogCoorddvEXT 731 @@ -674,16 +655,12 @@ typedef PROC _glapi_proc; #define _gloffset_ObjectUnpurgeableAPPLE 961 #define _gloffset_CreateShaderProgramEXT 963 #define _gloffset_TextureBarrierNV 965 -#define _gloffset_StencilFuncSeparateATI 966 #else /* !FEATURE_remap_table */ #define driDispatchRemapTable_size 565 extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; -#define StencilFuncSeparate_remap_index 13 -#define StencilMaskSeparate_remap_index 14 -#define StencilOpSeparate_remap_index 15 #define GetStringi_remap_index 27 #define TexBuffer_remap_index 28 #define GetBufferParameteri64v_remap_index 30 @@ -726,21 +703,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define MapBufferRange_remap_index 173 #define BindVertexArray_remap_index 175 #define GenVertexArrays_remap_index 176 -#define GetGraphicsResetStatusARB_remap_index 257 -#define GetnColorTableARB_remap_index 258 -#define GetnConvolutionFilterARB_remap_index 260 -#define GetnHistogramARB_remap_index 261 -#define GetnMapdvARB_remap_index 262 -#define GetnMapfvARB_remap_index 263 -#define GetnMapivARB_remap_index 264 -#define GetnMinmaxARB_remap_index 265 -#define GetnPixelMapfvARB_remap_index 266 -#define GetnPixelMapuivARB_remap_index 267 -#define GetnPixelMapusvARB_remap_index 268 -#define GetnPolygonStippleARB_remap_index 269 -#define GetnSeparableFilterARB_remap_index 270 -#define GetnTexImageARB_remap_index 271 -#define ReadnPixelsARB_remap_index 276 #define TexStorage1D_remap_index 277 #define TexStorage2D_remap_index 278 #define TexStorage3D_remap_index 279 @@ -914,11 +876,7 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define ObjectUnpurgeableAPPLE_remap_index 553 #define CreateShaderProgramEXT_remap_index 555 #define TextureBarrierNV_remap_index 557 -#define StencilFuncSeparateATI_remap_index 558 -#define _gloffset_StencilFuncSeparate driDispatchRemapTable[StencilFuncSeparate_remap_index] -#define _gloffset_StencilMaskSeparate driDispatchRemapTable[StencilMaskSeparate_remap_index] -#define _gloffset_StencilOpSeparate driDispatchRemapTable[StencilOpSeparate_remap_index] #define _gloffset_GetStringi driDispatchRemapTable[GetStringi_remap_index] #define _gloffset_GetBufferParameteri64v driDispatchRemapTable[GetBufferParameteri64v_remap_index] #define _gloffset_GetInteger64i_v driDispatchRemapTable[GetInteger64i_v_remap_index] @@ -959,21 +917,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_MapBufferRange driDispatchRemapTable[MapBufferRange_remap_index] #define _gloffset_BindVertexArray driDispatchRemapTable[BindVertexArray_remap_index] #define _gloffset_GenVertexArrays driDispatchRemapTable[GenVertexArrays_remap_index] -#define _gloffset_GetGraphicsResetStatusARB driDispatchRemapTable[GetGraphicsResetStatusARB_remap_index] -#define _gloffset_GetnColorTableARB driDispatchRemapTable[GetnColorTableARB_remap_index] -#define _gloffset_GetnConvolutionFilterARB driDispatchRemapTable[GetnConvolutionFilterARB_remap_index] -#define _gloffset_GetnHistogramARB driDispatchRemapTable[GetnHistogramARB_remap_index] -#define _gloffset_GetnMapdvARB driDispatchRemapTable[GetnMapdvARB_remap_index] -#define _gloffset_GetnMapfvARB driDispatchRemapTable[GetnMapfvARB_remap_index] -#define _gloffset_GetnMapivARB driDispatchRemapTable[GetnMapivARB_remap_index] -#define _gloffset_GetnMinmaxARB driDispatchRemapTable[GetnMinmaxARB_remap_index] -#define _gloffset_GetnPixelMapfvARB driDispatchRemapTable[GetnPixelMapfvARB_remap_index] -#define _gloffset_GetnPixelMapuivARB driDispatchRemapTable[GetnPixelMapuivARB_remap_index] -#define _gloffset_GetnPixelMapusvARB driDispatchRemapTable[GetnPixelMapusvARB_remap_index] -#define _gloffset_GetnPolygonStippleARB driDispatchRemapTable[GetnPolygonStippleARB_remap_index] -#define _gloffset_GetnSeparableFilterARB driDispatchRemapTable[GetnSeparableFilterARB_remap_index] -#define _gloffset_GetnTexImageARB driDispatchRemapTable[GetnTexImageARB_remap_index] -#define _gloffset_ReadnPixelsARB driDispatchRemapTable[ReadnPixelsARB_remap_index] #define _gloffset_TexStorage1D driDispatchRemapTable[TexStorage1D_remap_index] #define _gloffset_TexStorage2D driDispatchRemapTable[TexStorage2D_remap_index] #define _gloffset_TexStorage3D driDispatchRemapTable[TexStorage3D_remap_index] @@ -1010,7 +953,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_SecondaryColor3usEXT driDispatchRemapTable[SecondaryColor3usEXT_remap_index] #define _gloffset_SecondaryColor3usvEXT driDispatchRemapTable[SecondaryColor3usvEXT_remap_index] #define _gloffset_SecondaryColorPointerEXT driDispatchRemapTable[SecondaryColorPointerEXT_remap_index] -#define _gloffset_MultiDrawArraysEXT driDispatchRemapTable[MultiDrawArraysEXT_remap_index] #define _gloffset_FogCoordPointerEXT driDispatchRemapTable[FogCoordPointerEXT_remap_index] #define _gloffset_FogCoorddEXT driDispatchRemapTable[FogCoorddEXT_remap_index] #define _gloffset_FogCoorddvEXT driDispatchRemapTable[FogCoorddvEXT_remap_index] @@ -1147,7 +1089,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_ObjectUnpurgeableAPPLE driDispatchRemapTable[ObjectUnpurgeableAPPLE_remap_index] #define _gloffset_CreateShaderProgramEXT driDispatchRemapTable[CreateShaderProgramEXT_remap_index] #define _gloffset_TextureBarrierNV driDispatchRemapTable[TextureBarrierNV_remap_index] -#define _gloffset_StencilFuncSeparateATI driDispatchRemapTable[StencilFuncSeparateATI_remap_index] #endif /* !FEATURE_remap_table */ @@ -5265,39 +5206,6 @@ static inline void SET_CopyTexSubImage3D(struct _glapi_table *disp, void (GLAPIE SET_by_offset(disp, _gloffset_CopyTexSubImage3D, fn); } -typedef void (GLAPIENTRYP _glptr_StencilFuncSeparate)(GLenum, GLenum, GLint, GLuint); -#define CALL_StencilFuncSeparate(disp, parameters) \ - (* GET_StencilFuncSeparate(disp)) parameters -static inline _glptr_StencilFuncSeparate GET_StencilFuncSeparate(struct _glapi_table *disp) { - return (_glptr_StencilFuncSeparate) (GET_by_offset(disp, _gloffset_StencilFuncSeparate)); -} - -static inline void SET_StencilFuncSeparate(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLuint)) { - SET_by_offset(disp, _gloffset_StencilFuncSeparate, fn); -} - -typedef void (GLAPIENTRYP _glptr_StencilMaskSeparate)(GLenum, GLuint); -#define CALL_StencilMaskSeparate(disp, parameters) \ - (* GET_StencilMaskSeparate(disp)) parameters -static inline _glptr_StencilMaskSeparate GET_StencilMaskSeparate(struct _glapi_table *disp) { - return (_glptr_StencilMaskSeparate) (GET_by_offset(disp, _gloffset_StencilMaskSeparate)); -} - -static inline void SET_StencilMaskSeparate(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint)) { - SET_by_offset(disp, _gloffset_StencilMaskSeparate, fn); -} - -typedef void (GLAPIENTRYP _glptr_StencilOpSeparate)(GLenum, GLenum, GLenum, GLenum); -#define CALL_StencilOpSeparate(disp, parameters) \ - (* GET_StencilOpSeparate(disp)) parameters -static inline _glptr_StencilOpSeparate GET_StencilOpSeparate(struct _glapi_table *disp) { - return (_glptr_StencilOpSeparate) (GET_by_offset(disp, _gloffset_StencilOpSeparate)); -} - -static inline void SET_StencilOpSeparate(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLenum)) { - SET_by_offset(disp, _gloffset_StencilOpSeparate, fn); -} - typedef const GLubyte * (GLAPIENTRYP _glptr_GetStringi)(GLenum, GLuint); #define CALL_GetStringi(disp, parameters) \ (* GET_GetStringi(disp)) parameters @@ -5727,171 +5635,6 @@ static inline void SET_GenVertexArrays(struct _glapi_table *disp, void (GLAPIENT SET_by_offset(disp, _gloffset_GenVertexArrays, fn); } -typedef GLenum (GLAPIENTRYP _glptr_GetGraphicsResetStatusARB)(void); -#define CALL_GetGraphicsResetStatusARB(disp, parameters) \ - (* GET_GetGraphicsResetStatusARB(disp)) parameters -static inline _glptr_GetGraphicsResetStatusARB GET_GetGraphicsResetStatusARB(struct _glapi_table *disp) { - return (_glptr_GetGraphicsResetStatusARB) (GET_by_offset(disp, _gloffset_GetGraphicsResetStatusARB)); -} - -static inline void SET_GetGraphicsResetStatusARB(struct _glapi_table *disp, GLenum (GLAPIENTRYP fn)(void)) { - SET_by_offset(disp, _gloffset_GetGraphicsResetStatusARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnColorTableARB)(GLenum, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_GetnColorTableARB(disp, parameters) \ - (* GET_GetnColorTableARB(disp)) parameters -static inline _glptr_GetnColorTableARB GET_GetnColorTableARB(struct _glapi_table *disp) { - return (_glptr_GetnColorTableARB) (GET_by_offset(disp, _gloffset_GetnColorTableARB)); -} - -static inline void SET_GetnColorTableARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnColorTableARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnConvolutionFilterARB)(GLenum, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_GetnConvolutionFilterARB(disp, parameters) \ - (* GET_GetnConvolutionFilterARB(disp)) parameters -static inline _glptr_GetnConvolutionFilterARB GET_GetnConvolutionFilterARB(struct _glapi_table *disp) { - return (_glptr_GetnConvolutionFilterARB) (GET_by_offset(disp, _gloffset_GetnConvolutionFilterARB)); -} - -static inline void SET_GetnConvolutionFilterARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnConvolutionFilterARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnHistogramARB)(GLenum, GLboolean, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_GetnHistogramARB(disp, parameters) \ - (* GET_GetnHistogramARB(disp)) parameters -static inline _glptr_GetnHistogramARB GET_GetnHistogramARB(struct _glapi_table *disp) { - return (_glptr_GetnHistogramARB) (GET_by_offset(disp, _gloffset_GetnHistogramARB)); -} - -static inline void SET_GetnHistogramARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLboolean, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnHistogramARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnMapdvARB)(GLenum, GLenum, GLsizei, GLdouble *); -#define CALL_GetnMapdvARB(disp, parameters) \ - (* GET_GetnMapdvARB(disp)) parameters -static inline _glptr_GetnMapdvARB GET_GetnMapdvARB(struct _glapi_table *disp) { - return (_glptr_GetnMapdvARB) (GET_by_offset(disp, _gloffset_GetnMapdvARB)); -} - -static inline void SET_GetnMapdvARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLdouble *)) { - SET_by_offset(disp, _gloffset_GetnMapdvARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnMapfvARB)(GLenum, GLenum, GLsizei, GLfloat *); -#define CALL_GetnMapfvARB(disp, parameters) \ - (* GET_GetnMapfvARB(disp)) parameters -static inline _glptr_GetnMapfvARB GET_GetnMapfvARB(struct _glapi_table *disp) { - return (_glptr_GetnMapfvARB) (GET_by_offset(disp, _gloffset_GetnMapfvARB)); -} - -static inline void SET_GetnMapfvARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetnMapfvARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnMapivARB)(GLenum, GLenum, GLsizei, GLint *); -#define CALL_GetnMapivARB(disp, parameters) \ - (* GET_GetnMapivARB(disp)) parameters -static inline _glptr_GetnMapivARB GET_GetnMapivARB(struct _glapi_table *disp) { - return (_glptr_GetnMapivARB) (GET_by_offset(disp, _gloffset_GetnMapivARB)); -} - -static inline void SET_GetnMapivARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLsizei, GLint *)) { - SET_by_offset(disp, _gloffset_GetnMapivARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnMinmaxARB)(GLenum, GLboolean, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_GetnMinmaxARB(disp, parameters) \ - (* GET_GetnMinmaxARB(disp)) parameters -static inline _glptr_GetnMinmaxARB GET_GetnMinmaxARB(struct _glapi_table *disp) { - return (_glptr_GetnMinmaxARB) (GET_by_offset(disp, _gloffset_GetnMinmaxARB)); -} - -static inline void SET_GetnMinmaxARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLboolean, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnMinmaxARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnPixelMapfvARB)(GLenum, GLsizei, GLfloat *); -#define CALL_GetnPixelMapfvARB(disp, parameters) \ - (* GET_GetnPixelMapfvARB(disp)) parameters -static inline _glptr_GetnPixelMapfvARB GET_GetnPixelMapfvARB(struct _glapi_table *disp) { - return (_glptr_GetnPixelMapfvARB) (GET_by_offset(disp, _gloffset_GetnPixelMapfvARB)); -} - -static inline void SET_GetnPixelMapfvARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLfloat *)) { - SET_by_offset(disp, _gloffset_GetnPixelMapfvARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnPixelMapuivARB)(GLenum, GLsizei, GLuint *); -#define CALL_GetnPixelMapuivARB(disp, parameters) \ - (* GET_GetnPixelMapuivARB(disp)) parameters -static inline _glptr_GetnPixelMapuivARB GET_GetnPixelMapuivARB(struct _glapi_table *disp) { - return (_glptr_GetnPixelMapuivARB) (GET_by_offset(disp, _gloffset_GetnPixelMapuivARB)); -} - -static inline void SET_GetnPixelMapuivARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLuint *)) { - SET_by_offset(disp, _gloffset_GetnPixelMapuivARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnPixelMapusvARB)(GLenum, GLsizei, GLushort *); -#define CALL_GetnPixelMapusvARB(disp, parameters) \ - (* GET_GetnPixelMapusvARB(disp)) parameters -static inline _glptr_GetnPixelMapusvARB GET_GetnPixelMapusvARB(struct _glapi_table *disp) { - return (_glptr_GetnPixelMapusvARB) (GET_by_offset(disp, _gloffset_GetnPixelMapusvARB)); -} - -static inline void SET_GetnPixelMapusvARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLushort *)) { - SET_by_offset(disp, _gloffset_GetnPixelMapusvARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnPolygonStippleARB)(GLsizei, GLubyte *); -#define CALL_GetnPolygonStippleARB(disp, parameters) \ - (* GET_GetnPolygonStippleARB(disp)) parameters -static inline _glptr_GetnPolygonStippleARB GET_GetnPolygonStippleARB(struct _glapi_table *disp) { - return (_glptr_GetnPolygonStippleARB) (GET_by_offset(disp, _gloffset_GetnPolygonStippleARB)); -} - -static inline void SET_GetnPolygonStippleARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLsizei, GLubyte *)) { - SET_by_offset(disp, _gloffset_GetnPolygonStippleARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnSeparableFilterARB)(GLenum, GLenum, GLenum, GLsizei, GLvoid *, GLsizei, GLvoid *, GLvoid *); -#define CALL_GetnSeparableFilterARB(disp, parameters) \ - (* GET_GetnSeparableFilterARB(disp)) parameters -static inline _glptr_GetnSeparableFilterARB GET_GetnSeparableFilterARB(struct _glapi_table *disp) { - return (_glptr_GetnSeparableFilterARB) (GET_by_offset(disp, _gloffset_GetnSeparableFilterARB)); -} - -static inline void SET_GetnSeparableFilterARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLenum, GLsizei, GLvoid *, GLsizei, GLvoid *, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnSeparableFilterARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_GetnTexImageARB)(GLenum, GLint, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_GetnTexImageARB(disp, parameters) \ - (* GET_GetnTexImageARB(disp)) parameters -static inline _glptr_GetnTexImageARB GET_GetnTexImageARB(struct _glapi_table *disp) { - return (_glptr_GetnTexImageARB) (GET_by_offset(disp, _gloffset_GetnTexImageARB)); -} - -static inline void SET_GetnTexImageARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLint, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_GetnTexImageARB, fn); -} - -typedef void (GLAPIENTRYP _glptr_ReadnPixelsARB)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, GLvoid *); -#define CALL_ReadnPixelsARB(disp, parameters) \ - (* GET_ReadnPixelsARB(disp)) parameters -static inline _glptr_ReadnPixelsARB GET_ReadnPixelsARB(struct _glapi_table *disp) { - return (_glptr_ReadnPixelsARB) (GET_by_offset(disp, _gloffset_ReadnPixelsARB)); -} - -static inline void SET_ReadnPixelsARB(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLsizei, GLvoid *)) { - SET_by_offset(disp, _gloffset_ReadnPixelsARB, fn); -} - typedef void (GLAPIENTRYP _glptr_TexStorage1D)(GLenum, GLsizei, GLenum, GLsizei); #define CALL_TexStorage1D(disp, parameters) \ (* GET_TexStorage1D(disp)) parameters @@ -6288,17 +6031,6 @@ static inline void SET_SecondaryColorPointerEXT(struct _glapi_table *disp, void SET_by_offset(disp, _gloffset_SecondaryColorPointerEXT, fn); } -typedef void (GLAPIENTRYP _glptr_MultiDrawArraysEXT)(GLenum, const GLint *, const GLsizei *, GLsizei); -#define CALL_MultiDrawArraysEXT(disp, parameters) \ - (* GET_MultiDrawArraysEXT(disp)) parameters -static inline _glptr_MultiDrawArraysEXT GET_MultiDrawArraysEXT(struct _glapi_table *disp) { - return (_glptr_MultiDrawArraysEXT) (GET_by_offset(disp, _gloffset_MultiDrawArraysEXT)); -} - -static inline void SET_MultiDrawArraysEXT(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, const GLint *, const GLsizei *, GLsizei)) { - SET_by_offset(disp, _gloffset_MultiDrawArraysEXT, fn); -} - typedef void (GLAPIENTRYP _glptr_FogCoordPointerEXT)(GLenum, GLsizei, const GLvoid *); #define CALL_FogCoordPointerEXT(disp, parameters) \ (* GET_FogCoordPointerEXT(disp)) parameters @@ -7795,16 +7527,5 @@ static inline void SET_TextureBarrierNV(struct _glapi_table *disp, void (GLAPIEN SET_by_offset(disp, _gloffset_TextureBarrierNV, fn); } -typedef void (GLAPIENTRYP _glptr_StencilFuncSeparateATI)(GLenum, GLenum, GLint, GLuint); -#define CALL_StencilFuncSeparateATI(disp, parameters) \ - (* GET_StencilFuncSeparateATI(disp)) parameters -static inline _glptr_StencilFuncSeparateATI GET_StencilFuncSeparateATI(struct _glapi_table *disp) { - return (_glptr_StencilFuncSeparateATI) (GET_by_offset(disp, _gloffset_StencilFuncSeparateATI)); -} - -static inline void SET_StencilFuncSeparateATI(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLenum, GLint, GLuint)) { - SET_by_offset(disp, _gloffset_StencilFuncSeparateATI, fn); -} - #endif /* !defined( _DISPATCH_H_ ) */ diff --git a/reactos/dll/opengl/mesa/main/dlist.c b/reactos/dll/opengl/mesa/main/dlist.c index 3a08b7f12f4..ea19b9b26e3 100644 --- a/reactos/dll/opengl/mesa/main/dlist.c +++ b/reactos/dll/opengl/mesa/main/dlist.c @@ -49,7 +49,6 @@ #include "light.h" #include "macros.h" #include "pack.h" -#include "pbo.h" #include "teximage.h" #include "texstorage.h" #include "mtypes.h" @@ -287,14 +286,8 @@ typedef enum OPCODE_SAMPLE_COVERAGE, /* GL_ARB_window_pos */ OPCODE_WINDOW_POS_ARB, - /* GL_EXT_stencil_two_side */ - OPCODE_ACTIVE_STENCIL_FACE_EXT, /* GL_EXT_depth_bounds_test */ OPCODE_DEPTH_BOUNDS_EXT, - /* OpenGL 2.0 */ - OPCODE_STENCIL_FUNC_SEPARATE, - OPCODE_STENCIL_OP_SEPARATE, - OPCODE_STENCIL_MASK_SEPARATE, /* Vertex attributes -- fallback for when optimized display * list build isn't active. @@ -671,6 +664,8 @@ unpack_image(struct gl_context *ctx, GLuint dimensions, GLenum format, GLenum type, const GLvoid * pixels, const struct gl_pixelstore_attrib *unpack) { + GLvoid *image; + if (width <= 0 || height <= 0) { return NULL; } @@ -680,52 +675,15 @@ unpack_image(struct gl_context *ctx, GLuint dimensions, return NULL; } - if (!_mesa_is_bufferobj(unpack->BufferObj)) { - /* no PBO */ - GLvoid *image; - - if (type == GL_BITMAP) - image = _mesa_unpack_bitmap(width, height, pixels, unpack); - else - image = _mesa_unpack_image(dimensions, width, height, depth, - format, type, pixels, unpack); - if (pixels && !image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction"); - } - return image; + if (type == GL_BITMAP) + image = _mesa_unpack_bitmap(width, height, pixels, unpack); + else + image = _mesa_unpack_image(dimensions, width, height, depth, + format, type, pixels, unpack); + if (pixels && !image) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction"); } - else if (_mesa_validate_pbo_access(dimensions, unpack, width, height, - depth, format, type, INT_MAX, pixels)) { - const GLubyte *map, *src; - GLvoid *image; - - map = (GLubyte *) - ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size, - GL_MAP_READ_BIT, unpack->BufferObj); - if (!map) { - /* unable to map src buffer! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "unable to map PBO"); - return NULL; - } - - src = ADD_POINTERS(map, pixels); - if (type == GL_BITMAP) - image = _mesa_unpack_bitmap(width, height, src, unpack); - else - image = _mesa_unpack_image(dimensions, width, height, depth, - format, type, src, unpack); - - ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj); - - if (!image) { - _mesa_error(ctx, GL_OUT_OF_MEMORY, "display list construction"); - } - return image; - } - - /* bad access! */ - _mesa_error(ctx, GL_INVALID_OPERATION, "invalid PBO access"); - return NULL; + return image; } /** @@ -3326,91 +3284,6 @@ save_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) } -static void GLAPIENTRY -save_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = face; - n[2].e = func; - n[3].i = ref; - n[4].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilFuncSeparate(ctx->Exec, (face, func, ref, mask)); - } -} - - -static void GLAPIENTRY -save_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, - GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - /* GL_FRONT */ - n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = GL_FRONT; - n[2].e = frontfunc; - n[3].i = ref; - n[4].ui = mask; - } - /* GL_BACK */ - n = alloc_instruction(ctx, OPCODE_STENCIL_FUNC_SEPARATE, 4); - if (n) { - n[1].e = GL_BACK; - n[2].e = backfunc; - n[3].i = ref; - n[4].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilFuncSeparate(ctx->Exec, (GL_FRONT, frontfunc, ref, mask)); - CALL_StencilFuncSeparate(ctx->Exec, (GL_BACK, backfunc, ref, mask)); - } -} - - -static void GLAPIENTRY -save_StencilMaskSeparate(GLenum face, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_STENCIL_MASK_SEPARATE, 2); - if (n) { - n[1].e = face; - n[2].ui = mask; - } - if (ctx->ExecuteFlag) { - CALL_StencilMaskSeparate(ctx->Exec, (face, mask)); - } -} - - -static void GLAPIENTRY -save_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_STENCIL_OP_SEPARATE, 4); - if (n) { - n[1].e = face; - n[2].e = fail; - n[3].e = zfail; - n[4].e = zpass; - } - if (ctx->ExecuteFlag) { - CALL_StencilOpSeparate(ctx->Exec, (face, fail, zfail, zpass)); - } -} - - static void GLAPIENTRY save_TexEnvfv(GLenum target, GLenum pname, const GLfloat *params) { @@ -4130,24 +4003,6 @@ save_ProgramNamedParameter4dvNV(GLuint id, GLsizei len, const GLubyte * name, #endif - -/* GL_EXT_stencil_two_side */ -static void GLAPIENTRY -save_ActiveStencilFaceEXT(GLenum face) -{ - GET_CURRENT_CONTEXT(ctx); - Node *n; - ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx); - n = alloc_instruction(ctx, OPCODE_ACTIVE_STENCIL_FACE_EXT, 1); - if (n) { - n[1].e = face; - } - if (ctx->ExecuteFlag) { - CALL_ActiveStencilFaceEXT(ctx->Exec, (face)); - } -} - - /* GL_EXT_depth_bounds_test */ static void GLAPIENTRY save_DepthBoundsEXT(GLclampd zmin, GLclampd zmax) @@ -5425,17 +5280,6 @@ execute_list(struct gl_context *ctx, GLuint list) case OPCODE_STENCIL_OP: CALL_StencilOp(ctx->Exec, (n[1].e, n[2].e, n[3].e)); break; - case OPCODE_STENCIL_FUNC_SEPARATE: - CALL_StencilFuncSeparate(ctx->Exec, - (n[1].e, n[2].e, n[3].i, n[4].ui)); - break; - case OPCODE_STENCIL_MASK_SEPARATE: - CALL_StencilMaskSeparate(ctx->Exec, (n[1].e, n[2].ui)); - break; - case OPCODE_STENCIL_OP_SEPARATE: - CALL_StencilOpSeparate(ctx->Exec, - (n[1].e, n[2].e, n[3].e, n[4].e)); - break; case OPCODE_TEXENV: { GLfloat params[4]; @@ -5595,9 +5439,6 @@ execute_list(struct gl_context *ctx, GLuint list) break; #endif - case OPCODE_ACTIVE_STENCIL_FACE_EXT: - CALL_ActiveStencilFaceEXT(ctx->Exec, (n[1].e)); - break; case OPCODE_DEPTH_BOUNDS_EXT: CALL_DepthBoundsEXT(ctx->Exec, (n[1].f, n[2].f)); break; @@ -6666,16 +6507,6 @@ exec_FogCoordPointerEXT(GLenum type, GLsizei stride, const GLvoid *ptr) CALL_FogCoordPointerEXT(ctx->Exec, (type, stride, ptr)); } -/* GL_EXT_multi_draw_arrays */ -static void GLAPIENTRY -exec_MultiDrawArraysEXT(GLenum mode, const GLint *first, - const GLsizei *count, GLsizei primcount) -{ - GET_CURRENT_CONTEXT(ctx); - FLUSH_VERTICES(ctx, 0); - CALL_MultiDrawArraysEXT(ctx->Exec, (mode, first, count, primcount)); -} - /* GL_IBM_multimode_draw_arrays */ static void GLAPIENTRY exec_MultiModeDrawArraysIBM(const GLenum * mode, const GLint * first, @@ -6930,14 +6761,6 @@ _mesa_create_save_table(void) SET_TexImage3D(table, save_TexImage3D); SET_TexSubImage3D(table, save_TexSubImage3D); - /* GL 2.0 */ - SET_StencilFuncSeparate(table, save_StencilFuncSeparate); - SET_StencilMaskSeparate(table, save_StencilMaskSeparate); - SET_StencilOpSeparate(table, save_StencilOpSeparate); - - /* ATI_separate_stencil */ - SET_StencilFuncSeparateATI(table, save_StencilFuncSeparateATI); - /* GL_ARB_imaging */ /* Not all are supported */ SET_BlendColor(table, save_BlendColor); @@ -7023,9 +6846,6 @@ _mesa_create_save_table(void) /* 145. GL_EXT_secondary_color */ SET_SecondaryColorPointerEXT(table, exec_SecondaryColorPointerEXT); - /* 148. GL_EXT_multi_draw_arrays */ - SET_MultiDrawArraysEXT(table, exec_MultiDrawArraysEXT); - /* 149. GL_EXT_fog_coord */ SET_FogCoordPointerEXT(table, exec_FogCoordPointerEXT); @@ -7096,9 +6916,6 @@ _mesa_create_save_table(void) SET_PointParameteriNV(table, save_PointParameteriNV); SET_PointParameterivNV(table, save_PointParameterivNV); - /* 268. GL_EXT_stencil_two_side */ - SET_ActiveStencilFaceEXT(table, save_ActiveStencilFaceEXT); - /* 273. GL_APPLE_vertex_array_object */ SET_BindVertexArrayAPPLE(table, _mesa_BindVertexArrayAPPLE); SET_DeleteVertexArraysAPPLE(table, _mesa_DeleteVertexArraysAPPLE); @@ -7505,8 +7322,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->DrawArrays = 0; vfmt->DrawElements = 0; vfmt->DrawRangeElements = 0; - vfmt->MultiDrawElemementsEXT = 0; - vfmt->MultiDrawElemementsBaseVertex = 0; #endif } diff --git a/reactos/dll/opengl/mesa/main/drawpix.c b/reactos/dll/opengl/mesa/main/drawpix.c index 13bf07bb11f..c18b9362294 100644 --- a/reactos/dll/opengl/mesa/main/drawpix.c +++ b/reactos/dll/opengl/mesa/main/drawpix.c @@ -32,7 +32,6 @@ #include "framebuffer.h" #include "image.h" #include "mfeatures.h" -#include "pbo.h" #include "readpix.h" #include "state.h" #include "dispatch.h" @@ -107,22 +106,6 @@ _mesa_DrawPixels( GLsizei width, GLsizei height, GLint x = IROUND(ctx->Current.RasterPos[0]); GLint y = IROUND(ctx->Current.RasterPos[1]); - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - /* unpack from PBO */ - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, - 1, format, type, INT_MAX, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(invalid PBO access)"); - return; - } - if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawPixels(PBO is mapped)"); - return; - } - } - ctx->Driver.DrawPixels(ctx, x, y, width, height, format, type, &ctx->Unpack, pixels); } @@ -254,23 +237,6 @@ _mesa_Bitmap( GLsizei width, GLsizei height, GLint x = IFLOOR(ctx->Current.RasterPos[0] + epsilon - xorig); GLint y = IFLOOR(ctx->Current.RasterPos[1] + epsilon - yorig); - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - /* unpack from PBO */ - if (!_mesa_validate_pbo_access(2, &ctx->Unpack, width, height, - 1, GL_COLOR_INDEX, GL_BITMAP, - INT_MAX, (const GLvoid *) bitmap)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBitmap(invalid PBO access)"); - return; - } - if (_mesa_bufferobj_mapped(ctx->Unpack.BufferObj)) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, - "glBitmap(PBO is mapped)"); - return; - } - } - ctx->Driver.Bitmap( ctx, x, y, width, height, &ctx->Unpack, bitmap ); } } diff --git a/reactos/dll/opengl/mesa/main/enable.c b/reactos/dll/opengl/mesa/main/enable.c index 43678922d67..78d0f39435f 100644 --- a/reactos/dll/opengl/mesa/main/enable.c +++ b/reactos/dll/opengl/mesa/main/enable.c @@ -694,22 +694,6 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state) ctx->Point.PointSprite = state; break; - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side, cap); - if (ctx->Stencil.TestTwoSide == state) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.TestTwoSide = state; - if (state) { - ctx->Stencil._BackFace = 2; - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; - } else { - ctx->Stencil._BackFace = 1; - ctx->_TriangleCaps &= ~DD_TRI_TWOSTENCIL; - } - break; - /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test, cap); @@ -991,11 +975,6 @@ _mesa_IsEnabled( GLenum cap ) CHECK_EXTENSION2(NV_point_sprite, ARB_point_sprite) return ctx->Point.PointSprite; - /* GL_EXT_stencil_two_side */ - case GL_STENCIL_TEST_TWO_SIDE_EXT: - CHECK_EXTENSION(EXT_stencil_two_side); - return ctx->Stencil.TestTwoSide; - /* GL_EXT_depth_bounds_test */ case GL_DEPTH_BOUNDS_TEST_EXT: CHECK_EXTENSION(EXT_depth_bounds_test); diff --git a/reactos/dll/opengl/mesa/main/eval.c b/reactos/dll/opengl/mesa/main/eval.c index add35877260..a70897bcfcf 100644 --- a/reactos/dll/opengl/mesa/main/eval.c +++ b/reactos/dll/opengl/mesa/main/eval.c @@ -495,7 +495,7 @@ _mesa_Map2d( GLenum target, static void GLAPIENTRY -_mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v ) +_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) { GET_CURRENT_CONTEXT(ctx); struct gl_1d_map *map1d; @@ -503,7 +503,6 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v ) GLint i, n; GLfloat *data; GLuint comps; - GLsizei numBytes; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -528,9 +527,6 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v ) n = map2d->Uorder * map2d->Vorder * comps; } if (data) { - numBytes = n * sizeof *v; - if (bufSize < numBytes) - goto overflow; for (i=0;iOrder; } else { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = (GLdouble) map2d->Uorder; v[1] = (GLdouble) map2d->Vorder; } break; case GL_DOMAIN: if (map1d) { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = (GLdouble) map1d->u1; v[1] = (GLdouble) map1d->u2; } else { - numBytes = 4 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = (GLdouble) map2d->u1; v[1] = (GLdouble) map2d->u2; v[2] = (GLdouble) map2d->v1; @@ -573,21 +557,10 @@ _mesa_GetnMapdvARB( GLenum target, GLenum query, GLsizei bufSize, GLdouble *v ) _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapdv(query)" ); } return; - -overflow: - _mesa_error( ctx, GL_INVALID_OPERATION, - "glGetnMapdvARB(out of bounds: bufSize is %d," - " but %d bytes are required)", bufSize, numBytes ); } static void GLAPIENTRY -_mesa_GetMapdv( GLenum target, GLenum query, GLdouble *v ) -{ - _mesa_GetnMapdvARB(target, query, INT_MAX, v); -} - -static void GLAPIENTRY -_mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v ) +_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) { GET_CURRENT_CONTEXT(ctx); struct gl_1d_map *map1d; @@ -595,7 +568,6 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v ) GLint i, n; GLfloat *data; GLuint comps; - GLsizei numBytes; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -620,9 +592,6 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v ) n = map2d->Uorder * map2d->Vorder * comps; } if (data) { - numBytes = n * sizeof *v; - if (bufSize < numBytes) - goto overflow; for (i=0;iOrder; } else { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = (GLfloat) map2d->Uorder; v[1] = (GLfloat) map2d->Vorder; } break; case GL_DOMAIN: if (map1d) { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = map1d->u1; v[1] = map1d->u2; } else { - numBytes = 4 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = map2d->u1; v[1] = map2d->u2; v[2] = map2d->v1; @@ -665,23 +622,11 @@ _mesa_GetnMapfvARB( GLenum target, GLenum query, GLsizei bufSize, GLfloat *v ) _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapfv(query)" ); } return; - -overflow: - _mesa_error( ctx, GL_INVALID_OPERATION, - "glGetnMapfvARB(out of bounds: bufSize is %d," - " but %d bytes are required)", bufSize, numBytes ); } static void GLAPIENTRY -_mesa_GetMapfv( GLenum target, GLenum query, GLfloat *v ) -{ - _mesa_GetnMapfvARB(target, query, INT_MAX, v); -} - - -static void GLAPIENTRY -_mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) +_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) { GET_CURRENT_CONTEXT(ctx); struct gl_1d_map *map1d; @@ -689,7 +634,6 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) GLuint i, n; GLfloat *data; GLuint comps; - GLsizei numBytes; ASSERT_OUTSIDE_BEGIN_END(ctx); @@ -714,9 +658,6 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) n = map2d->Uorder * map2d->Vorder * comps; } if (data) { - numBytes = n * sizeof *v; - if (bufSize < numBytes) - goto overflow; for (i=0;iOrder; } else { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = map2d->Uorder; v[1] = map2d->Vorder; } break; case GL_DOMAIN: if (map1d) { - numBytes = 2 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = IROUND(map1d->u1); v[1] = IROUND(map1d->u2); } else { - numBytes = 4 * sizeof *v; - if (bufSize < numBytes) - goto overflow; v[0] = IROUND(map2d->u1); v[1] = IROUND(map2d->u2); v[2] = IROUND(map2d->v1); @@ -759,18 +688,6 @@ _mesa_GetnMapivARB( GLenum target, GLenum query, GLsizei bufSize, GLint *v ) _mesa_error( ctx, GL_INVALID_ENUM, "glGetMapiv(query)" ); } return; - -overflow: - _mesa_error( ctx, GL_INVALID_OPERATION, - "glGetnMapivARB(out of bounds: bufSize is %d," - " but %d bytes are required)", bufSize, numBytes ); -} - - -static void GLAPIENTRY -_mesa_GetMapiv( GLenum target, GLenum query, GLint *v ) -{ - _mesa_GetnMapivARB(target, query, INT_MAX, v); } @@ -866,11 +783,6 @@ _mesa_init_eval_dispatch(struct _glapi_table *disp) SET_MapGrid1f(disp, _mesa_MapGrid1f); SET_MapGrid2d(disp, _mesa_MapGrid2d); SET_MapGrid2f(disp, _mesa_MapGrid2f); - - /* GL_ARB_robustness */ - SET_GetnMapdvARB(disp, _mesa_GetnMapdvARB); - SET_GetnMapfvARB(disp, _mesa_GetnMapfvARB); - SET_GetnMapivARB(disp, _mesa_GetnMapivARB); } diff --git a/reactos/dll/opengl/mesa/main/extensions.c b/reactos/dll/opengl/mesa/main/extensions.c index 079dc525adf..0b781e4009b 100644 --- a/reactos/dll/opengl/mesa/main/extensions.c +++ b/reactos/dll/opengl/mesa/main/extensions.c @@ -71,12 +71,8 @@ static const struct extension extension_table[] = { { "GL_ARB_half_float_vertex", o(ARB_half_float_vertex), 2008 }, { "GL_ARB_map_buffer_range", o(ARB_map_buffer_range), 2008 }, { "GL_ARB_multisample", o(dummy_true), 1994 }, - { "GL_ARB_multitexture", o(dummy_true), 1998 }, - { "GL_ARB_pixel_buffer_object", o(EXT_pixel_buffer_object), 2004 }, { "GL_ARB_point_parameters", o(EXT_point_parameters), 1997 }, { "GL_ARB_point_sprite", o(ARB_point_sprite), 2003 }, - { "GL_ARB_robustness", o(dummy_true), 2010 }, - { "GL_ARB_texture_border_clamp", o(ARB_texture_border_clamp), 2000 }, { "GL_ARB_texture_cube_map", o(ARB_texture_cube_map), 1999 }, { "GL_ARB_texture_env_add", o(dummy_true), 1999 }, { "GL_ARB_texture_env_combine", o(ARB_texture_env_combine), 2001 }, @@ -104,9 +100,7 @@ static const struct extension extension_table[] = { { "GL_EXT_depth_bounds_test", o(EXT_depth_bounds_test), 2002 }, { "GL_EXT_draw_range_elements", o(EXT_draw_range_elements), 1997 }, { "GL_EXT_fog_coord", o(EXT_fog_coord), 1999 }, - { "GL_EXT_multi_draw_arrays", o(dummy_true), 1999 }, { "GL_EXT_packed_pixels", o(EXT_packed_pixels), 1997 }, - { "GL_EXT_pixel_buffer_object", o(EXT_pixel_buffer_object), 2004 }, { "GL_EXT_point_parameters", o(EXT_point_parameters), 1997 }, { "GL_EXT_polygon_offset", o(dummy_true), 1995 }, { "GL_EXT_rescale_normal", o(EXT_rescale_normal), 1997 }, @@ -114,18 +108,15 @@ static const struct extension extension_table[] = { { "GL_EXT_separate_shader_objects", o(EXT_separate_shader_objects), 2008 }, { "GL_EXT_separate_specular_color", o(EXT_separate_specular_color), 1997 }, { "GL_EXT_shadow_funcs", o(EXT_shadow_funcs), 2002 }, - { "GL_EXT_stencil_two_side", o(EXT_stencil_two_side), 2001 }, { "GL_EXT_stencil_wrap", o(dummy_true), 2002 }, { "GL_EXT_subtexture", o(dummy_true), 1995 }, { "GL_EXT_texture3D", o(EXT_texture3D), 1996 }, { "GL_EXT_texture_cube_map", o(ARB_texture_cube_map), 2001 }, - { "GL_EXT_texture_edge_clamp", o(dummy_true), 1997 }, { "GL_EXT_texture_env_add", o(dummy_true), 1999 }, { "GL_EXT_texture_env_combine", o(dummy_true), 2000 }, { "GL_EXT_texture_env_dot3", o(EXT_texture_env_dot3), 2000 }, { "GL_EXT_texture_filter_anisotropic", o(EXT_texture_filter_anisotropic), 1999 }, { "GL_EXT_texture_integer", o(EXT_texture_integer), 2006 }, - { "GL_EXT_texture_mirror_clamp", o(EXT_texture_mirror_clamp), 2004 }, { "GL_EXT_texture_object", o(dummy_true), 1995 }, { "GL_EXT_texture", o(dummy_true), 1996 }, { "GL_EXT_vertex_array", o(dummy_true), 1995 }, @@ -135,10 +126,8 @@ static const struct extension extension_table[] = { { "GL_APPLE_packed_pixels", o(APPLE_packed_pixels), 2002 }, { "GL_APPLE_vertex_array_object", o(APPLE_vertex_array_object), 2002 }, { "GL_ATI_blend_equation_separate", o(EXT_blend_equation_separate), 2003 }, - { "GL_ATI_separate_stencil", o(ATI_separate_stencil), 2006 }, { "GL_ATI_texture_env_combine3", o(ATI_texture_env_combine3), 2002 }, { "GL_ATI_texture_float", o(ARB_texture_float), 2002 }, - { "GL_ATI_texture_mirror_once", o(ATI_texture_mirror_once), 2006 }, { "GL_IBM_multimode_draw_arrays", o(IBM_multimode_draw_arrays), 1998 }, { "GL_IBM_rasterpos_clip", o(IBM_rasterpos_clip), 1996 }, { "GL_IBM_texture_mirrored_repeat", o(dummy_true), 1998 }, @@ -154,9 +143,6 @@ static const struct extension extension_table[] = { { "GL_NV_texgen_reflection", o(NV_texgen_reflection), 1999 }, { "GL_NV_texture_barrier", o(NV_texture_barrier), 2009 }, { "GL_NV_texture_env_combine4", o(NV_texture_env_combine4), 1999 }, - { "GL_SGIS_texture_border_clamp", o(ARB_texture_border_clamp), 1997 }, - { "GL_SGIS_texture_edge_clamp", o(dummy_true), 1997 }, - { "GL_SUN_multi_draw_arrays", o(dummy_true), 1999 }, { 0, 0, 0}, }; @@ -227,7 +213,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.ARB_half_float_vertex = GL_TRUE; ctx->Extensions.ARB_map_buffer_range = GL_TRUE; ctx->Extensions.ARB_point_sprite = 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; ctx->Extensions.ARB_texture_env_crossbar = GL_TRUE; @@ -241,24 +226,17 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) ctx->Extensions.APPLE_object_purgeable = GL_TRUE; #endif ctx->Extensions.ATI_texture_env_combine3 = GL_TRUE; - ctx->Extensions.ATI_texture_mirror_once = GL_TRUE; - ctx->Extensions.ATI_separate_stencil = GL_TRUE; ctx->Extensions.EXT_blend_color = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; ctx->Extensions.EXT_blend_func_separate = GL_TRUE; ctx->Extensions.EXT_blend_minmax = GL_TRUE; ctx->Extensions.EXT_depth_bounds_test = GL_TRUE; ctx->Extensions.EXT_fog_coord = GL_TRUE; -#if FEATURE_EXT_pixel_buffer_object - ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif ctx->Extensions.EXT_point_parameters = GL_TRUE; ctx->Extensions.EXT_shadow_funcs = GL_TRUE; ctx->Extensions.EXT_secondary_color = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE; ctx->Extensions.EXT_texture_filter_anisotropic = GL_TRUE; - ctx->Extensions.EXT_texture_mirror_clamp = GL_TRUE; /*ctx->Extensions.IBM_multimode_draw_arrays = GL_TRUE;*/ ctx->Extensions.MESA_pack_invert = GL_TRUE; ctx->Extensions.MESA_resize_buffers = GL_TRUE; @@ -281,7 +259,6 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) void _mesa_enable_1_3_extensions(struct gl_context *ctx) { - ctx->Extensions.ARB_texture_border_clamp = GL_TRUE; ctx->Extensions.ARB_texture_cube_map = GL_TRUE; ctx->Extensions.ARB_texture_env_combine = GL_TRUE; ctx->Extensions.ARB_texture_env_dot3 = GL_TRUE; @@ -329,7 +306,6 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx) ctx->Extensions.ARB_point_sprite = GL_TRUE; ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; ctx->Extensions.ARB_texture_non_power_of_two = GL_TRUE; - ctx->Extensions.EXT_stencil_two_side = GL_TRUE; } @@ -340,9 +316,6 @@ _mesa_enable_2_0_extensions(struct gl_context *ctx) void _mesa_enable_2_1_extensions(struct gl_context *ctx) { -#if FEATURE_EXT_pixel_buffer_object - ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE; -#endif } diff --git a/reactos/dll/opengl/mesa/main/get.c b/reactos/dll/opengl/mesa/main/get.c index 1cd04aa4b00..79730d76e1d 100644 --- a/reactos/dll/opengl/mesa/main/get.c +++ b/reactos/dll/opengl/mesa/main/get.c @@ -270,12 +270,10 @@ EXTRA_EXT(NV_fog_distance); EXTRA_EXT(EXT_texture_filter_anisotropic); EXTRA_EXT(IBM_rasterpos_clip); EXTRA_EXT(NV_point_sprite); -EXTRA_EXT(EXT_stencil_two_side); EXTRA_EXT(NV_light_max_exponent); EXTRA_EXT(EXT_depth_bounds_test); EXTRA_EXT(APPLE_vertex_array_object); EXTRA_EXT(EXT_compiled_vertex_array); -EXTRA_EXT(EXT_pixel_buffer_object); EXTRA_EXT2(NV_point_sprite, ARB_point_sprite); static const int extra_version_30[] = { EXTRA_VERSION_30, EXTRA_END }; @@ -524,15 +522,6 @@ static const struct value_desc values[] = { { GL_BLEND_COLOR_EXT, LOC_CUSTOM, TYPE_FLOATN_4, 0, NO_EXTRA }, - /* OpenGL 2.0 */ - { GL_STENCIL_BACK_FUNC, CONTEXT_ENUM(Stencil.Function[1]), NO_EXTRA }, - { GL_STENCIL_BACK_VALUE_MASK, CONTEXT_INT(Stencil.ValueMask[1]), NO_EXTRA }, - { GL_STENCIL_BACK_WRITEMASK, CONTEXT_INT(Stencil.WriteMask[1]), NO_EXTRA }, - { GL_STENCIL_BACK_REF, CONTEXT_INT(Stencil.Ref[1]), NO_EXTRA }, - { GL_STENCIL_BACK_FAIL, CONTEXT_ENUM(Stencil.FailFunc[1]), NO_EXTRA }, - { GL_STENCIL_BACK_PASS_DEPTH_FAIL, CONTEXT_ENUM(Stencil.ZFailFunc[1]), NO_EXTRA }, - { GL_STENCIL_BACK_PASS_DEPTH_PASS, CONTEXT_ENUM(Stencil.ZPassFunc[1]), NO_EXTRA }, - /* OES_texture_3D */ { GL_TEXTURE_BINDING_3D, LOC_CUSTOM, TYPE_INT, TEXTURE_3D_INDEX, NO_EXTRA }, { GL_MAX_3D_TEXTURE_SIZE, LOC_CUSTOM, TYPE_INT, @@ -748,11 +737,6 @@ static const struct value_desc values[] = { { GL_POINT_SPRITE_COORD_ORIGIN, CONTEXT_ENUM(Point.SpriteOrigin), extra_NV_point_sprite_ARB_point_sprite }, - /* GL_EXT_stencil_two_side */ - { GL_STENCIL_TEST_TWO_SIDE_EXT, CONTEXT_BOOL(Stencil.TestTwoSide), - extra_EXT_stencil_two_side }, - { GL_ACTIVE_STENCIL_FACE_EXT, LOC_CUSTOM, TYPE_ENUM, NO_OFFSET, NO_EXTRA }, - /* GL_NV_light_max_exponent */ { GL_MAX_SHININESS_NV, CONTEXT_FLOAT(Const.MaxShininess), extra_NV_light_max_exponent }, @@ -769,12 +753,6 @@ static const struct value_desc values[] = { { GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB, LOC_CUSTOM, TYPE_INT, offsetof(struct gl_array_object, VertexAttrib[VERT_ATTRIB_FOG].BufferObj), NO_EXTRA }, - /* GL_EXT_pixel_buffer_object */ - { GL_PIXEL_PACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0, - extra_EXT_pixel_buffer_object }, - { GL_PIXEL_UNPACK_BUFFER_BINDING_EXT, LOC_CUSTOM, TYPE_INT, 0, - extra_EXT_pixel_buffer_object }, - /* GL_EXT_depth_bounds_test */ { GL_DEPTH_BOUNDS_TEST_EXT, CONTEXT_BOOL(Depth.BoundsTest), extra_EXT_depth_bounds_test }, @@ -799,9 +777,6 @@ static const struct value_desc values[] = { /* GL 3.2 */ { GL_CONTEXT_PROFILE_MASK, CONTEXT_INT(Const.ProfileMask), extra_version_32 }, - - /* GL_ARB_robustness */ - { GL_RESET_NOTIFICATION_STRATEGY_ARB, CONTEXT_ENUM(Const.ResetStrategy), NO_EXTRA }, }; /* All we need now is a way to look up the value struct from the enum. @@ -1018,30 +993,26 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int_4[3] = ctx->Viewport.Height; break; - case GL_ACTIVE_STENCIL_FACE_EXT: - v->value_enum = ctx->Stencil.ActiveFace ? GL_BACK : GL_FRONT; - break; - case GL_STENCIL_FAIL: - v->value_enum = ctx->Stencil.FailFunc[ctx->Stencil.ActiveFace]; + v->value_enum = ctx->Stencil.FailFunc; break; case GL_STENCIL_FUNC: - v->value_enum = ctx->Stencil.Function[ctx->Stencil.ActiveFace]; + v->value_enum = ctx->Stencil.Function; break; case GL_STENCIL_PASS_DEPTH_FAIL: - v->value_enum = ctx->Stencil.ZFailFunc[ctx->Stencil.ActiveFace]; + v->value_enum = ctx->Stencil.ZFailFunc; break; case GL_STENCIL_PASS_DEPTH_PASS: - v->value_enum = ctx->Stencil.ZPassFunc[ctx->Stencil.ActiveFace]; + v->value_enum = ctx->Stencil.ZPassFunc; break; case GL_STENCIL_REF: - v->value_int = ctx->Stencil.Ref[ctx->Stencil.ActiveFace]; + v->value_int = ctx->Stencil.Ref; break; case GL_STENCIL_VALUE_MASK: - v->value_int = ctx->Stencil.ValueMask[ctx->Stencil.ActiveFace]; + v->value_int = ctx->Stencil.ValueMask; break; case GL_STENCIL_WRITEMASK: - v->value_int = ctx->Stencil.WriteMask[ctx->Stencil.ActiveFace]; + v->value_int = ctx->Stencil.WriteMask; break; case GL_NUM_EXTENSIONS: @@ -1096,16 +1067,6 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu v->value_int = ctx->Array.ArrayObj->ElementArrayBufferObj->Name; break; - case GL_PIXEL_PACK_BUFFER_BINDING_EXT: - v->value_int = ctx->Pack.BufferObj->Name; - break; - case GL_PIXEL_UNPACK_BUFFER_BINDING_EXT: - v->value_int = ctx->Unpack.BufferObj->Name; - break; - case GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES: - v->value_int = ctx->Array.ArrayObj->VertexAttrib[VERT_ATTRIB_POINT_SIZE].BufferObj->Name; - break; - case GL_FOG_COLOR: COPY_4FV(v->value_float_4, ctx->Fog.Color); break; diff --git a/reactos/dll/opengl/mesa/main/get.h b/reactos/dll/opengl/mesa/main/get.h index b26cdd32cde..5e7a59c224c 100644 --- a/reactos/dll/opengl/mesa/main/get.h +++ b/reactos/dll/opengl/mesa/main/get.h @@ -68,8 +68,4 @@ _mesa_GetStringi(GLenum name, GLuint index); extern GLenum GLAPIENTRY _mesa_GetError( void ); -/* GL_ARB_robustness */ -extern GLenum GLAPIENTRY -_mesa_GetGraphicsResetStatusARB( void ); - #endif diff --git a/reactos/dll/opengl/mesa/main/getstring.c b/reactos/dll/opengl/mesa/main/getstring.c index f69fe2aafad..76f7361e23c 100644 --- a/reactos/dll/opengl/mesa/main/getstring.c +++ b/reactos/dll/opengl/mesa/main/getstring.c @@ -195,20 +195,3 @@ _mesa_GetError( void ) ctx->ErrorDebugCount = 0; return e; } - -/** - * Returns an error code specified by GL_ARB_robustness, or GL_NO_ERROR. - * \return current context status - */ -GLenum GLAPIENTRY -_mesa_GetGraphicsResetStatusARB( void ) -{ - GET_CURRENT_CONTEXT(ctx); - GLenum status = ctx->ResetStatus; - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glGetGraphicsResetStatusARB" - "(always returns GL_NO_ERROR)\n"); - - return status; -} diff --git a/reactos/dll/opengl/mesa/main/histogram.c b/reactos/dll/opengl/mesa/main/histogram.c index 44fc1325ceb..d603fdc3393 100644 --- a/reactos/dll/opengl/mesa/main/histogram.c +++ b/reactos/dll/opengl/mesa/main/histogram.c @@ -44,8 +44,8 @@ static void GLAPIENTRY _mesa_ResetMinmax(GLenum target); static void GLAPIENTRY -_mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLsizei bufSize, GLvoid *values) +_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -54,16 +54,8 @@ _mesa_GetnMinmaxARB(GLenum target, GLboolean reset, GLenum format, static void GLAPIENTRY -_mesa_GetMinmax(GLenum target, GLboolean reset, GLenum format, GLenum type, - GLvoid *values) -{ - _mesa_GetnMinmaxARB(target, reset, format, type, INT_MAX, values); -} - - -static void GLAPIENTRY -_mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format, - GLenum type, GLsizei bufSize, GLvoid *values) +_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, + GLenum type, GLvoid *values) { GET_CURRENT_CONTEXT(ctx); @@ -71,14 +63,6 @@ _mesa_GetnHistogramARB(GLenum target, GLboolean reset, GLenum format, } -static void GLAPIENTRY -_mesa_GetHistogram(GLenum target, GLboolean reset, GLenum format, GLenum type, - GLvoid *values) -{ - _mesa_GetnHistogramARB(target, reset, format, type, INT_MAX, values); -} - - static void GLAPIENTRY _mesa_GetHistogramParameterfv(GLenum target, GLenum pname, GLfloat *params) { @@ -164,10 +148,6 @@ _mesa_init_histogram_dispatch(struct _glapi_table *disp) SET_Minmax(disp, _mesa_Minmax); SET_ResetHistogram(disp, _mesa_ResetHistogram); SET_ResetMinmax(disp, _mesa_ResetMinmax); - - /* GL_ARB_robustness */ - SET_GetnHistogramARB(disp, _mesa_GetnHistogramARB); - SET_GetnMinmaxARB(disp, _mesa_GetnMinmaxARB); } #endif /* FEATURE_histogram */ diff --git a/reactos/dll/opengl/mesa/main/mtypes.h b/reactos/dll/opengl/mesa/main/mtypes.h index 12bcd709fdc..7cc01fef843 100644 --- a/reactos/dll/opengl/mesa/main/mtypes.h +++ b/reactos/dll/opengl/mesa/main/mtypes.h @@ -809,34 +809,18 @@ struct gl_scissor_attrib /** * Stencil attribute group (GL_STENCIL_BUFFER_BIT). * - * Three sets of stencil data are tracked so that OpenGL 2.0, - * GL_EXT_stencil_two_side, and GL_ATI_separate_stencil can all be supported - * simultaneously. In each of the stencil state arrays, element 0 corresponds - * to GL_FRONT. Element 1 corresponds to the OpenGL 2.0 / - * GL_ATI_separate_stencil GL_BACK state. Element 2 corresponds to the - * GL_EXT_stencil_two_side GL_BACK state. - * - * The derived value \c _BackFace is either 1 or 2 depending on whether or - * not GL_STENCIL_TEST_TWO_SIDE_EXT is enabled. - * - * The derived value \c _TestTwoSide is set when the front-face and back-face - * stencil state are different. */ struct gl_stencil_attrib { GLboolean Enabled; /**< Enabled flag */ - GLboolean TestTwoSide; /**< GL_EXT_stencil_two_side */ - GLubyte ActiveFace; /**< GL_EXT_stencil_two_side (0 or 2) */ GLboolean _Enabled; /**< Enabled and stencil buffer present */ - GLboolean _TestTwoSide; - GLubyte _BackFace; /**< Current back stencil state (1 or 2) */ - GLenum Function[3]; /**< Stencil function */ - GLenum FailFunc[3]; /**< Fail function */ - GLenum ZPassFunc[3]; /**< Depth buffer pass function */ - GLenum ZFailFunc[3]; /**< Depth buffer fail function */ - GLint Ref[3]; /**< Reference value */ - GLuint ValueMask[3]; /**< Value mask */ - GLuint WriteMask[3]; /**< Write mask */ + GLenum Function; /**< Stencil function */ + GLenum FailFunc; /**< Fail function */ + GLenum ZPassFunc; /**< Depth buffer pass function */ + GLenum ZFailFunc; /**< Depth buffer fail function */ + GLint Ref; /**< Reference value */ + GLuint ValueMask; /**< Value mask */ + GLuint WriteMask; /**< Write mask */ GLuint Clear; /**< Clear value */ }; @@ -1185,7 +1169,6 @@ struct gl_pixelstore_attrib GLboolean SwapBytes; GLboolean LsbFirst; GLboolean Invert; /**< GL_MESA_pack_invert */ - struct gl_buffer_object *BufferObj; /**< GL_ARB_pixel_buffer_object */ }; @@ -1569,9 +1552,6 @@ struct gl_constants /** OpenGL version 3.2 */ GLbitfield ProfileMask; /**< Mask of CONTEXT_x_PROFILE_BIT */ - /* GL_ARB_robustness */ - GLenum ResetStrategy; - /** * Whether the implementation strips out and ignores texture borders. * @@ -1601,7 +1581,6 @@ struct gl_extensions GLboolean ARB_half_float_vertex; GLboolean ARB_map_buffer_range; GLboolean ARB_point_sprite; - GLboolean ARB_texture_border_clamp; GLboolean ARB_texture_cube_map; GLboolean ARB_texture_env_combine; GLboolean ARB_texture_env_crossbar; @@ -1622,26 +1601,21 @@ struct gl_extensions GLboolean EXT_draw_range_elements; GLboolean EXT_fog_coord; GLboolean EXT_packed_pixels; - GLboolean EXT_pixel_buffer_object; GLboolean EXT_point_parameters; GLboolean EXT_rescale_normal; GLboolean EXT_shadow_funcs; GLboolean EXT_secondary_color; GLboolean EXT_separate_shader_objects; GLboolean EXT_separate_specular_color; - GLboolean EXT_stencil_two_side; GLboolean EXT_texture3D; GLboolean EXT_texture_env_dot3; GLboolean EXT_texture_filter_anisotropic; GLboolean EXT_texture_integer; - GLboolean EXT_texture_mirror_clamp; /* vendor extensions */ GLboolean APPLE_packed_pixels; GLboolean APPLE_vertex_array_object; GLboolean APPLE_object_purgeable; - GLboolean ATI_texture_mirror_once; GLboolean ATI_texture_env_combine3; - GLboolean ATI_separate_stencil; GLboolean IBM_rasterpos_clip; GLboolean IBM_multimode_draw_arrays; GLboolean MESA_pack_invert; @@ -1750,7 +1724,6 @@ struct gl_matrix_stack #define DD_LINE_STIPPLE 0x200 #define DD_POINT_SMOOTH 0x400 #define DD_POINT_ATTEN 0x800 -#define DD_TRI_TWOSTENCIL 0x1000 /*@}*/ @@ -1979,9 +1952,6 @@ struct gl_context GLenum ErrorValue; /**< Last error code */ - /* GL_ARB_robustness */ - GLenum ResetStatus; - /** * Recognize and silence repeated error debug messages in buggy apps. */ @@ -1993,8 +1963,6 @@ struct gl_context GLboolean ViewportInitialized; /**< has viewport size been initialized? */ - GLbitfield64 varying_vp_inputs; /**< mask of VERT_BIT_* flags */ - /** \name Derived state */ /*@{*/ /** Bitwise-or of DD_* flags. Note that this bitfield may be used before diff --git a/reactos/dll/opengl/mesa/main/pack.c b/reactos/dll/opengl/mesa/main/pack.c index d681f4e12ed..b6a99d97666 100644 --- a/reactos/dll/opengl/mesa/main/pack.c +++ b/reactos/dll/opengl/mesa/main/pack.c @@ -40,7 +40,6 @@ #include "pixeltransfer.h" #include "imports.h" - /** * Flip the 8 bits in each byte of the given array. * diff --git a/reactos/dll/opengl/mesa/main/pbo.c b/reactos/dll/opengl/mesa/main/pbo.c deleted file mode 100644 index d8fa9191dc5..00000000000 --- a/reactos/dll/opengl/mesa/main/pbo.c +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009-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 - * THE AUTHORS 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 pbo.c - * \brief Functions related to Pixel Buffer Objects. - */ - - - -#include "glheader.h" -#include "bufferobj.h" -#include "image.h" -#include "imports.h" -#include "mtypes.h" -#include "pbo.h" - - - -/** - * When we're about to read pixel data out of a PBO (via glDrawPixels, - * glTexImage, etc) or write data into a PBO (via glReadPixels, - * glGetTexImage, etc) we call this function to check that we're not - * going to read/write out of bounds. - * - * XXX This would also be a convenient time to check that the PBO isn't - * currently mapped. Whoever calls this function should check for that. - * Remember, we can't use a PBO when it's mapped! - * - * If we're not using a PBO, this is a no-op. - * - * \param width width of image to read/write - * \param height height of image to read/write - * \param depth depth of image to read/write - * \param format format of image to read/write - * \param type datatype of image to read/write - * \param clientMemSize the maximum number of bytes to read/write - * \param ptr the user-provided pointer/offset - * \return GL_TRUE if the buffer access is OK, GL_FALSE if the access would - * go out of bounds. - */ -GLboolean -_mesa_validate_pbo_access(GLuint dimensions, - const struct gl_pixelstore_attrib *pack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - const GLvoid *ptr) -{ - /* unsigned, to detect overflow/wrap-around */ - uintptr_t start, end, offset, size; - - /* If no PBO is bound, 'ptr' is a pointer to client memory containing - 'clientMemSize' bytes. - If a PBO is bound, 'ptr' is an offset into the bound PBO. - In that case 'clientMemSize' is ignored: we just use the PBO's size. - */ - if (!_mesa_is_bufferobj(pack->BufferObj)) { - offset = 0; - size = clientMemSize; - } else { - offset = (uintptr_t)ptr; - size = pack->BufferObj->Size; - /* The ARB_pixel_buffer_object spec says: - * "INVALID_OPERATION is generated by ColorTable, ColorSubTable, - * ConvolutionFilter2D, ConvolutionFilter1D, SeparableFilter2D, - * TexImage1D, TexImage2D, TexImage3D, TexSubImage1D, - * TexSubImage2D, TexSubImage3D, and DrawPixels if the current - * PIXEL_UNPACK_BUFFER_BINDING_ARB value is non-zero and the data - * parameter is not evenly divisible into the number of basic machine - * units needed to store in memory a datum indicated by the type - * parameter." - */ - if (type != GL_BITMAP && - (offset % _mesa_sizeof_packed_type(type))) - return GL_FALSE; - } - - if (size == 0) - /* no buffer! */ - return GL_FALSE; - - /* get the offset to the first pixel we'll read/write */ - start = _mesa_image_offset(dimensions, pack, width, height, - format, type, 0, 0, 0); - - /* get the offset to just past the last pixel we'll read/write */ - end = _mesa_image_offset(dimensions, pack, width, height, - format, type, depth-1, height-1, width); - - start += offset; - end += offset; - - if (start > size) { - /* This will catch negative values / wrap-around */ - return GL_FALSE; - } - if (end > size) { - /* Image read/write goes beyond end of buffer */ - return GL_FALSE; - } - - /* OK! */ - return GL_TRUE; -} - - -/** - * For commands that read from a PBO (glDrawPixels, glTexImage, - * glPolygonStipple, etc), if we're reading from a PBO, map it read-only - * and return the pointer into the PBO. If we're not reading from a - * PBO, return \p src as-is. - * If non-null return, must call _mesa_unmap_pbo_source() when done. - * - * \return NULL if error, else pointer to start of data - */ -const GLvoid * -_mesa_map_pbo_source(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *src) -{ - const GLubyte *buf; - - if (_mesa_is_bufferobj(unpack->BufferObj)) { - /* unpack from PBO */ - buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, - unpack->BufferObj->Size, - GL_MAP_READ_BIT, - unpack->BufferObj); - if (!buf) - return NULL; - - buf = ADD_POINTERS(buf, src); - } - else { - /* unpack from normal memory */ - buf = src; - } - - return buf; -} - - -/** - * Combine PBO-read validation and mapping. - * If any GL errors are detected, they'll be recorded and NULL returned. - * \sa _mesa_validate_pbo_access - * \sa _mesa_map_pbo_source - * A call to this function should have a matching call to - * _mesa_unmap_pbo_source(). - */ -const GLvoid * -_mesa_map_validate_pbo_source(struct gl_context *ctx, - GLuint dimensions, - const struct gl_pixelstore_attrib *unpack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - const GLvoid *ptr, const char *where) -{ - ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3); - - if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, - format, type, clientMemSize, ptr)) { - if (_mesa_is_bufferobj(unpack->BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "%s(out of bounds PBO access)", where); - } else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "%s(out of bounds access: bufSize (%d) is too small)", - where, clientMemSize); - } - return NULL; - } - - if (!_mesa_is_bufferobj(unpack->BufferObj)) { - /* non-PBO access: no further validation to be done */ - return ptr; - } - - if (_mesa_bufferobj_mapped(unpack->BufferObj)) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where); - return NULL; - } - - ptr = _mesa_map_pbo_source(ctx, unpack, ptr); - return ptr; -} - - -/** - * Counterpart to _mesa_map_pbo_source() - */ -void -_mesa_unmap_pbo_source(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack) -{ - ASSERT(unpack != &ctx->Pack); /* catch pack/unpack mismatch */ - if (_mesa_is_bufferobj(unpack->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj); - } -} - - -/** - * For commands that write to a PBO (glReadPixels, glGetColorTable, etc), - * if we're writing to a PBO, map it write-only and return the pointer - * into the PBO. If we're not writing to a PBO, return \p dst as-is. - * If non-null return, must call _mesa_unmap_pbo_dest() when done. - * - * \return NULL if error, else pointer to start of data - */ -void * -_mesa_map_pbo_dest(struct gl_context *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest) -{ - void *buf; - - if (_mesa_is_bufferobj(pack->BufferObj)) { - /* pack into PBO */ - buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, - pack->BufferObj->Size, - GL_MAP_WRITE_BIT, - pack->BufferObj); - if (!buf) - return NULL; - - buf = ADD_POINTERS(buf, dest); - } - else { - /* pack to normal memory */ - buf = dest; - } - - return buf; -} - - -/** - * Combine PBO-write validation and mapping. - * If any GL errors are detected, they'll be recorded and NULL returned. - * \sa _mesa_validate_pbo_access - * \sa _mesa_map_pbo_dest - * A call to this function should have a matching call to - * _mesa_unmap_pbo_dest(). - */ -GLvoid * -_mesa_map_validate_pbo_dest(struct gl_context *ctx, - GLuint dimensions, - const struct gl_pixelstore_attrib *unpack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - GLvoid *ptr, const char *where) -{ - ASSERT(dimensions == 1 || dimensions == 2 || dimensions == 3); - - if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, - format, type, clientMemSize, ptr)) { - if (_mesa_is_bufferobj(unpack->BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "%s(out of bounds PBO access)", where); - } else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "%s(out of bounds access: bufSize (%d) is too small)", - where, clientMemSize); - } - return NULL; - } - - if (!_mesa_is_bufferobj(unpack->BufferObj)) { - /* non-PBO access: no further validation to be done */ - return ptr; - } - - if (_mesa_bufferobj_mapped(unpack->BufferObj)) { - /* buffer is already mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "%s(PBO is mapped)", where); - return NULL; - } - - ptr = _mesa_map_pbo_dest(ctx, unpack, ptr); - return ptr; -} - - -/** - * Counterpart to _mesa_map_pbo_dest() - */ -void -_mesa_unmap_pbo_dest(struct gl_context *ctx, - const struct gl_pixelstore_attrib *pack) -{ - ASSERT(pack != &ctx->Unpack); /* catch pack/unpack mismatch */ - if (_mesa_is_bufferobj(pack->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, pack->BufferObj); - } -} - - -/** - * Check if an unpack PBO is active prior to fetching a texture image. - * If so, do bounds checking and map the buffer into main memory. - * Any errors detected will be recorded. - * The caller _must_ call _mesa_unmap_teximage_pbo() too! - */ -const GLvoid * -_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack, - const char *funcName) -{ - GLubyte *buf; - - if (!_mesa_is_bufferobj(unpack->BufferObj)) { - /* no PBO */ - return pixels; - } - if (!_mesa_validate_pbo_access(dimensions, unpack, width, height, depth, - format, type, INT_MAX, pixels)) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)"); - return NULL; - } - - buf = (GLubyte *) ctx->Driver.MapBufferRange(ctx, 0, unpack->BufferObj->Size, - GL_MAP_READ_BIT, - unpack->BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped)"); - return NULL; - } - - return ADD_POINTERS(buf, pixels); -} - - -/** - * Check if an unpack PBO is active prior to fetching a compressed texture - * image. - * If so, do bounds checking and map the buffer into main memory. - * Any errors detected will be recorded. - * The caller _must_ call _mesa_unmap_teximage_pbo() too! - */ -const GLvoid * -_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx, - GLsizei imageSize, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - const char *funcName) -{ - GLubyte *buf; - - if (!_mesa_is_bufferobj(packing->BufferObj)) { - /* not using a PBO - return pointer unchanged */ - return pixels; - } - if ((const GLubyte *) pixels + imageSize > - ((const GLubyte *) 0) + packing->BufferObj->Size) { - /* out of bounds read! */ - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(invalid PBO access)"); - return NULL; - } - - buf = (GLubyte*) ctx->Driver.MapBufferRange(ctx, 0, - packing->BufferObj->Size, - GL_MAP_READ_BIT, - packing->BufferObj); - if (!buf) { - _mesa_error(ctx, GL_INVALID_OPERATION, funcName, "(PBO is mapped"); - return NULL; - } - - return ADD_POINTERS(buf, pixels); -} - - -/** - * This function must be called after either of the validate_pbo_*_teximage() - * functions. It unmaps the PBO buffer if it was mapped earlier. - */ -void -_mesa_unmap_teximage_pbo(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack) -{ - if (_mesa_is_bufferobj(unpack->BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, unpack->BufferObj); - } -} - - diff --git a/reactos/dll/opengl/mesa/main/pbo.h b/reactos/dll/opengl/mesa/main/pbo.h deleted file mode 100644 index 00a6e617f22..00000000000 --- a/reactos/dll/opengl/mesa/main/pbo.h +++ /dev/null @@ -1,93 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 1999-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009-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 - * THE AUTHORS 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 PBO_H -#define PBO_H - - -#include "mtypes.h" - - -extern GLboolean -_mesa_validate_pbo_access(GLuint dimensions, - const struct gl_pixelstore_attrib *pack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - const GLvoid *ptr); - -extern const GLvoid * -_mesa_map_pbo_source(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack, - const GLvoid *src); - -extern const GLvoid * -_mesa_map_validate_pbo_source(struct gl_context *ctx, - GLuint dimensions, - const struct gl_pixelstore_attrib *unpack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - const GLvoid *ptr, const char *where); - -extern void -_mesa_unmap_pbo_source(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack); - -extern void * -_mesa_map_pbo_dest(struct gl_context *ctx, - const struct gl_pixelstore_attrib *pack, - GLvoid *dest); - -extern GLvoid * -_mesa_map_validate_pbo_dest(struct gl_context *ctx, - GLuint dimensions, - const struct gl_pixelstore_attrib *unpack, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, GLsizei clientMemSize, - GLvoid *ptr, const char *where); - -extern void -_mesa_unmap_pbo_dest(struct gl_context *ctx, - const struct gl_pixelstore_attrib *pack); - - -extern const GLvoid * -_mesa_validate_pbo_teximage(struct gl_context *ctx, GLuint dimensions, - GLsizei width, GLsizei height, GLsizei depth, - GLenum format, GLenum type, const GLvoid *pixels, - const struct gl_pixelstore_attrib *unpack, - const char *funcName); - -extern const GLvoid * -_mesa_validate_pbo_compressed_teximage(struct gl_context *ctx, - GLsizei imageSize, const GLvoid *pixels, - const struct gl_pixelstore_attrib *packing, - const char *funcName); - -extern void -_mesa_unmap_teximage_pbo(struct gl_context *ctx, - const struct gl_pixelstore_attrib *unpack); - - -#endif diff --git a/reactos/dll/opengl/mesa/main/pixel.c b/reactos/dll/opengl/mesa/main/pixel.c index e73c5a49a4a..c4c12da9e9b 100644 --- a/reactos/dll/opengl/mesa/main/pixel.c +++ b/reactos/dll/opengl/mesa/main/pixel.c @@ -35,7 +35,6 @@ #include "macros.h" #include "mfeatures.h" #include "pixel.h" -#include "pbo.h" #include "mtypes.h" #include "main/dispatch.h" @@ -143,44 +142,6 @@ store_pixelmap(struct gl_context *ctx, GLenum map, GLsizei mapsize, } -/** - * Convenience wrapper for _mesa_validate_pbo_access() for gl[Get]PixelMap(). - */ -static GLboolean -validate_pbo_access(struct gl_context *ctx, - struct gl_pixelstore_attrib *pack, GLsizei mapsize, - GLenum format, GLenum type, GLsizei clientMemSize, - const GLvoid *ptr) -{ - GLboolean ok; - - /* Note, need to use DefaultPacking and Unpack's buffer object */ - _mesa_reference_buffer_object(ctx, - &ctx->DefaultPacking.BufferObj, - pack->BufferObj); - - ok = _mesa_validate_pbo_access(1, &ctx->DefaultPacking, mapsize, 1, 1, - format, type, clientMemSize, ptr); - - /* restore */ - _mesa_reference_buffer_object(ctx, - &ctx->DefaultPacking.BufferObj, - ctx->Shared->NullBufferObj); - - if (!ok) { - if (_mesa_is_bufferobj(pack->BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "gl[Get]PixelMap*v(out of bounds PBO access)"); - } else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetnPixelMap*vARB(out of bounds access:" - " bufSize (%d) is too small)", clientMemSize); - } - } - return ok; -} - - static void GLAPIENTRY _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) { @@ -203,23 +164,11 @@ _mesa_PixelMapfv( GLenum map, GLsizei mapsize, const GLfloat *values ) FLUSH_VERTICES(ctx, _NEW_PIXEL); - if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, - GL_FLOAT, INT_MAX, values)) { - return; - } - - values = (const GLfloat *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapfv(PBO is mapped)"); - } return; } store_pixelmap(ctx, map, mapsize, values); - - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); } @@ -245,17 +194,7 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) FLUSH_VERTICES(ctx, _NEW_PIXEL); - if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, - GL_UNSIGNED_INT, INT_MAX, values)) { - return; - } - - values = (const GLuint *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapuiv(PBO is mapped)"); - } return; } @@ -273,8 +212,6 @@ _mesa_PixelMapuiv(GLenum map, GLsizei mapsize, const GLuint *values ) } } - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - store_pixelmap(ctx, map, mapsize, fvalues); } @@ -301,17 +238,7 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) FLUSH_VERTICES(ctx, _NEW_PIXEL); - if (!validate_pbo_access(ctx, &ctx->Unpack, mapsize, GL_INTENSITY, - GL_UNSIGNED_SHORT, INT_MAX, values)) { - return; - } - - values = (const GLushort *) _mesa_map_pbo_source(ctx, &ctx->Unpack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Unpack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glPixelMapusv(PBO is mapped)"); - } return; } @@ -329,14 +256,12 @@ _mesa_PixelMapusv(GLenum map, GLsizei mapsize, const GLushort *values ) } } - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); - store_pixelmap(ctx, map, mapsize, fvalues); } static void GLAPIENTRY -_mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values ) +_mesa_GetPixelMapfv( GLenum map, GLfloat *values ) { GET_CURRENT_CONTEXT(ctx); GLint mapsize, i; @@ -352,17 +277,7 @@ _mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values ) mapsize = pm->Size; - if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, - GL_FLOAT, bufSize, values)) { - return; - } - - values = (GLfloat *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapfv(PBO is mapped)"); - } return; } @@ -375,19 +290,11 @@ _mesa_GetnPixelMapfvARB( GLenum map, GLsizei bufSize, GLfloat *values ) else { memcpy(values, pm->Map, mapsize * sizeof(GLfloat)); } - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); } static void GLAPIENTRY -_mesa_GetPixelMapfv( GLenum map, GLfloat *values ) -{ - _mesa_GetnPixelMapfvARB(map, INT_MAX, values); -} - -static void GLAPIENTRY -_mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values ) +_mesa_GetPixelMapuiv( GLenum map, GLuint *values ) { GET_CURRENT_CONTEXT(ctx); GLint mapsize, i; @@ -403,17 +310,7 @@ _mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values ) mapsize = pm->Size; - if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, - GL_UNSIGNED_INT, bufSize, values)) { - return; - } - - values = (GLuint *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapuiv(PBO is mapped)"); - } return; } @@ -426,19 +323,11 @@ _mesa_GetnPixelMapuivARB( GLenum map, GLsizei bufSize, GLuint *values ) values[i] = FLOAT_TO_UINT( pm->Map[i] ); } } - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); } static void GLAPIENTRY -_mesa_GetPixelMapuiv( GLenum map, GLuint *values ) -{ - _mesa_GetnPixelMapuivARB(map, INT_MAX, values); -} - -static void GLAPIENTRY -_mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values ) +_mesa_GetPixelMapusv( GLenum map, GLushort *values ) { GET_CURRENT_CONTEXT(ctx); GLint mapsize, i; @@ -454,17 +343,7 @@ _mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values ) mapsize = pm->Size; - if (!validate_pbo_access(ctx, &ctx->Pack, mapsize, GL_INTENSITY, - GL_UNSIGNED_SHORT, bufSize, values)) { - return; - } - - values = (GLushort *) _mesa_map_pbo_dest(ctx, &ctx->Pack, values); if (!values) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetPixelMapusv(PBO is mapped)"); - } return; } @@ -485,15 +364,6 @@ _mesa_GetnPixelMapusvARB( GLenum map, GLsizei bufSize, GLushort *values ) CLAMPED_FLOAT_TO_USHORT(values[i], pm->Map[i] ); } } - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); -} - - -static void GLAPIENTRY -_mesa_GetPixelMapusv( GLenum map, GLushort *values ) -{ - _mesa_GetnPixelMapusvARB(map, INT_MAX, values); } @@ -663,11 +533,6 @@ _mesa_init_pixel_dispatch(struct _glapi_table *disp) SET_PixelTransferf(disp, _mesa_PixelTransferf); SET_PixelTransferi(disp, _mesa_PixelTransferi); SET_PixelZoom(disp, _mesa_PixelZoom); - - /* GL_ARB_robustness */ - SET_GetnPixelMapfvARB(disp, _mesa_GetnPixelMapfvARB); - SET_GetnPixelMapuivARB(disp, _mesa_GetnPixelMapuivARB); - SET_GetnPixelMapusvARB(disp, _mesa_GetnPixelMapusvARB); } diff --git a/reactos/dll/opengl/mesa/main/pixelstore.c b/reactos/dll/opengl/mesa/main/pixelstore.c index 81474491dc5..bbc4e5d6fb4 100644 --- a/reactos/dll/opengl/mesa/main/pixelstore.c +++ b/reactos/dll/opengl/mesa/main/pixelstore.c @@ -235,10 +235,6 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->Pack.SwapBytes = GL_FALSE; ctx->Pack.LsbFirst = GL_FALSE; ctx->Pack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - _mesa_reference_buffer_object(ctx, &ctx->Pack.BufferObj, - ctx->Shared->NullBufferObj); -#endif ctx->Unpack.Alignment = 4; ctx->Unpack.RowLength = 0; ctx->Unpack.ImageHeight = 0; @@ -248,10 +244,6 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->Unpack.SwapBytes = GL_FALSE; ctx->Unpack.LsbFirst = GL_FALSE; ctx->Unpack.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - _mesa_reference_buffer_object(ctx, &ctx->Unpack.BufferObj, - ctx->Shared->NullBufferObj); -#endif /* * _mesa_unpack_image() returns image data in this format. When we @@ -268,8 +260,4 @@ _mesa_init_pixelstore( struct gl_context *ctx ) ctx->DefaultPacking.SwapBytes = GL_FALSE; ctx->DefaultPacking.LsbFirst = GL_FALSE; ctx->DefaultPacking.Invert = GL_FALSE; -#if FEATURE_EXT_pixel_buffer_object - _mesa_reference_buffer_object(ctx, &ctx->DefaultPacking.BufferObj, - ctx->Shared->NullBufferObj); -#endif } diff --git a/reactos/dll/opengl/mesa/main/polygon.c b/reactos/dll/opengl/mesa/main/polygon.c index addca0228d5..ab84ae318fd 100644 --- a/reactos/dll/opengl/mesa/main/polygon.c +++ b/reactos/dll/opengl/mesa/main/polygon.c @@ -34,7 +34,6 @@ #include "image.h" #include "enums.h" #include "pack.h" -#include "pbo.h" #include "polygon.h" #include "mtypes.h" @@ -193,17 +192,10 @@ _mesa_PolygonMode( GLenum face, GLenum mode ) void _mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern) { - pattern = _mesa_map_validate_pbo_source(ctx, 2, - &ctx->Unpack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, - INT_MAX, pattern, - "glPolygonStipple"); if (!pattern) return; _mesa_unpack_polygon_stipple(pattern, ctx->PolygonStipple, &ctx->Unpack); - - _mesa_unmap_pbo_source(ctx, &ctx->Unpack); } @@ -232,31 +224,17 @@ _mesa_PolygonStipple( const GLubyte *pattern ) * Called by glPolygonStipple. */ void GLAPIENTRY -_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest ) +_mesa_GetPolygonStipple( GLubyte *dest ) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE&VERBOSE_API) _mesa_debug(ctx, "glGetPolygonStipple\n"); - - dest = _mesa_map_validate_pbo_dest(ctx, 2, - &ctx->Pack, 32, 32, 1, - GL_COLOR_INDEX, GL_BITMAP, - bufSize, dest, "glGetPolygonStipple"); if (!dest) return; _mesa_pack_polygon_stipple(ctx->PolygonStipple, dest, &ctx->Pack); - - _mesa_unmap_pbo_dest(ctx, &ctx->Pack); -} - - -void GLAPIENTRY -_mesa_GetPolygonStipple( GLubyte *dest ) -{ - _mesa_GetnPolygonStippleARB(INT_MAX, dest); } diff --git a/reactos/dll/opengl/mesa/main/polygon.h b/reactos/dll/opengl/mesa/main/polygon.h index 35f222f269d..13f7c91ed07 100644 --- a/reactos/dll/opengl/mesa/main/polygon.h +++ b/reactos/dll/opengl/mesa/main/polygon.h @@ -36,9 +36,6 @@ struct gl_context; -extern void GLAPIENTRY -_mesa_GetnPolygonStippleARB( GLsizei bufSize, GLubyte *dest ); - extern void _mesa_polygon_stipple(struct gl_context *ctx, const GLubyte *pattern); diff --git a/reactos/dll/opengl/mesa/main/readpix.c b/reactos/dll/opengl/mesa/main/readpix.c index a3ff1a8b07c..819b22d59dc 100644 --- a/reactos/dll/opengl/mesa/main/readpix.c +++ b/reactos/dll/opengl/mesa/main/readpix.c @@ -34,7 +34,6 @@ #include "image.h" #include "mtypes.h" #include "pack.h" -#include "pbo.h" #include "state.h" @@ -401,8 +400,6 @@ _mesa_readpixels(struct gl_context *ctx, /* Do all needed clipping here, so that we can forget about it later */ if (_mesa_clip_readpixels(ctx, &x, &y, &width, &height, &clippedPacking)) { - pixels = _mesa_map_pbo_dest(ctx, &clippedPacking, pixels); - if (pixels) { switch (format) { case GL_STENCIL_INDEX: @@ -418,8 +415,6 @@ _mesa_readpixels(struct gl_context *ctx, read_rgba_pixels(ctx, x, y, width, height, format, type, pixels, &clippedPacking); } - - _mesa_unmap_pbo_dest(ctx, &clippedPacking); } } } @@ -536,9 +531,8 @@ _mesa_error_check_format_type(struct gl_context *ctx, GLenum format, void GLAPIENTRY -_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLsizei bufSize, - GLvoid *pixels ) +_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, + GLenum format, GLenum type, GLvoid *pixels ) { GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); @@ -588,33 +582,6 @@ _mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, if (width == 0 || height == 0) return; /* nothing to do */ - if (!_mesa_validate_pbo_access(2, &ctx->Pack, width, height, 1, - format, type, bufSize, pixels)) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadPixels(out of bounds PBO access)"); - } else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glReadnPixelsARB(out of bounds access:" - " bufSize (%d) is too small)", bufSize); - } - return; - } - - if (_mesa_is_bufferobj(ctx->Pack.BufferObj) && - _mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { - /* buffer is mapped - that's an error */ - _mesa_error(ctx, GL_INVALID_OPERATION, "glReadPixels(PBO is mapped)"); - return; - } - ctx->Driver.ReadPixels(ctx, x, y, width, height, format, type, &ctx->Pack, pixels); } - -void GLAPIENTRY -_mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLvoid *pixels ) -{ - _mesa_ReadnPixelsARB(x, y, width, height, format, type, INT_MAX, pixels); -} diff --git a/reactos/dll/opengl/mesa/main/readpix.h b/reactos/dll/opengl/mesa/main/readpix.h index 6caaf3adce1..6fca7b99c97 100644 --- a/reactos/dll/opengl/mesa/main/readpix.h +++ b/reactos/dll/opengl/mesa/main/readpix.h @@ -48,9 +48,4 @@ extern void GLAPIENTRY _mesa_ReadPixels( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ); -extern void GLAPIENTRY -_mesa_ReadnPixelsARB( GLint x, GLint y, GLsizei width, GLsizei height, - GLenum format, GLenum type, GLsizei bufSize, - GLvoid *pixels ); - #endif diff --git a/reactos/dll/opengl/mesa/main/state.c b/reactos/dll/opengl/mesa/main/state.c index bce7c677c1d..5810e434290 100644 --- a/reactos/dll/opengl/mesa/main/state.c +++ b/reactos/dll/opengl/mesa/main/state.c @@ -225,12 +225,6 @@ update_tricaps(struct gl_context *ctx, GLbitfield new_state) ctx->_TriangleCaps |= DD_FLATSHADE; if (_mesa_need_secondary_color(ctx)) ctx->_TriangleCaps |= DD_SEPARATE_SPECULAR; - - /* - * Stencil - */ - if (ctx->Stencil._TestTwoSide) - ctx->_TriangleCaps |= DD_TRI_TWOSTENCIL; } #endif @@ -339,39 +333,3 @@ _mesa_update_state( struct gl_context *ctx ) _mesa_update_state_locked(ctx); _mesa_unlock_context_textures(ctx); } - - - - -/** - * Want to figure out which fragment program inputs are actually - * constant/current values from ctx->Current. These should be - * referenced as a tracked state variable rather than a fragment - * program input, to save the overhead of putting a constant value in - * every submitted vertex, transferring it to hardware, interpolating - * it across the triangle, etc... - * - * When there is a VP bound, just use vp->outputs. But when we're - * generating vp from fixed function state, basically want to - * calculate: - * - * vp_out_2_fp_in( vp_in_2_vp_out( varying_inputs ) | - * potential_vp_outputs ) - * - * Where potential_vp_outputs is calculated by looking at enabled - * texgen, etc. - * - * The generated fragment program should then only declare inputs that - * may vary or otherwise differ from the ctx->Current values. - * Otherwise, the fp should track them as state values instead. - */ -void -_mesa_set_varying_vp_inputs( struct gl_context *ctx, - GLbitfield64 varying_inputs ) -{ - if (ctx->varying_vp_inputs != varying_inputs) { - ctx->varying_vp_inputs = varying_inputs; - ctx->NewState |= _NEW_ARRAY; - /*printf("%s %x\n", __FUNCTION__, varying_inputs);*/ - } -} diff --git a/reactos/dll/opengl/mesa/main/state.h b/reactos/dll/opengl/mesa/main/state.h index 3ab5aee0832..5268effb31a 100644 --- a/reactos/dll/opengl/mesa/main/state.h +++ b/reactos/dll/opengl/mesa/main/state.h @@ -38,10 +38,6 @@ extern void _mesa_update_state_locked(struct gl_context *ctx); -extern void -_mesa_set_varying_vp_inputs(struct gl_context *ctx, GLbitfield64 varying_inputs); - - /** * Is the secondary color needed? */ diff --git a/reactos/dll/opengl/mesa/main/stencil.c b/reactos/dll/opengl/mesa/main/stencil.c index b6993ff129b..5b3d328ab62 100644 --- a/reactos/dll/opengl/mesa/main/stencil.c +++ b/reactos/dll/opengl/mesa/main/stencil.c @@ -27,23 +27,6 @@ * \file stencil.c * Stencil operations. * - * Note: There's some conflict between GL_EXT_stencil_two_side and - * OpenGL 2.0's two-sided stencil feature. - * - * With GL_EXT_stencil_two_side, calling glStencilOp/Func/Mask() only the - * front OR back face state (as set by glActiveStencilFaceEXT) is set. - * - * But with OpenGL 2.0, calling glStencilOp/Func/Mask() sets BOTH the - * front AND back state. - * - * Also, note that GL_ATI_separate_stencil is different as well: - * glStencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, ...) vs. - * glStencilFuncSeparate(GLenum face, GLenum func, ...). - * - * This problem is solved by keeping three sets of stencil state: - * state[0] = GL_FRONT state. - * state[1] = OpenGL 2.0 / GL_ATI_separate_stencil GL_BACK state. - * state[2] = GL_EXT_stencil_two_side GL_BACK state. */ @@ -121,66 +104,6 @@ _mesa_ClearStencil( GLint s ) } } - -/** - * Set the function and reference value for stencil testing. - * - * \param frontfunc front test function. - * \param backfunc back test function. - * \param ref front and back reference value. - * \param mask front and back bitmask. - * - * \sa glStencilFunc(). - * - * Verifies the parameters and updates the respective values in - * __struct gl_contextRec::Stencil. On change flushes the vertices and notifies the - * driver via the dd_function_table::StencilFunc callback. - */ -void GLAPIENTRY -_mesa_StencilFuncSeparateATI( GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask ) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilFuncSeparateATI()\n"); - - if (!validate_stencil_func(ctx, frontfunc)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glStencilFuncSeparateATI(frontfunc)"); - return; - } - if (!validate_stencil_func(ctx, backfunc)) { - _mesa_error(ctx, GL_INVALID_ENUM, - "glStencilFuncSeparateATI(backfunc)"); - return; - } - - ref = CLAMP( ref, 0, stencilMax ); - - /* set both front and back state */ - if (ctx->Stencil.Function[0] == frontfunc && - ctx->Stencil.Function[1] == backfunc && - ctx->Stencil.ValueMask[0] == mask && - ctx->Stencil.ValueMask[1] == mask && - ctx->Stencil.Ref[0] == ref && - ctx->Stencil.Ref[1] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[0] = frontfunc; - ctx->Stencil.Function[1] = backfunc; - ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, GL_FRONT, - frontfunc, ref, mask); - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, - backfunc, ref, mask); - } -} - - /** * Set the function and reference value for stencil testing. * @@ -199,7 +122,6 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) { GET_CURRENT_CONTEXT(ctx); const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - const GLint face = ctx->Stencil.ActiveFace; ASSERT_OUTSIDE_BEGIN_END(ctx); if (MESA_VERBOSE & VERBOSE_API) @@ -212,43 +134,15 @@ _mesa_StencilFunc( GLenum func, GLint ref, GLuint mask ) ref = CLAMP( ref, 0, stencilMax ); - if (face != 0) { - if (ctx->Stencil.Function[face] == func && - ctx->Stencil.ValueMask[face] == mask && - ctx->Stencil.Ref[face] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[face] = func; - ctx->Stencil.Ref[face] = ref; - ctx->Stencil.ValueMask[face] = mask; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilFuncSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilFuncSeparate(ctx, GL_BACK, func, ref, mask); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.Function[0] == func && - ctx->Stencil.Function[1] == func && - ctx->Stencil.ValueMask[0] == mask && - ctx->Stencil.ValueMask[1] == mask && - ctx->Stencil.Ref[0] == ref && - ctx->Stencil.Ref[1] == ref) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.Function[0] = ctx->Stencil.Function[1] = func; - ctx->Stencil.Ref[0] = ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[0] = ctx->Stencil.ValueMask[1] = mask; - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - func, ref, mask); - } - } + /* set both front and back state */ + if (ctx->Stencil.Function == func && + ctx->Stencil.ValueMask == mask && + ctx->Stencil.Ref == ref) + return; + FLUSH_VERTICES(ctx, _NEW_STENCIL); + ctx->Stencil.Function = func; + ctx->Stencil.Ref = ref; + ctx->Stencil.ValueMask = mask; } @@ -267,42 +161,17 @@ void GLAPIENTRY _mesa_StencilMask( GLuint mask ) { GET_CURRENT_CONTEXT(ctx); - const GLint face = ctx->Stencil.ActiveFace; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glStencilMask()\n"); ASSERT_OUTSIDE_BEGIN_END(ctx); - if (face != 0) { - /* Only modify the EXT_stencil_two_side back-face state. - */ - if (ctx->Stencil.WriteMask[face] == mask) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.WriteMask[face] = mask; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilMaskSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilMaskSeparate(ctx, GL_BACK, mask); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.WriteMask[0] == mask && - ctx->Stencil.WriteMask[1] == mask) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.WriteMask[0] = ctx->Stencil.WriteMask[1] = mask; - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - mask); - } - } + /* set both front and back state */ + if (ctx->Stencil.WriteMask == mask) + return; + FLUSH_VERTICES(ctx, _NEW_STENCIL); + ctx->Stencil.WriteMask = mask; } @@ -324,7 +193,6 @@ void GLAPIENTRY _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) { GET_CURRENT_CONTEXT(ctx); - const GLint face = ctx->Stencil.ActiveFace; if (MESA_VERBOSE & VERBOSE_API) _mesa_debug(ctx, "glStencilOp()\n"); @@ -344,230 +212,25 @@ _mesa_StencilOp(GLenum fail, GLenum zfail, GLenum zpass) return; } - if (face != 0) { - /* only set active face state */ - if (ctx->Stencil.ZFailFunc[face] == zfail && - ctx->Stencil.ZPassFunc[face] == zpass && - ctx->Stencil.FailFunc[face] == fail) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[face] = zfail; - ctx->Stencil.ZPassFunc[face] = zpass; - ctx->Stencil.FailFunc[face] = fail; - - /* Only propagate the change to the driver if EXT_stencil_two_side - * is enabled. - */ - if (ctx->Driver.StencilOpSeparate && ctx->Stencil.TestTwoSide) { - ctx->Driver.StencilOpSeparate(ctx, GL_BACK, fail, zfail, zpass); - } - } - else { - /* set both front and back state */ - if (ctx->Stencil.ZFailFunc[0] == zfail && - ctx->Stencil.ZFailFunc[1] == zfail && - ctx->Stencil.ZPassFunc[0] == zpass && - ctx->Stencil.ZPassFunc[1] == zpass && - ctx->Stencil.FailFunc[0] == fail && - ctx->Stencil.FailFunc[1] == fail) - return; - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[0] = ctx->Stencil.ZFailFunc[1] = zfail; - ctx->Stencil.ZPassFunc[0] = ctx->Stencil.ZPassFunc[1] = zpass; - ctx->Stencil.FailFunc[0] = ctx->Stencil.FailFunc[1] = fail; - if (ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, - ((ctx->Stencil.TestTwoSide) - ? GL_FRONT : GL_FRONT_AND_BACK), - fail, zfail, zpass); - } - } -} - - - -#if _HAVE_FULL_GL -/* GL_EXT_stencil_two_side */ -void GLAPIENTRY -_mesa_ActiveStencilFaceEXT(GLenum face) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glActiveStencilFaceEXT()\n"); - - if (!ctx->Extensions.EXT_stencil_two_side) { - _mesa_error(ctx, GL_INVALID_OPERATION, "glActiveStencilFaceEXT"); + /* set both front and back state */ + if (ctx->Stencil.ZFailFunc == zfail && + ctx->Stencil.ZPassFunc == zpass && + ctx->Stencil.FailFunc == fail) return; - } - - if (face == GL_FRONT || face == GL_BACK) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ActiveFace = (face == GL_FRONT) ? 0 : 2; - } - else { - _mesa_error(ctx, GL_INVALID_ENUM, "glActiveStencilFaceEXT(face)"); - } -} -#endif - - - -/** - * OpenGL 2.0 function. - * \todo Make StencilOp() call this function. And eventually remove the - * ctx->Driver.StencilOp function and use ctx->Driver.StencilOpSeparate - * instead. - */ -void GLAPIENTRY -_mesa_StencilOpSeparate(GLenum face, GLenum sfail, GLenum zfail, GLenum zpass) -{ - GLboolean set = GL_FALSE; - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilOpSeparate()\n"); - - if (!validate_stencil_op(ctx, sfail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(sfail)"); - return; - } - if (!validate_stencil_op(ctx, zfail)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zfail)"); - return; - } - if (!validate_stencil_op(ctx, zpass)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(zpass)"); - return; - } - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilOpSeparate(face)"); - return; - } - - if (face != GL_BACK) { - /* set front */ - if (ctx->Stencil.ZFailFunc[0] != zfail || - ctx->Stencil.ZPassFunc[0] != zpass || - ctx->Stencil.FailFunc[0] != sfail){ - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[0] = zfail; - ctx->Stencil.ZPassFunc[0] = zpass; - ctx->Stencil.FailFunc[0] = sfail; - set = GL_TRUE; - } - } - if (face != GL_FRONT) { - /* set back */ - if (ctx->Stencil.ZFailFunc[1] != zfail || - ctx->Stencil.ZPassFunc[1] != zpass || - ctx->Stencil.FailFunc[1] != sfail) { - FLUSH_VERTICES(ctx, _NEW_STENCIL); - ctx->Stencil.ZFailFunc[1] = zfail; - ctx->Stencil.ZPassFunc[1] = zpass; - ctx->Stencil.FailFunc[1] = sfail; - set = GL_TRUE; - } - } - if (set && ctx->Driver.StencilOpSeparate) { - ctx->Driver.StencilOpSeparate(ctx, face, sfail, zfail, zpass); - } -} - - -/* OpenGL 2.0 */ -void GLAPIENTRY -_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - const GLint stencilMax = (1 << ctx->DrawBuffer->Visual.stencilBits) - 1; - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilFuncSeparate()\n"); - - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(face)"); - return; - } - if (!validate_stencil_func(ctx, func)) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilFuncSeparate(func)"); - return; - } - - ref = CLAMP(ref, 0, stencilMax); - FLUSH_VERTICES(ctx, _NEW_STENCIL); - - if (face != GL_BACK) { - /* set front */ - ctx->Stencil.Function[0] = func; - ctx->Stencil.Ref[0] = ref; - ctx->Stencil.ValueMask[0] = mask; - } - if (face != GL_FRONT) { - /* set back */ - ctx->Stencil.Function[1] = func; - ctx->Stencil.Ref[1] = ref; - ctx->Stencil.ValueMask[1] = mask; - } - if (ctx->Driver.StencilFuncSeparate) { - ctx->Driver.StencilFuncSeparate(ctx, face, func, ref, mask); - } + ctx->Stencil.ZFailFunc = zfail; + ctx->Stencil.ZPassFunc = zpass; + ctx->Stencil.FailFunc = fail; } - -/* OpenGL 2.0 */ -void GLAPIENTRY -_mesa_StencilMaskSeparate(GLenum face, GLuint mask) -{ - GET_CURRENT_CONTEXT(ctx); - ASSERT_OUTSIDE_BEGIN_END(ctx); - - if (MESA_VERBOSE & VERBOSE_API) - _mesa_debug(ctx, "glStencilMaskSeparate()\n"); - - if (face != GL_FRONT && face != GL_BACK && face != GL_FRONT_AND_BACK) { - _mesa_error(ctx, GL_INVALID_ENUM, "glStencilaMaskSeparate(face)"); - return; - } - - FLUSH_VERTICES(ctx, _NEW_STENCIL); - - if (face != GL_BACK) { - ctx->Stencil.WriteMask[0] = mask; - } - if (face != GL_FRONT) { - ctx->Stencil.WriteMask[1] = mask; - } - if (ctx->Driver.StencilMaskSeparate) { - ctx->Driver.StencilMaskSeparate(ctx, face, mask); - } -} - - /** * Update derived stencil state. */ void _mesa_update_stencil(struct gl_context *ctx) { - const GLint face = ctx->Stencil._BackFace; - ctx->Stencil._Enabled = (ctx->Stencil.Enabled && ctx->DrawBuffer->Visual.stencilBits > 0); - - ctx->Stencil._TestTwoSide = - ctx->Stencil._Enabled && - (ctx->Stencil.Function[0] != ctx->Stencil.Function[face] || - ctx->Stencil.FailFunc[0] != ctx->Stencil.FailFunc[face] || - ctx->Stencil.ZPassFunc[0] != ctx->Stencil.ZPassFunc[face] || - ctx->Stencil.ZFailFunc[0] != ctx->Stencil.ZFailFunc[face] || - ctx->Stencil.Ref[0] != ctx->Stencil.Ref[face] || - ctx->Stencil.ValueMask[0] != ctx->Stencil.ValueMask[face] || - ctx->Stencil.WriteMask[0] != ctx->Stencil.WriteMask[face]); } @@ -582,29 +245,12 @@ void _mesa_init_stencil(struct gl_context *ctx) { ctx->Stencil.Enabled = GL_FALSE; - ctx->Stencil.TestTwoSide = GL_FALSE; - ctx->Stencil.ActiveFace = 0; /* 0 = GL_FRONT, 2 = GL_BACK */ - ctx->Stencil.Function[0] = GL_ALWAYS; - ctx->Stencil.Function[1] = GL_ALWAYS; - ctx->Stencil.Function[2] = GL_ALWAYS; - ctx->Stencil.FailFunc[0] = GL_KEEP; - ctx->Stencil.FailFunc[1] = GL_KEEP; - ctx->Stencil.FailFunc[2] = GL_KEEP; - ctx->Stencil.ZPassFunc[0] = GL_KEEP; - ctx->Stencil.ZPassFunc[1] = GL_KEEP; - ctx->Stencil.ZPassFunc[2] = GL_KEEP; - ctx->Stencil.ZFailFunc[0] = GL_KEEP; - ctx->Stencil.ZFailFunc[1] = GL_KEEP; - ctx->Stencil.ZFailFunc[2] = GL_KEEP; - ctx->Stencil.Ref[0] = 0; - ctx->Stencil.Ref[1] = 0; - ctx->Stencil.Ref[2] = 0; - ctx->Stencil.ValueMask[0] = ~0U; - ctx->Stencil.ValueMask[1] = ~0U; - ctx->Stencil.ValueMask[2] = ~0U; - ctx->Stencil.WriteMask[0] = ~0U; - ctx->Stencil.WriteMask[1] = ~0U; - ctx->Stencil.WriteMask[2] = ~0U; + ctx->Stencil.Function = GL_ALWAYS; + ctx->Stencil.FailFunc = GL_KEEP; + ctx->Stencil.ZPassFunc = GL_KEEP; + ctx->Stencil.ZFailFunc = GL_KEEP; + ctx->Stencil.Ref = 0; + ctx->Stencil.ValueMask = ~0U; + ctx->Stencil.WriteMask = ~0U; ctx->Stencil.Clear = 0; - ctx->Stencil._BackFace = 1; } diff --git a/reactos/dll/opengl/mesa/main/stencil.h b/reactos/dll/opengl/mesa/main/stencil.h index b772bfd6e6f..74f97c7eda1 100644 --- a/reactos/dll/opengl/mesa/main/stencil.h +++ b/reactos/dll/opengl/mesa/main/stencil.h @@ -55,18 +55,6 @@ _mesa_StencilOp( GLenum fail, GLenum zfail, GLenum zpass ); extern void GLAPIENTRY _mesa_ActiveStencilFaceEXT(GLenum face); - -extern void GLAPIENTRY -_mesa_StencilOpSeparate(GLenum face, GLenum fail, GLenum zfail, GLenum zpass); - - -extern void GLAPIENTRY -_mesa_StencilFuncSeparate(GLenum face, GLenum func, GLint ref, GLuint mask); - - -extern void GLAPIENTRY -_mesa_StencilFuncSeparateATI(GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); - extern void GLAPIENTRY _mesa_StencilMaskSeparate(GLenum face, GLuint mask); diff --git a/reactos/dll/opengl/mesa/main/texgetimage.c b/reactos/dll/opengl/mesa/main/texgetimage.c index b916b2980f9..64955d7046b 100644 --- a/reactos/dll/opengl/mesa/main/texgetimage.c +++ b/reactos/dll/opengl/mesa/main/texgetimage.c @@ -39,7 +39,6 @@ #include "mfeatures.h" #include "mtypes.h" #include "pack.h" -#include "pbo.h" #include "texgetimage.h" #include "teximage.h" @@ -421,28 +420,6 @@ _mesa_get_teximage(struct gl_context *ctx, dimensions = 2; } - /* map dest buffer, if PBO */ - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - /* Packing texture image into a PBO. - * Map the (potentially) VRAM-based buffer into our process space so - * we can write into it with the code below. - * A hardware driver might use a sophisticated blit to move the - * texture data to the PBO if the PBO is in VRAM along with the texture. - */ - GLubyte *buf = (GLubyte *) - ctx->Driver.MapBufferRange(ctx, 0, ctx->Pack.BufferObj->Size, - GL_MAP_WRITE_BIT, ctx->Pack.BufferObj); - if (!buf) { - /* out of memory or other unexpected error */ - _mesa_error(ctx, GL_OUT_OF_MEMORY, "glGetTexImage(map PBO failed)"); - return; - } - /* was an offset into the PBO. - * Now make it a real, client-side pointer inside the mapped region. - */ - pixels = ADD_POINTERS(buf, pixels); - } - if (get_tex_memcpy(ctx, format, type, pixels, texImage)) { /* all done */ } @@ -455,10 +432,6 @@ _mesa_get_teximage(struct gl_context *ctx, else { get_tex_rgba(ctx, dimensions, format, type, pixels, texImage); } - - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - ctx->Driver.UnmapBuffer(ctx, ctx->Pack.BufferObj); - } } /** @@ -467,13 +440,11 @@ _mesa_get_teximage(struct gl_context *ctx, */ static GLboolean getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, - GLenum format, GLenum type, GLsizei clientMemSize, - GLvoid *pixels ) + GLenum format, GLenum type, GLvoid *pixels ) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; const GLint maxLevels = _mesa_max_texture_levels(ctx, target); - const GLuint dimensions = (target == GL_TEXTURE_3D) ? 3 : 2; GLenum baseFormat, err; if (maxLevels == 0) { @@ -548,29 +519,6 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, return GL_TRUE; } - if (!_mesa_validate_pbo_access(dimensions, &ctx->Pack, texImage->Width, - texImage->Height, texImage->Depth, - format, type, clientMemSize, pixels)) { - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(out of bounds PBO access)"); - } else { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetnTexImageARB(out of bounds access:" - " bufSize (%d) is too small)", clientMemSize); - } - return GL_TRUE; - } - - if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) { - /* PBO should not be mapped */ - if (_mesa_bufferobj_mapped(ctx->Pack.BufferObj)) { - _mesa_error(ctx, GL_INVALID_OPERATION, - "glGetTexImage(PBO is mapped)"); - return GL_TRUE; - } - } - return GL_FALSE; } @@ -587,20 +535,19 @@ getteximage_error_check(struct gl_context *ctx, GLenum target, GLint level, * \param pixels returned pixel data. */ void GLAPIENTRY -_mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format, - GLenum type, GLsizei bufSize, GLvoid *pixels ) +_mesa_GetTexImage( GLenum target, GLint level, GLenum format, + GLenum type, GLvoid *pixels ) { struct gl_texture_object *texObj; struct gl_texture_image *texImage; GET_CURRENT_CONTEXT(ctx); ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - if (getteximage_error_check(ctx, target, level, format, type, - bufSize, pixels)) { + if (getteximage_error_check(ctx, target, level, format, type, pixels)) { return; } - if (!_mesa_is_bufferobj(ctx->Pack.BufferObj) && !pixels) { + if (!pixels) { /* not an error, do nothing */ return; } @@ -627,10 +574,3 @@ _mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format, _mesa_unlock_texture(ctx, texObj); } - -void GLAPIENTRY -_mesa_GetTexImage( GLenum target, GLint level, GLenum format, - GLenum type, GLvoid *pixels ) -{ - _mesa_GetnTexImageARB(target, level, format, type, INT_MAX, pixels); -} diff --git a/reactos/dll/opengl/mesa/main/texgetimage.h b/reactos/dll/opengl/mesa/main/texgetimage.h index acef7dff895..eedf2ebfb47 100644 --- a/reactos/dll/opengl/mesa/main/texgetimage.h +++ b/reactos/dll/opengl/mesa/main/texgetimage.h @@ -43,8 +43,5 @@ _mesa_get_teximage(struct gl_context *ctx, extern void GLAPIENTRY _mesa_GetTexImage( GLenum target, GLint level, GLenum format, GLenum type, GLvoid *pixels ); -extern void GLAPIENTRY -_mesa_GetnTexImageARB( GLenum target, GLint level, GLenum format, - GLenum type, GLsizei bufSize, GLvoid *pixels ); #endif /* TEXGETIMAGE_H */ diff --git a/reactos/dll/opengl/mesa/main/texparam.c b/reactos/dll/opengl/mesa/main/texparam.c index 5c430b5c254..d403db1756a 100644 --- a/reactos/dll/opengl/mesa/main/texparam.c +++ b/reactos/dll/opengl/mesa/main/texparam.c @@ -52,27 +52,11 @@ static GLboolean validate_texture_wrap_mode(struct gl_context * ctx, GLenum target, GLenum wrap) { - const struct gl_extensions * const e = & ctx->Extensions; - switch (wrap) { case GL_CLAMP: case GL_REPEAT: - case GL_CLAMP_TO_EDGE: case GL_MIRRORED_REPEAT: return GL_TRUE; - case GL_CLAMP_TO_BORDER: - if (e->ARB_texture_border_clamp) - return GL_TRUE; - break; - case GL_MIRROR_CLAMP_EXT: - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - if (e->ATI_texture_mirror_once || e->EXT_texture_mirror_clamp) - return GL_TRUE; - break; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - if (e->EXT_texture_mirror_clamp) - return GL_TRUE; - break; default: break; } diff --git a/reactos/dll/opengl/mesa/main/texstore.c b/reactos/dll/opengl/mesa/main/texstore.c index 9d6ebb41a3b..1c30455d618 100644 --- a/reactos/dll/opengl/mesa/main/texstore.c +++ b/reactos/dll/opengl/mesa/main/texstore.c @@ -60,7 +60,6 @@ #include "mfeatures.h" #include "mtypes.h" #include "pack.h" -#include "pbo.h" #include "imports.h" #include "teximage.h" #include "texstore.h" @@ -3340,9 +3339,7 @@ store_texsubimage(struct gl_context *ctx, } /* get pointer to src pixels (may be in a pbo which we'll map here) */ - src = (const GLubyte *) - _mesa_validate_pbo_teximage(ctx, dims, width, height, depth, - format, type, pixels, packing, caller); + src = (const GLubyte *)pixels; if (!src) return; @@ -3403,8 +3400,6 @@ store_texsubimage(struct gl_context *ctx, if (!success) _mesa_error(ctx, GL_OUT_OF_MEMORY, "%s", caller); - - _mesa_unmap_teximage_pbo(ctx, packing); } diff --git a/reactos/dll/opengl/mesa/main/varray.c b/reactos/dll/opengl/mesa/main/varray.c index 74c72432408..8d86a8250cc 100644 --- a/reactos/dll/opengl/mesa/main/varray.c +++ b/reactos/dll/opengl/mesa/main/varray.c @@ -566,25 +566,6 @@ _mesa_UnlockArraysEXT( void ) ctx->Array.NewState |= VERT_BIT_ALL; } - -/* GL_EXT_multi_draw_arrays */ -void GLAPIENTRY -_mesa_MultiDrawArraysEXT( GLenum mode, const GLint *first, - const GLsizei *count, GLsizei primcount ) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (count[i] > 0) { - CALL_DrawArrays(ctx->Exec, (mode, first[i], count[i])); - } - } -} - - /* GL_IBM_multimode_draw_arrays */ void GLAPIENTRY _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, diff --git a/reactos/dll/opengl/mesa/main/varray.h b/reactos/dll/opengl/mesa/main/varray.h index f2fc41fa516..9b3b1c50604 100644 --- a/reactos/dll/opengl/mesa/main/varray.h +++ b/reactos/dll/opengl/mesa/main/varray.h @@ -140,11 +140,6 @@ _mesa_SecondaryColorPointerEXT(GLint size, GLenum type, extern void GLAPIENTRY _mesa_InterleavedArrays(GLenum format, GLsizei stride, const GLvoid *pointer); - -extern void GLAPIENTRY -_mesa_MultiDrawArraysEXT( GLenum mode, const GLint *first, - const GLsizei *count, GLsizei primcount ); - extern void GLAPIENTRY _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, const GLsizei * count, diff --git a/reactos/dll/opengl/mesa/main/version.c b/reactos/dll/opengl/mesa/main/version.c index 531814e9081..7d43d707505 100644 --- a/reactos/dll/opengl/mesa/main/version.c +++ b/reactos/dll/opengl/mesa/main/version.c @@ -61,8 +61,7 @@ compute_version(struct gl_context *ctx) GLuint major, minor; static const int max = 100; - const GLboolean ver_1_3 = (ctx->Extensions.ARB_texture_border_clamp && - ctx->Extensions.ARB_texture_cube_map && + const GLboolean ver_1_3 = (ctx->Extensions.ARB_texture_cube_map && ctx->Extensions.ARB_texture_env_combine && ctx->Extensions.ARB_texture_env_dot3); const GLboolean ver_1_4 = (ver_1_3 && @@ -79,18 +78,8 @@ compute_version(struct gl_context *ctx) const GLboolean ver_2_0 = (ver_1_5 && ctx->Extensions.ARB_point_sprite && ctx->Extensions.ARB_texture_non_power_of_two && - ctx->Extensions.EXT_blend_equation_separate && - - /* Technically, 2.0 requires the functionality - * of the EXT version. Enable 2.0 if either - * extension is available, and assume that a - * driver that only exposes the ATI extension - * will fallback to software when necessary. - */ - (ctx->Extensions.EXT_stencil_two_side - || ctx->Extensions.ATI_separate_stencil)); - const GLboolean ver_2_1 = (ver_2_0 && - ctx->Extensions.EXT_pixel_buffer_object); + ctx->Extensions.EXT_blend_equation_separate); + const GLboolean ver_2_1 = (ver_2_0); const GLboolean ver_3_0 = (ver_2_1 && ctx->Extensions.ARB_half_float_pixel && ctx->Extensions.ARB_half_float_vertex && diff --git a/reactos/dll/opengl/mesa/swrast/s_aalinetemp.h b/reactos/dll/opengl/mesa/swrast/s_aalinetemp.h index 7a8ab7a4412..2c04801a5aa 100644 --- a/reactos/dll/opengl/mesa/swrast/s_aalinetemp.h +++ b/reactos/dll/opengl/mesa/swrast/s_aalinetemp.h @@ -126,7 +126,6 @@ NAME(line)(struct gl_context *ctx, const SWvertex *v0, const SWvertex *v1) INIT_SPAN(line.span, GL_LINE); line.span.arrayMask = SPAN_XY | SPAN_COVERAGE; - line.span.facing = swrast->PointLineFacing; line.xAdj = line.dx / line.len * line.halfWidth; line.yAdj = line.dy / line.len * line.halfWidth; diff --git a/reactos/dll/opengl/mesa/swrast/s_aatritemp.h b/reactos/dll/opengl/mesa/swrast/s_aatritemp.h index 77b3ae6ec7a..6ac564d6012 100644 --- a/reactos/dll/opengl/mesa/swrast/s_aatritemp.h +++ b/reactos/dll/opengl/mesa/swrast/s_aatritemp.h @@ -106,8 +106,6 @@ if (area * bf < 0 || area == 0 || IS_INF_OR_NAN(area)) return; ltor = (GLboolean) (area < 0.0F); - - span.facing = area * swrast->_BackfaceSign > 0.0F; } /* Plane equation setup: diff --git a/reactos/dll/opengl/mesa/swrast/s_bitmap.c b/reactos/dll/opengl/mesa/swrast/s_bitmap.c index d6cdda89118..e25d507c144 100644 --- a/reactos/dll/opengl/mesa/swrast/s_bitmap.c +++ b/reactos/dll/opengl/mesa/swrast/s_bitmap.c @@ -32,7 +32,6 @@ #include "main/bufferobj.h" #include "main/image.h" #include "main/macros.h" -#include "main/pbo.h" #include "s_context.h" #include "s_span.h" @@ -56,7 +55,6 @@ _swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py, ASSERT(ctx->RenderMode == GL_RENDER); - bitmap = (const GLubyte *) _mesa_map_pbo_source(ctx, unpack, bitmap); if (!bitmap) return; @@ -129,8 +127,6 @@ _swrast_Bitmap( struct gl_context *ctx, GLint px, GLint py, } swrast_render_finish(ctx); - - _mesa_unmap_pbo_source(ctx, unpack); } diff --git a/reactos/dll/opengl/mesa/swrast/s_context.c b/reactos/dll/opengl/mesa/swrast/s_context.c index 17ecc7e7c10..f91deffc5b6 100644 --- a/reactos/dll/opengl/mesa/swrast/s_context.c +++ b/reactos/dll/opengl/mesa/swrast/s_context.c @@ -576,12 +576,6 @@ _swrast_ResetLineStipple( struct gl_context *ctx ) SWRAST_CONTEXT(ctx)->StippleCounter = 0; } -void -_swrast_SetFacing(struct gl_context *ctx, GLuint facing) -{ - SWRAST_CONTEXT(ctx)->PointLineFacing = facing; -} - void _swrast_allow_vertex_fog( struct gl_context *ctx, GLboolean value ) { @@ -668,7 +662,6 @@ _swrast_CreateContext( struct gl_context *ctx ) /* init point span buffer */ swrast->PointSpan.primitive = GL_POINT; swrast->PointSpan.end = 0; - swrast->PointSpan.facing = 0; swrast->PointSpan.array = swrast->SpanArrays; ctx->swrast_context = swrast; diff --git a/reactos/dll/opengl/mesa/swrast/s_context.h b/reactos/dll/opengl/mesa/swrast/s_context.h index cb71716c04d..612956eb47a 100644 --- a/reactos/dll/opengl/mesa/swrast/s_context.h +++ b/reactos/dll/opengl/mesa/swrast/s_context.h @@ -224,7 +224,6 @@ typedef struct /* Working values: */ GLuint StippleCounter; /**< Line stipple counter */ - GLuint PointLineFacing; GLbitfield NewState; GLuint StateChanges; GLenum Primitive; /* current primitive being drawn (ala glBegin) */ diff --git a/reactos/dll/opengl/mesa/swrast/s_drawpix.c b/reactos/dll/opengl/mesa/swrast/s_drawpix.c index b2cbf6a7dfa..3a5e29958c0 100644 --- a/reactos/dll/opengl/mesa/swrast/s_drawpix.c +++ b/reactos/dll/opengl/mesa/swrast/s_drawpix.c @@ -32,7 +32,6 @@ #include "main/imports.h" #include "main/macros.h" #include "main/pack.h" -#include "main/pbo.h" #include "main/pixeltransfer.h" #include "main/state.h" @@ -511,7 +510,6 @@ _swrast_DrawPixels( struct gl_context *ctx, if (swrast->NewState) _swrast_validate_derived( ctx ); - pixels = _mesa_map_pbo_source(ctx, unpack, pixels); if (!pixels) { return; } @@ -534,6 +532,4 @@ _swrast_DrawPixels( struct gl_context *ctx, /* all other formats should be color formats */ draw_rgba_pixels(ctx, x, y, width, height, format, type, unpack, pixels); } - - _mesa_unmap_pbo_source(ctx, unpack); } diff --git a/reactos/dll/opengl/mesa/swrast/s_linetemp.h b/reactos/dll/opengl/mesa/swrast/s_linetemp.h index 1668f7db914..c58a39a2714 100644 --- a/reactos/dll/opengl/mesa/swrast/s_linetemp.h +++ b/reactos/dll/opengl/mesa/swrast/s_linetemp.h @@ -291,8 +291,6 @@ NAME( struct gl_context *ctx, const SWvertex *vert0, const SWvertex *vert1 ) span.interpMask = interpFlags; span.arrayMask = SPAN_XY; - span.facing = swrast->PointLineFacing; - /* * Draw diff --git a/reactos/dll/opengl/mesa/swrast/s_points.c b/reactos/dll/opengl/mesa/swrast/s_points.c index 5bae6b066e3..36174e4007a 100644 --- a/reactos/dll/opengl/mesa/swrast/s_points.c +++ b/reactos/dll/opengl/mesa/swrast/s_points.c @@ -103,8 +103,6 @@ sprite_point(struct gl_context *ctx, const SWvertex *vert) INIT_SPAN(span, GL_POINT); span.interpMask = SPAN_Z | SPAN_RGBA; - span.facing = swrast->PointLineFacing; - span.red = ChanToFixed(vert->color[0]); span.green = ChanToFixed(vert->color[1]); span.blue = ChanToFixed(vert->color[2]); @@ -271,8 +269,6 @@ smooth_point(struct gl_context *ctx, const SWvertex *vert) span.interpMask = SPAN_Z | SPAN_RGBA; span.arrayMask = SPAN_COVERAGE | SPAN_MASK; - span.facing = swrast->PointLineFacing; - span.red = ChanToFixed(vert->color[0]); span.green = ChanToFixed(vert->color[1]); span.blue = ChanToFixed(vert->color[2]); @@ -374,7 +370,6 @@ large_point(struct gl_context *ctx, const SWvertex *vert) /* span init */ INIT_SPAN(span, GL_POINT); span.arrayMask = SPAN_XY; - span.facing = swrast->PointLineFacing; span.interpMask = SPAN_Z | SPAN_RGBA; span.red = ChanToFixed(vert->color[0]); @@ -470,8 +465,7 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert) /* check if we need to flush */ if (span->end >= MAX_WIDTH || - (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT)) || - span->facing != swrast->PointLineFacing) { + (swrast->_RasterMask & (BLEND_BIT | LOGIC_OP_BIT | MASKING_BIT))) { if (span->end > 0) { _swrast_write_rgba_span(ctx, span); span->end = 0; @@ -480,8 +474,6 @@ pixel_point(struct gl_context *ctx, const SWvertex *vert) count = span->end; - span->facing = swrast->PointLineFacing; - /* fragment attributes */ span->array->rgba[count][RCOMP] = vert->color[0]; span->array->rgba[count][GCOMP] = vert->color[1]; diff --git a/reactos/dll/opengl/mesa/swrast/s_span.h b/reactos/dll/opengl/mesa/swrast/s_span.h index a58d1ad64ce..be41d113fc0 100644 --- a/reactos/dll/opengl/mesa/swrast/s_span.h +++ b/reactos/dll/opengl/mesa/swrast/s_span.h @@ -122,9 +122,6 @@ typedef struct sw_span /** either GL_POLYGON, GL_LINE, GL_POLYGON, GL_BITMAP */ GLenum primitive; - /** 0 = front-facing span, 1 = back-facing span (for two-sided stencil) */ - GLuint facing; - /** * This bitmask (of \link SpanFlags SPAN_* flags\endlink) indicates * which of the attrStart/StepX/StepY variables are relevant. @@ -177,7 +174,6 @@ do { \ (S).arrayAttribs = 0x0; \ (S).end = 0; \ (S).leftClip = 0; \ - (S).facing = 0; \ (S).array = SWRAST_CONTEXT(ctx)->SpanArrays; \ } while (0) diff --git a/reactos/dll/opengl/mesa/swrast/s_stencil.c b/reactos/dll/opengl/mesa/swrast/s_stencil.c index 04317f76512..2aa81b92457 100644 --- a/reactos/dll/opengl/mesa/swrast/s_stencil.c +++ b/reactos/dll/opengl/mesa/swrast/s_stencil.c @@ -124,12 +124,12 @@ clamp(GLint val) * @param stride stride between stencil values */ static void -apply_stencil_op(const struct gl_context *ctx, GLenum oper, GLuint face, +apply_stencil_op(const struct gl_context *ctx, GLenum oper, GLuint n, GLubyte stencil[], const GLubyte mask[], GLint stride) { - const GLubyte ref = ctx->Stencil.Ref[face]; - const GLubyte wrtmask = ctx->Stencil.WriteMask[face]; + const GLubyte ref = ctx->Stencil.Ref; + const GLubyte wrtmask = ctx->Stencil.WriteMask; const GLubyte invmask = (GLubyte) (~wrtmask); GLuint i, j; @@ -207,14 +207,14 @@ apply_stencil_op(const struct gl_context *ctx, GLenum oper, GLuint face, * @return GL_FALSE = all pixels failed, GL_TRUE = zero or more pixels passed. */ static GLboolean -do_stencil_test(struct gl_context *ctx, GLuint face, GLuint n, +do_stencil_test(struct gl_context *ctx, GLuint n, GLubyte stencil[], GLubyte mask[], GLint stride) { GLubyte fail[MAX_WIDTH]; GLboolean allfail = GL_FALSE; GLuint i, j; - const GLuint valueMask = ctx->Stencil.ValueMask[face]; - const GLubyte ref = (GLubyte) (ctx->Stencil.Ref[face] & valueMask); + const GLuint valueMask = ctx->Stencil.ValueMask; + const GLubyte ref = (GLubyte) (ctx->Stencil.Ref & valueMask); GLubyte s; /* @@ -226,7 +226,7 @@ do_stencil_test(struct gl_context *ctx, GLuint face, GLuint n, * the stencil fail operator is not to be applied * ENDIF */ - switch (ctx->Stencil.Function[face]) { + switch (ctx->Stencil.Function) { case GL_NEVER: STENCIL_TEST(0); allfail = GL_TRUE; @@ -257,8 +257,8 @@ do_stencil_test(struct gl_context *ctx, GLuint face, GLuint n, return 0; } - if (ctx->Stencil.FailFunc[face] != GL_KEEP) { - apply_stencil_op(ctx, ctx->Stencil.FailFunc[face], face, n, stencil, + if (ctx->Stencil.FailFunc != GL_KEEP) { + apply_stencil_op(ctx, ctx->Stencil.FailFunc, n, stencil, fail, stride); } @@ -351,7 +351,6 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span) struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; const GLint stencilOffset = get_stencil_offset(rb->Format); const GLint stencilStride = _mesa_get_format_bytes(rb->Format); - const GLuint face = (span->facing == 0) ? 0 : ctx->Stencil._BackFace; const GLuint count = span->end; GLubyte *mask = span->array->mask; GLubyte stencilTemp[MAX_WIDTH]; @@ -375,7 +374,7 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span) * Apply the stencil test to the fragments. * failMask[i] is 1 if the stencil test failed. */ - if (!do_stencil_test(ctx, face, count, stencilBuf, mask, stencilStride)) { + if (!do_stencil_test(ctx, count, stencilBuf, mask, stencilStride)) { /* all fragments failed the stencil test, we're done. */ span->writeAll = GL_FALSE; if (span->arrayMask & SPAN_XY) { @@ -395,7 +394,7 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span) /* * No depth buffer, just apply zpass stencil function to active pixels. */ - apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face, count, + apply_stencil_op(ctx, ctx->Stencil.ZPassFunc, count, stencilBuf, mask, stencilStride); } else { @@ -413,12 +412,12 @@ _swrast_stencil_and_ztest_span(struct gl_context *ctx, SWspan *span) compute_pass_fail_masks(count, origMask, mask, passMask, failMask); /* apply the pass and fail operations */ - if (ctx->Stencil.ZFailFunc[face] != GL_KEEP) { - apply_stencil_op(ctx, ctx->Stencil.ZFailFunc[face], face, + if (ctx->Stencil.ZFailFunc != GL_KEEP) { + apply_stencil_op(ctx, ctx->Stencil.ZFailFunc, count, stencilBuf, failMask, stencilStride); } - if (ctx->Stencil.ZPassFunc[face] != GL_KEEP) { - apply_stencil_op(ctx, ctx->Stencil.ZPassFunc[face], face, + if (ctx->Stencil.ZPassFunc != GL_KEEP) { + apply_stencil_op(ctx, ctx->Stencil.ZPassFunc, count, stencilBuf, passMask, stencilStride); } } @@ -491,7 +490,7 @@ _swrast_write_stencil_span(struct gl_context *ctx, GLint n, GLint x, GLint y, struct gl_framebuffer *fb = ctx->DrawBuffer; struct gl_renderbuffer *rb = fb->Attachment[BUFFER_STENCIL].Renderbuffer; const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1; - const GLuint stencilMask = ctx->Stencil.WriteMask[0]; + const GLuint stencilMask = ctx->Stencil.WriteMask; GLubyte *stencilBuf; if (y < 0 || y >= (GLint) rb->Height || @@ -544,7 +543,7 @@ _swrast_clear_stencil_buffer(struct gl_context *ctx) struct gl_renderbuffer *rb = ctx->DrawBuffer->Attachment[BUFFER_STENCIL].Renderbuffer; const GLubyte stencilBits = ctx->DrawBuffer->Visual.stencilBits; - const GLuint writeMask = ctx->Stencil.WriteMask[0]; + const GLuint writeMask = ctx->Stencil.WriteMask; const GLuint stencilMax = (1 << stencilBits) - 1; GLint x, y, width, height; GLubyte *map; diff --git a/reactos/dll/opengl/mesa/swrast/s_texfilter.c b/reactos/dll/opengl/mesa/swrast/s_texfilter.c index 9f2a0a29879..bb5db592f6a 100644 --- a/reactos/dll/opengl/mesa/swrast/s_texfilter.c +++ b/reactos/dll/opengl/mesa/swrast/s_texfilter.c @@ -146,7 +146,7 @@ lerp_rgba_3d(GLfloat result[4], GLfloat a, GLfloat b, GLfloat c, /** * Used to compute texel locations for linear sampling. * Input: - * wrapMode = GL_REPEAT, GL_CLAMP, GL_CLAMP_TO_EDGE, GL_CLAMP_TO_BORDER + * wrapMode = GL_REPEAT, GL_CLAMP * s = texcoord in [0,1] * size = width (or height or depth) of texture * Output: @@ -173,36 +173,6 @@ linear_texel_locations(GLenum wrapMode, *i1 = REMAINDER(*i0 + 1, size); } break; - case GL_CLAMP_TO_EDGE: - if (s <= 0.0F) - u = 0.0F; - else if (s >= 1.0F) - u = (GLfloat) size; - else - u = s * size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - if (*i0 < 0) - *i0 = 0; - if (*i1 >= (GLint) size) - *i1 = size - 1; - break; - case GL_CLAMP_TO_BORDER: - { - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s <= min) - u = min * size; - else if (s >= max) - u = max * size; - else - u = s * size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - } - break; case GL_MIRRORED_REPEAT: { const GLint flr = IFLOOR(s); @@ -219,46 +189,6 @@ linear_texel_locations(GLenum wrapMode, *i1 = size - 1; } break; - case GL_MIRROR_CLAMP_EXT: - u = FABSF(s); - if (u >= 1.0F) - u = (GLfloat) size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - break; - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - u = FABSF(s); - if (u >= 1.0F) - u = (GLfloat) size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - if (*i0 < 0) - *i0 = 0; - if (*i1 >= (GLint) size) - *i1 = size - 1; - break; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - { - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - u = FABSF(s); - if (u <= min) - u = min * size; - else if (u >= max) - u = max * size; - else - u *= size; - u -= 0.5F; - *i0 = IFLOOR(u); - *i1 = *i0 + 1; - } - break; case GL_CLAMP: if (s <= 0.0F) u = 0.0F; @@ -300,34 +230,6 @@ nearest_texel_location(GLenum wrapMode, else i = REMAINDER(i, size); return i; - case GL_CLAMP_TO_EDGE: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = 1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s < min) - i = 0; - else if (s > max) - i = size - 1; - else - i = IFLOOR(s * size); - } - return i; - case GL_CLAMP_TO_BORDER: - { - /* s limited to [min,max] */ - /* i limited to [-1, size] */ - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - if (s <= min) - i = -1; - else if (s >= max) - i = size; - else - i = IFLOOR(s * size); - } - return i; case GL_MIRRORED_REPEAT: { const GLfloat min = 1.0F / (2.0F * size); @@ -346,49 +248,6 @@ nearest_texel_location(GLenum wrapMode, i = IFLOOR(u * size); } return i; - case GL_MIRROR_CLAMP_EXT: - { - /* s limited to [0,1] */ - /* i limited to [0,size-1] */ - const GLfloat u = FABSF(s); - if (u <= 0.0F) - i = 0; - else if (u >= 1.0F) - i = size - 1; - else - i = IFLOOR(u * size); - } - return i; - case GL_MIRROR_CLAMP_TO_EDGE_EXT: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = 1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - const GLfloat u = FABSF(s); - if (u < min) - i = 0; - else if (u > max) - i = size - 1; - else - i = IFLOOR(u * size); - } - return i; - case GL_MIRROR_CLAMP_TO_BORDER_EXT: - { - /* s limited to [min,max] */ - /* i limited to [0, size-1] */ - const GLfloat min = -1.0F / (2.0F * size); - const GLfloat max = 1.0F - min; - const GLfloat u = FABSF(s); - if (u < min) - i = -1; - else if (u > max) - i = size; - else - i = IFLOOR(u * size); - } - return i; case GL_CLAMP: /* s limited to [0,1] */ /* i limited to [0,size-1] */ @@ -424,17 +283,7 @@ linear_repeat_texel_location(GLuint size, GLfloat s, static inline GLint clamp_rect_coord_nearest(GLenum wrapMode, GLfloat coord, GLint max) { - switch (wrapMode) { - case GL_CLAMP: - return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); - case GL_CLAMP_TO_EDGE: - return IFLOOR( CLAMP(coord, 0.5F, max - 0.5F) ); - case GL_CLAMP_TO_BORDER: - return IFLOOR( CLAMP(coord, -0.5F, max + 0.5F) ); - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_nearest"); - return 0; - } + return IFLOOR( CLAMP(coord, 0.0F, max - 1) ); } @@ -446,37 +295,11 @@ clamp_rect_coord_linear(GLenum wrapMode, GLfloat coord, GLint max, GLint *i0out, GLint *i1out, GLfloat *weight) { GLfloat fcol; - GLint i0, i1; - switch (wrapMode) { - case GL_CLAMP: - /* Not exactly what the spec says, but it matches NVIDIA output */ - fcol = CLAMP(coord - 0.5F, 0.0F, max - 1); - i0 = IFLOOR(fcol); - i1 = i0 + 1; - break; - case GL_CLAMP_TO_EDGE: - fcol = CLAMP(coord, 0.5F, max - 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - if (i1 > max - 1) - i1 = max - 1; - break; - case GL_CLAMP_TO_BORDER: - fcol = CLAMP(coord, -0.5F, max + 0.5F); - fcol -= 0.5F; - i0 = IFLOOR(fcol); - i1 = i0 + 1; - break; - default: - _mesa_problem(NULL, "bad wrapMode in clamp_rect_coord_linear"); - i0 = i1 = 0; - fcol = 0.0F; - break; - } - *i0out = i0; - *i1out = i1; + /* Not exactly what the spec says, but it matches NVIDIA output */ + fcol = CLAMP(coord - 0.5F, 0.0F, max - 1); *weight = FRAC(fcol); + *i0out = IFLOOR(fcol); + *i1out = *i0out + 1; } diff --git a/reactos/dll/opengl/mesa/swrast/s_tritemp.h b/reactos/dll/opengl/mesa/swrast/s_tritemp.h index ee434d21015..8f1723617a1 100644 --- a/reactos/dll/opengl/mesa/swrast/s_tritemp.h +++ b/reactos/dll/opengl/mesa/swrast/s_tritemp.h @@ -241,9 +241,6 @@ static void NAME(struct gl_context *ctx, const SWvertex *v0, return; oneOverArea = 1.0F / area; - - /* 0 = front, 1 = back */ - span.facing = oneOverArea * bf > 0.0F; } /* Edge setup. For a triangle strip these could be reused... */ diff --git a/reactos/dll/opengl/mesa/swrast/swrast.h b/reactos/dll/opengl/mesa/swrast/swrast.h index bf7d101990c..cff5ed874bd 100644 --- a/reactos/dll/opengl/mesa/swrast/swrast.h +++ b/reactos/dll/opengl/mesa/swrast/swrast.h @@ -133,13 +133,6 @@ _swrast_Clear(struct gl_context *ctx, GLbitfield buffers); extern void _swrast_ResetLineStipple( struct gl_context *ctx ); -/** - * Indicates front/back facing for subsequent points/lines when drawing - * unfilled polygons. Needed for two-side stencil. - */ -extern void -_swrast_SetFacing(struct gl_context *ctx, GLuint facing); - /* These will always render the correct point/line/triangle for the * current state. * diff --git a/reactos/dll/opengl/mesa/swrast_setup/ss_context.c b/reactos/dll/opengl/mesa/swrast_setup/ss_context.c index c7e55a2252f..7965f8eda8a 100644 --- a/reactos/dll/opengl/mesa/swrast_setup/ss_context.c +++ b/reactos/dll/opengl/mesa/swrast_setup/ss_context.c @@ -174,9 +174,6 @@ _swsetup_RenderStart( struct gl_context *ctx ) swsetup->NewState = 0; - /* This will change if drawing unfilled tris */ - _swrast_SetFacing(ctx, 0); - _swrast_render_start(ctx); /* Important */ diff --git a/reactos/dll/opengl/mesa/swrast_setup/ss_triangle.c b/reactos/dll/opengl/mesa/swrast_setup/ss_triangle.c index 75ee52a3d8b..58918b8d510 100644 --- a/reactos/dll/opengl/mesa/swrast_setup/ss_triangle.c +++ b/reactos/dll/opengl/mesa/swrast_setup/ss_triangle.c @@ -128,8 +128,6 @@ static void _swsetup_render_tri(struct gl_context *ctx, return; } - _swrast_SetFacing(ctx, facing); - if (ctx->Light.ShadeModel == GL_FLAT) { GLchan c[2][4]; GLfloat s[2][4]; @@ -253,8 +251,7 @@ void _swsetup_choose_trifuncs( struct gl_context *ctx ) * unfilled triangle path. */ if (ctx->Polygon.FrontMode != GL_FILL || - ctx->Polygon.BackMode != GL_FILL || - (ctx->Stencil.Enabled && ctx->Stencil._TestTwoSide)) + ctx->Polygon.BackMode != GL_FILL) ind |= SS_UNFILLED_BIT; tnl->Driver.Render.Triangle = tri_tab[ind]; diff --git a/reactos/dll/opengl/mesa/vbo/vbo_exec_array.c b/reactos/dll/opengl/mesa/vbo/vbo_exec_array.c index b4528c799f9..e10b74f999e 100644 --- a/reactos/dll/opengl/mesa/vbo/vbo_exec_array.c +++ b/reactos/dll/opengl/mesa/vbo/vbo_exec_array.c @@ -367,8 +367,6 @@ recalculate_input_bindings(struct gl_context *ctx) } ctx->NewState |= _NEW_ARRAY; - - _mesa_set_varying_vp_inputs( ctx, VERT_BIT_ALL & (~const_inputs) ); } diff --git a/reactos/dll/opengl/mesa/vbo/vbo_exec_draw.c b/reactos/dll/opengl/mesa/vbo/vbo_exec_draw.c index 7cc922b30ca..dd80cf5a44b 100644 --- a/reactos/dll/opengl/mesa/vbo/vbo_exec_draw.c +++ b/reactos/dll/opengl/mesa/vbo/vbo_exec_draw.c @@ -213,8 +213,6 @@ vbo_exec_bind_arrays( struct gl_context *ctx ) ctx->NewState |= _NEW_ARRAY; } } - - _mesa_set_varying_vp_inputs( ctx, varying_inputs ); } @@ -346,10 +344,7 @@ vbo_exec_vtx_flush(struct vbo_exec_context *exec, GLboolean keepUnmapped) if (exec->vtx.copied.nr != exec->vtx.vert_count) { struct gl_context *ctx = exec->ctx; - - /* Before the update_state() as this may raise _NEW_ARRAY - * from _mesa_set_varying_vp_inputs(). - */ + vbo_exec_bind_arrays( ctx ); if (ctx->NewState) diff --git a/reactos/dll/opengl/mesa/vbo/vbo_save_draw.c b/reactos/dll/opengl/mesa/vbo/vbo_save_draw.c index e1e4ebcf000..0a6ab4e05ea 100644 --- a/reactos/dll/opengl/mesa/vbo/vbo_save_draw.c +++ b/reactos/dll/opengl/mesa/vbo/vbo_save_draw.c @@ -172,8 +172,6 @@ static void vbo_bind_vertex_list(struct gl_context *ctx, ctx->NewState |= _NEW_ARRAY; } } - - _mesa_set_varying_vp_inputs( ctx, varying_inputs ); }