Formalize render object id contract

This commit is contained in:
2026-04-10 01:57:15 +08:00
parent 4debbbea1f
commit b5ba985831
12 changed files with 282 additions and 102 deletions

View File

@@ -134,7 +134,9 @@ PpmImage LoadPpmImage(const std::filesystem::path& path) {
}
std::array<uint8_t, 3> EncodeObjectIdToRgb(uint64_t objectId) {
const uint32_t encodedId = EncodeObjectIdToUInt32(objectId);
RenderObjectId renderObjectId = kInvalidRenderObjectId;
EXPECT_TRUE(TryConvertRuntimeObjectIdToRenderObjectId(objectId, renderObjectId));
const uint32_t encodedId = EncodeRenderObjectIdToUInt32(renderObjectId);
return {
static_cast<uint8_t>((encodedId >> 0u) & 0xFFu),
static_cast<uint8_t>((encodedId >> 8u) & 0xFFu),