diff --git a/reactos/dll/opengl/mesa/generated/glsl/glcpp/glcpp-parse.c b/reactos/dll/opengl/mesa/generated/glsl/glcpp/glcpp-parse.c index 9b263d10208..2df5f0a2a4d 100644 --- a/reactos/dll/opengl/mesa/generated/glsl/glcpp/glcpp-parse.c +++ b/reactos/dll/opengl/mesa/generated/glsl/glcpp/glcpp-parse.c @@ -3494,10 +3494,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) add_builtin_define(parser, "GL_EXT_texture_array", 1); } - if (extensions->ARB_fragment_coord_conventions) - add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", - 1); - if (extensions->ARB_shader_texture_lod) add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); diff --git a/reactos/dll/opengl/mesa/generated/glsl/glsl_lexer.cpp b/reactos/dll/opengl/mesa/generated/glsl/glsl_lexer.cpp index 1a7edbff6f4..35465d8d68e 100644 --- a/reactos/dll/opengl/mesa/generated/glsl/glsl_lexer.cpp +++ b/reactos/dll/opengl/mesa/generated/glsl/glsl_lexer.cpp @@ -2008,8 +2008,7 @@ YY_RULE_SETUP { if ((yyextra->language_version >= 140) || yyextra->AMD_conservative_depth_enable - || yyextra->ARB_conservative_depth_enable - || yyextra->ARB_fragment_coord_conventions_enable) { + || yyextra->ARB_conservative_depth_enable) { return LAYOUT_TOK; } else { yylval->identifier = strdup(yytext); diff --git a/reactos/dll/opengl/mesa/generated/glsl/glsl_parser.cpp b/reactos/dll/opengl/mesa/generated/glsl/glsl_parser.cpp index 0dac6d62a3e..dab23db2a73 100644 --- a/reactos/dll/opengl/mesa/generated/glsl/glsl_parser.cpp +++ b/reactos/dll/opengl/mesa/generated/glsl/glsl_parser.cpp @@ -4111,12 +4111,6 @@ yyreduce: } (yyval.type_qualifier).flags.i = (yyvsp[(1) - (3)].type_qualifier).flags.i | (yyvsp[(3) - (3)].type_qualifier).flags.i; - - if ((yyvsp[(1) - (3)].type_qualifier).flags.q.explicit_location) - (yyval.type_qualifier).location = (yyvsp[(1) - (3)].type_qualifier).location; - - if ((yyvsp[(3) - (3)].type_qualifier).flags.q.explicit_location) - (yyval.type_qualifier).location = (yyvsp[(3) - (3)].type_qualifier).location; } break; @@ -4129,23 +4123,6 @@ yyreduce: memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - /* Layout qualifiers for ARB_fragment_coord_conventions. */ - if (!got_one && state->ARB_fragment_coord_conventions_enable) { - if (strcmp((yyvsp[(1) - (1)].identifier), "origin_upper_left") == 0) { - got_one = true; - (yyval.type_qualifier).flags.q.origin_upper_left = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "pixel_center_integer") == 0) { - got_one = true; - (yyval.type_qualifier).flags.q.pixel_center_integer = 1; - } - - if (got_one && state->ARB_fragment_coord_conventions_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "GL_ARB_fragment_coord_conventions layout " - "identifier `%s' used\n", (yyvsp[(1) - (1)].identifier)); - } - } - /* Layout qualifiers for AMD/ARB_conservative_depth. */ if (!got_one && (state->AMD_conservative_depth_enable || diff --git a/reactos/dll/opengl/mesa/src/glsl/ast.h b/reactos/dll/opengl/mesa/src/glsl/ast.h index 1f78af87e5a..a01aac07376 100644 --- a/reactos/dll/opengl/mesa/src/glsl/ast.h +++ b/reactos/dll/opengl/mesa/src/glsl/ast.h @@ -352,18 +352,6 @@ struct ast_type_qualifier { unsigned flat:1; unsigned noperspective:1; - /** \name Layout qualifiers for GL_ARB_fragment_coord_conventions */ - /*@{*/ - unsigned origin_upper_left:1; - unsigned pixel_center_integer:1; - /*@}*/ - - /** - * Flag set if GL_ARB_explicit_attrib_location "location" layout - * qualifier is used. - */ - unsigned explicit_location:1; - /** \name Layout qualifiers for GL_AMD_conservative_depth */ /** \{ */ unsigned depth_any:1; @@ -379,14 +367,6 @@ struct ast_type_qualifier { unsigned i; } flags; - /** - * Location specified via GL_ARB_explicit_attrib_location layout - * - * \note - * This field is only valid if \c explicit_location is set. - */ - int location; - /** * Return true if and only if an interpolation qualifier is present. */ diff --git a/reactos/dll/opengl/mesa/src/glsl/ast_to_hir.cpp b/reactos/dll/opengl/mesa/src/glsl/ast_to_hir.cpp index db5b68ce548..3e7658bc06f 100644 --- a/reactos/dll/opengl/mesa/src/glsl/ast_to_hir.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/ast_to_hir.cpp @@ -2030,119 +2030,6 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual, } - var->pixel_center_integer = qual->flags.q.pixel_center_integer; - var->origin_upper_left = qual->flags.q.origin_upper_left; - if ((qual->flags.q.origin_upper_left || qual->flags.q.pixel_center_integer) - && (strcmp(var->name, "gl_FragCoord") != 0)) { - const char *const qual_string = (qual->flags.q.origin_upper_left) - ? "origin_upper_left" : "pixel_center_integer"; - - _mesa_glsl_error(loc, state, - "layout qualifier `%s' can only be applied to " - "fragment shader input `gl_FragCoord'", - qual_string); - } - - if (qual->flags.q.explicit_location) { - const bool global_scope = (state->current_function == NULL); - bool fail = false; - const char *string = ""; - - /* In the vertex shader only shader inputs can be given explicit - * locations. - * - * In the fragment shader only shader outputs can be given explicit - * locations. - */ - switch (state->target) { - case vertex_shader: - if (!global_scope || (var->mode != ir_var_in)) { - fail = true; - string = "input"; - } - break; - - case fragment_shader: - if (!global_scope || (var->mode != ir_var_out)) { - fail = true; - string = "output"; - } - break; - }; - - if (fail) { - _mesa_glsl_error(loc, state, - "only %s shader %s variables can be given an " - "explicit location\n", - _mesa_glsl_shader_target_name(state->target), - string); - } else { - var->explicit_location = true; - - /* This bit of silliness is needed because invalid explicit locations - * are supposed to be flagged during linking. Small negative values - * biased by VERT_ATTRIB_GENERIC0 or FRAG_RESULT_DATA0 could alias - * built-in values (e.g., -16+VERT_ATTRIB_GENERIC0 = VERT_ATTRIB_POS). - * The linker needs to be able to differentiate these cases. This - * ensures that negative values stay negative. - */ - if (qual->location >= 0) { - var->location = (state->target == vertex_shader) - ? (qual->location + VERT_ATTRIB_GENERIC0) - : (qual->location + FRAG_RESULT_DATA0); - } else { - var->location = qual->location; - } - } - } - - /* Does the declaration use the 'layout' keyword? - */ - const bool uses_layout = qual->flags.q.pixel_center_integer - || qual->flags.q.origin_upper_left - || qual->flags.q.explicit_location; - - /* Does the declaration use the deprecated 'attribute' or 'varying' - * keywords? - */ - const bool uses_deprecated_qualifier = qual->flags.q.attribute - || qual->flags.q.varying; - - /* Is the 'layout' keyword used with parameters that allow relaxed checking. - * Many implementations of GL_ARB_fragment_coord_conventions_enable and some - * implementations (only Mesa?) GL_ARB_explicit_attrib_location_enable - * allowed the layout qualifier to be used with 'varying' and 'attribute'. - * These extensions and all following extensions that add the 'layout' - * keyword have been modified to require the use of 'in' or 'out'. - * - * The following extension do not allow the deprecated keywords: - * - * GL_AMD_conservative_depth - * GL_ARB_conservative_depth - * GL_ARB_gpu_shader5 - * GL_ARB_separate_shader_objects - * GL_ARB_tesselation_shader - * GL_ARB_transform_feedback3 - * GL_ARB_uniform_buffer_object - * - * It is unknown whether GL_EXT_shader_image_load_store or GL_NV_gpu_shader5 - * allow layout with the deprecated keywords. - */ - const bool relaxed_layout_qualifier_checking = - state->ARB_fragment_coord_conventions_enable; - - if (uses_layout && uses_deprecated_qualifier) { - if (relaxed_layout_qualifier_checking) { - _mesa_glsl_warning(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); - } else { - _mesa_glsl_error(loc, state, - "`layout' qualifier may not be used with " - "`attribute' or `varying'"); - } - } - /* Layout qualifiers for gl_FragDepth, which are enabled by extension * AMD_conservative_depth. */ @@ -2236,26 +2123,6 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl, earlier->type = var->type; delete var; var = NULL; - } else if (state->ARB_fragment_coord_conventions_enable - && strcmp(var->name, "gl_FragCoord") == 0 - && earlier->type == var->type - && earlier->mode == var->mode) { - /* Allow redeclaration of gl_FragCoord for ARB_fcc layout - * qualifiers. - */ - earlier->origin_upper_left = var->origin_upper_left; - earlier->pixel_center_integer = var->pixel_center_integer; - - /* According to section 4.3.7 of the GLSL 1.30 spec, - * the following built-in varaibles can be redeclared with an - * interpolation qualifier: - * * gl_FrontColor - * * gl_BackColor - * * gl_FrontSecondaryColor - * * gl_BackSecondaryColor - * * gl_Color - * * gl_SecondaryColor - */ } else if (state->language_version >= 130 && (strcmp(var->name, "gl_FrontColor") == 0 || strcmp(var->name, "gl_BackColor") == 0 @@ -2579,8 +2446,7 @@ ast_declarator_list::hir(exec_list *instructions, * This is relaxed in GLSL 1.30. It is also relaxed by any extension * that adds the 'layout' keyword. */ - if ((state->language_version < 130) - && !state->ARB_fragment_coord_conventions_enable) { + if (state->language_version < 130) { if (this->type->qualifier.flags.q.out) { _mesa_glsl_error(& loc, state, "`out' qualifier in declaration of `%s' " diff --git a/reactos/dll/opengl/mesa/src/glsl/builtin_variables.cpp b/reactos/dll/opengl/mesa/src/glsl/builtin_variables.cpp index 6a4f372dfd1..2dde1c87c50 100644 --- a/reactos/dll/opengl/mesa/src/glsl/builtin_variables.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/builtin_variables.cpp @@ -407,7 +407,6 @@ add_variable(exec_list *instructions, glsl_symbol_table *symtab, } var->location = slot; - var->explicit_location = (slot >= 0); /* Once the variable is created an initialized, add it to the symbol table * and add the declaration to the IR stream. diff --git a/reactos/dll/opengl/mesa/src/glsl/glcpp/glcpp-parse.c b/reactos/dll/opengl/mesa/src/glsl/glcpp/glcpp-parse.c index 3fc9a698ab8..28cc4092230 100644 --- a/reactos/dll/opengl/mesa/src/glsl/glcpp/glcpp-parse.c +++ b/reactos/dll/opengl/mesa/src/glsl/glcpp/glcpp-parse.c @@ -3444,10 +3444,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api) add_builtin_define(parser, "GL_EXT_texture_array", 1); } - if (extensions->ARB_fragment_coord_conventions) - add_builtin_define(parser, "GL_ARB_fragment_coord_conventions", - 1); - if (extensions->ARB_shader_texture_lod) add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1); diff --git a/reactos/dll/opengl/mesa/src/glsl/glsl_lexer.cpp b/reactos/dll/opengl/mesa/src/glsl/glsl_lexer.cpp index 3891bb0647f..8fd80097e13 100644 --- a/reactos/dll/opengl/mesa/src/glsl/glsl_lexer.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/glsl_lexer.cpp @@ -2001,8 +2001,7 @@ YY_RULE_SETUP { if ((yyextra->language_version >= 140) || yyextra->AMD_conservative_depth_enable - || yyextra->ARB_conservative_depth_enable - || yyextra->ARB_fragment_coord_conventions_enable) { + || yyextra->ARB_conservative_depth_enable) { return LAYOUT_TOK; } else { yylval->identifier = strdup(yytext); diff --git a/reactos/dll/opengl/mesa/src/glsl/glsl_parser.cpp b/reactos/dll/opengl/mesa/src/glsl/glsl_parser.cpp index 6e2508c642a..17abfc234b2 100644 --- a/reactos/dll/opengl/mesa/src/glsl/glsl_parser.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/glsl_parser.cpp @@ -4080,12 +4080,6 @@ yyreduce: } (yyval.type_qualifier).flags.i = (yyvsp[(1) - (3)].type_qualifier).flags.i | (yyvsp[(3) - (3)].type_qualifier).flags.i; - - if ((yyvsp[(1) - (3)].type_qualifier).flags.q.explicit_location) - (yyval.type_qualifier).location = (yyvsp[(1) - (3)].type_qualifier).location; - - if ((yyvsp[(3) - (3)].type_qualifier).flags.q.explicit_location) - (yyval.type_qualifier).location = (yyvsp[(3) - (3)].type_qualifier).location; ;} break; @@ -4098,23 +4092,6 @@ yyreduce: memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier))); - /* Layout qualifiers for ARB_fragment_coord_conventions. */ - if (!got_one && state->ARB_fragment_coord_conventions_enable) { - if (strcmp((yyvsp[(1) - (1)].identifier), "origin_upper_left") == 0) { - got_one = true; - (yyval.type_qualifier).flags.q.origin_upper_left = 1; - } else if (strcmp((yyvsp[(1) - (1)].identifier), "pixel_center_integer") == 0) { - got_one = true; - (yyval.type_qualifier).flags.q.pixel_center_integer = 1; - } - - if (got_one && state->ARB_fragment_coord_conventions_warn) { - _mesa_glsl_warning(& (yylsp[(1) - (1)]), state, - "GL_ARB_fragment_coord_conventions layout " - "identifier `%s' used\n", (yyvsp[(1) - (1)].identifier)); - } - } - /* Layout qualifiers for AMD/ARB_conservative_depth. */ if (!got_one && (state->AMD_conservative_depth_enable || diff --git a/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.cpp b/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.cpp index bbed708942a..12e0becd6cb 100644 --- a/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.cpp @@ -260,7 +260,6 @@ static const _mesa_glsl_extension _mesa_glsl_supported_extensions[] = { EXT(ARB_conservative_depth, false, false, true, true, false, ARB_conservative_depth), EXT(ARB_draw_buffers, false, false, true, true, false, dummy_true), EXT(ARB_draw_instanced, true, false, false, true, false, ARB_draw_instanced), - EXT(ARB_fragment_coord_conventions, true, false, true, true, false, ARB_fragment_coord_conventions), EXT(ARB_texture_rectangle, true, false, true, true, false, dummy_true), EXT(EXT_texture_array, true, false, true, true, false, EXT_texture_array), EXT(ARB_shader_texture_lod, true, false, true, true, false, ARB_shader_texture_lod), diff --git a/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.h b/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.h index 70dc0ae3468..27982646fda 100644 --- a/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.h +++ b/reactos/dll/opengl/mesa/src/glsl/glsl_parser_extras.h @@ -180,8 +180,6 @@ struct _mesa_glsl_parse_state { bool ARB_draw_buffers_warn; bool ARB_draw_instanced_enable; bool ARB_draw_instanced_warn; - bool ARB_fragment_coord_conventions_enable; - bool ARB_fragment_coord_conventions_warn; bool ARB_texture_rectangle_enable; bool ARB_texture_rectangle_warn; bool EXT_texture_array_enable; diff --git a/reactos/dll/opengl/mesa/src/glsl/ir.cpp b/reactos/dll/opengl/mesa/src/glsl/ir.cpp index a5eca5a51a0..4d5883c4e6e 100644 --- a/reactos/dll/opengl/mesa/src/glsl/ir.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/ir.cpp @@ -1325,14 +1325,11 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name, this->ir_type = ir_type_variable; this->type = type; this->name = ralloc_strdup(this, name); - this->explicit_location = false; this->has_initializer = false; this->location = -1; this->warn_extension = NULL; this->constant_value = NULL; this->constant_initializer = NULL; - this->origin_upper_left = false; - this->pixel_center_integer = false; this->depth_layout = ir_depth_layout_none; this->used = false; diff --git a/reactos/dll/opengl/mesa/src/glsl/ir.h b/reactos/dll/opengl/mesa/src/glsl/ir.h index 1fae5864fc9..9f88a8eafbf 100644 --- a/reactos/dll/opengl/mesa/src/glsl/ir.h +++ b/reactos/dll/opengl/mesa/src/glsl/ir.h @@ -347,23 +347,8 @@ public: */ unsigned interpolation:2; - /** - * \name ARB_fragment_coord_conventions - * @{ - */ - unsigned origin_upper_left:1; - unsigned pixel_center_integer:1; /*@}*/ - /** - * Was the location explicitly set in the shader? - * - * If the location is explicitly set in the shader, it \b cannot be changed - * by the linker or by the API (e.g., calls to \c glBindAttribLocation have - * no effect). - */ - unsigned explicit_location:1; - /** * Does this variable have an initializer? * diff --git a/reactos/dll/opengl/mesa/src/glsl/ir_clone.cpp b/reactos/dll/opengl/mesa/src/glsl/ir_clone.cpp index c63615c7eb3..16e4c5079f1 100644 --- a/reactos/dll/opengl/mesa/src/glsl/ir_clone.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/ir_clone.cpp @@ -47,9 +47,6 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const var->interpolation = this->interpolation; var->location = this->location; var->warn_extension = this->warn_extension; - var->origin_upper_left = this->origin_upper_left; - var->pixel_center_integer = this->pixel_center_integer; - var->explicit_location = this->explicit_location; var->has_initializer = this->has_initializer; var->depth_layout = this->depth_layout; @@ -64,9 +61,6 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const sizeof(this->state_slots[0]) * var->num_state_slots); } - if (this->explicit_location) - var->location = this->location; - if (this->constant_value) var->constant_value = this->constant_value->clone(mem_ctx, ht); diff --git a/reactos/dll/opengl/mesa/src/glsl/linker.cpp b/reactos/dll/opengl/mesa/src/glsl/linker.cpp index 816cc277176..c980712146a 100644 --- a/reactos/dll/opengl/mesa/src/glsl/linker.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/linker.cpp @@ -202,7 +202,7 @@ link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode, /* Only assign locations for generic attributes / varyings / etc. */ - if ((var->location >= generic_base) && !var->explicit_location) + if (var->location >= generic_base) var->location = -1; } } @@ -409,19 +409,6 @@ cross_validate_globals(struct gl_shader_program *prog, } } - if (var->explicit_location) { - if (existing->explicit_location - && (var->location != existing->location)) { - linker_error(prog, "explicit locations for %s " - "`%s' have differing values\n", - mode_string(var), var->name); - return false; - } - - existing->location = var->location; - existing->explicit_location = true; - } - /* Validate layout qualifiers for gl_FragDepth. * * From the AMD/ARB_conservative_depth specs: @@ -1214,17 +1201,7 @@ assign_attribute_or_color_locations(gl_shader_program *prog, if ((var == NULL) || (var->mode != (unsigned) direction)) continue; - if (var->explicit_location) { - if ((var->location >= (int)(max_index + generic_base)) - || (var->location < 0)) { - linker_error(prog, - "invalid explicit location %d specified for `%s'\n", - (var->location < 0) - ? var->location : var->location - generic_base, - var->name); - return false; - } - } else if (target_index == MESA_SHADER_VERTEX) { + if (target_index == MESA_SHADER_VERTEX) { unsigned binding; if (prog->AttributeBindings->get(binding, var->name)) { diff --git a/reactos/dll/opengl/mesa/src/glsl/standalone_scaffolding.cpp b/reactos/dll/opengl/mesa/src/glsl/standalone_scaffolding.cpp index 24cc64ad97b..5a39162f214 100644 --- a/reactos/dll/opengl/mesa/src/glsl/standalone_scaffolding.cpp +++ b/reactos/dll/opengl/mesa/src/glsl/standalone_scaffolding.cpp @@ -68,7 +68,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api) ctx->Extensions.dummy_true = true; ctx->Extensions.ARB_ES2_compatibility = true; ctx->Extensions.ARB_draw_instanced = true; - ctx->Extensions.ARB_fragment_coord_conventions = true; ctx->Extensions.EXT_texture_array = true; ctx->Extensions.NV_texture_rectangle = true; ctx->Extensions.EXT_texture3D = true; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/api_validate.c b/reactos/dll/opengl/mesa/src/mesa/main/api_validate.c index 0879a683eb0..172bfa55f69 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/api_validate.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/api_validate.c @@ -164,7 +164,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function) */ static GLboolean check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) + const GLvoid *indices) { struct _mesa_prim prim; struct _mesa_index_buffer ib; @@ -186,8 +186,7 @@ check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type, vbo_get_minmax_index(ctx, &prim, &ib, &min, &max); - if ((int)(min + basevertex) < 0 || - max + basevertex >= ctx->Array.ArrayObj->_MaxElement) { + if (max >= ctx->Array.ArrayObj->_MaxElement) { /* the max element is out of bounds of one or more enabled arrays */ _mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)", max, ctx->Array.ArrayObj->_MaxElement); @@ -223,7 +222,7 @@ _mesa_valid_prim_mode(const struct gl_context *ctx, GLenum mode) GLboolean _mesa_validate_DrawElements(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) + const GLvoid *indices) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -264,7 +263,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx, return GL_FALSE; } - if (!check_index_bounds(ctx, count, type, indices, basevertex)) + if (!check_index_bounds(ctx, count, type, indices)) return GL_FALSE; return GL_TRUE; @@ -280,7 +279,7 @@ GLboolean _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) + const GLvoid *indices) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -325,7 +324,7 @@ _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, return GL_FALSE; } - if (!check_index_bounds(ctx, count, type, indices, basevertex)) + if (!check_index_bounds(ctx, count, type, indices)) return GL_FALSE; return GL_TRUE; @@ -413,8 +412,7 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi GLboolean _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLsizei numInstances, - GLint basevertex) + const GLvoid *indices, GLsizei numInstances) { ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE); @@ -465,7 +463,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, return GL_FALSE; } - if (!check_index_bounds(ctx, count, type, indices, basevertex)) + if (!check_index_bounds(ctx, count, type, indices)) return GL_FALSE; return GL_TRUE; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/api_validate.h b/reactos/dll/opengl/mesa/src/mesa/main/api_validate.h index c03e0952511..9a72f0e0307 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/api_validate.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/api_validate.h @@ -53,13 +53,13 @@ _mesa_validate_DrawArrays(struct gl_context *ctx, extern GLboolean _mesa_validate_DrawElements(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex); + const GLvoid *indices); extern GLboolean _mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex); + const GLvoid *indices); extern GLboolean @@ -69,7 +69,6 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi extern GLboolean _mesa_validate_DrawElementsInstanced(struct gl_context *ctx, GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLsizei primcount, - GLint basevertex); + const GLvoid *indices, GLsizei primcount); #endif diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dd.h b/reactos/dll/opengl/mesa/src/mesa/main/dd.h index 15ce009f459..ccc3efb4b52 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dd.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/dd.h @@ -1022,29 +1022,11 @@ typedef struct { GLenum type, const GLvoid **indices, GLsizei primcount); - void (GLAPIENTRYP DrawElementsBaseVertex)( GLenum mode, GLsizei count, - GLenum type, - const GLvoid *indices, - GLint basevertex ); - void (GLAPIENTRYP DrawRangeElementsBaseVertex)( GLenum mode, GLuint start, - GLuint end, GLsizei count, - GLenum type, - const GLvoid *indices, - GLint basevertex); - void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode, - const GLsizei *count, - GLenum type, - const GLvoid **indices, - GLsizei primcount, - const GLint *basevertex); void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first, GLsizei count, GLsizei primcount); void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei primcount); - void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count, - GLenum type, const GLvoid *indices, - GLsizei primcount, GLint basevertex); /*@}*/ /** diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h b/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h index 7b01b00ebdf..bbff15dd0c3 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/dispatch.h @@ -640,10 +640,6 @@ #define _gloffset_BindVertexArray 583 #define _gloffset_GenVertexArrays 584 #define _gloffset_CopyBufferSubData 585 -#define _gloffset_DrawElementsBaseVertex 593 -#define _gloffset_DrawElementsInstancedBaseVertex 594 -#define _gloffset_DrawRangeElementsBaseVertex 595 -#define _gloffset_MultiDrawElementsBaseVertex 596 #define _gloffset_BlendEquationSeparateiARB 597 #define _gloffset_BlendEquationiARB 598 #define _gloffset_BlendFuncSeparateiARB 599 @@ -1100,10 +1096,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define BindVertexArray_remap_index 175 #define GenVertexArrays_remap_index 176 #define CopyBufferSubData_remap_index 177 -#define DrawElementsBaseVertex_remap_index 185 -#define DrawElementsInstancedBaseVertex_remap_index 186 -#define DrawRangeElementsBaseVertex_remap_index 187 -#define MultiDrawElementsBaseVertex_remap_index 188 #define BlendEquationSeparateiARB_remap_index 189 #define BlendEquationiARB_remap_index 190 #define BlendFuncSeparateiARB_remap_index 191 @@ -1554,10 +1546,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ]; #define _gloffset_BindVertexArray driDispatchRemapTable[BindVertexArray_remap_index] #define _gloffset_GenVertexArrays driDispatchRemapTable[GenVertexArrays_remap_index] #define _gloffset_CopyBufferSubData driDispatchRemapTable[CopyBufferSubData_remap_index] -#define _gloffset_DrawElementsBaseVertex driDispatchRemapTable[DrawElementsBaseVertex_remap_index] -#define _gloffset_DrawElementsInstancedBaseVertex driDispatchRemapTable[DrawElementsInstancedBaseVertex_remap_index] -#define _gloffset_DrawRangeElementsBaseVertex driDispatchRemapTable[DrawRangeElementsBaseVertex_remap_index] -#define _gloffset_MultiDrawElementsBaseVertex driDispatchRemapTable[MultiDrawElementsBaseVertex_remap_index] #define _gloffset_BlendEquationSeparateiARB driDispatchRemapTable[BlendEquationSeparateiARB_remap_index] #define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index] #define _gloffset_BlendFuncSeparateiARB driDispatchRemapTable[BlendFuncSeparateiARB_remap_index] @@ -8137,50 +8125,6 @@ static inline void SET_CopyBufferSubData(struct _glapi_table *disp, void (GLAPIE SET_by_offset(disp, _gloffset_CopyBufferSubData, fn); } -typedef void (GLAPIENTRYP _glptr_DrawElementsBaseVertex)(GLenum, GLsizei, GLenum, const GLvoid *, GLint); -#define CALL_DrawElementsBaseVertex(disp, parameters) \ - (* GET_DrawElementsBaseVertex(disp)) parameters -static inline _glptr_DrawElementsBaseVertex GET_DrawElementsBaseVertex(struct _glapi_table *disp) { - return (_glptr_DrawElementsBaseVertex) (GET_by_offset(disp, _gloffset_DrawElementsBaseVertex)); -} - -static inline void SET_DrawElementsBaseVertex(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLenum, const GLvoid *, GLint)) { - SET_by_offset(disp, _gloffset_DrawElementsBaseVertex, fn); -} - -typedef void (GLAPIENTRYP _glptr_DrawElementsInstancedBaseVertex)(GLenum, GLsizei, GLenum, const GLvoid *, GLsizei, GLint); -#define CALL_DrawElementsInstancedBaseVertex(disp, parameters) \ - (* GET_DrawElementsInstancedBaseVertex(disp)) parameters -static inline _glptr_DrawElementsInstancedBaseVertex GET_DrawElementsInstancedBaseVertex(struct _glapi_table *disp) { - return (_glptr_DrawElementsInstancedBaseVertex) (GET_by_offset(disp, _gloffset_DrawElementsInstancedBaseVertex)); -} - -static inline void SET_DrawElementsInstancedBaseVertex(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLsizei, GLenum, const GLvoid *, GLsizei, GLint)) { - SET_by_offset(disp, _gloffset_DrawElementsInstancedBaseVertex, fn); -} - -typedef void (GLAPIENTRYP _glptr_DrawRangeElementsBaseVertex)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint); -#define CALL_DrawRangeElementsBaseVertex(disp, parameters) \ - (* GET_DrawRangeElementsBaseVertex(disp)) parameters -static inline _glptr_DrawRangeElementsBaseVertex GET_DrawRangeElementsBaseVertex(struct _glapi_table *disp) { - return (_glptr_DrawRangeElementsBaseVertex) (GET_by_offset(disp, _gloffset_DrawRangeElementsBaseVertex)); -} - -static inline void SET_DrawRangeElementsBaseVertex(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *, GLint)) { - SET_by_offset(disp, _gloffset_DrawRangeElementsBaseVertex, fn); -} - -typedef void (GLAPIENTRYP _glptr_MultiDrawElementsBaseVertex)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *); -#define CALL_MultiDrawElementsBaseVertex(disp, parameters) \ - (* GET_MultiDrawElementsBaseVertex(disp)) parameters -static inline _glptr_MultiDrawElementsBaseVertex GET_MultiDrawElementsBaseVertex(struct _glapi_table *disp) { - return (_glptr_MultiDrawElementsBaseVertex) (GET_by_offset(disp, _gloffset_MultiDrawElementsBaseVertex)); -} - -static inline void SET_MultiDrawElementsBaseVertex(struct _glapi_table *disp, void (GLAPIENTRYP fn)(GLenum, const GLsizei *, GLenum, const GLvoid **, GLsizei, const GLint *)) { - SET_by_offset(disp, _gloffset_MultiDrawElementsBaseVertex, fn); -} - typedef void (GLAPIENTRYP _glptr_BlendEquationSeparateiARB)(GLuint, GLenum, GLenum); #define CALL_BlendEquationSeparateiARB(disp, parameters) \ (* GET_BlendEquationSeparateiARB(disp)) parameters diff --git a/reactos/dll/opengl/mesa/src/mesa/main/dlist.c b/reactos/dll/opengl/mesa/src/mesa/main/dlist.c index f9fd7e99646..19ff9661a16 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/dlist.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/dlist.c @@ -1273,19 +1273,6 @@ save_DrawElementsInstancedARB(GLenum mode, "glDrawElementsInstanced() during display list compile"); } -static void GLAPIENTRY -save_DrawElementsInstancedBaseVertexARB(GLenum mode, - GLsizei count, - GLenum type, - const GLvoid *indices, - GLsizei primcount, - GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - _mesa_error(ctx, GL_INVALID_OPERATION, - "glDrawElementsInstancedBaseVertex() during display list compile"); -} - static void invalidate_saved_current_state( struct gl_context *ctx ) { GLint i; @@ -10051,9 +10038,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt) vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB; vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB; - /* GL_ARB_draw_elements_base_vertex */ - vfmt->DrawElementsInstancedBaseVertex = save_DrawElementsInstancedBaseVertexARB; - /* The driver is required to implement these as * 1) They can probably do a better job. * 2) A lot of new mechanisms would have to be added to this module diff --git a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c index 3d5bdb09c12..61bbbaf6c7f 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/extensions.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/extensions.c @@ -85,9 +85,6 @@ static const struct extension extension_table[] = { { "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 }, { "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 }, { "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 }, - { "GL_ARB_draw_elements_base_vertex", o(ARB_draw_elements_base_vertex), GL, 2009 }, - { "GL_ARB_draw_instanced", o(ARB_draw_instanced), GL, 2008 }, - { "GL_ARB_fragment_coord_conventions", o(ARB_fragment_coord_conventions), GL, 2009 }, { "GL_ARB_fragment_program", o(ARB_fragment_program), GL, 2002 }, { "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL, 2003 }, { "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL, 2002 }, @@ -348,9 +345,7 @@ _mesa_enable_sw_extensions(struct gl_context *ctx) { /*ctx->Extensions.ARB_copy_buffer = GL_TRUE;*/ ctx->Extensions.ARB_depth_clamp = GL_TRUE; - ctx->Extensions.ARB_draw_elements_base_vertex = GL_TRUE; ctx->Extensions.ARB_draw_instanced = GL_TRUE; - ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE; #if FEATURE_ARB_fragment_program ctx->Extensions.ARB_fragment_program = GL_TRUE; ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h index b06359e5974..ab6b9afc769 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/mtypes.h @@ -1824,8 +1824,6 @@ struct gl_fragment_program { struct gl_program Base; /**< base class */ GLboolean UsesKill; /**< shader uses KIL instruction */ - GLboolean OriginUpperLeft; - GLboolean PixelCenterInteger; enum gl_frag_depth_layout FragDepthLayout; /** @@ -2495,9 +2493,7 @@ struct gl_extensions GLboolean ARB_depth_buffer_float; GLboolean ARB_depth_clamp; GLboolean ARB_draw_buffers_blend; - GLboolean ARB_draw_elements_base_vertex; GLboolean ARB_draw_instanced; - GLboolean ARB_fragment_coord_conventions; GLboolean ARB_fragment_program; GLboolean ARB_fragment_program_shadow; GLboolean ARB_fragment_shader; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/varray.h b/reactos/dll/opengl/mesa/src/mesa/main/varray.h index 7df9582dfc4..0ac95ebf171 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/varray.h +++ b/reactos/dll/opengl/mesa/src/mesa/main/varray.h @@ -200,12 +200,6 @@ extern void GLAPIENTRY _mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount ); -extern void GLAPIENTRY -_mesa_MultiDrawElementsBaseVertex( GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount, - const GLint *basevertex); - extern void GLAPIENTRY _mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first, const GLsizei * count, diff --git a/reactos/dll/opengl/mesa/src/mesa/main/version.c b/reactos/dll/opengl/mesa/src/mesa/main/version.c index 7a960682b9a..68ddf94c6cb 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/version.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/version.c @@ -148,9 +148,7 @@ compute_version(struct gl_context *ctx) ctx->Const.MaxVertexTextureImageUnits >= 16); const GLboolean ver_3_2 = (ver_3_1 && ctx->Const.GLSLVersion >= 150 && - ctx->Extensions.ARB_depth_clamp && - ctx->Extensions.ARB_draw_elements_base_vertex && - ctx->Extensions.ARB_fragment_coord_conventions); + ctx->Extensions.ARB_depth_clamp); if (ver_3_2) { major = 3; diff --git a/reactos/dll/opengl/mesa/src/mesa/main/vtxfmt.c b/reactos/dll/opengl/mesa/src/mesa/main/vtxfmt.c index d0941477d61..1b3c299ea4c 100644 --- a/reactos/dll/opengl/mesa/src/mesa/main/vtxfmt.c +++ b/reactos/dll/opengl/mesa/src/mesa/main/vtxfmt.c @@ -101,12 +101,8 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt ) SET_DrawElements(tab, vfmt->DrawElements); SET_DrawRangeElements(tab, vfmt->DrawRangeElements); SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT); - SET_DrawElementsBaseVertex(tab, vfmt->DrawElementsBaseVertex); - SET_DrawRangeElementsBaseVertex(tab, vfmt->DrawRangeElementsBaseVertex); - SET_MultiDrawElementsBaseVertex(tab, vfmt->MultiDrawElementsBaseVertex); SET_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced); SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced); - SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex); /* GL_NV_vertex_program */ SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV); diff --git a/reactos/dll/opengl/mesa/src/mesa/program/arbprogparse.c b/reactos/dll/opengl/mesa/src/mesa/program/arbprogparse.c index dffc8abf735..2f6b8db5d62 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/arbprogparse.c +++ b/reactos/dll/opengl/mesa/src/mesa/program/arbprogparse.c @@ -116,8 +116,6 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target, program->Base.SamplersUsed |= (1 << i); } program->Base.ShadowSamplers = prog.ShadowSamplers; - program->OriginUpperLeft = state.option.OriginUpperLeft; - program->PixelCenterInteger = state.option.PixelCenterInteger; program->UsesKill = state.fragment.UsesKill; diff --git a/reactos/dll/opengl/mesa/src/mesa/program/ir_to_mesa.cpp b/reactos/dll/opengl/mesa/src/mesa/program/ir_to_mesa.cpp index b03e4e0c638..03940702526 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/ir_to_mesa.cpp +++ b/reactos/dll/opengl/mesa/src/mesa/program/ir_to_mesa.cpp @@ -680,13 +680,6 @@ ir_to_mesa_visitor::find_variable_storage(ir_variable *var) void ir_to_mesa_visitor::visit(ir_variable *ir) { - if (strcmp(ir->name, "gl_FragCoord") == 0) { - struct gl_fragment_program *fp = (struct gl_fragment_program *)this->prog; - - fp->OriginUpperLeft = ir->origin_upper_left; - fp->PixelCenterInteger = ir->pixel_center_integer; - } - if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) { unsigned int i; const ir_state_slot *const slots = ir->state_slots; diff --git a/reactos/dll/opengl/mesa/src/mesa/program/program.c b/reactos/dll/opengl/mesa/src/mesa/program/program.c index 498f533f76d..ccd97d4119a 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/program.c +++ b/reactos/dll/opengl/mesa/src/mesa/program/program.c @@ -480,8 +480,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog) = (const struct gl_fragment_program *) prog; struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone; fpc->UsesKill = fp->UsesKill; - fpc->OriginUpperLeft = fp->OriginUpperLeft; - fpc->PixelCenterInteger = fp->PixelCenterInteger; } break; default: diff --git a/reactos/dll/opengl/mesa/src/mesa/program/program_parse_extra.c b/reactos/dll/opengl/mesa/src/mesa/program/program_parse_extra.c index 4d928483e16..bedef7479ac 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/program_parse_extra.c +++ b/reactos/dll/opengl/mesa/src/mesa/program/program_parse_extra.c @@ -216,18 +216,6 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option) state->option.Shadow = 1; return 1; } - } else if (strncmp(option, "fragment_coord_", 15) == 0) { - option += 15; - if (state->ctx->Extensions.ARB_fragment_coord_conventions) { - if (strcmp(option, "origin_upper_left") == 0) { - state->option.OriginUpperLeft = 1; - return 1; - } - else if (strcmp(option, "pixel_center_integer") == 0) { - state->option.PixelCenterInteger = 1; - return 1; - } - } } } else if (strncmp(option, "ATI_", 4) == 0) { option += 4; diff --git a/reactos/dll/opengl/mesa/src/mesa/program/program_parser.h b/reactos/dll/opengl/mesa/src/mesa/program/program_parser.h index bc756148a20..a2bdda52987 100644 --- a/reactos/dll/opengl/mesa/src/mesa/program/program_parser.h +++ b/reactos/dll/opengl/mesa/src/mesa/program/program_parser.h @@ -208,8 +208,6 @@ struct asm_parser_state { unsigned TexRect:1; unsigned TexArray:1; unsigned NV_fragment:1; - unsigned OriginUpperLeft:1; - unsigned PixelCenterInteger:1; } option; struct { diff --git a/reactos/dll/opengl/mesa/src/mesa/swrast/s_fragprog.c b/reactos/dll/opengl/mesa/src/mesa/swrast/s_fragprog.c index d6fa40d3e2a..a91ff694bff 100644 --- a/reactos/dll/opengl/mesa/src/mesa/swrast/s_fragprog.c +++ b/reactos/dll/opengl/mesa/src/mesa/swrast/s_fragprog.c @@ -133,21 +133,11 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine, const struct gl_fragment_program *program, const SWspan *span, GLuint col) { - GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col]; - if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) { /* Clear temporary registers (undefined for ARB_f_p) */ memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat)); } - /* ARB_fragment_coord_conventions */ - if (program->OriginUpperLeft) - wpos[1] = ctx->DrawBuffer->Height - 1 - wpos[1]; - if (!program->PixelCenterInteger) { - wpos[0] += 0.5F; - wpos[1] += 0.5F; - } - /* Setup pointer to input attributes */ machine->Attribs = span->array->attribs; diff --git a/reactos/dll/opengl/mesa/src/mesa/tnl/t_draw.c b/reactos/dll/opengl/mesa/src/mesa/tnl/t_draw.c index b6885f1ce11..5b05977fce6 100644 --- a/reactos/dll/opengl/mesa/src/mesa/tnl/t_draw.c +++ b/reactos/dll/opengl/mesa/src/mesa/tnl/t_draw.c @@ -330,27 +330,22 @@ static void bind_indices( struct gl_context *ctx, ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr); } - if (ib->type == GL_UNSIGNED_INT && VB->Primitive[0].basevertex == 0) { + if (ib->type == GL_UNSIGNED_INT) { VB->Elts = (GLuint *) ptr; } else { GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint)); VB->Elts = elts; - if (ib->type == GL_UNSIGNED_INT) { - const GLuint *in = (GLuint *)ptr; - for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; - } - else if (ib->type == GL_UNSIGNED_SHORT) { + if (ib->type == GL_UNSIGNED_SHORT) { const GLushort *in = (GLushort *)ptr; for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; + *elts++ = (GLuint)(*in++); } else { const GLubyte *in = (GLubyte *)ptr; for (i = 0; i < ib->count; i++) - *elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex; + *elts++ = (GLuint)(*in++); } } } @@ -407,17 +402,13 @@ void _tnl_draw_prims( struct gl_context *ctx, TNLcontext *tnl = TNL_CONTEXT(ctx); const GLuint TEST_SPLIT = 0; const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES; - GLint max_basevertex = prim->basevertex; - GLuint i; /* Mesa core state should have been validated already */ assert(ctx->NewState == 0x0); - for (i = 1; i < nr_prims; i++) - max_basevertex = MAX2(max_basevertex, prim[i].basevertex); - if (0) { + GLuint i; printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); for (i = 0; i < nr_prims; i++) printf("prim %d: %s start %d count %d\n", i, @@ -434,7 +425,7 @@ void _tnl_draw_prims( struct gl_context *ctx, _tnl_vbo_draw_prims ); return; } - else if ((GLint)max_index + max_basevertex > max) { + else if (max_index > max) { /* The software TNL pipeline has a fixed amount of storage for * vertices and it is necessary to split incoming drawing commands * if they exceed that limit. @@ -448,7 +439,7 @@ void _tnl_draw_prims( struct gl_context *ctx, * recursively call back into this function. */ vbo_split_prims( ctx, arrays, prim, nr_prims, ib, - 0, max_index + prim->basevertex, + 0, max_index, _tnl_vbo_draw_prims, &limits ); } @@ -460,39 +451,21 @@ void _tnl_draw_prims( struct gl_context *ctx, GLuint nr_bo = 0; GLuint inst; - for (i = 0; i < nr_prims;) { - GLuint this_nr_prims; - - /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices - * will rebase the elements to the basevertex, and we'll only - * emit strings of prims with the same basevertex in one draw call. - */ - for (this_nr_prims = 1; i + this_nr_prims < nr_prims; - this_nr_prims++) { - if (prim[i].basevertex != prim[i + this_nr_prims].basevertex) - break; - } - - assert(prim[i].num_instances > 0); - /* Binding inputs may imply mapping some vertex buffer objects. * They will need to be unmapped below. */ - for (inst = 0; inst < prim[i].num_instances; inst++) { + for (inst = 0; inst < prim[0].num_instances; inst++) { - bind_prims(ctx, &prim[i], this_nr_prims); - bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1, - bo, &nr_bo); - bind_indices(ctx, ib, bo, &nr_bo); + bind_prims(ctx, prim, nr_prims); + bind_inputs(ctx, arrays, max_index + 1, + bo, &nr_bo); + bind_indices(ctx, ib, bo, &nr_bo); - tnl->CurInstance = inst; - TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); + tnl->CurInstance = inst; + TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx); - unmap_vbos(ctx, bo, nr_bo); - free_space(ctx); - } - - i += this_nr_prims; + unmap_vbos(ctx, bo, nr_bo); + free_space(ctx); } } } diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo.h b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo.h index 010bf1d5b56..86802d4580e 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo.h +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo.h @@ -49,7 +49,6 @@ struct _mesa_prim { GLuint start; GLuint count; - GLint basevertex; GLsizei num_instances; }; diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_exec_array.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_exec_array.c index 808532906e1..fbdeac0d465 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_exec_array.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_exec_array.c @@ -736,8 +736,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, GLboolean index_bounds_valid, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices, - GLint basevertex, GLint numInstances) + const GLvoid *indices, GLint numInstances) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -771,7 +770,6 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, prim[0].start = 0; prim[0].count = count; prim[0].indexed = 1; - prim[0].basevertex = basevertex; prim[0].num_instances = numInstances; /* Need to give special consideration to rendering a range of @@ -810,16 +808,14 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode, index_bounds_valid, start, end ); } - /** * Called by glDrawRangeElementsBaseVertex() in immediate mode. */ static void GLAPIENTRY -vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, +vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, - const GLvoid *indices, - GLint basevertex) + const GLvoid *indices) { static GLuint warnCount = 0; GLboolean index_bounds_valid = GL_TRUE; @@ -827,16 +823,16 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, if (MESA_VERBOSE & VERBOSE_DRAW) _mesa_debug(ctx, - "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p, %d)\n", + "glDrawRangeElementsBaseVertex(%s, %u, %u, %d, %s, %p)\n", _mesa_lookup_enum_by_nr(mode), start, end, count, - _mesa_lookup_enum_by_nr(type), indices, basevertex); + _mesa_lookup_enum_by_nr(type), indices); if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count, - type, indices, basevertex )) + type, indices )) return; - if ((int) end + basevertex < 0 || - start + basevertex >= ctx->Array.ArrayObj->_MaxElement) { + if (end < start || + end >= ctx->Array.ArrayObj->_MaxElement) { /* The application requested we draw using a range of indices that's * outside the bounds of the current VBO. This is invalid and appears * to give undefined results. The safest thing to do is to simply @@ -846,10 +842,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, */ if (warnCount++ < 10) { _mesa_warning(ctx, "glDrawRangeElements(start %u, end %u, " - "basevertex %d, count %d, type 0x%x, indices=%p):\n" + "count %d, type 0x%x, indices=%p):\n" "\trange is outside VBO bounds (max=%u); ignoring.\n" "\tThis should be fixed in the application.", - start, end, basevertex, count, type, indices, + start, end, count, type, indices, ctx->Array.ArrayObj->_MaxElement - 1); } index_bounds_valid = GL_FALSE; @@ -872,18 +868,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, } if (0) { - printf("glDraw[Range]Elements{,BaseVertex}" - "(start %u, end %u, type 0x%x, count %d) ElemBuf %u, " - "base %d\n", + printf("glDraw[Range]Elements" + "(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n", start, end, type, count, - ctx->Array.ArrayObj->ElementArrayBufferObj->Name, - basevertex); + ctx->Array.ArrayObj->ElementArrayBufferObj->Name); } - if ((int) start + basevertex < 0 || - end + basevertex >= ctx->Array.ArrayObj->_MaxElement) - index_bounds_valid = GL_FALSE; - #if 0 check_draw_elements_data(ctx, count, type, indices); #else @@ -891,27 +881,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode, #endif vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end, - count, type, indices, basevertex, 1); -} - - -/** - * Called by glDrawRangeElements() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawRangeElements(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, const GLvoid *indices) -{ - if (MESA_VERBOSE & VERBOSE_DRAW) { - GET_CURRENT_CONTEXT(ctx); - _mesa_debug(ctx, - "glDrawRangeElements(%s, %u, %u, %d, %s, %p)\n", - _mesa_lookup_enum_by_nr(mode), start, end, count, - _mesa_lookup_enum_by_nr(type), indices); - } - - vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, - indices, 0); + count, type, indices, 1); } @@ -929,34 +899,11 @@ vbo_exec_DrawElements(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(mode), count, _mesa_lookup_enum_by_nr(type), indices); - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, 0 )) + if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices)) return; vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, 0, 1); -} - - -/** - * Called by glDrawElementsBaseVertex() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawElementsBaseVertex(%s, %d, %s, %p, %d)\n", - _mesa_lookup_enum_by_nr(mode), count, - _mesa_lookup_enum_by_nr(type), indices, basevertex); - - if (!_mesa_validate_DrawElements( ctx, mode, count, type, indices, - basevertex )) - return; - - vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, basevertex, 1); + count, type, indices, 1); } @@ -975,35 +922,11 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, _mesa_lookup_enum_by_nr(type), indices, numInstances); if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, - numInstances, 0)) + numInstances)) return; vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, 0, numInstances); -} - -/** - * Called by glDrawElementsInstancedBaseVertex() in immediate mode. - */ -static void GLAPIENTRY -vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLsizei numInstances, - GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - - if (MESA_VERBOSE & VERBOSE_DRAW) - _mesa_debug(ctx, "glDrawElementsInstancedBaseVertex(%s, %d, %s, %p, %d; %d)\n", - _mesa_lookup_enum_by_nr(mode), count, - _mesa_lookup_enum_by_nr(type), indices, - numInstances, basevertex); - - if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices, - numInstances, basevertex)) - return; - - vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0, - count, type, indices, basevertex, numInstances); + count, type, indices, numInstances); } @@ -1015,8 +938,7 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type static void vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount, - const GLint *basevertex) + const GLvoid **indices, GLsizei primcount) { struct vbo_context *vbo = vbo_context(ctx); struct vbo_exec_context *exec = &vbo->exec; @@ -1097,11 +1019,7 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, prim[i].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size; prim[i].count = count[i]; prim[i].indexed = 1; - prim[i].num_instances = 1; - if (basevertex != NULL) - prim[i].basevertex = basevertex[i]; - else - prim[i].basevertex = 0; + prim[i].num_instances = 1; } check_buffers_are_unmapped(exec->array.inputs); @@ -1124,10 +1042,6 @@ vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode, prim[0].count = count[i]; prim[0].indexed = 1; prim[0].num_instances = 1; - if (basevertex != NULL) - prim[0].basevertex = basevertex[i]; - else - prim[0].basevertex = 0; check_buffers_are_unmapped(exec->array.inputs); vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib, @@ -1151,36 +1065,11 @@ vbo_exec_MultiDrawElements(GLenum mode, ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - 0)) + if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i])) return; } - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, - NULL); -} - - -static void GLAPIENTRY -vbo_exec_MultiDrawElementsBaseVertex(GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, - GLsizei primcount, - const GLsizei *basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - GLint i; - - ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); - - for (i = 0; i < primcount; i++) { - if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i], - basevertex[i])) - return; - } - - vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount, - basevertex); + vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount); } /** @@ -1194,12 +1083,8 @@ vbo_exec_array_init( struct vbo_exec_context *exec ) exec->vtxfmt.DrawElements = vbo_exec_DrawElements; exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements; exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements; - exec->vtxfmt.DrawElementsBaseVertex = vbo_exec_DrawElementsBaseVertex; - exec->vtxfmt.DrawRangeElementsBaseVertex = vbo_exec_DrawRangeElementsBaseVertex; - exec->vtxfmt.MultiDrawElementsBaseVertex = vbo_exec_MultiDrawElementsBaseVertex; exec->vtxfmt.DrawArraysInstanced = vbo_exec_DrawArraysInstanced; exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced; - exec->vtxfmt.DrawElementsInstancedBaseVertex = vbo_exec_DrawElementsInstancedBaseVertex; } @@ -1232,14 +1117,6 @@ _mesa_DrawElements(GLenum mode, GLsizei count, GLenum type, } -void GLAPIENTRY -_mesa_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - vbo_exec_DrawElementsBaseVertex(mode, count, type, indices, basevertex); -} - - void GLAPIENTRY _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices) @@ -1248,16 +1125,6 @@ _mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, } -void GLAPIENTRY -_mesa_DrawRangeElementsBaseVertex(GLenum mode, GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid *indices, GLint basevertex) -{ - vbo_exec_DrawRangeElementsBaseVertex(mode, start, end, count, type, - indices, basevertex); -} - - void GLAPIENTRY _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, const GLvoid **indices, GLsizei primcount) @@ -1265,13 +1132,3 @@ _mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type, vbo_exec_MultiDrawElements(mode, count, type, indices, primcount); } - -void GLAPIENTRY -_mesa_MultiDrawElementsBaseVertex(GLenum mode, - const GLsizei *count, GLenum type, - const GLvoid **indices, GLsizei primcount, - const GLint *basevertex) -{ - vbo_exec_MultiDrawElementsBaseVertex(mode, count, type, indices, - primcount, basevertex); -} diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_noop.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_noop.c index 43001120784..ee2181fc3d9 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_noop.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_noop.c @@ -371,12 +371,6 @@ _mesa_noop_DrawElements(GLenum mode, GLsizei count, GLenum type, { } -static void GLAPIENTRY -_mesa_noop_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices, GLint basevertex) -{ -} - static void GLAPIENTRY _mesa_noop_DrawRangeElements(GLenum mode, @@ -392,24 +386,6 @@ _mesa_noop_MultiDrawElements(GLenum mode, const GLsizei * count, GLenum type, { } -static void GLAPIENTRY -_mesa_noop_DrawRangeElementsBaseVertex(GLenum mode, - GLuint start, GLuint end, - GLsizei count, GLenum type, - const GLvoid * indices, - GLint basevertex) -{ -} - -static void GLAPIENTRY -_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei * count, - GLenum type, - const GLvoid ** indices, - GLsizei primcount, - const GLint * basevertex) -{ -} - static void GLAPIENTRY _mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2) { @@ -500,9 +476,6 @@ _mesa_noop_vtxfmt_init(GLvertexformat * vfmt) vfmt->DrawElements = _mesa_noop_DrawElements; vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements; vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements; - vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex; - vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex; - vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex; } diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_rebase.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_rebase.c index 8efad4e6ed8..d72d71c9180 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_rebase.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_rebase.c @@ -138,22 +138,7 @@ void vbo_rebase_prims( struct gl_context *ctx, printf("%s %d..%d\n", __FUNCTION__, min_index, max_index); - /* XXX this path is disabled for now. - * There's rendering corruption in some apps when it's enabled. - */ - if (0 && ib && ctx->Extensions.ARB_draw_elements_base_vertex) { - /* If we can just tell the hardware or the TNL to interpret our - * indices with a different base, do so. - */ - tmp_prims = (struct _mesa_prim *)malloc(sizeof(*prim) * nr_prims); - - for (i = 0; i < nr_prims; i++) { - tmp_prims[i] = prim[i]; - tmp_prims[i].basevertex -= min_index; - } - - prim = tmp_prims; - } else if (ib) { + if (ib) { /* Unfortunately need to adjust each index individually. */ GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer; diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_save_api.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_save_api.c index 82c57109db8..4546e9318a4 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_save_api.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_save_api.c @@ -979,40 +979,6 @@ _save_DrawRangeElements(GLenum mode, GLuint start, GLuint end, } -static void GLAPIENTRY -_save_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type, - const GLvoid * indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawElements"); -} - - -static void GLAPIENTRY -_save_DrawRangeElementsBaseVertex(GLenum mode, - GLuint start, - GLuint end, - GLsizei count, - GLenum type, - const GLvoid * indices, GLint basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) start; - (void) end; - (void) count; - (void) type; - (void) indices; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, "glDrawRangeElements"); -} - - static void GLAPIENTRY _save_DrawArrays(GLenum mode, GLint start, GLsizei count) { @@ -1038,23 +1004,6 @@ _save_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, } -static void GLAPIENTRY -_save_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, - GLenum type, const GLvoid **indices, - GLsizei primcount, const GLint *basevertex) -{ - GET_CURRENT_CONTEXT(ctx); - (void) mode; - (void) count; - (void) type; - (void) indices; - (void) primcount; - (void) basevertex; - _mesa_compile_error(ctx, GL_INVALID_OPERATION, - "glMultiDrawElementsBaseVertex"); -} - - static void GLAPIENTRY _save_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2) { @@ -1168,7 +1117,7 @@ _save_OBE_DrawElements(GLenum mode, GLsizei count, GLenum type, struct vbo_save_context *save = &vbo_context(ctx)->save; GLint i; - if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices, 0)) + if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices)) return; if (save->out_of_memory) @@ -1216,7 +1165,7 @@ _save_OBE_DrawRangeElements(GLenum mode, GLuint start, GLuint end, struct vbo_save_context *save = &vbo_context(ctx)->save; if (!_mesa_validate_DrawRangeElements(ctx, mode, - start, end, count, type, indices, 0)) + start, end, count, type, indices)) return; if (save->out_of_memory) @@ -1240,25 +1189,6 @@ _save_OBE_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type, } -static void GLAPIENTRY -_save_OBE_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count, - GLenum type, - const GLvoid **indices, - GLsizei primcount, - const GLint *basevertex) -{ - GLsizei i; - - for (i = 0; i < primcount; i++) { - if (count[i] > 0) { - CALL_DrawElementsBaseVertex(GET_DISPATCH(), (mode, count[i], type, - indices[i], - basevertex[i])); - } - } -} - - static void _save_vtxfmt_init(struct gl_context *ctx) { @@ -1356,10 +1286,7 @@ _save_vtxfmt_init(struct gl_context *ctx) vfmt->DrawArrays = _save_DrawArrays; vfmt->DrawElements = _save_DrawElements; vfmt->DrawRangeElements = _save_DrawRangeElements; - vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex; - vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex; vfmt->MultiDrawElementsEXT = _save_MultiDrawElements; - vfmt->MultiDrawElementsBaseVertex = _save_MultiDrawElementsBaseVertex; } @@ -1562,7 +1489,6 @@ vbo_save_api_init(struct vbo_save_context *save) ctx->ListState.ListVtxfmt.DrawElements = _save_OBE_DrawElements; ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements; ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _save_OBE_MultiDrawElements; - ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _save_OBE_MultiDrawElementsBaseVertex; _mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt); } diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split.c index c933a3f9a04..49bdb0a6b46 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split.c @@ -108,14 +108,6 @@ void vbo_split_prims( struct gl_context *ctx, vbo_draw_func draw, const struct split_limits *limits ) { - GLint max_basevertex = prim->basevertex; - GLuint i; - - for (i = 1; i < nr_prims; i++) - max_basevertex = MAX2(max_basevertex, prim[i].basevertex); - - /* XXX max_basevertex is computed but not used, why? */ - if (ib) { if (limits->max_indices == 0) { /* Could traverse the indices, re-emitting vertices in turn. diff --git a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split_copy.c b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split_copy.c index 40e526b1d73..3ec4eb69a83 100644 --- a/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split_copy.c +++ b/reactos/dll/opengl/mesa/src/mesa/vbo/vbo_split_copy.c @@ -588,40 +588,28 @@ void vbo_split_copy( struct gl_context *ctx, const struct split_limits *limits ) { struct copy_context copy; - GLuint i, this_nr_prims; + GLuint i; - for (i = 0; i < nr_prims;) { - /* Our SW TNL pipeline doesn't handle basevertex yet, so bind_indices - * will rebase the elements to the basevertex, and we'll only - * emit strings of prims with the same basevertex in one draw call. - */ - for (this_nr_prims = 1; i + this_nr_prims < nr_prims; - this_nr_prims++) { - if (prim[i].basevertex != prim[i + this_nr_prims].basevertex) - break; - } + memset(©, 0, sizeof(copy)); - memset(©, 0, sizeof(copy)); + /* Require indexed primitives: + */ + assert(ib); - /* Require indexed primitives: - */ - assert(ib); + copy.ctx = ctx; + copy.array = arrays; + copy.prim = prim; + copy.nr_prims = nr_prims; + copy.ib = ib; + copy.draw = draw; + copy.limits = limits; - copy.ctx = ctx; - copy.array = arrays; - copy.prim = &prim[i]; - copy.nr_prims = this_nr_prims; - copy.ib = ib; - copy.draw = draw; - copy.limits = limits; + /* Clear the vertex cache: + */ + for (i = 0; i < ELT_TABLE_SIZE; i++) + copy.vert_cache[i].in = ~0; - /* Clear the vertex cache: - */ - for (i = 0; i < ELT_TABLE_SIZE; i++) - copy.vert_cache[i].in = ~0; - - replay_init(©); - replay_elts(©); - replay_finish(©); - } + replay_init(©); + replay_elts(©); + replay_finish(©); }