diff options
Diffstat (limited to 'source/blender/draw/engines/gpencil')
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_draw_data.c | 8 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.c | 15 | ||||
-rw-r--r-- | source/blender/draw/engines/gpencil/gpencil_engine.h | 16 |
3 files changed, 24 insertions, 15 deletions
diff --git a/source/blender/draw/engines/gpencil/gpencil_draw_data.c b/source/blender/draw/engines/gpencil/gpencil_draw_data.c index 51152475a06..7faf426c4e0 100644 --- a/source/blender/draw/engines/gpencil/gpencil_draw_data.c +++ b/source/blender/draw/engines/gpencil/gpencil_draw_data.c @@ -30,7 +30,7 @@ #include "BLI_math_color.h" #include "BLI_memblock.h" -#include "GPU_uniformbuffer.h" +#include "GPU_uniform_buffer.h" #include "IMB_imbuf_types.h" @@ -46,7 +46,7 @@ static GPENCIL_MaterialPool *gpencil_material_pool_add(GPENCIL_PrivateData *pd) matpool->next = NULL; matpool->used_count = 0; if (matpool->ubo == NULL) { - matpool->ubo = GPU_uniformbuffer_create(sizeof(matpool->mat_data), NULL, NULL); + matpool->ubo = GPU_uniformbuf_create(sizeof(matpool->mat_data)); } pd->last_material_pool = matpool; return matpool; @@ -301,7 +301,7 @@ void gpencil_material_resources_get(GPENCIL_MaterialPool *first_pool, int mat_id, GPUTexture **r_tex_stroke, GPUTexture **r_tex_fill, - GPUUniformBuffer **r_ubo_mat) + GPUUniformBuf **r_ubo_mat) { GPENCIL_MaterialPool *matpool = first_pool; int pool_id = mat_id / GP_MATERIAL_BUFFER_LEN; @@ -331,7 +331,7 @@ GPENCIL_LightPool *gpencil_light_pool_add(GPENCIL_PrivateData *pd) /* Tag light list end. */ lightpool->light_data[0].color[0] = -1.0; if (lightpool->ubo == NULL) { - lightpool->ubo = GPU_uniformbuffer_create(sizeof(lightpool->light_data), NULL, NULL); + lightpool->ubo = GPU_uniformbuf_create(sizeof(lightpool->light_data)); } pd->last_light_pool = lightpool; return lightpool; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 015e631dc14..368530fde05 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -42,7 +42,7 @@ #include "DNA_view3d_types.h" #include "GPU_texture.h" -#include "GPU_uniformbuffer.h" +#include "GPU_uniform_buffer.h" #include "gpencil_engine.h" @@ -345,8 +345,8 @@ typedef struct gpIterPopulateData { GPENCIL_MaterialPool *matpool; DRWShadingGroup *grp; /* Last material UBO bound. Used to avoid uneeded buffer binding. */ - GPUUniformBuffer *ubo_mat; - GPUUniformBuffer *ubo_lights; + GPUUniformBuf *ubo_mat; + GPUUniformBuf *ubo_lights; /* Last texture bound. */ GPUTexture *tex_fill; GPUTexture *tex_stroke; @@ -487,9 +487,10 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl, MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(iter->ob, gps->mat_nr + 1); + const bool is_render = iter->pd->is_render; bool hide_material = (gp_style->flag & GP_MATERIAL_HIDE) != 0; bool show_stroke = ((gp_style->flag & GP_MATERIAL_STROKE_SHOW) != 0) || - ((gps->flag & GP_STROKE_NOFILL) != 0); + (!is_render && ((gps->flag & GP_STROKE_NOFILL) != 0)); bool show_fill = (gps->tot_triangles > 0) && ((gp_style->flag & GP_MATERIAL_FILL_SHOW) != 0) && (!iter->pd->simplify_fill) && ((gps->flag & GP_STROKE_NOFILL) == 0); @@ -501,7 +502,7 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl, return; } - GPUUniformBuffer *ubo_mat; + GPUUniformBuf *ubo_mat; GPUTexture *tex_stroke, *tex_fill; gpencil_material_resources_get( iter->matpool, iter->mat_ofs + gps->mat_nr, &tex_stroke, &tex_fill, &ubo_mat); @@ -654,13 +655,13 @@ void GPENCIL_cache_finish(void *ved) BLI_memblock_iternew(pd->gp_material_pool, &iter); GPENCIL_MaterialPool *pool; while ((pool = (GPENCIL_MaterialPool *)BLI_memblock_iterstep(&iter))) { - GPU_uniformbuffer_update(pool->ubo, pool->mat_data); + GPU_uniformbuf_update(pool->ubo, pool->mat_data); } BLI_memblock_iternew(pd->gp_light_pool, &iter); GPENCIL_LightPool *lpool; while ((lpool = (GPENCIL_LightPool *)BLI_memblock_iterstep(&iter))) { - GPU_uniformbuffer_update(lpool->ubo, lpool->light_data); + GPU_uniformbuf_update(lpool->ubo, lpool->light_data); } /* Sort object by decreasing Z to avoid most of alpha ordering issues. */ diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.h b/source/blender/draw/engines/gpencil/gpencil_engine.h index a406df530fc..852945b25c3 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.h +++ b/source/blender/draw/engines/gpencil/gpencil_engine.h @@ -24,10 +24,16 @@ #include "DNA_gpencil_types.h" +#include "DRW_render.h" + #include "BLI_bitmap.h" #include "GPU_batch.h" +#ifdef __cplusplus +extern "C" { +#endif + extern DrawEngineType draw_engine_gpencil_type; struct GPENCIL_Data; @@ -108,7 +114,7 @@ typedef struct GPENCIL_MaterialPool { /* GPU representatin of materials. */ gpMaterial mat_data[GP_MATERIAL_BUFFER_LEN]; /* Matching ubo. */ - struct GPUUniformBuffer *ubo; + struct GPUUniformBuf *ubo; /* Texture per material. NULL means none. */ struct GPUTexture *tex_fill[GP_MATERIAL_BUFFER_LEN]; struct GPUTexture *tex_stroke[GP_MATERIAL_BUFFER_LEN]; @@ -120,7 +126,7 @@ typedef struct GPENCIL_LightPool { /* GPU representatin of materials. */ gpLight light_data[GPENCIL_LIGHT_BUFFER_LEN]; /* Matching ubo. */ - struct GPUUniformBuffer *ubo; + struct GPUUniformBuf *ubo; /* Number of light in the pool. */ int light_used; } GPENCIL_LightPool; @@ -384,7 +390,7 @@ void gpencil_material_resources_get(GPENCIL_MaterialPool *first_pool, int mat_id, struct GPUTexture **r_tex_stroke, struct GPUTexture **r_tex_fill, - struct GPUUniformBuffer **r_ubo_mat); + struct GPUUniformBuf **r_ubo_mat); void gpencil_light_ambient_add(GPENCIL_LightPool *lightpool, const float color[3]); void gpencil_light_pool_populate(GPENCIL_LightPool *matpool, Object *ob); @@ -397,7 +403,6 @@ void gpencil_vfx_cache_populate(GPENCIL_Data *vedata, Object *ob, GPENCIL_tObjec /* Shaders */ struct GPUShader *GPENCIL_shader_antialiasing(int stage); struct GPUShader *GPENCIL_shader_geometry_get(void); -struct GPUShader *GPENCIL_shader_composite_get(void); struct GPUShader *GPENCIL_shader_layer_blend_get(void); struct GPUShader *GPENCIL_shader_mask_invert_get(void); struct GPUShader *GPENCIL_shader_depth_merge_get(void); @@ -438,3 +443,6 @@ void GPENCIL_render_to_image(void *vedata, void gpencil_light_pool_free(void *storage); void gpencil_material_pool_free(void *storage); GPENCIL_ViewLayerData *GPENCIL_view_layer_data_ensure(void); +#ifdef __cplusplus +} +#endif |