static void intelCopyTexSubImage2D(struct gl_context *ctx, struct gl_texture_image *texImage, GLint xoffset, GLint yoffset, struct gl_renderbuffer *rb, GLint x, GLint y, GLsizei width, GLsizei height) { if (!intel_copy_texsubimage(intel_context(ctx), intel_texture_image(texImage), xoffset, yoffset, intel_renderbuffer(rb), x, y, width, height)) { fallback_debug("%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexSubImage2D(ctx, texImage, xoffset, yoffset, rb, x, y, width, height); } }
static void intelCopyTexSubImage2D(struct gl_context * ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); /* Need to check texture is compatible with source format. */ if (!intel_copy_texsubimage(intel_context(ctx), intel_texture_image(texImage), xoffset, yoffset, x, y, width, height)) { fallback_debug("%s - fallback to swrast\n", __FUNCTION__); _mesa_meta_CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height); } }
void radeonCopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height) { struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); radeonContextPtr radeon = RADEON_CONTEXT(ctx); radeon_prepare_render(radeon); if (!do_copy_texsubimage(ctx, target, level, radeon_tex_obj(texObj), (radeon_texture_image *)texImage, xoffset, yoffset, x, y, width, height)) { radeon_print(RADEON_FALLBACKS, RADEON_NORMAL, "Falling back to sw for glCopyTexSubImage2D\n"); _mesa_meta_CopyTexSubImage2D(ctx, target, level, xoffset, yoffset, x, y, width, height); } }