diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2022-02-06 03:18:19 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2022-02-06 03:25:46 +0300 |
commit | 48fbf0baea88b6c9e1d41f5baafb6da1eb636a27 (patch) | |
tree | 1aed4e778ce107f2893a7f45f6fad8f110a36797 /source/blender/draw/intern/shaders/common_view_lib.glsl | |
parent | 085a3662dd60fb1aa7efaa0bc368c7a54ab3a275 (diff) |
DRW: Add preprocessor error if including common_view_lib.glsl without draw_view
This avoid making include mistake and potentially detect areas that do
not really need common_view_lib.glsl.
Diffstat (limited to 'source/blender/draw/intern/shaders/common_view_lib.glsl')
-rw-r--r-- | source/blender/draw/intern/shaders/common_view_lib.glsl | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/source/blender/draw/intern/shaders/common_view_lib.glsl b/source/blender/draw/intern/shaders/common_view_lib.glsl index d4d18b95238..2ac157ad208 100644 --- a/source/blender/draw/intern/shaders/common_view_lib.glsl +++ b/source/blender/draw/intern/shaders/common_view_lib.glsl @@ -1,5 +1,5 @@ /* Temporary until we fully make the switch. */ -#ifndef DRW_SHADER_SHARED_H +#ifndef USE_GPU_SHADER_CREATE_INFO # define DRW_RESOURCE_CHUNK_LEN 512 @@ -24,7 +24,13 @@ layout(std140) uniform viewBlock vec4 CameraTexCoFactors; }; -#endif /* DRW_SHADER_SHARED_H */ +#endif /* USE_GPU_SHADER_CREATE_INFO */ + +#ifdef USE_GPU_SHADER_CREATE_INFO +# ifndef DRW_RESOURCE_CHUNK_LEN +# error "Missing draw_view additional create info on shader create info" +# endif +#endif #define ViewNear (ViewVecs[0].w) #define ViewFar (ViewVecs[1].w) |