Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
|
#include "qrhimetal_p.h"
#include "qshader_p.h"
#include <QGuiApplication>
#include <QWindow>
#include <QUrl>
#include <QFile>
#include <QTemporaryFile>
#include <QFileInfo>
#include <qmath.h>
#include <QOperatingSystemVersion>
#include <QtCore/private/qcore_mac_p.h>
#include <UIKit/UIKit.h>
#include <Metal/Metal.h>
#include <QuartzCore/CAMetalLayer.h>
Go to the source code of this file.
Macros | |
#define | QRHI_METAL_DISABLE_BINARY_ARCHIVE |
#define | QRHI_METAL_COMMAND_BUFFERS_WITH_UNRETAINED_REFERENCES |
Enumerations | |
enum class | BindingType { Buffer , Texture , Sampler } |
#define QRHI_METAL_COMMAND_BUFFERS_WITH_UNRETAINED_REFERENCES |
Definition at line 54 of file qrhimetal.mm.
#define QRHI_METAL_DISABLE_BINARY_ARCHIVE |
Definition at line 49 of file qrhimetal.mm.
|
strong |
Enumerator | |
---|---|
Buffer | |
Texture | |
Sampler |
Definition at line 1115 of file qrhimetal.mm.
|
static |
Definition at line 5235 of file qrhimetal.mm.
References addUnusedVertexAttribute(), aligned(), alignment, elements, and QShaderDescription::Struct.
Referenced by addUnusedVertexAttribute(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
|
static |
Definition at line 5265 of file qrhimetal.mm.
References addVertexAttribute(), aligned(), alignment, elements, indexTaken(), nextAttributeIndex(), Q_ASSERT, QShaderDescription::Struct, takeIndex(), and toMetalAttributeFormat().
Referenced by addVertexAttribute(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
|
inline |
Definition at line 497 of file qrhimetal.mm.
Referenced by addUnusedVertexAttribute(), addVertexAttribute(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
Definition at line 5229 of file qrhimetal.mm.
References alignment.
|
inlinestatic |
Definition at line 1140 of file qrhimetal.mm.
References QMetalShaderResourceBindingsData::COMPUTE, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QMetalShaderResourceBindingsData::FRAGMENT, QMetalShaderResourceBindingsData::TESSCTRL, QMetalShaderResourceBindingsData::TESSEVAL, and QMetalShaderResourceBindingsData::VERTEX.
Referenced by QRhiMetal::enqueueShaderResourceBindings(), and rebindShaderResources().
|
inlinestatic |
Definition at line 1198 of file qrhimetal.mm.
References QMetalShaderResourceBindingsData::COMPUTE, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QMetalShaderResourceBindingsData::FRAGMENT, QMetalShaderResourceBindingsData::TESSCTRL, QMetalShaderResourceBindingsData::TESSEVAL, and QMetalShaderResourceBindingsData::VERTEX.
Referenced by QRhiMetal::enqueueShaderResourceBindings(), and rebindShaderResources().
|
inlinestatic |
Definition at line 1171 of file qrhimetal.mm.
References QMetalShaderResourceBindingsData::COMPUTE, QMetalCommandBufferData::currentComputePassEncoder, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, QMetalShaderResourceBindingsData::FRAGMENT, QMetalShaderResourceBindingsData::TESSCTRL, QMetalShaderResourceBindingsData::TESSEVAL, and QMetalShaderResourceBindingsData::VERTEX.
Referenced by QRhiMetal::enqueueShaderResourceBindings(), and rebindShaderResources().
|
static |
Definition at line 1930 of file qrhimetal.mm.
References QMetalCommandBufferData::cb, QMetalCommandBufferData::currentPassRpDesc, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::currentTarget, QMetalCommandBuffer::d, i, Q_ASSERT, QRHI_RES, QMetalCommandBuffer::resetPerPassCachedState(), QRhiResource::resourceType(), QRhiResource::SwapChainRenderTarget, QMetalCommandBufferData::tessellationComputeEncoder, and QRhiResource::TextureRenderTarget.
Referenced by QRhiMetal::tessellatedDraw().
Definition at line 5203 of file qrhimetal.mm.
Referenced by addVertexAttribute(), and nextAttributeIndex().
|
inlinestatic |
Definition at line 6203 of file qrhimetal.mm.
References Q_ASSERT, view, and window().
Referenced by QRhiMetal::updateSwapChainProxyData().
|
inlinestatic |
Definition at line 1121 of file qrhimetal.mm.
References QMap< Key, T >::cend(), QMap< Key, T >::constFind(), QMap< Key, T >::isEmpty(), it, map, and Sampler.
|
inlinestatic |
Definition at line 5306 of file qrhimetal.mm.
References i, match(), and matches().
Referenced by matches(), matches(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
|
inlinestatic |
Definition at line 5321 of file qrhimetal.mm.
References matches().
|
inlinestatic |
Definition at line 5213 of file qrhimetal.mm.
References indexTaken().
Referenced by addVertexAttribute(), and QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
Q_DECLARE_TYPEINFO | ( | QRhiMetalData::DeferredReleaseEntry | , |
Q_RELOCATABLE_TYPE | ) |
Q_DECLARE_TYPEINFO | ( | QRhiMetalData::TextureReadback | , |
Q_RELOCATABLE_TYPE | ) |
|
static |
Definition at line 3124 of file qrhimetal.mm.
References QRhiMetalData::DeferredReleaseEntry::buffer, i, QMTL_FRAMES_IN_FLIGHT, and release().
Referenced by QRhiMetal::executeDeferredReleases().
|
static |
Definition at line 3130 of file qrhimetal.mm.
References release(), and QRhiMetalData::DeferredReleaseEntry::renderbuffer.
Referenced by QRhiMetal::executeDeferredReleases().
|
static |
Definition at line 3144 of file qrhimetal.mm.
References release(), and QRhiMetalData::DeferredReleaseEntry::sampler.
Referenced by QRhiMetal::executeDeferredReleases().
|
static |
Definition at line 3135 of file qrhimetal.mm.
References i, QRhi::MAX_MIP_LEVELS, QMTL_FRAMES_IN_FLIGHT, release(), and QRhiMetalData::DeferredReleaseEntry::texture.
Referenced by QRhiMetal::executeDeferredReleases().
|
inlinestatic |
Definition at line 1230 of file qrhimetal.mm.
References bindStageBuffers(), bindStageSamplers(), bindStageTextures(), QMetalCommandBufferData::currentShaderResourceBindingState, QMetalCommandBuffer::d, i, and QMetalShaderResourceBindingsData::res.
Referenced by QRhiMetal::tessellatedDraw().
Definition at line 5208 of file qrhimetal.mm.
Referenced by addVertexAttribute().
|
static |
Definition at line 1917 of file qrhimetal.mm.
References QMetalCommandBufferData::cb, QMetalCommandBufferData::currentRenderPassEncoder, QMetalCommandBuffer::d, and QMetalCommandBufferData::tessellationComputeEncoder.
Referenced by QRhiMetal::tessellatedDraw().
|
inlinestatic |
Definition at line 4000 of file qrhimetal.mm.
References QRhiSampler::ClampToEdge, QRhiSampler::Mirror, and QRhiSampler::Repeat.
Referenced by QMetalSampler::create().
|
inlinestatic |
Definition at line 4443 of file qrhimetal.mm.
References QRhiVertexInputAttribute::Float, QRhiVertexInputAttribute::Float2, QRhiVertexInputAttribute::Float3, QRhiVertexInputAttribute::Float4, QRhiVertexInputAttribute::Half, QRhiVertexInputAttribute::Half2, QRhiVertexInputAttribute::Half3, QRhiVertexInputAttribute::Half4, QRhiVertexInputAttribute::SInt, QRhiVertexInputAttribute::SInt2, QRhiVertexInputAttribute::SInt3, QRhiVertexInputAttribute::SInt4, QRhiVertexInputAttribute::SShort, QRhiVertexInputAttribute::SShort2, QRhiVertexInputAttribute::SShort3, QRhiVertexInputAttribute::SShort4, QRhiVertexInputAttribute::UInt, QRhiVertexInputAttribute::UInt2, QRhiVertexInputAttribute::UInt3, QRhiVertexInputAttribute::UInt4, QRhiVertexInputAttribute::UNormByte, QRhiVertexInputAttribute::UNormByte2, QRhiVertexInputAttribute::UNormByte4, QRhiVertexInputAttribute::UShort, QRhiVertexInputAttribute::UShort2, QRhiVertexInputAttribute::UShort3, and QRhiVertexInputAttribute::UShort4.
Referenced by addVertexAttribute(), QMetalGraphicsPipelineData::setupStageInputDescriptor(), and QMetalGraphicsPipelineData::setupVertexInputDescriptor().
|
inlinestatic |
Definition at line 4506 of file qrhimetal.mm.
References QRhiGraphicsPipeline::ConstantAlpha, QRhiGraphicsPipeline::ConstantColor, QRhiGraphicsPipeline::DstAlpha, QRhiGraphicsPipeline::DstColor, QRhiGraphicsPipeline::One, QRhiGraphicsPipeline::OneMinusConstantAlpha, QRhiGraphicsPipeline::OneMinusConstantColor, QRhiGraphicsPipeline::OneMinusDstAlpha, QRhiGraphicsPipeline::OneMinusDstColor, QRhiGraphicsPipeline::OneMinusSrc1Alpha, QRhiGraphicsPipeline::OneMinusSrc1Color, QRhiGraphicsPipeline::OneMinusSrcAlpha, QRhiGraphicsPipeline::OneMinusSrcColor, QRhiGraphicsPipeline::Src1Alpha, QRhiGraphicsPipeline::Src1Color, QRhiGraphicsPipeline::SrcAlpha, QRhiGraphicsPipeline::SrcAlphaSaturate, QRhiGraphicsPipeline::SrcColor, and QRhiGraphicsPipeline::Zero.
Referenced by QMetalGraphicsPipeline::setupAttachmentsInMetalRenderPassDescriptor().
|
inlinestatic |
Definition at line 4553 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Add, QRhiGraphicsPipeline::Max, QRhiGraphicsPipeline::Min, QRhiGraphicsPipeline::ReverseSubtract, and QRhiGraphicsPipeline::Subtract.
Referenced by QMetalGraphicsPipeline::setupAttachmentsInMetalRenderPassDescriptor().
|
inlinestatic |
Definition at line 4572 of file qrhimetal.mm.
References QRhiGraphicsPipeline::A, QRhiGraphicsPipeline::B, QRhiGraphicsPipeline::G, and QRhiGraphicsPipeline::R.
Referenced by QMetalGraphicsPipeline::setupAttachmentsInMetalRenderPassDescriptor().
|
inlinestatic |
Definition at line 4586 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Always, QRhiGraphicsPipeline::Equal, QRhiGraphicsPipeline::Greater, QRhiGraphicsPipeline::GreaterOrEqual, QRhiGraphicsPipeline::Less, QRhiGraphicsPipeline::LessOrEqual, QRhiGraphicsPipeline::Never, and QRhiGraphicsPipeline::NotEqual.
Referenced by QMetalGraphicsPipeline::setupMetalDepthStencilDescriptor().
|
inlinestatic |
Definition at line 4673 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Back, QRhiGraphicsPipeline::Front, and QRhiGraphicsPipeline::None.
Referenced by QMetalGraphicsPipeline::mapStates().
|
inlinestatic |
Definition at line 3972 of file qrhimetal.mm.
References QRhiSampler::Linear, and QRhiSampler::Nearest.
Referenced by QMetalSampler::create().
|
inlinestatic |
Definition at line 4729 of file qrhimetal.mm.
References QShaderVersion::version().
Referenced by QRhiMetalData::createMetalLib().
|
inlinestatic |
Definition at line 3985 of file qrhimetal.mm.
References QRhiSampler::Linear, QRhiSampler::Nearest, and QRhiSampler::None.
Referenced by QMetalSampler::create().
|
inlinestatic |
Definition at line 4655 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Lines, QRhiGraphicsPipeline::LineStrip, QRhiGraphicsPipeline::Points, QRhiGraphicsPipeline::TriangleFan, QRhiGraphicsPipeline::Triangles, and QRhiGraphicsPipeline::TriangleStrip.
Referenced by QMetalGraphicsPipeline::createVertexFragmentPipeline().
|
inlinestatic |
Definition at line 4636 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Lines, QRhiGraphicsPipeline::LineStrip, QRhiGraphicsPipeline::Points, QRhiGraphicsPipeline::Triangles, and QRhiGraphicsPipeline::TriangleStrip.
Referenced by QMetalGraphicsPipeline::createVertexFragmentPipeline().
|
inlinestatic |
Definition at line 4611 of file qrhimetal.mm.
References QRhiGraphicsPipeline::DecrementAndClamp, QRhiGraphicsPipeline::DecrementAndWrap, QRhiGraphicsPipeline::IncrementAndClamp, QRhiGraphicsPipeline::IncrementAndWrap, QRhiGraphicsPipeline::Invert, QRhiGraphicsPipeline::Keep, QRhiGraphicsPipeline::Replace, and QRhiGraphicsPipeline::StencilZero.
Referenced by QMetalGraphicsPipeline::setupMetalDepthStencilDescriptor().
|
inlinestatic |
Definition at line 4714 of file qrhimetal.mm.
References QShaderDescription::EqualTessellationPartitioning, QShaderDescription::FractionalEvenTessellationPartitioning, and QShaderDescription::FractionalOddTessellationPartitioning.
Referenced by QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
|
inlinestatic |
Definition at line 4701 of file qrhimetal.mm.
References QShaderDescription::CcwTessellationWindingOrder, and QShaderDescription::CwTessellationWindingOrder.
Referenced by QMetalGraphicsPipelineData::Tessellation::teseFragRenderPipeline().
|
inlinestatic |
Definition at line 4015 of file qrhimetal.mm.
References QRhiSampler::Always, QRhiSampler::Equal, QRhiSampler::Greater, QRhiSampler::GreaterOrEqual, QRhiSampler::Less, QRhiSampler::LessOrEqual, QRhiSampler::Never, and QRhiSampler::NotEqual.
Referenced by QMetalSampler::create().
|
inlinestatic |
Definition at line 3361 of file qrhimetal.mm.
References QRhiTexture::ASTC_10x10, QRhiTexture::ASTC_10x5, QRhiTexture::ASTC_10x6, QRhiTexture::ASTC_10x8, QRhiTexture::ASTC_12x10, QRhiTexture::ASTC_12x12, QRhiTexture::ASTC_4x4, QRhiTexture::ASTC_5x4, QRhiTexture::ASTC_5x5, QRhiTexture::ASTC_6x5, QRhiTexture::ASTC_6x6, QRhiTexture::ASTC_8x5, QRhiTexture::ASTC_8x6, QRhiTexture::ASTC_8x8, QRhiTexture::BC1, QRhiTexture::BC2, QRhiTexture::BC3, QRhiTexture::BC4, QRhiTexture::BC5, QRhiTexture::BC6H, QRhiTexture::BC7, QRhiTexture::BGRA8, d, QRhiTexture::D16, QRhiTexture::D24, QRhiTexture::D24S8, QRhiTexture::D32F, QRhiTexture::ETC2_RGB8, QRhiTexture::ETC2_RGB8A1, QRhiTexture::ETC2_RGBA8, Q_UNUSED, qWarning, QRhiTexture::R16, QRhiTexture::R16F, QRhiTexture::R32F, QRhiTexture::R8, QRhiTexture::RED_OR_ALPHA8, QRhiTexture::RG16, QRhiTexture::RG8, QRhiTexture::RGB10A2, QRhiTexture::RGBA16F, QRhiTexture::RGBA32F, QRhiTexture::RGBA8, and QRhiTexture::sRGB.
Referenced by QMetalRenderBuffer::create(), and QMetalTexture::prepareCreate().
|
inlinestatic |
Definition at line 4688 of file qrhimetal.mm.
References QRhiGraphicsPipeline::Fill, and QRhiGraphicsPipeline::Line.
Referenced by QMetalGraphicsPipeline::mapStates().
|
inlinestatic |
Definition at line 1252 of file qrhimetal.mm.
References QMetalShaderResourceBindingsData::COMPUTE, QRhiShaderResourceBinding::ComputeStage, QMetalShaderResourceBindingsData::FRAGMENT, QRhiShaderResourceBinding::FragmentStage, QMetalShaderResourceBindingsData::TESSCTRL, QRhiShaderResourceBinding::TessellationControlStage, QRhiShaderResourceBinding::TessellationEvaluationStage, QMetalShaderResourceBindingsData::TESSEVAL, QMetalShaderResourceBindingsData::VERTEX, and QRhiShaderResourceBinding::VertexStage.
Referenced by QRhiMetal::enqueueShaderResourceBindings().