[GPU] Resolved memory leak in RTV in pipeline creation
This commit is contained in:
parent
34ed823bfc
commit
e8dbb65fc1
|
@ -1044,6 +1044,15 @@ bool PipelineCache::ConfigurePipeline(
|
||||||
bound_depth_and_color_render_target_formats, runtime_description)) {
|
bound_depth_and_color_render_target_formats, runtime_description)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Due to hashing below and value variance in some titles (4D53085B) we must
|
||||||
|
// ignore it during hash calculation. Otherwise it would cause huge stuttering
|
||||||
|
// and memory leakage.
|
||||||
|
const float depth_bias_slope_scaled =
|
||||||
|
runtime_description.description.depth_bias_slope_scaled;
|
||||||
|
|
||||||
|
runtime_description.description.depth_bias_slope_scaled = 0.0f;
|
||||||
|
|
||||||
PipelineDescription& description = runtime_description.description;
|
PipelineDescription& description = runtime_description.description;
|
||||||
|
|
||||||
if (current_pipeline_ != nullptr &&
|
if (current_pipeline_ != nullptr &&
|
||||||
|
@ -1071,8 +1080,12 @@ bool PipelineCache::ConfigurePipeline(
|
||||||
std::memcpy(&new_pipeline->description, &runtime_description,
|
std::memcpy(&new_pipeline->description, &runtime_description,
|
||||||
sizeof(runtime_description));
|
sizeof(runtime_description));
|
||||||
pipelines_.emplace(hash, new_pipeline);
|
pipelines_.emplace(hash, new_pipeline);
|
||||||
|
|
||||||
COUNT_profile_set("gpu/pipeline_cache/pipelines", pipelines_.size());
|
COUNT_profile_set("gpu/pipeline_cache/pipelines", pipelines_.size());
|
||||||
|
|
||||||
|
runtime_description.description.depth_bias_slope_scaled =
|
||||||
|
depth_bias_slope_scaled;
|
||||||
|
|
||||||
if (!creation_threads_.empty()) {
|
if (!creation_threads_.empty()) {
|
||||||
// Submit the pipeline for creation to any available thread.
|
// Submit the pipeline for creation to any available thread.
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue