[Bf-blender-cvs] [abaf6b106d3] master: Revert "GPU: Create and use new GPU_texture_read_rect utility."
mano-wii
noreply at git.blender.org
Wed Jun 26 01:47:12 CEST 2019
Commit: abaf6b106d3a34512f1061dc23277f3924da7fc6
Author: mano-wii
Date: Tue Jun 25 20:26:46 2019 -0300
Branches: master
https://developer.blender.org/rBabaf6b106d3a34512f1061dc23277f3924da7fc6
Revert "GPU: Create and use new GPU_texture_read_rect utility."
This reverts commit e061cb44378efaf159a30fb1c5834db48ffb2bb3.
This function is problematic on some operating systems.
# Conflicts:
# source/blender/draw/intern/draw_manager.c
# source/blender/gpu/GPU_texture.h
# source/blender/gpu/intern/gpu_texture.c
===================================================================
M source/blender/gpu/GPU_texture.h
M source/blender/gpu/intern/gpu_texture.c
===================================================================
diff --git a/source/blender/gpu/GPU_texture.h b/source/blender/gpu/GPU_texture.h
index 4397234543b..2b61d99e852 100644
--- a/source/blender/gpu/GPU_texture.h
+++ b/source/blender/gpu/GPU_texture.h
@@ -214,10 +214,6 @@ void GPU_texture_update_sub(GPUTexture *tex,
int depth);
void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat gpu_data_format, int miplvl);
-void GPU_texture_read_rect(GPUTexture *tex,
- eGPUDataFormat gpu_data_format,
- const struct rcti *rect,
- void *r_buf);
void GPU_invalid_tex_init(void);
void GPU_invalid_tex_bind(int mode);
diff --git a/source/blender/gpu/intern/gpu_texture.c b/source/blender/gpu/intern/gpu_texture.c
index 54e93c361ca..6a92832d1e5 100644
--- a/source/blender/gpu/intern/gpu_texture.c
+++ b/source/blender/gpu/intern/gpu_texture.c
@@ -1485,40 +1485,6 @@ void *GPU_texture_read(GPUTexture *tex, eGPUDataFormat gpu_data_format, int mipl
return buf;
}
-void GPU_texture_read_rect(GPUTexture *tex,
- eGPUDataFormat gpu_data_format,
- const rcti *rect,
- void *r_buf)
-{
- gpu_validate_data_format(tex->format, gpu_data_format);
-
- GPUFrameBuffer *cur_fb = GPU_framebuffer_active_get();
- GPUFrameBuffer *tmp_fb = GPU_framebuffer_create();
- GPU_framebuffer_texture_attach(tmp_fb, tex, 0, 0);
-
- GPU_framebuffer_bind(tmp_fb);
- glReadBuffer(GL_COLOR_ATTACHMENT0);
-
- GLenum data_format = gpu_get_gl_dataformat(tex->format, &tex->format_flag);
- GLenum data_type = gpu_get_gl_datatype(gpu_data_format);
-
- glReadPixels(rect->xmin,
- rect->ymin,
- BLI_rcti_size_x(rect),
- BLI_rcti_size_y(rect),
- data_format,
- data_type,
- r_buf);
-
- if (cur_fb) {
- GPU_framebuffer_bind(cur_fb);
- }
- else {
- GPU_framebuffer_restore();
- }
- GPU_framebuffer_free(tmp_fb);
-}
-
void GPU_texture_update(GPUTexture *tex, eGPUDataFormat data_format, const void *pixels)
{
GPU_texture_update_sub(tex, data_format, pixels, 0, 0, 0, tex->w, tex->h, tex->d);
More information about the Bf-blender-cvs
mailing list