mirror of
https://github.com/EduApps-CDG/OpenDX
synced 2024-12-30 09:45:37 +01:00
[dxvk] Remove support for VK_AMD_rasterization_order
RADV will be doing this by default when it makes sense.
This commit is contained in:
parent
492c7384bc
commit
4d28f765df
@ -129,7 +129,6 @@ namespace dxvk {
|
|||||||
* used by DXVK if supported by the implementation.
|
* used by DXVK if supported by the implementation.
|
||||||
*/
|
*/
|
||||||
struct DxvkDeviceExtensions : public DxvkExtensionList {
|
struct DxvkDeviceExtensions : public DxvkExtensionList {
|
||||||
DxvkExtension amdRasterizationOrder = { this, VK_AMD_RASTERIZATION_ORDER_EXTENSION_NAME, DxvkExtensionType::Optional };
|
|
||||||
DxvkExtension khrDescriptorUpdateTemplate = { this, VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, DxvkExtensionType::Required };
|
DxvkExtension khrDescriptorUpdateTemplate = { this, VK_KHR_DESCRIPTOR_UPDATE_TEMPLATE_EXTENSION_NAME, DxvkExtensionType::Required };
|
||||||
DxvkExtension khrMaintenance1 = { this, VK_KHR_MAINTENANCE1_EXTENSION_NAME, DxvkExtensionType::Required };
|
DxvkExtension khrMaintenance1 = { this, VK_KHR_MAINTENANCE1_EXTENSION_NAME, DxvkExtensionType::Required };
|
||||||
DxvkExtension khrMaintenance2 = { this, VK_KHR_MAINTENANCE2_EXTENSION_NAME, DxvkExtensionType::Desired };
|
DxvkExtension khrMaintenance2 = { this, VK_KHR_MAINTENANCE2_EXTENSION_NAME, DxvkExtensionType::Desired };
|
||||||
|
@ -163,14 +163,9 @@ namespace dxvk {
|
|||||||
vpInfo.scissorCount = state.rsViewportCount;
|
vpInfo.scissorCount = state.rsViewportCount;
|
||||||
vpInfo.pScissors = nullptr;
|
vpInfo.pScissors = nullptr;
|
||||||
|
|
||||||
VkPipelineRasterizationStateRasterizationOrderAMD rsOrder;
|
|
||||||
rsOrder.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_RASTERIZATION_ORDER_AMD;
|
|
||||||
rsOrder.pNext = nullptr;
|
|
||||||
rsOrder.rasterizationOrder = this->pickRasterizationOrder(state);
|
|
||||||
|
|
||||||
VkPipelineRasterizationStateCreateInfo rsInfo;
|
VkPipelineRasterizationStateCreateInfo rsInfo;
|
||||||
rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
rsInfo.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO;
|
||||||
rsInfo.pNext = m_device->extensions().amdRasterizationOrder.enabled() ? &rsOrder : rsOrder.pNext;
|
rsInfo.pNext = nullptr;
|
||||||
rsInfo.flags = 0;
|
rsInfo.flags = 0;
|
||||||
rsInfo.depthClampEnable = state.rsEnableDepthClamp;
|
rsInfo.depthClampEnable = state.rsEnableDepthClamp;
|
||||||
rsInfo.rasterizerDiscardEnable= state.rsEnableDiscard;
|
rsInfo.rasterizerDiscardEnable= state.rsEnableDiscard;
|
||||||
@ -309,31 +304,6 @@ namespace dxvk {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
VkRasterizationOrderAMD DxvkGraphicsPipeline::pickRasterizationOrder(
|
|
||||||
const DxvkGraphicsPipelineStateInfo& state) const {
|
|
||||||
// If blending is not enabled, we can enable out-of-order
|
|
||||||
// rasterization for certain depth-compare modes.
|
|
||||||
bool blendingEnabled = false;
|
|
||||||
|
|
||||||
for (uint32_t i = 0; i < MaxNumRenderTargets; i++) {
|
|
||||||
if (m_fsOut & (1u << i))
|
|
||||||
blendingEnabled |= state.omBlendAttachments[i].blendEnable;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!blendingEnabled) {
|
|
||||||
if (m_device->hasOption(DxvkOption::AssumeNoZfight))
|
|
||||||
return VK_RASTERIZATION_ORDER_RELAXED_AMD;
|
|
||||||
|
|
||||||
if (state.dsEnableDepthTest && state.dsEnableDepthWrite
|
|
||||||
&& (state.dsDepthCompareOp == VK_COMPARE_OP_LESS
|
|
||||||
|| state.dsDepthCompareOp == VK_COMPARE_OP_GREATER))
|
|
||||||
return VK_RASTERIZATION_ORDER_RELAXED_AMD;
|
|
||||||
}
|
|
||||||
|
|
||||||
return VK_RASTERIZATION_ORDER_STRICT_AMD;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void DxvkGraphicsPipeline::logPipelineState(
|
void DxvkGraphicsPipeline::logPipelineState(
|
||||||
LogLevel level,
|
LogLevel level,
|
||||||
const DxvkGraphicsPipelineStateInfo& state) const {
|
const DxvkGraphicsPipelineStateInfo& state) const {
|
||||||
|
@ -160,9 +160,6 @@ namespace dxvk {
|
|||||||
bool validatePipelineState(
|
bool validatePipelineState(
|
||||||
const DxvkGraphicsPipelineStateInfo& state) const;
|
const DxvkGraphicsPipelineStateInfo& state) const;
|
||||||
|
|
||||||
VkRasterizationOrderAMD pickRasterizationOrder(
|
|
||||||
const DxvkGraphicsPipelineStateInfo& state) const;
|
|
||||||
|
|
||||||
void logPipelineState(
|
void logPipelineState(
|
||||||
LogLevel level,
|
LogLevel level,
|
||||||
const DxvkGraphicsPipelineStateInfo& state) const;
|
const DxvkGraphicsPipelineStateInfo& state) const;
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
namespace dxvk {
|
namespace dxvk {
|
||||||
|
|
||||||
const static std::unordered_map<std::string, DxvkOptionSet> g_appOptions = {{
|
const static std::unordered_map<std::string, DxvkOptionSet> g_appOptions = {{
|
||||||
{ "NieRAutomata.exe", DxvkOptionSet(DxvkOption::AssumeNoZfight) },
|
|
||||||
}};
|
}};
|
||||||
|
|
||||||
|
|
||||||
@ -23,9 +23,7 @@ namespace dxvk {
|
|||||||
|
|
||||||
|
|
||||||
void DxvkOptions::logOptions() const {
|
void DxvkOptions::logOptions() const {
|
||||||
#define LOG_OPTION(opt) this->logOption(DxvkOption::opt, #opt)
|
|
||||||
LOG_OPTION(AssumeNoZfight);
|
|
||||||
#undef LOG_OPTION
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -8,11 +8,7 @@ namespace dxvk {
|
|||||||
* \brief App- and driver-specific options
|
* \brief App- and driver-specific options
|
||||||
*/
|
*/
|
||||||
enum class DxvkOption : uint64_t {
|
enum class DxvkOption : uint64_t {
|
||||||
/// Assume that the application will not render
|
|
||||||
/// multiple polygons with the exact same depth
|
|
||||||
/// value. Allows out-of-order rasterization to
|
|
||||||
/// be enabled for more rendering modes.
|
|
||||||
AssumeNoZfight = 0,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
using DxvkOptionSet = Flags<DxvkOption>;
|
using DxvkOptionSet = Flags<DxvkOption>;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user