Non-Local Residency 1: Get Non-Local Memory Info

Adds functionality to query VideoMemoryInfo for the NON_LOCAL memory
segment.

Bug: dawn:193
Change-Id: I63c2f5a649c37617e7b39a60faa2d3b5b5077156
Reviewed-on: https://dawn-review.googlesource.com/c/dawn/+/19900
Commit-Queue: Brandon Jones <brandon1.jones@intel.com>
Reviewed-by: Austin Eng <enga@chromium.org>
This commit is contained in:
Brandon Jones
2020-04-22 21:57:00 +00:00
committed by Commit Bot service account
parent b4eccc8227
commit f56f19059b
5 changed files with 89 additions and 34 deletions

View File

@@ -30,6 +30,15 @@ namespace dawn_native { namespace d3d12 {
DAWN_NATIVE_EXPORT WGPUTextureFormat
GetNativeSwapChainPreferredFormat(const DawnSwapChainImplementation* swapChain);
enum MemorySegment {
Local,
NonLocal,
};
DAWN_NATIVE_EXPORT uint64_t SetExternalMemoryReservation(WGPUDevice device,
uint64_t requestedReservationSize,
MemorySegment memorySegment);
struct DAWN_NATIVE_EXPORT ExternalImageDescriptorDXGISharedHandle : ExternalImageDescriptor {
public:
ExternalImageDescriptorDXGISharedHandle();
@@ -39,9 +48,6 @@ namespace dawn_native { namespace d3d12 {
bool isSwapChainTexture = false;
};
DAWN_NATIVE_EXPORT uint64_t SetExternalMemoryReservation(WGPUDevice device,
uint64_t requestedReservationSize);
// Note: SharedHandle must be a handle to a texture object.
DAWN_NATIVE_EXPORT WGPUTexture
WrapSharedHandle(WGPUDevice device, const ExternalImageDescriptorDXGISharedHandle* descriptor);