Fix: EEVEE: ASAN memcpy-param-overlap when reading float3 passes

Using a temporary variable fixes the issue.
This commit is contained in:
Clément Foucault
2024-12-13 15:04:50 +01:00
parent 7e7f4f0cee
commit b006a2c67b

View File

@@ -847,7 +847,8 @@ float *Film::read_pass(eViewLayerEEVEEPassType pass_type, int layer_offset)
if (pass_is_float3(pass_type)) {
/* Convert result in place as we cannot do this conversion on GPU. */
for (const int px : IndexRange(GPU_texture_width(pass_tx) * GPU_texture_height(pass_tx))) {
*(reinterpret_cast<float3 *>(result) + px) = *(reinterpret_cast<float3 *>(result + px * 4));
float3 tmp = *(reinterpret_cast<float3 *>(result + px * 4));
*(reinterpret_cast<float3 *>(result) + px) = tmp;
}
}