Pass EvaluationContext instead of bContext
2.8x branch added bContext arg in many places, pass eval-context instead since its not simple to reason about what what nested functions do when they can access and change almost anything. Also use const to prevent unexpected modifications. This fixes crash loading files with shadows, since off-screen buffers use a NULL context for rendering.
This commit is contained in:
@@ -44,7 +44,7 @@
|
||||
|
||||
#include "MOD_modifiertypes.h"
|
||||
|
||||
static void deformVerts(ModifierData *UNUSED(md), struct EvaluationContext *UNUSED(eval_ctx),
|
||||
static void deformVerts(ModifierData *UNUSED(md), const struct EvaluationContext *UNUSED(eval_ctx),
|
||||
Object *ob, DerivedMesh *UNUSED(derivedData),
|
||||
float (*vertexCos)[3],
|
||||
int numVerts,
|
||||
@@ -61,7 +61,7 @@ static void deformVerts(ModifierData *UNUSED(md), struct EvaluationContext *UNUS
|
||||
}
|
||||
}
|
||||
|
||||
static void deformMatrices(ModifierData *md, struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData,
|
||||
static void deformMatrices(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob, DerivedMesh *derivedData,
|
||||
float (*vertexCos)[3], float (*defMats)[3][3], int numVerts)
|
||||
{
|
||||
Key *key = BKE_key_from_object(ob);
|
||||
@@ -83,7 +83,7 @@ static void deformMatrices(ModifierData *md, struct EvaluationContext *eval_ctx,
|
||||
deformVerts(md, eval_ctx, ob, derivedData, vertexCos, numVerts, 0);
|
||||
}
|
||||
|
||||
static void deformVertsEM(ModifierData *md, struct EvaluationContext *eval_ctx, Object *ob,
|
||||
static void deformVertsEM(ModifierData *md, const struct EvaluationContext *eval_ctx, Object *ob,
|
||||
struct BMEditMesh *UNUSED(editData),
|
||||
DerivedMesh *derivedData,
|
||||
float (*vertexCos)[3],
|
||||
@@ -95,7 +95,7 @@ static void deformVertsEM(ModifierData *md, struct EvaluationContext *eval_ctx,
|
||||
deformVerts(md, eval_ctx, ob, derivedData, vertexCos, numVerts, 0);
|
||||
}
|
||||
|
||||
static void deformMatricesEM(ModifierData *UNUSED(md), struct EvaluationContext *UNUSED(eval_ctx),
|
||||
static void deformMatricesEM(ModifierData *UNUSED(md), const struct EvaluationContext *UNUSED(eval_ctx),
|
||||
Object *ob, struct BMEditMesh *UNUSED(editData),
|
||||
DerivedMesh *UNUSED(derivedData),
|
||||
float (*vertexCos)[3],
|
||||
|
||||
Reference in New Issue
Block a user