[d3d11] Add option to disable write-after-write barriers

This commit is contained in:
Philip Rebohle 2019-02-07 00:57:21 +01:00
parent 023cf01c3c
commit e56710e64f
No known key found for this signature in database
GPG Key ID: C8CC613427A31C99
3 changed files with 14 additions and 1 deletions

View File

@ -13,8 +13,14 @@ namespace dxvk {
const Rc<DxvkDevice>& Device)
: D3D11DeviceContext(pParent, Device, DxvkCsChunkFlag::SingleUse),
m_csThread(Device->createContext()) {
EmitCs([cDevice = m_device] (DxvkContext* ctx) {
EmitCs([
cDevice = m_device,
cRelaxedBarriers = pParent->GetOptions()->relaxedBarriers
] (DxvkContext* ctx) {
ctx->beginRecording(cDevice->createCommandList());
if (cRelaxedBarriers)
ctx->setBarrierControl(DxvkBarrierControl::IgnoreWriteAfterWrite);
});
ClearState();

View File

@ -9,6 +9,7 @@ namespace dxvk {
this->dcSingleUseMode = config.getOption<bool>("d3d11.dcSingleUseMode", true);
this->strictDivision = config.getOption<bool>("d3d11.strictDivision", false);
this->zeroInitWorkgroupMemory = config.getOption<bool>("d3d11.zeroInitWorkgroupMemory", false);
this->relaxedBarriers = config.getOption<bool>("d3d11.relaxedBarriers", false);
this->maxTessFactor = config.getOption<int32_t>("d3d11.maxTessFactor", 0);
this->samplerAnisotropy = config.getOption<int32_t>("d3d11.samplerAnisotropy", -1);
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);

View File

@ -36,6 +36,12 @@ namespace dxvk {
/// TGSM in compute shaders before reading it.
bool zeroInitWorkgroupMemory;
/// Use relaxed memory barriers
///
/// May improve performance in some games,
/// but might also cause rendering issues.
bool relaxedBarriers;
/// Maximum tessellation factor.
///
/// Limits tessellation factors in tessellation