mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-09-12 14:18:31 +09:00
[Fix] (Pipe): count the render-state CSO binds the cache has always declared and never incremented
- Counters::Binds was declared, documented as one of the three numbers P13's capacity retune reads, and incremented nowhere: the retune would have read a permanent zero, and the unit tests counted binds in a local of their own - counted in Acquire, which has exactly one caller and is followed by a bind_render_state every time, so the count cannot drift from the emitter forgetting to tick it
This commit is contained in:
@@ -56,7 +56,13 @@ namespace MobileGL::MG_Pipe {
|
|||||||
public:
|
public:
|
||||||
struct Counters {
|
struct Counters {
|
||||||
Uint64 Mints = 0; // create_render_state emissions
|
Uint64 Mints = 0; // create_render_state emissions
|
||||||
Uint64 Binds = 0; // bind_render_state emissions, mint or reuse
|
// bind_render_state emissions, mint or reuse. Counted in Acquire because Acquire
|
||||||
|
// has exactly ONE caller (PipeFill.cpp's EmitRenderState) and that caller binds
|
||||||
|
// immediately after every call - so "acquisitions" and "binds" are the same
|
||||||
|
// number, and counting it here keeps the count from depending on an emitter
|
||||||
|
// remembering to tick it. mints/binds is the cache's hit rate and it is the
|
||||||
|
// number the CSO content-addressing negative control moves.
|
||||||
|
Uint64 Binds = 0;
|
||||||
Uint64 Hits = 0; // a probe that found a live entry and passed the memcmp
|
Uint64 Hits = 0; // a probe that found a live entry and passed the memcmp
|
||||||
Uint64 Collisions = 0; // a hash hit the memcmp REJECTED - the reason it exists
|
Uint64 Collisions = 0; // a hash hit the memcmp REJECTED - the reason it exists
|
||||||
Uint64 Evictions = 0; // LRU evictions, each one a delete_render_state
|
Uint64 Evictions = 0; // LRU evictions, each one a delete_render_state
|
||||||
@@ -68,6 +74,7 @@ namespace MobileGL::MG_Pipe {
|
|||||||
MGPipeHandle Acquire(const RenderStateParameters& params, Uint64& payloadBytes) {
|
MGPipeHandle Acquire(const RenderStateParameters& params, Uint64& payloadBytes) {
|
||||||
Array<Uint8, kMGPipePipelineChunkBytes> bytes;
|
Array<Uint8, kMGPipePipelineChunkBytes> bytes;
|
||||||
MGPipeGatherPipelineBytes(params, bytes.data());
|
MGPipeGatherPipelineBytes(params, bytes.data());
|
||||||
|
++m_counters.Binds;
|
||||||
|
|
||||||
const Bool contentAddressed =
|
const Bool contentAddressed =
|
||||||
(MG_Config::Features.PipePush & kMGPipeBehaviourNoCsoContentAddressing) == 0;
|
(MG_Config::Features.PipePush & kMGPipeBehaviourNoCsoContentAddressing) == 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user