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:
authorJeroen Bakker <jeroen@blender.org>2022-01-17 16:34:28 +0300
committerJeroen Bakker <jeroen@blender.org>2022-01-17 16:34:28 +0300
commitedee5a947b7ea3e1324aa334a22c7c9bbf47f5f7 (patch)
treeb8f15e66277700ccdc5d6c8b7c7eb3728f91182f /source/blender/editors/gpencil
parent8fb2ff458ba579dba08bfdf57d043ad158b5db07 (diff)
Revert "GPUShaderCreateInfo for interface abstraction"
This reverts commit 8fb2ff458ba579dba08bfdf57d043ad158b5db07. Missing some files.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/drawgpencil.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/source/blender/editors/gpencil/drawgpencil.c b/source/blender/editors/gpencil/drawgpencil.c
index 23b579b94f1..6f63529298c 100644
--- a/source/blender/editors/gpencil/drawgpencil.c
+++ b/source/blender/editors/gpencil/drawgpencil.c
@@ -61,12 +61,9 @@
#include "WM_api.h"
-#include "GPU_batch.h"
#include "GPU_immediate.h"
#include "GPU_matrix.h"
-#include "GPU_shader_shared.h"
#include "GPU_state.h"
-#include "GPU_uniform_buffer.h"
#include "ED_gpencil.h"
#include "ED_screen.h"
@@ -192,27 +189,21 @@ static void gpencil_draw_stroke_3d(tGPDdraw *tgpw,
};
immBindBuiltinProgram(GPU_SHADER_GPENCIL_STROKE);
-
+ immUniform2fv("Viewport", viewport);
+ immUniform1f("pixsize", tgpw->rv3d->pixsize);
float obj_scale = tgpw->ob ?
(tgpw->ob->scale[0] + tgpw->ob->scale[1] + tgpw->ob->scale[2]) / 3.0f :
1.0f;
- struct GPencilStrokeData gpencil_stroke_data;
- copy_v2_v2(gpencil_stroke_data.viewport, viewport);
- gpencil_stroke_data.pixsize = tgpw->rv3d->pixsize;
- gpencil_stroke_data.objscale = obj_scale;
+ immUniform1f("objscale", obj_scale);
int keep_size = (int)((tgpw->gpd) && (tgpw->gpd->flag & GP_DATA_STROKE_KEEPTHICKNESS));
- gpencil_stroke_data.keep_size = keep_size;
- gpencil_stroke_data.pixfactor = tgpw->gpd->pixfactor;
+ immUniform1i("keep_size", keep_size);
+ immUniform1f("pixfactor", tgpw->gpd->pixfactor);
/* xray mode always to 3D space to avoid wrong zdepth calculation (T60051) */
- gpencil_stroke_data.xraymode = GP_XRAY_3DSPACE;
- gpencil_stroke_data.caps_start = tgpw->gps->caps[0];
- gpencil_stroke_data.caps_end = tgpw->gps->caps[1];
- gpencil_stroke_data.fill_stroke = tgpw->is_fill_stroke;
-
- GPUUniformBuf *ubo = GPU_uniformbuf_create_ex(
- sizeof(struct GPencilStrokeData), &gpencil_stroke_data, __func__);
- immBindUniformBuf("gpencil_stroke_data", ubo);
+ immUniform1i("xraymode", GP_XRAY_3DSPACE);
+ immUniform1i("caps_start", (int)tgpw->gps->caps[0]);
+ immUniform1i("caps_end", (int)tgpw->gps->caps[1]);
+ immUniform1i("fill_stroke", (int)tgpw->is_fill_stroke);
/* draw stroke curve */
immBeginAtMost(GPU_PRIM_LINE_STRIP_ADJ, totpoints + cyclic_add + 2);
@@ -264,8 +255,6 @@ static void gpencil_draw_stroke_3d(tGPDdraw *tgpw,
immEnd();
immUnbindProgram();
-
- GPU_uniformbuf_free(ubo);
}
/* ----- Strokes Drawing ------ */