meta: Delete the PBO texture upload/download path
authorJason Ekstrand <jason.ekstrand@intel.com>
Fri, 2 Jun 2017 03:38:19 +0000 (20:38 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Fri, 13 Oct 2017 02:58:40 +0000 (19:58 -0700)
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/Makefile.sources
src/mesa/drivers/common/meta.h
src/mesa/drivers/dri/i965/intel_tex.c
src/mesa/main/dd.h

index babdc2c41ffee92bf79b208b92ec4e4a20c96860..6da1e3fef9d6b1209efbb6e3ac38232e13b7d328 100644 (file)
@@ -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
 
index 1b5cf42eb87fdad93ad4d9b1fad3d77f51eca0f5..af2399642fcb8099ef2e8d5b6f3d8af268ca6952 100644 (file)
@@ -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,
index eda209f69d1c1d43dd154ce4cdbcc51df402d68e..65a1cb37d4573873f001b002cc0d670e55b36679 100644 (file)
@@ -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;
 }
index 7b2fe8b519cd17321d41b31277fb2a0ccc00a0bf..da03b2e8b94f5b879a5e21f77eecf554a7257118 100644 (file)
@@ -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