![]() |
Qt 6.x
The Qt SDK
|
#include <qrhigles2_p.h>
Public Member Functions | |
QGles2GraphicsPipeline (QRhiImplementation *rhi) | |
~QGles2GraphicsPipeline () | |
void | destroy () override |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
bool | create () override |
Creates the corresponding native graphics resources. | |
![]() | |
QRhiResource::Type | resourceType () const override |
Flags | flags () const |
void | setFlags (Flags f) |
Sets the flags f. | |
Topology | topology () const |
void | setTopology (Topology t) |
Sets the primitive topology t. | |
CullMode | cullMode () const |
void | setCullMode (CullMode mode) |
Sets the specified face culling mode. | |
FrontFace | frontFace () const |
void | setFrontFace (FrontFace f) |
Sets the front face mode f. | |
void | setTargetBlends (std::initializer_list< TargetBlend > list) |
Sets the list of render target blend settings. | |
template<typename InputIterator > | |
void | setTargetBlends (InputIterator first, InputIterator last) |
Sets the list of render target blend settings from the iterators first and last. | |
const TargetBlend * | cbeginTargetBlends () const |
const TargetBlend * | cendTargetBlends () const |
const TargetBlend * | targetBlendAt (qsizetype index) const |
qsizetype | targetBlendCount () const |
bool | hasDepthTest () const |
void | setDepthTest (bool enable) |
Enables or disables depth testing based on enable. | |
bool | hasDepthWrite () const |
void | setDepthWrite (bool enable) |
Controls the writing out of depth data into the depth buffer based on enable. | |
CompareOp | depthOp () const |
void | setDepthOp (CompareOp op) |
Sets the depth comparison function op. | |
bool | hasStencilTest () const |
void | setStencilTest (bool enable) |
Enables or disables stencil tests based on enable. | |
StencilOpState | stencilFront () const |
void | setStencilFront (const StencilOpState &state) |
Sets the stencil test state for front faces. | |
StencilOpState | stencilBack () const |
void | setStencilBack (const StencilOpState &state) |
Sets the stencil test state for back faces. | |
quint32 | stencilReadMask () const |
void | setStencilReadMask (quint32 mask) |
Sets the stencil read mask. | |
quint32 | stencilWriteMask () const |
void | setStencilWriteMask (quint32 mask) |
Sets the stencil write mask. | |
int | sampleCount () const |
void | setSampleCount (int s) |
Sets the sample count. | |
float | lineWidth () const |
void | setLineWidth (float width) |
Sets the line width. | |
int | depthBias () const |
void | setDepthBias (int bias) |
Sets the depth bias. | |
float | slopeScaledDepthBias () const |
void | setSlopeScaledDepthBias (float bias) |
Sets the slope scaled depth bias. | |
void | setShaderStages (std::initializer_list< QRhiShaderStage > list) |
Sets the list of shader stages. | |
template<typename InputIterator > | |
void | setShaderStages (InputIterator first, InputIterator last) |
Sets the list of shader stages from the iterators first and last. | |
const QRhiShaderStage * | cbeginShaderStages () const |
const QRhiShaderStage * | cendShaderStages () const |
const QRhiShaderStage * | shaderStageAt (qsizetype index) const |
qsizetype | shaderStageCount () const |
QRhiVertexInputLayout | vertexInputLayout () const |
void | setVertexInputLayout (const QRhiVertexInputLayout &layout) |
Specifies the vertex input layout. | |
QRhiShaderResourceBindings * | shaderResourceBindings () const |
void | setShaderResourceBindings (QRhiShaderResourceBindings *srb) |
Associates with srb describing the resource binding layout and the resources (QRhiBuffer, QRhiTexture) themselves. | |
QRhiRenderPassDescriptor * | renderPassDescriptor () const |
void | setRenderPassDescriptor (QRhiRenderPassDescriptor *desc) |
Associates with the specified QRhiRenderPassDescriptor desc. | |
int | patchControlPointCount () const |
void | setPatchControlPointCount (int count) |
Sets the number of patch control points to count. | |
PolygonMode | polygonMode () const |
void | setPolygonMode (PolygonMode mode) |
Sets the polygon mode. | |
int | multiViewCount () const |
void | setMultiViewCount (int count) |
Sets the view count for multiview rendering. | |
virtual bool | create ()=0 |
Creates the corresponding native graphics resources. | |
![]() | |
virtual | ~QRhiResource () |
Destructor. | |
virtual Type | resourceType () const =0 |
virtual void | destroy ()=0 |
Releases (or requests deferred releasing of) the underlying native graphics resources. | |
void | deleteLater () |
When called without a frame being recorded, this function is equivalent to deleting the object. | |
QByteArray | name () const |
void | setName (const QByteArray &name) |
Sets a name for the object. | |
quint64 | globalResourceId () const |
QRhi * | rhi () const |
Public Attributes | |
GLuint | program = 0 |
GLenum | drawMode = GL_TRIANGLES |
QGles2UniformDescriptionVector | uniforms |
QGles2SamplerDescriptionVector | samplers |
QGles2UniformState | uniformState [QGles2UniformState::MAX_TRACKED_LOCATION+1] |
QRhiShaderResourceBindings * | currentSrb = nullptr |
uint | currentSrbGeneration = 0 |
uint | generation = 0 |
Friends | |
class | QRhiGles2 |
Definition at line 265 of file qrhigles2_p.h.
QGles2GraphicsPipeline::QGles2GraphicsPipeline | ( | QRhiImplementation * | rhi | ) |
Definition at line 5811 of file qrhigles2.cpp.
QGles2GraphicsPipeline::~QGles2GraphicsPipeline | ( | ) |
Definition at line 5816 of file qrhigles2.cpp.
References destroy().
|
overridevirtual |
Creates the corresponding native graphics resources.
If there are already resources present due to an earlier create() with no corresponding destroy(), then destroy() is called implicitly first.
true
when successful, false
when a graphics operation failed. Regardless of the return value, calling destroy() is always safe.VkPipelineCache
to improve data reuse during the lifetime of the application.Implements QRhiGraphicsPipeline.
Definition at line 5852 of file qrhigles2.cpp.
References QVarLengthArray< T, Prealloc >::begin(), QVarLengthArray< T, Prealloc >::constData(), currentSrb, currentSrbGeneration, desc, destroy(), drawMode, QRhi::EnablePipelineCacheDataSave, QVarLengthArray< T, Prealloc >::end(), QRhiShaderStage::Fragment, generation, QRhiShaderStage::Geometry, QShader::GlslShader, GLuint, isGraphicsStage(), QRhiGraphicsPipeline::m_shaderStages, QRhiGraphicsPipeline::m_topology, QRhiGles2::ProgramCacheError, QRhiGles2::ProgramCacheHit, QRhiGles2::ProgramCacheMiss, Q_ASSERT, QRHI_RES_RHI, QShader::shader(), QVLABaseBase::size(), QRhiShaderStage::TessellationControl, QRhiShaderStage::TessellationEvaluation, toGlTopology(), uniforms, uniformState, and QRhiShaderStage::Vertex.
|
overridevirtual |
Releases (or requests deferred releasing of) the underlying native graphics resources.
Safe to call multiple times, subsequent invocations will be a no-op then.
Once destroy() is called, the QRhiResource instance can be reused, by calling create()
again. That will then result in creating new native graphics resources underneath.
The QRhiResource destructor also performs the same task, so calling this function is not necessary before deleting a QRhiResource.
Implements QRhiResource.
Definition at line 5821 of file qrhigles2.cpp.
References QVarLengthArray< T, Prealloc >::clear(), e, QRhiGles2::DeferredReleaseEntry::Pipeline, program, QRHI_RES_RHI, and uniforms.
Referenced by ~QGles2GraphicsPipeline(), and create().
|
friend |
Definition at line 280 of file qrhigles2_p.h.
QRhiShaderResourceBindings* QGles2GraphicsPipeline::currentSrb = nullptr |
Definition at line 277 of file qrhigles2_p.h.
Referenced by create(), and QRhiGles2::setShaderResources().
uint QGles2GraphicsPipeline::currentSrbGeneration = 0 |
Definition at line 278 of file qrhigles2_p.h.
Referenced by create(), and QRhiGles2::setShaderResources().
GLenum QGles2GraphicsPipeline::drawMode = GL_TRIANGLES |
Definition at line 273 of file qrhigles2_p.h.
Referenced by create(), and QRhiGles2::executeCommandBuffer().
uint QGles2GraphicsPipeline::generation = 0 |
Definition at line 279 of file qrhigles2_p.h.
Referenced by create(), and QRhiGles2::setGraphicsPipeline().
GLuint QGles2GraphicsPipeline::program = 0 |
Definition at line 272 of file qrhigles2_p.h.
Referenced by destroy(), and QRhiGles2::executeBindGraphicsPipeline().
QGles2SamplerDescriptionVector QGles2GraphicsPipeline::samplers |
Definition at line 275 of file qrhigles2_p.h.
QGles2UniformDescriptionVector QGles2GraphicsPipeline::uniforms |
Definition at line 274 of file qrhigles2_p.h.
QGles2UniformState QGles2GraphicsPipeline::uniformState[QGles2UniformState::MAX_TRACKED_LOCATION+1] |
Definition at line 276 of file qrhigles2_p.h.
Referenced by create().