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
372dc31e
Commit
372dc31e
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: Use vkd3d_shader_parse_dxbc() in d3dcompiler_strip_shader().
parent
7dfd32d5
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
11 deletions
+11
-11
blob.c
dlls/d3dcompiler_43/blob.c
+10
-10
blob.c
dlls/d3dcompiler_43/tests/blob.c
+1
-1
No files found.
dlls/d3dcompiler_43/blob.c
View file @
372dc31e
...
@@ -348,10 +348,11 @@ static BOOL check_blob_strip(DWORD tag, UINT flags)
...
@@ -348,10 +348,11 @@ static BOOL check_blob_strip(DWORD tag, UINT flags)
static
HRESULT
d3dcompiler_strip_shader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3DBlob
**
blob
)
static
HRESULT
d3dcompiler_strip_shader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3DBlob
**
blob
)
{
{
const
struct
vkd3d_shader_code
src_dxbc
=
{.
code
=
data
,
.
size
=
data_size
};
struct
vkd3d_shader_dxbc_section_desc
*
sections
;
struct
vkd3d_shader_dxbc_section_desc
*
sections
;
struct
vkd3d_shader_dxbc_desc
src_dxbc_desc
;
struct
vkd3d_shader_code
dst_dxbc
;
struct
vkd3d_shader_code
dst_dxbc
;
unsigned
int
section_count
,
i
;
unsigned
int
section_count
,
i
;
struct
dxbc
src_dxbc
;
HRESULT
hr
;
HRESULT
hr
;
int
ret
;
int
ret
;
...
@@ -367,24 +368,23 @@ static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT
...
@@ -367,24 +368,23 @@ static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT
return
D3DERR_INVALIDCALL
;
return
D3DERR_INVALIDCALL
;
}
}
hr
=
dxbc_parse
(
data
,
data_size
,
&
src_dxbc
);
if
((
ret
=
vkd3d_shader_parse_dxbc
(
&
src_dxbc
,
0
,
&
src_dxbc_desc
,
NULL
))
<
0
)
if
(
FAILED
(
hr
))
{
{
WARN
(
"Failed to parse
blob part
\n
"
);
WARN
(
"Failed to parse
source data, ret %d.
\n
"
,
ret
);
return
hr
;
return
E_FAIL
;
}
}
/* src_dxbc.count >= dst_dxbc.count */
/* src_dxbc.count >= dst_dxbc.count */
if
(
!
(
sections
=
calloc
(
src_dxbc
.
count
,
sizeof
(
*
sections
))))
if
(
!
(
sections
=
calloc
(
src_dxbc
_desc
.
section_
count
,
sizeof
(
*
sections
))))
{
{
ERR
(
"Failed to allocate sections memory.
\n
"
);
ERR
(
"Failed to allocate sections memory.
\n
"
);
dxbc_destroy
(
&
src_dxb
c
);
vkd3d_shader_free_dxbc
(
&
src_dxbc_des
c
);
return
E_OUTOFMEMORY
;
return
E_OUTOFMEMORY
;
}
}
for
(
i
=
0
,
section_count
=
0
;
i
<
src_dxbc
.
count
;
++
i
)
for
(
i
=
0
,
section_count
=
0
;
i
<
src_dxbc
_desc
.
section_
count
;
++
i
)
{
{
const
struct
vkd3d_shader_dxbc_section_desc
*
src_section
=
&
src_dxbc
.
sections
[
i
];
const
struct
vkd3d_shader_dxbc_section_desc
*
src_section
=
&
src_dxbc
_desc
.
sections
[
i
];
if
(
check_blob_strip
(
src_section
->
tag
,
flags
))
if
(
check_blob_strip
(
src_section
->
tag
,
flags
))
sections
[
section_count
++
]
=
*
src_section
;
sections
[
section_count
++
]
=
*
src_section
;
...
@@ -405,7 +405,7 @@ static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT
...
@@ -405,7 +405,7 @@ static HRESULT d3dcompiler_strip_shader(const void *data, SIZE_T data_size, UINT
done:
done:
free
(
sections
);
free
(
sections
);
dxbc_destroy
(
&
src_dxb
c
);
vkd3d_shader_free_dxbc
(
&
src_dxbc_des
c
);
return
hr
;
return
hr
;
}
}
...
...
dlls/d3dcompiler_43/tests/blob.c
View file @
372dc31e
...
@@ -375,7 +375,7 @@ static void test_get_blob_part(void)
...
@@ -375,7 +375,7 @@ static void test_get_blob_part(void)
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
D3DERR_INVALIDCALL
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
hr
=
D3DStripShader
(
test_blob_part
,
8
*
sizeof
(
DWORD
),
0
,
&
blob
);
hr
=
D3DStripShader
(
test_blob_part
,
8
*
sizeof
(
DWORD
),
0
,
&
blob
);
#if D3D_COMPILER_VERSION
<
46
#if D3D_COMPILER_VERSION
>=
46
todo_wine
todo_wine
#endif
#endif
ok
(
hr
==
expected
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
ok
(
hr
==
expected
,
"Got unexpected hr %#lx.
\n
"
,
hr
);
...
...
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