summaryrefslogtreecommitdiffstats
path: root/tests/manual
diff options
context:
space:
mode:
authorLaszlo Agocs <laszlo.agocs@qt.io>2020-06-12 17:39:41 +0200
committerLaszlo Agocs <laszlo.agocs@qt.io>2020-06-15 15:34:05 +0200
commit9b8d4a9e453b23f7b5b70280ee822f7f3a475261 (patch)
treeb3266327294cbb0b82f58417e44e85379acf6465 /tests/manual
parented231455cc22f6280be917780013584020d208d8 (diff)
rhi manual tests: Prevent warnings with MSVC
The QPair changes trigger warnings about size_t vs. quint32. We made offsets and sizes 32-bit in the QRhi API to emphasize that some of the graphics APIs are using 32-bit sizes still. It's a bit unfortunate that pairs now generate warnings when the size does not match. Just cast as needed. Change-Id: I88504eed8be6f4bdb2205b3671e2c2a9db9fcb1e Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'tests/manual')
-rw-r--r--tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp2
-rw-r--r--tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp2
-rw-r--r--tests/manual/rhi/mrt/mrt.cpp6
-rw-r--r--tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp6
-rw-r--r--tests/manual/rhi/msaatexture/msaatexture.cpp6
-rw-r--r--tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp2
-rw-r--r--tests/manual/rhi/texuploads/texuploads.cpp2
-rw-r--r--tests/manual/rhi/triquadcube/texturedcuberenderer.cpp2
-rw-r--r--tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp2
9 files changed, 15 insertions, 15 deletions
diff --git a/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
index b6526027d3..24227305aa 100644
--- a/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
+++ b/tests/manual/rhi/compressedtexture_bc1/compressedtexture_bc1.cpp
@@ -191,7 +191,7 @@ void Window::customRender()
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ d.vbuf, 0 },
- { d.vbuf, 36 * 3 * sizeof(float) }
+ { d.vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);
diff --git a/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
index b1626345cf..04516dd9bf 100644
--- a/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
+++ b/tests/manual/rhi/compressedtexture_bc1_subupload/compressedtexture_bc1_subupload.cpp
@@ -204,7 +204,7 @@ void Window::customRender()
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ d.vbuf, 0 },
- { d.vbuf, 36 * 3 * sizeof(float) }
+ { d.vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);
diff --git a/tests/manual/rhi/mrt/mrt.cpp b/tests/manual/rhi/mrt/mrt.cpp
index 5f36455386..03182bf170 100644
--- a/tests/manual/rhi/mrt/mrt.cpp
+++ b/tests/manual/rhi/mrt/mrt.cpp
@@ -166,7 +166,7 @@ void Window::customInit()
});
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float2, quint32(2 * sizeof(float)) }
});
d.ps->setVertexInputLayout(inputLayout);
d.ps->setShaderResourceBindings(d.colData[0].srb); // all of them are layout-compatible
@@ -209,7 +209,7 @@ void Window::customInit()
});
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float3, quint32(2 * sizeof(float)) }
});
d.triPs->setVertexInputLayout(inputLayout);
d.triPs->setShaderResourceBindings(d.triSrb);
@@ -248,7 +248,7 @@ void Window::customRender()
cb->setGraphicsPipeline(d.triPs);
cb->setViewport({ 0, 0, float(d.rt->pixelSize().width()), float(d.rt->pixelSize().height()) });
cb->setShaderResources();
- QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(quadVertexData));
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, quint32(sizeof(quadVertexData)));
cb->setVertexInput(0, 1, &vbufBinding);
cb->draw(3);
cb->endPass();
diff --git a/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp
index 9ce6c3ec5e..26ea484d9e 100644
--- a/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp
+++ b/tests/manual/rhi/msaarenderbuffer/msaarenderbuffer.cpp
@@ -155,7 +155,7 @@ void Window::customInit()
});
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float3, quint32(2 * sizeof(float)) }
});
d.triPs->setVertexInputLayout(inputLayout);
d.triPs->setShaderResourceBindings(d.triSrb);
@@ -186,7 +186,7 @@ void Window::customInit()
});
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float2, quint32(2 * sizeof(float)) }
});
d.ps->setVertexInputLayout(inputLayout);
d.ps->setShaderResourceBindings(d.srb);
@@ -241,7 +241,7 @@ void Window::customRender()
cb->setGraphicsPipeline(d.triPs);
cb->setViewport({ 0, 0, float(d.rb->pixelSize().width()), float(d.rb->pixelSize().height()) });
cb->setShaderResources();
- QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(vertexData));
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, quint32(sizeof(vertexData)));
cb->setVertexInput(0, 1, &vbufBinding);
cb->draw(3);
cb->endPass();
diff --git a/tests/manual/rhi/msaatexture/msaatexture.cpp b/tests/manual/rhi/msaatexture/msaatexture.cpp
index b7c306f97e..1b735d2984 100644
--- a/tests/manual/rhi/msaatexture/msaatexture.cpp
+++ b/tests/manual/rhi/msaatexture/msaatexture.cpp
@@ -171,7 +171,7 @@ void Window::customInit()
inputLayout.setBindings({ { 4 * sizeof(float) } });
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float2, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float2, quint32(2 * sizeof(float)) }
});
d.psLeft->setVertexInputLayout(inputLayout);
d.psLeft->setShaderResourceBindings(d.srbLeft);
@@ -227,7 +227,7 @@ void Window::customInit()
});
inputLayout.setAttributes({
{ 0, 0, QRhiVertexInputAttribute::Float2, 0 },
- { 0, 1, QRhiVertexInputAttribute::Float3, 2 * sizeof(float) }
+ { 0, 1, QRhiVertexInputAttribute::Float3, quint32(2 * sizeof(float)) }
});
d.triPs->setVertexInputLayout(inputLayout);
d.triPs->setShaderResourceBindings(d.triSrb);
@@ -299,7 +299,7 @@ void Window::customRender()
cb->setGraphicsPipeline(d.triPs);
cb->setViewport({ 0, 0, float(d.msaaTex->pixelSize().width()), float(d.msaaTex->pixelSize().height()) });
cb->setShaderResources();
- QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, sizeof(vertexData));
+ QRhiCommandBuffer::VertexInput vbufBinding(d.vbuf, quint32(sizeof(vertexData)));
cb->setVertexInput(0, 1, &vbufBinding);
cb->draw(3);
cb->endPass();
diff --git a/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp
index e271b2e8ac..731e7221f3 100644
--- a/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp
+++ b/tests/manual/rhi/multiwindow_threaded/multiwindow_threaded.cpp
@@ -613,7 +613,7 @@ void Renderer::render(bool newlyExposed, bool wakeBeforePresent)
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ m_vbuf, 0 },
- { m_vbuf, 36 * 3 * sizeof(float) }
+ { m_vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);
diff --git a/tests/manual/rhi/texuploads/texuploads.cpp b/tests/manual/rhi/texuploads/texuploads.cpp
index a98085188f..ee59c513ba 100644
--- a/tests/manual/rhi/texuploads/texuploads.cpp
+++ b/tests/manual/rhi/texuploads/texuploads.cpp
@@ -302,7 +302,7 @@ void Window::customRender()
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ d.vbuf, 0 },
- { d.vbuf, 36 * 3 * sizeof(float) }
+ { d.vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);
diff --git a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
index 6492c95104..5031eb219a 100644
--- a/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
+++ b/tests/manual/rhi/triquadcube/texturedcuberenderer.cpp
@@ -217,7 +217,7 @@ void TexturedCubeRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &outputS
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ m_vbuf, 0 },
- { m_vbuf, 36 * 3 * sizeof(float) }
+ { m_vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);
diff --git a/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
index 18f4828a01..0f2f7047ef 100644
--- a/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
+++ b/tests/manual/rhi/triquadcube/triangleoncuberenderer.cpp
@@ -285,7 +285,7 @@ void TriangleOnCubeRenderer::queueDraw(QRhiCommandBuffer *cb, const QSize &outpu
cb->setShaderResources();
const QRhiCommandBuffer::VertexInput vbufBindings[] = {
{ m_vbuf, 0 },
- { m_vbuf, 36 * 3 * sizeof(float) }
+ { m_vbuf, quint32(36 * 3 * sizeof(float)) }
};
cb->setVertexInput(0, 2, vbufBindings);
cb->draw(36);