summaryrefslogtreecommitdiff
path: root/chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h')
-rw-r--r--chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h31
1 files changed, 15 insertions, 16 deletions
diff --git a/chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h b/chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h
index 458e9926f7d..dc5fb756658 100644
--- a/chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h
+++ b/chromium/third_party/dawn/src/dawn_native/d3d12/BindGroupD3D12.h
@@ -15,37 +15,36 @@
#ifndef DAWNNATIVE_D3D12_BINDGROUPD3D12_H_
#define DAWNNATIVE_D3D12_BINDGROUPD3D12_H_
+#include "common/PlacementAllocated.h"
+#include "common/Serial.h"
#include "dawn_native/BindGroup.h"
-
#include "dawn_native/d3d12/d3d12_platform.h"
-#include "dawn_native/d3d12/DescriptorHeapAllocator.h"
-
namespace dawn_native { namespace d3d12 {
class Device;
+ class ShaderVisibleDescriptorAllocator;
- class BindGroup : public BindGroupBase {
+ class BindGroup : public BindGroupBase, public PlacementAllocated {
public:
+ static BindGroup* Create(Device* device, const BindGroupDescriptor* descriptor);
+
BindGroup(Device* device, const BindGroupDescriptor* descriptor);
+ ~BindGroup() override;
- void AllocateDescriptors(const DescriptorHeapHandle& cbvSrvUavHeapStart,
- uint32_t* cbvUavSrvHeapOffset,
- const DescriptorHeapHandle& samplerHeapStart,
- uint32_t* samplerHeapOffset);
- uint32_t GetCbvUavSrvHeapOffset() const;
- uint32_t GetSamplerHeapOffset() const;
+ // Returns true if the BindGroup was successfully populated.
+ ResultOrError<bool> Populate(ShaderVisibleDescriptorAllocator* allocator);
- bool TestAndSetCounted(uint64_t heapSerial, uint32_t indexInSubmit);
+ D3D12_GPU_DESCRIPTOR_HANDLE GetBaseCbvUavSrvDescriptor() const;
+ D3D12_GPU_DESCRIPTOR_HANDLE GetBaseSamplerDescriptor() const;
private:
- uint32_t mCbvUavSrvHeapOffset;
- uint32_t mSamplerHeapOffset;
+ Serial mLastUsageSerial = 0;
+ Serial mHeapSerial = 0;
- uint64_t mHeapSerial = 0;
- uint32_t mIndexInSubmit = 0;
+ D3D12_GPU_DESCRIPTOR_HANDLE mBaseCbvSrvUavDescriptor = {0};
+ D3D12_GPU_DESCRIPTOR_HANDLE mBaseSamplerDescriptor = {0};
};
-
}} // namespace dawn_native::d3d12
#endif // DAWNNATIVE_D3D12_BINDGROUPD3D12_H_