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
parent104e6a7b8a3cf9fbd2cd6dc79e3dbc766a83419a (diff)
GPUViewport: Make Depth texture not depth testable.
-rw-r--r--source/blender/draw/intern/draw_manager.c1
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c13
2 files changed, 11 insertions, 3 deletions
diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c
index 253b3e680c9..010684889bc 100644
--- a/source/blender/draw/intern/draw_manager.c
+++ b/source/blender/draw/intern/draw_manager.c
@@ -1443,7 +1443,6 @@ static void draw_shgroup(DRWShadingGroup *shgroup, DRWState pass_state)
}
tex = *((GPUTexture **)uni->value);
GPU_texture_bind(tex, uni->bindloc);
- GPU_texture_compare_mode(tex, false);
bound_tex = MEM_callocN(sizeof(DRWBoundTexture), "DRWBoundTexture");
bound_tex->tex = tex;
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;
}