diff --git a/src/bgfx.cpp b/src/bgfx.cpp index a26d7f6c7..d89962757 100644 --- a/src/bgfx.cpp +++ b/src/bgfx.cpp @@ -1575,7 +1575,7 @@ namespace bgfx void UniformBuffer::writeUniform(UniformType::Enum _type, uint16_t _loc, const void* _value, uint16_t _num) { - const uint32_t opcode = encodeOpcode(bx::narrowCast(_type), _loc, _num, true); + const uint32_t opcode = encodeOpcode(uint8_t(_type), _loc, _num, true); write(opcode); write(_value, g_uniformTypeSize[_type]*_num); } diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index 1f149950d..aa08e2409 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -5336,7 +5336,7 @@ namespace bgfx { namespace gl } UniformType::Enum type = convertGlType(gltype); - m_constantBuffer->writeUniformHandle(bx::narrowCast(type), 0, info->m_handle, uint16_t(num) ); + m_constantBuffer->writeUniformHandle(uint8_t(type), 0, info->m_handle, uint16_t(num) ); m_constantBuffer->write(loc); BX_TRACE("store %s %d", name, info->m_handle); }