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
717419da
Commit
717419da
authored
Sep 23, 2009
by
Henri Verbeet
Committed by
Alexandre Julliard
Sep 24, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Add a separate function for pixel shader initialization.
parent
7f1c802b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
54 additions
and
36 deletions
+54
-36
d3d8_private.h
dlls/d3d8/d3d8_private.h
+3
-11
device.c
dlls/d3d8/device.c
+28
-24
pixelshader.c
dlls/d3d8/pixelshader.c
+23
-1
No files found.
dlls/d3d8/d3d8_private.h
View file @
717419da
...
...
@@ -603,17 +603,6 @@ HRESULT vertexshader_init(IDirect3DVertexShader8Impl *shader, IDirect3DDevice8Im
#define D3D8_MAX_VERTEX_SHADER_CONSTANTF 256
/* ------------------------ */
/* IDirect3DPixelShaderImpl */
/* ------------------------ */
/*****************************************************************************
* Predeclare the interface implementation structures
*/
extern
const
IDirect3DPixelShader8Vtbl
Direct3DPixelShader8_Vtbl
DECLSPEC_HIDDEN
;
/*****************************************************************************
* IDirect3DPixelShader implementation structure
*/
...
...
@@ -625,6 +614,9 @@ typedef struct IDirect3DPixelShader8Impl {
IWineD3DPixelShader
*
wineD3DPixelShader
;
}
IDirect3DPixelShader8Impl
;
HRESULT
pixelshader_init
(
IDirect3DPixelShader8Impl
*
shader
,
IDirect3DDevice8Impl
*
device
,
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
DECLSPEC_HIDDEN
;
/**
* Internals functions
*
...
...
dlls/d3d8/device.c
View file @
717419da
...
...
@@ -2094,15 +2094,20 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetIndices(LPDIRECT3DDEVICE8 iface, I
return
rc
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreatePixelShader
(
LPDIRECT3DDEVICE8
iface
,
CONST
DWORD
*
pFunction
,
DWORD
*
ppShader
)
{
static
HRESULT
WINAPI
IDirect3DDevice8Impl_CreatePixelShader
(
IDirect3DDevice8
*
iface
,
const
DWORD
*
byte_code
,
DWORD
*
shader
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
IDirect3DPixelShader8Impl
*
object
;
DWORD
shader_handle
;
DWORD
handle
;
HRESULT
hr
;
TRACE
(
"
(%p) : pFunction(%p), ppShader(%p)
\n
"
,
This
,
pFunction
,
ppS
hader
);
TRACE
(
"
iface %p, byte_code %p, shader %p.
\n
"
,
iface
,
byte_code
,
s
hader
);
if
(
NULL
==
ppShader
)
{
if
(
!
shader
)
{
TRACE
(
"(%p) Invalid call
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
}
...
...
@@ -2110,39 +2115,38 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate memmory.
\n
"
);
ERR
(
"Failed to allocate
pixel shader
memmory.
\n
"
);
return
E_OUTOFMEMORY
;
}
object
->
ref
=
1
;
object
->
lpVtbl
=
&
Direct3DPixelShader8_Vtbl
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreatePixelShader
(
This
->
WineD3DDevice
,
pFunction
,
NULL
,
&
object
->
wineD3DPixelShader
,
(
IUnknown
*
)
object
);
if
(
FAILED
(
hr
))
{
wined3d_mutex_unlock
();
FIXME
(
"(%p) call to IWineD3DDevice_CreatePixelShader failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppShader
=
0
;
return
hr
;
}
handle
=
d3d8_allocate_handle
(
&
This
->
handle_table
,
object
,
D3D8_HANDLE_PS
);
wined3d_mutex_unlock
();
if
(
handle
==
D3D8_INVALID_HANDLE
)
{
ERR
(
"Failed to allocate
shader handle
\n
"
);
IDirect3DVertexShader8_Release
((
IUnknown
*
)
object
);
ERR
(
"Failed to allocate
pixel shader handle.
\n
"
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
E_OUTOFMEMORY
;
}
*
ppShader
=
object
->
handle
=
handle
+
VS_HIGHESTFIXEDFXF
+
1
;
TRACE
(
"(%p) : returning %p (handle %#x)
\n
"
,
This
,
object
,
*
ppShader
);
shader_handle
=
handle
+
VS_HIGHESTFIXEDFXF
+
1
;
return
hr
;
hr
=
pixelshader_init
(
object
,
This
,
byte_code
,
shader_handle
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize pixel shader, hr %#x.
\n
"
,
hr
);
wined3d_mutex_lock
();
d3d8_free_handle
(
&
This
->
handle_table
,
handle
,
D3D8_HANDLE_PS
);
wined3d_mutex_unlock
();
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
shader
=
0
;
return
hr
;
}
TRACE
(
"Created pixel shader %p (handle %#x).
\n
"
,
object
,
shader_handle
);
*
shader
=
shader_handle
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetPixelShader
(
LPDIRECT3DDEVICE8
iface
,
DWORD
pShader
)
{
...
...
dlls/d3d8/pixelshader.c
View file @
717419da
...
...
@@ -65,10 +65,32 @@ static ULONG WINAPI IDirect3DPixelShader8Impl_Release(IDirect3DPixelShader8 * if
return
ref
;
}
const
IDirect3DPixelShader8Vtbl
Direct3DPixelShader8_Vtbl
=
static
const
IDirect3DPixelShader8Vtbl
Direct3DPixelShader8_Vtbl
=
{
/* IUnknown */
IDirect3DPixelShader8Impl_QueryInterface
,
IDirect3DPixelShader8Impl_AddRef
,
IDirect3DPixelShader8Impl_Release
,
};
HRESULT
pixelshader_init
(
IDirect3DPixelShader8Impl
*
shader
,
IDirect3DDevice8Impl
*
device
,
const
DWORD
*
byte_code
,
DWORD
shader_handle
)
{
HRESULT
hr
;
shader
->
ref
=
1
;
shader
->
lpVtbl
=
&
Direct3DPixelShader8_Vtbl
;
shader
->
handle
=
shader_handle
;
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreatePixelShader
(
device
->
WineD3DDevice
,
byte_code
,
NULL
,
&
shader
->
wineD3DPixelShader
,
(
IUnknown
*
)
shader
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d pixel shader, hr %#x.
\n
"
,
hr
);
return
hr
;
}
return
D3D_OK
;
}
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