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
f1023815
Commit
f1023815
authored
Apr 27, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Apr 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
wined3d: Add a wined3d pixel shader to struct d3d10_pixel_shader.
parent
abc253f5
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
56 additions
and
1 deletion
+56
-1
d3d10core_private.h
dlls/d3d10core/d3d10core_private.h
+5
-0
device.c
dlls/d3d10core/device.c
+20
-1
shader.c
dlls/d3d10core/shader.c
+31
-0
No files found.
dlls/d3d10core/d3d10core_private.h
View file @
f1023815
...
...
@@ -39,6 +39,7 @@
((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_SHDR MAKE_TAG('S', 'H', 'D', 'R')
/* TRACE helper functions */
const
char
*
debug_d3d10_primitive_topology
(
D3D10_PRIMITIVE_TOPOLOGY
topology
);
...
...
@@ -149,8 +150,12 @@ struct d3d10_pixel_shader
{
const
struct
ID3D10PixelShaderVtbl
*
vtbl
;
LONG
refcount
;
IWineD3DPixelShader
*
wined3d_shader
;
};
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
const
DWORD
**
shader_code
);
/* Layered device */
enum
dxgi_device_layer_id
{
...
...
dlls/d3d10core/device.c
View file @
f1023815
...
...
@@ -1023,11 +1023,21 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreateGeometryShaderWithStreamOutp
static
HRESULT
STDMETHODCALLTYPE
d3d10_device_CreatePixelShader
(
ID3D10Device
*
iface
,
const
void
*
byte_code
,
SIZE_T
byte_code_length
,
ID3D10PixelShader
**
shader
)
{
struct
d3d10_device
*
This
=
(
struct
d3d10_device
*
)
iface
;
struct
d3d10_pixel_shader
*
object
;
const
DWORD
*
shader_code
;
HRESULT
hr
;
FIXME
(
"iface %p, byte_code %p, byte_code_length %lu, shader %p stub!
\n
"
,
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
)
{
...
...
@@ -1038,6 +1048,15 @@ static HRESULT STDMETHODCALLTYPE d3d10_device_CreatePixelShader(ID3D10Device *if
object
->
vtbl
=
&
d3d10_pixel_shader_vtbl
;
object
->
refcount
=
1
;
hr
=
IWineD3DDevice_CreatePixelShader
(
This
->
wined3d_device
,
shader_code
,
&
object
->
wined3d_shader
,
(
IUnknown
*
)
object
);
if
(
FAILED
(
hr
))
{
ERR
(
"CreatePixelShader failed, hr %#x
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
*
shader
=
(
ID3D10PixelShader
*
)
object
;
return
S_OK
;
...
...
dlls/d3d10core/shader.c
View file @
f1023815
...
...
@@ -24,6 +24,37 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
d3d10core
);
static
HRESULT
shdr_handler
(
const
char
*
data
,
DWORD
data_size
,
DWORD
tag
,
void
*
ctx
)
{
const
DWORD
**
shader_data
=
ctx
;
char
tag_str
[
5
];
switch
(
tag
)
{
case
TAG_SHDR
:
*
shader_data
=
(
const
DWORD
*
)
data
;
return
S_OK
;
default:
memcpy
(
tag_str
,
&
tag
,
4
);
tag_str
[
4
]
=
'\0'
;
FIXME
(
"Unhandled chunk %s
\n
"
,
tag_str
);
return
S_OK
;
}
}
HRESULT
shader_extract_from_dxbc
(
const
void
*
dxbc
,
SIZE_T
dxbc_length
,
const
DWORD
**
shader_code
)
{
HRESULT
hr
;
hr
=
parse_dxbc
(
dxbc
,
dxbc_length
,
shdr_handler
,
shader_code
);
if
(
!*
shader_code
)
hr
=
E_FAIL
;
if
(
FAILED
(
hr
))
ERR
(
"Failed to parse shader, hr %#x
\n
"
,
hr
);
return
hr
;
}
/* IUnknown methods */
static
HRESULT
STDMETHODCALLTYPE
d3d10_vertex_shader_QueryInterface
(
ID3D10VertexShader
*
iface
,
...
...
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