Qt 6.x
The Qt SDK
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
qssgiblbaker.cpp File Reference
#include "qssgiblbaker_p.h"
#include <QFile>
#include <QFileInfo>
#include <QScopeGuard>
#include <QtQuick3DRuntimeRender/private/qssgrhicontext_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrenderloadedtexture_p.h>
#include <QtQuick3DRuntimeRender/private/qssgrendershadercache_p.h>
+ Include dependency graph for qssgiblbaker.cpp:

Go to the source code of this file.

Macros

#define GL_FLOAT   0x1406
 
#define GL_HALF_FLOAT   0x140B
 
#define GL_UNSIGNED_BYTE   0x1401
 
#define GL_RGBA   0x1908
 
#define GL_RGBA8   0x8058
 
#define GL_RGBA16F   0x881A
 
#define GL_RGBA32F   0x8814
 

Functions

static constexpr QSSGRenderTextureFormat FORMAT (QSSGRenderTextureFormat::RGBA16F)
 
QString renderToKTXFileInternal (const char *name, const QString &inPath, const QString &outPath, QRhi::Implementation impl, QRhiInitParams *initParams)
 
void adjustToPlatformQuirks (QRhi::Implementation &impl)
 
QRhi::Implementation getRhiImplementation ()
 
QString renderToKTXFile (const QString &inPath, const QString &outPath)
 

Variables

static const float cube []
 

Macro Definition Documentation

◆ GL_FLOAT

#define GL_FLOAT   0x1406

Definition at line 20 of file qssgiblbaker.cpp.

◆ GL_HALF_FLOAT

#define GL_HALF_FLOAT   0x140B

Definition at line 21 of file qssgiblbaker.cpp.

◆ GL_RGBA

#define GL_RGBA   0x1908

Definition at line 23 of file qssgiblbaker.cpp.

◆ GL_RGBA16F

#define GL_RGBA16F   0x881A

Definition at line 25 of file qssgiblbaker.cpp.

◆ GL_RGBA32F

#define GL_RGBA32F   0x8814

Definition at line 26 of file qssgiblbaker.cpp.

◆ GL_RGBA8

#define GL_RGBA8   0x8058

Definition at line 24 of file qssgiblbaker.cpp.

◆ GL_UNSIGNED_BYTE

#define GL_UNSIGNED_BYTE   0x1401

Definition at line 22 of file qssgiblbaker.cpp.

Function Documentation

◆ adjustToPlatformQuirks()

void adjustToPlatformQuirks ( QRhi::Implementation impl)

Definition at line 584 of file qssgiblbaker.cpp.

References QRhi::create(), QRhi::Metal, QRhi::OpenGLES2, Q_UNUSED, and qDebug.

Referenced by getRhiImplementation().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ FORMAT()

static constexpr QSSGRenderTextureFormat FORMAT ( QSSGRenderTextureFormat::RGBA16F  )
staticconstexpr

Referenced by renderToKTXFileInternal().

+ Here is the caller graph for this function:

◆ getRhiImplementation()

QRhi::Implementation getRhiImplementation ( )

Definition at line 605 of file qssgiblbaker.cpp.

References adjustToPlatformQuirks(), QByteArray::constData(), QRhi::D3D11, QRhi::D3D12, QByteArray::isEmpty(), QRhi::Metal, QRhi::Null, QRhi::OpenGLES2, QByteArrayLiteral, qgetenv(), qWarning, and QRhi::Vulkan.

Referenced by renderToKTXFile().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderToKTXFile()

QString renderToKTXFile ( const QString inPath,
const QString outPath 
)

Definition at line 644 of file qssgiblbaker.cpp.

References QSurfaceFormat::CoreProfile, QRhi::D3D11, QRhi::D3D12, getRhiImplementation(), QOpenGLContext::LibGL, QRhi::Metal, QRhi::OpenGLES2, QOpenGLContext::openGLModuleType(), QStringLiteral, renderToKTXFileInternal(), and QRhi::Vulkan.

Referenced by QSSGIblBaker::import().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderToKTXFileInternal()

QString renderToKTXFileInternal ( const char *  name,
const QString inPath,
const QString outPath,
QRhi::Implementation  impl,
QRhiInitParams initParams 
)

Definition at line 100 of file qssgiblbaker.cpp.

References QVarLengthArray< T, Prealloc >::append(), cb, QRhiTextureRenderTargetDescription::cbeginColorAttachments(), QRhiGraphicsPipeline::CCW, QRhiSampler::ClampToEdge, QFileDevice::close(), QRhiRenderBuffer::Color, QSSGRhiContext::commonPassFlags(), QMatrix4x4::constData(), QList< T >::constData(), QRhiBuffer::create(), QRhiTexture::create(), QRhiRenderBuffer::create(), QRhiShaderResourceBindings::create(), QRhiGraphicsPipeline::create(), QRhi::create(), cube, QRhiTexture::CubeMap, QList< T >::data(), QScopedPointer< T, Cleanup >::data(), QRhiResource::deleteLater(), desc, QRhiTextureRenderTarget::description(), QRhiBuffer::Dynamic, QRhiVertexInputAttribute::Float3, FORMAT(), QRhiShaderResourceBinding::FragmentStage, QRhiGraphicsPipeline::Front, QScopedPointer< T, Cleanup >::get(), QSSGRenderTextureFormat::getNumberOfComponent(), QSSGRenderTextureFormat::getSizeofFormat(), QSSGInputUtil::getStreamForFile(), GL_HALF_FLOAT, GL_RGBA, GL_RGBA16F, QSize::height(), QRhiBuffer::Immutable, QMap< Key, T >::insert(), KTX_IDENTIFIER_LENGTH, ktxIdentifier, QRhiGraphicsPipeline::LessOrEqual, QRhiSampler::Linear, QSSGLoadedTexture::loadHdrImage(), QMatrix4x4::lookAt(), QRhiTexture::MipMapped, QRhiRenderPassDescriptor::newCompatibleRenderPassDescriptor(), QRhiSampler::None, QFile::open(), QMatrix4x4::perspective(), platformEndianIdentifier, Q_ASSERT, qDebug, qMax(), qMin(), QStringLiteral, qWarning, QRhiResourceUpdateBatch::readBackTexture(), QRhiTexture::RenderTarget, QRhiSampler::Repeat, QList< T >::resize(), QRhiTexture::RGBA16F, QSSGRenderTextureFormat::RGBE8, QRhiShaderResourceBinding::sampledTexture(), QRhiVertexInputLayout::setAttributes(), QRhiShaderResourceBindings::setBindings(), QRhiVertexInputLayout::setBindings(), QRhiTextureRenderTargetDescription::setColorAttachments(), QRhiGraphicsPipeline::setCullMode(), QRhiGraphicsPipeline::setDepthOp(), QRhiGraphicsPipeline::setFrontFace(), QRhiColorAttachment::setLayer(), QRhiReadbackDescription::setLayer(), QRhiColorAttachment::setLevel(), QRhiReadbackDescription::setLevel(), QRhiGraphicsPipeline::setRenderPassDescriptor(), QRhiGraphicsPipeline::setShaderResourceBindings(), QRhiGraphicsPipeline::setShaderStages(), QRhiGraphicsPipeline::setVertexInputLayout(), QMap< Key, T >::size(), QList< T >::size(), QRhiColorAttachment::texture(), QRhiBuffer::UniformBuffer, QRhiShaderResourceBinding::uniformBufferWithDynamicOffset(), QRhiTexture::UsedWithGenerateMips, QRhiBuffer::VertexBuffer, QRhiShaderResourceBinding::VertexStage, QSize::width(), QIODevice::write(), and QIODeviceBase::WriteOnly.

Referenced by renderToKTXFile().

+ Here is the caller graph for this function:

Variable Documentation

◆ cube

const float cube[]
static

Definition at line 62 of file qssgiblbaker.cpp.

Referenced by renderToKTXFileInternal().