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
a4bd0c1c
Commit
a4bd0c1c
authored
7 years ago
by
Józef Kucia
Browse files
Options
Downloads
Patches
Plain Diff
libs/vkd3d: Allocate GPU virtual addresses in d3d12_committed_resource_init().
parent
b0979b27
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
libs/vkd3d/resource.c
+7
-10
7 additions, 10 deletions
libs/vkd3d/resource.c
with
7 additions
and
10 deletions
libs/vkd3d/resource.c
+
7
−
10
View file @
a4bd0c1c
...
...
@@ -277,20 +277,10 @@ static HRESULT vkd3d_allocate_buffer_memory(struct d3d12_resource *resource, str
if
(
FAILED
(
hr
=
vkd3d_allocate_device_memory
(
device
,
heap_properties
,
heap_flags
,
&
memory_requirements
,
&
resource
->
vk_memory
)))
return
hr
;
if
(
!
(
resource
->
gpu_address
=
vkd3d_gpu_va_allocator_allocate
(
&
device
->
gpu_va_allocator
,
memory_requirements
.
size
,
resource
)))
{
ERR
(
"Failed to allocate GPU VA.
\n
"
);
VK_CALL
(
vkFreeMemory
(
device
->
vk_device
,
resource
->
vk_memory
,
NULL
));
resource
->
vk_memory
=
VK_NULL_HANDLE
;
return
E_OUTOFMEMORY
;
}
if
((
vr
=
VK_CALL
(
vkBindBufferMemory
(
device
->
vk_device
,
resource
->
u
.
vk_buffer
,
resource
->
vk_memory
,
0
)))
<
0
)
{
WARN
(
"Failed to bind memory, vr %d.
\n
"
,
vr
);
vkd3d_gpu_va_allocator_free
(
&
device
->
gpu_va_allocator
,
resource
->
gpu_address
);
resource
->
gpu_address
=
0
;
VK_CALL
(
vkFreeMemory
(
device
->
vk_device
,
resource
->
vk_memory
,
NULL
));
resource
->
vk_memory
=
VK_NULL_HANDLE
;
return
hresult_from_vk_result
(
vr
);
...
...
@@ -675,6 +665,13 @@ static HRESULT d3d12_committed_resource_init(struct d3d12_resource *resource, st
case
D3D12_RESOURCE_DIMENSION_BUFFER
:
if
(
FAILED
(
hr
=
vkd3d_create_buffer
(
resource
,
device
,
heap_properties
,
heap_flags
,
desc
)))
return
hr
;
if
(
!
(
resource
->
gpu_address
=
vkd3d_gpu_va_allocator_allocate
(
&
device
->
gpu_va_allocator
,
desc
->
Width
,
resource
)))
{
ERR
(
"Failed to allocate GPU VA.
\n
"
);
d3d12_resource_destroy
(
resource
,
device
);
return
E_OUTOFMEMORY
;
}
if
(
FAILED
(
hr
=
vkd3d_allocate_buffer_memory
(
resource
,
device
,
heap_properties
,
heap_flags
)))
{
d3d12_resource_destroy
(
resource
,
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