Lines Matching defs:sbuf
74 struct svga_buffer *sbuf = svga_buffer(resource);
97 if (sbuf->dma.pending) {
98 svga_buffer_upload_flush(svga, sbuf);
105 svga_buffer_destroy_hw_storage(ss, sbuf);
108 sbuf->map.num_ranges = 0;
109 sbuf->dma.flags.discard = TRUE;
113 if (!sbuf->map.num_ranges) {
119 sbuf->dma.flags.unsynchronized = TRUE;
129 if (sbuf->dma.pending) {
130 svga_buffer_upload_flush(svga, sbuf);
132 if (sbuf->hwbuf) {
164 sbuf->dma.flags.unsynchronized = FALSE;
168 if (!sbuf->swbuf && !sbuf->hwbuf) {
169 if (svga_buffer_create_hw_storage(ss, sbuf) != PIPE_OK) {
178 (sbuf->b.b.width0 + 1023)/1024);
181 sbuf->swbuf = align_malloc(sbuf->b.b.width0, 16);
182 if (!sbuf->swbuf) {
200 struct svga_buffer *sbuf = svga_buffer(transfer->resource);
204 if (sbuf->swbuf) {
206 map = sbuf->swbuf;
208 else if (sbuf->hwbuf) {
212 map = sws->buffer_map(sws, sbuf->hwbuf, transfer->usage);
219 ++sbuf->map.count;
233 struct svga_buffer *sbuf = svga_buffer(transfer->resource);
242 svga_buffer_add_range(sbuf, offset, offset + length);
253 struct svga_buffer *sbuf = svga_buffer(transfer->resource);
257 assert(sbuf->map.count);
258 if (sbuf->map.count) {
259 --sbuf->map.count;
262 if (sbuf->hwbuf) {
263 sws->buffer_unmap(sws, sbuf->hwbuf);
276 sbuf->dma.flags.discard = TRUE;
278 svga_buffer_add_range(sbuf, 0, sbuf->b.b.width0);
302 struct svga_buffer *sbuf = svga_buffer( buf );
306 assert(!sbuf->dma.pending);
308 if(sbuf->handle)
309 svga_buffer_destroy_host_surface(ss, sbuf);
311 if(sbuf->uploaded.buffer)
312 pipe_resource_reference(&sbuf->uploaded.buffer, NULL);
314 if(sbuf->hwbuf)
315 svga_buffer_destroy_hw_storage(ss, sbuf);
317 if(sbuf->swbuf && !sbuf->user)
318 align_free(sbuf->swbuf);
320 FREE(sbuf);
343 struct svga_buffer *sbuf;
345 sbuf = CALLOC_STRUCT(svga_buffer);
346 if(!sbuf)
349 sbuf->b.b = *template;
350 sbuf->b.vtbl = &svga_buffer_vtbl;
351 pipe_reference_init(&sbuf->b.b.reference, 1);
352 sbuf->b.b.screen = screen;
355 if(svga_buffer_create_host_surface(ss, sbuf) != PIPE_OK)
359 sbuf->swbuf = align_malloc(template->width0, 64);
360 if(!sbuf->swbuf)
364 debug_reference(&sbuf->b.b.reference,
367 return &sbuf->b.b;
370 FREE(sbuf);
381 struct svga_buffer *sbuf;
383 sbuf = CALLOC_STRUCT(svga_buffer);
384 if(!sbuf)
387 pipe_reference_init(&sbuf->b.b.reference, 1);
388 sbuf->b.vtbl = &svga_buffer_vtbl;
389 sbuf->b.b.screen = screen;
390 sbuf->b.b.format = PIPE_FORMAT_R8_UNORM; /* ?? */
391 sbuf->b.b.usage = PIPE_USAGE_IMMUTABLE;
392 sbuf->b.b.bind = bind;
393 sbuf->b.b.width0 = bytes;
394 sbuf->b.b.height0 = 1;
395 sbuf->b.b.depth0 = 1;
396 sbuf->b.b.array_size = 1;
398 sbuf->swbuf = ptr;
399 sbuf->user = TRUE;
401 debug_reference(&sbuf->b.b.reference,
404 return &sbuf->b.b;