Cycles: Fix transform addressing in the denoiser code
This commit is contained in:
@@ -109,7 +109,7 @@ ccl_device void kernel_filter_construct_transform(ccl_global float ccl_restrict_
|
|||||||
/* Bake the feature scaling into the transformation matrix. */
|
/* Bake the feature scaling into the transformation matrix. */
|
||||||
for(int i = 0; i < DENOISE_FEATURES; i++) {
|
for(int i = 0; i < DENOISE_FEATURES; i++) {
|
||||||
for(int j = 0; j < (*rank); j++) {
|
for(int j = 0; j < (*rank); j++) {
|
||||||
transform[i*DENOISE_FEATURES + j] *= feature_scale[i];
|
transform[(i*DENOISE_FEATURES + j)*transform_stride] *= feature_scale[i];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -81,10 +81,6 @@ ccl_device void kernel_filter_construct_transform(float ccl_restrict_ptr buffer,
|
|||||||
break;
|
break;
|
||||||
float s = feature_matrix[i*DENOISE_FEATURES+i];
|
float s = feature_matrix[i*DENOISE_FEATURES+i];
|
||||||
reduced_energy += s;
|
reduced_energy += s;
|
||||||
/* Bake the feature scaling into the transformation matrix. */
|
|
||||||
for(int j = 0; j < DENOISE_FEATURES; j++) {
|
|
||||||
transform[(*rank)*DENOISE_FEATURES + j] *= _mm_cvtss_f32(feature_scale[j]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -92,10 +88,6 @@ ccl_device void kernel_filter_construct_transform(float ccl_restrict_ptr buffer,
|
|||||||
float s = feature_matrix[i*DENOISE_FEATURES+i];
|
float s = feature_matrix[i*DENOISE_FEATURES+i];
|
||||||
if(i >= 2 && sqrtf(s) < pca_threshold)
|
if(i >= 2 && sqrtf(s) < pca_threshold)
|
||||||
break;
|
break;
|
||||||
/* Bake the feature scaling into the transformation matrix. */
|
|
||||||
for(int j = 0; j < DENOISE_FEATURES; j++) {
|
|
||||||
transform[(*rank)*DENOISE_FEATURES + j] *= _mm_cvtss_f32(feature_scale[j]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user