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

Black renderbuffer and inconsistent 'Backface culled' under OpenGL #2972

Closed
Aaron1011 opened this issue Jul 2, 2023 · 3 comments
Closed
Labels
Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation

Comments

@Aaron1011
Copy link

Aaron1011 commented Jul 2, 2023

Description

I'm running the same application as in #2971, but targeting OpenGL (using the OpenGL backend of https://github.com/gfx-rs/wgpu). Every glDrawElementsInstanced call shows a completely black renderbuffer. However, the application runs properly under Renderdoc, and later events in the capture show a correctly-filled in renderbuffer.

Steps to reproduce

  1. Download this OpenGL capture file and open it in Renderdoc
  2. Navigate to EID 134: glDrawElementsInstanced(36, 1). You'll need to expand two 'Context3D render pass tabs'
  3. In the 'Texture Viewer tab', select the 'FB0' renderbuffer. Note that 'Highlight Drawcall' shows the entire texture highlighted, and 'Depth Test', 'Stencil Test', and 'Backface Cull' all highlight the entire texture in green. Also, 'Pipeline State' shows that both the depth and stencil states are set to 'Always'.
  4. Right click on any pixel in the renderbuffer, and click 'History'. Note that the 'EID 134' event shows 'Backface culled', despite the entire texture passing the backface test (in fact, I disabled backface culling entirely from OpenGL).

Environment

  • RenderDoc version: Local build, commit c328c3f
  • Operating System: Linux
  • Graphics API: OpenGL (NVIDIA GeForce RTX 3080 Ti)
@Zorro666 Zorro666 added Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation labels Jul 3, 2023
@Zorro666
Copy link
Collaborator

Zorro666 commented Jul 3, 2023

Hi there

Thank you for the report and capture.

Currently working to get a system setup (Linux + nVidia GPU) to be able to load and debug the capture.

It might take a couple of weeks before can investigate this issue.

Thank you in advance

@Zorro666
Copy link
Collaborator

Quick note to say so far have not been able to reproduce the pixel history issue. EID 134 is not included in the history. Continuing to debug the issue.

@Zorro666
Copy link
Collaborator

Hi there,

This is looking to be a GLES limitation and not a RenderDoc bug.
From the information in the capture the API being used is GLES (not proper GL) and it was made on an Intel GPU.
The black RenderBuffer in the Texture viewer is because it is an MSAA RenderBuffer and GLES does not support reading the unresolved pixel data. GLES limitations are also affecting the Pixel History.

Replaying the capture on nVidia GPU (Windows or Linux) shows the RenderBuffer data as expected (because the nVidia driver goes beyond the GLES specification).

Windows on nVidia
image

Linux on nVidia
image

This is the Linux command used to force GL to run on the nVidia GPU
__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia <PATH_TO_QRENDERDOC>

Potential solutions to explore in your application to overcome the GLES limitation are:

  • switch your application to use proper GL and not GLES API
  • switch your application to use non-MSAA RenderBuffer
  • switch your application to use Texture's instead of RenderBuffer's
  • replay the RenderDoc captures on an nVidia GPU

I have recreated the pixel history bug (on Linux only, on Windows it is working as expected) and will be investigating that, however it might turn out to be a GLES limitation

Pixel History : Windows + nVidia
image

Pixel History : Linux + nVidia
image

Zorro666 added a commit that referenced this issue Jul 23, 2023
GL_SAMPLES_PASSED is not supported by GLES.
The pixel history test is already using a 1x1 scissor test, GL_ANY_SAMPLES_PASSED should be the same as GL_SAMPLES_PASSED.
The pixel history logic is only testing for non-zero passing samples, the precise value is not used.
CamilliaX pushed a commit to CamilliaX/renderdoc that referenced this issue Aug 5, 2023
Allow a little latitude on expected line numbers in callstacks test

Protect against invalid socket data potentially causing crashes

Add test of Set*Root32BitConstants with 0 constants being set

* This crashes on nvidia, on compute only strangely, if we pass in a NULL
  pointer along with a 0 number of constants.

Expand NULL-protection for Set*Root32BitConstants

Don't allow tooltip to display if context menu is shown in shader viewer

Add "used" attribute to prevent exported symbol dead-stripping

Ideally would use "retain" but that would require upgrading to recent compilers in CI and the project.

__attribute__((retain)) function/variable to prevent linker garbage
collection.

Ensure image layout is up to date mid-command buffer in pixel history

* Previously we were obtaining the image layout from before the current command
  buffer was recorded, but this is out of date if the image layout has changed
  during the command buffer. Worst case it could be e.g. UNDEFINED if the image
  was created and not used until the current command buffer.

Add documentation for return type

Add missing documentation reference

Remove unimplemented function declarations

Add extra pings to reduce problems with unreasonably slow adb commands

Don't sanitise selected paths from remote hosts. Closes baldurk#3006

* If the remote host disconnects during the selection process we will no longer
  have a valid connection, we shouldn't sanitise the resulting path according to
  local filenames.

Tidy up and implement support for self capture on linux

Handle OpExecutionModeId in SPIR-V reflection

Bump version to v1.29

Handle non-square checkboxes : adjust to make them square

Extension of 7452e29

Change RenderDoc style checkboxes to use checks for low contrast themes

Include InidicatorCheckBox style to match style change in 7452e29

Vulkan PostVS ignore primmitive restart indexes when restart is active

Compute primitive restart using VulkanRenderState not pipeline, to account for dynamic state.
Ignore primitive restart indexes, handles primitive restart indexes being used when there are no active vertex buffer bindings

Fix branch specified in CI badge in README

Make gcc happier with escaped \\ in comments

Hide invalid shader resources

Fixed the problem that showing invalid shader resource in pipeline state viewer since v1.24

Revert "Hide invalid shader resources"

This reverts commit e62b6fa.

Hide invalid shader resources on D3D12

Change RenderDoc style checkboxes to use checks for low contrast themes

* Deliberately low contrast themes like the dark theme can have issues showing a
  box that is filled vs just a plain rectangle which is harder to read at a
  glance. Changing the fill to an X icon gives extra readability on the dark
  theme.

Fix capture comments styling of links

Remove explicit styling span in settings dialog, links style themselves

Ensure D3D12 barrier API is kept happy by matching access to layout

Fix disassembly for arrays of pointers having wrong type declaration

Account for arrays of pointers when calculating buffer offsets

Use correct size for basic types when calculating cbuffer sizes

avoid get color_read_* with depth format

Fix Android Vulkan capturing

Add __attribute__((visibility("default"))) to VK_LAYER_EXPORT on Android.
It used to be defined in the Vulkan headers and changed when the update to the latest Vulkan headers was integrated in 5118f08

GL Pixel History small code clean up in CalculateFragmentDepthTests

Move constant out of inner loop.
Remove if test for depth test being enabled and set the depth function to GL_ALWAYS if the depth test is disabled.

GL Pixel History set preMod.depth before call to QueryPostModPerFragment

Copy the postMod depth to next history's preMod depth.
The preMode depth is used to prime the depth buffer in QueryPostModPerFragment.

Use GL_ANY_SAMPLES_PASSED instead of GL_SAMPLES_PASSED Closes baldurk#2972

GL_SAMPLES_PASSED is not supported by GLES.
The pixel history test is already using a 1x1 scissor test, GL_ANY_SAMPLES_PASSED should be the same as GL_SAMPLES_PASSED.
The pixel history logic is only testing for non-zero passing samples, the precise value is not used.

Workaround nVidia crash in SetGraphicsRoot32BitConstants replay

When Num32BitValuesToSet = 0, set valid dummy pointer for pSrcData.
nVidia driver crashes if pSrcData is NULL.

Add Qt:WindowStaysOnTopHint to resource preview Closes baldurk#2971

Qt on Ubuntu 23.04 includes qt/qtbase@f9e4402ffe, which during show() under certain scenarios (for example Qt::ToolTip windows) would destroy and recreate the xcb window.

Adding Qt:WindowStaysOnTopHint to the window flags for ToolTip windows prevents the xcb window from being destroyed and recreated during show().

Vk tests ignore default pipeline in headless mode

Fixes crash trying to launch VK_Compute_Only

Use innertype id to look up image type. Closes baldurk#2970

Fixes incorrect shader debugging for ImageFetch operation on arrays on buffers (and certain scenarios of arrays of textures).

Set name on newly created named metadata. Closes baldurk#2981 (credit Yun)

Add missing ")" R11G11B10 GetBufferFormatString()

"[[packed(r11g11b10]] float3" -> "[[packed(r11g11b10)]] float3"

There was a missing ")"

Test null DSV in D3D12::GetRenderOutputSubresource

Prevents a crash when refreshing the overlay for am unbound Texture resource and the pipeline state does not have a bound DSV.

Related to 742e3de which changed the internal behaviour of FillResourceView().
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation
Projects
None yet
Development

No branches or pull requests

2 participants