mirror of https://github.com/doitsujin/dxvk
[d3d11,dxbc] Add d3d11.forceSampleRateShading option
This commit is contained in:
parent
06fb93daf0
commit
e426ec09a1
|
@ -201,6 +201,15 @@
|
||||||
# d3d9.invariantPosition = True
|
# d3d9.invariantPosition = True
|
||||||
|
|
||||||
|
|
||||||
|
# Forces per-sample rate shading when MSAA is enabled, rather than per-pixel
|
||||||
|
# shading. May improve visual clarity at a significant performance cost, but
|
||||||
|
# may also introduce visual issues in some games.
|
||||||
|
#
|
||||||
|
# Supported values: True, False
|
||||||
|
|
||||||
|
# d3d11.forceSampleRateShading = False
|
||||||
|
|
||||||
|
|
||||||
# Forces the sample count of all textures to 1, and performs
|
# Forces the sample count of all textures to 1, and performs
|
||||||
# the needed fixups in resolve operations and shaders.
|
# the needed fixups in resolve operations and shaders.
|
||||||
#
|
#
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace dxvk {
|
||||||
this->samplerLodBias = config.getOption<float>("d3d11.samplerLodBias", 0.0f);
|
this->samplerLodBias = config.getOption<float>("d3d11.samplerLodBias", 0.0f);
|
||||||
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
|
this->invariantPosition = config.getOption<bool>("d3d11.invariantPosition", true);
|
||||||
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
this->floatControls = config.getOption<bool>("d3d11.floatControls", true);
|
||||||
|
this->forceSampleRateShading = config.getOption<bool>("d3d11.forceSampleRateShading", false);
|
||||||
this->disableMsaa = config.getOption<bool>("d3d11.disableMsaa", false);
|
this->disableMsaa = config.getOption<bool>("d3d11.disableMsaa", false);
|
||||||
this->enableContextLock = config.getOption<bool>("d3d11.enableContextLock", false);
|
this->enableContextLock = config.getOption<bool>("d3d11.enableContextLock", false);
|
||||||
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);
|
this->deferSurfaceCreation = config.getOption<bool>("dxgi.deferSurfaceCreation", false);
|
||||||
|
|
|
@ -99,6 +99,11 @@ namespace dxvk {
|
||||||
/// for a single window that may interfere with each other.
|
/// for a single window that may interfere with each other.
|
||||||
bool deferSurfaceCreation;
|
bool deferSurfaceCreation;
|
||||||
|
|
||||||
|
/// Enables sample rate shading by interpolating fragment shader
|
||||||
|
/// inputs at the sample location rather than pixel center,
|
||||||
|
/// unless otherwise specified by the application.
|
||||||
|
bool forceSampleRateShading;
|
||||||
|
|
||||||
/// Forces the sample count of all textures to be 1, and
|
/// Forces the sample count of all textures to be 1, and
|
||||||
/// performs the required shader and resolve fixups.
|
/// performs the required shader and resolve fixups.
|
||||||
bool disableMsaa;
|
bool disableMsaa;
|
||||||
|
|
|
@ -726,6 +726,14 @@ namespace dxvk {
|
||||||
m_module.decorate(varId, spv::DecorationSample);
|
m_module.decorate(varId, spv::DecorationSample);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_moduleInfo.options.forceSampleRateShading) {
|
||||||
|
if (im == DxbcInterpolationMode::Linear
|
||||||
|
|| im == DxbcInterpolationMode::LinearNoPerspective) {
|
||||||
|
m_module.enableCapability(spv::CapabilitySampleRateShading);
|
||||||
|
m_module.decorate(varId, spv::DecorationSample);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Declare the input slot as defined
|
// Declare the input slot as defined
|
||||||
m_inputMask |= 1u << regIdx;
|
m_inputMask |= 1u << regIdx;
|
||||||
m_vArrayLength = std::max(m_vArrayLength, regIdx + 1);
|
m_vArrayLength = std::max(m_vArrayLength, regIdx + 1);
|
||||||
|
|
|
@ -38,6 +38,7 @@ namespace dxvk {
|
||||||
zeroInitWorkgroupMemory = options.zeroInitWorkgroupMemory;
|
zeroInitWorkgroupMemory = options.zeroInitWorkgroupMemory;
|
||||||
forceVolatileTgsmAccess = options.forceVolatileTgsmAccess;
|
forceVolatileTgsmAccess = options.forceVolatileTgsmAccess;
|
||||||
disableMsaa = options.disableMsaa;
|
disableMsaa = options.disableMsaa;
|
||||||
|
forceSampleRateShading = options.forceSampleRateShading;
|
||||||
enableSampleShadingInterlock = device->features().extFragmentShaderInterlock.fragmentShaderSampleInterlock;
|
enableSampleShadingInterlock = device->features().extFragmentShaderInterlock.fragmentShaderSampleInterlock;
|
||||||
|
|
||||||
// Figure out float control flags to match D3D11 rules
|
// Figure out float control flags to match D3D11 rules
|
||||||
|
|
|
@ -43,6 +43,10 @@ namespace dxvk {
|
||||||
/// Replace ld_ms with ld
|
/// Replace ld_ms with ld
|
||||||
bool disableMsaa = false;
|
bool disableMsaa = false;
|
||||||
|
|
||||||
|
/// Force sample rate shading by using sample
|
||||||
|
/// interpolation for fragment shader inputs
|
||||||
|
bool forceSampleRateShading = false;
|
||||||
|
|
||||||
// Enable per-sample interlock if supported
|
// Enable per-sample interlock if supported
|
||||||
bool enableSampleShadingInterlock = false;
|
bool enableSampleShadingInterlock = false;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue