diff options
author | chai <chaifix@163.com> | 2021-11-01 09:50:03 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2021-11-01 09:50:03 +0800 |
commit | 8078aeed4e62c6b3aa48102554044768b402570c (patch) | |
tree | 45928c5b35df5dd3f952ccb789c84b7986743b26 /Runtime/Graphics | |
parent | 20577019253d0b2938fbf0057eed0bda72556e82 (diff) |
*misc
Diffstat (limited to 'Runtime/Graphics')
-rw-r--r-- | Runtime/Graphics/CustomVertexLayout.h | 5 | ||||
-rw-r--r-- | Runtime/Graphics/Shader.cpp | 2 | ||||
-rw-r--r-- | Runtime/Graphics/ShaderCompiler.cpp | 3 |
3 files changed, 7 insertions, 3 deletions
diff --git a/Runtime/Graphics/CustomVertexLayout.h b/Runtime/Graphics/CustomVertexLayout.h index cd68a27..8f9dda8 100644 --- a/Runtime/Graphics/CustomVertexLayout.h +++ b/Runtime/Graphics/CustomVertexLayout.h @@ -12,6 +12,11 @@ struct CustomVertexLayout GLuint buffer; // 创建时留空 std::vector<VertexAttributeDescriptor> attributes; + CustomVertexLayout() + { + int n = buffer; + } + // 重置pointer(startOffset)为0 void RestorePointer() { diff --git a/Runtime/Graphics/Shader.cpp b/Runtime/Graphics/Shader.cpp index 4b4c9e0..60e165f 100644 --- a/Runtime/Graphics/Shader.cpp +++ b/Runtime/Graphics/Shader.cpp @@ -75,7 +75,7 @@ void Shader::CompileProgram(const char* vert, const char* frag, bool keepSrc) const char* fragCode = frag; // vertex shader m_VertID = glCreateShader(GL_VERTEX_SHADER); - glShaderSource(m_VertID, 1, &vertCode, NULL); + glShaderSource(m_VertID, 1, &vertCode, NULL);//为了支持中文注释,长度传NULL glCompileShader(m_VertID); checkCompileshaderErrorors(m_VertID, "VERTEX"); // fragment Shader diff --git a/Runtime/Graphics/ShaderCompiler.cpp b/Runtime/Graphics/ShaderCompiler.cpp index a3dcf50..20b19f5 100644 --- a/Runtime/Graphics/ShaderCompiler.cpp +++ b/Runtime/Graphics/ShaderCompiler.cpp @@ -31,8 +31,7 @@ if(pos == string::npos || !IsLabelActive(src, label)) {\ CheckLabel(VSH_END);
CheckLabel(FSH_BEGIN);
CheckLabel(FSH_END);
-
-
+
vsh = GetContent(src, VSH_BEGIN, VSH_END);
fsh = GetContent(src, FSH_BEGIN, FSH_END);
|