dx12 UAV barrier + device wrapper update
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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<UINT>(slot), static_cast<UINT>(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];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -2898,7 +2898,7 @@ namespace wiGraphicsTypes
|
||||
}
|
||||
static_cast<ID3D12GraphicsCommandList*>(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<ID3D12GraphicsCommandList*>(commandLists[threadID])->ResourceBarrier(1, &barrier);
|
||||
|
||||
const_cast<GPUResource*>(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)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -153,6 +153,12 @@ namespace wiGraphicsTypes
|
||||
std::vector<ID3D11ShaderResourceView*> additionalSRVs_DX11; // can be used for sub-resources if requested
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE* SRV_DX12; // main resource SRV
|
||||
std::vector<D3D12_CPU_DESCRIPTOR_HANDLE*> additionalSRVs_DX12; // can be used for sub-resources if requested
|
||||
|
||||
ID3D11UnorderedAccessView* UAV_DX11; // main resource UAV
|
||||
std::vector<ID3D11UnorderedAccessView*> additionalUAVs_DX11; // can be used for sub-resources if requested
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE* UAV_DX12; // main resource UAV
|
||||
std::vector<D3D12_CPU_DESCRIPTOR_HANDLE*> 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<ID3D11UnorderedAccessView*> additionalUAVs_DX11; // can be used for sub-resources if requested
|
||||
D3D12_CPU_DESCRIPTOR_HANDLE* UAV_DX12; // main resource UAV
|
||||
std::vector<D3D12_CPU_DESCRIPTOR_HANDLE*> 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;
|
||||
|
||||
@@ -531,9 +531,9 @@ void wiHairParticle::ComputeCulling(Camera* camera, GRAPHICSTHREAD threadID)
|
||||
|
||||
device->BindResourceCS(vb, 0, threadID);
|
||||
|
||||
const GPUUnorderedResource* uavs[] = {
|
||||
static_cast<const GPUUnorderedResource*>(drawargs),
|
||||
static_cast<const GPUUnorderedResource*>(ib),
|
||||
const GPUResource* uavs[] = {
|
||||
static_cast<const GPUResource*>(drawargs),
|
||||
static_cast<const GPUResource*>(ib),
|
||||
};
|
||||
device->BindUnorderedAccessResourcesCS(uavs, 0, ARRAYSIZE(uavs), threadID);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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<const GPUUnorderedResource*>(textures[TEXTYPE_2D_TILEDDEFERRED_DIFFUSEUAV]),
|
||||
static_cast<const GPUUnorderedResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]),
|
||||
static_cast<const GPUUnorderedResource*>(textures[TEXTYPE_2D_TILEDDEFERRED_SPECULARUAV]),
|
||||
const GPUResource* uavs[] = {
|
||||
static_cast<const GPUResource*>(textures[TEXTYPE_2D_TILEDDEFERRED_DIFFUSEUAV]),
|
||||
static_cast<const GPUResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]),
|
||||
static_cast<const GPUResource*>(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<const GPUUnorderedResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_OPAQUE]),
|
||||
static_cast<const GPUUnorderedResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]),
|
||||
const GPUResource* uavs[] = {
|
||||
static_cast<const GPUResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_OPAQUE]),
|
||||
static_cast<const GPUResource*>(resourceBuffers[RBTYPE_ENTITYINDEXLIST_TRANSPARENT]),
|
||||
};
|
||||
device->BindUnorderedAccessResourcesCS(uavs, UAVSLOT_ENTITYINDEXLIST_OPAQUE, ARRAYSIZE(uavs), threadID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user