Fix crash on unsupported attribute type conversion (#3066)

This commit is contained in:
Tim Sylvester
2024-12-04 12:57:22 -08:00
committed by GitHub
parent 61d385bd63
commit 112edb66ad
2 changed files with 4 additions and 2 deletions

View File

@@ -271,7 +271,9 @@ gfx::AttributeBindingArray UploadPass::buildAttributeBindings(
return;
}
overrideAttr->setDirty(false);
if (overrideAttr) {
overrideAttr->setDirty(false);
}
bindings[index] = {
/*.attribute = */ {defaultAttr.getDataType(), offset},

View File

@@ -169,7 +169,7 @@ const std::vector<std::uint8_t>& VertexAttributeGL::getRaw(gfx::VertexAttribute&
for (std::size_t i = 0; i < count; ++i) {
if (!get(attr.get(i), type, outPtr)) {
// missing type conversion
assert(false);
std::fill(outPtr, outPtr + stride_, 0);
}
outPtr += stride_;
}