Lines Matching refs:r300
53 static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op op) in r300_blitter_begin() argument
55 if ((op & R300_STOP_QUERY) && r300->query_current) { in r300_blitter_begin()
56 r300->blitter_saved_query = r300->query_current; in r300_blitter_begin()
57 r300_stop_query(r300); in r300_blitter_begin()
63 util_blitter_save_blend(r300->blitter, r300->blend_state.state); in r300_blitter_begin()
64 util_blitter_save_depth_stencil_alpha(r300->blitter, r300->dsa_state.state); in r300_blitter_begin()
65 util_blitter_save_stencil_ref(r300->blitter, &(r300->stencil_ref)); in r300_blitter_begin()
66 util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state); in r300_blitter_begin()
67 util_blitter_save_fragment_shader(r300->blitter, r300->fs.state); in r300_blitter_begin()
68 util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state); in r300_blitter_begin()
69 util_blitter_save_viewport(r300->blitter, &r300->viewport); in r300_blitter_begin()
70 util_blitter_save_scissor(r300->blitter, r300->scissor_state.state); in r300_blitter_begin()
71 util_blitter_save_sample_mask(r300->blitter, *(unsigned*)r300->sample_mask.state); in r300_blitter_begin()
72 util_blitter_save_vertex_buffer_slot(r300->blitter, r300->vertex_buffer); in r300_blitter_begin()
73 util_blitter_save_vertex_elements(r300->blitter, r300->velems); in r300_blitter_begin()
76 util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state); in r300_blitter_begin()
81 (struct r300_textures_state*)r300->textures_state.state; in r300_blitter_begin()
84 r300->blitter, state->sampler_state_count, in r300_blitter_begin()
88 r300->blitter, state->sampler_view_count, in r300_blitter_begin()
94 r300->blitter_saved_skip_rendering = r300->skip_rendering+1; in r300_blitter_begin()
95 r300->skip_rendering = FALSE; in r300_blitter_begin()
97 r300->blitter_saved_skip_rendering = 0; in r300_blitter_begin()
101 static void r300_blitter_end(struct r300_context *r300) in r300_blitter_end() argument
103 if (r300->blitter_saved_query) { in r300_blitter_end()
104 r300_resume_query(r300, r300->blitter_saved_query); in r300_blitter_end()
105 r300->blitter_saved_query = NULL; in r300_blitter_end()
108 if (r300->blitter_saved_skip_rendering) { in r300_blitter_end()
110 r300->skip_rendering = r300->blitter_saved_skip_rendering-1; in r300_blitter_end()
126 static boolean r300_cbzb_clear_allowed(struct r300_context *r300, in r300_cbzb_clear_allowed() argument
130 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_cbzb_clear_allowed()
139 static boolean r300_fast_zclear_allowed(struct r300_context *r300, in r300_fast_zclear_allowed() argument
143 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_fast_zclear_allowed()
148 static boolean r300_hiz_clear_allowed(struct r300_context *r300) in r300_hiz_clear_allowed() argument
151 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_hiz_clear_allowed()
180 static void r300_set_clear_color(struct r300_context *r300, in r300_set_clear_color() argument
184 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_set_clear_color()
193 r300->color_clear_value_gb = uc.h[0] | ((uint32_t)uc.h[1] << 16); in r300_set_clear_color()
194 r300->color_clear_value_ar = uc.h[2] | ((uint32_t)uc.h[3] << 16); in r300_set_clear_color()
196 r300->color_clear_value = uc.ui[0]; in r300_set_clear_color()
254 struct r300_context* r300 = r300_context(pipe); in r300_clear() local
256 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_clear()
258 (struct r300_hyperz_state*)r300->hyperz_state.state; in r300_clear()
274 zmask_clear = r300_fast_zclear_allowed(r300, buffers); in r300_clear()
275 hiz_clear = r300_hiz_clear_allowed(r300); in r300_clear()
281 if (!r300->hyperz_enabled && in r300_clear()
282 (r300->screen->caps.is_r500 || debug_get_option_hyperz())) { in r300_clear()
283 r300->hyperz_enabled = in r300_clear()
284 r300->rws->cs_request_feature(&r300->cs, in r300_clear()
287 if (r300->hyperz_enabled) { in r300_clear()
289 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG); in r300_clear()
294 if (r300->hyperz_enabled) { in r300_clear()
299 r300_mark_atom_dirty(r300, &r300->zmask_clear); in r300_clear()
300 r300_mark_atom_dirty(r300, &r300->gpu_flush); in r300_clear()
305 r300->hiz_clear_value = r300_hiz_clear_value(depth); in r300_clear()
306 r300_mark_atom_dirty(r300, &r300->hiz_clear); in r300_clear()
307 r300_mark_atom_dirty(r300, &r300->gpu_flush); in r300_clear()
309 r300->num_z_clears++; in r300_clear()
320 if (!r300->cmask_access) { in r300_clear()
321 r300->cmask_access = in r300_clear()
322 r300->rws->cs_request_feature(&r300->cs, in r300_clear()
328 if (r300->cmask_access) { in r300_clear()
331 if (!r300->screen->cmask_resource) { in r300_clear()
332 mtx_lock(&r300->screen->cmask_mutex); in r300_clear()
334 if (!r300->screen->cmask_resource) { in r300_clear()
338 r300->screen->cmask_resource = fb->cbufs[0]->texture; in r300_clear()
340 mtx_unlock(&r300->screen->cmask_mutex); in r300_clear()
343 if (r300->screen->cmask_resource == fb->cbufs[0]->texture) { in r300_clear()
344 r300_set_clear_color(r300, color); in r300_clear()
345 r300_mark_atom_dirty(r300, &r300->cmask_clear); in r300_clear()
346 r300_mark_atom_dirty(r300, &r300->gpu_flush); in r300_clear()
352 else if (r300_cbzb_clear_allowed(r300, buffers)) { in r300_clear()
361 r300->cbzb_clear = TRUE; in r300_clear()
362 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG); in r300_clear()
368 r300_blitter_begin(r300, R300_CLEAR); in r300_clear()
369 util_blitter_clear(r300->blitter, width, height, 1, in r300_clear()
372 r300_blitter_end(r300); in r300_clear()
373 } else if (r300->zmask_clear.dirty || in r300_clear()
374 r300->hiz_clear.dirty || in r300_clear()
375 r300->cmask_clear.dirty) { in r300_clear()
380 r300->gpu_flush.size + in r300_clear()
381 (r300->zmask_clear.dirty ? r300->zmask_clear.size : 0) + in r300_clear()
382 (r300->hiz_clear.dirty ? r300->hiz_clear.size : 0) + in r300_clear()
383 (r300->cmask_clear.dirty ? r300->cmask_clear.size : 0) + in r300_clear()
384 r300_get_num_cs_end_dwords(r300); in r300_clear()
387 if (!r300->rws->cs_check_space(&r300->cs, dwords, false)) { in r300_clear()
388 r300_flush(&r300->context, PIPE_FLUSH_ASYNC, NULL); in r300_clear()
392 r300_emit_gpu_flush(r300, r300->gpu_flush.size, r300->gpu_flush.state); in r300_clear()
393 r300->gpu_flush.dirty = FALSE; in r300_clear()
395 if (r300->zmask_clear.dirty) { in r300_clear()
396 r300_emit_zmask_clear(r300, r300->zmask_clear.size, in r300_clear()
397 r300->zmask_clear.state); in r300_clear()
398 r300->zmask_clear.dirty = FALSE; in r300_clear()
400 if (r300->hiz_clear.dirty) { in r300_clear()
401 r300_emit_hiz_clear(r300, r300->hiz_clear.size, in r300_clear()
402 r300->hiz_clear.state); in r300_clear()
403 r300->hiz_clear.dirty = FALSE; in r300_clear()
405 if (r300->cmask_clear.dirty) { in r300_clear()
406 r300_emit_cmask_clear(r300, r300->cmask_clear.size, in r300_clear()
407 r300->cmask_clear.state); in r300_clear()
408 r300->cmask_clear.dirty = FALSE; in r300_clear()
415 if (r300->cbzb_clear) { in r300_clear()
416 r300->cbzb_clear = FALSE; in r300_clear()
418 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG); in r300_clear()
425 if (r300->zmask_in_use || r300->hiz_in_use) { in r300_clear()
426 r300_mark_atom_dirty(r300, &r300->hyperz_state); in r300_clear()
438 struct r300_context *r300 = r300_context(pipe); in r300_clear_render_target() local
440 r300_blitter_begin(r300, R300_CLEAR_SURFACE | in r300_clear_render_target()
442 util_blitter_clear_render_target(r300->blitter, dst, color, in r300_clear_render_target()
444 r300_blitter_end(r300); in r300_clear_render_target()
457 struct r300_context *r300 = r300_context(pipe); in r300_clear_depth_stencil() local
459 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_clear_depth_stencil()
461 if (r300->zmask_in_use && !r300->locked_zbuffer) { in r300_clear_depth_stencil()
463 r300_decompress_zmask(r300); in r300_clear_depth_stencil()
468 r300_blitter_begin(r300, R300_CLEAR_SURFACE | in r300_clear_depth_stencil()
470 util_blitter_clear_depth_stencil(r300->blitter, dst, clear_flags, depth, stencil, in r300_clear_depth_stencil()
472 r300_blitter_end(r300); in r300_clear_depth_stencil()
475 void r300_decompress_zmask(struct r300_context *r300) in r300_decompress_zmask() argument
478 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_decompress_zmask()
480 if (!r300->zmask_in_use || r300->locked_zbuffer) in r300_decompress_zmask()
483 r300->zmask_decompress = TRUE; in r300_decompress_zmask()
484 r300_mark_atom_dirty(r300, &r300->hyperz_state); in r300_decompress_zmask()
486 r300_blitter_begin(r300, R300_DECOMPRESS); in r300_decompress_zmask()
487 util_blitter_custom_clear_depth(r300->blitter, fb->width, fb->height, 0, in r300_decompress_zmask()
488 r300->dsa_decompress_zmask); in r300_decompress_zmask()
489 r300_blitter_end(r300); in r300_decompress_zmask()
491 r300->zmask_decompress = FALSE; in r300_decompress_zmask()
492 r300->zmask_in_use = FALSE; in r300_decompress_zmask()
493 r300_mark_atom_dirty(r300, &r300->hyperz_state); in r300_decompress_zmask()
496 void r300_decompress_zmask_locked_unsafe(struct r300_context *r300) in r300_decompress_zmask_locked_unsafe() argument
501 fb.width = r300->locked_zbuffer->width; in r300_decompress_zmask_locked_unsafe()
502 fb.height = r300->locked_zbuffer->height; in r300_decompress_zmask_locked_unsafe()
503 fb.zsbuf = r300->locked_zbuffer; in r300_decompress_zmask_locked_unsafe()
505 r300->context.set_framebuffer_state(&r300->context, &fb); in r300_decompress_zmask_locked_unsafe()
506 r300_decompress_zmask(r300); in r300_decompress_zmask_locked_unsafe()
509 void r300_decompress_zmask_locked(struct r300_context *r300) in r300_decompress_zmask_locked() argument
514 util_copy_framebuffer_state(&saved_fb, r300->fb_state.state); in r300_decompress_zmask_locked()
515 r300_decompress_zmask_locked_unsafe(r300); in r300_decompress_zmask_locked()
516 r300->context.set_framebuffer_state(&r300->context, &saved_fb); in r300_decompress_zmask_locked()
519 pipe_surface_reference(&r300->locked_zbuffer, NULL); in r300_decompress_zmask_locked()
542 struct r300_context *r300 = r300_context(pipe); in r300_resource_copy_region() local
544 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_resource_copy_region()
572 util_blitter_default_src_texture(r300->blitter, &src_templ, src, src_level); in r300_resource_copy_region()
662 if (r300->zmask_in_use && !r300->locked_zbuffer) { in r300_resource_copy_region()
665 r300_decompress_zmask(r300); in r300_resource_copy_region()
675 r300_blitter_begin(r300, R300_COPY); in r300_resource_copy_region()
676 util_blitter_blit_generic(r300->blitter, dst_view, &dstbox, in r300_resource_copy_region()
680 r300_blitter_end(r300); in r300_resource_copy_region()
719 struct r300_context *r300 = r300_context(pipe); in r300_simple_msaa_resolve() local
722 struct r300_aa_state *aa = (struct r300_aa_state*)r300->aa_state.state; in r300_simple_msaa_resolve()
741 r300->aa_state.size = 8; in r300_simple_msaa_resolve()
742 r300_mark_atom_dirty(r300, &r300->aa_state); in r300_simple_msaa_resolve()
745 r300_blitter_begin(r300, R300_CLEAR_SURFACE); in r300_simple_msaa_resolve()
746 util_blitter_custom_color(r300->blitter, &srcsurf->base, NULL); in r300_simple_msaa_resolve()
747 r300_blitter_end(r300); in r300_simple_msaa_resolve()
751 r300->aa_state.size = 4; in r300_simple_msaa_resolve()
752 r300_mark_atom_dirty(r300, &r300->aa_state); in r300_simple_msaa_resolve()
761 struct r300_context *r300 = r300_context(pipe); in r300_msaa_resolve() local
800 r300_blitter_begin(r300, R300_BLIT | R300_IGNORE_RENDER_COND); in r300_msaa_resolve()
801 util_blitter_blit(r300->blitter, &blit); in r300_msaa_resolve()
802 r300_blitter_end(r300); in r300_msaa_resolve()
810 struct r300_context *r300 = r300_context(pipe); in r300_blit() local
812 (struct pipe_framebuffer_state*)r300->fb_state.state; in r300_blit()
860 if (r300->zmask_in_use && !r300->locked_zbuffer) { in r300_blit()
863 r300_decompress_zmask(r300); in r300_blit()
867 r300_blitter_begin(r300, R300_BLIT | in r300_blit()
869 util_blitter_blit(r300->blitter, &info); in r300_blit()
870 r300_blitter_end(r300); in r300_blit()
878 void r300_init_blit_functions(struct r300_context *r300) in r300_init_blit_functions() argument
880 r300->context.clear = r300_clear; in r300_init_blit_functions()
881 r300->context.clear_render_target = r300_clear_render_target; in r300_init_blit_functions()
882 r300->context.clear_depth_stencil = r300_clear_depth_stencil; in r300_init_blit_functions()
883 r300->context.resource_copy_region = r300_resource_copy_region; in r300_init_blit_functions()
884 r300->context.blit = r300_blit; in r300_init_blit_functions()
885 r300->context.flush_resource = r300_flush_resource; in r300_init_blit_functions()