mirror of
https://github.com/doitsujin/dxvk.git
synced 2025-02-20 10:54:16 +01:00
[d3d9] Flush format converter in device after init
Otherwise we can be overwritten if its a new resource we just created by the initializer.
This commit is contained in:
parent
58316ebe4c
commit
077f48b4ef
@ -4682,6 +4682,7 @@ namespace dxvk {
|
||||
D3D9DeviceLock lock = LockDevice();
|
||||
|
||||
m_initializer->Flush();
|
||||
m_converter->Flush();
|
||||
|
||||
if (m_csIsBusy || !m_csChunk->empty()) {
|
||||
// Add commands to flush the threaded
|
||||
|
@ -14,6 +14,12 @@ namespace dxvk {
|
||||
}
|
||||
|
||||
|
||||
void D3D9FormatHelper::Flush() {
|
||||
if (m_transferCommands != 0)
|
||||
FlushInternal();
|
||||
}
|
||||
|
||||
|
||||
void D3D9FormatHelper::ConvertFormat(
|
||||
D3D9_CONVERSION_FORMAT_INFO conversionFormat,
|
||||
const Rc<DxvkImage>& dstImage,
|
||||
@ -67,7 +73,7 @@ namespace dxvk {
|
||||
(imageExtent.height / 8) + (imageExtent.height % 8),
|
||||
1);
|
||||
|
||||
m_context->flushCommandList();
|
||||
m_transferCommands += 1;
|
||||
}
|
||||
|
||||
|
||||
@ -112,7 +118,7 @@ namespace dxvk {
|
||||
// Reset the spec constants used...
|
||||
m_context->setSpecConstant(VK_PIPELINE_BIND_POINT_COMPUTE, 0, 0);
|
||||
|
||||
m_context->flushCommandList();
|
||||
m_transferCommands += 1;
|
||||
}
|
||||
|
||||
|
||||
@ -135,4 +141,11 @@ namespace dxvk {
|
||||
{ 0u, 0u, 0u, sizeof(VkExtent2D) }, code);
|
||||
}
|
||||
|
||||
|
||||
void D3D9FormatHelper::FlushInternal() {
|
||||
m_context->flushCommandList();
|
||||
|
||||
m_transferCommands = 0;
|
||||
}
|
||||
|
||||
}
|
@ -13,6 +13,8 @@ namespace dxvk {
|
||||
|
||||
D3D9FormatHelper(const Rc<DxvkDevice>& device);
|
||||
|
||||
void Flush();
|
||||
|
||||
void ConvertFormat(
|
||||
D3D9_CONVERSION_FORMAT_INFO conversionFormat,
|
||||
const Rc<DxvkImage>& dstImage,
|
||||
@ -43,9 +45,13 @@ namespace dxvk {
|
||||
|
||||
Rc<DxvkShader> InitShader(SpirvCodeBuffer code);
|
||||
|
||||
void FlushInternal();
|
||||
|
||||
Rc<DxvkDevice> m_device;
|
||||
Rc<DxvkContext> m_context;
|
||||
|
||||
size_t m_transferCommands = 0;
|
||||
|
||||
std::array<Rc<DxvkShader>, D3D9ConversionFormat_Count> m_shaders;
|
||||
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user