Skip to content

Commit

Permalink
Remove MeshoptCompressionMode::None, specify Bistro test path
Browse files Browse the repository at this point in the history
  • Loading branch information
spnda committed Jan 26, 2024
1 parent b6d282d commit aa2e6d4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 17 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ tests/gltf/intel_sponza/
tests/gltf/glTF-Sample-Models/
tests/gltf/good-froge/
tests/gltf/deccer-cubes/
tests/gltf/bistro/
tests/gltf_loaders/

# gltf Rust wrapper
Expand Down
18 changes: 9 additions & 9 deletions examples/gl_viewer/gl_viewer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ bool checkGlLinkErrors(GLuint target) {
}

struct IndirectDrawCommand {
uint32_t count;
uint32_t instanceCount;
uint32_t firstIndex;
int32_t baseVertex;
uint32_t baseInstance;
std::uint32_t count;
std::uint32_t instanceCount;
std::uint32_t firstIndex;
std::int32_t baseVertex;
std::uint32_t baseInstance;
};

struct Primitive {
Expand All @@ -153,15 +153,15 @@ struct Texture {
GLuint texture;
};

enum MaterialUniformFlags : uint32_t {
enum MaterialUniformFlags : std::uint32_t {
None = 0 << 0,
HasBaseColorTexture = 1 << 0,
};

struct MaterialUniforms {
glm::fvec4 baseColorFactor;
float alphaCutoff;
uint32_t flags;
std::uint32_t flags;
};

struct Viewer {
Expand Down Expand Up @@ -434,10 +434,10 @@ bool loadMesh(Viewer* viewer, fastgltf::Mesh& mesh) {
auto& indices = asset.accessors[it->indicesAccessor.value()];
if (!indices.bufferViewIndex.has_value())
return false;
draw.count = static_cast<uint32_t>(indices.count);
draw.count = static_cast<std::uint32_t>(indices.count);

auto& indicesView = asset.bufferViews[indices.bufferViewIndex.value()];
draw.firstIndex = static_cast<uint32_t>(indices.byteOffset + indicesView.byteOffset) / fastgltf::getElementByteSize(indices.type, indices.componentType);
draw.firstIndex = static_cast<std::uint32_t>(indices.byteOffset + indicesView.byteOffset) / fastgltf::getElementByteSize(indices.type, indices.componentType);
primitive.indexType = getGLComponentType(indices.componentType);
glVertexArrayElementBuffer(vao, viewer->buffers[indicesView.bufferIndex]);
}
Expand Down
4 changes: 2 additions & 2 deletions include/fastgltf/parser.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -308,9 +308,9 @@ namespace fastgltf {
// value used for enabling/disabling the loading of it. This also represents all extensions that
// fastgltf supports and understands.
#if FASTGLTF_ENABLE_DEPRECATED_EXT
static constexpr size_t SUPPORTED_EXTENSION_COUNT = 21;
static constexpr std::size_t SUPPORTED_EXTENSION_COUNT = 21;
#else
static constexpr size_t SUPPORTED_EXTENSION_COUNT = 20;
static constexpr std::size_t SUPPORTED_EXTENSION_COUNT = 20;
#endif
static constexpr std::array<std::pair<std::string_view, Extensions>, SUPPORTED_EXTENSION_COUNT> extensionStrings = {{
{ extensions::EXT_mesh_gpu_instancing, Extensions::EXT_mesh_gpu_instancing },
Expand Down
1 change: 0 additions & 1 deletion include/fastgltf/types.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,6 @@ namespace fastgltf {
};

enum class MeshoptCompressionMode : std::uint8_t {
None = 0,
Attributes,
Triangles,
Indices,
Expand Down
2 changes: 1 addition & 1 deletion src/base64.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ namespace fastgltf::base64 {
}

// clang-format off
[[gnu::aligned(16)]] static constexpr std::array<uint8_t, 16> shuffleData = {
[[gnu::aligned(16)]] static constexpr std::array<std::uint8_t, 16> shuffleData = {
2, 1, 0,
6, 5, 4,
10, 9, 8,
Expand Down
4 changes: 1 addition & 3 deletions src/fastgltf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ void fg::URIView::parse() {
return;
}

size_t idx = 0;
std::size_t idx = 0;
auto firstColon = view.find(':');
if (firstColon != std::string::npos) {
// URI has a scheme.
Expand Down Expand Up @@ -838,8 +838,6 @@ fg::Error fg::validate(const fastgltf::Asset& asset) {
if (compression->byteStride != 2 && compression->byteStride != 4)
return Error::InvalidGltf;
break;
case MeshoptCompressionMode::None:
break;
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/gltf_path.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
inline auto path = std::filesystem::path { __FILE__ }.parent_path() / "gltf";
inline auto sampleModels = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "glTF-Sample-Models";
inline auto intelSponza = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "intel_sponza";
inline auto bistroPath = std::filesystem::path {};
inline auto bistroPath = std::filesystem::path { __FILE__ }.parent_path() / "gltf" / "bistro";

0 comments on commit aa2e6d4

Please sign in to comment.