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
f85a24e3
Verified
Commit
f85a24e3
authored
3 years ago
by
Tobias Frisch
Browse files
Options
Downloads
Patches
Plain Diff
[
#79
] Fix for stride zero
Signed-off-by:
Tobias Frisch
<
tfrisch@uni-koblenz.de
>
parent
74a935a9
Branches
Branches containing commit
Tags
Tags containing commit
1 merge request
!69
Resolve "Rework Asset Loader API"
Pipeline
#26459
passed
3 years ago
Stage: build
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+22
-1
22 additions, 1 deletion
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
with
22 additions
and
1 deletion
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
22
−
1
View file @
f85a24e3
...
...
@@ -32,7 +32,7 @@ namespace vkcv::asset {
* @param type The accessor type
* @return An unsigned integer count
*/
static
uint
8
_t
getComponentCount
(
const
fx
::
gltf
::
Accessor
::
Type
type
)
{
static
uint
32
_t
getComponentCount
(
const
fx
::
gltf
::
Accessor
::
Type
type
)
{
switch
(
type
)
{
case
fx
::
gltf
::
Accessor
::
Type
::
Scalar
:
return
1
;
...
...
@@ -52,6 +52,22 @@ namespace vkcv::asset {
return
0
;
}
}
static
uint32_t
getComponentSize
(
ComponentType
type
)
{
switch
(
type
)
{
case
ComponentType
::
INT8
:
case
ComponentType
::
UINT8
:
return
1
;
case
ComponentType
::
INT16
:
case
ComponentType
::
UINT16
:
return
2
;
case
ComponentType
::
UINT32
:
case
ComponentType
::
FLOAT32
:
return
4
;
default:
return
0
;
}
}
/**
* Translate the component type used in the index accessor of fx-gltf to our
...
...
@@ -124,6 +140,11 @@ namespace vkcv::asset {
att
.
stride
=
buf
.
byteStride
;
att
.
componentType
=
static_cast
<
ComponentType
>
(
accessor
.
componentType
);
att
.
componentCount
=
getComponentCount
(
accessor
.
type
);
/* Assume tightly packed stride as not explicitly provided */
if
(
att
.
stride
==
0
)
{
att
.
stride
=
att
.
componentCount
*
getComponentSize
(
att
.
componentType
);
}
}
if
((
att
.
type
==
PrimitiveType
::
UNDEFINED
)
||
...
...
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