Skip to content

Commit

Permalink
Fix IMGUI Demo with HDR10 (#997)
Browse files Browse the repository at this point in the history
IMGUI leaves the scissor in a random state.  This messes up the color normalization in HDR10, where the scissor needs to include the whole viewport.  Restore the scissor after IMGUI is done drawing stuff.
  • Loading branch information
dwsJason authored Dec 28, 2024
1 parent b78e42e commit 2a4bb4b
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions Samples/Example_ImGui_Docking/Example_ImGui_Docking.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,17 @@ void Example_ImGui::Compose(wi::graphics::CommandList cmd)
vertexOffset += drawList->VtxBuffer.size();
}

// Restore Scissor
{
Rect scissor;
scissor.left = 0;
scissor.top = 0;
scissor.right = (int32_t)viewport.width;
scissor.bottom = (int32_t)viewport.height;
device->BindScissorRects(1, &scissor, cmd);

}

//// Update and Render additional Platform Windows
//if (io.ConfigFlags & ImGuiConfigFlags_ViewportsEnable)
//{
Expand Down

0 comments on commit 2a4bb4b

Please sign in to comment.