Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
9e9f3703
Commit
9e9f3703
authored
Mar 31, 2023
by
Zebediah Figura
Committed by
Alexandre Julliard
Apr 07, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx10: Map DXGI_FORMAT_R16_UNORM to DXGI_FORMAT_R16G16B16A16_UNORM in get_d3dx10_dds_format().
parent
2d9b61d0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
15 deletions
+22
-15
d3dx10.c
dlls/d3dx10_43/tests/d3dx10.c
+1
-0
texture.c
dlls/d3dx10_43/texture.c
+21
-15
No files found.
dlls/d3dx10_43/tests/d3dx10.c
View file @
9e9f3703
...
...
@@ -2929,6 +2929,7 @@ static void test_get_image_info(void)
check_dds_pixel_format
(
DDS_PF_RGB
,
0
,
24
,
0xff0000
,
0x00ff00
,
0x0000ff
,
0
,
DXGI_FORMAT_R8G8B8A8_UNORM
);
check_dds_pixel_format
(
DDS_PF_RGB
,
0
,
32
,
0x0000ffff
,
0xffff0000
,
0
,
0
,
DXGI_FORMAT_R16G16_UNORM
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
,
0
,
8
,
0xff
,
0
,
0
,
0
,
DXGI_FORMAT_R8G8B8A8_UNORM
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
,
0
,
16
,
0xffff
,
0
,
0
,
0
,
DXGI_FORMAT_R16G16B16A16_UNORM
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
|
DDS_PF_ALPHA
,
0
,
16
,
0x00ff
,
0
,
0
,
0xff00
,
DXGI_FORMAT_R8G8B8A8_UNORM
);
check_dds_pixel_format
(
DDS_PF_LUMINANCE
|
DDS_PF_ALPHA
,
0
,
8
,
0x0f
,
0
,
0
,
0xf0
,
DXGI_FORMAT_R8G8B8A8_UNORM
);
...
...
dlls/d3dx10_43/texture.c
View file @
9e9f3703
...
...
@@ -71,18 +71,6 @@ wic_pixel_formats[] =
{
&
GUID_WICPixelFormat128bppRGBAFloat
,
DXGI_FORMAT_R32G32B32A32_FLOAT
}
};
static
const
DXGI_FORMAT
to_be_converted_format
[]
=
{
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_R8_UNORM
,
DXGI_FORMAT_R8G8_UNORM
,
DXGI_FORMAT_B5G6R5_UNORM
,
DXGI_FORMAT_B4G4R4A4_UNORM
,
DXGI_FORMAT_B5G5R5A1_UNORM
,
DXGI_FORMAT_B8G8R8X8_UNORM
,
DXGI_FORMAT_B8G8R8A8_UNORM
};
static
D3DX10_IMAGE_FILE_FORMAT
wic_container_guid_to_file_format
(
GUID
*
container_format
)
{
unsigned
int
i
;
...
...
@@ -260,12 +248,30 @@ static unsigned int get_bpp_from_format(DXGI_FORMAT format)
static
DXGI_FORMAT
get_d3dx10_dds_format
(
DXGI_FORMAT
format
)
{
static
const
struct
{
DXGI_FORMAT
src
;
DXGI_FORMAT
dst
;
}
format_map
[]
=
{
{
DXGI_FORMAT_UNKNOWN
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_R8_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_R8G8_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_B5G6R5_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_B4G4R4A4_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_B5G5R5A1_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_B8G8R8X8_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_B8G8R8A8_UNORM
,
DXGI_FORMAT_R8G8B8A8_UNORM
},
{
DXGI_FORMAT_R16_UNORM
,
DXGI_FORMAT_R16G16B16A16_UNORM
},
};
unsigned
int
i
;
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
to_be_converted_format
);
++
i
)
for
(
i
=
0
;
i
<
ARRAY_SIZE
(
format_map
);
++
i
)
{
if
(
format
==
to_be_converted_format
[
i
]
)
return
DXGI_FORMAT_R8G8B8A8_UNORM
;
if
(
format
==
format_map
[
i
].
src
)
return
format_map
[
i
].
dst
;
}
return
format
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment