mirror of
https://github.com/love2d/love.git
synced 2026-08-16 00:02:12 +02:00
use location numbers for vertex input attributes, instead of name-based binding.
- add 'location' named field to buffer and mesh vertex format tables, replaces 'name' field. - location numbers are expected to match 'layout (location = #)' qualifiers in vertex inputs in shader code. - deprecate vertex inputs in shader code that don't have layout location qualifiers. - love's default vertex attributes use location 0 for position, 1 for texcoord, and 2 for color. - add new variants of Mesh:attachAttribute, setAttributeEnabled, and isAttributeEnabled which take location numbers instead of names. Improves draw performance in vulkan and metal backends.
This commit is contained in:
@@ -92,6 +92,8 @@ Font::Font(love::font::Rasterizer *r, const SamplerState &s)
|
||||
if (pixelFormat == PIXELFORMAT_LA8_UNORM && !gfx->isPixelFormatSupported(pixelFormat, PIXELFORMATUSAGEFLAGS_SAMPLE))
|
||||
pixelFormat = PIXELFORMAT_RGBA8_UNORM;
|
||||
|
||||
vertexAttributesID = gfx->registerVertexAttributes(VertexAttributes(vertexFormat, 0));
|
||||
|
||||
loadVolatile();
|
||||
++fontCount;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user