Merge pull request #8012 from stenzek/bounding-box-shaders
PixelShaderGen: Don't emit bounding box shader code for old UIDs when disabled
This commit is contained in:
commit
5b4ebccf6b
|
@ -347,6 +347,10 @@ void ClearUnusedPixelShaderUidBits(APIType ApiType, const ShaderHostConfig& host
|
||||||
// uint output when logic op is not supported (i.e. driver/device does not support D3D11.1).
|
// uint output when logic op is not supported (i.e. driver/device does not support D3D11.1).
|
||||||
if (ApiType != APIType::D3D || !host_config.backend_logic_op)
|
if (ApiType != APIType::D3D || !host_config.backend_logic_op)
|
||||||
uid_data->uint_output = 0;
|
uid_data->uint_output = 0;
|
||||||
|
|
||||||
|
// If bounding box is enabled when a UID cache is created, then later disabled, we shouldn't
|
||||||
|
// emit the bounding box portion of the shader.
|
||||||
|
uid_data->bounding_box &= host_config.bounding_box;
|
||||||
}
|
}
|
||||||
|
|
||||||
void WritePixelShaderCommonHeader(ShaderCode& out, APIType ApiType, u32 num_texgens,
|
void WritePixelShaderCommonHeader(ShaderCode& out, APIType ApiType, u32 num_texgens,
|
||||||
|
|
|
@ -641,6 +641,7 @@ const AbstractPipeline* ShaderCache::InsertGXPipeline(const GXPipelineUid& confi
|
||||||
auto& entry = m_gx_pipeline_cache[config];
|
auto& entry = m_gx_pipeline_cache[config];
|
||||||
entry.second = false;
|
entry.second = false;
|
||||||
if (!entry.first && pipeline)
|
if (!entry.first && pipeline)
|
||||||
|
{
|
||||||
entry.first = std::move(pipeline);
|
entry.first = std::move(pipeline);
|
||||||
|
|
||||||
if (g_ActiveConfig.bShaderCache)
|
if (g_ActiveConfig.bShaderCache)
|
||||||
|
@ -654,6 +655,7 @@ const AbstractPipeline* ShaderCache::InsertGXPipeline(const GXPipelineUid& confi
|
||||||
static_cast<u32>(cache_data.size()));
|
static_cast<u32>(cache_data.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return entry.first.get();
|
return entry.first.get();
|
||||||
}
|
}
|
||||||
|
@ -665,6 +667,7 @@ ShaderCache::InsertGXUberPipeline(const GXUberPipelineUid& config,
|
||||||
auto& entry = m_gx_uber_pipeline_cache[config];
|
auto& entry = m_gx_uber_pipeline_cache[config];
|
||||||
entry.second = false;
|
entry.second = false;
|
||||||
if (!entry.first && pipeline)
|
if (!entry.first && pipeline)
|
||||||
|
{
|
||||||
entry.first = std::move(pipeline);
|
entry.first = std::move(pipeline);
|
||||||
|
|
||||||
if (g_ActiveConfig.bShaderCache)
|
if (g_ActiveConfig.bShaderCache)
|
||||||
|
@ -678,6 +681,7 @@ ShaderCache::InsertGXUberPipeline(const GXUberPipelineUid& config,
|
||||||
static_cast<u32>(cache_data.size()));
|
static_cast<u32>(cache_data.size()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return entry.first.get();
|
return entry.first.get();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue