Browse Source

shaderpipeline: Fix some warnings

rdb 3 years ago
parent
commit
6633ea7ae5

+ 1 - 1
panda/src/shaderpipeline/shaderCompilerGlslang.cxx

@@ -216,7 +216,7 @@ private:
  */
 static void
 log_message(spv_message_level_t level, const char *, const spv_position_t &, const char *msg) {
-  NotifySeverity severity;
+  NotifySeverity severity = NS_info;
   switch (level) {
   case SPV_MSG_FATAL:
   case SPV_MSG_INTERNAL_ERROR:

+ 1 - 1
panda/src/shaderpipeline/shaderModuleSpirV.cxx

@@ -1920,7 +1920,7 @@ r_define_type(InstructionIterator &it, const ShaderType *type) {
 
     it = _instructions.insert(it, spv::OpTypeImage, args, nargs);
   }
-  else if (const ShaderType::Sampler *sampler_type = type->as_sampler()) {
+  else if (type->as_sampler() != nullptr) {
     it = _instructions.insert(it, spv::OpTypeSampler, {id});
   }
   else if (const ShaderType::SampledImage *sampled_image_type = type->as_sampled_image()) {