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

Unable to debug a shared R32UI / RGBE9995 texture in any way #3148

Closed
reduz opened this issue Nov 26, 2023 · 4 comments
Closed

Unable to debug a shared R32UI / RGBE9995 texture in any way #3148

reduz opened this issue Nov 26, 2023 · 4 comments
Labels
Bug A crash, misbehaviour, or other problem Need More Info More information is needed from a user to work on this issue

Comments

@reduz
Copy link

reduz commented Nov 26, 2023

Description

Renderdoc is unable to debug a texture in certain circumstances where I believe should be possible to.

The texture is created R32UI but it has a view into E5B9G9R9_UFLOAT_PACK32 (via VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT)

  • Trying to see the texture as E5B9G9R9_UFLOAT_PACK32 is futile, RenderDoc only wants to show it as R32UI even though it knows the view exists.
  • Trying to write a custom shader to view this texture as RGBE fails, the shader displays black no matter what.

Steps to reproduce

  1. Create a texture as R32UI and a custom view to it as E5B9G9R9_UFLOAT_PACK32.
  2. When debugging, try to in any way see the RGBE view instead of the R32UI one, this is not possible.
  3. Write the following shader to try to see the texture:
#version 450

layout (location = 0) in vec2 uv;

layout (location = 0) out vec4 color_out;

layout (binding = RD_UINT_3D_BINDING) uniform usampler3D texUInt3D;

void main()
{
	vec2 uv_inv = uv;

	vec2 posf = uv_inv*vec2(RD_TexDim().xy).xy;
	ivec2 posi = ivec2(posf).xy;
	uint rgbeui = texelFetch(texUInt3D,ivec3(posi,RD_SelectedSliceFace()),0 ).r;
	
	vec4 rgbe = vec4((uvec4(rgbeui) >> uvec4(0,9,18,27)) & uvec4(0x1FF,0x1FF,0x1FF,0x1F));
	vec3 emission = rgbe.rgb * pow( 2.0, rgbe.a - 15.0 - 9.0 );

    color_out = vec4( emission,1);
}

Result is all black.

  1. Inspect the texture values, it has valid RGE values.
  2. Save the texture as a binary block, decode as raw RGBE, it looks fine.

Environment

  • RenderDoc version: 1.29
  • Operating System: Ubutntu
  • Graphics API: Vulkan
  • GPU: Geforce GFX 1650
@reduz
Copy link
Author

reduz commented Nov 26, 2023

As a note, it seems if the main texture is created as E5B9G9R9_UFLOAT_PACK32 and the view is R32UI, RenderDoc displays properly this texture as RGBE. The problem is the other way around.

@reduz
Copy link
Author

reduz commented Nov 26, 2023

Actually, researching a bit further, this seems like a general impossibility in RenderDoc to debug UINT formats, it just does not work with any format. You can´t take an UINT texture and output anything in your shader that looks any other than black. (testing with a RGBA16UINT, same thing, even though the texture has data, any attempt to convert this data to anything viewable fails and results in black).

@baldurk baldurk added Bug A crash, misbehaviour, or other problem Unresolved Waiting for a fix or implementation labels Nov 27, 2023
@baldurk
Copy link
Owner

baldurk commented Dec 5, 2023

I'm not able to reproduce this (testing on windows + NV). In a simple test with an R32UI texture the shader you posted (slightly modified as I don't have any valid aliased RGB9E5 data) works as expected:

// issue3148.glsl
#version 450

layout (location = 0) in vec2 uv;

layout (location = 0) out vec4 color_out;

layout (binding = RD_UINT_3D_BINDING) uniform usampler3D texUInt3D;

void main()
{
	vec2 uv_inv = uv;

	vec2 posf = uv_inv*vec2(RD_TexDim().xy).xy;
	ivec2 posi = ivec2(posf).xy;
	uint rgbeui = texelFetch(texUInt3D,ivec3(posi,RD_SelectedSliceFace()),0 ).r;
	
	//vec4 rgbe = vec4((uvec4(rgbeui) >> uvec4(0,9,18,27)) & uvec4(0x1FF,0x1FF,0x1FF,0x1F));
	//vec3 emission = rgbe.rgb * pow( 2.0, rgbe.a - 15.0 - 9.0 );

	if(rgbeui > 50)
		color_out = vec4( 1,0,1,1);
	else if(rgbeui > 0)
		color_out = vec4( 0,1,0,1);
	else
		color_out = vec4( 0,0,0,1);
}

image

Can you please share a full and complete reproduction case I can use to reproduce your exact issue, as it may be something more specific than you have detailed here.

If you have another system available, it would also be helpful to check on a different driver or GPU in case this is a driver issue. You didn't say which driver version you're using, so it would also be worth checking to see if a driver update is available.

@baldurk baldurk added Need More Info More information is needed from a user to work on this issue and removed Unresolved Waiting for a fix or implementation labels Dec 5, 2023
@baldurk
Copy link
Owner

baldurk commented Jan 5, 2024

Closing this due to lack of activity from the reporter and no further information to investigate.

If you are the reporter and this bug is still a problem for you, or you are someone finding this issue and you believe this bug is still a problem and you have more information to share, please do not comment here and instead please open a new issue. You can reference this issue if you wish, but opening a new issue prevents confusion of accidentally linking two unrelated bugs and means that each issue can be handled in a clean process.

@baldurk baldurk closed this as completed Jan 5, 2024
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 Need More Info More information is needed from a user to work on this issue
Projects
None yet
Development

No branches or pull requests

2 participants