rhi: gl: get rid of a wrapper QByteArray where a raw ptr suffices
This is a visible performance increase actually, given this is on a quite hot chode path. Change-Id: I165bfa0d4e490f80078551efb4bf2fe8e72d3596 Reviewed-by: Paul Olav Tvete <paul.tvete@qt.io>bb10
parent
80091e0a0f
commit
63e54fbdfe
|
|
@ -2836,15 +2836,14 @@ void QRhiGles2::bindShaderResources(QRhiGraphicsPipeline *maybeGraphicsPs, QRhiC
|
|||
}
|
||||
}
|
||||
QGles2Buffer *bufD = QRHI_RES(QGles2Buffer, b->u.ubuf.buf);
|
||||
const QByteArray bufView = QByteArray::fromRawData(bufD->ubuf + viewOffset,
|
||||
b->u.ubuf.maybeSize ? b->u.ubuf.maybeSize : bufD->m_size);
|
||||
const char *bufView = bufD->ubuf + viewOffset;
|
||||
QGles2UniformDescriptionVector &uniforms(maybeGraphicsPs ? QRHI_RES(QGles2GraphicsPipeline, maybeGraphicsPs)->uniforms
|
||||
: QRHI_RES(QGles2ComputePipeline, maybeComputePs)->uniforms);
|
||||
for (QGles2UniformDescription &uniform : uniforms) {
|
||||
if (uniform.binding == b->binding) {
|
||||
// in a uniform buffer everything is at least 4 byte aligned
|
||||
// so this should not cause unaligned reads
|
||||
const void *src = bufView.constData() + uniform.offset;
|
||||
const void *src = bufView + uniform.offset;
|
||||
|
||||
if (uniform.arrayDim > 0
|
||||
&& uniform.type != QShaderDescription::Float
|
||||
|
|
|
|||
Loading…
Reference in New Issue