/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
return texture;
}
+TextureSet CreateTextureSet(Pixel::Format format, int width, int height)
+{
+ TextureSet textureSet = TextureSet::New();
+ textureSet.SetTexture(0u, CreateTexture(TextureType::TEXTURE_2D, format, width, height));
+ return textureSet;
+}
+
} // namespace Dali
#define DALI_TEST_ACTOR_UTILS_H
/*
- * Copyright (c) 2021 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
*/
Actor CreateRenderableActor2(TextureSet textures, const std::string& vertexShader, const std::string& fragmentShader);
-Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height);
+Texture CreateTexture(TextureType::Type type, Pixel::Format format, int width, int height);
+TextureSet CreateTextureSet(Pixel::Format format, int width, int height);
} // namespace Dali
/*
- * Copyright (c) 2022 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2023 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.
mProgramUniforms3f.clear();
mProgramUniforms4f.clear();
- mAttribLocs.clear();
- mAttribLocs.push_back("aPosition");
- mAttribLocs.push_back("aTexCoord");
+ mAttribLocs = {"aPosition", "aTexCoord"};
+ mAttribTypes = {GL_FLOAT, GL_FLOAT};
+
mCullFaceTrace.Reset();
mDepthFunctionTrace.Reset();
mEnableDisableTrace.Reset();
inline void GetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, char* name) override
{
+ strncpy(name, mAttribLocs[index].c_str(), 99);
+ *type = mAttribTypes[index];
}
inline void SetActiveUniforms(const std::vector<ActiveUniform>& uniforms)
mBufferTrace.PushCall("VertexAttribPointer", namedParams.str(), namedParams);
}
+ inline void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) override
+ {
+ TraceCallStack::NamedParams namedParams;
+ namedParams["index"] << index;
+ namedParams["size"] << size;
+ namedParams["type"] << std::hex << type;
+ namedParams["stride"] << stride;
+ namedParams["offset"] << std::to_string(reinterpret_cast<unsigned long>(pointer));
+
+ mBufferTrace.PushCall("VertexAttribIPointer", namedParams.str(), namedParams);
+ }
+
inline void Viewport(GLint x, GLint y, GLsizei width, GLsizei height) override
{
std::string commaString(", ");
{
}
- inline void VertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer) override
- {
- }
-
inline void GetVertexAttribIiv(GLuint index, GLenum pname, GLint* params) override
{
}
{
mLinkStatus = value;
}
- inline void SetAttribLocations(std::vector<std::string> locs)
+ inline void SetAttribLocations(std::vector<std::string>& locs)
{
mAttribLocs = locs;
}
+ inline void SetAttribTypes(std::vector<GLenum>& types)
+ {
+ mAttribTypes = types;
+ }
inline void SetGetErrorResult(GLenum result)
{
mGetErrorResult = result;
bool mGetProgramBinaryCalled;
typedef std::map<GLuint, std::string> ShaderSourceMap;
ShaderSourceMap mShaderSources;
- std::vector<std::string> mAttribLocs; // should be bound to shader
+ std::vector<std::string> mAttribLocs; // should be bound to shader
+ std::vector<GLenum> mAttribTypes; // should be bound to shader
GLuint mLastShaderCompiled;
GLbitfield mLastClearBitMask;
Vector4 mLastClearColor;