-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Weird behavior with 3D texture UAV #1351
Comments
Just for reference, this is the output from the GL version. Note that D3D11 needs to do manual packing of formats while GL has native typed UAV loads: And this is the output from D3D11 when using native typed UAV loads (needs D3D11.3 and Windows 10): Note that both GL & D3D11.3 versions behave correctly in RenderDoc, but not the D3D11.1 one |
As far as I can tell this is behaving as expected, though there's an important bit of information which is kind of easy to miss. In the 'working' cases of GL and D3D11.3, the texture is natively UNORM so when you write 1.0 to any texel it shows up clearly. In the D3D11.0 case the texture is natively TYPELESS and so without any better information it's interpreted as UNORM. However when it's written it's written as packed UINT which means a value of 1 is written - 0.03 in UNorm terms. So the data is always there, it's just incredibly dark when viewed as UNORM so you need to use the range control to see it show up. When you select the dispatch and view it through the bindings, the UINT type hint is applied and the texture is re-interpreted as UINTs at which point it shows up correctly. This is all as is expected, though of course you need to know that a TYPELESS texture will be interpreted as UNORM and not as UINT with all else being equal. I've changed the status bar so it will explicitly say "Viewed as UNorm" if it doesn't have anything better - previously it would only show that when explicitly cast by a view. |
I don't think I understand. But after selecting the dispatch call and reopening the texture, it looks as expected from there onwards; and pixel clicking shows the correct value too. |
Maybe I'm seeing something different to you then. When I load the capture and open Texture 1065 it looks like this: As of the next nightly build the status bar will be amended like this: If I adjust the range I can see data: And pick any of those pixels as unorm values, e.g. in slice 0 most of the top row: This is all without changing events, so effectively at the end of the frame. Selecting the start of the frame also gives the same results. Selecting anywhere in EIDs 27 - 52 shows completely black, because the texture is cleared in EID 27's dispatch. Then if you select the EID 68 that writes to it, and open the texture via the bound thumbnails, the status bar updates to uint interpretation: This shows the 1 values that were written as UINT into the texture in that dispatch. If you open the texture as a buffer you can similarly see that the data is 1, and not 255 in each component. I looked at the compute shader and while I didn't dive down into it, it seems like maybe you are mistaken based on a bug in
The multiply by 255 happens before the saturate, so an input of Then the UNORM values get displayed as pure white even without the UINT typecast: But unless I edit the shader to fix that multiply, I don't ever see 255 when interpreted as UINT or 1.0 as UNORM, and RenderDoc's display is consistent with the underlying data. Do you actually see signs of 0xFFFFFFFF being written anywhere or was that an assumption based on how you thought the shader should work? Please check to see what you actually get, and if it differs from what I've listed above let me know, but I'm still not sure there's any actual bug here. |
Gaaaahhh! You're right in all accounts. I keep forgetting GL vs D3D11 flip the texture, so I was mouse picking the wrong pixels and see the whole bottom black. Now I see what you mean. There is no RenderDoc bug, there's only my saturation bug. Thanks for spotting it btw.!!! |
Description
NOTE: I am porting our voxelizer compute shader from GL3+ to D3D11 so there's a high chance I'm doing things wrong. However this looks like a RenderDoc bug.
When opening the attached file, there is a really weird behaviour going on that looks like a RenderDoc bug:
File: Voxelizer.rdc.7z.zip
Steps to repro:
This is how it looks (btw it's the expected output):
![ExpectedOutput](https://user-images.githubusercontent.com/3395130/56101802-0af45680-5efe-11e9-8b29-77756bbdcfde.png)
Opening it via Outputs tab shows the expected output; but opening it via Texture List.
At the beginning of the frame, the texture already should have the same output (because I was running the exact compute shader every frame), so it should have never been black.
Btw voxelNormalTex does not look as expected but that may be my wrong doing I have still debugging to do
Environment
The text was updated successfully, but these errors were encountered: