diff --git a/bindings/bf/bgfx.bf b/bindings/bf/bgfx.bf
index 5b41ad759..3ba599650 100644
--- a/bindings/bf/bgfx.bf
+++ b/bindings/bf/bgfx.bf
@@ -1697,6 +1697,46 @@ public static class bgfx
///
TexCoord7,
+ ///
+ /// a_texcoord8
+ ///
+ TexCoord8,
+
+ ///
+ /// a_texcoord9
+ ///
+ TexCoord9,
+
+ ///
+ /// a_texcoord10
+ ///
+ TexCoord10,
+
+ ///
+ /// a_texcoord11
+ ///
+ TexCoord11,
+
+ ///
+ /// a_texcoord12
+ ///
+ TexCoord12,
+
+ ///
+ /// a_texcoord13
+ ///
+ TexCoord13,
+
+ ///
+ /// a_texcoord14
+ ///
+ TexCoord14,
+
+ ///
+ /// a_texcoord15
+ ///
+ TexCoord15,
+
Count
}
@@ -1738,6 +1778,16 @@ public static class bgfx
///
Float,
+ ///
+ /// Int32
+ ///
+ Int32,
+
+ ///
+ /// Uint32
+ ///
+ Uint32,
+
Count
}
@@ -2594,6 +2644,8 @@ public static class bgfx
public uint32 maxComputeBindings;
public uint32 maxVertexLayouts;
public uint32 maxVertexStreams;
+ public uint32 maxVertexAttributes;
+ public uint32 maxInstanceData;
public uint32 maxIndexBuffers;
public uint32 maxVertexBuffers;
public uint32 maxDynamicIndexBuffers;
@@ -2860,8 +2912,8 @@ public static class bgfx
{
public uint32 hash;
public uint16 stride;
- public uint16[18] offset;
- public uint16[18] attributes;
+ public uint16[26] offset;
+ public uint16[26] attributes;
}
[CRepr]
diff --git a/bindings/c3/bgfx.c3 b/bindings/c3/bgfx.c3
index 78280c7df..0fadae4e5 100644
--- a/bindings/c3/bgfx.c3
+++ b/bindings/c3/bgfx.c3
@@ -1072,6 +1072,30 @@ enum Attrib : uint
// a_texcoord7
TEXCOORD7,
+ // a_texcoord8
+ TEXCOORD8,
+
+ // a_texcoord9
+ TEXCOORD9,
+
+ // a_texcoord10
+ TEXCOORD10,
+
+ // a_texcoord11
+ TEXCOORD11,
+
+ // a_texcoord12
+ TEXCOORD12,
+
+ // a_texcoord13
+ TEXCOORD13,
+
+ // a_texcoord14
+ TEXCOORD14,
+
+ // a_texcoord15
+ TEXCOORD15,
+
COUNT
}
@@ -1098,6 +1122,12 @@ enum AttribType : uint
// Float
FLOAT,
+ // Int32
+ INT32,
+
+ // Uint32
+ UINT32,
+
COUNT
}
@@ -1660,6 +1690,10 @@ struct CapsLimits
uint maxVertexLayouts;
// Maximum number of vertex streams.
uint maxVertexStreams;
+ // Maximum number of vertex attributes.
+ uint maxVertexAttributes;
+ // Maximum number of instance data slots.
+ uint maxInstanceData;
// Maximum number of index buffer handles.
uint maxIndexBuffers;
// Maximum number of vertex buffer handles.
@@ -2185,9 +2219,9 @@ struct VertexLayout
// Stride.
ushort stride;
// Attribute offsets.
- ushort[18] offset;
+ ushort[26] offset;
// Used attributes.
- ushort[18] attributes;
+ ushort[26] attributes;
}
// Encoders are used for submitting draw calls from multiple threads. Only one encoder
diff --git a/bindings/cs/bgfx.cs b/bindings/cs/bgfx.cs
index f1d3657bc..d3a3b9446 100644
--- a/bindings/cs/bgfx.cs
+++ b/bindings/cs/bgfx.cs
@@ -1692,6 +1692,46 @@ public static partial class bgfx
///
TexCoord7,
+ ///
+ /// a_texcoord8
+ ///
+ TexCoord8,
+
+ ///
+ /// a_texcoord9
+ ///
+ TexCoord9,
+
+ ///
+ /// a_texcoord10
+ ///
+ TexCoord10,
+
+ ///
+ /// a_texcoord11
+ ///
+ TexCoord11,
+
+ ///
+ /// a_texcoord12
+ ///
+ TexCoord12,
+
+ ///
+ /// a_texcoord13
+ ///
+ TexCoord13,
+
+ ///
+ /// a_texcoord14
+ ///
+ TexCoord14,
+
+ ///
+ /// a_texcoord15
+ ///
+ TexCoord15,
+
Count
}
@@ -1732,6 +1772,16 @@ public static partial class bgfx
///
Float,
+ ///
+ /// Int32
+ ///
+ Int32,
+
+ ///
+ /// Uint32
+ ///
+ Uint32,
+
Count
}
@@ -2572,6 +2622,8 @@ public static partial class bgfx
public uint maxComputeBindings;
public uint maxVertexLayouts;
public uint maxVertexStreams;
+ public uint maxVertexAttributes;
+ public uint maxInstanceData;
public uint maxIndexBuffers;
public uint maxVertexBuffers;
public uint maxDynamicIndexBuffers;
@@ -2818,8 +2870,8 @@ public static partial class bgfx
{
public uint hash;
public ushort stride;
- public fixed ushort offset[18];
- public fixed ushort attributes[18];
+ public fixed ushort offset[26];
+ public fixed ushort attributes[26];
}
public unsafe struct Encoder
diff --git a/bindings/d/impl.d b/bindings/d/impl.d
index 4ee67c0d4..9abced215 100644
--- a/bindings/d/impl.d
+++ b/bindings/d/impl.d
@@ -36,12 +36,12 @@ extern(C++, "bgfx") package final abstract class Access{
}
extern(C++, "bgfx") package final abstract class Attrib{
enum Enum{
- position,normal,tangent,bitangent,color0,color1,color2,color3,indices,weight,texCoord0,texCoord1,texCoord2,texCoord3,texCoord4,texCoord5,texCoord6,texCoord7,count
+ position,normal,tangent,bitangent,color0,color1,color2,color3,indices,weight,texCoord0,texCoord1,texCoord2,texCoord3,texCoord4,texCoord5,texCoord6,texCoord7,texCoord8,texCoord9,texCoord10,texCoord11,texCoord12,texCoord13,texCoord14,texCoord15,count
}
}
extern(C++, "bgfx") package final abstract class AttribType{
enum Enum{
- int8,uint8,uint10,int16,uint16,half,float_,count
+ int8,uint8,uint10,int16,uint16,half,float_,int32,uint32,count
}
}
extern(C++, "bgfx") package final abstract class TextureFormat{
diff --git a/bindings/d/package.d b/bindings/d/package.d
index ee9d9d253..884630724 100644
--- a/bindings/d/package.d
+++ b/bindings/d/package.d
@@ -9,7 +9,7 @@ import bindbc.common.types: c_int64, c_uint64, va_list;
import bindbc.bgfx.config;
static import bgfx.impl;
-enum uint apiVersion = 149;
+enum uint apiVersion = 150;
alias ViewID = ushort;
@@ -709,6 +709,14 @@ enum Attrib: bgfx.impl.Attrib.Enum{
texCoord5 = bgfx.impl.Attrib.Enum.texCoord5,
texCoord6 = bgfx.impl.Attrib.Enum.texCoord6,
texCoord7 = bgfx.impl.Attrib.Enum.texCoord7,
+ texCoord8 = bgfx.impl.Attrib.Enum.texCoord8,
+ texCoord9 = bgfx.impl.Attrib.Enum.texCoord9,
+ texCoord10 = bgfx.impl.Attrib.Enum.texCoord10,
+ texCoord11 = bgfx.impl.Attrib.Enum.texCoord11,
+ texCoord12 = bgfx.impl.Attrib.Enum.texCoord12,
+ texCoord13 = bgfx.impl.Attrib.Enum.texCoord13,
+ texCoord14 = bgfx.impl.Attrib.Enum.texCoord14,
+ texCoord15 = bgfx.impl.Attrib.Enum.texCoord15,
count = bgfx.impl.Attrib.Enum.count,
}
@@ -721,6 +729,8 @@ enum AttribType: bgfx.impl.AttribType.Enum{
uint16 = bgfx.impl.AttribType.Enum.uint16,
half = bgfx.impl.AttribType.Enum.half,
float_ = bgfx.impl.AttribType.Enum.float_,
+ int32 = bgfx.impl.AttribType.Enum.int32,
+ uint32 = bgfx.impl.AttribType.Enum.uint32,
count = bgfx.impl.AttribType.Enum.count,
}
@@ -1132,6 +1142,8 @@ extern(C++, "bgfx") struct Caps{
uint maxComputeBindings; ///Maximum number of compute bindings.
uint maxVertexLayouts; ///Maximum number of vertex format layouts.
uint maxVertexStreams; ///Maximum number of vertex streams.
+ uint maxVertexAttributes; ///Maximum number of vertex attributes.
+ uint maxInstanceData; ///Maximum number of instance data slots.
uint maxIndexBuffers; ///Maximum number of index buffer handles.
uint maxVertexBuffers; ///Maximum number of vertex buffer handles.
uint maxDynamicIndexBuffers; ///Maximum number of dynamic index buffer handles.
diff --git a/bindings/zig/bgfx.zig b/bindings/zig/bgfx.zig
index 45ff27db9..77c8c10d1 100644
--- a/bindings/zig/bgfx.zig
+++ b/bindings/zig/bgfx.zig
@@ -1033,6 +1033,30 @@ pub const Attrib = enum(c_int) {
/// a_texcoord7
TexCoord7,
+ /// a_texcoord8
+ TexCoord8,
+
+ /// a_texcoord9
+ TexCoord9,
+
+ /// a_texcoord10
+ TexCoord10,
+
+ /// a_texcoord11
+ TexCoord11,
+
+ /// a_texcoord12
+ TexCoord12,
+
+ /// a_texcoord13
+ TexCoord13,
+
+ /// a_texcoord14
+ TexCoord14,
+
+ /// a_texcoord15
+ TexCoord15,
+
Count
};
@@ -1058,6 +1082,12 @@ pub const AttribType = enum(c_int) {
/// Float
Float,
+ /// Int32
+ Int32,
+
+ /// Uint32
+ Uint32,
+
Count
};
@@ -1588,6 +1618,8 @@ pub const Caps = extern struct {
maxComputeBindings: u32,
maxVertexLayouts: u32,
maxVertexStreams: u32,
+ maxVertexAttributes: u32,
+ maxInstanceData: u32,
maxIndexBuffers: u32,
maxVertexBuffers: u32,
maxDynamicIndexBuffers: u32,
@@ -1824,8 +1856,8 @@ pub const Init = extern struct {
pub const VertexLayout = extern struct {
hash: u32,
stride: u16,
- offset: [18]u16,
- attributes: [18]u16,
+ offset: [26]u16,
+ attributes: [26]u16,
/// Start VertexLayout.
/// Renderer backend type. See: `bgfx::RendererType`
pub inline fn begin(self: *VertexLayout, _rendererType: RendererType) *VertexLayout {
diff --git a/examples/05-instancing/varying.def.sc b/examples/05-instancing/varying.def.sc
index 2ac2984d2..f519f02d0 100644
--- a/examples/05-instancing/varying.def.sc
+++ b/examples/05-instancing/varying.def.sc
@@ -2,8 +2,8 @@ vec4 v_color0 : COLOR0 = vec4(1.0, 0.0, 0.0, 1.0);
vec3 a_position : POSITION;
vec4 a_color0 : COLOR0;
-vec4 i_data0 : TEXCOORD7;
-vec4 i_data1 : TEXCOORD6;
-vec4 i_data2 : TEXCOORD5;
-vec4 i_data3 : TEXCOORD4;
-vec4 i_data4 : TEXCOORD3;
+vec4 i_data0 : TEXCOORD31;
+vec4 i_data1 : TEXCOORD30;
+vec4 i_data2 : TEXCOORD29;
+vec4 i_data3 : TEXCOORD28;
+vec4 i_data4 : TEXCOORD27;
diff --git a/examples/06-bump/varying.def.sc b/examples/06-bump/varying.def.sc
index 34417e785..159908487 100644
--- a/examples/06-bump/varying.def.sc
+++ b/examples/06-bump/varying.def.sc
@@ -9,7 +9,7 @@ vec3 a_position : POSITION;
vec4 a_normal : NORMAL;
vec4 a_tangent : TANGENT;
vec2 a_texcoord0 : TEXCOORD0;
-vec4 i_data0 : TEXCOORD7;
-vec4 i_data1 : TEXCOORD6;
-vec4 i_data2 : TEXCOORD5;
-vec4 i_data3 : TEXCOORD4;
+vec4 i_data0 : TEXCOORD31;
+vec4 i_data1 : TEXCOORD30;
+vec4 i_data2 : TEXCOORD29;
+vec4 i_data3 : TEXCOORD28;
diff --git a/examples/24-nbody/varying.def.sc b/examples/24-nbody/varying.def.sc
index 16023cea0..5d7acbbdf 100644
--- a/examples/24-nbody/varying.def.sc
+++ b/examples/24-nbody/varying.def.sc
@@ -1,4 +1,4 @@
vec2 a_position : POSITION;
-vec4 i_data0 : TEXCOORD7;
+vec4 i_data0 : TEXCOORD31;
vec3 v_texCoord : TEXCOORD0 = vec3(0.0, 0.0, 0.0);
diff --git a/examples/33-pom/varying.def.sc b/examples/33-pom/varying.def.sc
index 2b42f9cc8..a6d268ea4 100644
--- a/examples/33-pom/varying.def.sc
+++ b/examples/33-pom/varying.def.sc
@@ -7,7 +7,3 @@ vec3 a_position : POSITION;
vec3 a_tangent : TANGENT;
vec3 a_bitangent : BITANGENT;
vec2 a_texcoord0 : TEXCOORD0;
-vec4 i_data0 : TEXCOORD7;
-vec4 i_data1 : TEXCOORD6;
-vec4 i_data2 : TEXCOORD5;
-vec4 i_data3 : TEXCOORD4;
diff --git a/examples/37-gpudrivenrendering/varying.def.sc b/examples/37-gpudrivenrendering/varying.def.sc
index bab2e384d..a14c3669d 100644
--- a/examples/37-gpudrivenrendering/varying.def.sc
+++ b/examples/37-gpudrivenrendering/varying.def.sc
@@ -1,9 +1,9 @@
vec3 a_position : POSITION;
vec2 a_texcoord0 : TEXCOORD0;
-vec4 i_data0 : TEXCOORD7;
-vec4 i_data1 : TEXCOORD6;
-vec4 i_data2 : TEXCOORD5;
-vec4 i_data3 : TEXCOORD4;
+vec4 i_data0 : TEXCOORD31;
+vec4 i_data1 : TEXCOORD30;
+vec4 i_data2 : TEXCOORD29;
+vec4 i_data3 : TEXCOORD28;
vec2 v_texcoord0 : TEXCOORD0;
flat float v_materialID : TEXCOORD0;
diff --git a/examples/runtime/shaders/dxbc/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/dxbc/cs_gdr_stream_compaction.bin
index 4fa810c52..929844138 100644
Binary files a/examples/runtime/shaders/dxbc/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/dxbc/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/dxbc/cs_indirect.bin b/examples/runtime/shaders/dxbc/cs_indirect.bin
index 24ecdedc5..db544849d 100644
Binary files a/examples/runtime/shaders/dxbc/cs_indirect.bin and b/examples/runtime/shaders/dxbc/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/dxbc/vs_bump_instanced.bin b/examples/runtime/shaders/dxbc/vs_bump_instanced.bin
index 4f1a01239..3aa697a3d 100644
Binary files a/examples/runtime/shaders/dxbc/vs_bump_instanced.bin and b/examples/runtime/shaders/dxbc/vs_bump_instanced.bin differ
diff --git a/examples/runtime/shaders/dxbc/vs_gdr_instanced_indirect_rendering.bin b/examples/runtime/shaders/dxbc/vs_gdr_instanced_indirect_rendering.bin
index ae5257097..0632ad34a 100644
Binary files a/examples/runtime/shaders/dxbc/vs_gdr_instanced_indirect_rendering.bin and b/examples/runtime/shaders/dxbc/vs_gdr_instanced_indirect_rendering.bin differ
diff --git a/examples/runtime/shaders/dxbc/vs_gdr_render_occlusion.bin b/examples/runtime/shaders/dxbc/vs_gdr_render_occlusion.bin
index 8191e3c53..d42737c6d 100644
Binary files a/examples/runtime/shaders/dxbc/vs_gdr_render_occlusion.bin and b/examples/runtime/shaders/dxbc/vs_gdr_render_occlusion.bin differ
diff --git a/examples/runtime/shaders/dxbc/vs_instancing.bin b/examples/runtime/shaders/dxbc/vs_instancing.bin
index bcfb64db6..ce7c0ce63 100644
Binary files a/examples/runtime/shaders/dxbc/vs_instancing.bin and b/examples/runtime/shaders/dxbc/vs_instancing.bin differ
diff --git a/examples/runtime/shaders/dxbc/vs_particle.bin b/examples/runtime/shaders/dxbc/vs_particle.bin
index 0526cec17..310d2401d 100644
Binary files a/examples/runtime/shaders/dxbc/vs_particle.bin and b/examples/runtime/shaders/dxbc/vs_particle.bin differ
diff --git a/examples/runtime/shaders/dxil/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/dxil/cs_gdr_stream_compaction.bin
index 2f139534f..e41965139 100644
Binary files a/examples/runtime/shaders/dxil/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/dxil/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/dxil/cs_indirect.bin b/examples/runtime/shaders/dxil/cs_indirect.bin
index bb50a44aa..680e7e8f1 100644
Binary files a/examples/runtime/shaders/dxil/cs_indirect.bin and b/examples/runtime/shaders/dxil/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/dxil/vs_bump_instanced.bin b/examples/runtime/shaders/dxil/vs_bump_instanced.bin
index cb06fb3c0..202963e56 100644
Binary files a/examples/runtime/shaders/dxil/vs_bump_instanced.bin and b/examples/runtime/shaders/dxil/vs_bump_instanced.bin differ
diff --git a/examples/runtime/shaders/dxil/vs_gdr_instanced_indirect_rendering.bin b/examples/runtime/shaders/dxil/vs_gdr_instanced_indirect_rendering.bin
index 123718cd0..aee460602 100644
Binary files a/examples/runtime/shaders/dxil/vs_gdr_instanced_indirect_rendering.bin and b/examples/runtime/shaders/dxil/vs_gdr_instanced_indirect_rendering.bin differ
diff --git a/examples/runtime/shaders/dxil/vs_gdr_render_occlusion.bin b/examples/runtime/shaders/dxil/vs_gdr_render_occlusion.bin
index 562e899a1..cd0261a39 100644
Binary files a/examples/runtime/shaders/dxil/vs_gdr_render_occlusion.bin and b/examples/runtime/shaders/dxil/vs_gdr_render_occlusion.bin differ
diff --git a/examples/runtime/shaders/dxil/vs_instancing.bin b/examples/runtime/shaders/dxil/vs_instancing.bin
index b19fc90f5..615a8118b 100644
Binary files a/examples/runtime/shaders/dxil/vs_instancing.bin and b/examples/runtime/shaders/dxil/vs_instancing.bin differ
diff --git a/examples/runtime/shaders/dxil/vs_particle.bin b/examples/runtime/shaders/dxil/vs_particle.bin
index dee74fef5..25699dbed 100644
Binary files a/examples/runtime/shaders/dxil/vs_particle.bin and b/examples/runtime/shaders/dxil/vs_particle.bin differ
diff --git a/examples/runtime/shaders/essl/cs_indirect.bin b/examples/runtime/shaders/essl/cs_indirect.bin
index af86cf8d9..71464e532 100644
Binary files a/examples/runtime/shaders/essl/cs_indirect.bin and b/examples/runtime/shaders/essl/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/essl/cs_init_instances.bin b/examples/runtime/shaders/essl/cs_init_instances.bin
index 2020bc130..b34b83e6a 100644
Binary files a/examples/runtime/shaders/essl/cs_init_instances.bin and b/examples/runtime/shaders/essl/cs_init_instances.bin differ
diff --git a/examples/runtime/shaders/essl/cs_update_instances.bin b/examples/runtime/shaders/essl/cs_update_instances.bin
index cda09f459..ceeacf28a 100644
Binary files a/examples/runtime/shaders/essl/cs_update_instances.bin and b/examples/runtime/shaders/essl/cs_update_instances.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin b/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin
index 07d32fb40..eeccbd156 100644
Binary files a/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin and b/examples/runtime/shaders/glsl/cs_gdr_copy_z.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin b/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin
index 7bb6a51d5..c1e9ac727 100644
Binary files a/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin and b/examples/runtime/shaders/glsl/cs_gdr_downscale_hi_z.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin b/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin
index 26065539b..74356cec1 100644
Binary files a/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin and b/examples/runtime/shaders/glsl/cs_gdr_occlude_props.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin
index cbd9bcbd7..b517c2a98 100644
Binary files a/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/glsl/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_indirect.bin b/examples/runtime/shaders/glsl/cs_indirect.bin
index cf9b25298..a8b2d78bd 100644
Binary files a/examples/runtime/shaders/glsl/cs_indirect.bin and b/examples/runtime/shaders/glsl/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_init_instances.bin b/examples/runtime/shaders/glsl/cs_init_instances.bin
index 70dd87081..fb7b8422d 100644
Binary files a/examples/runtime/shaders/glsl/cs_init_instances.bin and b/examples/runtime/shaders/glsl/cs_init_instances.bin differ
diff --git a/examples/runtime/shaders/glsl/cs_update_instances.bin b/examples/runtime/shaders/glsl/cs_update_instances.bin
index 68bec2000..b7aae5ff3 100644
Binary files a/examples/runtime/shaders/glsl/cs_update_instances.bin and b/examples/runtime/shaders/glsl/cs_update_instances.bin differ
diff --git a/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin b/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin
index 5a50a8d23..0fcaf2c4d 100644
Binary files a/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin and b/examples/runtime/shaders/metal/cs_gdr_downscale_hi_z.bin differ
diff --git a/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin b/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin
index 52018b6c7..de832acc6 100644
Binary files a/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin and b/examples/runtime/shaders/metal/cs_gdr_occlude_props.bin differ
diff --git a/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin
index 67ce3893e..05e2d631c 100644
Binary files a/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/metal/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/metal/cs_indirect.bin b/examples/runtime/shaders/metal/cs_indirect.bin
index b905a28a3..e3aa30199 100644
Binary files a/examples/runtime/shaders/metal/cs_indirect.bin and b/examples/runtime/shaders/metal/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/metal/cs_init_instances.bin b/examples/runtime/shaders/metal/cs_init_instances.bin
index 8c7a2c6c7..d0ea25667 100644
Binary files a/examples/runtime/shaders/metal/cs_init_instances.bin and b/examples/runtime/shaders/metal/cs_init_instances.bin differ
diff --git a/examples/runtime/shaders/metal/cs_update_instances.bin b/examples/runtime/shaders/metal/cs_update_instances.bin
index 2c0d4c6da..a0e869642 100644
Binary files a/examples/runtime/shaders/metal/cs_update_instances.bin and b/examples/runtime/shaders/metal/cs_update_instances.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin b/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin
index 0978b7d96..fdd3d99a8 100644
Binary files a/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin and b/examples/runtime/shaders/spirv/cs_gdr_copy_z.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin b/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin
index 67d107539..b28095616 100644
Binary files a/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin and b/examples/runtime/shaders/spirv/cs_gdr_downscale_hi_z.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin b/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin
index fc77858b6..45be0fd01 100644
Binary files a/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin and b/examples/runtime/shaders/spirv/cs_gdr_occlude_props.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin
index aee768b4f..67443345b 100644
Binary files a/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/spirv/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_indirect.bin b/examples/runtime/shaders/spirv/cs_indirect.bin
index 08e4b5ea2..e1f17db33 100644
Binary files a/examples/runtime/shaders/spirv/cs_indirect.bin and b/examples/runtime/shaders/spirv/cs_indirect.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_init_instances.bin b/examples/runtime/shaders/spirv/cs_init_instances.bin
index 4358deb77..95629db43 100644
Binary files a/examples/runtime/shaders/spirv/cs_init_instances.bin and b/examples/runtime/shaders/spirv/cs_init_instances.bin differ
diff --git a/examples/runtime/shaders/spirv/cs_update_instances.bin b/examples/runtime/shaders/spirv/cs_update_instances.bin
index fd37c1189..695311bdf 100644
Binary files a/examples/runtime/shaders/spirv/cs_update_instances.bin and b/examples/runtime/shaders/spirv/cs_update_instances.bin differ
diff --git a/examples/runtime/shaders/wgsl/cs_gdr_stream_compaction.bin b/examples/runtime/shaders/wgsl/cs_gdr_stream_compaction.bin
index 32b9e1760..89f39dced 100644
Binary files a/examples/runtime/shaders/wgsl/cs_gdr_stream_compaction.bin and b/examples/runtime/shaders/wgsl/cs_gdr_stream_compaction.bin differ
diff --git a/examples/runtime/shaders/wgsl/cs_indirect.bin b/examples/runtime/shaders/wgsl/cs_indirect.bin
index 585187295..9ca1ec3eb 100644
Binary files a/examples/runtime/shaders/wgsl/cs_indirect.bin and b/examples/runtime/shaders/wgsl/cs_indirect.bin differ
diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h
index 9357f176c..ee59b8532 100644
--- a/include/bgfx/bgfx.h
+++ b/include/bgfx/bgfx.h
@@ -101,24 +101,32 @@ namespace bgfx
/// Corresponds to vertex shader attribute.
enum Enum
{
- Position, //!< a_position
- Normal, //!< a_normal
- Tangent, //!< a_tangent
- Bitangent, //!< a_bitangent
- Color0, //!< a_color0
- Color1, //!< a_color1
- Color2, //!< a_color2
- Color3, //!< a_color3
- Indices, //!< a_indices
- Weight, //!< a_weight
- TexCoord0, //!< a_texcoord0
- TexCoord1, //!< a_texcoord1
- TexCoord2, //!< a_texcoord2
- TexCoord3, //!< a_texcoord3
- TexCoord4, //!< a_texcoord4
- TexCoord5, //!< a_texcoord5
- TexCoord6, //!< a_texcoord6
- TexCoord7, //!< a_texcoord7
+ Position, //!< a_position
+ Normal, //!< a_normal
+ Tangent, //!< a_tangent
+ Bitangent, //!< a_bitangent
+ Color0, //!< a_color0
+ Color1, //!< a_color1
+ Color2, //!< a_color2
+ Color3, //!< a_color3
+ Indices, //!< a_indices
+ Weight, //!< a_weight
+ TexCoord0, //!< a_texcoord0
+ TexCoord1, //!< a_texcoord1
+ TexCoord2, //!< a_texcoord2
+ TexCoord3, //!< a_texcoord3
+ TexCoord4, //!< a_texcoord4
+ TexCoord5, //!< a_texcoord5
+ TexCoord6, //!< a_texcoord6
+ TexCoord7, //!< a_texcoord7
+ TexCoord8, //!< a_texcoord8
+ TexCoord9, //!< a_texcoord9
+ TexCoord10, //!< a_texcoord10
+ TexCoord11, //!< a_texcoord11
+ TexCoord12, //!< a_texcoord12
+ TexCoord13, //!< a_texcoord13
+ TexCoord14, //!< a_texcoord14
+ TexCoord15, //!< a_texcoord15
Count
};
@@ -140,6 +148,8 @@ namespace bgfx
Uint16, //!< Uint16
Half, //!< Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
Float, //!< Float
+ Int32, //!< Int32
+ Uint32, //!< Uint32
Count
};
@@ -545,6 +555,8 @@ namespace bgfx
uint32_t maxComputeBindings; //!< Maximum number of compute bindings.
uint32_t maxVertexLayouts; //!< Maximum number of vertex format layouts.
uint32_t maxVertexStreams; //!< Maximum number of vertex streams.
+ uint32_t maxVertexAttributes; //!< Maximum number of vertex attributes.
+ uint32_t maxInstanceData; //!< Maximum number of instance data slots.
uint32_t maxIndexBuffers; //!< Maximum number of index buffer handles.
uint32_t maxVertexBuffers; //!< Maximum number of vertex buffer handles.
uint32_t maxDynamicIndexBuffers; //!< Maximum number of dynamic index buffer handles.
diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h
index 17eca6c81..f3b87c362 100644
--- a/include/bgfx/c99/bgfx.h
+++ b/include/bgfx/c99/bgfx.h
@@ -134,6 +134,14 @@ typedef enum bgfx_attrib
BGFX_ATTRIB_TEXCOORD5, /** (15) a_texcoord5 */
BGFX_ATTRIB_TEXCOORD6, /** (16) a_texcoord6 */
BGFX_ATTRIB_TEXCOORD7, /** (17) a_texcoord7 */
+ BGFX_ATTRIB_TEXCOORD8, /** (18) a_texcoord8 */
+ BGFX_ATTRIB_TEXCOORD9, /** (19) a_texcoord9 */
+ BGFX_ATTRIB_TEXCOORD10, /** (20) a_texcoord10 */
+ BGFX_ATTRIB_TEXCOORD11, /** (21) a_texcoord11 */
+ BGFX_ATTRIB_TEXCOORD12, /** (22) a_texcoord12 */
+ BGFX_ATTRIB_TEXCOORD13, /** (23) a_texcoord13 */
+ BGFX_ATTRIB_TEXCOORD14, /** (24) a_texcoord14 */
+ BGFX_ATTRIB_TEXCOORD15, /** (25) a_texcoord15 */
BGFX_ATTRIB_COUNT
@@ -152,6 +160,8 @@ typedef enum bgfx_attrib_type
BGFX_ATTRIB_TYPE_UINT16, /** ( 4) Uint16 */
BGFX_ATTRIB_TYPE_HALF, /** ( 5) Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`. */
BGFX_ATTRIB_TYPE_FLOAT, /** ( 6) Float */
+ BGFX_ATTRIB_TYPE_INT32, /** ( 7) Int32 */
+ BGFX_ATTRIB_TYPE_UINT32, /** ( 8) Uint32 */
BGFX_ATTRIB_TYPE_COUNT
@@ -586,6 +596,8 @@ typedef struct bgfx_caps_limits_s
uint32_t maxComputeBindings; /** Maximum number of compute bindings. */
uint32_t maxVertexLayouts; /** Maximum number of vertex format layouts. */
uint32_t maxVertexStreams; /** Maximum number of vertex streams. */
+ uint32_t maxVertexAttributes; /** Maximum number of vertex attributes. */
+ uint32_t maxInstanceData; /** Maximum number of instance data slots. */
uint32_t maxIndexBuffers; /** Maximum number of index buffer handles. */
uint32_t maxVertexBuffers; /** Maximum number of vertex buffer handles. */
uint32_t maxDynamicIndexBuffers; /** Maximum number of dynamic index buffer handles. */
diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h
index 9f9065b7b..ef65b27dc 100644
--- a/include/bgfx/defines.h
+++ b/include/bgfx/defines.h
@@ -15,7 +15,7 @@
#ifndef BGFX_DEFINES_H_HEADER_GUARD
#define BGFX_DEFINES_H_HEADER_GUARD
-#define BGFX_API_VERSION UINT32_C(149)
+#define BGFX_API_VERSION UINT32_C(150)
/**
* Color RGB/alpha/depth write. When it's not specified write will be disabled.
diff --git a/scripts/bgfx.idl b/scripts/bgfx.idl
index f8e5bb39e..df405e623 100644
--- a/scripts/bgfx.idl
+++ b/scripts/bgfx.idl
@@ -1,7 +1,7 @@
-- vim: syntax=lua
-- bgfx interface
-version(149)
+version(150)
typedef "bool"
typedef "char"
@@ -549,6 +549,14 @@ enum.Attrib { comment = "Corresponds to vertex shader attribute.", section = "Ve
.TexCoord5 --- a_texcoord5
.TexCoord6 --- a_texcoord6
.TexCoord7 --- a_texcoord7
+ .TexCoord8 --- a_texcoord8
+ .TexCoord9 --- a_texcoord9
+ .TexCoord10 --- a_texcoord10
+ .TexCoord11 --- a_texcoord11
+ .TexCoord12 --- a_texcoord12
+ .TexCoord13 --- a_texcoord13
+ .TexCoord14 --- a_texcoord14
+ .TexCoord15 --- a_texcoord15
()
--- Vertex attribute type enum.
@@ -560,6 +568,8 @@ enum.AttribType { comment = "Attribute types:", section = "Vertex Buffers" }
.Uint16 --- Uint16
.Half --- Half, availability depends on: `BGFX_CAPS_VERTEX_ATTRIB_HALF`.
.Float --- Float
+ .Int32 --- Int32
+ .Uint32 --- Uint32
()
--- Texture format enum.
@@ -808,6 +818,8 @@ struct.Limits { namespace = "Caps" }
.maxComputeBindings "uint32_t" --- Maximum number of compute bindings.
.maxVertexLayouts "uint32_t" --- Maximum number of vertex format layouts.
.maxVertexStreams "uint32_t" --- Maximum number of vertex streams.
+ .maxVertexAttributes "uint32_t" --- Maximum number of vertex attributes.
+ .maxInstanceData "uint32_t" --- Maximum number of instance data slots.
.maxIndexBuffers "uint32_t" --- Maximum number of index buffer handles.
.maxVertexBuffers "uint32_t" --- Maximum number of vertex buffer handles.
.maxDynamicIndexBuffers "uint32_t" --- Maximum number of dynamic index buffer handles.
diff --git a/src/bgfx.cpp b/src/bgfx.cpp
index 4d940584b..d624e7753 100644
--- a/src/bgfx.cpp
+++ b/src/bgfx.cpp
@@ -815,7 +815,7 @@ namespace bgfx
ShaderHandle vsh = createEmbeddedShader(s_embeddedShaders, g_caps.rendererType, "vs_debugfont");
ShaderHandle fsh = createEmbeddedShader(s_embeddedShaders, g_caps.rendererType, "fs_debugfont");
- BX_ASSERT(isValid(vsh) && isValid(fsh), "Failed to create embedded blit shaders");
+ BX_ASSERT(isValid(vsh) && isValid(fsh), "Failed to create embedded debug font shaders");
m_program = createProgram(vsh, fsh, true);
@@ -2033,6 +2033,8 @@ namespace bgfx
LIMITS(maxComputeBindings);
LIMITS(maxVertexLayouts);
LIMITS(maxVertexStreams);
+ LIMITS(maxVertexAttributes);
+ LIMITS(maxInstanceData);
LIMITS(maxIndexBuffers);
LIMITS(maxVertexBuffers);
LIMITS(maxDynamicIndexBuffers);
@@ -4077,8 +4079,10 @@ namespace bgfx
g_caps.limits.maxTextures = BGFX_CONFIG_MAX_TEXTURES;
g_caps.limits.maxTextureSamplers = BGFX_CONFIG_MAX_TEXTURE_SAMPLERS;
g_caps.limits.maxComputeBindings = 0;
+ g_caps.limits.maxInstanceData = BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT;
g_caps.limits.maxVertexLayouts = BGFX_CONFIG_MAX_VERTEX_LAYOUTS;
g_caps.limits.maxVertexStreams = 1;
+ g_caps.limits.maxVertexAttributes = 16;
g_caps.limits.maxIndexBuffers = BGFX_CONFIG_MAX_INDEX_BUFFERS;
g_caps.limits.maxVertexBuffers = BGFX_CONFIG_MAX_VERTEX_BUFFERS;
g_caps.limits.maxDynamicIndexBuffers = BGFX_CONFIG_MAX_DYNAMIC_INDEX_BUFFERS;
diff --git a/src/config.h b/src/config.h
index 7b4b27610..0ae740f78 100644
--- a/src/config.h
+++ b/src/config.h
@@ -460,11 +460,16 @@ static_assert(BGFX_CONFIG_MAX_VERTEX_STREAMS < 32, "Must be less than 32!");
# define BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE (32<<20)
#endif // BGFX_CONFIG_MAX_SCRATCH_STAGING_BUFFER_PER_FRAME_SIZE
+/// First TEXCOORD representing instanced data. N is decreasing.
+#ifndef BGFX_CONFIG_INSTANCE_DATA_FIRST_TEXCOORD
+# define BGFX_CONFIG_INSTANCE_DATA_FIRST_TEXCOORD 31
+#endif // BGFX_CONFIG_INSTANCE_DATA_FIRST_TEXCOORD
+
/// Maximum number of instance data vec4 attributes per draw call. Default is 5.
/// Each instance data element is a vec4 (16 bytes). Total instance stride is
/// BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT * 16 bytes.
#ifndef BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
-# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 5
+# define BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT 16
#endif // BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT
/// Maximum number of color palette entries. Default is 16.
diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp
index 7b2421b5f..9923208f0 100644
--- a/src/renderer_d3d11.cpp
+++ b/src/renderer_d3d11.cpp
@@ -327,6 +327,14 @@ namespace bgfx { namespace d3d11
{ "TEXCOORD", 5, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 8, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 9, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 10, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 11, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 12, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 13, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 14, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 15, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 },
};
static_assert(Attrib::Count == BX_COUNTOF(s_attrib) );
@@ -374,6 +382,18 @@ namespace bgfx { namespace d3d11
{ DXGI_FORMAT_R32G32B32_FLOAT, DXGI_FORMAT_R32G32B32_FLOAT },
{ DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT },
},
+ { // Int32 (32-bit integers can't be normalized; both slots are the SINT format)
+ { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT },
+ { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT },
+ { DXGI_FORMAT_R32G32B32_SINT, DXGI_FORMAT_R32G32B32_SINT },
+ { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT },
+ },
+ { // Uint32
+ { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT },
+ { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT },
+ { DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_UINT },
+ { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT },
+ },
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -1313,8 +1333,11 @@ namespace bgfx { namespace d3d11
D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT
, BGFX_CONFIG_MAX_VERTEX_STREAMS
) );
+ g_caps.limits.maxVertexAttributes = D3D11_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT;
}
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
+
// 32-bit indices only supported on 9_2+.
if (m_featureLevel >= D3D_FEATURE_LEVEL_9_2)
{
@@ -2832,7 +2855,7 @@ namespace bgfx { namespace d3d11
for (uint32_t ii = 0; ii < _numInstanceData; ++ii)
{
- uint32_t index = 7-ii; // TEXCOORD7 = i_data0, TEXCOORD6 = i_data1, etc.
+ const uint32_t index = BGFX_CONFIG_INSTANCE_DATA_FIRST_TEXCOORD - ii; // TEXCOORD(x) = i_data0, TEXCOORD(x-1) = i_data1, etc.
uint32_t jj;
D3D11_INPUT_ELEMENT_DESC* curr = vertexElements;
diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp
index ede543968..c6f8ea888 100644
--- a/src/renderer_d3d12.cpp
+++ b/src/renderer_d3d12.cpp
@@ -335,6 +335,14 @@ namespace bgfx { namespace d3d12
{ "TEXCOORD", 5, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 6, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
{ "TEXCOORD", 7, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 8, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 9, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 10, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 11, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 12, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 13, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 14, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
+ { "TEXCOORD", 15, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 },
};
static_assert(Attrib::Count == BX_COUNTOF(s_attrib) );
@@ -382,6 +390,18 @@ namespace bgfx { namespace d3d12
{ DXGI_FORMAT_R32G32B32_FLOAT, DXGI_FORMAT_R32G32B32_FLOAT },
{ DXGI_FORMAT_R32G32B32A32_FLOAT, DXGI_FORMAT_R32G32B32A32_FLOAT },
},
+ { // Int32 (32-bit integers can't be normalized; both slots are the SINT format)
+ { DXGI_FORMAT_R32_SINT, DXGI_FORMAT_R32_SINT },
+ { DXGI_FORMAT_R32G32_SINT, DXGI_FORMAT_R32G32_SINT },
+ { DXGI_FORMAT_R32G32B32_SINT, DXGI_FORMAT_R32G32B32_SINT },
+ { DXGI_FORMAT_R32G32B32A32_SINT, DXGI_FORMAT_R32G32B32A32_SINT },
+ },
+ { // Uint32
+ { DXGI_FORMAT_R32_UINT, DXGI_FORMAT_R32_UINT },
+ { DXGI_FORMAT_R32G32_UINT, DXGI_FORMAT_R32G32_UINT },
+ { DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_UINT },
+ { DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_UINT },
+ },
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -1686,6 +1706,8 @@ namespace bgfx { namespace d3d12
g_caps.limits.maxFBAttachments = bx::min(16, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS);
g_caps.limits.maxComputeBindings = bx::min(D3D12_UAV_SLOT_COUNT, BGFX_MAX_COMPUTE_BINDINGS);
g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS;
+ g_caps.limits.maxVertexAttributes = D3D12_IA_VERTEX_INPUT_STRUCTURE_ELEMENT_COUNT;
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
for (uint32_t ii = 0; ii < TextureFormat::Count; ++ii)
{
@@ -3367,7 +3389,7 @@ namespace bgfx { namespace d3d12
for (uint32_t ii = 0; ii < _numInstanceData; ++ii)
{
- uint32_t index = 7 - ii; // TEXCOORD7 = i_data0, TEXCOORD6 = i_data1, etc.
+ uint32_t index = BGFX_CONFIG_INSTANCE_DATA_FIRST_TEXCOORD - ii; // TEXCOORD(x) = i_data0, TEXCOORD(x-1) = i_data1, etc.
uint32_t jj;
D3D12_INPUT_ELEMENT_DESC* curr = _vertexElements;
diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp
index 58544a601..5caabd79d 100644
--- a/src/renderer_gl.cpp
+++ b/src/renderer_gl.cpp
@@ -61,6 +61,14 @@ namespace bgfx { namespace gl
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
};
static_assert(Attrib::Count == BX_COUNTOF(s_attribName) );
@@ -71,6 +79,17 @@ namespace bgfx { namespace gl
"i_data2",
"i_data3",
"i_data4",
+ "i_data5",
+ "i_data6",
+ "i_data7",
+ "i_data8",
+ "i_data9",
+ "i_data10",
+ "i_data11",
+ "i_data12",
+ "i_data13",
+ "i_data14",
+ "i_data15",
};
static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
@@ -91,6 +110,8 @@ namespace bgfx { namespace gl
GL_UNSIGNED_SHORT, // Uint16
GL_HALF_FLOAT, // Half
GL_FLOAT, // Float
+ GL_INT, // Int32
+ GL_UNSIGNED_INT, // Uint32
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -2963,6 +2984,8 @@ namespace bgfx { namespace gl
g_caps.limits.maxTextureLayers = BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGLES >= 30) || s_extension[Extension::EXT_texture_array].m_supported ? uint16_t(bx::max(glGet(GL_MAX_ARRAY_TEXTURE_LAYERS), 1) ) : 1;
g_caps.limits.maxComputeBindings = computeSupport ? BGFX_MAX_COMPUTE_BINDINGS : 0;
g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS;
+ g_caps.limits.maxVertexAttributes = uint32_t(glGet(GL_MAX_VERTEX_ATTRIBS) );
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
if (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL)
|| m_gles3
diff --git a/src/renderer_mtl.cpp b/src/renderer_mtl.cpp
index 7ddf0fa55..62da2e470 100644
--- a/src/renderer_mtl.cpp
+++ b/src/renderer_mtl.cpp
@@ -71,6 +71,14 @@ namespace bgfx { namespace mtl
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
};
static_assert(Attrib::Count == BX_COUNTOF(s_attribName) );
@@ -81,6 +89,17 @@ namespace bgfx { namespace mtl
"i_data2",
"i_data3",
"i_data4",
+ "i_data5",
+ "i_data6",
+ "i_data7",
+ "i_data8",
+ "i_data9",
+ "i_data10",
+ "i_data11",
+ "i_data12",
+ "i_data13",
+ "i_data14",
+ "i_data15",
};
static_assert(BGFX_CONFIG_MAX_INSTANCE_DATA_COUNT == BX_COUNTOF(s_instanceDataName) );
@@ -128,6 +147,18 @@ namespace bgfx { namespace mtl
{ MTL::VertexFormatFloat3, MTL::VertexFormatFloat3 },
{ MTL::VertexFormatFloat4, MTL::VertexFormatFloat4 },
},
+ { // Int32 (32-bit integers can't be normalized; both slots are the SINT format)
+ { MTL::VertexFormatInt, MTL::VertexFormatInt },
+ { MTL::VertexFormatInt2, MTL::VertexFormatInt2 },
+ { MTL::VertexFormatInt3, MTL::VertexFormatInt3 },
+ { MTL::VertexFormatInt4, MTL::VertexFormatInt4 },
+ },
+ { // Uint32
+ { MTL::VertexFormatUInt, MTL::VertexFormatUInt },
+ { MTL::VertexFormatUInt2, MTL::VertexFormatUInt2 },
+ { MTL::VertexFormatUInt3, MTL::VertexFormatUInt3 },
+ { MTL::VertexFormatUInt4, MTL::VertexFormatUInt4 },
+ },
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -961,6 +992,8 @@ static_assert(BX_COUNTOF(s_accessNames) == Access::Count, "Invalid s_accessNames
g_caps.limits.maxTextureLayers = 2048;
g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS;
+ g_caps.limits.maxVertexAttributes = 31;
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
// Maximum number of entries in the buffer argument table, per graphics or compute function are 31.
// It is decremented by 1 because 1 entry is used for uniforms.
g_caps.limits.maxComputeBindings = bx::min(30, BGFX_MAX_COMPUTE_BINDINGS);
diff --git a/src/renderer_noop.cpp b/src/renderer_noop.cpp
index 9a2e86d04..f8d305d16 100644
--- a/src/renderer_noop.cpp
+++ b/src/renderer_noop.cpp
@@ -75,6 +75,7 @@ namespace bgfx { namespace noop
g_caps.limits.maxComputeBindings = g_caps.limits.maxTextureSamplers;
g_caps.limits.maxFBAttachments = BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS;
g_caps.limits.maxVertexStreams = BGFX_CONFIG_MAX_VERTEX_STREAMS;
+ g_caps.limits.maxVertexAttributes = 32;
}
~RendererContextNOOP()
diff --git a/src/renderer_vk.cpp b/src/renderer_vk.cpp
index 6c3a09ac9..2f32a3e43 100644
--- a/src/renderer_vk.cpp
+++ b/src/renderer_vk.cpp
@@ -554,6 +554,18 @@ VK_IMPORT_DEVICE
{ VK_FORMAT_R32G32B32_SFLOAT, VK_FORMAT_R32G32B32_SFLOAT },
{ VK_FORMAT_R32G32B32A32_SFLOAT, VK_FORMAT_R32G32B32A32_SFLOAT },
},
+ { // Int32 (32-bit integers can't be normalized; both slots are the SINT format)
+ { VK_FORMAT_R32_SINT, VK_FORMAT_R32_SINT },
+ { VK_FORMAT_R32G32_SINT, VK_FORMAT_R32G32_SINT },
+ { VK_FORMAT_R32G32B32_SINT, VK_FORMAT_R32G32B32_SINT },
+ { VK_FORMAT_R32G32B32A32_SINT, VK_FORMAT_R32G32B32A32_SINT },
+ },
+ { // Uint32
+ { VK_FORMAT_R32_UINT, VK_FORMAT_R32_UINT },
+ { VK_FORMAT_R32G32_UINT, VK_FORMAT_R32G32_UINT },
+ { VK_FORMAT_R32G32B32_UINT, VK_FORMAT_R32G32B32_UINT },
+ { VK_FORMAT_R32G32B32A32_UINT, VK_FORMAT_R32G32B32A32_UINT },
+ },
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -598,7 +610,7 @@ VK_IMPORT_DEVICE
uint32_t numBindings = _vertexInputState.vertexBindingDescriptionCount;
uint32_t numAttribs = _vertexInputState.vertexAttributeDescriptionCount;
- VkVertexInputBindingDescription* inputBinding = const_cast(_vertexInputState.pVertexBindingDescriptions + numBindings);
+ VkVertexInputBindingDescription* inputBinding = const_cast(_vertexInputState.pVertexBindingDescriptions + numBindings);
VkVertexInputAttributeDescription* inputAttrib = const_cast(_vertexInputState.pVertexAttributeDescriptions + numAttribs);
inputBinding->binding = numBindings;
@@ -1834,6 +1846,8 @@ VK_IMPORT_INSTANCE
g_caps.limits.maxTextureSamplers = bx::min(m_deviceProperties.limits.maxPerStageResources, BGFX_CONFIG_MAX_TEXTURE_SAMPLERS);
g_caps.limits.maxComputeBindings = bx::min(m_deviceProperties.limits.maxPerStageResources, BGFX_MAX_COMPUTE_BINDINGS);
g_caps.limits.maxVertexStreams = bx::min(m_deviceProperties.limits.maxVertexInputBindings, BGFX_CONFIG_MAX_VERTEX_STREAMS);
+ g_caps.limits.maxVertexAttributes = m_deviceProperties.limits.maxVertexInputAttributes;
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
{
const VkSampleCountFlags sampleMask = ~0
diff --git a/src/renderer_webgpu.cpp b/src/renderer_webgpu.cpp
index 016ae3ce9..927801af1 100644
--- a/src/renderer_webgpu.cpp
+++ b/src/renderer_webgpu.cpp
@@ -98,6 +98,18 @@ namespace bgfx { namespace wgpu
{ WGPUVertexFormat_Float32x3, WGPUVertexFormat_Float32x3 },
{ WGPUVertexFormat_Float32x4, WGPUVertexFormat_Float32x4 },
},
+ { // Int32 (32-bit integers can't be normalized; both slots are the SINT format)
+ { WGPUVertexFormat_Sint32, WGPUVertexFormat_Sint32 },
+ { WGPUVertexFormat_Sint32x2, WGPUVertexFormat_Sint32x2 },
+ { WGPUVertexFormat_Sint32x3, WGPUVertexFormat_Sint32x3 },
+ { WGPUVertexFormat_Sint32x4, WGPUVertexFormat_Sint32x4 },
+ },
+ { // Uint32
+ { WGPUVertexFormat_Uint32, WGPUVertexFormat_Uint32 },
+ { WGPUVertexFormat_Uint32x2, WGPUVertexFormat_Uint32x2 },
+ { WGPUVertexFormat_Uint32x3, WGPUVertexFormat_Uint32x3 },
+ { WGPUVertexFormat_Uint32x4, WGPUVertexFormat_Uint32x4 },
+ },
};
static_assert(AttribType::Count == BX_COUNTOF(s_attribType) );
@@ -1370,6 +1382,8 @@ WGPU_IMPORT
g_caps.limits.maxComputeBindings = BGFX_CONFIG_MAX_TEXTURE_SAMPLERS;
g_caps.limits.maxFBAttachments = bx::min(m_limits.maxColorAttachments, BGFX_CONFIG_MAX_FRAME_BUFFER_ATTACHMENTS);
g_caps.limits.maxVertexStreams = bx::min(m_limits.maxVertexBuffers, BGFX_CONFIG_MAX_VERTEX_STREAMS);
+ g_caps.limits.maxVertexAttributes = m_limits.maxVertexAttributes;
+ g_caps.limits.maxInstanceData = bx::min(g_caps.limits.maxInstanceData, g_caps.limits.maxVertexAttributes);
g_caps.supported = 0
| BGFX_CAPS_ALPHA_TO_COVERAGE
diff --git a/src/vertexlayout.cpp b/src/vertexlayout.cpp
index 13c8a422e..9fb664868 100644
--- a/src/vertexlayout.cpp
+++ b/src/vertexlayout.cpp
@@ -13,7 +13,7 @@
namespace bgfx
{
- static const uint8_t s_attribTypeSizeD3D1x[AttribType::Count][4] =
+ static const uint8_t s_attribTypeSizeD3D1x[][4] =
{
{ 1, 2, 4, 4 }, // Int8
{ 1, 2, 4, 4 }, // Uint8
@@ -22,9 +22,12 @@ namespace bgfx
{ 2, 4, 8, 8 }, // Uint16
{ 2, 4, 8, 8 }, // Half
{ 4, 8, 12, 16 }, // Float
+ { 4, 8, 12, 16 }, // Int32
+ { 4, 8, 12, 16 }, // Uint32
};
+ static_assert(BX_COUNTOF(s_attribTypeSizeD3D1x) == AttribType::Count);
- static const uint8_t s_attribTypeSizeGl[AttribType::Count][4] =
+ static const uint8_t s_attribTypeSizeGl[][4] =
{
{ 1, 2, 4, 4 }, // Int8
{ 1, 2, 4, 4 }, // Uint8
@@ -33,9 +36,12 @@ namespace bgfx
{ 2, 4, 6, 8 }, // Uint16
{ 2, 4, 6, 8 }, // Half
{ 4, 8, 12, 16 }, // Float
+ { 4, 8, 12, 16 }, // Int32
+ { 4, 8, 12, 16 }, // Uint32
};
+ static_assert(BX_COUNTOF(s_attribTypeSizeGl) == AttribType::Count);
- static const uint8_t (*s_attribTypeSize[])[AttribType::Count][4] =
+ static const uint8_t (*s_attribTypeSize[])[][4] =
{
&s_attribTypeSizeD3D1x, // Noop
&s_attribTypeSizeD3D1x, // Agc
@@ -88,9 +94,9 @@ namespace bgfx
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 encodedType = (_type&7)<<3;
+ const uint16_t encodedType = (_type&0xf)<<3; // 4 bits (up to 16 attrib types)
const uint16_t encodedNum = (_num-1)&3;
- const uint16_t encodeAsInt = (_asInt&(!!"\x1\x1\x1\x1\x1\x0\x0"[_type]) )<<8;
+ const uint16_t encodeAsInt = (_asInt&(!!"\x1\x1\x1\x1\x1\x0\x0\x1\x1"[_type]) )<<8;
m_attributes[_attrib] = encodedNorm|encodedType|encodedNum|encodeAsInt;
m_offset[_attrib] = m_stride;
@@ -110,7 +116,7 @@ namespace bgfx
{
uint16_t val = m_attributes[_attrib];
_num = (val&3)+1;
- _type = AttribType::Enum( (val>>3)&7);
+ _type = AttribType::Enum( (val>>3)&0xf);
_normalized = !!(val&(1<<7) );
_asInt = !!(val&(1<<8) );
}
@@ -124,6 +130,8 @@ namespace bgfx
false, // Uint16
true, // Half
true, // Float
+ false, // Int32
+ false, // Uint32
};
static_assert(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count);
@@ -134,24 +142,32 @@ namespace bgfx
static const char* s_attrName[] =
{
- "P", "Attrib::Position",
- "N", "Attrib::Normal",
- "T", "Attrib::Tangent",
- "B", "Attrib::Bitangent",
- "C0", "Attrib::Color0",
- "C1", "Attrib::Color1",
- "C2", "Attrib::Color2",
- "C3", "Attrib::Color3",
- "I", "Attrib::Indices",
- "W", "Attrib::Weights",
- "T0", "Attrib::TexCoord0",
- "T1", "Attrib::TexCoord1",
- "T2", "Attrib::TexCoord2",
- "T3", "Attrib::TexCoord3",
- "T4", "Attrib::TexCoord4",
- "T5", "Attrib::TexCoord5",
- "T6", "Attrib::TexCoord6",
- "T7", "Attrib::TexCoord7",
+ "P", "Attrib::Position",
+ "N", "Attrib::Normal",
+ "T", "Attrib::Tangent",
+ "B", "Attrib::Bitangent",
+ "C0", "Attrib::Color0",
+ "C1", "Attrib::Color1",
+ "C2", "Attrib::Color2",
+ "C3", "Attrib::Color3",
+ "I", "Attrib::Indices",
+ "W", "Attrib::Weights",
+ "T0", "Attrib::TexCoord0",
+ "T1", "Attrib::TexCoord1",
+ "T2", "Attrib::TexCoord2",
+ "T3", "Attrib::TexCoord3",
+ "T4", "Attrib::TexCoord4",
+ "T5", "Attrib::TexCoord5",
+ "T6", "Attrib::TexCoord6",
+ "T7", "Attrib::TexCoord7",
+ "T8", "Attrib::TexCoord8",
+ "T9", "Attrib::TexCoord9",
+ "T10", "Attrib::TexCoord10",
+ "T11", "Attrib::TexCoord11",
+ "T12", "Attrib::TexCoord12",
+ "T13", "Attrib::TexCoord13",
+ "T14", "Attrib::TexCoord14",
+ "T15", "Attrib::TexCoord15",
};
static_assert(BX_COUNTOF(s_attrName) == Attrib::Count*2);
@@ -176,24 +192,32 @@ namespace bgfx
// NOTICE:
// Attrib must be in order how it appears in Attrib::Enum! id is
// unique and should not be changed if new Attribs are added.
- { Attrib::Position, 0x0001 },
- { Attrib::Normal, 0x0002 },
- { Attrib::Tangent, 0x0003 },
- { Attrib::Bitangent, 0x0004 },
- { Attrib::Color0, 0x0005 },
- { Attrib::Color1, 0x0006 },
- { Attrib::Color2, 0x0018 },
- { Attrib::Color3, 0x0019 },
- { Attrib::Indices, 0x000e },
- { Attrib::Weight, 0x000f },
- { Attrib::TexCoord0, 0x0010 },
- { Attrib::TexCoord1, 0x0011 },
- { Attrib::TexCoord2, 0x0012 },
- { Attrib::TexCoord3, 0x0013 },
- { Attrib::TexCoord4, 0x0014 },
- { Attrib::TexCoord5, 0x0015 },
- { Attrib::TexCoord6, 0x0016 },
- { Attrib::TexCoord7, 0x0017 },
+ { Attrib::Position, 0x0001 },
+ { Attrib::Normal, 0x0002 },
+ { Attrib::Tangent, 0x0003 },
+ { Attrib::Bitangent, 0x0004 },
+ { Attrib::Color0, 0x0005 },
+ { Attrib::Color1, 0x0006 },
+ { Attrib::Color2, 0x0018 },
+ { Attrib::Color3, 0x0019 },
+ { Attrib::Indices, 0x000e },
+ { Attrib::Weight, 0x000f },
+ { Attrib::TexCoord0, 0x0010 },
+ { Attrib::TexCoord1, 0x0011 },
+ { Attrib::TexCoord2, 0x0012 },
+ { Attrib::TexCoord3, 0x0013 },
+ { Attrib::TexCoord4, 0x0014 },
+ { Attrib::TexCoord5, 0x0015 },
+ { Attrib::TexCoord6, 0x0016 },
+ { Attrib::TexCoord7, 0x0017 },
+ { Attrib::TexCoord8, 0x001a },
+ { Attrib::TexCoord9, 0x001b },
+ { Attrib::TexCoord10, 0x001c },
+ { Attrib::TexCoord11, 0x001d },
+ { Attrib::TexCoord12, 0x001e },
+ { Attrib::TexCoord13, 0x001f },
+ { Attrib::TexCoord14, 0x0020 },
+ { Attrib::TexCoord15, 0x0021 },
};
static_assert(BX_COUNTOF(s_attribToId) == Attrib::Count);
@@ -234,6 +258,8 @@ namespace bgfx
{ AttribType::Uint16, 0x0007 },
{ AttribType::Half, 0x0003 },
{ AttribType::Float, 0x0004 },
+ { AttribType::Int32, 0x0008 },
+ { AttribType::Uint32, 0x0009 },
};
static_assert(BX_COUNTOF(s_attribTypeToId) == AttribType::Count);
diff --git a/tools/geometryv/geometryv.cpp b/tools/geometryv/geometryv.cpp
index 7973295b8..18f4c8b71 100644
--- a/tools/geometryv/geometryv.cpp
+++ b/tools/geometryv/geometryv.cpp
@@ -48,24 +48,32 @@ static const bgfx::EmbeddedShader s_embeddedShaders[] =
static const char* s_attribShortNames[] =
{
- "P", // Position
- "N", // Normal
- "T", // Tangent
- "B", // Bitangent
- "C0", // Color0
- "C1", // Color1
- "C2", // Color2
- "C3", // Color3
- "I", // Indices
- "W", // Weight
- "TC0", // TexCoord0
- "TC1", // TexCoord1
- "TC2", // TexCoord2
- "TC3", // TexCoord3
- "TC4", // TexCoord4
- "TC5", // TexCoord5
- "TC6", // TexCoord6
- "TC7", // TexCoord7
+ "P", // Position
+ "N", // Normal
+ "T", // Tangent
+ "B", // Bitangent
+ "C0", // Color0
+ "C1", // Color1
+ "C2", // Color2
+ "C3", // Color3
+ "I", // Indices
+ "W", // Weight
+ "TC0", // TexCoord0
+ "TC1", // TexCoord1
+ "TC2", // TexCoord2
+ "TC3", // TexCoord3
+ "TC4", // TexCoord4
+ "TC5", // TexCoord5
+ "TC6", // TexCoord6
+ "TC7", // TexCoord7
+ "TC8", // TexCoord8
+ "TC9", // TexCoord9
+ "TC10", // TexCoord10
+ "TC11", // TexCoord11
+ "TC12", // TexCoord12
+ "TC13", // TexCoord13
+ "TC14", // TexCoord14
+ "TC15", // TexCoord15
};
static_assert(BX_COUNTOF(s_attribShortNames) == bgfx::Attrib::Count);
diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp
index 2ebb6a18e..e59708d48 100644
--- a/tools/shaderc/shaderc.cpp
+++ b/tools/shaderc/shaderc.cpp
@@ -339,11 +339,30 @@ namespace bgfx
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
"i_data0",
"i_data1",
"i_data2",
"i_data3",
"i_data4",
+ "i_data5",
+ "i_data6",
+ "i_data7",
+ "i_data8",
+ "i_data9",
+ "i_data10",
+ "i_data11",
+ "i_data12",
+ "i_data13",
+ "i_data14",
+ "i_data15",
NULL
};
@@ -1695,9 +1714,8 @@ namespace bgfx
"Invalid vertex shader input attribute '%s'.\n"
"\n"
"Valid input attributes:\n"
- " a_position, a_normal, a_tangent, a_bitangent, a_color0, a_color1, a_color2, a_color3, a_indices, a_weight,\n"
- " a_texcoord0, a_texcoord1, a_texcoord2, a_texcoord3, a_texcoord4, a_texcoord5, a_texcoord6, a_texcoord7,\n"
- " i_data0, i_data1, i_data2, i_data3, i_data4.\n"
+ " a_position, a_normal, a_tangent, a_bitangent, a_color0-3, a_indices, a_weight,\n"
+ " a_texcoord0-15, i_data0-15.\n"
"\n"
, it->c_str() );
break;
diff --git a/tools/shaderc/shaderc_dxil.cpp b/tools/shaderc/shaderc_dxil.cpp
index 1ebe81210..4f46ee61a 100644
--- a/tools/shaderc/shaderc_dxil.cpp
+++ b/tools/shaderc/shaderc_dxil.cpp
@@ -55,26 +55,35 @@ namespace bgfx { namespace dxil
static const RemapInputSemantic s_remapInputSemantic[bgfx::Attrib::Count + 1] =
{
- { bgfx::Attrib::Position, "POSITION", 0 },
- { bgfx::Attrib::Normal, "NORMAL", 0 },
- { bgfx::Attrib::Tangent, "TANGENT", 0 },
- { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
- { bgfx::Attrib::Color0, "COLOR", 0 },
- { bgfx::Attrib::Color1, "COLOR", 1 },
- { bgfx::Attrib::Color2, "COLOR", 2 },
- { bgfx::Attrib::Color3, "COLOR", 3 },
- { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
- { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
- { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
- { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
- { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
- { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
- { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
- { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
- { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
- { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
- { bgfx::Attrib::Count, "", 0 },
+ { bgfx::Attrib::Position, "POSITION", 0 },
+ { bgfx::Attrib::Normal, "NORMAL", 0 },
+ { bgfx::Attrib::Tangent, "TANGENT", 0 },
+ { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
+ { bgfx::Attrib::Color0, "COLOR", 0 },
+ { bgfx::Attrib::Color1, "COLOR", 1 },
+ { bgfx::Attrib::Color2, "COLOR", 2 },
+ { bgfx::Attrib::Color3, "COLOR", 3 },
+ { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
+ { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
+ { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
+ { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
+ { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
+ { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
+ { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
+ { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
+ { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
+ { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
+ { bgfx::Attrib::TexCoord8, "TEXCOORD", 8 },
+ { bgfx::Attrib::TexCoord9, "TEXCOORD", 9 },
+ { bgfx::Attrib::TexCoord10, "TEXCOORD", 10 },
+ { bgfx::Attrib::TexCoord11, "TEXCOORD", 11 },
+ { bgfx::Attrib::TexCoord12, "TEXCOORD", 12 },
+ { bgfx::Attrib::TexCoord13, "TEXCOORD", 13 },
+ { bgfx::Attrib::TexCoord14, "TEXCOORD", 14 },
+ { bgfx::Attrib::TexCoord15, "TEXCOORD", 15 },
+ { bgfx::Attrib::Count, "", 0 },
};
+ static_assert(BX_COUNTOF(s_remapInputSemantic) == bgfx::Attrib::Count + 1);
const RemapInputSemantic& findInputSemantic(const char* _name, uint8_t _index)
{
diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp
index 38f4a9039..588b893c5 100644
--- a/tools/shaderc/shaderc_hlsl.cpp
+++ b/tools/shaderc/shaderc_hlsl.cpp
@@ -212,26 +212,35 @@ namespace bgfx { namespace hlsl
static const RemapInputSemantic s_remapInputSemantic[bgfx::Attrib::Count + 1] =
{
- { bgfx::Attrib::Position, "POSITION", 0 },
- { bgfx::Attrib::Normal, "NORMAL", 0 },
- { bgfx::Attrib::Tangent, "TANGENT", 0 },
- { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
- { bgfx::Attrib::Color0, "COLOR", 0 },
- { bgfx::Attrib::Color1, "COLOR", 1 },
- { bgfx::Attrib::Color2, "COLOR", 2 },
- { bgfx::Attrib::Color3, "COLOR", 3 },
- { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
- { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
- { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
- { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
- { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
- { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
- { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
- { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
- { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
- { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
- { bgfx::Attrib::Count, "", 0 },
+ { bgfx::Attrib::Position, "POSITION", 0 },
+ { bgfx::Attrib::Normal, "NORMAL", 0 },
+ { bgfx::Attrib::Tangent, "TANGENT", 0 },
+ { bgfx::Attrib::Bitangent, "BITANGENT", 0 },
+ { bgfx::Attrib::Color0, "COLOR", 0 },
+ { bgfx::Attrib::Color1, "COLOR", 1 },
+ { bgfx::Attrib::Color2, "COLOR", 2 },
+ { bgfx::Attrib::Color3, "COLOR", 3 },
+ { bgfx::Attrib::Indices, "BLENDINDICES", 0 },
+ { bgfx::Attrib::Weight, "BLENDWEIGHT", 0 },
+ { bgfx::Attrib::TexCoord0, "TEXCOORD", 0 },
+ { bgfx::Attrib::TexCoord1, "TEXCOORD", 1 },
+ { bgfx::Attrib::TexCoord2, "TEXCOORD", 2 },
+ { bgfx::Attrib::TexCoord3, "TEXCOORD", 3 },
+ { bgfx::Attrib::TexCoord4, "TEXCOORD", 4 },
+ { bgfx::Attrib::TexCoord5, "TEXCOORD", 5 },
+ { bgfx::Attrib::TexCoord6, "TEXCOORD", 6 },
+ { bgfx::Attrib::TexCoord7, "TEXCOORD", 7 },
+ { bgfx::Attrib::TexCoord8, "TEXCOORD", 8 },
+ { bgfx::Attrib::TexCoord9, "TEXCOORD", 9 },
+ { bgfx::Attrib::TexCoord10, "TEXCOORD", 10 },
+ { bgfx::Attrib::TexCoord11, "TEXCOORD", 11 },
+ { bgfx::Attrib::TexCoord12, "TEXCOORD", 12 },
+ { bgfx::Attrib::TexCoord13, "TEXCOORD", 13 },
+ { bgfx::Attrib::TexCoord14, "TEXCOORD", 14 },
+ { bgfx::Attrib::TexCoord15, "TEXCOORD", 15 },
+ { bgfx::Attrib::Count, "", 0 },
};
+ static_assert(BX_COUNTOF(s_remapInputSemantic) == bgfx::Attrib::Count + 1);
const RemapInputSemantic& findInputSemantic(const char* _name, uint8_t _index)
{
diff --git a/tools/shaderc/shaderc_metal.cpp b/tools/shaderc/shaderc_metal.cpp
index d3ae4ce19..5eb77f863 100644
--- a/tools/shaderc/shaderc_metal.cpp
+++ b/tools/shaderc/shaderc_metal.cpp
@@ -199,6 +199,14 @@ namespace bgfx { namespace metal
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
};
static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
diff --git a/tools/shaderc/shaderc_spirv.cpp b/tools/shaderc/shaderc_spirv.cpp
index 9b0dbdc6a..53b2fa674 100644
--- a/tools/shaderc/shaderc_spirv.cpp
+++ b/tools/shaderc/shaderc_spirv.cpp
@@ -302,6 +302,14 @@ namespace bgfx { namespace spirv
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
};
static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );
diff --git a/tools/shaderc/shaderc_wgsl.cpp b/tools/shaderc/shaderc_wgsl.cpp
index b80ff9ce1..78f19e00a 100644
--- a/tools/shaderc/shaderc_wgsl.cpp
+++ b/tools/shaderc/shaderc_wgsl.cpp
@@ -292,6 +292,14 @@ namespace bgfx { namespace wgsl
"a_texcoord5",
"a_texcoord6",
"a_texcoord7",
+ "a_texcoord8",
+ "a_texcoord9",
+ "a_texcoord10",
+ "a_texcoord11",
+ "a_texcoord12",
+ "a_texcoord13",
+ "a_texcoord14",
+ "a_texcoord15",
};
static_assert(bgfx::Attrib::Count == BX_COUNTOF(s_attribName) );