From: Chip Davis cdavis5x@gmail.com
Signed-off-by: Chip Davis cdavis5x@gmail.com --- dlls/wined3d/device.c | 4 +-- dlls/wined3d/utils.c | 55 ++++++++++++---------------------- dlls/wined3d/wined3d_private.h | 2 +- 3 files changed, 22 insertions(+), 39 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c index 72c5167131a..33ae584f817 100644 --- a/dlls/wined3d/device.c +++ b/dlls/wined3d/device.c @@ -4723,9 +4723,9 @@ static bool resources_format_compatible(const struct wined3d_resource *src_resou if (src_resource->device->cs->c.state->feature_level < WINED3D_FEATURE_LEVEL_10_1) return false; if ((src_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS) - && (dst_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK)) + && (dst_resource->format_attrs & WINED3D_FORMAT_ATTR_CAST_TO_BLOCK)) return src_resource->format->block_byte_count == dst_resource->format->byte_count; - if ((src_resource->format_flags & WINED3DFMT_FLAG_CAST_TO_BLOCK) + if ((src_resource->format_attrs & WINED3D_FORMAT_ATTR_CAST_TO_BLOCK) && (dst_resource->format_attrs & WINED3D_FORMAT_ATTR_BLOCKS)) return src_resource->format->byte_count == dst_resource->format->block_byte_count; return false; diff --git a/dlls/wined3d/utils.c b/dlls/wined3d/utils.c index 9308848ce97..5b62ae0f542 100644 --- a/dlls/wined3d/utils.c +++ b/dlls/wined3d/utils.c @@ -328,42 +328,25 @@ static const struct wined3d_format_base_flags format_base_flags[] = {WINED3DFMT_NVDB, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_ATOC, WINED3D_FORMAT_ATTR_EXTENSION}, {WINED3DFMT_RESZ, WINED3D_FORMAT_ATTR_EXTENSION}, - {WINED3DFMT_R32G32B32A32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32B32A32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UNORM, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SNORM, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R16G16B16A16_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32G32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_TYPELESS, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_FLOAT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, - {WINED3DFMT_R32_UINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK | WINED3DFMT_FLAG_INDEX_BUFFER}, - {WINED3DFMT_R32_SINT, 0, - WINED3DFMT_FLAG_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32B32A32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UNORM, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SNORM, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R16G16B16A16_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32G32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_TYPELESS, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_FLOAT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, + {WINED3DFMT_R32_UINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK, + WINED3DFMT_FLAG_INDEX_BUFFER}, + {WINED3DFMT_R32_SINT, WINED3D_FORMAT_ATTR_CAST_TO_BLOCK}, {WINED3DFMT_R16_UINT, 0, WINED3DFMT_FLAG_INDEX_BUFFER}, {WINED3DFMT_A8_UNORM, WINED3D_FORMAT_ATTR_NORMALISED}, diff --git a/dlls/wined3d/wined3d_private.h b/dlls/wined3d/wined3d_private.h index 6cd98794ea8..1c7eb9bf6f0 100644 --- a/dlls/wined3d/wined3d_private.h +++ b/dlls/wined3d/wined3d_private.h @@ -6117,6 +6117,7 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3D_FORMAT_ATTR_BROKEN_PITCH 0x00000100 #define WINED3D_FORMAT_ATTR_HEIGHT_SCALE 0x00000200 #define WINED3D_FORMAT_ATTR_MAPPABLE 0x00000400 +#define WINED3D_FORMAT_ATTR_CAST_TO_BLOCK 0x00000800
/* WineD3D pixel format flags */ #define WINED3DFMT_FLAG_POSTPIXELSHADER_BLENDING 0x00000001 @@ -6135,7 +6136,6 @@ extern enum wined3d_format_id pixelformat_for_depth(DWORD depth) DECLSPEC_HIDDEN #define WINED3DFMT_FLAG_GEN_MIPMAP 0x00400000 #define WINED3DFMT_FLAG_VERTEX_ATTRIBUTE 0x01000000 #define WINED3DFMT_FLAG_BLIT 0x02000000 -#define WINED3DFMT_FLAG_CAST_TO_BLOCK 0x08000000 #define WINED3DFMT_FLAG_INDEX_BUFFER 0x10000000
struct wined3d_rational