2#include <Process/Dataflow/CableData.hpp>
4#include <Gfx/Graph/Mesh.hpp>
5#include <Gfx/Graph/RenderState.hpp>
6#include <Gfx/Graph/Scale.hpp>
7#include <Gfx/Graph/Uniforms.hpp>
8#include <Gfx/Graph/VertexFallbackPlan.hpp>
10#include <ossia/detail/hash_map.hpp>
11#include <ossia/detail/small_flat_map.hpp>
13#include <score_plugin_gfx_export.h>
15#include <QtCore/QDebug>
35struct RenderTargetSpecs;
36class VertexFallbackPool;
57 QRhiCommandBuffer* cb{};
59 ? QRhi::FrameOpDeviceLost
60 : rhi.beginOffscreenFrame(&cb);
61 if(m_beginResult == QRhi::FrameOpSuccess)
70 thread_local int nested = 0;
71 if((nested++ % 600) == 0)
72 qWarning() <<
"score.gfx: beginOffscreenFrame entered while a frame is "
73 "already recording; skipping this render (occurrence"
86 explicit operator bool()
const noexcept {
return m_commands; }
87 QRhiCommandBuffer& commands()
const noexcept {
return *m_commands; }
89 QRhi::FrameOpResult beginResult()
const noexcept {
return m_beginResult; }
90 QRhi::FrameOpResult endResult()
const noexcept {
return m_endResult; }
91 bool deviceLost()
const noexcept
93 return m_beginResult == QRhi::FrameOpDeviceLost
94 || m_endResult == QRhi::FrameOpDeviceLost;
97 QRhi::FrameOpResult end()
noexcept
102 m_commands =
nullptr;
103 m_endResult = rhi->endOffscreenFrame();
116 QRhiCommandBuffer* m_commands{};
117 QRhi::FrameOpResult m_beginResult{QRhi::FrameOpSuccess};
118 QRhi::FrameOpResult m_endResult{QRhi::FrameOpSuccess};
132 , swapChain{&swapChain}
138 if(rhi && rhi->isRecordingFrame())
139 rhi->endFrame(swapChain, QRhi::SkipPresent);
147 void release()
noexcept { rhi =
nullptr; }
151 QRhiSwapChain* swapChain{};
170 QRhiSampler* sampler{};
171 QRhiTexture* texture{};
172 QRhiTexture* fallback{};
183SCORE_PLUGIN_GFX_EXPORT
191 ossia::hash_map<RenderList*, Sampler> samplers;
193 std::vector<float> data;
235struct SCORE_PLUGIN_GFX_EXPORT
Edge
244 generation.fetch_add(1, std::memory_order_relaxed);
245 if(
auto it = std::find(source->edges.begin(), source->edges.end(),
this);
246 it != source->edges.end())
247 source->edges.erase(it);
248 if(
auto it = std::find(sink->
edges.begin(), sink->
edges.end(),
this);
249 it != sink->
edges.end())
250 sink->
edges.erase(it);
255 Process::CableType type{};
259 static inline std::atomic<uint64_t> generation{0};
268 for(
const Edge* e : output.edges)
269 if(e && e->sink && (e->sink->flags & Flag::GrabsFromSource) == Flag::GrabsFromSource)
279 QRhiGraphicsPipeline* pipeline{};
280 QRhiShaderResourceBindings* srb{};
292 pipeline->deleteLater();
311 QRhiTexture* texture{};
312 QRhiRenderBuffer* colorRenderBuffer{};
313 QRhiRenderBuffer* depthRenderBuffer{};
314 QRhiRenderPassDescriptor* renderPass{};
315 QRhiRenderTarget* renderTarget{};
317 std::vector<QRhiTexture*> additionalColorTextures;
318 std::vector<QRhiRenderBuffer*> additionalColorRenderBuffers;
319 QRhiTexture* depthTexture{};
320 QRhiTexture* msDepthTexture{};
324 QRhiTexture* dummyColorTexture{};
330 int multiViewCount{0};
336 operator bool()
const noexcept {
return texture !=
nullptr || dummyColorTexture !=
nullptr || depthTexture !=
nullptr; }
338 int colorAttachmentCount()
const noexcept
341 return 1 + (int)additionalColorTextures.size();
342 if(dummyColorTexture)
350 bool hasStencil()
const noexcept
352 if(depthRenderBuffer)
353 return depthRenderBuffer->type() == QRhiRenderBuffer::DepthStencil;
354 for(
const QRhiTexture* t : {depthTexture, msDepthTexture})
360 case QRhiTexture::D24S8:
361#if QT_VERSION >= QT_VERSION_CHECK(6, 9, 0)
362 case QRhiTexture::D32FS8:
393 int sampleCount()
const noexcept
395 if(colorRenderBuffer)
396 return colorRenderBuffer->sampleCount();
398 return texture->sampleCount();
400 return msDepthTexture->sampleCount();
402 return depthTexture->sampleCount();
410 if(texture || dummyColorTexture || depthTexture)
417 texture->deleteLater();
420 if(dummyColorTexture)
421 dummyColorTexture->deleteLater();
422 dummyColorTexture =
nullptr;
424 for(
auto* t : additionalColorTextures)
426 additionalColorTextures.clear();
428 if(colorRenderBuffer)
429 colorRenderBuffer->deleteLater();
430 colorRenderBuffer =
nullptr;
432 for(
auto* rb : additionalColorRenderBuffers)
434 additionalColorRenderBuffers.clear();
436 if(depthRenderBuffer)
437 depthRenderBuffer->deleteLater();
438 depthRenderBuffer =
nullptr;
441 depthTexture->deleteLater();
442 depthTexture =
nullptr;
445 msDepthTexture->deleteLater();
446 msDepthTexture =
nullptr;
449 renderPass->deleteLater();
450 renderPass =
nullptr;
453 renderTarget->deleteLater();
454 renderTarget =
nullptr;
465 std::vector<QImage> frames;
471SCORE_PLUGIN_GFX_EXPORT
485SCORE_PLUGIN_GFX_EXPORT
486bool zeroTexture(QRhi& rhi, QRhiResourceUpdateBatch& res, QRhiTexture& tex);
493SCORE_PLUGIN_GFX_EXPORT
495 const RenderState& state, QRhiTexture::Format fmt, QSize sz,
int samples,
bool depth,
496 bool samplableDepth =
false, QRhiTexture::Flags flags = {});
504SCORE_PLUGIN_GFX_EXPORT
506 const RenderState& state,
507 std::span<QRhiTexture* const> colorTextures,
508 QRhiTexture* depthTexture,
524SCORE_PLUGIN_GFX_EXPORT
526 const RenderState& state, QSize sz,
int samples,
bool samplableDepth =
true,
527 QRhiTexture::Format depthFmt = QRhiTexture::D32F);
540SCORE_PLUGIN_GFX_EXPORT
542 const RenderState& state, QRhiTexture* externalDepthTexture,
int samples,
543 bool samplableDepth =
true);
554SCORE_PLUGIN_GFX_EXPORT
556 const RenderState& state, QRhiTexture* colorTextureArray,
int renderLayer,
557 QRhiTexture* depthTexture,
int samples);
567SCORE_PLUGIN_GFX_EXPORT
569 const RenderState& state, std::span<QRhiTexture* const> colorTextures,
570 int renderLayer, QRhiTexture* depthTexture,
int samples);
581SCORE_PLUGIN_GFX_EXPORT
583 const RenderState& state, QRhiTexture* colorTextureArray,
int multiViewCount,
584 QRhiTexture* depthTextureArray,
int samples);
593SCORE_PLUGIN_GFX_EXPORT
595 const RenderState& state, std::span<QRhiTexture* const> colorTextures,
596 int multiViewCount, QRhiTexture* depthTextureArray,
int samples);
605SCORE_PLUGIN_GFX_EXPORT
607 const std::string& fmt, QRhiTexture::Format fallback)
noexcept;
609SCORE_PLUGIN_GFX_EXPORT
610void replaceBuffer(QRhiShaderResourceBindings&,
int binding, QRhiBuffer* newBuffer);
611SCORE_PLUGIN_GFX_EXPORT
612void replaceSampler(QRhiShaderResourceBindings&,
int binding, QRhiSampler* newSampler);
613SCORE_PLUGIN_GFX_EXPORT
614void replaceTexture(QRhiShaderResourceBindings&,
int binding, QRhiTexture* newTexture);
616SCORE_PLUGIN_GFX_EXPORT
618 std::vector<QRhiShaderResourceBinding>&,
int binding, QRhiBuffer* newBuffer);
632SCORE_PLUGIN_GFX_EXPORT
633BufferRange bindableRange(
634 const QRhiBuffer* buf, int64_t offset, int64_t size,
const char* who,
635 bool uniform =
false) noexcept;
643SCORE_PLUGIN_GFX_EXPORT
645 const QRhiBuffer* buf,
bool uniform, int64_t offset, int64_t
range,
649SCORE_PLUGIN_GFX_EXPORT
651 QRhiShaderResourceBindings&,
int binding, QRhiBuffer* newBuffer, BufferRange
range);
652SCORE_PLUGIN_GFX_EXPORT
654 std::vector<QRhiShaderResourceBinding>&,
int binding, QRhiBuffer* newBuffer,
656SCORE_PLUGIN_GFX_EXPORT
658 std::vector<QRhiShaderResourceBinding>&,
int binding, QRhiSampler* newSampler);
659SCORE_PLUGIN_GFX_EXPORT
661 std::vector<QRhiShaderResourceBinding>&,
int binding, QRhiTexture* newTexture);
673SCORE_PLUGIN_GFX_EXPORT
675 std::vector<QRhiShaderResourceBinding>&,
int binding,
int element,
676 QRhiTexture* newTexture);
677SCORE_PLUGIN_GFX_EXPORT
679 QRhiShaderResourceBindings&,
int binding,
int element, QRhiTexture* newTexture);
684SCORE_PLUGIN_GFX_EXPORT
686 QRhiShaderResourceBindings&, QRhiSampler* oldSampler, QRhiSampler* newSampler);
691SCORE_PLUGIN_GFX_EXPORT
693 QRhiShaderResourceBindings&, QRhiSampler* sampler, QRhiTexture* newTexture);
698SCORE_PLUGIN_GFX_EXPORT
700 QRhiShaderResourceBindings&, QRhiSampler* oldSampler, QRhiSampler* newSampler,
701 QRhiTexture* newTexture);
706SCORE_PLUGIN_GFX_EXPORT
708 QRhiShaderResourceBindings& srb, QRhiTexture* old_tex, QRhiTexture* new_tex);
716SCORE_PLUGIN_GFX_EXPORT
718 const RenderList& renderer, const TextureRenderTarget& rt, QRhiBuffer* processUBO,
719 QRhiBuffer* materialUBO,
std::span<const Sampler> samplers,
720 std::span<QRhiShaderResourceBinding> additionalBindings = {},
721 int firstSamplerBinding = 3,
int sampleCount = 0);
734SCORE_PLUGIN_GFX_EXPORT
736 const ossia::geometry& geom, std::string_view name, std::string_view semantic_key);
753 QRhiBuffer::UsageFlags usage,
754 QRhiBuffer::Type nonDynamic = QRhiBuffer::Immutable)
noexcept
756 return usage.testFlag(QRhiBuffer::UniformBuffer) ? QRhiBuffer::Dynamic
772SCORE_PLUGIN_GFX_EXPORT
774 QRhiGraphicsPipeline& pip,
const QShader& vertexShader,
775 const ossia::geometry& geom, FallbackBindingPlan* outPlan =
nullptr,
776 QRhi* rhi =
nullptr);
803SCORE_PLUGIN_GFX_EXPORT
805 QRhiGraphicsPipeline& pip,
const QShader& vertexShader,
806 const ossia::geometry& geom,
const isf::descriptor& desc,
807 QRhi& rhi, VertexFallbackPool& pool, QRhiResourceUpdateBatch& batch,
808 FallbackBindingPlan& outPlan);
813 QRhiVertexInputLayout& layout)
noexcept;
815SCORE_PLUGIN_GFX_EXPORT
void warnOrphanVertexBindings(
816 const QRhiVertexInputLayout& layout,
const char* where)
noexcept;
821SCORE_PLUGIN_GFX_EXPORT
823 const RenderList& renderer,
const Mesh& mesh,
const QShader& vertexS,
824 const QShader& fragmentS,
const TextureRenderTarget& rt, QRhiBuffer* processUBO,
825 QRhiBuffer* materialUBO, std::span<const Sampler> samplers,
826 std::span<QRhiShaderResourceBinding> additionalBindings = {});
838SCORE_PLUGIN_GFX_EXPORT
840 const RenderList& renderer,
const Mesh& mesh,
const QShader& vertexS,
841 const QShader& fragmentS,
const TextureRenderTarget& rt,
842 QRhiShaderResourceBindings* srb);
844SCORE_PLUGIN_GFX_EXPORT
846 const RenderList& renderer,
const Mesh& mesh,
const QShader& vertexS,
847 const QShader& fragmentS,
const TextureRenderTarget& rt,
848 QRhiShaderResourceBindings* srb,
const QRhiGraphicsPipeline::TargetBlend& blend);
857SCORE_PLUGIN_GFX_EXPORT
859 const RenderList& renderer,
const Mesh& mesh,
const QShader& vertexS,
860 const QShader& fragmentS,
const TextureRenderTarget& rt, QRhiBuffer* processUBO,
861 QRhiBuffer* materialUBO, std::span<const Sampler> samplers,
862 const QRhiGraphicsPipeline::TargetBlend& blend,
863 std::span<QRhiShaderResourceBinding> additionalBindings = {});
870struct sampler_config;
887SCORE_PLUGIN_GFX_EXPORT
888QRhiSampler*
makeSampler(QRhi& rhi,
const isf::sampler_config& cfg);
893SCORE_PLUGIN_GFX_EXPORT
899SCORE_PLUGIN_GFX_EXPORT
904SCORE_PLUGIN_GFX_EXPORT
910SCORE_PLUGIN_GFX_EXPORT
918SCORE_PLUGIN_GFX_EXPORT
924struct pipeline_state;
929struct GraphicsStorageResources;
952SCORE_PLUGIN_GFX_EXPORT
954 const RenderList& renderer,
const Mesh& mesh,
const QShader& vertexS,
955 const QShader& fragmentS,
const TextureRenderTarget& rt, QRhiBuffer* processUBO,
956 QRhiBuffer* materialUBO, std::span<const Sampler> samplers,
957 std::span<QRhiShaderResourceBinding> extraBindings,
958 const isf::pipeline_state& state,
959 int multiViewCount = 0,
960 bool useShadingRate =
false,
961 int firstSamplerBinding = 3,
962 std::span<const QRhiGraphicsPipeline::TargetBlend> seedBlends = {});
969SCORE_PLUGIN_GFX_EXPORT
971 const RenderState& v, QString vert, QString frag,
int multiViewCount = 0);
978SCORE_PLUGIN_GFX_EXPORT
979QShader
makeCompute(
const RenderState& v, QString compt);
989 RenderList& renderer,
const std::vector<Port*>& input,
990 ossia::small_vector<Sampler, 8>& samplers);
992 QRhiBuffer* buffer{};
999SCORE_PLUGIN_GFX_EXPORT
1005SCORE_PLUGIN_GFX_EXPORT
1006QImage
resizeTexture(
const QImage& img,
int min,
int max)
noexcept;
1008inline void copyMatrix(
const QMatrix4x4& mat,
float* ptr)
noexcept
1010 memcpy(ptr, mat.constData(),
sizeof(
float) * 16);
1012inline void copyMatrix(
const QMatrix3x3& mat,
float* ptr)
noexcept
1014 memcpy(ptr, mat.constData(),
sizeof(
float) * 9);
1020SCORE_PLUGIN_GFX_EXPORT
1026SCORE_PLUGIN_GFX_EXPORT
1034 QRhiResourceUpdateBatch* ub
1041#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
1042 ub->updateDynamicBuffer(buf, offset, QByteArray::fromRawData(data, bytesize));
1044 ub->updateDynamicBuffer(buf, offset, bytesize, data);
1049 QRhiResourceUpdateBatch* ub
1055#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
1056 ub->updateDynamicBuffer(buf, offset, std::move(b));
1058 ub->updateDynamicBuffer(buf, offset, b.size(), b.data());
1066 QRhiResourceUpdateBatch* ub
1073#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
1074 ub->uploadStaticBuffer(buf, offset, QByteArray::fromRawData(data, bytesize));
1076 ub->uploadStaticBuffer(buf, offset, bytesize, data);
1081 QRhiResourceUpdateBatch* ub
1087#if QT_VERSION >= QT_VERSION_CHECK(6, 10, 0)
1088 ub->uploadStaticBuffer(buf, offset, std::move(b));
1090 ub->uploadStaticBuffer(buf, offset, b.size(), b.data());
1098SCORE_PLUGIN_GFX_EXPORT
1110SCORE_PLUGIN_GFX_EXPORT
1112 QRhi& rhi, QRhiResourceUpdateBatch& res, std::string_view qualifier,
int dimensions,
1113 bool array,
bool cube, QSize size = {1, 1},
int extent = 1);
1120SCORE_PLUGIN_GFX_EXPORT
1129SCORE_PLUGIN_GFX_EXPORT
1139SCORE_PLUGIN_GFX_EXPORT
1147#if QT_VERSION >= QT_VERSION_CHECK(6, 5, 0)
1156SCORE_PLUGIN_GFX_EXPORT
1164SCORE_PLUGIN_GFX_EXPORT
1166 QRhi& rhi,
const char* kind, std::initializer_list<const QString*> sources);
1168SCORE_PLUGIN_GFX_EXPORT
1169std::vector<Sampler> initInputSamplers(
1170 const score::gfx::Node& node, RenderList& renderer,
const std::vector<Port*>& ports,
1171 const isf::descriptor* desc =
nullptr);
1177SCORE_PLUGIN_GFX_EXPORT
1179 std::span<Sampler> samplers,
const score::gfx::Node& node,
const Port& input,
1180 const RenderTargetSpecs& spec);
Root data model for visual nodes.
Definition score-plugin-gfx/Gfx/Graph/Node.hpp:115
List of nodes to be rendered to an output.
Definition RenderList.hpp:36
TreeNode< DeviceExplorerNode > Node
Definition DeviceNode.hpp:74
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
QSizeF computeScaleForTexcoordSizing(ScaleMode mode, QSizeF renderSize, QSizeF textureSize)
Compute the scale to apply to a texture rendered to a quad the size of viewport.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1996
bool remapPipelineVertexInputs(QRhiGraphicsPipeline &pip, const QShader &vertexShader, const ossia::geometry &geom, FallbackBindingPlan *outPlan, QRhi *rhi)
Remap a pipeline's vertex input layout using semantic matching.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1246
void updateDynamicBufferWithStoredData(QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, int64_t bytesize, const char *data)
Schedule a Dynamic buffer update when we can guarantee the buffer outlives the frame.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:1033
int maxStorageImageBinding(QStringView glsl)
Highest binding of a storage image declared in glsl, -1 if none.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:3011
TextureRenderTarget createLayeredRenderTarget(const RenderState &state, QRhiTexture *colorTextureArray, int renderLayer, QRhiTexture *depthTex, int samples)
Create a render target that targets a single layer of a texture array.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2385
QString blockRefusal(const QRhiBuffer *buf, bool uniform, int64_t offset, int64_t range, int64_t declared)
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:600
bool applySetSamplerFields(QRhiSampler &sampler, const RenderTargetSpecs &spec) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2769
const isf::sampler_config * inputSamplerConfig(const isf::input &inp) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2796
const ossia::geometry::attribute * findGeometryAttribute(const ossia::geometry &geom, std::string_view name, std::string_view semantic_key)
Match a (name, semantic) request to an upstream geometry attribute.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:917
QRhiBuffer::Type bufferTypeFor(QRhiBuffer::UsageFlags usage, QRhiBuffer::Type nonDynamic=QRhiBuffer::Immutable) noexcept
The QRhi buffer type a usage flag is allowed to be created with.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:752
void dropTrailingOrphanVertexBindings(QRhiVertexInputLayout &layout) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1266
QRhiSampler * makeSampler(QRhi &rhi, const isf::sampler_config &cfg)
Build a QRhiSampler from an isf::sampler_config.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2819
QShader makeCompute(const RenderState &v, QString compute)
Compile a compute shader.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1806
bool outputGrabbedBySink(const Port &output) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:266
bool followTextureMips(QRhiSampler &sampler, const QRhiTexture &texture)
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2871
std::pair< QShader, QShader > makeShaders(const RenderState &v, QString vert, QString frag, int multiViewCount)
Get a pair of compiled vertex / fragment shaders from GLSL 4.5 sources.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1707
bool declaresCompare(const isf::sampler_config &cfg) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2814
QRhiTexture::Format imageFormatFromQualifier(std::string_view qualifier) noexcept
QRhi format for a GLSL image format qualifier ("rgba8", "r32ui", ...); RGBA8 when unknown.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:3070
TextureRenderTarget createRenderTarget(const RenderState &state, QRhiTexture *tex, int samples, bool depth, bool samplableDepth)
Create a render target from a texture.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:86
TextureRenderTarget createDepthOnlyRenderTarget(const RenderState &state, QSize sz, int samples, bool samplableDepth, QRhiTexture::Format depthFmt)
Create a depth-only render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2269
Pipeline buildPipeline(const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiShaderResourceBindings *srb)
Lower-level buildPipeline variant: bring your own SRB.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1510
bool retargetSampler(Sampler &s, QRhiTexture *tex)
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2861
int storageImageUnitLimit(QRhi &rhi)
Number of storage image units the backend binds by binding number: GL_MAX_IMAGE_UNITS on OpenGL (8 wh...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2883
int64_t storageBufferSizeLimit(QRhi &rhi)
Largest storage buffer the device binds, in bytes: Vulkan maxStorageBufferRange, GL MAX_SHADER_STORAG...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2921
void uploadStaticBufferWithStoredData(QRhiResourceUpdateBatch *ub, QRhiBuffer *buf, int offset, int64_t bytesize, const char *data)
Schedule a Static buffer update when we can guarantee the buffer outlives the frame.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:1065
QRhiTexture::Format parseOutputFormat(const std::string &fmt, QRhiTexture::Format fallback) noexcept
Map an ISF/CSF FORMAT string to a QRhiTexture::Format.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2700
QRhiTexture * createStorageImagePlaceholder(QRhi &rhi, QRhiResourceUpdateBatch &res, std::string_view qualifier, int dimensions, bool array, bool cube, QSize size, int extent)
A zero-filled texture a storage image binding declared with qualifier can take when nothing is bound:...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:3099
bool zeroTexture(QRhi &rhi, QRhiResourceUpdateBatch &res, QRhiTexture &tex)
Queue zeros into every level, layer, face and slice of a texture.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:309
QRhi * resourceRhi(const QRhiResource &r) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:1145
QImage resizeTexture(const QImage &img, int min, int max) noexcept
Resize a texture to fit within GPU limits.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1946
bool declaresSampler(const isf::sampler_config &cfg) noexcept
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2807
QSizeF computeScaleForMeshSizing(ScaleMode mode, QSizeF viewport, QSizeF texture)
Compute the scale to apply to a texture so that it fits in a GL viewport.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1956
TextureRenderTarget createMultiViewRenderTarget(const RenderState &state, QRhiTexture *colorTextureArray, int multiViewCount, QRhiTexture *depthTextureArray, int samples)
Create a multiview render target (single RT drawing N views at once).
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2432
Pipeline buildPipelineWithState(const RenderList &renderer, const Mesh &mesh, const QShader &vertexS, const QShader &fragmentS, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > extraBindings, const isf::pipeline_state &state, int multiViewCount, bool useShadingRate, int firstSamplerBinding, std::span< const QRhiGraphicsPipeline::TargetBlend > seedBlends)
Create a render pipeline applying pipeline_state from an ISF descriptor.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1551
void replaceSamplerAndTexture(QRhiShaderResourceBindings &srb, QRhiSampler *oldSampler, QRhiSampler *newSampler, QRhiTexture *newTexture)
Replace both sampler and texture in a SRC.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:829
bool warnStorageImageUnits(QRhi &rhi, const char *kind, std::initializer_list< const QString * > sources)
Warn once per shader when a storage image in sources has a binding the OpenGL backend cannot bind (at...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:3034
QRhiShaderResourceBindings * createDefaultBindings(const RenderList &renderer, const TextureRenderTarget &rt, QRhiBuffer *processUBO, QRhiBuffer *materialUBO, std::span< const Sampler > samplers, std::span< QRhiShaderResourceBinding > additionalBindings, int firstSamplerBinding, int sampleCount)
Create bindings following the score conventions for shaders and materials.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1432
ScaleMode
How to resize a texture to adapt it to a viewport.
Definition Scale.hpp:10
void updateInputSamplerFilter(std::span< Sampler > samplers, const score::gfx::Node &node, const Port &input, const RenderTargetSpecs &spec)
Give the sampler initInputSamplers() created for input, one of node's input ports,...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2213
void replaceTextureElement(std::vector< QRhiShaderResourceBinding > &tmp, int binding, int element, QRhiTexture *newTexture)
Replace one element of a multi-element texture binding.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:729
QSize resizeTextureSize(QSize sz, int min, int max) noexcept
Resize the size of a texture to fit within GPU limits.
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:1895
int64_t bufferOffsetAlignment(QRhi &rhi, bool uniform)
The byte multiple a buffer binding's offset must be on this device: QRhi::ubufAlignment() for a unifo...
Definition score-plugin-gfx/Gfx/Graph/Utils.cpp:2955
Definition MIDISync.hpp:149
Data model for audio data being sent to the GPU.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:190
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:628
quint32 size
0: the whole buffer.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:630
Utility to represent a shader material following score conventions.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:987
Connection between two score::gfx::Port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:236
Definition VertexFallbackPlan.hpp:27
Image data and metadata.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:463
RAII bracket for QRhi::beginOffscreenFrame / endOffscreenFrame.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:54
static std::atomic_bool simulateDeviceLost
Test seam: while set, every new frame fails to begin with FrameOpDeviceLost without touching the QRhi...
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:112
Useful abstraction for storing a graphics pipeline and associated resource bindings.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:278
FallbackBindingPlan plan
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:287
Port of a score::gfx::Node.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:215
void * value
Pointer to the corresponding data.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:220
score::gfx::Node * node
Parent node of the port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:217
Types type
Type of the value.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:223
std::vector< Edge * > edges
Edges connected to that port.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:229
Flag flags
Optional setting flags.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:226
Global state associated to a rendering context.
Definition RenderState.hpp:40
Stores a sampler and the texture currently associated with it.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:169
bool mips_follow_texture
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:175
bool mipmap_set
The inlet sets the mipmap mode (U34), which then wins over following.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:177
Closes a swapchain frame if the scope is left without presenting it.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:129
Useful abstraction for storing all the data related to a render target.
Definition score-plugin-gfx/Gfx/Graph/Utils.hpp:307