Use types have same widths in loop condition.

In case comparisons between types of different widths in a loop condition
caused the loop to behave unexpectedly.
This commit is contained in:
Roy.li 2022-03-22 15:23:47 +08:00
parent 565db34cba
commit 749be80389
2 changed files with 2 additions and 2 deletions

View File

@ -4951,7 +4951,7 @@ void CompilerMSL::emit_custom_functions()
for (uint32_t variant = 0; variant < 12; variant++)
{
uint32_t dimensions = spv_func - SPVFuncImplArrayCopyMultidimBase;
uint8_t dimensions = spv_func - SPVFuncImplArrayCopyMultidimBase;
string tmp = "template<typename T";
for (uint8_t i = 0; i < dimensions; i++)
{

View File

@ -638,7 +638,7 @@ public:
protected:
// An enum of SPIR-V functions that are implemented in additional
// source code that is added to the shader if necessary.
enum SPVFuncImpl
enum SPVFuncImpl : uint8_t
{
SPVFuncImplNone,
SPVFuncImplMod,