#include "intel_image.h"
#include "intel_tiled_memcpy.h"
#include "brw_context.h"
+#include "brw_blorp.h"
#define FILE_DEBUG_FLAG DEBUG_TEXTURE
flags);
}
+static bool
+intel_texsubimage_blorp(struct brw_context *brw, GLuint dims,
+ struct gl_texture_image *tex_image,
+ unsigned x, unsigned y, unsigned z,
+ unsigned width, unsigned height, unsigned depth,
+ GLenum format, GLenum type, const void *pixels,
+ const struct gl_pixelstore_attrib *packing)
+{
+ struct intel_texture_image *intel_image = intel_texture_image(tex_image);
+ const unsigned mt_level = tex_image->Level + tex_image->TexObject->MinLevel;
+ const unsigned mt_z = tex_image->TexObject->MinLayer + tex_image->Face + z;
+
+ /* The blorp path can't understand crazy format hackery */
+ if (_mesa_base_tex_format(&brw->ctx, tex_image->InternalFormat) !=
+ _mesa_get_format_base_format(tex_image->TexFormat))
+ return false;
+
+ return brw_blorp_upload_miptree(brw, intel_image->mt, tex_image->TexFormat,
+ mt_level, x, y, mt_z, width, height, depth,
+ tex_image->TexObject->Target, format, type,
+ pixels, packing);
+}
/**
* \brief A fast path for glTexImage and glTexSubImage.
const GLvoid * pixels,
const struct gl_pixelstore_attrib *packing)
{
+ struct brw_context *brw = brw_context(ctx);
struct intel_mipmap_tree *mt = intel_texture_image(texImage)->mt;
bool ok;
if (mt && mt->format == MESA_FORMAT_S_UINT8)
mt->r8stencil_needs_update = true;
- ok = _mesa_meta_pbo_TexSubImage(ctx, dims, texImage,
+ if (_mesa_is_bufferobj(packing->BufferObj) || tex_busy) {
+ ok = intel_texsubimage_blorp(brw, dims, texImage,
xoffset, yoffset, zoffset,
width, height, depth, format, type,
- pixels, tex_busy, packing);
- if (ok)
- return;
+ pixels, packing);
+ if (ok)
+ return;
+ }
ok = intel_texsubimage_tiled_memcpy(ctx, dims, texImage,
xoffset, yoffset, zoffset,