In my DirectX 11 application, I am trying to draw non-color data to a DXGI_FORMAT_R32G32B32A32_UINT texture, and then pass a ShaderResourceView of that texture into a compute shader for processing. When I get into the compute shader, the values I receive from the texels do not seem to match what is being outputted by the pixel shader.
I was hoping I could use NSight to debug the issue, but when I go to the “Resources Page” so I can attempt to look at the values stored in my texture, in place of the thumbnail it says “The resource has unused views” and doesn’t give me any other details about the texture.
Can someone tell me what this means and how I can fix it?
I’ll go ahead and also provide more information about what I’m trying to do, in case it sheds some light on my problem. This texture that I’m drawing is not meant for display. It is “graphical” in the sense that I have a buffer of vertices that I’m drawing as a point list - I’m using the standard drawing pipeline so that I can position the points on the texture appropriately and take advantage of the built-in depth-buffering. However, the values I want to store per texel are not color component values. Rather, I have four values (one float, three unsigned integers).
At first, I was trying to draw these values to a DXGI_FORMAT_R32G32B32A32_FLOAT texture, and for the uint values, was using the asfloat function in my pixel shader to store them as a binary-equivalent float. In my compute shader, when I pulled the float4 value (using the  operator to index a texel), I would try to convert back the uint values using the asuint function. What I found was that I could read the one regular float value fine, but the uint values didn’t survive the conversions for some reason - they always came back as zero. So I thought instead I would try it the other way around, using a DXGI_FORMAT_R32G32B32A32_UINT texture instead, but now I’m getting ALL zeros when I retrieve a texel by index in my compute shader.
I figure there must be a way to store values of two different data types in a single texture, but I haven’t found the solution yet.
Thought I should update my post - as I continued working on this I switch BACK to using the DXGI_FORMAT_R32G32B32A32_FLOAT format texture and doing the same binary casts I (thought) I was doing before, and this time it worked! Not sure what bug or typo I fixed in the process of changing it back, but it is working now. Still, if anyone can explain what the “The resource has unused views” message means in the Resource Page of NSight, I’m still curious to know!