From eafec6d4f72b05c389576358b9e1d0ebd87cf174 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Tue, 18 Sep 2018 14:22:42 +0200 Subject: GPUShader: Manually validate sampler count This happens on NVidia GPUs, using more textures than the maximum allowed by the gl will NOT trigger a linking issue (maybe because of bindless texture implementation?). So in this case we manually count the number of samplers per shader stage and compare it against the GL limit. We discard the shader if the sampler count is too high. This shows the user something is wrong with the shader. --- source/blender/gpu/GPU_extensions.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'source/blender/gpu/GPU_extensions.h') diff --git a/source/blender/gpu/GPU_extensions.h b/source/blender/gpu/GPU_extensions.h index 23ac95775d7..1059ba06953 100644 --- a/source/blender/gpu/GPU_extensions.h +++ b/source/blender/gpu/GPU_extensions.h @@ -41,6 +41,9 @@ extern "C" { int GPU_max_texture_size(void); int GPU_max_texture_layers(void); int GPU_max_textures(void); +int GPU_max_textures_vert(void); +int GPU_max_textures_geom(void); +int GPU_max_textures_frag(void); float GPU_max_texture_anisotropy(void); int GPU_max_color_texture_samples(void); int GPU_max_cube_map_size(void); -- cgit v1.2.3