2 * Copyright 2011 Joakim Sindholt <opensource@zhasha.com>
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * on the rights to use, copy, modify, merge, publish, distribute, sub
8 * license, and/or sell copies of the Software, and to permit persons to whom
9 * the Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
21 * USE OR OTHER DEALINGS IN THE SOFTWARE. */
23 #include "basetexture9.h"
28 #include "cubetexture9.h"
29 #include "volumetexture9.h"
32 #include "nine_pipe.h"
33 #include "nine_dump.h"
36 #include "util/u_format.h"
37 #include "util/u_gen_mipmap.h"
39 #define DBG_CHANNEL DBG_BASETEXTURE
42 NineBaseTexture9_ctor( struct NineBaseTexture9
*This
,
43 struct NineUnknownParams
*pParams
,
44 struct pipe_resource
*initResource
,
50 BOOL alloc
= (Pool
== D3DPOOL_DEFAULT
) && !initResource
&&
51 (format
!= D3DFMT_NULL
);
54 DBG("This=%p, pParams=%p initResource=%p Type=%d format=%d Pool=%d Usage=%d\n",
55 This
, pParams
, initResource
, Type
, format
, Pool
, Usage
);
57 user_assert(!(Usage
& (D3DUSAGE_RENDERTARGET
| D3DUSAGE_DEPTHSTENCIL
)) ||
58 Pool
== D3DPOOL_DEFAULT
, D3DERR_INVALIDCALL
);
59 user_assert(!(Usage
& D3DUSAGE_DYNAMIC
) ||
60 !(Pool
== D3DPOOL_MANAGED
||
61 Pool
== D3DPOOL_SCRATCH
), D3DERR_INVALIDCALL
);
63 hr
= NineResource9_ctor(&This
->base
, pParams
, initResource
, alloc
, Type
, Pool
, Usage
);
67 This
->format
= format
;
68 This
->pipe
= pParams
->device
->pipe
;
69 This
->mipfilter
= (Usage
& D3DUSAGE_AUTOGENMIPMAP
) ?
70 D3DTEXF_LINEAR
: D3DTEXF_NONE
;
71 This
->managed
.lod
= 0;
72 This
->managed
.lod_resident
= -1;
73 /* Mark the texture as dirty to trigger first upload when we need the texture,
74 * even if it wasn't set by the application */
75 if (Pool
== D3DPOOL_MANAGED
)
76 This
->managed
.dirty
= TRUE
;
77 /* When a depth buffer is sampled, it is for shadow mapping, except for
78 * D3DFMT_INTZ, D3DFMT_DF16 and D3DFMT_DF24.
79 * In addition D3DFMT_INTZ can be used for both texturing and depth buffering
80 * if z write is disabled. This particular feature may not work for us in
81 * practice because OGL doesn't have that. However apparently it is known
82 * some cards have performance issues with this feature, so real apps
83 * shouldn't use it. */
84 This
->shadow
= (This
->format
!= D3DFMT_INTZ
&& This
->format
!= D3DFMT_DF16
&&
85 This
->format
!= D3DFMT_DF24
) &&
86 util_format_has_depth(util_format_description(This
->base
.info
.format
));
88 list_inithead(&This
->list
);
89 list_inithead(&This
->list2
);
90 if (Pool
== D3DPOOL_MANAGED
)
91 list_add(&This
->list2
, &This
->base
.base
.device
->managed_textures
);
97 NineBaseTexture9_dtor( struct NineBaseTexture9
*This
)
99 DBG("This=%p\n", This
);
101 pipe_sampler_view_reference(&This
->view
[0], NULL
);
102 pipe_sampler_view_reference(&This
->view
[1], NULL
);
104 if (This
->list
.prev
!= NULL
&& This
->list
.next
!= NULL
)
105 list_del(&This
->list
);
106 if (This
->list2
.prev
!= NULL
&& This
->list2
.next
!= NULL
)
107 list_del(&This
->list2
);
109 NineResource9_dtor(&This
->base
);
113 NineBaseTexture9_SetLOD( struct NineBaseTexture9
*This
,
116 DWORD old
= This
->managed
.lod
;
119 DBG("This=%p LODNew=%d\n", This
, LODNew
);
121 user_assert(This
->base
.pool
== D3DPOOL_MANAGED
, 0);
123 max_level
= (This
->base
.usage
& D3DUSAGE_AUTOGENMIPMAP
) ?
124 0 : This
->base
.info
.last_level
;
125 This
->managed
.lod
= MIN2(LODNew
, max_level
);
127 if (This
->managed
.lod
!= old
&& This
->bind_count
&& LIST_IS_EMPTY(&This
->list
))
128 list_add(&This
->list
, &This
->base
.base
.device
->update_textures
);
134 NineBaseTexture9_GetLOD( struct NineBaseTexture9
*This
)
136 DBG("This=%p\n", This
);
138 return This
->managed
.lod
;
142 NineBaseTexture9_GetLevelCount( struct NineBaseTexture9
*This
)
144 DBG("This=%p\n", This
);
146 if (This
->base
.usage
& D3DUSAGE_AUTOGENMIPMAP
)
148 return This
->base
.info
.last_level
+ 1;
152 NineBaseTexture9_SetAutoGenFilterType( struct NineBaseTexture9
*This
,
153 D3DTEXTUREFILTERTYPE FilterType
)
155 DBG("This=%p FilterType=%d\n", This
, FilterType
);
157 if (!(This
->base
.usage
& D3DUSAGE_AUTOGENMIPMAP
))
159 user_assert(FilterType
!= D3DTEXF_NONE
, D3DERR_INVALIDCALL
);
161 This
->mipfilter
= FilterType
;
162 This
->dirty_mip
= TRUE
;
163 NineBaseTexture9_GenerateMipSubLevels(This
);
168 D3DTEXTUREFILTERTYPE NINE_WINAPI
169 NineBaseTexture9_GetAutoGenFilterType( struct NineBaseTexture9
*This
)
171 DBG("This=%p\n", This
);
173 return This
->mipfilter
;
177 NineBaseTexture9_UploadSelf( struct NineBaseTexture9
*This
)
180 unsigned last_level
= This
->base
.info
.last_level
;
181 unsigned l
, min_level_dirty
= This
->managed
.lod
;
184 DBG("This=%p dirty=%i type=%s\n", This
, This
->managed
.dirty
,
185 nine_D3DRTYPE_to_str(This
->base
.type
));
187 assert(This
->base
.pool
== D3DPOOL_MANAGED
);
189 if (This
->base
.usage
& D3DUSAGE_AUTOGENMIPMAP
)
192 update_lod
= This
->managed
.lod_resident
!= This
->managed
.lod
;
193 if (!update_lod
&& !This
->managed
.dirty
)
196 /* Allocate a new resource with the correct number of levels,
197 * Mark states for update, and tell the nine surfaces/volumes
198 * their new resource. */
200 struct pipe_resource
*res
;
202 DBG("updating LOD from %u to %u ...\n", This
->managed
.lod_resident
, This
->managed
.lod
);
204 pipe_sampler_view_reference(&This
->view
[0], NULL
);
205 pipe_sampler_view_reference(&This
->view
[1], NULL
);
207 if (This
->bind_count
) {
208 /* mark state dirty */
209 struct nine_state
*state
= &This
->base
.base
.device
->state
;
211 for (s
= 0; s
< NINE_MAX_SAMPLERS
; ++s
)
212 /* Dirty tracking is done in device9 state, not nine_context. */
213 if (state
->texture
[s
] == This
)
214 state
->changed
.group
|= NINE_STATE_TEXTURE
;
217 /* Allocate a new resource */
218 hr
= NineBaseTexture9_CreatePipeResource(This
, This
->managed
.lod_resident
!= -1);
221 res
= This
->base
.resource
;
223 if (This
->managed
.lod_resident
== -1) {/* no levels were resident */
224 This
->managed
.dirty
= FALSE
; /* We are going to upload everything. */
225 This
->managed
.lod_resident
= This
->base
.info
.last_level
+ 1;
228 if (This
->base
.type
== D3DRTYPE_TEXTURE
) {
229 struct NineTexture9
*tex
= NineTexture9(This
);
231 /* last content (if apply) has been copied to the new resource.
232 * Note: We cannot render to surfaces of managed textures.
233 * Note2: the level argument passed is to get the level offset
234 * right when the texture is uploaded (the texture first level
235 * corresponds to This->managed.lod).
236 * Note3: We don't care about the value passed for the surfaces
237 * before This->managed.lod, negative with this implementation. */
238 for (l
= 0; l
<= This
->base
.info
.last_level
; ++l
)
239 NineSurface9_SetResource(tex
->surfaces
[l
], res
, l
- This
->managed
.lod
);
241 if (This
->base
.type
== D3DRTYPE_CUBETEXTURE
) {
242 struct NineCubeTexture9
*tex
= NineCubeTexture9(This
);
245 for (l
= 0; l
<= This
->base
.info
.last_level
; ++l
) {
246 for (z
= 0; z
< 6; ++z
)
247 NineSurface9_SetResource(tex
->surfaces
[l
* 6 + z
],
248 res
, l
- This
->managed
.lod
);
251 if (This
->base
.type
== D3DRTYPE_VOLUMETEXTURE
) {
252 struct NineVolumeTexture9
*tex
= NineVolumeTexture9(This
);
254 for (l
= 0; l
<= This
->base
.info
.last_level
; ++l
)
255 NineVolume9_SetResource(tex
->volumes
[l
], res
, l
- This
->managed
.lod
);
257 assert(!"invalid texture type");
260 /* We are going to fully upload the new levels,
261 * no need to update dirty parts of the texture for these */
262 min_level_dirty
= MAX2(This
->managed
.lod
, This
->managed
.lod_resident
);
265 /* Update dirty parts of the texture */
266 if (This
->managed
.dirty
) {
267 if (This
->base
.type
== D3DRTYPE_TEXTURE
) {
268 struct NineTexture9
*tex
= NineTexture9(This
);
273 DBG("TEXTURE: dirty rect=(%u,%u) (%ux%u)\n",
274 tex
->dirty_rect
.x
, tex
->dirty_rect
.y
,
275 tex
->dirty_rect
.width
, tex
->dirty_rect
.height
);
277 /* Note: for l < min_level_dirty, the resource is
278 * either non-existing (and thus will be entirely re-uploaded
279 * if the lod changes) or going to have a full upload */
280 if (tex
->dirty_rect
.width
) {
281 for (l
= min_level_dirty
; l
<= last_level
; ++l
) {
282 u_box_minify_2d(&box
, &tex
->dirty_rect
, l
);
283 NineSurface9_UploadSelf(tex
->surfaces
[l
], &box
);
285 memset(&tex
->dirty_rect
, 0, sizeof(tex
->dirty_rect
));
286 tex
->dirty_rect
.depth
= 1;
289 if (This
->base
.type
== D3DRTYPE_CUBETEXTURE
) {
290 struct NineCubeTexture9
*tex
= NineCubeTexture9(This
);
296 for (z
= 0; z
< 6; ++z
) {
297 DBG("FACE[%u]: dirty rect=(%u,%u) (%ux%u)\n", z
,
298 tex
->dirty_rect
[z
].x
, tex
->dirty_rect
[z
].y
,
299 tex
->dirty_rect
[z
].width
, tex
->dirty_rect
[z
].height
);
301 if (tex
->dirty_rect
[z
].width
) {
302 for (l
= min_level_dirty
; l
<= last_level
; ++l
) {
303 u_box_minify_2d(&box
, &tex
->dirty_rect
[z
], l
);
304 NineSurface9_UploadSelf(tex
->surfaces
[l
* 6 + z
], &box
);
306 memset(&tex
->dirty_rect
[z
], 0, sizeof(tex
->dirty_rect
[z
]));
307 tex
->dirty_rect
[z
].depth
= 1;
311 if (This
->base
.type
== D3DRTYPE_VOLUMETEXTURE
) {
312 struct NineVolumeTexture9
*tex
= NineVolumeTexture9(This
);
315 DBG("VOLUME: dirty_box=(%u,%u,%u) (%ux%ux%u)\n",
316 tex
->dirty_box
.x
, tex
->dirty_box
.y
, tex
->dirty_box
.y
,
317 tex
->dirty_box
.width
, tex
->dirty_box
.height
, tex
->dirty_box
.depth
);
319 if (tex
->dirty_box
.width
) {
320 for (l
= min_level_dirty
; l
<= last_level
; ++l
) {
321 u_box_minify_3d(&box
, &tex
->dirty_box
, l
);
322 NineVolume9_UploadSelf(tex
->volumes
[l
], &box
);
324 memset(&tex
->dirty_box
, 0, sizeof(tex
->dirty_box
));
327 assert(!"invalid texture type");
329 This
->managed
.dirty
= FALSE
;
332 /* Upload the new levels */
334 if (This
->base
.type
== D3DRTYPE_TEXTURE
) {
335 struct NineTexture9
*tex
= NineTexture9(This
);
338 box
.x
= box
.y
= box
.z
= 0;
340 for (l
= This
->managed
.lod
; l
< This
->managed
.lod_resident
; ++l
) {
341 box
.width
= u_minify(This
->base
.info
.width0
, l
);
342 box
.height
= u_minify(This
->base
.info
.height0
, l
);
343 NineSurface9_UploadSelf(tex
->surfaces
[l
], &box
);
346 if (This
->base
.type
== D3DRTYPE_CUBETEXTURE
) {
347 struct NineCubeTexture9
*tex
= NineCubeTexture9(This
);
351 box
.x
= box
.y
= box
.z
= 0;
353 for (l
= This
->managed
.lod
; l
< This
->managed
.lod_resident
; ++l
) {
354 box
.width
= u_minify(This
->base
.info
.width0
, l
);
355 box
.height
= u_minify(This
->base
.info
.height0
, l
);
356 for (z
= 0; z
< 6; ++z
)
357 NineSurface9_UploadSelf(tex
->surfaces
[l
* 6 + z
], &box
);
360 if (This
->base
.type
== D3DRTYPE_VOLUMETEXTURE
) {
361 struct NineVolumeTexture9
*tex
= NineVolumeTexture9(This
);
364 box
.x
= box
.y
= box
.z
= 0;
365 for (l
= This
->managed
.lod
; l
< This
->managed
.lod_resident
; ++l
) {
366 box
.width
= u_minify(This
->base
.info
.width0
, l
);
367 box
.height
= u_minify(This
->base
.info
.height0
, l
);
368 box
.depth
= u_minify(This
->base
.info
.depth0
, l
);
369 NineVolume9_UploadSelf(tex
->volumes
[l
], &box
);
372 assert(!"invalid texture type");
375 This
->managed
.lod_resident
= This
->managed
.lod
;
378 if (This
->base
.usage
& D3DUSAGE_AUTOGENMIPMAP
)
379 This
->dirty_mip
= TRUE
;
381 DBG("DONE, generate mip maps = %i\n", This
->dirty_mip
);
386 NineBaseTexture9_GenerateMipSubLevels( struct NineBaseTexture9
*This
)
388 struct pipe_resource
*resource
;
389 unsigned base_level
= 0;
390 unsigned last_level
= This
->base
.info
.last_level
- This
->managed
.lod
;
391 unsigned first_layer
= 0;
393 unsigned filter
= This
->mipfilter
== D3DTEXF_POINT
? PIPE_TEX_FILTER_NEAREST
394 : PIPE_TEX_FILTER_LINEAR
;
395 DBG("This=%p\n", This
);
397 if (This
->base
.pool
== D3DPOOL_MANAGED
)
398 NineBaseTexture9_UploadSelf(This
);
399 if (!This
->dirty_mip
)
401 if (This
->managed
.lod
) {
402 ERR("AUTOGENMIPMAP if level 0 is not resident not supported yet !\n");
407 NineBaseTexture9_UpdateSamplerView(This
, 0);
409 last_layer
= util_max_layer(This
->view
[0]->texture
, base_level
);
411 resource
= This
->base
.resource
;
413 util_gen_mipmap(This
->pipe
, resource
,
414 resource
->format
, base_level
, last_level
,
415 first_layer
, last_layer
, filter
);
417 This
->dirty_mip
= FALSE
;
421 NineBaseTexture9_CreatePipeResource( struct NineBaseTexture9
*This
,
424 struct pipe_context
*pipe
= This
->pipe
;
425 struct pipe_screen
*screen
= This
->base
.info
.screen
;
426 struct pipe_resource templ
;
428 struct pipe_resource
*res
;
429 struct pipe_resource
*old
= This
->base
.resource
;
431 DBG("This=%p lod=%u last_level=%u\n", This
,
432 This
->managed
.lod
, This
->base
.info
.last_level
);
434 assert(This
->base
.pool
== D3DPOOL_MANAGED
);
436 templ
= This
->base
.info
;
438 if (This
->managed
.lod
) {
439 templ
.width0
= u_minify(templ
.width0
, This
->managed
.lod
);
440 templ
.height0
= u_minify(templ
.height0
, This
->managed
.lod
);
441 templ
.depth0
= u_minify(templ
.depth0
, This
->managed
.lod
);
443 templ
.last_level
= This
->base
.info
.last_level
- This
->managed
.lod
;
446 /* LOD might have changed. */
447 if (old
->width0
== templ
.width0
&&
448 old
->height0
== templ
.height0
&&
449 old
->depth0
== templ
.depth0
)
453 res
= screen
->resource_create(screen
, &templ
);
455 return D3DERR_OUTOFVIDEOMEMORY
;
456 This
->base
.resource
= res
;
458 if (old
&& CopyData
) { /* Don't return without releasing old ! */
464 l
= (This
->managed
.lod
< This
->managed
.lod_resident
) ? This
->managed
.lod_resident
- This
->managed
.lod
: 0;
465 m
= (This
->managed
.lod
< This
->managed
.lod_resident
) ? 0 : This
->managed
.lod
- This
->managed
.lod_resident
;
467 box
.width
= u_minify(templ
.width0
, l
);
468 box
.height
= u_minify(templ
.height0
, l
);
469 box
.depth
= u_minify(templ
.depth0
, l
);
471 for (; l
<= templ
.last_level
; ++l
, ++m
) {
472 pipe
->resource_copy_region(pipe
,
475 box
.width
= u_minify(box
.width
, 1);
476 box
.height
= u_minify(box
.height
, 1);
477 box
.depth
= u_minify(box
.depth
, 1);
480 pipe_resource_reference(&old
, NULL
);
485 #define SWIZZLE_TO_REPLACE(s) (s == PIPE_SWIZZLE_0 || \
486 s == PIPE_SWIZZLE_1 || \
487 s == PIPE_SWIZZLE_NONE)
490 NineBaseTexture9_UpdateSamplerView( struct NineBaseTexture9
*This
,
493 const struct util_format_description
*desc
;
494 struct pipe_context
*pipe
= This
->pipe
;
495 struct pipe_screen
*screen
= pipe
->screen
;
496 struct pipe_resource
*resource
= This
->base
.resource
;
497 struct pipe_sampler_view templ
;
498 enum pipe_format srgb_format
;
502 DBG("This=%p sRGB=%d\n", This
, sRGB
);
504 if (unlikely(!resource
)) {
505 if (unlikely(This
->format
== D3DFMT_NULL
))
507 NineBaseTexture9_Dump(This
);
511 pipe_sampler_view_reference(&This
->view
[sRGB
], NULL
);
513 swizzle
[0] = PIPE_SWIZZLE_X
;
514 swizzle
[1] = PIPE_SWIZZLE_Y
;
515 swizzle
[2] = PIPE_SWIZZLE_Z
;
516 swizzle
[3] = PIPE_SWIZZLE_W
;
517 desc
= util_format_description(resource
->format
);
518 if (desc
->colorspace
== UTIL_FORMAT_COLORSPACE_ZS
) {
519 /* msdn doc is incomplete here and wrong.
520 * The only formats that can be read directly here
521 * are DF16, DF24 and INTZ.
522 * Tested on win the swizzle is
523 * R = depth, G = B = 0, A = 1 for DF16 and DF24
524 * R = G = B = A = depth for INTZ
525 * For the other ZS formats that can't be read directly
526 * but can be used as shadow map, the result is duplicated on
528 if (This
->format
== D3DFMT_DF16
||
529 This
->format
== D3DFMT_DF24
) {
530 swizzle
[1] = PIPE_SWIZZLE_0
;
531 swizzle
[2] = PIPE_SWIZZLE_0
;
532 swizzle
[3] = PIPE_SWIZZLE_1
;
534 swizzle
[1] = PIPE_SWIZZLE_X
;
535 swizzle
[2] = PIPE_SWIZZLE_X
;
536 swizzle
[3] = PIPE_SWIZZLE_X
;
538 } else if (resource
->format
== PIPE_FORMAT_RGTC2_UNORM
) {
539 swizzle
[0] = PIPE_SWIZZLE_Y
;
540 swizzle
[1] = PIPE_SWIZZLE_X
;
541 swizzle
[2] = PIPE_SWIZZLE_1
;
542 swizzle
[3] = PIPE_SWIZZLE_1
;
543 } else if (resource
->format
!= PIPE_FORMAT_A8_UNORM
&&
544 resource
->format
!= PIPE_FORMAT_RGTC1_UNORM
) {
546 * A8 should have 0.0 as default values for RGB.
547 * ATI1/RGTC1 should be r 0 0 1 (tested on windows).
548 * It is already what gallium does. All the other ones
549 * should have 1.0 for non-defined values */
550 for (i
= 0; i
< 4; i
++) {
551 if (SWIZZLE_TO_REPLACE(desc
->swizzle
[i
]))
552 swizzle
[i
] = PIPE_SWIZZLE_1
;
556 /* if requested and supported, convert to the sRGB format */
557 srgb_format
= util_format_srgb(resource
->format
);
558 if (sRGB
&& srgb_format
!= PIPE_FORMAT_NONE
&&
559 screen
->is_format_supported(screen
, srgb_format
,
560 resource
->target
, 0, resource
->bind
))
561 templ
.format
= srgb_format
;
563 templ
.format
= resource
->format
;
564 templ
.u
.tex
.first_layer
= 0;
565 templ
.u
.tex
.last_layer
= resource
->target
== PIPE_TEXTURE_3D
?
566 resource
->depth0
- 1 : resource
->array_size
- 1;
567 templ
.u
.tex
.first_level
= 0;
568 templ
.u
.tex
.last_level
= resource
->last_level
;
569 templ
.swizzle_r
= swizzle
[0];
570 templ
.swizzle_g
= swizzle
[1];
571 templ
.swizzle_b
= swizzle
[2];
572 templ
.swizzle_a
= swizzle
[3];
573 templ
.target
= resource
->target
;
575 This
->view
[sRGB
] = pipe
->create_sampler_view(pipe
, resource
, &templ
);
577 DBG("sampler view = %p(resource = %p)\n", This
->view
[sRGB
], resource
);
579 return This
->view
? D3D_OK
: D3DERR_DRIVERINTERNALERROR
;
583 NineBaseTexture9_PreLoad( struct NineBaseTexture9
*This
)
585 DBG("This=%p\n", This
);
587 if (This
->base
.pool
== D3DPOOL_MANAGED
)
588 NineBaseTexture9_UploadSelf(This
);
592 NineBaseTexture9_UnLoad( struct NineBaseTexture9
*This
)
594 if (This
->base
.pool
!= D3DPOOL_MANAGED
||
595 This
->managed
.lod_resident
== -1)
598 pipe_resource_reference(&This
->base
.resource
, NULL
);
599 This
->managed
.lod_resident
= -1;
600 This
->managed
.dirty
= TRUE
;
602 /* If the texture is bound, we have to re-upload it */
603 BASETEX_REGISTER_UPDATE(This
);
608 NineBaseTexture9_Dump( struct NineBaseTexture9
*This
)
610 DBG("\nNineBaseTexture9(%p->NULL/%p): Pool=%s Type=%s Usage=%s\n"
611 "Format=%s Dims=%ux%ux%u/%u LastLevel=%u Lod=%u(%u)\n", This
,
613 nine_D3DPOOL_to_str(This
->base
.pool
),
614 nine_D3DRTYPE_to_str(This
->base
.type
),
615 nine_D3DUSAGE_to_str(This
->base
.usage
),
616 d3dformat_to_string(This
->format
),
617 This
->base
.info
.width0
, This
->base
.info
.height0
, This
->base
.info
.depth0
,
618 This
->base
.info
.array_size
, This
->base
.info
.last_level
,
619 This
->managed
.lod
, This
->managed
.lod_resident
);