xenia-project / xenia

Xbox 360 Emulator Research Project
https://xenia.jp
Other
8.28k stars 1.14k forks source link

[D3D12] RTV pipeline creation: depth_bias_slope_scaled - memory leak/performance issue #2253

Open Gliniak opened 8 months ago

Gliniak commented 8 months ago

Validation

Describe what's going wrong

GetCurrentStateDescription in pipeline_cache.cc creates PipelineRuntimeDescription which in case of RTV uses GetPreferredFacePolygonOffset to generate depth_bias_slope_scaled. This is a problem because for some calls this is executed with different register values which causes to generate multiple pipelines for the same shader that will never be use again.

Test cases: https://github.com/xenia-project/game-compatibility/issues/52 https://github.com/xenia-project/game-compatibility/issues/21

In case of first test case values (from registers) are quite small: 0.0001 - 0.0000001 For second one they're quite huge: 10-150

Describe what should happen

No idea

If applicable, provide a callstack here, especially for crashes

No response

If applicable, upload a logfile and link it here

No response