diff options
author | Axel Davy <[email protected]> | 2015-02-19 17:44:43 +0100 |
---|---|---|
committer | Axel Davy <[email protected]> | 2015-04-29 08:28:11 +0200 |
commit | 090ebc7638e64592716ac4ecd4c29609b2f35421 (patch) | |
tree | 37f29d9b9af7233b4f05d7de35c2300a64cfd24d | |
parent | 520e36f89cb9048258d9c1ca42de68564ad876a9 (diff) |
st/nine: Bound the dirty regions to resource size
Signed-off-by: Axel Davy <[email protected]>
-rw-r--r-- | src/gallium/state_trackers/nine/cubetexture9.c | 4 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/texture9.c | 3 | ||||
-rw-r--r-- | src/gallium/state_trackers/nine/volumetexture9.c | 9 |
3 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/cubetexture9.c b/src/gallium/state_trackers/nine/cubetexture9.c index 98fe887072c..edea1f28a8d 100644 --- a/src/gallium/state_trackers/nine/cubetexture9.c +++ b/src/gallium/state_trackers/nine/cubetexture9.c @@ -276,6 +276,10 @@ NineCubeTexture9_AddDirtyRect( struct NineCubeTexture9 *This, rect_to_pipe_box_clamp(&box, pDirtyRect); u_box_union_2d(&This->dirty_rect[FaceType], &This->dirty_rect[FaceType], &box); + (void) u_box_clip_2d(&This->dirty_rect[FaceType], + &This->dirty_rect[FaceType], + This->base.base.info.width0, + This->base.base.info.height0); } return D3D_OK; } diff --git a/src/gallium/state_trackers/nine/texture9.c b/src/gallium/state_trackers/nine/texture9.c index 5b5fd551a80..c1d1343b273 100644 --- a/src/gallium/state_trackers/nine/texture9.c +++ b/src/gallium/state_trackers/nine/texture9.c @@ -310,6 +310,9 @@ NineTexture9_AddDirtyRect( struct NineTexture9 *This, struct pipe_box box; rect_to_pipe_box_clamp(&box, pDirtyRect); u_box_union_2d(&This->dirty_rect, &This->dirty_rect, &box); + (void) u_box_clip_2d(&This->dirty_rect, &This->dirty_rect, + This->base.base.info.width0, + This->base.base.info.height0); } return D3D_OK; } diff --git a/src/gallium/state_trackers/nine/volumetexture9.c b/src/gallium/state_trackers/nine/volumetexture9.c index b5661731764..8f1de13ce5f 100644 --- a/src/gallium/state_trackers/nine/volumetexture9.c +++ b/src/gallium/state_trackers/nine/volumetexture9.c @@ -223,6 +223,15 @@ NineVolumeTexture9_AddDirtyBox( struct NineVolumeTexture9 *This, struct pipe_box box; d3dbox_to_pipe_box(&box, pDirtyBox); u_box_union_3d(&This->dirty_box, &This->dirty_box, &box); + This->dirty_box.x = MAX2(This->dirty_box.x, 0); + This->dirty_box.y = MAX2(This->dirty_box.y, 0); + This->dirty_box.z = MAX2(This->dirty_box.z, 0); + This->dirty_box.width = MIN2(This->dirty_box.width, + This->base.base.info.width0 - This->dirty_box.x); + This->dirty_box.height = MIN2(This->dirty_box.height, + This->base.base.info.height0 - This->dirty_box.y); + This->dirty_box.depth = MIN2(This->dirty_box.depth, + This->base.base.info.depth0 - This->dirty_box.z); } return D3D_OK; } |