Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge branch 'perfqueries'.
Adds support for PE performance metrics. Used in Super Mario Sunshine's "Scrubbing Sirena Beach" level to determine when enough goop has been cleaned up to finish the level. Also used in TimeSplitters: Future Perfect to determine the appearance of flares around light sources (e.g. sun). OpenGL and D3D11 only. D3D9 support unlikely to be added unless anyone bothers to do the work. Initial work and D3D11 support by me. Kudos go to Billiard for adding the OpenGL support and reviving development of this branch that way :D Slightly (~7%) decreases performance when performance metrics are used (and only then). Fixes issue 1498. Fixes issue 5368.
- Loading branch information
Showing
38 changed files
with
736 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,3 @@ | ||
| #include "PerfQueryBase.h" | ||
|
|
||
| PerfQueryBase* g_perf_query = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,54 @@ | ||
| #ifndef _PERFQUERY_BASE_H_ | ||
| #define _PERFQUERY_BASE_H_ | ||
|
|
||
| #include "CommonTypes.h" | ||
|
|
||
| enum PerfQueryType | ||
| { | ||
| PQ_ZCOMP_INPUT_ZCOMPLOC = 0, | ||
| PQ_ZCOMP_OUTPUT_ZCOMPLOC, | ||
| PQ_ZCOMP_INPUT, | ||
| PQ_ZCOMP_OUTPUT, | ||
| PQ_BLEND_INPUT, | ||
| PQ_EFB_COPY_CLOCKS, | ||
| PQ_NUM_MEMBERS | ||
| }; | ||
|
|
||
| enum PerfQueryGroup | ||
| { | ||
| PQG_ZCOMP_ZCOMPLOC, | ||
| PQG_ZCOMP, | ||
| PQG_EFB_COPY_CLOCKS, | ||
| PQG_NUM_MEMBERS, | ||
| }; | ||
|
|
||
| class PerfQueryBase | ||
| { | ||
| public: | ||
| PerfQueryBase() {}; | ||
| virtual ~PerfQueryBase() {} | ||
|
|
||
| // Begin querying the specified value for the following host GPU commands | ||
| virtual void EnableQuery(PerfQueryGroup type) {} | ||
|
|
||
| // Stop querying the specified value for the following host GPU commands | ||
| virtual void DisableQuery(PerfQueryGroup type) {} | ||
|
|
||
| // Reset query counters to zero and drop any pending queries | ||
| virtual void ResetQuery() {} | ||
|
|
||
| // Return the measured value for the specified query type | ||
| // NOTE: Called from CPU thread | ||
| virtual u32 GetQueryResult(PerfQueryType type) { return 0; } | ||
|
|
||
| // Request the value of any pending queries - causes a pipeline flush and thus should be used carefully! | ||
| virtual void FlushResults() {} | ||
|
|
||
| // True if there are no further pending query results | ||
| // NOTE: Called from CPU thread | ||
| virtual bool IsFlushed() const { return true; } | ||
| }; | ||
|
|
||
| extern PerfQueryBase* g_perf_query; | ||
|
|
||
| #endif // _PERFQUERY_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.