Lines Matching refs:stfb
206 st_framebuffer_validate(struct st_framebuffer *stfb, in st_framebuffer_validate() argument
215 new_stamp = p_atomic_read(&stfb->iface->stamp); in st_framebuffer_validate()
216 if (stfb->iface_stamp == new_stamp) in st_framebuffer_validate()
219 memset(textures, 0, stfb->num_statts * sizeof(textures[0])); in st_framebuffer_validate()
223 if (!stfb->iface->validate(&st->iface, stfb->iface, stfb->statts, in st_framebuffer_validate()
224 stfb->num_statts, textures)) in st_framebuffer_validate()
227 stfb->iface_stamp = new_stamp; in st_framebuffer_validate()
228 new_stamp = p_atomic_read(&stfb->iface->stamp); in st_framebuffer_validate()
229 } while(stfb->iface_stamp != new_stamp); in st_framebuffer_validate()
231 width = stfb->Base.Width; in st_framebuffer_validate()
232 height = stfb->Base.Height; in st_framebuffer_validate()
234 for (i = 0; i < stfb->num_statts; i++) { in st_framebuffer_validate()
242 idx = attachment_to_buffer_index(stfb->statts[i]); in st_framebuffer_validate()
248 strb = st_renderbuffer(stfb->Base.Attachment[idx].Renderbuffer); in st_framebuffer_validate()
271 ++stfb->stamp; in st_framebuffer_validate()
272 _mesa_resize_framebuffer(st->ctx, &stfb->Base, width, height); in st_framebuffer_validate()
281 st_framebuffer_update_attachments(struct st_framebuffer *stfb) in st_framebuffer_update_attachments() argument
285 stfb->num_statts = 0; in st_framebuffer_update_attachments()
290 strb = st_renderbuffer(stfb->Base.Attachment[idx].Renderbuffer); in st_framebuffer_update_attachments()
296 st_visual_have_buffers(stfb->iface->visual, 1 << statt)) in st_framebuffer_update_attachments()
297 stfb->statts[stfb->num_statts++] = statt; in st_framebuffer_update_attachments()
299 stfb->stamp++; in st_framebuffer_update_attachments()
308 st_framebuffer_add_renderbuffer(struct st_framebuffer *stfb, in st_framebuffer_add_renderbuffer() argument
315 assert(_mesa_is_winsys_fbo(&stfb->Base)); in st_framebuffer_add_renderbuffer()
323 format = stfb->iface->visual->depth_stencil_format; in st_framebuffer_add_renderbuffer()
327 format = stfb->iface->visual->accum_format; in st_framebuffer_add_renderbuffer()
331 format = stfb->iface->visual->color_format; in st_framebuffer_add_renderbuffer()
341 rb = st_new_renderbuffer_fb(format, stfb->iface->visual->samples, sw); in st_framebuffer_add_renderbuffer()
346 _mesa_attach_and_own_rb(&stfb->Base, idx, rb); in st_framebuffer_add_renderbuffer()
352 _mesa_attach_and_own_rb(&stfb->Base, BUFFER_DEPTH, rb); in st_framebuffer_add_renderbuffer()
358 _mesa_attach_and_reference_rb(&stfb->Base, BUFFER_STENCIL, rb); in st_framebuffer_add_renderbuffer()
360 _mesa_attach_and_own_rb(&stfb->Base, BUFFER_STENCIL, rb); in st_framebuffer_add_renderbuffer()
440 struct st_framebuffer *stfb; in st_framebuffer_create() local
448 stfb = CALLOC_STRUCT(st_framebuffer); in st_framebuffer_create()
449 if (!stfb) in st_framebuffer_create()
494 _mesa_initialize_window_framebuffer(&stfb->Base, &mode); in st_framebuffer_create()
496 stfb->iface = stfbi; in st_framebuffer_create()
497 stfb->iface_ID = stfbi->ID; in st_framebuffer_create()
498 stfb->iface_stamp = p_atomic_read(&stfbi->stamp) - 1; in st_framebuffer_create()
501 idx = stfb->Base._ColorDrawBufferIndexes[0]; in st_framebuffer_create()
502 if (!st_framebuffer_add_renderbuffer(stfb, idx, prefer_srgb)) { in st_framebuffer_create()
503 free(stfb); in st_framebuffer_create()
507 st_framebuffer_add_renderbuffer(stfb, BUFFER_DEPTH, false); in st_framebuffer_create()
508 st_framebuffer_add_renderbuffer(stfb, BUFFER_ACCUM, false); in st_framebuffer_create()
510 stfb->stamp = 0; in st_framebuffer_create()
511 st_framebuffer_update_attachments(stfb); in st_framebuffer_create()
513 return stfb; in st_framebuffer_create()
522 struct st_framebuffer *stfb) in st_framebuffer_reference() argument
524 struct gl_framebuffer *fb = stfb ? &stfb->Base : NULL; in st_framebuffer_reference()
628 struct st_framebuffer *stfb, *next; in st_framebuffers_purge() local
632 LIST_FOR_EACH_ENTRY_SAFE_REV(stfb, next, &st->winsys_buffers, head) { in st_framebuffers_purge()
633 struct st_framebuffer_iface *stfbi = stfb->iface; in st_framebuffers_purge()
644 list_del(&stfb->head); in st_framebuffers_purge()
645 st_framebuffer_reference(&stfb, NULL); in st_framebuffers_purge()
1013 struct st_framebuffer *cur = NULL, *stfb = NULL; in st_framebuffer_reuse_or_create() local
1023 st_framebuffer_reference(&stfb, cur); in st_framebuffer_reuse_or_create()
1029 if (stfb == NULL) { in st_framebuffer_reuse_or_create()
1044 st_framebuffer_reference(&stfb, cur); in st_framebuffer_reuse_or_create()
1048 return stfb; in st_framebuffer_reuse_or_create()
1133 struct st_framebuffer *stfb = st_ws_framebuffer(st->ctx->DrawBuffer); in st_manager_flush_frontbuffer() local
1136 if (!stfb) in st_manager_flush_frontbuffer()
1144 !stfb->Base.Visual.doubleBufferMode) in st_manager_flush_frontbuffer()
1147 strb = st_renderbuffer(stfb->Base.Attachment[BUFFER_FRONT_LEFT]. in st_manager_flush_frontbuffer()
1154 stfb->iface->flush_front(&st->iface, stfb->iface, in st_manager_flush_frontbuffer()
1190 struct st_framebuffer *stfb; in st_manager_flush_swapbuffers() local
1195 stfb = st_ws_framebuffer(ctx->DrawBuffer); in st_manager_flush_swapbuffers()
1196 if (!stfb || !stfb->iface->flush_swapbuffers) in st_manager_flush_swapbuffers()
1199 stfb->iface->flush_swapbuffers(&st->iface, stfb->iface); in st_manager_flush_swapbuffers()
1212 struct st_framebuffer *stfb = st_ws_framebuffer(fb); in st_manager_add_color_renderbuffer() local
1215 if (!stfb) in st_manager_add_color_renderbuffer()
1220 if (stfb->Base.Attachment[idx].Renderbuffer) in st_manager_add_color_renderbuffer()
1233 if (!st_framebuffer_add_renderbuffer(stfb, idx, in st_manager_add_color_renderbuffer()
1234 stfb->Base.Visual.sRGBCapable)) in st_manager_add_color_renderbuffer()
1237 st_framebuffer_update_attachments(stfb); in st_manager_add_color_renderbuffer()
1244 if (stfb->iface) in st_manager_add_color_renderbuffer()
1245 stfb->iface_stamp = p_atomic_read(&stfb->iface->stamp) - 1; in st_manager_add_color_renderbuffer()