4#include <unordered_map>
8#include "shader/ComputeShaderInterface.h"
9#include "render/directx/resource/DirectXResource.h"
10#include "render/directx/descriptors/DirectXDescriptorHeap.h"
13#include "directx/d3dx12.h"
50 const std::string& sShaderResourceName,
51 ComputeResourceUsage usage,
52 bool bUpdateOnlyCurrentFrameResourceDescriptors =
false)
override;
63 for (
const auto& [iRootParameterIndex, pResource] :
cbvResources) {
64 pCommandList->SetComputeRootConstantBufferView(
65 iRootParameterIndex, pResource->getInternalResource()->GetGPUVirtualAddress());
69 for (
const auto& [iRootParameterIndex, pResource] :
uavResources) {
70 pCommandList->SetComputeRootUnorderedAccessView(
71 iRootParameterIndex, pResource->getInternalResource()->GetGPUVirtualAddress());
75 for (
const auto& [iRootParameterIndex, pResource] :
srvResources) {
76 pCommandList->SetComputeRootShaderResourceView(
77 iRootParameterIndex, pResource->getInternalResource()->GetGPUVirtualAddress());
81 for (
const auto& [iRootParameterIndex, pDescriptor] :
tableResources) {
83 pCommandList->SetComputeRootDescriptorTable(
85 D3D12_GPU_DESCRIPTOR_HANDLE{
Definition: ComputeShaderInterface.h:46
unsigned int getThreadGroupCountX() const
Definition: ComputeShaderInterface.h:223
Renderer * pRenderer
Definition: ComputeShaderInterface.h:241
unsigned int getThreadGroupCountY() const
Definition: ComputeShaderInterface.h:230
const ComputeExecutionGroup executionGroup
Definition: ComputeShaderInterface.h:259
const ComputeExecutionStage executionStage
Definition: ComputeShaderInterface.h:256
unsigned int getThreadGroupCountZ() const
Definition: ComputeShaderInterface.h:237
const std::string sComputeShaderName
Definition: ComputeShaderInterface.h:262
Definition: DirectXDescriptorHeap.h:211
ID3D12DescriptorHeap * getInternalHeap() const
Definition: DirectXDescriptorHeap.h:348
Definition: GpuResource.h:16
Definition: HlslComputeShaderInterface.h:17
DirectXDescriptorHeap * pCbvSrvUavHeap
Definition: HlslComputeShaderInterface.h:123
void dispatchOnGraphicsQueue(ID3D12GraphicsCommandList *pCommandList)
Definition: HlslComputeShaderInterface.h:61
virtual std::optional< Error > bindResource(GpuResource *pResource, const std::string &sShaderResourceName, ComputeResourceUsage usage, bool bUpdateOnlyCurrentFrameResourceDescriptors=false) override
Definition: HlslComputeShaderInterface.cpp:30
std::unordered_map< UINT, DirectXResource * > uavResources
Definition: HlslComputeShaderInterface.h:114
std::unordered_map< UINT, DirectXDescriptor * > tableResources
Definition: HlslComputeShaderInterface.h:120
std::unordered_map< UINT, DirectXResource * > cbvResources
Definition: HlslComputeShaderInterface.h:111
UINT iCbvSrvUavDescriptorSize
Definition: HlslComputeShaderInterface.h:126
std::unordered_map< UINT, DirectXResource * > srvResources
Definition: HlslComputeShaderInterface.h:117
Definition: Renderer.h:43