Jump to content
  • Advertisement
Ward Correll

DX12 Can someone help a newbie?

Recommended Posts

I include the source code from what I am playing with. It's an exercise from Frank Luna's DirectX 12 book about rendering a skull from a text file. I get a stack overflow error and the program quits. I don't know where I went wrong it's messy programming on the parts I added but maybe one of you masterminds can tell me where I went wrong.

Chapter_7_Drawing_in_Direct3D_Part_II.zip

Edited by Ward Correll

Share this post


Link to post
Share on other sites
Advertisement

I think I know what I did wrong but not sure how to fix it. In reading the vertex data from the text file I created an array larger than can be allowed. The sample code in the next chapter shows the skull I will just try to copy what he did and learn from that.

Share this post


Link to post
Share on other sites

Your Vertex structure contains float3+float3+float4+float2, that's 44 bytes (if packed).

You declare this on stack: Vertex v[31076];

That's 1367344 bytes or 1.3 MB. That's too much for a typical stack, which is 1 MB IIRC.

Why don't you allocate a std::vector<Vector>, do a resize() on it, and load it into it? That'll solve it. You can access its data by ::data().

Edited by pcmaster

Share this post


Link to post
Share on other sites

The best help i can give you is to stick with DX11, DX12 is not here to replace DX11, but to allow extremely rare application scenario that need it to be able to go beyond what is doable with DX11.

If your application is not at least a GTA V or similar, DX12 will only give you trouble for no benefits

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

  • 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!