Browse Source

Rename VertexDecl to VertexLayout

Leandro Freire 6 years ago
parent
commit
855623e153
68 changed files with 660 additions and 660 deletions
  1. 56 56
      bindings/cs/bgfx.cs
  2. 2 2
      examples/01-cubes/cubes.cpp
  3. 2 2
      examples/02-metaballs/metaballs.cpp
  4. 2 2
      examples/03-raymarch/raymarch.cpp
  5. 2 2
      examples/05-instancing/instancing.cpp
  6. 2 2
      examples/06-bump/bump.cpp
  7. 2 2
      examples/07-callback/callback.cpp
  8. 2 2
      examples/08-update/update.cpp
  9. 2 2
      examples/09-hdr/hdr.cpp
  10. 5 5
      examples/13-stencil/stencil.cpp
  11. 9 9
      examples/14-shadowvolumes/shadowvolumes.cpp
  12. 2 2
      examples/15-shadowmaps-simple/shadowmaps_simple.cpp
  13. 7 7
      examples/16-shadowmaps/shadowmaps.cpp
  14. 2 2
      examples/17-drawstress/drawstress.cpp
  15. 2 2
      examples/18-ibl/ibl.cpp
  16. 4 4
      examples/19-oit/oit.cpp
  17. 6 6
      examples/21-deferred/deferred.cpp
  18. 2 2
      examples/22-windows/windows.cpp
  19. 2 2
      examples/23-vectordisplay/main.cpp
  20. 1 1
      examples/23-vectordisplay/vectordisplay.cpp
  21. 1 1
      examples/23-vectordisplay/vectordisplay.h
  22. 2 2
      examples/24-nbody/nbody.cpp
  23. 2 2
      examples/26-occlusion/occlusion.cpp
  24. 2 2
      examples/27-terrain/terrain.cpp
  25. 2 2
      examples/31-rsm/reflectiveshadowmap.cpp
  26. 2 2
      examples/33-pom/pom.cpp
  27. 4 4
      examples/34-mvs/mvs.cpp
  28. 2 2
      examples/35-dynamic/dynamic.cpp
  29. 3 3
      examples/36-sky/sky.cpp
  30. 4 4
      examples/37-gpudrivenrendering/gpudrivenrendering.cpp
  31. 4 4
      examples/38-bloom/bloom.cpp
  32. 2 2
      examples/39-assao/assao.cpp
  33. 2 2
      examples/40-svt/svt.cpp
  34. 2 2
      examples/41-tess/tess.cpp
  35. 2 2
      examples/common/bgfx_utils.cpp
  36. 3 3
      examples/common/bgfx_utils.h
  37. 8 8
      examples/common/debugdraw/debugdraw.cpp
  38. 1 1
      examples/common/example-glue.cpp
  39. 1 1
      examples/common/font/text_buffer_manager.h
  40. 1 1
      examples/common/imgui/imgui.cpp
  41. 1 1
      examples/common/nanovg/nanovg_bgfx.cpp
  42. 2 2
      examples/common/ps/particle_system.cpp
  43. 53 53
      include/bgfx/bgfx.h
  44. 79 79
      include/bgfx/c99/bgfx.h
  45. 1 1
      include/bgfx/defines.h
  46. 64 64
      scripts/bgfx.idl
  47. 1 1
      scripts/bgfx.natvis
  48. 1 1
      scripts/temp.bgfx.idl.inl
  49. 38 38
      src/bgfx.cpp
  50. 56 56
      src/bgfx.idl.inl
  51. 58 58
      src/bgfx_p.h
  52. 19 19
      src/renderer_d3d11.cpp
  53. 2 2
      src/renderer_d3d11.h
  54. 23 23
      src/renderer_d3d12.cpp
  55. 2 2
      src/renderer_d3d12.h
  56. 17 17
      src/renderer_d3d9.cpp
  57. 2 2
      src/renderer_d3d9.h
  58. 10 10
      src/renderer_gl.cpp
  59. 3 3
      src/renderer_gl.h
  60. 2 2
      src/renderer_mtl.h
  61. 16 16
      src/renderer_mtl.mm
  62. 3 3
      src/renderer_noop.cpp
  63. 20 20
      src/renderer_vk.cpp
  64. 2 2
      src/renderer_vk.h
  65. 14 14
      src/vertexdecl.cpp
  66. 2 2
      src/vertexdecl.h
  67. 3 3
      tools/geometryc/geometryc.cpp
  68. 2 2
      tools/texturev/texturev.cpp

+ 56 - 56
bindings/cs/bgfx.cs

@@ -1907,7 +1907,7 @@ public static partial class bgfx
 			public uint maxTextures;
 			public uint maxTextures;
 			public uint maxTextureSamplers;
 			public uint maxTextureSamplers;
 			public uint maxComputeBindings;
 			public uint maxComputeBindings;
-			public uint maxVertexDecls;
+			public uint maxVertexLayouts;
 			public uint maxVertexStreams;
 			public uint maxVertexStreams;
 			public uint maxIndexBuffers;
 			public uint maxIndexBuffers;
 			public uint maxVertexBuffers;
 			public uint maxVertexBuffers;
@@ -1999,7 +1999,7 @@ public static partial class bgfx
 		public uint startVertex;
 		public uint startVertex;
 		public ushort stride;
 		public ushort stride;
 		public VertexBufferHandle handle;
 		public VertexBufferHandle handle;
-		public VertexDeclHandle decl;
+		public VertexLayoutHandle decl;
 	}
 	}
 	
 	
 	public unsafe struct InstanceDataBuffer
 	public unsafe struct InstanceDataBuffer
@@ -2086,7 +2086,7 @@ public static partial class bgfx
 		public ushort numTextures;
 		public ushort numTextures;
 		public ushort numUniforms;
 		public ushort numUniforms;
 		public ushort numVertexBuffers;
 		public ushort numVertexBuffers;
-		public ushort numVertexDecls;
+		public ushort numVertexLayouts;
 		public long textureMemoryUsed;
 		public long textureMemoryUsed;
 		public long rtMemoryUsed;
 		public long rtMemoryUsed;
 		public int transientVbUsed;
 		public int transientVbUsed;
@@ -2104,7 +2104,7 @@ public static partial class bgfx
 		public EncoderStats* encoderStats;
 		public EncoderStats* encoderStats;
 	}
 	}
 	
 	
-	public unsafe struct VertexDecl
+	public unsafe struct VertexLayout
 	{
 	{
 		public uint hash;
 		public uint hash;
 		public ushort stride;
 		public ushort stride;
@@ -2138,7 +2138,7 @@ public static partial class bgfx
 	
 	
 	public struct VertexBufferHandle{ public ushort idx; }
 	public struct VertexBufferHandle{ public ushort idx; }
 	
 	
-	public struct VertexDeclHandle{ public ushort idx; }
+	public struct VertexLayoutHandle{ public ushort idx; }
 	
 	
 
 
 	/// <summary>
 	/// <summary>
@@ -2155,14 +2155,14 @@ public static partial class bgfx
 	public static extern unsafe void attachment_init(Attachment* _this, TextureHandle _handle, Access _access, ushort _layer, ushort _mip, byte _resolve);
 	public static extern unsafe void attachment_init(Attachment* _this, TextureHandle _handle, Access _access, ushort _layer, ushort _mip, byte _resolve);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// Start VertexDecl.
+	/// Start VertexLayout.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_begin", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe VertexDecl* vertex_decl_begin(VertexDecl* _this, RendererType _rendererType);
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_begin", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe VertexLayout* vertex_layout_begin(VertexLayout* _this, RendererType _rendererType);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// Add attribute to VertexDecl.
+	/// Add attribute to VertexLayout.
 	/// @remarks Must be called between begin/end.
 	/// @remarks Must be called between begin/end.
 	/// </summary>
 	/// </summary>
 	///
 	///
@@ -2172,8 +2172,8 @@ public static partial class bgfx
 	/// <param name="_normalized">When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.</param>
 	/// <param name="_normalized">When using fixed point AttribType (f.e. Uint8) value will be normalized for vertex shader usage. When normalized is set to true, AttribType::Uint8 value in range 0-255 will be in range 0.0-1.0 in vertex shader.</param>
 	/// <param name="_asInt">Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.</param>
 	/// <param name="_asInt">Packaging rule for vertexPack, vertexUnpack, and vertexConvert for AttribType::Uint8 and AttribType::Int16. Unpacking code must be implemented inside vertex shader.</param>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_add", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe VertexDecl* vertex_decl_add(VertexDecl* _this, Attrib _attrib, byte _num, AttribType _type, bool _normalized, bool _asInt);
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_add", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe VertexLayout* vertex_layout_add(VertexLayout* _this, Attrib _attrib, byte _num, AttribType _type, bool _normalized, bool _asInt);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Decode attribute.
 	/// Decode attribute.
@@ -2185,32 +2185,32 @@ public static partial class bgfx
 	/// <param name="_normalized">Attribute is normalized.</param>
 	/// <param name="_normalized">Attribute is normalized.</param>
 	/// <param name="_asInt">Attribute is packed as int.</param>
 	/// <param name="_asInt">Attribute is packed as int.</param>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_decode", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void vertex_decl_decode(VertexDecl* _this, Attrib _attrib, byte * _num, AttribType* _type, bool* _normalized, bool* _asInt);
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_decode", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe void vertex_layout_decode(VertexLayout* _this, Attrib _attrib, byte * _num, AttribType* _type, bool* _normalized, bool* _asInt);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// Returns true if VertexDecl contains attribute.
+	/// Returns true if VertexLayout contains attribute.
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
 	/// <param name="_attrib">Attribute semantics. See: `bgfx::Attrib`</param>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_has", CallingConvention = CallingConvention.Cdecl)]
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_has", CallingConvention = CallingConvention.Cdecl)]
 	[return: MarshalAs(UnmanagedType.I1)]
 	[return: MarshalAs(UnmanagedType.I1)]
-	public static extern unsafe bool vertex_decl_has(VertexDecl* _this, Attrib _attrib);
+	public static extern unsafe bool vertex_layout_has(VertexLayout* _this, Attrib _attrib);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Skip `_num` bytes in vertex stream.
 	/// Skip `_num` bytes in vertex stream.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_skip", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe VertexDecl* vertex_decl_skip(VertexDecl* _this, byte _num);
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_skip", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe VertexLayout* vertex_layout_skip(VertexLayout* _this, byte _num);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// End VertexDecl.
+	/// End VertexLayout.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_vertex_decl_end", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void vertex_decl_end(VertexDecl* _this);
+	[DllImport(DllName, EntryPoint="bgfx_vertex_layout_end", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe void vertex_layout_end(VertexLayout* _this);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Pack vertex attribute into vertex stream format.
 	/// Pack vertex attribute into vertex stream format.
@@ -2219,12 +2219,12 @@ public static partial class bgfx
 	/// <param name="_input">Value to be packed into vertex stream.</param>
 	/// <param name="_input">Value to be packed into vertex stream.</param>
 	/// <param name="_inputNormalized">`true` if input value is already normalized.</param>
 	/// <param name="_inputNormalized">`true` if input value is already normalized.</param>
 	/// <param name="_attr">Attribute to pack.</param>
 	/// <param name="_attr">Attribute to pack.</param>
-	/// <param name="_decl">Vertex stream declaration.</param>
+	/// <param name="_decl">Vertex stream layout.</param>
 	/// <param name="_data">Destination vertex stream where data will be packed.</param>
 	/// <param name="_data">Destination vertex stream where data will be packed.</param>
 	/// <param name="_index">Vertex index that will be modified.</param>
 	/// <param name="_index">Vertex index that will be modified.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_vertex_pack", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_vertex_pack", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void vertex_pack(float _input, bool _inputNormalized, Attrib _attr, VertexDecl* _decl, void* _data, uint _index);
+	public static extern unsafe void vertex_pack(float _input, bool _inputNormalized, Attrib _attr, VertexLayout* _decl, void* _data, uint _index);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Unpack vertex attribute from vertex stream format.
 	/// Unpack vertex attribute from vertex stream format.
@@ -2232,38 +2232,38 @@ public static partial class bgfx
 	///
 	///
 	/// <param name="_output">Result of unpacking.</param>
 	/// <param name="_output">Result of unpacking.</param>
 	/// <param name="_attr">Attribute to unpack.</param>
 	/// <param name="_attr">Attribute to unpack.</param>
-	/// <param name="_decl">Vertex stream declaration.</param>
+	/// <param name="_decl">Vertex stream layout.</param>
 	/// <param name="_data">Source vertex stream from where data will be unpacked.</param>
 	/// <param name="_data">Source vertex stream from where data will be unpacked.</param>
 	/// <param name="_index">Vertex index that will be unpacked.</param>
 	/// <param name="_index">Vertex index that will be unpacked.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_vertex_unpack", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_vertex_unpack", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void vertex_unpack(float _output, Attrib _attr, VertexDecl* _decl, void* _data, uint _index);
+	public static extern unsafe void vertex_unpack(float _output, Attrib _attr, VertexLayout* _decl, void* _data, uint _index);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Converts vertex stream data from one vertex stream format to another.
 	/// Converts vertex stream data from one vertex stream format to another.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	/// <param name="_dstDecl">Destination vertex stream declaration.</param>
+	/// <param name="_dstDecl">Destination vertex stream layout.</param>
 	/// <param name="_dstData">Destination vertex stream.</param>
 	/// <param name="_dstData">Destination vertex stream.</param>
-	/// <param name="_srcDecl">Source vertex stream declaration.</param>
+	/// <param name="_srcDecl">Source vertex stream layout.</param>
 	/// <param name="_srcData">Source vertex stream data.</param>
 	/// <param name="_srcData">Source vertex stream data.</param>
 	/// <param name="_num">Number of vertices to convert from source to destination.</param>
 	/// <param name="_num">Number of vertices to convert from source to destination.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_vertex_convert", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_vertex_convert", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void vertex_convert(VertexDecl* _dstDecl, void* _dstData, VertexDecl* _srcDecl, void* _srcData, uint _num);
+	public static extern unsafe void vertex_convert(VertexLayout* _dstDecl, void* _dstData, VertexLayout* _srcDecl, void* _srcData, uint _num);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Weld vertices.
 	/// Weld vertices.
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
 	/// <param name="_output">Welded vertices remapping table. The size of buffer must be the same as number of vertices.</param>
-	/// <param name="_decl">Vertex stream declaration.</param>
+	/// <param name="_decl">Vertex stream layout.</param>
 	/// <param name="_data">Vertex stream.</param>
 	/// <param name="_data">Vertex stream.</param>
 	/// <param name="_num">Number of vertices in vertex stream.</param>
 	/// <param name="_num">Number of vertices in vertex stream.</param>
 	/// <param name="_epsilon">Error tolerance for vertex position comparison.</param>
 	/// <param name="_epsilon">Error tolerance for vertex position comparison.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_weld_vertices", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_weld_vertices", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe ushort weld_vertices(ushort* _output, VertexDecl* _decl, void* _data, ushort _num, float _epsilon);
+	public static extern unsafe ushort weld_vertices(ushort* _output, VertexLayout* _decl, void* _data, ushort _num, float _epsilon);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Convert index buffer for use with different primitive topologies.
 	/// Convert index buffer for use with different primitive topologies.
@@ -2529,33 +2529,33 @@ public static partial class bgfx
 	public static extern unsafe void destroy_index_buffer(IndexBufferHandle _handle);
 	public static extern unsafe void destroy_index_buffer(IndexBufferHandle _handle);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// Create vertex declaration.
+	/// Create vertex layout.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	///
 	///
-	[DllImport(DllName, EntryPoint="bgfx_create_vertex_decl", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe VertexDeclHandle create_vertex_decl(VertexDecl* _decl);
+	[DllImport(DllName, EntryPoint="bgfx_create_vertex_layout", CallingConvention = CallingConvention.Cdecl)]
+	public static extern unsafe VertexLayoutHandle create_vertex_layout(VertexLayout* _decl);
 	
 	
 	/// <summary>
 	/// <summary>
-	/// Destroy vertex declaration.
+	/// Destroy vertex layout.
 	/// </summary>
 	/// </summary>
 	///
 	///
-	/// <param name="_handle">Vertex declaration handle.</param>
+	/// <param name="_handle">Vertex layout handle.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_destroy_vertex_decl", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_destroy_vertex_decl", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void destroy_vertex_decl(VertexDeclHandle _handle);
+	public static extern unsafe void destroy_vertex_decl(VertexLayoutHandle _handle);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Create static vertex buffer.
 	/// Create static vertex buffer.
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_mem">Vertex buffer data.</param>
 	/// <param name="_mem">Vertex buffer data.</param>
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	/// <param name="_flags">Buffer creation flags.  - `BGFX_BUFFER_NONE` - No flags.  - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.  - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer      is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.  - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.  - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of      data is passed. If this flag is not specified, and more data is passed on update, the buffer      will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.  - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
 	/// <param name="_flags">Buffer creation flags.  - `BGFX_BUFFER_NONE` - No flags.  - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.  - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer      is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.  - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.  - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of      data is passed. If this flag is not specified, and more data is passed on update, the buffer      will be trimmed to fit the existing buffer size. This flag has effect only on dynamic buffers.  - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on index buffers.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_create_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_create_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe VertexBufferHandle create_vertex_buffer(Memory* _mem, VertexDecl* _decl, ushort _flags);
+	public static extern unsafe VertexBufferHandle create_vertex_buffer(Memory* _mem, VertexLayout* _decl, ushort _flags);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Set static vertex buffer debug name.
 	/// Set static vertex buffer debug name.
@@ -2622,22 +2622,22 @@ public static partial class bgfx
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_num">Number of vertices.</param>
 	/// <param name="_num">Number of vertices.</param>
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	/// <param name="_flags">Buffer creation flags.   - `BGFX_BUFFER_NONE` - No flags.   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.   - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer       is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.   - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.   - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of       data is passed. If this flag is not specified, and more data is passed on update, the buffer       will be trimmed to fit the existing buffer size. This flag has effect only on dynamic       buffers.   - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on       index buffers.</param>
 	/// <param name="_flags">Buffer creation flags.   - `BGFX_BUFFER_NONE` - No flags.   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.   - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer       is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.   - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.   - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of       data is passed. If this flag is not specified, and more data is passed on update, the buffer       will be trimmed to fit the existing buffer size. This flag has effect only on dynamic       buffers.   - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on       index buffers.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer(uint _num, VertexDecl* _decl, ushort _flags);
+	public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer(uint _num, VertexLayout* _decl, ushort _flags);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Create dynamic vertex buffer and initialize it.
 	/// Create dynamic vertex buffer and initialize it.
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_mem">Vertex buffer data.</param>
 	/// <param name="_mem">Vertex buffer data.</param>
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	/// <param name="_flags">Buffer creation flags.   - `BGFX_BUFFER_NONE` - No flags.   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.   - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer       is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.   - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.   - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of       data is passed. If this flag is not specified, and more data is passed on update, the buffer       will be trimmed to fit the existing buffer size. This flag has effect only on dynamic       buffers.   - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on       index buffers.</param>
 	/// <param name="_flags">Buffer creation flags.   - `BGFX_BUFFER_NONE` - No flags.   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.   - `BGFX_BUFFER_COMPUTE_WRITE` - Buffer will be written into by compute shader. When buffer       is created with `BGFX_BUFFER_COMPUTE_WRITE` flag it cannot be updated from CPU.   - `BGFX_BUFFER_COMPUTE_READ_WRITE` - Buffer will be used for read/write by compute shader.   - `BGFX_BUFFER_ALLOW_RESIZE` - Buffer will resize on buffer update if a different amount of       data is passed. If this flag is not specified, and more data is passed on update, the buffer       will be trimmed to fit the existing buffer size. This flag has effect only on dynamic       buffers.   - `BGFX_BUFFER_INDEX32` - Buffer is using 32-bit indices. This flag has effect only on       index buffers.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer_mem", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_create_dynamic_vertex_buffer_mem", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer_mem(Memory* _mem, VertexDecl* _decl, ushort _flags);
+	public static extern unsafe DynamicVertexBufferHandle create_dynamic_vertex_buffer_mem(Memory* _mem, VertexLayout* _decl, ushort _flags);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Update dynamic vertex buffer.
 	/// Update dynamic vertex buffer.
@@ -2673,10 +2673,10 @@ public static partial class bgfx
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_num">Number of required vertices.</param>
 	/// <param name="_num">Number of required vertices.</param>
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_get_avail_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_get_avail_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe uint get_avail_transient_vertex_buffer(uint _num, VertexDecl* _decl);
+	public static extern unsafe uint get_avail_transient_vertex_buffer(uint _num, VertexLayout* _decl);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Returns number of requested or maximum available instance buffer slots.
 	/// Returns number of requested or maximum available instance buffer slots.
@@ -2706,10 +2706,10 @@ public static partial class bgfx
 	///
 	///
 	/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
 	/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
 	/// <param name="_num">Number of vertices to allocate.</param>
 	/// <param name="_num">Number of vertices to allocate.</param>
-	/// <param name="_decl">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_alloc_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_alloc_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void alloc_transient_vertex_buffer(TransientVertexBuffer* _tvb, uint _num, VertexDecl* _decl);
+	public static extern unsafe void alloc_transient_vertex_buffer(TransientVertexBuffer* _tvb, uint _num, VertexLayout* _decl);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Check for required space and allocate transient vertex and index
 	/// Check for required space and allocate transient vertex and index
@@ -2720,14 +2720,14 @@ public static partial class bgfx
 	/// </summary>
 	/// </summary>
 	///
 	///
 	/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
 	/// <param name="_tvb">TransientVertexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
-	/// <param name="_decl">Number of vertices to allocate.</param>
-	/// <param name="_numVertices">Vertex declaration.</param>
+	/// <param name="_decl">Vertex layout.</param>
+	/// <param name="_numVertices">Number of vertices to allocate.</param>
 	/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
 	/// <param name="_tib">TransientIndexBuffer structure is filled and is valid for the duration of frame, and it can be reused for multiple draw calls.</param>
 	/// <param name="_numIndices">Number of indices to allocate.</param>
 	/// <param name="_numIndices">Number of indices to allocate.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_alloc_transient_buffers", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_alloc_transient_buffers", CallingConvention = CallingConvention.Cdecl)]
 	[return: MarshalAs(UnmanagedType.I1)]
 	[return: MarshalAs(UnmanagedType.I1)]
-	public static extern unsafe bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexDecl* _decl, uint _numVertices, TransientIndexBuffer* _tib, uint _numIndices);
+	public static extern unsafe bool alloc_transient_buffers(TransientVertexBuffer* _tvb, VertexLayout* _decl, uint _numVertices, TransientIndexBuffer* _tib, uint _numIndices);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Allocate instance data buffer.
 	/// Allocate instance data buffer.
@@ -3536,10 +3536,10 @@ public static partial class bgfx
 	/// <param name="_handle">Vertex buffer.</param>
 	/// <param name="_handle">Vertex buffer.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
-	/// <param name="_declHandle">VertexDecl handle for aliasing vertex buffer.</param>
+	/// <param name="_declHandle">VertexLayout handle for aliasing vertex buffer.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void encoder_set_vertex_buffer(Encoder* _this, byte _stream, VertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexDeclHandle _declHandle);
+	public static extern unsafe void encoder_set_vertex_buffer(Encoder* _this, byte _stream, VertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexLayoutHandle _declHandle);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Set vertex buffer for draw primitive.
 	/// Set vertex buffer for draw primitive.
@@ -3549,10 +3549,10 @@ public static partial class bgfx
 	/// <param name="_handle">Dynamic vertex buffer.</param>
 	/// <param name="_handle">Dynamic vertex buffer.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
-	/// <param name="_declHandle">VertexDecl handle for aliasing vertex buffer.</param>
+	/// <param name="_declHandle">VertexLayout handle for aliasing vertex buffer.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_dynamic_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void encoder_set_dynamic_vertex_buffer(Encoder* _this, byte _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexDeclHandle _declHandle);
+	public static extern unsafe void encoder_set_dynamic_vertex_buffer(Encoder* _this, byte _stream, DynamicVertexBufferHandle _handle, uint _startVertex, uint _numVertices, VertexLayoutHandle _declHandle);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Set vertex buffer for draw primitive.
 	/// Set vertex buffer for draw primitive.
@@ -3562,10 +3562,10 @@ public static partial class bgfx
 	/// <param name="_tvb">Transient vertex buffer.</param>
 	/// <param name="_tvb">Transient vertex buffer.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_startVertex">First vertex to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
 	/// <param name="_numVertices">Number of vertices to render.</param>
-	/// <param name="_declHandle">VertexDecl handle for aliasing vertex buffer.</param>
+	/// <param name="_declHandle">VertexLayout handle for aliasing vertex buffer.</param>
 	///
 	///
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
 	[DllImport(DllName, EntryPoint="bgfx_encoder_set_transient_vertex_buffer", CallingConvention = CallingConvention.Cdecl)]
-	public static extern unsafe void encoder_set_transient_vertex_buffer(Encoder* _this, byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices, VertexDeclHandle _declHandle);
+	public static extern unsafe void encoder_set_transient_vertex_buffer(Encoder* _this, byte _stream, TransientVertexBuffer* _tvb, uint _startVertex, uint _numVertices, VertexLayoutHandle _declHandle);
 	
 	
 	/// <summary>
 	/// <summary>
 	/// Set number of vertices for auto generated vertices use in conjuction
 	/// Set number of vertices for auto generated vertices use in conjuction

+ 2 - 2
examples/01-cubes/cubes.cpp

@@ -26,10 +26,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[] =
 static PosColorVertex s_cubeVertices[] =
 {
 {

+ 2 - 2
examples/02-metaballs/metaballs.cpp

@@ -40,10 +40,10 @@ struct PosNormalColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalColorVertex::ms_decl;
+bgfx::VertexLayout PosNormalColorVertex::ms_decl;
 
 
 struct Grid
 struct Grid
 {
 {

+ 2 - 2
examples/03-raymarch/raymarch.cpp

@@ -29,10 +29,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 void renderScreenSpaceQuad(uint8_t _view, bgfx::ProgramHandle _program, float _x, float _y, float _width, float _height)
 void renderScreenSpaceQuad(uint8_t _view, bgfx::ProgramHandle _program, float _x, float _y, float _width, float _height)
 {
 {

+ 2 - 2
examples/05-instancing/instancing.cpp

@@ -26,10 +26,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 2 - 2
examples/06-bump/bump.cpp

@@ -31,10 +31,10 @@ struct PosNormalTangentTexcoordVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalTangentTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosNormalTangentTexcoordVertex::ms_decl;
 
 
 static PosNormalTangentTexcoordVertex s_cubeVertices[24] =
 static PosNormalTangentTexcoordVertex s_cubeVertices[24] =
 {
 {

+ 2 - 2
examples/07-callback/callback.cpp

@@ -36,10 +36,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 2 - 2
examples/08-update/update.cpp

@@ -33,10 +33,10 @@ struct PosTexcoordVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosTexcoordVertex::ms_decl;
 
 
 static PosTexcoordVertex s_cubeVertices[] =
 static PosTexcoordVertex s_cubeVertices[] =
 {
 {

+ 2 - 2
examples/09-hdr/hdr.cpp

@@ -32,10 +32,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f)
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f)
 {
 {

+ 5 - 5
examples/13-stencil/stencil.cpp

@@ -15,7 +15,7 @@
 
 
 namespace bgfx
 namespace bgfx
 {
 {
-	int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 }
 }
 
 
 namespace
 namespace
@@ -51,10 +51,10 @@ struct PosNormalTexcoordVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosNormalTexcoordVertex::ms_decl;
 
 
 static const float s_texcoord = 5.0f;
 static const float s_texcoord = 5.0f;
 static PosNormalTexcoordVertex s_hplaneVertices[] =
 static PosNormalTexcoordVertex s_hplaneVertices[] =
@@ -622,7 +622,7 @@ struct Group
 
 
 struct Mesh
 struct Mesh
 {
 {
-	void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+	void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 	{
 	{
 		Group group;
 		Group group;
 		const bgfx::Memory* mem;
 		const bgfx::Memory* mem;
@@ -780,7 +780,7 @@ struct Mesh
 		}
 		}
 	}
 	}
 
 
-	bgfx::VertexDecl m_decl;
+	bgfx::VertexLayout m_decl;
 	typedef std::vector<Group> GroupArray;
 	typedef std::vector<Group> GroupArray;
 	GroupArray m_groups;
 	GroupArray m_groups;
 };
 };

+ 9 - 9
examples/14-shadowvolumes/shadowvolumes.cpp

@@ -26,7 +26,7 @@ namespace stl = tinystl;
 
 
 namespace bgfx
 namespace bgfx
 {
 {
-	int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 }
 }
 
 
 namespace
 namespace
@@ -60,10 +60,10 @@ struct PosNormalTexcoordVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosNormalTexcoordVertex::ms_decl;
 
 
 static const float s_texcoord = 50.0f;
 static const float s_texcoord = 50.0f;
 static PosNormalTexcoordVertex s_hplaneVertices[] =
 static PosNormalTexcoordVertex s_hplaneVertices[] =
@@ -697,7 +697,7 @@ inline float sqLength(const float _a[3], const float _b[3])
 	return xx*xx + yy*yy + zz*zz;
 	return xx*xx + yy*yy + zz*zz;
 }
 }
 
 
-uint16_t weldVertices(WeldedVertex* _output, const bgfx::VertexDecl& _decl, const void* _data, uint16_t _num, float _epsilon)
+uint16_t weldVertices(WeldedVertex* _output, const bgfx::VertexLayout& _decl, const void* _data, uint16_t _num, float _epsilon)
 {
 {
 	const uint32_t hashSize = bx::uint32_nextpow2(_num);
 	const uint32_t hashSize = bx::uint32_nextpow2(_num);
 	const uint32_t hashMask = hashSize-1;
 	const uint32_t hashMask = hashSize-1;
@@ -782,7 +782,7 @@ struct Group
 		Plane m_plane[2];
 		Plane m_plane[2];
 	};
 	};
 
 
-	void fillStructures(const bgfx::VertexDecl& _decl)
+	void fillStructures(const bgfx::VertexLayout& _decl)
 	{
 	{
 		uint16_t stride = _decl.getStride();
 		uint16_t stride = _decl.getStride();
 		m_faces.clear();
 		m_faces.clear();
@@ -933,7 +933,7 @@ typedef std::vector<Group> GroupArray;
 
 
 struct Mesh
 struct Mesh
 {
 {
-	void load(const void* _vertices, uint16_t _numVertices, const bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+	void load(const void* _vertices, uint16_t _numVertices, const bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 	{
 	{
 		Group group;
 		Group group;
 		const bgfx::Memory* mem;
 		const bgfx::Memory* mem;
@@ -1011,7 +1011,7 @@ struct Mesh
 		m_groups.clear();
 		m_groups.clear();
 	}
 	}
 
 
-	bgfx::VertexDecl m_decl;
+	bgfx::VertexLayout m_decl;
 	GroupArray m_groups;
 	GroupArray m_groups;
 };
 };
 
 
@@ -1023,7 +1023,7 @@ struct Model
 		m_texture.idx = bgfx::kInvalidHandle;
 		m_texture.idx = bgfx::kInvalidHandle;
 	}
 	}
 
 
-	void load(const void* _vertices, uint16_t _numVertices, const bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+	void load(const void* _vertices, uint16_t _numVertices, const bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 	{
 	{
 		m_mesh.load(_vertices, _numVertices, _decl, _indices, _numIndices);
 		m_mesh.load(_vertices, _numVertices, _decl, _indices, _numIndices);
 	}
 	}
@@ -1543,7 +1543,7 @@ void shadowVolumeCreate(
 		}
 		}
 	}
 	}
 
 
-	bgfx::VertexDecl decl;
+	bgfx::VertexLayout decl;
 	decl.begin()
 	decl.begin()
 		.add(bgfx::Attrib::Position,  3, bgfx::AttribType::Float)
 		.add(bgfx::Attrib::Position,  3, bgfx::AttribType::Float)
 		.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)
 		.add(bgfx::Attrib::TexCoord0, 2, bgfx::AttribType::Float)

+ 2 - 2
examples/15-shadowmaps-simple/shadowmaps_simple.cpp

@@ -39,10 +39,10 @@ struct PosNormalVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalVertex::ms_decl;
+bgfx::VertexLayout PosNormalVertex::ms_decl;
 
 
 static PosNormalVertex s_hplaneVertices[] =
 static PosNormalVertex s_hplaneVertices[] =
 {
 {

+ 7 - 7
examples/16-shadowmaps/shadowmaps.cpp

@@ -20,7 +20,7 @@
 
 
 namespace bgfx
 namespace bgfx
 {
 {
-	int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 }
 }
 
 
 namespace
 namespace
@@ -812,7 +812,7 @@ struct Group
 
 
 struct Mesh
 struct Mesh
 {
 {
-	void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+	void load(const void* _vertices, uint32_t _numVertices, const bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 	{
 	{
 		Group group;
 		Group group;
 		const bgfx::Memory* mem;
 		const bgfx::Memory* mem;
@@ -977,7 +977,7 @@ struct Mesh
 		}
 		}
 	}
 	}
 
 
-	bgfx::VertexDecl m_decl;
+	bgfx::VertexLayout m_decl;
 	typedef std::vector<Group> GroupArray;
 	typedef std::vector<Group> GroupArray;
 	GroupArray m_groups;
 	GroupArray m_groups;
 };
 };
@@ -1001,10 +1001,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = true, float _width = 1.0f, float _height = 1.0f)
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = true, float _width = 1.0f, float _height = 1.0f)
 {
 {
@@ -1344,7 +1344,7 @@ public:
 		s_programs.init();
 		s_programs.init();
 
 
 		// Vertex declarations.
 		// Vertex declarations.
-		bgfx::VertexDecl PosNormalTexcoordDecl;
+		bgfx::VertexLayout PosNormalTexcoordDecl;
 		PosNormalTexcoordDecl.begin()
 		PosNormalTexcoordDecl.begin()
 			.add(bgfx::Attrib::Position,  3, bgfx::AttribType::Float)
 			.add(bgfx::Attrib::Position,  3, bgfx::AttribType::Float)
 			.add(bgfx::Attrib::Normal,    4, bgfx::AttribType::Uint8, true, true)
 			.add(bgfx::Attrib::Normal,    4, bgfx::AttribType::Uint8, true, true)
@@ -3219,7 +3219,7 @@ public:
 	ViewState m_viewState;
 	ViewState m_viewState;
 	ClearValues m_clearValues;
 	ClearValues m_clearValues;
 
 
-	bgfx::VertexDecl m_posDecl;
+	bgfx::VertexLayout m_posDecl;
 
 
 	bgfx::TextureHandle m_texFigure;
 	bgfx::TextureHandle m_texFigure;
 	bgfx::TextureHandle m_texFlare;
 	bgfx::TextureHandle m_texFlare;

+ 2 - 2
examples/17-drawstress/drawstress.cpp

@@ -44,10 +44,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 2 - 2
examples/18-ibl/ibl.cpp

@@ -85,10 +85,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f)
 void screenSpaceQuad(float _textureWidth, float _textureHeight, bool _originBottomLeft = false, float _width = 1.0f, float _height = 1.0f)
 {
 {

+ 4 - 4
examples/19-oit/oit.cpp

@@ -26,10 +26,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 struct PosColorTexCoord0Vertex
 struct PosColorTexCoord0Vertex
 {
 {
@@ -50,10 +50,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 6 - 6
examples/21-deferred/deferred.cpp

@@ -41,10 +41,10 @@ struct PosNormalTangentTexcoordVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosNormalTangentTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosNormalTangentTexcoordVertex::ms_decl;
 
 
 struct PosTexCoord0Vertex
 struct PosTexCoord0Vertex
 {
 {
@@ -63,10 +63,10 @@ struct PosTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosTexCoord0Vertex::ms_decl;
 
 
 struct DebugVertex
 struct DebugVertex
 {
 {
@@ -84,10 +84,10 @@ struct DebugVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl DebugVertex::ms_decl;
+bgfx::VertexLayout DebugVertex::ms_decl;
 
 
 static PosNormalTangentTexcoordVertex s_cubeVertices[24] =
 static PosNormalTangentTexcoordVertex s_cubeVertices[24] =
 {
 {

+ 2 - 2
examples/22-windows/windows.cpp

@@ -33,10 +33,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 2 - 2
examples/23-vectordisplay/main.cpp

@@ -29,10 +29,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 class ExampleVectorDisplay : public entry::AppI
 class ExampleVectorDisplay : public entry::AppI
 {
 {

+ 1 - 1
examples/23-vectordisplay/vectordisplay.cpp

@@ -43,7 +43,7 @@ void PosColorUvVertex::init()
 		.end();
 		.end();
 }
 }
 
 
-bgfx::VertexDecl PosColorUvVertex::ms_decl;
+bgfx::VertexLayout PosColorUvVertex::ms_decl;
 
 
 inline float normalizef(float _a)
 inline float normalizef(float _a)
 {
 {

+ 1 - 1
examples/23-vectordisplay/vectordisplay.h

@@ -22,7 +22,7 @@ struct PosColorUvVertex
 	uint32_t m_abgr;
 	uint32_t m_abgr;
 
 
 	static void init();
 	static void init();
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
 class VectorDisplay
 class VectorDisplay

+ 2 - 2
examples/24-nbody/nbody.cpp

@@ -154,7 +154,7 @@ public:
 
 
 		if (m_computeSupported)
 		if (m_computeSupported)
 		{
 		{
-			bgfx::VertexDecl quadVertexDecl;
+			bgfx::VertexLayout quadVertexDecl;
 			quadVertexDecl.begin()
 			quadVertexDecl.begin()
 				.add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
 				.add(bgfx::Attrib::Position, 2, bgfx::AttribType::Float)
 				.end();
 				.end();
@@ -176,7 +176,7 @@ public:
 			m_particleProgram = loadProgram("vs_particle", "fs_particle");
 			m_particleProgram = loadProgram("vs_particle", "fs_particle");
 
 
 			// Setup compute buffers
 			// Setup compute buffers
-			bgfx::VertexDecl computeVertexDecl;
+			bgfx::VertexLayout computeVertexDecl;
 			computeVertexDecl.begin()
 			computeVertexDecl.begin()
 				.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 				.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 				.end();
 				.end();

+ 2 - 2
examples/26-occlusion/occlusion.cpp

@@ -29,10 +29,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[8] =
 static PosColorVertex s_cubeVertices[8] =
 {
 {

+ 2 - 2
examples/27-terrain/terrain.cpp

@@ -34,10 +34,10 @@ struct PosTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosTexCoord0Vertex::ms_decl;
 
 
 struct TerrainData
 struct TerrainData
 {
 {

+ 2 - 2
examples/31-rsm/reflectiveshadowmap.cpp

@@ -123,9 +123,9 @@ struct PosTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
-bgfx::VertexDecl PosTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosTexCoord0Vertex::ms_decl;
 
 
 // Utility function to draw a screen space quad for deferred rendering
 // Utility function to draw a screen space quad for deferred rendering
 void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)
 void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)

+ 2 - 2
examples/33-pom/pom.cpp

@@ -32,10 +32,10 @@ struct PosTangentBitangentTexcoordVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTangentBitangentTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosTangentBitangentTexcoordVertex::ms_decl;
 
 
 uint32_t packUint32(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w)
 uint32_t packUint32(uint8_t _x, uint8_t _y, uint8_t _z, uint8_t _w)
 {
 {

+ 4 - 4
examples/34-mvs/mvs.cpp

@@ -24,10 +24,10 @@ struct PosVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosVertex::ms_decl;
+bgfx::VertexLayout PosVertex::ms_decl;
 
 
 struct ColorVertex
 struct ColorVertex
 {
 {
@@ -41,10 +41,10 @@ struct ColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl ColorVertex::ms_decl;
+bgfx::VertexLayout ColorVertex::ms_decl;
 
 
 static PosVertex s_cubePosVertices[] =
 static PosVertex s_cubePosVertices[] =
 {
 {

+ 2 - 2
examples/35-dynamic/dynamic.cpp

@@ -31,10 +31,10 @@ struct PosColorVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorVertex::ms_decl;
+bgfx::VertexLayout PosColorVertex::ms_decl;
 
 
 static PosColorVertex s_cubeVertices[] =
 static PosColorVertex s_cubeVertices[] =
 {
 {

+ 3 - 3
examples/36-sky/sky.cpp

@@ -1,4 +1,4 @@
-/*
+/*
  * Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
  * Copyright 2017 Stanislav Pidhorskyi. All rights reserved.
  * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  * License: https://github.com/bkaradzic/bgfx#license-bsd-2-clause
  */
  */
@@ -310,10 +310,10 @@ namespace
 				.end();
 				.end();
 		}
 		}
 
 
-		static bgfx::VertexDecl ms_decl;
+		static bgfx::VertexLayout ms_decl;
 	};
 	};
 
 
-	bgfx::VertexDecl ScreenPosVertex::ms_decl;
+	bgfx::VertexLayout ScreenPosVertex::ms_decl;
 
 
 	// Renders a screen-space grid of triangles.
 	// Renders a screen-space grid of triangles.
 	// Because of performance reasons, and because sky color is smooth, sky color is computed in vertex shader.
 	// Because of performance reasons, and because sky color is smooth, sky color is computed in vertex shader.

+ 4 - 4
examples/37-gpudrivenrendering/gpudrivenrendering.cpp

@@ -199,10 +199,10 @@ struct PosVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosVertex::ms_decl;
+bgfx::VertexLayout PosVertex::ms_decl;
 
 
 static PosVertex s_cubeVertices[8] =
 static PosVertex s_cubeVertices[8] =
 {
 {
@@ -528,7 +528,7 @@ public:
 
 
 			//bounding box for each instance, will be fed to the compute shader to calculate occlusion
 			//bounding box for each instance, will be fed to the compute shader to calculate occlusion
 			{
 			{
-				bgfx::VertexDecl computeVertexDecl;
+				bgfx::VertexLayout computeVertexDecl;
 				computeVertexDecl.begin()
 				computeVertexDecl.begin()
 					.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 					.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 					.end();
 					.end();
@@ -562,7 +562,7 @@ public:
 
 
 			//pre and post occlusion culling instance data buffers
 			//pre and post occlusion culling instance data buffers
 			{
 			{
-				bgfx::VertexDecl instanceBufferVertexDecl;
+				bgfx::VertexLayout instanceBufferVertexDecl;
 				instanceBufferVertexDecl.begin()
 				instanceBufferVertexDecl.begin()
 					.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 					.add(bgfx::Attrib::TexCoord0, 4, bgfx::AttribType::Float)
 					.add(bgfx::Attrib::TexCoord1, 4, bgfx::AttribType::Float)
 					.add(bgfx::Attrib::TexCoord1, 4, bgfx::AttribType::Float)

+ 4 - 4
examples/38-bloom/bloom.cpp

@@ -49,10 +49,10 @@ struct PosVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosVertex::ms_decl;
+bgfx::VertexLayout PosVertex::ms_decl;
 
 
 struct PosTexCoord0Vertex
 struct PosTexCoord0Vertex
 {
 {
@@ -71,10 +71,10 @@ struct PosTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosTexCoord0Vertex::ms_decl;
 
 
 constexpr float cs = 0.29f;
 constexpr float cs = 0.29f;
 
 

+ 2 - 2
examples/39-assao/assao.cpp

@@ -78,10 +78,10 @@ namespace
 				.end();
 				.end();
 		}
 		}
 
 
-		static bgfx::VertexDecl ms_decl;
+		static bgfx::VertexLayout ms_decl;
 	};
 	};
 
 
-	bgfx::VertexDecl PosTexCoord0Vertex::ms_decl;
+	bgfx::VertexLayout PosTexCoord0Vertex::ms_decl;
 
 
 	// Utility function to draw a screen space quad for deferred rendering
 	// Utility function to draw a screen space quad for deferred rendering
 	void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)
 	void screenSpaceQuad(float _textureWidth, float _textureHeight, float _texelHalf, bool _originBottomLeft, float _width = 1.0f, float _height = 1.0f)

+ 2 - 2
examples/40-svt/svt.cpp

@@ -40,10 +40,10 @@ struct PosTexcoordVertex
 			.end();
 			.end();
 	};
 	};
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosTexcoordVertex::ms_decl;
+bgfx::VertexLayout PosTexcoordVertex::ms_decl;
 
 
 static const float s_planeScale = 50.0f;
 static const float s_planeScale = 50.0f;
 
 

+ 2 - 2
examples/41-tess/tess.cpp

@@ -872,11 +872,11 @@ namespace
 
 
 		bgfx::IndexBufferHandle m_geometryIndices;
 		bgfx::IndexBufferHandle m_geometryIndices;
 		bgfx::VertexBufferHandle m_geometryVertices;
 		bgfx::VertexBufferHandle m_geometryVertices;
-		bgfx::VertexDecl m_geometryDecl;
+		bgfx::VertexLayout m_geometryDecl;
 
 
 		bgfx::IndexBufferHandle m_instancedGeometryIndices;
 		bgfx::IndexBufferHandle m_instancedGeometryIndices;
 		bgfx::VertexBufferHandle m_instancedGeometryVertices;
 		bgfx::VertexBufferHandle m_instancedGeometryVertices;
-		bgfx::VertexDecl m_instancedGeometryDecl;
+		bgfx::VertexLayout m_instancedGeometryDecl;
 
 
 		bgfx::IndirectBufferHandle m_dispatchIndirect;
 		bgfx::IndirectBufferHandle m_dispatchIndirect;
 
 

+ 2 - 2
examples/common/bgfx_utils.cpp

@@ -258,7 +258,7 @@ bimg::ImageContainer* imageLoad(const char* _filePath, bgfx::TextureFormat::Enum
 	return bimg::imageParse(entry::getAllocator(), data, size, bimg::TextureFormat::Enum(_dstFormat) );
 	return bimg::imageParse(entry::getAllocator(), data, size, bimg::TextureFormat::Enum(_dstFormat) );
 }
 }
 
 
-void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 {
 {
 	struct PosTexcoord
 	struct PosTexcoord
 	{
 	{
@@ -375,7 +375,7 @@ void Group::reset()
 
 
 namespace bgfx
 namespace bgfx
 {
 {
-	int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 }
 }
 
 
 void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)
 void Mesh::load(bx::ReaderSeekerI* _reader, bool _ramcopy)

+ 3 - 3
examples/common/bgfx_utils.h

@@ -35,7 +35,7 @@ bgfx::TextureHandle loadTexture(const char* _name, uint64_t _flags = BGFX_TEXTUR
 bimg::ImageContainer* imageLoad(const char* _filePath, bgfx::TextureFormat::Enum _dstFormat);
 bimg::ImageContainer* imageLoad(const char* _filePath, bgfx::TextureFormat::Enum _dstFormat);
 
 
 ///
 ///
-void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices);
+void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices);
 
 
 /// Returns true if both internal transient index and vertex buffer have
 /// Returns true if both internal transient index and vertex buffer have
 /// enough space.
 /// enough space.
@@ -44,7 +44,7 @@ void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl
 /// @param[in] _decl Vertex declaration.
 /// @param[in] _decl Vertex declaration.
 /// @param[in] _numIndices Number of indices.
 /// @param[in] _numIndices Number of indices.
 ///
 ///
-inline bool checkAvailTransientBuffers(uint32_t _numVertices, const bgfx::VertexDecl& _decl, uint32_t _numIndices)
+inline bool checkAvailTransientBuffers(uint32_t _numVertices, const bgfx::VertexLayout& _decl, uint32_t _numIndices)
 {
 {
 	return _numVertices == bgfx::getAvailTransientVertexBuffer(_numVertices, _decl)
 	return _numVertices == bgfx::getAvailTransientVertexBuffer(_numVertices, _decl)
 		&& (0 == _numIndices || _numIndices == bgfx::getAvailTransientIndexBuffer(_numIndices) )
 		&& (0 == _numIndices || _numIndices == bgfx::getAvailTransientIndexBuffer(_numIndices) )
@@ -123,7 +123,7 @@ struct Mesh
 	void submit(bgfx::ViewId _id, bgfx::ProgramHandle _program, const float* _mtx, uint64_t _state) const;
 	void submit(bgfx::ViewId _id, bgfx::ProgramHandle _program, const float* _mtx, uint64_t _state) const;
 	void submit(const MeshState*const* _state, uint8_t _numPasses, const float* _mtx, uint16_t _numMatrices) const;
 	void submit(const MeshState*const* _state, uint8_t _numPasses, const float* _mtx, uint16_t _numMatrices) const;
 
 
-	bgfx::VertexDecl m_decl;
+	bgfx::VertexLayout m_decl;
 	GroupArray m_groups;
 	GroupArray m_groups;
 };
 };
 
 

+ 8 - 8
examples/common/debugdraw/debugdraw.cpp

@@ -37,10 +37,10 @@ struct DebugVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl DebugVertex::ms_decl;
+bgfx::VertexLayout DebugVertex::ms_decl;
 
 
 struct DebugUvVertex
 struct DebugUvVertex
 {
 {
@@ -61,10 +61,10 @@ struct DebugUvVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl DebugUvVertex::ms_decl;
+bgfx::VertexLayout DebugUvVertex::ms_decl;
 
 
 struct DebugShapeVertex
 struct DebugShapeVertex
 {
 {
@@ -82,10 +82,10 @@ struct DebugShapeVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl DebugShapeVertex::ms_decl;
+bgfx::VertexLayout DebugShapeVertex::ms_decl;
 
 
 struct DebugMeshVertex
 struct DebugMeshVertex
 {
 {
@@ -101,10 +101,10 @@ struct DebugMeshVertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl DebugMeshVertex::ms_decl;
+bgfx::VertexLayout DebugMeshVertex::ms_decl;
 
 
 static DebugShapeVertex s_quadVertices[4] =
 static DebugShapeVertex s_quadVertices[4] =
 {
 {

+ 1 - 1
examples/common/example-glue.cpp

@@ -350,7 +350,7 @@ void showExampleDialog(entry::AppI* _app, const char* _errorText)
 				resourceBar("  T", "Textures",               stats->numTextures,             caps->limits.maxTextures,             maxWidth, itemHeight);
 				resourceBar("  T", "Textures",               stats->numTextures,             caps->limits.maxTextures,             maxWidth, itemHeight);
 				resourceBar("  U", "Uniforms",               stats->numUniforms,             caps->limits.maxUniforms,             maxWidth, itemHeight);
 				resourceBar("  U", "Uniforms",               stats->numUniforms,             caps->limits.maxUniforms,             maxWidth, itemHeight);
 				resourceBar(" VB", "Vertex buffers",         stats->numVertexBuffers,        caps->limits.maxVertexBuffers,        maxWidth, itemHeight);
 				resourceBar(" VB", "Vertex buffers",         stats->numVertexBuffers,        caps->limits.maxVertexBuffers,        maxWidth, itemHeight);
-				resourceBar(" VD", "Vertex declarations",    stats->numVertexDecls,          caps->limits.maxVertexDecls,          maxWidth, itemHeight);
+				resourceBar(" VD", "Vertex declarations",    stats->numVertexLayouts,        caps->limits.maxVertexLayouts,        maxWidth, itemHeight);
 				ImGui::PopFont();
 				ImGui::PopFont();
 			}
 			}
 
 

+ 1 - 1
examples/common/font/text_buffer_manager.h

@@ -87,7 +87,7 @@ private:
 	BufferCache* m_textBuffers;
 	BufferCache* m_textBuffers;
 	bx::HandleAllocT<MAX_TEXT_BUFFER_COUNT> m_textBufferHandles;
 	bx::HandleAllocT<MAX_TEXT_BUFFER_COUNT> m_textBufferHandles;
 	FontManager* m_fontManager;
 	FontManager* m_fontManager;
-	bgfx::VertexDecl m_vertexDecl;
+	bgfx::VertexLayout m_vertexDecl;
 	bgfx::UniformHandle s_texColor;
 	bgfx::UniformHandle s_texColor;
 	bgfx::ProgramHandle m_basicProgram;
 	bgfx::ProgramHandle m_basicProgram;
 	bgfx::ProgramHandle m_distanceProgram;
 	bgfx::ProgramHandle m_distanceProgram;

+ 1 - 1
examples/common/imgui/imgui.cpp

@@ -391,7 +391,7 @@ struct OcornutImguiContext
 
 
 	ImGuiContext*       m_imgui;
 	ImGuiContext*       m_imgui;
 	bx::AllocatorI*     m_allocator;
 	bx::AllocatorI*     m_allocator;
-	bgfx::VertexDecl    m_decl;
+	bgfx::VertexLayout    m_decl;
 	bgfx::ProgramHandle m_program;
 	bgfx::ProgramHandle m_program;
 	bgfx::ProgramHandle m_imageProgram;
 	bgfx::ProgramHandle m_imageProgram;
 	bgfx::TextureHandle m_texture;
 	bgfx::TextureHandle m_texture;

+ 1 - 1
examples/common/nanovg/nanovg_bgfx.cpp

@@ -48,7 +48,7 @@ static const bgfx::EmbeddedShader s_embeddedShaders[] =
 
 
 namespace
 namespace
 {
 {
-	static bgfx::VertexDecl s_nvgDecl;
+	static bgfx::VertexLayout s_nvgDecl;
 
 
 	enum GLNVGshaderType
 	enum GLNVGshaderType
 	{
 	{

+ 2 - 2
examples/common/ps/particle_system.cpp

@@ -45,10 +45,10 @@ struct PosColorTexCoord0Vertex
 			.end();
 			.end();
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosColorTexCoord0Vertex::ms_decl;
+bgfx::VertexLayout PosColorTexCoord0Vertex::ms_decl;
 
 
 void EmitterUniforms::reset()
 void EmitterUniforms::reset()
 {
 {

+ 53 - 53
include/bgfx/bgfx.h

@@ -403,7 +403,7 @@ namespace bgfx
 	BGFX_HANDLE(TextureHandle)
 	BGFX_HANDLE(TextureHandle)
 	BGFX_HANDLE(UniformHandle)
 	BGFX_HANDLE(UniformHandle)
 	BGFX_HANDLE(VertexBufferHandle)
 	BGFX_HANDLE(VertexBufferHandle)
-	BGFX_HANDLE(VertexDeclHandle)
+	BGFX_HANDLE(VertexLayoutHandle)
 
 
 	/// Callback interface to implement application specific behavior.
 	/// Callback interface to implement application specific behavior.
 	/// Cached items are currently used for OpenGL and Direct3D 12 binary
 	/// Cached items are currently used for OpenGL and Direct3D 12 binary
@@ -754,7 +754,7 @@ namespace bgfx
 			uint32_t maxTextures;             //!< Maximum number of texture handles.
 			uint32_t maxTextures;             //!< Maximum number of texture handles.
 			uint32_t maxTextureSamplers;      //!< Maximum number of texture samplers.
 			uint32_t maxTextureSamplers;      //!< Maximum number of texture samplers.
 			uint32_t maxComputeBindings;      //!< Maximum number of compute bindings.
 			uint32_t maxComputeBindings;      //!< Maximum number of compute bindings.
-			uint32_t maxVertexDecls;          //!< Maximum number of vertex format declarations.
+			uint32_t maxVertexLayouts;        //!< Maximum number of vertex format layouts.
 			uint32_t maxVertexStreams;        //!< Maximum number of vertex streams.
 			uint32_t maxVertexStreams;        //!< Maximum number of vertex streams.
 			uint32_t maxIndexBuffers;         //!< Maximum number of index buffer handles.
 			uint32_t maxIndexBuffers;         //!< Maximum number of index buffer handles.
 			uint32_t maxVertexBuffers;        //!< Maximum number of vertex buffer handles.
 			uint32_t maxVertexBuffers;        //!< Maximum number of vertex buffer handles.
@@ -816,7 +816,7 @@ namespace bgfx
 		uint32_t startVertex;      //!< First vertex.
 		uint32_t startVertex;      //!< First vertex.
 		uint16_t stride;           //!< Vertex stride.
 		uint16_t stride;           //!< Vertex stride.
 		VertexBufferHandle handle; //!< Vertex buffer handle.
 		VertexBufferHandle handle; //!< Vertex buffer handle.
-		VertexDeclHandle decl;     //!< Vertex declaration handle.
+		VertexLayoutHandle decl;   //!< Vertex layout handle.
 	};
 	};
 
 
 	/// Instance data buffer info.
 	/// Instance data buffer info.
@@ -961,7 +961,7 @@ namespace bgfx
 		uint16_t numTextures;               //!< Number of used textures.
 		uint16_t numTextures;               //!< Number of used textures.
 		uint16_t numUniforms;               //!< Number of used uniforms.
 		uint16_t numUniforms;               //!< Number of used uniforms.
 		uint16_t numVertexBuffers;          //!< Number of used vertex buffers.
 		uint16_t numVertexBuffers;          //!< Number of used vertex buffers.
-		uint16_t numVertexDecls;            //!< Number of used vertex declarations.
+		uint16_t numVertexLayouts;          //!< Number of used vertex layouts.
 
 
 		int64_t textureMemoryUsed;          //!< Estimate of texture memory used.
 		int64_t textureMemoryUsed;          //!< Estimate of texture memory used.
 		int64_t rtMemoryUsed;               //!< Estimate of render target memory used.
 		int64_t rtMemoryUsed;               //!< Estimate of render target memory used.
@@ -1225,7 +1225,7 @@ namespace bgfx
 		/// @param[in] _handle Vertex buffer.
 		/// @param[in] _handle Vertex buffer.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _numVertices Number of vertices to render.
 		/// @param[in] _numVertices Number of vertices to render.
-		/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+		/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_encoder_set_vertex_buffer`.
 		/// @attention C99 equivalent is `bgfx_encoder_set_vertex_buffer`.
 		///
 		///
@@ -1234,7 +1234,7 @@ namespace bgfx
 			, VertexBufferHandle _handle
 			, VertexBufferHandle _handle
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+			, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 			);
 			);
 
 
 		/// Set vertex buffer for draw primitive.
 		/// Set vertex buffer for draw primitive.
@@ -1255,7 +1255,7 @@ namespace bgfx
 		/// @param[in] _handle Dynamic vertex buffer.
 		/// @param[in] _handle Dynamic vertex buffer.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _numVertices Number of vertices to render.
 		/// @param[in] _numVertices Number of vertices to render.
-		/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+		/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_encoder_set_dynamic_vertex_buffer`.
 		/// @attention C99 equivalent is `bgfx_encoder_set_dynamic_vertex_buffer`.
 		///
 		///
@@ -1264,7 +1264,7 @@ namespace bgfx
 			, DynamicVertexBufferHandle _handle
 			, DynamicVertexBufferHandle _handle
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+			, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 			);
 			);
 
 
 		/// Set vertex buffer for draw primitive.
 		/// Set vertex buffer for draw primitive.
@@ -1285,7 +1285,7 @@ namespace bgfx
 		/// @param[in] _tvb Transient vertex buffer.
 		/// @param[in] _tvb Transient vertex buffer.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _startVertex First vertex to render.
 		/// @param[in] _numVertices Number of vertices to render.
 		/// @param[in] _numVertices Number of vertices to render.
-		/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+		/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_encoder_set_transient_vertex_buffer`.
 		/// @attention C99 equivalent is `bgfx_encoder_set_transient_vertex_buffer`.
 		///
 		///
@@ -1294,7 +1294,7 @@ namespace bgfx
 			, const TransientVertexBuffer* _tvb
 			, const TransientVertexBuffer* _tvb
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+			, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 			);
 			);
 
 
 		/// Set number of vertices for auto generated vertices use in conjuction
 		/// Set number of vertices for auto generated vertices use in conjuction
@@ -1662,27 +1662,27 @@ namespace bgfx
 			);
 			);
 	};
 	};
 
 
-	/// Vertex declaration.
+	/// Vertex layout.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_vertex_decl_t`.
 	/// @attention C99 equivalent is `bgfx_vertex_decl_t`.
 	///
 	///
-	struct VertexDecl
+	struct VertexLayout
 	{
 	{
-		VertexDecl();
+		VertexLayout();
 
 
-		/// Start VertexDecl.
+		/// Start VertexLayout.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_vertex_decl_begin`.
 		/// @attention C99 equivalent is `bgfx_vertex_decl_begin`.
 		///
 		///
-		VertexDecl& begin(RendererType::Enum _renderer = RendererType::Noop);
+		VertexLayout& begin(RendererType::Enum _renderer = RendererType::Noop);
 
 
-		/// End VertexDecl.
+		/// End VertexLayout.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_vertex_decl_end`.
 		/// @attention C99 equivalent is `bgfx_vertex_decl_end`.
 		///
 		///
 		void end();
 		void end();
 
 
-		/// Add attribute to VertexDecl.
+		/// Add attribute to VertexLayout.
 		///
 		///
 		/// @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
 		/// @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
 		/// @param[in] _num Number of elements 1, 2, 3 or 4.
 		/// @param[in] _num Number of elements 1, 2, 3 or 4.
@@ -1700,7 +1700,7 @@ namespace bgfx
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_vertex_decl_add`.
 		/// @attention C99 equivalent is `bgfx_vertex_decl_add`.
 		///
 		///
-		VertexDecl& add(
+		VertexLayout& add(
 			  Attrib::Enum _attrib
 			  Attrib::Enum _attrib
 			, uint8_t _num
 			, uint8_t _num
 			, AttribType::Enum _type
 			, AttribType::Enum _type
@@ -1712,7 +1712,7 @@ namespace bgfx
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_vertex_decl_skip`.
 		/// @attention C99 equivalent is `bgfx_vertex_decl_skip`.
 		///
 		///
-		VertexDecl& skip(uint8_t _num);
+		VertexLayout& skip(uint8_t _num);
 
 
 		/// Decode attribute.
 		/// Decode attribute.
 		///
 		///
@@ -1726,7 +1726,7 @@ namespace bgfx
 			, bool& _asInt
 			, bool& _asInt
 			) const;
 			) const;
 
 
-		/// Returns true if VertexDecl contains attribute.
+		/// Returns true if VertexLayout contains attribute.
 		///
 		///
 		/// @attention C99 equivalent is `bgfx_vertex_decl_has`.
 		/// @attention C99 equivalent is `bgfx_vertex_decl_has`.
 		///
 		///
@@ -1752,7 +1752,7 @@ namespace bgfx
 	/// @param[in] _input Value to be packed into vertex stream.
 	/// @param[in] _input Value to be packed into vertex stream.
 	/// @param[in] _inputNormalized True if input value is already normalized.
 	/// @param[in] _inputNormalized True if input value is already normalized.
 	/// @param[in] _attr Attribute to pack.
 	/// @param[in] _attr Attribute to pack.
-	/// @param[in] _decl Vertex stream declaration.
+	/// @param[in] _decl Vertex stream layout.
 	/// @param[in] _data Destination vertex stream where data will be packed.
 	/// @param[in] _data Destination vertex stream where data will be packed.
 	/// @param[in] _index Vertex index that will be modified.
 	/// @param[in] _index Vertex index that will be modified.
 	///
 	///
@@ -1762,7 +1762,7 @@ namespace bgfx
 		  const float _input[4]
 		  const float _input[4]
 		, bool _inputNormalized
 		, bool _inputNormalized
 		, Attrib::Enum _attr
 		, Attrib::Enum _attr
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, void* _data
 		, void* _data
 		, uint32_t _index = 0
 		, uint32_t _index = 0
 		);
 		);
@@ -1771,7 +1771,7 @@ namespace bgfx
 	///
 	///
 	/// @param[out] _output Result of unpacking.
 	/// @param[out] _output Result of unpacking.
 	/// @param[in]  _attr Attribute to unpack.
 	/// @param[in]  _attr Attribute to unpack.
-	/// @param[in]  _decl Vertex stream declaration.
+	/// @param[in]  _decl Vertex stream layout.
 	/// @param[in]  _data Source vertex stream from where data will be unpacked.
 	/// @param[in]  _data Source vertex stream from where data will be unpacked.
 	/// @param[in]  _index Vertex index that will be unpacked.
 	/// @param[in]  _index Vertex index that will be unpacked.
 	///
 	///
@@ -1780,25 +1780,25 @@ namespace bgfx
 	void vertexUnpack(
 	void vertexUnpack(
 		  float _output[4]
 		  float _output[4]
 		, Attrib::Enum _attr
 		, Attrib::Enum _attr
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, const void* _data
 		, const void* _data
 		, uint32_t _index = 0
 		, uint32_t _index = 0
 		);
 		);
 
 
 	/// Converts vertex stream data from one vertex stream format to another.
 	/// Converts vertex stream data from one vertex stream format to another.
 	///
 	///
-	/// @param[in] _destDecl Destination vertex stream declaration.
+	/// @param[in] _destDecl Destination vertex stream layout.
 	/// @param[in] _destData Destination vertex stream.
 	/// @param[in] _destData Destination vertex stream.
-	/// @param[in] _srcDecl Source vertex stream declaration.
+	/// @param[in] _srcDecl Source vertex stream layout.
 	/// @param[in] _srcData Source vertex stream data.
 	/// @param[in] _srcData Source vertex stream data.
 	/// @param[in] _num Number of vertices to convert from source to destination.
 	/// @param[in] _num Number of vertices to convert from source to destination.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_vertex_convert`.
 	/// @attention C99 equivalent is `bgfx_vertex_convert`.
 	///
 	///
 	void vertexConvert(
 	void vertexConvert(
-		  const VertexDecl& _destDecl
+		  const VertexLayout& _destDecl
 		, void* _destData
 		, void* _destData
-		, const VertexDecl& _srcDecl
+		, const VertexLayout& _srcDecl
 		, const void* _srcData
 		, const void* _srcData
 		, uint32_t _num = 1
 		, uint32_t _num = 1
 		);
 		);
@@ -1807,7 +1807,7 @@ namespace bgfx
 	///
 	///
 	/// @param[in] _output Welded vertices remapping table. The size of buffer
 	/// @param[in] _output Welded vertices remapping table. The size of buffer
 	///   must be the same as number of vertices.
 	///   must be the same as number of vertices.
-	/// @param[in] _decl Vertex stream declaration.
+	/// @param[in] _decl Vertex stream layout.
 	/// @param[in] _data Vertex stream.
 	/// @param[in] _data Vertex stream.
 	/// @param[in] _num Number of vertices in vertex stream.
 	/// @param[in] _num Number of vertices in vertex stream.
 	/// @param[in] _epsilon Error tolerance for vertex position comparison.
 	/// @param[in] _epsilon Error tolerance for vertex position comparison.
@@ -1817,7 +1817,7 @@ namespace bgfx
 	///
 	///
 	uint16_t weldVertices(
 	uint16_t weldVertices(
 		  uint16_t* _output
 		  uint16_t* _output
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, const void* _data
 		, const void* _data
 		, uint16_t _num
 		, uint16_t _num
 		, float _epsilon = 0.001f
 		, float _epsilon = 0.001f
@@ -2166,22 +2166,22 @@ namespace bgfx
 	///
 	///
 	void destroy(IndexBufferHandle _handle);
 	void destroy(IndexBufferHandle _handle);
 
 
-	/// Create vertex declaration.
+	/// Create vertex layout.
 	///
 	///
-	/// @attention C99 equivalent is `bgfx_create_vertex_decl`.
+	/// @attention C99 equivalent is `bgfx_create_vertex_layout`.
 	///
 	///
-	VertexDeclHandle createVertexDecl(const VertexDecl& _decl);
+	VertexLayoutHandle createVertexLayout(const VertexLayout& _decl);
 
 
-	/// Destroy vertex declaration.
+	/// Destroy vertex layout.
 	///
 	///
-	/// @attention C99 equivalent is `bgfx_destroy_vertex_decl`.
+	/// @attention C99 equivalent is `bgfx_destroy_vertex_layout`.
 	///
 	///
-	void destroy(VertexDeclHandle _handle);
+	void destroy(VertexLayoutHandle _handle);
 
 
 	/// Create static vertex buffer.
 	/// Create static vertex buffer.
 	///
 	///
 	/// @param[in] _mem Vertex buffer data.
 	/// @param[in] _mem Vertex buffer data.
-	/// @param[in] _decl Vertex declaration.
+	/// @param[in] _decl Vertex layout.
 	/// @param[in] _flags Buffer creation flags.
 	/// @param[in] _flags Buffer creation flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -2200,7 +2200,7 @@ namespace bgfx
 	///
 	///
 	VertexBufferHandle createVertexBuffer(
 	VertexBufferHandle createVertexBuffer(
 		  const Memory* _mem
 		  const Memory* _mem
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		);
 		);
 
 
@@ -2300,7 +2300,7 @@ namespace bgfx
 	/// Create empty dynamic vertex buffer.
 	/// Create empty dynamic vertex buffer.
 	///
 	///
 	/// @param[in] _num Number of vertices.
 	/// @param[in] _num Number of vertices.
-	/// @param[in] _decl Vertex declaration.
+	/// @param[in] _decl Vertex layout.
 	/// @param[in] _flags Buffer creation flags.
 	/// @param[in] _flags Buffer creation flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -2319,14 +2319,14 @@ namespace bgfx
 	///
 	///
 	DynamicVertexBufferHandle createDynamicVertexBuffer(
 	DynamicVertexBufferHandle createDynamicVertexBuffer(
 		  uint32_t _num
 		  uint32_t _num
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		);
 		);
 
 
 	/// Create dynamic vertex buffer and initialize it.
 	/// Create dynamic vertex buffer and initialize it.
 	///
 	///
 	/// @param[in] _mem Vertex buffer data.
 	/// @param[in] _mem Vertex buffer data.
-	/// @param[in] _decl Vertex declaration.
+	/// @param[in] _decl Vertex layout.
 	/// @param[in] _flags Buffer creation flags.
 	/// @param[in] _flags Buffer creation flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_NONE` - No flags.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	///   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -2345,7 +2345,7 @@ namespace bgfx
 	///
 	///
 	DynamicVertexBufferHandle createDynamicVertexBuffer(
 	DynamicVertexBufferHandle createDynamicVertexBuffer(
 		  const Memory* _mem
 		  const Memory* _mem
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		, uint16_t _flags = BGFX_BUFFER_NONE
 		);
 		);
 
 
@@ -2382,13 +2382,13 @@ namespace bgfx
 	/// Returns number of requested or maximum available vertices.
 	/// Returns number of requested or maximum available vertices.
 	///
 	///
 	/// @param[in] _num Number of required vertices.
 	/// @param[in] _num Number of required vertices.
-	/// @param[in] _decl Vertex declaration.
+	/// @param[in] _decl Vertex layout.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_get_avail_transient_vertex_buffer`.
 	/// @attention C99 equivalent is `bgfx_get_avail_transient_vertex_buffer`.
 	///
 	///
 	uint32_t getAvailTransientVertexBuffer(
 	uint32_t getAvailTransientVertexBuffer(
 		  uint32_t _num
 		  uint32_t _num
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		);
 		);
 
 
 	/// Returns number of requested or maximum available instance buffer slots.
 	/// Returns number of requested or maximum available instance buffer slots.
@@ -2426,14 +2426,14 @@ namespace bgfx
 	///   for the duration of frame, and it can be reused for multiple draw
 	///   for the duration of frame, and it can be reused for multiple draw
 	///   calls.
 	///   calls.
 	/// @param[in] _num Number of vertices to allocate.
 	/// @param[in] _num Number of vertices to allocate.
-	/// @param[in] _decl Vertex declaration.
+	/// @param[in] _decl Vertex layout.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_alloc_transient_vertex_buffer`.
 	/// @attention C99 equivalent is `bgfx_alloc_transient_vertex_buffer`.
 	///
 	///
 	void allocTransientVertexBuffer(
 	void allocTransientVertexBuffer(
 		  TransientVertexBuffer* _tvb
 		  TransientVertexBuffer* _tvb
 		, uint32_t _num
 		, uint32_t _num
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		);
 		);
 
 
 	/// Check for required space and allocate transient vertex and index
 	/// Check for required space and allocate transient vertex and index
@@ -2447,7 +2447,7 @@ namespace bgfx
 	///
 	///
 	bool allocTransientBuffers(
 	bool allocTransientBuffers(
 		  TransientVertexBuffer* _tvb
 		  TransientVertexBuffer* _tvb
-		, const VertexDecl& _decl
+		, const VertexLayout& _decl
 		, uint32_t _numVertices
 		, uint32_t _numVertices
 		, TransientIndexBuffer* _tib
 		, TransientIndexBuffer* _tib
 		, uint32_t _numIndices
 		, uint32_t _numIndices
@@ -3621,7 +3621,7 @@ namespace bgfx
 	/// @param[in] _handle Vertex buffer.
 	/// @param[in] _handle Vertex buffer.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _numVertices Number of vertices to render.
 	/// @param[in] _numVertices Number of vertices to render.
-	/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+	/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
 	/// @attention C99 equivalent is `bgfx_set_vertex_buffer`.
 	///
 	///
@@ -3630,7 +3630,7 @@ namespace bgfx
 		, VertexBufferHandle _handle
 		, VertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+		, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 		);
 		);
 
 
 	/// Set vertex buffer for draw primitive.
 	/// Set vertex buffer for draw primitive.
@@ -3651,7 +3651,7 @@ namespace bgfx
 	/// @param[in] _handle Dynamic vertex buffer.
 	/// @param[in] _handle Dynamic vertex buffer.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _numVertices Number of vertices to render.
 	/// @param[in] _numVertices Number of vertices to render.
-	/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+	/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_set_dynamic_vertex_buffer`.
 	/// @attention C99 equivalent is `bgfx_set_dynamic_vertex_buffer`.
 	///
 	///
@@ -3660,7 +3660,7 @@ namespace bgfx
 		, DynamicVertexBufferHandle _handle
 		, DynamicVertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+		, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 		);
 		);
 
 
 	/// Set vertex buffer for draw primitive.
 	/// Set vertex buffer for draw primitive.
@@ -3681,7 +3681,7 @@ namespace bgfx
 	/// @param[in] _tvb Transient vertex buffer.
 	/// @param[in] _tvb Transient vertex buffer.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _startVertex First vertex to render.
 	/// @param[in] _numVertices Number of vertices to render.
 	/// @param[in] _numVertices Number of vertices to render.
-	/// @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+	/// @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
 	///
 	///
 	/// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
 	/// @attention C99 equivalent is `bgfx_set_transient_vertex_buffer`.
 	///
 	///
@@ -3690,7 +3690,7 @@ namespace bgfx
 		, const TransientVertexBuffer* _tvb
 		, const TransientVertexBuffer* _tvb
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle = BGFX_INVALID_HANDLE
+		, VertexLayoutHandle _declHandle = BGFX_INVALID_HANDLE
 		);
 		);
 
 
 	/// Set number of vertices for auto generated vertices use in conjuction
 	/// Set number of vertices for auto generated vertices use in conjuction

+ 79 - 79
include/bgfx/c99/bgfx.h

@@ -460,7 +460,7 @@ typedef struct bgfx_uniform_handle_s { uint16_t idx; } bgfx_uniform_handle_t;
 
 
 typedef struct bgfx_vertex_buffer_handle_s { uint16_t idx; } bgfx_vertex_buffer_handle_t;
 typedef struct bgfx_vertex_buffer_handle_s { uint16_t idx; } bgfx_vertex_buffer_handle_t;
 
 
-typedef struct bgfx_vertex_decl_handle_s { uint16_t idx; } bgfx_vertex_decl_handle_t;
+typedef struct bgfx_vertex_layout_handle_s { uint16_t idx; } bgfx_vertex_layout_handle_t;
 
 
 
 
 #define BGFX_HANDLE_IS_VALID(h) ((h).idx != UINT16_MAX)
 #define BGFX_HANDLE_IS_VALID(h) ((h).idx != UINT16_MAX)
@@ -503,7 +503,7 @@ typedef struct bgfx_caps_limits_s
     uint32_t             maxTextures;        /** Maximum number of texture handles.       */
     uint32_t             maxTextures;        /** Maximum number of texture handles.       */
     uint32_t             maxTextureSamplers; /** Maximum number of texture samplers.      */
     uint32_t             maxTextureSamplers; /** Maximum number of texture samplers.      */
     uint32_t             maxComputeBindings; /** Maximum number of compute bindings.      */
     uint32_t             maxComputeBindings; /** Maximum number of compute bindings.      */
-    uint32_t             maxVertexDecls;     /** Maximum number of vertex format declarations. */
+    uint32_t             maxVertexLayouts;   /** Maximum number of vertex format layouts. */
     uint32_t             maxVertexStreams;   /** Maximum number of vertex streams.        */
     uint32_t             maxVertexStreams;   /** Maximum number of vertex streams.        */
     uint32_t             maxIndexBuffers;    /** Maximum number of index buffer handles.  */
     uint32_t             maxIndexBuffers;    /** Maximum number of index buffer handles.  */
     uint32_t             maxVertexBuffers;   /** Maximum number of vertex buffer handles. */
     uint32_t             maxVertexBuffers;   /** Maximum number of vertex buffer handles. */
@@ -700,7 +700,7 @@ typedef struct bgfx_transient_vertex_buffer_s
     uint32_t             startVertex;        /** First vertex.                            */
     uint32_t             startVertex;        /** First vertex.                            */
     uint16_t             stride;             /** Vertex stride.                           */
     uint16_t             stride;             /** Vertex stride.                           */
     bgfx_vertex_buffer_handle_t handle;      /** Vertex buffer handle.                    */
     bgfx_vertex_buffer_handle_t handle;      /** Vertex buffer handle.                    */
-    bgfx_vertex_decl_handle_t decl;          /** Vertex declaration handle.               */
+    bgfx_vertex_layout_handle_t decl;        /** Vertex layout handle.                    */
 
 
 } bgfx_transient_vertex_buffer_t;
 } bgfx_transient_vertex_buffer_t;
 
 
@@ -829,7 +829,7 @@ typedef struct bgfx_stats_s
     uint16_t             numTextures;        /** Number of used textures.                 */
     uint16_t             numTextures;        /** Number of used textures.                 */
     uint16_t             numUniforms;        /** Number of used uniforms.                 */
     uint16_t             numUniforms;        /** Number of used uniforms.                 */
     uint16_t             numVertexBuffers;   /** Number of used vertex buffers.           */
     uint16_t             numVertexBuffers;   /** Number of used vertex buffers.           */
-    uint16_t             numVertexDecls;     /** Number of used vertex declarations.      */
+    uint16_t             numVertexLayouts;   /** Number of used vertex layouts.           */
     int64_t              textureMemoryUsed;  /** Estimate of texture memory used.         */
     int64_t              textureMemoryUsed;  /** Estimate of texture memory used.         */
     int64_t              rtMemoryUsed;       /** Estimate of render target memory used.   */
     int64_t              rtMemoryUsed;       /** Estimate of render target memory used.   */
     int32_t              transientVbUsed;    /** Amount of transient vertex buffer used.  */
     int32_t              transientVbUsed;    /** Amount of transient vertex buffer used.  */
@@ -849,17 +849,17 @@ typedef struct bgfx_stats_s
 } bgfx_stats_t;
 } bgfx_stats_t;
 
 
 /**
 /**
- * Vertex declaration.
+ * Vertex layout.
  *
  *
  */
  */
-typedef struct bgfx_vertex_decl_s
+typedef struct bgfx_vertex_layout_s
 {
 {
     uint32_t             hash;               /** Hash.                                    */
     uint32_t             hash;               /** Hash.                                    */
     uint16_t             stride;             /** Stride.                                  */
     uint16_t             stride;             /** Stride.                                  */
     uint16_t             offset[BGFX_ATTRIB_COUNT]; /** Attribute offsets.                       */
     uint16_t             offset[BGFX_ATTRIB_COUNT]; /** Attribute offsets.                       */
     uint16_t             attributes[BGFX_ATTRIB_COUNT]; /** Used attributes.                         */
     uint16_t             attributes[BGFX_ATTRIB_COUNT]; /** Used attributes.                         */
 
 
-} bgfx_vertex_decl_t;
+} bgfx_vertex_layout_t;
 
 
 /**
 /**
  * Encoders are used for submitting draw calls from multiple threads. Only one encoder
  * Encoders are used for submitting draw calls from multiple threads. Only one encoder
@@ -884,15 +884,15 @@ typedef struct bgfx_encoder_s bgfx_encoder_t;
 BGFX_C_API void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, uint16_t _layer, uint16_t _mip, uint8_t _resolve);
 BGFX_C_API void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, uint16_t _layer, uint16_t _mip, uint8_t _resolve);
 
 
 /**
 /**
- * Start VertexDecl.
+ * Start VertexLayout.
  *
  *
  * @param[in] _rendererType
  * @param[in] _rendererType
  *
  *
  */
  */
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _this, bgfx_renderer_type_t _rendererType);
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_begin(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
 
 
 /**
 /**
- * Add attribute to VertexDecl.
+ * Add attribute to VertexLayout.
  * @remarks Must be called between begin/end.
  * @remarks Must be called between begin/end.
  *
  *
  * @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
  * @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
@@ -907,7 +907,7 @@ BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _this,
  *  Unpacking code must be implemented inside vertex shader.
  *  Unpacking code must be implemented inside vertex shader.
  *
  *
  */
  */
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_add(bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
 
 
 /**
 /**
  * Decode attribute.
  * Decode attribute.
@@ -919,15 +919,15 @@ BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_add(bgfx_vertex_decl_t* _this, b
  * @param[out] _asInt Attribute is packed as int.
  * @param[out] _asInt Attribute is packed as int.
  *
  *
  */
  */
-BGFX_C_API void bgfx_vertex_decl_decode(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt);
+BGFX_C_API void bgfx_vertex_layout_decode(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt);
 
 
 /**
 /**
- * Returns true if VertexDecl contains attribute.
+ * Returns true if VertexLayout contains attribute.
  *
  *
  * @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
  * @param[in] _attrib Attribute semantics. See: `bgfx::Attrib`
  *
  *
  */
  */
-BGFX_C_API bool bgfx_vertex_decl_has(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib);
+BGFX_C_API bool bgfx_vertex_layout_has(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib);
 
 
 /**
 /**
  * Skip `_num` bytes in vertex stream.
  * Skip `_num` bytes in vertex stream.
@@ -935,13 +935,13 @@ BGFX_C_API bool bgfx_vertex_decl_has(const bgfx_vertex_decl_t* _this, bgfx_attri
  * @param[in] _num
  * @param[in] _num
  *
  *
  */
  */
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_skip(bgfx_vertex_decl_t* _this, uint8_t _num);
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, uint8_t _num);
 
 
 /**
 /**
- * End VertexDecl.
+ * End VertexLayout.
  *
  *
  */
  */
-BGFX_C_API void bgfx_vertex_decl_end(bgfx_vertex_decl_t* _this);
+BGFX_C_API void bgfx_vertex_layout_end(bgfx_vertex_layout_t* _this);
 
 
 /**
 /**
  * Pack vertex attribute into vertex stream format.
  * Pack vertex attribute into vertex stream format.
@@ -949,43 +949,43 @@ BGFX_C_API void bgfx_vertex_decl_end(bgfx_vertex_decl_t* _this);
  * @param[in] _input Value to be packed into vertex stream.
  * @param[in] _input Value to be packed into vertex stream.
  * @param[in] _inputNormalized `true` if input value is already normalized.
  * @param[in] _inputNormalized `true` if input value is already normalized.
  * @param[in] _attr Attribute to pack.
  * @param[in] _attr Attribute to pack.
- * @param[in] _decl Vertex stream declaration.
+ * @param[in] _decl Vertex stream layout.
  * @param[in] _data Destination vertex stream where data will be packed.
  * @param[in] _data Destination vertex stream where data will be packed.
  * @param[in] _index Vertex index that will be modified.
  * @param[in] _index Vertex index that will be modified.
  *
  *
  */
  */
-BGFX_C_API void bgfx_vertex_pack(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, void* _data, uint32_t _index);
+BGFX_C_API void bgfx_vertex_pack(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, void* _data, uint32_t _index);
 
 
 /**
 /**
  * Unpack vertex attribute from vertex stream format.
  * Unpack vertex attribute from vertex stream format.
  *
  *
  * @param[out] _output Result of unpacking.
  * @param[out] _output Result of unpacking.
  * @param[in] _attr Attribute to unpack.
  * @param[in] _attr Attribute to unpack.
- * @param[in] _decl Vertex stream declaration.
+ * @param[in] _decl Vertex stream layout.
  * @param[in] _data Source vertex stream from where data will be unpacked.
  * @param[in] _data Source vertex stream from where data will be unpacked.
  * @param[in] _index Vertex index that will be unpacked.
  * @param[in] _index Vertex index that will be unpacked.
  *
  *
  */
  */
-BGFX_C_API void bgfx_vertex_unpack(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, const void* _data, uint32_t _index);
+BGFX_C_API void bgfx_vertex_unpack(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, const void* _data, uint32_t _index);
 
 
 /**
 /**
  * Converts vertex stream data from one vertex stream format to another.
  * Converts vertex stream data from one vertex stream format to another.
  *
  *
- * @param[in] _dstDecl Destination vertex stream declaration.
+ * @param[in] _dstDecl Destination vertex stream layout.
  * @param[in] _dstData Destination vertex stream.
  * @param[in] _dstData Destination vertex stream.
- * @param[in] _srcDecl Source vertex stream declaration.
+ * @param[in] _srcDecl Source vertex stream layout.
  * @param[in] _srcData Source vertex stream data.
  * @param[in] _srcData Source vertex stream data.
  * @param[in] _num Number of vertices to convert from source to destination.
  * @param[in] _num Number of vertices to convert from source to destination.
  *
  *
  */
  */
-BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_decl_t * _dstDecl, void* _dstData, const bgfx_vertex_decl_t * _srcDecl, const void* _srcData, uint32_t _num);
+BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_layout_t * _dstDecl, void* _dstData, const bgfx_vertex_layout_t * _srcDecl, const void* _srcData, uint32_t _num);
 
 
 /**
 /**
  * Weld vertices.
  * Weld vertices.
  *
  *
  * @param[in] _output Welded vertices remapping table. The size of buffer
  * @param[in] _output Welded vertices remapping table. The size of buffer
  *  must be the same as number of vertices.
  *  must be the same as number of vertices.
- * @param[in] _decl Vertex stream declaration.
+ * @param[in] _decl Vertex stream layout.
  * @param[in] _data Vertex stream.
  * @param[in] _data Vertex stream.
  * @param[in] _num Number of vertices in vertex stream.
  * @param[in] _num Number of vertices in vertex stream.
  * @param[in] _epsilon Error tolerance for vertex position comparison.
  * @param[in] _epsilon Error tolerance for vertex position comparison.
@@ -993,7 +993,7 @@ BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_decl_t * _dstDecl, void* _
  * @returns Number of unique vertices after vertex welding.
  * @returns Number of unique vertices after vertex welding.
  *
  *
  */
  */
-BGFX_C_API uint16_t bgfx_weld_vertices(uint16_t* _output, const bgfx_vertex_decl_t * _decl, const void* _data, uint16_t _num, float _epsilon);
+BGFX_C_API uint16_t bgfx_weld_vertices(uint16_t* _output, const bgfx_vertex_layout_t * _decl, const void* _data, uint16_t _num, float _epsilon);
 
 
 /**
 /**
  * Convert index buffer for use with different primitive topologies.
  * Convert index buffer for use with different primitive topologies.
@@ -1294,26 +1294,26 @@ BGFX_C_API void bgfx_set_index_buffer_name(bgfx_index_buffer_handle_t _handle, c
 BGFX_C_API void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle);
 BGFX_C_API void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle);
 
 
 /**
 /**
- * Create vertex declaration.
+ * Create vertex layout.
  *
  *
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  *
  *
  */
  */
-BGFX_C_API bgfx_vertex_decl_handle_t bgfx_create_vertex_decl(const bgfx_vertex_decl_t * _decl);
+BGFX_C_API bgfx_vertex_layout_handle_t bgfx_create_vertex_layout(const bgfx_vertex_layout_t * _decl);
 
 
 /**
 /**
- * Destroy vertex declaration.
+ * Destroy vertex layout.
  *
  *
- * @param[in] _handle Vertex declaration handle.
+ * @param[in] _handle Vertex layout handle.
  *
  *
  */
  */
-BGFX_C_API void bgfx_destroy_vertex_decl(bgfx_vertex_decl_handle_t _handle);
+BGFX_C_API void bgfx_destroy_vertex_decl(bgfx_vertex_layout_handle_t _handle);
 
 
 /**
 /**
  * Create static vertex buffer.
  * Create static vertex buffer.
  *
  *
  * @param[in] _mem Vertex buffer data.
  * @param[in] _mem Vertex buffer data.
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  * @param[in] _flags Buffer creation flags.
  * @param[in] _flags Buffer creation flags.
  *   - `BGFX_BUFFER_NONE` - No flags.
  *   - `BGFX_BUFFER_NONE` - No flags.
  *   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
  *   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1328,7 +1328,7 @@ BGFX_C_API void bgfx_destroy_vertex_decl(bgfx_vertex_decl_handle_t _handle);
  * @returns Static vertex buffer handle.
  * @returns Static vertex buffer handle.
  *
  *
  */
  */
-BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t * _decl, uint16_t _flags);
+BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t * _decl, uint16_t _flags);
 
 
 /**
 /**
  * Set static vertex buffer debug name.
  * Set static vertex buffer debug name.
@@ -1415,7 +1415,7 @@ BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_hand
  * Create empty dynamic vertex buffer.
  * Create empty dynamic vertex buffer.
  *
  *
  * @param[in] _num Number of vertices.
  * @param[in] _num Number of vertices.
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  * @param[in] _flags Buffer creation flags.
  * @param[in] _flags Buffer creation flags.
  *    - `BGFX_BUFFER_NONE` - No flags.
  *    - `BGFX_BUFFER_NONE` - No flags.
  *    - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
  *    - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1432,13 +1432,13 @@ BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_hand
  * @returns Dynamic vertex buffer handle.
  * @returns Dynamic vertex buffer handle.
  *
  *
  */
  */
-BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_layout_t* _decl, uint16_t _flags);
 
 
 /**
 /**
  * Create dynamic vertex buffer and initialize it.
  * Create dynamic vertex buffer and initialize it.
  *
  *
  * @param[in] _mem Vertex buffer data.
  * @param[in] _mem Vertex buffer data.
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  * @param[in] _flags Buffer creation flags.
  * @param[in] _flags Buffer creation flags.
  *    - `BGFX_BUFFER_NONE` - No flags.
  *    - `BGFX_BUFFER_NONE` - No flags.
  *    - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
  *    - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1455,7 +1455,7 @@ BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer
  * @returns Dynamic vertex buffer handle.
  * @returns Dynamic vertex buffer handle.
  *
  *
  */
  */
-BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t* _decl, uint16_t _flags);
 
 
 /**
 /**
  * Update dynamic vertex buffer.
  * Update dynamic vertex buffer.
@@ -1489,12 +1489,12 @@ BGFX_C_API uint32_t bgfx_get_avail_transient_index_buffer(uint32_t _num);
  * Returns number of requested or maximum available vertices.
  * Returns number of requested or maximum available vertices.
  *
  *
  * @param[in] _num Number of required vertices.
  * @param[in] _num Number of required vertices.
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  *
  *
  * @returns Number of requested or maximum available vertices.
  * @returns Number of requested or maximum available vertices.
  *
  *
  */
  */
-BGFX_C_API uint32_t bgfx_get_avail_transient_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t * _decl);
+BGFX_C_API uint32_t bgfx_get_avail_transient_vertex_buffer(uint32_t _num, const bgfx_vertex_layout_t * _decl);
 
 
 /**
 /**
  * Returns number of requested or maximum available instance buffer slots.
  * Returns number of requested or maximum available instance buffer slots.
@@ -1527,10 +1527,10 @@ BGFX_C_API void bgfx_alloc_transient_index_buffer(bgfx_transient_index_buffer_t*
  *  for the duration of frame, and it can be reused for multiple draw
  *  for the duration of frame, and it can be reused for multiple draw
  *  calls.
  *  calls.
  * @param[in] _num Number of vertices to allocate.
  * @param[in] _num Number of vertices to allocate.
- * @param[in] _decl Vertex declaration.
+ * @param[in] _decl Vertex layout.
  *
  *
  */
  */
-BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_decl_t * _decl);
+BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_layout_t * _decl);
 
 
 /**
 /**
  * Check for required space and allocate transient vertex and index
  * Check for required space and allocate transient vertex and index
@@ -1542,15 +1542,15 @@ BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_
  * @param[out] _tvb TransientVertexBuffer structure is filled and is valid
  * @param[out] _tvb TransientVertexBuffer structure is filled and is valid
  *  for the duration of frame, and it can be reused for multiple draw
  *  for the duration of frame, and it can be reused for multiple draw
  *  calls.
  *  calls.
- * @param[in] _decl Number of vertices to allocate.
- * @param[in] _numVertices Vertex declaration.
+ * @param[in] _decl Vertex layout.
+ * @param[in] _numVertices Number of vertices to allocate.
  * @param[out] _tib TransientIndexBuffer structure is filled and is valid
  * @param[out] _tib TransientIndexBuffer structure is filled and is valid
  *  for the duration of frame, and it can be reused for multiple draw
  *  for the duration of frame, and it can be reused for multiple draw
  *  calls.
  *  calls.
  * @param[in] _numIndices Number of indices to allocate.
  * @param[in] _numIndices Number of indices to allocate.
  *
  *
  */
  */
-BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
+BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_layout_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
 
 
 /**
 /**
  * Allocate instance data buffer.
  * Allocate instance data buffer.
@@ -2435,10 +2435,10 @@ BGFX_C_API void bgfx_encoder_set_transient_index_buffer(bgfx_encoder_t* _this, c
  * @param[in] _handle Vertex buffer.
  * @param[in] _handle Vertex buffer.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _numVertices Number of vertices to render.
  * @param[in] _numVertices Number of vertices to render.
- * @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+ * @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
  *
  *
  */
  */
-BGFX_C_API void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
+BGFX_C_API void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
 
 
 /**
 /**
  * Set vertex buffer for draw primitive.
  * Set vertex buffer for draw primitive.
@@ -2447,10 +2447,10 @@ BGFX_C_API void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, uint8_t _s
  * @param[in] _handle Dynamic vertex buffer.
  * @param[in] _handle Dynamic vertex buffer.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _numVertices Number of vertices to render.
  * @param[in] _numVertices Number of vertices to render.
- * @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+ * @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
  *
  *
  */
  */
-BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
+BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
 
 
 /**
 /**
  * Set vertex buffer for draw primitive.
  * Set vertex buffer for draw primitive.
@@ -2459,10 +2459,10 @@ BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, ui
  * @param[in] _tvb Transient vertex buffer.
  * @param[in] _tvb Transient vertex buffer.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _startVertex First vertex to render.
  * @param[in] _numVertices Number of vertices to render.
  * @param[in] _numVertices Number of vertices to render.
- * @param[in] _declHandle VertexDecl handle for aliasing vertex buffer.
+ * @param[in] _declHandle VertexLayout handle for aliasing vertex buffer.
  *
  *
  */
  */
-BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
+BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
 
 
 /**
 /**
  * Set number of vertices for auto generated vertices use in conjuction
  * Set number of vertices for auto generated vertices use in conjuction
@@ -3220,12 +3220,12 @@ BGFX_C_API void bgfx_blit(bgfx_view_id_t _id, bgfx_texture_handle_t _dst, uint8_
 typedef enum bgfx_function_id
 typedef enum bgfx_function_id
 {
 {
     BGFX_FUNCTION_ID_ATTACHMENT_INIT,
     BGFX_FUNCTION_ID_ATTACHMENT_INIT,
-    BGFX_FUNCTION_ID_VERTEX_DECL_BEGIN,
-    BGFX_FUNCTION_ID_VERTEX_DECL_ADD,
-    BGFX_FUNCTION_ID_VERTEX_DECL_DECODE,
-    BGFX_FUNCTION_ID_VERTEX_DECL_HAS,
-    BGFX_FUNCTION_ID_VERTEX_DECL_SKIP,
-    BGFX_FUNCTION_ID_VERTEX_DECL_END,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_BEGIN,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_ADD,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_DECODE,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_HAS,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_SKIP,
+    BGFX_FUNCTION_ID_VERTEX_LAYOUT_END,
     BGFX_FUNCTION_ID_VERTEX_PACK,
     BGFX_FUNCTION_ID_VERTEX_PACK,
     BGFX_FUNCTION_ID_VERTEX_UNPACK,
     BGFX_FUNCTION_ID_VERTEX_UNPACK,
     BGFX_FUNCTION_ID_VERTEX_CONVERT,
     BGFX_FUNCTION_ID_VERTEX_CONVERT,
@@ -3254,7 +3254,7 @@ typedef enum bgfx_function_id
     BGFX_FUNCTION_ID_CREATE_INDEX_BUFFER,
     BGFX_FUNCTION_ID_CREATE_INDEX_BUFFER,
     BGFX_FUNCTION_ID_SET_INDEX_BUFFER_NAME,
     BGFX_FUNCTION_ID_SET_INDEX_BUFFER_NAME,
     BGFX_FUNCTION_ID_DESTROY_INDEX_BUFFER,
     BGFX_FUNCTION_ID_DESTROY_INDEX_BUFFER,
-    BGFX_FUNCTION_ID_CREATE_VERTEX_DECL,
+    BGFX_FUNCTION_ID_CREATE_VERTEX_LAYOUT,
     BGFX_FUNCTION_ID_DESTROY_VERTEX_DECL,
     BGFX_FUNCTION_ID_DESTROY_VERTEX_DECL,
     BGFX_FUNCTION_ID_CREATE_VERTEX_BUFFER,
     BGFX_FUNCTION_ID_CREATE_VERTEX_BUFFER,
     BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_NAME,
     BGFX_FUNCTION_ID_SET_VERTEX_BUFFER_NAME,
@@ -3412,16 +3412,16 @@ typedef enum bgfx_function_id
 struct bgfx_interface_vtbl
 struct bgfx_interface_vtbl
 {
 {
     void (*attachment_init)(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, uint16_t _layer, uint16_t _mip, uint8_t _resolve);
     void (*attachment_init)(bgfx_attachment_t* _this, bgfx_texture_handle_t _handle, bgfx_access_t _access, uint16_t _layer, uint16_t _mip, uint8_t _resolve);
-    bgfx_vertex_decl_t* (*vertex_decl_begin)(bgfx_vertex_decl_t* _this, bgfx_renderer_type_t _rendererType);
-    bgfx_vertex_decl_t* (*vertex_decl_add)(bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
-    void (*vertex_decl_decode)(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt);
-    bool (*vertex_decl_has)(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib);
-    bgfx_vertex_decl_t* (*vertex_decl_skip)(bgfx_vertex_decl_t* _this, uint8_t _num);
-    void (*vertex_decl_end)(bgfx_vertex_decl_t* _this);
-    void (*vertex_pack)(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, void* _data, uint32_t _index);
-    void (*vertex_unpack)(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, const void* _data, uint32_t _index);
-    void (*vertex_convert)(const bgfx_vertex_decl_t * _dstDecl, void* _dstData, const bgfx_vertex_decl_t * _srcDecl, const void* _srcData, uint32_t _num);
-    uint16_t (*weld_vertices)(uint16_t* _output, const bgfx_vertex_decl_t * _decl, const void* _data, uint16_t _num, float _epsilon);
+    bgfx_vertex_layout_t* (*vertex_layout_begin)(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType);
+    bgfx_vertex_layout_t* (*vertex_layout_add)(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt);
+    void (*vertex_layout_decode)(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt);
+    bool (*vertex_layout_has)(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib);
+    bgfx_vertex_layout_t* (*vertex_layout_skip)(bgfx_vertex_layout_t* _this, uint8_t _num);
+    void (*vertex_layout_end)(bgfx_vertex_layout_t* _this);
+    void (*vertex_pack)(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, void* _data, uint32_t _index);
+    void (*vertex_unpack)(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, const void* _data, uint32_t _index);
+    void (*vertex_convert)(const bgfx_vertex_layout_t * _dstDecl, void* _dstData, const bgfx_vertex_layout_t * _srcDecl, const void* _srcData, uint32_t _num);
+    uint16_t (*weld_vertices)(uint16_t* _output, const bgfx_vertex_layout_t * _decl, const void* _data, uint16_t _num, float _epsilon);
     uint32_t (*topology_convert)(bgfx_topology_convert_t _conversion, void* _dst, uint32_t _dstSize, const void* _indices, uint32_t _numIndices, bool _index32);
     uint32_t (*topology_convert)(bgfx_topology_convert_t _conversion, void* _dst, uint32_t _dstSize, const void* _indices, uint32_t _numIndices, bool _index32);
     void (*topology_sort_tri_list)(bgfx_topology_sort_t _sort, void* _dst, uint32_t _dstSize, const float _dir[3], const float _pos[3], const void* _vertices, uint32_t _stride, const void* _indices, uint32_t _numIndices, bool _index32);
     void (*topology_sort_tri_list)(bgfx_topology_sort_t _sort, void* _dst, uint32_t _dstSize, const float _dir[3], const float _pos[3], const void* _vertices, uint32_t _stride, const void* _indices, uint32_t _numIndices, bool _index32);
     uint8_t (*get_supported_renderers)(uint8_t _max, bgfx_renderer_type_t* _enum);
     uint8_t (*get_supported_renderers)(uint8_t _max, bgfx_renderer_type_t* _enum);
@@ -3446,25 +3446,25 @@ struct bgfx_interface_vtbl
     bgfx_index_buffer_handle_t (*create_index_buffer)(const bgfx_memory_t* _mem, uint16_t _flags);
     bgfx_index_buffer_handle_t (*create_index_buffer)(const bgfx_memory_t* _mem, uint16_t _flags);
     void (*set_index_buffer_name)(bgfx_index_buffer_handle_t _handle, const char* _name, int32_t _len);
     void (*set_index_buffer_name)(bgfx_index_buffer_handle_t _handle, const char* _name, int32_t _len);
     void (*destroy_index_buffer)(bgfx_index_buffer_handle_t _handle);
     void (*destroy_index_buffer)(bgfx_index_buffer_handle_t _handle);
-    bgfx_vertex_decl_handle_t (*create_vertex_decl)(const bgfx_vertex_decl_t * _decl);
-    void (*destroy_vertex_decl)(bgfx_vertex_decl_handle_t _handle);
-    bgfx_vertex_buffer_handle_t (*create_vertex_buffer)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t * _decl, uint16_t _flags);
+    bgfx_vertex_layout_handle_t (*create_vertex_layout)(const bgfx_vertex_layout_t * _decl);
+    void (*destroy_vertex_decl)(bgfx_vertex_layout_handle_t _handle);
+    bgfx_vertex_buffer_handle_t (*create_vertex_buffer)(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t * _decl, uint16_t _flags);
     void (*set_vertex_buffer_name)(bgfx_vertex_buffer_handle_t _handle, const char* _name, int32_t _len);
     void (*set_vertex_buffer_name)(bgfx_vertex_buffer_handle_t _handle, const char* _name, int32_t _len);
     void (*destroy_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle);
     void (*destroy_vertex_buffer)(bgfx_vertex_buffer_handle_t _handle);
     bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer)(uint32_t _num, uint16_t _flags);
     bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer)(uint32_t _num, uint16_t _flags);
     bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer_mem)(const bgfx_memory_t* _mem, uint16_t _flags);
     bgfx_dynamic_index_buffer_handle_t (*create_dynamic_index_buffer_mem)(const bgfx_memory_t* _mem, uint16_t _flags);
     void (*update_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem);
     void (*update_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _startIndex, const bgfx_memory_t* _mem);
     void (*destroy_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle);
     void (*destroy_dynamic_index_buffer)(bgfx_dynamic_index_buffer_handle_t _handle);
-    bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
-    bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer_mem)(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags);
+    bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer)(uint32_t _num, const bgfx_vertex_layout_t* _decl, uint16_t _flags);
+    bgfx_dynamic_vertex_buffer_handle_t (*create_dynamic_vertex_buffer_mem)(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t* _decl, uint16_t _flags);
     void (*update_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem);
     void (*update_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, const bgfx_memory_t* _mem);
     void (*destroy_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle);
     void (*destroy_dynamic_vertex_buffer)(bgfx_dynamic_vertex_buffer_handle_t _handle);
     uint32_t (*get_avail_transient_index_buffer)(uint32_t _num);
     uint32_t (*get_avail_transient_index_buffer)(uint32_t _num);
-    uint32_t (*get_avail_transient_vertex_buffer)(uint32_t _num, const bgfx_vertex_decl_t * _decl);
+    uint32_t (*get_avail_transient_vertex_buffer)(uint32_t _num, const bgfx_vertex_layout_t * _decl);
     uint32_t (*get_avail_instance_data_buffer)(uint32_t _num, uint16_t _stride);
     uint32_t (*get_avail_instance_data_buffer)(uint32_t _num, uint16_t _stride);
     void (*alloc_transient_index_buffer)(bgfx_transient_index_buffer_t* _tib, uint32_t _num);
     void (*alloc_transient_index_buffer)(bgfx_transient_index_buffer_t* _tib, uint32_t _num);
-    void (*alloc_transient_vertex_buffer)(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_decl_t * _decl);
-    bool (*alloc_transient_buffers)(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
+    void (*alloc_transient_vertex_buffer)(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_layout_t * _decl);
+    bool (*alloc_transient_buffers)(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_layout_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices);
     void (*alloc_instance_data_buffer)(bgfx_instance_data_buffer_t* _idb, uint32_t _num, uint16_t _stride);
     void (*alloc_instance_data_buffer)(bgfx_instance_data_buffer_t* _idb, uint32_t _num, uint16_t _stride);
     bgfx_indirect_buffer_handle_t (*create_indirect_buffer)(uint32_t _num);
     bgfx_indirect_buffer_handle_t (*create_indirect_buffer)(uint32_t _num);
     void (*destroy_indirect_buffer)(bgfx_indirect_buffer_handle_t _handle);
     void (*destroy_indirect_buffer)(bgfx_indirect_buffer_handle_t _handle);
@@ -3530,9 +3530,9 @@ struct bgfx_interface_vtbl
     void (*encoder_set_index_buffer)(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
     void (*encoder_set_index_buffer)(bgfx_encoder_t* _this, bgfx_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
     void (*encoder_set_dynamic_index_buffer)(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
     void (*encoder_set_dynamic_index_buffer)(bgfx_encoder_t* _this, bgfx_dynamic_index_buffer_handle_t _handle, uint32_t _firstIndex, uint32_t _numIndices);
     void (*encoder_set_transient_index_buffer)(bgfx_encoder_t* _this, const bgfx_transient_index_buffer_t* _tib, uint32_t _firstIndex, uint32_t _numIndices);
     void (*encoder_set_transient_index_buffer)(bgfx_encoder_t* _this, const bgfx_transient_index_buffer_t* _tib, uint32_t _firstIndex, uint32_t _numIndices);
-    void (*encoder_set_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
-    void (*encoder_set_dynamic_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
-    void (*encoder_set_transient_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle);
+    void (*encoder_set_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
+    void (*encoder_set_dynamic_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
+    void (*encoder_set_transient_vertex_buffer)(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle);
     void (*encoder_set_vertex_count)(bgfx_encoder_t* _this, uint32_t _numVertices);
     void (*encoder_set_vertex_count)(bgfx_encoder_t* _this, uint32_t _numVertices);
     void (*encoder_set_instance_data_buffer)(bgfx_encoder_t* _this, const bgfx_instance_data_buffer_t* _idb, uint32_t _start, uint32_t _num);
     void (*encoder_set_instance_data_buffer)(bgfx_encoder_t* _this, const bgfx_instance_data_buffer_t* _idb, uint32_t _start, uint32_t _num);
     void (*encoder_set_instance_data_from_vertex_buffer)(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);
     void (*encoder_set_instance_data_from_vertex_buffer)(bgfx_encoder_t* _this, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _num);

+ 1 - 1
include/bgfx/defines.h

@@ -6,7 +6,7 @@
 #ifndef BGFX_DEFINES_H_HEADER_GUARD
 #ifndef BGFX_DEFINES_H_HEADER_GUARD
 #define BGFX_DEFINES_H_HEADER_GUARD
 #define BGFX_DEFINES_H_HEADER_GUARD
 
 
-#define BGFX_API_VERSION UINT32_C(99)
+#define BGFX_API_VERSION UINT32_C(100)
 
 
 /**
 /**
  * Color RGB/alpha/depth write. When it's not specified write will be disabled.
  * Color RGB/alpha/depth write. When it's not specified write will be disabled.

+ 64 - 64
scripts/bgfx.idl

@@ -1,7 +1,7 @@
 -- vim: syntax=lua
 -- vim: syntax=lua
 -- bgfx interface
 -- bgfx interface
 
 
-version(99)
+version(100)
 
 
 typedef "bool"
 typedef "bool"
 typedef "char"
 typedef "char"
@@ -669,7 +669,7 @@ struct.Limits  { namespace = "Caps" }
 	.maxTextures             "uint32_t"    --- Maximum number of texture handles.
 	.maxTextures             "uint32_t"    --- Maximum number of texture handles.
 	.maxTextureSamplers      "uint32_t"    --- Maximum number of texture samplers.
 	.maxTextureSamplers      "uint32_t"    --- Maximum number of texture samplers.
 	.maxComputeBindings      "uint32_t"    --- Maximum number of compute bindings.
 	.maxComputeBindings      "uint32_t"    --- Maximum number of compute bindings.
-	.maxVertexDecls          "uint32_t"    --- Maximum number of vertex format declarations.
+	.maxVertexLayouts        "uint32_t"    --- Maximum number of vertex format layouts.
 	.maxVertexStreams        "uint32_t"    --- Maximum number of vertex streams.
 	.maxVertexStreams        "uint32_t"    --- Maximum number of vertex streams.
 	.maxIndexBuffers         "uint32_t"    --- Maximum number of index buffer handles.
 	.maxIndexBuffers         "uint32_t"    --- Maximum number of index buffer handles.
 	.maxVertexBuffers        "uint32_t"    --- Maximum number of vertex buffer handles.
 	.maxVertexBuffers        "uint32_t"    --- Maximum number of vertex buffer handles.
@@ -793,7 +793,7 @@ struct.TransientVertexBuffer
 	.startVertex "uint32_t"           --- First vertex.
 	.startVertex "uint32_t"           --- First vertex.
 	.stride      "uint16_t"           --- Vertex stride.
 	.stride      "uint16_t"           --- Vertex stride.
 	.handle      "VertexBufferHandle" --- Vertex buffer handle.
 	.handle      "VertexBufferHandle" --- Vertex buffer handle.
-	.decl        "VertexDeclHandle"   --- Vertex declaration handle.
+	.decl        "VertexLayoutHandle" --- Vertex layout handle.
 
 
 --- Instance data buffer info.
 --- Instance data buffer info.
 struct.InstanceDataBuffer
 struct.InstanceDataBuffer
@@ -892,7 +892,7 @@ struct.Stats
 	.numTextures             "uint16_t"      --- Number of used textures.
 	.numTextures             "uint16_t"      --- Number of used textures.
 	.numUniforms             "uint16_t"      --- Number of used uniforms.
 	.numUniforms             "uint16_t"      --- Number of used uniforms.
 	.numVertexBuffers        "uint16_t"      --- Number of used vertex buffers.
 	.numVertexBuffers        "uint16_t"      --- Number of used vertex buffers.
-	.numVertexDecls          "uint16_t"      --- Number of used vertex declarations.
+	.numVertexLayouts          "uint16_t"    --- Number of used vertex layouts.
 
 
 	.textureMemoryUsed       "int64_t"       --- Estimate of texture memory used.
 	.textureMemoryUsed       "int64_t"       --- Estimate of texture memory used.
 	.rtMemoryUsed            "int64_t"       --- Estimate of render target memory used.
 	.rtMemoryUsed            "int64_t"       --- Estimate of render target memory used.
@@ -915,8 +915,8 @@ struct.Stats
 	.numEncoders             "uint8_t"       --- Number of encoders used during frame.
 	.numEncoders             "uint8_t"       --- Number of encoders used during frame.
 	.encoderStats            "EncoderStats*" --- Array of encoder stats.
 	.encoderStats            "EncoderStats*" --- Array of encoder stats.
 
 
---- Vertex declaration.
-struct.VertexDecl { ctor }
+--- Vertex layout.
+struct.VertexLayout { ctor }
 	.hash       "uint32_t"                --- Hash.
 	.hash       "uint32_t"                --- Hash.
 	.stride     "uint16_t"                --- Stride.
 	.stride     "uint16_t"                --- Stride.
 	.offset     "uint16_t[Attrib::Count]" --- Attribute offsets.
 	.offset     "uint16_t[Attrib::Count]" --- Attribute offsets.
@@ -937,20 +937,20 @@ handle "ShaderHandle"
 handle "TextureHandle"
 handle "TextureHandle"
 handle "UniformHandle"
 handle "UniformHandle"
 handle "VertexBufferHandle"
 handle "VertexBufferHandle"
-handle "VertexDeclHandle"
+handle "VertexLayoutHandle"
 
 
---- Start VertexDecl.
-func.VertexDecl.begin
-	"VertexDecl&"
+--- Start VertexLayout.
+func.VertexLayout.begin
+	"VertexLayout&"
 	.rendererType    "RendererType::Enum"
 	.rendererType    "RendererType::Enum"
 	{ default = "RendererType::Noop" }
 	{ default = "RendererType::Noop" }
 
 
---- Add attribute to VertexDecl.
+--- Add attribute to VertexLayout.
 ---
 ---
 --- @remarks Must be called between begin/end.
 --- @remarks Must be called between begin/end.
 ---
 ---
-func.VertexDecl.add
-	"VertexDecl&"
+func.VertexLayout.add
+	"VertexLayout&"
 	.attrib          "Attrib::Enum"     --- Attribute semantics. See: `bgfx::Attrib`
 	.attrib          "Attrib::Enum"     --- Attribute semantics. See: `bgfx::Attrib`
 	.num             "uint8_t"          --- Number of elements 1, 2, 3 or 4.
 	.num             "uint8_t"          --- Number of elements 1, 2, 3 or 4.
 	.type            "AttribType::Enum" --- Element type.
 	.type            "AttribType::Enum" --- Element type.
@@ -963,7 +963,7 @@ func.VertexDecl.add
 	                                    --- Unpacking code must be implemented inside vertex shader.
 	                                    --- Unpacking code must be implemented inside vertex shader.
 
 
 --- Decode attribute.
 --- Decode attribute.
-func.VertexDecl.decode { const }
+func.VertexLayout.decode { const }
 	"void"
 	"void"
 	.attrib     "Attrib::Enum"               --- Attribute semantics. See: `bgfx::Attrib`
 	.attrib     "Attrib::Enum"               --- Attribute semantics. See: `bgfx::Attrib`
 	.num        "uint8_t &"          { out } --- Number of elements.
 	.num        "uint8_t &"          { out } --- Number of elements.
@@ -971,75 +971,75 @@ func.VertexDecl.decode { const }
 	.normalized "bool &"             { out } --- Attribute is normalized.
 	.normalized "bool &"             { out } --- Attribute is normalized.
 	.asInt      "bool &"             { out } --- Attribute is packed as int.
 	.asInt      "bool &"             { out } --- Attribute is packed as int.
 
 
---- Returns true if VertexDecl contains attribute.
-func.VertexDecl.has { const }
+--- Returns true if VertexLayout contains attribute.
+func.VertexLayout.has { const }
 	"bool"
 	"bool"
 	.attrib "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib`
 	.attrib "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib`
 
 
 --- Skip `_num` bytes in vertex stream.
 --- Skip `_num` bytes in vertex stream.
-func.VertexDecl.skip
-	"VertexDecl&"
+func.VertexLayout.skip
+	"VertexLayout&"
 	.num "uint8_t"
 	.num "uint8_t"
 
 
 -- Notice: `end` is a keyword in lua.
 -- Notice: `end` is a keyword in lua.
---- End VertexDecl.
-func.VertexDecl["end"]
+--- End VertexLayout.
+func.VertexLayout["end"]
 	"void"
 	"void"
 
 
 --- Returns relative attribute offset from the vertex.
 --- Returns relative attribute offset from the vertex.
-func.VertexDecl.getOffset { const , cpponly }
+func.VertexLayout.getOffset { const , cpponly }
 	"uint16_t"
 	"uint16_t"
 	.attrib    "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib`
 	.attrib    "Attrib::Enum" --- Attribute semantics. See: `bgfx::Attrib`
 
 
 --- Returns vertex stride.
 --- Returns vertex stride.
-func.VertexDecl.getStride { const , cpponly }
+func.VertexLayout.getStride { const , cpponly }
 	"uint16_t"
 	"uint16_t"
 
 
 --- Returns size of vertex buffer for number of vertices.
 --- Returns size of vertex buffer for number of vertices.
-func.VertexDecl.getSize { const, cpponly }
+func.VertexLayout.getSize { const, cpponly }
 	"uint32_t"
 	"uint32_t"
 	.num       "uint32_t"
 	.num       "uint32_t"
 
 
 --- Pack vertex attribute into vertex stream format.
 --- Pack vertex attribute into vertex stream format.
 func.vertexPack
 func.vertexPack
 	"void"
 	"void"
-	.input           "const float[4]"     --- Value to be packed into vertex stream.
-	.inputNormalized "bool"               --- `true` if input value is already normalized.
-	.attr            "Attrib::Enum"       --- Attribute to pack.
-	.decl            "const VertexDecl &" --- Vertex stream declaration.
-	.data            "void*"              --- Destination vertex stream where data will be packed.
-	.index           "uint32_t"           --- Vertex index that will be modified.
+	.input           "const float[4]"     	--- Value to be packed into vertex stream.
+	.inputNormalized "bool"               	--- `true` if input value is already normalized.
+	.attr            "Attrib::Enum"       	--- Attribute to pack.
+	.decl            "const VertexLayout &" --- Vertex stream layout.
+	.data            "void*"              	--- Destination vertex stream where data will be packed.
+	.index           "uint32_t"           	--- Vertex index that will be modified.
 	 { default = 0 }
 	 { default = 0 }
 
 
 --- Unpack vertex attribute from vertex stream format.
 --- Unpack vertex attribute from vertex stream format.
 func.vertexUnpack
 func.vertexUnpack
 	"void"
 	"void"
-	.output "float[4]" { out }   --- Result of unpacking.
-	.attr   "Attrib::Enum"       --- Attribute to unpack.
-	.decl   "const VertexDecl &" --- Vertex stream declaration.
-	.data   "const void*"        --- Source vertex stream from where data will be unpacked.
-	.index  "uint32_t"           --- Vertex index that will be unpacked.
+	.output "float[4]" { out }   	--- Result of unpacking.
+	.attr   "Attrib::Enum"       	--- Attribute to unpack.
+	.decl   "const VertexLayout &" 	--- Vertex stream layout.
+	.data   "const void*"        	--- Source vertex stream from where data will be unpacked.
+	.index  "uint32_t"           	--- Vertex index that will be unpacked.
 	 { default = 0 }
 	 { default = 0 }
 
 
 --- Converts vertex stream data from one vertex stream format to another.
 --- Converts vertex stream data from one vertex stream format to another.
 func.vertexConvert
 func.vertexConvert
 	"void"
 	"void"
-	.dstDecl "const VertexDecl &" --- Destination vertex stream declaration.
-	.dstData "void*"              --- Destination vertex stream.
-	.srcDecl "const VertexDecl &" --- Source vertex stream declaration.
-	.srcData "const void*"        --- Source vertex stream data.
-	.num     "uint32_t"           --- Number of vertices to convert from source to destination.
+	.dstDecl "const VertexLayout &" --- Destination vertex stream layout.
+	.dstData "void*"              	--- Destination vertex stream.
+	.srcDecl "const VertexLayout &" --- Source vertex stream layout.
+	.srcData "const void*"        	--- Source vertex stream data.
+	.num     "uint32_t"           	--- Number of vertices to convert from source to destination.
 	 { default = 1 }
 	 { default = 1 }
 
 
 --- Weld vertices.
 --- Weld vertices.
 func.weldVertices
 func.weldVertices
-	"uint16_t"                    --- Number of unique vertices after vertex welding.
-	.output  "uint16_t*"          --- Welded vertices remapping table. The size of buffer
-	                              --- must be the same as number of vertices.
-	.decl    "const VertexDecl &" --- Vertex stream declaration.
-	.data    "const void*"        --- Vertex stream.
-	.num     "uint16_t"           --- Number of vertices in vertex stream.
-	.epsilon "float"              --- Error tolerance for vertex position comparison.
+	"uint16_t"                    	--- Number of unique vertices after vertex welding.
+	.output  "uint16_t*"          	--- Welded vertices remapping table. The size of buffer
+	                              	--- must be the same as number of vertices.
+	.decl    "const VertexLayout &" --- Vertex stream layout.
+	.data    "const void*"        	--- Vertex stream.
+	.num     "uint16_t"           	--- Number of vertices in vertex stream.
+	.epsilon "float"              	--- Error tolerance for vertex position comparison.
 	 { default = "0.001f" }
 	 { default = "0.001f" }
 
 
 --- Convert index buffer for use with different primitive topologies.
 --- Convert index buffer for use with different primitive topologies.
@@ -1279,21 +1279,21 @@ func.destroy { cname = "destroy_index_buffer" }
 	"void"
 	"void"
 	.handle "IndexBufferHandle" --- Static index buffer handle.
 	.handle "IndexBufferHandle" --- Static index buffer handle.
 
 
---- Create vertex declaration.
-func.createVertexDecl
-	"VertexDeclHandle"
-	.decl  "const VertexDecl &" --- Vertex declaration.
+--- Create vertex layout.
+func.createVertexLayout
+	"VertexLayoutHandle"
+	.decl  "const VertexLayout &" --- Vertex layout.
 
 
---- Destroy vertex declaration.
+--- Destroy vertex layout.
 func.destroy { cname = "destroy_vertex_decl" }
 func.destroy { cname = "destroy_vertex_decl" }
 	"void"
 	"void"
-	.handle "VertexDeclHandle" --- Vertex declaration handle.
+	.handle "VertexLayoutHandle" --- Vertex layout handle.
 
 
 --- Create static vertex buffer.
 --- Create static vertex buffer.
 func.createVertexBuffer
 func.createVertexBuffer
 	"VertexBufferHandle"              --- Static vertex buffer handle.
 	"VertexBufferHandle"              --- Static vertex buffer handle.
 	.mem   "const Memory*"            --- Vertex buffer data.
 	.mem   "const Memory*"            --- Vertex buffer data.
-	.decl  "const VertexDecl &"       --- Vertex declaration.
+	.decl  "const VertexLayout &"     --- Vertex layout.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	 { default = "BGFX_BUFFER_NONE" } ---  - `BGFX_BUFFER_NONE` - No flags.
 	 { default = "BGFX_BUFFER_NONE" } ---  - `BGFX_BUFFER_NONE` - No flags.
 	                                  ---  - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	                                  ---  - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1368,7 +1368,7 @@ func.destroy { cname = "destroy_dynamic_index_buffer" }
 func.createDynamicVertexBuffer
 func.createDynamicVertexBuffer
 	"DynamicVertexBufferHandle"       --- Dynamic vertex buffer handle.
 	"DynamicVertexBufferHandle"       --- Dynamic vertex buffer handle.
 	.num   "uint32_t"                 --- Number of vertices.
 	.num   "uint32_t"                 --- Number of vertices.
-	.decl  "const VertexDecl&"        --- Vertex declaration.
+	.decl  "const VertexLayout&"      --- Vertex layout.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	 { default = "BGFX_BUFFER_NONE" } ---   - `BGFX_BUFFER_NONE` - No flags.
 	 { default = "BGFX_BUFFER_NONE" } ---   - `BGFX_BUFFER_NONE` - No flags.
 	                                  ---   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	                                  ---   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1386,7 +1386,7 @@ func.createDynamicVertexBuffer
 func.createDynamicVertexBuffer { cname = "create_dynamic_vertex_buffer_mem" }
 func.createDynamicVertexBuffer { cname = "create_dynamic_vertex_buffer_mem" }
 	"DynamicVertexBufferHandle"       --- Dynamic vertex buffer handle.
 	"DynamicVertexBufferHandle"       --- Dynamic vertex buffer handle.
 	.mem   "const Memory*"            --- Vertex buffer data.
 	.mem   "const Memory*"            --- Vertex buffer data.
-	.decl  "const VertexDecl&"        --- Vertex declaration.
+	.decl  "const VertexLayout&"      --- Vertex layout.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	.flags "uint16_t"                 --- Buffer creation flags.
 	 { default = "BGFX_BUFFER_NONE" } ---   - `BGFX_BUFFER_NONE` - No flags.
 	 { default = "BGFX_BUFFER_NONE" } ---   - `BGFX_BUFFER_NONE` - No flags.
 	                                  ---   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
 	                                  ---   - `BGFX_BUFFER_COMPUTE_READ` - Buffer will be read from by compute shader.
@@ -1419,9 +1419,9 @@ func.getAvailTransientIndexBuffer
 
 
 --- Returns number of requested or maximum available vertices.
 --- Returns number of requested or maximum available vertices.
 func.getAvailTransientVertexBuffer
 func.getAvailTransientVertexBuffer
-	"uint32_t"                  --- Number of requested or maximum available vertices.
-	.num "uint32_t"             --- Number of required vertices.
-	.decl  "const VertexDecl &" --- Vertex declaration.
+	"uint32_t"                  	--- Number of requested or maximum available vertices.
+	.num "uint32_t"             	--- Number of required vertices.
+	.decl  "const VertexLayout &" 	--- Vertex layout.
 
 
 --- Returns number of requested or maximum available instance buffer slots.
 --- Returns number of requested or maximum available instance buffer slots.
 func.getAvailInstanceDataBuffer
 func.getAvailInstanceDataBuffer
@@ -1448,7 +1448,7 @@ func.allocTransientVertexBuffer
 	                                       --- for the duration of frame, and it can be reused for multiple draw
 	                                       --- for the duration of frame, and it can be reused for multiple draw
 	                                       --- calls.
 	                                       --- calls.
 	.num  "uint32_t"                       --- Number of vertices to allocate.
 	.num  "uint32_t"                       --- Number of vertices to allocate.
-	.decl "const VertexDecl &"             --- Vertex declaration.
+	.decl "const VertexLayout &"             --- Vertex layout.
 
 
 --- Check for required space and allocate transient vertex and index
 --- Check for required space and allocate transient vertex and index
 --- buffers. If both space requirements are satisfied function returns
 --- buffers. If both space requirements are satisfied function returns
@@ -1462,8 +1462,8 @@ func.allocTransientBuffers
 	.tvb         "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure is filled and is valid
 	.tvb         "TransientVertexBuffer*" { out } --- TransientVertexBuffer structure is filled and is valid
 	                                              --- for the duration of frame, and it can be reused for multiple draw
 	                                              --- for the duration of frame, and it can be reused for multiple draw
 	                                              --- calls.
 	                                              --- calls.
-	.decl        "const VertexDecl &"             --- Number of vertices to allocate.
-	.numVertices "uint32_t"                       --- Vertex declaration.
+	.decl        "const VertexLayout &"           --- Vertex layout.
+	.numVertices "uint32_t"                       --- Number of vertices to allocate.
 	.tib         "TransientIndexBuffer*" { out }  --- TransientIndexBuffer structure is filled and is valid
 	.tib         "TransientIndexBuffer*" { out }  --- TransientIndexBuffer structure is filled and is valid
 	                                              --- for the duration of frame, and it can be reused for multiple draw
 	                                              --- for the duration of frame, and it can be reused for multiple draw
 	                                              --- calls.
 	                                              --- calls.
@@ -2211,7 +2211,7 @@ func.Encoder.setVertexBuffer
 	.handle      "VertexBufferHandle" --- Vertex buffer.
 	.handle      "VertexBufferHandle" --- Vertex buffer.
 	.startVertex "uint32_t"           --- First vertex to render.
 	.startVertex "uint32_t"           --- First vertex to render.
 	.numVertices "uint32_t"           --- Number of vertices to render.
 	.numVertices "uint32_t"           --- Number of vertices to render.
-	.declHandle  "VertexDeclHandle"   --- VertexDecl handle for aliasing vertex buffer.
+	.declHandle  "VertexLayoutHandle"   --- VertexLayout handle for aliasing vertex buffer.
 	 { default = "BGFX_INVALID_HANDLE" }
 	 { default = "BGFX_INVALID_HANDLE" }
 
 
 --- Set vertex buffer for draw primitive.
 --- Set vertex buffer for draw primitive.
@@ -2227,7 +2227,7 @@ func.Encoder.setVertexBuffer { cname = "set_dynamic_vertex_buffer" }
 	.handle      "DynamicVertexBufferHandle" --- Dynamic vertex buffer.
 	.handle      "DynamicVertexBufferHandle" --- Dynamic vertex buffer.
 	.startVertex "uint32_t"                  --- First vertex to render.
 	.startVertex "uint32_t"                  --- First vertex to render.
 	.numVertices "uint32_t"                  --- Number of vertices to render.
 	.numVertices "uint32_t"                  --- Number of vertices to render.
-	.declHandle  "VertexDeclHandle"          --- VertexDecl handle for aliasing vertex buffer.
+	.declHandle  "VertexLayoutHandle"          --- VertexLayout handle for aliasing vertex buffer.
 	 { default = "BGFX_INVALID_HANDLE" }
 	 { default = "BGFX_INVALID_HANDLE" }
 
 
 --- Set vertex buffer for draw primitive.
 --- Set vertex buffer for draw primitive.
@@ -2243,7 +2243,7 @@ func.Encoder.setVertexBuffer { cname = "set_transient_vertex_buffer" }
 	.tvb         "const TransientVertexBuffer*" --- Transient vertex buffer.
 	.tvb         "const TransientVertexBuffer*" --- Transient vertex buffer.
 	.startVertex "uint32_t"                     --- First vertex to render.
 	.startVertex "uint32_t"                     --- First vertex to render.
 	.numVertices "uint32_t"                     --- Number of vertices to render.
 	.numVertices "uint32_t"                     --- Number of vertices to render.
-	.declHandle  "VertexDeclHandle"             --- VertexDecl handle for aliasing vertex buffer.
+	.declHandle  "VertexLayoutHandle"             --- VertexLayout handle for aliasing vertex buffer.
 	 { default = "BGFX_INVALID_HANDLE" }
 	 { default = "BGFX_INVALID_HANDLE" }
 
 
 --- Set number of vertices for auto generated vertices use in conjuction
 --- Set number of vertices for auto generated vertices use in conjuction

+ 1 - 1
scripts/bgfx.natvis

@@ -106,7 +106,7 @@
         </Expand>
         </Expand>
     </Type>
     </Type>
 
 
-    <Type Name="bgfx::VertexDeclHandle">
+    <Type Name="bgfx::VertexLayoutHandle">
         <DisplayString Condition="idx == bgfx::kInvalidHandle">{{ idx={idx} (INVALID) }}</DisplayString>
         <DisplayString Condition="idx == bgfx::kInvalidHandle">{{ idx={idx} (INVALID) }}</DisplayString>
         <DisplayString>{{ idx={idx} }}</DisplayString>
         <DisplayString>{{ idx={idx} }}</DisplayString>
         <Expand>
         <Expand>

+ 1 - 1
scripts/temp.bgfx.idl.inl

@@ -31,7 +31,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame,          BGFX_RENDER_FRAME_COUNT);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory,                bgfx_memory_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory,                bgfx_memory_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform,             bgfx_transform_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform,             bgfx_transform_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats,                 bgfx_stats_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats,                 bgfx_stats_t);
-BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexDecl,            bgfx_vertex_decl_t);
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexLayout,          bgfx_vertex_layout_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer,  bgfx_transient_index_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer,  bgfx_transient_index_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer,    bgfx_instance_data_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer,    bgfx_instance_data_buffer_t);

+ 38 - 38
src/bgfx.cpp

@@ -511,11 +511,11 @@ namespace bgfx
 		return handle;
 		return handle;
 	}
 	}
 
 
-	void dump(const VertexDecl& _decl)
+	void dump(const VertexLayout& _decl)
 	{
 	{
 		if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
 		if (BX_ENABLED(BGFX_CONFIG_DEBUG) )
 		{
 		{
-			BX_TRACE("vertexdecl %08x (%08x), stride %d"
+			BX_TRACE("vertexlayout %08x (%08x), stride %d"
 				, _decl.m_hash
 				, _decl.m_hash
 				, bx::hash<bx::HashMurmur2A>(_decl.m_attributes)
 				, bx::hash<bx::HashMurmur2A>(_decl.m_attributes)
 				, _decl.m_stride
 				, _decl.m_stride
@@ -1576,7 +1576,7 @@ namespace bgfx
 		LIMITS(maxTextures);
 		LIMITS(maxTextures);
 		LIMITS(maxTextureSamplers);
 		LIMITS(maxTextureSamplers);
 		LIMITS(maxComputeBindings);
 		LIMITS(maxComputeBindings);
-		LIMITS(maxVertexDecls);
+		LIMITS(maxVertexLayouts);
 		LIMITS(maxVertexStreams);
 		LIMITS(maxVertexStreams);
 		LIMITS(maxIndexBuffers);
 		LIMITS(maxIndexBuffers);
 		LIMITS(maxVertexBuffers);
 		LIMITS(maxVertexBuffers);
@@ -1918,7 +1918,7 @@ namespace bgfx
 			frame();
 			frame();
 		}
 		}
 
 
-		frame(); // If any VertexDecls needs to be destroyed.
+		frame(); // If any VertexLayouts needs to be destroyed.
 
 
 		getCommandBuffer(CommandBuffer::RendererShutdownEnd);
 		getCommandBuffer(CommandBuffer::RendererShutdownEnd);
 		frame();
 		frame();
@@ -1939,7 +1939,7 @@ namespace bgfx
 		m_dynIndexBufferAllocator.compact();
 		m_dynIndexBufferAllocator.compact();
 
 
 		BX_CHECK(m_vertexDeclHandle.getNumHandles() == m_declRef.m_vertexDeclMap.getNumElements()
 		BX_CHECK(m_vertexDeclHandle.getNumHandles() == m_declRef.m_vertexDeclMap.getNumElements()
-				, "VertexDeclRef mismatch, num handles %d, handles in hash map %d."
+				, "VertexLayoutRef mismatch, num handles %d, handles in hash map %d."
 				, m_vertexDeclHandle.getNumHandles()
 				, m_vertexDeclHandle.getNumHandles()
 				, m_declRef.m_vertexDeclMap.getNumElements()
 				, m_declRef.m_vertexDeclMap.getNumElements()
 				);
 				);
@@ -2032,7 +2032,7 @@ namespace bgfx
 			CHECK_HANDLE_LEAK        ("DynamicIndexBufferHandle",  m_dynamicIndexBufferHandle                                  );
 			CHECK_HANDLE_LEAK        ("DynamicIndexBufferHandle",  m_dynamicIndexBufferHandle                                  );
 			CHECK_HANDLE_LEAK        ("DynamicVertexBufferHandle", m_dynamicVertexBufferHandle                                 );
 			CHECK_HANDLE_LEAK        ("DynamicVertexBufferHandle", m_dynamicVertexBufferHandle                                 );
 			CHECK_HANDLE_LEAK_NAME   ("IndexBufferHandle",         m_indexBufferHandle,        IndexBuffer,    m_indexBuffers  );
 			CHECK_HANDLE_LEAK_NAME   ("IndexBufferHandle",         m_indexBufferHandle,        IndexBuffer,    m_indexBuffers  );
-			CHECK_HANDLE_LEAK        ("VertexDeclHandle",          m_vertexDeclHandle                                          );
+			CHECK_HANDLE_LEAK        ("VertexLayoutHandle",        m_vertexDeclHandle                                          );
 			CHECK_HANDLE_LEAK_NAME   ("VertexBufferHandle",        m_vertexBufferHandle,       VertexBuffer,   m_vertexBuffers );
 			CHECK_HANDLE_LEAK_NAME   ("VertexBufferHandle",        m_vertexBufferHandle,       VertexBuffer,   m_vertexBuffers );
 			CHECK_HANDLE_LEAK_RC_NAME("ShaderHandle",              m_shaderHandle,             ShaderRef,      m_shaderRef     );
 			CHECK_HANDLE_LEAK_RC_NAME("ShaderHandle",              m_shaderHandle,             ShaderRef,      m_shaderRef     );
 			CHECK_HANDLE_LEAK        ("ProgramHandle",             m_programHandle                                             );
 			CHECK_HANDLE_LEAK        ("ProgramHandle",             m_programHandle                                             );
@@ -2720,28 +2720,28 @@ namespace bgfx
 				}
 				}
 				break;
 				break;
 
 
-			case CommandBuffer::CreateVertexDecl:
+			case CommandBuffer::CreateVertexLayout:
 				{
 				{
-					BGFX_PROFILER_SCOPE("CreateVertexDecl", 0xff2040ff);
+					BGFX_PROFILER_SCOPE("CreateVertexLayout", 0xff2040ff);
 
 
-					VertexDeclHandle handle;
+					VertexLayoutHandle handle;
 					_cmdbuf.read(handle);
 					_cmdbuf.read(handle);
 
 
-					VertexDecl decl;
+					VertexLayout decl;
 					_cmdbuf.read(decl);
 					_cmdbuf.read(decl);
 
 
-					m_renderCtx->createVertexDecl(handle, decl);
+					m_renderCtx->createVertexLayout(handle, decl);
 				}
 				}
 				break;
 				break;
 
 
-			case CommandBuffer::DestroyVertexDecl:
+			case CommandBuffer::DestroyVertexLayout:
 				{
 				{
-					BGFX_PROFILER_SCOPE("DestroyVertexDecl", 0xff2040ff);
+					BGFX_PROFILER_SCOPE("DestroyVertexLayout", 0xff2040ff);
 
 
-					VertexDeclHandle handle;
+					VertexLayoutHandle handle;
 					_cmdbuf.read(handle);
 					_cmdbuf.read(handle);
 
 
-					m_renderCtx->destroyVertexDecl(handle);
+					m_renderCtx->destroyVertexLayout(handle);
 				}
 				}
 				break;
 				break;
 
 
@@ -2755,7 +2755,7 @@ namespace bgfx
 					const Memory* mem;
 					const Memory* mem;
 					_cmdbuf.read(mem);
 					_cmdbuf.read(mem);
 
 
-					VertexDeclHandle declHandle;
+					VertexLayoutHandle declHandle;
 					_cmdbuf.read(declHandle);
 					_cmdbuf.read(declHandle);
 
 
 					uint16_t flags;
 					uint16_t flags;
@@ -3375,7 +3375,7 @@ namespace bgfx
 		g_caps.limits.maxTextures             = BGFX_CONFIG_MAX_TEXTURES;
 		g_caps.limits.maxTextures             = BGFX_CONFIG_MAX_TEXTURES;
 		g_caps.limits.maxTextureSamplers      = BGFX_CONFIG_MAX_TEXTURE_SAMPLERS;
 		g_caps.limits.maxTextureSamplers      = BGFX_CONFIG_MAX_TEXTURE_SAMPLERS;
 		g_caps.limits.maxComputeBindings      = 0;
 		g_caps.limits.maxComputeBindings      = 0;
-		g_caps.limits.maxVertexDecls          = BGFX_CONFIG_MAX_VERTEX_DECLS;
+		g_caps.limits.maxVertexLayouts          = BGFX_CONFIG_MAX_VERTEX_DECLS;
 		g_caps.limits.maxVertexStreams        = 1;
 		g_caps.limits.maxVertexStreams        = 1;
 		g_caps.limits.maxIndexBuffers         = BGFX_CONFIG_MAX_INDEX_BUFFERS;
 		g_caps.limits.maxIndexBuffers         = BGFX_CONFIG_MAX_INDEX_BUFFERS;
 		g_caps.limits.maxVertexBuffers        = BGFX_CONFIG_MAX_VERTEX_BUFFERS;
 		g_caps.limits.maxVertexBuffers        = BGFX_CONFIG_MAX_VERTEX_BUFFERS;
@@ -3581,7 +3581,7 @@ namespace bgfx
 		, VertexBufferHandle _handle
 		, VertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 	)
 	)
 	{
 	{
 		BGFX_CHECK_HANDLE("setVertexBuffer", s_ctx->m_vertexBufferHandle, _handle);
 		BGFX_CHECK_HANDLE("setVertexBuffer", s_ctx->m_vertexBufferHandle, _handle);
@@ -3599,7 +3599,7 @@ namespace bgfx
 		, DynamicVertexBufferHandle _handle
 		, DynamicVertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 		)
 		)
 	{
 	{
 		BGFX_CHECK_HANDLE("setVertexBuffer", s_ctx->m_dynamicVertexBufferHandle, _handle);
 		BGFX_CHECK_HANDLE("setVertexBuffer", s_ctx->m_dynamicVertexBufferHandle, _handle);
@@ -3618,7 +3618,7 @@ namespace bgfx
 		, const TransientVertexBuffer* _tvb
 		, const TransientVertexBuffer* _tvb
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 		)
 		)
 	{
 	{
 		BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
 		BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
@@ -3937,20 +3937,20 @@ namespace bgfx
 		s_ctx->destroyIndexBuffer(_handle);
 		s_ctx->destroyIndexBuffer(_handle);
 	}
 	}
 
 
-	VertexDeclHandle createVertexDecl(const VertexDecl& _decl)
+	VertexLayoutHandle createVertexLayout(const VertexLayout& _decl)
 	{
 	{
-		return s_ctx->createVertexDecl(_decl);
+		return s_ctx->createVertexLayout(_decl);
 	}
 	}
 
 
-	void destroy(VertexDeclHandle _handle)
+	void destroy(VertexLayoutHandle _handle)
 	{
 	{
-		s_ctx->destroyVertexDecl(_handle);
+		s_ctx->destroyVertexLayout(_handle);
 	}
 	}
 
 
-	VertexBufferHandle createVertexBuffer(const Memory* _mem, const VertexDecl& _decl, uint16_t _flags)
+	VertexBufferHandle createVertexBuffer(const Memory* _mem, const VertexLayout& _decl, uint16_t _flags)
 	{
 	{
 		BX_CHECK(NULL != _mem, "_mem can't be NULL");
 		BX_CHECK(NULL != _mem, "_mem can't be NULL");
-		BX_CHECK(isValid(_decl), "Invalid VertexDecl.");
+		BX_CHECK(isValid(_decl), "Invalid VertexLayout.");
 		return s_ctx->createVertexBuffer(_mem, _decl, _flags);
 		return s_ctx->createVertexBuffer(_mem, _decl, _flags);
 	}
 	}
 
 
@@ -3986,16 +3986,16 @@ namespace bgfx
 		s_ctx->destroyDynamicIndexBuffer(_handle);
 		s_ctx->destroyDynamicIndexBuffer(_handle);
 	}
 	}
 
 
-	DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint16_t _flags)
+	DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexLayout& _decl, uint16_t _flags)
 	{
 	{
-		BX_CHECK(isValid(_decl), "Invalid VertexDecl.");
+		BX_CHECK(isValid(_decl), "Invalid VertexLayout.");
 		return s_ctx->createDynamicVertexBuffer(_num, _decl, _flags);
 		return s_ctx->createDynamicVertexBuffer(_num, _decl, _flags);
 	}
 	}
 
 
-	DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexDecl& _decl, uint16_t _flags)
+	DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexLayout& _decl, uint16_t _flags)
 	{
 	{
 		BX_CHECK(NULL != _mem, "_mem can't be NULL");
 		BX_CHECK(NULL != _mem, "_mem can't be NULL");
-		BX_CHECK(isValid(_decl), "Invalid VertexDecl.");
+		BX_CHECK(isValid(_decl), "Invalid VertexLayout.");
 		return s_ctx->createDynamicVertexBuffer(_mem, _decl, _flags);
 		return s_ctx->createDynamicVertexBuffer(_mem, _decl, _flags);
 	}
 	}
 
 
@@ -4016,10 +4016,10 @@ namespace bgfx
 		return s_ctx->getAvailTransientIndexBuffer(_num);
 		return s_ctx->getAvailTransientIndexBuffer(_num);
 	}
 	}
 
 
-	uint32_t getAvailTransientVertexBuffer(uint32_t _num, const VertexDecl& _decl)
+	uint32_t getAvailTransientVertexBuffer(uint32_t _num, const VertexLayout& _decl)
 	{
 	{
 		BX_CHECK(0 < _num, "Requesting 0 vertices.");
 		BX_CHECK(0 < _num, "Requesting 0 vertices.");
-		BX_CHECK(isValid(_decl), "Invalid VertexDecl.");
+		BX_CHECK(isValid(_decl), "Invalid VertexLayout.");
 		return s_ctx->getAvailTransientVertexBuffer(_num, _decl.m_stride);
 		return s_ctx->getAvailTransientVertexBuffer(_num, _decl.m_stride);
 	}
 	}
 
 
@@ -4042,11 +4042,11 @@ namespace bgfx
 			);
 			);
 	}
 	}
 
 
-	void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, const VertexDecl& _decl)
+	void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, const VertexLayout& _decl)
 	{
 	{
 		BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
 		BX_CHECK(NULL != _tvb, "_tvb can't be NULL");
 		BX_CHECK(0 < _num, "Requesting 0 vertices.");
 		BX_CHECK(0 < _num, "Requesting 0 vertices.");
-		BX_CHECK(isValid(_decl), "Invalid VertexDecl.");
+		BX_CHECK(isValid(_decl), "Invalid VertexLayout.");
 		s_ctx->allocTransientVertexBuffer(_tvb, _num, _decl);
 		s_ctx->allocTransientVertexBuffer(_tvb, _num, _decl);
 		BX_CHECK(_num == _tvb->size / _decl.m_stride
 		BX_CHECK(_num == _tvb->size / _decl.m_stride
 			, "Failed to allocate transient vertex buffer (requested %d, available %d). "
 			, "Failed to allocate transient vertex buffer (requested %d, available %d). "
@@ -4056,7 +4056,7 @@ namespace bgfx
 			);
 			);
 	}
 	}
 
 
-	bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexDecl& _decl, uint32_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint32_t _numIndices)
+	bool allocTransientBuffers(bgfx::TransientVertexBuffer* _tvb, const bgfx::VertexLayout& _decl, uint32_t _numVertices, bgfx::TransientIndexBuffer* _tib, uint32_t _numIndices)
 	{
 	{
 		BGFX_MUTEX_SCOPE(s_ctx->m_resourceApiLock);
 		BGFX_MUTEX_SCOPE(s_ctx->m_resourceApiLock);
 
 
@@ -4833,7 +4833,7 @@ namespace bgfx
 		, VertexBufferHandle _handle
 		, VertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 		)
 		)
 	{
 	{
 		BGFX_CHECK_API_THREAD();
 		BGFX_CHECK_API_THREAD();
@@ -4850,7 +4850,7 @@ namespace bgfx
 		, DynamicVertexBufferHandle _handle
 		, DynamicVertexBufferHandle _handle
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 		)
 		)
 	{
 	{
 		BGFX_CHECK_API_THREAD();
 		BGFX_CHECK_API_THREAD();
@@ -4867,7 +4867,7 @@ namespace bgfx
 		, const TransientVertexBuffer* _tvb
 		, const TransientVertexBuffer* _tvb
 		, uint32_t _startVertex
 		, uint32_t _startVertex
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, VertexDeclHandle _declHandle
+		, VertexLayoutHandle _declHandle
 		)
 		)
 	{
 	{
 		BGFX_CHECK_API_THREAD();
 		BGFX_CHECK_API_THREAD();

+ 56 - 56
src/bgfx.idl.inl

@@ -31,7 +31,7 @@ BGFX_C99_ENUM_CHECK(bgfx::RenderFrame,          BGFX_RENDER_FRAME_COUNT);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory,                bgfx_memory_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Memory,                bgfx_memory_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform,             bgfx_transform_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Transform,             bgfx_transform_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats,                 bgfx_stats_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::Stats,                 bgfx_stats_t);
-BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexDecl,            bgfx_vertex_decl_t);
+BGFX_C99_STRUCT_SIZE_CHECK(bgfx::VertexLayout,          bgfx_vertex_layout_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer,  bgfx_transient_index_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientIndexBuffer,  bgfx_transient_index_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::TransientVertexBuffer, bgfx_transient_vertex_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer,    bgfx_instance_data_buffer_t);
 BGFX_C99_STRUCT_SIZE_CHECK(bgfx::InstanceDataBuffer,    bgfx_instance_data_buffer_t);
@@ -53,66 +53,66 @@ BGFX_C_API void bgfx_attachment_init(bgfx_attachment_t* _this, bgfx_texture_hand
 	This->init(handle.cpp, (bgfx::Access::Enum)_access, _layer, _mip, _resolve);
 	This->init(handle.cpp, (bgfx::Access::Enum)_access, _layer, _mip, _resolve);
 }
 }
 
 
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_begin(bgfx_vertex_decl_t* _this, bgfx_renderer_type_t _rendererType)
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_begin(bgfx_vertex_layout_t* _this, bgfx_renderer_type_t _rendererType)
 {
 {
-	bgfx::VertexDecl* This = (bgfx::VertexDecl*)_this;
-	return (bgfx_vertex_decl_t*)&This->begin((bgfx::RendererType::Enum)_rendererType);
+	bgfx::VertexLayout* This = (bgfx::VertexLayout*)_this;
+	return (bgfx_vertex_layout_t*)&This->begin((bgfx::RendererType::Enum)_rendererType);
 }
 }
 
 
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_add(bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt)
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_add(bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t _num, bgfx_attrib_type_t _type, bool _normalized, bool _asInt)
 {
 {
-	bgfx::VertexDecl* This = (bgfx::VertexDecl*)_this;
-	return (bgfx_vertex_decl_t*)&This->add((bgfx::Attrib::Enum)_attrib, _num, (bgfx::AttribType::Enum)_type, _normalized, _asInt);
+	bgfx::VertexLayout* This = (bgfx::VertexLayout*)_this;
+	return (bgfx_vertex_layout_t*)&This->add((bgfx::Attrib::Enum)_attrib, _num, (bgfx::AttribType::Enum)_type, _normalized, _asInt);
 }
 }
 
 
-BGFX_C_API void bgfx_vertex_decl_decode(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt)
+BGFX_C_API void bgfx_vertex_layout_decode(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib, uint8_t * _num, bgfx_attrib_type_t * _type, bool * _normalized, bool * _asInt)
 {
 {
-	const bgfx::VertexDecl* This = (const bgfx::VertexDecl*)_this;
+	const bgfx::VertexLayout* This = (const bgfx::VertexLayout*)_this;
 	bgfx::AttribType::Enum type;
 	bgfx::AttribType::Enum type;
 	This->decode((bgfx::Attrib::Enum)_attrib, *_num, type, *_normalized, *_asInt);
 	This->decode((bgfx::Attrib::Enum)_attrib, *_num, type, *_normalized, *_asInt);
 	*_type = (bgfx_attrib_type_t)type;
 	*_type = (bgfx_attrib_type_t)type;
 }
 }
 
 
-BGFX_C_API bool bgfx_vertex_decl_has(const bgfx_vertex_decl_t* _this, bgfx_attrib_t _attrib)
+BGFX_C_API bool bgfx_vertex_layout_has(const bgfx_vertex_layout_t* _this, bgfx_attrib_t _attrib)
 {
 {
-	const bgfx::VertexDecl* This = (const bgfx::VertexDecl*)_this;
+	const bgfx::VertexLayout* This = (const bgfx::VertexLayout*)_this;
 	return This->has((bgfx::Attrib::Enum)_attrib);
 	return This->has((bgfx::Attrib::Enum)_attrib);
 }
 }
 
 
-BGFX_C_API bgfx_vertex_decl_t* bgfx_vertex_decl_skip(bgfx_vertex_decl_t* _this, uint8_t _num)
+BGFX_C_API bgfx_vertex_layout_t* bgfx_vertex_layout_skip(bgfx_vertex_layout_t* _this, uint8_t _num)
 {
 {
-	bgfx::VertexDecl* This = (bgfx::VertexDecl*)_this;
-	return (bgfx_vertex_decl_t*)&This->skip(_num);
+	bgfx::VertexLayout* This = (bgfx::VertexLayout*)_this;
+	return (bgfx_vertex_layout_t*)&This->skip(_num);
 }
 }
 
 
-BGFX_C_API void bgfx_vertex_decl_end(bgfx_vertex_decl_t* _this)
+BGFX_C_API void bgfx_vertex_layout_end(bgfx_vertex_layout_t* _this)
 {
 {
-	bgfx::VertexDecl* This = (bgfx::VertexDecl*)_this;
+	bgfx::VertexLayout* This = (bgfx::VertexLayout*)_this;
 	This->end();
 	This->end();
 }
 }
 
 
-BGFX_C_API void bgfx_vertex_pack(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, void* _data, uint32_t _index)
+BGFX_C_API void bgfx_vertex_pack(const float _input[4], bool _inputNormalized, bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, void* _data, uint32_t _index)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	bgfx::vertexPack(_input, _inputNormalized, (bgfx::Attrib::Enum)_attr, decl, _data, _index);
 	bgfx::vertexPack(_input, _inputNormalized, (bgfx::Attrib::Enum)_attr, decl, _data, _index);
 }
 }
 
 
-BGFX_C_API void bgfx_vertex_unpack(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_decl_t * _decl, const void* _data, uint32_t _index)
+BGFX_C_API void bgfx_vertex_unpack(float _output[4], bgfx_attrib_t _attr, const bgfx_vertex_layout_t * _decl, const void* _data, uint32_t _index)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	bgfx::vertexUnpack(_output, (bgfx::Attrib::Enum)_attr, decl, _data, _index);
 	bgfx::vertexUnpack(_output, (bgfx::Attrib::Enum)_attr, decl, _data, _index);
 }
 }
 
 
-BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_decl_t * _dstDecl, void* _dstData, const bgfx_vertex_decl_t * _srcDecl, const void* _srcData, uint32_t _num)
+BGFX_C_API void bgfx_vertex_convert(const bgfx_vertex_layout_t * _dstDecl, void* _dstData, const bgfx_vertex_layout_t * _srcDecl, const void* _srcData, uint32_t _num)
 {
 {
-	const bgfx::VertexDecl & dstDecl = *(const bgfx::VertexDecl *)_dstDecl;
-	const bgfx::VertexDecl & srcDecl = *(const bgfx::VertexDecl *)_srcDecl;
+	const bgfx::VertexLayout & dstDecl = *(const bgfx::VertexLayout *)_dstDecl;
+	const bgfx::VertexLayout & srcDecl = *(const bgfx::VertexLayout *)_srcDecl;
 	bgfx::vertexConvert(dstDecl, _dstData, srcDecl, _srcData, _num);
 	bgfx::vertexConvert(dstDecl, _dstData, srcDecl, _srcData, _num);
 }
 }
 
 
-BGFX_C_API uint16_t bgfx_weld_vertices(uint16_t* _output, const bgfx_vertex_decl_t * _decl, const void* _data, uint16_t _num, float _epsilon)
+BGFX_C_API uint16_t bgfx_weld_vertices(uint16_t* _output, const bgfx_vertex_layout_t * _decl, const void* _data, uint16_t _num, float _epsilon)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	return bgfx::weldVertices(_output, decl, _data, _num, _epsilon);
 	return bgfx::weldVertices(_output, decl, _data, _num, _epsilon);
 }
 }
 
 
@@ -237,23 +237,23 @@ BGFX_C_API void bgfx_destroy_index_buffer(bgfx_index_buffer_handle_t _handle)
 	bgfx::destroy(handle.cpp);
 	bgfx::destroy(handle.cpp);
 }
 }
 
 
-BGFX_C_API bgfx_vertex_decl_handle_t bgfx_create_vertex_decl(const bgfx_vertex_decl_t * _decl)
+BGFX_C_API bgfx_vertex_layout_handle_t bgfx_create_vertex_layout(const bgfx_vertex_layout_t * _decl)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
-	union { bgfx_vertex_decl_handle_t c; bgfx::VertexDeclHandle cpp; } handle_ret;
-	handle_ret.cpp = bgfx::createVertexDecl(decl);
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
+	union { bgfx_vertex_layout_handle_t c; bgfx::VertexLayoutHandle cpp; } handle_ret;
+	handle_ret.cpp = bgfx::createVertexLayout(decl);
 	return handle_ret.c;
 	return handle_ret.c;
 }
 }
 
 
-BGFX_C_API void bgfx_destroy_vertex_decl(bgfx_vertex_decl_handle_t _handle)
+BGFX_C_API void bgfx_destroy_vertex_decl(bgfx_vertex_layout_handle_t _handle)
 {
 {
-	union { bgfx_vertex_decl_handle_t c; bgfx::VertexDeclHandle cpp; } handle = { _handle };
+	union { bgfx_vertex_layout_handle_t c; bgfx::VertexLayoutHandle cpp; } handle = { _handle };
 	bgfx::destroy(handle.cpp);
 	bgfx::destroy(handle.cpp);
 }
 }
 
 
-BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t * _decl, uint16_t _flags)
+BGFX_C_API bgfx_vertex_buffer_handle_t bgfx_create_vertex_buffer(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t * _decl, uint16_t _flags)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle_ret;
 	union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle_ret;
 	handle_ret.cpp = bgfx::createVertexBuffer((const bgfx::Memory*)_mem, decl, _flags);
 	handle_ret.cpp = bgfx::createVertexBuffer((const bgfx::Memory*)_mem, decl, _flags);
 	return handle_ret.c;
 	return handle_ret.c;
@@ -297,17 +297,17 @@ BGFX_C_API void bgfx_destroy_dynamic_index_buffer(bgfx_dynamic_index_buffer_hand
 	bgfx::destroy(handle.cpp);
 	bgfx::destroy(handle.cpp);
 }
 }
 
 
-BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t* _decl, uint16_t _flags)
+BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer(uint32_t _num, const bgfx_vertex_layout_t* _decl, uint16_t _flags)
 {
 {
-	const bgfx::VertexDecl& decl = *(const bgfx::VertexDecl*)_decl;
+	const bgfx::VertexLayout& decl = *(const bgfx::VertexLayout*)_decl;
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle_ret;
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle_ret;
 	handle_ret.cpp = bgfx::createDynamicVertexBuffer(_num, decl, _flags);
 	handle_ret.cpp = bgfx::createDynamicVertexBuffer(_num, decl, _flags);
 	return handle_ret.c;
 	return handle_ret.c;
 }
 }
 
 
-BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const bgfx_memory_t* _mem, const bgfx_vertex_decl_t* _decl, uint16_t _flags)
+BGFX_C_API bgfx_dynamic_vertex_buffer_handle_t bgfx_create_dynamic_vertex_buffer_mem(const bgfx_memory_t* _mem, const bgfx_vertex_layout_t* _decl, uint16_t _flags)
 {
 {
-	const bgfx::VertexDecl& decl = *(const bgfx::VertexDecl*)_decl;
+	const bgfx::VertexLayout& decl = *(const bgfx::VertexLayout*)_decl;
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle_ret;
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle_ret;
 	handle_ret.cpp = bgfx::createDynamicVertexBuffer((const bgfx::Memory*)_mem, decl, _flags);
 	handle_ret.cpp = bgfx::createDynamicVertexBuffer((const bgfx::Memory*)_mem, decl, _flags);
 	return handle_ret.c;
 	return handle_ret.c;
@@ -330,9 +330,9 @@ BGFX_C_API uint32_t bgfx_get_avail_transient_index_buffer(uint32_t _num)
 	return bgfx::getAvailTransientIndexBuffer(_num);
 	return bgfx::getAvailTransientIndexBuffer(_num);
 }
 }
 
 
-BGFX_C_API uint32_t bgfx_get_avail_transient_vertex_buffer(uint32_t _num, const bgfx_vertex_decl_t * _decl)
+BGFX_C_API uint32_t bgfx_get_avail_transient_vertex_buffer(uint32_t _num, const bgfx_vertex_layout_t * _decl)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	return bgfx::getAvailTransientVertexBuffer(_num, decl);
 	return bgfx::getAvailTransientVertexBuffer(_num, decl);
 }
 }
 
 
@@ -346,15 +346,15 @@ BGFX_C_API void bgfx_alloc_transient_index_buffer(bgfx_transient_index_buffer_t*
 	bgfx::allocTransientIndexBuffer((bgfx::TransientIndexBuffer*)_tib, _num);
 	bgfx::allocTransientIndexBuffer((bgfx::TransientIndexBuffer*)_tib, _num);
 }
 }
 
 
-BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_decl_t * _decl)
+BGFX_C_API void bgfx_alloc_transient_vertex_buffer(bgfx_transient_vertex_buffer_t* _tvb, uint32_t _num, const bgfx_vertex_layout_t * _decl)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	bgfx::allocTransientVertexBuffer((bgfx::TransientVertexBuffer*)_tvb, _num, decl);
 	bgfx::allocTransientVertexBuffer((bgfx::TransientVertexBuffer*)_tvb, _num, decl);
 }
 }
 
 
-BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_decl_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices)
+BGFX_C_API bool bgfx_alloc_transient_buffers(bgfx_transient_vertex_buffer_t* _tvb, const bgfx_vertex_layout_t * _decl, uint32_t _numVertices, bgfx_transient_index_buffer_t* _tib, uint32_t _numIndices)
 {
 {
-	const bgfx::VertexDecl & decl = *(const bgfx::VertexDecl *)_decl;
+	const bgfx::VertexLayout & decl = *(const bgfx::VertexLayout *)_decl;
 	return bgfx::allocTransientBuffers((bgfx::TransientVertexBuffer*)_tvb, decl, _numVertices, (bgfx::TransientIndexBuffer*)_tib, _numIndices);
 	return bgfx::allocTransientBuffers((bgfx::TransientVertexBuffer*)_tvb, decl, _numVertices, (bgfx::TransientIndexBuffer*)_tib, _numIndices);
 }
 }
 
 
@@ -759,26 +759,26 @@ BGFX_C_API void bgfx_encoder_set_transient_index_buffer(bgfx_encoder_t* _this, c
 	This->setIndexBuffer((const bgfx::TransientIndexBuffer*)_tib, _firstIndex, _numIndices);
 	This->setIndexBuffer((const bgfx::TransientIndexBuffer*)_tib, _firstIndex, _numIndices);
 }
 }
 
 
-BGFX_C_API void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle)
+BGFX_C_API void bgfx_encoder_set_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle)
 {
 {
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
 	union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle };
 	union { bgfx_vertex_buffer_handle_t c; bgfx::VertexBufferHandle cpp; } handle = { _handle };
-	union { bgfx_vertex_decl_handle_t c; bgfx::VertexDeclHandle cpp; } declHandle = { _declHandle };
+	union { bgfx_vertex_layout_handle_t c; bgfx::VertexLayoutHandle cpp; } declHandle = { _declHandle };
 	This->setVertexBuffer(_stream, handle.cpp, _startVertex, _numVertices, declHandle.cpp);
 	This->setVertexBuffer(_stream, handle.cpp, _startVertex, _numVertices, declHandle.cpp);
 }
 }
 
 
-BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle)
+BGFX_C_API void bgfx_encoder_set_dynamic_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, bgfx_dynamic_vertex_buffer_handle_t _handle, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle)
 {
 {
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
 	union { bgfx_dynamic_vertex_buffer_handle_t c; bgfx::DynamicVertexBufferHandle cpp; } handle = { _handle };
-	union { bgfx_vertex_decl_handle_t c; bgfx::VertexDeclHandle cpp; } declHandle = { _declHandle };
+	union { bgfx_vertex_layout_handle_t c; bgfx::VertexLayoutHandle cpp; } declHandle = { _declHandle };
 	This->setVertexBuffer(_stream, handle.cpp, _startVertex, _numVertices, declHandle.cpp);
 	This->setVertexBuffer(_stream, handle.cpp, _startVertex, _numVertices, declHandle.cpp);
 }
 }
 
 
-BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_decl_handle_t _declHandle)
+BGFX_C_API void bgfx_encoder_set_transient_vertex_buffer(bgfx_encoder_t* _this, uint8_t _stream, const bgfx_transient_vertex_buffer_t* _tvb, uint32_t _startVertex, uint32_t _numVertices, bgfx_vertex_layout_handle_t _declHandle)
 {
 {
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
 	bgfx::Encoder* This = (bgfx::Encoder*)_this;
-	union { bgfx_vertex_decl_handle_t c; bgfx::VertexDeclHandle cpp; } declHandle = { _declHandle };
+	union { bgfx_vertex_layout_handle_t c; bgfx::VertexLayoutHandle cpp; } declHandle = { _declHandle };
 	This->setVertexBuffer(_stream, (const bgfx::TransientVertexBuffer*)_tvb, _startVertex, _numVertices, declHandle.cpp);
 	This->setVertexBuffer(_stream, (const bgfx::TransientVertexBuffer*)_tvb, _startVertex, _numVertices, declHandle.cpp);
 }
 }
 
 
@@ -1203,12 +1203,12 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
 		static bgfx_interface_vtbl_t s_bgfx_interface =
 		static bgfx_interface_vtbl_t s_bgfx_interface =
 		{
 		{
 			bgfx_attachment_init,
 			bgfx_attachment_init,
-			bgfx_vertex_decl_begin,
-			bgfx_vertex_decl_add,
-			bgfx_vertex_decl_decode,
-			bgfx_vertex_decl_has,
-			bgfx_vertex_decl_skip,
-			bgfx_vertex_decl_end,
+			bgfx_vertex_layout_begin,
+			bgfx_vertex_layout_add,
+			bgfx_vertex_layout_decode,
+			bgfx_vertex_layout_has,
+			bgfx_vertex_layout_skip,
+			bgfx_vertex_layout_end,
 			bgfx_vertex_pack,
 			bgfx_vertex_pack,
 			bgfx_vertex_unpack,
 			bgfx_vertex_unpack,
 			bgfx_vertex_convert,
 			bgfx_vertex_convert,
@@ -1237,7 +1237,7 @@ BGFX_C_API bgfx_interface_vtbl_t* bgfx_get_interface(uint32_t _version)
 			bgfx_create_index_buffer,
 			bgfx_create_index_buffer,
 			bgfx_set_index_buffer_name,
 			bgfx_set_index_buffer_name,
 			bgfx_destroy_index_buffer,
 			bgfx_destroy_index_buffer,
-			bgfx_create_vertex_decl,
+			bgfx_create_vertex_layout,
 			bgfx_destroy_vertex_decl,
 			bgfx_destroy_vertex_decl,
 			bgfx_create_vertex_buffer,
 			bgfx_create_vertex_buffer,
 			bgfx_set_vertex_buffer_name,
 			bgfx_set_vertex_buffer_name,

+ 58 - 58
src/bgfx_p.h

@@ -74,7 +74,7 @@ namespace bgfx
 
 
 	void trace(const char* _filePath, uint16_t _line, const char* _format, ...);
 	void trace(const char* _filePath, uint16_t _line, const char* _format, ...);
 
 
-	inline bool operator==(const VertexDeclHandle& _lhs, const VertexDeclHandle& _rhs) { return _lhs.idx == _rhs.idx; }
+	inline bool operator==(const VertexLayoutHandle& _lhs, const VertexLayoutHandle& _rhs) { return _lhs.idx == _rhs.idx; }
 	inline bool operator==(const UniformHandle& _lhs,    const UniformHandle&    _rhs) { return _lhs.idx == _rhs.idx; }
 	inline bool operator==(const UniformHandle& _lhs,    const UniformHandle&    _rhs) { return _lhs.idx == _rhs.idx; }
 }
 }
 
 
@@ -313,7 +313,7 @@ namespace bgfx
 
 
 	const char* getTypeName(Handle _handle);
 	const char* getTypeName(Handle _handle);
 
 
-	inline bool isValid(const VertexDecl& _decl)
+	inline bool isValid(const VertexLayout& _decl)
 	{
 	{
 		return 0 != _decl.m_stride;
 		return 0 != _decl.m_stride;
 	}
 	}
@@ -543,7 +543,7 @@ namespace bgfx
 	}
 	}
 
 
 	/// Dump vertex declaration into debug output.
 	/// Dump vertex declaration into debug output.
-	void dump(const VertexDecl& _decl);
+	void dump(const VertexLayout& _decl);
 
 
 	struct TextVideoMem
 	struct TextVideoMem
 	{
 	{
@@ -657,7 +657,7 @@ namespace bgfx
 		TextureHandle m_texture;
 		TextureHandle m_texture;
 		TransientVertexBuffer* m_vb;
 		TransientVertexBuffer* m_vb;
 		TransientIndexBuffer* m_ib;
 		TransientIndexBuffer* m_ib;
-		VertexDecl m_decl;
+		VertexLayout m_decl;
 		ProgramHandle m_program;
 		ProgramHandle m_program;
 	};
 	};
 
 
@@ -727,7 +727,7 @@ namespace bgfx
 		void shutdown();
 		void shutdown();
 
 
 		VertexBufferHandle m_vb;
 		VertexBufferHandle m_vb;
-		VertexDecl m_decl;
+		VertexLayout m_decl;
 		ProgramHandle m_program[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
 		ProgramHandle m_program[BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS];
 	};
 	};
 
 
@@ -779,7 +779,7 @@ namespace bgfx
 		{
 		{
 			RendererInit,
 			RendererInit,
 			RendererShutdownBegin,
 			RendererShutdownBegin,
-			CreateVertexDecl,
+			CreateVertexLayout,
 			CreateIndexBuffer,
 			CreateIndexBuffer,
 			CreateVertexBuffer,
 			CreateVertexBuffer,
 			CreateDynamicIndexBuffer,
 			CreateDynamicIndexBuffer,
@@ -798,7 +798,7 @@ namespace bgfx
 			SetName,
 			SetName,
 			End,
 			End,
 			RendererShutdownEnd,
 			RendererShutdownEnd,
-			DestroyVertexDecl,
+			DestroyVertexLayout,
 			DestroyIndexBuffer,
 			DestroyIndexBuffer,
 			DestroyVertexBuffer,
 			DestroyVertexBuffer,
 			DestroyDynamicIndexBuffer,
 			DestroyDynamicIndexBuffer,
@@ -1538,7 +1538,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 
 
 		uint32_t           m_startVertex;
 		uint32_t           m_startVertex;
 		VertexBufferHandle m_handle;
 		VertexBufferHandle m_handle;
-		VertexDeclHandle   m_decl;
+		VertexLayoutHandle   m_decl;
 	};
 	};
 
 
 	BX_ALIGN_DECL_CACHE_LINE(struct) RenderBind
 	BX_ALIGN_DECL_CACHE_LINE(struct) RenderBind
@@ -1710,7 +1710,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 		uint32_t m_startVertex;
 		uint32_t m_startVertex;
 		uint32_t m_numVertices;
 		uint32_t m_numVertices;
 		uint16_t m_stride;
 		uint16_t m_stride;
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 		uint16_t m_flags;
 		uint16_t m_flags;
 	};
 	};
 
 
@@ -2024,7 +2024,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return m_freeIndexBuffer.queue(_handle);
 			return m_freeIndexBuffer.queue(_handle);
 		}
 		}
 
 
-		bool free(VertexDeclHandle _handle)
+		bool free(VertexLayoutHandle _handle)
 		{
 		{
 			return m_freeVertexDecl.queue(_handle);
 			return m_freeVertexDecl.queue(_handle);
 		}
 		}
@@ -2160,7 +2160,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 		};
 		};
 
 
 		FreeHandle<IndexBufferHandle,  BGFX_CONFIG_MAX_INDEX_BUFFERS>  m_freeIndexBuffer;
 		FreeHandle<IndexBufferHandle,  BGFX_CONFIG_MAX_INDEX_BUFFERS>  m_freeIndexBuffer;
-		FreeHandle<VertexDeclHandle,   BGFX_CONFIG_MAX_VERTEX_DECLS>   m_freeVertexDecl;
+		FreeHandle<VertexLayoutHandle, BGFX_CONFIG_MAX_VERTEX_DECLS>   m_freeVertexDecl;
 		FreeHandle<VertexBufferHandle, BGFX_CONFIG_MAX_VERTEX_BUFFERS> m_freeVertexBuffer;
 		FreeHandle<VertexBufferHandle, BGFX_CONFIG_MAX_VERTEX_BUFFERS> m_freeVertexBuffer;
 		FreeHandle<ShaderHandle,       BGFX_CONFIG_MAX_SHADERS>        m_freeShader;
 		FreeHandle<ShaderHandle,       BGFX_CONFIG_MAX_SHADERS>        m_freeShader;
 		FreeHandle<ProgramHandle,      BGFX_CONFIG_MAX_PROGRAMS>       m_freeProgram;
 		FreeHandle<ProgramHandle,      BGFX_CONFIG_MAX_PROGRAMS>       m_freeProgram;
@@ -2339,7 +2339,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			, VertexBufferHandle _handle
 			, VertexBufferHandle _handle
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle
+			, VertexLayoutHandle _declHandle
 			)
 			)
 		{
 		{
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
@@ -2359,7 +2359,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			, const DynamicVertexBuffer& _dvb
 			, const DynamicVertexBuffer& _dvb
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle
+			, VertexLayoutHandle _declHandle
 			)
 			)
 		{
 		{
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
@@ -2381,7 +2381,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			, const TransientVertexBuffer* _tvb
 			, const TransientVertexBuffer* _tvb
 			, uint32_t _startVertex
 			, uint32_t _startVertex
 			, uint32_t _numVertices
 			, uint32_t _numVertices
-			, VertexDeclHandle _declHandle
+			, VertexLayoutHandle _declHandle
 			)
 			)
 		{
 		{
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
 			BX_CHECK(UINT8_MAX != m_draw.m_streamMask, "");
@@ -2541,9 +2541,9 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 		int64_t m_cpuTimeEnd;
 		int64_t m_cpuTimeEnd;
 	};
 	};
 
 
-	struct VertexDeclRef
+	struct VertexLayoutRef
 	{
 	{
-		VertexDeclRef()
+		VertexLayoutRef()
 		{
 		{
 		}
 		}
 
 
@@ -2559,7 +2559,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 		{
 		{
 			for (uint16_t ii = 0, num = _handleAlloc.getNumHandles(); ii < num; ++ii)
 			for (uint16_t ii = 0, num = _handleAlloc.getNumHandles(); ii < num; ++ii)
 			{
 			{
-				VertexDeclHandle handle = { _handleAlloc.getHandleAt(ii) };
+				VertexLayoutHandle handle = { _handleAlloc.getHandleAt(ii) };
 				m_vertexDeclRef[handle.idx] = 0;
 				m_vertexDeclRef[handle.idx] = 0;
 				m_vertexDeclMap.removeByHandle(handle.idx);
 				m_vertexDeclMap.removeByHandle(handle.idx);
 				_handleAlloc.free(handle.idx);
 				_handleAlloc.free(handle.idx);
@@ -2568,19 +2568,19 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			m_vertexDeclMap.reset();
 			m_vertexDeclMap.reset();
 		}
 		}
 
 
-		VertexDeclHandle find(uint32_t _hash)
+		VertexLayoutHandle find(uint32_t _hash)
 		{
 		{
-			VertexDeclHandle handle = { m_vertexDeclMap.find(_hash) };
+			VertexLayoutHandle handle = { m_vertexDeclMap.find(_hash) };
 			return handle;
 			return handle;
 		}
 		}
 
 
-		void add(VertexDeclHandle _declHandle, uint32_t _hash)
+		void add(VertexLayoutHandle _declHandle, uint32_t _hash)
 		{
 		{
 			m_vertexDeclRef[_declHandle.idx]++;
 			m_vertexDeclRef[_declHandle.idx]++;
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 		}
 		}
 
 
-		void add(VertexBufferHandle _handle, VertexDeclHandle _declHandle, uint32_t _hash)
+		void add(VertexBufferHandle _handle, VertexLayoutHandle _declHandle, uint32_t _hash)
 		{
 		{
 			BX_CHECK(m_vertexBufferRef[_handle.idx].idx == kInvalidHandle, "");
 			BX_CHECK(m_vertexBufferRef[_handle.idx].idx == kInvalidHandle, "");
 			m_vertexBufferRef[_handle.idx] = _declHandle;
 			m_vertexBufferRef[_handle.idx] = _declHandle;
@@ -2588,7 +2588,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 		}
 		}
 
 
-		void add(DynamicVertexBufferHandle _handle, VertexDeclHandle _declHandle, uint32_t _hash)
+		void add(DynamicVertexBufferHandle _handle, VertexLayoutHandle _declHandle, uint32_t _hash)
 		{
 		{
 			BX_CHECK(m_dynamicVertexBufferRef[_handle.idx].idx == kInvalidHandle, "");
 			BX_CHECK(m_dynamicVertexBufferRef[_handle.idx].idx == kInvalidHandle, "");
 			m_dynamicVertexBufferRef[_handle.idx] = _declHandle;
 			m_dynamicVertexBufferRef[_handle.idx] = _declHandle;
@@ -2596,7 +2596,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 			m_vertexDeclMap.insert(_hash, _declHandle.idx);
 		}
 		}
 
 
-		VertexDeclHandle release(VertexDeclHandle _declHandle)
+		VertexLayoutHandle release(VertexLayoutHandle _declHandle)
 		{
 		{
 			if (isValid(_declHandle) )
 			if (isValid(_declHandle) )
 			{
 			{
@@ -2612,30 +2612,30 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return BGFX_INVALID_HANDLE;
 			return BGFX_INVALID_HANDLE;
 		}
 		}
 
 
-		VertexDeclHandle release(VertexBufferHandle _handle)
+		VertexLayoutHandle release(VertexBufferHandle _handle)
 		{
 		{
-			VertexDeclHandle declHandle = m_vertexBufferRef[_handle.idx];
+			VertexLayoutHandle declHandle = m_vertexBufferRef[_handle.idx];
 			declHandle = release(declHandle);
 			declHandle = release(declHandle);
 			m_vertexBufferRef[_handle.idx].idx = kInvalidHandle;
 			m_vertexBufferRef[_handle.idx].idx = kInvalidHandle;
 
 
 			return declHandle;
 			return declHandle;
 		}
 		}
 
 
-		VertexDeclHandle release(DynamicVertexBufferHandle _handle)
+		VertexLayoutHandle release(DynamicVertexBufferHandle _handle)
 		{
 		{
-			VertexDeclHandle declHandle = m_dynamicVertexBufferRef[_handle.idx];
+			VertexLayoutHandle declHandle = m_dynamicVertexBufferRef[_handle.idx];
 			declHandle = release(declHandle);
 			declHandle = release(declHandle);
 			m_dynamicVertexBufferRef[_handle.idx].idx = kInvalidHandle;
 			m_dynamicVertexBufferRef[_handle.idx].idx = kInvalidHandle;
 
 
 			return declHandle;
 			return declHandle;
 		}
 		}
 
 
-		typedef bx::HandleHashMapT<BGFX_CONFIG_MAX_VERTEX_DECLS*2> VertexDeclMap;
-		VertexDeclMap m_vertexDeclMap;
+		typedef bx::HandleHashMapT<BGFX_CONFIG_MAX_VERTEX_DECLS*2> VertexLayoutMap;
+		VertexLayoutMap m_vertexDeclMap;
 
 
 		uint16_t m_vertexDeclRef[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		uint16_t m_vertexDeclRef[BGFX_CONFIG_MAX_VERTEX_DECLS];
-		VertexDeclHandle m_vertexBufferRef[BGFX_CONFIG_MAX_VERTEX_BUFFERS];
-		VertexDeclHandle m_dynamicVertexBufferRef[BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS];
+		VertexLayoutHandle m_vertexBufferRef[BGFX_CONFIG_MAX_VERTEX_BUFFERS];
+		VertexLayoutHandle m_dynamicVertexBufferRef[BGFX_CONFIG_MAX_DYNAMIC_VERTEX_BUFFERS];
 	};
 	};
 
 
 	// First-fit non-local allocator.
 	// First-fit non-local allocator.
@@ -2772,9 +2772,9 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 		virtual void flip() = 0;
 		virtual void flip() = 0;
 		virtual void createIndexBuffer(IndexBufferHandle _handle, const Memory* _mem, uint16_t _flags) = 0;
 		virtual void createIndexBuffer(IndexBufferHandle _handle, const Memory* _mem, uint16_t _flags) = 0;
 		virtual void destroyIndexBuffer(IndexBufferHandle _handle) = 0;
 		virtual void destroyIndexBuffer(IndexBufferHandle _handle) = 0;
-		virtual void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) = 0;
-		virtual void destroyVertexDecl(VertexDeclHandle _handle) = 0;
-		virtual void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) = 0;
+		virtual void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) = 0;
+		virtual void destroyVertexLayout(VertexLayoutHandle _handle) = 0;
+		virtual void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) = 0;
 		virtual void destroyVertexBuffer(VertexBufferHandle _handle) = 0;
 		virtual void destroyVertexBuffer(VertexBufferHandle _handle) = 0;
 		virtual void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) = 0;
 		virtual void createDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _size, uint16_t _flags) = 0;
 		virtual void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) = 0;
 		virtual void updateDynamicIndexBuffer(IndexBufferHandle _handle, uint32_t _offset, uint32_t _size, const Memory* _mem) = 0;
@@ -2964,7 +2964,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			stats.numTextures             = m_textureHandle.getNumHandles();
 			stats.numTextures             = m_textureHandle.getNumHandles();
 			stats.numUniforms             = m_uniformHandle.getNumHandles();
 			stats.numUniforms             = m_uniformHandle.getNumHandles();
 			stats.numVertexBuffers        = m_vertexBufferHandle.getNumHandles();
 			stats.numVertexBuffers        = m_vertexBufferHandle.getNumHandles();
-			stats.numVertexDecls          = m_vertexDeclHandle.getNumHandles();
+			stats.numVertexLayouts        = m_vertexDeclHandle.getNumHandles();
 
 
 			stats.textureMemoryUsed = m_textureMemoryUsed;
 			stats.textureMemoryUsed = m_textureMemoryUsed;
 			stats.rtMemoryUsed      = m_rtMemoryUsed;
 			stats.rtMemoryUsed      = m_rtMemoryUsed;
@@ -3026,9 +3026,9 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			cmdbuf.write(_handle);
 			cmdbuf.write(_handle);
 		}
 		}
 
 
-		VertexDeclHandle findVertexDecl(const VertexDecl& _decl)
+		VertexLayoutHandle findVertexLayout(const VertexLayout& _decl)
 		{
 		{
-			VertexDeclHandle declHandle = m_declRef.find(_decl.m_hash);
+			VertexLayoutHandle declHandle = m_declRef.find(_decl.m_hash);
 
 
 			if (!isValid(declHandle) )
 			if (!isValid(declHandle) )
 			{
 			{
@@ -3038,7 +3038,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 					return declHandle;
 					return declHandle;
 				}
 				}
 
 
-				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateVertexDecl);
+				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateVertexLayout);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(_decl);
 				cmdbuf.write(_decl);
 			}
 			}
@@ -3046,11 +3046,11 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return declHandle;
 			return declHandle;
 		}
 		}
 
 
-		BGFX_API_FUNC(VertexDeclHandle createVertexDecl(const VertexDecl& _decl) )
+		BGFX_API_FUNC(VertexLayoutHandle createVertexLayout(const VertexLayout& _decl) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 
 
-			VertexDeclHandle handle = findVertexDecl(_decl);
+			VertexLayoutHandle handle = findVertexLayout(_decl);
 			if (!isValid(handle) )
 			if (!isValid(handle) )
 			{
 			{
 				BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
 				BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
@@ -3062,13 +3062,13 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return handle;
 			return handle;
 		}
 		}
 
 
-		BGFX_API_FUNC(void destroyVertexDecl(VertexDeclHandle _handle) )
+		BGFX_API_FUNC(void destroyVertexLayout(VertexLayoutHandle _handle) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			m_declRef.release(_handle);
 			m_declRef.release(_handle);
 		}
 		}
 
 
-		BGFX_API_FUNC(VertexBufferHandle createVertexBuffer(const Memory* _mem, const VertexDecl& _decl, uint16_t _flags) )
+		BGFX_API_FUNC(VertexBufferHandle createVertexBuffer(const Memory* _mem, const VertexLayout& _decl, uint16_t _flags) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 
 
@@ -3076,7 +3076,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 
 
 			if (isValid(handle) )
 			if (isValid(handle) )
 			{
 			{
-				VertexDeclHandle declHandle = findVertexDecl(_decl);
+				VertexLayoutHandle declHandle = findVertexLayout(_decl);
 				if (!isValid(declHandle) )
 				if (!isValid(declHandle) )
 				{
 				{
 					BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
 					BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
@@ -3136,10 +3136,10 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 
 
 		void destroyVertexBufferInternal(VertexBufferHandle _handle)
 		void destroyVertexBufferInternal(VertexBufferHandle _handle)
 		{
 		{
-			VertexDeclHandle declHandle = m_declRef.release(_handle);
+			VertexLayoutHandle declHandle = m_declRef.release(_handle);
 			if (isValid(declHandle) )
 			if (isValid(declHandle) )
 			{
 			{
-				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexDecl);
+				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexLayout);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(declHandle);
 				m_render->free(declHandle);
 				m_render->free(declHandle);
 			}
 			}
@@ -3353,11 +3353,11 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return ptr;
 			return ptr;
 		}
 		}
 
 
-		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexDecl& _decl, uint16_t _flags) )
+		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(uint32_t _num, const VertexLayout& _decl, uint16_t _flags) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 
 
-			VertexDeclHandle declHandle = findVertexDecl(_decl);
+			VertexLayoutHandle declHandle = findVertexLayout(_decl);
 			if (!isValid(declHandle) )
 			if (!isValid(declHandle) )
 			{
 			{
 				BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
 				BX_TRACE("WARNING: Failed to allocate vertex decl handle (BGFX_CONFIG_MAX_VERTEX_DECLS, max: %d).", BGFX_CONFIG_MAX_VERTEX_DECLS);
@@ -3421,7 +3421,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			return handle;
 			return handle;
 		}
 		}
 
 
-		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexDecl& _decl, uint16_t _flags) )
+		BGFX_API_FUNC(DynamicVertexBufferHandle createDynamicVertexBuffer(const Memory* _mem, const VertexLayout& _decl, uint16_t _flags) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 
 
@@ -3492,12 +3492,12 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 
 
 		void destroyDynamicVertexBufferInternal(DynamicVertexBufferHandle _handle)
 		void destroyDynamicVertexBufferInternal(DynamicVertexBufferHandle _handle)
 		{
 		{
-			VertexDeclHandle declHandle = m_declRef.release(_handle);
+			VertexLayoutHandle declHandle = m_declRef.release(_handle);
 			BGFX_CHECK_HANDLE_INVALID_OK("destroyDynamicVertexBufferInternal", m_vertexDeclHandle, declHandle);
 			BGFX_CHECK_HANDLE_INVALID_OK("destroyDynamicVertexBufferInternal", m_vertexDeclHandle, declHandle);
 
 
 			if (isValid(declHandle) )
 			if (isValid(declHandle) )
 			{
 			{
-				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexDecl);
+				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::DestroyVertexLayout);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(declHandle);
 				m_render->free(declHandle);
 				m_render->free(declHandle);
 			}
 			}
@@ -3587,7 +3587,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			_tib->startIndex = bx::strideAlign(offset, 2)/2;
 			_tib->startIndex = bx::strideAlign(offset, 2)/2;
 		}
 		}
 
 
-		TransientVertexBuffer* createTransientVertexBuffer(uint32_t _size, const VertexDecl* _decl = NULL)
+		TransientVertexBuffer* createTransientVertexBuffer(uint32_t _size, const VertexLayout* _decl = NULL)
 		{
 		{
 			TransientVertexBuffer* tvb = NULL;
 			TransientVertexBuffer* tvb = NULL;
 
 
@@ -3597,11 +3597,11 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			if (isValid(handle) )
 			if (isValid(handle) )
 			{
 			{
 				uint16_t stride = 0;
 				uint16_t stride = 0;
-				VertexDeclHandle declHandle = BGFX_INVALID_HANDLE;
+				VertexLayoutHandle declHandle = BGFX_INVALID_HANDLE;
 
 
 				if (NULL != _decl)
 				if (NULL != _decl)
 				{
 				{
-					declHandle = findVertexDecl(*_decl);
+					declHandle = findVertexLayout(*_decl);
 					m_declRef.add(handle, declHandle, _decl->m_hash);
 					m_declRef.add(handle, declHandle, _decl->m_hash);
 
 
 					stride = _decl->m_stride;
 					stride = _decl->m_stride;
@@ -3637,19 +3637,19 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 			BX_ALIGNED_FREE(g_allocator, _tvb, 16);
 			BX_ALIGNED_FREE(g_allocator, _tvb, 16);
 		}
 		}
 
 
-		BGFX_API_FUNC(void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, const VertexDecl& _decl) )
+		BGFX_API_FUNC(void allocTransientVertexBuffer(TransientVertexBuffer* _tvb, uint32_t _num, const VertexLayout& _decl) )
 		{
 		{
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 			BGFX_MUTEX_SCOPE(m_resourceApiLock);
 
 
-			VertexDeclHandle declHandle = m_declRef.find(_decl.m_hash);
+			VertexLayoutHandle declHandle = m_declRef.find(_decl.m_hash);
 
 
 			TransientVertexBuffer& dvb = *m_submit->m_transientVb;
 			TransientVertexBuffer& dvb = *m_submit->m_transientVb;
 
 
 			if (!isValid(declHandle) )
 			if (!isValid(declHandle) )
 			{
 			{
-				VertexDeclHandle temp = { m_vertexDeclHandle.alloc() };
+				VertexLayoutHandle temp = { m_vertexDeclHandle.alloc() };
 				declHandle = temp;
 				declHandle = temp;
-				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateVertexDecl);
+				CommandBuffer& cmdbuf = getCommandBuffer(CommandBuffer::CreateVertexLayout);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(declHandle);
 				cmdbuf.write(_decl);
 				cmdbuf.write(_decl);
 				m_declRef.add(declHandle, _decl.m_hash);
 				m_declRef.add(declHandle, _decl.m_hash);
@@ -4949,7 +4949,7 @@ constexpr uint64_t kSortKeyComputeProgramMask  = uint64_t(BGFX_CONFIG_MAX_PROGRA
 
 
 		TextureRef     m_textureRef[BGFX_CONFIG_MAX_TEXTURES];
 		TextureRef     m_textureRef[BGFX_CONFIG_MAX_TEXTURES];
 		FrameBufferRef m_frameBufferRef[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferRef m_frameBufferRef[BGFX_CONFIG_MAX_FRAME_BUFFERS];
-		VertexDeclRef  m_declRef;
+		VertexLayoutRef  m_declRef;
 
 
 		ViewId m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
 		ViewId m_viewRemap[BGFX_CONFIG_MAX_VIEWS];
 		uint32_t m_seq[BGFX_CONFIG_MAX_VIEWS];
 		uint32_t m_seq[BGFX_CONFIG_MAX_VIEWS];

+ 19 - 19
src/renderer_d3d11.cpp

@@ -348,7 +348,7 @@ namespace bgfx { namespace d3d11
 	};
 	};
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 
 
-	static D3D11_INPUT_ELEMENT_DESC* fillVertexDecl(uint8_t _stream, D3D11_INPUT_ELEMENT_DESC* _out, const VertexDecl& _decl)
+	static D3D11_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D11_INPUT_ELEMENT_DESC* _out, const VertexLayout& _decl)
 	{
 	{
 		D3D11_INPUT_ELEMENT_DESC* elem = _out;
 		D3D11_INPUT_ELEMENT_DESC* elem = _out;
 
 
@@ -1688,18 +1688,18 @@ namespace bgfx { namespace d3d11
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 		}
 		}
@@ -1726,7 +1726,7 @@ namespace bgfx { namespace d3d11
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 		}
 		}
 
 
@@ -2095,7 +2095,7 @@ namespace bgfx { namespace d3d11
 			deviceCtx->PSSetConstantBuffers(0, 1, &program.m_fsh->m_buffer);
 			deviceCtx->PSSetConstantBuffers(0, 1, &program.m_fsh->m_buffer);
 
 
 			VertexBufferD3D11& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
 			VertexBufferD3D11& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
-			VertexDecl& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
+			VertexLayout& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
 			uint32_t stride = vertexDecl.m_stride;
 			uint32_t stride = vertexDecl.m_stride;
 			uint32_t offset = 0;
 			uint32_t offset = 0;
 			deviceCtx->IASetVertexBuffers(0, 1, &vb.m_ptr, &stride, &offset);
 			deviceCtx->IASetVertexBuffers(0, 1, &vb.m_ptr, &stride, &offset);
@@ -2578,7 +2578,7 @@ namespace bgfx { namespace d3d11
 			}
 			}
 		}
 		}
 
 
-		void setInputLayout(uint8_t _numStreams, const VertexDecl** _vertexDecls, const ProgramD3D11& _program, uint16_t _numInstanceData)
+		void setInputLayout(uint8_t _numStreams, const VertexLayout** _vertexDecls, const ProgramD3D11& _program, uint16_t _numInstanceData)
 		{
 		{
 			bx::HashMurmur2A murmur;
 			bx::HashMurmur2A murmur;
 			murmur.begin();
 			murmur.begin();
@@ -2600,8 +2600,8 @@ namespace bgfx { namespace d3d11
 
 
 				for (uint8_t stream = 0; stream < _numStreams; ++stream)
 				for (uint8_t stream = 0; stream < _numStreams; ++stream)
 				{
 				{
-					VertexDecl decl;
-					bx::memCopy(&decl, _vertexDecls[stream], sizeof(VertexDecl) );
+					VertexLayout decl;
+					bx::memCopy(&decl, _vertexDecls[stream], sizeof(VertexLayout) );
 
 
 					const bool last = stream == _numStreams-1;
 					const bool last = stream == _numStreams-1;
 
 
@@ -2620,7 +2620,7 @@ namespace bgfx { namespace d3d11
 						}
 						}
 					}
 					}
 
 
-					elem = fillVertexDecl(stream, elem, decl);
+					elem = fillVertexLayout(stream, elem, decl);
 				}
 				}
 
 
 				uint32_t num = uint32_t(elem-vertexElements);
 				uint32_t num = uint32_t(elem-vertexElements);
@@ -2668,9 +2668,9 @@ namespace bgfx { namespace d3d11
 			m_deviceCtx->IASetInputLayout(layout);
 			m_deviceCtx->IASetInputLayout(layout);
 		}
 		}
 
 
-		void setInputLayout(const VertexDecl& _vertexDecl, const ProgramD3D11& _program, uint16_t _numInstanceData)
+		void setInputLayout(const VertexLayout& _vertexDecl, const ProgramD3D11& _program, uint16_t _numInstanceData)
 		{
 		{
-			const VertexDecl* decls[1] = { &_vertexDecl };
+			const VertexLayout* decls[1] = { &_vertexDecl };
 			setInputLayout(BX_COUNTOF(decls), decls, _program, _numInstanceData);
 			setInputLayout(BX_COUNTOF(decls), decls, _program, _numInstanceData);
 		}
 		}
 
 
@@ -3409,7 +3409,7 @@ namespace bgfx { namespace d3d11
 				}
 				}
 
 
 				VertexBufferD3D11& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
 				VertexBufferD3D11& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
-				const VertexDecl& vertexDecl = _clearQuad.m_decl;
+				const VertexLayout& vertexDecl = _clearQuad.m_decl;
 
 
 				const uint32_t stride = vertexDecl.m_stride;
 				const uint32_t stride = vertexDecl.m_stride;
 				const uint32_t offset = 0;
 				const uint32_t offset = 0;
@@ -3473,7 +3473,7 @@ namespace bgfx { namespace d3d11
 		ShaderD3D11 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ShaderD3D11 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ProgramD3D11 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		ProgramD3D11 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		TextureD3D11 m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureD3D11 m_textures[BGFX_CONFIG_MAX_TEXTURES];
-		VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		FrameBufferD3D11 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferD3D11 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
@@ -3827,7 +3827,7 @@ namespace bgfx { namespace d3d11
 #endif // 0
 #endif // 0
 	}
 	}
 
 
-	void VertexBufferD3D11::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+	void VertexBufferD3D11::create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags)
 	{
 	{
 		m_decl = _declHandle;
 		m_decl = _declHandle;
 		uint16_t stride = isValid(_declHandle)
 		uint16_t stride = isValid(_declHandle)
@@ -5877,7 +5877,7 @@ namespace bgfx { namespace d3d11
 					ID3D11Buffer* buffers[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					ID3D11Buffer* buffers[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					uint32_t strides[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					uint32_t strides[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					uint32_t offsets[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					uint32_t offsets[BGFX_CONFIG_MAX_VERTEX_STREAMS];
-					const VertexDecl* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
+					const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 
 
 					uint32_t numVertices = draw.m_numVertices;
 					uint32_t numVertices = draw.m_numVertices;
 					uint8_t  numStreams  = 0;
 					uint8_t  numStreams  = 0;
@@ -5902,7 +5902,7 @@ namespace bgfx { namespace d3d11
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 								? draw.m_stream[idx].m_decl.idx
 								? draw.m_stream[idx].m_decl.idx
 								: vb.m_decl.idx;
 								: vb.m_decl.idx;
-							const VertexDecl& vertexDecl = m_vertexDecls[decl];
+							const VertexLayout& vertexDecl = m_vertexDecls[decl];
 							const uint32_t stride = vertexDecl.m_stride;
 							const uint32_t stride = vertexDecl.m_stride;
 
 
 							buffers[numStreams] = vb.m_ptr;
 							buffers[numStreams] = vb.m_ptr;

+ 2 - 2
src/renderer_d3d11.h

@@ -127,9 +127,9 @@ namespace bgfx { namespace d3d11
 		{
 		{
 		}
 		}
 
 
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags);
 
 
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 	struct ShaderD3D11
 	struct ShaderD3D11

+ 23 - 23
src/renderer_d3d12.cpp

@@ -332,7 +332,7 @@ namespace bgfx { namespace d3d12
 	};
 	};
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 
 
-	static D3D12_INPUT_ELEMENT_DESC* fillVertexDecl(uint8_t _stream, D3D12_INPUT_ELEMENT_DESC* _out, const VertexDecl& _decl)
+	static D3D12_INPUT_ELEMENT_DESC* fillVertexLayout(uint8_t _stream, D3D12_INPUT_ELEMENT_DESC* _out, const VertexLayout& _decl)
 	{
 	{
 		D3D12_INPUT_ELEMENT_DESC* elem = _out;
 		D3D12_INPUT_ELEMENT_DESC* elem = _out;
 
 
@@ -1530,18 +1530,18 @@ namespace bgfx { namespace d3d12
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 		}
 		}
@@ -1568,7 +1568,7 @@ namespace bgfx { namespace d3d12
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 		}
 		}
 
 
@@ -1954,7 +1954,7 @@ namespace bgfx { namespace d3d12
 				| BGFX_STATE_DEPTH_TEST_ALWAYS
 				| BGFX_STATE_DEPTH_TEST_ALWAYS
 				;
 				;
 
 
-			const VertexDecl* decls[1] = { &m_vertexDecls[_blitter.m_vb->decl.idx] };
+			const VertexLayout* decls[1] = { &m_vertexDecls[_blitter.m_vb->decl.idx] };
 			ID3D12PipelineState* pso = getPipelineState(state
 			ID3D12PipelineState* pso = getPipelineState(state
 				, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
 				, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
 				, 1
 				, 1
@@ -1993,7 +1993,7 @@ namespace bgfx { namespace d3d12
 			m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, srvHandle);
 			m_commandList->SetGraphicsRootDescriptorTable(Rdt::SRV, srvHandle);
 
 
 			VertexBufferD3D12& vb  = m_vertexBuffers[_blitter.m_vb->handle.idx];
 			VertexBufferD3D12& vb  = m_vertexBuffers[_blitter.m_vb->handle.idx];
-			const VertexDecl& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
+			const VertexLayout& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
 			D3D12_VERTEX_BUFFER_VIEW viewDesc;
 			D3D12_VERTEX_BUFFER_VIEW viewDesc;
 			viewDesc.BufferLocation = vb.m_gpuVA;
 			viewDesc.BufferLocation = vb.m_gpuVA;
 			viewDesc.StrideInBytes  = vertexDecl.m_stride;
 			viewDesc.StrideInBytes  = vertexDecl.m_stride;
@@ -2604,7 +2604,7 @@ namespace bgfx { namespace d3d12
 			_desc.BackFace.StencilFunc         = s_cmpFunc[(bstencil&BGFX_STENCIL_TEST_MASK) >> BGFX_STENCIL_TEST_SHIFT];
 			_desc.BackFace.StencilFunc         = s_cmpFunc[(bstencil&BGFX_STENCIL_TEST_MASK) >> BGFX_STENCIL_TEST_SHIFT];
 		}
 		}
 
 
-		uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, uint8_t _numStreams, const VertexDecl** _vertexDecls, const ProgramD3D12& _program, uint16_t _numInstanceData)
+		uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, uint8_t _numStreams, const VertexLayout** _vertexDecls, const ProgramD3D12& _program, uint16_t _numInstanceData)
 		{
 		{
 			uint16_t attrMask[Attrib::Count];
 			uint16_t attrMask[Attrib::Count];
 			bx::memCopy(attrMask, _program.m_vsh->m_attrMask, sizeof(attrMask));
 			bx::memCopy(attrMask, _program.m_vsh->m_attrMask, sizeof(attrMask));
@@ -2613,8 +2613,8 @@ namespace bgfx { namespace d3d12
 
 
 			for (uint8_t stream = 0; stream < _numStreams; ++stream)
 			for (uint8_t stream = 0; stream < _numStreams; ++stream)
 			{
 			{
-				VertexDecl decl;
-				bx::memCopy(&decl, _vertexDecls[stream], sizeof(VertexDecl));
+				VertexLayout decl;
+				bx::memCopy(&decl, _vertexDecls[stream], sizeof(VertexLayout));
 
 
 				const bool last = stream == _numStreams-1;
 				const bool last = stream == _numStreams-1;
 
 
@@ -2633,7 +2633,7 @@ namespace bgfx { namespace d3d12
 					}
 					}
 				}
 				}
 
 
-				elem = fillVertexDecl(stream, elem, decl);
+				elem = fillVertexLayout(stream, elem, decl);
 			}
 			}
 
 
 			uint32_t num = uint32_t(elem-_vertexElements);
 			uint32_t num = uint32_t(elem-_vertexElements);
@@ -2671,9 +2671,9 @@ namespace bgfx { namespace d3d12
 			return uint32_t(elem-_vertexElements);
 			return uint32_t(elem-_vertexElements);
 		}
 		}
 
 
-		uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, const VertexDecl& _vertexDecl, const ProgramD3D12& _program, uint16_t _numInstanceData)
+		uint32_t setInputLayout(D3D12_INPUT_ELEMENT_DESC* _vertexElements, const VertexLayout& _vertexDecl, const ProgramD3D12& _program, uint16_t _numInstanceData)
 		{
 		{
-			const VertexDecl* decls[1] = { &_vertexDecl };
+			const VertexLayout* decls[1] = { &_vertexDecl };
 			return setInputLayout(_vertexElements, BX_COUNTOF(decls), decls, _program, _numInstanceData);
 			return setInputLayout(_vertexElements, BX_COUNTOF(decls), decls, _program, _numInstanceData);
 		}
 		}
 
 
@@ -2792,7 +2792,7 @@ namespace bgfx { namespace d3d12
 			  uint64_t _state
 			  uint64_t _state
 			, uint64_t _stencil
 			, uint64_t _stencil
 			, uint8_t _numStreams
 			, uint8_t _numStreams
-			, const VertexDecl** _vertexDecls
+			, const VertexLayout** _vertexDecls
 			, ProgramHandle _program
 			, ProgramHandle _program
 			, uint8_t _numInstanceData
 			, uint8_t _numInstanceData
 			)
 			)
@@ -2817,10 +2817,10 @@ namespace bgfx { namespace d3d12
 
 
 			_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, ~BGFX_STENCIL_FUNC_REF_MASK);
 			_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, ~BGFX_STENCIL_FUNC_REF_MASK);
 
 
-			VertexDecl decl;
+			VertexLayout decl;
 			if (0 < _numStreams)
 			if (0 < _numStreams)
 			{
 			{
-				bx::memCopy(&decl, _vertexDecls[0], sizeof(VertexDecl) );
+				bx::memCopy(&decl, _vertexDecls[0], sizeof(VertexLayout) );
 				const uint16_t* attrMask = program.m_vsh->m_attrMask;
 				const uint16_t* attrMask = program.m_vsh->m_attrMask;
 
 
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
@@ -3356,7 +3356,7 @@ namespace bgfx { namespace d3d12
 		ShaderD3D12 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ShaderD3D12 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ProgramD3D12 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		ProgramD3D12 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		TextureD3D12 m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureD3D12 m_textures[BGFX_CONFIG_MAX_TEXTURES];
-		VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		FrameBufferD3D12 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferD3D12 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
@@ -3971,7 +3971,7 @@ namespace bgfx { namespace d3d12
 				vb.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
 				vb.setState(_commandList, D3D12_RESOURCE_STATE_GENERIC_READ);
 
 
 				uint16_t decl = !isValid(vb.m_decl) ? stream.m_decl.idx : vb.m_decl.idx;
 				uint16_t decl = !isValid(vb.m_decl) ? stream.m_decl.idx : vb.m_decl.idx;
-				const VertexDecl& vertexDecl = s_renderD3D12->m_vertexDecls[decl];
+				const VertexLayout& vertexDecl = s_renderD3D12->m_vertexDecls[decl];
 				uint32_t stride = vertexDecl.m_stride;
 				uint32_t stride = vertexDecl.m_stride;
 
 
 				D3D12_VERTEX_BUFFER_VIEW& vbv = _vbv[numStreams];
 				D3D12_VERTEX_BUFFER_VIEW& vbv = _vbv[numStreams];
@@ -4442,7 +4442,7 @@ namespace bgfx { namespace d3d12
 		return _state;
 		return _state;
 	}
 	}
 
 
-	void VertexBufferD3D12::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+	void VertexBufferD3D12::create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags)
 	{
 	{
 		BufferD3D12::create(_size, _data, _flags, true);
 		BufferD3D12::create(_size, _data, _flags, true);
 		m_decl = _declHandle;
 		m_decl = _declHandle;
@@ -6254,7 +6254,7 @@ namespace bgfx { namespace d3d12
 						|| f3 == (state & f3)
 						|| f3 == (state & f3)
 						;
 						;
 
 
-					const VertexDecl* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
+					const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 
 
 					uint8_t numStreams = 0;
 					uint8_t numStreams = 0;
 					if (UINT8_MAX != draw.m_streamMask)
 					if (UINT8_MAX != draw.m_streamMask)
@@ -6277,7 +6277,7 @@ namespace bgfx { namespace d3d12
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 								? draw.m_stream[idx].m_decl.idx
 								? draw.m_stream[idx].m_decl.idx
 								: vb.m_decl.idx;
 								: vb.m_decl.idx;
-							const VertexDecl& vertexDecl = m_vertexDecls[decl];
+							const VertexLayout& vertexDecl = m_vertexDecls[decl];
 
 
 							decls[numStreams] = &vertexDecl;
 							decls[numStreams] = &vertexDecl;
 						}
 						}

+ 2 - 2
src/renderer_d3d12.h

@@ -224,9 +224,9 @@ namespace bgfx { namespace d3d12
 
 
 	struct VertexBufferD3D12 : public BufferD3D12
 	struct VertexBufferD3D12 : public BufferD3D12
 	{
 	{
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags);
 
 
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 	struct ShaderD3D12
 	struct ShaderD3D12

+ 17 - 17
src/renderer_d3d9.cpp

@@ -335,7 +335,7 @@ namespace bgfx { namespace d3d9
 	};
 	};
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 
 
-	static D3DVERTEXELEMENT9* fillVertexDecl(uint8_t _stream, D3DVERTEXELEMENT9* _out, const VertexDecl& _decl)
+	static D3DVERTEXELEMENT9* fillVertexLayout(uint8_t _stream, D3DVERTEXELEMENT9* _out, const VertexLayout& _decl)
 	{
 	{
 		D3DVERTEXELEMENT9* elem = _out;
 		D3DVERTEXELEMENT9* elem = _out;
 
 
@@ -998,18 +998,18 @@ namespace bgfx { namespace d3d9
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t /*_flags*/) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t /*_flags*/) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle);
 		}
 		}
@@ -1036,7 +1036,7 @@ namespace bgfx { namespace d3d9
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t /*_flags*/) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t /*_flags*/) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl);
 		}
 		}
 
 
@@ -1373,7 +1373,7 @@ namespace bgfx { namespace d3d9
 			DX_CHECK(device->SetPixelShader(program.m_fsh->m_pixelShader) );
 			DX_CHECK(device->SetPixelShader(program.m_fsh->m_pixelShader) );
 
 
 			VertexBufferD3D9& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
 			VertexBufferD3D9& vb = m_vertexBuffers[_blitter.m_vb->handle.idx];
-			VertexDecl& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
+			VertexLayout& vertexDecl = m_vertexDecls[_blitter.m_vb->decl.idx];
 			DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, vertexDecl.m_stride) );
 			DX_CHECK(device->SetStreamSource(0, vb.m_ptr, 0, vertexDecl.m_stride) );
 			setInputLayout(vertexDecl, 0);
 			setInputLayout(vertexDecl, 0);
 
 
@@ -2088,7 +2088,7 @@ namespace bgfx { namespace d3d9
 				}
 				}
 
 
 				VertexBufferD3D9& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
 				VertexBufferD3D9& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
-				VertexDecl& vertexDecl = _clearQuad.m_decl;
+				VertexLayout& vertexDecl = _clearQuad.m_decl;
 				uint32_t stride = _clearQuad.m_decl.m_stride;
 				uint32_t stride = _clearQuad.m_decl.m_stride;
 
 
 				ProgramD3D9& program = m_program[_clearQuad.m_program[numMrt-1].idx];
 				ProgramD3D9& program = m_program[_clearQuad.m_program[numMrt-1].idx];
@@ -2138,7 +2138,7 @@ namespace bgfx { namespace d3d9
 			}
 			}
 		}
 		}
 
 
-		void setInputLayout(uint8_t _numStreams, const VertexDecl** _vertexDecls, uint16_t _numInstanceData)
+		void setInputLayout(uint8_t _numStreams, const VertexLayout** _vertexDecls, uint16_t _numInstanceData)
 		{
 		{
 			bx::HashMurmur2A murmur;
 			bx::HashMurmur2A murmur;
 			murmur.begin();
 			murmur.begin();
@@ -2157,7 +2157,7 @@ namespace bgfx { namespace d3d9
 
 
 				for (uint8_t stream = 0; stream < _numStreams; ++stream)
 				for (uint8_t stream = 0; stream < _numStreams; ++stream)
 				{
 				{
-					elem = fillVertexDecl(stream, elem, *_vertexDecls[stream]);
+					elem = fillVertexLayout(stream, elem, *_vertexDecls[stream]);
 				}
 				}
 
 
 				const D3DVERTEXELEMENT9 inst = { _numStreams, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 };
 				const D3DVERTEXELEMENT9 inst = { _numStreams, 0, D3DDECLTYPE_FLOAT4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 };
@@ -2180,9 +2180,9 @@ namespace bgfx { namespace d3d9
 			DX_CHECK(m_device->SetVertexDeclaration(layout) );
 			DX_CHECK(m_device->SetVertexDeclaration(layout) );
 		}
 		}
 
 
-		void setInputLayout(const VertexDecl& _vertexDecl, uint16_t _numInstanceData)
+		void setInputLayout(const VertexLayout& _vertexDecl, uint16_t _numInstanceData)
 		{
 		{
-			const VertexDecl* decls[1] = { &_vertexDecl };
+			const VertexLayout* decls[1] = { &_vertexDecl };
 			setInputLayout(BX_COUNTOF(decls), decls, _numInstanceData);
 			setInputLayout(BX_COUNTOF(decls), decls, _numInstanceData);
 		}
 		}
 
 
@@ -2237,7 +2237,7 @@ namespace bgfx { namespace d3d9
 		ShaderD3D9 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ShaderD3D9 m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ProgramD3D9 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		ProgramD3D9 m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		TextureD3D9 m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureD3D9 m_textures[BGFX_CONFIG_MAX_TEXTURES];
-		VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		FrameBufferD3D9 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferD3D9 m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		UniformRegistry m_uniformReg;
 		UniformRegistry m_uniformReg;
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
@@ -2341,7 +2341,7 @@ namespace bgfx { namespace d3d9
 		}
 		}
 	}
 	}
 
 
-	void VertexBufferD3D9::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle)
+	void VertexBufferD3D9::create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle)
 	{
 	{
 		m_size = _size;
 		m_size = _size;
 		m_decl = _declHandle;
 		m_decl = _declHandle;
@@ -4214,7 +4214,7 @@ namespace bgfx { namespace d3d9
 					currentState.m_instanceDataOffset     = draw.m_instanceDataOffset;
 					currentState.m_instanceDataOffset     = draw.m_instanceDataOffset;
 					currentState.m_instanceDataStride     = draw.m_instanceDataStride;
 					currentState.m_instanceDataStride     = draw.m_instanceDataStride;
 
 
-					const VertexDecl* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
+					const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 
 
 					const bool instanced = true
 					const bool instanced = true
 						&& isValid(draw.m_instanceDataBuffer)
 						&& isValid(draw.m_instanceDataBuffer)
@@ -4246,7 +4246,7 @@ namespace bgfx { namespace d3d9
 						const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 						const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 							? draw.m_stream[idx].m_decl.idx
 							? draw.m_stream[idx].m_decl.idx
 							: vb.m_decl.idx;
 							: vb.m_decl.idx;
-						const VertexDecl& vertexDecl = m_vertexDecls[decl];
+						const VertexLayout& vertexDecl = m_vertexDecls[decl];
 						const uint32_t stride = vertexDecl.m_stride;
 						const uint32_t stride = vertexDecl.m_stride;
 
 
 						decls[numStreams] = &vertexDecl;
 						decls[numStreams] = &vertexDecl;

+ 2 - 2
src/renderer_d3d9.h

@@ -191,7 +191,7 @@ namespace bgfx { namespace d3d9
 		{
 		{
 		}
 		}
 
 
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle);
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle);
 		void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false)
 		void update(uint32_t _offset, uint32_t _size, void* _data, bool _discard = false)
 		{
 		{
 			if (NULL  != m_dynamic
 			if (NULL  != m_dynamic
@@ -232,7 +232,7 @@ namespace bgfx { namespace d3d9
 		IDirect3DVertexBuffer9* m_ptr;
 		IDirect3DVertexBuffer9* m_ptr;
 		uint8_t* m_dynamic;
 		uint8_t* m_dynamic;
 		uint32_t m_size;
 		uint32_t m_size;
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 	struct ShaderD3D9
 	struct ShaderD3D9

+ 10 - 10
src/renderer_gl.cpp

@@ -2686,18 +2686,18 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 		}
 		}
@@ -2724,7 +2724,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 		}
 		}
 
 
@@ -3794,7 +3794,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 				}
 				}
 
 
 				VertexBufferGL& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
 				VertexBufferGL& vb = m_vertexBuffers[_clearQuad.m_vb.idx];
-				VertexDecl& vertexDecl = _clearQuad.m_decl;
+				VertexLayout& vertexDecl = _clearQuad.m_decl;
 
 
 				GL_CHECK(glBindBuffer(GL_ARRAY_BUFFER, vb.m_id) );
 				GL_CHECK(glBindBuffer(GL_ARRAY_BUFFER, vb.m_id) );
 
 
@@ -3868,7 +3868,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 		ShaderGL m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ShaderGL m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ProgramGL m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		ProgramGL m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		TextureGL m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureGL m_textures[BGFX_CONFIG_MAX_TEXTURES];
-		VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		FrameBufferGL m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferGL m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		UniformRegistry m_uniformReg;
 		UniformRegistry m_uniformReg;
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
@@ -4508,7 +4508,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 		m_instanceData[used] = 0xffff;
 		m_instanceData[used] = 0xffff;
 	}
 	}
 
 
-	void ProgramGL::bindAttributes(const VertexDecl& _vertexDecl, uint32_t _baseVertex)
+	void ProgramGL::bindAttributes(const VertexLayout& _vertexDecl, uint32_t _baseVertex)
 	{
 	{
 		for (uint32_t ii = 0, iiEnd = m_usedCount; ii < iiEnd; ++ii)
 		for (uint32_t ii = 0, iiEnd = m_usedCount; ii < iiEnd; ++ii)
 		{
 		{
@@ -7265,7 +7265,7 @@ BX_TRACE("%d, %d, %d, %s", _array, _srgb, _mipAutogen, getName(_format) );
 
 
 								const VertexBufferGL& vb = m_vertexBuffers[draw.m_stream[idx].m_handle.idx];
 								const VertexBufferGL& vb = m_vertexBuffers[draw.m_stream[idx].m_handle.idx];
 								uint16_t decl = !isValid(vb.m_decl) ? draw.m_stream[idx].m_decl.idx : vb.m_decl.idx;
 								uint16_t decl = !isValid(vb.m_decl) ? draw.m_stream[idx].m_decl.idx : vb.m_decl.idx;
-								const VertexDecl& vertexDecl = m_vertexDecls[decl];
+								const VertexLayout& vertexDecl = m_vertexDecls[decl];
 
 
 								numVertices = bx::uint32_min(numVertices, vb.m_size/vertexDecl.m_stride);
 								numVertices = bx::uint32_min(numVertices, vb.m_size/vertexDecl.m_stride);
 							}
 							}

+ 3 - 3
src/renderer_gl.h

@@ -1214,7 +1214,7 @@ namespace bgfx { namespace gl
 
 
 	struct VertexBufferGL
 	struct VertexBufferGL
 	{
 	{
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags)
 		{
 		{
 			m_size = _size;
 			m_size = _size;
 			m_decl = _declHandle;
 			m_decl = _declHandle;
@@ -1258,7 +1258,7 @@ namespace bgfx { namespace gl
 		GLuint m_id;
 		GLuint m_id;
 		GLenum m_target;
 		GLenum m_target;
 		uint32_t m_size;
 		uint32_t m_size;
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 	struct TextureGL
 	struct TextureGL
@@ -1375,7 +1375,7 @@ namespace bgfx { namespace gl
 			bx::memCopy(m_unboundUsedAttrib, m_used, sizeof(m_unboundUsedAttrib) );
 			bx::memCopy(m_unboundUsedAttrib, m_used, sizeof(m_unboundUsedAttrib) );
 		}
 		}
 
 
-		void bindAttributes(const VertexDecl& _vertexDecl, uint32_t _baseVertex = 0);
+		void bindAttributes(const VertexLayout& _vertexDecl, uint32_t _baseVertex = 0);
 
 
 		void bindAttributesEnd()
 		void bindAttributesEnd()
 		{
 		{

+ 2 - 2
src/renderer_mtl.h

@@ -822,9 +822,9 @@ namespace bgfx { namespace mtl
 		{
 		{
 		}
 		}
 
 
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags);
 
 
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 
 

+ 16 - 16
src/renderer_mtl.mm

@@ -732,18 +732,18 @@ namespace bgfx { namespace mtl
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 		}
 		}
@@ -770,7 +770,7 @@ namespace bgfx { namespace mtl
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 		}
 		}
 
 
@@ -1512,7 +1512,7 @@ namespace bgfx { namespace mtl
 				numMrt = bx::uint32_max(1, fb.m_num);
 				numMrt = bx::uint32_max(1, fb.m_num);
 			}
 			}
 
 
-			const VertexDecl* decl = &_clearQuad.m_decl;
+			const VertexLayout* decl = &_clearQuad.m_decl;
 			const PipelineStateMtl* pso = getPipelineState(
 			const PipelineStateMtl* pso = getPipelineState(
 				  state
 				  state
 				, 0
 				, 0
@@ -1894,7 +1894,7 @@ namespace bgfx { namespace mtl
 			, uint32_t _rgba
 			, uint32_t _rgba
 			, FrameBufferHandle _fbh
 			, FrameBufferHandle _fbh
 			, uint8_t _numStreams
 			, uint8_t _numStreams
-			, const VertexDecl** _vertexDecls
+			, const VertexLayout** _vertexDecls
 			, ProgramHandle _program
 			, ProgramHandle _program
 			, uint8_t _numInstanceData
 			, uint8_t _numInstanceData
 			)
 			)
@@ -2071,7 +2071,7 @@ namespace bgfx { namespace mtl
 				uint8_t stream = 0;
 				uint8_t stream = 0;
 				for (; stream < _numStreams; ++stream)
 				for (; stream < _numStreams; ++stream)
 				{
 				{
-					const VertexDecl& vertexDecl = *_vertexDecls[stream];
+					const VertexLayout& vertexDecl = *_vertexDecls[stream];
 					bool streamUsed = false;
 					bool streamUsed = false;
 					for (uint32_t ii = 0; Attrib::Count != program.m_used[ii]; ++ii)
 					for (uint32_t ii = 0; Attrib::Count != program.m_used[ii]; ++ii)
 					{
 					{
@@ -2155,12 +2155,12 @@ namespace bgfx { namespace mtl
 			  uint64_t _state
 			  uint64_t _state
 			, uint32_t _rgba
 			, uint32_t _rgba
 			, FrameBufferHandle _fbh
 			, FrameBufferHandle _fbh
-			, VertexDeclHandle _declHandle
+			, VertexLayoutHandle _declHandle
 			, ProgramHandle _program
 			, ProgramHandle _program
 			, uint16_t _numInstanceData
 			, uint16_t _numInstanceData
 			)
 			)
 		{
 		{
-			const VertexDecl* decl = &m_vertexDecls[_declHandle.idx];
+			const VertexLayout* decl = &m_vertexDecls[_declHandle.idx];
 			return getPipelineState(
 			return getPipelineState(
 				  _state
 				  _state
 				, _rgba
 				, _rgba
@@ -2300,7 +2300,7 @@ namespace bgfx { namespace mtl
 		TextureMtl      m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureMtl      m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		FrameBufferMtl  m_mainFrameBuffer;
 		FrameBufferMtl  m_mainFrameBuffer;
 		FrameBufferMtl  m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferMtl  m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
-		VertexDecl      m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout    m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		UniformRegistry m_uniformReg;
 		UniformRegistry m_uniformReg;
 		void*           m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void*           m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 
 
@@ -2565,7 +2565,7 @@ namespace bgfx { namespace mtl
 		}
 		}
 	}
 	}
 
 
-	void VertexBufferMtl::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+	void VertexBufferMtl::create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags)
 	{
 	{
 		m_decl = _declHandle;
 		m_decl = _declHandle;
 		uint16_t stride = isValid(_declHandle)
 		uint16_t stride = isValid(_declHandle)
@@ -4263,7 +4263,7 @@ namespace bgfx { namespace mtl
 					currentState.m_instanceDataOffset     = draw.m_instanceDataOffset;
 					currentState.m_instanceDataOffset     = draw.m_instanceDataOffset;
 					currentState.m_instanceDataStride     = draw.m_instanceDataStride;
 					currentState.m_instanceDataStride     = draw.m_instanceDataStride;
 
 
-					const VertexDecl* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
+					const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 
 
 					uint32_t numVertices = draw.m_numVertices;
 					uint32_t numVertices = draw.m_numVertices;
 					uint8_t  numStreams  = 0;
 					uint8_t  numStreams  = 0;
@@ -4285,7 +4285,7 @@ namespace bgfx { namespace mtl
 						const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 						const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 							? draw.m_stream[idx].m_decl.idx
 							? draw.m_stream[idx].m_decl.idx
 							: vb.m_decl.idx;
 							: vb.m_decl.idx;
-						const VertexDecl& vertexDecl = m_vertexDecls[decl];
+						const VertexLayout& vertexDecl = m_vertexDecls[decl];
 						const uint32_t stride = vertexDecl.m_stride;
 						const uint32_t stride = vertexDecl.m_stride;
 
 
 						decls[numStreams] = &vertexDecl;
 						decls[numStreams] = &vertexDecl;
@@ -4415,7 +4415,7 @@ namespace bgfx { namespace mtl
 					{
 					{
 						const VertexBufferMtl& vb = m_vertexBuffers[currentState.m_stream[0].m_handle.idx];
 						const VertexBufferMtl& vb = m_vertexBuffers[currentState.m_stream[0].m_handle.idx];
 						uint16_t decl = !isValid(vb.m_decl) ? draw.m_stream[0].m_decl.idx : vb.m_decl.idx;
 						uint16_t decl = !isValid(vb.m_decl) ? draw.m_stream[0].m_decl.idx : vb.m_decl.idx;
-						const VertexDecl& vertexDecl = m_vertexDecls[decl];
+						const VertexLayout& vertexDecl = m_vertexDecls[decl];
 						numVertices = vb.m_size/vertexDecl.m_stride;
 						numVertices = vb.m_size/vertexDecl.m_stride;
 					}
 					}
 
 

+ 3 - 3
src/renderer_noop.cpp

@@ -100,15 +100,15 @@ namespace bgfx { namespace noop
 		{
 		{
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle /*_handle*/, const VertexDecl& /*_decl*/) override
+		void createVertexLayout(VertexLayoutHandle /*_handle*/, const VertexLayout& /*_decl*/) override
 		{
 		{
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle /*_handle*/, const Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint16_t /*_flags*/) override
+		void createVertexBuffer(VertexBufferHandle /*_handle*/, const Memory* /*_mem*/, VertexLayoutHandle /*_declHandle*/, uint16_t /*_flags*/) override
 		{
 		{
 		}
 		}
 
 

+ 20 - 20
src/renderer_vk.cpp

@@ -327,7 +327,7 @@ VK_IMPORT_DEVICE
 	};
 	};
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 	BX_STATIC_ASSERT(AttribType::Count == BX_COUNTOF(s_attribType) );
 
 
-	void fillVertexDecl(const ShaderVK* _vsh, VkPipelineVertexInputStateCreateInfo& _vertexInputState, const VertexDecl& _decl)
+	void fillVertexLayout(const ShaderVK* _vsh, VkPipelineVertexInputStateCreateInfo& _vertexInputState, const VertexLayout& _decl)
 	{
 	{
 		uint32_t numBindings = _vertexInputState.vertexBindingDescriptionCount;
 		uint32_t numBindings = _vertexInputState.vertexBindingDescriptionCount;
 		uint32_t numAttribs  = _vertexInputState.vertexAttributeDescriptionCount;
 		uint32_t numAttribs  = _vertexInputState.vertexAttributeDescriptionCount;
@@ -2324,18 +2324,18 @@ VK_IMPORT_DEVICE
 			m_indexBuffers[_handle.idx].destroy();
 			m_indexBuffers[_handle.idx].destroy();
 		}
 		}
 
 
-		void createVertexDecl(VertexDeclHandle _handle, const VertexDecl& _decl) override
+		void createVertexLayout(VertexLayoutHandle _handle, const VertexLayout& _decl) override
 		{
 		{
-			VertexDecl& decl = m_vertexDecls[_handle.idx];
-			bx::memCopy(&decl, &_decl, sizeof(VertexDecl) );
+			VertexLayout& decl = m_vertexDecls[_handle.idx];
+			bx::memCopy(&decl, &_decl, sizeof(VertexLayout) );
 			dump(decl);
 			dump(decl);
 		}
 		}
 
 
-		void destroyVertexDecl(VertexDeclHandle /*_handle*/) override
+		void destroyVertexLayout(VertexLayoutHandle /*_handle*/) override
 		{
 		{
 		}
 		}
 
 
-		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexDeclHandle _declHandle, uint16_t _flags) override
+		void createVertexBuffer(VertexBufferHandle _handle, const Memory* _mem, VertexLayoutHandle _declHandle, uint16_t _flags) override
 		{
 		{
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 			m_vertexBuffers[_handle.idx].create(_mem->size, _mem->data, _declHandle, _flags);
 		}
 		}
@@ -2363,7 +2363,7 @@ VK_IMPORT_DEVICE
 
 
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		void createDynamicVertexBuffer(VertexBufferHandle _handle, uint32_t _size, uint16_t _flags) override
 		{
 		{
-			VertexDeclHandle decl = BGFX_INVALID_HANDLE;
+			VertexLayoutHandle decl = BGFX_INVALID_HANDLE;
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 			m_vertexBuffers[_handle.idx].create(_size, NULL, decl, _flags);
 		}
 		}
 
 
@@ -2571,7 +2571,7 @@ VK_IMPORT_DEVICE
 				| BGFX_STATE_DEPTH_TEST_ALWAYS
 				| BGFX_STATE_DEPTH_TEST_ALWAYS
 				;
 				;
 
 
-			const VertexDecl* vertexDecl = &m_vertexDecls[_blitter.m_vb->decl.idx];
+			const VertexLayout* vertexDecl = &m_vertexDecls[_blitter.m_vb->decl.idx];
 			VkPipeline pso = getPipeline(state
 			VkPipeline pso = getPipeline(state
 				, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
 				, packStencil(BGFX_STENCIL_DEFAULT, BGFX_STENCIL_DEFAULT)
 				, 1
 				, 1
@@ -3084,7 +3084,7 @@ VK_IMPORT_DEVICE
 			_desc.maxDepthBounds = 1.0f;
 			_desc.maxDepthBounds = 1.0f;
 		}
 		}
 
 
-		void setInputLayout(VkPipelineVertexInputStateCreateInfo& _vertexInputState, uint8_t _numStream, const VertexDecl** _vertexDecl, const ProgramVK& _program, uint8_t _numInstanceData)
+		void setInputLayout(VkPipelineVertexInputStateCreateInfo& _vertexInputState, uint8_t _numStream, const VertexLayout** _vertexDecl, const ProgramVK& _program, uint8_t _numInstanceData)
 		{
 		{
 			_vertexInputState.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
 			_vertexInputState.sType = VK_STRUCTURE_TYPE_PIPELINE_VERTEX_INPUT_STATE_CREATE_INFO;
 			_vertexInputState.pNext = NULL;
 			_vertexInputState.pNext = NULL;
@@ -3097,8 +3097,8 @@ VK_IMPORT_DEVICE
 			bx::memCopy(unsettedAttr, _program.m_vsh->m_attrMask, sizeof(uint16_t) * Attrib::Count);
 			bx::memCopy(unsettedAttr, _program.m_vsh->m_attrMask, sizeof(uint16_t) * Attrib::Count);
 			for (uint8_t stream = 0; stream < _numStream; ++stream)
 			for (uint8_t stream = 0; stream < _numStream; ++stream)
 			{
 			{
-				VertexDecl decl;
-				bx::memCopy(&decl, _vertexDecl[stream], sizeof(VertexDecl) );
+				VertexLayout decl;
+				bx::memCopy(&decl, _vertexDecl[stream], sizeof(VertexLayout) );
 				const uint16_t* attrMask = _program.m_vsh->m_attrMask;
 				const uint16_t* attrMask = _program.m_vsh->m_attrMask;
 
 
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
@@ -3112,7 +3112,7 @@ VK_IMPORT_DEVICE
 					}
 					}
 				}
 				}
 
 
-				fillVertexDecl(_program.m_vsh, _vertexInputState, decl);
+				fillVertexLayout(_program.m_vsh, _vertexInputState, decl);
 			}
 			}
 
 
 			for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
 			for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
@@ -3302,7 +3302,7 @@ VK_IMPORT_DEVICE
 			return VK_NULL_HANDLE;
 			return VK_NULL_HANDLE;
 		}
 		}
 
 
-		VkPipeline getPipeline(uint64_t _state, uint64_t _stencil, uint8_t _numStreams, const VertexDecl** _vertexDecls, ProgramHandle _program, uint8_t _numInstanceData)
+		VkPipeline getPipeline(uint64_t _state, uint64_t _stencil, uint8_t _numStreams, const VertexLayout** _vertexDecls, ProgramHandle _program, uint8_t _numInstanceData)
 		{
 		{
 			ProgramVK& program = m_program[_program.idx];
 			ProgramVK& program = m_program[_program.idx];
 
 
@@ -3324,10 +3324,10 @@ VK_IMPORT_DEVICE
 
 
 			_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, ~BGFX_STENCIL_FUNC_REF_MASK);
 			_stencil &= packStencil(~BGFX_STENCIL_FUNC_REF_MASK, ~BGFX_STENCIL_FUNC_REF_MASK);
 
 
-			VertexDecl decl;
+			VertexLayout decl;
 			if (0 < _numStreams)
 			if (0 < _numStreams)
 			{
 			{
-				bx::memCopy(&decl, _vertexDecls[0], sizeof(VertexDecl) );
+				bx::memCopy(&decl, _vertexDecls[0], sizeof(VertexLayout) );
 				const uint16_t* attrMask = program.m_vsh->m_attrMask;
 				const uint16_t* attrMask = program.m_vsh->m_attrMask;
 
 
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
 				for (uint32_t ii = 0; ii < Attrib::Count; ++ii)
@@ -3825,7 +3825,7 @@ VK_IMPORT_DEVICE
 		ShaderVK m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ShaderVK m_shaders[BGFX_CONFIG_MAX_SHADERS];
 		ProgramVK m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		ProgramVK m_program[BGFX_CONFIG_MAX_PROGRAMS];
 		TextureVK m_textures[BGFX_CONFIG_MAX_TEXTURES];
 		TextureVK m_textures[BGFX_CONFIG_MAX_TEXTURES];
-		VertexDecl m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
+		VertexLayout m_vertexDecls[BGFX_CONFIG_MAX_VERTEX_DECLS];
 		FrameBufferVK m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		FrameBufferVK m_frameBuffers[BGFX_CONFIG_MAX_FRAME_BUFFERS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		void* m_uniforms[BGFX_CONFIG_MAX_UNIFORMS];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
 		Matrix4 m_predefinedUniforms[PredefinedUniform::Count];
@@ -4275,7 +4275,7 @@ VK_DESTROY
 		}
 		}
 	}
 	}
 
 
-	void VertexBufferVK::create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags)
+	void VertexBufferVK::create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags)
 	{
 	{
 		BufferVK::create(_size, _data, _flags, true);
 		BufferVK::create(_size, _data, _flags, true);
 		m_decl = _declHandle;
 		m_decl = _declHandle;
@@ -5741,7 +5741,7 @@ BX_UNUSED(currentSamplerStateIdx);
 						|| f3 == (state & f3)
 						|| f3 == (state & f3)
 						;
 						;
 
 
-					const VertexDecl* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
+					const VertexLayout* decls[BGFX_CONFIG_MAX_VERTEX_STREAMS];
 					uint8_t numStreams = 0;
 					uint8_t numStreams = 0;
 					if (UINT8_MAX != draw.m_streamMask)
 					if (UINT8_MAX != draw.m_streamMask)
 					{
 					{
@@ -5763,7 +5763,7 @@ BX_UNUSED(currentSamplerStateIdx);
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 							const uint16_t decl = isValid(draw.m_stream[idx].m_decl)
 												  ? draw.m_stream[idx].m_decl.idx
 												  ? draw.m_stream[idx].m_decl.idx
 												  : vb.m_decl.idx;
 												  : vb.m_decl.idx;
-							const VertexDecl& vertexDecl = m_vertexDecls[decl];
+							const VertexLayout& vertexDecl = m_vertexDecls[decl];
 
 
 							decls[numStreams] = &vertexDecl;
 							decls[numStreams] = &vertexDecl;
 						}
 						}
@@ -6139,7 +6139,7 @@ BX_UNUSED(currentSamplerStateIdx);
 					if (!isValid(draw.m_indexBuffer) )
 					if (!isValid(draw.m_indexBuffer) )
 					{
 					{
 						const VertexBufferVK& vertexBuffer = m_vertexBuffers[draw.m_stream[0].m_handle.idx];
 						const VertexBufferVK& vertexBuffer = m_vertexBuffers[draw.m_stream[0].m_handle.idx];
-						const VertexDecl& vertexDecl = m_vertexDecls[draw.m_stream[0].m_decl.idx];
+						const VertexLayout& vertexDecl = m_vertexDecls[draw.m_stream[0].m_decl.idx];
 
 
 						const uint32_t numVertices = UINT32_MAX == draw.m_numVertices
 						const uint32_t numVertices = UINT32_MAX == draw.m_numVertices
 							? vertexBuffer.m_size / vertexDecl.m_stride
 							? vertexBuffer.m_size / vertexDecl.m_stride

+ 2 - 2
src/renderer_vk.h

@@ -378,9 +378,9 @@ VK_DESTROY
 
 
 	struct VertexBufferVK : public BufferVK
 	struct VertexBufferVK : public BufferVK
 	{
 	{
-		void create(uint32_t _size, void* _data, VertexDeclHandle _declHandle, uint16_t _flags);
+		void create(uint32_t _size, void* _data, VertexLayoutHandle _declHandle, uint16_t _flags);
 
 
-		VertexDeclHandle m_decl;
+		VertexLayoutHandle m_decl;
 	};
 	};
 
 
 	struct ShaderVK
 	struct ShaderVK

+ 14 - 14
src/vertexdecl.cpp

@@ -63,16 +63,16 @@ namespace bgfx
 		s_attribTypeSize[RendererType::Count] = s_attribTypeSize[_type];
 		s_attribTypeSize[RendererType::Count] = s_attribTypeSize[_type];
 	}
 	}
 
 
-	VertexDecl::VertexDecl()
+	VertexLayout::VertexLayout()
 		: m_stride(0)
 		: m_stride(0)
 	{
 	{
 		// BK - struct need to have ctor to qualify as non-POD data.
 		// BK - struct need to have ctor to qualify as non-POD data.
 		// Need this to catch programming errors when serializing struct.
 		// Need this to catch programming errors when serializing struct.
 	}
 	}
 
 
-	VertexDecl& VertexDecl::begin(RendererType::Enum _renderer)
+	VertexLayout& VertexLayout::begin(RendererType::Enum _renderer)
 	{
 	{
-		m_hash = _renderer; // use hash to store renderer type while building VertexDecl.
+		m_hash = _renderer; // use hash to store renderer type while building VertexLayout.
 		m_stride = 0;
 		m_stride = 0;
 		bx::memSet(m_attributes, 0xff, sizeof(m_attributes) );
 		bx::memSet(m_attributes, 0xff, sizeof(m_attributes) );
 		bx::memSet(m_offset, 0, sizeof(m_offset) );
 		bx::memSet(m_offset, 0, sizeof(m_offset) );
@@ -80,7 +80,7 @@ namespace bgfx
 		return *this;
 		return *this;
 	}
 	}
 
 
-	void VertexDecl::end()
+	void VertexLayout::end()
 	{
 	{
 		bx::HashMurmur2A murmur;
 		bx::HashMurmur2A murmur;
 		murmur.begin();
 		murmur.begin();
@@ -90,7 +90,7 @@ namespace bgfx
 		m_hash = murmur.end();
 		m_hash = murmur.end();
 	}
 	}
 
 
-	VertexDecl& VertexDecl::add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized, bool _asInt)
+	VertexLayout& VertexLayout::add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized, bool _asInt)
 	{
 	{
 		const uint16_t encodedNorm = (_normalized&1)<<7;
 		const uint16_t encodedNorm = (_normalized&1)<<7;
 		const uint16_t encodedType = (_type&7)<<3;
 		const uint16_t encodedType = (_type&7)<<3;
@@ -104,14 +104,14 @@ namespace bgfx
 		return *this;
 		return *this;
 	}
 	}
 
 
-	VertexDecl& VertexDecl::skip(uint8_t _num)
+	VertexLayout& VertexLayout::skip(uint8_t _num)
 	{
 	{
 		m_stride += _num;
 		m_stride += _num;
 
 
 		return *this;
 		return *this;
 	}
 	}
 
 
-	void VertexDecl::decode(Attrib::Enum _attrib, uint8_t& _num, AttribType::Enum& _type, bool& _normalized, bool& _asInt) const
+	void VertexLayout::decode(Attrib::Enum _attrib, uint8_t& _num, AttribType::Enum& _type, bool& _normalized, bool& _asInt) const
 	{
 	{
 		uint16_t val = m_attributes[_attrib];
 		uint16_t val = m_attributes[_attrib];
 		_num        = (val&3)+1;
 		_num        = (val&3)+1;
@@ -241,7 +241,7 @@ namespace bgfx
 		return s_attribTypeToId[_attr].id;
 		return s_attribTypeToId[_attr].id;
 	}
 	}
 
 
-	int32_t write(bx::WriterI* _writer, const VertexDecl& _decl, bx::Error* _err)
+	int32_t write(bx::WriterI* _writer, const VertexLayout& _decl, bx::Error* _err)
 	{
 	{
 		BX_ERROR_SCOPE(_err);
 		BX_ERROR_SCOPE(_err);
 
 
@@ -277,7 +277,7 @@ namespace bgfx
 		return total;
 		return total;
 	}
 	}
 
 
-	int32_t read(bx::ReaderI* _reader, VertexDecl& _decl, bx::Error* _err)
+	int32_t read(bx::ReaderI* _reader, VertexLayout& _decl, bx::Error* _err)
 	{
 	{
 		BX_ERROR_SCOPE(_err);
 		BX_ERROR_SCOPE(_err);
 
 
@@ -337,7 +337,7 @@ namespace bgfx
 		return total;
 		return total;
 	}
 	}
 
 
-	void vertexPack(const float _input[4], bool _inputNormalized, Attrib::Enum _attr, const VertexDecl& _decl, void* _data, uint32_t _index)
+	void vertexPack(const float _input[4], bool _inputNormalized, Attrib::Enum _attr, const VertexLayout& _decl, void* _data, uint32_t _index)
 	{
 	{
 		if (!_decl.has(_attr) )
 		if (!_decl.has(_attr) )
 		{
 		{
@@ -493,7 +493,7 @@ namespace bgfx
 		}
 		}
 	}
 	}
 
 
-	void vertexUnpack(float _output[4], Attrib::Enum _attr, const VertexDecl& _decl, const void* _data, uint32_t _index)
+	void vertexUnpack(float _output[4], Attrib::Enum _attr, const VertexLayout& _decl, const void* _data, uint32_t _index)
 	{
 	{
 		if (!_decl.has(_attr) )
 		if (!_decl.has(_attr) )
 		{
 		{
@@ -619,7 +619,7 @@ namespace bgfx
 		}
 		}
 	}
 	}
 
 
-	void vertexConvert(const VertexDecl& _destDecl, void* _destData, const VertexDecl& _srcDecl, const void* _srcData, uint32_t _num)
+	void vertexConvert(const VertexLayout& _destDecl, void* _destData, const VertexLayout& _srcDecl, const void* _srcData, uint32_t _num)
 	{
 	{
 		if (_destDecl.m_hash == _srcDecl.m_hash)
 		if (_destDecl.m_hash == _srcDecl.m_hash)
 		{
 		{
@@ -724,7 +724,7 @@ namespace bgfx
 		return xx*xx + yy*yy + zz*zz;
 		return xx*xx + yy*yy + zz*zz;
 	}
 	}
 
 
-	uint16_t weldVerticesRef(uint16_t* _output, const VertexDecl& _decl, const void* _data, uint16_t _num, float _epsilon)
+	uint16_t weldVerticesRef(uint16_t* _output, const VertexLayout& _decl, const void* _data, uint16_t _num, float _epsilon)
 	{
 	{
 		// Brute force slow vertex welding...
 		// Brute force slow vertex welding...
 		const float epsilonSq = _epsilon*_epsilon;
 		const float epsilonSq = _epsilon*_epsilon;
@@ -765,7 +765,7 @@ namespace bgfx
 		return (uint16_t)numVertices;
 		return (uint16_t)numVertices;
 	}
 	}
 
 
-	uint16_t weldVertices(uint16_t* _output, const VertexDecl& _decl, const void* _data, uint16_t _num, float _epsilon)
+	uint16_t weldVertices(uint16_t* _output, const VertexLayout& _decl, const void* _data, uint16_t _num, float _epsilon)
 	{
 	{
 		const uint32_t hashSize = bx::uint32_nextpow2(_num);
 		const uint32_t hashSize = bx::uint32_nextpow2(_num);
 		const uint32_t hashMask = hashSize-1;
 		const uint32_t hashMask = hashSize-1;

+ 2 - 2
src/vertexdecl.h

@@ -30,10 +30,10 @@ namespace bgfx
 	AttribType::Enum idToAttribType(uint16_t id);
 	AttribType::Enum idToAttribType(uint16_t id);
 
 
 	///
 	///
-	int32_t write(bx::WriterI* _writer, const bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t write(bx::WriterI* _writer, const bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 
 
 	///
 	///
-	int32_t read(bx::ReaderI* _reader, bgfx::VertexDecl& _decl, bx::Error* _err = NULL);
+	int32_t read(bx::ReaderI* _reader, bgfx::VertexLayout& _decl, bx::Error* _err = NULL);
 
 
 } // namespace bgfx
 } // namespace bgfx
 
 

+ 3 - 3
tools/geometryc/geometryc.cpp

@@ -150,7 +150,7 @@ void writeCompressedVertices(bx::WriterI* _writer,  const uint8_t* _vertices, ui
 	free(compressedVertices);
 	free(compressedVertices);
 }
 }
 
 
-void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexDecl _decl, const uint16_t* _indices, uint32_t _numIndices)
+void calcTangents(void* _vertices, uint16_t _numVertices, bgfx::VertexLayout _decl, const uint16_t* _indices, uint32_t _numIndices)
 {
 {
 	struct PosTexcoord
 	struct PosTexcoord
 	{
 	{
@@ -276,7 +276,7 @@ void write(bx::WriterI* _writer, const void* _vertices, uint32_t _numVertices, u
 void write(bx::WriterI* _writer
 void write(bx::WriterI* _writer
 		, const uint8_t* _vertices
 		, const uint8_t* _vertices
 		, uint32_t _numVertices
 		, uint32_t _numVertices
-		, const bgfx::VertexDecl& _decl
+		, const bgfx::VertexLayout& _decl
 		, const uint16_t* _indices
 		, const uint16_t* _indices
 		, uint32_t _numIndices
 		, uint32_t _numIndices
 		, bool _compress
 		, bool _compress
@@ -793,7 +793,7 @@ int main(int _argc, const char* _argv[])
 		}
 		}
 	}
 	}
 
 
-	bgfx::VertexDecl decl;
+	bgfx::VertexLayout decl;
 	decl.begin();
 	decl.begin();
 	decl.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float);
 	decl.add(bgfx::Attrib::Position, 3, bgfx::AttribType::Float);
 
 

+ 2 - 2
tools/texturev/texturev.cpp

@@ -906,10 +906,10 @@ struct PosUvwColorVertex
 		m_abgr = _abgr;
 		m_abgr = _abgr;
 	}
 	}
 
 
-	static bgfx::VertexDecl ms_decl;
+	static bgfx::VertexLayout ms_decl;
 };
 };
 
 
-bgfx::VertexDecl PosUvwColorVertex::ms_decl;
+bgfx::VertexLayout PosUvwColorVertex::ms_decl;
 
 
 static uint32_t addQuad(uint16_t* _indices, uint16_t _idx0, uint16_t _idx1, uint16_t _idx2, uint16_t _idx3)
 static uint32_t addQuad(uint16_t* _indices, uint16_t _idx0, uint16_t _idx1, uint16_t _idx2, uint16_t _idx3)
 {
 {