Silence warnings

This commit is contained in:
twinaphex 2020-05-23 03:19:25 +02:00
parent b3a4c02d05
commit 6408da2ae4

View File

@ -73,7 +73,8 @@ get_semantic_name(slang_reflection& reflection,
"FrameCount",
"FrameDirection",
};
if ((int)semantic < sizeof(names) / sizeof(*names))
int size = sizeof(names) / sizeof(*names);
if ((int)semantic < size)
return std::string(names[semantic]);
return get_semantic_name(reflection.semantic_map, semantic, index);
@ -86,9 +87,11 @@ get_semantic_name(slang_reflection& reflection,
static const char* names[] = {
"Original", "Source", "OriginalHistory", "PassOutput", "PassFeedback",
};
int size;
if ((int)semantic < (int)SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY)
return std::string(names[semantic]);
else if ((int)semantic < sizeof(names) / sizeof(*names))
size = sizeof(names) / sizeof(*names);
if ((int)semantic < size)
return std::string(names[semantic]) + to_string(index);
return get_semantic_name(reflection.texture_semantic_map, semantic, index);
@ -101,9 +104,11 @@ static string get_size_semantic_name(
static const char* names[] = {
"OriginalSize", "SourceSize", "OriginalHistorySize", "PassOutputSize", "PassFeedbackSize",
};
int size;
if ((int)semantic < (int)SLANG_TEXTURE_SEMANTIC_ORIGINAL_HISTORY)
return std::string(names[semantic]);
if ((int)semantic < sizeof(names) / sizeof(*names))
size = sizeof(names) / sizeof(*names);
if ((int)semantic < size)
return std::string(names[semantic]) + to_string(index);
return get_semantic_name(reflection.texture_semantic_uniform_map, semantic, index);