37 Microsoft::WRL::ComPtr<ID3D12GraphicsCommandList2> commandList;
38 const std::shared_ptr<CommandQueueD3D12> owningQueue;
40 std::shared_ptr<struct RenderPassD3D12> currentRenderPass;
41 std::shared_ptr<struct RenderPipelineD3D12> currentRenderPipeline;
42 std::shared_ptr<struct ComputePipelineD3D12> currentComputePipeline;
47 D3D12_RESOURCE_STATES state;
50 std::unordered_map<const struct D3D12TrackedResource*, ResourceLastUse> activeBuffers;
52 std::unordered_map<D3D12TextureLastUseKey, ResourceLastUse> activeTextures;
67 void BeginRendering(RGLRenderPassPtr) final;
68 void EndRendering() final;
70 void BindRenderPipeline(RGLRenderPipelinePtr) final;
71 void BeginCompute(RGLComputePipelinePtr) final;
72 void EndCompute() final;
73 void DispatchCompute(uint32_t threadsX, uint32_t threadsY, uint32_t threadsZ, uint32_t threadsPerThreadgroupX=1, uint32_t threadsPerThreadgroupY=1, uint32_t threadsPerThreadgroupZ=1) final;
75 void BindBuffer(RGLBufferPtr buffer, uint32_t bindingOffset, uint32_t offsetIntoBuffer = 0) final;
76 void BindComputeBuffer(RGLBufferPtr buffer, uint32_t binding, uint32_t offsetIntoBuffer = 0) final;
77 void SetVertexBuffer(RGLBufferPtr buffer, const
VertexBufferBinding& bindingInfo = {})
final;
79 void SetVertexBytes(
const untyped_span data, uint32_t offset)
final;
80 void SetFragmentBytes(
const untyped_span data, uint32_t offset)
final;
81 void SetComputeBytes(
const untyped_span data, uint32_t offset)
final;
83 void SetIndexBuffer(RGLBufferPtr buffer)
final;
85 void SetVertexSampler(RGLSamplerPtr sampler, uint32_t index)
final;
86 void SetFragmentSampler(RGLSamplerPtr sampler, uint32_t index)
final;
87 void SetComputeSampler(RGLSamplerPtr sampler, uint32_t index)
final;
89 void SetVertexTexture(
const TextureView& texture, uint32_t index)
final;
90 void SetFragmentTexture(
const TextureView& texture, uint32_t index)
final;
91 void SetComputeTexture(
const TextureView& texture, uint32_t index)
final;
96 void BindBindlessBufferDescriptorSet(uint32_t set_idx)
final;
98 void SetViewport(
const Viewport&)
final;
99 void SetScissor(
const Rect&)
final;
101 void CopyTextureToBuffer(TextureView& sourceTexture,
const Rect& sourceRect,
size_t offset, RGLBufferPtr desetBuffer)
final;
103 void CopyBufferToTexture(RGLBufferPtr source, uint32_t size,
const TextureDestConfig& dest)
final;
105 void CopyBufferToBuffer(BufferCopyConfig from, BufferCopyConfig to, uint32_t size)
final;
107 void CopyTextureToTexture(
const TextureCopyConfig& from,
const TextureCopyConfig& to)
final;
110 void Commit(
const CommitConfig&)
final;
112 void ExecuteIndirectIndexed(
const IndirectConfig&)
final;
113 void ExecuteIndirect(
const IndirectConfig&)
final;
114 void DispatchIndirect(
const DispatchIndirectConfig&)
final;
116 void BeginRenderDebugMarker(
const std::string& label)
final;
117 void BeginComputeDebugMarker(
const std::string& label)
final;
119 void EndRenderDebugMarker() final;
120 void EndComputeDebugMarker() final;
122 void UseResource(const TextureView& tx) final;
123 void UseResource(const RGLBufferPtr buffer) final;
125 void BlockUntilCompleted() final;
127 virtual ~CommandBufferD3D12();
129 void SyncIfNeeded(const BufferD3D12* buffer, D3D12_RESOURCE_STATES needed,
bool written = false);
130 void SyncIfNeeded(TextureView texture, D3D12_RESOURCE_STATES needed,
bool written);
131 D3D12_RESOURCE_STATES GetBufferCurrentResourceState(const struct D3D12TrackedResource*);
132 HANDLE internalFenceEvent;
133 Microsoft::WRL::ComPtr<ID3D12Fence> internalFence;
Definition D3D12CommandBuffer.hpp:11
Definition Texture.hpp:43