Browse Source

[vulkan] Small patch for tesselation vs an already handling with topology patch list.

vkexperiments1
CamilleLaVey 3 months ago
parent
commit
76bb5fc18b
  1. 3
      src/video_core/renderer_vulkan/vk_graphics_pipeline.h
  2. 5
      src/video_core/renderer_vulkan/vk_rasterizer.cpp

3
src/video_core/renderer_vulkan/vk_graphics_pipeline.h

@ -98,6 +98,9 @@ public:
bool UsesExtendedDynamicState2LogicOp() const noexcept { bool UsesExtendedDynamicState2LogicOp() const noexcept {
return key.state.extended_dynamic_state_2_logic_op != 0; return key.state.extended_dynamic_state_2_logic_op != 0;
} }
bool HasTessellationStages() const noexcept {
return static_cast<bool>(spv_modules[1]) || static_cast<bool>(spv_modules[2]);
}
GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete; GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete;
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete; GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;

5
src/video_core/renderer_vulkan/vk_rasterizer.cpp

@ -1991,11 +1991,14 @@ void RasterizerVulkan::UpdateDepthCompareOp(Tegra::Engines::Maxwell3D::Regs& reg
} }
void RasterizerVulkan::UpdatePrimitiveTopology([[maybe_unused]] Tegra::Engines::Maxwell3D::Regs& regs) { void RasterizerVulkan::UpdatePrimitiveTopology([[maybe_unused]] Tegra::Engines::Maxwell3D::Regs& regs) {
GraphicsPipeline* pipeline = pipeline_cache.CurrentGraphicsPipeline();
const auto topology = maxwell3d->draw_manager->GetDrawState().topology; const auto topology = maxwell3d->draw_manager->GetDrawState().topology;
if (!state_tracker.ChangePrimitiveTopology(topology)) { if (!state_tracker.ChangePrimitiveTopology(topology)) {
return; return;
} }
const auto vk_topology = MaxwellToVK::PrimitiveTopology(device, topology);
const auto vk_topology = pipeline && pipeline->HasTessellationStages()
? VK_PRIMITIVE_TOPOLOGY_PATCH_LIST
: MaxwellToVK::PrimitiveTopology(device, topology);
scheduler.Record([vk_topology](vk::CommandBuffer cmdbuf) { scheduler.Record([vk_topology](vk::CommandBuffer cmdbuf) {
cmdbuf.SetPrimitiveTopologyEXT(vk_topology); cmdbuf.SetPrimitiveTopologyEXT(vk_topology);
}); });

Loading…
Cancel
Save