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
_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,
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)
{
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;
}
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