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-09-18 15:22:42 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-09-18 15:22:42 +0300
commiteafec6d4f72b05c389576358b9e1d0ebd87cf174 (patch)
tree77367435ef72425f389509288ced9ef79758d8ae /source/blender/gpu/GPU_extensions.h
parentbf2a54b0584c1e568af7ecf67ae2a623bc5263fe (diff)
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.
Diffstat (limited to 'source/blender/gpu/GPU_extensions.h')
-rw-r--r--source/blender/gpu/GPU_extensions.h3
1 files changed, 3 insertions, 0 deletions
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);