aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src')
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_blitter.c10
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug.c2
-rw-r--r--mesalib/src/glsl/SConscript4
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-lex.l49
-rw-r--r--mesalib/src/glsl/glcpp/glcpp-parse.y61
-rw-r--r--mesalib/src/glsl/glcpp/glcpp.h5
-rw-r--r--mesalib/src/glsl/glcpp/pp.c38
-rw-r--r--mesalib/src/glsl/ir.h2
-rw-r--r--mesalib/src/glsl/ir_set_program_inouts.cpp6
-rw-r--r--mesalib/src/glsl/linker.cpp28
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_debug_output.xml2
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml2
-rw-r--r--mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml2
-rw-r--r--mesalib/src/mapi/glapi/gen/GL3x.xml2
-rw-r--r--mesalib/src/mapi/glapi/gen/gl_API.xml4
-rw-r--r--mesalib/src/mesa/main/APIspec.xml2
-rw-r--r--mesalib/src/mesa/main/arrayobj.c11
-rw-r--r--mesalib/src/mesa/main/arrayobj.h12
-rw-r--r--mesalib/src/mesa/main/bufferobj.c11
-rw-r--r--mesalib/src/mesa/main/dd.h2
-rw-r--r--mesalib/src/mesa/main/enable.c11
-rw-r--r--mesalib/src/mesa/main/errors.c18
-rw-r--r--mesalib/src/mesa/main/ffvertex_prog.c2
-rw-r--r--mesalib/src/mesa/main/imports.h10
-rw-r--r--mesalib/src/mesa/main/light.c10
-rw-r--r--mesalib/src/mesa/main/mtypes.h138
-rw-r--r--mesalib/src/mesa/main/transformfeedback.c2
-rw-r--r--mesalib/src/mesa/state_tracker/st_cb_fbo.c26
-rw-r--r--mesalib/src/mesa/tnl/t_vb_light.c4
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_api.c2
-rw-r--r--mesalib/src/mesa/vbo/vbo_exec_array.c5
-rw-r--r--mesalib/src/mesa/vbo/vbo_noop.c2
-rw-r--r--mesalib/src/mesa/vbo/vbo_save_api.c4
-rw-r--r--mesalib/src/mesa/x86/Makefile.am1
-rw-r--r--mesalib/src/mesa/x86/gen_matypes.c2
35 files changed, 322 insertions, 170 deletions
diff --git a/mesalib/src/gallium/auxiliary/util/u_blitter.c b/mesalib/src/gallium/auxiliary/util/u_blitter.c
index d0b9187d1..4b4734a21 100644
--- a/mesalib/src/gallium/auxiliary/util/u_blitter.c
+++ b/mesalib/src/gallium/auxiliary/util/u_blitter.c
@@ -815,6 +815,8 @@ static void util_blitter_clear_custom(struct blitter_context *blitter,
pipe->bind_vs_state(pipe, ctx->vs);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
+ if (ctx->has_stream_out)
+ pipe->set_stream_output_targets(pipe, 0, NULL, 0);
blitter_set_dst_dimensions(ctx, width, height);
blitter->draw_rectangle(blitter, 0, 0, width, height, depth,
@@ -1013,6 +1015,8 @@ void util_blitter_copy_texture_view(struct blitter_context *blitter,
pipe->bind_vs_state(pipe, ctx->vs);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
+ if (ctx->has_stream_out)
+ pipe->set_stream_output_targets(pipe, 0, NULL, 0);
pipe->bind_fragment_sampler_states(pipe, 1, &ctx->sampler_state);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
pipe->set_fragment_sampler_views(pipe, 1, &src);
@@ -1098,6 +1102,8 @@ void util_blitter_clear_render_target(struct blitter_context *blitter,
pipe->bind_vs_state(pipe, ctx->vs);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
+ if (ctx->has_stream_out)
+ pipe->set_stream_output_targets(pipe, 0, NULL, 0);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
/* set a framebuffer state */
@@ -1166,6 +1172,8 @@ void util_blitter_clear_depth_stencil(struct blitter_context *blitter,
pipe->bind_vs_state(pipe, ctx->vs);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
+ if (ctx->has_stream_out)
+ pipe->set_stream_output_targets(pipe, 0, NULL, 0);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
/* set a framebuffer state */
@@ -1215,6 +1223,8 @@ void util_blitter_custom_depth_stencil(struct blitter_context *blitter,
pipe->bind_vs_state(pipe, ctx->vs);
if (ctx->has_geometry_shader)
pipe->bind_gs_state(pipe, NULL);
+ if (ctx->has_stream_out)
+ pipe->set_stream_output_targets(pipe, 0, NULL, 0);
pipe->bind_vertex_elements_state(pipe, ctx->velem_state);
/* set a framebuffer state */
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.c b/mesalib/src/gallium/auxiliary/util/u_debug.c
index 0a350cae7..bf98f222e 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug.c
+++ b/mesalib/src/gallium/auxiliary/util/u_debug.c
@@ -204,7 +204,7 @@ static boolean str_has_option(const char *str, const char *name)
* we compare 'start' up to 'str-1' with 'name'. */
while (1) {
- if (!*str || !isalnum(*str)) {
+ if (!*str || !(isalnum(*str) || *str == '_')) {
if (str-start == name_len &&
!memcmp(start, name, name_len)) {
return TRUE;
diff --git a/mesalib/src/glsl/SConscript b/mesalib/src/glsl/SConscript
index f8e872368..2fc57c6dd 100644
--- a/mesalib/src/glsl/SConscript
+++ b/mesalib/src/glsl/SConscript
@@ -14,8 +14,8 @@ env.Prepend(CPPPATH = [
'#src/glsl/glcpp',
])
-# Make glcpp/glcpp-parse.h and glsl_parser.h reacheable from the include path
-env.Append(CPPPATH = [Dir('.').abspath])
+# Make glcpp-parse.h and glsl_parser.h reachable from the include path.
+env.Append(CPPPATH = [Dir('.').abspath, Dir('glcpp').abspath])
env.Append(YACCFLAGS = '-d')
diff --git a/mesalib/src/glsl/glcpp/glcpp-lex.l b/mesalib/src/glsl/glcpp/glcpp-lex.l
index b34f2c0e9..7ab58cb28 100644
--- a/mesalib/src/glsl/glcpp/glcpp-lex.l
+++ b/mesalib/src/glsl/glcpp/glcpp-lex.l
@@ -40,12 +40,18 @@ void glcpp_set_column (int column_no , yyscan_t yyscanner);
#define YY_NO_INPUT
-#define YY_USER_ACTION \
- do { \
- yylloc->first_column = yycolumn + 1; \
- yylloc->first_line = yylineno; \
- yycolumn += yyleng; \
- } while(0);
+#define YY_USER_ACTION \
+ do { \
+ if (parser->has_new_line_number) \
+ yylineno = parser->new_line_number; \
+ if (parser->has_new_source_number) \
+ yylloc->source = parser->new_source_number; \
+ yylloc->first_column = yycolumn + 1; \
+ yylloc->first_line = yylineno; \
+ yycolumn += yyleng; \
+ parser->has_new_line_number = 0; \
+ parser->has_new_source_number = 0; \
+ } while(0);
#define YY_USER_INIT \
do { \
@@ -129,35 +135,8 @@ HEXADECIMAL_INTEGER 0[xX][0-9a-fA-F]+[uU]?
return OTHER;
}
-{HASH}line{HSPACE}+{DIGITS}{HSPACE}+{DIGITS}{HSPACE}*$ {
- /* Eat characters until the first digit is
- * encountered
- */
- char *ptr = yytext;
- while (!isdigit(*ptr))
- ptr++;
-
- /* Subtract one from the line number because
- * yylineno is zero-based instead of
- * one-based.
- */
- yylineno = strtol(ptr, &ptr, 0) - 1;
- yylloc->source = strtol(ptr, NULL, 0);
-}
-
-{HASH}line{HSPACE}+{DIGITS}{HSPACE}*$ {
- /* Eat characters until the first digit is
- * encountered
- */
- char *ptr = yytext;
- while (!isdigit(*ptr))
- ptr++;
-
- /* Subtract one from the line number because
- * yylineno is zero-based instead of
- * one-based.
- */
- yylineno = strtol(ptr, &ptr, 0) - 1;
+{HASH}line {
+ return HASH_LINE;
}
<SKIP,INITIAL>{
diff --git a/mesalib/src/glsl/glcpp/glcpp-parse.y b/mesalib/src/glsl/glcpp/glcpp-parse.y
index 9e8f9b2d6..cc4af1689 100644
--- a/mesalib/src/glsl/glcpp/glcpp-parse.y
+++ b/mesalib/src/glsl/glcpp/glcpp-parse.y
@@ -105,9 +105,15 @@ _parser_active_list_pop (glcpp_parser_t *parser);
static int
_parser_active_list_contains (glcpp_parser_t *parser, const char *identifier);
+/* Expand list, and begin lexing from the result (after first
+ * prefixing a token of type 'head_token_type').
+ */
static void
-_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list);
+_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
+ int head_token_type,
+ token_list_t *list);
+/* Perform macro expansion in-place on the given list. */
static void
_glcpp_parser_expand_token_list (glcpp_parser_t *parser,
token_list_t *list);
@@ -156,7 +162,7 @@ add_builtin_define(glcpp_parser_t *parser, const char *name, int value);
%lex-param {glcpp_parser_t *parser}
%expect 0
-%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE_FUNC HASH_DEFINE_OBJ HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING NEWLINE OTHER PLACEHOLDER SPACE
+%token COMMA_FINAL DEFINED ELIF_EXPANDED HASH HASH_DEFINE_FUNC HASH_DEFINE_OBJ HASH_ELIF HASH_ELSE HASH_ENDIF HASH_IF HASH_IFDEF HASH_IFNDEF HASH_LINE HASH_UNDEF HASH_VERSION IDENTIFIER IF_EXPANDED INTEGER INTEGER_STRING LINE_EXPANDED NEWLINE OTHER PLACEHOLDER SPACE
%token PASTE
%type <ival> expression INTEGER operator SPACE integer_constant
%type <str> IDENTIFIER INTEGER_STRING OTHER
@@ -202,6 +208,24 @@ expanded_line:
| ELIF_EXPANDED expression NEWLINE {
_glcpp_parser_skip_stack_change_if (parser, & @1, "elif", $2);
}
+| LINE_EXPANDED integer_constant NEWLINE {
+ parser->has_new_line_number = 1;
+ parser->new_line_number = $2;
+ ralloc_asprintf_rewrite_tail (&parser->output,
+ &parser->output_length,
+ "#line %" PRIiMAX,
+ $2);
+ }
+| LINE_EXPANDED integer_constant integer_constant NEWLINE {
+ parser->has_new_line_number = 1;
+ parser->new_line_number = $2;
+ parser->has_new_source_number = 1;
+ parser->new_source_number = $3;
+ ralloc_asprintf_rewrite_tail (&parser->output,
+ &parser->output_length,
+ "#line %" PRIiMAX " %" PRIiMAX,
+ $2, $3);
+ }
;
control_line:
@@ -222,6 +246,14 @@ control_line:
}
ralloc_free ($2);
}
+| HASH_LINE pp_tokens NEWLINE {
+ if (parser->skip_stack == NULL ||
+ parser->skip_stack->type == SKIP_NO_SKIP)
+ {
+ _glcpp_parser_expand_and_lex_from (parser,
+ LINE_EXPANDED, $2);
+ }
+ }
| HASH_IF conditional_tokens NEWLINE {
/* Be careful to only evaluate the 'if' expression if
* we are not skipping. When we are skipping, we
@@ -233,7 +265,8 @@ control_line:
if (parser->skip_stack == NULL ||
parser->skip_stack->type == SKIP_NO_SKIP)
{
- _glcpp_parser_expand_if (parser, IF_EXPANDED, $2);
+ _glcpp_parser_expand_and_lex_from (parser,
+ IF_EXPANDED, $2);
}
else
{
@@ -272,7 +305,8 @@ control_line:
if (parser->skip_stack &&
parser->skip_stack->type == SKIP_TO_ELSE)
{
- _glcpp_parser_expand_if (parser, ELIF_EXPANDED, $2);
+ _glcpp_parser_expand_and_lex_from (parser,
+ ELIF_EXPANDED, $2);
}
else
{
@@ -341,6 +375,9 @@ integer_constant:
expression:
integer_constant
+| IDENTIFIER {
+ $$ = 0;
+ }
| expression OR expression {
$$ = $1 || $3;
}
@@ -1109,6 +1146,11 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
parser->info_log_length = 0;
parser->error = 0;
+ parser->has_new_line_number = 0;
+ parser->new_line_number = 1;
+ parser->has_new_source_number = 0;
+ parser->new_source_number = 0;
+
/* Add pre-defined macros. */
add_builtin_define(parser, "GL_ARB_draw_buffers", 1);
add_builtin_define(parser, "GL_ARB_texture_rectangle", 1);
@@ -1269,14 +1311,21 @@ _token_list_create_with_one_space (void *ctx)
return list;
}
+/* Perform macro expansion on 'list', placing the resulting tokens
+ * into a new list which is initialized with a first token of type
+ * 'head_token_type'. Then begin lexing from the resulting list,
+ * (return to the current lexing source when this list is exhausted).
+ */
static void
-_glcpp_parser_expand_if (glcpp_parser_t *parser, int type, token_list_t *list)
+_glcpp_parser_expand_and_lex_from (glcpp_parser_t *parser,
+ int head_token_type,
+ token_list_t *list)
{
token_list_t *expanded;
token_t *token;
expanded = _token_list_create (parser);
- token = _token_create_ival (parser, type, type);
+ token = _token_create_ival (parser, head_token_type, head_token_type);
_token_list_append (expanded, token);
_glcpp_parser_expand_token_list (parser, list);
_token_list_append_list (expanded, list);
diff --git a/mesalib/src/glsl/glcpp/glcpp.h b/mesalib/src/glsl/glcpp/glcpp.h
index 2d7cad2e6..a13ade69e 100644
--- a/mesalib/src/glsl/glcpp/glcpp.h
+++ b/mesalib/src/glsl/glcpp/glcpp.h
@@ -25,6 +25,7 @@
#define GLCPP_H
#include <stdint.h>
+#include <stdbool.h>
#include "../ralloc.h"
@@ -177,6 +178,10 @@ struct glcpp_parser {
size_t output_length;
size_t info_log_length;
int error;
+ bool has_new_line_number;
+ int new_line_number;
+ bool has_new_source_number;
+ int new_source_number;
};
struct gl_extensions;
diff --git a/mesalib/src/glsl/glcpp/pp.c b/mesalib/src/glsl/glcpp/pp.c
index 3640896a2..9170d14a3 100644
--- a/mesalib/src/glsl/glcpp/pp.c
+++ b/mesalib/src/glsl/glcpp/pp.c
@@ -33,15 +33,20 @@ glcpp_error (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
va_list ap;
parser->error = 1;
- ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
- "preprocessor error: ",
- locp->source,
- locp->first_line,
- locp->first_column);
+ ralloc_asprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length,
+ "%u:%u(%u): "
+ "preprocessor error: ",
+ locp->source,
+ locp->first_line,
+ locp->first_column);
va_start(ap, fmt);
- ralloc_vasprintf_append(&parser->info_log, fmt, ap);
+ ralloc_vasprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length,
+ fmt, ap);
va_end(ap);
- ralloc_strcat(&parser->info_log, "\n");
+ ralloc_asprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length, "\n");
}
void
@@ -49,15 +54,20 @@ glcpp_warning (YYLTYPE *locp, glcpp_parser_t *parser, const char *fmt, ...)
{
va_list ap;
- ralloc_asprintf_append(&parser->info_log, "%u:%u(%u): "
- "preprocessor warning: ",
- locp->source,
- locp->first_line,
- locp->first_column);
+ ralloc_asprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length,
+ "%u:%u(%u): "
+ "preprocessor warning: ",
+ locp->source,
+ locp->first_line,
+ locp->first_column);
va_start(ap, fmt);
- ralloc_vasprintf_append(&parser->info_log, fmt, ap);
+ ralloc_vasprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length,
+ fmt, ap);
va_end(ap);
- ralloc_strcat(&parser->info_log, "\n");
+ ralloc_asprintf_rewrite_tail(&parser->info_log,
+ &parser->info_log_length, "\n");
}
/* Searches backwards for '^ *#' from a given starting point. */
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index 014f3630d..505d2e74b 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -353,7 +353,7 @@ public:
const struct glsl_type *type;
/**
- * Delcared name of the variable
+ * Declared name of the variable
*/
const char *name;
diff --git a/mesalib/src/glsl/ir_set_program_inouts.cpp b/mesalib/src/glsl/ir_set_program_inouts.cpp
index 8f3edb969..a7415c7e3 100644
--- a/mesalib/src/glsl/ir_set_program_inouts.cpp
+++ b/mesalib/src/glsl/ir_set_program_inouts.cpp
@@ -26,7 +26,8 @@
*
* Sets the InputsRead and OutputsWritten of Mesa programs.
*
- * Additionally, for fragment shaders, sets the InterpQualifier array.
+ * Additionally, for fragment shaders, sets the InterpQualifier array and
+ * IsCentroid bitfield.
*
* Mesa programs (gl_program, not gl_shader_program) have a set of
* flags indicating which varyings are read and written. Computing
@@ -88,6 +89,8 @@ mark(struct gl_program *prog, ir_variable *var, int offset, int len,
gl_fragment_program *fprog = (gl_fragment_program *) prog;
fprog->InterpQualifier[var->location + var->index + offset + i] =
(glsl_interp_qualifier) var->interpolation;
+ if (var->centroid)
+ fprog->IsCentroid |= bitfield;
}
} else if (var->mode == ir_var_system_value) {
prog->SystemValuesRead |= bitfield;
@@ -178,6 +181,7 @@ do_set_program_inouts(exec_list *instructions, struct gl_program *prog,
if (is_fragment_shader) {
memset(((gl_fragment_program *) prog)->InterpQualifier, 0,
sizeof(((gl_fragment_program *) prog)->InterpQualifier));
+ ((gl_fragment_program *) prog)->IsCentroid = 0;
}
visit_list_elements(&v, instructions);
}
diff --git a/mesalib/src/glsl/linker.cpp b/mesalib/src/glsl/linker.cpp
index bdab499f0..310944752 100644
--- a/mesalib/src/glsl/linker.cpp
+++ b/mesalib/src/glsl/linker.cpp
@@ -1859,6 +1859,32 @@ assign_varying_location(ir_variable *input_var, ir_variable *output_var,
/**
+ * Is the given variable a varying variable to be counted against the
+ * limit in ctx->Const.MaxVarying?
+ * This includes variables such as texcoords, colors and generic
+ * varyings, but excludes variables such as gl_FrontFacing and gl_FragCoord.
+ */
+static bool
+is_varying_var(GLenum shaderType, const ir_variable *var)
+{
+ /* Only fragment shaders will take a varying variable as an input */
+ if (shaderType == GL_FRAGMENT_SHADER &&
+ var->mode == ir_var_in &&
+ var->explicit_location) {
+ switch (var->location) {
+ case FRAG_ATTRIB_WPOS:
+ case FRAG_ATTRIB_FACE:
+ case FRAG_ATTRIB_PNTC:
+ return false;
+ default:
+ return true;
+ }
+ }
+ return false;
+}
+
+
+/**
* Assign locations for all variables that are produced in one pipeline stage
* (the "producer") and consumed in the next stage (the "consumer").
*
@@ -1966,7 +1992,7 @@ assign_varying_locations(struct gl_context *ctx,
* value is written by the previous stage.
*/
var->mode = ir_var_auto;
- } else {
+ } else if (is_varying_var(consumer->Type, var)) {
/* The packing rules are used for vertex shader inputs are also
* used for fragment shader inputs.
*/
diff --git a/mesalib/src/mapi/glapi/gen/ARB_debug_output.xml b/mesalib/src/mapi/glapi/gen/ARB_debug_output.xml
index f2877a4f7..11f268dc6 100644
--- a/mesalib/src/mapi/glapi/gen/ARB_debug_output.xml
+++ b/mesalib/src/mapi/glapi/gen/ARB_debug_output.xml
@@ -72,7 +72,7 @@
<function name="DebugMessageCallbackARB" offset="assign">
<param name="callback" type="GLDEBUGPROCARB"/>
- <param name="userParam" type="GLvoid *"/>
+ <param name="userParam" type="const GLvoid *"/>
</function>
<function name="GetDebugMessageLogARB" offset="assign">
diff --git a/mesalib/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml b/mesalib/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
index a697ea509..851f1faec 100644
--- a/mesalib/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
+++ b/mesalib/src/mapi/glapi/gen/ARB_draw_elements_base_vertex.xml
@@ -30,7 +30,7 @@
<param name="mode" type="GLenum"/>
<param name="count" type="const GLsizei *"/>
<param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
+ <param name="indices" type="const GLvoid * const *"/>
<param name="primcount" type="GLsizei"/>
<param name="basevertex" type="const GLint *"/>
</function>
diff --git a/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml b/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml
index cbcd339e7..80541a821 100644
--- a/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml
+++ b/mesalib/src/mapi/glapi/gen/ARB_uniform_buffer_object.xml
@@ -42,7 +42,7 @@
<function name="GetUniformIndices" offset="assign">
<param name="program" type="GLuint" />
<param name="uniformCount" type="GLsizei" />
- <param name="uniformNames" type="const GLchar **" />
+ <param name="uniformNames" type="const GLchar * const *" />
<param name="uniformIndices" type="GLuint *" />
</function>
diff --git a/mesalib/src/mapi/glapi/gen/GL3x.xml b/mesalib/src/mapi/glapi/gen/GL3x.xml
index f3d782ca4..d287ac2b0 100644
--- a/mesalib/src/mapi/glapi/gen/GL3x.xml
+++ b/mesalib/src/mapi/glapi/gen/GL3x.xml
@@ -231,7 +231,7 @@
<function name="TransformFeedbackVaryings" alias="TransformFeedbackVaryingsEXT">
<param name="program" type="GLuint"/>
<param name="count" type="GLsizei"/>
- <param name="varyings" type="const GLchar* *"/>
+ <param name="varyings" type="const GLchar * const *"/>
<param name="bufferMode" type="GLenum"/>
</function>
diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
index af0513556..af74c909b 100644
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -4677,7 +4677,7 @@
<param name="mode" type="GLenum"/>
<param name="count" type="const GLsizei *"/>
<param name="type" type="GLenum"/>
- <param name="indices" type="const GLvoid **"/>
+ <param name="indices" type="const GLvoid * const *"/>
<param name="primcount" type="GLsizei"/>
</function>
@@ -5363,7 +5363,7 @@
<function name="ShaderSource" alias="ShaderSourceARB">
<param name="shader" type="GLuint"/>
<param name="count" type="GLsizei"/>
- <param name="string" type="const GLchar **"/>
+ <param name="string" type="const GLchar * const *"/>
<param name="length" type="const GLint *"/>
<glx ignore="true"/>
</function>
diff --git a/mesalib/src/mesa/main/APIspec.xml b/mesalib/src/mesa/main/APIspec.xml
index 64e666eff..f870cf7db 100644
--- a/mesalib/src/mesa/main/APIspec.xml
+++ b/mesalib/src/mesa/main/APIspec.xml
@@ -2946,7 +2946,7 @@
<return type="void"/>
<param name="shader" type="GLuint"/>
<param name="count" type="GLsizei"/>
- <param name="string" type="const GLchar **"/>
+ <param name="string" type="const GLchar * const *"/>
<param name="length" type="const int *"/>
</proto>
</template>
diff --git a/mesalib/src/mesa/main/arrayobj.c b/mesalib/src/mesa/main/arrayobj.c
index 4c50066de..3439ab6b5 100644
--- a/mesalib/src/mesa/main/arrayobj.c
+++ b/mesalib/src/mesa/main/arrayobj.c
@@ -123,14 +123,15 @@ _mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj )
/**
* Set ptr to arrayObj w/ reference counting.
+ * Note: this should only be called from the _mesa_reference_array_object()
+ * inline function.
*/
void
-_mesa_reference_array_object(struct gl_context *ctx,
- struct gl_array_object **ptr,
- struct gl_array_object *arrayObj)
+_mesa_reference_array_object_(struct gl_context *ctx,
+ struct gl_array_object **ptr,
+ struct gl_array_object *arrayObj)
{
- if (*ptr == arrayObj)
- return;
+ assert(*ptr != arrayObj);
if (*ptr) {
/* Unreference the old array object */
diff --git a/mesalib/src/mesa/main/arrayobj.h b/mesalib/src/mesa/main/arrayobj.h
index 717c7916e..e5270fa2c 100644
--- a/mesalib/src/mesa/main/arrayobj.h
+++ b/mesalib/src/mesa/main/arrayobj.h
@@ -52,9 +52,19 @@ extern void
_mesa_delete_array_object( struct gl_context *ctx, struct gl_array_object *obj );
extern void
+_mesa_reference_array_object_(struct gl_context *ctx,
+ struct gl_array_object **ptr,
+ struct gl_array_object *arrayObj);
+
+static inline void
_mesa_reference_array_object(struct gl_context *ctx,
struct gl_array_object **ptr,
- struct gl_array_object *arrayObj);
+ struct gl_array_object *arrayObj)
+{
+ if (*ptr != arrayObj)
+ _mesa_reference_array_object_(ctx, ptr, arrayObj);
+}
+
extern void
_mesa_initialize_array_object( struct gl_context *ctx,
diff --git a/mesalib/src/mesa/main/bufferobj.c b/mesalib/src/mesa/main/bufferobj.c
index 5f724ace3..ea48af97e 100644
--- a/mesalib/src/mesa/main/bufferobj.c
+++ b/mesalib/src/mesa/main/bufferobj.c
@@ -2021,8 +2021,11 @@ set_ubo_binding(struct gl_context *ctx,
}
/**
- * Specify a buffer object to receive vertex shader results. Plus,
- * specify the starting offset to place the results, and max size.
+ * Bind a region of a buffer object to a uniform block binding point.
+ * \param index the uniform buffer binding point index
+ * \param bufObj the buffer object
+ * \param offset offset to the start of buffer object region
+ * \param size size of the buffer object region
*/
static void
bind_buffer_range_uniform_buffer(struct gl_context *ctx,
@@ -2054,8 +2057,8 @@ bind_buffer_range_uniform_buffer(struct gl_context *ctx,
/**
- * Specify a buffer object to receive vertex shader results.
- * As above, but start at offset = 0.
+ * Bind a buffer object to a uniform block binding point.
+ * As above, but offset = 0.
*/
static void
bind_buffer_base_uniform_buffer(struct gl_context *ctx,
diff --git a/mesalib/src/mesa/main/dd.h b/mesalib/src/mesa/main/dd.h
index 5bcf36bfa..687a38f44 100644
--- a/mesalib/src/mesa/main/dd.h
+++ b/mesalib/src/mesa/main/dd.h
@@ -1024,7 +1024,7 @@ typedef struct {
void (GLAPIENTRYP MultiDrawElementsBaseVertex)( GLenum mode,
const GLsizei *count,
GLenum type,
- const GLvoid **indices,
+ const GLvoid * const *indices,
GLsizei primcount,
const GLint *basevertex);
void (GLAPIENTRYP DrawArraysInstanced)(GLenum mode, GLint first,
diff --git a/mesalib/src/mesa/main/enable.c b/mesalib/src/mesa/main/enable.c
index d0b462580..c811f2a9c 100644
--- a/mesalib/src/mesa/main/enable.c
+++ b/mesalib/src/mesa/main/enable.c
@@ -161,8 +161,8 @@ client_state(struct gl_context *ctx, GLenum cap, GLboolean state)
return;
invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(0x%x)",
- state ? "Enable" : "Disable", cap);
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%sClientState(%s)",
+ state ? "Enable" : "Disable", _mesa_lookup_enum_by_nr(cap));
}
@@ -937,8 +937,8 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
return;
invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(0x%x)",
- state ? "Enable" : "Disable", cap);
+ _mesa_error(ctx, GL_INVALID_ENUM, "gl%s(%s)",
+ state ? "Enable" : "Disable", _mesa_lookup_enum_by_nr(cap));
}
@@ -1441,6 +1441,7 @@ _mesa_IsEnabled( GLenum cap )
return GL_FALSE;
invalid_enum_error:
- _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(0x%x)", (int) cap);
+ _mesa_error(ctx, GL_INVALID_ENUM, "glIsEnabled(%s)",
+ _mesa_lookup_enum_by_nr(cap));
return GL_FALSE;
}
diff --git a/mesalib/src/mesa/main/errors.c b/mesalib/src/mesa/main/errors.c
index 69dbb65cf..8b96319ce 100644
--- a/mesalib/src/mesa/main/errors.c
+++ b/mesalib/src/mesa/main/errors.c
@@ -718,11 +718,11 @@ _mesa_DebugMessageControlARB(GLenum source, GLenum type, GLenum severity,
}
static void GLAPIENTRY
-_mesa_DebugMessageCallbackARB(GLDEBUGPROCARB callback, GLvoid *userParam)
+_mesa_DebugMessageCallbackARB(GLDEBUGPROCARB callback, const GLvoid *userParam)
{
GET_CURRENT_CONTEXT(ctx);
ctx->Debug.Callback = callback;
- ctx->Debug.CallbackData = userParam;
+ ctx->Debug.CallbackData = (void *) userParam;
}
void
@@ -801,12 +801,21 @@ output_if_debug(const char *prefixString, const char *outputString,
GLboolean newline)
{
static int debug = -1;
+ static FILE *fout = NULL;
/* Init the local 'debug' var once.
* Note: the _mesa_init_debug() function should have been called
* by now so MESA_DEBUG_FLAGS will be initialized.
*/
if (debug == -1) {
+ /* If MESA_LOG_FILE env var is set, log Mesa errors, warnings,
+ * etc to the named file. Otherwise, output to stderr.
+ */
+ const char *logFile = _mesa_getenv("MESA_LOG_FILE");
+ if (logFile)
+ fout = fopen(logFile, "w");
+ if (!fout)
+ fout = stderr;
#ifdef DEBUG
/* in debug builds, print messages unless MESA_DEBUG="silent" */
if (MESA_DEBUG_FLAGS & DEBUG_SILENT)
@@ -821,9 +830,10 @@ output_if_debug(const char *prefixString, const char *outputString,
/* Now only print the string if we're required to do so. */
if (debug) {
- fprintf(stderr, "%s: %s", prefixString, outputString);
+ fprintf(fout, "%s: %s", prefixString, outputString);
if (newline)
- fprintf(stderr, "\n");
+ fprintf(fout, "\n");
+ fflush(fout);
#if defined(_WIN32) && !defined(_WIN32_WCE)
/* stderr from windows applications without console is not usually
diff --git a/mesalib/src/mesa/main/ffvertex_prog.c b/mesalib/src/mesa/main/ffvertex_prog.c
index f1ab75333..557768311 100644
--- a/mesalib/src/mesa/main/ffvertex_prog.c
+++ b/mesalib/src/mesa/main/ffvertex_prog.c
@@ -181,7 +181,7 @@ static void make_state_key( struct gl_context *ctx, struct state_key *key )
key->light_twoside = 1;
if (ctx->Light.ColorMaterialEnabled) {
- key->light_color_material_mask = ctx->Light.ColorMaterialBitmask;
+ key->light_color_material_mask = ctx->Light._ColorMaterialBitmask;
}
for (i = 0; i < MAX_LIGHTS; i++) {
diff --git a/mesalib/src/mesa/main/imports.h b/mesalib/src/mesa/main/imports.h
index c0b6cecea..9fb6ae8f1 100644
--- a/mesalib/src/mesa/main/imports.h
+++ b/mesalib/src/mesa/main/imports.h
@@ -646,6 +646,16 @@ _mesa_vsnprintf(char *str, size_t size, const char *fmt, va_list arg);
#endif
+/**
+ * On Mingw32 we need to use __mingw_fprintf() to parse formats such
+ * as "0x%llx", and possibly others
+ */
+#ifdef __MINGW32__
+#define fprintf __mingw_fprintf
+#endif
+
+
+
#ifdef __cplusplus
}
#endif
diff --git a/mesalib/src/mesa/main/light.c b/mesalib/src/mesa/main/light.c
index 38ec1b6e8..d6fbcd9be 100644
--- a/mesalib/src/mesa/main/light.c
+++ b/mesalib/src/mesa/main/light.c
@@ -693,13 +693,13 @@ _mesa_update_material( struct gl_context *ctx, GLuint bitmask )
/*
* Update the current materials from the given rgba color
- * according to the bitmask in ColorMaterialBitmask, which is
+ * according to the bitmask in _ColorMaterialBitmask, which is
* set by glColorMaterial().
*/
void
_mesa_update_color_material( struct gl_context *ctx, const GLfloat color[4] )
{
- GLuint bitmask = ctx->Light.ColorMaterialBitmask;
+ const GLbitfield bitmask = ctx->Light._ColorMaterialBitmask;
struct gl_material *mat = &ctx->Light.Material;
int i;
@@ -731,13 +731,13 @@ _mesa_ColorMaterial( GLenum face, GLenum mode )
if (bitmask == 0)
return; /* error was recorded */
- if (ctx->Light.ColorMaterialBitmask == bitmask &&
+ if (ctx->Light._ColorMaterialBitmask == bitmask &&
ctx->Light.ColorMaterialFace == face &&
ctx->Light.ColorMaterialMode == mode)
return;
FLUSH_VERTICES(ctx, _NEW_LIGHT);
- ctx->Light.ColorMaterialBitmask = bitmask;
+ ctx->Light._ColorMaterialBitmask = bitmask;
ctx->Light.ColorMaterialFace = face;
ctx->Light.ColorMaterialMode = mode;
@@ -1188,7 +1188,7 @@ _mesa_init_lighting( struct gl_context *ctx )
ctx->Light.Enabled = GL_FALSE;
ctx->Light.ColorMaterialFace = GL_FRONT_AND_BACK;
ctx->Light.ColorMaterialMode = GL_AMBIENT_AND_DIFFUSE;
- ctx->Light.ColorMaterialBitmask = _mesa_material_bitmask( ctx,
+ ctx->Light._ColorMaterialBitmask = _mesa_material_bitmask( ctx,
GL_FRONT_AND_BACK,
GL_AMBIENT_AND_DIFFUSE, ~0,
NULL );
diff --git a/mesalib/src/mesa/main/mtypes.h b/mesalib/src/mesa/main/mtypes.h
index def0db1aa..d37c1f3de 100644
--- a/mesalib/src/mesa/main/mtypes.h
+++ b/mesalib/src/mesa/main/mtypes.h
@@ -630,6 +630,26 @@ struct gl_config
/**
+ * Material state.
+ */
+struct gl_material
+{
+ GLfloat Attrib[MAT_ATTRIB_MAX][4];
+};
+
+
+/**
+ * Light state flags.
+ */
+/*@{*/
+#define LIGHT_SPOT 0x1
+#define LIGHT_LOCAL_VIEWER 0x2
+#define LIGHT_POSITIONAL 0x4
+#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
+/*@}*/
+
+
+/**
* Light source state.
*/
struct gl_light
@@ -654,7 +674,7 @@ struct gl_light
* \name Derived fields
*/
/*@{*/
- GLbitfield _Flags; /**< State */
+ GLbitfield _Flags; /**< Mask of LIGHT_x bits defined above */
GLfloat _Position[4]; /**< position in eye/obj coordinates */
GLfloat _VP_inf_norm[3]; /**< Norm direction to infinite light */
@@ -683,15 +703,6 @@ struct gl_lightmodel
/**
- * Material state.
- */
-struct gl_material
-{
- GLfloat Attrib[MAT_ATTRIB_MAX][4];
-};
-
-
-/**
* Accumulation buffer attribute group (GL_ACCUM_BUFFER_BIT)
*/
struct gl_accum_attrib
@@ -912,16 +923,6 @@ struct gl_hint_attrib
GLenum FragmentShaderDerivative; /**< GL_ARB_fragment_shader */
};
-/**
- * Light state flags.
- */
-/*@{*/
-#define LIGHT_SPOT 0x1
-#define LIGHT_LOCAL_VIEWER 0x2
-#define LIGHT_POSITIONAL 0x4
-#define LIGHT_NEED_VERTICES (LIGHT_POSITIONAL|LIGHT_LOCAL_VIEWER)
-/*@}*/
-
/**
* Lighting attribute group (GL_LIGHT_BIT).
@@ -932,20 +933,19 @@ struct gl_light_attrib
struct gl_lightmodel Model; /**< Lighting model */
/**
- * Must flush FLUSH_VERTICES before referencing:
+ * Front and back material values.
+ * Note: must call FLUSH_VERTICES() before using.
*/
- /*@{*/
- struct gl_material Material; /**< Includes front & back values */
- /*@}*/
+ struct gl_material Material;
GLboolean Enabled; /**< Lighting enabled flag */
GLenum ShadeModel; /**< GL_FLAT or GL_SMOOTH */
GLenum ProvokingVertex; /**< GL_EXT_provoking_vertex */
GLenum ColorMaterialFace; /**< GL_FRONT, BACK or FRONT_AND_BACK */
GLenum ColorMaterialMode; /**< GL_AMBIENT, GL_DIFFUSE, etc */
- GLbitfield ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
+ GLbitfield _ColorMaterialBitmask; /**< bitmask formed from Face and Mode */
GLboolean ColorMaterialEnabled;
- GLenum ClampVertexColor;
+ GLenum ClampVertexColor; /**< GL_TRUE, GL_FALSE, GL_FIXED_ONLY */
GLboolean _ClampVertexColor;
struct gl_light EnabledList; /**< List sentinel */
@@ -1181,46 +1181,6 @@ typedef enum
/**
- * TexGenEnabled flags.
- */
-/*@{*/
-#define S_BIT 1
-#define T_BIT 2
-#define R_BIT 4
-#define Q_BIT 8
-#define STR_BITS (S_BIT | T_BIT | R_BIT)
-/*@}*/
-
-
-/**
- * Bit flag versions of the corresponding GL_ constants.
- */
-/*@{*/
-#define TEXGEN_SPHERE_MAP 0x1
-#define TEXGEN_OBJ_LINEAR 0x2
-#define TEXGEN_EYE_LINEAR 0x4
-#define TEXGEN_REFLECTION_MAP_NV 0x8
-#define TEXGEN_NORMAL_MAP_NV 0x10
-
-#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
- TEXGEN_REFLECTION_MAP_NV | \
- TEXGEN_NORMAL_MAP_NV)
-#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
- TEXGEN_REFLECTION_MAP_NV | \
- TEXGEN_NORMAL_MAP_NV | \
- TEXGEN_EYE_LINEAR)
-/*@}*/
-
-
-
-/** Tex-gen enabled for texture unit? */
-#define ENABLE_TEXGEN(unit) (1 << (unit))
-
-/** Non-identity texture matrix for texture unit? */
-#define ENABLE_TEXMAT(unit) (1 << (unit))
-
-
-/**
* Texture image state. Drivers will typically create a subclass of this
* with extra fields for memory buffers, etc.
*/
@@ -1367,6 +1327,46 @@ struct gl_tex_env_combine_state
/**
+ * TexGenEnabled flags.
+ */
+/*@{*/
+#define S_BIT 1
+#define T_BIT 2
+#define R_BIT 4
+#define Q_BIT 8
+#define STR_BITS (S_BIT | T_BIT | R_BIT)
+/*@}*/
+
+
+/**
+ * Bit flag versions of the corresponding GL_ constants.
+ */
+/*@{*/
+#define TEXGEN_SPHERE_MAP 0x1
+#define TEXGEN_OBJ_LINEAR 0x2
+#define TEXGEN_EYE_LINEAR 0x4
+#define TEXGEN_REFLECTION_MAP_NV 0x8
+#define TEXGEN_NORMAL_MAP_NV 0x10
+
+#define TEXGEN_NEED_NORMALS (TEXGEN_SPHERE_MAP | \
+ TEXGEN_REFLECTION_MAP_NV | \
+ TEXGEN_NORMAL_MAP_NV)
+#define TEXGEN_NEED_EYE_COORD (TEXGEN_SPHERE_MAP | \
+ TEXGEN_REFLECTION_MAP_NV | \
+ TEXGEN_NORMAL_MAP_NV | \
+ TEXGEN_EYE_LINEAR)
+/*@}*/
+
+
+
+/** Tex-gen enabled for texture unit? */
+#define ENABLE_TEXGEN(unit) (1 << (unit))
+
+/** Non-identity texture matrix for texture unit? */
+#define ENABLE_TEXMAT(unit) (1 << (unit))
+
+
+/**
* Texture coord generation state.
*/
struct gl_texgen
@@ -2021,6 +2021,12 @@ struct gl_fragment_program
* GLSL, the value is INTERP_QUALIFIER_NONE.
*/
enum glsl_interp_qualifier InterpQualifier[FRAG_ATTRIB_MAX];
+
+ /**
+ * Bitfield indicating, for each fragment shader input, 1 if that input
+ * uses centroid interpolation, 0 otherwise. Unused inputs are 0.
+ */
+ GLbitfield64 IsCentroid;
};
diff --git a/mesalib/src/mesa/main/transformfeedback.c b/mesalib/src/mesa/main/transformfeedback.c
index 84c409185..d02b6a056 100644
--- a/mesalib/src/mesa/main/transformfeedback.c
+++ b/mesalib/src/mesa/main/transformfeedback.c
@@ -428,6 +428,7 @@ bind_buffer_range(struct gl_context *ctx, GLuint index,
/**
* Specify a buffer object to receive vertex shader results. Plus,
* specify the starting offset to place the results, and max size.
+ * Called from the glBindBufferRange() function.
*/
void
_mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx,
@@ -471,6 +472,7 @@ _mesa_bind_buffer_range_transform_feedback(struct gl_context *ctx,
/**
* Specify a buffer object to receive vertex shader results.
* As above, but start at offset = 0.
+ * Called from the glBindBufferBase() function.
*/
void
_mesa_bind_buffer_base_transform_feedback(struct gl_context *ctx,
diff --git a/mesalib/src/mesa/state_tracker/st_cb_fbo.c b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
index aeb5ac7fb..10f4e09cf 100644
--- a/mesalib/src/mesa/state_tracker/st_cb_fbo.c
+++ b/mesalib/src/mesa/state_tracker/st_cb_fbo.c
@@ -57,6 +57,10 @@
#include "util/u_surface.h"
+/** Set to 1 to enable extra debug code */
+#define ST_DEBUG_FBO 0
+
+
static GLboolean
st_renderbuffer_alloc_sw_storage(struct gl_context * ctx,
struct gl_renderbuffer *rb,
@@ -472,6 +476,16 @@ st_finish_render_texture(struct gl_context *ctx,
}
+/** Debug helper */
+static void
+st_fbo_invalid(const char *reason)
+{
+#if ST_DEBUG_FBO
+ debug_printf("Invalid FBO: %s\n", reason);
+#endif
+}
+
+
/**
* Validate a renderbuffer attachment for a particular set of bindings.
*/
@@ -484,6 +498,7 @@ st_validate_attachment(struct gl_context *ctx,
const struct st_texture_object *stObj = st_texture_object(att->Texture);
enum pipe_format format;
gl_format texFormat;
+ GLboolean valid;
/* Only validate texture attachments for now, since
* st_renderbuffer_alloc_storage makes sure that
@@ -507,9 +522,14 @@ st_validate_attachment(struct gl_context *ctx,
format = st_mesa_format_to_pipe_format(linearFormat);
}
- return screen->is_format_supported(screen, format,
+ valid = screen->is_format_supported(screen, format,
PIPE_TEXTURE_2D,
stObj->pt->nr_samples, bindings);
+ if (!valid) {
+ st_fbo_invalid("Invalid format");
+ }
+
+ return valid;
}
@@ -558,12 +578,14 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
screen->get_param(screen, PIPE_CAP_MIXED_COLORBUFFER_FORMATS) != 0;
if (depth->Type && stencil->Type && depth->Type != stencil->Type) {
+ st_fbo_invalid("Different Depth/Stencil buffer formats");
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
if (depth->Type == GL_RENDERBUFFER_EXT &&
stencil->Type == GL_RENDERBUFFER_EXT &&
depth->Renderbuffer != stencil->Renderbuffer) {
+ st_fbo_invalid("Separate Depth/Stencil buffers");
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
return;
}
@@ -571,6 +593,7 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
stencil->Type == GL_TEXTURE &&
depth->Texture != stencil->Texture) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ st_fbo_invalid("Different Depth/Stencil textures");
return;
}
@@ -613,6 +636,7 @@ st_validate_framebuffer(struct gl_context *ctx, struct gl_framebuffer *fb)
first_format = format;
} else if (format != first_format) {
fb->_Status = GL_FRAMEBUFFER_UNSUPPORTED_EXT;
+ st_fbo_invalid("Mixed color formats");
return;
}
}
diff --git a/mesalib/src/mesa/tnl/t_vb_light.c b/mesalib/src/mesa/tnl/t_vb_light.c
index 39467fac7..854887c8f 100644
--- a/mesalib/src/mesa/tnl/t_vb_light.c
+++ b/mesalib/src/mesa/tnl/t_vb_light.c
@@ -227,12 +227,12 @@ prepare_materials(struct gl_context *ctx,
store->mat_count = 0;
store->mat_bitmask = 0;
- /* Examine the ColorMaterialBitmask to determine which materials
+ /* Examine the _ColorMaterialBitmask to determine which materials
* track vertex color. Override the material attribute's pointer
* with the color pointer for each one.
*/
if (ctx->Light.ColorMaterialEnabled) {
- const GLuint bitmask = ctx->Light.ColorMaterialBitmask;
+ const GLuint bitmask = ctx->Light._ColorMaterialBitmask;
for (i = 0 ; i < MAT_ATTRIB_MAX ; i++)
if (bitmask & (1<<i))
VB->AttribPtr[_TNL_ATTRIB_MAT_FRONT_AMBIENT + i] = VB->AttribPtr[_TNL_ATTRIB_COLOR0];
diff --git a/mesalib/src/mesa/vbo/vbo_exec_api.c b/mesalib/src/mesa/vbo/vbo_exec_api.c
index bfa1b1db8..fc7e40692 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_api.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_api.c
@@ -450,7 +450,7 @@ vbo_Materialfv(GLenum face, GLenum pname, const GLfloat *params)
* indicating which material attributes can actually be updated below.
*/
if (ctx->Light.ColorMaterialEnabled) {
- updateMats = ~ctx->Light.ColorMaterialBitmask;
+ updateMats = ~ctx->Light._ColorMaterialBitmask;
}
else {
/* GL_COLOR_MATERIAL is disabled so don't skip any material updates */
diff --git a/mesalib/src/mesa/vbo/vbo_exec_array.c b/mesalib/src/mesa/vbo/vbo_exec_array.c
index ebf008536..6f6a2983a 100644
--- a/mesalib/src/mesa/vbo/vbo_exec_array.c
+++ b/mesalib/src/mesa/vbo/vbo_exec_array.c
@@ -1149,7 +1149,8 @@ vbo_exec_DrawElementsInstancedBaseVertexBaseInstance(GLenum mode, GLsizei count,
static void
vbo_validated_multidrawelements(struct gl_context *ctx, GLenum mode,
const GLsizei *count, GLenum type,
- const GLvoid **indices, GLsizei primcount,
+ const GLvoid * const *indices,
+ GLsizei primcount,
const GLint *basevertex)
{
struct vbo_context *vbo = vbo_context(ctx);
@@ -1290,7 +1291,7 @@ vbo_exec_MultiDrawElements(GLenum mode,
static void GLAPIENTRY
vbo_exec_MultiDrawElementsBaseVertex(GLenum mode,
const GLsizei *count, GLenum type,
- const GLvoid **indices,
+ const GLvoid * const *indices,
GLsizei primcount,
const GLsizei *basevertex)
{
diff --git a/mesalib/src/mesa/vbo/vbo_noop.c b/mesalib/src/mesa/vbo/vbo_noop.c
index 430011207..2f472c21c 100644
--- a/mesalib/src/mesa/vbo/vbo_noop.c
+++ b/mesalib/src/mesa/vbo/vbo_noop.c
@@ -404,7 +404,7 @@ _mesa_noop_DrawRangeElementsBaseVertex(GLenum mode,
static void GLAPIENTRY
_mesa_noop_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei * count,
GLenum type,
- const GLvoid ** indices,
+ const GLvoid * const *indices,
GLsizei primcount,
const GLint * basevertex)
{
diff --git a/mesalib/src/mesa/vbo/vbo_save_api.c b/mesalib/src/mesa/vbo/vbo_save_api.c
index b2c9dd5f0..d27525812 100644
--- a/mesalib/src/mesa/vbo/vbo_save_api.c
+++ b/mesalib/src/mesa/vbo/vbo_save_api.c
@@ -1042,7 +1042,7 @@ _save_MultiDrawElements(GLenum mode, const GLsizei *count, GLenum type,
static void GLAPIENTRY
_save_MultiDrawElementsBaseVertex(GLenum mode, const GLsizei *count,
- GLenum type, const GLvoid **indices,
+ GLenum type, const GLvoid * const *indices,
GLsizei primcount, const GLint *basevertex)
{
GET_CURRENT_CONTEXT(ctx);
@@ -1255,7 +1255,7 @@ _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,
+ const GLvoid * const *indices,
GLsizei primcount,
const GLint *basevertex)
{
diff --git a/mesalib/src/mesa/x86/Makefile.am b/mesalib/src/mesa/x86/Makefile.am
index f241de505..5976bb47c 100644
--- a/mesalib/src/mesa/x86/Makefile.am
+++ b/mesalib/src/mesa/x86/Makefile.am
@@ -22,6 +22,7 @@
if HAVE_X86_ASM
AM_CPPFLAGS = \
+ -I$(top_srcdir)/include \
-I$(top_srcdir)/src/mesa \
-I$(top_srcdir)/src/mapi \
$(API_DEFINES) \
diff --git a/mesalib/src/mesa/x86/gen_matypes.c b/mesalib/src/mesa/x86/gen_matypes.c
index 4fe99e799..a1d8ee67d 100644
--- a/mesalib/src/mesa/x86/gen_matypes.c
+++ b/mesalib/src/mesa/x86/gen_matypes.c
@@ -99,7 +99,7 @@ int main( int argc, char **argv )
OFFSET( "CTX_LIGHT_SHADE_MODEL ", struct gl_context, Light.ShadeModel );
OFFSET( "CTX_LIGHT_COLOR_MAT_FACE ", struct gl_context, Light.ColorMaterialFace );
OFFSET( "CTX_LIGHT_COLOR_MAT_MODE ", struct gl_context, Light.ColorMaterialMode );
- OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", struct gl_context, Light.ColorMaterialBitmask );
+ OFFSET( "CTX_LIGHT_COLOR_MAT_MASK ", struct gl_context, Light._ColorMaterialBitmask );
OFFSET( "CTX_LIGHT_COLOR_MAT_ENABLED ", struct gl_context, Light.ColorMaterialEnabled );
OFFSET( "CTX_LIGHT_ENABLED_LIST ", struct gl_context, Light.EnabledList );
OFFSET( "CTX_LIGHT_NEED_VERTS ", struct gl_context, Light._NeedVertices );