diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2018-04-23 22:08:11 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2018-05-02 21:49:38 +0300 |
commit | 12570c737356a06e21052cdc767b26ed7584a948 (patch) | |
tree | 3dcda29aa3596d96642e1249c3bf0665819beeb5 /source/blender/gpu/GPU_shader.h | |
parent | 26021984859b6c522a532e3613fe65ffed6cbc19 (diff) |
GPUShader: Add GPU_SHADER_2D_IMAGE_MULTISAMPLE_2/4/8/16
This shader is used instead of blitting back and forth to a single sample
buffer.
This means it resolves the color and depth samples and outputs a fragment
which can be depth tested and blended on top of an existing framebuffer.
We do static shader variation with manual loop unrolling for performance
reason. In my test I get 25% more perf with intel integrated gpu and 75%
performance gain with dedicated nvidia card compared to a single shader
with a uniform for sample count.
Diffstat (limited to 'source/blender/gpu/GPU_shader.h')
-rw-r--r-- | source/blender/gpu/GPU_shader.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/gpu/GPU_shader.h b/source/blender/gpu/GPU_shader.h index 59bf92aa672..6d75447c8a3 100644 --- a/source/blender/gpu/GPU_shader.h +++ b/source/blender/gpu/GPU_shader.h @@ -119,6 +119,10 @@ typedef enum GPUBuiltinShader { GPU_SHADER_2D_IMAGE_ALPHA, GPU_SHADER_2D_IMAGE_RECT_COLOR, GPU_SHADER_2D_IMAGE_MULTI_RECT_COLOR, + GPU_SHADER_2D_IMAGE_MULTISAMPLE_2, + GPU_SHADER_2D_IMAGE_MULTISAMPLE_4, + GPU_SHADER_2D_IMAGE_MULTISAMPLE_8, + GPU_SHADER_2D_IMAGE_MULTISAMPLE_16, GPU_SHADER_2D_CHECKER, GPU_SHADER_2D_DIAG_STRIPES, /* for simple 3D drawing */ |