Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
VkCV Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Contributor 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
Vulkan2021
VkCV Framework
Commits
ca274cb3
Commit
ca274cb3
authored
3 years ago
by
Alexander Gauggel
Browse files
Options
Downloads
Patches
Plain Diff
moved Context comments from cpp to hpp and converted them from XML to doxygen
parent
42b402ba
No related branches found
No related tags found
1 merge request
!11
Resolve "Add Doxygen comments to existing code"
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/vkcv/Context.cpp
+0
-32
0 additions, 32 deletions
src/vkcv/Context.cpp
src/vkcv/Context.hpp
+38
-0
38 additions, 0 deletions
src/vkcv/Context.hpp
with
38 additions
and
32 deletions
src/vkcv/Context.cpp
+
0
−
32
View file @
ca274cb3
...
...
@@ -135,12 +135,6 @@ namespace vkcv {
return
m_device
;
}
/// <summary>
/// All existing physical devices will be evaluated by
/// </summary>
/// <param name="instance">The instance.</param>
/// <returns>The optimal physical device.</returns>
/// <seealso cref="Context.deviceScore">
vk
::
PhysicalDevice
Context
::
pickPhysicalDevice
(
vk
::
Instance
&
instance
)
{
vk
::
PhysicalDevice
phyDevice
;
std
::
vector
<
vk
::
PhysicalDevice
>
devices
=
instance
.
enumeratePhysicalDevices
();
...
...
@@ -165,12 +159,6 @@ namespace vkcv {
return
phyDevice
;
}
/// <summary>
/// The physical device is evaluated by three categories: discrete GPU vs. integrated GPU, amount of queues and
/// its abilities, and VRAM.
/// </summary>
/// <param name="physicalDevice"> The physical device. </param>
/// <returns></returns>
int
Context
::
deviceScore
(
const
vk
::
PhysicalDevice
&
physicalDevice
)
{
uint32_t
score
=
0
;
vk
::
PhysicalDeviceProperties
properties
=
physicalDevice
.
getProperties
();
...
...
@@ -201,15 +189,6 @@ namespace vkcv {
return
score
;
}
/// <summary>
/// Creates a candidate list of queues that all meet the desired flags and then creates the maximum possible number
/// of queues. If the number of desired queues is not sufficient, the remaining queues are created from the next
/// candidate from the list.
/// </summary>
/// <param name="physicalDevice">The physical device</param>
/// <param name="queueCount">The amount of queues to be created</param>
/// <param name="queueFlags">The abilities which have to be supported by any created queue</param>
/// <returns></returns>
std
::
vector
<
vk
::
DeviceQueueCreateInfo
>
Context
::
getQueueCreateInfos
(
vk
::
PhysicalDevice
&
physicalDevice
,
uint32_t
queueCount
,
std
::
vector
<
float
>
&
qPriorities
,
std
::
vector
<
vk
::
QueueFlagBits
>&
queueFlags
)
{
std
::
vector
<
vk
::
DeviceQueueCreateInfo
>
queueCreateInfos
;
std
::
vector
<
vk
::
QueueFamilyProperties
>
qFamilyProperties
=
physicalDevice
.
getQueueFamilyProperties
();
...
...
@@ -242,13 +221,6 @@ namespace vkcv {
return
queueCreateInfos
;
}
/// <summary>
/// With the help of the reference <paramref name="supported"> all elements in <paramref name="check"/> checked,
/// if they are supported by the physical device.
/// </summary>
/// <param name="supported">The reference that can be used to check <paramref name="check"/></param>
/// <param name="check">The elements to be checked</param>
/// <returns>True, if all elements in <param name="check"> are supported</returns>
bool
Context
::
checkSupport
(
std
::
vector
<
const
char
*>&
supported
,
std
::
vector
<
const
char
*>&
check
)
{
for
(
auto
checkElem
:
check
)
{
bool
found
=
false
;
...
...
@@ -264,10 +236,6 @@ namespace vkcv {
return
true
;
}
/// <summary>
/// Gets all extensions required, i.e. GLFW and advanced debug extensions.
/// </summary>
/// <returns>The required extensions</returns>
std
::
vector
<
const
char
*>
Context
::
getRequiredExtensions
()
{
uint32_t
glfwExtensionCount
=
0
;
const
char
**
glfwExtensions
=
glfwGetRequiredInstanceExtensions
(
&
glfwExtensionCount
);
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/Context.hpp
+
38
−
0
View file @
ca274cb3
...
...
@@ -31,10 +31,48 @@ namespace vkcv {
Context
&
operator
=
(
Context
&&
other
)
=
default
;
static
Context
create
(
const
char
*
applicationName
,
uint32_t
applicationVersion
,
uint32_t
queueCount
=
1
,
std
::
vector
<
vk
::
QueueFlagBits
>
queueFlags
=
{},
std
::
vector
<
const
char
*>
instanceExtensions
=
{},
std
::
vector
<
const
char
*>
deviceExtensions
=
{});
/**
* @brief With the help of the reference "supported" all elements in "check" checked,
* if they are supported by the physical device.
* @param supported The reference that can be used to check "check"
* @param check The elements to be checked
* @return True, if all elements in "check" are supported
*/
static
bool
checkSupport
(
std
::
vector
<
const
char
*>
&
supported
,
std
::
vector
<
const
char
*>
&
check
);
/**
* @brief Gets all extensions required, i.e. GLFW and advanced debug extensions.
* @return The required extensions
*/
static
std
::
vector
<
const
char
*>
getRequiredExtensions
();
/**
* @brief All existing physical devices will be evaluated by deviceScore.
* @param instance The instance
* @return The optimal physical device
* @see Context.deviceScore
*/
static
vk
::
PhysicalDevice
pickPhysicalDevice
(
vk
::
Instance
&
instance
);
/**
* @brief The physical device is evaluated by three categories:
* discrete GPU vs. integrated GPU, amount of queues and its abilities, and VRAM.physicalDevice.
* @param physicalDevice The physical device
* @return Device score as integer
*/
static
int
deviceScore
(
const
vk
::
PhysicalDevice
&
physicalDevice
);
/**
* @brief Creates a candidate list of queues that all meet the desired flags and then creates the maximum possible number
* of queues. If the number of desired queues is not sufficient, the remaining queues are created from the next
* candidate from the list.
* @param physicalDevice The physical device
* @param queueCount The amount of queues to be created
* @param qPriorities
* @param queueFlags The abilities which have to be supported by any created queue
* @return
*/
static
std
::
vector
<
vk
::
DeviceQueueCreateInfo
>
getQueueCreateInfos
(
vk
::
PhysicalDevice
&
physicalDevice
,
uint32_t
queueCount
,
std
::
vector
<
float
>&
qPriorities
,
std
::
vector
<
vk
::
QueueFlagBits
>
&
queueFlags
);
};
...
...
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