Jump to content
  • Advertisement
Sign in to follow this  
karnaltaB

DX12 DirectX 12 Root Constant Buffer Problem

Recommended Posts

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

Share this post


Link to post
Share on other sites
Advertisement
Posted (edited)

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?

Edited by ajmiles

Share this post


Link to post
Share on other sites
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.

 

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!