Open adiba opened 5 years ago
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
Update: Still working through the fix, may have to rethink a couple of parts of the proposed solution.
Since
MapSubresource
returns the mapped subresource rather than taking a destination pointer, there is no way to passpMappedResource = NULL
toMap
, which is required for theReadFromSubresource
operation.Relevant docs: