Advertisement

D3D12: CreateShaderResourceView crash

Started by November 23, 2017 10:14 AM
14 comments, last by VietNN 7 years, 2 months ago

On the original topic, sounds like you have a bad pointer you're passing in, either to the resource or the desc, or it's possible you've corrupted something by writing memory you're not supposed to. That's all I can give you without getting it under a debugger myself.

Off topic, galop1n is correct, the GetCopyableFootprints method only provides a least-common-denominator layout that the API will accept for copying between opaque driver layouts and transparent buffers. The actual memory footprint of the opaque texture will likely be less, but could even be more, we don't really expose that information, though you can see it through PIX or WPA I think.

1 hour ago, SoldierOfLight said:

On the original topic, sounds like you have a bad pointer you're passing in, either to the resource or the desc, or it's possible you've corrupted something by writing memory you're not supposed to. That's all I can give you without getting it under a debugger myself.

Off topic, galop1n is correct, the GetCopyableFootprints method only provides a least-common-denominator layout that the API will accept for copying between opaque driver layouts and transparent buffers. The actual memory footprint of the opaque texture will likely be less, but could even be more, we don't really expose that information, though you can see it through PIX or WPA I think.

I was in fact talking about GetResourceAllocationInfo, this is the one you use for placed resource, it is not guarantee that a commited resource will need the same amount, but it is likely and good enough to estimate the memory waste. GetCopyableFootPrints use the 256 padding rules and is row_major, so it is useless for that purpose ( but highly recommended to be used for resource transfer as harcoding pitchs is a bad habit ). 

Advertisement

Ah, I forgot about GetResourceAllocationInfo, you're totally right - I was thrown off that you called it GetMemoryFootprint. That provides the real memory footprint. That's what I get for trying to be helpful so early after getting back from vacation...

9 minutes ago, SoldierOfLight said:

Ah, I forgot about GetResourceAllocationInfo, you're totally right - I was thrown off that you called it GetMemoryFootprint. That provides the real memory footprint. That's what I get for trying to be helpful so early after getting back from vacation...

The same, i came back to LA from barbados yesterday for a vacation+wedding+hooneymoon combo :)

Thank you SoldierOfLight and galop1n for your explanation.

This topic is closed to new replies.

Advertisement