29#include <QtGui/private/qrhi_p.h>
37template <
typename CB,
typename =
void>
43 CB,
std::void_t<decltype(std::declval<CB&>().drawIndexedIndirectCount(
44 static_cast<QRhiBuffer*>(nullptr), 0u,
45 static_cast<QRhiBuffer*>(nullptr), 0u, 0u, 0u))>> : std::true_type
49template <
typename CB,
typename =
void>
55 CB,
std::void_t<decltype(std::declval<CB&>().dispatchIndirect(
56 static_cast<QRhiBuffer*>(nullptr), 0u))>> : std::true_type
62template <
typename R,
typename =
void>
65 static bool supported(R&)
noexcept {
return false; }
70 static bool supported(R& rhi)
noexcept
72 return rhi.isFeatureSupported(R::DrawIndirectCount);
76template <
typename R,
typename =
void>
79 static bool supported(R&)
noexcept {
return false; }
84 static bool supported(R& rhi)
noexcept
86 return rhi.isFeatureSupported(R::DispatchIndirect);
91#if defined(SCORE_GFX_SIMULATE_QT612)
92inline constexpr bool rhiHasDrawIndirectCount =
false;
93inline constexpr bool rhiHasDispatchIndirect =
false;
95inline constexpr bool rhiHasDrawIndirectCount
97inline constexpr bool rhiHasDispatchIndirect
103template <
typename R = QRhi>
106 if constexpr(rhiHasDrawIndirectCount)
113template <
typename R = QRhi>
116 if constexpr(rhiHasDispatchIndirect)
125template <
typename CB = QRhiCommandBuffer>
127 CB& cb,
bool indexed, QRhiBuffer* indirectBuffer, quint32 indirectOffset,
128 QRhiBuffer* countBuffer, quint32 countOffset, quint32 maxDrawCount,
129 quint32 stride)
noexcept
131 if constexpr(rhiHasDrawIndirectCount)
134 cb.drawIndexedIndirectCount(
135 indirectBuffer, indirectOffset, countBuffer, countOffset,
136 maxDrawCount, stride);
138 cb.drawIndirectCount(
139 indirectBuffer, indirectOffset, countBuffer, countOffset,
140 maxDrawCount, stride);
152template <
typename CB = QRhiCommandBuffer>
154 CB& cb, QRhiBuffer* argsBuffer, quint32 argsOffset)
noexcept
156 if constexpr(rhiHasDispatchIndirect)
158 cb.dispatchIndirect(argsBuffer, argsOffset);
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11
bool drawIndirectCountCompat(CB &cb, bool indexed, QRhiBuffer *indirectBuffer, quint32 indirectOffset, QRhiBuffer *countBuffer, quint32 countOffset, quint32 maxDrawCount, quint32 stride) noexcept
Definition RhiIndirectCompat.hpp:126
bool dispatchIndirectCompat(CB &cb, QRhiBuffer *argsBuffer, quint32 argsOffset) noexcept
Definition RhiIndirectCompat.hpp:153
bool rhiSupportsDrawIndirectCount(R &rhi) noexcept
Definition RhiIndirectCompat.hpp:104
bool rhiSupportsDispatchIndirect(R &rhi) noexcept
QRhi::DispatchIndirect reported by the device; same convention as above.
Definition RhiIndirectCompat.hpp:114
Definition RhiIndirectCompat.hpp:78
Definition RhiIndirectCompat.hpp:64
Definition RhiIndirectCompat.hpp:51
Definition RhiIndirectCompat.hpp:39