Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 948 vs 949 for /trunk/Source Code/Platform/Video/Headers/RenderPackage.h

Diff revisions: vs.
  @@ -36,7 +36,19 @@
36 36
37 37 namespace Divide {
38 38
39 + class RenderingComponent;
40 + namespace Attorney {
41 + class RenderPackageRenderingComponent;
42 + };
43 +
39 44 class RenderPackage {
45 + friend class Attorney::RenderPackageRenderingComponent;
46 + public:
47 + struct CommandEntry {
48 + size_t _index = 0;
49 + GFX::CommandType _type = GFX::CommandType::COUNT;
50 + };
51 +
40 52 public:
41 53 explicit RenderPackage(GFXDevice& context, bool useSecondaryBuffers);
42 54 ~RenderPackage();
  @@ -54,9 +66,11 @@
54 66
55 67 const GFX::CommandBuffer& commands() const;
56 68
57 - size_t drawCommandCount() const;
58 - const GenericDrawCommand& drawCommand(I32 index) const;
59 - void drawCommand(I32 index, const GenericDrawCommand cmd);
69 + I32 drawCommandCount() const;
70 + const GenericDrawCommand& drawCommand(I32 index, I32 cmdIndex) const;
71 + void drawCommand(I32 index, I32 cmdIndex, const GenericDrawCommand& cmd);
72 +
73 + const GFX::DrawCommand& drawCommand(I32 index) const;
60 74
61 75 const Pipeline& pipeline(I32 index) const;
62 76 void pipeline(I32 index, const Pipeline& pipeline);
  @@ -75,12 +89,12 @@
75 89 void addClipPlanesCommand(const GFX::SetClipPlanesCommand& clipPlanes);
76 90 void addPushConstantsCommand(const GFX::SendPushConstantsCommand& pushConstants);
77 91 void addDescriptorSetsCommand(const GFX::BindDescriptorSetsCommand& descriptorSets);
78 -
92 + void addCommandBuffer(const GFX::CommandBuffer& commandBuffer);
93 +
79 94 protected:
80 - friend class RenderingComponent;
81 - //eventually phase this out
82 - GFX::CommandBuffer& commands();
83 - GenericDrawCommand& drawCommand(I32 index);
95 + // Return true if the command buffer was reconstructed
96 + bool buildCommandBuffer();
97 + GFX::DrawCommand& drawCommand(I32 cmdIdx);
84 98
85 99 private:
86 100 GFXDevice& _context;
  @@ -88,27 +102,47 @@
88 102 bool _isOcclusionCullable;
89 103 bool _secondaryCommandPool;
90 104
91 - vectorImpl<GenericDrawCommand> _drawCommands;
105 + vectorImpl<GFX::DrawCommand> _drawCommands;
92 106 bool _drawCommandDirty = true;
93 107
94 - vectorImpl<Pipeline> _pipelines;
108 + vectorImpl<GFX::BindPipelineCommand> _pipelines;
95 109 bool _pipelineDirty = true;
96 110
97 - vectorImpl<ClipPlaneList> _clipPlanes;
111 + vectorImpl<GFX::SetClipPlanesCommand> _clipPlanes;
98 112 bool _clipPlanesDirty = true;
99 113
100 - vectorImpl<PushConstants> _pushConstants;
114 + vectorImpl<GFX::SendPushConstantsCommand> _pushConstants;
101 115 bool _pushConstantsDirty = true;
102 116
103 - vectorImpl<DescriptorSet> _descriptorSets;
117 + vectorImpl<GFX::BindDescriptorSetsCommand> _descriptorSets;
104 118 bool _descriptorSetsDirty = true;
105 119
106 - private:
120 + protected:
121 + vectorImpl<CommandEntry> _commandOrdering;
107 122 // Cached command buffer
108 123 bool _commandBufferDirty = true;
109 124 GFX::CommandBuffer* _commands;
110 125 };
111 126
112 - }; //namespace Divide
127 + namespace Attorney {
128 + class RenderPackageRenderingComponent {
129 + private:
130 + static GFX::CommandBuffer* commands(const RenderPackage& pkg) {
131 + return pkg._commands;
132 + }
133 +
134 + // Return true if the command buffer was reconstructed
135 + static bool buildCommandBuffer(RenderPackage& pkg) {
136 + return pkg.buildCommandBuffer();
137 + }
138 +
139 + static GFX::DrawCommand& drawCommand(RenderPackage& pkg, I32 cmdIdx) {
140 + return pkg.drawCommand(cmdIdx);
141 + }
142 +
143 + friend class Divide::RenderingComponent;
144 + };
145 + }; // namespace Attorney
146 + }; // namespace Divide
113 147
114 148 #endif //_RENDER_PACKAGE_H_