#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.
bool IsBlendEquationSupported(DevelBlendEquation::Type blendEquation) override;
+ uint32_t GetShaderLanguageVersion();
+
std::string GetShaderVersionPrefix();
std::string GetVertexShaderPrefix();
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)
TraceCallStack mViewportTrace;
// Shaders & Uniforms
+ uint32_t mShaderLanguageVersion{320u};
+
GLuint mLastShaderIdUsed;
GLuint mLastProgramIdUsed{0u};
GLuint mLastUniformIdUsed;