Fix PSO init to release old data on recreation
This commit is contained in:
@@ -31,7 +31,8 @@ bool GPUPipelineStateDX11::IsValid() const
|
||||
|
||||
bool GPUPipelineStateDX11::Init(const Description& desc)
|
||||
{
|
||||
ASSERT(!IsValid());
|
||||
if (IsValid())
|
||||
OnReleaseGPU();
|
||||
|
||||
// Cache shaders
|
||||
VS = (GPUShaderProgramVSDX11*)desc.VS;
|
||||
|
||||
@@ -135,7 +135,8 @@ void GPUPipelineStateDX12::OnReleaseGPU()
|
||||
|
||||
bool GPUPipelineStateDX12::Init(const Description& desc)
|
||||
{
|
||||
ASSERT(!IsValid());
|
||||
if (IsValid())
|
||||
OnReleaseGPU();
|
||||
|
||||
// Create description
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC psDesc;
|
||||
|
||||
@@ -355,7 +355,8 @@ bool GPUPipelineStateVulkan::IsValid() const
|
||||
|
||||
bool GPUPipelineStateVulkan::Init(const Description& desc)
|
||||
{
|
||||
ASSERT(!IsValid());
|
||||
if (IsValid())
|
||||
OnReleaseGPU();
|
||||
|
||||
// Reset description
|
||||
RenderToolsVulkan::ZeroStruct(_desc, VK_STRUCTURE_TYPE_GRAPHICS_PIPELINE_CREATE_INFO);
|
||||
|
||||
Reference in New Issue
Block a user