the maxz and minz shaders were not being compiled pbr-viewport
authorDalai Felinto <dfelinto@gmail.com>
Wed, 2 Nov 2016 18:52:11 +0000 (19:52 +0100)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 2 Nov 2016 18:52:15 +0000 (19:52 +0100)
source/blender/gpu/intern/gpu_shader.c

index 2434ecf01a4b599d6b24f853a5d690e8fdc6b67b..a638a530444825bc02e744ef593d737ef38dd864 100644 (file)
@@ -887,6 +887,20 @@ GPUShader *GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
                                        NULL, NULL, NULL, 0, 0, 0);
                        retval = GG.shaders.point_uniform_size_uniform_color_outline_smooth_3D;
                        break;
+               case GPU_SHADER_MAXZ_DOWNSAMPLE:
+                       if (!GG.shaders.maxz_downsample)
+                               GG.shaders.maxz_downsample = GPU_shader_create(
+                                       datatoc_gpu_shader_downsample_maxz_vert_glsl, datatoc_gpu_shader_downsample_maxz_frag_glsl,
+                                       NULL, NULL, NULL, 0, 0, 0);
+                       retval = GG.shaders.maxz_downsample;
+                       break;
+               case GPU_SHADER_MINZ_DOWNSAMPLE:
+                       if (!GG.shaders.minz_downsample)
+                               GG.shaders.minz_downsample = GPU_shader_create(
+                                       datatoc_gpu_shader_downsample_maxz_vert_glsl, datatoc_gpu_shader_downsample_maxz_frag_glsl,
+                                       NULL, NULL, "#define MIN;\n", 0, 0, 0);
+                       retval = GG.shaders.minz_downsample;
+                       break;
        }
 
 exit: