aboutsummaryrefslogtreecommitdiff
path: root/mesalib/src/mesa/state_tracker
diff options
context:
space:
mode:
Diffstat (limited to 'mesalib/src/mesa/state_tracker')
-rw-r--r--mesalib/src/mesa/state_tracker/st_context.c5
-rw-r--r--mesalib/src/mesa/state_tracker/st_extensions.c24
-rw-r--r--mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp10
3 files changed, 18 insertions, 21 deletions
diff --git a/mesalib/src/mesa/state_tracker/st_context.c b/mesalib/src/mesa/state_tracker/st_context.c
index 7d18c2521..80393cff7 100644
--- a/mesalib/src/mesa/state_tracker/st_context.c
+++ b/mesalib/src/mesa/state_tracker/st_context.c
@@ -221,11 +221,6 @@ struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
struct gl_context *shareCtx = share ? share->ctx : NULL;
struct dd_function_table funcs;
- /* Sanity checks */
- STATIC_ASSERT(MESA_SHADER_VERTEX == PIPE_SHADER_VERTEX);
- STATIC_ASSERT(MESA_SHADER_FRAGMENT == PIPE_SHADER_FRAGMENT);
- STATIC_ASSERT(MESA_SHADER_GEOMETRY == PIPE_SHADER_GEOMETRY);
-
memset(&funcs, 0, sizeof(funcs));
st_init_driver_functions(&funcs);
diff --git a/mesalib/src/mesa/state_tracker/st_extensions.c b/mesalib/src/mesa/state_tracker/st_extensions.c
index 83e8e2e96..32348ef73 100644
--- a/mesalib/src/mesa/state_tracker/st_extensions.c
+++ b/mesalib/src/mesa/state_tracker/st_extensions.c
@@ -68,7 +68,7 @@ void st_init_limits(struct st_context *st)
{
struct pipe_screen *screen = st->pipe->screen;
struct gl_constants *c = &st->ctx->Const;
- gl_shader_type sh;
+ unsigned sh;
boolean can_ubo = TRUE;
c->MaxTextureLevels
@@ -149,23 +149,25 @@ void st_init_limits(struct st_context *st)
can_ubo = FALSE;
}
- for (sh = 0; sh < MESA_SHADER_TYPES; ++sh) {
- struct gl_shader_compiler_options *options =
- &st->ctx->ShaderCompilerOptions[sh];
+ for (sh = 0; sh < PIPE_SHADER_TYPES; ++sh) {
+ struct gl_shader_compiler_options *options;
struct gl_program_constants *pc;
switch (sh) {
case PIPE_SHADER_FRAGMENT:
pc = &c->FragmentProgram;
+ options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_FRAGMENT];
break;
case PIPE_SHADER_VERTEX:
pc = &c->VertexProgram;
+ options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_VERTEX];
break;
case PIPE_SHADER_GEOMETRY:
pc = &c->GeometryProgram;
+ options = &st->ctx->ShaderCompilerOptions[MESA_SHADER_GEOMETRY];
break;
default:
- assert(0);
+ /* compute shader, etc. */
continue;
}
@@ -274,9 +276,6 @@ void st_init_limits(struct st_context *st)
c->GLSLSkipStrictMaxUniformLimitCheck =
screen->get_param(screen, PIPE_CAP_TGSI_CAN_COMPACT_CONSTANTS);
- c->GLSLSkipStrictMaxVaryingLimitCheck =
- screen->get_param(screen, PIPE_CAP_TGSI_CAN_COMPACT_VARYINGS);
-
if (can_ubo) {
st->ctx->Extensions.ARB_uniform_buffer_object = GL_TRUE;
c->UniformBufferOffsetAlignment =
@@ -552,7 +551,14 @@ void st_init_extensions(struct st_context *st)
ctx->Extensions.EXT_pixel_buffer_object = GL_TRUE;
ctx->Extensions.EXT_point_parameters = GL_TRUE;
ctx->Extensions.EXT_provoking_vertex = GL_TRUE;
- ctx->Extensions.EXT_separate_shader_objects = GL_TRUE;
+
+ /* IMPORTANT:
+ * Don't enable EXT_separate_shader_objects. It disallows a certain
+ * optimization in the GLSL compiler and therefore is considered
+ * harmful.
+ */
+ ctx->Extensions.EXT_separate_shader_objects = GL_FALSE;
+
ctx->Extensions.EXT_texture_env_dot3 = GL_TRUE;
ctx->Extensions.EXT_vertex_array_bgra = GL_TRUE;
diff --git a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
index 32bc2b37b..64e0a8a46 100644
--- a/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
+++ b/mesalib/src/mesa/state_tracker/st_glsl_to_tgsi.cpp
@@ -5271,15 +5271,11 @@ st_link_shader(struct gl_context *ctx, struct gl_shader_program *prog)
linked_prog = get_mesa_program(ctx, prog, prog->_LinkedShaders[i]);
if (linked_prog) {
- static const GLenum targets[] = {
- GL_VERTEX_PROGRAM_ARB,
- GL_FRAGMENT_PROGRAM_ARB,
- GL_GEOMETRY_PROGRAM_NV
- };
-
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
linked_prog);
- if (!ctx->Driver.ProgramStringNotify(ctx, targets[i], linked_prog)) {
+ if (!ctx->Driver.ProgramStringNotify(ctx,
+ _mesa_program_index_to_target(i),
+ linked_prog)) {
_mesa_reference_program(ctx, &prog->_LinkedShaders[i]->Program,
NULL);
_mesa_reference_program(ctx, &linked_prog, NULL);