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
3d6569a8
Commit
3d6569a8
authored
Apr 19, 2023
by
Stefan Dösinger
Committed by
Alexandre Julliard
Apr 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler/tests: Load D3DAssemble via GetProcAddress.
parent
6d41756c
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
10 deletions
+22
-10
asm.c
dlls/d3dcompiler_43/tests/asm.c
+15
-8
hlsl_d3d9.c
dlls/d3dcompiler_43/tests/hlsl_d3d9.c
+7
-2
No files found.
dlls/d3dcompiler_43/tests/asm.c
View file @
3d6569a8
...
...
@@ -27,7 +27,7 @@
perhaps with a different name? */
#define D3DXERR_INVALIDDATA 0x88760b59
HRESULT
WINAPI
D3DAssemble
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
static
HRESULT
(
WINAPI
*
pD3DAssemble
)
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
const
D3D_SHADER_MACRO
*
defines
,
ID3DInclude
*
include
,
UINT
flags
,
ID3DBlob
**
shader
,
ID3DBlob
**
error_messages
);
...
...
@@ -57,7 +57,7 @@ static void exec_tests(const char *name, struct shader_test tests[], unsigned in
for
(
i
=
0
;
i
<
count
;
i
++
)
{
/* D3DAssemble sets messages to 0 if there aren't error messages */
messages
=
NULL
;
hr
=
D3DAssemble
(
tests
[
i
].
text
,
strlen
(
tests
[
i
].
text
),
NULL
,
NULL
,
hr
=
p
D3DAssemble
(
tests
[
i
].
text
,
strlen
(
tests
[
i
].
text
),
NULL
,
NULL
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
ok
(
hr
==
S_OK
,
"Test %s, shader %u: D3DAssemble failed with error %#lx - %ld.
\n
"
,
name
,
i
,
hr
,
hr
&
0xffff
);
if
(
messages
)
{
...
...
@@ -1431,7 +1431,7 @@ static void failure_test(void) {
{
shader
=
NULL
;
messages
=
NULL
;
hr
=
D3DAssemble
(
tests
[
i
],
strlen
(
tests
[
i
]),
NULL
,
NULL
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
hr
=
p
D3DAssemble
(
tests
[
i
],
strlen
(
tests
[
i
]),
NULL
,
NULL
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
ok
(
hr
==
D3DXERR_INVALIDDATA
,
"Test %u: Got unexpected hr %#lx.
\n
"
,
i
,
hr
);
if
(
messages
)
{
...
...
@@ -1556,7 +1556,7 @@ static void assembleshader_test(void) {
/* defines test */
shader
=
NULL
;
messages
=
NULL
;
hr
=
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
hr
=
p
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
messages
)
{
...
...
@@ -1567,14 +1567,14 @@ static void assembleshader_test(void) {
/* NULL messages test */
shader
=
NULL
;
hr
=
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
NULL
);
hr
=
p
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
NULL
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
shader
)
ID3D10Blob_Release
(
shader
);
/* NULL shader test */
messages
=
NULL
;
hr
=
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
NULL
,
&
messages
);
hr
=
p
D3DAssemble
(
test1
,
strlen
(
test1
),
NULL
,
defines
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
NULL
,
&
messages
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
messages
)
{
...
...
@@ -1586,7 +1586,7 @@ static void assembleshader_test(void) {
shader
=
NULL
;
messages
=
NULL
;
include
.
ID3DInclude_iface
.
lpVtbl
=
&
D3DInclude_Vtbl
;
hr
=
D3DAssemble
(
testshader
,
strlen
(
testshader
),
NULL
,
NULL
,
hr
=
p
D3DAssemble
(
testshader
,
strlen
(
testshader
),
NULL
,
NULL
,
&
include
.
ID3DInclude_iface
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
messages
)
...
...
@@ -1599,7 +1599,7 @@ static void assembleshader_test(void) {
/* NULL shader tests */
shader
=
NULL
;
messages
=
NULL
;
hr
=
D3DAssemble
(
NULL
,
0
,
NULL
,
NULL
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
hr
=
p
D3DAssemble
(
NULL
,
0
,
NULL
,
NULL
,
NULL
,
D3DCOMPILE_SKIP_VALIDATION
,
&
shader
,
&
messages
);
ok
(
hr
==
D3DXERR_INVALIDDATA
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
messages
)
{
...
...
@@ -1762,6 +1762,13 @@ static void test_disassemble_shader(void)
START_TEST
(
asm
)
{
HMODULE
d3dcompiler
;
char
buffer
[
20
];
sprintf
(
buffer
,
"d3dcompiler_%d"
,
D3D_COMPILER_VERSION
);
d3dcompiler
=
GetModuleHandleA
(
buffer
);
pD3DAssemble
=
(
void
*
)
GetProcAddress
(
d3dcompiler
,
"D3DAssemble"
);
preproc_test
();
ps_1_1_test
();
vs_1_1_test
();
...
...
dlls/d3dcompiler_43/tests/hlsl_d3d9.c
View file @
3d6569a8
...
...
@@ -26,7 +26,7 @@
#define D3DXERR_INVALIDDATA 0x88760b59
HRESULT
WINAPI
D3DAssemble
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
static
HRESULT
(
WINAPI
*
pD3DAssemble
)
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
const
D3D_SHADER_MACRO
*
defines
,
ID3DInclude
*
include
,
UINT
flags
,
ID3DBlob
**
shader
,
ID3DBlob
**
error_messages
);
...
...
@@ -1499,7 +1499,7 @@ static HRESULT call_D3DAssemble(const char *source_name, ID3DInclude *include, I
"#include
\"
include
\\
include3.h
\"\n
"
"mov oC0, c0"
;
return
D3DAssemble
(
ps_code
,
sizeof
(
ps_code
),
source_name
,
NULL
,
include
,
0
,
blob
,
errors
);
return
p
D3DAssemble
(
ps_code
,
sizeof
(
ps_code
),
source_name
,
NULL
,
include
,
0
,
blob
,
errors
);
}
static
HRESULT
call_D3DCompile
(
const
char
*
source_name
,
ID3DInclude
*
include
,
ID3D10Blob
**
blob
,
ID3D10Blob
**
errors
)
...
...
@@ -1761,6 +1761,7 @@ static void test_no_output_blob(void)
START_TEST
(
hlsl_d3d9
)
{
char
buffer
[
20
];
HMODULE
mod
;
if
(
!
(
mod
=
LoadLibraryA
(
"d3dx9_36.dll"
)))
...
...
@@ -1770,6 +1771,10 @@ START_TEST(hlsl_d3d9)
}
pD3DXGetShaderConstantTable
=
(
void
*
)
GetProcAddress
(
mod
,
"D3DXGetShaderConstantTable"
);
sprintf
(
buffer
,
"d3dcompiler_%d"
,
D3D_COMPILER_VERSION
);
mod
=
GetModuleHandleA
(
buffer
);
pD3DAssemble
=
(
void
*
)
GetProcAddress
(
mod
,
"D3DAssemble"
);
test_swizzle
();
test_math
();
test_conditionals
();
...
...
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