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
8eb02d10
Verified
Commit
8eb02d10
authored
3 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
[
#101
] Fix for MSVC
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
8f0e83dc
No related branches found
No related tags found
No related merge requests found
Pipeline
#26596
failed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
CMakeLists.txt
+1
-1
1 addition, 1 deletion
CMakeLists.txt
src/vkcv/FeatureManager.cpp
+11
-10
11 additions, 10 deletions
src/vkcv/FeatureManager.cpp
with
12 additions
and
11 deletions
CMakeLists.txt
+
1
−
1
View file @
8eb02d10
...
@@ -65,7 +65,7 @@ add_library(vkcv STATIC ${vkcv_sources})
...
@@ -65,7 +65,7 @@ add_library(vkcv STATIC ${vkcv_sources})
if
(
MSVC
)
if
(
MSVC
)
#enable multicore compilation on visual studio
#enable multicore compilation on visual studio
target_compile_options
(
vkcv PRIVATE
"/MP"
"/openmp"
)
target_compile_options
(
vkcv PRIVATE
"/MP"
"/openmp"
"/Zc:offsetof-"
)
#set source groups to create proper filters in visual studio
#set source groups to create proper filters in visual studio
source_group
(
TREE
${
CMAKE_CURRENT_SOURCE_DIR
}
FILES
${
vkcv_sources
}
)
source_group
(
TREE
${
CMAKE_CURRENT_SOURCE_DIR
}
FILES
${
vkcv_sources
}
)
...
...
This diff is collapsed.
Click to expand it.
src/vkcv/FeatureManager.cpp
+
11
−
10
View file @
8eb02d10
#include
"vkcv/FeatureManager.hpp"
#include
"vkcv/FeatureManager.hpp"
#include
<stddef.h>
#include
<string.h>
#include
<string.h>
namespace
vkcv
{
namespace
vkcv
{
...
@@ -11,16 +12,16 @@ vk::PhysicalDeviceFeatures2 query; \
...
@@ -11,16 +12,16 @@ vk::PhysicalDeviceFeatures2 query; \
query.setPNext(&supported); \
query.setPNext(&supported); \
m_physicalDevice.getFeatures2(&query)
m_physicalDevice.getFeatures2(&query)
#define vkcv_check_feature(attribute) { \
#define vkcv_check_feature(attribute) {
\
const char *f = reinterpret_cast<const char*>(&(features)); \
const char *f = reinterpret_cast<const char*>(&(features));
\
const char *s = reinterpret_cast<const char*>(&(supported)); \
const char *s = reinterpret_cast<const char*>(&(supported));
\
const vk::Bool32* fb = reinterpret_cast<const vk::Bool32*>(f + offsetof(typeof(features), attribute)); \
const vk::Bool32* fb = reinterpret_cast<const vk::Bool32*>(f + offsetof(typeof(
(
features)
)
, attribute)); \
const vk::Bool32* sb = reinterpret_cast<const vk::Bool32*>(s + offsetof(typeof(features), attribute)); \
const vk::Bool32* sb = reinterpret_cast<const vk::Bool32*>(s + offsetof(typeof(
(
features)
)
, attribute)); \
if ((*fb) && (!*sb)) { \
if ((*fb) && (!*sb)) {
\
vkcv_log(((required)? LogLevel::ERROR : LogLevel::WARNING), \
vkcv_log(((required)? LogLevel::ERROR : LogLevel::WARNING),
\
"Feature '" #attribute "' is not supported"); \
"Feature '" #attribute "' is not supported");
\
return false; \
return false;
\
} \
}
\
}
}
bool
FeatureManager
::
checkSupport
(
const
vk
::
PhysicalDevice16BitStorageFeatures
&
features
,
bool
required
)
const
{
bool
FeatureManager
::
checkSupport
(
const
vk
::
PhysicalDevice16BitStorageFeatures
&
features
,
bool
required
)
const
{
...
...
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