mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-18 23:43:23 +09:00
[Fix] (Pipe): avalanche the composite shutter mix so dirty bits stop colliding
This commit is contained in:
@@ -33,6 +33,7 @@
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_Util/Metrics/PipeStats.h>
|
||||
|
||||
#include <algorithm>
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
@@ -46,6 +47,29 @@ namespace {
|
||||
EXPECT_EQ(kMGPipeSubsystemsMigratedAtP2 & kMGPipeBehaviourNoCsoContentAddressing, 0ull);
|
||||
}
|
||||
|
||||
// A composite shutter is only as good as its mix: a collision is a missed fire. The pairs
|
||||
// below collided under the hash_combine step the mix used to be - the second one on a
|
||||
// phone, the third is bit 12's (bind generation, program units) pair that left a draw
|
||||
// sampling the previous unit set's texture.
|
||||
TEST(Tracker, ShutterMixSeparatesSmallCounterPairs) {
|
||||
EXPECT_NE(MGPipeMixShutter(1, 64), MGPipeMixShutter(2, 1));
|
||||
EXPECT_NE(MGPipeMixShutter(174, 37), MGPipeMixShutter(48, 8026));
|
||||
const auto bit12 = [](Uint64 content, Uint64 params, Uint64 bind, Uint64 units) {
|
||||
return MGPipeMixShutter(MGPipeMixShutter(MGPipeMixShutter(content, params), bind), units);
|
||||
};
|
||||
Vector<Uint64> seen;
|
||||
for (Uint64 content = 0; content < 4; ++content)
|
||||
for (Uint64 params = 0; params < 40; ++params)
|
||||
for (Uint64 bind = 0; bind < 16; ++bind)
|
||||
for (Uint64 program = 1; program < 8; ++program)
|
||||
for (Uint64 version = 0; version < 8; ++version) {
|
||||
seen.push_back(bit12(content, params, bind, MGPipeMixShutter(program, version)));
|
||||
}
|
||||
std::sort(seen.begin(), seen.end());
|
||||
EXPECT_EQ(std::adjacent_find(seen.begin(), seen.end()), seen.end())
|
||||
<< "two distinct small states share a shutter value";
|
||||
}
|
||||
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
|
||||
using MG_State::GLState::TextureObjectBase;
|
||||
|
||||
@@ -24,8 +24,8 @@
|
||||
21 ResourceSubData 104 592591476e1de3eb
|
||||
22 ResourceRespecify 88 d2ea8273d6969816
|
||||
23 CreateSamplerView 36 92735167665158b2
|
||||
24 SetSamplerViews 40 ff12d52ac483fd59
|
||||
25 BindSamplerStates 24 8ec570815d8132c4
|
||||
24 SetSamplerViews 40 cdfff376ce9850d7
|
||||
25 BindSamplerStates 24 c15219323b7a40b1
|
||||
26 SetGlobalConstants 56 3a08c059ed3fb509
|
||||
27 CreateRenderState 444 cbaa7e1b0c8f56b0
|
||||
28 BindRenderState 12 2df0851678bfe6a3
|
||||
@@ -36,7 +36,7 @@
|
||||
33 SetContextValues 96 8d24acac68829781
|
||||
34 CreateVertexElements 1320 1e6a49d992827735
|
||||
35 BindVertexElements 16 b110667323a9f265
|
||||
36 SetVertexBuffers 56 98392787becb775d
|
||||
36 SetVertexBuffers 56 776e3b47bef003ea
|
||||
37 SetIndexBuffer 24 8b038a41009b3de1
|
||||
38 DrawVbo 68 f68b4c81a25b7c80
|
||||
39 DrawVbo 68 bfcdfb6905f6a2e0
|
||||
|
||||
Reference in New Issue
Block a user