Skip to content

Instantly share code, notes, and snippets.

@jherico
Created September 9, 2019 21:43
Show Gist options
  • Save jherico/fc53179448cd54514d304f5be5db9ab4 to your computer and use it in GitHub Desktop.
Save jherico/fc53179448cd54514d304f5be5db9ab4 to your computer and use it in GitHub Desktop.
case Accessor::Type::eSCALAR:
switch (componentType) {
case Accessor::ComponentType::eBYTE:
return normalized ? vk::Format::eR8Snorm : vk::Format::eR8Sint;
case Accessor::ComponentType::eUNSIGNED_BYTE:
return normalized ? vk::Format::eR8Unorm : vk::Format::eR8Uint;
case Accessor::ComponentType::eSHORT:
return normalized ? vk::Format::eR16Snorm : vk::Format::eR16Sint;
case Accessor::ComponentType::eUNSIGNED_SHORT:
return normalized ? vk::Format::eR16Unorm : vk::Format::eR16Uint;
case Accessor::ComponentType::eFLOAT:
return vk::Format::eR32Sfloat;
case Accessor::ComponentType::eUNSIGNED_INT:
default:
throw std::runtime_error("Invalid accessor for vertex data");
}
case Accessor::Type::eVEC2:
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment