aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt2
-rw-r--r--layers/shader_validation.cpp4
2 files changed, 4 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 785d6fc9..83b9ef27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -96,6 +96,8 @@ if(WIN32)
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34703>")
# Warn about different indirection types.
add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34057>")
+ # Warn about signed/unsigned mismatch.
+ add_compile_options("$<$<CXX_COMPILER_ID:MSVC>:/w34245>")
endif()
if(NOT WIN32)
diff --git a/layers/shader_validation.cpp b/layers/shader_validation.cpp
index ff3a84b8..11fcbdcb 100644
--- a/layers/shader_validation.cpp
+++ b/layers/shader_validation.cpp
@@ -584,8 +584,8 @@ static std::map<location_t, interface_var> collect_interface_by_location(shader_
unsigned id = insn.word(2);
unsigned type = insn.word(1);
- int location = value_or_default(var_locations, id, -1);
- int builtin = value_or_default(var_builtins, id, -1);
+ int location = value_or_default(var_locations, id, static_cast<unsigned>(-1));
+ int builtin = value_or_default(var_builtins, id, static_cast<unsigned>(-1));
unsigned component = value_or_default(var_components, id, 0); // Unspecified is OK, is 0
bool is_patch = var_patch.find(id) != var_patch.end();
bool is_relaxed_precision = var_relaxed_precision.find(id) != var_relaxed_precision.end();