Lines Matching refs:r300
48 static void r300_blitter_begin(struct r300_context* r300, enum r300_blitter_op op)
50 if ((op & R300_STOP_QUERY) && r300->query_current) {
51 r300->blitter_saved_query = r300->query_current;
52 r300_stop_query(r300);
58 util_blitter_save_blend(r300->blitter, r300->blend_state.state);
59 util_blitter_save_depth_stencil_alpha(r300->blitter, r300->dsa_state.state);
60 util_blitter_save_stencil_ref(r300->blitter, &(r300->stencil_ref));
61 util_blitter_save_rasterizer(r300->blitter, r300->rs_state.state);
62 util_blitter_save_fragment_shader(r300->blitter, r300->fs.state);
63 util_blitter_save_vertex_shader(r300->blitter, r300->vs_state.state);
64 util_blitter_save_viewport(r300->blitter, &r300->viewport);
65 util_blitter_save_vertex_buffers(r300->blitter, r300->nr_vertex_buffers,
66 r300->vertex_buffer);
67 util_blitter_save_vertex_elements(r300->blitter, r300->velems);
70 util_blitter_save_framebuffer(r300->blitter, r300->fb_state.state);
75 (struct r300_textures_state*)r300->textures_state.state;
78 r300->blitter, state->sampler_state_count,
82 r300->blitter, state->sampler_view_count,
88 r300->blitter_saved_skip_rendering = r300->skip_rendering+1;
89 r300->skip_rendering = FALSE;
91 r300->blitter_saved_skip_rendering = 0;
95 static void r300_blitter_end(struct r300_context *r300)
97 if (r300->blitter_saved_query) {
98 r300_resume_query(r300, r300->blitter_saved_query);
99 r300->blitter_saved_query = NULL;
102 if (r300->blitter_saved_skip_rendering) {
104 r300->skip_rendering = r300->blitter_saved_skip_rendering-1;
120 static boolean r300_cbzb_clear_allowed(struct r300_context *r300,
124 (struct pipe_framebuffer_state*)r300->fb_state.state;
133 static boolean r300_fast_zclear_allowed(struct r300_context *r300)
136 (struct pipe_framebuffer_state*)r300->fb_state.state;
141 static boolean r300_hiz_clear_allowed(struct r300_context *r300)
144 (struct pipe_framebuffer_state*)r300->fb_state.state;
224 struct r300_context* r300 = r300_context(pipe);
226 (struct pipe_framebuffer_state*)r300->fb_state.state;
228 (struct r300_hyperz_state*)r300->hyperz_state.state;
238 zmask_clear = r300_fast_zclear_allowed(r300);
239 hiz_clear = r300_hiz_clear_allowed(r300);
243 r300->num_z_clears++;
246 if (!r300->hyperz_enabled) {
247 r300->hyperz_enabled =
248 r300->rws->cs_request_feature(r300->cs,
251 if (r300->hyperz_enabled) {
253 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG);
258 if (r300->hyperz_enabled) {
259 DBG(r300, DBG_HYPERZ, "r300: Clear memory: %s%s\n",
266 r300_mark_atom_dirty(r300, &r300->zmask_clear);
271 r300->hiz_clear_value = r300_hiz_clear_value(depth);
272 r300_mark_atom_dirty(r300, &r300->hiz_clear);
279 if (r300_cbzb_clear_allowed(r300, buffers)) {
288 r300->cbzb_clear = TRUE;
289 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG);
296 r300_blitter_begin(r300, R300_CLEAR);
297 util_blitter_clear(r300->blitter,
302 r300_blitter_end(r300);
303 } else if (r300->zmask_clear.dirty || r300->hiz_clear.dirty) {
308 (r300->zmask_clear.dirty ? r300->zmask_clear.size : 0) +
309 (r300->hiz_clear.dirty ? r300->hiz_clear.size : 0) +
310 r300_get_num_cs_end_dwords(r300);
313 if (dwords > (RADEON_MAX_CMDBUF_DWORDS - r300->cs->cdw)) {
314 r300_flush(&r300->context, RADEON_FLUSH_ASYNC, NULL);
318 if (r300->zmask_clear.dirty) {
319 r300_emit_zmask_clear(r300, r300->zmask_clear.size,
320 r300->zmask_clear.state);
321 r300->zmask_clear.dirty = FALSE;
323 if (r300->hiz_clear.dirty) {
324 r300_emit_hiz_clear(r300, r300->hiz_clear.size,
325 r300->hiz_clear.state);
326 r300->hiz_clear.dirty = FALSE;
333 if (r300->cbzb_clear) {
334 r300->cbzb_clear = FALSE;
336 r300_mark_fb_state_dirty(r300, R300_CHANGED_HYPERZ_FLAG);
343 if (r300->zmask_in_use || r300->hiz_in_use) {
344 r300_mark_atom_dirty(r300, &r300->hyperz_state);
355 struct r300_context *r300 = r300_context(pipe);
357 r300_blitter_begin(r300, R300_CLEAR_SURFACE);
358 util_blitter_clear_render_target(r300->blitter, dst, color,
360 r300_blitter_end(r300);
372 struct r300_context *r300 = r300_context(pipe);
374 (struct pipe_framebuffer_state*)r300->fb_state.state;
376 if (r300->zmask_in_use && !r300->locked_zbuffer) {
378 r300_decompress_zmask(r300);
383 r300_blitter_begin(r300, R300_CLEAR_SURFACE);
384 util_blitter_clear_depth_stencil(r300->blitter, dst, clear_flags, depth, stencil,
386 r300_blitter_end(r300);
389 void r300_decompress_zmask(struct r300_context *r300)
392 (struct pipe_framebuffer_state*)r300->fb_state.state;
394 if (!r300->zmask_in_use || r300->locked_zbuffer)
397 r300->zmask_decompress = TRUE;
398 r300_mark_atom_dirty(r300, &r300->hyperz_state);
400 r300_blitter_begin(r300, R300_DECOMPRESS);
401 util_blitter_custom_clear_depth(r300->blitter, fb->width, fb->height, 0,
402 r300->dsa_decompress_zmask);
403 r300_blitter_end(r300);
405 r300->zmask_decompress = FALSE;
406 r300->zmask_in_use = FALSE;
407 r300_mark_atom_dirty(r300, &r300->hyperz_state);
410 void r300_decompress_zmask_locked_unsafe(struct r300_context *r300)
415 fb.width = r300->locked_zbuffer->width;
416 fb.height = r300->locked_zbuffer->height;
417 fb.zsbuf = r300->locked_zbuffer;
419 r300->context.set_framebuffer_state(&r300->context, &fb);
420 r300_decompress_zmask(r300);
423 void r300_decompress_zmask_locked(struct r300_context *r300)
428 util_copy_framebuffer_state(&saved_fb, r300->fb_state.state);
429 r300_decompress_zmask_locked_unsafe(r300);
430 r300->context.set_framebuffer_state(&r300->context, &saved_fb);
433 pipe_surface_reference(&r300->locked_zbuffer, NULL);
456 struct r300_context *r300 = r300_context(pipe);
458 (struct pipe_framebuffer_state*)r300->fb_state.state;
507 debug_printf("r300: copy_region: Unhandled format: %s. Falling back to software.\n"
508 "r300: copy_region: Software fallback doesn't work for tiled textures.\n",
569 if (r300->zmask_in_use && !r300->locked_zbuffer) {
572 r300_decompress_zmask(r300);
579 r300_blitter_begin(r300, R300_COPY);
580 util_blitter_copy_texture_view(r300->blitter, dst_view, ~0, dstx, dsty,
583 r300_blitter_end(r300);
589 void r300_init_blit_functions(struct r300_context *r300)
591 r300->context.clear = r300_clear;
592 r300->context.clear_render_target = r300_clear_render_target;
593 r300->context.clear_depth_stencil = r300_clear_depth_stencil;
594 r300->context.resource_copy_region = r300_resource_copy_region;