Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-04-19 18:00:58 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-04-19 20:03:40 +0300
commit67962824e9f740cf4daf4c3328657e743c54258b (patch)
treea7febb14cab8cf910c772020eaa63069d7f75528
parent37d298391e281ae301ee59e7614d836587c9931d (diff)
GPU: Fix Adresse Sanitizer errors
-rw-r--r--source/blender/gpu/intern/gpu_shader_create_info.hh3
-rw-r--r--source/blender/nodes/shader/nodes/node_shader_volume_principled.cc8
2 files changed, 5 insertions, 6 deletions
diff --git a/source/blender/gpu/intern/gpu_shader_create_info.hh b/source/blender/gpu/intern/gpu_shader_create_info.hh
index 3ab96d0d84a..8635d261f5f 100644
--- a/source/blender/gpu/intern/gpu_shader_create_info.hh
+++ b/source/blender/gpu/intern/gpu_shader_create_info.hh
@@ -627,7 +627,8 @@ struct ShaderCreateInfo {
Resource res(Resource::BindType::SAMPLER, slot);
res.sampler.type = type;
res.sampler.name = name;
- res.sampler.sampler = sampler;
+ /* Produces asan errors for the moment. */
+ // res.sampler.sampler = sampler;
((freq == Frequency::PASS) ? pass_resources_ : batch_resources_).append(res);
interface_names_size_ += name.size() + 1;
return *(Self *)this;
diff --git a/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc b/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc
index d4d5c4789ed..07e700e550a 100644
--- a/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc
+++ b/source/blender/nodes/shader/nodes/node_shader_volume_principled.cc
@@ -93,17 +93,15 @@ static int node_shader_gpu_volume_principled(GPUMaterial *mat,
}
/* Default values if attributes not found. */
+ static float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
if (!density) {
- static float one = 1.0f;
- density = GPU_constant(&one);
+ density = GPU_constant(white);
}
if (!color) {
- static float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
color = GPU_constant(white);
}
if (!temperature) {
- static float one = 1.0f;
- temperature = GPU_constant(&one);
+ temperature = GPU_constant(white);
}
/* Create blackbody spectrum. */