tests: Clean up some MSVC++ compiler warnings
Known issues running tests on Windows:
- Compiler warnings from gtest that we haven’t spent the time to figure out
- Tests don’t run in place - you need to have them in the same directory with vulkan.dll,
gtest.dll, and if MSVC++ is not installed, the MSVC++ runtime dlls. If you want to use
the --compare-images option to vk_render_tests, you will need the “golden”
folder with golden images.
- vk_layer_validation_tests will fail unless you specify VK_LAYER_NAMES as Validation
in the registry or environment. You will also need to specify VK_LAYERS_PATH to point
to the layer dlls. The mismatched type validation test will fail regardless as the
check it is testing for did not make it into the SDK branch
- Known issue of parameter checker for CreateDepthStencilView expecting msaaResolveSubresource
to be valid even if msaa isn’t active
- Problem with runtime assert or hang in shader tracker - for now just remove the
shader checker files from your VK_LAYERS_PATH location.
diff --git a/tests/blit_tests.cpp b/tests/blit_tests.cpp
index d3159f2..59f04fe 100644
--- a/tests/blit_tests.cpp
+++ b/tests/blit_tests.cpp
@@ -1200,16 +1200,16 @@
// TODO support all formats
switch (format) {
case VK_FORMAT_R8G8B8A8_UNORM:
- raw.push_back(color[0] * 255.0f);
- raw.push_back(color[1] * 255.0f);
- raw.push_back(color[2] * 255.0f);
- raw.push_back(color[3] * 255.0f);
+ raw.push_back((uint8_t)(color[0] * 255.0f));
+ raw.push_back((uint8_t)(color[1] * 255.0f));
+ raw.push_back((uint8_t)(color[2] * 255.0f));
+ raw.push_back((uint8_t)(color[3] * 255.0f));
break;
case VK_FORMAT_B8G8R8A8_UNORM:
- raw.push_back(color[2] * 255.0f);
- raw.push_back(color[1] * 255.0f);
- raw.push_back(color[0] * 255.0f);
- raw.push_back(color[3] * 255.0f);
+ raw.push_back((uint8_t)(color[2] * 255.0f));
+ raw.push_back((uint8_t)(color[1] * 255.0f));
+ raw.push_back((uint8_t)(color[0] * 255.0f));
+ raw.push_back((uint8_t)(color[3] * 255.0f));
break;
default:
break;
@@ -1425,7 +1425,7 @@
case VK_FORMAT_D16_UNORM:
case VK_FORMAT_D16_UNORM_S8_UINT:
{
- const uint16_t unorm = depth * 65535.0f;
+ const uint16_t unorm = (uint16_t)(depth * 65535.0f);
raw.push_back(unorm & 0xff);
raw.push_back(unorm >> 8);
}