Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2018-12-17 10:47:37 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-12-17 10:47:37 +0300
commit30a0f1a2bfe29a62b3cea70cead0200ad4e7234a (patch)
tree721fad12ced763772f84935fe5393b530ea56bb2 /source/blender
parentb322ce0847e308f15d0a551af0a77ecf3ee06091 (diff)
Workbench: Use int to fix compilation issues on certain platform
Diffstat (limited to 'source/blender')
-rw-r--r--source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl18
1 files changed, 9 insertions, 9 deletions
diff --git a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
index 5ce85dcd00d..76b00469f15 100644
--- a/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
+++ b/source/blender/draw/engines/workbench/shaders/workbench_common_lib.glsl
@@ -65,11 +65,11 @@ float workbench_float_pair_encode(float v1, float v2)
// const uint v1_mask = ~(0xFFFFFFFFu << ROUGHNESS_BITS);
// const uint v2_mask = ~(0xFFFFFFFFu << METALLIC_BITS);
/* Same as above because some compiler are dumb af. and think we use mediump int. */
- const uint total_mask = 0xFFu;
- const uint v1_mask = 0x1Fu;
- const uint v2_mask = 0x7u;
+ const int total_mask = 0xFF;
+ const int v1_mask = 0x1F;
+ const int v2_mask = 0x7;
int iv1 = int(v1 * float(v1_mask));
- int iv2 = int(v2 * float(v2_mask)) << ROUGHNESS_BITS;
+ int iv2 = int(v2 * float(v2_mask)) << int(ROUGHNESS_BITS);
return float(iv1 | iv2) * (1.0 / float(total_mask));
}
@@ -79,12 +79,12 @@ void workbench_float_pair_decode(float data, out float v1, out float v2)
// const uint v1_mask = ~(0xFFFFFFFFu << ROUGHNESS_BITS);
// const uint v2_mask = ~(0xFFFFFFFFu << METALLIC_BITS);
/* Same as above because some compiler are dumb af. and think we use mediump int. */
- const uint total_mask = 0xFFu;
- const uint v1_mask = 0x1Fu;
- const uint v2_mask = 0x7u;
- uint idata = uint(data * float(total_mask));
+ const int total_mask = 0xFF;
+ const int v1_mask = 0x1F;
+ const int v2_mask = 0x7;
+ int idata = int(data * float(total_mask));
v1 = float(idata & v1_mask) * (1.0 / float(v1_mask));
- v2 = float(idata >> ROUGHNESS_BITS) * (1.0 / float(v2_mask));
+ v2 = float(idata >> int(ROUGHNESS_BITS)) * (1.0 / float(v2_mask));
}
float calculate_transparent_weight(float z, float alpha)