diff options
author | Campbell Barton <ideasman42@gmail.com> | 2017-05-10 13:14:52 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2017-05-10 13:35:51 +0300 |
commit | 0722e41f9ea450be014d667417ff903510be2770 (patch) | |
tree | 6bc3038aa4bf0a3a392ab9d341d50925fd4bc7d2 /source/blender/draw/modes/sculpt_mode.c | |
parent | 1c18d07a1c3fd2055259ce5eb8f70bde61bacafd (diff) |
DWM: Use Gawain for sculpt drawing
Currently only uses the simple shader.
Diffstat (limited to 'source/blender/draw/modes/sculpt_mode.c')
-rw-r--r-- | source/blender/draw/modes/sculpt_mode.c | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/source/blender/draw/modes/sculpt_mode.c b/source/blender/draw/modes/sculpt_mode.c index 015baf2a317..114bc8c96c4 100644 --- a/source/blender/draw/modes/sculpt_mode.c +++ b/source/blender/draw/modes/sculpt_mode.c @@ -26,8 +26,14 @@ #include "DRW_engine.h" #include "DRW_render.h" +#include "DNA_object_types.h" + +#include "BKE_pbvh.h" +#include "BKE_paint.h" + /* If builtin shaders are needed */ #include "GPU_shader.h" +#include "GPU_matrix.h" #include "draw_common.h" @@ -192,7 +198,7 @@ static void SCULPT_cache_finish(void *vedata) /* Draw time ! Control rendering pipeline from here */ static void SCULPT_draw_scene(void *vedata) { - SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; +// SCULPT_PassList *psl = ((SCULPT_Data *)vedata)->psl; SCULPT_FramebufferList *fbl = ((SCULPT_Data *)vedata)->fbl; /* Default framebuffer and texture */ @@ -211,7 +217,21 @@ static void SCULPT_draw_scene(void *vedata) */ /* ... or just render passes on default framebuffer. */ - DRW_draw_pass(psl->pass); +// DRW_draw_pass(psl->pass); + + { + const DRWContextState *draw_ctx = DRW_context_state_get(); + SceneLayer *sl = draw_ctx->sl; + Object *ob = OBACT_NEW; + + PBVH *pbvh = ob->sculpt->pbvh; + + /* this shader is used inside draw call */ + gpuPushMatrix(); + gpuMultMatrix(ob->obmat); + BKE_pbvh_draw(pbvh, NULL, NULL, NULL, false, false); + gpuPopMatrix(); + } /* If you changed framebuffer, double check you rebind * the default one with its textures attached before finishing */ |