New To The Forum? Click Here To Read The How To Guide. -- Developers Click Here.

UpdateSubresource using ID3D11Texture2D

TheRealIronWolfTheRealIronWolf Posts: 50
Hiro Protagonist

Hi,

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;
			++textures;
			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!


Tagged:

Comments

  • imperativityimperativity Posts: 3,465 Oculus Staff
    Hi,

    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.
    Please tag me @imperativity in your forum post/response if you need immediate assistance or want additional support or context on an issue you are having with our software or integrations.

    Having an issue with our platform, services, or integrations?

    Try using our new bug tool to report this and receive emailed updates as we proceed to address it internally.
  • TheRealIronWolfTheRealIronWolf Posts: 50
    Hiro Protagonist
    Hi, I figured this one out, I had to use CopySubresourceRegion instead.
Sign In or Register to comment.