GPUViewport: Make Depth texture not depth testable.
This commit is contained in:
parent
104e6a7b8a
commit
2a0c91b70c
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue