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
9262f872
Commit
9262f872
authored
8 years ago
by
Henri Verbeet
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d: Allocate CPU memory for descriptors.
parent
cd37442f
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
+19
-2
19 additions, 2 deletions
libs/vkd3d/device.c
libs/vkd3d/resource.c
+17
-1
17 additions, 1 deletion
libs/vkd3d/resource.c
libs/vkd3d/vkd3d_private.h
+24
-0
24 additions, 0 deletions
libs/vkd3d/vkd3d_private.h
with
60 additions
and
3 deletions
libs/vkd3d/device.c
+
19
−
2
View file @
9262f872
...
...
@@ -685,9 +685,26 @@ static HRESULT STDMETHODCALLTYPE d3d12_device_CreateDescriptorHeap(ID3D12Device
static
UINT
STDMETHODCALLTYPE
d3d12_device_GetDescriptorHandleIncrementSize
(
ID3D12Device
*
iface
,
D3D12_DESCRIPTOR_HEAP_TYPE
descriptor_heap_type
)
{
FIXM
E
(
"iface %p, descriptor_heap_type %#x
stub!
\n
"
,
iface
,
descriptor_heap_type
);
TRAC
E
(
"iface %p, descriptor_heap_type %#x
.
\n
"
,
iface
,
descriptor_heap_type
);
return
0
;
switch
(
descriptor_heap_type
)
{
case
D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV
:
return
sizeof
(
struct
d3d12_cbv_srv_uav_desc
);
case
D3D12_DESCRIPTOR_HEAP_TYPE_SAMPLER
:
return
sizeof
(
struct
d3d12_sampler_desc
);
case
D3D12_DESCRIPTOR_HEAP_TYPE_RTV
:
return
sizeof
(
struct
d3d12_rtv_desc
);
case
D3D12_DESCRIPTOR_HEAP_TYPE_DSV
:
return
sizeof
(
struct
d3d12_dsv_desc
);
default:
FIXME
(
"Unhandled type %#x.
\n
"
,
descriptor_heap_type
);
return
0
;
}
}
static
HRESULT
STDMETHODCALLTYPE
d3d12_device_CreateRootSignature
(
ID3D12Device
*
iface
,
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/resource.c
+
17
−
1
View file @
9262f872
...
...
@@ -830,12 +830,28 @@ static void d3d12_descriptor_heap_init(struct d3d12_descriptor_heap *descriptor_
HRESULT
d3d12_descriptor_heap_create
(
struct
d3d12_device
*
device
,
const
D3D12_DESCRIPTOR_HEAP_DESC
*
desc
,
struct
d3d12_descriptor_heap
**
descriptor_heap
)
{
size_t
max_descriptor_count
,
descriptor_size
;
struct
d3d12_descriptor_heap
*
object
;
if
(
!
(
object
=
vkd3d_malloc
(
sizeof
(
*
object
))))
if
(
!
(
descriptor_size
=
ID3D12Device_GetDescriptorHandleIncrementSize
(
&
device
->
ID3D12Device_iface
,
desc
->
Type
)))
{
WARN
(
"No descriptor size for descriptor type %#x.
\n
"
,
desc
->
Type
);
return
E_INVALIDARG
;
}
max_descriptor_count
=
(
~
(
size_t
)
0
-
sizeof
(
*
object
))
/
descriptor_size
;
if
(
desc
->
NumDescriptors
>
max_descriptor_count
)
{
WARN
(
"Invalid descriptor count %u (max %zu).
\n
"
,
desc
->
NumDescriptors
,
max_descriptor_count
);
return
E_OUTOFMEMORY
;
}
if
(
!
(
object
=
vkd3d_malloc
(
offsetof
(
struct
d3d12_descriptor_heap
,
descriptors
[
descriptor_size
*
desc
->
NumDescriptors
]))))
return
E_OUTOFMEMORY
;
d3d12_descriptor_heap_init
(
object
,
device
,
desc
);
memset
(
object
->
descriptors
,
0
,
descriptor_size
*
desc
->
NumDescriptors
);
TRACE
(
"Created descriptor heap %p.
\n
"
,
object
);
...
...
This diff is collapsed.
Click to expand it.
libs/vkd3d/vkd3d_private.h
+
24
−
0
View file @
9262f872
...
...
@@ -33,6 +33,8 @@
#include
<assert.h>
#define VKD3D_DESCRIPTOR_MAGIC_FREE 0x00000000u
struct
d3d12_command_list
;
struct
d3d12_device
;
...
...
@@ -83,6 +85,26 @@ HRESULT d3d12_committed_resource_create(struct d3d12_device *device,
const
D3D12_RESOURCE_DESC
*
desc
,
D3D12_RESOURCE_STATES
initial_state
,
const
D3D12_CLEAR_VALUE
*
optimized_clear_value
,
struct
d3d12_resource
**
resource
)
DECLSPEC_HIDDEN
;
struct
d3d12_cbv_srv_uav_desc
{
uint32_t
magic
;
};
struct
d3d12_sampler_desc
{
uint32_t
magic
;
};
struct
d3d12_rtv_desc
{
uint32_t
magic
;
};
struct
d3d12_dsv_desc
{
uint32_t
magic
;
};
/* ID3D12DescriptorHeap */
struct
d3d12_descriptor_heap
{
...
...
@@ -92,6 +114,8 @@ struct d3d12_descriptor_heap
D3D12_DESCRIPTOR_HEAP_DESC
desc
;
struct
d3d12_device
*
device
;
BYTE
descriptors
[];
};
HRESULT
d3d12_descriptor_heap_create
(
struct
d3d12_device
*
device
,
...
...
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