diff options
Diffstat (limited to 'mesalib/src/mesa')
-rw-r--r-- | mesalib/src/mesa/main/macros.h | 4 | ||||
-rw-r--r-- | mesalib/src/mesa/program/program_parse.y | 6 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_draw.c | 2 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_extensions.c | 8 | ||||
-rw-r--r-- | mesalib/src/mesa/state_tracker/st_format.c | 23 |
5 files changed, 36 insertions, 7 deletions
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h index a54663ced..1d5d7f346 100644 --- a/mesalib/src/mesa/main/macros.h +++ b/mesalib/src/mesa/main/macros.h @@ -669,6 +669,10 @@ do { \ /** Maximum of two values: */
#define MAX2( A, B ) ( (A)>(B) ? (A) : (B) )
+/** Minimum and maximum of three values: */
+#define MIN3( A, B, C ) ((A) < (B) ? MIN2(A, C) : MIN2(B, C))
+#define MAX3( A, B, C ) ((A) > (B) ? MAX2(A, C) : MAX2(B, C))
+
/** Dot product of two 2-element vectors */
#define DOT2( a, b ) ( (a)[0]*(b)[0] + (a)[1]*(b)[1] )
diff --git a/mesalib/src/mesa/program/program_parse.y b/mesalib/src/mesa/program/program_parse.y index d87470b49..e7752fcbd 100644 --- a/mesalib/src/mesa/program/program_parse.y +++ b/mesalib/src/mesa/program/program_parse.y @@ -1258,7 +1258,11 @@ optArraySize: | INTEGER
{
if (($1 < 1) || ((unsigned) $1 > state->limits->MaxParameters)) {
- yyerror(& @1, state, "invalid parameter array size");
+ char msg[100];
+ _mesa_snprintf(msg, sizeof(msg),
+ "invalid parameter array size (size=%d max=%u)",
+ $1, state->limits->MaxParameters);
+ yyerror(& @1, state, msg);
YYERROR;
} else {
$$ = $1;
diff --git a/mesalib/src/mesa/state_tracker/st_draw.c b/mesalib/src/mesa/state_tracker/st_draw.c index 61e127776..bf4fef57a 100644 --- a/mesalib/src/mesa/state_tracker/st_draw.c +++ b/mesalib/src/mesa/state_tracker/st_draw.c @@ -247,7 +247,7 @@ is_interleaved_arrays(const struct st_vertex_program *vp, const struct gl_buffer_object *firstBufObj = NULL;
GLint firstStride = -1;
const GLubyte *client_addr = NULL;
- GLboolean user_memory;
+ GLboolean user_memory = GL_FALSE;
for (attr = 0; attr < vpv->num_inputs; attr++) {
const GLuint mesaAttr = vp->index_to_input[attr];
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c index 1cbe618ce..8f697fa51 100644 --- a/mesalib/src/mesa/state_tracker/st_extensions.c +++ b/mesalib/src/mesa/state_tracker/st_extensions.c @@ -167,6 +167,8 @@ void st_init_limits(struct st_context *st) pc->MaxNativeAddressRegs = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_ADDRS);
pc->MaxNativeParameters = screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_CONSTS);
pc->MaxUniformComponents = 4 * MIN2(pc->MaxNativeParameters, MAX_UNIFORMS);
+ /* raise MaxParameters if native support is higher */
+ pc->MaxParameters = MAX2(pc->MaxParameters, pc->MaxNativeParameters);
options->EmitNoNoise = TRUE;
@@ -187,7 +189,7 @@ void st_init_limits(struct st_context *st) options->EmitNoIndirectUniform = !screen->get_shader_param(screen, sh,
PIPE_SHADER_CAP_INDIRECT_CONST_ADDR);
- if(options->EmitNoLoops)
+ if (options->EmitNoLoops)
options->MaxUnrollIterations = MIN2(screen->get_shader_param(screen, sh, PIPE_SHADER_CAP_MAX_INSTRUCTIONS), 65536);
}
@@ -539,8 +541,8 @@ void st_init_extensions(struct st_context *st) PIPE_TEXTURE_2D, 0,
PIPE_BIND_RENDER_TARGET) &&
!screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_SNORM,
- PIPE_TEXTURE_2D, 0,
- PIPE_BIND_RENDER_TARGET) &&
+ PIPE_TEXTURE_2D, 0,
+ PIPE_BIND_RENDER_TARGET) &&
!screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16A16_FLOAT,
PIPE_TEXTURE_2D, 0,
PIPE_BIND_RENDER_TARGET) &&
diff --git a/mesalib/src/mesa/state_tracker/st_format.c b/mesalib/src/mesa/state_tracker/st_format.c index 8b3e782a5..32b44b806 100644 --- a/mesalib/src/mesa/state_tracker/st_format.c +++ b/mesalib/src/mesa/state_tracker/st_format.c @@ -954,14 +954,24 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, /* prefer formats in order of data size, choosing 16-bit ones if equal sized */
case GL_RGBA16F_ARB:
+ {
+ static const enum pipe_format formats[] = {
+ PIPE_FORMAT_R16G16B16A16_FLOAT,
+ PIPE_FORMAT_R32G32B32A32_FLOAT
+ };
+ return find_supported_format(screen, formats, Elements(formats),
+ target, sample_count, bindings);
+ }
case GL_RGB16F_ARB:
{
static const enum pipe_format formats[] = {
+ PIPE_FORMAT_R16G16B16_FLOAT,
PIPE_FORMAT_R16G16B16A16_FLOAT,
+ PIPE_FORMAT_R32G32B32_FLOAT,
PIPE_FORMAT_R32G32B32A32_FLOAT
};
return find_supported_format(screen, formats, Elements(formats),
- target, sample_count, bindings);
+ target, sample_count, bindings);
}
case GL_LUMINANCE_ALPHA16F_ARB:
{
@@ -1040,14 +1050,23 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, /* try a 32-bit format if available, otherwise fallback to a 16-bit one */
case GL_RGBA32F_ARB:
+ {
+ static const enum pipe_format formats[] = {
+ PIPE_FORMAT_R32G32B32A32_FLOAT,
+ PIPE_FORMAT_R16G16B16A16_FLOAT
+ };
+ return find_supported_format(screen, formats, Elements(formats),
+ target, sample_count, bindings);
+ }
case GL_RGB32F_ARB:
{
static const enum pipe_format formats[] = {
+ PIPE_FORMAT_R32G32B32_FLOAT,
PIPE_FORMAT_R32G32B32A32_FLOAT,
PIPE_FORMAT_R16G16B16A16_FLOAT
};
return find_supported_format(screen, formats, Elements(formats),
- target, sample_count, bindings);
+ target, sample_count, bindings);
}
case GL_LUMINANCE_ALPHA32F_ARB:
{
|