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>2017-05-07 15:29:51 +0300
committerClément Foucault <foucault.clem@gmail.com>2017-05-07 16:51:54 +0300
commit2a0c91b70c40485c05151fba5e3313cf4800559b (patch)
tree81d063185a569b69832ded395e61d3260d7f871f /source/blender/gpu/intern/gpu_viewport.c
parent104e6a7b8a3cf9fbd2cd6dc79e3dbc766a83419a (diff)
GPUViewport: Make Depth texture not depth testable.
Diffstat (limited to 'source/blender/gpu/intern/gpu_viewport.c')
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index 98c3613e1e2..c116d035f60 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -267,11 +267,20 @@ void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect)
/* Depth */
dtxl->depth = GPU_texture_create_depth(rect_w, rect_h, NULL);
- if (!dtxl->depth) {
+
+ if (dtxl->depth) {
+ /* Define texture parameters */
+ GPU_texture_bind(dtxl->depth, 0);
+ GPU_texture_compare_mode(dtxl->depth, false);
+ GPU_texture_filter_mode(dtxl->depth, true);
+ GPU_texture_unbind(dtxl->depth);
+ }
+ else {
ok = false;
goto cleanup;
}
- else if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0)) {
+
+ if (!GPU_framebuffer_texture_attach(dfbl->default_fb, dtxl->depth, 0, 0)) {
ok = false;
goto cleanup;
}