Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
2c9b24b0
Commit
2c9b24b0
authored
Oct 12, 2010
by
Rico Schüller
Committed by
Alexandre Julliard
Oct 13, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Implement D3DStripShader().
parent
a36f51b1
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
110 additions
and
1 deletion
+110
-1
blob.c
dlls/d3dcompiler_43/blob.c
+89
-0
d3dcompiler_43.spec
dlls/d3dcompiler_43/d3dcompiler_43.spec
+1
-1
d3dcompiler_43_main.c
dlls/d3dcompiler_43/d3dcompiler_43_main.c
+7
-0
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+3
-0
d3dcompiler.h
include/d3dcompiler.h
+10
-0
No files found.
dlls/d3dcompiler_43/blob.c
View file @
2c9b24b0
...
@@ -285,3 +285,92 @@ HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_P
...
@@ -285,3 +285,92 @@ HRESULT d3dcompiler_get_blob_part(const void *data, SIZE_T data_size, D3D_BLOB_P
return
hr
;
return
hr
;
}
}
static
BOOL
check_blob_strip
(
DWORD
tag
,
UINT
flags
)
{
BOOL
add
=
TRUE
;
if
(
flags
&
D3DCOMPILER_STRIP_TEST_BLOBS
)
FIXME
(
"Unhandled flag D3DCOMPILER_STRIP_TEST_BLOBS.
\n
"
);
switch
(
tag
)
{
case
TAG_RDEF
:
case
TAG_STAT
:
if
(
flags
&
D3DCOMPILER_STRIP_REFLECTION_DATA
)
add
=
FALSE
;
break
;
case
TAG_SDBG
:
if
(
flags
&
D3DCOMPILER_STRIP_DEBUG_INFO
)
add
=
FALSE
;
break
;
default:
break
;
}
TRACE
(
"%s tag %s
\n
"
,
add
?
"Add"
:
"Skip"
,
debugstr_an
((
const
char
*
)
&
tag
,
4
));
return
add
;
}
HRESULT
d3dcompiler_strip_shader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3DBlob
**
blob
)
{
struct
dxbc
src_dxbc
,
dst_dxbc
;
HRESULT
hr
;
unsigned
int
i
;
if
(
!
blob
)
{
WARN
(
"NULL for blob specified
\n
"
);
return
E_FAIL
;
}
if
(
!
data
||
!
data_size
)
{
WARN
(
"Invalid arguments: data %p, data_size %lu
\n
"
,
data
,
data_size
);
return
D3DERR_INVALIDCALL
;
}
hr
=
dxbc_parse
(
data
,
data_size
,
&
src_dxbc
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to parse blob part
\n
"
);
return
hr
;
}
/* src_dxbc.count >= dst_dxbc.count */
hr
=
dxbc_init
(
&
dst_dxbc
,
src_dxbc
.
count
);
if
(
FAILED
(
hr
))
{
dxbc_destroy
(
&
src_dxbc
);
WARN
(
"Failed to init dxbc
\n
"
);
return
hr
;
}
for
(
i
=
0
;
i
<
src_dxbc
.
count
;
++
i
)
{
struct
dxbc_section
*
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
);
if
(
FAILED
(
hr
))
{
dxbc_destroy
(
&
src_dxbc
);
dxbc_destroy
(
&
dst_dxbc
);
WARN
(
"Failed to add section to dxbc
\n
"
);
return
hr
;
}
}
}
hr
=
dxbc_write_blob
(
&
dst_dxbc
,
blob
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to write blob part
\n
"
);
}
dxbc_destroy
(
&
src_dxbc
);
dxbc_destroy
(
&
dst_dxbc
);
return
hr
;
}
dlls/d3dcompiler_43/d3dcompiler_43.spec
View file @
2c9b24b0
...
@@ -14,4 +14,4 @@
...
@@ -14,4 +14,4 @@
@ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr)
@ stdcall D3DPreprocess(ptr long str ptr ptr ptr ptr)
@ stub D3DReflect
@ stub D3DReflect
@ stub D3DReturnFailure1
@ stub D3DReturnFailure1
@ st
ub D3DStripShader
@ st
dcall D3DStripShader(ptr long long ptr)
dlls/d3dcompiler_43/d3dcompiler_43_main.c
View file @
2c9b24b0
...
@@ -116,3 +116,10 @@ HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **bl
...
@@ -116,3 +116,10 @@ HRESULT WINAPI D3DGetDebugInfo(const void *data, SIZE_T data_size, ID3DBlob **bl
return
d3dcompiler_get_blob_part
(
data
,
data_size
,
D3D_BLOB_DEBUG_INFO
,
0
,
blob
);
return
d3dcompiler_get_blob_part
(
data
,
data_size
,
D3D_BLOB_DEBUG_INFO
,
0
,
blob
);
}
}
HRESULT
WINAPI
D3DStripShader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3D10Blob
**
blob
)
{
TRACE
(
"data %p, data_size %lu, flags %#x, blob %p
\n
"
,
data
,
data_size
,
flags
,
blob
);
return
d3dcompiler_strip_shader
(
data
,
data_size
,
flags
,
blob
);
}
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
2c9b24b0
...
@@ -55,6 +55,7 @@ HRESULT d3dcompiler_blob_init(struct d3dcompiler_blob *blob, SIZE_T data_size) D
...
@@ -55,6 +55,7 @@ HRESULT d3dcompiler_blob_init(struct d3dcompiler_blob *blob, SIZE_T data_size) D
/* blob handling */
/* blob handling */
HRESULT
d3dcompiler_get_blob_part
(
const
void
*
data
,
SIZE_T
data_size
,
D3D_BLOB_PART
part
,
UINT
flags
,
ID3DBlob
**
blob
)
DECLSPEC_HIDDEN
;
HRESULT
d3dcompiler_get_blob_part
(
const
void
*
data
,
SIZE_T
data_size
,
D3D_BLOB_PART
part
,
UINT
flags
,
ID3DBlob
**
blob
)
DECLSPEC_HIDDEN
;
HRESULT
d3dcompiler_strip_shader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3DBlob
**
blob
)
DECLSPEC_HIDDEN
;
/* Shader assembler definitions */
/* Shader assembler definitions */
typedef
enum
_shader_type
{
typedef
enum
_shader_type
{
...
@@ -585,7 +586,9 @@ void SlDeleteShader(struct bwriter_shader *shader);
...
@@ -585,7 +586,9 @@ void SlDeleteShader(struct bwriter_shader *shader);
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_PCSG MAKE_TAG('P', 'C', 'S', 'G')
#define TAG_PCSG MAKE_TAG('P', 'C', 'S', 'G')
#define TAG_RDEF MAKE_TAG('R', 'D', 'E', 'F')
#define TAG_SDBG MAKE_TAG('S', 'D', 'B', 'G')
#define TAG_SDBG MAKE_TAG('S', 'D', 'B', 'G')
#define TAG_STAT MAKE_TAG('S', 'T', 'A', 'T')
#define TAG_XNAP MAKE_TAG('X', 'N', 'A', 'P')
#define TAG_XNAP MAKE_TAG('X', 'N', 'A', 'P')
#define TAG_XNAS MAKE_TAG('X', 'N', 'A', 'S')
#define TAG_XNAS MAKE_TAG('X', 'N', 'A', 'S')
...
...
include/d3dcompiler.h
View file @
2c9b24b0
...
@@ -45,6 +45,16 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena
...
@@ -45,6 +45,16 @@ HRESULT WINAPI D3DCompile(const void *data, SIZE_T data_size, const char *filena
const
D3D_SHADER_MACRO
*
defines
,
ID3DInclude
*
include
,
const
char
*
entrypoint
,
const
D3D_SHADER_MACRO
*
defines
,
ID3DInclude
*
include
,
const
char
*
entrypoint
,
const
char
*
target
,
UINT
sflags
,
UINT
eflags
,
ID3DBlob
**
shader
,
ID3DBlob
**
error_messages
);
const
char
*
target
,
UINT
sflags
,
UINT
eflags
,
ID3DBlob
**
shader
,
ID3DBlob
**
error_messages
);
typedef
enum
D3DCOMPILER_STRIP_FLAGS
{
D3DCOMPILER_STRIP_REFLECTION_DATA
=
1
,
D3DCOMPILER_STRIP_DEBUG_INFO
=
2
,
D3DCOMPILER_STRIP_TEST_BLOBS
=
4
,
D3DCOMPILER_STRIP_FORCE_DWORD
=
0x7fffffff
}
D3DCOMPILER_STRIP_FLAGS
;
HRESULT
WINAPI
D3DStripShader
(
const
void
*
data
,
SIZE_T
data_size
,
UINT
flags
,
ID3DBlob
**
blob
);
typedef
enum
D3D_BLOB_PART
typedef
enum
D3D_BLOB_PART
{
{
D3D_BLOB_INPUT_SIGNATURE_BLOB
,
D3D_BLOB_INPUT_SIGNATURE_BLOB
,
...
...
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