Skip to content

Initial commit for SER Sakura Scene with toggle #919

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 14 commits into
base: master
Choose a base branch
from

Conversation

chauvuha
Copy link

@chauvuha chauvuha commented Jul 3, 2025

Implemented a more diverse scene that demonstrates the integration of Shader Execution Reordering (SER) to showcase performance gains:

  • Included more varied materials: materialID == 1 triggers reflection rays, materialID == 2 and 3 sample from textures, and materialID == 0 uses a plain color.
  • Separated closesthit shader for each material.
  • Added three SER toggles: sort by HitObject, sort by materialID (from the shader table), and a combined mode using both.
  • Toggle 'R' to turn on/off camera rotation (Note: Turn off rotation for better perf difference).

@chauvuha chauvuha requested a review from Copilot July 7, 2025 17:48
@chauvuha chauvuha assigned chauvuha and unassigned chauvuha Jul 7, 2025
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR introduces a new D3D12 Raytracing sample (“Sakura Scene”) demonstrating Shader Execution Reordering (SER) with multiple materials and toggleable sorting modes.

  • Adds a complete sample project (headers, source, shaders, build files) for the SER-enabled Sakura scene
  • Enhances HLSL raygen and closest-hit shaders to separate materials and apply SER based on HitObject, materialID, or both
  • Provides README updates with controls and usage instructions

Reviewed Changes

Copilot reviewed 26 out of 33 changed files in this pull request and generated no comments.

File Description
stdafx.h New precompiled header pulling in core and D3D12 dependencies for the sample
Raytracing.hlsl Implements SER toggles and per-material closest-hit shaders for diverse materials
readme.md Documents sample usage, UI controls, and command-line options
Comments suppressed due to low confidence (4)

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraScene/readme.md:22

  • Add a line for the 'R' key since the sample description mentions toggling camera rotation (e.g., * R - toggles camera rotation on/off.).
* S - toggles shader execution reordering on/off.

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraScene/D3D12RaytracingSakuraScene.h:115

  • [nitpick] Member variable m_ObjModelLoader uses an uppercase ‘O’ after the prefix; consider m_objModelLoader for consistency with other m_ members.
    ObjModelLoader m_ObjModelLoader;

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraScene/D3D12RaytracingSakuraScene.h:157

  • [nitpick] The prefix tcube is inconsistent with transparentCube; consider renaming to c_transparentCubeClosestHitShaderName to match the hit-group constant.
    static const wchar_t* c_tcubeClosestHitShaderName;

Samples/Desktop/D3D12Raytracing/src/D3D12RaytracingSakuraScene/D3D12RaytracingSakuraScene.vcxproj.filters:62

  • The project references CheckCast.h but this header is not added in the diff; remove the reference or include the missing file to avoid build errors.
    <ClInclude Include="CheckCast.h" />

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants