Fix T61373: Crash when selecting the edit mode

Some GPUs complain about `error C7011: implicit cast from "int" to "uint"` even if the cast is explicit.
This commit is contained in:
Germano Cavalcante 2019-02-18 11:30:22 -03:00
parent abb147e609
commit c94b3b19a2
Notes: blender-bot 2023-12-08 16:39:08 +01:00
Referenced by issue #61373, Often crashes in edit mode
2 changed files with 8 additions and 8 deletions

View File

@ -14,10 +14,10 @@ void main()
{
#ifndef UNIFORM_ID
id = vec4(
(((color + offset) ) & uint(0xFF)) * (1.0f / 255.0f),
(((color + offset) >> 8) & uint(0xFF)) * (1.0f / 255.0f),
(((color + offset) >> 16) & uint(0xFF)) * (1.0f / 255.0f),
(((color + offset) >> 24) ) * (1.0f / 255.0f));
(((color + offset) ) & 0xFFu) * (1.0f / 255.0f),
(((color + offset) >> 8u) & 0xFFu) * (1.0f / 255.0f),
(((color + offset) >> 16u) & 0xFFu) * (1.0f / 255.0f),
(((color + offset) >> 24u) ) * (1.0f / 255.0f));
#endif
vec4 pos_4d = vec4(pos, 1.0);

View File

@ -11,10 +11,10 @@ void main()
{
#ifdef UNIFORM_ID
fragColor = vec4(
((id ) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 8) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 16) & uint(0xFF)) * (1.0f / 255.0f),
((id >> 24) ) * (1.0f / 255.0f));
((id ) & 0xFFu) * (1.0f / 255.0f),
((id >> 8u) & 0xFFu) * (1.0f / 255.0f),
((id >> 16u) & 0xFFu) * (1.0f / 255.0f),
((id >> 24u) ) * (1.0f / 255.0f));
#else
fragColor = id;
#endif