mirror of
https://github.com/doitsujin/dxvk.git
synced 2024-12-02 10:24:12 +01:00
[dxvk] Remove conditional rendering from backend
Was disabled anyway due to being broken on various drivers, so let's get rid of it.
This commit is contained in:
parent
34e730fe41
commit
0ce5dd8b03
@ -226,8 +226,6 @@ namespace dxvk {
|
||||
|| !required.ext4444Formats.formatA4R4G4B4)
|
||||
&& (m_deviceFeatures.ext4444Formats.formatA4B4G4R4
|
||||
|| !required.ext4444Formats.formatA4B4G4R4)
|
||||
&& (m_deviceFeatures.extConditionalRendering.conditionalRendering
|
||||
|| !required.extConditionalRendering.conditionalRendering)
|
||||
&& (m_deviceFeatures.extCustomBorderColor.customBorderColors
|
||||
|| !required.extCustomBorderColor.customBorderColors)
|
||||
&& (m_deviceFeatures.extCustomBorderColor.customBorderColorWithoutFormat
|
||||
@ -265,11 +263,10 @@ namespace dxvk {
|
||||
DxvkDeviceFeatures enabledFeatures) {
|
||||
DxvkDeviceExtensions devExtensions;
|
||||
|
||||
std::array<DxvkExt*, 24> devExtensionList = {{
|
||||
std::array<DxvkExt*, 23> devExtensionList = {{
|
||||
&devExtensions.amdMemoryOverallocationBehaviour,
|
||||
&devExtensions.amdShaderFragmentMask,
|
||||
&devExtensions.ext4444Formats,
|
||||
&devExtensions.extConditionalRendering,
|
||||
&devExtensions.extCustomBorderColor,
|
||||
&devExtensions.extDepthClipEnable,
|
||||
&devExtensions.extExtendedDynamicState,
|
||||
@ -333,11 +330,6 @@ namespace dxvk {
|
||||
enabledFeatures.ext4444Formats.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.ext4444Formats);
|
||||
}
|
||||
|
||||
if (devExtensions.extConditionalRendering) {
|
||||
enabledFeatures.extConditionalRendering.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT;
|
||||
enabledFeatures.extConditionalRendering.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extConditionalRendering);
|
||||
}
|
||||
|
||||
if (devExtensions.extCustomBorderColor) {
|
||||
enabledFeatures.extCustomBorderColor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT;
|
||||
enabledFeatures.extCustomBorderColor.pNext = std::exchange(enabledFeatures.core.pNext, &enabledFeatures.extCustomBorderColor);
|
||||
@ -584,11 +576,6 @@ namespace dxvk {
|
||||
m_deviceFeatures.ext4444Formats.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.ext4444Formats);
|
||||
}
|
||||
|
||||
if (m_deviceExtensions.supports(VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME)) {
|
||||
m_deviceFeatures.extConditionalRendering.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CONDITIONAL_RENDERING_FEATURES_EXT;
|
||||
m_deviceFeatures.extConditionalRendering.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extConditionalRendering);
|
||||
}
|
||||
|
||||
if (m_deviceExtensions.supports(VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME)) {
|
||||
m_deviceFeatures.extCustomBorderColor.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_CUSTOM_BORDER_COLOR_FEATURES_EXT;
|
||||
m_deviceFeatures.extCustomBorderColor.pNext = std::exchange(m_deviceFeatures.core.pNext, &m_deviceFeatures.extCustomBorderColor);
|
||||
@ -700,8 +687,6 @@ namespace dxvk {
|
||||
"\n shaderFloat64 : ", features.core.features.shaderFloat64 ? "1" : "0",
|
||||
"\n shaderInt64 : ", features.core.features.shaderInt64 ? "1" : "0",
|
||||
"\n variableMultisampleRate : ", features.core.features.variableMultisampleRate ? "1" : "0",
|
||||
"\n", VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME,
|
||||
"\n conditionalRendering : ", features.extConditionalRendering.conditionalRendering ? "1" : "0",
|
||||
"\n", VK_EXT_4444_FORMATS_EXTENSION_NAME,
|
||||
"\n formatA4R4G4B4 : ", features.ext4444Formats.formatA4R4G4B4 ? "1" : "0",
|
||||
"\n formatA4B4G4R4 : ", features.ext4444Formats.formatA4B4G4R4 ? "1" : "0",
|
||||
|
@ -2347,28 +2347,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::setPredicate(
|
||||
const DxvkBufferSlice& predicate,
|
||||
VkConditionalRenderingFlagsEXT flags) {
|
||||
if (!m_state.cond.predicate.matches(predicate)) {
|
||||
m_state.cond.predicate = predicate;
|
||||
|
||||
if (m_predicateWrites.find(predicate.getSliceHandle())
|
||||
!= m_predicateWrites.end()) {
|
||||
spillRenderPass();
|
||||
commitPredicateUpdates();
|
||||
}
|
||||
|
||||
m_flags.set(DxvkContextFlag::GpDirtyPredicate);
|
||||
}
|
||||
|
||||
if (m_state.cond.flags != flags) {
|
||||
m_state.cond.flags = flags;
|
||||
m_flags.set(DxvkContextFlag::GpDirtyPredicate);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::setBarrierControl(DxvkBarrierControlFlags control) {
|
||||
m_barrierControl = control;
|
||||
}
|
||||
@ -2387,21 +2365,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::writePredicate(
|
||||
const DxvkBufferSlice& predicate,
|
||||
const Rc<DxvkGpuQuery>& query) {
|
||||
DxvkBufferSliceHandle predicateHandle = predicate.getSliceHandle();
|
||||
DxvkGpuQueryHandle queryHandle = query->handle();
|
||||
|
||||
if (m_flags.test(DxvkContextFlag::GpRenderPassBound))
|
||||
m_predicateWrites.insert({ predicateHandle, queryHandle });
|
||||
else
|
||||
updatePredicate(predicateHandle, queryHandle);
|
||||
|
||||
m_cmd->trackResource<DxvkAccess::Write>(predicate.buffer());
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::writeTimestamp(const Rc<DxvkGpuQuery>& query) {
|
||||
m_queryManager.writeTimestamp(m_cmd, query);
|
||||
}
|
||||
@ -3400,30 +3363,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::updatePredicate(
|
||||
const DxvkBufferSliceHandle& predicate,
|
||||
const DxvkGpuQueryHandle& query) {
|
||||
m_cmd->cmdCopyQueryPoolResults(
|
||||
query.queryPool, query.queryId, 1,
|
||||
predicate.handle, predicate.offset, sizeof(uint32_t),
|
||||
VK_QUERY_RESULT_WAIT_BIT);
|
||||
|
||||
m_execBarriers.accessBuffer(predicate,
|
||||
VK_PIPELINE_STAGE_TRANSFER_BIT,
|
||||
VK_ACCESS_TRANSFER_WRITE_BIT,
|
||||
VK_PIPELINE_STAGE_CONDITIONAL_RENDERING_BIT_EXT,
|
||||
VK_ACCESS_CONDITIONAL_RENDERING_READ_BIT_EXT);
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::commitPredicateUpdates() {
|
||||
for (const auto& update : m_predicateWrites)
|
||||
updatePredicate(update.first, update.second);
|
||||
|
||||
m_predicateWrites.clear();
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::startRenderPass() {
|
||||
if (!m_flags.test(DxvkContextFlag::GpRenderPassBound)) {
|
||||
this->flushClears(true);
|
||||
@ -3466,7 +3405,6 @@ namespace dxvk {
|
||||
m_gfxBarriers.reset();
|
||||
|
||||
this->unbindGraphicsPipeline();
|
||||
this->commitPredicateUpdates();
|
||||
|
||||
m_flags.clr(DxvkContextFlag::GpDirtyXfbCounters);
|
||||
} else if (flushClears) {
|
||||
@ -3577,33 +3515,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::startConditionalRendering() {
|
||||
if (!m_flags.test(DxvkContextFlag::GpCondActive)) {
|
||||
m_flags.set(DxvkContextFlag::GpCondActive);
|
||||
|
||||
auto predicateSlice = m_state.cond.predicate.getSliceHandle();
|
||||
|
||||
VkConditionalRenderingBeginInfoEXT info;
|
||||
info.sType = VK_STRUCTURE_TYPE_CONDITIONAL_RENDERING_BEGIN_INFO_EXT;
|
||||
info.pNext = nullptr;
|
||||
info.buffer = predicateSlice.handle;
|
||||
info.offset = predicateSlice.offset;
|
||||
info.flags = m_state.cond.flags;
|
||||
|
||||
m_cmd->cmdBeginConditionalRendering(&info);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::pauseConditionalRendering() {
|
||||
if (m_flags.test(DxvkContextFlag::GpCondActive)) {
|
||||
m_flags.clr(DxvkContextFlag::GpCondActive);
|
||||
|
||||
m_cmd->cmdEndConditionalRendering();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::startTransformFeedback() {
|
||||
if (!m_flags.test(DxvkContextFlag::GpXfbActive)) {
|
||||
m_flags.set(DxvkContextFlag::GpXfbActive);
|
||||
@ -3719,8 +3630,7 @@ namespace dxvk {
|
||||
DxvkContextFlag::GpDirtyStencilRef,
|
||||
DxvkContextFlag::GpDirtyViewport,
|
||||
DxvkContextFlag::GpDirtyDepthBias,
|
||||
DxvkContextFlag::GpDirtyDepthBounds,
|
||||
DxvkContextFlag::GpDirtyPredicate);
|
||||
DxvkContextFlag::GpDirtyDepthBounds);
|
||||
|
||||
m_gpActivePipeline = VK_NULL_HANDLE;
|
||||
}
|
||||
@ -4178,16 +4088,6 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::updateConditionalRendering() {
|
||||
m_flags.clr(DxvkContextFlag::GpDirtyPredicate);
|
||||
|
||||
pauseConditionalRendering();
|
||||
|
||||
if (m_state.cond.predicate.defined())
|
||||
startConditionalRendering();
|
||||
}
|
||||
|
||||
|
||||
void DxvkContext::updateDynamicState() {
|
||||
if (!m_gpActivePipeline)
|
||||
return;
|
||||
@ -4325,9 +4225,6 @@ namespace dxvk {
|
||||
if (m_state.gp.flags.test(DxvkGraphicsPipelineFlag::HasTransformFeedback))
|
||||
this->updateTransformFeedbackState();
|
||||
|
||||
if (m_flags.test(DxvkContextFlag::GpDirtyPredicate))
|
||||
this->updateConditionalRendering();
|
||||
|
||||
if (m_flags.any(
|
||||
DxvkContextFlag::GpDirtyViewport,
|
||||
DxvkContextFlag::GpDirtyBlendConstants,
|
||||
|
@ -936,21 +936,6 @@ namespace dxvk {
|
||||
uint32_t index,
|
||||
uint32_t value);
|
||||
|
||||
/**
|
||||
* \brief Sets predicate
|
||||
*
|
||||
* Enables or disables conditional rendering,
|
||||
* depending on whether the given buffer slice
|
||||
* is defined or not. Draw calls and render
|
||||
* target clear commands will get discarded if
|
||||
* the predicate value is either zero or non-zero.
|
||||
* \param [in] predicate The predicate buffer
|
||||
* \param [in] flags Conditional rendering mode
|
||||
*/
|
||||
void setPredicate(
|
||||
const DxvkBufferSlice& predicate,
|
||||
VkConditionalRenderingFlagsEXT flags);
|
||||
|
||||
/**
|
||||
* \brief Sets barrier control flags
|
||||
*
|
||||
@ -968,18 +953,6 @@ namespace dxvk {
|
||||
void signalGpuEvent(
|
||||
const Rc<DxvkGpuEvent>& event);
|
||||
|
||||
/**
|
||||
* \brief Copies query data to predicate buffer
|
||||
*
|
||||
* The given buffer slice can then be passed
|
||||
* to \c setPredicate to enable predication.
|
||||
* \param [in] predicate Predicate buffer
|
||||
* \param [in] query Source query
|
||||
*/
|
||||
void writePredicate(
|
||||
const DxvkBufferSlice& predicate,
|
||||
const Rc<DxvkGpuQuery>& query);
|
||||
|
||||
/**
|
||||
* \brief Writes to a timestamp query
|
||||
* \param [in] query The timestamp query
|
||||
@ -1048,11 +1021,6 @@ namespace dxvk {
|
||||
std::array<DxvkGraphicsPipeline*, 4096> m_gpLookupCache = { };
|
||||
std::array<DxvkComputePipeline*, 256> m_cpLookupCache = { };
|
||||
|
||||
std::unordered_map<
|
||||
DxvkBufferSliceHandle,
|
||||
DxvkGpuQueryHandle,
|
||||
DxvkHash, DxvkEq> m_predicateWrites;
|
||||
|
||||
void blitImageFb(
|
||||
const Rc<DxvkImage>& dstImage,
|
||||
const Rc<DxvkImage>& srcImage,
|
||||
@ -1131,12 +1099,6 @@ namespace dxvk {
|
||||
void flushClears(
|
||||
bool useRenderPass);
|
||||
|
||||
void updatePredicate(
|
||||
const DxvkBufferSliceHandle& predicate,
|
||||
const DxvkGpuQueryHandle& query);
|
||||
|
||||
void commitPredicateUpdates();
|
||||
|
||||
void startRenderPass();
|
||||
void spillRenderPass(bool flushClears = true);
|
||||
|
||||
@ -1152,9 +1114,6 @@ namespace dxvk {
|
||||
const DxvkRenderTargets& renderTargets,
|
||||
DxvkRenderPassOps& renderPassOps);
|
||||
|
||||
void startConditionalRendering();
|
||||
void pauseConditionalRendering();
|
||||
|
||||
void startTransformFeedback();
|
||||
void pauseTransformFeedback();
|
||||
|
||||
@ -1186,8 +1145,6 @@ namespace dxvk {
|
||||
void updateTransformFeedbackBuffers();
|
||||
void updateTransformFeedbackState();
|
||||
|
||||
void updateConditionalRendering();
|
||||
|
||||
void updateDynamicState();
|
||||
|
||||
template<VkPipelineBindPoint BindPoint>
|
||||
|
@ -22,7 +22,6 @@ namespace dxvk {
|
||||
*/
|
||||
enum class DxvkContextFlag : uint32_t {
|
||||
GpRenderPassBound, ///< Render pass is currently bound
|
||||
GpCondActive, ///< Conditional rendering is enabled
|
||||
GpXfbActive, ///< Transform feedback is enabled
|
||||
GpDirtyFramebuffer, ///< Framebuffer binding is out of date
|
||||
GpDirtyPipeline, ///< Graphics pipeline binding is out of date
|
||||
@ -38,7 +37,6 @@ namespace dxvk {
|
||||
GpDirtyDepthBounds, ///< Depth bounds have changed
|
||||
GpDirtyStencilRef, ///< Stencil reference has changed
|
||||
GpDirtyViewport, ///< Viewport state has changed
|
||||
GpDirtyPredicate, ///< Predicate has changed
|
||||
GpDynamicBlendConstants, ///< Blend constants are dynamic
|
||||
GpDynamicDepthBias, ///< Depth bias is dynamic
|
||||
GpDynamicDepthBounds, ///< Depth bounds are dynamic
|
||||
@ -144,12 +142,6 @@ namespace dxvk {
|
||||
};
|
||||
|
||||
|
||||
struct DxvkCondRenderState {
|
||||
DxvkBufferSlice predicate;
|
||||
VkConditionalRenderingFlagsEXT flags;
|
||||
};
|
||||
|
||||
|
||||
struct DxvkDeferredClear {
|
||||
Rc<DxvkImageView> imageView;
|
||||
VkImageAspectFlags clearAspects;
|
||||
@ -171,7 +163,6 @@ namespace dxvk {
|
||||
DxvkPushConstantState pc;
|
||||
DxvkXfbState xfb;
|
||||
DxvkDynamicState dyn;
|
||||
DxvkCondRenderState cond;
|
||||
|
||||
DxvkGraphicsPipelineState gp;
|
||||
DxvkComputePipelineState cp;
|
||||
|
@ -36,7 +36,6 @@ namespace dxvk {
|
||||
VkPhysicalDeviceFeatures2 core;
|
||||
VkPhysicalDeviceShaderDrawParametersFeatures shaderDrawParameters;
|
||||
VkPhysicalDevice4444FormatsFeaturesEXT ext4444Formats;
|
||||
VkPhysicalDeviceConditionalRenderingFeaturesEXT extConditionalRendering;
|
||||
VkPhysicalDeviceCustomBorderColorFeaturesEXT extCustomBorderColor;
|
||||
VkPhysicalDeviceDepthClipEnableFeaturesEXT extDepthClipEnable;
|
||||
VkPhysicalDeviceExtendedDynamicStateFeaturesEXT extExtendedDynamicState;
|
||||
|
@ -261,7 +261,6 @@ namespace dxvk {
|
||||
DxvkExt amdMemoryOverallocationBehaviour = { VK_AMD_MEMORY_OVERALLOCATION_BEHAVIOR_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt amdShaderFragmentMask = { VK_AMD_SHADER_FRAGMENT_MASK_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt ext4444Formats = { VK_EXT_4444_FORMATS_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt extConditionalRendering = { VK_EXT_CONDITIONAL_RENDERING_EXTENSION_NAME, DxvkExtMode::Disabled };
|
||||
DxvkExt extCustomBorderColor = { VK_EXT_CUSTOM_BORDER_COLOR_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt extDepthClipEnable = { VK_EXT_DEPTH_CLIP_ENABLE_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
DxvkExt extExtendedDynamicState = { VK_EXT_EXTENDED_DYNAMIC_STATE_EXTENSION_NAME, DxvkExtMode::Optional };
|
||||
|
Loading…
Reference in New Issue
Block a user