[PATCH 2/3] d3dx10: Handle format converting for D3DX10CreateTextureFromMemory.
Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> --- dlls/d3dx10_43/tests/d3dx10.c | 3 +- dlls/d3dx10_43/texture.c | 89 ++++++++++++++++++++++++++++++++--- 2 files changed, 83 insertions(+), 9 deletions(-)
On Fri, Jun 18, 2021 at 8:29 AM Ziqing Hui <zhui(a)codeweavers.com> wrote:
Signed-off-by: Ziqing Hui <zhui(a)codeweavers.com> --- dlls/d3dx10_43/tests/d3dx10.c | 3 +- dlls/d3dx10_43/texture.c | 89 ++++++++++++++++++++++++++++++++--- 2 files changed, 83 insertions(+), 9 deletions(-)
+ dst_format = (GUID *)dxgi_format_to_wic_guid(img_info.Format);
Casting away the const isn't very nice. It also seems unnecessary. This patch made me look back to this hunk from D3DX10GetImageInfoFromMemory(): if (img_info->ImageFileFormat == D3DX10_IFF_DDS) { ... } else { ... img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; ... } That seems suspicious, can't formats other than DDS (e.g. WMP) support higher bit depths with d3dx10?
This patch made me look back to this hunk from D3DX10GetImageInfoFromMemory():
if (img_info->ImageFileFormat == D3DX10_IFF_DDS) { ... } else { ... img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; ... }
That seems suspicious, can't formats other than DDS (e.g. WMP) support higher bit depths with d3dx10? Maybe I can send a patch that adds more test images (e.g. WMP images which have higher bit depths) after this patch set is finished ?
On Thu, Jun 24, 2021 at 5:45 AM Ziqing Hui <zhui(a)codeweavers.com> wrote:
This patch made me look back to this hunk from D3DX10GetImageInfoFromMemory():
if (img_info->ImageFileFormat == D3DX10_IFF_DDS) { ... } else { ... img_info->Format = DXGI_FORMAT_R8G8B8A8_UNORM; ... }
That seems suspicious, can't formats other than DDS (e.g. WMP) support higher bit depths with d3dx10? Maybe I can send a patch that adds more test images (e.g. WMP images which have higher bit depths) after this patch set is finished ?
Yes, sure, you don't have to test (and maybe fix) it right away.
participants (2)
-
Matteo Bruni -
Ziqing Hui