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
ddab7fcd
Commit
ddab7fcd
authored
May 15, 2012
by
Matteo Bruni
Committed by
Alexandre Julliard
May 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3dcompiler: Make SlWriteBytecode return the shader size.
parent
c2073b7b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
8 additions
and
28 deletions
+8
-28
bytecodewriter.c
dlls/d3dcompiler_43/bytecodewriter.c
+4
-22
compiler.c
dlls/d3dcompiler_43/compiler.c
+3
-5
d3dcompiler_private.h
dlls/d3dcompiler_43/d3dcompiler_private.h
+1
-1
No files found.
dlls/d3dcompiler_43/bytecodewriter.c
View file @
ddab7fcd
...
...
@@ -2543,22 +2543,8 @@ static HRESULT call_instr_handler(struct bc_writer *writer,
return
E_INVALIDARG
;
}
/* SlWriteBytecode (wineshader.@)
*
* Writes shader version specific bytecode from the shader passed in.
* The returned bytecode can be passed to the Direct3D runtime like
* IDirect3DDevice9::Create*Shader.
*
* Parameters:
* shader: Shader to translate into bytecode
* version: Shader version to generate(d3d version token)
* dxversion: DirectX version the code targets
* result: the resulting shader bytecode
*
* Return values:
* S_OK on success
*/
DWORD
SlWriteBytecode
(
const
struct
bwriter_shader
*
shader
,
int
dxversion
,
DWORD
**
result
)
{
HRESULT
SlWriteBytecode
(
const
struct
bwriter_shader
*
shader
,
int
dxversion
,
DWORD
**
result
,
DWORD
*
size
)
{
struct
bc_writer
*
writer
;
struct
bytecode_buffer
*
buffer
=
NULL
;
HRESULT
hr
;
...
...
@@ -2610,12 +2596,8 @@ DWORD SlWriteBytecode(const struct bwriter_shader *shader, int dxversion, DWORD
goto
error
;
}
/* Cut off unneeded memory from the result buffer */
*
result
=
d3dcompiler_realloc
(
buffer
->
data
,
sizeof
(
DWORD
)
*
buffer
->
size
);
if
(
!*
result
)
{
*
result
=
buffer
->
data
;
}
*
size
=
buffer
->
size
*
sizeof
(
DWORD
);
*
result
=
buffer
->
data
;
buffer
->
data
=
NULL
;
hr
=
S_OK
;
...
...
dlls/d3dcompiler_43/compiler.c
View file @
ddab7fcd
...
...
@@ -396,9 +396,8 @@ static HRESULT assemble_shader(const char *preproc_shader,
struct
bwriter_shader
*
shader
;
char
*
messages
=
NULL
;
HRESULT
hr
;
DWORD
*
res
;
LPD3DBLOB
buffer
;
int
size
;
DWORD
*
res
,
size
;
ID3DBlob
*
buffer
;
char
*
pos
;
shader
=
SlAssembleShader
(
preproc_shader
,
&
messages
);
...
...
@@ -443,7 +442,7 @@ static HRESULT assemble_shader(const char *preproc_shader,
return
D3DXERR_INVALIDDATA
;
}
hr
=
SlWriteBytecode
(
shader
,
9
,
&
res
);
hr
=
SlWriteBytecode
(
shader
,
9
,
&
res
,
&
size
);
SlDeleteShader
(
shader
);
if
(
FAILED
(
hr
))
{
...
...
@@ -453,7 +452,6 @@ static HRESULT assemble_shader(const char *preproc_shader,
if
(
shader_blob
)
{
size
=
HeapSize
(
GetProcessHeap
(),
0
,
res
);
hr
=
D3DCreateBlob
(
size
,
&
buffer
);
if
(
FAILED
(
hr
))
{
...
...
dlls/d3dcompiler_43/d3dcompiler_private.h
View file @
ddab7fcd
...
...
@@ -570,7 +570,7 @@ typedef enum _BWRITERDECLUSAGE {
#define T3_REG 5
struct
bwriter_shader
*
SlAssembleShader
(
const
char
*
text
,
char
**
messages
)
DECLSPEC_HIDDEN
;
DWORD
SlWriteBytecode
(
const
struct
bwriter_shader
*
shader
,
int
dxversion
,
DWORD
**
result
)
DECLSPEC_HIDDEN
;
HRESULT
SlWriteBytecode
(
const
struct
bwriter_shader
*
shader
,
int
dxversion
,
DWORD
**
result
,
DWORD
*
size
)
DECLSPEC_HIDDEN
;
void
SlDeleteShader
(
struct
bwriter_shader
*
shader
)
DECLSPEC_HIDDEN
;
#define MAKE_TAG(ch0, ch1, ch2, ch3) \
...
...
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