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
13a5036b
Commit
13a5036b
authored
3 years ago
by
Jakob Bornecrantz
Committed by
Ryan Pavlik
3 years ago
Browse files
Options
Downloads
Patches
Plain Diff
c/main: Make temp_vk be a pointer
parent
9b6b5b7e
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/xrt/compositor/main/comp_compositor.c
+10
-8
10 additions, 8 deletions
src/xrt/compositor/main/comp_compositor.c
with
10 additions
and
8 deletions
src/xrt/compositor/main/comp_compositor.c
+
10
−
8
View file @
13a5036b
...
@@ -1079,8 +1079,10 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
...
@@ -1079,8 +1079,10 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
}
}
COMP_DEBUG
(
c
,
"Checking for NVIDIA vulkan driver."
);
COMP_DEBUG
(
c
,
"Checking for NVIDIA vulkan driver."
);
struct
vk_bundle
temp_vk
=
{
0
};
struct
vk_bundle
temp_vk_storage
=
{
0
};
ret
=
vk_get_loader_functions
(
&
temp_vk
,
vkGetInstanceProcAddr
);
struct
vk_bundle
*
temp_vk
=
&
temp_vk_storage
;
ret
=
vk_get_loader_functions
(
temp_vk
,
vkGetInstanceProcAddr
);
if
(
ret
!=
VK_SUCCESS
)
{
if
(
ret
!=
VK_SUCCESS
)
{
CVK_ERROR
(
c
,
"vk_get_loader_functions"
,
"Failed to get loader functions."
,
ret
);
CVK_ERROR
(
c
,
"vk_get_loader_functions"
,
"Failed to get loader functions."
,
ret
);
return
false
;
return
false
;
...
@@ -1095,13 +1097,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
...
@@ -1095,13 +1097,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
.
ppEnabledExtensionNames
=
extension_names
,
.
ppEnabledExtensionNames
=
extension_names
,
};
};
ret
=
temp_vk
.
vkCreateInstance
(
&
instance_create_info
,
NULL
,
&
(
temp_vk
.
instance
));
ret
=
temp_vk
->
vkCreateInstance
(
&
instance_create_info
,
NULL
,
&
(
temp_vk
->
instance
));
if
(
ret
!=
VK_SUCCESS
)
{
if
(
ret
!=
VK_SUCCESS
)
{
CVK_ERROR
(
c
,
"vkCreateInstance"
,
"Failed to create VkInstance."
,
ret
);
CVK_ERROR
(
c
,
"vkCreateInstance"
,
"Failed to create VkInstance."
,
ret
);
return
false
;
return
false
;
}
}
ret
=
vk_get_instance_functions
(
&
temp_vk
);
ret
=
vk_get_instance_functions
(
temp_vk
);
if
(
ret
!=
VK_SUCCESS
)
{
if
(
ret
!=
VK_SUCCESS
)
{
CVK_ERROR
(
c
,
"vk_get_instance_functions"
,
"Failed to get Vulkan instance functions."
,
ret
);
CVK_ERROR
(
c
,
"vk_get_instance_functions"
,
"Failed to get Vulkan instance functions."
,
ret
);
return
false
;
return
false
;
...
@@ -1109,7 +1111,7 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
...
@@ -1109,7 +1111,7 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
// follow same device selection logic as subsequent calls
// follow same device selection logic as subsequent calls
ret
=
vk_create_device
(
//
ret
=
vk_create_device
(
//
&
temp_vk
,
//
temp_vk
,
//
c
->
settings
.
selected_gpu_index
,
//
c
->
settings
.
selected_gpu_index
,
//
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT
,
// global_priority
VK_QUEUE_GLOBAL_PRIORITY_MEDIUM_EXT
,
// global_priority
required_device_extensions
,
//
required_device_extensions
,
//
...
@@ -1122,13 +1124,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
...
@@ -1122,13 +1124,13 @@ compositor_check_vulkan_caps(struct comp_compositor *c)
return
false
;
return
false
;
}
}
if
(
_test_for_nvidia
(
c
,
&
temp_vk
))
{
if
(
_test_for_nvidia
(
c
,
temp_vk
))
{
c
->
settings
.
window_type
=
WINDOW_DIRECT_NVIDIA
;
c
->
settings
.
window_type
=
WINDOW_DIRECT_NVIDIA
;
COMP_DEBUG
(
c
,
"Selecting direct NVIDIA window type!"
);
COMP_DEBUG
(
c
,
"Selecting direct NVIDIA window type!"
);
}
}
temp_vk
.
vkDestroyDevice
(
temp_vk
.
device
,
NULL
);
temp_vk
->
vkDestroyDevice
(
temp_vk
->
device
,
NULL
);
temp_vk
.
vkDestroyInstance
(
temp_vk
.
instance
,
NULL
);
temp_vk
->
vkDestroyInstance
(
temp_vk
->
instance
,
NULL
);
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
#endif // VK_USE_PLATFORM_XLIB_XRANDR_EXT
return
true
;
return
true
;
...
...
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