diff options
-rw-r--r-- | Data/Resources/Shaders/Editor_UI.glsl | 27 | ||||
-rw-r--r-- | Data/Resources/Shaders/UI.glsl | 11 | ||||
-rw-r--r-- | Documents/æž¶æž„.xlsx | bin | 6625 -> 117504 bytes | |||
-rw-r--r-- | Runtime/Graphics/SharedVertexBuffer.h | 8 | ||||
-rw-r--r-- | Runtime/Graphics/VertexBuffer.h | 7 |
5 files changed, 35 insertions, 18 deletions
diff --git a/Data/Resources/Shaders/Editor_UI.glsl b/Data/Resources/Shaders/Editor_UI.glsl new file mode 100644 index 0000000..e4b6790 --- /dev/null +++ b/Data/Resources/Shaders/Editor_UI.glsl @@ -0,0 +1,27 @@ + +uniform float2 screenSize; + + +VERTEX_SHADER_BEGIN + +in vec2 position; +int vec2 uv; + +out vec4 clipPos; + +void main() +{ + +} + +VERTEX_SHADER_END + +FRAGMENT_SHADER_BEGIN +out vec4 outColor; + +void main() +{ + outColor = vec4(1,1,1,1); +} + +FRAGMENT_SHADER_END diff --git a/Data/Resources/Shaders/UI.glsl b/Data/Resources/Shaders/UI.glsl deleted file mode 100644 index c4b1f92..0000000 --- a/Data/Resources/Shaders/UI.glsl +++ /dev/null @@ -1,11 +0,0 @@ -VERTEX_SHADER_BEGIN - - -VERTEX_SHADER_END - - -FRAGMENT_SHADER_BEGIN - - - -FRAGMENT_SHADER_END
\ No newline at end of file diff --git a/Documents/æž¶æž„.xlsx b/Documents/æž¶æž„.xlsx Binary files differindex 15e2235..eea1ffa 100644 --- a/Documents/æž¶æž„.xlsx +++ b/Documents/æž¶æž„.xlsx diff --git a/Runtime/Graphics/SharedVertexBuffer.h b/Runtime/Graphics/SharedVertexBuffer.h index 001eb2c..cc89752 100644 --- a/Runtime/Graphics/SharedVertexBuffer.h +++ b/Runtime/Graphics/SharedVertexBuffer.h @@ -18,13 +18,15 @@ public: // default layout void GetChunk(uint attrs, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); - void ReleaseChunk(int actualVerts, int actualIndices); void DrawChunk(); // custom layout void GetChunk(uint sizePerVert, uint sizePerIndex, int maxVerts, int maxIndices, EPrimitive primitive, void **out_vb, void **out_ib); void DrawChunk(CustomVertexLayout& layout); + // common + void ReleaseChunk(int actualVerts, int actualIndices); + private: void FillCustomVertexLayout(CustomVertexLayout& dst); @@ -32,14 +34,12 @@ private: void Clean(); - // if vertex databuffer size beyond this value, use pinned memory mapping, instead of glBufferData. + // Èç¹ûÊý¾Ý´óС³¬¹ýÕâ¸öÏÞÖÆ£¬ÓÃÄÚ´æÊý¾Ý£¬¶ø²»ÊÇglBufferData enum { DataBufferThreshold = 1024 }; - // shared vbo and ibo GPU::DataBuffer *m_CurVB; GPU::DataBuffer *m_CurIB; - // restore vbo and ibo data if not using pinned memory mapping std::vector<byte> m_CurVBData; std::vector<uint16> m_CurIBData; diff --git a/Runtime/Graphics/VertexBuffer.h b/Runtime/Graphics/VertexBuffer.h index 382ca39..5e4fdf2 100644 --- a/Runtime/Graphics/VertexBuffer.h +++ b/Runtime/Graphics/VertexBuffer.h @@ -12,6 +12,8 @@ #include "CustomVertexLayout.h" #include "Primitive.h" +// ʵ¼ÊʹÓùý³ÌÖУ¬Í¨³£ÊÇÒ»¸öVBOºÍÒ»¸öIBOÒ»Æð£¬submesh¶ÔÓ¦µÄÊÇIBOÖеIJ»Í¬µÄ¶Î£¬¶ø²»ÊDz»Í¬µÄIBO + class VertexBuffer { public: @@ -29,9 +31,8 @@ public: private: VertexBufferType m_Type; - GPU::DataBuffer *m_VB; - GPU::DataBuffer *m_IB;// vertex buffer and index buffer - + GPU::DataBuffer* m_VB; + GPU::DataBuffer* m_IB; }; #endif
\ No newline at end of file |