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
9c61a205
Commit
9c61a205
authored
3 years ago
by
Trevor Hollmann
Browse files
Options
Downloads
Patches
Plain Diff
[
#63
] Use newly defined component types instead of uint16.
parent
e006dbe6
No related branches found
No related tags found
1 merge request
!51
Resolve "Laden mehrer Meshes mit Materials und Textures"
Pipeline
#25477
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/vkcv/VertexLayout.hpp
+3
-3
3 additions, 3 deletions
include/vkcv/VertexLayout.hpp
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+2
-3
2 additions, 3 deletions
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
with
5 additions
and
6 deletions
include/vkcv/VertexLayout.hpp
+
3
−
3
View file @
9c61a205
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
#include
<vector>
#include
<vector>
#include
<iostream>
#include
<iostream>
namespace
vkcv
{
namespace
vkcv
{
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
/* With these enums, 0 is reserved to signal uninitialized or invalid data. */
enum
class
PrimitiveType
:
uint32_t
{
enum
class
PrimitiveType
:
uint32_t
{
...
@@ -19,7 +19,7 @@ enum class PrimitiveType : uint32_t {
...
@@ -19,7 +19,7 @@ enum class PrimitiveType : uint32_t {
* convenience (easier to read in if/switch statements etc). While this enum
* convenience (easier to read in if/switch statements etc). While this enum
* exists in (almost) the same definition in the fx-gltf library, we want to
* exists in (almost) the same definition in the fx-gltf library, we want to
* avoid exposing that dependency, thus it is re-defined here. */
* avoid exposing that dependency, thus it is re-defined here. */
enum
class
Vertex
ComponentType
:
uint16_t
{
enum
class
ComponentType
:
uint16_t
{
NONE
=
0
,
INT8
=
5120
,
UINT8
=
5121
,
INT16
=
5122
,
UINT16
=
5123
,
NONE
=
0
,
INT8
=
5120
,
UINT8
=
5121
,
INT16
=
5122
,
UINT16
=
5123
,
UINT32
=
5125
,
FLOAT32
=
5126
UINT32
=
5125
,
FLOAT32
=
5126
};
};
...
@@ -30,7 +30,7 @@ typedef struct {
...
@@ -30,7 +30,7 @@ typedef struct {
uint32_t
offset
;
// offset in bytes
uint32_t
offset
;
// offset in bytes
uint32_t
length
;
// length of ... in bytes
uint32_t
length
;
// length of ... in bytes
uint32_t
stride
;
// stride in bytes
uint32_t
stride
;
// stride in bytes
uint16_t
componentType
;
// eg. 5126 for float
ComponentType
componentType
;
// eg. 5126 for float
uint8_t
componentCount
;
// eg. 3 for vec3
uint8_t
componentCount
;
// eg. 3 for vec3
}
VertexAttribute
;
}
VertexAttribute
;
...
...
This diff is collapsed.
Click to expand it.
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
2
−
3
View file @
9c61a205
...
@@ -118,7 +118,7 @@ int loadMesh(const std::string &path, Mesh &mesh) {
...
@@ -118,7 +118,7 @@ int loadMesh(const std::string &path, Mesh &mesh) {
attribute
.
offset
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteOffset
;
attribute
.
offset
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteOffset
;
attribute
.
length
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteLength
;
attribute
.
length
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteLength
;
attribute
.
stride
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteStride
;
attribute
.
stride
=
object
.
bufferViews
[
accessor
.
bufferView
].
byteStride
;
attribute
.
componentType
=
static_cast
<
uint16_t
>
(
accessor
.
componentType
);
attribute
.
componentType
=
static_cast
<
ComponentType
>
(
accessor
.
componentType
);
if
(
convertTypeToInt
(
accessor
.
type
)
!=
10
)
{
if
(
convertTypeToInt
(
accessor
.
type
)
!=
10
)
{
attribute
.
componentCount
=
convertTypeToInt
(
accessor
.
type
);
attribute
.
componentCount
=
convertTypeToInt
(
accessor
.
type
);
...
@@ -304,8 +304,7 @@ int loadScene(const std::string &path, Scene &scene){
...
@@ -304,8 +304,7 @@ int loadScene(const std::string &path, Scene &scene){
attribute
.
offset
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteOffset
;
attribute
.
offset
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteOffset
;
attribute
.
length
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteLength
;
attribute
.
length
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteLength
;
attribute
.
stride
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteStride
;
attribute
.
stride
=
sceneObjects
.
bufferViews
[
accessor
.
bufferView
].
byteStride
;
// TODO use enums instead of only integer representation for types (defined in VertexLayout.hpp)
attribute
.
componentType
=
static_cast
<
ComponentType
>
(
accessor
.
componentType
);
attribute
.
componentType
=
static_cast
<
uint16_t
>
(
accessor
.
componentType
);
if
(
convertTypeToInt
(
accessor
.
type
)
!=
10
)
{
if
(
convertTypeToInt
(
accessor
.
type
)
!=
10
)
{
attribute
.
componentCount
=
convertTypeToInt
(
accessor
.
type
);
attribute
.
componentCount
=
convertTypeToInt
(
accessor
.
type
);
...
...
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