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
cdb74127
Commit
cdb74127
authored
Sep 23, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add a separate function for vertex shader initialization.
parent
0a72acc7
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
48 additions
and
33 deletions
+48
-33
d3d9_private.h
dlls/d3d9/d3d9_private.h
+3
-2
device.c
dlls/d3d9/device.c
+30
-0
vertexshader.c
dlls/d3d9/vertexshader.c
+15
-31
No files found.
dlls/d3d9/d3d9_private.h
View file @
cdb74127
...
...
@@ -206,8 +206,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexDeclaration(IDirect3DDevice9
IDirect3DVertexDeclaration9
*
pDecl
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_GetVertexDeclaration
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DVertexDeclaration9
**
ppDecl
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateVertexShader
(
IDirect3DDevice9Ex
*
iface
,
const
DWORD
*
pFunction
,
IDirect3DVertexShader9
**
ppShader
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_SetVertexShader
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DVertexShader9
*
pShader
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_GetVertexShader
(
IDirect3DDevice9Ex
*
iface
,
...
...
@@ -528,6 +526,9 @@ typedef struct IDirect3DVertexShader9Impl {
LPDIRECT3DDEVICE9EX
parentDevice
;
}
IDirect3DVertexShader9Impl
;
HRESULT
vertexshader_init
(
IDirect3DVertexShader9Impl
*
shader
,
IDirect3DDevice9Impl
*
device
,
const
DWORD
*
byte_code
)
DECLSPEC_HIDDEN
;
#define D3D9_MAX_VERTEX_SHADER_CONSTANTF 256
#define D3D9_MAX_SIMULTANEOUS_RENDERTARGETS 4
...
...
dlls/d3d9/device.c
View file @
cdb74127
...
...
@@ -1830,6 +1830,36 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetFVF(LPDIRECT3DDEVICE9EX iface, DWO
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateVertexShader
(
IDirect3DDevice9Ex
*
iface
,
const
DWORD
*
byte_code
,
IDirect3DVertexShader9
**
shader
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DVertexShader9Impl
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, byte_code %p, shader %p.
\n
"
,
iface
,
byte_code
,
shader
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate vertex shader memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
vertexshader_init
(
object
,
This
,
byte_code
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize vertex shader, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created vertex shader %p.
\n
"
,
object
);
*
shader
=
(
IDirect3DVertexShader9
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_SetStreamSource
(
LPDIRECT3DDEVICE9EX
iface
,
UINT
StreamNumber
,
IDirect3DVertexBuffer9
*
pStreamData
,
UINT
OffsetInBytes
,
UINT
Stride
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
...
...
dlls/d3d9/vertexshader.c
View file @
cdb74127
...
...
@@ -111,43 +111,27 @@ static const IDirect3DVertexShader9Vtbl Direct3DVertexShader9_Vtbl =
IDirect3DVertexShader9Impl_GetFunction
};
HRESULT
vertexshader_init
(
IDirect3DVertexShader9Impl
*
shader
,
IDirect3DDevice9Impl
*
device
,
const
DWORD
*
byte_code
)
{
HRESULT
hr
;
/* IDirect3DDevice9 IDirect3DVertexShader9 Methods follow: */
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateVertexShader
(
LPDIRECT3DDEVICE9EX
iface
,
CONST
DWORD
*
pFunction
,
IDirect3DVertexShader9
**
ppShader
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hrc
=
D3D_OK
;
IDirect3DVertexShader9Impl
*
object
;
/* Setup a stub object for now */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
TRACE
(
"(%p) : pFunction(%p), ppShader(%p)
\n
"
,
This
,
pFunction
,
ppShader
);
if
(
NULL
==
object
)
{
FIXME
(
"Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
ref
=
1
;
object
->
lpVtbl
=
&
Direct3DVertexShader9_Vtbl
;
shader
->
ref
=
1
;
shader
->
lpVtbl
=
&
Direct3DVertexShader9_Vtbl
;
wined3d_mutex_lock
();
hr
c
=
IWineD3DDevice_CreateVertexShader
(
This
->
WineD3DDevice
,
pFunction
,
NULL
/* output signature */
,
&
object
->
wineD3DVertexShader
,
(
IUnknown
*
)
object
);
hr
=
IWineD3DDevice_CreateVertexShader
(
device
->
WineD3DDevice
,
byte_code
,
NULL
/* output signature */
,
&
shader
->
wineD3DVertexShader
,
(
IUnknown
*
)
shader
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hrc
))
{
/* free up object */
FIXME
(
"Call to IWineD3DDevice_CreateVertexShader failed
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
IDirect3DDevice9Ex_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppShader
=
(
IDirect3DVertexShader9
*
)
object
;
TRACE
(
"(%p) : Created vertex shader %p
\n
"
,
This
,
object
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d vertex shader, hr %#x.
\n
"
,
hr
);
return
hr
;
}
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
*
ppShader
);
return
hrc
;
shader
->
parentDevice
=
(
IDirect3DDevice9Ex
*
)
device
;
IDirect3DDevice9Ex_AddRef
(
shader
->
parentDevice
);
return
D3D_OK
;
}
HRESULT
WINAPI
IDirect3DDevice9Impl_SetVertexShader
(
LPDIRECT3DDEVICE9EX
iface
,
IDirect3DVertexShader9
*
pShader
)
{
...
...
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