From 760a5815d4bb6d3d7bd5c9dad8a195c7f5ae79d1 Mon Sep 17 00:00:00 2001 From: Jason Ekstrand Date: Thu, 1 Jun 2017 20:38:19 -0700 Subject: [PATCH] meta: Delete the PBO texture upload/download path Reviewed-by: Topi Pohjolainen Reviewed-by: Kenneth Graunke --- src/mesa/Makefile.sources | 1 - src/mesa/drivers/common/meta.h | 17 -------- src/mesa/drivers/dri/i965/intel_tex.c | 63 --------------------------- src/mesa/main/dd.h | 16 ------- 4 files changed, 97 deletions(-) diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources index babdc2c41ff..6da1e3fef9d 100644 --- a/src/mesa/Makefile.sources +++ b/src/mesa/Makefile.sources @@ -643,7 +643,6 @@ COMMON_DRIVER_FILES = \ drivers/common/driverfuncs.h \ drivers/common/meta_blit.c \ drivers/common/meta_generate_mipmap.c \ - drivers/common/meta_tex_subimage.c \ drivers/common/meta.c \ drivers/common/meta.h diff --git a/src/mesa/drivers/common/meta.h b/src/mesa/drivers/common/meta.h index 1b5cf42eb87..af2399642fc 100644 --- a/src/mesa/drivers/common/meta.h +++ b/src/mesa/drivers/common/meta.h @@ -520,23 +520,6 @@ extern void _mesa_meta_GenerateMipmap(struct gl_context *ctx, GLenum target, struct gl_texture_object *texObj); -extern bool -_mesa_meta_pbo_TexSubImage(struct gl_context *ctx, GLuint dims, - struct gl_texture_image *tex_image, - int xoffset, int yoffset, int zoffset, - int width, int height, int depth, - GLenum format, GLenum type, const void *pixels, - bool create_pbo, - const struct gl_pixelstore_attrib *packing); - -extern bool -_mesa_meta_pbo_GetTexSubImage(struct gl_context *ctx, GLuint dims, - struct gl_texture_image *tex_image, - int xoffset, int yoffset, int zoffset, - int width, int height, int depth, - GLenum format, GLenum type, const void *pixels, - const struct gl_pixelstore_attrib *packing); - extern void _mesa_meta_CopyTexSubImage(struct gl_context *ctx, GLuint dims, struct gl_texture_image *texImage, diff --git a/src/mesa/drivers/dri/i965/intel_tex.c b/src/mesa/drivers/dri/i965/intel_tex.c index eda209f69d1..65a1cb37d45 100644 --- a/src/mesa/drivers/dri/i965/intel_tex.c +++ b/src/mesa/drivers/dri/i965/intel_tex.c @@ -302,67 +302,6 @@ intel_texture_view(struct gl_context *ctx, return GL_TRUE; } -static bool -intel_set_texture_storage_for_buffer_object(struct gl_context *ctx, - struct gl_texture_object *tex_obj, - struct gl_buffer_object *buffer_obj, - uint32_t buffer_offset, - uint32_t row_stride, - bool read_only) -{ - struct brw_context *brw = brw_context(ctx); - struct intel_texture_object *intel_texobj = intel_texture_object(tex_obj); - struct gl_texture_image *image = tex_obj->Image[0][0]; - struct intel_texture_image *intel_image = intel_texture_image(image); - struct intel_buffer_object *intel_buffer_obj = intel_buffer_object(buffer_obj); - - if (!read_only) { - /* Renderbuffers have the restriction that the buffer offset and - * surface pitch must be a multiple of the element size. If it's - * not, we have to fail and fall back to software. - */ - int cpp = _mesa_get_format_bytes(image->TexFormat); - if (buffer_offset % cpp || row_stride % cpp) { - perf_debug("Bad PBO alignment; fallback to CPU mapping\n"); - return false; - } - - if (!brw->mesa_format_supports_render[image->TexFormat]) { - perf_debug("Non-renderable PBO format; fallback to CPU mapping\n"); - return false; - } - } - - assert(intel_texobj->mt == NULL); - - struct brw_bo *bo = intel_bufferobj_buffer(brw, intel_buffer_obj, - buffer_offset, - row_stride * image->Height, - !read_only); - intel_texobj->mt = - intel_miptree_create_for_bo(brw, bo, - image->TexFormat, - buffer_offset, - image->Width, image->Height, image->Depth, - row_stride, - MIPTREE_CREATE_DEFAULT); - if (!intel_texobj->mt) - return false; - - if (!_swrast_init_texture_image(image)) - return false; - - intel_miptree_reference(&intel_image->mt, intel_texobj->mt); - - /* The miptree is in a validated state, so no need to check later. */ - intel_texobj->needs_validate = false; - intel_texobj->validated_first_level = 0; - intel_texobj->validated_last_level = 0; - intel_texobj->_Format = intel_texobj->mt->format; - - return true; -} - static void intel_texture_barrier(struct gl_context *ctx) { @@ -395,7 +334,5 @@ intelInitTextureFuncs(struct dd_function_table *functions) functions->MapTextureImage = intel_map_texture_image; functions->UnmapTextureImage = intel_unmap_texture_image; functions->TextureView = intel_texture_view; - functions->SetTextureStorageForBufferObject = - intel_set_texture_storage_for_buffer_object; functions->TextureBarrier = intel_texture_barrier; } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 7b2fe8b519c..da03b2e8b94 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -426,22 +426,6 @@ struct dd_function_table { struct gl_texture_object *texObj, struct gl_texture_object *origTexObj); - /** Sets the given buffer object as the texture's storage. The given - * texture must have target GL_TEXTURE_1D, GL_TEXTURE_2D, - * GL_TEXTURE_RECTANGLE, and GL_TEXTURE_2D_ARRAY; have only a single - * mipmap level; be immutable; and must not have any assigned storage. - * The format and dimensions of the gl_texture_object will already be - * initialized. - * - * This function is used by the meta PBO texture upload path. - */ - bool (*SetTextureStorageForBufferObject)(struct gl_context *ctx, - struct gl_texture_object *texObj, - struct gl_buffer_object *bufferObj, - uint32_t buffer_offset, - uint32_t row_stride, - bool read_only); - /** * Map a renderbuffer into user space. * \param mode bitmask of GL_MAP_READ_BIT, GL_MAP_WRITE_BIT and -- 2.30.2