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
bfb63a86
Commit
bfb63a86
authored
Jan 17, 2010
by
Henri Verbeet
Committed by
Alexandre Julliard
Jan 18, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
d3d9: Add a separate function for query initialization.
parent
cdb7a94a
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
46 additions
and
40 deletions
+46
-40
d3d9_private.h
dlls/d3d9/d3d9_private.h
+3
-3
device.c
dlls/d3d9/device.c
+31
-0
query.c
dlls/d3d9/query.c
+12
-37
No files found.
dlls/d3d9/d3d9_private.h
View file @
bfb63a86
...
...
@@ -228,9 +228,6 @@ extern HRESULT WINAPI IDirect3DDevice9Impl_SetPixelShaderConstantB(IDirect3DDevi
UINT
StartRegister
,
const
BOOL
*
pConstantData
,
UINT
BoolCount
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_GetPixelShaderConstantB
(
IDirect3DDevice9Ex
*
iface
,
UINT
StartRegister
,
BOOL
*
pConstantData
,
UINT
BoolCount
)
DECLSPEC_HIDDEN
;
extern
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateQuery
(
IDirect3DDevice9Ex
*
iface
,
D3DQUERYTYPE
Type
,
IDirect3DQuery9
**
ppQuery
)
DECLSPEC_HIDDEN
;
/* ---------------- */
/* IDirect3DVolume9 */
...
...
@@ -564,4 +561,7 @@ typedef struct IDirect3DQuery9Impl {
LPDIRECT3DDEVICE9EX
parentDevice
;
}
IDirect3DQuery9Impl
;
HRESULT
query_init
(
IDirect3DQuery9Impl
*
query
,
IDirect3DDevice9Impl
*
device
,
D3DQUERYTYPE
type
)
DECLSPEC_HIDDEN
;
#endif
/* __WINE_D3D9_PRIVATE_H */
dlls/d3d9/device.c
View file @
bfb63a86
...
...
@@ -2178,6 +2178,37 @@ static HRESULT WINAPI IDirect3DDevice9Impl_DeletePatch(LPDIRECT3DDEVICE9EX ifa
return
hr
;
}
static
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateQuery
(
IDirect3DDevice9Ex
*
iface
,
D3DQUERYTYPE
type
,
IDirect3DQuery9
**
query
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DQuery9Impl
*
object
;
HRESULT
hr
;
TRACE
(
"iface %p, type %#x, query %p.
\n
"
,
iface
,
type
,
query
);
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
*
object
));
if
(
!
object
)
{
ERR
(
"Failed to allocate query memory.
\n
"
);
return
E_OUTOFMEMORY
;
}
hr
=
query_init
(
object
,
This
,
type
);
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to initialize query, hr %#x.
\n
"
,
hr
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
return
hr
;
}
TRACE
(
"Created query %p.
\n
"
,
object
);
if
(
query
)
*
query
=
(
IDirect3DQuery9
*
)
object
;
else
IDirect3DQuery9_Release
((
IDirect3DQuery9
*
)
object
);
return
D3D_OK
;
}
static
HRESULT
WINAPI
IDirect3DDevice9ExImpl_SetConvolutionMonoKernel
(
IDirect3DDevice9Ex
*
iface
,
UINT
width
,
UINT
height
,
float
*
rows
,
float
*
columns
)
{
...
...
dlls/d3d9/query.c
View file @
bfb63a86
...
...
@@ -150,49 +150,24 @@ static const IDirect3DQuery9Vtbl Direct3DQuery9_Vtbl =
IDirect3DQuery9Impl_GetData
};
HRESULT
query_init
(
IDirect3DQuery9Impl
*
query
,
IDirect3DDevice9Impl
*
device
,
D3DQUERYTYPE
type
)
{
HRESULT
hr
;
/* IDirect3DDevice9 IDirect3DQuery9 Methods follow: */
HRESULT
WINAPI
IDirect3DDevice9Impl_CreateQuery
(
LPDIRECT3DDEVICE9EX
iface
,
D3DQUERYTYPE
Type
,
IDirect3DQuery9
**
ppQuery
)
{
IDirect3DDevice9Impl
*
This
=
(
IDirect3DDevice9Impl
*
)
iface
;
IDirect3DQuery9Impl
*
object
=
NULL
;
HRESULT
hr
=
D3D_OK
;
TRACE
(
"iface %p, type %#x, query %p.
\n
"
,
iface
,
Type
,
ppQuery
);
query
->
lpVtbl
=
&
Direct3DQuery9_Vtbl
;
query
->
ref
=
1
;
if
(
!
ppQuery
)
{
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateQuery
(
This
->
WineD3DDevice
,
Type
,
NULL
,
NULL
);
hr
=
IWineD3DDevice_CreateQuery
(
device
->
WineD3DDevice
,
type
,
&
query
->
wineD3DQuery
,
(
IUnknown
*
)
query
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
WARN
(
"Failed to create wined3d query, hr %#x.
\n
"
,
hr
);
return
hr
;
}
/* Allocate the storage for the device */
object
=
HeapAlloc
(
GetProcessHeap
(),
HEAP_ZERO_MEMORY
,
sizeof
(
IDirect3DQuery9Impl
));
if
(
NULL
==
object
)
{
ERR
(
"Allocation of memory failed, returning D3DERR_OUTOFVIDEOMEMORY
\n
"
);
return
D3DERR_OUTOFVIDEOMEMORY
;
}
object
->
lpVtbl
=
&
Direct3DQuery9_Vtbl
;
object
->
ref
=
1
;
query
->
parentDevice
=
(
IDirect3DDevice9Ex
*
)
device
;
IDirect3DDevice9Ex_AddRef
(
query
->
parentDevice
);
wined3d_mutex_lock
();
hr
=
IWineD3DDevice_CreateQuery
(
This
->
WineD3DDevice
,
Type
,
&
object
->
wineD3DQuery
,
(
IUnknown
*
)
object
);
wined3d_mutex_unlock
();
if
(
FAILED
(
hr
))
{
/* free up object */
WARN
(
"(%p) call to IWineD3DDevice_CreateQuery failed
\n
"
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
object
);
}
else
{
IDirect3DDevice9Ex_AddRef
(
iface
);
object
->
parentDevice
=
iface
;
*
ppQuery
=
(
LPDIRECT3DQUERY9
)
object
;
TRACE
(
"(%p) : Created query %p
\n
"
,
This
,
object
);
}
TRACE
(
"(%p) : returning %x
\n
"
,
This
,
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