From c70e017fa21a6cfb56abf7601c78db3faad882d4 Mon Sep 17 00:00:00 2001 From: turanszkij Date: Mon, 4 Dec 2017 16:04:57 +0000 Subject: [PATCH] dx12 UAV barrier + device wrapper update --- WickedEngine/wiEmittedParticle.cpp | 2 +- WickedEngine/wiFFTGenerator.cpp | 10 +++++----- WickedEngine/wiFFTGenerator.h | 4 ++-- WickedEngine/wiGraphicsDevice.h | 6 +++--- WickedEngine/wiGraphicsDevice_DX11.cpp | 6 +++--- WickedEngine/wiGraphicsDevice_DX11.h | 6 +++--- WickedEngine/wiGraphicsDevice_DX12.cpp | 24 ++++++++++++++++++++---- WickedEngine/wiGraphicsDevice_DX12.h | 6 +++--- WickedEngine/wiGraphicsResource.cpp | 18 +++++++----------- WickedEngine/wiGraphicsResource.h | 25 ++++++++----------------- WickedEngine/wiHairParticle.cpp | 6 +++--- WickedEngine/wiOcean.cpp | 4 ++-- WickedEngine/wiRenderer.cpp | 18 +++++++++--------- 13 files changed, 69 insertions(+), 66 deletions(-) diff --git a/WickedEngine/wiEmittedParticle.cpp b/WickedEngine/wiEmittedParticle.cpp index 862e762a7..ed515fb49 100644 --- a/WickedEngine/wiEmittedParticle.cpp +++ b/WickedEngine/wiEmittedParticle.cpp @@ -303,7 +303,7 @@ void wiEmittedParticle::UpdateRenderData(GRAPHICSTHREAD threadID) device->UpdateBuffer(constantBuffer, &cb, threadID); device->BindConstantBufferCS(constantBuffer, CB_GETBINDSLOT(EmittedParticleCB), threadID); - const GPUUnorderedResource* uavs[] = { + const GPUResource* uavs[] = { particleBuffer, aliveList[0], // CURRENT alivelist aliveList[1], // NEW alivelist diff --git a/WickedEngine/wiFFTGenerator.cpp b/WickedEngine/wiFFTGenerator.cpp index daf508b68..a0456515a 100644 --- a/WickedEngine/wiFFTGenerator.cpp +++ b/WickedEngine/wiFFTGenerator.cpp @@ -14,7 +14,7 @@ ComputeShader* CSFFT_512x512_Data_t::pRadix008A_CS2 = nullptr; ComputePSO CSFFT_512x512_Data_t::PSO1, CSFFT_512x512_Data_t::PSO2; void radix008A(CSFFT512x512_Plan* fft_plan, - GPUUnorderedResource* pUAV_Dst, + GPUResource* pUAV_Dst, GPUResource* pSRV_Src, UINT thread_count, UINT istride, @@ -29,7 +29,7 @@ void radix008A(CSFFT512x512_Plan* fft_plan, GPUResource* cs_srvs[1] = { pSRV_Src }; device->BindResourcesCS(cs_srvs, TEXSLOT_ONDEMAND0, 1, threadID); - GPUUnorderedResource* cs_uavs[1] = { pUAV_Dst }; + GPUResource* cs_uavs[1] = { pUAV_Dst }; device->BindUnorderedAccessResourcesCS(cs_uavs, 0, 1, threadID); // Shader @@ -53,13 +53,13 @@ void radix008A(CSFFT512x512_Plan* fft_plan, } void fft_512x512_c2c(CSFFT512x512_Plan* fft_plan, - GPUUnorderedResource* pUAV_Dst, + GPUResource* pUAV_Dst, GPUResource* pSRV_Dst, GPUResource* pSRV_Src, GRAPHICSTHREAD threadID) { const UINT thread_count = fft_plan->slices * (512 * 512) / 8; - GPUUnorderedResource* pUAV_Tmp = fft_plan->pUAV_Tmp; + GPUResource* pUAV_Tmp = fft_plan->pUAV_Tmp; GPUResource* pSRV_Tmp = fft_plan->pSRV_Tmp; GraphicsDevice* device = wiRenderer::GetDevice(); GPUBuffer* cs_cbs; @@ -213,7 +213,7 @@ void fft512x512_create_plan(CSFFT512x512_Plan* plan, UINT slices) device->CreateBuffer(&buf_desc, nullptr, plan->pBuffer_Tmp); plan->pSRV_Tmp = (GPUResource*)plan->pBuffer_Tmp; - plan->pUAV_Tmp = (GPUUnorderedResource*)plan->pBuffer_Tmp; + plan->pUAV_Tmp = (GPUResource*)plan->pBuffer_Tmp; } void fft512x512_destroy_plan(CSFFT512x512_Plan* plan) diff --git a/WickedEngine/wiFFTGenerator.h b/WickedEngine/wiFFTGenerator.h index 82777170e..bb125d587 100644 --- a/WickedEngine/wiFFTGenerator.h +++ b/WickedEngine/wiFFTGenerator.h @@ -27,7 +27,7 @@ typedef struct CSFFT_512x512_Data_t // Temporary buffers wiGraphicsTypes::GPUBuffer* pBuffer_Tmp; - wiGraphicsTypes::GPUUnorderedResource* pUAV_Tmp; + wiGraphicsTypes::GPUResource* pUAV_Tmp; wiGraphicsTypes::GPUResource* pSRV_Tmp; static void LoadShaders(); @@ -49,7 +49,7 @@ void fft512x512_create_plan(CSFFT512x512_Plan* plan, UINT slices); void fft512x512_destroy_plan(CSFFT512x512_Plan* plan); void fft_512x512_c2c(CSFFT512x512_Plan* fft_plan, - wiGraphicsTypes::GPUUnorderedResource* pUAV_Dst, + wiGraphicsTypes::GPUResource* pUAV_Dst, wiGraphicsTypes::GPUResource* pSRV_Dst, wiGraphicsTypes::GPUResource* pSRV_Src, GRAPHICSTHREAD threadID); diff --git a/WickedEngine/wiGraphicsDevice.h b/WickedEngine/wiGraphicsDevice.h index 5d8eca6b0..367ad0e18 100644 --- a/WickedEngine/wiGraphicsDevice.h +++ b/WickedEngine/wiGraphicsDevice.h @@ -87,7 +87,7 @@ namespace wiGraphicsTypes ///////////////Thread-sensitive//////////////////////// virtual void BindViewports(UINT NumViewports, const ViewPort *pViewports, GRAPHICSTHREAD threadID) = 0; - virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUUnorderedResource* const *ppUAVs, int slotUAV, int countUAV, + virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUResource* const *ppUAVs, int slotUAV, int countUAV, GRAPHICSTHREAD threadID, int arrayIndex = -1) = 0; virtual void BindRenderTargets(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GRAPHICSTHREAD threadID, int arrayIndex = -1) = 0; virtual void ClearRenderTarget(Texture* pTexture, const FLOAT ColorRGBA[4], GRAPHICSTHREAD threadID, int arrayIndex = -1) = 0; @@ -104,8 +104,8 @@ namespace wiGraphicsTypes virtual void BindResourcesDS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) = 0; virtual void BindResourcesHS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) = 0; virtual void BindResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) = 0; - virtual void BindUnorderedAccessResourceCS(const GPUUnorderedResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) = 0; - virtual void BindUnorderedAccessResourcesCS(const GPUUnorderedResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) = 0; + virtual void BindUnorderedAccessResourceCS(const GPUResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) = 0; + virtual void BindUnorderedAccessResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) = 0; virtual void UnBindResources(int slot, int num, GRAPHICSTHREAD threadID) = 0; virtual void UnBindUnorderedAccessResources(int slot, int num, GRAPHICSTHREAD threadID) = 0; virtual void BindSamplerPS(const Sampler* sampler, int slot, GRAPHICSTHREAD threadID) = 0; diff --git a/WickedEngine/wiGraphicsDevice_DX11.cpp b/WickedEngine/wiGraphicsDevice_DX11.cpp index 2836165b7..eb2205963 100644 --- a/WickedEngine/wiGraphicsDevice_DX11.cpp +++ b/WickedEngine/wiGraphicsDevice_DX11.cpp @@ -2754,7 +2754,7 @@ void GraphicsDevice_DX11::BindViewports(UINT NumViewports, const ViewPort *pView } deviceContexts[threadID]->RSSetViewports(NumViewports, d3dViewPorts); } -void GraphicsDevice_DX11::BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUUnorderedResource* const *ppUAVs, int slotUAV, int countUAV, +void GraphicsDevice_DX11::BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUResource* const *ppUAVs, int slotUAV, int countUAV, GRAPHICSTHREAD threadID, int arrayIndex) { // RTVs: @@ -3014,7 +3014,7 @@ void GraphicsDevice_DX11::BindResourcesCS(const GPUResource *const* resources, i } deviceContexts[threadID]->CSSetShaderResources(static_cast(slot), static_cast(count), srvs); } -void GraphicsDevice_DX11::BindUnorderedAccessResourceCS(const GPUUnorderedResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex) +void GraphicsDevice_DX11::BindUnorderedAccessResourceCS(const GPUResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex) { if (resource != nullptr) { @@ -3029,7 +3029,7 @@ void GraphicsDevice_DX11::BindUnorderedAccessResourceCS(const GPUUnorderedResour } } } -void GraphicsDevice_DX11::BindUnorderedAccessResourcesCS(const GPUUnorderedResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) +void GraphicsDevice_DX11::BindUnorderedAccessResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) { assert(count <= 8); ID3D11UnorderedAccessView* uavs[8]; diff --git a/WickedEngine/wiGraphicsDevice_DX11.h b/WickedEngine/wiGraphicsDevice_DX11.h index a1c71a0fa..35d9114ea 100644 --- a/WickedEngine/wiGraphicsDevice_DX11.h +++ b/WickedEngine/wiGraphicsDevice_DX11.h @@ -71,7 +71,7 @@ namespace wiGraphicsTypes ///////////////Thread-sensitive//////////////////////// virtual void BindViewports(UINT NumViewports, const ViewPort *pViewports, GRAPHICSTHREAD threadID) override; - virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUUnorderedResource* const *ppUAVs, int slotUAV, int countUAV, + virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUResource* const *ppUAVs, int slotUAV, int countUAV, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; virtual void BindRenderTargets(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; virtual void ClearRenderTarget(Texture* pTexture, const FLOAT ColorRGBA[4], GRAPHICSTHREAD threadID, int arrayIndex = -1) override; @@ -88,8 +88,8 @@ namespace wiGraphicsTypes virtual void BindResourcesDS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void BindResourcesHS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void BindResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; - virtual void BindUnorderedAccessResourceCS(const GPUUnorderedResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; - virtual void BindUnorderedAccessResourcesCS(const GPUUnorderedResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; + virtual void BindUnorderedAccessResourceCS(const GPUResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; + virtual void BindUnorderedAccessResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void UnBindResources(int slot, int num, GRAPHICSTHREAD threadID) override; virtual void UnBindUnorderedAccessResources(int slot, int num, GRAPHICSTHREAD threadID) override; virtual void BindSamplerPS(const Sampler* sampler, int slot, GRAPHICSTHREAD threadID) override; diff --git a/WickedEngine/wiGraphicsDevice_DX12.cpp b/WickedEngine/wiGraphicsDevice_DX12.cpp index 75443fc29..86beb4d8f 100644 --- a/WickedEngine/wiGraphicsDevice_DX12.cpp +++ b/WickedEngine/wiGraphicsDevice_DX12.cpp @@ -2898,7 +2898,7 @@ namespace wiGraphicsTypes } static_cast(commandLists[threadID])->RSSetViewports(NumViewports, d3dViewPorts); } - void GraphicsDevice_DX12::BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUUnorderedResource* const *ppUAVs, int slotUAV, int countUAV, + void GraphicsDevice_DX12::BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUResource* const *ppUAVs, int slotUAV, int countUAV, GRAPHICSTHREAD threadID, int arrayIndex) { } @@ -3085,10 +3085,26 @@ namespace wiGraphicsTypes } } } - void GraphicsDevice_DX12::BindUnorderedAccessResourceCS(const GPUUnorderedResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex) + void GraphicsDevice_DX12::BindUnorderedAccessResourceCS(const GPUResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex) { - if (resource != nullptr) + if (resource != nullptr && resource->resource_DX12 != nullptr) { + D3D12_RESOURCE_STATES currentState = _ConvertResourceStates(resource->resourceState[threadID]); + D3D12_RESOURCE_STATES requiredState = D3D12_RESOURCE_STATE_UNORDERED_ACCESS; + if (currentState != requiredState) + { + D3D12_RESOURCE_BARRIER barrier = {}; + barrier.Flags = D3D12_RESOURCE_BARRIER_FLAG_NONE; + barrier.Transition.pResource = resource->resource_DX12; + barrier.Transition.StateBefore = currentState; + barrier.Transition.StateAfter = requiredState; + barrier.Transition.Subresource = D3D12_RESOURCE_BARRIER_ALL_SUBRESOURCES; + barrier.Type = D3D12_RESOURCE_BARRIER_TYPE_TRANSITION; + static_cast(commandLists[threadID])->ResourceBarrier(1, &barrier); + + const_cast(resource)->resourceState[threadID] = _ConvertResourceStates_Inv(requiredState); + } + D3D12_CPU_DESCRIPTOR_HANDLE dst = ResourceDescriptorHeapGPU[threadID]->GetCPUDescriptorHandleForHeapStart(); int offset = CS * GPU_RESOURCE_HEAP_COUNT + GPU_RESOURCE_HEAP_CBV_COUNT + GPU_RESOURCE_HEAP_SRV_COUNT + slot; dst.ptr += (SIZE_T)(offset * device->GetDescriptorHandleIncrementSize(D3D12_DESCRIPTOR_HEAP_TYPE_CBV_SRV_UAV)); @@ -3107,7 +3123,7 @@ namespace wiGraphicsTypes } } } - void GraphicsDevice_DX12::BindUnorderedAccessResourcesCS(const GPUUnorderedResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) + void GraphicsDevice_DX12::BindUnorderedAccessResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) { if (resources != nullptr) { diff --git a/WickedEngine/wiGraphicsDevice_DX12.h b/WickedEngine/wiGraphicsDevice_DX12.h index e010b74b9..2577b736f 100644 --- a/WickedEngine/wiGraphicsDevice_DX12.h +++ b/WickedEngine/wiGraphicsDevice_DX12.h @@ -120,7 +120,7 @@ namespace wiGraphicsTypes ///////////////Thread-sensitive//////////////////////// virtual void BindViewports(UINT NumViewports, const ViewPort *pViewports, GRAPHICSTHREAD threadID) override; - virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUUnorderedResource* const *ppUAVs, int slotUAV, int countUAV, + virtual void BindRenderTargetsUAVs(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GPUResource* const *ppUAVs, int slotUAV, int countUAV, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; virtual void BindRenderTargets(UINT NumViews, Texture* const *ppRenderTargets, Texture2D* depthStencilTexture, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; virtual void ClearRenderTarget(Texture* pTexture, const FLOAT ColorRGBA[4], GRAPHICSTHREAD threadID, int arrayIndex = -1) override; @@ -137,8 +137,8 @@ namespace wiGraphicsTypes virtual void BindResourcesDS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void BindResourcesHS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void BindResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; - virtual void BindUnorderedAccessResourceCS(const GPUUnorderedResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; - virtual void BindUnorderedAccessResourcesCS(const GPUUnorderedResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; + virtual void BindUnorderedAccessResourceCS(const GPUResource* resource, int slot, GRAPHICSTHREAD threadID, int arrayIndex = -1) override; + virtual void BindUnorderedAccessResourcesCS(const GPUResource *const* resources, int slot, int count, GRAPHICSTHREAD threadID) override; virtual void UnBindResources(int slot, int num, GRAPHICSTHREAD threadID) override; virtual void UnBindUnorderedAccessResources(int slot, int num, GRAPHICSTHREAD threadID) override; virtual void BindSamplerPS(const Sampler* sampler, int slot, GRAPHICSTHREAD threadID) override; diff --git a/WickedEngine/wiGraphicsResource.cpp b/WickedEngine/wiGraphicsResource.cpp index 9f9c8ed4c..50d4af7c7 100644 --- a/WickedEngine/wiGraphicsResource.cpp +++ b/WickedEngine/wiGraphicsResource.cpp @@ -73,6 +73,8 @@ namespace wiGraphicsTypes { SAFE_INIT(SRV_DX11); SAFE_INIT(SRV_DX12); + SAFE_INIT(UAV_DX11); + SAFE_INIT(UAV_DX12); SAFE_INIT(resource_DX12); for (int i = 0; i < ARRAYSIZE(resourceState); ++i) @@ -94,16 +96,7 @@ namespace wiGraphicsTypes SAFE_DELETE(x); } - SAFE_RELEASE(resource_DX12); - } - GPUUnorderedResource::GPUUnorderedResource() - { - SAFE_INIT(UAV_DX11); - SAFE_INIT(UAV_DX12); - } - GPUUnorderedResource::~GPUUnorderedResource() - { SAFE_RELEASE(UAV_DX11); for (auto& x : additionalUAVs_DX11) { @@ -115,9 +108,12 @@ namespace wiGraphicsTypes { SAFE_DELETE(x); } + + + SAFE_RELEASE(resource_DX12); } - GPUBuffer::GPUBuffer() : GPUResource(), GPUUnorderedResource() + GPUBuffer::GPUBuffer() : GPUResource() { SAFE_INIT(resource_DX11); } @@ -173,7 +169,7 @@ namespace wiGraphicsTypes SAFE_DELETE(vertexLayout); } - Texture::Texture() : GPUResource(), GPUUnorderedResource() + Texture::Texture() : GPUResource() , independentRTVArraySlices(false), independentRTVCubemapFaces(false) , independentSRVMIPs(false), independentUAVMIPs(false) { diff --git a/WickedEngine/wiGraphicsResource.h b/WickedEngine/wiGraphicsResource.h index 289109592..4cf663909 100644 --- a/WickedEngine/wiGraphicsResource.h +++ b/WickedEngine/wiGraphicsResource.h @@ -153,6 +153,12 @@ namespace wiGraphicsTypes std::vector additionalSRVs_DX11; // can be used for sub-resources if requested D3D12_CPU_DESCRIPTOR_HANDLE* SRV_DX12; // main resource SRV std::vector additionalSRVs_DX12; // can be used for sub-resources if requested + + ID3D11UnorderedAccessView* UAV_DX11; // main resource UAV + std::vector additionalUAVs_DX11; // can be used for sub-resources if requested + D3D12_CPU_DESCRIPTOR_HANDLE* UAV_DX12; // main resource UAV + std::vector additionalUAVs_DX12; // can be used for sub-resources if requested + ID3D12Resource* resource_DX12; RESOURCE_STATES resourceState[10]; @@ -162,22 +168,7 @@ namespace wiGraphicsTypes virtual ~GPUResource(); }; - class GPUUnorderedResource - { - friend class GraphicsDevice_DX11; - friend class GraphicsDevice_DX12; - private: - ID3D11UnorderedAccessView* UAV_DX11; // main resource UAV - std::vector additionalUAVs_DX11; // can be used for sub-resources if requested - D3D12_CPU_DESCRIPTOR_HANDLE* UAV_DX12; // main resource UAV - std::vector additionalUAVs_DX12; // can be used for sub-resources if requested - - protected: - GPUUnorderedResource(); - virtual ~GPUUnorderedResource(); - }; - - class GPUBuffer : public GPUResource, public GPUUnorderedResource + class GPUBuffer : public GPUResource { friend class GraphicsDevice_DX11; friend class GraphicsDevice_DX12; @@ -277,7 +268,7 @@ namespace wiGraphicsTypes ~VertexShaderInfo(); }; - class Texture : public GPUResource, public GPUUnorderedResource + class Texture : public GPUResource { friend class GraphicsDevice_DX11; friend class GraphicsDevice_DX12; diff --git a/WickedEngine/wiHairParticle.cpp b/WickedEngine/wiHairParticle.cpp index e000e2796..454936df3 100644 --- a/WickedEngine/wiHairParticle.cpp +++ b/WickedEngine/wiHairParticle.cpp @@ -531,9 +531,9 @@ void wiHairParticle::ComputeCulling(Camera* camera, GRAPHICSTHREAD threadID) device->BindResourceCS(vb, 0, threadID); - const GPUUnorderedResource* uavs[] = { - static_cast(drawargs), - static_cast(ib), + const GPUResource* uavs[] = { + static_cast(drawargs), + static_cast(ib), }; device->BindUnorderedAccessResourcesCS(uavs, 0, ARRAYSIZE(uavs), threadID); diff --git a/WickedEngine/wiOcean.cpp b/WickedEngine/wiOcean.cpp index f4c9f7503..f8cbaacb1 100644 --- a/WickedEngine/wiOcean.cpp +++ b/WickedEngine/wiOcean.cpp @@ -261,7 +261,7 @@ void wiOcean::UpdateDisplacementMap(float time, GRAPHICSTHREAD threadID) }; device->BindResourcesCS(cs0_srvs, TEXSLOT_ONDEMAND0, 2, threadID); - GPUUnorderedResource* cs0_uavs[1] = { m_pBuffer_Float2_Ht }; + GPUResource* cs0_uavs[1] = { m_pBuffer_Float2_Ht }; device->BindUnorderedAccessResourcesCS(cs0_uavs, 0, 1, threadID); Ocean_Simulation_PerFrameCB perFrameData; @@ -294,7 +294,7 @@ void wiOcean::UpdateDisplacementMap(float time, GRAPHICSTHREAD threadID) // Update displacement map: //device->BindCS(m_pUpdateDisplacementMapCS, threadID); device->BindComputePSO(&CPSO_updateDisplacementMap, threadID); - GPUUnorderedResource* cs_uavs[] = { m_pDisplacementMap }; + GPUResource* cs_uavs[] = { m_pDisplacementMap }; device->BindUnorderedAccessResourcesCS(cs_uavs, 0, 1, threadID); GPUResource* cs_srvs[1] = { m_pBuffer_Float_Dxyz }; device->BindResourcesCS(cs_srvs, TEXSLOT_ONDEMAND0, 1, threadID); diff --git a/WickedEngine/wiRenderer.cpp b/WickedEngine/wiRenderer.cpp index 12a1d2848..0bd4a59d1 100644 --- a/WickedEngine/wiRenderer.cpp +++ b/WickedEngine/wiRenderer.cpp @@ -3237,7 +3237,7 @@ void wiRenderer::UpdateRenderData(GRAPHICSTHREAD threadID) &mesh->vertexBuffer_POS, &mesh->vertexBuffer_BON, }; - const GPUUnorderedResource* sos[] = { + const GPUResource* sos[] = { &mesh->streamoutBuffer_POS, &mesh->streamoutBuffer_PRE, }; @@ -5374,7 +5374,7 @@ void wiRenderer::VoxelRadiance(GRAPHICSTHREAD threadID) VP.MaxDepth = 1.0f; GetDevice()->BindViewports(1, &VP, threadID); - GPUUnorderedResource* UAVs[] = { resourceBuffers[RBTYPE_VOXELSCENE] }; + GPUResource* UAVs[] = { resourceBuffers[RBTYPE_VOXELSCENE] }; GetDevice()->BindRenderTargetsUAVs(0, nullptr, nullptr, UAVs, 0, 1, threadID); RenderMeshes(center, culledRenderer, SHADERTYPE_VOXELIZE, RENDERTYPE_OPAQUE, threadID); @@ -5598,10 +5598,10 @@ void wiRenderer::ComputeTiledLightCulling(bool deferred, GRAPHICSTHREAD threadID if (deferred) { - const GPUUnorderedResource* uavs[] = { - static_cast(textures[TEXTYPE_2D_TILEDDEFERRED_DIFFUSEUAV]), - static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]), - static_cast(textures[TEXTYPE_2D_TILEDDEFERRED_SPECULARUAV]), + const GPUResource* uavs[] = { + static_cast(textures[TEXTYPE_2D_TILEDDEFERRED_DIFFUSEUAV]), + static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]), + static_cast(textures[TEXTYPE_2D_TILEDDEFERRED_SPECULARUAV]), }; device->BindUnorderedAccessResourcesCS(uavs, UAVSLOT_TILEDDEFERRED_DIFFUSE, ARRAYSIZE(uavs), threadID); @@ -5610,9 +5610,9 @@ void wiRenderer::ComputeTiledLightCulling(bool deferred, GRAPHICSTHREAD threadID } else { - const GPUUnorderedResource* uavs[] = { - static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_OPAQUE]), - static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]), + const GPUResource* uavs[] = { + static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_OPAQUE]), + static_cast(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]), }; device->BindUnorderedAccessResourcesCS(uavs, UAVSLOT_ENTITYINDEXLIST_OPAQUE, ARRAYSIZE(uavs), threadID); }