Skip to content
This repository has been archived by the owner on Mar 30, 2019. It is now read-only.

One cannot pass NULL to MapSubresource for the parameter D3D11_MAPPED_SUBRESOURCE *pMappedResource #1131

Open
adiba opened this issue Feb 23, 2019 · 2 comments

Comments

@adiba
Copy link

adiba commented Feb 23, 2019

Since MapSubresource returns the mapped subresource rather than taking a destination pointer, there is no way to pass pMappedResource = NULL to Map, which is required for the ReadFromSubresource operation.

Relevant docs:

@adiba adiba changed the title One cannot pass NULL for the parameter D3D11_MAPPED_SUBRESOURCE *pMappedResource One cannot pass NULL to MapSubresource for the parameter D3D11_MAPPED_SUBRESOURCE *pMappedResource Feb 24, 2019
@h1cks
Copy link

h1cks commented Mar 30, 2019

I've dug through this one and it definitely is a bug and I believe we can fix this without a breaking change. But relies on use of a default parameter to be added.

The base call into MapSubresource is the problem, its calling by mapping a databox address which then always passes a non null address to Map Sub resource.

Need to understand what to set in the mapping xml to pass as a nullable struct. Then test the struct for null in the code, prior to mapping it to a reference. I feel that this will need to be hand coded rather than auto generated. Additional changes up the call tree are required to pass through a flag to make the input variable pass whether the call should be made with a null or a data struct.

Need some advice on how to set up the mapping xml so to hand code the call to MapSubresource

@h1cks
Copy link

h1cks commented Mar 30, 2019

Update: Still working through the fix, may have to rethink a couple of parts of the proposed solution.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants