DirectX 12 Root Constant Buffer Problem

Started by
14 comments, last by karnaltaB 5 years, 8 months ago
14 hours ago, ajmiles said:

Sharing a PIX capture with us would probably also solve the problem.

Ok here is how my sample is supposed to work :

I have a rotating cube and 6 textures loaded in the shader, every x seconds, a 32 bits root constant (an integer) is updated to the pixel shader and the texture is switched (1-6). And if my value fall down to zero, I juste return black as pixel shader color.

When doing my sample with a traditionnal constant buffer view to pass my int value, it's working fine. But when I use a 32 bits root constant, after a few second of running the value fall to zero.

Here are two PIX captures, one when it's working and another one when the value fall down to zero.

PS : I am using C# with SharpDX, maybe a pointer lifecycle issue ? Even if in debug mode the pointer seem to be OK even after root constant has stop updating correctly.

 

Thank in advance

 

GPU 1 - OK.pix3

GPU 3 - NOK.pix3

Advertisement

image.png.44eb3764b145fbb286f40df6c9ace07e.pngimage.png.1e1f7fb956c1074d18bc1494c1843234.png

To be honest, I'm not sure how you're getting red in your "working" case.

PIX doesn't show any referenced textures for your pixel shader, yet the pixel shader does appear to be written as if it's expecting 6 textures to be bound. They should be showing up here in the PS group as a descriptor table / SRVs.

I've had a look into why they aren't showing up, and I'm a little worried by how your root signature looks. For the root parameter describing the descriptor table, the "OffsetInDescriptorsFromTableStart" field is set to 2147483648, which is 0x80000000. I would have expected this value to be either 0 or D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND, which is 0xFFFFFFFF.

There's always the possibility that PIX is wrong, but could you check what you think you're setting this field to?

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

4 hours ago, ajmiles said:

image.png.44eb3764b145fbb286f40df6c9ace07e.pngimage.png.1e1f7fb956c1074d18bc1494c1843234.png

To be honest, I'm not sure how you're getting red in your "working" case.

PIX doesn't show any referenced textures for your pixel shader, yet the pixel shader does appear to be written as if it's expecting 6 textures to be bound. They should be showing up here in the PS group as a descriptor table / SRVs.

I've had a look into why they aren't showing up, and I'm a little worried by how your root signature looks. For the root parameter describing the descriptor table, the "OffsetInDescriptorsFromTableStart" field is set to 2147483648, which is 0x80000000. I would have expected this value to be either 0 or D3D12_DESCRIPTOR_RANGE_OFFSET_APPEND, which is 0xFFFFFFFF.

There's always the possibility that PIX is wrong, but could you check what you think you're setting this field to?

I load 6 textures (simple solid color 512x512) with a RootDescriptorTable in the range of t0-t5 to the pixel shader. I can't tell you why they are not visible in PIX, I am quite new to it.

For the OffsetInDescriptorsFromTable, it was a mistake, I used int.MinValue to set it, which is -2147483648 :/ I corrected that and I now use zero. But unfortunately it doesn't solve my issue.

 

Have you tried running it with the Software WARP renderer? What about another GPU or another machine? Are the graphics drivers up to date?

Adam Miles - Principal Software Development Engineer - Microsoft Xbox Advanced Technology Group

14 hours ago, ajmiles said:

Have you tried running it with the Software WARP renderer? What about another GPU or another machine? Are the graphics drivers up to date?

With WARP renderer no. But I have tested it on two machines with updated drivers, none work.

I will certainly find out what I am doing wrong while progressing in my learning engine.

This topic is closed to new replies.

Advertisement