Skip to content
Snippets Groups Projects
Commit c1ab7800 authored by Trevor Hollmann's avatar Trevor Hollmann
Browse files

[#79] Add doc about hardcoded addressModeW in Sampler.

parent b3ec2867
No related branches found
No related tags found
1 merge request!69Resolve "Rework Asset Loader API"
Pipeline #26265 passed
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment