Debian Codegraph @

Source/Core/VideoBackends/D3D12/D3D12VertexManager.h

raw symbols SCIP
1 // Copyright 2019 Dolphin Emulator Project
2 // SPDX-License-Identifier: GPL-2.0-or-later
3
4 #pragma once
5
6 #include <memory>
7
8 #include "VideoBackends/D3D12/D3D12StreamBuffer.h"
9 #include "VideoBackends/D3D12/DescriptorHeapManager.h"
10 #include "VideoCommon/VertexManagerBase.h"
11
12 namespace DX12
13 {
14 class VertexManager final : public VertexManagerBase
15 {
16 public:
17 VertexManager();
18 ~VertexManager() override;
19
20 bool Initialize() override;
21
22 void UploadUtilityUniforms(const void* uniforms, u32 uniforms_size) override;
23 bool UploadTexelBuffer(const void* data, u32 data_size, TexelBufferFormat format,
24 u32* out_offset) override;
25 bool UploadTexelBuffer(const void* data, u32 data_size, TexelBufferFormat format, u32* out_offset,
26 const void* palette_data, u32 palette_size,
27 TexelBufferFormat palette_format, u32* out_palette_offset) override;
28
29 protected:
30 void ResetBuffer(u32 vertex_stride) override;
31 void CommitBuffer(u32 num_vertices, u32 vertex_stride, u32 num_indices, u32* out_base_vertex,
32 u32* out_base_index) override;
33 void UploadUniforms() override;
34
35 void UpdateVertexShaderConstants();
36 void UpdateGeometryShaderConstants();
37 void UpdatePixelShaderConstants();
38 void UpdateCustomShaderConstants();
39
40 // Allocates storage in the uniform buffer of the specified size. If this storage cannot be
41 // allocated immediately, the current command buffer will be submitted and all stage's
42 // constants will be re-uploaded. false will be returned in this case, otherwise true.
43 bool ReserveConstantStorage();
44 void UploadAllConstants();
45
46 StreamBuffer m_vertex_stream_buffer;
47 StreamBuffer m_index_stream_buffer;
48 StreamBuffer m_uniform_stream_buffer;
49 StreamBuffer m_texel_stream_buffer;
50 std::array<DescriptorHandle, NUM_TEXEL_BUFFER_FORMATS> m_texel_buffer_views = {};
51 DescriptorHandle m_vertex_srv = {};
52 };
53
54 } // namespace DX12