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
fb7653d8
Verified
Commit
fb7653d8
authored
3 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
[
#56
] Added missing check into first_mesh example
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
621fd545
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!45
Resolve "Szene-Repräsentation"
Pipeline
#26291
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
projects/first_mesh/src/main.cpp
+9
-7
9 additions, 7 deletions
projects/first_mesh/src/main.cpp
with
9 additions
and
7 deletions
projects/first_mesh/src/main.cpp
+
9
−
7
View file @
fb7653d8
...
@@ -34,9 +34,8 @@ int main(int argc, const char** argv) {
...
@@ -34,9 +34,8 @@ int main(int argc, const char** argv) {
if
(
result
==
1
)
{
if
(
result
==
1
)
{
std
::
cout
<<
"Mesh loading successful!"
<<
std
::
endl
;
std
::
cout
<<
"Mesh loading successful!"
<<
std
::
endl
;
}
}
else
{
else
{
std
::
cerr
<<
"Mesh loading failed: "
<<
result
<<
std
::
endl
;
std
::
cout
<<
"Mesh loading failed: "
<<
result
<<
std
::
endl
;
return
1
;
return
1
;
}
}
...
@@ -74,7 +73,7 @@ int main(int argc, const char** argv) {
...
@@ -74,7 +73,7 @@ int main(int argc, const char** argv) {
vkcv
::
PassHandle
firstMeshPass
=
core
.
createPass
(
firstMeshPassDefinition
);
vkcv
::
PassHandle
firstMeshPass
=
core
.
createPass
(
firstMeshPassDefinition
);
if
(
!
firstMeshPass
)
{
if
(
!
firstMeshPass
)
{
std
::
c
out
<<
"Error. Could not create renderpass. Exiting."
<<
std
::
endl
;
std
::
c
err
<<
"Error. Could not create renderpass. Exiting."
<<
std
::
endl
;
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
...
@@ -113,12 +112,15 @@ int main(int argc, const char** argv) {
...
@@ -113,12 +112,15 @@ int main(int argc, const char** argv) {
vkcv
::
PipelineHandle
firstMeshPipeline
=
core
.
createGraphicsPipeline
(
firstMeshPipelineConfig
);
vkcv
::
PipelineHandle
firstMeshPipeline
=
core
.
createGraphicsPipeline
(
firstMeshPipelineConfig
);
if
(
!
firstMeshPipeline
)
{
if
(
!
firstMeshPipeline
)
{
std
::
cout
<<
"Error. Could not create graphics pipeline. Exiting."
<<
std
::
endl
;
std
::
cerr
<<
"Error. Could not create graphics pipeline. Exiting."
<<
std
::
endl
;
return
EXIT_FAILURE
;
}
if
(
mesh
.
textures
.
empty
())
{
std
::
cerr
<<
"Error. No textures found. Exiting."
<<
std
::
endl
;
return
EXIT_FAILURE
;
return
EXIT_FAILURE
;
}
}
// FIXME There should be a test here to make sure there is at least 1
// texture in the mesh.
vkcv
::
asset
::
Texture
&
tex
=
mesh
.
textures
[
0
];
vkcv
::
asset
::
Texture
&
tex
=
mesh
.
textures
[
0
];
vkcv
::
Image
texture
=
core
.
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
tex
.
w
,
tex
.
h
);
vkcv
::
Image
texture
=
core
.
createImage
(
vk
::
Format
::
eR8G8B8A8Srgb
,
tex
.
w
,
tex
.
h
);
texture
.
fill
(
tex
.
data
.
data
());
texture
.
fill
(
tex
.
data
.
data
());
...
...
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