/* HolographicSpaceInterop.idl * * IDL defines for COM APIs to support Windows.Graphics.Holographic interop with DX12 * * Copyright (c) Microsoft Corporation. All rights reserved */ import "inspectable.idl"; import "d3d12.idl"; #include cpp_quote("#include ") cpp_quote("#if (NTDDI_VERSION >= NTDDI_WIN10_RS2)") #pragma region Modern Family cpp_quote("#if WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP)") //! Extends HolographicCamera to allow 2D texture resources to be created and used as content buffers for apps using Direct3D 12. [ uuid(7cc1f9c5-6d02-41fa-9500-e1809eb48eec), ] interface IHolographicCameraInterop : IInspectable { /*! Creates a D3D12 resource for use as a content buffer for the camera. The D3D12_RESOURCE_DESC struct can contain any set of valid initial values. Any values that will not work with this HolographicCamera will be overridden in the struct indicated by pDesc. This parameter is not optional. The resource is created so that it is already committed to a heap. */ HRESULT CreateDirect3D12BackBufferResource( //! The Direct3D 12 device. [in] ID3D12Device* pDevice, //! The Direct3D 12 resource description. //! The API will make a best effort to respect the values in this descriptor. The app //! should inspect the descriptor for the texture returned by ppCreatedTexture2DResource //! and respond appropriately to any differences from what was specified. [in] D3D12_RESOURCE_DESC* pTexture2DDesc, //! If successful, the Direct3D 12 2D texture resource for use as a content buffer. Otherwise null. [out, retval] ID3D12Resource** ppCreatedTexture2DResource); /*! Creates a D3D12 resource for use as a content buffer for the camera with optional hardware protection. Behavior is the same as CreateDirect3D12BackBufferResource but accepts an optional ID3D12ProtectedResourceSession. Use this optional parameter to to create a hardware protected resource buffer. */ HRESULT CreateDirect3D12HardwareProtectedBackBufferResource( //! The Direct3D 12 device. [in] ID3D12Device* pDevice, //! The Direct3D 12 resource description. //! The API will make a best effort to respect the values in this descriptor. The app //! should inspect the descriptor for the texture returned by ppCreatedTexture2DResource //! and respond appropriately to any differences from what was specified. [in] D3D12_RESOURCE_DESC* pTexture2DDesc, //! An optional D3D12 protected resource session. Passing a protected session will attempt to create //! A D3D12 hardware protected resource. [in] ID3D12ProtectedResourceSession* pProtectedResourceSession, //! If successful, the Direct3D 12 2D texture resource for use as a content buffer. Otherwise null. [out, retval] ID3D12Resource** ppCreatedTexture2DResource); /*! Acquires a Direct3D12 buffer resource. After committing a resource to a HolographicFrame by calling IHolographicCameraRenderingParameters4::CommitDirect3D12Resource, the app should consider control of that resource to be held by the system. That control can last for a few frames as the frame the buffer was committed to makes its way through the presentation queue. To know when the system has relinquished control, call AcquireDirect3D12TextureResource. If the buffer cannot be acquired by the time the app is ready to start rendering a new HolographicFrame, the app should create a new resource and add it to the buffer queue. This method accepts an optional timeout value. When this value is specified, the system will wait for that many milliseconds for the buffer to become available. The default behavior is to not wait. When no timeout value is specified, if this method is called and the buffer is not ready to be acquired, the method call will fail with the error code E_NOTREADY. */ HRESULT AcquireDirect3D12BufferResource( //! The Direct3D 12 resource to acquire. //! The resource will be in the D3D12_RESOURCE_STATE_COMMON when it is acquired. [in] ID3D12Resource* pResourceToAcquire, //! The Direct3D 12 command queue to use for transitioning //! the state of this resource when acquiring it for the app. [in] ID3D12CommandQueue* pCommandQueue); HRESULT AcquireDirect3D12BufferResourceWithTimeout( [in] ID3D12Resource* pResourceToAcquire, //! The Direct3D 12 command queue to use for transitioning //! the state of this resource when acquiring it for the app. //! The resource will be in the D3D12_RESOURCE_STATE_COMMON when it is acquired. [in] ID3D12CommandQueue* pCommandQueue, //! If this parameter is set, the call will wait for that amount of //! time for the buffer to be acquired. //! If the timeout period elapses before the buffer can be acquired, //! the method will fail with the error code E_TIMEOUT. //! This parameter is in 100-nanosecond units, similar to the //! Windows.Foundation.TimeSpan Duration property. [in] UINT64 duration); /*! Un-Acquires a Direct3D12 buffer resource. A resource which has been acquired but not submitted should be unacquired to return control of the buffer back to the app, allowing it to be re-aqcuired later. */ HRESULT UnacquireDirect3D12BufferResource( [in] ID3D12Resource* pResourceToUnacquire); } //! Extends HolographicCameraRenderingParameters to support setting a content buffer //! per-frame. [ uuid(f75b68d6-d1fd-4707-aafd-fa6f4c0e3bf4) ] interface IHolographicCameraRenderingParametersInterop : IInspectable { HRESULT CommitDirect3D12Resource( //! The Direct3D 12 texture resource with content to display when presenting the //! HolographicFrame used to retrieve this object. [in] ID3D12Resource* pColorResourceToCommit, //! A fence used to signal work completion on pColorResourceToCommit. [in] ID3D12Fence* pColorResourceFence, //! The value used to signal work completion on the texture resource fence. [in] UINT64 colorResourceFenceSignalValue); HRESULT CommitDirect3D12ResourceWithDepthData( //! The Direct3D 12 texture resource with content to display when presenting the //! HolographicFrame used to retrieve this object. [in] ID3D12Resource* pColorResourceToCommit, //! A fence used to signal work completion on pColorResourceToCommit. [in] ID3D12Fence* pColorResourceFence, //! The fence value used to signal work completion on the texture resource. [in] UINT64 colorResourceFenceSignalValue, //! The Direct3D 12 depth buffer with depth data for image stabilization. //! Typically used when rendering to pColorResourceToCommit, or derived from the //! same rendering pass. [in] ID3D12Resource* pDepthResourceToCommit, //! A fence used to signal work completion on pDepthResourceToCommit. [in] ID3D12Fence* pDepthResourceFence, //! The value used to signal work completion on the depth resource fence. [in] UINT64 depthResourceFenceSignalValue); } [ uuid(cfa688f0-639e-4a47-83d7-6b7f5ebf7fed) ] interface IHolographicQuadLayerInterop : IInspectable { /*! Creates a D3D12 resource for use as a content buffer for the layer. The D3D12_RESOURCE_DESC struct can contain any set of valid initial values. Any values that will not work with this quad layer object will be overridden in the struct indicated by pDesc. This parameter is not optional. The resource is created so that it is already committed to a heap. */ HRESULT CreateDirect3D12ContentBufferResource( //! The Direct3D 12 device. [in] ID3D12Device* pDevice, //! The Direct3D 12 resource description. //! The API will make a best effort to respect the values in this descriptor. The app //! should inspect the descriptor for the texture returned by ppCreatedTexture2DResource //! and respond appropriately to any differences from what was specified. [in] D3D12_RESOURCE_DESC* pTexture2DDesc, //! If successful, the Direct3D 12 2D texture resource for use as a content buffer. Otherwise null. [out,retval] ID3D12Resource** ppTexture2DResource); /*! Creates a D3D12 resource for use as a content buffer for the camera with optional hardware protection. Behavior is the same as CreateDirect3D12ContentBufferResource but accepts an optional ID3D12ProtectedResourceSession. Use this optional parameter to to create a hardware protected resource buffer. */ HRESULT CreateDirect3D12HardwareProtectedContentBufferResource( //! The Direct3D 12 device. [in] ID3D12Device* pDevice, //! The Direct3D 12 resource description. //! The API will make a best effort to respect the values in this descriptor. The app //! should inspect the descriptor for the texture returned by ppCreatedTexture2DResource //! and respond appropriately to any differences from what was specified. [in] D3D12_RESOURCE_DESC* pTexture2DDesc, //! An optional D3D12 protected resource session. Passing a protected session will attempt to create //! A D3D12 hardware protected resource. [in] ID3D12ProtectedResourceSession* pProtectedResourceSession, //! If successful, the Direct3D 12 2D texture resource for use as a content buffer. Otherwise null. [out, retval] ID3D12Resource** ppCreatedTexture2DResource); /*! Acquires a Direct3D12 buffer resource. After committing a resource to a HolographicFrame by calling IHolographicCameraRenderingParameters4::CommitDirect3D12Resource, the app should consider control of that resource to be held by the system. That control can last for a few frames as the frame the buffer was committed to makes its way through the presentation queue. To know when the system has relinquished control, call AcquireDirect3D12TextureResource. If the buffer cannot be acquired by the time the app is ready to start rendering a new HolographicFrame, the app should create a new resource and add it to the buffer queue. This method accepts an optional timeout value. When this value is specified, the system will wait for that many milliseconds for the buffer to become available. The default behavior is to not wait. When no timeout value is specified, if this method is called and the buffer is not ready to be acquired, the method call will fail with the error code E_NOTREADY. */ HRESULT AcquireDirect3D12BufferResource( //! The Direct3D 12 resource to acquire. //! The resource will be in the D3D12_RESOURCE_STATE_COMMON when it is acquired. [in] ID3D12Resource* pResourceToAcquire, //! The Direct3D 12 command queue to use for transitioning //! the state of this resource when acquiring it for the app. [in] ID3D12CommandQueue* pCommandQueue); HRESULT AcquireDirect3D12BufferResourceWithTimeout( //! The Direct3D 12 resource to acquire. //! The resource will be in the D3D12_RESOURCE_STATE_COMMON when it is acquired. [in] ID3D12Resource* pResourceToAcquire, //! The Direct3D 12 command queue to use for transitioning //! the state of this resource when acquiring it for the app. [in] ID3D12CommandQueue* pCommandQueue, //! If this parameter is set, the call will wait for that amount of //! time for the buffer to be acquired. //! If the timeout period elapses before the buffer can be acquired, //! the method will fail with the error code E_TIMEOUT. //! This parameter is in 100-nanosecond units, similar to the //! Windows.Foundation.TimeSpan Duration property. [in] UINT64 duration); /*! Un-Acquires a Direct3D12 buffer resource. A resource which has been acquired but not submitted should be unacquired to return control of the buffer back to the app, allowing it to be re-aqcuired later. */ HRESULT UnacquireDirect3D12BufferResource( [in] ID3D12Resource* pResourceToUnacquire); } [ uuid(e5f549cd-c909-444f-8809-7cc18a9c8920) ] interface IHolographicQuadLayerUpdateParametersInterop : IInspectable { HRESULT CommitDirect3D12Resource( //! The Direct3D 12 texture resource with content to display when presenting the //! HolographicFrame used to retrieve this object. [in] ID3D12Resource* pColorResourceToCommit, //! A fence used to signal work completion on pColorResourceToCommit. [in] ID3D12Fence* pColorResourceFence, //! The value used to signal work completion on the texture resource fence. [in] UINT64 colorResourceFenceSignalValue); } cpp_quote("#endif /* WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_APP) */") #pragma endregion cpp_quote("#endif //(NTDDI_VERSION >= NTDDI_WIN10)")