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
9a4ce317
Commit
9a4ce317
authored
Aug 27, 2006
by
H. Verbeet
Committed by
Alexandre Julliard
Aug 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d8: Use proper handles for pixel shaders.
parent
4a48e38e
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
38 additions
and
10 deletions
+38
-10
d3d8_private.h
dlls/d3d8/d3d8_private.h
+1
-0
device.c
dlls/d3d8/device.c
+37
-10
No files found.
dlls/d3d8/d3d8_private.h
View file @
9a4ce317
...
...
@@ -560,6 +560,7 @@ typedef struct IDirect3DPixelShader8Impl {
const
IDirect3DPixelShader8Vtbl
*
lpVtbl
;
LONG
ref
;
shader_handle
*
handle
;
/* The device, to be replaced by an IDirect3DDeviceImpl */
IWineD3DPixelShader
*
wineD3DPixelShader
;
}
IDirect3DPixelShader8Impl
;
...
...
dlls/d3d8/device.c
View file @
9a4ce317
...
...
@@ -1262,6 +1262,8 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i
IDirect3DPixelShader8Impl
*
object
;
HRESULT
hrc
=
D3D_OK
;
TRACE
(
"(%p) : pFunction(%p), ppShader(%p)
\n
"
,
This
,
pFunction
,
ppShader
);
if
(
NULL
==
ppShader
)
{
TRACE
(
"(%p) Invalid call
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
...
...
@@ -1280,20 +1282,37 @@ static HRESULT WINAPI IDirect3DDevice8Impl_CreatePixelShader(LPDIRECT3DDEVICE8 i
HeapFree
(
GetProcessHeap
(),
0
,
object
);
*
ppShader
=
0
;
}
else
{
*
ppShader
=
(
DWORD
)
object
;
shader_handle
*
handle
=
alloc_shader_handle
(
This
);
if
(
!
handle
)
{
ERR
(
"Failed to allocate shader handle
\n
"
);
IDirect3DVertexShader8_Release
((
IUnknown
*
)
object
);
hrc
=
E_OUTOFMEMORY
;
}
else
{
object
->
handle
=
handle
;
*
handle
=
object
;
*
ppShader
=
(
handle
-
This
->
shader_handles
)
+
VS_HIGHESTFIXEDFXF
+
1
;
}
}
}
TRACE
(
"(%p) : returning %p
\n
"
,
This
,
(
void
*
)
*
ppShader
);
TRACE
(
"(%p) : returning %p
(handle %#lx)
\n
"
,
This
,
object
,
*
ppShader
);
return
hrc
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_SetPixelShader
(
LPDIRECT3DDEVICE8
iface
,
DWORD
pShader
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
IDirect3DPixelShader8Impl
*
shader
=
(
IDirect3DPixelShader8Impl
*
)
pShader
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
IDirect3DPixelShader8Impl
*
shader
=
NULL
;
TRACE
(
"(%p) : pShader %#lx
\n
"
,
This
,
pShader
);
if
(
pShader
>
VS_HIGHESTFIXEDFXF
&&
This
->
allocated_shader_handles
>
pShader
-
(
VS_HIGHESTFIXEDFXF
+
1
))
{
shader
=
This
->
shader_handles
[
pShader
-
(
VS_HIGHESTFIXEDFXF
+
1
)];
}
else
if
(
pShader
)
{
ERR
(
"Trying to set an invalid handle.
\n
"
);
}
TRACE
(
"(%p) : Setting shader %p
\n
"
,
This
,
shader
);
return
IWineD3DDevice_SetPixelShader
(
This
->
WineD3DDevice
,
shader
==
NULL
?
NULL
:
shader
->
wineD3DPixelShader
);
}
...
...
@@ -1310,23 +1329,31 @@ static HRESULT WINAPI IDirect3DDevice8Impl_GetPixelShader(LPDIRECT3DDEVICE8 ifac
hrc
=
IWineD3DDevice_GetPixelShader
(
This
->
WineD3DDevice
,
&
object
);
if
(
D3D_OK
==
hrc
&&
NULL
!=
object
)
{
hrc
=
IWineD3DPixelShader_GetParent
(
object
,
(
IUnknown
**
)
ppShader
);
IWineD3DPixelShader_Release
(
object
);
IDirect3DPixelShader8Impl
*
d3d8_shader
;
hrc
=
IWineD3DPixelShader_GetParent
(
object
,
(
IUnknown
**
)
&
d3d8_shader
);
IWineD3DPixelShader_Release
(
object
);
*
ppShader
=
(
d3d8_shader
->
handle
-
This
->
shader_handles
)
+
(
VS_HIGHESTFIXEDFXF
+
1
);
}
else
{
*
ppShader
=
(
DWORD
)
NULL
;
}
TRACE
(
"(%p) : returning %
p
\n
"
,
This
,
(
void
*
)
*
ppShader
);
TRACE
(
"(%p) : returning %
#lx
\n
"
,
This
,
*
ppShader
);
return
hrc
;
}
static
HRESULT
WINAPI
IDirect3DDevice8Impl_DeletePixelShader
(
LPDIRECT3DDEVICE8
iface
,
DWORD
pShader
)
{
IDirect3DDevice8Impl
*
This
=
(
IDirect3DDevice8Impl
*
)
iface
;
IDirect3DPixelShader8Impl
*
shader
=
(
IDirect3DPixelShader8Impl
*
)
pShader
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
if
(
NULL
!=
shader
)
{
TRACE
(
"(%p) : pShader %#lx
\n
"
,
This
,
pShader
);
if
(
pShader
<=
VS_HIGHESTFIXEDFXF
||
This
->
allocated_shader_handles
<=
pShader
-
(
VS_HIGHESTFIXEDFXF
+
1
))
{
ERR
(
"(%p) : Trying to delete an invalid handle
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
}
else
{
shader_handle
*
handle
=
&
This
->
shader_handles
[
pShader
-
(
VS_HIGHESTFIXEDFXF
+
1
)];
IDirect3DPixelShader8Impl
*
shader
=
*
handle
;
while
(
IUnknown_Release
((
IUnknown
*
)
shader
));
free_shader_handle
(
This
,
handle
);
}
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