WIP: Vulkan: Workbench #107886

Closed
Jeroen Bakker wants to merge 88 commits from Jeroen-Bakker:vulkan-draw-manager-workbench into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
8 changed files with 22 additions and 22 deletions
Showing only changes of commit fed9b2f266 - Show all commits

View File

@ -98,9 +98,9 @@ void legacy_gpencil_frame_to_grease_pencil_drawing(const bGPDframe &gpf,
/* Write curve attributes. */ /* Write curve attributes. */
stroke_cyclic.span[stroke_i] = (gps->flag & GP_STROKE_CYCLIC) != 0; stroke_cyclic.span[stroke_i] = (gps->flag & GP_STROKE_CYCLIC) != 0;
/* TODO: This should be a `double` attribute. */ /* TODO: This should be a `double` attribute. */
stroke_init_times.span[stroke_i] = static_cast<float>(gps->inittime); stroke_init_times.span[stroke_i] = float(gps->inittime);
stroke_start_caps.span[stroke_i] = static_cast<int8_t>(gps->caps[0]); stroke_start_caps.span[stroke_i] = int8_t(gps->caps[0]);
stroke_end_caps.span[stroke_i] = static_cast<int8_t>(gps->caps[1]); stroke_end_caps.span[stroke_i] = int8_t(gps->caps[1]);
stroke_hardnesses.span[stroke_i] = gps->hardeness; stroke_hardnesses.span[stroke_i] = gps->hardeness;
stroke_point_aspect_ratios.span[stroke_i] = gps->aspect_ratio[0] / stroke_point_aspect_ratios.span[stroke_i] = gps->aspect_ratio[0] /
max_ff(gps->aspect_ratio[1], 1e-8); max_ff(gps->aspect_ratio[1], 1e-8);
@ -207,7 +207,7 @@ void legacy_gpencil_to_grease_pencil(Main &bmain, GreasePencil &grease_pencil, b
(gpl->onion_flag & GP_LAYER_ONIONSKIN), (gpl->onion_flag & GP_LAYER_ONIONSKIN),
GP_LAYER_TREE_NODE_USE_ONION_SKINNING); GP_LAYER_TREE_NODE_USE_ONION_SKINNING);
new_layer.blend_mode = static_cast<int8_t>(gpl->blend_mode); new_layer.blend_mode = int8_t(gpl->blend_mode);
/* Convert the layer masks. */ /* Convert the layer masks. */
LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) { LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) {

View File

@ -67,7 +67,7 @@ static std::string get_default_collection_name(const Object *object,
} }
char name[MAX_ID_NAME]; char name[MAX_ID_NAME];
BLI_snprintf(name, sizeof(name), format, object->id.name + 2); SNPRINTF(name, format, object->id.name + 2);
return name; return name;
} }

View File

@ -4098,8 +4098,8 @@ void blo_do_versions_280(FileData *fd, Library * /*lib*/, Main *bmain)
UnitSettings *unit = &scene->unit; UnitSettings *unit = &scene->unit;
if (unit->system == USER_UNIT_NONE) { if (unit->system == USER_UNIT_NONE) {
unit->length_unit = (char)USER_UNIT_ADAPTIVE; unit->length_unit = char(USER_UNIT_ADAPTIVE);
unit->mass_unit = (char)USER_UNIT_ADAPTIVE; unit->mass_unit = char(USER_UNIT_ADAPTIVE);
} }
RenderData *render_data = &scene->r; RenderData *render_data = &scene->r;

View File

@ -4480,7 +4480,7 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain)
} }
FOREACH_NODETREE_END; FOREACH_NODETREE_END;
BKE_animdata_main_cb(bmain, version_liboverride_nla_frame_start_end, NULL); BKE_animdata_main_cb(bmain, version_liboverride_nla_frame_start_end, nullptr);
/* Store simulation bake directory in geometry nodes modifier. */ /* Store simulation bake directory in geometry nodes modifier. */
LISTBASE_FOREACH (Object *, ob, &bmain->objects) { LISTBASE_FOREACH (Object *, ob, &bmain->objects) {

View File

@ -99,21 +99,21 @@ static void SELECT_next_instance_free(void *instance_)
static const DrawEngineDataSize SELECT_next_data_size = DRW_VIEWPORT_DATA_SIZE(SELECT_NextData); static const DrawEngineDataSize SELECT_next_data_size = DRW_VIEWPORT_DATA_SIZE(SELECT_NextData);
DrawEngineType draw_engine_select_next_type = { DrawEngineType draw_engine_select_next_type = {
NULL, nullptr,
NULL, nullptr,
N_("Select-Next"), N_("Select-Next"),
&SELECT_next_data_size, &SELECT_next_data_size,
&SELECT_next_engine_init, &SELECT_next_engine_init,
NULL, nullptr,
&SELECT_next_instance_free, &SELECT_next_instance_free,
&SELECT_next_cache_init, &SELECT_next_cache_init,
&SELECT_next_cache_populate, &SELECT_next_cache_populate,
&SELECT_next_cache_finish, &SELECT_next_cache_finish,
&SELECT_next_draw_scene, &SELECT_next_draw_scene,
NULL, nullptr,
NULL, nullptr,
NULL, nullptr,
NULL, nullptr,
}; };
/** \} */ /** \} */

View File

@ -2466,7 +2466,7 @@ static float x_axis_name[4][2] = {
{-0.9f * S_X, 1.0f * S_Y}, {-0.9f * S_X, 1.0f * S_Y},
{1.0f * S_X, -1.0f * S_Y}, {1.0f * S_X, -1.0f * S_Y},
}; };
#define X_LEN (sizeof(x_axis_name) / sizeof(float[2])) #define X_LEN (ARRAY_SIZE(x_axis_name))
#undef S_X #undef S_X
#undef S_Y #undef S_Y
@ -2480,7 +2480,7 @@ static float y_axis_name[6][2] = {
{0.0f * S_X, -0.1f * S_Y}, {0.0f * S_X, -0.1f * S_Y},
{0.0f * S_X, -1.0f * S_Y}, {0.0f * S_X, -1.0f * S_Y},
}; };
#define Y_LEN (sizeof(y_axis_name) / sizeof(float[2])) #define Y_LEN (ARRAY_SIZE(y_axis_name))
#undef S_X #undef S_X
#undef S_Y #undef S_Y
@ -2498,7 +2498,7 @@ static float z_axis_name[10][2] = {
{-1.00f * S_X, -1.00f * S_Y}, {-1.00f * S_X, -1.00f * S_Y},
{1.00f * S_X, -1.00f * S_Y}, {1.00f * S_X, -1.00f * S_Y},
}; };
#define Z_LEN (sizeof(z_axis_name) / sizeof(float[2])) #define Z_LEN (ARRAY_SIZE(z_axis_name))
#undef S_X #undef S_X
#undef S_Y #undef S_Y
@ -2525,7 +2525,7 @@ static float axis_marker[8][2] = {
{-S_X, 0.0f} {-S_X, 0.0f}
#endif #endif
}; };
#define MARKER_LEN (sizeof(axis_marker) / sizeof(float[2])) #define MARKER_LEN (ARRAY_SIZE(axis_marker))
#define MARKER_FILL_LAYER 6 #define MARKER_FILL_LAYER 6
#undef S_X #undef S_X
#undef S_Y #undef S_Y

View File

@ -1969,7 +1969,7 @@ static eV3D_OpMode view3d_navigation_type_from_idname(const char *idname)
ViewOpsData *ED_view3d_navigation_init(bContext *C) ViewOpsData *ED_view3d_navigation_init(bContext *C)
{ {
if (!CTX_wm_region_view3d(C)) { if (!CTX_wm_region_view3d(C)) {
return NULL; return nullptr;
} }
ViewOpsData *vod = MEM_cnew<ViewOpsData>(__func__); ViewOpsData *vod = MEM_cnew<ViewOpsData>(__func__);
@ -2069,7 +2069,7 @@ bool ED_view3d_navigation_do(bContext *C, ViewOpsData *vod, const wmEvent *event
/* Although #ED_view3d_update_viewmat is already called when redrawing the 3D View, do it here /* Although #ED_view3d_update_viewmat is already called when redrawing the 3D View, do it here
* as well, so the updated matrix values can be accessed by the operator. */ * as well, so the updated matrix values can be accessed by the operator. */
ED_view3d_update_viewmat( ED_view3d_update_viewmat(
vod->depsgraph, vod->scene, vod->v3d, vod->region, NULL, NULL, NULL, false); vod->depsgraph, vod->scene, vod->v3d, vod->region, nullptr, nullptr, nullptr, false);
return true; return true;
} }

View File

@ -1160,7 +1160,7 @@ static void snap_multipoints_free(TransInfo *t)
if (t->tsnap.status & SNAP_MULTI_POINTS) { if (t->tsnap.status & SNAP_MULTI_POINTS) {
BLI_freelistN(&t->tsnap.points); BLI_freelistN(&t->tsnap.points);
t->tsnap.status &= ~SNAP_MULTI_POINTS; t->tsnap.status &= ~SNAP_MULTI_POINTS;
t->tsnap.selectedPoint = NULL; t->tsnap.selectedPoint = nullptr;
} }
} }