18#include <QtGui/private/qtguiglobal_p.h>
19#include <rhi/qshader.h>
20#include <QtCore/QAtomicInt>
27 static const int QSB_VERSION = 9;
28 static const int QSB_VERSION_WITHOUT_INPUT_OUTPUT_INTERFACE_BLOCKS = 8;
29 static const int QSB_VERSION_WITHOUT_EXTENDED_STORAGE_BUFFER_INFO = 7;
30 static const int QSB_VERSION_WITHOUT_NATIVE_SHADER_INFO = 6;
31 static const int QSB_VERSION_WITHOUT_SEPARATE_IMAGES_AND_SAMPLERS = 5;
32 static const int QSB_VERSION_WITHOUT_VAR_ARRAYDIMS = 4;
33 static const int QSB_VERSION_WITH_CBOR = 3;
34 static const int QSB_VERSION_WITH_BINARY_JSON = 2;
35 static const int QSB_VERSION_WITHOUT_BINDINGS = 1;
37 enum MslNativeShaderInfoExtraBufferBindings {
38 MslTessVertIndicesBufferBinding = 0,
39 MslTessVertTescOutputBufferBinding,
40 MslTessTescTessLevelBufferBinding,
41 MslTessTescPatchOutputBufferBinding,
42 MslTessTescParamsBufferBinding,
43 MslTessTescInputBufferBinding,
44 MslBufferSizeBufferBinding,
45 MslMultiViewMaskBufferBinding
53 QShaderPrivate(
const QShaderPrivate &other)
55 qsbVersion(other.qsbVersion),
58 shaders(other.shaders),
59 bindings(other.bindings),
60 combinedImageMap(other.combinedImageMap),
61 nativeShaderInfoMap(other.nativeShaderInfoMap)
65 static QShaderPrivate *get(QShader *s) {
return s->d; }
66 static const QShaderPrivate *get(
const QShader *s) {
return s->d; }
67 static int qtQsbVersion(QShader::SerializedFormatVersion qtVersion) {
69 case QShader::SerializedFormatVersion::Qt_6_4:
70 return (QShaderPrivate::QSB_VERSION_WITHOUT_SEPARATE_IMAGES_AND_SAMPLERS + 1);
71 case QShader::SerializedFormatVersion::Qt_6_5:
72 return (QShaderPrivate::QSB_VERSION_WITHOUT_EXTENDED_STORAGE_BUFFER_INFO + 1);
74 return QShaderPrivate::QSB_VERSION;
79 int qsbVersion = QSB_VERSION;
80 QShader::Stage stage = QShader::VertexStage;
81 QShaderDescription desc;
83 QMap<QShaderKey, QShaderCode> shaders;
84 QMap<QShaderKey, QShader::NativeResourceBindingMap> bindings;
85 QMap<QShaderKey, QShader::SeparateToCombinedImageSamplerMappingList> combinedImageMap;
86 QMap<QShaderKey, QShader::NativeShaderInfo> nativeShaderInfoMap;
static QRhiResourceUpdateBatchPrivate * get(QRhiResourceUpdateBatch *b)
Int aligned(Int v, Int byteAlign)
\variable QRhiVulkanQueueSubmitParams::waitSemaphoreCount
id< MTLTexture > viewForLevel(int level)
id< MTLTexture > perLevelViews[QRhi::MAX_MIP_LEVELS]
id< MTLBuffer > stagingBuf[QMTL_FRAMES_IN_FLIGHT]
QMetalTextureData(QMetalTexture *t)
~QMetalTextureRenderTarget()
float devicePixelRatio() const override
QMetalRenderTargetData * d
QMetalTextureRenderTarget(QRhiImplementation *rhi, const QRhiTextureRenderTargetDescription &desc, Flags flags)
bool create() override
Creates the corresponding native graphics resources.
QRhiRenderPassDescriptor * newCompatibleRenderPassDescriptor() override
int sampleCount() const override
QSize pixelSize() const override
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
QMetalTexture(QRhiImplementation *rhi, Format format, const QSize &pixelSize, int depth, int arraySize, int sampleCount, Flags flags)
bool prepareCreate(QSize *adjustedSize=nullptr)
NativeTexture nativeTexture() override
bool create() override
Creates the corresponding native graphics resources.
void destroy() override
Releases (or requests deferred releasing of) the underlying native graphics resources.
bool createFrom(NativeTexture src) override
Similar to create(), except that no new native textures are created.
id< MTLComputePipelineState > pipelineState
id< MTLDepthStencilState > depthStencilState
std::array< id< MTLComputePipelineState >, 3 > tessVertexComputeState
id< MTLRasterizationRateMap > rateMap
id< MTLSamplerState > samplerState
id< MTLBuffer > stagingBuffers[QMTL_FRAMES_IN_FLIGHT]
id< MTLComputePipelineState > tessTessControlComputeState
id< MTLRenderPipelineState > pipelineState
id< MTLBuffer > buffers[QMTL_FRAMES_IN_FLIGHT]
id< MTLTexture > views[QRhi::MAX_MIP_LEVELS]
QRhiReadbackDescription desc
QRhiReadbackResult * result
QRhiTexture::Format format
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h
float maxPotentialColorComponentValue
LuminanceBehavior luminanceBehavior
float maxColorComponentValue
\inmodule QtGuiPrivate \inheaderfile rhi/qrhi.h