diff options
author | Clément Foucault <foucault.clem@gmail.com> | 2020-07-16 03:50:55 +0300 |
---|---|---|
committer | Clément Foucault <foucault.clem@gmail.com> | 2020-07-16 19:01:44 +0300 |
commit | 8084b7e6e273e16a4441100a56570627128413da (patch) | |
tree | a9a8003a640aea46302a88fceea713ebe73740c6 /source/blender/editors/sculpt_paint/paint_utils.c | |
parent | ab19abe22315f2e2dcce989beef6dcabee528299 (diff) |
Cleanup: GPU: Replace all glReadPixels by GPU equivalent
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_utils.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_utils.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index c84a3b9cbfc..6c5d6f4ee4e 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -55,9 +55,10 @@ #include "RNA_access.h" #include "RNA_define.h" -#include "GPU_glew.h" +#include "GPU_framebuffer.h" #include "GPU_matrix.h" #include "GPU_state.h" +#include "GPU_texture.h" #include "IMB_colormanagement.h" #include "IMB_imbuf.h" @@ -246,7 +247,7 @@ static void imapaint_project(float matrix[4][4], const float co[3], float pco[4] } static void imapaint_tri_weights(float matrix[4][4], - const GLint view[4], + const int view[4], const float v1[3], const float v2[3], const float v3[3], @@ -300,7 +301,7 @@ static void imapaint_pick_uv( int i, findex; float p[2], w[3], absw, minabsw; float matrix[4][4], proj[4][4]; - GLint view[4]; + int view[4]; const eImagePaintMode mode = scene->toolsettings->imapaint.mode; const MLoopTri *lt = BKE_mesh_runtime_looptri_ensure(me_eval); @@ -576,20 +577,16 @@ void paint_sample_color( } if (!sample_success) { - glReadBuffer(GL_FRONT); - glReadPixels( - x + region->winrct.xmin, y + region->winrct.ymin, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); - glReadBuffer(GL_BACK); + GPU_frontbuffer_read_pixels( + x + region->winrct.xmin, y + region->winrct.ymin, 1, 1, 4, GPU_DATA_UNSIGNED_BYTE, &col); } else { return; } } else { - glReadBuffer(GL_FRONT); - glReadPixels( - x + region->winrct.xmin, y + region->winrct.ymin, 1, 1, GL_RGBA, GL_UNSIGNED_BYTE, &col); - glReadBuffer(GL_BACK); + GPU_frontbuffer_read_pixels( + x + region->winrct.xmin, y + region->winrct.ymin, 1, 1, 4, GPU_DATA_UNSIGNED_BYTE, &col); } cp = (uchar *)&col; |