diff options
Diffstat (limited to 'src/mesa/state_tracker')
-rw-r--r-- | src/mesa/state_tracker/st_atom_rasterizer.c | 8 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_atom_shader.c | 9 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_bufferobjects.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_cb_fbo.c | 13 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 4 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_context.h | 1 | ||||
-rw-r--r-- | src/mesa/state_tracker/st_program.c | 24 |
7 files changed, 43 insertions, 20 deletions
diff --git a/src/mesa/state_tracker/st_atom_rasterizer.c b/src/mesa/state_tracker/st_atom_rasterizer.c index cceed42c828..0f01e9939de 100644 --- a/src/mesa/state_tracker/st_atom_rasterizer.c +++ b/src/mesa/state_tracker/st_atom_rasterizer.c @@ -237,6 +237,14 @@ static void update_raster_state( struct st_context *st ) /* _NEW_MULTISAMPLE */ raster->multisample = ctx->Multisample._Enabled; + /* _NEW_MULTISAMPLE | _NEW_BUFFERS */ + raster->force_persample_interp = + st->can_force_persample_interp && + ctx->Multisample._Enabled && + ctx->Multisample.SampleShading && + ctx->Multisample.MinSampleShadingValue * + ctx->DrawBuffer->Visual.samples > 1; + /* _NEW_SCISSOR */ raster->scissor = ctx->Scissor.EnableFlags; diff --git a/src/mesa/state_tracker/st_atom_shader.c b/src/mesa/state_tracker/st_atom_shader.c index fee15a980f3..1e880a107c0 100644 --- a/src/mesa/state_tracker/st_atom_shader.c +++ b/src/mesa/state_tracker/st_atom_shader.c @@ -70,8 +70,15 @@ update_fp( struct st_context *st ) key.clamp_color = st->clamp_frag_color_in_shader && st->ctx->Color._ClampFragmentColor; - /* Ignore sample qualifier while computing this flag. */ + /* Don't set it if the driver can force the interpolation by itself. + * If SAMPLE_ID or SAMPLE_POS are used, the interpolation is set + * automatically. + * Ignore sample qualifier while computing this flag. + */ key.persample_shading = + !st->can_force_persample_interp && + !(stfp->Base.Base.SystemValuesRead & (SYSTEM_BIT_SAMPLE_ID | + SYSTEM_BIT_SAMPLE_POS)) && _mesa_get_min_invocations_per_fragment(st->ctx, &stfp->Base, true) > 1; st->fp_variant = st_get_fp_variant(st, stfp, &key); diff --git a/src/mesa/state_tracker/st_cb_bufferobjects.c b/src/mesa/state_tracker/st_cb_bufferobjects.c index db254c2144e..8afd336779f 100644 --- a/src/mesa/state_tracker/st_cb_bufferobjects.c +++ b/src/mesa/state_tracker/st_cb_bufferobjects.c @@ -527,8 +527,4 @@ st_init_bufferobject_functions(struct dd_function_table *functions) functions->UnmapBuffer = st_bufferobj_unmap; functions->CopyBufferSubData = st_copy_buffer_subdata; functions->ClearBufferSubData = st_clear_buffer_subdata; - - /* For GL_APPLE_vertex_array_object */ - functions->NewArrayObject = _mesa_new_vao; - functions->DeleteArrayObject = _mesa_delete_vao; } diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 9d06a232bfa..ff703fa41cb 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -246,17 +246,6 @@ st_renderbuffer_delete(struct gl_context *ctx, struct gl_renderbuffer *rb) /** - * Called via ctx->Driver.NewFramebuffer() - */ -static struct gl_framebuffer * -st_new_framebuffer(struct gl_context *ctx, GLuint name) -{ - /* XXX not sure we need to subclass gl_framebuffer for pipe */ - return _mesa_new_framebuffer(ctx, name); -} - - -/** * Called via ctx->Driver.NewRenderbuffer() */ static struct gl_renderbuffer * @@ -826,7 +815,7 @@ st_UnmapRenderbuffer(struct gl_context *ctx, void st_init_fbo_functions(struct dd_function_table *functions) { - functions->NewFramebuffer = st_new_framebuffer; + functions->NewFramebuffer = _mesa_new_framebuffer; functions->NewRenderbuffer = st_new_renderbuffer; functions->FramebufferRenderbuffer = _mesa_FramebufferRenderbuffer_sw; functions->RenderTexture = st_render_texture; diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index 72c23cad4bc..a9ab5edcf49 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -237,6 +237,8 @@ st_create_context_priv( struct gl_context *ctx, struct pipe_context *pipe, PIPE_BIND_SAMPLER_VIEW); st->prefer_blit_based_texture_transfer = screen->get_param(screen, PIPE_CAP_PREFER_BLIT_BASED_TEXTURE_TRANSFER); + st->can_force_persample_interp = screen->get_param(screen, + PIPE_CAP_FORCE_PERSAMPLE_INTERP); st->needs_texcoord_semantic = screen->get_param(screen, PIPE_CAP_TGSI_TEXCOORD); @@ -410,8 +412,6 @@ void st_init_driver_functions(struct pipe_screen *screen, _mesa_init_shader_object_functions(functions); _mesa_init_sampler_object_functions(functions); - functions->Accum = _mesa_accum; - st_init_blit_functions(functions); st_init_bufferobject_functions(functions); st_init_clear_functions(functions); diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 81d5480431a..a4cda29059d 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -98,6 +98,7 @@ struct st_context boolean has_etc1; boolean has_etc2; boolean prefer_blit_based_texture_transfer; + boolean can_force_persample_interp; boolean needs_texcoord_semantic; boolean apply_texture_swizzle_to_border_color; diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index e62dd7aab80..a07f8fec309 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -619,7 +619,9 @@ st_translate_fragment_program(struct st_context *st, else interpLocation[slot] = TGSI_INTERPOLATE_LOC_CENTER; - if (key->persample_shading) + if (stfp->Base.Base.SystemValuesRead & (SYSTEM_BIT_SAMPLE_ID | + SYSTEM_BIT_SAMPLE_POS) || + key->persample_shading) interpLocation[slot] = TGSI_INTERPOLATE_LOC_SAMPLE; switch (attr) { @@ -1681,6 +1683,26 @@ st_precompile_shader_variant(struct st_context *st, break; } + case GL_TESS_CONTROL_PROGRAM_NV: { + struct st_tessctrl_program *p = (struct st_tessctrl_program *)prog; + struct st_tcp_variant_key key; + + memset(&key, 0, sizeof(key)); + key.st = st; + st_get_tcp_variant(st, p, &key); + break; + } + + case GL_TESS_EVALUATION_PROGRAM_NV: { + struct st_tesseval_program *p = (struct st_tesseval_program *)prog; + struct st_tep_variant_key key; + + memset(&key, 0, sizeof(key)); + key.st = st; + st_get_tep_variant(st, p, &key); + break; + } + case GL_GEOMETRY_PROGRAM_NV: { struct st_geometry_program *p = (struct st_geometry_program *)prog; struct st_gp_variant_key key; |