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:
-rw-r--r--source/blender/gpu/GPU_texture.h1
-rw-r--r--source/blender/gpu/intern/gpu_framebuffer.c2
-rw-r--r--source/blender/gpu/intern/gpu_texture.c5
-rw-r--r--source/blender/gpu/intern/gpu_viewport.c5
4 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index fa8ed992c72..82e215f6fae 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -162,6 +162,7 @@ GPUTexture *GPU_texture_create_cube_custom(
GPUTexture *GPU_texture_create_depth(int w, int h, char err_out[256]);
GPUTexture *GPU_texture_create_depth_with_stencil(int w, int h, char err_out[256]);
GPUTexture *GPU_texture_create_depth_multisample(int w, int h, int samples, char err_out[256]);
+GPUTexture *GPU_texture_create_depth_with_stencil_multisample(int w, int h, int samples, char err_out[256]);
GPUTexture *GPU_texture_from_blender(
struct Image *ima, struct ImageUser *iuser, int textarget, bool is_data, double time, int mipmap);
diff --git a/source/blender/gpu/intern/gpu_framebuffer.c b/source/blender/gpu/intern/gpu_framebuffer.c
index 9f0ccffb8eb..884a305bd02 100644
--- a/source/blender/gpu/intern/gpu_framebuffer.c
+++ b/source/blender/gpu/intern/gpu_framebuffer.c
@@ -670,7 +670,7 @@ GPUOffScreen *GPU_offscreen_create(int width, int height, int samples, char err_
}
}
- ofs->depth = GPU_texture_create_depth_multisample(width, height, samples, err_out);
+ ofs->depth = GPU_texture_create_depth_with_stencil_multisample(width, height, samples, err_out);
if (!ofs->depth) {
GPU_offscreen_free(ofs);
return NULL;
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index ac8c8bacac1..252eede8758 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -711,6 +711,11 @@ GPUTexture *GPU_texture_create_depth_multisample(int w, int h, int samples, char
return GPU_texture_create_nD(w, h, 0, 2, NULL, GPU_DEPTH_COMPONENT24, 1, samples, false, err_out);
}
+GPUTexture *GPU_texture_create_depth_with_stencil_multisample(int w, int h, int samples, char err_out[256])
+{
+ return GPU_texture_create_nD(w, h, 0, 2, NULL, GPU_DEPTH24_STENCIL8, 1, samples, false, err_out);
+}
+
void GPU_texture_update(GPUTexture *tex, const float *pixels)
{
BLI_assert(tex->format > -1);
diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c
index bdbf829a1ca..bd563a36f57 100644
--- a/source/blender/gpu/intern/gpu_viewport.c
+++ b/source/blender/gpu/intern/gpu_viewport.c
@@ -381,7 +381,8 @@ void GPU_viewport_bind(GPUViewport *viewport, const rcti *rect)
}
/* Depth */
- dtxl->multisample_depth = GPU_texture_create_depth_multisample(rect_w, rect_h, U.ogl_multisamples, NULL);
+ dtxl->multisample_depth = GPU_texture_create_depth_with_stencil_multisample(rect_w, rect_h,
+ U.ogl_multisamples, NULL);
if (!dtxl->multisample_depth) {
ok = false;
@@ -430,7 +431,7 @@ cleanup_multisample:
}
/* Depth */
- dtxl->depth = GPU_texture_create_depth(rect_w, rect_h, NULL);
+ dtxl->depth = GPU_texture_create_depth_with_stencil(rect_w, rect_h, NULL);
if (dtxl->depth) {
/* Define texture parameters */