diff --git a/include/bgfx/bgfx.h b/include/bgfx/bgfx.h index 5c58e27a7..97eadcec2 100644 --- a/include/bgfx/bgfx.h +++ b/include/bgfx/bgfx.h @@ -97,6 +97,8 @@ namespace bgfx Bitangent, //!< a_bitangent Color0, //!< a_color0 Color1, //!< a_color1 + Color2, //!< a_color2 + Color3, //!< a_color3 Indices, //!< a_indices Weight, //!< a_weight TexCoord0, //!< a_texcoord0 diff --git a/include/bgfx/c99/bgfx.h b/include/bgfx/c99/bgfx.h index d2d127b0c..ec0452bd7 100644 --- a/include/bgfx/c99/bgfx.h +++ b/include/bgfx/c99/bgfx.h @@ -75,6 +75,8 @@ typedef enum bgfx_attrib BGFX_ATTRIB_BITANGENT, BGFX_ATTRIB_COLOR0, BGFX_ATTRIB_COLOR1, + BGFX_ATTRIB_COLOR2, + BGFX_ATTRIB_COLOR3, BGFX_ATTRIB_INDICES, BGFX_ATTRIB_WEIGHT, BGFX_ATTRIB_TEXCOORD0, diff --git a/include/bgfx/defines.h b/include/bgfx/defines.h index fb1f80855..f05617828 100644 --- a/include/bgfx/defines.h +++ b/include/bgfx/defines.h @@ -6,7 +6,7 @@ #ifndef BGFX_DEFINES_H_HEADER_GUARD #define BGFX_DEFINES_H_HEADER_GUARD -#define BGFX_API_VERSION UINT32_C(41) +#define BGFX_API_VERSION UINT32_C(42) /// #define BGFX_STATE_RGB_WRITE UINT64_C(0x0000000000000001) //!< Enable RGB write. diff --git a/src/bgfx_p.h b/src/bgfx_p.h index 00ea4656b..e8086e15f 100644 --- a/src/bgfx_p.h +++ b/src/bgfx_p.h @@ -2765,7 +2765,7 @@ namespace bgfx DynamicVertexBuffer& dvb = m_dynamicVertexBuffers[_handle.idx]; - if (0 != (dvb.m_flags & BGFX_BUFFER_COMPUTE_WRITE) ) + if (0 != (dvb.m_flags & BGFX_BUFFER_COMPUTE_READ_WRITE) ) { destroyVertexBuffer(dvb.m_handle); } diff --git a/src/renderer_d3d11.cpp b/src/renderer_d3d11.cpp index a3569b62d..199621548 100644 --- a/src/renderer_d3d11.cpp +++ b/src/renderer_d3d11.cpp @@ -308,6 +308,8 @@ namespace bgfx { namespace d3d11 { "BITANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "COLOR", 1, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "COLOR", 2, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, + { "COLOR", 3, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "BLENDINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "BLENDWEIGHT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D11_APPEND_ALIGNED_ELEMENT, D3D11_INPUT_PER_VERTEX_DATA, 0 }, diff --git a/src/renderer_d3d12.cpp b/src/renderer_d3d12.cpp index d7d9a199d..2bbc33b5d 100644 --- a/src/renderer_d3d12.cpp +++ b/src/renderer_d3d12.cpp @@ -260,6 +260,8 @@ namespace bgfx { namespace d3d12 { "BITANGENT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "COLOR", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "COLOR", 1, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, + { "COLOR", 2, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, + { "COLOR", 3, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "BLENDINDICES", 0, DXGI_FORMAT_R8G8B8A8_UINT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "BLENDWEIGHT", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, D3D12_APPEND_ALIGNED_ELEMENT, D3D12_INPUT_CLASSIFICATION_PER_VERTEX_DATA, 0 }, diff --git a/src/renderer_d3d9.cpp b/src/renderer_d3d9.cpp index d77e73613..165a09eb0 100644 --- a/src/renderer_d3d9.cpp +++ b/src/renderer_d3d9.cpp @@ -284,6 +284,8 @@ namespace bgfx { namespace d3d9 { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BINORMAL, 0 }, { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 0 }, { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 1 }, + { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 2 }, + { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_COLOR, 3 }, { 0, 0, D3DDECLTYPE_UBYTE4, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDINDICES, 0 }, { 0, 0, D3DDECLTYPE_FLOAT3, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_BLENDWEIGHT, 0 }, { 0, 0, D3DDECLTYPE_FLOAT2, D3DDECLMETHOD_DEFAULT, D3DDECLUSAGE_TEXCOORD, 0 }, diff --git a/src/renderer_gl.cpp b/src/renderer_gl.cpp index e74181095..a56a06436 100644 --- a/src/renderer_gl.cpp +++ b/src/renderer_gl.cpp @@ -63,6 +63,8 @@ namespace bgfx { namespace gl "a_bitangent", "a_color0", "a_color1", + "a_color2", + "a_color3", "a_indices", "a_weight", "a_texcoord0", diff --git a/src/renderer_mtl.mm b/src/renderer_mtl.mm index 1dc2e57f1..3e4a0f21e 100644 --- a/src/renderer_mtl.mm +++ b/src/renderer_mtl.mm @@ -104,6 +104,8 @@ namespace bgfx { namespace mtl "a_bitangent", "a_color0", "a_color1", + "a_color2", + "a_color3", "a_indices", "a_weight", "a_texcoord0", diff --git a/src/vertexdecl.cpp b/src/vertexdecl.cpp index a2d88a4ff..a8d8ae420 100644 --- a/src/vertexdecl.cpp +++ b/src/vertexdecl.cpp @@ -127,6 +127,8 @@ namespace bgfx "Attrib::Bitangent", "Attrib::Color0", "Attrib::Color1", + "Attrib::Color2", + "Attrib::Color3", "Attrib::Indices", "Attrib::Weights", "Attrib::TexCoord0", @@ -196,6 +198,8 @@ namespace bgfx { Attrib::Bitangent, 0x0004 }, { Attrib::Color0, 0x0005 }, { Attrib::Color1, 0x0006 }, + { Attrib::Color2, 0x0018 }, + { Attrib::Color3, 0x0019 }, { Attrib::Indices, 0x000e }, { Attrib::Weight, 0x000f }, { Attrib::TexCoord0, 0x0010 }, diff --git a/tools/shaderc/shaderc.cpp b/tools/shaderc/shaderc.cpp index cf9ff58b0..a275ff5fa 100644 --- a/tools/shaderc/shaderc.cpp +++ b/tools/shaderc/shaderc.cpp @@ -17,7 +17,7 @@ extern "C" #define BGFX_CHUNK_MAGIC_VSH BX_MAKEFOURCC('V', 'S', 'H', 0x4) #define BGFX_SHADERC_VERSION_MAJOR 1 -#define BGFX_SHADERC_VERSION_MINOR 2 +#define BGFX_SHADERC_VERSION_MINOR 3 namespace bgfx { @@ -2116,6 +2116,10 @@ namespace bgfx ); } } + else + { + bx::stringPrintf(code, "#version %d\n", glsl); + } code += preprocessor.m_preprocessed; diff --git a/tools/shaderc/shaderc_hlsl.cpp b/tools/shaderc/shaderc_hlsl.cpp index c9f7d13e5..e9866219d 100644 --- a/tools/shaderc/shaderc_hlsl.cpp +++ b/tools/shaderc/shaderc_hlsl.cpp @@ -172,6 +172,8 @@ namespace bgfx { namespace hlsl { 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 },