Browse Source

Fix conflicts

pull/294/head
MaranBr 3 months ago
parent
commit
6bdb121625
  1. 3
      src/video_core/renderer_vulkan/vk_graphics_pipeline.h
  2. 57
      src/video_core/renderer_vulkan/vk_rasterizer.cpp

3
src/video_core/renderer_vulkan/vk_graphics_pipeline.h

@ -80,8 +80,7 @@ public:
PipelineStatistics* pipeline_statistics, RenderPassCache& render_pass_cache,
const GraphicsPipelineCacheKey& key, std::array<vk::ShaderModule, NUM_STAGES> stages,
const std::array<const Shader::Info*, NUM_STAGES>& infos);
// True if this pipeline was created with VK_DYNAMIC_STATE_VERTEX_INPUT_EXT
bool HasDynamicVertexInput() const noexcept { return key.state.dynamic_vertex_input; }
GraphicsPipeline& operator=(GraphicsPipeline&&) noexcept = delete;
GraphicsPipeline(GraphicsPipeline&&) noexcept = delete;

57
src/video_core/renderer_vulkan/vk_rasterizer.cpp

@ -984,11 +984,11 @@ void RasterizerVulkan::UpdateDynamicStates() {
auto has_float = std::any_of(regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(), In(Maxwell3D::Regs::VertexAttribute::Type::Float));
if (regs.logic_op.enable) {
regs.logic_op.enable = static_cast<u32>(!has_float);
}
}
UpdateLogicOpEnable(regs);
} else {
UpdateLogicOpEnable(regs);
}
}
UpdateDepthClampEnable(regs);
UpdateLineStippleEnable(regs);
UpdateConservativeRasterizationMode(regs);
@ -1002,9 +1002,7 @@ void RasterizerVulkan::UpdateDynamicStates() {
}
}
if (device.IsExtVertexInputDynamicStateSupported() && dynamic_state > 2) {
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) {
UpdateVertexInput(regs);
}
UpdateVertexInput(regs);
}
}
@ -1031,18 +1029,16 @@ void RasterizerVulkan::UpdateViewportsState(Tegra::Engines::Maxwell3D::Regs& reg
return;
}
if (!regs.viewport_scale_offset_enabled) {
float x = static_cast<float>(regs.surface_clip.x);
float y = static_cast<float>(regs.surface_clip.y);
float width = static_cast<float>(regs.surface_clip.width);
float height = static_cast<float>(regs.surface_clip.height);
const bool lower_left =
regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
if (lower_left) {
// Vulkan viewport space is top-left; emulate lower-left with negative height.
y += height;
height = -height;
}
float x = static_cast<float>(regs.surface_clip.x);
float y = static_cast<float>(regs.surface_clip.y);
float width = static_cast<float>(regs.surface_clip.width);
float height = static_cast<float>(regs.surface_clip.height);
const bool lower_left = regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft;
if (lower_left) {
// Vulkan viewport space is top-left; emulate lower-left with negative height.
y += height;
height = -height;
}
VkViewport viewport{
.x = x,
.y = y,
@ -1078,20 +1074,19 @@ void RasterizerVulkan::UpdateScissorsState(Tegra::Engines::Maxwell3D::Regs& regs
return;
}
if (!regs.viewport_scale_offset_enabled) {
u32 x = regs.surface_clip.x;
u32 y = regs.surface_clip.y;
u32 width = regs.surface_clip.width ? regs.surface_clip.width : 1u;
u32 height = regs.surface_clip.height ? regs.surface_clip.height : 1u;
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) {
// Vulkan scissor is top-left; convert from lower-left coordinates.
y = regs.surface_clip.height - (y + height);
}
VkRect2D scissor{};
scissor.offset.x = static_cast<int32_t>(x);
scissor.offset.y = static_cast<int32_t>(y);
scissor.extent.width = width;
scissor.extent.height = height;
u32 x = regs.surface_clip.x;
u32 y = regs.surface_clip.y;
u32 width = regs.surface_clip.width ? regs.surface_clip.width : 1u;
u32 height = regs.surface_clip.height ? regs.surface_clip.height : 1u;
if (regs.window_origin.mode != Maxwell::WindowOrigin::Mode::UpperLeft) {
// Vulkan scissor is top-left; convert from lower-left coordinates.
y = regs.surface_clip.height - (y + height);
}
VkRect2D scissor{};
scissor.offset.x = static_cast<int32_t>(x);
scissor.offset.y = static_cast<int32_t>(y);
scissor.extent.width = width;
scissor.extent.height = height;
scheduler.Record([scissor](vk::CommandBuffer cmdbuf) { cmdbuf.SetScissor(0, scissor); });
return;
}

Loading…
Cancel
Save