mirror of
https://github.com/reactos/reactos.git
synced 2025-07-05 11:31:20 +00:00
[[MESA]
- leaner build part 7 of X - Get rid of the ARB_draw_elements and ARB_fragment_coord_conventions extensions CORE-7499 svn path=/trunk/; revision=60509
This commit is contained in:
parent
94e68da9c3
commit
0ac85330a1
40 changed files with 77 additions and 795 deletions
|
@ -3494,10 +3494,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
|
||||||
add_builtin_define(parser, "GL_EXT_texture_array", 1);
|
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)
|
if (extensions->ARB_shader_texture_lod)
|
||||||
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
|
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
|
||||||
|
|
||||||
|
|
|
@ -2008,8 +2008,7 @@ YY_RULE_SETUP
|
||||||
{
|
{
|
||||||
if ((yyextra->language_version >= 140)
|
if ((yyextra->language_version >= 140)
|
||||||
|| yyextra->AMD_conservative_depth_enable
|
|| yyextra->AMD_conservative_depth_enable
|
||||||
|| yyextra->ARB_conservative_depth_enable
|
|| yyextra->ARB_conservative_depth_enable) {
|
||||||
|| yyextra->ARB_fragment_coord_conventions_enable) {
|
|
||||||
return LAYOUT_TOK;
|
return LAYOUT_TOK;
|
||||||
} else {
|
} else {
|
||||||
yylval->identifier = strdup(yytext);
|
yylval->identifier = strdup(yytext);
|
||||||
|
|
|
@ -4111,12 +4111,6 @@ yyreduce:
|
||||||
}
|
}
|
||||||
|
|
||||||
(yyval.type_qualifier).flags.i = (yyvsp[(1) - (3)].type_qualifier).flags.i | (yyvsp[(3) - (3)].type_qualifier).flags.i;
|
(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;
|
break;
|
||||||
|
|
||||||
|
@ -4129,23 +4123,6 @@ yyreduce:
|
||||||
|
|
||||||
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
|
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. */
|
/* Layout qualifiers for AMD/ARB_conservative_depth. */
|
||||||
if (!got_one &&
|
if (!got_one &&
|
||||||
(state->AMD_conservative_depth_enable ||
|
(state->AMD_conservative_depth_enable ||
|
||||||
|
|
|
@ -352,18 +352,6 @@ struct ast_type_qualifier {
|
||||||
unsigned flat:1;
|
unsigned flat:1;
|
||||||
unsigned noperspective: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 */
|
/** \name Layout qualifiers for GL_AMD_conservative_depth */
|
||||||
/** \{ */
|
/** \{ */
|
||||||
unsigned depth_any:1;
|
unsigned depth_any:1;
|
||||||
|
@ -379,14 +367,6 @@ struct ast_type_qualifier {
|
||||||
unsigned i;
|
unsigned i;
|
||||||
} flags;
|
} 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.
|
* Return true if and only if an interpolation qualifier is present.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -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
|
/* Layout qualifiers for gl_FragDepth, which are enabled by extension
|
||||||
* AMD_conservative_depth.
|
* AMD_conservative_depth.
|
||||||
*/
|
*/
|
||||||
|
@ -2236,26 +2123,6 @@ get_variable_being_redeclared(ir_variable *var, ast_declaration *decl,
|
||||||
earlier->type = var->type;
|
earlier->type = var->type;
|
||||||
delete var;
|
delete var;
|
||||||
var = NULL;
|
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
|
} else if (state->language_version >= 130
|
||||||
&& (strcmp(var->name, "gl_FrontColor") == 0
|
&& (strcmp(var->name, "gl_FrontColor") == 0
|
||||||
|| strcmp(var->name, "gl_BackColor") == 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
|
* This is relaxed in GLSL 1.30. It is also relaxed by any extension
|
||||||
* that adds the 'layout' keyword.
|
* that adds the 'layout' keyword.
|
||||||
*/
|
*/
|
||||||
if ((state->language_version < 130)
|
if (state->language_version < 130) {
|
||||||
&& !state->ARB_fragment_coord_conventions_enable) {
|
|
||||||
if (this->type->qualifier.flags.q.out) {
|
if (this->type->qualifier.flags.q.out) {
|
||||||
_mesa_glsl_error(& loc, state,
|
_mesa_glsl_error(& loc, state,
|
||||||
"`out' qualifier in declaration of `%s' "
|
"`out' qualifier in declaration of `%s' "
|
||||||
|
|
|
@ -407,7 +407,6 @@ add_variable(exec_list *instructions, glsl_symbol_table *symtab,
|
||||||
}
|
}
|
||||||
|
|
||||||
var->location = slot;
|
var->location = slot;
|
||||||
var->explicit_location = (slot >= 0);
|
|
||||||
|
|
||||||
/* Once the variable is created an initialized, add it to the symbol table
|
/* Once the variable is created an initialized, add it to the symbol table
|
||||||
* and add the declaration to the IR stream.
|
* and add the declaration to the IR stream.
|
||||||
|
|
|
@ -3444,10 +3444,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
|
||||||
add_builtin_define(parser, "GL_EXT_texture_array", 1);
|
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)
|
if (extensions->ARB_shader_texture_lod)
|
||||||
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
|
add_builtin_define(parser, "GL_ARB_shader_texture_lod", 1);
|
||||||
|
|
||||||
|
|
|
@ -2001,8 +2001,7 @@ YY_RULE_SETUP
|
||||||
{
|
{
|
||||||
if ((yyextra->language_version >= 140)
|
if ((yyextra->language_version >= 140)
|
||||||
|| yyextra->AMD_conservative_depth_enable
|
|| yyextra->AMD_conservative_depth_enable
|
||||||
|| yyextra->ARB_conservative_depth_enable
|
|| yyextra->ARB_conservative_depth_enable) {
|
||||||
|| yyextra->ARB_fragment_coord_conventions_enable) {
|
|
||||||
return LAYOUT_TOK;
|
return LAYOUT_TOK;
|
||||||
} else {
|
} else {
|
||||||
yylval->identifier = strdup(yytext);
|
yylval->identifier = strdup(yytext);
|
||||||
|
|
|
@ -4080,12 +4080,6 @@ yyreduce:
|
||||||
}
|
}
|
||||||
|
|
||||||
(yyval.type_qualifier).flags.i = (yyvsp[(1) - (3)].type_qualifier).flags.i | (yyvsp[(3) - (3)].type_qualifier).flags.i;
|
(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;
|
break;
|
||||||
|
|
||||||
|
@ -4098,23 +4092,6 @@ yyreduce:
|
||||||
|
|
||||||
memset(& (yyval.type_qualifier), 0, sizeof((yyval.type_qualifier)));
|
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. */
|
/* Layout qualifiers for AMD/ARB_conservative_depth. */
|
||||||
if (!got_one &&
|
if (!got_one &&
|
||||||
(state->AMD_conservative_depth_enable ||
|
(state->AMD_conservative_depth_enable ||
|
||||||
|
|
|
@ -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_conservative_depth, false, false, true, true, false, ARB_conservative_depth),
|
||||||
EXT(ARB_draw_buffers, false, false, true, true, false, dummy_true),
|
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_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(ARB_texture_rectangle, true, false, true, true, false, dummy_true),
|
||||||
EXT(EXT_texture_array, true, false, true, true, false, EXT_texture_array),
|
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),
|
EXT(ARB_shader_texture_lod, true, false, true, true, false, ARB_shader_texture_lod),
|
||||||
|
|
|
@ -180,8 +180,6 @@ struct _mesa_glsl_parse_state {
|
||||||
bool ARB_draw_buffers_warn;
|
bool ARB_draw_buffers_warn;
|
||||||
bool ARB_draw_instanced_enable;
|
bool ARB_draw_instanced_enable;
|
||||||
bool ARB_draw_instanced_warn;
|
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_enable;
|
||||||
bool ARB_texture_rectangle_warn;
|
bool ARB_texture_rectangle_warn;
|
||||||
bool EXT_texture_array_enable;
|
bool EXT_texture_array_enable;
|
||||||
|
|
|
@ -1325,14 +1325,11 @@ ir_variable::ir_variable(const struct glsl_type *type, const char *name,
|
||||||
this->ir_type = ir_type_variable;
|
this->ir_type = ir_type_variable;
|
||||||
this->type = type;
|
this->type = type;
|
||||||
this->name = ralloc_strdup(this, name);
|
this->name = ralloc_strdup(this, name);
|
||||||
this->explicit_location = false;
|
|
||||||
this->has_initializer = false;
|
this->has_initializer = false;
|
||||||
this->location = -1;
|
this->location = -1;
|
||||||
this->warn_extension = NULL;
|
this->warn_extension = NULL;
|
||||||
this->constant_value = NULL;
|
this->constant_value = NULL;
|
||||||
this->constant_initializer = NULL;
|
this->constant_initializer = NULL;
|
||||||
this->origin_upper_left = false;
|
|
||||||
this->pixel_center_integer = false;
|
|
||||||
this->depth_layout = ir_depth_layout_none;
|
this->depth_layout = ir_depth_layout_none;
|
||||||
this->used = false;
|
this->used = false;
|
||||||
|
|
||||||
|
|
|
@ -347,23 +347,8 @@ public:
|
||||||
*/
|
*/
|
||||||
unsigned interpolation:2;
|
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?
|
* Does this variable have an initializer?
|
||||||
*
|
*
|
||||||
|
|
|
@ -47,9 +47,6 @@ ir_variable::clone(void *mem_ctx, struct hash_table *ht) const
|
||||||
var->interpolation = this->interpolation;
|
var->interpolation = this->interpolation;
|
||||||
var->location = this->location;
|
var->location = this->location;
|
||||||
var->warn_extension = this->warn_extension;
|
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->has_initializer = this->has_initializer;
|
||||||
var->depth_layout = this->depth_layout;
|
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);
|
sizeof(this->state_slots[0]) * var->num_state_slots);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->explicit_location)
|
|
||||||
var->location = this->location;
|
|
||||||
|
|
||||||
if (this->constant_value)
|
if (this->constant_value)
|
||||||
var->constant_value = this->constant_value->clone(mem_ctx, ht);
|
var->constant_value = this->constant_value->clone(mem_ctx, ht);
|
||||||
|
|
||||||
|
|
|
@ -202,7 +202,7 @@ link_invalidate_variable_locations(gl_shader *sh, enum ir_variable_mode mode,
|
||||||
|
|
||||||
/* Only assign locations for generic attributes / varyings / etc.
|
/* Only assign locations for generic attributes / varyings / etc.
|
||||||
*/
|
*/
|
||||||
if ((var->location >= generic_base) && !var->explicit_location)
|
if (var->location >= generic_base)
|
||||||
var->location = -1;
|
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.
|
/* Validate layout qualifiers for gl_FragDepth.
|
||||||
*
|
*
|
||||||
* From the AMD/ARB_conservative_depth specs:
|
* 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))
|
if ((var == NULL) || (var->mode != (unsigned) direction))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (var->explicit_location) {
|
if (target_index == MESA_SHADER_VERTEX) {
|
||||||
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) {
|
|
||||||
unsigned binding;
|
unsigned binding;
|
||||||
|
|
||||||
if (prog->AttributeBindings->get(binding, var->name)) {
|
if (prog->AttributeBindings->get(binding, var->name)) {
|
||||||
|
|
|
@ -68,7 +68,6 @@ void initialize_context_to_defaults(struct gl_context *ctx, gl_api api)
|
||||||
ctx->Extensions.dummy_true = true;
|
ctx->Extensions.dummy_true = true;
|
||||||
ctx->Extensions.ARB_ES2_compatibility = true;
|
ctx->Extensions.ARB_ES2_compatibility = true;
|
||||||
ctx->Extensions.ARB_draw_instanced = true;
|
ctx->Extensions.ARB_draw_instanced = true;
|
||||||
ctx->Extensions.ARB_fragment_coord_conventions = true;
|
|
||||||
ctx->Extensions.EXT_texture_array = true;
|
ctx->Extensions.EXT_texture_array = true;
|
||||||
ctx->Extensions.NV_texture_rectangle = true;
|
ctx->Extensions.NV_texture_rectangle = true;
|
||||||
ctx->Extensions.EXT_texture3D = true;
|
ctx->Extensions.EXT_texture3D = true;
|
||||||
|
|
|
@ -164,7 +164,7 @@ check_valid_to_render(struct gl_context *ctx, const char *function)
|
||||||
*/
|
*/
|
||||||
static GLboolean
|
static GLboolean
|
||||||
check_index_bounds(struct gl_context *ctx, GLsizei count, GLenum type,
|
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_prim prim;
|
||||||
struct _mesa_index_buffer ib;
|
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);
|
vbo_get_minmax_index(ctx, &prim, &ib, &min, &max);
|
||||||
|
|
||||||
if ((int)(min + basevertex) < 0 ||
|
if (max >= ctx->Array.ArrayObj->_MaxElement) {
|
||||||
max + basevertex >= ctx->Array.ArrayObj->_MaxElement) {
|
|
||||||
/* the max element is out of bounds of one or more enabled arrays */
|
/* 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)",
|
_mesa_warning(ctx, "glDrawElements() index=%u is out of bounds (max=%u)",
|
||||||
max, ctx->Array.ArrayObj->_MaxElement);
|
max, ctx->Array.ArrayObj->_MaxElement);
|
||||||
|
@ -223,7 +222,7 @@ _mesa_valid_prim_mode(const struct gl_context *ctx, GLenum mode)
|
||||||
GLboolean
|
GLboolean
|
||||||
_mesa_validate_DrawElements(struct gl_context *ctx,
|
_mesa_validate_DrawElements(struct gl_context *ctx,
|
||||||
GLenum mode, GLsizei count, GLenum type,
|
GLenum mode, GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLint basevertex)
|
const GLvoid *indices)
|
||||||
{
|
{
|
||||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||||
|
|
||||||
|
@ -264,7 +263,7 @@ _mesa_validate_DrawElements(struct gl_context *ctx,
|
||||||
return GL_FALSE;
|
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_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
@ -280,7 +279,7 @@ GLboolean
|
||||||
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
|
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
|
||||||
GLuint start, GLuint end,
|
GLuint start, GLuint end,
|
||||||
GLsizei count, GLenum type,
|
GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLint basevertex)
|
const GLvoid *indices)
|
||||||
{
|
{
|
||||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
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;
|
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_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
@ -413,8 +412,7 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
|
||||||
GLboolean
|
GLboolean
|
||||||
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
||||||
GLenum mode, GLsizei count, GLenum type,
|
GLenum mode, GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLsizei numInstances,
|
const GLvoid *indices, GLsizei numInstances)
|
||||||
GLint basevertex)
|
|
||||||
{
|
{
|
||||||
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx, GL_FALSE);
|
||||||
|
|
||||||
|
@ -465,7 +463,7 @@ _mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
||||||
return GL_FALSE;
|
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_FALSE;
|
||||||
|
|
||||||
return GL_TRUE;
|
return GL_TRUE;
|
||||||
|
|
|
@ -53,13 +53,13 @@ _mesa_validate_DrawArrays(struct gl_context *ctx,
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_mesa_validate_DrawElements(struct gl_context *ctx,
|
_mesa_validate_DrawElements(struct gl_context *ctx,
|
||||||
GLenum mode, GLsizei count, GLenum type,
|
GLenum mode, GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLint basevertex);
|
const GLvoid *indices);
|
||||||
|
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
|
_mesa_validate_DrawRangeElements(struct gl_context *ctx, GLenum mode,
|
||||||
GLuint start, GLuint end,
|
GLuint start, GLuint end,
|
||||||
GLsizei count, GLenum type,
|
GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLint basevertex);
|
const GLvoid *indices);
|
||||||
|
|
||||||
|
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
|
@ -69,7 +69,6 @@ _mesa_validate_DrawArraysInstanced(struct gl_context *ctx, GLenum mode, GLint fi
|
||||||
extern GLboolean
|
extern GLboolean
|
||||||
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
_mesa_validate_DrawElementsInstanced(struct gl_context *ctx,
|
||||||
GLenum mode, GLsizei count, GLenum type,
|
GLenum mode, GLsizei count, GLenum type,
|
||||||
const GLvoid *indices, GLsizei primcount,
|
const GLvoid *indices, GLsizei primcount);
|
||||||
GLint basevertex);
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1022,29 +1022,11 @@ typedef struct {
|
||||||
GLenum type,
|
GLenum type,
|
||||||
const GLvoid **indices,
|
const GLvoid **indices,
|
||||||
GLsizei primcount);
|
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,
|
void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
|
||||||
GLsizei count, GLsizei primcount);
|
GLsizei count, GLsizei primcount);
|
||||||
void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
|
void (GLAPIENTRYP DrawElementsInstanced)(GLenum mode, GLsizei count,
|
||||||
GLenum type, const GLvoid *indices,
|
GLenum type, const GLvoid *indices,
|
||||||
GLsizei primcount);
|
GLsizei primcount);
|
||||||
void (GLAPIENTRYP DrawElementsInstancedBaseVertex)(GLenum mode, GLsizei count,
|
|
||||||
GLenum type, const GLvoid *indices,
|
|
||||||
GLsizei primcount, GLint basevertex);
|
|
||||||
/*@}*/
|
/*@}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -640,10 +640,6 @@
|
||||||
#define _gloffset_BindVertexArray 583
|
#define _gloffset_BindVertexArray 583
|
||||||
#define _gloffset_GenVertexArrays 584
|
#define _gloffset_GenVertexArrays 584
|
||||||
#define _gloffset_CopyBufferSubData 585
|
#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_BlendEquationSeparateiARB 597
|
||||||
#define _gloffset_BlendEquationiARB 598
|
#define _gloffset_BlendEquationiARB 598
|
||||||
#define _gloffset_BlendFuncSeparateiARB 599
|
#define _gloffset_BlendFuncSeparateiARB 599
|
||||||
|
@ -1100,10 +1096,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define BindVertexArray_remap_index 175
|
#define BindVertexArray_remap_index 175
|
||||||
#define GenVertexArrays_remap_index 176
|
#define GenVertexArrays_remap_index 176
|
||||||
#define CopyBufferSubData_remap_index 177
|
#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 BlendEquationSeparateiARB_remap_index 189
|
||||||
#define BlendEquationiARB_remap_index 190
|
#define BlendEquationiARB_remap_index 190
|
||||||
#define BlendFuncSeparateiARB_remap_index 191
|
#define BlendFuncSeparateiARB_remap_index 191
|
||||||
|
@ -1554,10 +1546,6 @@ extern int driDispatchRemapTable[ driDispatchRemapTable_size ];
|
||||||
#define _gloffset_BindVertexArray driDispatchRemapTable[BindVertexArray_remap_index]
|
#define _gloffset_BindVertexArray driDispatchRemapTable[BindVertexArray_remap_index]
|
||||||
#define _gloffset_GenVertexArrays driDispatchRemapTable[GenVertexArrays_remap_index]
|
#define _gloffset_GenVertexArrays driDispatchRemapTable[GenVertexArrays_remap_index]
|
||||||
#define _gloffset_CopyBufferSubData driDispatchRemapTable[CopyBufferSubData_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_BlendEquationSeparateiARB driDispatchRemapTable[BlendEquationSeparateiARB_remap_index]
|
||||||
#define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index]
|
#define _gloffset_BlendEquationiARB driDispatchRemapTable[BlendEquationiARB_remap_index]
|
||||||
#define _gloffset_BlendFuncSeparateiARB driDispatchRemapTable[BlendFuncSeparateiARB_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);
|
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);
|
typedef void (GLAPIENTRYP _glptr_BlendEquationSeparateiARB)(GLuint, GLenum, GLenum);
|
||||||
#define CALL_BlendEquationSeparateiARB(disp, parameters) \
|
#define CALL_BlendEquationSeparateiARB(disp, parameters) \
|
||||||
(* GET_BlendEquationSeparateiARB(disp)) parameters
|
(* GET_BlendEquationSeparateiARB(disp)) parameters
|
||||||
|
|
|
@ -1273,19 +1273,6 @@ save_DrawElementsInstancedARB(GLenum mode,
|
||||||
"glDrawElementsInstanced() during display list compile");
|
"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 )
|
static void invalidate_saved_current_state( struct gl_context *ctx )
|
||||||
{
|
{
|
||||||
GLint i;
|
GLint i;
|
||||||
|
@ -10051,9 +10038,6 @@ _mesa_save_vtxfmt_init(GLvertexformat * vfmt)
|
||||||
vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB;
|
vfmt->DrawArraysInstanced = save_DrawArraysInstancedARB;
|
||||||
vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB;
|
vfmt->DrawElementsInstanced = save_DrawElementsInstancedARB;
|
||||||
|
|
||||||
/* GL_ARB_draw_elements_base_vertex */
|
|
||||||
vfmt->DrawElementsInstancedBaseVertex = save_DrawElementsInstancedBaseVertexARB;
|
|
||||||
|
|
||||||
/* The driver is required to implement these as
|
/* The driver is required to implement these as
|
||||||
* 1) They can probably do a better job.
|
* 1) They can probably do a better job.
|
||||||
* 2) A lot of new mechanisms would have to be added to this module
|
* 2) A lot of new mechanisms would have to be added to this module
|
||||||
|
|
|
@ -85,9 +85,6 @@ static const struct extension extension_table[] = {
|
||||||
{ "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
|
{ "GL_ARB_depth_clamp", o(ARB_depth_clamp), GL, 2003 },
|
||||||
{ "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 },
|
{ "GL_ARB_draw_buffers", o(dummy_true), GL, 2002 },
|
||||||
{ "GL_ARB_draw_buffers_blend", o(ARB_draw_buffers_blend), GL, 2009 },
|
{ "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", o(ARB_fragment_program), GL, 2002 },
|
||||||
{ "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL, 2003 },
|
{ "GL_ARB_fragment_program_shadow", o(ARB_fragment_program_shadow), GL, 2003 },
|
||||||
{ "GL_ARB_fragment_shader", o(ARB_fragment_shader), GL, 2002 },
|
{ "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_copy_buffer = GL_TRUE;*/
|
||||||
ctx->Extensions.ARB_depth_clamp = 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_draw_instanced = GL_TRUE;
|
||||||
ctx->Extensions.ARB_fragment_coord_conventions = GL_TRUE;
|
|
||||||
#if FEATURE_ARB_fragment_program
|
#if FEATURE_ARB_fragment_program
|
||||||
ctx->Extensions.ARB_fragment_program = GL_TRUE;
|
ctx->Extensions.ARB_fragment_program = GL_TRUE;
|
||||||
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
|
ctx->Extensions.ARB_fragment_program_shadow = GL_TRUE;
|
||||||
|
|
|
@ -1824,8 +1824,6 @@ struct gl_fragment_program
|
||||||
{
|
{
|
||||||
struct gl_program Base; /**< base class */
|
struct gl_program Base; /**< base class */
|
||||||
GLboolean UsesKill; /**< shader uses KIL instruction */
|
GLboolean UsesKill; /**< shader uses KIL instruction */
|
||||||
GLboolean OriginUpperLeft;
|
|
||||||
GLboolean PixelCenterInteger;
|
|
||||||
enum gl_frag_depth_layout FragDepthLayout;
|
enum gl_frag_depth_layout FragDepthLayout;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2495,9 +2493,7 @@ struct gl_extensions
|
||||||
GLboolean ARB_depth_buffer_float;
|
GLboolean ARB_depth_buffer_float;
|
||||||
GLboolean ARB_depth_clamp;
|
GLboolean ARB_depth_clamp;
|
||||||
GLboolean ARB_draw_buffers_blend;
|
GLboolean ARB_draw_buffers_blend;
|
||||||
GLboolean ARB_draw_elements_base_vertex;
|
|
||||||
GLboolean ARB_draw_instanced;
|
GLboolean ARB_draw_instanced;
|
||||||
GLboolean ARB_fragment_coord_conventions;
|
|
||||||
GLboolean ARB_fragment_program;
|
GLboolean ARB_fragment_program;
|
||||||
GLboolean ARB_fragment_program_shadow;
|
GLboolean ARB_fragment_program_shadow;
|
||||||
GLboolean ARB_fragment_shader;
|
GLboolean ARB_fragment_shader;
|
||||||
|
|
|
@ -200,12 +200,6 @@ extern void GLAPIENTRY
|
||||||
_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
|
_mesa_MultiDrawElementsEXT( GLenum mode, const GLsizei *count, GLenum type,
|
||||||
const GLvoid **indices, GLsizei primcount );
|
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
|
extern void GLAPIENTRY
|
||||||
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
|
_mesa_MultiModeDrawArraysIBM( const GLenum * mode, const GLint * first,
|
||||||
const GLsizei * count,
|
const GLsizei * count,
|
||||||
|
|
|
@ -148,9 +148,7 @@ compute_version(struct gl_context *ctx)
|
||||||
ctx->Const.MaxVertexTextureImageUnits >= 16);
|
ctx->Const.MaxVertexTextureImageUnits >= 16);
|
||||||
const GLboolean ver_3_2 = (ver_3_1 &&
|
const GLboolean ver_3_2 = (ver_3_1 &&
|
||||||
ctx->Const.GLSLVersion >= 150 &&
|
ctx->Const.GLSLVersion >= 150 &&
|
||||||
ctx->Extensions.ARB_depth_clamp &&
|
ctx->Extensions.ARB_depth_clamp);
|
||||||
ctx->Extensions.ARB_draw_elements_base_vertex &&
|
|
||||||
ctx->Extensions.ARB_fragment_coord_conventions);
|
|
||||||
|
|
||||||
if (ver_3_2) {
|
if (ver_3_2) {
|
||||||
major = 3;
|
major = 3;
|
||||||
|
|
|
@ -101,12 +101,8 @@ install_vtxfmt( struct _glapi_table *tab, const GLvertexformat *vfmt )
|
||||||
SET_DrawElements(tab, vfmt->DrawElements);
|
SET_DrawElements(tab, vfmt->DrawElements);
|
||||||
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
|
SET_DrawRangeElements(tab, vfmt->DrawRangeElements);
|
||||||
SET_MultiDrawElementsEXT(tab, vfmt->MultiDrawElementsEXT);
|
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_DrawArraysInstancedARB(tab, vfmt->DrawArraysInstanced);
|
||||||
SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
|
SET_DrawElementsInstancedARB(tab, vfmt->DrawElementsInstanced);
|
||||||
SET_DrawElementsInstancedBaseVertex(tab, vfmt->DrawElementsInstancedBaseVertex);
|
|
||||||
|
|
||||||
/* GL_NV_vertex_program */
|
/* GL_NV_vertex_program */
|
||||||
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
|
SET_VertexAttrib1fNV(tab, vfmt->VertexAttrib1fNV);
|
||||||
|
|
|
@ -116,8 +116,6 @@ _mesa_parse_arb_fragment_program(struct gl_context* ctx, GLenum target,
|
||||||
program->Base.SamplersUsed |= (1 << i);
|
program->Base.SamplersUsed |= (1 << i);
|
||||||
}
|
}
|
||||||
program->Base.ShadowSamplers = prog.ShadowSamplers;
|
program->Base.ShadowSamplers = prog.ShadowSamplers;
|
||||||
program->OriginUpperLeft = state.option.OriginUpperLeft;
|
|
||||||
program->PixelCenterInteger = state.option.PixelCenterInteger;
|
|
||||||
|
|
||||||
program->UsesKill = state.fragment.UsesKill;
|
program->UsesKill = state.fragment.UsesKill;
|
||||||
|
|
||||||
|
|
|
@ -680,13 +680,6 @@ ir_to_mesa_visitor::find_variable_storage(ir_variable *var)
|
||||||
void
|
void
|
||||||
ir_to_mesa_visitor::visit(ir_variable *ir)
|
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) {
|
if (ir->mode == ir_var_uniform && strncmp(ir->name, "gl_", 3) == 0) {
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
const ir_state_slot *const slots = ir->state_slots;
|
const ir_state_slot *const slots = ir->state_slots;
|
||||||
|
|
|
@ -480,8 +480,6 @@ _mesa_clone_program(struct gl_context *ctx, const struct gl_program *prog)
|
||||||
= (const struct gl_fragment_program *) prog;
|
= (const struct gl_fragment_program *) prog;
|
||||||
struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone;
|
struct gl_fragment_program *fpc = (struct gl_fragment_program *) clone;
|
||||||
fpc->UsesKill = fp->UsesKill;
|
fpc->UsesKill = fp->UsesKill;
|
||||||
fpc->OriginUpperLeft = fp->OriginUpperLeft;
|
|
||||||
fpc->PixelCenterInteger = fp->PixelCenterInteger;
|
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -216,18 +216,6 @@ _mesa_ARBfp_parse_option(struct asm_parser_state *state, const char *option)
|
||||||
state->option.Shadow = 1;
|
state->option.Shadow = 1;
|
||||||
return 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) {
|
} else if (strncmp(option, "ATI_", 4) == 0) {
|
||||||
option += 4;
|
option += 4;
|
||||||
|
|
|
@ -208,8 +208,6 @@ struct asm_parser_state {
|
||||||
unsigned TexRect:1;
|
unsigned TexRect:1;
|
||||||
unsigned TexArray:1;
|
unsigned TexArray:1;
|
||||||
unsigned NV_fragment:1;
|
unsigned NV_fragment:1;
|
||||||
unsigned OriginUpperLeft:1;
|
|
||||||
unsigned PixelCenterInteger:1;
|
|
||||||
} option;
|
} option;
|
||||||
|
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -133,21 +133,11 @@ init_machine(struct gl_context *ctx, struct gl_program_machine *machine,
|
||||||
const struct gl_fragment_program *program,
|
const struct gl_fragment_program *program,
|
||||||
const SWspan *span, GLuint col)
|
const SWspan *span, GLuint col)
|
||||||
{
|
{
|
||||||
GLfloat *wpos = span->array->attribs[FRAG_ATTRIB_WPOS][col];
|
|
||||||
|
|
||||||
if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
|
if (program->Base.Target == GL_FRAGMENT_PROGRAM_NV) {
|
||||||
/* Clear temporary registers (undefined for ARB_f_p) */
|
/* Clear temporary registers (undefined for ARB_f_p) */
|
||||||
memset(machine->Temporaries, 0, MAX_PROGRAM_TEMPS * 4 * sizeof(GLfloat));
|
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 */
|
/* Setup pointer to input attributes */
|
||||||
machine->Attribs = span->array->attribs;
|
machine->Attribs = span->array->attribs;
|
||||||
|
|
||||||
|
|
|
@ -330,27 +330,22 @@ static void bind_indices( struct gl_context *ctx,
|
||||||
ptr = ADD_POINTERS(ib->obj->Pointer, ib->ptr);
|
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;
|
VB->Elts = (GLuint *) ptr;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint));
|
GLuint *elts = (GLuint *)get_space(ctx, ib->count * sizeof(GLuint));
|
||||||
VB->Elts = elts;
|
VB->Elts = elts;
|
||||||
|
|
||||||
if (ib->type == GL_UNSIGNED_INT) {
|
if (ib->type == GL_UNSIGNED_SHORT) {
|
||||||
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) {
|
|
||||||
const GLushort *in = (GLushort *)ptr;
|
const GLushort *in = (GLushort *)ptr;
|
||||||
for (i = 0; i < ib->count; i++)
|
for (i = 0; i < ib->count; i++)
|
||||||
*elts++ = (GLuint)(*in++) + VB->Primitive[0].basevertex;
|
*elts++ = (GLuint)(*in++);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
const GLubyte *in = (GLubyte *)ptr;
|
const GLubyte *in = (GLubyte *)ptr;
|
||||||
for (i = 0; i < ib->count; i++)
|
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);
|
TNLcontext *tnl = TNL_CONTEXT(ctx);
|
||||||
const GLuint TEST_SPLIT = 0;
|
const GLuint TEST_SPLIT = 0;
|
||||||
const GLint max = TEST_SPLIT ? 8 : tnl->vb.Size - MAX_CLIPPED_VERTICES;
|
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 */
|
/* Mesa core state should have been validated already */
|
||||||
assert(ctx->NewState == 0x0);
|
assert(ctx->NewState == 0x0);
|
||||||
|
|
||||||
for (i = 1; i < nr_prims; i++)
|
|
||||||
max_basevertex = MAX2(max_basevertex, prim[i].basevertex);
|
|
||||||
|
|
||||||
if (0)
|
if (0)
|
||||||
{
|
{
|
||||||
|
GLuint i;
|
||||||
printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
|
printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
|
||||||
for (i = 0; i < nr_prims; i++)
|
for (i = 0; i < nr_prims; i++)
|
||||||
printf("prim %d: %s start %d count %d\n", 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 );
|
_tnl_vbo_draw_prims );
|
||||||
return;
|
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
|
/* The software TNL pipeline has a fixed amount of storage for
|
||||||
* vertices and it is necessary to split incoming drawing commands
|
* vertices and it is necessary to split incoming drawing commands
|
||||||
* if they exceed that limit.
|
* if they exceed that limit.
|
||||||
|
@ -448,7 +439,7 @@ void _tnl_draw_prims( struct gl_context *ctx,
|
||||||
* recursively call back into this function.
|
* recursively call back into this function.
|
||||||
*/
|
*/
|
||||||
vbo_split_prims( ctx, arrays, prim, nr_prims, ib,
|
vbo_split_prims( ctx, arrays, prim, nr_prims, ib,
|
||||||
0, max_index + prim->basevertex,
|
0, max_index,
|
||||||
_tnl_vbo_draw_prims,
|
_tnl_vbo_draw_prims,
|
||||||
&limits );
|
&limits );
|
||||||
}
|
}
|
||||||
|
@ -460,39 +451,21 @@ void _tnl_draw_prims( struct gl_context *ctx,
|
||||||
GLuint nr_bo = 0;
|
GLuint nr_bo = 0;
|
||||||
GLuint inst;
|
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.
|
/* Binding inputs may imply mapping some vertex buffer objects.
|
||||||
* They will need to be unmapped below.
|
* 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_prims(ctx, prim, nr_prims);
|
||||||
bind_inputs(ctx, arrays, max_index + prim[i].basevertex + 1,
|
bind_inputs(ctx, arrays, max_index + 1,
|
||||||
bo, &nr_bo);
|
bo, &nr_bo);
|
||||||
bind_indices(ctx, ib, bo, &nr_bo);
|
bind_indices(ctx, ib, bo, &nr_bo);
|
||||||
|
|
||||||
tnl->CurInstance = inst;
|
tnl->CurInstance = inst;
|
||||||
TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
|
TNL_CONTEXT(ctx)->Driver.RunPipeline(ctx);
|
||||||
|
|
||||||
unmap_vbos(ctx, bo, nr_bo);
|
unmap_vbos(ctx, bo, nr_bo);
|
||||||
free_space(ctx);
|
free_space(ctx);
|
||||||
}
|
|
||||||
|
|
||||||
i += this_nr_prims;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -49,7 +49,6 @@ struct _mesa_prim {
|
||||||
|
|
||||||
GLuint start;
|
GLuint start;
|
||||||
GLuint count;
|
GLuint count;
|
||||||
GLint basevertex;
|
|
||||||
GLsizei num_instances;
|
GLsizei num_instances;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -736,8 +736,7 @@ vbo_validated_drawrangeelements(struct gl_context *ctx, GLenum mode,
|
||||||
GLboolean index_bounds_valid,
|
GLboolean index_bounds_valid,
|
||||||
GLuint start, GLuint end,
|
GLuint start, GLuint end,
|
||||||
GLsizei count, GLenum type,
|
GLsizei count, GLenum type,
|
||||||
const GLvoid *indices,
|
const GLvoid *indices, GLint numInstances)
|
||||||
GLint basevertex, GLint numInstances)
|
|
||||||
{
|
{
|
||||||
struct vbo_context *vbo = vbo_context(ctx);
|
struct vbo_context *vbo = vbo_context(ctx);
|
||||||
struct vbo_exec_context *exec = &vbo->exec;
|
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].start = 0;
|
||||||
prim[0].count = count;
|
prim[0].count = count;
|
||||||
prim[0].indexed = 1;
|
prim[0].indexed = 1;
|
||||||
prim[0].basevertex = basevertex;
|
|
||||||
prim[0].num_instances = numInstances;
|
prim[0].num_instances = numInstances;
|
||||||
|
|
||||||
/* Need to give special consideration to rendering a range of
|
/* 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 );
|
index_bounds_valid, start, end );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called by glDrawRangeElementsBaseVertex() in immediate mode.
|
* Called by glDrawRangeElementsBaseVertex() in immediate mode.
|
||||||
*/
|
*/
|
||||||
static void GLAPIENTRY
|
static void GLAPIENTRY
|
||||||
vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
|
vbo_exec_DrawRangeElements(GLenum mode,
|
||||||
GLuint start, GLuint end,
|
GLuint start, GLuint end,
|
||||||
GLsizei count, GLenum type,
|
GLsizei count, GLenum type,
|
||||||
const GLvoid *indices,
|
const GLvoid *indices)
|
||||||
GLint basevertex)
|
|
||||||
{
|
{
|
||||||
static GLuint warnCount = 0;
|
static GLuint warnCount = 0;
|
||||||
GLboolean index_bounds_valid = GL_TRUE;
|
GLboolean index_bounds_valid = GL_TRUE;
|
||||||
|
@ -827,16 +823,16 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
|
||||||
|
|
||||||
if (MESA_VERBOSE & VERBOSE_DRAW)
|
if (MESA_VERBOSE & VERBOSE_DRAW)
|
||||||
_mesa_debug(ctx,
|
_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(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,
|
if (!_mesa_validate_DrawRangeElements( ctx, mode, start, end, count,
|
||||||
type, indices, basevertex ))
|
type, indices ))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ((int) end + basevertex < 0 ||
|
if (end < start ||
|
||||||
start + basevertex >= ctx->Array.ArrayObj->_MaxElement) {
|
end >= ctx->Array.ArrayObj->_MaxElement) {
|
||||||
/* The application requested we draw using a range of indices that's
|
/* The application requested we draw using a range of indices that's
|
||||||
* outside the bounds of the current VBO. This is invalid and appears
|
* outside the bounds of the current VBO. This is invalid and appears
|
||||||
* to give undefined results. The safest thing to do is to simply
|
* to give undefined results. The safest thing to do is to simply
|
||||||
|
@ -846,10 +842,10 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
|
||||||
*/
|
*/
|
||||||
if (warnCount++ < 10) {
|
if (warnCount++ < 10) {
|
||||||
_mesa_warning(ctx, "glDrawRangeElements(start %u, end %u, "
|
_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"
|
"\trange is outside VBO bounds (max=%u); ignoring.\n"
|
||||||
"\tThis should be fixed in the application.",
|
"\tThis should be fixed in the application.",
|
||||||
start, end, basevertex, count, type, indices,
|
start, end, count, type, indices,
|
||||||
ctx->Array.ArrayObj->_MaxElement - 1);
|
ctx->Array.ArrayObj->_MaxElement - 1);
|
||||||
}
|
}
|
||||||
index_bounds_valid = GL_FALSE;
|
index_bounds_valid = GL_FALSE;
|
||||||
|
@ -872,18 +868,12 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (0) {
|
if (0) {
|
||||||
printf("glDraw[Range]Elements{,BaseVertex}"
|
printf("glDraw[Range]Elements"
|
||||||
"(start %u, end %u, type 0x%x, count %d) ElemBuf %u, "
|
"(start %u, end %u, type 0x%x, count %d) ElemBuf %u\n",
|
||||||
"base %d\n",
|
|
||||||
start, end, type, count,
|
start, end, type, count,
|
||||||
ctx->Array.ArrayObj->ElementArrayBufferObj->Name,
|
ctx->Array.ArrayObj->ElementArrayBufferObj->Name);
|
||||||
basevertex);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((int) start + basevertex < 0 ||
|
|
||||||
end + basevertex >= ctx->Array.ArrayObj->_MaxElement)
|
|
||||||
index_bounds_valid = GL_FALSE;
|
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
check_draw_elements_data(ctx, count, type, indices);
|
check_draw_elements_data(ctx, count, type, indices);
|
||||||
#else
|
#else
|
||||||
|
@ -891,27 +881,7 @@ vbo_exec_DrawRangeElementsBaseVertex(GLenum mode,
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end,
|
vbo_validated_drawrangeelements(ctx, mode, index_bounds_valid, start, end,
|
||||||
count, type, indices, basevertex, 1);
|
count, type, indices, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -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(mode), count,
|
||||||
_mesa_lookup_enum_by_nr(type), indices);
|
_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;
|
return;
|
||||||
|
|
||||||
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
|
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
|
||||||
count, type, indices, 0, 1);
|
count, type, indices, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -975,35 +922,11 @@ vbo_exec_DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
|
||||||
_mesa_lookup_enum_by_nr(type), indices, numInstances);
|
_mesa_lookup_enum_by_nr(type), indices, numInstances);
|
||||||
|
|
||||||
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
|
if (!_mesa_validate_DrawElementsInstanced(ctx, mode, count, type, indices,
|
||||||
numInstances, 0))
|
numInstances))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
|
vbo_validated_drawrangeelements(ctx, mode, GL_FALSE, ~0, ~0,
|
||||||
count, type, indices, 0, numInstances);
|
count, type, indices, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -1015,8 +938,7 @@ vbo_exec_DrawElementsInstancedBaseVertex(GLenum mode, GLsizei count, GLenum type
|
||||||
static void
|
static void
|
||||||
vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
|
vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
|
||||||
const GLsizei *count, GLenum type,
|
const GLsizei *count, GLenum type,
|
||||||
const GLvoid **indices, GLsizei primcount,
|
const GLvoid **indices, GLsizei primcount)
|
||||||
const GLint *basevertex)
|
|
||||||
{
|
{
|
||||||
struct vbo_context *vbo = vbo_context(ctx);
|
struct vbo_context *vbo = vbo_context(ctx);
|
||||||
struct vbo_exec_context *exec = &vbo->exec;
|
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].start = ((uintptr_t)indices[i] - min_index_ptr) / index_type_size;
|
||||||
prim[i].count = count[i];
|
prim[i].count = count[i];
|
||||||
prim[i].indexed = 1;
|
prim[i].indexed = 1;
|
||||||
prim[i].num_instances = 1;
|
prim[i].num_instances = 1;
|
||||||
if (basevertex != NULL)
|
|
||||||
prim[i].basevertex = basevertex[i];
|
|
||||||
else
|
|
||||||
prim[i].basevertex = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
check_buffers_are_unmapped(exec->array.inputs);
|
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].count = count[i];
|
||||||
prim[0].indexed = 1;
|
prim[0].indexed = 1;
|
||||||
prim[0].num_instances = 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);
|
check_buffers_are_unmapped(exec->array.inputs);
|
||||||
vbo->draw_prims(ctx, exec->array.inputs, prim, 1, &ib,
|
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);
|
ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx);
|
||||||
|
|
||||||
for (i = 0; i < primcount; i++) {
|
for (i = 0; i < primcount; i++) {
|
||||||
if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i],
|
if (!_mesa_validate_DrawElements(ctx, mode, count[i], type, indices[i]))
|
||||||
0))
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
vbo_validated_multidrawelements(ctx, mode, count, type, indices, primcount,
|
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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1194,12 +1083,8 @@ vbo_exec_array_init( struct vbo_exec_context *exec )
|
||||||
exec->vtxfmt.DrawElements = vbo_exec_DrawElements;
|
exec->vtxfmt.DrawElements = vbo_exec_DrawElements;
|
||||||
exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements;
|
exec->vtxfmt.DrawRangeElements = vbo_exec_DrawRangeElements;
|
||||||
exec->vtxfmt.MultiDrawElementsEXT = vbo_exec_MultiDrawElements;
|
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.DrawArraysInstanced = vbo_exec_DrawArraysInstanced;
|
||||||
exec->vtxfmt.DrawElementsInstanced = vbo_exec_DrawElementsInstanced;
|
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
|
void GLAPIENTRY
|
||||||
_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
|
_mesa_DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
|
||||||
GLenum type, const GLvoid *indices)
|
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
|
void GLAPIENTRY
|
||||||
_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
|
_mesa_MultiDrawElementsEXT(GLenum mode, const GLsizei *count, GLenum type,
|
||||||
const GLvoid **indices, GLsizei primcount)
|
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);
|
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);
|
|
||||||
}
|
|
||||||
|
|
|
@ -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
|
static void GLAPIENTRY
|
||||||
_mesa_noop_DrawRangeElements(GLenum mode,
|
_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
|
static void GLAPIENTRY
|
||||||
_mesa_noop_EvalMesh1(GLenum mode, GLint i1, GLint i2)
|
_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->DrawElements = _mesa_noop_DrawElements;
|
||||||
vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
|
vfmt->DrawRangeElements = _mesa_noop_DrawRangeElements;
|
||||||
vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
|
vfmt->MultiDrawElementsEXT = _mesa_noop_MultiDrawElements;
|
||||||
vfmt->DrawElementsBaseVertex = _mesa_noop_DrawElementsBaseVertex;
|
|
||||||
vfmt->DrawRangeElementsBaseVertex = _mesa_noop_DrawRangeElementsBaseVertex;
|
|
||||||
vfmt->MultiDrawElementsBaseVertex = _mesa_noop_MultiDrawElementsBaseVertex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -138,22 +138,7 @@ void vbo_rebase_prims( struct gl_context *ctx,
|
||||||
printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
|
printf("%s %d..%d\n", __FUNCTION__, min_index, max_index);
|
||||||
|
|
||||||
|
|
||||||
/* XXX this path is disabled for now.
|
if (ib) {
|
||||||
* 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) {
|
|
||||||
/* Unfortunately need to adjust each index individually.
|
/* Unfortunately need to adjust each index individually.
|
||||||
*/
|
*/
|
||||||
GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer;
|
GLboolean map_ib = ib->obj->Name && !ib->obj->Pointer;
|
||||||
|
|
|
@ -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
|
static void GLAPIENTRY
|
||||||
_save_DrawArrays(GLenum mode, GLint start, GLsizei count)
|
_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
|
static void GLAPIENTRY
|
||||||
_save_Rectf(GLfloat x1, GLfloat y1, GLfloat x2, GLfloat y2)
|
_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;
|
struct vbo_save_context *save = &vbo_context(ctx)->save;
|
||||||
GLint i;
|
GLint i;
|
||||||
|
|
||||||
if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices, 0))
|
if (!_mesa_validate_DrawElements(ctx, mode, count, type, indices))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (save->out_of_memory)
|
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;
|
struct vbo_save_context *save = &vbo_context(ctx)->save;
|
||||||
|
|
||||||
if (!_mesa_validate_DrawRangeElements(ctx, mode,
|
if (!_mesa_validate_DrawRangeElements(ctx, mode,
|
||||||
start, end, count, type, indices, 0))
|
start, end, count, type, indices))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (save->out_of_memory)
|
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
|
static void
|
||||||
_save_vtxfmt_init(struct gl_context *ctx)
|
_save_vtxfmt_init(struct gl_context *ctx)
|
||||||
{
|
{
|
||||||
|
@ -1356,10 +1286,7 @@ _save_vtxfmt_init(struct gl_context *ctx)
|
||||||
vfmt->DrawArrays = _save_DrawArrays;
|
vfmt->DrawArrays = _save_DrawArrays;
|
||||||
vfmt->DrawElements = _save_DrawElements;
|
vfmt->DrawElements = _save_DrawElements;
|
||||||
vfmt->DrawRangeElements = _save_DrawRangeElements;
|
vfmt->DrawRangeElements = _save_DrawRangeElements;
|
||||||
vfmt->DrawElementsBaseVertex = _save_DrawElementsBaseVertex;
|
|
||||||
vfmt->DrawRangeElementsBaseVertex = _save_DrawRangeElementsBaseVertex;
|
|
||||||
vfmt->MultiDrawElementsEXT = _save_MultiDrawElements;
|
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.DrawElements = _save_OBE_DrawElements;
|
||||||
ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
|
ctx->ListState.ListVtxfmt.DrawRangeElements = _save_OBE_DrawRangeElements;
|
||||||
ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _save_OBE_MultiDrawElements;
|
ctx->ListState.ListVtxfmt.MultiDrawElementsEXT = _save_OBE_MultiDrawElements;
|
||||||
ctx->ListState.ListVtxfmt.MultiDrawElementsBaseVertex = _save_OBE_MultiDrawElementsBaseVertex;
|
|
||||||
_mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt);
|
_mesa_install_save_vtxfmt(ctx, &ctx->ListState.ListVtxfmt);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -108,14 +108,6 @@ void vbo_split_prims( struct gl_context *ctx,
|
||||||
vbo_draw_func draw,
|
vbo_draw_func draw,
|
||||||
const struct split_limits *limits )
|
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 (ib) {
|
||||||
if (limits->max_indices == 0) {
|
if (limits->max_indices == 0) {
|
||||||
/* Could traverse the indices, re-emitting vertices in turn.
|
/* Could traverse the indices, re-emitting vertices in turn.
|
||||||
|
|
|
@ -588,40 +588,28 @@ void vbo_split_copy( struct gl_context *ctx,
|
||||||
const struct split_limits *limits )
|
const struct split_limits *limits )
|
||||||
{
|
{
|
||||||
struct copy_context copy;
|
struct copy_context copy;
|
||||||
GLuint i, this_nr_prims;
|
GLuint i;
|
||||||
|
|
||||||
for (i = 0; i < nr_prims;) {
|
memset(©, 0, sizeof(copy));
|
||||||
/* 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));
|
/* Require indexed primitives:
|
||||||
|
*/
|
||||||
|
assert(ib);
|
||||||
|
|
||||||
/* Require indexed primitives:
|
copy.ctx = ctx;
|
||||||
*/
|
copy.array = arrays;
|
||||||
assert(ib);
|
copy.prim = prim;
|
||||||
|
copy.nr_prims = nr_prims;
|
||||||
|
copy.ib = ib;
|
||||||
|
copy.draw = draw;
|
||||||
|
copy.limits = limits;
|
||||||
|
|
||||||
copy.ctx = ctx;
|
/* Clear the vertex cache:
|
||||||
copy.array = arrays;
|
*/
|
||||||
copy.prim = &prim[i];
|
for (i = 0; i < ELT_TABLE_SIZE; i++)
|
||||||
copy.nr_prims = this_nr_prims;
|
copy.vert_cache[i].in = ~0;
|
||||||
copy.ib = ib;
|
|
||||||
copy.draw = draw;
|
|
||||||
copy.limits = limits;
|
|
||||||
|
|
||||||
/* Clear the vertex cache:
|
replay_init(©);
|
||||||
*/
|
replay_elts(©);
|
||||||
for (i = 0; i < ELT_TABLE_SIZE; i++)
|
replay_finish(©);
|
||||||
copy.vert_cache[i].in = ~0;
|
|
||||||
|
|
||||||
replay_init(©);
|
|
||||||
replay_elts(©);
|
|
||||||
replay_finish(©);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue