X-Git-Url: http://review.tizen.org/git/?a=blobdiff_plain;ds=sidebyside;f=automated-tests%2Fsrc%2Fdali-toolkit%2Fdali-toolkit-test-utils%2Ftest-gl-abstraction.h;h=9f458fc06a796a3444cca33671776b579543441a;hb=HEAD;hp=2ca98dc97232b2143c14bfa2ab60685d4b409658;hpb=dacfa04c292116a2df17a37e722963c40c287464;p=platform%2Fcore%2Fuifw%2Fdali-toolkit.git diff --git a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h index 2ca98dc..a70c21f 100644 --- a/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h +++ b/automated-tests/src/dali-toolkit/dali-toolkit-test-utils/test-gl-abstraction.h @@ -2,7 +2,7 @@ #define TEST_GL_ABSTRACTION_H /* - * Copyright (c) 2023 Samsung Electronics Co., Ltd. + * Copyright (c) 2024 Samsung Electronics Co., Ltd. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -77,6 +77,8 @@ public: bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) override; + uint32_t GetShaderLanguageVersion(); + std::string GetShaderVersionPrefix(); std::string GetVertexShaderPrefix(); @@ -1041,7 +1043,32 @@ public: for(const auto& uniform : mActiveUniforms) { - GetUniformLocation(program, uniform.name.c_str()); + std::string name = uniform.name; + if(uniform.size <= 1) + { + GetUniformLocation(program, name.c_str()); + } + else + { + // Convert single active uniform from "uBlah[0]" or "uStruct[0].element" to N versions of the same + std::string suffix; + auto iter = name.find("["); // Search for index operator + if(iter != std::string::npos) + { + name = uniform.name.substr(0, iter); // Strip off index operator + iter = uniform.name.find("]"); + if(iter != std::string::npos && iter + 1 != uniform.name.length()) + { + suffix = uniform.name.substr(iter + 1); + } + } + for(int i = 0; i < uniform.size; ++i) + { + std::stringstream nss; + nss << name << "[" << i << "]" << suffix; + GetUniformLocation(program, nss.str().c_str()); // Generate N uniforms in the uniform map + } + } } for(const auto& uniform : mCustomUniformData) @@ -2687,6 +2714,8 @@ public: TraceCallStack mViewportTrace; // Shaders & Uniforms + uint32_t mShaderLanguageVersion{320u}; + GLuint mLastShaderIdUsed; GLuint mLastProgramIdUsed{0u}; GLuint mLastUniformIdUsed;