| 241 | } |
| 242 | |
| 243 | Status Runtime::AllocateInternalObject(const Object& object) { |
| 244 | const ObjectRef ref = GetRef(object); |
| 245 | switch (object.object_type) { |
| 246 | case ObjectType::BUFFER: { |
| 247 | GlBuffer gl_buffer; |
| 248 | RETURN_IF_ERROR(CreateReadWriteShaderStorageBuffer<uint8_t>( |
| 249 | ByteSizeOf(object), &gl_buffer)); |
| 250 | RETURN_IF_ERROR( |
| 251 | internal_objects_.RegisterBuffer(ref, std::move(gl_buffer))); |
| 252 | break; |
| 253 | } |
| 254 | case ObjectType::TEXTURE: { |
| 255 | GlTexture gl_texture; |
| 256 | RETURN_IF_ERROR(MakeGlTextureRef(object, &gl_texture)); |
| 257 | RETURN_IF_ERROR( |
| 258 | internal_objects_.RegisterTexture(ref, std::move(gl_texture))); |
| 259 | break; |
| 260 | } |
| 261 | default: |
| 262 | return InternalError("Unexpected internal object type"); |
| 263 | } |
| 264 | return OkStatus(); |
| 265 | } |
| 266 | |
| 267 | Status Runtime::AllocateConstObject(const Object& object, uint32_t* id) { |
| 268 | const ObjectData* data = GetData(object); |
nothing calls this directly
no test coverage detected