[Bf-blender-cvs] [c94b3b19a2c] master: Fix T61373: Crash when selecting the edit mode

mano-wii noreply at git.blender.org
Mon Feb 18 16:37:13 CET 2019


Commit: c94b3b19a2c07ce2617bf4998a1634f020660e4d
Author: mano-wii
Date:   Mon Feb 18 11:30:22 2019 -0300
Branches: master
https://developer.blender.org/rBc94b3b19a2c07ce2617bf4998a1634f020660e4d

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.

===================================================================

M	source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl
M	source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl

===================================================================

diff --git a/source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl b/source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl
index aa544ea82ee..b2d186efa91 100644
--- a/source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_3D_selection_id_vert.glsl
@@ -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);
diff --git a/source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl b/source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl
index 29fe9e9d8c7..a38113fad87 100644
--- a/source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl
+++ b/source/blender/gpu/shaders/gpu_shader_selection_id_frag.glsl
@@ -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



More information about the Bf-blender-cvs mailing list