[Tizen] Print more infomation for preprocess accepted/tizen/unified/20250109.175149 accepted/tizen/unified/x/20250110.015324
authorWoochan Lee <wc0917.lee@samsung.com>
Tue, 7 Jan 2025 06:57:01 +0000 (15:57 +0900)
committerWoochan Lee <wc0917.lee@samsung.com>
Tue, 7 Jan 2025 06:57:01 +0000 (15:57 +0900)
This reverts commit 26295c58f1640ecff3506f5df51e087f0ea22491.

dali/internal/graphics/common/shader-parser.cpp
dali/internal/graphics/gles-impl/gles-graphics-shader.cpp

index 6bbde1d3e967b717f8e7f66a7a2e2009ff64a239..a45ffe3eba6165f7a5b7acbe81a52084e7314615 100644 (file)
@@ -686,6 +686,10 @@ void Parse(const ShaderParserInfo& parseInfo, std::vector<std::string>& output)
   auto vs = std::istringstream(*parseInfo.vertexShaderCode);
   auto fs = std::istringstream(*parseInfo.fragmentShaderCode);
 
+  DALI_LOG_DEBUG_INFO("Preprocessing shader. language version : %u\n", static_cast<uint32_t>(parseInfo.language));
+  DALI_LOG_DEBUG_INFO("  vsh size : %zu, legacy version : %u\n", parseInfo.vertexShaderCode->size(), parseInfo.vertexShaderLegacyVersion);
+  DALI_LOG_DEBUG_INFO("  fsh size : %zu, legacy version : %u\n", parseInfo.fragmentShaderCode->size(), parseInfo.fragmentShaderLegacyVersion);
+
   output.resize(2);
 
   // Create program
@@ -713,6 +717,7 @@ void Parse(const ShaderParserInfo& parseInfo, std::vector<std::string>& output)
   if(parseInfo.vertexShaderLegacyVersion && parseInfo.fragmentShaderLegacyVersion)
   {
     // Not touching any shaders, return current code as output
+    DALI_LOG_DEBUG_INFO("Skip preprocessing. Use same shader as input\n");
     return;
   }
   else if(!parseInfo.vertexShaderLegacyVersion && !parseInfo.fragmentShaderLegacyVersion)
index 1c91b0ae510529de27ca6b305b6d354afd42c267..684bc5b68d554ba45c97bb889ef58794369cc6f0 100644 (file)
@@ -145,7 +145,26 @@ struct ShaderImpl::Impl
                 line << c;
               }
             }
-            DALI_LOG_ERROR("%4d > %s\n", ++lineNumber, line.str().c_str());
+            DALI_LOG_ERROR("%4d > %s[%d / %d]\n", ++lineNumber, line.str().c_str(), i, static_cast<int>(size));
+
+            if(i < size)
+            {
+              while(i < size)
+              {
+                const char c = static_cast<const char>(src[i++]);
+                if(c == '\n')
+                {
+                  DALI_LOG_ERROR("(extra) %4d > %s\n", ++lineNumber, line.str().c_str());
+                  line = std::ostringstream();
+                }
+                else
+                {
+                  line << c;
+                }
+              }
+            }
+            DALI_LOG_ERROR("(extra) %4d > %s\n", ++lineNumber, line.str().c_str());
+            line = std::ostringstream();
           }
           //DALI_LOG_ERROR("Code: %.*s\n", size, reinterpret_cast<const char*>(src));
           DALI_LOG_ERROR("glCompileShader() failed: \n%s\n", output);