util_blitter_save_vertex_buffer_slot(rctx->blitter, rctx->vertex_buffer_state.vb);
util_blitter_save_vertex_elements(rctx->blitter, rctx->vertex_fetch_shader.cso);
util_blitter_save_vertex_shader(rctx->blitter, rctx->vs_shader);
- util_blitter_save_so_targets(rctx->blitter, rctx->streamout.num_targets,
- (struct pipe_stream_output_target**)rctx->streamout.targets);
+ util_blitter_save_so_targets(rctx->blitter, rctx->b.streamout.num_targets,
+ (struct pipe_stream_output_target**)rctx->b.streamout.targets);
util_blitter_save_rasterizer(rctx->blitter, rctx->rasterizer_state.cso);
if (op & R600_SAVE_FRAGMENT_STATE) {
/* XXX Decompressing MSAA depth textures is broken on R6xx.
* There is also a hardlock if CMASK and FMASK are not present.
* Just skip this until we find out how to fix it. */
- if (rctx->chip_class == R600 && max_sample > 0) {
+ if (rctx->b.chip_class == R600 && max_sample > 0) {
texture->dirty_level_mask = 0;
return;
}
- if (rctx->family == CHIP_RV610 || rctx->family == CHIP_RV630 ||
- rctx->family == CHIP_RV620 || rctx->family == CHIP_RV635)
+ if (rctx->b.family == CHIP_RV610 || rctx->b.family == CHIP_RV630 ||
+ rctx->b.family == CHIP_RV620 || rctx->b.family == CHIP_RV635)
depth = 0.0f;
else
depth = 1.0f;
zsurf = ctx->create_surface(ctx, &texture->resource.b.b, &surf_tmpl);
surf_tmpl.format = flushed_depth_texture->resource.b.b.format;
- surf_tmpl.u.tex.level = level;
- surf_tmpl.u.tex.first_layer = layer;
- surf_tmpl.u.tex.last_layer = layer;
cbsurf = ctx->create_surface(ctx,
&flushed_depth_texture->resource.b.b, &surf_tmpl);
surf_tmpl.u.tex.first_layer = layer;
surf_tmpl.u.tex.last_layer = layer;
- zsurf = rctx->context.create_surface(&rctx->context, &texture->resource.b.b, &surf_tmpl);
+ zsurf = rctx->b.b.create_surface(&rctx->b.b, &texture->resource.b.b, &surf_tmpl);
- r600_blitter_begin(&rctx->context, R600_DECOMPRESS);
+ r600_blitter_begin(&rctx->b.b, R600_DECOMPRESS);
util_blitter_custom_depth_stencil(rctx->blitter, zsurf, NULL, ~0,
rctx->custom_dsa_flush, 1.0f);
- r600_blitter_end(&rctx->context);
+ r600_blitter_end(&rctx->b.b);
pipe_surface_reference(&zsurf, NULL);
}
tex = (struct r600_texture *)view->texture;
assert(tex->is_depth && !tex->is_flushing_texture);
- if (rctx->chip_class >= EVERGREEN ||
+ if (rctx->b.chip_class >= EVERGREEN ||
r600_can_read_depth(tex)) {
r600_blit_decompress_depth_in_place(rctx, tex,
view->u.tex.first_level, view->u.tex.last_level,
0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
} else {
- r600_blit_decompress_depth(&rctx->context, tex, NULL,
+ r600_blit_decompress_depth(&rctx->b.b, tex, NULL,
view->u.tex.first_level, view->u.tex.last_level,
0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level),
0, u_max_sample(&tex->resource.b.b));
tex = (struct r600_texture *)view->texture;
assert(tex->cmask_size && tex->fmask_size);
- r600_blit_decompress_color(&rctx->context, tex,
+ r600_blit_decompress_color(&rctx->b.b, tex,
view->u.tex.first_level, view->u.tex.last_level,
0, util_max_layer(&tex->resource.b.b, view->u.tex.first_level));
}
struct r600_texture *rtex = (struct r600_texture*)tex;
if (rtex->is_depth && !rtex->is_flushing_texture) {
- if (rctx->chip_class >= EVERGREEN ||
+ if (rctx->b.chip_class >= EVERGREEN ||
r600_can_read_depth(rtex)) {
r600_blit_decompress_depth_in_place(rctx, rtex,
level, level,
struct pipe_framebuffer_state *fb = &rctx->framebuffer.state;
int i;
- if (rctx->chip_class < EVERGREEN) {
+ if (rctx->b.chip_class < EVERGREEN) {
return false;
}
else if (rctx->screen->has_streamout &&
/* Require 4-byte alignment. */
dstx % 4 == 0 && src_box->x % 4 == 0 && src_box->width % 4 == 0) {
+
+ /* Flush both resources. */
+ r600_flag_resource_cache_flush(rctx, src);
+ r600_flag_resource_cache_flush(rctx, dst);
+
r600_blitter_begin(ctx, R600_COPY_BUFFER);
util_blitter_copy_buffer(rctx->blitter, dst, dstx, src, src_box->x, src_box->width);
r600_blitter_end(ctx);
+
+ /* Flush the dst in case the 3D engine has been prefetching the resource. */
+ r600_flag_resource_cache_flush(rctx, dst);
} else {
util_resource_copy_region(ctx, dst, 0, dstx, 0, 0, src, 0, src_box);
}
uint32_t v = value;
if (rctx->screen->has_cp_dma &&
- rctx->chip_class >= EVERGREEN &&
+ rctx->b.chip_class >= EVERGREEN &&
offset % 4 == 0 && size % 4 == 0) {
uint32_t clear_value = v | (v << 8) | (v << 16) | (v << 24);
clear_value.ui[0] = v | (v << 8) | (v << 16) | (v << 24);
+ r600_flag_resource_cache_flush(rctx, dst);
+
r600_blitter_begin(ctx, R600_DISABLE_RENDER_COND);
util_blitter_clear_buffer(rctx->blitter, dst, offset, size,
1, &clear_value);
r600_blitter_end(ctx);
+
+ /* Flush again in case the 3D engine has been prefetching the resource. */
+ r600_flag_resource_cache_flush(rctx, dst);
} else {
char *map = r600_buffer_mmap_sync_with_rings(rctx, r600_resource(dst),
PIPE_TRANSFER_WRITE);
dst_view = r600_create_surface_custom(ctx, dst, &dst_templ, dst_width, dst_height);
- if (rctx->chip_class >= EVERGREEN) {
+ if (rctx->b.chip_class >= EVERGREEN) {
src_view = evergreen_create_sampler_view_custom(ctx, src, &src_templ,
src_width0, src_height0);
} else {
REPLACE_FORMAT_SIGN(B10G10R10A2, U);
REPLACE_FORMAT(R8);
REPLACE_FORMAT(R8G8);
- REPLACE_FORMAT(R8G8B8);
+ REPLACE_FORMAT(R8G8B8X8);
REPLACE_FORMAT(R8G8B8A8);
REPLACE_FORMAT(A8);
REPLACE_FORMAT(I8);
REPLACE_FORMAT(L8A8);
REPLACE_FORMAT(R16);
REPLACE_FORMAT(R16G16);
- REPLACE_FORMAT(R16G16B16);
+ REPLACE_FORMAT(R16G16B16X16);
REPLACE_FORMAT(R16G16B16A16);
REPLACE_FORMAT(A16);
REPLACE_FORMAT(I16);
struct pipe_resource *tmp, templ;
struct pipe_blit_info blit;
unsigned sample_mask =
- rctx->chip_class == CAYMAN ? ~0 :
+ rctx->b.chip_class == CAYMAN ? ~0 :
((1ull << MAX2(1, info->src.resource->nr_samples)) - 1);
assert(info->src.level == 0);
void r600_init_blit_functions(struct r600_context *rctx)
{
- rctx->context.clear = r600_clear;
- rctx->context.clear_render_target = r600_clear_render_target;
- rctx->context.clear_depth_stencil = r600_clear_depth_stencil;
- rctx->context.resource_copy_region = r600_resource_copy_region;
- rctx->context.blit = r600_blit;
+ rctx->b.b.clear = r600_clear;
+ rctx->b.b.clear_render_target = r600_clear_render_target;
+ rctx->b.b.clear_depth_stencil = r600_clear_depth_stencil;
+ rctx->b.b.resource_copy_region = r600_resource_copy_region;
+ rctx->b.b.blit = r600_blit;
}