Lines Matching refs:svga

60    struct svga_context *svga = svga_context(pipe);  in svga_destroy()  local
64 for (i = 0; i < ARRAY_SIZE(svga->rasterizer_no_cull); i++) { in svga_destroy()
65 if (svga->rasterizer_no_cull[i]) { in svga_destroy()
66 pipe->delete_rasterizer_state(pipe, svga->rasterizer_no_cull[i]); in svga_destroy()
71 if (svga->depthstencil_disable) { in svga_destroy()
72 pipe->delete_depth_stencil_alpha_state(pipe, svga->depthstencil_disable); in svga_destroy()
76 for (shader = 0; shader < ARRAY_SIZE(svga->state.hw_draw.constbuf); shader++) { in svga_destroy()
77 pipe_resource_reference(&svga->state.hw_draw.constbuf[shader], NULL); in svga_destroy()
80 pipe->delete_blend_state(pipe, svga->noop_blend); in svga_destroy()
83 if (svga->gb_query) { in svga_destroy()
85 svga->gb_query = NULL; in svga_destroy()
88 util_blitter_destroy(svga->blitter); in svga_destroy()
90 svga_cleanup_sampler_state(svga); in svga_destroy()
91 svga_cleanup_framebuffer(svga); in svga_destroy()
92 svga_cleanup_tss_binding(svga); in svga_destroy()
93 svga_cleanup_vertex_state(svga); in svga_destroy()
95 svga_destroy_swtnl(svga); in svga_destroy()
96 svga_hwtnl_destroy(svga->hwtnl); in svga_destroy()
98 svga->swc->destroy(svga->swc); in svga_destroy()
100 util_bitmask_destroy(svga->blend_object_id_bm); in svga_destroy()
101 util_bitmask_destroy(svga->ds_object_id_bm); in svga_destroy()
102 util_bitmask_destroy(svga->input_element_object_id_bm); in svga_destroy()
103 util_bitmask_destroy(svga->rast_object_id_bm); in svga_destroy()
104 util_bitmask_destroy(svga->sampler_object_id_bm); in svga_destroy()
105 util_bitmask_destroy(svga->sampler_view_id_bm); in svga_destroy()
106 util_bitmask_destroy(svga->shader_id_bm); in svga_destroy()
107 util_bitmask_destroy(svga->surface_view_id_bm); in svga_destroy()
108 util_bitmask_destroy(svga->stream_output_id_bm); in svga_destroy()
109 util_bitmask_destroy(svga->query_id_bm); in svga_destroy()
110 u_upload_destroy(svga->const0_upload); in svga_destroy()
111 u_upload_destroy(svga->pipe.stream_uploader); in svga_destroy()
112 u_upload_destroy(svga->pipe.const_uploader); in svga_destroy()
113 svga_texture_transfer_map_upload_destroy(svga); in svga_destroy()
117 for (i = 0; i < ARRAY_SIZE(svga->curr.constbufs[shader]); ++i) { in svga_destroy()
118 pipe_resource_reference(&svga->curr.constbufs[shader][i].buffer, NULL); in svga_destroy()
122 FREE(svga); in svga_destroy()
130 struct svga_context *svga = NULL; in svga_context_create() local
135 svga = CALLOC_STRUCT(svga_context); in svga_context_create()
136 if (!svga) in svga_context_create()
139 LIST_INITHEAD(&svga->dirty_buffers); in svga_context_create()
141 svga->pipe.screen = screen; in svga_context_create()
142 svga->pipe.priv = priv; in svga_context_create()
143 svga->pipe.destroy = svga_destroy; in svga_context_create()
144 svga->pipe.stream_uploader = u_upload_create(&svga->pipe, 1024 * 1024, in svga_context_create()
148 if (!svga->pipe.stream_uploader) in svga_context_create()
151 svga->pipe.const_uploader = u_upload_create(&svga->pipe, 128 * 1024, in svga_context_create()
154 if (!svga->pipe.const_uploader) in svga_context_create()
157 svga->swc = svgascreen->sws->context_create(svgascreen->sws); in svga_context_create()
158 if (!svga->swc) in svga_context_create()
161 svga_init_resource_functions(svga); in svga_context_create()
162 svga_init_blend_functions(svga); in svga_context_create()
163 svga_init_blit_functions(svga); in svga_context_create()
164 svga_init_depth_stencil_functions(svga); in svga_context_create()
165 svga_init_draw_functions(svga); in svga_context_create()
166 svga_init_flush_functions(svga); in svga_context_create()
167 svga_init_misc_functions(svga); in svga_context_create()
168 svga_init_rasterizer_functions(svga); in svga_context_create()
169 svga_init_sampler_functions(svga); in svga_context_create()
170 svga_init_fs_functions(svga); in svga_context_create()
171 svga_init_vs_functions(svga); in svga_context_create()
172 svga_init_gs_functions(svga); in svga_context_create()
173 svga_init_vertex_functions(svga); in svga_context_create()
174 svga_init_constbuffer_functions(svga); in svga_context_create()
175 svga_init_query_functions(svga); in svga_context_create()
176 svga_init_surface_functions(svga); in svga_context_create()
177 svga_init_stream_output_functions(svga); in svga_context_create()
178 svga_init_clear_functions(svga); in svga_context_create()
181 svga->curr.sample_mask = ~0; in svga_context_create()
184 svga->debug.no_swtnl = debug_get_option_no_swtnl(); in svga_context_create()
185 svga->debug.force_swtnl = debug_get_option_force_swtnl(); in svga_context_create()
186 svga->debug.use_min_mipmap = debug_get_option_use_min_mipmap(); in svga_context_create()
187 svga->debug.no_line_width = debug_get_option_no_line_width(); in svga_context_create()
188 svga->debug.force_hw_line_stipple = debug_get_option_force_hw_line_stipple(); in svga_context_create()
190 if (!(svga->blend_object_id_bm = util_bitmask_create())) in svga_context_create()
193 if (!(svga->ds_object_id_bm = util_bitmask_create())) in svga_context_create()
196 if (!(svga->input_element_object_id_bm = util_bitmask_create())) in svga_context_create()
199 if (!(svga->rast_object_id_bm = util_bitmask_create())) in svga_context_create()
202 if (!(svga->sampler_object_id_bm = util_bitmask_create())) in svga_context_create()
205 if (!(svga->sampler_view_id_bm = util_bitmask_create())) in svga_context_create()
208 if (!(svga->shader_id_bm = util_bitmask_create())) in svga_context_create()
211 if (!(svga->surface_view_id_bm = util_bitmask_create())) in svga_context_create()
214 if (!(svga->stream_output_id_bm = util_bitmask_create())) in svga_context_create()
217 if (!(svga->query_id_bm = util_bitmask_create())) in svga_context_create()
220 svga->hwtnl = svga_hwtnl_create(svga); in svga_context_create()
221 if (svga->hwtnl == NULL) in svga_context_create()
224 if (!svga_init_swtnl(svga)) in svga_context_create()
227 ret = svga_emit_initial_state(svga); in svga_context_create()
231 svga->const0_upload = u_upload_create(&svga->pipe, in svga_context_create()
235 if (!svga->const0_upload) in svga_context_create()
238 if (!svga_texture_transfer_map_upload_create(svga)) in svga_context_create()
243 memset(&svga->state.hw_clear, 0xcd, sizeof(svga->state.hw_clear)); in svga_context_create()
244 memset(&svga->state.hw_clear.framebuffer, 0x0, in svga_context_create()
245 sizeof(svga->state.hw_clear.framebuffer)); in svga_context_create()
246 svga->state.hw_clear.num_rendertargets = 0; in svga_context_create()
247 svga->state.hw_clear.dsv = NULL; in svga_context_create()
249 memset(&svga->state.hw_draw, 0xcd, sizeof(svga->state.hw_draw)); in svga_context_create()
250 memset(&svga->state.hw_draw.views, 0x0, sizeof(svga->state.hw_draw.views)); in svga_context_create()
251 memset(&svga->state.hw_draw.num_samplers, 0, in svga_context_create()
252 sizeof(svga->state.hw_draw.num_samplers)); in svga_context_create()
253 memset(&svga->state.hw_draw.num_sampler_views, 0, in svga_context_create()
254 sizeof(svga->state.hw_draw.num_sampler_views)); in svga_context_create()
255 memset(svga->state.hw_draw.sampler_views, 0, in svga_context_create()
256 sizeof(svga->state.hw_draw.sampler_views)); in svga_context_create()
257 svga->state.hw_draw.num_views = 0; in svga_context_create()
258 svga->state.hw_draw.num_backed_views = 0; in svga_context_create()
259 svga->state.hw_draw.rasterizer_discard = FALSE; in svga_context_create()
262 svga->state.hw_draw.vs = NULL; in svga_context_create()
263 svga->state.hw_draw.gs = NULL; in svga_context_create()
264 svga->state.hw_draw.fs = NULL; in svga_context_create()
267 memset(svga->state.hw_draw.constbuf, 0, in svga_context_create()
268 sizeof(svga->state.hw_draw.constbuf)); in svga_context_create()
269 memset(svga->state.hw_draw.default_constbuf_size, 0, in svga_context_create()
270 sizeof(svga->state.hw_draw.default_constbuf_size)); in svga_context_create()
271 memset(svga->state.hw_draw.enabled_constbufs, 0, in svga_context_create()
272 sizeof(svga->state.hw_draw.enabled_constbufs)); in svga_context_create()
273 svga->state.hw_draw.ib = NULL; in svga_context_create()
274 svga->state.hw_draw.num_vbuffers = 0; in svga_context_create()
275 memset(svga->state.hw_draw.vbuffers, 0, in svga_context_create()
276 sizeof(svga->state.hw_draw.vbuffers)); in svga_context_create()
277 svga->state.hw_draw.const0_buffer = NULL; in svga_context_create()
278 svga->state.hw_draw.const0_handle = NULL; in svga_context_create()
296 svga->noop_blend = svga->pipe.create_blend_state(&svga->pipe, &noop_tmpl); in svga_context_create()
299 svga->dirty = ~0; in svga_context_create()
300 svga->pred.query_id = SVGA3D_INVALID_ID; in svga_context_create()
301 svga->disable_rasterizer = FALSE; in svga_context_create()
306 svga_destroy_swtnl(svga); in svga_context_create()
308 if (svga->const0_upload) in svga_context_create()
309 u_upload_destroy(svga->const0_upload); in svga_context_create()
310 if (svga->pipe.const_uploader) in svga_context_create()
311 u_upload_destroy(svga->pipe.const_uploader); in svga_context_create()
312 if (svga->pipe.stream_uploader) in svga_context_create()
313 u_upload_destroy(svga->pipe.stream_uploader); in svga_context_create()
314 svga_texture_transfer_map_upload_destroy(svga); in svga_context_create()
315 if (svga->hwtnl) in svga_context_create()
316 svga_hwtnl_destroy(svga->hwtnl); in svga_context_create()
317 if (svga->swc) in svga_context_create()
318 svga->swc->destroy(svga->swc); in svga_context_create()
319 util_bitmask_destroy(svga->blend_object_id_bm); in svga_context_create()
320 util_bitmask_destroy(svga->ds_object_id_bm); in svga_context_create()
321 util_bitmask_destroy(svga->input_element_object_id_bm); in svga_context_create()
322 util_bitmask_destroy(svga->rast_object_id_bm); in svga_context_create()
323 util_bitmask_destroy(svga->sampler_object_id_bm); in svga_context_create()
324 util_bitmask_destroy(svga->sampler_view_id_bm); in svga_context_create()
325 util_bitmask_destroy(svga->shader_id_bm); in svga_context_create()
326 util_bitmask_destroy(svga->surface_view_id_bm); in svga_context_create()
327 util_bitmask_destroy(svga->stream_output_id_bm); in svga_context_create()
328 util_bitmask_destroy(svga->query_id_bm); in svga_context_create()
329 FREE(svga); in svga_context_create()
330 svga = NULL; in svga_context_create()
334 return svga ? &svga->pipe:NULL; in svga_context_create()
339 svga_context_flush(struct svga_context *svga, in svga_context_flush() argument
342 struct svga_screen *svgascreen = svga_screen(svga->pipe.screen); in svga_context_flush()
346 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_CONTEXTFLUSH); in svga_context_flush()
348 svga->curr.nr_fbs = 0; in svga_context_flush()
354 if (svga->state.hw_draw.const0_handle) { in svga_context_flush()
355 assert(svga->state.hw_draw.const0_buffer); in svga_context_flush()
356 u_upload_unmap(svga->const0_upload); in svga_context_flush()
357 pipe_resource_reference(&svga->state.hw_draw.const0_buffer, NULL); in svga_context_flush()
358 svga->state.hw_draw.const0_handle = NULL; in svga_context_flush()
364 svga_context_flush_buffers(svga); in svga_context_flush()
366 svga->hud.command_buffer_size += in svga_context_flush()
367 svga->swc->get_command_buffer_size(svga->swc); in svga_context_flush()
371 t0 = svga_get_time(svga); in svga_context_flush()
372 svga->swc->flush(svga->swc, &fence); in svga_context_flush()
373 svga->hud.flush_time += (svga_get_time(svga) - t0); in svga_context_flush()
375 svga->hud.num_flushes++; in svga_context_flush()
377 svga_screen_cache_flush(svgascreen, svga, fence); in svga_context_flush()
379 SVGA3D_ResetLastCommand(svga->swc); in svga_context_flush()
384 svga->rebind.flags.rendertargets = TRUE; in svga_context_flush()
385 svga->rebind.flags.texture_samplers = TRUE; in svga_context_flush()
387 if (svga_have_gb_objects(svga)) { in svga_context_flush()
389 svga->rebind.flags.constbufs = TRUE; in svga_context_flush()
390 svga->rebind.flags.vs = TRUE; in svga_context_flush()
391 svga->rebind.flags.fs = TRUE; in svga_context_flush()
392 svga->rebind.flags.gs = TRUE; in svga_context_flush()
394 if (svga_need_to_rebind_resources(svga)) { in svga_context_flush()
395 svga->rebind.flags.query = TRUE; in svga_context_flush()
401 svga->pipe.screen->fence_finish(svga->pipe.screen, NULL, fence, in svga_context_flush()
410 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_context_flush()
418 svga_context_finish(struct svga_context *svga) in svga_context_finish() argument
420 struct pipe_screen *screen = svga->pipe.screen; in svga_context_finish()
423 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_CONTEXTFINISH); in svga_context_finish()
425 svga_context_flush(svga, &fence); in svga_context_finish()
429 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_context_finish()
439 svga_hwtnl_flush_retry(struct svga_context *svga) in svga_hwtnl_flush_retry() argument
443 ret = svga_hwtnl_flush(svga->hwtnl); in svga_hwtnl_flush_retry()
445 svga_context_flush(svga, NULL); in svga_hwtnl_flush_retry()
446 ret = svga_hwtnl_flush(svga->hwtnl); in svga_hwtnl_flush_retry()
459 svga_hwtnl_flush_buffer(struct svga_context *svga, in svga_hwtnl_flush_buffer() argument
462 if (svga_hwtnl_is_buffer_referred(svga->hwtnl, buffer)) { in svga_hwtnl_flush_buffer()
463 svga_hwtnl_flush_retry(svga); in svga_hwtnl_flush_buffer()
472 svga_surfaces_flush(struct svga_context *svga) in svga_surfaces_flush() argument
474 SVGA_STATS_TIME_PUSH(svga_sws(svga), SVGA_STATS_TIME_SURFACEFLUSH); in svga_surfaces_flush()
478 svga_hwtnl_flush_retry(svga); in svga_surfaces_flush()
482 svga_propagate_rendertargets(svga); in svga_surfaces_flush()
484 SVGA_STATS_TIME_POP(svga_sws(svga)); in svga_surfaces_flush()