GLuint VBO;
GLuint FBO;
GLuint Sampler;
- GLuint ShaderProg;
struct sampler_table samplers;
};
*
* \returns a handle to a shader program on success or zero on failure.
*/
-static GLuint
+static void
setup_blit_shader(struct gl_context *ctx,
GLenum target,
struct sampler_table *table)
assert(sampler != NULL);
- if (sampler->shader_prog != 0)
- return sampler->shader_prog;
+ if (sampler->shader_prog != 0) {
+ _mesa_UseProgram(sampler->shader_prog);
+ return;
+ }
/* The version check is a little tricky. API is set to API_OPENGLES2 even
* for OpenGL ES 3.0 contexts, and GLSLVersion may be set to 140, for
link_program_with_debug(ctx, sampler->shader_prog);
ralloc_free(mem_ctx);
- return sampler->shader_prog;
+ _mesa_UseProgram(sampler->shader_prog);
}
/**
*/
if (glsl_version) {
setup_glsl_blit_framebuffer(ctx, blit, target);
- if (target == GL_TEXTURE_2D)
- _mesa_UseProgram(blit->samplers.sampler_2d.shader_prog);
- else
- _mesa_UseProgram(blit->samplers.sampler_rect.shader_prog);
}
else {
setup_ff_tnl_for_blit(&ctx->Meta->Blit.VAO,
*/
if (use_glsl_version) {
setup_glsl_blit_framebuffer(ctx, blit, tex->Target);
- if (tex->Target == GL_TEXTURE_2D)
- _mesa_UseProgram(blit->samplers.sampler_2d.shader_prog);
- else
- _mesa_UseProgram(blit->samplers.sampler_rect.shader_prog);
}
else {
setup_ff_tnl_for_blit(&blit->VAO, &blit->VBO, 2);
{
setup_vertex_objects(&mipmap->VAO, &mipmap->VBO, true, 2, 3, 0);
- mipmap->ShaderProg = setup_blit_shader(ctx, target,
- &mipmap->samplers);
+ setup_blit_shader(ctx, target, &mipmap->samplers);
}
*/
if (use_glsl_version) {
setup_glsl_generate_mipmap(ctx, mipmap, target);
- _mesa_UseProgram(mipmap->ShaderProg);
}
else {
setup_ff_tnl_for_blit(&mipmap->VAO, &mipmap->VBO, 3);
const bool use_glsl_version = ctx->Extensions.ARB_vertex_shader &&
ctx->Extensions.ARB_fragment_shader &&
(ctx->API != API_OPENGLES);
- GLuint shaderProg = 0;
if (slice > 0) {
assert(target == GL_TEXTURE_3D ||
setup_vertex_objects(&decompress->VAO, &decompress->VBO, true,
2, 4, 0);
- shaderProg = setup_blit_shader(ctx, target, &decompress->samplers);
+ setup_blit_shader(ctx, target, &decompress->samplers);
} else {
setup_ff_tnl_for_blit(&decompress->VAO, &decompress->VBO, 3);
}
if (!use_glsl_version)
_mesa_set_enable(ctx, target, GL_TRUE);
- else {
- assert(shaderProg != 0);
- _mesa_UseProgram(shaderProg);
- }
{
/* save texture object state */