[Bf-blender-cvs] [9c435200102] master: GPU Extension: Add OS defines
Clément Foucault
noreply at git.blender.org
Sat Mar 9 16:27:32 CET 2019
Commit: 9c4352001022440f0cffbc64061cd67f28d687b3
Author: Clément Foucault
Date: Sat Mar 9 16:42:44 2019 +0100
Branches: master
https://developer.blender.org/rB9c4352001022440f0cffbc64061cd67f28d687b3
GPU Extension: Add OS defines
This makes possible to have os specific workaround inside the shaders.
===================================================================
M source/blender/gpu/intern/gpu_shader.c
===================================================================
diff --git a/source/blender/gpu/intern/gpu_shader.c b/source/blender/gpu/intern/gpu_shader.c
index e9ca3257a8f..55b696e5ba2 100644
--- a/source/blender/gpu/intern/gpu_shader.c
+++ b/source/blender/gpu/intern/gpu_shader.c
@@ -271,6 +271,14 @@ static void gpu_shader_standard_defines(char defines[MAX_DEFINE_LENGTH])
else if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY))
strcat(defines, "#define GPU_INTEL\n");
+ /* some useful defines to detect OS type */
+ if (GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_WIN, GPU_DRIVER_ANY))
+ strcat(defines, "#define OS_WIN\n");
+ else if (GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY))
+ strcat(defines, "#define OS_MAC\n");
+ else if (GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_UNIX, GPU_DRIVER_ANY))
+ strcat(defines, "#define OS_UNIX\n");
+
return;
}
More information about the Bf-blender-cvs
mailing list