struct gl_texture_object **texObj,
GLenum *target);
+GLuint
+_mesa_meta_setup_sampler(struct gl_context *ctx,
+ const struct gl_texture_object *texObj,
+ GLenum target, GLenum filter, GLuint srcLevel);
+
extern void
_mesa_meta_BlitFramebuffer(struct gl_context *ctx,
GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1,
2);
}
- _mesa_GenSamplers(1, &sampler);
- _mesa_BindSampler(ctx->Texture.CurrentUnit, sampler);
-
/*
printf("Blit from texture!\n");
printf(" srcAtt %p dstAtt %p\n", readAtt, drawAtt);
printf(" srcTex %p dstText %p\n", texObj, drawAtt->Texture);
*/
- /* Prepare src texture state */
- _mesa_BindTexture(target, texObj->Name);
- _mesa_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, filter);
- _mesa_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, filter);
- if (target != GL_TEXTURE_RECTANGLE_ARB) {
- _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel);
- _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel);
- }
- _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
- _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+ sampler = _mesa_meta_setup_sampler(ctx, texObj, target, filter, srcLevel);
/* Always do our blits with no net sRGB decode or encode.
*
return true;
}
+GLuint
+_mesa_meta_setup_sampler(struct gl_context *ctx,
+ const struct gl_texture_object *texObj,
+ GLenum target, GLenum filter, GLuint srcLevel)
+{
+ GLuint sampler;
+
+ _mesa_GenSamplers(1, &sampler);
+ _mesa_BindSampler(ctx->Texture.CurrentUnit, sampler);
+
+ /* Prepare src texture state */
+ _mesa_BindTexture(target, texObj->Name);
+ _mesa_SamplerParameteri(sampler, GL_TEXTURE_MIN_FILTER, filter);
+ _mesa_SamplerParameteri(sampler, GL_TEXTURE_MAG_FILTER, filter);
+ if (target != GL_TEXTURE_RECTANGLE_ARB) {
+ _mesa_TexParameteri(target, GL_TEXTURE_BASE_LEVEL, srcLevel);
+ _mesa_TexParameteri(target, GL_TEXTURE_MAX_LEVEL, srcLevel);
+ }
+ _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE);
+ _mesa_SamplerParameteri(sampler, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE);
+
+ return sampler;
+}
+
/**
* Meta implementation of ctx->Driver.BlitFramebuffer() in terms
* of texture mapping and polygon rendering.