diff options
author | Axel Davy <[email protected]> | 2015-02-19 17:34:45 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-04-29 08:28:11 +0200 |
commit | 520e36f89cb9048258d9c1ca42de68564ad876a9 (patch) | |
tree | 7e7927cb89fd9f81423ca18018a83ff6e452898e /src/gallium/state_trackers/nine/basetexture9.c | |
parent | 4c2247ac60f426a6441f964f2204af9f8dc04dc5 (diff) |
st/nine: Simplify Surface9 Managed resources implementation
Remove the Surface9 code for dirty rects, used only for Managed
resources. Instead convey the information to the parent texture.
According to documentation, this seems to be the expected behaviour,
and if documentation is wrong there, that's not a problem since it can
only leads to more texture updates in corner cases.
Signed-off-by: Axel Davy <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/nine/basetexture9.c')
-rw-r--r-- | src/gallium/state_trackers/nine/basetexture9.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/src/gallium/state_trackers/nine/basetexture9.c b/src/gallium/state_trackers/nine/basetexture9.c index 75a305f099a..9b7976c3862 100644 --- a/src/gallium/state_trackers/nine/basetexture9.c +++ b/src/gallium/state_trackers/nine/basetexture9.c @@ -279,16 +279,17 @@ NineBaseTexture9_UploadSelf( struct NineBaseTexture9 *This ) tex->dirty_rect.x, tex->dirty_rect.y, tex->dirty_rect.width, tex->dirty_rect.height); + /* Note: for l < This->managed.lod, the resource is + * non-existing, and thus will be entirely re-uploaded + * if This->managed.lod changes */ if (tex->dirty_rect.width) { - for (l = 0; l <= last_level; ++l) { + for (l = This->managed.lod; l <= last_level; ++l) { u_box_minify_2d(&box, &tex->dirty_rect, l); - NineSurface9_AddDirtyRect(tex->surfaces[l], &box); + NineSurface9_UploadSelf(tex->surfaces[l], &box); } memset(&tex->dirty_rect, 0, sizeof(tex->dirty_rect)); tex->dirty_rect.depth = 1; } - for (l = This->managed.lod; l <= last_level; ++l) - NineSurface9_UploadSelf(tex->surfaces[l]); } else if (This->base.type == D3DRTYPE_CUBETEXTURE) { struct NineCubeTexture9 *tex = NineCubeTexture9(This); @@ -303,15 +304,13 @@ NineBaseTexture9_UploadSelf( struct NineBaseTexture9 *This ) tex->dirty_rect[z].width, tex->dirty_rect[z].height); if (tex->dirty_rect[z].width) { - for (l = 0; l <= last_level; ++l) { + for (l = This->managed.lod; l <= last_level; ++l) { u_box_minify_2d(&box, &tex->dirty_rect[z], l); - NineSurface9_AddDirtyRect(tex->surfaces[l * 6 + z], &box); + NineSurface9_UploadSelf(tex->surfaces[l * 6 + z], &box); } memset(&tex->dirty_rect[z], 0, sizeof(tex->dirty_rect[z])); tex->dirty_rect[z].depth = 1; } - for (l = This->managed.lod; l <= last_level; ++l) - NineSurface9_UploadSelf(tex->surfaces[l * 6 + z]); } } else if (This->base.type == D3DRTYPE_VOLUMETEXTURE) { |