void nine_pipe_context_clear(struct NineDevice9 *);
+#define is_ATI1_ATI2(format) (format == PIPE_FORMAT_RGTC1_UNORM || format == PIPE_FORMAT_RGTC2_UNORM)
+
static inline void
rect_to_pipe_box(struct pipe_box *dst, const RECT *src)
{
w = u_minify(width, level);
h = u_minify(height, level);
- size = nine_format_get_stride(format, w) *
- util_format_get_nblocksy(format, h);
+ if (is_ATI1_ATI2(format)) {
+ /* For "unknown" formats like ATIx use width * height bytes */
+ size = w * h;
+ } else {
+ size = nine_format_get_stride(format, w) *
+ util_format_get_nblocksy(format, h);
+ }
+
return size;
}
w = u_minify(width, l);
h = u_minify(height, l);
offsets[l] = size;
- size += nine_format_get_stride(format, w) *
- util_format_get_nblocksy(format, h);
+ if (is_ATI1_ATI2(format)) {
+ /* For "unknown" formats like ATIx use width * height bytes */
+ size += w * h;
+ } else {
+ size += nine_format_get_stride(format, w) *
+ util_format_get_nblocksy(format, h);
+ }
}
return size;
#define DBG_CHANNEL DBG_SURFACE
-#define is_ATI1_ATI2(format) (format == PIPE_FORMAT_RGTC1_UNORM || format == PIPE_FORMAT_RGTC2_UNORM)
-
HRESULT
NineSurface9_ctor( struct NineSurface9 *This,
struct NineUnknownParams *pParams,