maxwell_to_vk: Implement more primitive topologies
Add an extra argument to query device capabilities in the future. The intention behind this is to use native quads, quad strips, line loops and polygons if these are released for Vulkan.
This commit is contained in:
parent
15513f0801
commit
8db8631d81
2 changed files with 11 additions and 2 deletions
|
@ -221,7 +221,8 @@ vk::ShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage) {
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
|
|
||||||
vk::PrimitiveTopology PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
|
vk::PrimitiveTopology PrimitiveTopology([[maybe_unused]] const VKDevice& device,
|
||||||
|
Maxwell::PrimitiveTopology topology) {
|
||||||
switch (topology) {
|
switch (topology) {
|
||||||
case Maxwell::PrimitiveTopology::Points:
|
case Maxwell::PrimitiveTopology::Points:
|
||||||
return vk::PrimitiveTopology::ePointList;
|
return vk::PrimitiveTopology::ePointList;
|
||||||
|
@ -233,6 +234,13 @@ vk::PrimitiveTopology PrimitiveTopology(Maxwell::PrimitiveTopology topology) {
|
||||||
return vk::PrimitiveTopology::eTriangleList;
|
return vk::PrimitiveTopology::eTriangleList;
|
||||||
case Maxwell::PrimitiveTopology::TriangleStrip:
|
case Maxwell::PrimitiveTopology::TriangleStrip:
|
||||||
return vk::PrimitiveTopology::eTriangleStrip;
|
return vk::PrimitiveTopology::eTriangleStrip;
|
||||||
|
case Maxwell::PrimitiveTopology::TriangleFan:
|
||||||
|
return vk::PrimitiveTopology::eTriangleFan;
|
||||||
|
case Maxwell::PrimitiveTopology::Quads:
|
||||||
|
// TODO(Rodrigo): Use VK_PRIMITIVE_TOPOLOGY_QUAD_LIST_EXT whenever it releases
|
||||||
|
return vk::PrimitiveTopology::eTriangleList;
|
||||||
|
case Maxwell::PrimitiveTopology::Patches:
|
||||||
|
return vk::PrimitiveTopology::ePatchList;
|
||||||
default:
|
default:
|
||||||
UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
|
UNIMPLEMENTED_MSG("Unimplemented topology={}", static_cast<u32>(topology));
|
||||||
return {};
|
return {};
|
||||||
|
|
|
@ -35,7 +35,8 @@ std::pair<vk::Format, bool> SurfaceFormat(const VKDevice& device, FormatType for
|
||||||
|
|
||||||
vk::ShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage);
|
vk::ShaderStageFlagBits ShaderStage(Tegra::Engines::ShaderType stage);
|
||||||
|
|
||||||
vk::PrimitiveTopology PrimitiveTopology(Maxwell::PrimitiveTopology topology);
|
vk::PrimitiveTopology PrimitiveTopology(const VKDevice& device,
|
||||||
|
Maxwell::PrimitiveTopology topology);
|
||||||
|
|
||||||
vk::Format VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size);
|
vk::Format VertexFormat(Maxwell::VertexAttribute::Type type, Maxwell::VertexAttribute::Size size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue