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
7e8bd131
Commit
7e8bd131
authored
Aug 19, 2022
by
Ziqing Hui
Committed by
Alexandre Julliard
Aug 31, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dx10: Introduce create_effect().
parent
f40e7071
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
40 additions
and
27 deletions
+40
-27
compiler.c
dlls/d3dx10_43/compiler.c
+38
-25
d3dx10.c
dlls/d3dx10_43/tests/d3dx10.c
+2
-2
No files found.
dlls/d3dx10_43/compiler.c
View file @
7e8bd131
...
...
@@ -28,25 +28,19 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dx
);
HRESULT
WINAPI
D3DX10CreateEffectFromMemory
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
static
HRESULT
create_effect
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
const
D3D10_SHADER_MACRO
*
defines
,
ID3D10Include
*
include
,
const
char
*
profile
,
UINT
shader_flags
,
UINT
effect_flags
,
ID3D10Device
*
device
,
ID3D10EffectPool
*
effect_pool
,
ID3D
X10ThreadPump
*
pump
,
ID3D10Effect
**
effect
,
ID3D10Blob
**
errors
,
HRESULT
*
hresult
)
ID3D
10Effect
**
effect
,
ID3D10Blob
**
errors
)
{
ID3D10Blob
*
code
;
HRESULT
hr
;
TRACE
(
"data %p, datasize %Iu, filename %s, defines %p, include %p, profile %s, shader_flags %#x,"
"effect_flags %#x, device %p, effect_pool %p, pump %p, effect %p, errors %p, hresult %p.
\n
"
,
data
,
datasize
,
debugstr_a
(
filename
),
defines
,
include
,
debugstr_a
(
profile
),
shader_flags
,
effect_flags
,
device
,
effect_pool
,
pump
,
effect
,
errors
,
hresult
);
if
(
pump
)
FIXME
(
"Asynchronous mode is not supported.
\n
"
);
if
(
!
data
||
!
device
)
return
E_FAIL
;
if
(
!
include
)
include
=
D3D_COMPILE_STANDARD_FILE_INCLUDE
;
if
(
errors
)
*
errors
=
NULL
;
if
(
FAILED
(
hr
=
D3DCompile
(
data
,
datasize
,
filename
,
defines
,
include
,
"main"
,
profile
,
shader_flags
,
effect_flags
,
&
code
,
errors
)))
...
...
@@ -62,12 +56,34 @@ HRESULT WINAPI D3DX10CreateEffectFromMemory(const void *data, SIZE_T datasize, c
return
hr
;
}
HRESULT
WINAPI
D3DX10CreateEffectFromMemory
(
const
void
*
data
,
SIZE_T
datasize
,
const
char
*
filename
,
const
D3D10_SHADER_MACRO
*
defines
,
ID3D10Include
*
include
,
const
char
*
profile
,
UINT
shader_flags
,
UINT
effect_flags
,
ID3D10Device
*
device
,
ID3D10EffectPool
*
effect_pool
,
ID3DX10ThreadPump
*
pump
,
ID3D10Effect
**
effect
,
ID3D10Blob
**
errors
,
HRESULT
*
hresult
)
{
TRACE
(
"data %p, datasize %Iu, filename %s, defines %p, include %p, profile %s, shader_flags %#x,"
"effect_flags %#x, device %p, effect_pool %p, pump %p, effect %p, errors %p, hresult %p.
\n
"
,
data
,
datasize
,
debugstr_a
(
filename
),
defines
,
include
,
debugstr_a
(
profile
),
shader_flags
,
effect_flags
,
device
,
effect_pool
,
pump
,
effect
,
errors
,
hresult
);
if
(
pump
)
FIXME
(
"Asynchronous mode is not supported.
\n
"
);
if
(
!
include
)
include
=
D3D_COMPILE_STANDARD_FILE_INCLUDE
;
return
create_effect
(
data
,
datasize
,
filename
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
effect
,
errors
);
}
HRESULT
WINAPI
D3DX10CreateEffectFromFileW
(
const
WCHAR
*
filename
,
const
D3D10_SHADER_MACRO
*
defines
,
ID3D10Include
*
include
,
const
char
*
profile
,
UINT
shader_flags
,
UINT
effect_flags
,
ID3D10Device
*
device
,
ID3D10EffectPool
*
effect_pool
,
ID3DX10ThreadPump
*
pump
,
ID3D10Effect
**
effect
,
ID3D10Blob
**
errors
,
HRESULT
*
hresult
)
{
ID3D10Blob
*
code
;
char
filename_a
[
MAX_PATH
];
void
*
buffer
=
NULL
;
DWORD
size
=
0
;
HRESULT
hr
;
TRACE
(
"filename %s, defines %p, include %p, profile %s, shader_flags %#x, effect_flags %#x, "
...
...
@@ -81,17 +97,14 @@ HRESULT WINAPI D3DX10CreateEffectFromFileW(const WCHAR *filename, const D3D10_SH
if
(
!
include
)
include
=
D3D_COMPILE_STANDARD_FILE_INCLUDE
;
if
(
FAILED
(
hr
=
D3DCompileFromFile
(
filename
,
defines
,
include
,
"main"
,
profile
,
shader_flags
,
effect_flags
,
&
code
,
errors
)))
if
(
SUCCEEDED
((
hr
=
load_file
(
filename
,
&
buffer
,
&
size
))))
{
WARN
(
"Effect compilation failed, hr %#lx.
\n
"
,
hr
);
return
hr
;
WideCharToMultiByte
(
CP_ACP
,
0
,
filename
,
-
1
,
filename_a
,
sizeof
(
filename_a
),
NULL
,
NULL
);
hr
=
create_effect
(
buffer
,
size
,
filename_a
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
effect
,
errors
);
free
(
buffer
);
}
hr
=
D3D10CreateEffectFromMemory
(
ID3D10Blob_GetBufferPointer
(
code
),
ID3D10Blob_GetBufferSize
(
code
),
effect_flags
,
device
,
effect_pool
,
effect
);
ID3D10Blob_Release
(
code
);
return
hr
;
}
...
...
@@ -144,8 +157,8 @@ HRESULT WINAPI D3DX10CreateEffectFromResourceA(HMODULE module, const char *resou
if
(
FAILED
(
hr
))
return
hr
;
return
D3DX10CreateEffectFromMemory
(
data
,
size
,
filename
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
pump
,
effect
,
errors
,
hresult
);
return
create_effect
(
data
,
size
,
filename
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
effect
,
errors
);
}
HRESULT
WINAPI
D3DX10CreateEffectFromResourceW
(
HMODULE
module
,
const
WCHAR
*
resource_name
,
...
...
@@ -178,8 +191,8 @@ HRESULT WINAPI D3DX10CreateEffectFromResourceW(HMODULE module, const WCHAR *reso
WideCharToMultiByte
(
CP_ACP
,
0
,
filenameW
,
-
1
,
filename
,
len
,
NULL
,
NULL
);
}
hr
=
D3DX10CreateEffectFromMemory
(
data
,
size
,
filename
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
pump
,
effect
,
errors
,
hresult
);
hr
=
create_effect
(
data
,
size
,
filename
,
defines
,
include
,
profile
,
shader_flags
,
effect_flags
,
device
,
effect_pool
,
effect
,
errors
);
free
(
filename
);
return
hr
;
}
...
...
dlls/d3dx10_43/tests/d3dx10.c
View file @
7e8bd131
...
...
@@ -4073,7 +4073,7 @@ static void test_create_effect_from_file(void)
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromFileW
(
L"deadbeef"
,
NULL
,
NULL
,
NULL
,
0x0
,
0x0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
todo_wine
ok
(
hr
==
D3D10_ERROR_FILE_NOT_FOUND
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
D3D10_ERROR_FILE_NOT_FOUND
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
...
...
@@ -4081,7 +4081,7 @@ static void test_create_effect_from_file(void)
effect
=
(
ID3D10Effect
*
)
0xdeadbeef
;
hr
=
D3DX10CreateEffectFromFileA
(
"deadbeef"
,
NULL
,
NULL
,
NULL
,
0x0
,
0x0
,
device
,
NULL
,
NULL
,
&
effect
,
&
errors
,
NULL
);
todo_wine
ok
(
hr
==
D3D10_ERROR_FILE_NOT_FOUND
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
D3D10_ERROR_FILE_NOT_FOUND
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
todo_wine
ok
(
!
errors
,
"Got unexpected errors %p.
\n
"
,
errors
);
ok
(
effect
==
(
ID3D10Effect
*
)
0xdeadbeef
,
"Got unexpected effect %p.
\n
"
,
effect
);
...
...
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