Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
vkd3d
Manage
Activity
Members
Labels
Plan
Wiki
Bugzilla
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
wine
vkd3d
Commits
79cbc900
Commit
79cbc900
authored
7 years ago
by
Sven Hesse
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d: Create Vulkan Query Pools for D3D12 Query Heaps.
parent
6c5d8da2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
libs/vkd3d/device.c
+1
-1
1 addition, 1 deletion
libs/vkd3d/device.c
libs/vkd3d/resource.c
+59
-1
59 additions, 1 deletion
libs/vkd3d/resource.c
libs/vkd3d/vkd3d_private.h
+2
-1
2 additions, 1 deletion
libs/vkd3d/vkd3d_private.h
with
62 additions
and
3 deletions
libs/vkd3d/device.c
+
1
−
1
View file @
79cbc900
...
...
@@ -1419,7 +1419,7 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateQueryHeap(ID3D12Device *ifac
TRACE
(
"iface %p, desc %p, iid %s, heap %p.
\n
"
,
iface
,
desc
,
debugstr_guid
(
iid
),
heap
);
if
(
FAILED
(
hr
=
d3d12_query_heap_create
(
device
,
&
object
)))
if
(
FAILED
(
hr
=
d3d12_query_heap_create
(
device
,
&
object
,
desc
)))
return
hr
;
return
return_interface
((
IUnknown
*
)
&
object
->
ID3D12QueryHeap_iface
,
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/resource.c
+
59
−
1
View file @
79cbc900
...
...
@@ -1636,6 +1636,9 @@ static ULONG STDMETHODCALLTYPE d3d12_query_heap_Release(ID3D12QueryHeap *iface)
if
(
!
refcount
)
{
struct
d3d12_device
*
device
=
heap
->
device
;
const
struct
vkd3d_vk_device_procs
*
vk_procs
=
&
device
->
vk_procs
;
VK_CALL
(
vkDestroyQueryPool
(
device
->
vk_device
,
heap
->
vk_query_pool
,
NULL
));
vkd3d_free
(
heap
);
...
...
@@ -1701,9 +1704,13 @@ static const struct ID3D12QueryHeapVtbl d3d12_query_heap_vtbl =
d3d12_query_heap_GetDevice
,
};
HRESULT
d3d12_query_heap_create
(
struct
d3d12_device
*
device
,
struct
d3d12_query_heap
**
heap
)
HRESULT
d3d12_query_heap_create
(
struct
d3d12_device
*
device
,
struct
d3d12_query_heap
**
heap
,
const
D3D12_QUERY_HEAP_DESC
*
desc
)
{
const
struct
vkd3d_vk_device_procs
*
vk_procs
=
&
device
->
vk_procs
;
struct
d3d12_query_heap
*
object
;
VkQueryPoolCreateInfo
pool_info
;
VkResult
vr
;
if
(
!
(
object
=
vkd3d_malloc
(
sizeof
(
*
object
))))
return
E_OUTOFMEMORY
;
...
...
@@ -1711,6 +1718,57 @@ HRESULT d3d12_query_heap_create(struct d3d12_device *device, struct d3d12_query_
object
->
ID3D12QueryHeap_iface
.
lpVtbl
=
&
d3d12_query_heap_vtbl
;
object
->
refcount
=
1
;
object
->
device
=
device
;
pool_info
.
sType
=
VK_STRUCTURE_TYPE_QUERY_POOL_CREATE_INFO
;
pool_info
.
pNext
=
NULL
;
pool_info
.
flags
=
0
;
pool_info
.
queryCount
=
desc
->
Count
;
switch
(
desc
->
Type
)
{
case
D3D12_QUERY_HEAP_TYPE_OCCLUSION
:
pool_info
.
queryType
=
VK_QUERY_TYPE_OCCLUSION
;
pool_info
.
pipelineStatistics
=
0
;
break
;
case
D3D12_QUERY_HEAP_TYPE_TIMESTAMP
:
pool_info
.
queryType
=
VK_QUERY_TYPE_TIMESTAMP
;
pool_info
.
pipelineStatistics
=
0
;
break
;
case
D3D12_QUERY_HEAP_TYPE_PIPELINE_STATISTICS
:
pool_info
.
queryType
=
VK_QUERY_TYPE_PIPELINE_STATISTICS
;
pool_info
.
pipelineStatistics
=
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_VERTICES_BIT
|
VK_QUERY_PIPELINE_STATISTIC_INPUT_ASSEMBLY_PRIMITIVES_BIT
|
VK_QUERY_PIPELINE_STATISTIC_VERTEX_SHADER_INVOCATIONS_BIT
|
VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_INVOCATIONS_BIT
|
VK_QUERY_PIPELINE_STATISTIC_GEOMETRY_SHADER_PRIMITIVES_BIT
|
VK_QUERY_PIPELINE_STATISTIC_CLIPPING_INVOCATIONS_BIT
|
VK_QUERY_PIPELINE_STATISTIC_CLIPPING_PRIMITIVES_BIT
|
VK_QUERY_PIPELINE_STATISTIC_FRAGMENT_SHADER_INVOCATIONS_BIT
|
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_CONTROL_SHADER_PATCHES_BIT
|
VK_QUERY_PIPELINE_STATISTIC_TESSELLATION_EVALUATION_SHADER_INVOCATIONS_BIT
|
VK_QUERY_PIPELINE_STATISTIC_COMPUTE_SHADER_INVOCATIONS_BIT
;
break
;
case
D3D12_QUERY_HEAP_TYPE_SO_STATISTICS
:
WARN
(
"Unsupported query heap type SO_STATISTICS.
\n
"
);
vkd3d_free
(
object
);
return
E_NOTIMPL
;
default:
WARN
(
"Invalid query heap type %u.
\n
"
,
desc
->
Type
);
vkd3d_free
(
object
);
return
E_INVALIDARG
;
}
if
((
vr
=
VK_CALL
(
vkCreateQueryPool
(
device
->
vk_device
,
&
pool_info
,
NULL
,
&
object
->
vk_query_pool
)))
<
0
)
{
WARN
(
"Failed to create Vulkan query pool, vr %d.
\n
"
,
vr
);
vkd3d_free
(
object
);
return
hresult_from_vk_result
(
vr
);
}
ID3D12Device_AddRef
(
&
device
->
ID3D12Device_iface
);
TRACE
(
"Created query heap %p.
\n
"
,
object
);
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/vkd3d_private.h
+
2
−
1
View file @
79cbc900
...
...
@@ -257,12 +257,13 @@ struct d3d12_query_heap
{
ID3D12QueryHeap
ID3D12QueryHeap_iface
;
LONG
refcount
;
VkQueryPool
vk_query_pool
;
struct
d3d12_device
*
device
;
};
HRESULT
d3d12_query_heap_create
(
struct
d3d12_device
*
device
,
struct
d3d12_query_heap
**
heap
)
DECLSPEC_HIDDEN
;
struct
d3d12_query_heap
**
heap
,
const
D3D12_QUERY_HEAP_DESC
*
desc
)
DECLSPEC_HIDDEN
;
struct
d3d12_root_descriptor_table_range
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment