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
7bf58c89
Commit
7bf58c89
authored
Nov 27, 2022
by
Nikolay Sivov
Committed by
Alexandre Julliard
Nov 30, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Implement D3DDisassemble() using vkd3d-shader.
Wine-Bug:
https://bugs.winehq.org/show_bug.cgi?id=46649
Signed-off-by:
Nikolay Sivov
<
nsivov@codeweavers.com
>
parent
e5c6f915
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
73 additions
and
7 deletions
+73
-7
compiler.c
dlls/d3dcompiler_43/compiler.c
+71
-3
asm.c
dlls/d3dcompiler_43/tests/asm.c
+2
-4
No files found.
dlls/d3dcompiler_43/compiler.c
View file @
7bf58c89
...
...
@@ -596,11 +596,79 @@ HRESULT WINAPI D3DPreprocess(const void *data, SIZE_T size, const char *filename
return
preprocess_shader
(
data
,
size
,
filename
,
defines
,
include
,
shader
,
error_messages
);
}
HRESULT
WINAPI
D3DDisassemble
(
const
void
*
data
,
SIZE_T
size
,
UINT
flags
,
const
char
*
comments
,
ID3DBlob
**
disassembly
)
HRESULT
WINAPI
D3DDisassemble
(
const
void
*
data
,
SIZE_T
size
,
UINT
flags
,
const
char
*
comments
,
ID3DBlob
**
disassembly
)
{
FIXME
(
"data %p, size %Iu, flags %#x, comments %p, disassembly %p stub!
\n
"
,
struct
vkd3d_shader_compile_info
compile_info
;
enum
vkd3d_shader_source_type
source_type
;
struct
vkd3d_shader_code
asm_code
;
const
char
*
ptr
=
data
;
char
*
messages
;
HRESULT
hr
;
int
ret
;
TRACE
(
"data %p, size %Iu, flags %#x, comments %p, disassembly %p.
\n
"
,
data
,
size
,
flags
,
comments
,
disassembly
);
return
E_NOTIMPL
;
if
(
flags
)
FIXME
(
"Ignoring flags %#x.
\n
"
,
flags
);
if
(
comments
)
FIXME
(
"Ignoring comments %s.
\n
"
,
debugstr_a
(
comments
));
#if D3D_COMPILER_VERSION >= 46
if
(
!
size
)
return
E_INVALIDARG
;
#endif
if
(
size
>=
4
&&
read_u32
(
&
ptr
)
==
TAG_DXBC
)
source_type
=
VKD3D_SHADER_SOURCE_DXBC_TPF
;
else
source_type
=
VKD3D_SHADER_SOURCE_D3D_BYTECODE
;
compile_info
.
type
=
VKD3D_SHADER_STRUCTURE_TYPE_COMPILE_INFO
;
compile_info
.
next
=
NULL
;
compile_info
.
source
.
code
=
data
;
compile_info
.
source
.
size
=
size
;
compile_info
.
source_type
=
source_type
;
compile_info
.
target_type
=
VKD3D_SHADER_TARGET_D3D_ASM
;
compile_info
.
options
=
NULL
;
compile_info
.
option_count
=
0
;
compile_info
.
log_level
=
VKD3D_SHADER_LOG_INFO
;
compile_info
.
source_name
=
NULL
;
ret
=
vkd3d_shader_compile
(
&
compile_info
,
&
asm_code
,
&
messages
);
if
(
ret
)
ERR
(
"Failed to disassemble shader, vkd3d result %d.
\n
"
,
ret
);
if
(
messages
)
{
if
(
*
messages
&&
ERR_ON
(
d3dcompiler
))
{
const
char
*
ptr
=
messages
;
const
char
*
line
;
ERR
(
"Shader log:
\n
"
);
while
((
line
=
get_line
(
&
ptr
)))
{
ERR
(
" %.*s"
,
(
int
)(
ptr
-
line
),
line
);
}
ERR
(
"
\n
"
);
}
vkd3d_shader_free_messages
(
messages
);
}
if
(
ret
)
return
hresult_from_vkd3d_result
(
ret
);
if
(
SUCCEEDED
(
hr
=
D3DCreateBlob
(
asm_code
.
size
,
disassembly
)))
memcpy
(
ID3D10Blob_GetBufferPointer
(
*
disassembly
),
asm_code
.
code
,
asm_code
.
size
);
vkd3d_shader_free_shader_code
(
&
asm_code
);
return
hr
;
}
HRESULT
WINAPI
D3DCompileFromFile
(
const
WCHAR
*
filename
,
const
D3D_SHADER_MACRO
*
defines
,
ID3DInclude
*
include
,
...
...
dlls/d3dcompiler_43/tests/asm.c
View file @
7bf58c89
...
...
@@ -1749,7 +1749,6 @@ static void test_disassemble_shader(void)
HRESULT
hr
;
hr
=
D3DDisassemble
(
vs_2_0
,
0
,
0
,
NULL
,
&
blob
);
todo_wine
#if D3D_COMPILER_VERSION >= 46
ok
(
hr
==
E_INVALIDARG
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
#else
...
...
@@ -1757,9 +1756,8 @@ static void test_disassemble_shader(void)
#endif
hr
=
D3DDisassemble
(
vs_2_0
,
sizeof
(
vs_2_0
),
0
,
NULL
,
&
blob
);
todo_wine
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
ID3D10Blob_Release
(
blob
);
ok
(
hr
==
S_OK
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ID3D10Blob_Release
(
blob
);
}
START_TEST
(
asm
)
...
...
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