Added color2/3 attributes.
This commit is contained in:
parent
e19a6738c7
commit
24569934a1
@ -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
|
||||
|
@ -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,
|
||||
|
@ -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.
|
||||
|
@ -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);
|
||||
}
|
||||
|
@ -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 },
|
||||
|
@ -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 },
|
||||
|
@ -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 },
|
||||
|
@ -63,6 +63,8 @@ namespace bgfx { namespace gl
|
||||
"a_bitangent",
|
||||
"a_color0",
|
||||
"a_color1",
|
||||
"a_color2",
|
||||
"a_color3",
|
||||
"a_indices",
|
||||
"a_weight",
|
||||
"a_texcoord0",
|
||||
|
@ -104,6 +104,8 @@ namespace bgfx { namespace mtl
|
||||
"a_bitangent",
|
||||
"a_color0",
|
||||
"a_color1",
|
||||
"a_color2",
|
||||
"a_color3",
|
||||
"a_indices",
|
||||
"a_weight",
|
||||
"a_texcoord0",
|
||||
|
@ -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 },
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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 },
|
||||
|
Loading…
Reference in New Issue
Block a user