mirror of
https://github.com/skyline-emu/skyline.git
synced 2024-11-23 05:59:17 +01:00
Set Shader Runtime Generic Vertex Attribute Types Correctly
The vertex attribute types supplied prior were just the default which is `Float`, this works for some cases but will entirely break if the attribute type isn't a float. The attribute types are now set correctly.
This commit is contained in:
parent
a2de6b9255
commit
550d12b7fa
@ -1188,6 +1188,26 @@ namespace skyline::gpu::interconnect {
|
|||||||
vertexAttribute.description.binding = attribute.bufferId;
|
vertexAttribute.description.binding = attribute.bufferId;
|
||||||
vertexAttribute.description.format = ConvertVertexBufferFormat(attribute.type, attribute.elementSize);
|
vertexAttribute.description.format = ConvertVertexBufferFormat(attribute.type, attribute.elementSize);
|
||||||
vertexAttribute.description.offset = attribute.offset;
|
vertexAttribute.description.offset = attribute.offset;
|
||||||
|
|
||||||
|
runtimeInfo.generic_input_types[index] = [type = attribute.type]() {
|
||||||
|
using MaxwellType = maxwell3d::VertexAttribute::ElementType;
|
||||||
|
using ShaderType = ShaderCompiler::AttributeType;
|
||||||
|
|
||||||
|
switch (type) {
|
||||||
|
case MaxwellType::None:
|
||||||
|
return ShaderType::Disabled;
|
||||||
|
case MaxwellType::Snorm:
|
||||||
|
case MaxwellType::Unorm:
|
||||||
|
case MaxwellType::Uscaled:
|
||||||
|
case MaxwellType::Sscaled:
|
||||||
|
case MaxwellType::Float:
|
||||||
|
return ShaderType::Float;
|
||||||
|
case MaxwellType::Sint:
|
||||||
|
return ShaderType::SignedInt;
|
||||||
|
case MaxwellType::Uint:
|
||||||
|
return ShaderType::UnsignedInt;
|
||||||
|
};
|
||||||
|
}();
|
||||||
} else {
|
} else {
|
||||||
vertexAttribute.enabled = false;
|
vertexAttribute.enabled = false;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user