#pragma once #include "../dxvk/dxvk_device.h" #include "d3d11_device_child.h" namespace dxvk { class D3D11Device; struct D3D11UavCounter { uint32_t atomicCtr; }; /** * \brief Unordered access view * * Unordered access views are special in that they can * have counters, which can be used inside shaders to * atomically append or consume structures. */ class D3D11UnorderedAccessView : public D3D11DeviceChild { public: D3D11UnorderedAccessView( D3D11Device* device, ID3D11Resource* resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC& desc, const Rc& bufferView, const DxvkBufferSlice& counterSlice); D3D11UnorderedAccessView( D3D11Device* device, ID3D11Resource* resource, const D3D11_UNORDERED_ACCESS_VIEW_DESC& desc, const Rc& imageView, const DxvkBufferSlice& counterSlice); ~D3D11UnorderedAccessView(); HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void** ppvObject) final; void STDMETHODCALLTYPE GetDevice(ID3D11Device** ppDevice) final; void STDMETHODCALLTYPE GetResource(ID3D11Resource** ppResource) final; void STDMETHODCALLTYPE GetDesc(D3D11_UNORDERED_ACCESS_VIEW_DESC* pDesc) final; D3D11_RESOURCE_DIMENSION GetResourceType() const { D3D11_RESOURCE_DIMENSION type; m_resource->GetType(&type); return type; } Rc GetBufferView() const { return m_bufferView; } Rc GetImageView() const { return m_imageView; } DxvkBufferSlice GetCounterSlice() const { return m_counterSlice; } private: Com m_device; Com m_resource; D3D11_UNORDERED_ACCESS_VIEW_DESC m_desc; Rc m_bufferView; Rc m_imageView; DxvkBufferSlice m_counterSlice; }; }