Skip to content
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

DRAW_EMPTY_SCISSOR_RECTANGLE warnings and example_win32_directx12.exe crash #4775

Closed
MichaelKv opened this issue Nov 30, 2021 · 1 comment
Closed

Comments

@MichaelKv
Copy link

Hello,
From imgui.h
// Version
// (Integer encoded as XYYZZ for use in #if preprocessor conditionals. Work in progress versions typically starts at XYY99 then bounce up to XYY00, XYY01 etc. when release tagging happens)
#define IMGUI_VERSION "1.86 WIP"
#define IMGUI_VERSION_NUM 18510
#define IMGUI_CHECKVERSION() ImGui::DebugCheckVersionAndDataLayout(IMGUI_VERSION, sizeof(ImGuiIO), sizeof(ImGuiStyle), sizeof(ImVec2), sizeof(ImVec4), sizeof(ImDrawVert), sizeof(ImDrawIdx))
#define IMGUI_HAS_TABLE
OS: Windows 2016 Server, x64
Compiler: Microsoft (R) C/C++ Optimizing Compiler Version 19.29.30136 for x64

I have a lot of problems with DRAW_EMPTY_SCISSOR_RECTANGLE warning in ImPlot (it makes Visual Studio Output Window totally unusable) so I have decided to reproduce the problem with ImGUI official demo. But instead of zillions of DRAW_EMPTY_SCISSOR_RECTANGLE messages example_win32_directx12.exe just crashes when I run it under the VS debugger. The last VS Output Window content is as following:

D3D12 WARNING: ID3D12CommandList::DrawIndexedInstanced: Viewport: 0 is non-empty while the corresponding scissor rectangle is empty. Nothing will be written to the render target when this viewport is selected. In D3D12, scissor testing is always enabled. [ EXECUTION WARNING #695: DRAW_EMPTY_SCISSOR_RECTANGLE]
D3D12: BREAK enabled for the previous message, which was: [ WARNING EXECUTION #695: DRAW_EMPTY_SCISSOR_RECTANGLE ]
Exception thrown at 0x00007FFD6B7D4F38 (KernelBase.dll) in example_win32_directx12.exe: 0x0000087A (parameters: 0x0000000000000002, 0x000000800D13B3D8, 0x000000800D13D2D0).
Unhandled exception at 0x00007FFD6B7D4F38 (KernelBase.dll) in example_win32_directx12.exe: 0x0000087A (parameters: 0x0000000000000002, 0x000000800D13B3D8, 0x000000800D13D2D0).

The steps to reproduce the problem are as following:

  1. run imgui_examples.sln
  2. select example_win32_directx12 as the startup item
  3. select x64/Debug configuration
  4. run it (F5).
  5. select the “Dear ImGui Demo” window
  6. open as many items as you can to make the vertical scroll bar to appear and make sure the plotting item is expanded and some graphics run
  7. begin to scroll the area back and forth (probably unnecessary but it leads to a lot of DRAW_EMPTY_SCISSOR_RECTANGLE warnings in the VS Output window for ImPlot, no crash)
  8. begin to resize the height of the “Dear ImGui Demo” window from the minimal possible size to some extent (rather quickly). No more than ten rather quick resizings will lead to the crash as above.

Please, notice that if you do not expand some tree-items to make the right scrollbar to appear than ImGui will likely survive the manipulations.
Additional question: is it possible to fix the situation by choosing another backend? I need the most reliable solution for Windows x64.
Thank you in advance.

ocornut added a commit that referenced this issue Nov 30, 2021
…kend would warn about it (others not so much). (#4775, #4464)

Amend/fix 2b0bd40
@ocornut
Copy link
Owner

ocornut commented Nov 30, 2021

Thanks for reporting this. This is a bug partly caused by 2b0bd40, now pushed a fix 440824d !
AFAIK only DX12 warns in this situation, but it is sane to make the same change for all back-end.

But specifically, the bug would not generally manifest as often before more recently, we made some fix for navigation leading to the current navigated item not being clipped: here you can see an arrow in the clipped area (where the draw cmd would normally be culled):
image

This is because we currently conflate clipping for logic and clipping for render, which we will change later.

@ocornut ocornut closed this as completed Nov 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants