Vulkan RTX: r_rtx mode visualization + auto vk_rtx_demo_spirv.inc#178
Vulkan RTX: r_rtx mode visualization + auto vk_rtx_demo_spirv.inc#178
Conversation
- Pass latched r_rtx (1-3) in frame UBO outputSize.z; rchit shades by mode (1=darken, 2=cool, 3=warm) for demo visualization - Descriptor: binding 2 UBO visible to raygen + closest hit - compile_shaders.sh: emit vk_rtx_demo_spirv.inc from RTX SPIR-V (PROJECT_ROOT) - Regenerate shader_data and embedded RTX modules; update RENDERERS_FUTURE Co-authored-by: Tim Fox <timfox@outlook.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 22b9f3b0d5
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| out_path.write_text("\n".join(lines) + "\n", encoding="utf-8") | ||
| print(f"Wrote {out_path}") | ||
|
|
||
| write_vk_rtx_demo_spirv_inc() |
There was a problem hiding this comment.
Gate vk_rtx_demo_spirv.inc writes behind apply mode
compile_shaders.sh now always rewrites src/renderers/vulkan/vk_rtx_demo_spirv.inc even when called in generation-only mode, so invocations that intentionally avoid touching tracked sources (for example the CMake custom command and scripts/validate_ci_build.sh, both of which run without --apply) will still dirty the working tree and can fail in read-only source checkouts. This bypasses the existing --generated-dir/--apply workflow and should be gated so source-tree updates only happen in an explicit apply step.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Stale comment
Security review complete: I found no high-confidence medium, high, or critical vulnerabilities introduced by this PR.
I also checked the existing unresolved automation thread; it is a build/workflow issue rather than a security finding, so there is no prior security finding to re-report.
Sent by Cursor Automation: Find vulnerabilities
There was a problem hiding this comment.
Security review complete for PR #178.
No high-confidence medium, high, or critical vulnerabilities were identified in the added or modified code. I also checked the existing unresolved automation thread and it appears to be a build/workflow concern rather than a security finding, so I did not re-report it as a vulnerability.
Sent by Cursor Automation: Find vulnerabilities


Summary
Advances the Vulkan KHR RTX demo path toward the documented
r_rtxmodes (1=shadows, 2=reflections, 3=full) by visualizing mode in the closest-hit shader, wiring the frame UBO to closest-hit, and automating regeneration ofvk_rtx_demo_spirv.inc.Technical changes
VkRtxFrameUBO:outputSize.zcarries clampedr_rtx(0–3) each frame; documented in struct comment.vk_rtx_init: descriptor binding 2 (uniform buffer) stage flags = raygen | closest hit.rtx_demo.rchit: readsrtx.outputSize.z; tints base albedo by mode (1 darker, 2 cool blue mix, 3 warm accent). Mode 0 keeps legacy flat grey.rtx_demo.rgen: comment only (UBO layout unchanged size-wise).scripts/compile_shaders.sh: after compiling RTX stages, writessrc/renderers/vulkan/vk_rtx_demo_spirv.incwith correctVK_RTX_DEMO_*_SPV_SIZEmacros (PROJECT_ROOTexport).shader_data.c,shader_build_meta.txt, andvk_rtx_demo_spirv.incvia./scripts/compile_shaders.sh --apply.Docs
docs/RENDERERS_FUTURE.md— RTX table row updated.CHANGELOG.md— [Unreleased] → Added.Validation
./scripts/compile_engine.sh vulkan(recompiles shaders; smoke path OK)ctest -R smoke_testcmake -B build-rtx-Release -DUSE_VULKAN_RTX=ON+ buildidtech3_vulkan_x86(RTX defines compile)Notes
This is visualization scaffolding for
r_rtxpresets on the existing single-hit demo; true shadows/reflections/full RT still require additional pipelines / secondary rays / integration perRENDERERS_FUTURE.md.