summaryrefslogtreecommitdiffstats
path: root/src/gui/rhi/qrhi_p.h
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-10-13 15:47:27 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-10-14 22:35:19 +0200
commit63790184c79d2765ea726488726cd9f2b43b91d1 (patch)
tree6fefd355602e18efcbdc432b038c40646f02963e /src/gui/rhi/qrhi_p.h
parent61dee37d667e083fd2979ecc166efbc1bfcaf0e7 (diff)
rhi: Fix up vertex inputs with matrices
In order to prevent too much voodoo in backends like D3D11, the input layout is expected to specify the slice index for vecX that are part of an unrolled matrix. Also deoptimize the instancing manual test to exercise a matrix too instead of just vectors. Change-Id: If2dcbcbc483645ce2420b2f87dda765b95da6e80 Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Diffstat (limited to 'src/gui/rhi/qrhi_p.h')
-rw-r--r--src/gui/rhi/qrhi_p.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/gui/rhi/qrhi_p.h b/src/gui/rhi/qrhi_p.h
index 977b68cd8e..6a141d13e1 100644
--- a/src/gui/rhi/qrhi_p.h
+++ b/src/gui/rhi/qrhi_p.h
@@ -212,7 +212,7 @@ public:
};
QRhiVertexInputAttribute() = default;
- QRhiVertexInputAttribute(int binding, int location, Format format, quint32 offset);
+ QRhiVertexInputAttribute(int binding, int location, Format format, quint32 offset, int matrixSlice = -1);
int binding() const { return m_binding; }
void setBinding(int b) { m_binding = b; }
@@ -226,11 +226,15 @@ public:
quint32 offset() const { return m_offset; }
void setOffset(quint32 ofs) { m_offset = ofs; }
+ int matrixSlice() const { return m_matrixSlice; }
+ void setMatrixSlice(int slice) { m_matrixSlice = slice; }
+
private:
int m_binding = 0;
int m_location = 0;
Format m_format = Float4;
quint32 m_offset = 0;
+ int m_matrixSlice = -1;
};
Q_DECLARE_TYPEINFO(QRhiVertexInputAttribute, Q_MOVABLE_TYPE);