summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/nine/texture9.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/nine/texture9.c')
-rw-r--r--src/gallium/state_trackers/nine/texture9.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/nine/texture9.c b/src/gallium/state_trackers/nine/texture9.c
index 6822865287a..af97082df8d 100644
--- a/src/gallium/state_trackers/nine/texture9.c
+++ b/src/gallium/state_trackers/nine/texture9.c
@@ -101,6 +101,13 @@ NineTexture9_ctor( struct NineTexture9 *This,
if (Format != D3DFMT_NULL && pf == PIPE_FORMAT_NONE)
return D3DERR_INVALIDCALL;
+ if (compressed_format(Format)) {
+ const unsigned w = util_format_get_blockwidth(pf);
+ const unsigned h = util_format_get_blockheight(pf);
+
+ user_assert(!(Width % w) && !(Height % h), D3DERR_INVALIDCALL);
+ }
+
info->screen = screen;
info->target = PIPE_TEXTURE_2D;
info->format = pf;