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
bb3b5a73
Commit
bb3b5a73
authored
May 08, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
May 11, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d10core: Parse pixelshader output signatures and pass them to CreatePixelShader().
parent
d6fa27f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
18 deletions
+46
-18
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+9
-1
device.c
dlls/d3d10core/device.c
+13
-9
shader.c
dlls/d3d10core/shader.c
+24
-8
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
bb3b5a73
...
...
@@ -39,8 +39,15 @@
((DWORD)(ch2) << 16) | ((DWORD)(ch3) << 24 ))
#define TAG_DXBC MAKE_TAG('D', 'X', 'B', 'C')
#define TAG_ISGN MAKE_TAG('I', 'S', 'G', 'N')
#define TAG_OSGN MAKE_TAG('O', 'S', 'G', 'N')
#define TAG_SHDR MAKE_TAG('S', 'H', 'D', 'R')
struct
d3d10_shader_info
{
const
DWORD
*
shader_code
;
struct
wined3d_shader_signature
*
output_signature
;
};
/* TRACE helper functions */
const
char
*
debug_d3d10_primitive_topology
(
D3D10_PRIMITIVE_TOPOLOGY
topology
);
const
char
*
debug_dxgi_format
(
DXGI_FORMAT
format
);
...
...
@@ -152,9 +159,10 @@ struct d3d10_pixel_shader
LONG
refcount
;
IWineD3DPixelShader
*
wined3d_shader
;
struct
wined3d_shader_signature
output_signature
;
};
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
const
DWORD
**
shader_code
);
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
struct
d3d10_shader_info
*
shader_info
);
HRESULT
shader_parse_signature
(
const
char
*
data
,
DWORD
data_size
,
struct
wined3d_shader_signature
*
s
);
void
shader_free_signature
(
struct
wined3d_shader_signature
*
s
);
...
...
dlls/d3d10core/device.c
View file @
bb3b5a73
...
...
@@ -1025,19 +1025,12 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *if
{
struct
d3d10_device
*
This
=
(
struct
d3d10_device
*
)
iface
;
struct
d3d10_pixel_shader
*
object
;
const
DWORD
*
shader_code
;
struct
d3d10_shader_info
shader_info
;
HRESULT
hr
;
TRACE
(
"iface %p, byte_code %p, byte_code_length %lu, shader %p
\n
"
,
iface
,
byte_code
,
byte_code_length
,
shader
);
hr
=
shader_extract_from_dxbc
(
byte_code
,
byte_code_length
,
&
shader_code
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to extract shader, hr %#x
\n
"
,
hr
);
return
hr
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
...
...
@@ -1048,11 +1041,22 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *if
object
->
vtbl
=
&
d3d10_pixel_shader_vtbl
;
object
->
refcount
=
1
;
shader_info
.
output_signature
=
&
object
->
output_signature
;
hr
=
shader_extract_from_dxbc
(
byte_code
,
byte_code_length
,
&
shader_info
);
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to extract shader, hr %#x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
hr
=
IWineD3DDevice_CreatePixelShader
(
This
->
wined3d_device
,
shader_code
,
NULL
,
&
object
->
wined3d_shader
,
(
IUnknown
*
)
object
);
shader_info
.
shader_code
,
&
object
->
output_signature
,
&
object
->
wined3d_shader
,
(
IUnknown
*
)
object
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreatePixelShader failed, hr %#x
\n
"
,
hr
);
shader_free_signature
(
&
object
->
output_signature
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
...
...
dlls/d3d10core/shader.c
View file @
bb3b5a73
...
...
@@ -26,31 +26,46 @@ WINE_DEFAULT_DEBUG_CHANNEL(d3d10core);
static
HRESULT
shdr_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
const
DWORD
**
shader_data
=
ctx
;
struct
d3d10_shader_info
*
shader_info
=
ctx
;
char
tag_str
[
5
];
HRESULT
hr
;
switch
(
tag
)
{
case
TAG_OSGN
:
hr
=
shader_parse_signature
(
data
,
data_size
,
shader_info
->
output_signature
);
if
(
FAILED
(
hr
))
return
hr
;
break
;
case
TAG_SHDR
:
*
shader_data
=
(
const
DWORD
*
)
data
;
return
S_OK
;
shader_info
->
shader_code
=
(
const
DWORD
*
)
data
;
break
;
default:
memcpy
(
tag_str
,
&
tag
,
4
);
tag_str
[
4
]
=
'\0'
;
FIXME
(
"Unhandled chunk %s
\n
"
,
tag_str
);
return
S_OK
;
break
;
}
return
S_OK
;
}
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
const
DWORD
**
shader_code
)
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
struct
d3d10_shader_info
*
shader_info
)
{
HRESULT
hr
;
hr
=
parse_dxbc
(
dxbc
,
dxbc_length
,
shdr_handler
,
shader_code
)
;
if
(
!*
shader_code
)
hr
=
E_FAIL
;
shader_info
->
shader_code
=
NULL
;
memset
(
shader_info
->
output_signature
,
0
,
sizeof
(
*
shader_info
->
output_signature
))
;
if
(
FAILED
(
hr
))
ERR
(
"Failed to parse shader, hr %#x
\n
"
,
hr
);
hr
=
parse_dxbc
(
dxbc
,
dxbc_length
,
shdr_handler
,
shader_info
);
if
(
!
shader_info
->
shader_code
)
hr
=
E_FAIL
;
if
(
FAILED
(
hr
))
{
ERR
(
"Failed to parse shader, hr %#x
\n
"
,
hr
);
shader_free_signature
(
shader_info
->
output_signature
);
}
return
hr
;
}
...
...
@@ -347,6 +362,7 @@ static ULONG STDMETHODCALLTYPE d3d10_pixel_shader_Release(ID3D10PixelShader *ifa
if
(
!
refcount
)
{
shader_free_signature
(
&
This
->
output_signature
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
...
...
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