diff options
Diffstat (limited to 'src/gallium/state_trackers/dri/dri_st_api.c')
-rw-r--r-- | src/gallium/state_trackers/dri/dri_st_api.c | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/src/gallium/state_trackers/dri/dri_st_api.c b/src/gallium/state_trackers/dri/dri_st_api.c index 84c94cb06d..c067cee66c 100644 --- a/src/gallium/state_trackers/dri/dri_st_api.c +++ b/src/gallium/state_trackers/dri/dri_st_api.c @@ -390,33 +390,33 @@ dri_destroy_st_framebuffer(struct st_framebuffer_iface *stfbi) } /** - * Return the texture at an attachment. Allocate the texture if it does not + * Validate the texture at an attachment. Allocate the texture if it does not * exist. */ -struct pipe_texture * -dri_get_st_framebuffer_texture(struct st_framebuffer_iface *stfbi, - enum st_attachment_type statt) +void +dri_st_framebuffer_validate_att(struct st_framebuffer_iface *stfbi, + enum st_attachment_type statt) { struct dri_drawable *drawable = (struct dri_drawable *) stfbi->st_manager_private; - - if (!(drawable->texture_mask & (1 << statt))) { - enum st_attachment_type statts[ST_ATTACHMENT_COUNT]; - unsigned i, count = 0; + enum st_attachment_type statts[ST_ATTACHMENT_COUNT]; + unsigned i, count = 0; - /* make sure DRI2 does not destroy existing buffers */ - for (i = 0; i < ST_ATTACHMENT_COUNT; i++) { - if (drawable->texture_mask & (1 << i)) { - statts[count++] = i; - } - } - statts[count++] = statt; + /* check if buffer already exists */ + if (drawable->texture_mask & (1 << statt)) + return; - drawable->texture_stamp = drawable->dPriv->lastStamp - 1; - dri_st_framebuffer_validate(stfbi, statts, count, NULL); + /* make sure DRI2 does not destroy existing buffers */ + for (i = 0; i < ST_ATTACHMENT_COUNT; i++) { + if (drawable->texture_mask & (1 << i)) { + statts[count++] = i; + } } + statts[count++] = statt; + + drawable->texture_stamp = drawable->dPriv->lastStamp - 1; - return drawable->textures[statt]; + stfbi->validate(stfbi, statts, count, NULL); } /** |