Skip to content

Commit 795de95

Browse files
committed
fix(macos): hardened runtime trigger on texture upload
1 parent e79e23a commit 795de95

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/UberShader.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,9 @@ UberShader::UberShader(RenderPass* renderPass, float ditherScale) {
486486
mShader->set_buffer("indices", VariableType::UInt32, {3 * 2}, indices);
487487
mShader->set_buffer("position", VariableType::Float32, {4, 2}, positions);
488488

489-
const auto& fcd = colormap::turbo();
489+
// Wrap in vector to ensure the memory is not in the app's const data segments. Hardened runtimes w/ code signing
490+
// would otherwise get tripped up if the texture upload happens via memory mapping, e.g. in Apple's unified archs.
491+
const auto fcd = vector(colormap::turbo().begin(), colormap::turbo().end());
490492
if (fcd.size() % 4 != 0) {
491493
throw runtime_error{fmt::format("Invalid false color data size. Expected multiple of 4, got {}.", fcd.size())};
492494
}

0 commit comments

Comments
 (0)