intel_miptree_create_for_teximage(struct brw_context *brw,
struct intel_texture_object *intelObj,
struct intel_texture_image *intelImage,
- bool expect_accelerated_upload)
+ uint32_t layout_flags)
{
GLuint lastLevel;
int width, height, depth;
intel_miptree_get_dimensions_for_image(&intelImage->base.Base,
&width, &height, &depth);
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
/* Figure out image dimensions at start level. */
for (i = intelImage->base.Base.Level; i > 0; i--) {
width,
height,
depth,
- expect_accelerated_upload,
intelImage->base.Base.NumSamples,
- INTEL_MIPTREE_TILING_ANY,
- false);
+ layout_flags | MIPTREE_LAYOUT_ALLOC_ANY_TILED);
}
static void
bool tex_busy = intelImage->mt && drm_intel_bo_busy(intelImage->mt->bo);
DBG("%s mesa_format %s target %s format %s type %s level %d %dx%dx%d\n",
- __FUNCTION__, _mesa_get_format_name(texImage->TexFormat),
- _mesa_lookup_enum_by_nr(texImage->TexObject->Target),
- _mesa_lookup_enum_by_nr(format), _mesa_lookup_enum_by_nr(type),
+ __func__, _mesa_get_format_name(texImage->TexFormat),
+ _mesa_enum_to_string(texImage->TexObject->Target),
+ _mesa_enum_to_string(format), _mesa_enum_to_string(type),
texImage->Level, texImage->Width, texImage->Height, texImage->Depth);
/* Allocate storage for texture data. */
return;
DBG("%s: upload image %dx%dx%d pixels %p\n",
- __FUNCTION__, texImage->Width, texImage->Height, texImage->Depth,
+ __func__, texImage->Width, texImage->Height, texImage->Depth,
pixels);
_mesa_store_teximage(ctx, dims, texImage,
GLuint width, GLuint height,
GLuint pitch,
GLuint tile_x, GLuint tile_y,
- bool disable_aux_buffers)
+ uint32_t layout_flags)
{
struct brw_context *brw = brw_context(ctx);
struct intel_texture_image *intel_image = intel_texture_image(image);
intel_image->mt = intel_miptree_create_for_bo(brw, bo, image->TexFormat,
0, width, height, 1, pitch,
- disable_aux_buffers);
+ layout_flags);
if (intel_image->mt == NULL)
return;
intel_image->mt->target = target;
rb->Base.Base.Width,
rb->Base.Base.Height,
rb->mt->pitch,
- 0, 0,
- false /*disable_aux_buffers*/);
+ 0, 0, 0);
_mesa_unlock_texture(&brw->ctx, texObj);
}
image->width, image->height,
image->pitch,
image->tile_x, image->tile_y,
- true /*disable_aux_buffers*/);
+ MIPTREE_LAYOUT_DISABLE_AUX);
}
/**
error = brw_bo_map(brw, bo, false /* write enable */, "miptree");
if (error) {
- DBG("%s: failed to map bo\n", __FUNCTION__);
+ DBG("%s: failed to map bo\n", __func__);
return false;
}
DBG("%s: level=%d x,y=(%d,%d) (w,h)=(%d,%d) format=0x%x type=0x%x "
"mesa_format=0x%x tiling=%d "
"packing=(alignment=%d row_length=%d skip_pixels=%d skip_rows=%d)\n",
- __FUNCTION__, texImage->Level, xoffset, yoffset, width, height,
+ __func__, texImage->Level, xoffset, yoffset, width, height,
format, type, texImage->TexFormat, image->mt->tiling,
packing->Alignment, packing->RowLength, packing->SkipPixels,
packing->SkipRows);
struct brw_context *brw = brw_context(ctx);
bool ok;
- DBG("%s\n", __FUNCTION__);
+ DBG("%s\n", __func__);
if (_mesa_is_bufferobj(ctx->Pack.BufferObj)) {
if (_mesa_meta_pbo_GetTexSubImage(ctx, 3, texImage, 0, 0, 0,
texImage->Width, texImage->Height,
texImage->Depth, format, type,
- pixels, &ctx->Pack))
+ pixels, &ctx->Pack)) {
+ /* Flush to guarantee coherency between the render cache and other
+ * caches the PBO could potentially be bound to after this point.
+ * See the related comment in intelReadPixels() for a more detailed
+ * explanation.
+ */
+ brw_emit_mi_flush(brw);
return;
+ }
- perf_debug("%s: fallback to CPU mapping in PBO case\n", __FUNCTION__);
+ perf_debug("%s: fallback to CPU mapping in PBO case\n", __func__);
}
ok = intel_gettexsubimage_tiled_memcpy(ctx, texImage, 0, 0,
_mesa_meta_GetTexImage(ctx, format, type, pixels, texImage);
- DBG("%s - DONE\n", __FUNCTION__);
+ DBG("%s - DONE\n", __func__);
}
void