23 void init(
RenderList& renderer, QRhiResourceUpdateBatch& res)
override;
24 void update(
RenderList& renderer, QRhiResourceUpdateBatch& res,
Edge* edge)
override;
27 void runInitialPasses(
28 RenderList&, QRhiCommandBuffer& commands, QRhiResourceUpdateBatch*& res,
31 void runRenderPass(
RenderList&, QRhiCommandBuffer& commands,
Edge& edge)
override;
35 void createComputePipeline(
RenderList& renderer);
38 std::vector<Sampler> allSamplers()
const noexcept;
41 void registerCommonExpressionVariables(
42 ossia::math_expression& e, ossia::small_pod_vector<double, 16>& data)
const;
45 std::optional<QSize> getImageSize(
const isf::csf_image_input&)
const noexcept;
46 QSize computeTextureSize(
const isf::csf_image_input& img)
const noexcept;
49 int calculateStorageBufferSize(std::span<const isf::storage_input::layout_field> layout,
int arrayCount)
const;
51 RenderList& renderer,
const QString& name,
const QString& access,
int size);
52 void updateStorageBuffers(
RenderList& renderer, QRhiResourceUpdateBatch& res);
53 void recreateShaderResourceBindings(
RenderList& renderer, QRhiResourceUpdateBatch& res);
54 int getArraySizeFromUI(
const QString& bufferName)
const;
55 QString updateShaderWithImageFormats(QString current);
58 void updateGeometryBindings(
RenderList& renderer, QRhiResourceUpdateBatch& res);
59 void pushOutputGeometry(
RenderList& renderer, QRhiResourceUpdateBatch& res,
Edge& edge);
60 int resolveCountExpression(
61 const std::string& expr,
const isf::geometry_input& geo,
62 const std::string& fieldName)
const;
63 int resolveDispatchExpression(
const std::string& expr)
const;
69 QRhiComputePipeline* pipeline{};
70 QRhiShaderResourceBindings* srb{};
71 QRhiBuffer* processUBO{};
77 QRhiSampler* outputSampler{};
81 ossia::small_vector<std::pair<Edge*, ComputePass>, 2> m_computePasses;
82 ossia::small_vector<std::pair<Edge*, GraphicsPass>, 2> m_graphicsPasses;
86 std::vector<Sampler> m_inputSamplers;
93 int64_t lastKnownSize{};
96 std::vector<isf::storage_input::layout_field> layout;
98 std::string buffer_usage;
100 std::vector<StorageBuffer> m_storageBuffers;
103 std::vector<std::pair<const score::gfx::Port*, int>> m_outStorageBuffers;
108 QRhiTexture* texture{};
111 QRhiTexture::Format format{QRhiTexture::RGBA8};
113 std::vector<StorageImage> m_storageImages;
116 std::vector<std::pair<const score::gfx::Port*, int>> m_outStorageImages;
119 struct GeometryBinding
124 QRhiBuffer* buffer{};
125 QRhiBuffer* read_buffer{};
130 bool per_instance{
false};
131 const void* lastUploadSrc{};
134 QRhiBuffer* scatterStaging{};
135 int64_t scatterStagingSize{};
138 bool scatterPending{
false};
145 QRhiBuffer* buffer{};
146 QRhiBuffer* read_buffer{};
151 std::vector<isf::storage_input::layout_field> layout;
152 std::string size_expr;
155 std::vector<AttributeSSBO> attribute_ssbos;
156 std::vector<AuxiliarySSBO> auxiliary_ssbos;
158 int instance_count{1};
159 int input_port_index{-1};
160 bool has_output{
false};
161 bool has_vertex_count_spec{
false};
162 bool has_instance_count_spec{
false};
163 bool is_feedback_receiver{
false};
164 bool pending_initial_copy{
false};
168 std::vector<QRhiBuffer*> copyFromBuffers;
172 ossia::geometry_spec outputGeometry;
173 int prev_vertex_count{-1};
174 int prev_instance_count{-1};
175 int prev_attribute_count{-1};
176 int prev_upstream_attr_count{-1};
178#if QT_VERSION >= QT_VERSION_CHECK(6, 12, 0)
179 QRhiBuffer* indirectDrawBuffer{};
180 bool uses_indirect_draw{
false};
181 bool indirect_draw_indexed{
false};
184 std::vector<GeometryBinding> m_geometryBindings;
186 QRhiBuffer* m_materialUBO{};
187 int m_materialSize{};
190 QRhiTexture* m_outputTexture{};
191 QRhiTexture::Format m_outputFormat{QRhiTexture::RGBA8};
194 QRhiComputePipeline* m_computePipeline{};
195 QShader m_computeShader;
196 QString m_computeShaderSource;
197 std::vector<QRhiComputePipeline*> m_perPassPipelines;
198 std::vector<QRhiComputePipeline*> m_ownedPipelines;
199 bool m_pipelinesDirty{
true};
202 GPUBufferScatter m_gpuScatter;
203 bool m_gpuScatterAvailable{
false};
210 bool m_inputsHaveBeenWritten{
false};
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:122