• Advertisement
Sign in to follow this  

Is SetPrivateData only supposed to be called once?

This topic is 660 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Short and to-the-point question; is there any reason that ID3D11DeviceChild::SetPrivateData isn't supposed to be called more than once for the same resource type? I recently began giving some of my textures more detailed names and started getting the following warnings:

 

D3D11 WARNING: ID3D11Texture2D::SetPrivateData: Existing private data of same name with different size found! [ STATE_SETTING WARNING #55: SETPRIVATEDATA_CHANGINGPARAMS]

 

What the message says holds true; my textures are first generically named on creation such as being set to the file name, or "RenderTarget[format]", etc. and then I'm overwriting this for certain resources that I wish to keep better track of when debugging such as "Vertical blur RT".

Judging by the message, is the problem that it has to reallocate the string buffer behind the scenes which is considered inefficient? Would it be preferable to set a large string with a bunch of padding at the end to afford changing the D3DDebugObjectName while maintaining the same string size? This seems wasteful however and it isn't like I'm changing this continually over the course of my program but rather just overwriting it during the setup phase, so I don't really mind a reallocation penalty there. Or is there some other reason for this warning?

For the record, the value change does work just fine, and I realize I could just ignore / disable the warning but I'd rather it wasn't raised in the first place if it is avoidable.

 

Thankful for any advice!

Share this post


Link to post
Share on other sites
Advertisement
It's a harmless warning, I'm pretty sure it's meant for other uses of SetPrivateData where overwriting the data makes much less sense. Edited by Mona2000

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement