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
c1ab7800
Commit
c1ab7800
authored
3 years ago
by
Trevor Hollmann
Browse files
Options
Downloads
Patches
Plain Diff
[
#79
] Add doc about hardcoded addressModeW in Sampler.
parent
b3ec2867
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!69
Resolve "Rework Asset Loader API"
Pipeline
#26265
passed
3 years ago
Stage: build
Stage: deploy
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+9
-5
9 additions, 5 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.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
11 additions
and
8 deletions
modules/asset_loader/include/vkcv/asset/asset_loader.hpp
+
9
−
5
View file @
c1ab7800
...
...
@@ -61,11 +61,15 @@ enum class PrimitiveMode : uint8_t {
/** The indices in the index buffer can be of different bit width. */
enum
class
IndexType
:
uint8_t
{
UNDEFINED
=
0
,
UINT8
=
1
,
UINT16
=
2
,
UINT32
=
3
};
/* NOTE: glTF defines samplers based on OpenGL, which can not be
* directly translated to Vulkan. The vkcv::asset::Sampler struct defined here
* adheres to the Vulkan spec, having alerady translated the flags from glTF to
* Vulkan. All values here can directly be passed to VkSamplerCreateInfo.
* */
/**
* This struct defines a sampler for a texture object. All values here can
* directly be passed to VkSamplerCreateInfo.
* NOTE that glTF defines samplers based on OpenGL, which can not be directly
* translated to Vulkan. The vkcv::asset::Sampler struct defined here adheres
* to the Vulkan spec, having alerady translated the flags from glTF to Vulkan.
* Since glTF does not specify border sampling for more than two dimensions,
* the addressModeW is hardcoded to a default: VK_SAMPLER_ADDRESS_MODE_REPEAT.
*/
typedef
struct
{
int
minFilter
,
magFilter
;
int
mipmapMode
;
...
...
This diff is collapsed.
Click to expand it.
modules/asset_loader/src/vkcv/asset/asset_loader.cpp
+
2
−
3
View file @
c1ab7800
...
...
@@ -350,9 +350,8 @@ int translateSampler(const fx::gltf::Sampler &src, vkcv::asset::Sampler &dst)
dst
.
addressModeU
=
translateSamplerMode
(
src
.
wrapS
);
dst
.
addressModeV
=
translateSamplerMode
(
src
.
wrapT
);
// TODO There is no information about wrapping for a third axis in
// glTF... what's a good heuristic we can use to set addressModeW?
// The following hardocded solution is only a temporary hack.
// There is no information about wrapping for a third axis in glTF and
// we have to hardcode this value.
dst
.
addressModeW
=
VK_SAMPLER_ADDRESS_MODE_REPEAT
;
return
ASSET_SUCCESS
;
...
...
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