summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorPatrick Rudolph <[email protected]>2015-01-06 17:47:39 +0100
committerAxel Davy <[email protected]>2015-02-06 00:07:18 +0100
commitb3afcc09680cfcf3af3ee98b48c327a6c01143ca (patch)
tree0ee701755850fb0d0685dcfe00b1316d6a438a67 /src/gallium/state_trackers
parent65ce2b2848eafe0d51375edca15fbb91956668e4 (diff)
st/nine: Check block alignment for compressed textures in NineSurface9_CopySurface
Reviewed-by: Axel Davy <[email protected]> Signed-off-by: Patrick Rudolph <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/nine/surface9.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/surface9.c b/src/gallium/state_trackers/nine/surface9.c
index b3c7c189a46..8c8d6537f00 100644
--- a/src/gallium/state_trackers/nine/surface9.c
+++ b/src/gallium/state_trackers/nine/surface9.c
@@ -549,6 +549,30 @@ NineSurface9_CopySurface( struct NineSurface9 *This,
r_src = NULL;
}
+ /* check source block align for compressed textures */
+ if (util_format_is_compressed(From->base.info.format) &&
+ ((src_box.width != From->desc.Width) ||
+ (src_box.height != From->desc.Height))) {
+ const unsigned w = util_format_get_blockwidth(From->base.info.format);
+ const unsigned h = util_format_get_blockheight(From->base.info.format);
+ user_assert(!(src_box.width % w) &&
+ !(src_box.height % h),
+ D3DERR_INVALIDCALL);
+ }
+
+ /* check destination block align for compressed textures */
+ if (util_format_is_compressed(This->base.info.format) &&
+ ((dst_box.width != This->desc.Width) ||
+ (dst_box.height != This->desc.Height) ||
+ dst_box.x != 0 ||
+ dst_box.y != 0)) {
+ const unsigned w = util_format_get_blockwidth(This->base.info.format);
+ const unsigned h = util_format_get_blockheight(This->base.info.format);
+ user_assert(!(dst_box.x % w) && !(dst_box.width % w) &&
+ !(dst_box.y % h) && !(dst_box.height % h),
+ D3DERR_INVALIDCALL);
+ }
+
if (r_dst && r_src) {
pipe->resource_copy_region(pipe,
r_dst, This->level,