mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-01-19 05:52:11 +01:00
[d3d9] Add option to disable direct buffer mapping
This commit is contained in:
parent
6d71eea516
commit
cf4c5c3422
@ -8,7 +8,8 @@ namespace dxvk {
|
|||||||
D3D9CommonBuffer::D3D9CommonBuffer(
|
D3D9CommonBuffer::D3D9CommonBuffer(
|
||||||
D3D9DeviceEx* pDevice,
|
D3D9DeviceEx* pDevice,
|
||||||
const D3D9_BUFFER_DESC* pDesc)
|
const D3D9_BUFFER_DESC* pDesc)
|
||||||
: m_parent ( pDevice ), m_desc ( *pDesc ), m_mapMode(DetermineMapMode()) {
|
: m_parent ( pDevice ), m_desc ( *pDesc ),
|
||||||
|
m_mapMode(DetermineMapMode(pDevice->GetOptions())) {
|
||||||
m_buffer = CreateBuffer();
|
m_buffer = CreateBuffer();
|
||||||
if (m_mapMode == D3D9_COMMON_BUFFER_MAP_MODE_BUFFER)
|
if (m_mapMode == D3D9_COMMON_BUFFER_MAP_MODE_BUFFER)
|
||||||
m_stagingBuffer = CreateStagingBuffer();
|
m_stagingBuffer = CreateStagingBuffer();
|
||||||
|
@ -88,8 +88,8 @@ namespace dxvk {
|
|||||||
/**
|
/**
|
||||||
* \brief Determine the mapping mode of the buffer, (ie. direct mapping or backed)
|
* \brief Determine the mapping mode of the buffer, (ie. direct mapping or backed)
|
||||||
*/
|
*/
|
||||||
inline D3D9_COMMON_BUFFER_MAP_MODE DetermineMapMode() const {
|
inline D3D9_COMMON_BUFFER_MAP_MODE DetermineMapMode(const D3D9Options* options) const {
|
||||||
return (m_desc.Pool == D3DPOOL_DEFAULT && (m_desc.Usage & (D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY)))
|
return (m_desc.Pool == D3DPOOL_DEFAULT && (m_desc.Usage & (D3DUSAGE_DYNAMIC | D3DUSAGE_WRITEONLY)) && options->allowDirectBufferMapping)
|
||||||
? D3D9_COMMON_BUFFER_MAP_MODE_DIRECT
|
? D3D9_COMMON_BUFFER_MAP_MODE_DIRECT
|
||||||
: D3D9_COMMON_BUFFER_MAP_MODE_BUFFER;
|
: D3D9_COMMON_BUFFER_MAP_MODE_BUFFER;
|
||||||
}
|
}
|
||||||
|
@ -72,6 +72,7 @@ namespace dxvk {
|
|||||||
this->alphaTestWiggleRoom = config.getOption<bool> ("d3d9.alphaTestWiggleRoom", false);
|
this->alphaTestWiggleRoom = config.getOption<bool> ("d3d9.alphaTestWiggleRoom", false);
|
||||||
this->apitraceMode = config.getOption<bool> ("d3d9.apitraceMode", false);
|
this->apitraceMode = config.getOption<bool> ("d3d9.apitraceMode", false);
|
||||||
this->deviceLocalConstantBuffers = config.getOption<bool> ("d3d9.deviceLocalConstantBuffers", false);
|
this->deviceLocalConstantBuffers = config.getOption<bool> ("d3d9.deviceLocalConstantBuffers", false);
|
||||||
|
this->allowDirectBufferMapping = config.getOption<bool> ("d3d9.allowDirectBufferMapping", true);
|
||||||
|
|
||||||
// If we are not Nvidia, enable general hazards.
|
// If we are not Nvidia, enable general hazards.
|
||||||
this->generalHazards = adapter != nullptr
|
this->generalHazards = adapter != nullptr
|
||||||
|
@ -156,6 +156,9 @@ namespace dxvk {
|
|||||||
|
|
||||||
/// Use device local memory for constant buffers.
|
/// Use device local memory for constant buffers.
|
||||||
bool deviceLocalConstantBuffers;
|
bool deviceLocalConstantBuffers;
|
||||||
|
|
||||||
|
/// Disable direct buffer mapping
|
||||||
|
bool allowDirectBufferMapping;
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user