mirror of
https://git.eden-emu.dev/eden-emu/eden
synced 2026-11-26 18:40:35 +01:00
Compare commits
3 commits
a8f4fe55cb
...
fcfcee7247
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
fcfcee7247 | ||
|
|
0b3fdb5797 | ||
|
|
d6e2fd0b4b |
12 changed files with 97 additions and 207 deletions
|
|
@ -806,58 +806,6 @@ void BufferCache<P>::UpdateVertexBufferSlot(u32 index, const Binding& binding) {
|
|||
template <class P>
|
||||
void BufferCache<P>::BindHostVertexBuffers() {
|
||||
|
||||
bool needs_vertex_input_refresh = false;
|
||||
bool use_vertex_input_dynamic_state = false;
|
||||
bool use_dynamic_stride = false;
|
||||
u32 max_dynamic_stride = 0;
|
||||
std::array<u32, NUM_VERTEX_BUFFERS> min_dynamic_stride{};
|
||||
if constexpr (!IS_OPENGL) {
|
||||
use_vertex_input_dynamic_state = runtime.UsesVertexInputDynamicState();
|
||||
if (use_vertex_input_dynamic_state) {
|
||||
for (u32 index = 0; index < NUM_VERTEX_BUFFERS; ++index) {
|
||||
if (maxwell3d->dirty.flags[Dirty::VertexBuffer0 + index]) {
|
||||
needs_vertex_input_refresh = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
use_dynamic_stride = runtime.UsesDynamicVertexBindingStride();
|
||||
if (use_dynamic_stride) {
|
||||
max_dynamic_stride = runtime.GetMaxVertexInputBindingStride();
|
||||
for (const auto& attribute : maxwell3d->regs.vertex_attrib_format) {
|
||||
if (attribute.constant != 0) {
|
||||
continue;
|
||||
}
|
||||
const u32 binding = attribute.buffer;
|
||||
if (binding >= NUM_VERTEX_BUFFERS) {
|
||||
continue;
|
||||
}
|
||||
const u32 extent = attribute.offset + attribute.SizeInBytes();
|
||||
min_dynamic_stride[binding] = (std::max)(min_dynamic_stride[binding], extent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
const auto sanitize_stride = [&](u32 binding, u32 stride) -> u32 {
|
||||
if constexpr (IS_OPENGL) {
|
||||
return stride;
|
||||
} else {
|
||||
if (!use_dynamic_stride || stride == 0) {
|
||||
return stride;
|
||||
}
|
||||
const u32 min_stride = min_dynamic_stride[binding];
|
||||
const u32 required_stride = (std::max)(stride, min_stride);
|
||||
if (required_stride <= max_dynamic_stride) {
|
||||
return required_stride;
|
||||
}
|
||||
if (min_stride > max_dynamic_stride) {
|
||||
return 0;
|
||||
}
|
||||
return max_dynamic_stride;
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef ANDROID
|
||||
const bool use_optimized_vertex_buffers = Settings::values.use_optimized_vertex_buffers.GetValue();
|
||||
#else
|
||||
|
|
@ -890,8 +838,7 @@ void BufferCache<P>::BindHostVertexBuffers() {
|
|||
continue;
|
||||
}
|
||||
flags[Dirty::VertexBuffer0 + index] = false;
|
||||
const u32 stride =
|
||||
sanitize_stride(index, maxwell3d->regs.vertex_streams[index].stride);
|
||||
const u32 stride = maxwell3d->regs.vertex_streams[index].stride;
|
||||
const u32 offset = buffer.Offset(binding.device_addr);
|
||||
buffer.MarkUsage(offset, binding.size);
|
||||
if (!bindings.buffers.empty() && index != last_index + 1) {
|
||||
|
|
@ -934,8 +881,7 @@ void BufferCache<P>::BindHostVertexBuffers() {
|
|||
const Binding& binding = channel_state->vertex_buffers[index];
|
||||
Buffer& buffer = slot_buffers[binding.buffer_id];
|
||||
|
||||
const u32 stride =
|
||||
sanitize_stride(index, maxwell3d->regs.vertex_streams[index].stride);
|
||||
const u32 stride = maxwell3d->regs.vertex_streams[index].stride;
|
||||
const u32 offset = buffer.Offset(binding.device_addr);
|
||||
buffer.MarkUsage(offset, binding.size);
|
||||
|
||||
|
|
@ -947,12 +893,6 @@ void BufferCache<P>::BindHostVertexBuffers() {
|
|||
runtime.BindVertexBuffers(host_bindings);
|
||||
}
|
||||
}
|
||||
|
||||
if constexpr (!IS_OPENGL) {
|
||||
if (needs_vertex_input_refresh) {
|
||||
runtime.NotifyVertexInputBindingChange();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
template <class P>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
|
|
@ -92,7 +92,16 @@ void ThreadManager::InvalidateRegion(DAddr addr, u64 size) {
|
|||
}
|
||||
|
||||
void ThreadManager::FlushAndInvalidateRegion(DAddr addr, u64 size) {
|
||||
// Skip flush on asynch mode, as FlushAndInvalidateRegion is not used for anything too important
|
||||
if (Settings::IsGPULevelHigh()) {
|
||||
if (!is_async) {
|
||||
PushCommand(FlushRegionCommand(addr, size));
|
||||
} else {
|
||||
auto& gpu = system.GPU();
|
||||
const u64 fence = gpu.RequestFlush(addr, size);
|
||||
TickGPU();
|
||||
gpu.WaitForSyncOperation(fence);
|
||||
}
|
||||
}
|
||||
rasterizer->OnCacheInvalidation(addr, size);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -629,6 +629,9 @@ void RasterizerOpenGL::ReleaseFences(bool force) {
|
|||
|
||||
void RasterizerOpenGL::FlushAndInvalidateRegion(DAddr addr, u64 size,
|
||||
VideoCommon::CacheType which) {
|
||||
if (Settings::IsGPULevelHigh()) {
|
||||
FlushRegion(addr, size, which);
|
||||
}
|
||||
InvalidateRegion(addr, size, which);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -10,7 +10,6 @@
|
|||
#include <span>
|
||||
#include <vector>
|
||||
|
||||
#include "common/settings.h"
|
||||
#include "video_core/buffer_cache/buffer_cache_base.h"
|
||||
#include "video_core/renderer_vulkan/vk_buffer_cache.h"
|
||||
|
||||
|
|
@ -335,9 +334,6 @@ BufferCacheRuntime::BufferCacheRuntime(const Device& device_, MemoryAllocator& m
|
|||
staging_pool{staging_pool_}, guest_descriptor_queue{guest_descriptor_queue_},
|
||||
quad_index_pass(device, scheduler, descriptor_pool, staging_pool,
|
||||
compute_pass_descriptor_queue) {
|
||||
use_vertex_input_dynamic_state = device.IsExtVertexInputDynamicStateSupported() &&
|
||||
Settings::values.vertex_input_dynamic_state.GetValue();
|
||||
|
||||
const VkDriverIdKHR driver_id = device.GetDriverID();
|
||||
limit_dynamic_storage_buffers = driver_id == VK_DRIVER_ID_QUALCOMM_PROPRIETARY ||
|
||||
driver_id == VK_DRIVER_ID_ARM_PROPRIETARY;
|
||||
|
|
@ -560,10 +556,7 @@ void BufferCacheRuntime::BindVertexBuffer(u32 index, VkBuffer buffer, u32 offset
|
|||
if (index >= device.GetMaxVertexInputBindings()) {
|
||||
return;
|
||||
}
|
||||
const bool use_bind_vertex_buffers2_stride =
|
||||
device.IsExtExtendedDynamicStateSupported() && !use_vertex_input_dynamic_state;
|
||||
|
||||
if (use_bind_vertex_buffers2_stride) {
|
||||
if (device.IsExtExtendedDynamicStateSupported()) {
|
||||
scheduler.Record([index, buffer, offset, size, stride](vk::CommandBuffer cmdbuf) {
|
||||
const VkDeviceSize vk_offset = buffer != VK_NULL_HANDLE ? offset : 0;
|
||||
const VkDeviceSize vk_size = buffer != VK_NULL_HANDLE ? size : VK_WHOLE_SIZE;
|
||||
|
|
@ -603,10 +596,7 @@ void BufferCacheRuntime::BindVertexBuffers(VideoCommon::HostBindings<Buffer>& bi
|
|||
if (binding_count == 0) {
|
||||
return;
|
||||
}
|
||||
const bool use_bind_vertex_buffers2_stride =
|
||||
device.IsExtExtendedDynamicStateSupported() && !use_vertex_input_dynamic_state;
|
||||
|
||||
if (use_bind_vertex_buffers2_stride) {
|
||||
if (device.IsExtExtendedDynamicStateSupported()) {
|
||||
scheduler.Record([bindings_ = std::move(bindings), buffer_handles_ = std::move(buffer_handles), binding_count](vk::CommandBuffer cmdbuf) {
|
||||
cmdbuf.BindVertexBuffers2EXT(bindings_.min_index, binding_count, buffer_handles_.data(), bindings_.offsets.data(), bindings_.sizes.data(), bindings_.strides.data());
|
||||
});
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2019 yuzu Emulator Project
|
||||
|
|
@ -161,28 +161,6 @@ public:
|
|||
return max_dynamic_storage_buffers;
|
||||
}
|
||||
|
||||
bool UsesDynamicVertexBindingStride() const {
|
||||
return device.IsExtExtendedDynamicStateSupported() && !use_vertex_input_dynamic_state;
|
||||
}
|
||||
|
||||
bool UsesVertexInputDynamicState() const {
|
||||
return use_vertex_input_dynamic_state;
|
||||
}
|
||||
|
||||
void NotifyVertexInputBindingChange() {
|
||||
needs_vertex_input_refresh = true;
|
||||
}
|
||||
|
||||
bool ConsumeVertexInputBindingChange() {
|
||||
const bool refresh = needs_vertex_input_refresh;
|
||||
needs_vertex_input_refresh = false;
|
||||
return refresh;
|
||||
}
|
||||
|
||||
u32 GetMaxVertexInputBindingStride() const {
|
||||
return device.GetMaxVertexInputBindingStride();
|
||||
}
|
||||
|
||||
private:
|
||||
void BindBuffer(VkBuffer buffer, u32 offset, u32 size) {
|
||||
guest_descriptor_queue.AddBuffer(buffer, offset, size);
|
||||
|
|
@ -205,8 +183,6 @@ private:
|
|||
std::unique_ptr<Uint8Pass> uint8_pass;
|
||||
QuadIndexedPass quad_index_pass;
|
||||
|
||||
bool use_vertex_input_dynamic_state = false;
|
||||
bool needs_vertex_input_refresh = false;
|
||||
bool limit_dynamic_storage_buffers = false;
|
||||
u32 max_dynamic_storage_buffers = (std::numeric_limits<u32>::max)();
|
||||
};
|
||||
|
|
|
|||
|
|
@ -82,9 +82,6 @@ public:
|
|||
const std::array<const Shader::Info*, NUM_STAGES>& infos);
|
||||
|
||||
bool HasDynamicVertexInput() const noexcept { return key.state.dynamic_vertex_input; }
|
||||
bool UsesVertexAttribute(size_t index) const noexcept {
|
||||
return index < Maxwell::NumVertexAttributes && stage_infos[0].loads.Generic(index);
|
||||
}
|
||||
bool SupportsAlphaToCoverage() const noexcept {
|
||||
return fragment_has_color0_output;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -766,6 +766,9 @@ void RasterizerVulkan::ReleaseFences(bool force) {
|
|||
|
||||
void RasterizerVulkan::FlushAndInvalidateRegion(DAddr addr, u64 size,
|
||||
VideoCommon::CacheType which) {
|
||||
if (Settings::IsGPULevelHigh()) {
|
||||
FlushRegion(addr, size, which);
|
||||
}
|
||||
InvalidateRegion(addr, size, which);
|
||||
}
|
||||
|
||||
|
|
@ -1014,6 +1017,20 @@ void RasterizerVulkan::UpdateDynamicStates() {
|
|||
|
||||
// EDS3 Enables: LogicOpEnable, DepthClamp, LineStipple, ConservativeRaster
|
||||
if (device.IsExtExtendedDynamicState3EnablesSupported()) {
|
||||
using namespace Tegra::Engines;
|
||||
// AMD Workaround: LogicOp incompatible with float render targets
|
||||
if (device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_OPEN_SOURCE ||
|
||||
device.GetDriverID() == VkDriverIdKHR::VK_DRIVER_ID_AMD_PROPRIETARY) {
|
||||
const auto has_float = std::any_of(
|
||||
regs.vertex_attrib_format.begin(), regs.vertex_attrib_format.end(),
|
||||
[](const auto& attrib) {
|
||||
return attrib.type == Maxwell3D::Regs::VertexAttribute::Type::Float;
|
||||
}
|
||||
);
|
||||
if (regs.logic_op.enable) {
|
||||
regs.logic_op.enable = static_cast<u32>(!has_float);
|
||||
}
|
||||
}
|
||||
UpdateLogicOpEnable(regs);
|
||||
UpdateDepthClampEnable(regs);
|
||||
UpdateLineRasterizationMode(regs);
|
||||
|
|
@ -1031,7 +1048,7 @@ void RasterizerVulkan::UpdateDynamicStates() {
|
|||
// Vertex Input Dynamic State: Independent from EDS levels
|
||||
if (device.IsExtVertexInputDynamicStateSupported()) {
|
||||
if (auto* gp = pipeline_cache.CurrentGraphicsPipeline(); gp && gp->HasDynamicVertexInput()) {
|
||||
UpdateVertexInput(regs, *gp);
|
||||
UpdateVertexInput(regs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
@ -1711,66 +1728,46 @@ void RasterizerVulkan::UpdateStencilTestEnable(Tegra::Engines::Maxwell3D::Regs&
|
|||
});
|
||||
}
|
||||
|
||||
void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs,
|
||||
const GraphicsPipeline& pipeline) {
|
||||
void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs) {
|
||||
auto& dirty{maxwell3d->dirty.flags};
|
||||
const bool force_vertex_input_refresh = buffer_cache_runtime.ConsumeVertexInputBindingChange();
|
||||
if (!dirty[Dirty::VertexInput] && !force_vertex_input_refresh) {
|
||||
if (!dirty[Dirty::VertexInput]) {
|
||||
return;
|
||||
}
|
||||
dirty[Dirty::VertexInput] = false;
|
||||
|
||||
const size_t max_vertex_attributes =
|
||||
(std::min)(Maxwell::NumVertexAttributes,
|
||||
static_cast<size_t>(device.GetMaxVertexInputAttributes()));
|
||||
const size_t max_vertex_bindings =
|
||||
(std::min)(Maxwell::NumVertexArrays,
|
||||
static_cast<size_t>(device.GetMaxVertexInputBindings()));
|
||||
|
||||
// Dynamic state path must respect device limits, same as static pipeline creation.
|
||||
for (size_t index = max_vertex_attributes; index < Maxwell::NumVertexAttributes; ++index) {
|
||||
dirty[Dirty::VertexAttribute0 + index] = false;
|
||||
}
|
||||
for (size_t index = max_vertex_bindings; index < Maxwell::NumVertexArrays; ++index) {
|
||||
dirty[Dirty::VertexBinding0 + index] = false;
|
||||
}
|
||||
|
||||
boost::container::static_vector<VkVertexInputBindingDescription2EXT, 32> bindings;
|
||||
boost::container::static_vector<VkVertexInputAttributeDescription2EXT, 32> attributes;
|
||||
|
||||
std::array<bool, Maxwell::NumVertexArrays> used_bindings{};
|
||||
for (size_t index = 0; index < max_vertex_attributes; ++index) {
|
||||
dirty[Dirty::VertexAttribute0 + index] = false;
|
||||
|
||||
const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]};
|
||||
if (attribute.constant) {
|
||||
continue;
|
||||
// There seems to be a bug on Nvidia's driver where updating only higher attributes ends up
|
||||
// generating dirty state. Track the highest dirty attribute and update all attributes until
|
||||
// that one.
|
||||
size_t highest_dirty_attr{};
|
||||
for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) {
|
||||
if (dirty[Dirty::VertexAttribute0 + index]) {
|
||||
highest_dirty_attr = index;
|
||||
}
|
||||
if (!pipeline.UsesVertexAttribute(index)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
const size_t binding{attribute.buffer};
|
||||
if (binding >= max_vertex_bindings) {
|
||||
continue;
|
||||
}
|
||||
|
||||
used_bindings[binding] = true;
|
||||
attributes.push_back({
|
||||
.sType = VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT,
|
||||
.pNext = nullptr,
|
||||
.location = static_cast<u32>(index),
|
||||
.binding = static_cast<u32>(binding),
|
||||
.format = MaxwellToVK::VertexFormat(device, attribute.type, attribute.size),
|
||||
.offset = attribute.offset,
|
||||
});
|
||||
}
|
||||
|
||||
for (size_t index = 0; index < max_vertex_bindings; ++index) {
|
||||
dirty[Dirty::VertexBinding0 + index] = false;
|
||||
if (!used_bindings[index]) {
|
||||
for (size_t index = 0; index < highest_dirty_attr; ++index) {
|
||||
const Maxwell::VertexAttribute attribute{regs.vertex_attrib_format[index]};
|
||||
const u32 binding{attribute.buffer};
|
||||
dirty[Dirty::VertexAttribute0 + index] = false;
|
||||
dirty[Dirty::VertexBinding0 + static_cast<size_t>(binding)] = true;
|
||||
if (!attribute.constant) {
|
||||
attributes.push_back({
|
||||
.sType = VK_STRUCTURE_TYPE_VERTEX_INPUT_ATTRIBUTE_DESCRIPTION_2_EXT,
|
||||
.pNext = nullptr,
|
||||
.location = static_cast<u32>(index),
|
||||
.binding = binding,
|
||||
.format = MaxwellToVK::VertexFormat(device, attribute.type, attribute.size),
|
||||
.offset = attribute.offset,
|
||||
});
|
||||
}
|
||||
}
|
||||
for (size_t index = 0; index < Maxwell::NumVertexAttributes; ++index) {
|
||||
if (!dirty[Dirty::VertexBinding0 + index]) {
|
||||
continue;
|
||||
}
|
||||
dirty[Dirty::VertexBinding0 + index] = false;
|
||||
|
||||
const u32 binding{static_cast<u32>(index)};
|
||||
const auto& input_binding{regs.vertex_streams[binding]};
|
||||
|
|
@ -1784,10 +1781,6 @@ void RasterizerVulkan::UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs,
|
|||
.divisor = is_instanced ? input_binding.frequency : 1,
|
||||
});
|
||||
}
|
||||
|
||||
ASSERT(attributes.size() <= max_vertex_attributes);
|
||||
ASSERT(bindings.size() <= max_vertex_bindings);
|
||||
|
||||
scheduler.Record([bindings, attributes](vk::CommandBuffer cmdbuf) {
|
||||
cmdbuf.SetVertexInputEXT(bindings, attributes);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -191,8 +191,7 @@ private:
|
|||
void UpdateLogicOp(Tegra::Engines::Maxwell3D::Regs& regs);
|
||||
void UpdateBlending(Tegra::Engines::Maxwell3D::Regs& regs);
|
||||
|
||||
void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs,
|
||||
const GraphicsPipeline& pipeline);
|
||||
void UpdateVertexInput(Tegra::Engines::Maxwell3D::Regs& regs);
|
||||
|
||||
Tegra::GPU& gpu;
|
||||
Tegra::MaxwellDeviceMemoryManager& device_memory;
|
||||
|
|
|
|||
|
|
@ -153,17 +153,11 @@ void Scheduler::RequestOutsideRenderPassOperationContext() {
|
|||
}
|
||||
|
||||
bool Scheduler::UpdateGraphicsPipeline(GraphicsPipeline* pipeline) {
|
||||
const auto consume_eds_refresh = [this] {
|
||||
if (!state.needs_state_enable_refresh) {
|
||||
return;
|
||||
}
|
||||
state_tracker.InvalidateExtendedDynamicStateFlags();
|
||||
state.needs_state_enable_refresh = false;
|
||||
};
|
||||
|
||||
if (state.graphics_pipeline == pipeline) {
|
||||
if (pipeline && pipeline->UsesExtendedDynamicState()) {
|
||||
consume_eds_refresh();
|
||||
if (pipeline && pipeline->UsesExtendedDynamicState() &&
|
||||
state.needs_state_enable_refresh) {
|
||||
state_tracker.InvalidateStateEnableFlag();
|
||||
state.needs_state_enable_refresh = false;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
@ -176,8 +170,9 @@ bool Scheduler::UpdateGraphicsPipeline(GraphicsPipeline* pipeline) {
|
|||
|
||||
if (!pipeline->UsesExtendedDynamicState()) {
|
||||
state.needs_state_enable_refresh = true;
|
||||
} else {
|
||||
consume_eds_refresh();
|
||||
} else if (state.needs_state_enable_refresh) {
|
||||
state_tracker.InvalidateStateEnableFlag();
|
||||
state.needs_state_enable_refresh = false;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
// SPDX-FileCopyrightText: Copyright 2026 Eden Emulator Project
|
||||
// SPDX-FileCopyrightText: Copyright 2025 Eden Emulator Project
|
||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||
|
||||
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
|
||||
|
|
@ -101,37 +101,6 @@ public:
|
|||
(*flags)[Dirty::StateEnable] = true;
|
||||
}
|
||||
|
||||
void InvalidateExtendedDynamicStateFlags() {
|
||||
InvalidateStateEnableFlag();
|
||||
|
||||
(*flags)[Dirty::CullMode] = true;
|
||||
(*flags)[Dirty::DepthCompareOp] = true;
|
||||
(*flags)[Dirty::FrontFace] = true;
|
||||
(*flags)[Dirty::StencilOp] = true;
|
||||
(*flags)[Dirty::DepthBoundsEnable] = true;
|
||||
(*flags)[Dirty::DepthTestEnable] = true;
|
||||
(*flags)[Dirty::DepthWriteEnable] = true;
|
||||
(*flags)[Dirty::StencilTestEnable] = true;
|
||||
|
||||
(*flags)[Dirty::PrimitiveRestartEnable] = true;
|
||||
(*flags)[Dirty::RasterizerDiscardEnable] = true;
|
||||
(*flags)[Dirty::DepthBiasEnable] = true;
|
||||
(*flags)[Dirty::LogicOp] = true;
|
||||
|
||||
(*flags)[Dirty::LogicOpEnable] = true;
|
||||
(*flags)[Dirty::DepthClampEnable] = true;
|
||||
(*flags)[Dirty::LineRasterizationMode] = true;
|
||||
(*flags)[Dirty::LineStippleEnable] = true;
|
||||
(*flags)[Dirty::ConservativeRasterizationMode] = true;
|
||||
(*flags)[Dirty::AlphaToCoverageEnable] = true;
|
||||
(*flags)[Dirty::AlphaToOneEnable] = true;
|
||||
|
||||
(*flags)[Dirty::Blending] = true;
|
||||
(*flags)[Dirty::ColorMask] = true;
|
||||
(*flags)[Dirty::BlendEnable] = true;
|
||||
(*flags)[Dirty::BlendEquations] = true;
|
||||
}
|
||||
|
||||
bool TouchViewports() {
|
||||
const bool dirty_viewports = Exchange(Dirty::Viewports, false);
|
||||
const bool rescale_viewports = Exchange(VideoCommon::Dirty::RescaleViewports, false);
|
||||
|
|
|
|||
|
|
@ -1112,11 +1112,34 @@ bool Device::GetSuitability(bool requires_swapchain) {
|
|||
// VK_DYNAMIC_STATE
|
||||
|
||||
// Driver detection variables for workarounds in GetSuitability
|
||||
const VkDriverId driver_id = properties.driver.driverID;
|
||||
|
||||
// VK_EXT_extended_dynamic_state2 below this will appear drivers that need workarounds.
|
||||
|
||||
// VK_EXT_extended_dynamic_state3 below this will appear drivers that need workarounds.
|
||||
|
||||
// Samsung: Broken extendedDynamicState3ColorBlendEquation
|
||||
// Disable blend equation dynamic state, force static pipeline state
|
||||
if (extensions.extended_dynamic_state3 &&
|
||||
(driver_id == VK_DRIVER_ID_SAMSUNG_PROPRIETARY)) {
|
||||
LOG_WARNING(Render_Vulkan,
|
||||
"Samsung: Disabling broken extendedDynamicState3ColorBlendEquation");
|
||||
features.extended_dynamic_state3.extendedDynamicState3ColorBlendEnable = false;
|
||||
features.extended_dynamic_state3.extendedDynamicState3ColorBlendEquation = false;
|
||||
}
|
||||
|
||||
// Intel Windows < 27.20.100.0: Broken VertexInputDynamicState
|
||||
// Same for NVIDIA Proprietary < 580.119.02, unknown when VIDS was first NOT broken
|
||||
// Disable VertexInputDynamicState on old Intel Windows drivers
|
||||
if (extensions.vertex_input_dynamic_state) {
|
||||
const u32 version = (properties.properties.driverVersion << 3) >> 3;
|
||||
if ((driver_id == VK_DRIVER_ID_INTEL_PROPRIETARY_WINDOWS && version < VK_MAKE_API_VERSION(27, 20, 100, 0))
|
||||
|| (driver_id == VK_DRIVER_ID_NVIDIA_PROPRIETARY && version < VK_MAKE_API_VERSION(580, 119, 02, 0))) {
|
||||
LOG_WARNING(Render_Vulkan, "Disabling broken VK_EXT_vertex_input_dynamic_state");
|
||||
RemoveExtensionFeature(extensions.vertex_input_dynamic_state, features.vertex_input_dynamic_state, VK_EXT_VERTEX_INPUT_DYNAMIC_STATE_EXTENSION_NAME);
|
||||
}
|
||||
}
|
||||
|
||||
if (u32(Settings::values.dyna_state.GetValue()) == 0) {
|
||||
LOG_INFO(Render_Vulkan, "Extended Dynamic State disabled by user setting, clearing all EDS features");
|
||||
features.extended_dynamic_state.extendedDynamicState = false;
|
||||
|
|
|
|||
|
|
@ -783,10 +783,6 @@ public:
|
|||
return properties.properties.limits.maxVertexInputBindings;
|
||||
}
|
||||
|
||||
u32 GetMaxVertexInputBindingStride() const {
|
||||
return properties.properties.limits.maxVertexInputBindingStride;
|
||||
}
|
||||
|
||||
u32 GetMaxViewports() const {
|
||||
return properties.properties.limits.maxViewports;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue