diff options
author | Jakob Bornecrantz <jakob@vmware.com> | 2010-05-21 20:37:23 +0100 |
---|---|---|
committer | Jakob Bornecrantz <jakob@vmware.com> | 2010-05-21 21:25:07 +0100 |
commit | a93f9f343a64ce91587af66761399f9d4c180015 (patch) | |
tree | 02fe536058d72077e38534e9388898cccac4f416 /src/gallium | |
parent | 5f66363f8ed26d6f3fc8fcccde804fe1fea1bbaa (diff) |
gallium: Fix invalidate framebuffer with old libGL libraries
Diffstat (limited to 'src/gallium')
-rw-r--r-- | src/gallium/include/state_tracker/st_api.h | 9 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_drawable.c | 2 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_screen.c | 9 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/common/dri_screen.h | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/drm/dri2.c | 1 |
5 files changed, 21 insertions, 3 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h index 1e343d0e36..e7efbf065f 100644 --- a/src/gallium/include/state_tracker/st_api.h +++ b/src/gallium/include/state_tracker/st_api.h @@ -109,7 +109,14 @@ enum st_context_resource_type { * Value to st_manager->get_param function. */ enum st_manager_param { - ST_MANAGER_TEMP, + /** + * The dri state tracker on old libGL's doesn't do the right thing + * with regards to invalidating the framebuffers. + * + * For the mesa state tracker that means that it needs to invalidate + * the framebuffer in glViewport itself. + */ + ST_MANAGER_BROKEN_INVALIDATE }; /** diff --git a/src/gallium/state_trackers/dri/common/dri_drawable.c b/src/gallium/state_trackers/dri/common/dri_drawable.c index 25892fc7a7..2bc0faffef 100644 --- a/src/gallium/state_trackers/dri/common/dri_drawable.c +++ b/src/gallium/state_trackers/dri/common/dri_drawable.c @@ -67,7 +67,7 @@ dri_st_framebuffer_validate(struct st_framebuffer_iface *stfbi, */ new_stamp = (drawable->texture_stamp != drawable->dPriv->lastStamp); - if (new_stamp || new_mask) { + if (new_stamp || new_mask || screen->broken_invalidate) { if (new_stamp && screen->update_drawable_info) screen->update_drawable_info(drawable); diff --git a/src/gallium/state_trackers/dri/common/dri_screen.c b/src/gallium/state_trackers/dri/common/dri_screen.c index f5c936e182..5decdb23b1 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.c +++ b/src/gallium/state_trackers/dri/common/dri_screen.c @@ -341,7 +341,14 @@ static int dri_get_param(struct st_manager *smapi, enum st_manager_param param) { - return 0; + struct dri_screen *screen = (struct dri_screen *)smapi; + + switch(param) { + case ST_MANAGER_BROKEN_INVALIDATE: + return screen->broken_invalidate; + default: + return 0; + } } static void diff --git a/src/gallium/state_trackers/dri/common/dri_screen.h b/src/gallium/state_trackers/dri/common/dri_screen.h index 1740fa8f42..9ff925d4be 100644 --- a/src/gallium/state_trackers/dri/common/dri_screen.h +++ b/src/gallium/state_trackers/dri/common/dri_screen.h @@ -50,6 +50,9 @@ struct dri_screen struct st_manager base; struct st_api *st_api; + /* on old libGL's invalidate doesn't get called as it should */ + boolean broken_invalidate; + /* dri */ __DRIscreen *sPriv; diff --git a/src/gallium/state_trackers/dri/drm/dri2.c b/src/gallium/state_trackers/dri/drm/dri2.c index e1216f14c0..6c022f4bbf 100644 --- a/src/gallium/state_trackers/dri/drm/dri2.c +++ b/src/gallium/state_trackers/dri/drm/dri2.c @@ -526,6 +526,7 @@ dri2_init_screen(__DRIscreen * sPriv) goto fail; screen->auto_fake_front = dri_with_format(sPriv); + screen->broken_invalidate = !sPriv->dri2.useInvalidate; return configs; fail: |