Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
monado
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
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
blender
monado
Commits
855cdb4c
Commit
855cdb4c
authored
4 years ago
by
Jakob Bornecrantz
Browse files
Options
Downloads
Patches
Plain Diff
aux/vk: Tidy code (NFC)
parent
5cb130cd
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xrt/auxiliary/vk/vk_helpers.c
+13
-22
13 additions, 22 deletions
src/xrt/auxiliary/vk/vk_helpers.c
with
13 additions
and
22 deletions
src/xrt/auxiliary/vk/vk_helpers.c
+
13
−
22
View file @
855cdb4c
// Copyright 2019-202
0
, Collabora, Ltd.
// Copyright 2019-202
1
, Collabora, Ltd.
// SPDX-License-Identifier: BSL-1.0
/*!
* @file
...
...
@@ -212,9 +212,7 @@ vk_alloc_and_bind_image_memory(struct vk_bundle *vk,
vk
->
vkGetImageMemoryRequirements
(
vk
->
device
,
image
,
&
memory_requirements
);
if
(
max_size
>
0
&&
memory_requirements
.
size
>
max_size
)
{
VK_ERROR
(
vk
,
"client_vk_swapchain - Got too little memory "
"%u vs %u
\n
"
,
VK_ERROR
(
vk
,
"client_vk_swapchain - Got too little memory %u vs %u
\n
"
,
(
uint32_t
)
memory_requirements
.
size
,
(
uint32_t
)
max_size
);
return
VK_ERROR_OUT_OF_DEVICE_MEMORY
;
}
...
...
@@ -313,9 +311,7 @@ vk_create_image_from_native(struct vk_bundle *vk,
{
VkImageUsageFlags
image_usage
=
vk_swapchain_usage_flags
(
vk
,
(
VkFormat
)
info
->
format
,
info
->
bits
);
if
(
image_usage
==
0
)
{
U_LOG_E
(
"vk_create_image_from_native: Unsupported swapchain usage "
"flags"
);
U_LOG_E
(
"vk_create_image_from_native: Unsupported swapchain usage flags"
);
return
VK_ERROR_FEATURE_NOT_PRESENT
;
}
...
...
@@ -1000,10 +996,8 @@ vk_select_physical_device(struct vk_bundle *vk, int forced_index)
uint32_t
gpu_index
=
0
;
if
(
forced_index
>
-
1
)
{
if
((
uint32_t
)
forced_index
+
1
>
gpu_count
)
{
VK_ERROR
(
vk
,
"Attempted to force GPU index %d, but only %d "
"GPUs are available"
,
forced_index
,
gpu_count
);
VK_ERROR
(
vk
,
"Attempted to force GPU index %d, but only %d GPUs are available"
,
forced_index
,
gpu_count
);
return
VK_ERROR_DEVICE_LOST
;
}
gpu_index
=
forced_index
;
...
...
@@ -1146,10 +1140,7 @@ vk_build_device_extensions(struct vk_bundle *vk,
for
(
uint32_t
i
=
0
;
i
<
num_required_device_extensions
;
i
++
)
{
const
char
*
ext
=
required_device_extensions
[
i
];
if
(
!
vk_check_extension
(
vk
,
props
,
num_props
,
ext
))
{
U_LOG_E
(
"VkPhysicalDevice does not support required "
"extension %s"
,
ext
);
U_LOG_E
(
"VkPhysicalDevice does not support required extension %s"
,
ext
);
free
(
props
);
return
false
;
}
...
...
@@ -1383,11 +1374,9 @@ check_feature(VkFormat format,
VkFormatFeatureFlags
flag
)
{
if
((
format_features
&
flag
)
==
0
)
{
U_LOG_E
(
"vk_swapchain_usage_flags: %s requested but %s not "
"supported for format %s (%08x) (%08x)"
,
xrt_swapchain_usage_string
(
usage
),
vk_format_feature_string
(
flag
),
vk_color_format_string
(
format
),
format_features
,
flag
);
U_LOG_E
(
"vk_swapchain_usage_flags: %s requested but %s not supported for format %s (%08x) (%08x)"
,
xrt_swapchain_usage_string
(
usage
),
vk_format_feature_string
(
flag
),
vk_color_format_string
(
format
),
format_features
,
flag
);
return
false
;
}
return
true
;
...
...
@@ -1508,8 +1497,10 @@ vk_buffer_init(struct vk_bundle *vk,
VkMemoryRequirements
requirements
;
vk
->
vkGetBufferMemoryRequirements
(
vk
->
device
,
*
out_buffer
,
&
requirements
);
VkMemoryAllocateInfo
alloc_info
=
{.
sType
=
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
,
.
allocationSize
=
requirements
.
size
};
VkMemoryAllocateInfo
alloc_info
=
{
.
sType
=
VK_STRUCTURE_TYPE_MEMORY_ALLOCATE_INFO
,
.
allocationSize
=
requirements
.
size
,
};
if
(
!
vk_get_memory_type
(
vk
,
requirements
.
memoryTypeBits
,
properties
,
&
alloc_info
.
memoryTypeIndex
))
{
VK_ERROR
(
vk
,
"Failed to find matching memoryTypeIndex for buffer"
);
...
...
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