1
0
mirror of https://github.com/doitsujin/dxvk.git synced 2025-04-01 09:25:24 +02:00

[dxvk] Fix line rendering check

This commit is contained in:
Philip Rebohle 2025-03-15 01:09:14 +01:00
parent 0dec617c4e
commit 3ef81f4ee4

View File

@ -57,6 +57,16 @@ namespace dxvk {
} }
VkPrimitiveTopology determinePipelineTopology(
const DxvkGraphicsPipelineShaders& shaders,
const DxvkGraphicsPipelineStateInfo& state) {
if (shaders.gs)
return shaders.gs->info().outputTopology;
return determinePreGsTopology(shaders, state);
}
DxvkGraphicsPipelineVertexInputState::DxvkGraphicsPipelineVertexInputState() { DxvkGraphicsPipelineVertexInputState::DxvkGraphicsPipelineVertexInputState() {
} }
@ -646,22 +656,17 @@ namespace dxvk {
bool DxvkGraphicsPipelinePreRasterizationState::isLineRendering( bool DxvkGraphicsPipelinePreRasterizationState::isLineRendering(
const DxvkGraphicsPipelineShaders& shaders, const DxvkGraphicsPipelineShaders& shaders,
const DxvkGraphicsPipelineStateInfo& state) { const DxvkGraphicsPipelineStateInfo& state) {
bool isLineRendering = state.rs.polygonMode() == VK_POLYGON_MODE_LINE; VkPrimitiveTopology topology = determinePipelineTopology(shaders, state);
if (shaders.gs) { if (state.rs.polygonMode() == VK_POLYGON_MODE_LINE) {
isLineRendering |= shaders.gs->info().outputTopology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST; return topology != VK_PRIMITIVE_TOPOLOGY_POINT_LIST
} else if (shaders.tes) { && topology != VK_PRIMITIVE_TOPOLOGY_PATCH_LIST;
isLineRendering |= shaders.tes->info().outputTopology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST;
} else {
VkPrimitiveTopology topology = state.ia.primitiveTopology();
isLineRendering |= topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY;
} }
return isLineRendering; return topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_LIST_WITH_ADJACENCY
|| topology == VK_PRIMITIVE_TOPOLOGY_LINE_STRIP_WITH_ADJACENCY;
} }