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
7f1c802b
Commit
7f1c802b
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 pixel shader initialization.
parent
dde50a47
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
38 deletions
+47
-38
d3d9_private.h
dlls/d3d9/d3d9_private.h
+3
-2
device.c
dlls/d3d9/device.c
+30
-0
pixelshader.c
dlls/d3d9/pixelshader.c
+14
-36
No files found.
dlls/d3d9/d3d9_private.h
View file @
7f1c802b
...
...
@@ -222,8 +222,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_SetVertexShaderConstantB(IDirect3DDev
UINT
StartRegister
,
const
BOOL
*
pConstantData
,
UINT
BoolCount
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_GetVertexShaderConstantB
(
IDirect3DDevice9Ex
*
iface
,
UINT
StartRegister
,
BOOL
*
pConstantData
,
UINT
BoolCount
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreatePixelShader
(
IDirect3DDevice9Ex
*
iface
,
const
DWORD
*
pFunction
,
IDirect3DPixelShader9
**
ppShader
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_SetPixelShader
(
IDirect3DDevice9Ex
*
iface
,
IDirect3DPixelShader9
*
pShader
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_GetPixelShader
(
IDirect3DDevice9Ex
*
iface
,
...
...
@@ -551,6 +549,9 @@ typedef struct IDirect3DPixelShader9Impl {
LPDIRECT3DDEVICE9EX
parentDevice
;
}
IDirect3DPixelShader9Impl
;
HRESULT
pixelshader_init
(
IDirect3DPixelShader9Impl
*
shader
,
IDirect3DDevice9Impl
*
device
,
const
DWORD
*
byte_code
)
DECLSPEC_HIDDEN
;
/* --------------- */
/* IDirect3DQuery9 */
/* --------------- */
...
...
dlls/d3d9/device.c
View file @
7f1c802b
...
...
@@ -1967,6 +1967,36 @@ static HRESULT WINAPI IDirect3DDevice9Impl_GetIndices(LPDIRECT3DDEVICE9EX ifac
return
rc
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_CreatePixelShader
(
IDirect3DDevice9Ex
*
iface
,
const
DWORD
*
byte_code
,
IDirect3DPixelShader9
**
shader
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DPixelShader9Impl
*
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
)
{
FIXME
(
"Failed to allocate pixel shader memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
pixelshader_init
(
object
,
This
,
byte_code
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize pixel shader, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created pixel shader %p.
\n
"
,
object
);
*
shader
=
(
IDirect3DPixelShader9
*
)
object
;
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_DrawRectPatch
(
LPDIRECT3DDEVICE9EX
iface
,
UINT
Handle
,
CONST
float
*
pNumSegs
,
CONST
D3DRECTPATCH_INFO
*
pRectPatchInfo
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
HRESULT
hr
;
...
...
dlls/d3d9/pixelshader.c
View file @
7f1c802b
...
...
@@ -107,49 +107,27 @@ static const IDirect3DPixelShader9Vtbl Direct3DPixelShader9_Vtbl =
IDirect3DPixelShader9Impl_GetFunction
};
HRESULT
pixelshader_init
(
IDirect3DPixelShader9Impl
*
shader
,
IDirect3DDevice9Impl
*
device
,
const
DWORD
*
byte_code
)
{
HRESULT
hr
;
/* IDirect3DDevice9 IDirect3DPixelShader9 Methods follow: */
HRESULT
WINAPI
IDirect3DDevice9Impl_CreatePixelShader
(
LPDIRECT3DDEVICE9EX
iface
,
CONST
DWORD
*
pFunction
,
IDirect3DPixelShader9
**
ppShader
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DPixelShader9Impl
*
object
;
HRESULT
hrc
=
D3D_OK
;
TRACE
(
"(%p) Relay
\n
"
,
This
);
if
(
ppShader
==
NULL
)
{
TRACE
(
"(%p) Invalid call
\n
"
,
This
);
return
D3DERR_INVALIDCALL
;
}
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
NULL
==
object
)
{
FIXME
(
"Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY
\n
"
);
return
E_OUTOFMEMORY
;
}
object
->
ref
=
1
;
object
->
lpVtbl
=
&
Direct3DPixelShader9_Vtbl
;
shader
->
ref
=
1
;
shader
->
lpVtbl
=
&
Direct3DPixelShader9_Vtbl
;
wined3d_mutex_lock
();
hr
c
=
IWineD3DDevice_CreatePixelShader
(
This
->
WineD3DDevice
,
pFunction
,
NULL
,
&
object
->
wineD3DPixelShader
,
(
IUnknown
*
)
object
);
hr
=
IWineD3DDevice_CreatePixelShader
(
device
->
WineD3DDevice
,
byte_code
,
NULL
,
&
shader
->
wineD3DPixelShader
,
(
IUnknown
*
)
shader
);
wined3d_mutex_unlock
();
if
(
hrc
!=
D3D_OK
)
if
(
FAILED
(
hr
))
{
/* free up object */
FIXME
(
"(%p) call to IWineD3DDevice_CreatePixelShader failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
IDirect3DDevice9Ex_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppShader
=
(
IDirect3DPixelShader9
*
)
object
;
TRACE
(
"(%p) : Created pixel shader %p
\n
"
,
This
,
object
);
WARN
(
"Failed to created wined3d pixel 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_SetPixelShader
(
LPDIRECT3DDEVICE9EX
iface
,
IDirect3DPixelShader9
*
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