Welcome to the Oculus Developer Forums!

Your participation on the forum is subject to the Oculus Code of Conduct.

In general, please be respectful and kind. If you violate the Oculus Code of Conduct, your access to the developer forums will be revoked at the discretion of Oculus staff.
New to the forums? Click here to read the How To guide. -- Developers click here.

UpdateSubresource using ID3D11Texture2D

TheRealIronWolfTheRealIronWolf Posts: 58
Hiro Protagonist


I am trying to initialize SkyBox/Cubemap in Oculus app.  Oculus's sample shows how to initialize texture swap chain texture.  The difference in my use case is that I do not initialize from .dds bytes read from disk, I already have ID3D11Texture2D.  I see samples online that allow getting Texture bytes, but that will involve CPU copying of memory, I wonder if it can be avoided.  Here's roughly what I am doing:

		int numFaces = 6;
		for (int i = 0; i < numFaces; ++i)
			ID3D11Texture2D *faceSrc = textures->handle;
			context->UpdateSubresource(tex, i, nullptr, (const void*)faceSrc, srcDesc.Width * 4, srcDesc.Width * srcDesc.Height * 4);

However, that crashes with AV in Nvidia driver.  Any suggestions?  Thanks!



  • imperativityimperativity Posts: 3,587 Valuable Player

    Can you please elaborate on this use case?

    If this is crashing in connection with your graphics driver this may be an issue with your driver or compatibility with your card.
  • TheRealIronWolfTheRealIronWolf Posts: 58
    Hiro Protagonist
    Hi, I figured this one out, I had to use CopySubresourceRegion instead.
Sign In or Register to comment.