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
b8fe76a8
Commit
b8fe76a8
authored
Apr 04, 2023
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 18, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Store DXBC sections as vkd3d_shader_dxbc_section_desc structures.
parent
92a2ebc6
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
32 additions
and
37 deletions
+32
-37
configure
configure
+4
-4
configure.ac
configure.ac
+1
-1
Makefile.in
dlls/d3d10/Makefile.in
+1
-0
blob.c
dlls/d3dcompiler_43/blob.c
+6
-6
compiler.c
dlls/d3dcompiler_43/compiler.c
+0
-2
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+3
-8
reflection.c
dlls/d3dcompiler_43/reflection.c
+9
-8
utils.c
dlls/d3dcompiler_43/utils.c
+8
-8
No files found.
configure
View file @
b8fe76a8
...
...
@@ -12891,8 +12891,8 @@ then :
else
$as_nop
:
fi
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for vkd3d_shader_
compile
in MinGW -lvkd3d-shader"
>
&5
printf
%s
"checking for vkd3d_shader_
compile
in MinGW -lvkd3d-shader... "
>
&6
;
}
{
printf
"%s
\n
"
"
$as_me
:
${
as_lineno
-
$LINENO
}
: checking for vkd3d_shader_
serialize_dxbc
in MinGW -lvkd3d-shader"
>
&5
printf
%s
"checking for vkd3d_shader_
serialize_dxbc
in MinGW -lvkd3d-shader... "
>
&6
;
}
if
test
${
ac_cv_mingw_lib_vkd3d_shader
+y
}
then
:
printf
%s
"(cached) "
>
&6
...
...
@@ -12909,11 +12909,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* Override any GCC internal prototype to avoid an error.
Use char because int might match the return type of a GCC
builtin and then its argument prototype would still apply. */
char vkd3d_shader_
compile
();
char vkd3d_shader_
serialize_dxbc
();
int
main (void)
{
return vkd3d_shader_
compile
();
return vkd3d_shader_
serialize_dxbc
();
;
return 0;
}
...
...
configure.ac
View file @
b8fe76a8
...
...
@@ -1089,7 +1089,7 @@ then
if test "$ac_cv_mingw_header_vkd3d_h" = "yes" -a "$ac_cv_mingw_header_vkd3d_shader_h" = "yes"
then
WINE_CHECK_MINGW_LIB(vkd3d,vkd3d_set_log_callback,[:],[:],[$VKD3D_PE_LIBS])
WINE_CHECK_MINGW_LIB(vkd3d-shader,vkd3d_shader_
compile
,[:],[:],[$VKD3D_PE_LIBS])
WINE_CHECK_MINGW_LIB(vkd3d-shader,vkd3d_shader_
serialize_dxbc
,[:],[:],[$VKD3D_PE_LIBS])
if test "$ac_cv_mingw_lib_vkd3d" = "no" -o "$ac_cv_mingw_lib_vkd3d_shader" = "no"
then
VKD3D_PE_CFLAGS=""
...
...
dlls/d3d10/Makefile.in
View file @
b8fe76a8
...
...
@@ -3,6 +3,7 @@ IMPORTLIB = d3d10
IMPORTS
=
uuid d3d10core d3dcompiler dxgi
EXTRADEFS
=
-DD3D_COMPILER_VERSION
=
0
PARENTSRC
=
../d3dcompiler_43
EXTRAINCL
=
$(VKD3D_PE_CFLAGS)
C_SRCS
=
\
d3d10_main.c
\
...
...
dlls/d3dcompiler_43/blob.c
View file @
b8fe76a8
...
...
@@ -250,11 +250,11 @@ static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D
for
(
i
=
0
;
i
<
src_dxbc
.
count
;
++
i
)
{
struct
dxbc_section
*
section
=
&
src_dxbc
.
sections
[
i
];
const
struct
vkd3d_shader_dxbc_section_desc
*
section
=
&
src_dxbc
.
sections
[
i
];
if
(
check_blob_part
(
section
->
tag
,
part
))
{
hr
=
dxbc_add_section
(
&
dst_dxbc
,
section
->
tag
,
section
->
data
,
section
->
data_
size
);
hr
=
dxbc_add_section
(
&
dst_dxbc
,
section
->
tag
,
section
->
data
.
code
,
section
->
data
.
size
);
if
(
FAILED
(
hr
))
{
dxbc_destroy
(
&
src_dxbc
);
...
...
@@ -304,10 +304,10 @@ static HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D
if
(
count
==
1
&&
(
part
==
D3D_BLOB_DEBUG_INFO
||
part
==
D3D_BLOB_LEGACY_SHADER
||
part
==
D3D_BLOB_XNA_PREPASS_SHADER
||
part
==
D3D_BLOB_XNA_SHADER
))
{
hr
=
D3DCreateBlob
(
dst_dxbc
.
sections
[
0
].
data
_
size
,
blob
);
hr
=
D3DCreateBlob
(
dst_dxbc
.
sections
[
0
].
data
.
size
,
blob
);
if
(
SUCCEEDED
(
hr
))
{
memcpy
(
ID3D10Blob_GetBufferPointer
(
*
blob
),
dst_dxbc
.
sections
[
0
].
data
,
dst_dxbc
.
sections
[
0
].
data_
size
);
memcpy
(
ID3D10Blob_GetBufferPointer
(
*
blob
),
dst_dxbc
.
sections
[
0
].
data
.
code
,
dst_dxbc
.
sections
[
0
].
data
.
size
);
}
else
{
...
...
@@ -391,11 +391,11 @@ static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT
for
(
i
=
0
;
i
<
src_dxbc
.
count
;
++
i
)
{
struct
dxbc_section
*
section
=
&
src_dxbc
.
sections
[
i
];
const
struct
vkd3d_shader_dxbc_section_desc
*
section
=
&
src_dxbc
.
sections
[
i
];
if
(
check_blob_strip
(
section
->
tag
,
flags
))
{
hr
=
dxbc_add_section
(
&
dst_dxbc
,
section
->
tag
,
section
->
data
,
section
->
data_
size
);
hr
=
dxbc_add_section
(
&
dst_dxbc
,
section
->
tag
,
section
->
data
.
code
,
section
->
data
.
size
);
if
(
FAILED
(
hr
))
{
dxbc_destroy
(
&
src_dxbc
);
...
...
dlls/d3dcompiler_43/compiler.c
View file @
b8fe76a8
...
...
@@ -25,8 +25,6 @@
#include "d3dcompiler_private.h"
#include <vkd3d_shader.h>
WINE_DEFAULT_DEBUG_CHANNEL
(
d3dcompiler
);
static
HRESULT
hresult_from_vkd3d_result
(
int
vkd3d_result
)
...
...
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
b8fe76a8
...
...
@@ -38,6 +38,8 @@
#include <assert.h>
#include <stdint.h>
#include <vkd3d_shader.h>
/*
* This doesn't belong here, but for some functions it is possible to return that value,
* see http://msdn.microsoft.com/en-us/library/bb205278%28v=VS.85%29.aspx
...
...
@@ -551,18 +553,11 @@ void SlDeleteShader(struct bwriter_shader *shader) DECLSPEC_HIDDEN;
#define TAG_XNAP MAKE_TAG('X', 'N', 'A', 'P')
#define TAG_XNAS MAKE_TAG('X', 'N', 'A', 'S')
struct
dxbc_section
{
DWORD
tag
;
const
char
*
data
;
DWORD
data_size
;
};
struct
dxbc
{
UINT
size
;
UINT
count
;
struct
dxbc_section
*
sections
;
struct
vkd3d_shader_dxbc_section_desc
*
sections
;
};
HRESULT
dxbc_write_blob
(
struct
dxbc
*
dxbc
,
ID3DBlob
**
blob
)
DECLSPEC_HIDDEN
;
...
...
dlls/d3dcompiler_43/reflection.c
View file @
b8fe76a8
...
...
@@ -1681,12 +1681,13 @@ err_out:
return
hr
;
}
static
HRESULT
d3dcompiler_parse_signature
(
struct
d3dcompiler_shader_signature
*
s
,
struct
dxbc_section
*
section
)
static
HRESULT
d3dcompiler_parse_signature
(
struct
d3dcompiler_shader_signature
*
s
,
const
struct
vkd3d_shader_dxbc_section_desc
*
section
)
{
enum
D3DCOMPILER_SIGNATURE_ELEMENT_SIZE
element_size
;
const
char
*
ptr
=
section
->
data
.
code
;
D3D11_SIGNATURE_PARAMETER_DESC
*
d
;
unsigned
int
string_data_offset
;
const
char
*
ptr
=
section
->
data
;
unsigned
int
string_data_size
;
unsigned
int
i
,
count
;
char
*
string_data
;
...
...
@@ -1723,7 +1724,7 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *
/* 2 u32s for the header, element_size for each element. */
string_data_offset
=
2
*
sizeof
(
uint32_t
)
+
count
*
element_size
*
sizeof
(
uint32_t
);
string_data_size
=
section
->
data
_
size
-
string_data_offset
;
string_data_size
=
section
->
data
.
size
-
string_data_offset
;
string_data
=
HeapAlloc
(
GetProcessHeap
(),
0
,
string_data_size
);
if
(
!
string_data
)
...
...
@@ -1732,7 +1733,7 @@ static HRESULT d3dcompiler_parse_signature(struct d3dcompiler_shader_signature *
HeapFree
(
GetProcessHeap
(),
0
,
d
);
return
E_OUTOFMEMORY
;
}
memcpy
(
string_data
,
section
->
data
+
string_data_offset
,
string_data_size
);
memcpy
(
string_data
,
(
const
char
*
)
section
->
data
.
code
+
string_data_offset
,
string_data_size
);
for
(
i
=
0
;
i
<
count
;
++
i
)
{
...
...
@@ -1876,12 +1877,12 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
for
(
i
=
0
;
i
<
src_dxbc
.
count
;
++
i
)
{
struct
dxbc_section
*
section
=
&
src_dxbc
.
sections
[
i
];
const
struct
vkd3d_shader_dxbc_section_desc
*
section
=
&
src_dxbc
.
sections
[
i
];
switch
(
section
->
tag
)
{
case
TAG_RDEF
:
hr
=
d3dcompiler_parse_rdef
(
reflection
,
section
->
data
,
section
->
data_
size
);
hr
=
d3dcompiler_parse_rdef
(
reflection
,
section
->
data
.
code
,
section
->
data
.
size
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to parse RDEF section.
\n
"
);
...
...
@@ -1943,7 +1944,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
case
TAG_SHEX
:
case
TAG_SHDR
:
hr
=
d3dcompiler_parse_shdr
(
reflection
,
section
->
data
,
section
->
data_
size
);
hr
=
d3dcompiler_parse_shdr
(
reflection
,
section
->
data
.
code
,
section
->
data
.
size
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to parse SHDR section.
\n
"
);
...
...
@@ -1952,7 +1953,7 @@ static HRESULT d3dcompiler_shader_reflection_init(struct d3dcompiler_shader_refl
break
;
case
TAG_STAT
:
hr
=
d3dcompiler_parse_stat
(
reflection
,
section
->
data
,
section
->
data_
size
);
hr
=
d3dcompiler_parse_stat
(
reflection
,
section
->
data
.
code
,
section
->
data
.
size
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to parse section STAT.
\n
"
);
...
...
dlls/d3dcompiler_43/utils.c
View file @
b8fe76a8
...
...
@@ -538,7 +538,7 @@ HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, size_t
if
(
dxbc
->
count
>=
dxbc
->
size
)
{
struct
dxbc_section
*
new_sections
;
struct
vkd3d_shader_dxbc_section_desc
*
new_sections
;
DWORD
new_size
=
dxbc
->
size
<<
1
;
new_sections
=
HeapReAlloc
(
GetProcessHeap
(),
0
,
dxbc
->
sections
,
new_size
*
sizeof
(
*
dxbc
->
sections
));
...
...
@@ -553,8 +553,8 @@ HRESULT dxbc_add_section(struct dxbc *dxbc, DWORD tag, const char *data, size_t
}
dxbc
->
sections
[
dxbc
->
count
].
tag
=
tag
;
dxbc
->
sections
[
dxbc
->
count
].
data
_
size
=
data_size
;
dxbc
->
sections
[
dxbc
->
count
].
data
=
data
;
dxbc
->
sections
[
dxbc
->
count
].
data
.
size
=
data_size
;
dxbc
->
sections
[
dxbc
->
count
].
data
.
code
=
data
;
++
dxbc
->
count
;
return
S_OK
;
...
...
@@ -670,7 +670,7 @@ HRESULT dxbc_write_blob(struct dxbc *dxbc, ID3DBlob **blob)
for
(
i
=
0
;
i
<
dxbc
->
count
;
++
i
)
{
size
+=
12
+
dxbc
->
sections
[
i
].
data
_
size
;
size
+=
12
+
dxbc
->
sections
[
i
].
data
.
size
;
}
hr
=
D3DCreateBlob
(
size
,
&
object
);
...
...
@@ -703,16 +703,16 @@ HRESULT dxbc_write_blob(struct dxbc *dxbc, ID3DBlob **blob)
for
(
i
=
0
;
i
<
dxbc
->
count
;
++
i
)
{
write_u32
(
&
ptr
,
offset
);
offset
+=
8
+
dxbc
->
sections
[
i
].
data
_
size
;
offset
+=
8
+
dxbc
->
sections
[
i
].
data
.
size
;
}
/* write the chunks */
for
(
i
=
0
;
i
<
dxbc
->
count
;
++
i
)
{
write_u32
(
&
ptr
,
dxbc
->
sections
[
i
].
tag
);
write_u32
(
&
ptr
,
dxbc
->
sections
[
i
].
data
_
size
);
memcpy
(
ptr
,
dxbc
->
sections
[
i
].
data
,
dxbc
->
sections
[
i
].
data_
size
);
ptr
+=
dxbc
->
sections
[
i
].
data
_
size
;
write_u32
(
&
ptr
,
dxbc
->
sections
[
i
].
data
.
size
);
memcpy
(
ptr
,
dxbc
->
sections
[
i
].
data
.
code
,
dxbc
->
sections
[
i
].
data
.
size
);
ptr
+=
dxbc
->
sections
[
i
].
data
.
size
;
}
TRACE
(
"Created ID3DBlob %p
\n
"
,
object
);
...
...
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