summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVinson Lee <vlee@freedesktop.org>2020-12-03 15:52:34 -0800
committerVinson Lee <vlee@freedesktop.org>2021-03-30 21:26:04 -0700
commitcd222e4a9cf0727e9b38e7f26d00ff2e2e8acb02 (patch)
treeedf50aaa18c8876e512a7c489b1446440fa13870
parent598dc3dca41e3b1a9bf9e94b17e5426773ed6830 (diff)
glsl: Initialize parcel_out_uniform_storage members.
Fix defects reported by Coverity Scan. uninit_member: Non-static class member buffer_block_index is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member ubo_byte_offset is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member shader_type is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member next_sampler is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member next_bindless_sampler is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member next_image is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member next_bindless_image is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member next_subroutine is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member field_counter is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member current_var is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member explicit_location is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member record_array_count is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member record_next_sampler is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member record_next_image is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member record_next_bindless_sampler is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member record_next_bindless_image is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member targets is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member shader_samplers_used is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member shader_shadow_samplers is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member num_bindless_samplers is not initialized in this constructor nor in any functions that it calls. uninit_member: Non-static class member num_bindless_images is not initialized in this constructor nor in any functions that it calls. Signed-off-by: Vinson Lee <vlee@freedesktop.org> Reviewed-by: Marek Olšák <marek.olsak@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7910>
-rw-r--r--src/compiler/glsl/link_uniforms.cpp19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/compiler/glsl/link_uniforms.cpp b/src/compiler/glsl/link_uniforms.cpp
index f0e229526f6..cb1655a97e0 100644
--- a/src/compiler/glsl/link_uniforms.cpp
+++ b/src/compiler/glsl/link_uniforms.cpp
@@ -685,11 +685,24 @@ public:
struct gl_uniform_storage *uniforms,
union gl_constant_value *values,
bool use_std430_as_default)
- : prog(prog), map(map), uniforms(uniforms),
- use_std430_as_default(use_std430_as_default), values(values),
- bindless_targets(NULL), bindless_access(NULL),
+ : buffer_block_index(0), ubo_byte_offset(0),
+ shader_type(MESA_SHADER_NONE),
+ prog(prog), map(map), uniforms(uniforms),
+ next_sampler(0), next_bindless_sampler(0), next_image(0),
+ next_bindless_image(0), next_subroutine(0),
+ use_std430_as_default(use_std430_as_default),
+ field_counter(0), current_var(NULL), explicit_location(0),
+ record_array_count(0), record_next_sampler(NULL),
+ record_next_image(NULL), record_next_bindless_sampler(NULL),
+ record_next_bindless_image(NULL),
+ values(values),
+ shader_samplers_used(0), shader_shadow_samplers(0),
+ num_bindless_samplers(0),
+ bindless_targets(NULL), num_bindless_images(0),
+ bindless_access(NULL),
shader_storage_blocks_write_access(0)
{
+ memset(this->targets, 0, sizeof(this->targets));
}
virtual ~parcel_out_uniform_storage()