Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Laszlo Agocs
qtrhi
Commits
7ade2c84
Commit
7ade2c84
authored
Jan 18, 2019
by
Laszlo Agocs
Browse files
Start getting rid of structs
parent
758458f2
Changes
26
Hide whitespace changes
Inline
Side-by-side
examples/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
View file @
7ade2c84
...
...
@@ -118,14 +118,14 @@ void Window::customInit()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
View file @
7ade2c84
...
...
@@ -122,14 +122,14 @@ void Window::customInit()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/cubemap/cubemap.cpp
View file @
7ade2c84
...
...
@@ -125,12 +125,12 @@ void Window::customInit()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/hellominimalcrossgfxtriangle/hellominimalcrossgfxtriangle.cpp
View file @
7ade2c84
...
...
@@ -338,13 +338,13 @@ void Window::init()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
examples/rhi/imguidemo/imguidemo.cpp
View file @
7ade2c84
...
...
@@ -103,13 +103,13 @@ void Window::customInit()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/imguidemo/qrhiimgui.cpp
View file @
7ade2c84
...
...
@@ -178,14 +178,14 @@ bool QRhiImgui::prepareFrame(QRhiRenderTarget *rt, QRhiRenderPassDescriptor *rp,
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
4
*
sizeof
(
float
)
+
sizeof
(
quint32
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
2
*
sizeof
(
float
)
},
{
0
,
2
,
QRhiVertexInput
Layout
::
Attribute
::
UNormByte4
,
4
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float2
,
2
*
sizeof
(
float
)
},
{
0
,
2
,
QRhiVertexInputAttribute
::
UNormByte4
,
4
*
sizeof
(
float
)
}
}
)
;
d
->
ps
->
setVertexInputLayout
(
inputLayout
);
d
->
ps
->
setShaderResourceBindings
(
d
->
textures
[
0
].
srb
);
...
...
examples/rhi/msaarenderbuffer/msaarenderbuffer.cpp
View file @
7ade2c84
...
...
@@ -119,8 +119,10 @@ void Window::customInit()
// rb is multisample, instead of writing out the msaa data into it,
// resolve into d.tex at the end of each render pass
QRhiTextureRenderTargetDescription
rtDesc
{
d
.
rb
};
rtDesc
.
colorAttachments
[
0
].
resolveTexture
=
d
.
tex
;
QRhiTextureRenderTargetDescription
rtDesc
;
QRhiColorAttachment
rtAtt
(
d
.
rb
);
rtAtt
.
setResolveTexture
(
d
.
tex
);
rtDesc
.
setColorAttachments
({
rtAtt
});
d
.
rt
=
m_r
->
newTextureRenderTarget
(
rtDesc
);
d
.
releasePool
<<
d
.
rt
;
...
...
@@ -148,13 +150,13 @@ void Window::customInit()
{
QRhiGraphicsShaderStage
::
Fragment
,
getShader
(
QLatin1String
(
":/color.frag.qsb"
))
}
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
d
.
triPs
->
setVertexInputLayout
(
inputLayout
);
d
.
triPs
->
setShaderResourceBindings
(
d
.
triSrb
);
d
.
triPs
->
setRenderPassDescriptor
(
d
.
rtRp
);
...
...
@@ -179,13 +181,13 @@ void Window::customInit()
{
QRhiGraphicsShaderStage
::
Vertex
,
getShader
(
QLatin1String
(
":/texture.vert.qsb"
))
},
{
QRhiGraphicsShaderStage
::
Fragment
,
getShader
(
QLatin1String
(
":/texture.frag.qsb"
))
}
});
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
4
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float2
,
2
*
sizeof
(
float
)
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
d
.
ps
->
setRenderPassDescriptor
(
m_rp
);
...
...
examples/rhi/msaatexture/msaatexture.cpp
View file @
7ade2c84
...
...
@@ -168,13 +168,11 @@ void Window::customInit()
{
QRhiGraphicsShaderStage
::
Fragment
,
getShader
(
QLatin1String
(
":/texture.frag.qsb"
))
}
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
bindings
=
{
{
4
*
sizeof
(
float
)
}
};
inputLayout
.
attributes
=
{
{
0
,
0
,
QRhiVertexInputLayout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputLayout
::
Attribute
::
Float2
,
2
*
sizeof
(
float
)
}
};
inputLayout
.
setBindings
({
{
4
*
sizeof
(
float
)
}
});
inputLayout
.
setAttributes
({
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float2
,
2
*
sizeof
(
float
)
}
});
d
.
psLeft
->
setVertexInputLayout
(
inputLayout
);
d
.
psLeft
->
setShaderResourceBindings
(
d
.
srbLeft
);
d
.
psLeft
->
setRenderPassDescriptor
(
m_rp
);
...
...
@@ -224,13 +222,13 @@ void Window::customInit()
{
QRhiGraphicsShaderStage
::
Vertex
,
getShader
(
QLatin1String
(
":/color.vert.qsb"
))
},
{
QRhiGraphicsShaderStage
::
Fragment
,
getShader
(
QLatin1String
(
":/color.frag.qsb"
))
}
});
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
d
.
triPs
->
setVertexInputLayout
(
inputLayout
);
d
.
triPs
->
setShaderResourceBindings
(
d
.
triSrb
);
d
.
triPs
->
setRenderPassDescriptor
(
d
.
rtRp
);
...
...
examples/rhi/multiwindow/multiwindow.cpp
View file @
7ade2c84
...
...
@@ -248,13 +248,13 @@ void ensureSharedResources(QRhiRenderPassDescriptor *rp)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/multiwindow_threaded/multiwindow_threaded.cpp
View file @
7ade2c84
...
...
@@ -502,14 +502,14 @@ void Renderer::init()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
examples/rhi/offscreen/offscreen.cpp
View file @
7ade2c84
...
...
@@ -268,13 +268,13 @@ int main(int argc, char **argv)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
5
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
ps
->
setVertexInputLayout
(
inputLayout
);
ps
->
setShaderResourceBindings
(
srb
);
...
...
examples/rhi/texuploads/texuploads.cpp
View file @
7ade2c84
...
...
@@ -129,14 +129,14 @@ void Window::customInit()
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
d
.
ps
->
setVertexInputLayout
(
inputLayout
);
d
.
ps
->
setShaderResourceBindings
(
d
.
srb
);
...
...
examples/rhi/triquadcube/texturedcuberenderer.cpp
View file @
7ade2c84
...
...
@@ -126,14 +126,14 @@ void TexturedCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
examples/rhi/triquadcube/triangleoncuberenderer.cpp
View file @
7ade2c84
...
...
@@ -143,14 +143,14 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
3
*
sizeof
(
float
)
},
{
2
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float3
,
0
},
{
1
,
1
,
QRhiVertexInputAttribute
::
Float2
,
0
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
@@ -164,15 +164,19 @@ void TriangleOnCubeRenderer::initResources(QRhiRenderPassDescriptor *rp)
if
(
DEPTH_TEXTURE
)
{
QRhiTextureRenderTargetDescription
desc
;
desc
.
d
epthTexture
=
m_depthTex
;
desc
.
setD
epthTexture
(
m_depthTex
)
;
m_rt
=
m_r
->
newTextureRenderTarget
(
desc
,
rtFlags
);
}
else
{
QRhiTextureRenderTargetDescription
desc
{
m_tex
};
QRhiTextureRenderTargetDescription
desc
;
QRhiColorAttachment
color0
{
m_tex
};
if
(
DS_ATT
)
desc
.
d
epthStencilBuffer
=
m_ds
;
desc
.
setD
epthStencilBuffer
(
m_ds
)
;
if
(
MRT
)
{
m_offscreenTriangle
.
setColorAttCount
(
2
);
desc
.
colorAttachments
.
append
(
m_tex2
);
QRhiColorAttachment
color1
{
m_tex2
};
desc
.
setColorAttachments
({
color0
,
color1
});
}
else
{
desc
.
setColorAttachments
({
color0
});
}
m_rt
=
m_r
->
newTextureRenderTarget
(
desc
,
rtFlags
);
}
...
...
examples/rhi/triquadcube/trianglerenderer.cpp
View file @
7ade2c84
...
...
@@ -117,13 +117,13 @@ void TriangleRenderer::initResources(QRhiRenderPassDescriptor *rp)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
7
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
examples/rhi/triquadcube/triquadcube.cpp
View file @
7ade2c84
...
...
@@ -155,6 +155,7 @@ void Window::customInit()
qDebug
(
"isFeatureSupported(Timestamps): %d"
,
m_r
->
isFeatureSupported
(
QRhi
::
Timestamps
));
qDebug
(
"isFeatureSupported(Instancing): %d"
,
m_r
->
isFeatureSupported
(
QRhi
::
Instancing
));
qDebug
(
"isFeatureSupported(CustomInstanceStepRate): %d"
,
m_r
->
isFeatureSupported
(
QRhi
::
CustomInstanceStepRate
));
qDebug
(
"isFeatureSupported(PrimitiveRestart): %d"
,
m_r
->
isFeatureSupported
(
QRhi
::
PrimitiveRestart
));
qDebug
(
"Min 2D texture width/height: %d"
,
m_r
->
resourceSizeLimit
(
QRhi
::
TextureSizeMin
));
qDebug
(
"Max 2D texture width/height: %d"
,
m_r
->
resourceSizeLimit
(
QRhi
::
TextureSizeMax
));
}
...
...
examples/rhi/vulkanwindow/trianglerenderer.cpp
View file @
7ade2c84
...
...
@@ -102,13 +102,13 @@ void TriangleRenderer::initResources(QRhiRenderPassDescriptor *rp)
});
QRhiVertexInputLayout
inputLayout
;
inputLayout
.
b
indings
=
{
inputLayout
.
setB
indings
(
{
{
7
*
sizeof
(
float
)
}
};
inputLayout
.
a
ttributes
=
{
{
0
,
0
,
QRhiVertexInput
Layout
::
Attribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInput
Layout
::
Attribute
::
Float3
,
2
*
sizeof
(
float
)
}
};
}
)
;
inputLayout
.
setA
ttributes
(
{
{
0
,
0
,
QRhiVertexInputAttribute
::
Float2
,
0
},
{
0
,
1
,
QRhiVertexInputAttribute
::
Float3
,
2
*
sizeof
(
float
)
}
}
)
;
m_ps
->
setVertexInputLayout
(
inputLayout
);
m_ps
->
setShaderResourceBindings
(
m_srb
);
...
...
src/rhi/qrhi.cpp
View file @
7ade2c84
...
...
@@ -380,7 +380,7 @@ QT_BEGIN_NAMESPACE
only possible with a QRhiGraphicsPipeline that has
QRhiGraphicsPipeline::UsesScissor set.
\note QRhi assumes OpenGL-style
viewp
or
t
coordinates, meaning x and y are
\note QRhi assumes OpenGL-style
sciss
or coordinates, meaning x and y are
bottom-left.
\sa QRhiCommandBuffer::setScissor(), QRhiViewport
...
...
@@ -393,7 +393,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\class QRhiVertexInput
Layout::
Binding
\class QRhiVertexInputBinding
\inmodule QtRhi
\brief Describes a vertex input binding.
...
...
@@ -414,14 +414,14 @@ QT_BEGIN_NAMESPACE
\badcode
QRhiVertexInputLayout inputLayout;
inputLayout.
b
indings
=
{
inputLayout.
setB
indings
(
{
{ 3 * sizeof(float) },
{ 2 * sizeof(float) }
};
}
)
;
\endcode
Only the stride is interesting here since instancing is not used. The
binding number is given by the index of the QRhiVertexInput
Layout::
Binding
binding number is given by the index of the QRhiVertexInputBinding
element in the bindings vector of the QRhiVertexInputLayout.
Once a graphics pipeline with this vertex input layout is bound, the vertex
...
...
@@ -445,7 +445,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\enum QRhiVertexInput
Layout::
Binding::Classification
\enum QRhiVertexInputBinding::Classification
Describes the input data classification.
\value PerVertex Data is per-vertex
...
...
@@ -453,7 +453,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\class QRhiVertexInput
Layout::
Attribute
\class QRhiVertexInputAttribute
\inmodule QtRhi
\brief Describes a single vertex input element.
...
...
@@ -478,14 +478,14 @@ QT_BEGIN_NAMESPACE
\badcode
QRhiVertexInputLayout inputLayout;
inputLayout.
b
indings
=
{
inputLayout.
setB
indings
(
{
{ 3 * sizeof(float) },
{ 2 * sizeof(float) }
};
inputLayout.
a
ttributes
=
{
{ 0, 0, QRhiVertexInput
Layout::
Attribute::Float3, 0 },
{ 1, 1, QRhiVertexInput
Layout::
Attribute::Float2, 0 }
};
}
)
;
inputLayout.
setA
ttributes
(
{
{ 0, 0, QRhiVertexInputAttribute::Float3, 0 },
{ 1, 1, QRhiVertexInputAttribute::Float2, 0 }
}
)
;
\endcode
Once a graphics pipeline with this vertex input layout is bound, the vertex
...
...
@@ -503,13 +503,13 @@ QT_BEGIN_NAMESPACE
\badcode
QRhiVertexInputLayout inputLayout;
inputLayout.
b
indings
=
{
inputLayout.
setB
indings
(
{
{ 5 * sizeof(float) }
};
inputLayout.
a
ttributes
=
{
{ 0, 0, QRhiVertexInput
Layout::
Attribute::Float3, 0 },
{ 0, 1, QRhiVertexInput
Layout::
Attribute::Float2, 3 * sizeof(float) }
};
}
)
;
inputLayout.
setA
ttributes
(
{
{ 0, 0, QRhiVertexInputAttribute::Float3, 0 },
{ 0, 1, QRhiVertexInputAttribute::Float2, 3 * sizeof(float) }
}
)
;
\endcode
and then:
...
...
@@ -522,7 +522,7 @@ QT_BEGIN_NAMESPACE
*/
/*!
\enum QRhiVertexInput
Layout::
Attribute::Format
\enum QRhiVertexInputAttribute::Format
Specifies the type of the element data.
\value Float4 Four component float vector
...
...
@@ -586,18 +586,20 @@ QT_BEGIN_NAMESPACE
zero or one renderbuffer as combined depth/stencil buffer or zero or one
texture as depth buffer.
\note \l depthStencilBuffer and \l depthTexture cannot be both set.
\note depthStencilBuffer() and depthTexture() cannot be both set (cannot be
non-null at the same time).
*/
/*!
\class QRhi
TextureRenderTargetDescription::
ColorAttachment
\class QRhiColorAttachment
\inmodule QtRhi
\brief Describes the a single color attachment of a render target.
A color attachment is either a QRhiTexture or a QRhiRenderBuffer. The
former, when
\l
texture is set, is used in most cases.
former, when texture
()
is set, is used in most cases.
\note \l texture and \l renderBuffer cannot be both set.
\note texture() and renderBuffer() cannot be both set (be non-null at the
same time).
Setting renderBuffer instead is recommended only when multisampling is
needed. Relying on QRhi::MultisampleRenderBuffer is a better choice than
...
...
@@ -606,11 +608,11 @@ QT_BEGIN_NAMESPACE
support for multisample textures, but does support multisample
renderbuffers).
When targeting a non-multisample texture, the
\l
layer and
\l
level
When targeting a non-multisample texture, the layer
()
and level
()
indicate the targeted layer (face index \c{0-5} for cubemaps) and mip
level.
When
\l
texture or
\l
renderBuffer is multisample,
\l
resolveTexture can be
When texture
()
or renderBuffer
()
is multisample, resolveTexture
()
can be
set optionally. When set, samples are resolved automatically into that
(non-multisample) texture at the end of the render pass. When rendering
into a multisample renderbuffers, this is the only way to get resolved,
...
...
@@ -618,8 +620,8 @@ QT_BEGIN_NAMESPACE
shaders so for them this is just one option.
\note when resolving is enabled, the multisample data may not be written
out at all. This means that the multisample
\l
texture must not be used
afterwards with shaders for sampling when
\l
resolveTexture is set.
out at all. This means that the multisample texture
()
must not be used
afterwards with shaders for sampling when resolveTexture
()
is set.
*/
/*!
...
...
@@ -990,7 +992,7 @@ QT_BEGIN_NAMESPACE
\value PreserveDepthStencilContents Indicates that the contents of the
depth texture is to be loaded when starting a render pass, instead
clearing. Only applicable when a texture is used as the depth buffer
(QRhiTextureRenderTargetDescription::depthTexture is set) because
(QRhiTextureRenderTargetDescription::depthTexture
()
is set) because
depth/stencil renderbuffers may not have any physical backing and data may
not be written out in the first place.
*/
...
...
@@ -1862,7 +1864,7 @@ QRhiSwapChain::QRhiSwapChain(QRhiImplementation *rhi)
\fn QRhiCommandBuffer *QRhiSwapChain::currentFrameCommandBuffer()
\return a command buffer on which rendering commands can be recorded. Only
valid within a Rhi::beginFrame() - QRhi::endFrame() block where
valid within a
Q
Rhi::beginFrame() - QRhi::endFrame() block where
beginFrame() was called with this swapchain.
\note the value must not be cached and reused between frames
...
...
@@ -2598,13 +2600,13 @@ void QRhiCommandBuffer::setGraphicsPipeline(QRhiGraphicsPipeline *ps,
\badcode
QRhiVertexInputLayout inputLayout;
inputLayout.
b
indings
=
{
inputLayout.
setB
indings
(
{
{ 5 * sizeof(float) }
};
inputLayout.
a
ttributes
=
{