Skip to content

Commit 6dc4817

Browse files
avivianavivian
andcommitted
chore(recorder): enable scripted Canvas + Ore in the GPU recorder (#12430) 66b9d31e8f
* Chore: Compile gpu recorder with rive canvas * Premake fixes * Build ore context * shder * logging * drawCanvas * canvas debug * More debugging * endQueue fix * Revert logging * Revert changes * Fix PR breaks Co-authored-by: Arthur Vivian <arthur@rive.app>
1 parent ea7277b commit 6dc4817

2 files changed

Lines changed: 21 additions & 7 deletions

File tree

.rive_head

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
13be041786e7811cffc3d5a7a474357619625536
1+
66b9d31e8ff505fe8c9800e865e933a452abc5b4

src/lua/renderer/lua_gpu.cpp

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -430,16 +430,30 @@ static Context* getOreContext(lua_State* L)
430430
static_cast<ScriptingContext*>(lua_getthreaddata(L))->oreContext());
431431
}
432432

433-
/// Returns the ShaderTarget byte that matches the active platform/backend.
434-
/// Mirrors the platform selection logic in wgslCompileForBackend().
433+
/// Returns the RSTB `ShaderTarget` byte that matches the ore backend
434+
/// compiled into this build. Dispatches on `ORE_BACKEND_*` rather than
435+
/// host-OS macros (`__APPLE__` / `_WIN32`) so hosts whose backend doesn't
436+
/// match the host's "default" runtime API — e.g. the Linux GPU recorder
437+
/// (Vulkan, not GL) or Mac MoltenVK — pick the correct pre-compiled
438+
/// variant out of the RSTB table.
439+
///
440+
/// Target enum (must match `ShaderAsset` RSTB format):
441+
/// 0 = WGSL passthrough, 1 = GLSL ES3, 2 = MSL, 3 = HLSL SM5,
442+
/// 5 = SPIR-V
435443
static uint8_t currentShaderTarget()
436444
{
437-
#if defined(__APPLE__)
445+
#if defined(ORE_BACKEND_METAL)
438446
return 2; // MSL
439-
#elif defined(_WIN32)
440-
return 3; // HLSL SM5, compiled to DXBC at runtime (D3D11/D3D12)
447+
#elif defined(ORE_BACKEND_VK)
448+
return 5; // SPIR-V
449+
#elif defined(ORE_BACKEND_D3D11) || defined(ORE_BACKEND_D3D12)
450+
return 3; // HLSL SM5, compiled to DXBC at runtime via D3DCompile
451+
#elif defined(ORE_BACKEND_WGPU)
452+
return 0; // WGSL passthrough (Dawn + wagyu)
453+
#elif defined(ORE_BACKEND_GL)
454+
return 1; // GLSL ES3
441455
#else
442-
return 1; // GLSL ES3 (Android / Linux OpenGL / Web via wagyu)
456+
return 1;
443457
#endif
444458
}
445459

0 commit comments

Comments
 (0)