__vfptr and UpdateSubresource

Started by
2 comments, last by Tim Lawton 11 years, 1 month ago

I'm currently trying to refactor a piece of code to load an MD5 model, during the render part of the code my UpdateSubresource takes in the first Parameters cbPerObjectBuffer (constant buffer per object buffer). unfortunately __vfptr seems be holding the wrong/none of the values it should be


		deviceContext->UpdateSubresource( cbPerObjectBuffer, 0, NULL, &m_cbPerObj, 0, 0 );

This is what I get

errorbp.png

This is what I should be getting

fixg.png

Can anyone tell me how to get values for __vfptr?

Advertisement
This has nothin to do with vtables; in your first screenshot your cbuffer is an uninitialized variable, with the value of 0xcdcdcdcd.

Your "cbPerObjectBuffer" pointer is bogus. Just look at the value: it's 0xcdcdcdcd, which is a scribble pattern used by VC++ to initialize memory allocated from the heap. In other words, you never initialized that pointer.

Thanks guys! Still a little new to this, but got it working now

This topic is closed to new replies.

Advertisement