Refactor: Cycles: Add const keyword to more function parameters

Pull Request: https://projects.blender.org/blender/blender/pulls/132361
This commit is contained in:
Brecht Van Lommel
2025-01-01 18:15:54 +01:00
parent dd51c8660b
commit 57ff24cb99
389 changed files with 3464 additions and 2900 deletions

View File

@@ -13,7 +13,7 @@ CCL_NAMESPACE_BEGIN
/* De Casteljau Evaluation */
static void decasteljau_cubic(float3 *P, float3 *dt, float t, const float3 cp[4])
static void decasteljau_cubic(float3 *P, float3 *dt, const float t, const float3 cp[4])
{
float3 d0 = cp[0] + t * (cp[1] - cp[0]);
float3 d1 = cp[1] + t * (cp[2] - cp[1]);
@@ -29,7 +29,7 @@ static void decasteljau_cubic(float3 *P, float3 *dt, float t, const float3 cp[4]
}
static void decasteljau_bicubic(
float3 *P, float3 *du, float3 *dv, const float3 cp[16], float u, float v)
float3 *P, float3 *du, float3 *dv, const float3 cp[16], float u, const float v)
{
float3 ucp[4];
float3 utn[4];
@@ -49,7 +49,8 @@ static void decasteljau_bicubic(
/* Linear Quad Patch */
void LinearQuadPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
void LinearQuadPatch::eval(
float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v)
{
const float3 d0 = interp(hull[0], hull[1], u);
const float3 d1 = interp(hull[2], hull[3], u);
@@ -80,7 +81,7 @@ BoundBox LinearQuadPatch::bound()
/* Bicubic Patch */
void BicubicPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, float u, float v)
void BicubicPatch::eval(float3 *P, float3 *dPdu, float3 *dPdv, float3 *N, const float u, float v)
{
if (N) {
float3 dPdu_;