mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-16 06:23:23 +09:00
[Test] (P13 W3b): strip the push/legacy-memo guards and the pull skip stubs from the tests
This commit is contained in:
@@ -10,7 +10,6 @@
|
||||
|
||||
#if defined(MGITEST_SPLIT_RUNTIME_PEEK) && !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Backend/MGPipe/PipeInputs.h>
|
||||
#include <MG_Impl/Pipe/PipeFill.h>
|
||||
// The serials live behind FilledState(), which exists only where the poison build flag is on -
|
||||
@@ -20,7 +19,6 @@
|
||||
#define MGITEST_DUAL_BLOCK_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -10,13 +10,11 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Pipe/MGPipeTypes.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_Util/Metrics/PipeStats.h>
|
||||
#define MGITEST_P4A_FINALFIX_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -10,14 +10,12 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_Backend/DirectGLES/Managers.h>
|
||||
#include <MG_Backend/DirectGLES/DirectGLES.h>
|
||||
#define MGITEST_P4A_SEAM_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
namespace MGITest {
|
||||
|
||||
bool PeekSeparateClientMapStats(unsigned long long* acquisitions, unsigned long long* pushedBytes) {
|
||||
#if defined(MGITEST_PERSISTENT_MAP_PEEK_LIVE) && MOBILEGL_BUILD_DISAGGREGATED && MOBILEGL_PIPE_PUSH
|
||||
#if defined(MGITEST_PERSISTENT_MAP_PEEK_LIVE) && MOBILEGL_BUILD_DISAGGREGATED
|
||||
if (MobileGL::MG_Config::Transport != MobileGL::MG_Config::TransportMode::Spawn) return false;
|
||||
namespace Stats = MobileGL::MG_Util::PipeStats;
|
||||
*acquisitions = Stats::TotalCalls(Stats::CallClass::MapPersistentRoundtrips);
|
||||
|
||||
@@ -10,7 +10,6 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_Pipe/MGPipeTypes.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
@@ -25,7 +24,6 @@
|
||||
#endif
|
||||
#define MGITEST_PIPE_APPLY_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/SlotAllocator.h>
|
||||
#define MGITEST_PIPE_SLOT_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/TextureEmit.h>
|
||||
#define MGITEST_TEXTURE_EMIT_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -10,11 +10,9 @@
|
||||
|
||||
#if !defined(__ANDROID__)
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Util/Metrics/PipeStats.h>
|
||||
#define MGITEST_WIRE_INDIRECT_PEEK_LIVE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
namespace MGITest {
|
||||
|
||||
|
||||
@@ -43,9 +43,7 @@
|
||||
#include <MG_Backend/DirectGLES/Managers.h>
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/PipeFill.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -150,7 +148,6 @@ TEST(SubsystemDepsTest, TheFourthRowIsPresentAndTheWithdrawnMirrorPairIsNotFine)
|
||||
// disagreement means records crossing to a server whose matching handle arm did not come up.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
TEST(SubsystemDepsTest, TheClientNeverEmitsAFamilyTheTableRefuses) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
const Uint64 families[] = {kMGPipeSubsystemFramebuffer, kMGPipeSubsystemTextureResources,
|
||||
kMGPipeSubsystemSamplers, kMGPipeSubsystemPrograms};
|
||||
int emitted = 0;
|
||||
@@ -174,9 +171,6 @@ TEST(SubsystemDepsTest, TheClientNeverEmitsAFamilyTheTableRefuses) {
|
||||
// asserted, because asserting it would make this case depend on whether the binary happens
|
||||
// to have pulled in a consumer registration.
|
||||
RecordProperty("client_emitting_combinations", emitted);
|
||||
#else
|
||||
GTEST_SKIP() << "the client dependency check is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
@@ -189,7 +183,6 @@ TEST(SubsystemDepsTest, TheClientNeverEmitsAFamilyTheTableRefuses) {
|
||||
// disagreement is a half-run subsystem rather than an extra refusal.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
TEST(SubsystemDepsTest, TheServerConsumerGateNeverArmsAFamilyTheTableRefuses) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using namespace MobileGL::MG_Backend::DirectGLES;
|
||||
// THE RESOLVERS SURVIVE A SWEEP ONLY BECAUSE LEGACY MEMOS ARE ON. Each of them ends in
|
||||
// ClassifyPipeSubsystemArm, and a verdict of NoArm calls StopOnArmlessPipeSubsystem
|
||||
@@ -233,11 +226,6 @@ TEST(SubsystemDepsTest, TheServerConsumerGateNeverArmsAFamilyTheTableRefuses) {
|
||||
<< resolver.Name << " armed with its own bit clear at " << Describe(mask);
|
||||
}
|
||||
}
|
||||
#else
|
||||
GTEST_SKIP() << "the four Resolve<Family>SubsystemArm() resolvers are declared and defined "
|
||||
"only under MOBILEGL_PIPE_PUSH (Managers.h's P4a D-K3 block), so the pull "
|
||||
"build has no server consumer gate to compare against";
|
||||
#endif
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
@@ -245,7 +233,6 @@ TEST(SubsystemDepsTest, TheServerConsumerGateNeverArmsAFamilyTheTableRefuses) {
|
||||
// vacuously green because every resolver said NO for an unrelated reason.
|
||||
// ---------------------------------------------------------------------------------------------
|
||||
TEST(SubsystemDepsTest, TheTwoDocumentedRefusalLanesStillRefuseAndTheFullMaskStillArms) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using namespace MobileGL::MG_Backend::DirectGLES;
|
||||
ASSERT_TRUE(MG_Config::Features.PipeLegacyMemos)
|
||||
<< "see the sweep above: a refused family with the legacy arm also off aborts the process";
|
||||
@@ -281,8 +268,4 @@ TEST(SubsystemDepsTest, TheTwoDocumentedRefusalLanesStillRefuseAndTheFullMaskSti
|
||||
EXPECT_FALSE(ResolveTextureResourceSubsystemArm())
|
||||
<< "0x5ff leaves bit 11 clear too, so the fourth row refuses it for the same reason";
|
||||
}
|
||||
#else
|
||||
GTEST_SKIP() << "the four Resolve<Family>SubsystemArm() resolvers exist only under "
|
||||
"MOBILEGL_PIPE_PUSH";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -15,9 +15,7 @@
|
||||
#include "Init.h"
|
||||
#include <Config.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#endif
|
||||
|
||||
#include <MG_Impl/GLImpl/Buffer/GL_Buffer.h>
|
||||
#include <MG_Impl/GetProcAddress.h>
|
||||
@@ -1658,20 +1656,14 @@ namespace {
|
||||
struct ScopedBackendOps {
|
||||
explicit ScopedBackendOps(const MG_State::GLState::BufferBackendOps* ops) {
|
||||
MG_State::GLState::SetBufferBackendOps(ops);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
m_savedResourceOps = MG_Pipe::MGPipeGetResourceOps();
|
||||
MG_Pipe::MGPipeSetResourceOps(nullptr);
|
||||
#endif
|
||||
}
|
||||
~ScopedBackendOps() {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MG_Pipe::MGPipeSetResourceOps(m_savedResourceOps);
|
||||
#endif
|
||||
MG_State::GLState::SetBufferBackendOps(nullptr);
|
||||
}
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
const MG_Pipe::MGPipeResourceOps* m_savedResourceOps = nullptr;
|
||||
#endif
|
||||
};
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -23,9 +23,7 @@
|
||||
#include <MG_State/GLState/TextureState/TextureState.h>
|
||||
#include <MG_Util/Metrics/PipeStats.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Backend/DirectGLES/Managers.h>
|
||||
#endif
|
||||
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#include <MG_Remote/Client/GpuWritePending.h>
|
||||
@@ -811,7 +809,6 @@ TEST(SplitBufferSet, AFaultedMapTheDrawDidNotBindStillShipsBeforeTheDrawThatDoes
|
||||
// (a SEG_STAGE snapshot that no longer matches the queued range).
|
||||
// =====================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
using MobileGL::MG_Backend::DirectGLES::BufferImpl::InvalidateFlushAccessFor;
|
||||
using MobileGL::MG_Backend::DirectGLES::BufferImpl::kEsprytInvalidateRangeMinBytes;
|
||||
@@ -871,17 +868,3 @@ TEST(EsprytFlushLadder, APartialRangeDoesNotOvertakeAQueuedRingCopy) {
|
||||
static_cast<GLbitfield>(GL_MAP_WRITE_BIT | GL_MAP_INVALIDATE_BUFFER_BIT))
|
||||
<< "the whole-buffer orphan-map rewrites every byte from the shadow the copies were taken from";
|
||||
}
|
||||
#else
|
||||
// The same six names in a pull build, for the G2/G14 reason above: the ladder's push arm
|
||||
// (FlushPendingRangesFrom) is the only one that carries this decision as a function - the pull
|
||||
// arm's FlushPendingRangesNow is byte-frozen against 5cb826b0 (ID-15) and may not grow one.
|
||||
#define MGL_PUSH_ONLY_OR_SKIP() \
|
||||
GTEST_SKIP() << "the three-tier ladder's push arm (FlushPendingRangesFrom) is what carries " \
|
||||
"InvalidateFlushAccessFor; a pull build compiles the frozen arm instead"
|
||||
TEST(EsprytFlushLadder, AWholeBufferRangeOrphansTheStore) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
TEST(EsprytFlushLadder, ALargePartialRangeInvalidatesExactlyThatRange) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
TEST(EsprytFlushLadder, ASmallPartialRangeFallsThroughToTheStagingRing) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
TEST(EsprytFlushLadder, AMapWiderThanTheQueuedRangeRefusesTierOne) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
TEST(EsprytFlushLadder, AnEmptyRangeIsNeverTierOne) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
TEST(EsprytFlushLadder, APartialRangeDoesNotOvertakeAQueuedRingCopy) { MGL_PUSH_ONLY_OR_SKIP(); }
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include "Init.h"
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
@@ -69,7 +68,6 @@
|
||||
// create_shader_state takes the two artefact structs by pointer beside the record, so a case
|
||||
// that mints a composite record needs their definitions.
|
||||
#include <MG_State/GLState/ProgramState/ProgramArtifacts.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -85,7 +83,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// `from` is a byte offset, and it exists because of the fork below: the library's log file
|
||||
// is already open by the time a case runs, so the child's lines are APPENDED to it rather
|
||||
// than written to a fresh file, and only what the child appended is this drive's evidence.
|
||||
@@ -186,7 +183,6 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// The contract commit's one case, and it pins the property everything else in this suite is
|
||||
@@ -196,7 +192,6 @@ namespace {
|
||||
// flag on the handle buys, and what keeps the resolver's lifetime bookkeeping out of the
|
||||
// ordinary program allocator.
|
||||
TEST(CompositeResolver, TheCompositeBandHasExactlyOneDoor) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPipeSlotAllocator slots;
|
||||
|
||||
// The ordinary door never opens onto the band, however many times it is used.
|
||||
@@ -232,9 +227,6 @@ TEST(CompositeResolver, TheCompositeBandHasExactlyOneDoor) {
|
||||
EXPECT_EQ(recycled.Slot, composite.Slot);
|
||||
EXPECT_NE(recycled.Gen, composite.Gen);
|
||||
EXPECT_FALSE(MGPipeIsCompositeShaderSlot(slots.Allocate(MGPipeKind::ShaderCso).Slot));
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client slot allocator in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================================================================
|
||||
@@ -249,7 +241,6 @@ TEST(CompositeResolver, TheCompositeBandHasExactlyOneDoor) {
|
||||
// spike on the first pipeline draw. Both spaces stay dense against their own high-water mark.
|
||||
// =========================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
using MG_State::GLState::LinkArtifacts;
|
||||
using MG_State::GLState::SpirvArtifacts;
|
||||
@@ -265,15 +256,11 @@ namespace {
|
||||
return MGPHandleOnly{cso, static_cast<Uint32>(MGPipeKind::ShaderCso), 0};
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
// The band's record lands in the band's own table and the ordinary one is not grown by it -
|
||||
// which is the whole 236 MB of it - and every entry point still names it as an ordinary
|
||||
// program.
|
||||
TEST(CompositeResolver, ACompositeRecordLandsInTheBandsOwnTableAndNeverGrowsTheOrdinaryOne) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -304,7 +291,6 @@ TEST(CompositeResolver, ACompositeRecordLandsInTheBandsOwnTableAndNeverGrowsTheO
|
||||
EXPECT_EQ(MGPipeApplier().ShaderCsos[2].Desc.StageMask, 0x7u);
|
||||
EXPECT_EQ(MGPipeApplier().CompositeShaderCsos[2].Desc.StageMask, 0x3u)
|
||||
<< "an ordinary program at slot 2 wrote the composite at band index 2";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The composite's slot has TWO independent release paths - the pipeline cache's eviction and
|
||||
@@ -312,9 +298,6 @@ TEST(CompositeResolver, ACompositeRecordLandsInTheBandsOwnTableAndNeverGrowsTheO
|
||||
// arrival here is a refused no-op, which is what makes the double free proven rather than
|
||||
// assumed, and it clears the bindings exactly once.
|
||||
TEST(CompositeResolver, ASecondDeleteOfACompositeIsARefusedNoOpRatherThanASecondRelease) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -342,16 +325,12 @@ TEST(CompositeResolver, ASecondDeleteOfACompositeIsARefusedNoOpRatherThanASecond
|
||||
EXPECT_TRUE(MGPipeApplier().CompositeShaderCsos[0].Live);
|
||||
EXPECT_EQ(MGPipeApplier().CompositeShaderCsos[0].Gen, 4u);
|
||||
EXPECT_EQ(MGPipeApplier().CompositeShaderCsos[0].Serial, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The band is INSIDE the ShaderCso slot limit, so the bound the applier refuses at is the limit
|
||||
// itself and not the band's base - a bound below it would refuse the very slots the allocator's
|
||||
// one composite door is allowed to hand out.
|
||||
TEST(CompositeResolver, ASlotAtTheShaderCsoLimitIsRefusedWhileTheLastBandSlotIsNot) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -375,26 +354,8 @@ TEST(CompositeResolver, ASlotAtTheShaderCsoLimitIsRefusedWhileTheLastBandSlotIsN
|
||||
MGPipeApplySetDrawProgram(ProgramHandle(MGPipeHandle{kMGPipeShaderCsoCompositeSlotBase - 1, 1}));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 1u)
|
||||
<< "an ordinary slot below the band resolved against a record nobody created";
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 requires the pull and push ctest name sets to be identical, name for name.
|
||||
#define MGL_COMPOSITE_RESOLVER_TEST_LIST(X) \
|
||||
X(CompositeResolver, ACompositeIsMintedFromTheReservedBand) \
|
||||
X(CompositeResolver, ASignatureThatHasNotMovedReusesOneComposite) \
|
||||
X(CompositeResolver, TwoPipelinesWithTheSameSignatureKeepTheirOwnComposite) \
|
||||
X(CompositeResolver, EvictionThenDestructionFreesTheSlotExactlyOnce) \
|
||||
X(CompositeResolver, DestructionThenEvictionFreesTheSlotExactlyOnce) \
|
||||
X(CompositeResolver, ASignatureMoveAfterAMakeCurrentStillReleasesThroughTheResolver) \
|
||||
X(CompositeResolver, TwoContextsHoldingOnePipelineNameKeepTheirOwnComposites) \
|
||||
X(CompositeResolver, ADestroyedContextsEntryIsDroppedRatherThanReleasedASecondTime)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_COMPOSITE_RESOLVER_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
|
||||
namespace {
|
||||
namespace GL = MobileGL::MG_Impl::GLImpl;
|
||||
@@ -763,7 +724,6 @@ void main() { o_color = vec4(0.5); }
|
||||
<< "the vector is bounded by the pairs whose composite slot is actually live";
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
namespace fs = std::filesystem;
|
||||
@@ -784,9 +744,7 @@ int main(int argc, char** argv) {
|
||||
// the library's own, not a copy.
|
||||
g_logPath = MobileGL::MG_Util::Debug::RoleLogPath(g_logPath.c_str(),
|
||||
MobileGL::MG_Util::Debug::LogRole::Client);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MobileGL::Initialize();
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -16,41 +16,16 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
#include <MG_Impl/Pipe/CsoCache.h>
|
||||
#include <MG_Impl/Pipe/SetHashSuppressor.h>
|
||||
#include <MG_Pipe/MGPipeRenderStateSpans.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
|
||||
namespace {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 REQUIRES THE PULL AND PUSH CTEST NAME SETS TO BE IDENTICAL, name for name. A
|
||||
// push-only case therefore cannot be ABSENT from a pull build; it has to be there and
|
||||
// SKIP, which is the shape PipeInputsTest.cpp established for the same reason. This list
|
||||
// declares exactly the suite.name pairs the push build gets from the real cases below, so
|
||||
// a case added on one side and forgotten on the other shows up as a ctest-name diff
|
||||
// rather than as a test that silently is not there.
|
||||
#define MGL_CSO_CACHE_TEST_LIST(X) \
|
||||
X(CsoCacheTest, TheSameStateIsMintedOnceAndReusedForever) \
|
||||
X(CsoCacheTest, LruEvictsTheOldestAndEmitsDelete) \
|
||||
X(CsoCacheTest, HashCollisionDoesNotAliasTwoStates) \
|
||||
X(CsoCacheTest, ContentAddressingOffMintsEveryTime) \
|
||||
X(CsoCacheTest, EveryAcquireCountsItsPayloadBytes) \
|
||||
X(SetHashSuppressorTest, TheFirstEmissionAlwaysGoesOutOnEverySlot) \
|
||||
X(SetHashSuppressorTest, AComputedZeroIsRemappedSoItIsNeverConfusedWithNeverEmitted) \
|
||||
X(SetHashSuppressorTest, SlotsAreIndependent) \
|
||||
X(SetHashSuppressorTest, InvalidateMakesTheNextSetGoOutWhateverItHashesTo)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_CSO_CACHE_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
class CsoCacheTest : public ::testing::Test {
|
||||
protected:
|
||||
void SetUp() override {
|
||||
@@ -196,5 +171,4 @@ namespace {
|
||||
suppressor.InvalidateAll();
|
||||
EXPECT_TRUE(suppressor.ShouldEmit(slot, 99));
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
@@ -40,14 +40,12 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
#include <MG_Backend/MGPipe/PipeInputs.h>
|
||||
#include <MG_Impl/Pipe/PipeFill.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_Util/Metrics/PipeStats.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <csignal>
|
||||
@@ -80,7 +78,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
|
||||
// A live frontend context, restored on the way out so the cases stay independent - the
|
||||
@@ -150,37 +147,8 @@ namespace {
|
||||
return "status " + std::to_string(r.Status);
|
||||
}
|
||||
#endif // MGTEST_HAVE_FORK
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
|
||||
TEST(FieldOwnershipTest, EveryFieldAndForwardIsInExactlyOneClass) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, TheClassSizesPartitionTheFieldSet) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, EveryBarrierPulledRowNamesTheRetiringPhase) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, TheReducedPathsUnmigratedFieldsAreAllAccountedFor) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, TheSevenStickyForwardsAgreeWithTheirFieldRows) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, VerbBoundaryOpsCoverEveryVerbShapedCall) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, TheAdmittedPullTableIsID84sDerivationAndNotAList) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(FieldOwnershipTest, TheResidualFillsSuppliedMemoReKeysOnEveryInputThatMovesAnAnswer) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
|
||||
#else // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// ---------------------------------------------------------------------------------------
|
||||
// The arithmetic: the table partitions the field set. Runs in push, verify and split.
|
||||
@@ -1094,7 +1062,6 @@ TEST_F(FieldOwnershipTest, DualBlockDoesNotArmUnderMonolithTransport) {
|
||||
|
||||
#endif // MGTEST_HAVE_FORK
|
||||
#endif // MOBILEGL_BUILD_DISAGGREGATED
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
// Before anything logs: MG_Util::Debug::InitFile() reads the variable once, on the first
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
// invisible in a push build (where it really is 0) and in a verify build (where
|
||||
@@ -75,7 +74,6 @@
|
||||
#include <MG_State/GLState/TextureState/TextureObject2DCube.h>
|
||||
|
||||
#include <algorithm>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -91,7 +89,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
std::string ReadLog() {
|
||||
// BOTH ROLES' LOGS (P6). A death test asserts that the CHILD said something; which
|
||||
// role's thread said it is not what these cases are about, and refusals raised on the
|
||||
@@ -196,7 +193,6 @@ namespace {
|
||||
state.Color[0].Kind = 1;
|
||||
return state;
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// The one case the contract commit lands, and it is not a placeholder: it pins the SHAPE every
|
||||
@@ -206,16 +202,12 @@ namespace {
|
||||
// frontend's own teardown into a pipe whose allocator has already been destroyed. One
|
||||
// allocation for the life of the process, no destructor to lose.
|
||||
TEST(FramebufferEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_EQ(&MGPipeFramebufferEmitterInstance(), &MGPipeFramebufferEmitterInstance());
|
||||
// And the family's wired-subsystem constant is either 0 or its own bit and nothing else.
|
||||
// It is 0 until this family's emitter has a body; the OR in PipeFill.cpp is what turns it
|
||||
// into the switch, so a header that set the wrong bit would switch the wrong family on.
|
||||
EXPECT_TRUE(kMGPipeWiredFramebufferSubsystem == 0 ||
|
||||
kMGPipeWiredFramebufferSubsystem == kMGPipeSubsystemFramebuffer);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client emitter in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -228,30 +220,6 @@ TEST(FramebufferEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
// conversion copying exactly one member (MGPSurface::Layered) and expects this suite to go red
|
||||
// NAMING that field, and a case that reported only "the records differ" could not answer it.
|
||||
// ============================================================================
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
#define MGL_FRAMEBUFFER_EMIT_CLIENT_TEST_LIST(X) \
|
||||
X(FramebufferEmit, EveryRecordsReadSurfaceComesFromItsOwnFramebuffersReadBuffer) \
|
||||
X(FramebufferEmit, OneObjectBoundToBothTargetsEmitsOneRecordWithTargetBoth) \
|
||||
X(FramebufferEmit, ADrawBufferChangeAloneStillMovesTheContentHash) \
|
||||
X(FramebufferEmit, ARecycledFramebufferHandleIsNeverSuppressedAgainstItsPredecessor) \
|
||||
X(FramebufferEmit, EveryAttachmentFieldSurvivesTheSurfaceConversion) \
|
||||
X(FramebufferEmit, AnAttachmentPointAboveTheWireWidthIsRefusedNotTruncated) \
|
||||
X(FramebufferEmit, ARestoragedAttachedRenderbufferPublishesItsNewExtent) \
|
||||
X(FramebufferEmit, AnUnchangedBindingPairEmitsNothing) \
|
||||
X(FramebufferEmit, AFramebufferHandedOverByNameGetsANamedRecordWithoutMovingABinding) \
|
||||
X(FramebufferEmit, ANamedRecordIsSuppressedPerObjectAndNeverAgainstABoundRecord) \
|
||||
X(FramebufferEmit, ADrawBufferTokenAboveTheWireWidthIsRefusedNotTruncated) \
|
||||
X(FramebufferEmit, ALayeredCubeAttachmentDoesNotAssertAFaceItCannotKnow) \
|
||||
X(FramebufferEmit, EveryNonTexturePointCarriesTheUnknownSentinelsRatherThanZero) \
|
||||
X(FramebufferEmit, ADeadFramebuffersNamedRecordLatchIsRetired) \
|
||||
X(FramebufferEmit, TheRecordsElevenSurfacesAreTheWholePointSetTheServerReads) \
|
||||
X(FramebufferEmit, ADefaultFramebufferResizeReEmitsTheRecordWithItsNewExtent) X(FramebufferEmit, TheDefaultFramebuffersRecordNamesNoSurfaceAShareGroupWouldHaveToHold)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_FRAMEBUFFER_EMIT_CLIENT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
namespace {
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
using MG_State::GLState::FramebufferObject;
|
||||
@@ -968,7 +936,6 @@ TEST(FramebufferEmit, ADeadFramebuffersNamedRecordLatchIsRetired) {
|
||||
EXPECT_FALSE(Framebuffers().NamedRecordIsLatched(handle))
|
||||
<< "the dead framebuffer's Named latch survived its death";
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// =========================================================================================
|
||||
// The APPLIER's half of set_framebuffer_state (the wire commits'). The emitter's half - the
|
||||
@@ -982,9 +949,6 @@ TEST(FramebufferEmit, ADeadFramebuffersNamedRecordLatchIsRetired) {
|
||||
// Both is one object bound to both and writes both. Deleting either store, or the serial bump,
|
||||
// leaves this red.
|
||||
TEST(FramebufferEmit, ADrawRecordAndAReadRecordAreKeptApartAndBothWritesBoth) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const Uint64 serialAtStart = MGPipeApplier().FramebufferSerial;
|
||||
|
||||
@@ -1029,16 +993,12 @@ TEST(FramebufferEmit, ADrawRecordAndAReadRecordAreKeptApartAndBothWritesBoth) {
|
||||
// A framebuffer has a handle but NO wire lifetime, so there is no record to refuse against
|
||||
// and this entry point never counts an object refusal.
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// A target outside the FOUR is not a target this server has, and guessing one would put a
|
||||
// draw's attachments into the read binding or the other way round. Named (3) is legal since
|
||||
// ID-19(b) and has its own case below; the first refused value is the one above it.
|
||||
TEST(FramebufferEmit, ATargetOutsideTheThreeBindingsIsRefusedNamingTheRecord) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
MGPFramebufferState bad = FramebufferRecord(MGPipeHandle{7, 4}, MGPipeFramebufferTarget::Draw, 100);
|
||||
bad.Target = static_cast<Uint8>(MGPipeFramebufferTarget::Count);
|
||||
@@ -1053,16 +1013,12 @@ TEST(FramebufferEmit, ATargetOutsideTheThreeBindingsIsRefusedNamingTheRecord) {
|
||||
<< "a refused record was written into the per-object table anyway";
|
||||
EXPECT_EQ(MGPipeApplier().FramebufferSerial, serialBefore)
|
||||
<< "a refused record must not move the serial";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The draw-buffer array is an INDEX into this record's own Color[], and -1 is NONE. An entry
|
||||
// outside that range would have the server read a colour attachment the record does not carry,
|
||||
// which is the truncation the wire width's cap refusal exists to prevent upstream.
|
||||
TEST(FramebufferEmit, ADrawBufferEntryOutsideTheRecordsOwnArrayIsRefusedRatherThanRead) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
|
||||
// The positive control first: -1 everywhere and the last legal index are both fine, so
|
||||
@@ -1089,7 +1045,6 @@ TEST(FramebufferEmit, ADrawBufferEntryOutsideTheRecordsOwnArrayIsRefusedRatherTh
|
||||
ASSERT_NE(MGPipeApplier().DrawFramebuffer(), nullptr);
|
||||
EXPECT_EQ(MGPipeApplier().DrawFramebuffer()->Width, 100u) << "a refused record was stored anyway";
|
||||
EXPECT_EQ(MGPipeApplier().FramebufferSerial, serialBefore);
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-J4, as ID-19(b) leaves it. The two framebuffer BINDINGS are per-context working state and a
|
||||
@@ -1100,9 +1055,6 @@ TEST(FramebufferEmit, ADrawBufferEntryOutsideTheRecordsOwnArrayIsRefusedRatherTh
|
||||
// already stamped into a twin that outlived the switch is not a generation at all. Restoring
|
||||
// `= 0` anywhere in the reset, or clearing the table there, leaves this red.
|
||||
TEST(FramebufferEmit, AMakeCurrentClearsBothRecordsAndAdvancesTheSerialRatherThanZeroingIt) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
MGPipeApplySetFramebufferState(FramebufferRecord(MGPipeHandle{4, 1}, MGPipeFramebufferTarget::Both, 100));
|
||||
const Uint64 serialBefore = MGPipeApplier().FramebufferSerial;
|
||||
@@ -1126,7 +1078,6 @@ TEST(FramebufferEmit, AMakeCurrentClearsBothRecordsAndAdvancesTheSerialRatherTha
|
||||
const Uint64 afterReset = MGPipeApplier().FramebufferSerial;
|
||||
MGPipeApplierReleaseObjectRecords();
|
||||
EXPECT_GT(MGPipeApplier().FramebufferSerial, afterReset);
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE TEARDOWN SCOPE DROPS THE OBJECT RECORDS, SO IT MUST DROP EVERY WORKING HANDLE THAT NAMES
|
||||
@@ -1137,9 +1088,6 @@ TEST(FramebufferEmit, AMakeCurrentClearsBothRecordsAndAdvancesTheSerialRatherTha
|
||||
// re-mints - resolves onto somebody else's record. Deleting any one of the eleven clears in
|
||||
// MGPipeApplierReleaseObjectRecords leaves this red.
|
||||
TEST(FramebufferEmit, AReleaseOfTheObjectRecordsAlsoClearsTheWorkingHandlesThatCouldNameThem) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
MGPipeApplySetFramebufferState(FramebufferRecord(MGPipeHandle{4, 1}, MGPipeFramebufferTarget::Both, 100));
|
||||
|
||||
@@ -1186,7 +1134,6 @@ TEST(FramebufferEmit, AReleaseOfTheObjectRecordsAlsoClearsTheWorkingHandlesThatC
|
||||
EXPECT_EQ(MGPipeApplier().ShaderImageStart, 0u);
|
||||
EXPECT_EQ(MGPipeApplier().ShaderImageCount, 0u);
|
||||
EXPECT_EQ(MGPipeApplier().BoundShaderImages[2].Res, kMGPipeNullHandle);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ID-19's CORRECTION, AND THE CASE THAT SAYS WHAT THE FOURTH TARGET IS FOR. Every DSA entry
|
||||
@@ -1197,9 +1144,6 @@ TEST(FramebufferEmit, AReleaseOfTheObjectRecordsAlsoClearsTheWorkingHandlesThatC
|
||||
// about the bindings: the record is written and addressable by handle, and BoundFramebuffer
|
||||
// does not move. Making the Named arm touch either binding leaves this red.
|
||||
TEST(FramebufferEmit, ANamedRecordDescribesTheFramebufferItNamesWithoutMovingEitherBinding) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
// TWO DIFFERENT FRAMEBUFFERS ON THE TWO BINDINGS FIRST, so "the bindings did not move" is an
|
||||
// assertion about values rather than about null.
|
||||
@@ -1243,7 +1187,6 @@ TEST(FramebufferEmit, ANamedRecordDescribesTheFramebufferItNamesWithoutMovingEit
|
||||
EXPECT_EQ(MGPipeApplier().DrawFramebuffer()->Width, 400u);
|
||||
EXPECT_EQ(MGPipeApplier().ReadFramebuffer()->Fbo, (MGPipeHandle{5, 2}));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// STALE-GENERATION REFUSAL, ON THE ONE TABLE WHOSE OBJECT HAS NO WIRE LIFETIME. A framebuffer is
|
||||
@@ -1254,9 +1197,6 @@ TEST(FramebufferEmit, ANamedRecordDescribesTheFramebufferItNamesWithoutMovingEit
|
||||
// reach it is an emitter defect, and it is counted APART from RefusedObjectCalls because this is
|
||||
// a read by the server's own sync path and not a call the applier refused.
|
||||
TEST(FramebufferEmit, AFramebufferHandleWhoseGenerationHasMovedOnIsRefusedRatherThanAnswered) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
MGPipeApplySetFramebufferState(FramebufferRecord(MGPipeHandle{12, 1}, MGPipeFramebufferTarget::Draw, 100));
|
||||
ASSERT_NE(MGPipeApplier().FramebufferRecordFor(MGPipeHandle{12, 1}), nullptr);
|
||||
@@ -1284,7 +1224,6 @@ TEST(FramebufferEmit, AFramebufferHandleWhoseGenerationHasMovedOnIsRefusedRather
|
||||
<< "an unbound binding or an undescribed slot was counted as a stale generation";
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 0u)
|
||||
<< "the framebuffer family may never move the object-refusal counter";
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE TWO REFUSALS THE PER-OBJECT TABLE ADDED. The null handle is what "nothing is bound" reads
|
||||
@@ -1294,9 +1233,6 @@ TEST(FramebufferEmit, AFramebufferHandleWhoseGenerationHasMovedOnIsRefusedRather
|
||||
// describes - kMGPipeDefaultFramebuffer {0,1} for the default one - so neither value is
|
||||
// producible by a correct client, which is why both are Fatal rather than counted refusals.
|
||||
TEST(FramebufferEmit, AFramebufferRecordThatNamesNoUsableHandleIsRefusedRatherThanStored) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
// The positive control first: the DEFAULT framebuffer is slot 0 at generation 1 and is
|
||||
// perfectly legal, so what follows refuses the null handle and not slot 0.
|
||||
@@ -1326,7 +1262,6 @@ TEST(FramebufferEmit, AFramebufferRecordThatNamesNoUsableHandleIsRefusedRatherTh
|
||||
EXPECT_LT(MGPipeApplier().FramebufferRecords.size(),
|
||||
static_cast<SizeT>(kMGPipeMaxFramebufferSlots))
|
||||
<< "an out-of-range slot resized the table instead of being refused";
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@@ -1344,7 +1279,6 @@ int main(int argc, char** argv) {
|
||||
#else
|
||||
setenv("MOBILEGL_LOG_FILE_PATH", g_logPath.c_str(), 1);
|
||||
#endif
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// ID-39: A BACKEND IS PRESENT, for the whole binary. Since ID-39 every P4a-family entry
|
||||
// point in MG_Pipe/PipeApply.cpp declines a record - and the client's gate in
|
||||
// MG_Impl/Pipe/PipeFill.cpp emits none at all - when no backend has registered
|
||||
@@ -1357,7 +1291,6 @@ int main(int argc, char** argv) {
|
||||
// itself are pinned in ResourceEmitTest and TextureEmitTest.
|
||||
static const MGPipeResourceOps kConsumerPresent{};
|
||||
MGPipeSetResourceOps(&kConsumerPresent);
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include "Init.h"
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
@@ -61,7 +60,6 @@
|
||||
#include <MG_Impl/Pipe/SlotAllocator.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -77,7 +75,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// `from` is a byte offset, and it exists because of the fork below: the library's log file
|
||||
// is already open by the time a case runs, so the child's lines are APPENDED to it rather
|
||||
// than written to a fresh file, and only what the child appended is this drive's evidence.
|
||||
@@ -178,20 +175,15 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// See FramebufferEmitTest's twin for why this is a shape pin rather than a placeholder.
|
||||
TEST(ImageEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_EQ(&MGPipeImageEmitterInstance(), &MGPipeImageEmitterInstance());
|
||||
// The image set has no bit of its own: set_shader_images rides the SAMPLER subsystem,
|
||||
// because the three unit sets are one family and an operator switching them off has to get
|
||||
// the whole family's legacy arm.
|
||||
EXPECT_EQ(kMGPipeMaxImageUnits, kMGPipeMaxTextureUnits);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client emitter in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================================================================
|
||||
@@ -200,7 +192,6 @@ TEST(ImageEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
// keyed on the FRONTEND sampling-resolution generation - is the client package's.
|
||||
// =========================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
// Every field carries a value of its own, and two of them are the point: InternalFormat and
|
||||
// Access are live glBindImageTexture state that the format-less image bake keys on, so a
|
||||
@@ -218,15 +209,11 @@ namespace {
|
||||
return view;
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
// The window rule, one field at a time: the entries land where the header says and nowhere
|
||||
// else, and every field of an entry survives. Deleting the copy loop, the two window
|
||||
// assignments or the serial bump leaves this red.
|
||||
TEST(ImageEmit, TheImageSetLandsInItsWindowWithEveryFieldTheShaderWasBuiltAgainst) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
// Access is a Uint8 on the wire - the client's own read/write/read-write encoding, not a
|
||||
// GL enum - and InternalFormat is the application's, which the server recasts.
|
||||
@@ -267,15 +254,11 @@ TEST(ImageEmit, TheImageSetLandsInItsWindowWithEveryFieldTheShaderWasBuiltAgains
|
||||
<< "the entry outside the new window was cleared";
|
||||
EXPECT_EQ(MGPipeApplier().SamplerViewsSerial, samplerViewsSerial)
|
||||
<< "the image set moved another set's serial; the three are independent";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The window gate, at the bound and one past it, and the null-tail arm. The image-unit space
|
||||
// is the same merged 192 the sampler units are.
|
||||
TEST(ImageEmit, AnImageWindowPastTheImageUnitSpaceIsRefusedRatherThanTruncated) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPImageView entry = ImageAt(0, 0x8058u, 2);
|
||||
|
||||
@@ -302,15 +285,11 @@ TEST(ImageEmit, AnImageWindowPastTheImageUnitSpaceIsRefusedRatherThanTruncated)
|
||||
|
||||
EXPECT_EQ(MGPipeApplier().ShaderImagesSerial, serialBefore) << "a refused set moved the serial";
|
||||
EXPECT_EQ(MGPipeApplier().ShaderImageStart, kMGPipeMaxImageUnits - 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// An EMPTY set is not a refusal: it is what a program with no image uniforms publishes, and it
|
||||
// still moves the serial, because "no images" is a state the twin has to hear about.
|
||||
TEST(ImageEmit, AnEmptySetIsAppliedRatherThanRefusedAndStillMovesTheSerial) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPImageView entry = ImageAt(0, 0x8058u, 1);
|
||||
MGPShaderImages filled{};
|
||||
@@ -324,15 +303,11 @@ TEST(ImageEmit, AnEmptySetIsAppliedRatherThanRefusedAndStillMovesTheSerial) {
|
||||
EXPECT_GT(MGPipeApplier().ShaderImagesSerial, serialBefore);
|
||||
EXPECT_EQ(MGPipeApplier().BoundShaderImages[0].InternalFormat, 0x8058u)
|
||||
<< "an empty window cleared entries it never named";
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-J4: the image set is per-context WORKING state, so a make-current takes it and ADVANCES
|
||||
// its serial rather than restarting it.
|
||||
TEST(ImageEmit, AMakeCurrentClearsTheImageSetAndAdvancesItsSerial) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPImageView entry = ImageAt(1, 0x8058u, 1);
|
||||
MGPShaderImages header{};
|
||||
@@ -347,25 +322,8 @@ TEST(ImageEmit, AMakeCurrentClearsTheImageSetAndAdvancesItsSerial) {
|
||||
EXPECT_EQ(MGPipeApplier().ShaderImageStart, 0u);
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().BoundShaderImages[1].Res));
|
||||
EXPECT_GT(MGPipeApplier().ShaderImagesSerial, serialBefore);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 requires the pull and push ctest name sets to be identical, name for name.
|
||||
#define MGL_IMAGE_EMIT_TEST_LIST(X) \
|
||||
X(ImageEmit, AZeroHighWaterMarkEmitsNothingWithoutHashing) \
|
||||
X(ImageEmit, AnAccessModeChangeAloneStillEmitsTheSet) \
|
||||
X(ImageEmit, AnInternalFormatChangeAloneStillEmitsTheSet) \
|
||||
X(ImageEmit, TheApplicationsFormatAndAccessTravelUnrecast) \
|
||||
X(ImageEmit, AnImageBoundTextureIsMarkedShaderImageBoundAtTheBind) \
|
||||
X(ImageEmit, TheBindFeedsTheImageUnitHighWaterMark) \
|
||||
X(ImageEmit, TheThreeAccessConstantsArePinnedOnBothSidesOfTheWire)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_IMAGE_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
|
||||
namespace {
|
||||
namespace GL = MobileGL::MG_Impl::GLImpl;
|
||||
@@ -685,7 +643,6 @@ void main() { imageStore(img, ivec2(0, 0), vec4(1.0)); }
|
||||
"over-approximation";
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
namespace fs = std::filesystem;
|
||||
@@ -706,9 +663,7 @@ int main(int argc, char** argv) {
|
||||
// the library's own, not a copy.
|
||||
g_logPath = MobileGL::MG_Util::Debug::RoleLogPath(g_logPath.c_str(),
|
||||
MobileGL::MG_Util::Debug::LogRole::Client);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MobileGL::Initialize();
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -40,10 +40,8 @@
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#include <MG_Pipe/MGPipeHandles.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
#include <MG_Backend/DirectVulkan/Renderer/MagmaPipeArms.h>
|
||||
#endif
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
#include <MG_Backend/DirectVulkan/Renderer/MagmaProgramSource.h>
|
||||
#endif
|
||||
@@ -51,22 +49,6 @@
|
||||
using namespace MobileGL;
|
||||
|
||||
namespace {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// The push build's case list, declared once so a case added on one side and forgotten on
|
||||
// the other shows up as a ctest-name diff rather than as a test that silently is not there
|
||||
// (the shape CsoCacheTest.cpp established).
|
||||
#define MGL_MAGMA_PIPE_IDENTITY_TEST_LIST(X) \
|
||||
X(MagmaPipeIdentityTest, AnIdleSlotIsRetiredAndReusedWithANewGeneration) \
|
||||
X(MagmaPipeIdentityTest, AReusedSlotDoesNotServeItsPredecessorsMemo) \
|
||||
X(MagmaPipeIdentityTest, TheAbaControlKnobServesTheStaleMemoAcrossAReusedSlot) \
|
||||
X(MagmaPipeIdentityTest, ALiveObjectKeepsItsSlotItsGenerationAndItsMemo) \
|
||||
X(MagmaPipeIdentityTest, AMagmaServerNeverPublishesTheRunAheadCapBit)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_MAGMA_PIPE_IDENTITY_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
using namespace MobileGL::MG_Backend::DirectVulkan;
|
||||
using MG_Pipe::MGPipeHandle;
|
||||
|
||||
@@ -244,7 +226,6 @@ namespace {
|
||||
static_assert(static_cast<Uint64>(MG_Pipe::kCapRunAheadApply) == (1ull << 10),
|
||||
"kCapRunAheadApply moved bit; CONTRACT-P5E table 0 names bit 10");
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
TEST(MagmaProgramSourceTest, ServerBindingTailsReplaceLinkTimeDefaults) {
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
|
||||
@@ -26,14 +26,12 @@
|
||||
// P4a: MGPipeUnmigratedEmulation's declaration, and the applier's records the catalogue's size
|
||||
// pins now reach. Push-only, like the translation unit that defines them - in a pull build the
|
||||
// symbol does not exist and the one case that calls it is compiled out.
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/SlotAllocator.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
// P5 R-17: the routing that INSTALLS the two tables. Included here so that the installation
|
||||
// case below states the partition deterministically rather than depending on whether some
|
||||
// other object in this particular test binary happened to drag the installer in.
|
||||
#include <MG_Pipe/PipeRoute.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -186,7 +184,6 @@ TEST(PipeCatalogue, GeneratedTablesHoldTheWholeCatalogue) {
|
||||
TEST(PipeCatalogue, UninstalledTablesAreAllNull) {
|
||||
const void* const* screen = reinterpret_cast<const void* const*>(&gMGPipeScreen);
|
||||
const void* const* context = reinterpret_cast<const void* const*>(&gMGPipeContext);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPipeInstallMonolithTables();
|
||||
// The 41 rows with no MGPipeApply* body are still null, and null still means "this
|
||||
// subsystem has not been migrated, keep pulling". Named rather than counted, because the
|
||||
@@ -213,12 +210,6 @@ TEST(PipeCatalogue, UninstalledTablesAreAllNull) {
|
||||
// tails are validated, but there is no MGPipeApplySetProgramBindings and no route - package
|
||||
// pg installs both. A null here is the contract, not an omission.
|
||||
EXPECT_EQ(gMGPipeContext.SetProgramBindings, nullptr);
|
||||
#else
|
||||
// A pull build compiles no applier and no routing, so the pre-migration statement is the
|
||||
// whole truth there and this case is the one that says so.
|
||||
for (SizeT i = 0; i < kMGPipeScreenCallCount; ++i) EXPECT_EQ(screen[i], nullptr) << i;
|
||||
for (SizeT i = 0; i < kMGPipeContextCallCount; ++i) EXPECT_EQ(context[i], nullptr) << i;
|
||||
#endif
|
||||
(void)screen;
|
||||
(void)context;
|
||||
}
|
||||
@@ -229,14 +220,12 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
|
||||
SizeT installed = 0;
|
||||
SizeT nulls = 0;
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// IDEMPOTENT, and called here on purpose: what this case observes is WHICH rows the
|
||||
// installer fills, not whether an installer ran somewhere in this binary. Leaving that to
|
||||
// ambient linkage is what made the same assertion pass in one build directory and fail in
|
||||
// another - the object file carrying a static initialiser was dropped by the linker in the
|
||||
// binaries that did not name a symbol in it.
|
||||
MGPipeInstallMonolithTables();
|
||||
#endif
|
||||
|
||||
for (SizeT i = 0; i < kMGPipeScreenCallCount; ++i) {
|
||||
if (screen[i] != nullptr) ++installed; else ++nulls;
|
||||
@@ -246,7 +235,6 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
|
||||
}
|
||||
EXPECT_EQ(installed + nulls, static_cast<SizeT>(kMGPipeCallCount));
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// 35 + 5 = 40, and the split is the honest shape of R-17 rather than an implementation
|
||||
// detail: 40 is the number of MGPipeApply* entry points PipeApply.h declares WITH A BODY
|
||||
// (37 at P5, P5c rv's set_context_values was the 38th, P5e sb's set_shader_buffers is the
|
||||
@@ -304,12 +292,6 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
|
||||
// P5e's set_program_bindings (CONTRACT-P5E.md §1): catalogued with a null route until pg
|
||||
// installs the applier entry point and the adapter beside it.
|
||||
EXPECT_EQ(gMGPipeContext.SetProgramBindings, nullptr);
|
||||
#else
|
||||
// A pull build compiles no applier and no routing, so the pre-migration statement is still
|
||||
// the whole truth there.
|
||||
EXPECT_EQ(installed, 0u);
|
||||
EXPECT_EQ(nulls, static_cast<SizeT>(kMGPipeCallCount));
|
||||
#endif
|
||||
}
|
||||
|
||||
// The retirement ratchet of the migration carrier (section 6.3): the constant and the
|
||||
@@ -1498,11 +1480,9 @@ TEST(PipeCatalogue, EveryUnmigratedEmulationIsNamedOnce) {
|
||||
EXPECT_STRNE(kNames[i], kNames[j]);
|
||||
}
|
||||
}
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// In monolith it really is a no-op: calling it changes nothing and returns nothing. The
|
||||
// teeth are a split server's, and the call site is what P8 gives them to.
|
||||
for (const char* name : kNames) MGPipeUnmigratedEmulation(name);
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE ShaderCso COMPOSITE BAND IS A SECOND SPACE, AND THE ALLOCATOR REPORTS IT SEPARATELY.
|
||||
@@ -1521,7 +1501,6 @@ TEST(PipeCatalogue, EveryUnmigratedEmulationIsNamedOnce) {
|
||||
// This case pins both halves: a leaked COMPOSITE moves the band's marks and not the ordinary
|
||||
// one, and an ordinary leak still moves the ordinary mark with a composite outstanding.
|
||||
TEST(PipeCatalogue, TheCompositeShaderBandIsCountedApartFromTheOrdinarySpace) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPipeSlotAllocator slots;
|
||||
|
||||
const Uint32 ordinaryBefore = slots.HighWater(MGPipeKind::ShaderCso);
|
||||
@@ -1561,7 +1540,4 @@ TEST(PipeCatalogue, TheCompositeShaderBandIsCountedApartFromTheOrdinarySpace) {
|
||||
EXPECT_EQ(slots.CompositeHighWater(), kMGPipeShaderCsoCompositeSlotBase + 1u);
|
||||
EXPECT_EQ(slots.HighWater(MGPipeKind::ShaderCso), ordinaryHighWater);
|
||||
EXPECT_EQ(slots.LiveCount(MGPipeKind::ShaderCso), 1u);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client slot allocator in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -30,12 +30,10 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
#include <MG_Backend/MGPipe/PipeInputs.h>
|
||||
#include <MG_Impl/Pipe/PipeFill.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32)
|
||||
#include <csignal>
|
||||
@@ -68,7 +66,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
|
||||
// A live frontend context for the filler to read (SanityTest's idiom), restored on the
|
||||
@@ -130,58 +127,8 @@ namespace {
|
||||
return "status " + std::to_string(r.Status);
|
||||
}
|
||||
#endif // MGTEST_HAVE_FORK
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
|
||||
TEST(PipeInputsTest,OmittingOneFieldForOneVerbLeavesExactlyThatFieldStale) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,ReadingAnOmittedFieldAbortsNamingTheVerb) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,ReadingAFilledFieldCompletes) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,ReadingBeforeAnyFillAbortsNamingNoVerb) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,CorruptedSnapshotFieldIsNamedWithItsSerial) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,EveryVerbFillsItsClassAndNothingElse) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,MutatedFieldIsNamedAtRead) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,PoisonOmitKnobArmsTheOmission) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,BadPoisonOmitKnobIsFatalNamingTheKnob) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,VerifyCorruptKnobNamesTheFieldAtEntry) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,BadVerifyCorruptKnobIsFatalNamingTheKnob) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,VerifyFatalOffLogsTheDivergenceAndContinues) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,AFrontendMutationInsideAVerbRefreshesThePushedField) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,TheMutationNoticeRefreshesTheValueButNotTheStamp) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
TEST(PipeInputsTest,AFrontendMutationInsideAVerbDoesNotDivergeAtRead) {
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
}
|
||||
|
||||
#else // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// Negative control B, layer 1 (P1 brief D6 / G5): the omitted (verb, field) pair is the
|
||||
// ONLY thing that goes stale - every other bit of the verb class's mask is fresh, every
|
||||
@@ -621,7 +568,6 @@ TEST_F(PipeInputsTest, AFrontendMutationInsideAVerbDoesNotDivergeAtRead) {
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
// Before anything logs: MG_Util::Debug::InitFile() reads the variable once, on the first
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include "Init.h"
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
@@ -71,7 +70,6 @@
|
||||
// crosses under split, and the record holds one; the round-trip case below drives it directly.
|
||||
#include <MG_State/GLState/ProgramState/ProgramArtifactsCodec.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -87,7 +85,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// `from` is a byte offset, and it exists because of the fork below: the library's log file
|
||||
// is already open by the time a case runs, so the child's lines are APPENDED to it rather
|
||||
// than written to a fresh file, and only what the child appended is this drive's evidence.
|
||||
@@ -188,18 +185,13 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// See FramebufferEmitTest's twin for why this is a shape pin rather than a placeholder.
|
||||
TEST(ProgramEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_EQ(&MGPipeProgramEmitterInstance(), &MGPipeProgramEmitterInstance());
|
||||
EXPECT_TRUE(kMGPipeWiredProgramSubsystem == 0 ||
|
||||
kMGPipeWiredProgramSubsystem == kMGPipeSubsystemPrograms);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client emitter in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================================================================
|
||||
@@ -209,7 +201,6 @@ TEST(ProgramEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
// the client package's and lands beside these.
|
||||
// =========================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
using MG_State::GLState::LinkArtifacts;
|
||||
using MG_State::GLState::SpirvArtifacts;
|
||||
@@ -246,16 +237,12 @@ namespace {
|
||||
return MGPipeApplier().ShaderCsos[slot];
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
// A create starts the record over and leaves Serial at 0; a RE-ISSUE on the same handle is how
|
||||
// a relink travels, and it takes the default uniform block with it - a block sized to a layout
|
||||
// that no longer exists is worse than no block, and the sentinel is the value that says
|
||||
// "nothing has been uploaded for this program".
|
||||
TEST(ProgramEmit, ACreateStoresTheDescriptorAndARelinkCountsUpAndDropsTheBlockKeyedToTheOldLayout) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -293,15 +280,11 @@ TEST(ProgramEmit, ACreateStoresTheDescriptorAndARelinkCountsUpAndDropsTheBlockKe
|
||||
EXPECT_EQ(ProgramRecordOf(5).Gen, 3u);
|
||||
EXPECT_EQ(ProgramRecordOf(5).Serial, 0u) << "a recycled slot kept its predecessor's serial";
|
||||
EXPECT_EQ(ProgramRecordOf(5).Desc.StageMask, 0x1u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The three refusals a create can produce: no artefacts at all behind seven undeclared blobs, a
|
||||
// default uniform block no program can have, and a slot outside the record table's bound.
|
||||
TEST(ProgramEmit, ACreateWithNoArtefactsAnOversizedBlockOrACorruptSlotIsRefusedNamingTheProgram) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -329,16 +312,12 @@ TEST(ProgramEmit, ACreateWithNoArtefactsAnOversizedBlockOrACorruptSlotIsRefusedN
|
||||
});
|
||||
EXPECT_TRUE(MGPipeApplier().ShaderCsos.empty());
|
||||
EXPECT_TRUE(MGPipeApplier().CompositeShaderCsos.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
// Three bindings, one serial, and each of them follows its OWN handle: set_draw_program and
|
||||
// set_dispatch_program are two calls because the frontend has two joins. A null handle is legal
|
||||
// and means "nothing bound"; a dead one leaves the previous binding standing and is counted.
|
||||
TEST(ProgramEmit, TheThreeBindingsFollowTheirOwnHandleAndADeadOneLeavesThePreviousBindingStanding) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -373,16 +352,12 @@ TEST(ProgramEmit, TheThreeBindingsFollowTheirOwnHandleAndADeadOneLeavesThePrevio
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().DrawProgram));
|
||||
EXPECT_EQ(MGPipeApplier().ProgramBindingSerial, serialBefore + 4);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, refusedBefore + 3) << "a null bind was counted as a refusal";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A delete drops the record whole, keeps the generation, and clears EVERY binding that named
|
||||
// it - unlike the unit sets, which are "the last set as received". A binding left pointing at a
|
||||
// dropped record would make the next verb refuse a state the applier itself created.
|
||||
TEST(ProgramEmit, ADeleteDropsTheRecordAndClearsEveryBindingThatNamedIt) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -410,16 +385,12 @@ TEST(ProgramEmit, ADeleteDropsTheRecordAndClearsEveryBindingThatNamedIt) {
|
||||
MGPipeApplyDeleteShaderState(ProgramHandle(cso));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 1u);
|
||||
EXPECT_EQ(MGPipeApplier().ProgramBindingSerial, serialAfter);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The default uniform block lands on the PROGRAM's record - it is (ShaderCso, Version) keyed
|
||||
// and belongs to the program, not to the context that uploaded it - and the length it is held
|
||||
// to is the program's own GlobalUboSize, which the create already bounded.
|
||||
TEST(ProgramEmit, TheDefaultUniformBlockLandsOnTheProgramsRecordAndTheSentinelIsRefused) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -462,16 +433,12 @@ TEST(ProgramEmit, TheDefaultUniformBlockLandsOnTheProgramsRecordAndTheSentinelIs
|
||||
// And a block for a program this applier does not have is the ordinary counted refusal.
|
||||
MGPipeApplySetGlobalConstants(GlobalConstants(MGPipeHandle{7, 2}, 15), block);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 1u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-J4 for this family: the program record is share-group state and survives a make-current -
|
||||
// re-emitting create_shader_state for a record the applier still holds would move its serial
|
||||
// for nothing - while the three bindings are working state and do not.
|
||||
TEST(ProgramEmit, TheProgramRecordSurvivesAMakeCurrentWhileTheThreeBindingsDoNot) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const LinkArtifacts link;
|
||||
const SpirvArtifacts spirv;
|
||||
@@ -500,30 +467,8 @@ TEST(ProgramEmit, TheProgramRecordSurvivesAMakeCurrentWhileTheThreeBindingsDoNot
|
||||
|
||||
MGPipeApplierReleaseObjectRecords();
|
||||
EXPECT_TRUE(MGPipeApplier().ShaderCsos.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 requires the pull and push ctest name sets to be identical, name for name.
|
||||
#define MGL_PROGRAM_EMIT_TEST_LIST(X) \
|
||||
X(ProgramEmit, TheStageMaskComesFromTheLinkedSnapshotAndNotTheAttachList) \
|
||||
X(ProgramEmit, TheNeverUploadedSentinelIsNeverEmitted) \
|
||||
X(ProgramEmit, TheEmitterJoinsAndTheTrackerDoesNot) \
|
||||
X(ProgramEmit, AReLinkReIssuesOnTheSameHandle) \
|
||||
X(ProgramEmit, TheDrawAndDispatchProgramsAreTwoIndependentSlots) \
|
||||
X(ProgramEmit, AnUnchangedProgramEmitsNothingAtAll) \
|
||||
X(ProgramEmit, AReIssuedCreateReSendsTheDefaultUniformBlock) \
|
||||
X(ProgramEmit, ADeadProgramsRecordLatchIsRetiredAtItsDeath) \
|
||||
X(ProgramEmit, AUniformBlockBindingAfterTheLinkTravelsOnItsOwnRecord) \
|
||||
X(ProgramEmit, TheThreeBindingTailsAreWholeSetsAndAReIssuedCreateDropsThem) \
|
||||
X(ProgramEmit, AFailedRelinkReIssuesWithLinkStatusZeroAndNeverAnObjectDeath) \
|
||||
X(ProgramEmit, TheFramedArchiveRoundTripsWithTheStageOfEveryModule)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_PROGRAM_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
|
||||
namespace {
|
||||
namespace GL = MobileGL::MG_Impl::GLImpl;
|
||||
@@ -1004,7 +949,6 @@ void main() { gl_Position = vec4(0.0); EmitVertex(); }
|
||||
EXPECT_TRUE(refused.Spirv.generatedSpirv.empty());
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
namespace fs = std::filesystem;
|
||||
@@ -1025,9 +969,7 @@ int main(int argc, char** argv) {
|
||||
// the library's own, not a copy.
|
||||
g_logPath = MobileGL::MG_Util::Debug::RoleLogPath(g_logPath.c_str(),
|
||||
MobileGL::MG_Util::Debug::LogRole::Client);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MobileGL::Initialize();
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -60,14 +60,12 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Backend/MGPipe/PipeInputs.h>
|
||||
#include <MG_Pipe/MGPipeRenderStateSpans.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_State/GLState/RenderState/RenderState.h>
|
||||
#include <MG_Test/ScopedPipeVerb.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -94,7 +92,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using MG_State::GLState::RenderState;
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
|
||||
@@ -223,15 +220,11 @@ namespace {
|
||||
<< "the assembled working block is not byte-identical to the live one - a chunk of "
|
||||
"RenderStateParameters is not being carried, and Espryt reads those bytes raw";
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 1. The table itself.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, ChunkTablePartitionsTheBlock) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
// Sorted, non-overlapping and complete. That is already a static_assert in
|
||||
// MGPipeRenderStateSpans.h - a gap there is a build break, not a red test - and the
|
||||
// point of re-asserting it at run time is that a reader of the suite sees the
|
||||
@@ -316,16 +309,12 @@ namespace {
|
||||
sizeof(StencilFaceState) - offsetof(StencilFaceState, FailOp)))
|
||||
<< "stencil face " << face << ": the three ops must be pipeline";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 2. G7 itself: the setter walk.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, SetterConsistency) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
RenderState rs;
|
||||
|
||||
// Drives one setter and asserts the G7 invariant on it. The m_version expectation is
|
||||
@@ -555,16 +544,12 @@ namespace {
|
||||
EXPECT_EQ(pipelineBefore, rs.GetPipelineStateVersion());
|
||||
EXPECT_EQ(hashBefore, MGPipeComputePipelineSubsetHash(rs.GetAllParameters()));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 3. D5's derivations against the getters they were transcribed from.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, DerivationMatchesTheFrontendGetters) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
// A live frontend context for the setters to write and the getters to answer from,
|
||||
// restored on the way out so the case stays independent (SanityTest's idiom).
|
||||
struct ContextGuard {
|
||||
@@ -714,16 +699,12 @@ namespace {
|
||||
EXPECT_EQ(gPipeInputs.GetClampReadColor(), ctx.GetClampReadColor());
|
||||
EXPECT_EQ(gPipeInputs.GetClampReadColor(), static_cast<GLenum>(GL_FALSE));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 4. Magma's DynamicTailKey against the dynamic half.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, DynamicChunksCoverMagmasDynamicTailKey) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
// The complete GL-state input inventory of ApplyDynamicDrawStateTail, transcribed
|
||||
// from the comment above `struct DynamicTailKey`
|
||||
// (MG_Backend/DirectVulkan/Renderer/VulkanRenderer.cpp). extentX/extentY/
|
||||
@@ -769,7 +750,6 @@ namespace {
|
||||
"scissorEnabled input and this expectation both need re-reading";
|
||||
EXPECT_TRUE(IsWhollyPipeline(offsetof(RenderStateParameters, ScissorTestEnabledMask),
|
||||
sizeof(RenderStateParameters::ScissorTestEnabledMask)));
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -782,9 +762,6 @@ namespace {
|
||||
// so cannot tell a correctly scoped guard from one that is too narrow.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, IncrementalChunksKeepEveryDerivedFieldInStep) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
struct ContextGuard {
|
||||
SharedPtr<GLContext> Previous;
|
||||
ContextGuard() : Previous(Move(MG_State::pGLContext)) {
|
||||
@@ -928,7 +905,6 @@ namespace {
|
||||
ctx.SetCapability(cap, !ctx.IsCapabilityEnabled(cap));
|
||||
push(("step 9: capability " + std::to_string(i)).c_str());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
@@ -944,7 +920,6 @@ namespace {
|
||||
// Neither is skipped anywhere, so `ctest -R Residual` reaches the wire and not only
|
||||
// the static_asserts.
|
||||
// =====================================================================================
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
constexpr SizeT kCapCount = static_cast<SizeT>(CapabilityInput::CapabilityInputCount);
|
||||
|
||||
// A live frontend context and a clean applier, restored on the way out (SanityTest's
|
||||
@@ -1062,7 +1037,6 @@ namespace {
|
||||
return "status " + std::to_string(r.Status);
|
||||
}
|
||||
#endif // MGTEST_HAVE_FORK
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 6a. The residual trip wire is SILENT until the applier owns the bytes it would compare.
|
||||
@@ -1073,9 +1047,6 @@ namespace {
|
||||
// with it means nothing. An earlier form of this wire aborted here.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, ResidualTripWireIsSilentUntilTheApplierOwnsTheBytes) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
Uint32 nextSlot = kMGPipeFirstAllocatableSlot;
|
||||
@@ -1116,7 +1087,6 @@ namespace {
|
||||
MGPipeApplySetResidualValueState(CarriedBitsOf(ctx));
|
||||
EXPECT_EQ(MGPipeApplier().ResidualCapabilitiesCompared, static_cast<Uint32>(kCapCount));
|
||||
EXPECT_EQ(MGPipeApplier().ResidualDivergences, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -1130,9 +1100,6 @@ namespace {
|
||||
// current. This is the case that pins the class contract shut.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, ResidualTripWireHoldsAcrossAVerbClassThatDoesNotPublishTheBlock) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
Uint32 nextSlot = kMGPipeFirstAllocatableSlot;
|
||||
@@ -1151,16 +1118,12 @@ namespace {
|
||||
}
|
||||
EXPECT_EQ(MGPipeApplier().ResidualCapabilitiesCompared, static_cast<Uint32>(kCapCount));
|
||||
EXPECT_EQ(MGPipeApplier().ResidualDivergences, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
// 6c. The armed wire FIRES, naming the capability. The red half of 6a/6b.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, ResidualTripWireFiresNamingTheCapability) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
Uint32 nextSlot = kMGPipeFirstAllocatableSlot;
|
||||
@@ -1186,7 +1149,6 @@ namespace {
|
||||
EXPECT_EQ(MGPipeApplier().ResidualDivergences, 1u);
|
||||
EXPECT_NE(ReadLog().substr(before.size()).find("PipeResidualDiverged, \"Dither\""), std::string::npos)
|
||||
<< "the wire counted a divergence without logging which capability";
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1196,9 +1158,6 @@ namespace {
|
||||
// which a `==` comparison would call a divergence.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, PatchCarrierTripWireFiresOnlyWhenTheApplierOwnsChunkP0) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
Uint32 nextSlot = kMGPipeFirstAllocatableSlot;
|
||||
@@ -1238,7 +1197,6 @@ namespace {
|
||||
MGPipeApplySetPatchState(diverging);
|
||||
EXPECT_EQ(MGPipeApplier().PatchCarrierDivergences, 1u);
|
||||
EXPECT_NE(ReadLog().substr(before.size()).find("PipePatchCarriersDiffer"), std::string::npos);
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -1248,9 +1206,6 @@ namespace {
|
||||
// calls it, and this is what says it still answers what the scoped form answers.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, WholeBlockDerivationAgreesWithTheChunkScopedOne) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
MG_Test::ScopedPipeVerb verb(MGPipeVerb::DrawArrays);
|
||||
@@ -1268,7 +1223,6 @@ namespace {
|
||||
|
||||
MGPipeDeriveRenderStateFields(gPipeInputs);
|
||||
ExpectDerivedDrawFieldsMatch(ctx, "the whole-block derivation");
|
||||
#endif
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------
|
||||
@@ -1277,9 +1231,6 @@ namespace {
|
||||
// fill table is still the only thing that says what a verb may read.
|
||||
// -------------------------------------------------------------------------------------
|
||||
TEST(RenderStateSpans, TheRemainingApplyEntryPointsReachPipeInputs) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
ApplierContextGuard guard;
|
||||
GLContext& ctx = *MG_State::pGLContext;
|
||||
|
||||
@@ -1356,7 +1307,6 @@ namespace {
|
||||
EXPECT_EQ(MGPipeApplier().RenderStateCsos[slot].Gen, 0u);
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().BoundRenderStateCso));
|
||||
}
|
||||
#endif
|
||||
}
|
||||
} // namespace
|
||||
|
||||
|
||||
@@ -55,7 +55,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
@@ -79,7 +78,6 @@
|
||||
#endif
|
||||
|
||||
#include <vector>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -112,9 +110,6 @@ namespace {
|
||||
// It is also the negative control for the registration itself. A Set that did not stick
|
||||
// would leave the family permanently dark, and nothing else in the tree would say so.
|
||||
TEST(ResourceEmit, TheResourceOpTableIsUnregisteredUntilABackendInstallsOne) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ASSERT_EQ(MGPipeGetResourceOps(), nullptr)
|
||||
<< "something registered a resource op table in a unit-test process";
|
||||
|
||||
@@ -129,7 +124,6 @@ namespace {
|
||||
|
||||
MGPipeSetResourceOps(nullptr);
|
||||
EXPECT_EQ(MGPipeGetResourceOps(), nullptr);
|
||||
#endif
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
@@ -149,7 +143,6 @@ namespace {
|
||||
// the split is contiguous, non-overlapping and reassembles has a pinned bound to split at.
|
||||
// =====================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// A fresh applier per case, and no table left installed behind one. Every case is its own
|
||||
// process under ctest, so this is belt and braces - but running the binary by hand must
|
||||
// give the same answers as running it under ctest, or a failure cannot be reproduced.
|
||||
@@ -319,15 +312,11 @@ namespace {
|
||||
return "status " + std::to_string(r.Status);
|
||||
}
|
||||
#endif // MGTEST_HAVE_FORK
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// A create is emitted from the buffer object's CONSTRUCTOR, so it defines no storage and
|
||||
// is not a mutation: it says a resource of this identity exists. Slot 0 is the reserved
|
||||
// null handle and never becomes live, whatever a record says.
|
||||
TEST(ResourceEmit, ACreateMarksTheSlotLiveAndCarriesItsDescriptor) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{7, 3};
|
||||
MGPipeApplyResourceCreate(BufferDesc(res, 0, 41));
|
||||
@@ -349,16 +338,12 @@ namespace {
|
||||
// And the reserved handle is refused rather than made live.
|
||||
MGPipeApplyResourceCreate(BufferDesc(kMGPipeNullHandle, 4096, 0));
|
||||
EXPECT_FALSE(MGPipeApplier().Resources[0].Live);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The serial is the server-owned MGGen the backend twin compares against instead of
|
||||
// mirroring a frontend change serial. Exactly the four mutations move it; a readback and a
|
||||
// persistent-map acquisition do not, because neither changes what is in the store.
|
||||
TEST(ResourceEmit, ARespecifyReplacesTheDescriptorAndOnlyAMutationMovesTheSerial) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{7, 3};
|
||||
const Uint8 bytes[64] = {};
|
||||
@@ -398,7 +383,6 @@ namespace {
|
||||
EXPECT_EQ(RecordOf(res.Slot).Serial, 5u);
|
||||
MGPipeApplyMapPersistent(BufferHandle(res), 512, bytes);
|
||||
EXPECT_EQ(RecordOf(res.Slot).Serial, 5u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// A destroy drops the record and keeps the generation, because the CLIENT allocator owns
|
||||
@@ -406,9 +390,6 @@ namespace {
|
||||
// afterwards is nothing at all - including after the slot has been handed out again, which
|
||||
// is the ABA shape a raw address cannot express.
|
||||
TEST(ResourceEmit, ADestroyDropsTheRecordAndAStaleGenerationResolvesToNothing) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle first{7, 3};
|
||||
MGPipeApplyResourceCreate(BufferDesc(first, 0, 41));
|
||||
@@ -445,7 +426,6 @@ namespace {
|
||||
EXPECT_EQ(RecordOf(second.Slot).Desc.Width, 0u);
|
||||
EXPECT_EQ(RecordOf(second.Slot).Desc.GlNameForDiag, 99u);
|
||||
EXPECT_EQ(RecordOf(second.Slot).Serial, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// HasLiveHostWrites is ALWAYS false in this phase and is written by nobody: it exists so
|
||||
@@ -453,9 +433,6 @@ namespace {
|
||||
// and a verify build refuses to let a producer land under it unannounced. This case walks
|
||||
// every path this phase has and pins that none of them is one.
|
||||
TEST(ResourceEmit, NoResourcePathInThisPhaseLeavesHostWritesLive) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{2, 1};
|
||||
const Uint8 bytes[64] = {};
|
||||
@@ -485,7 +462,6 @@ namespace {
|
||||
// TheObjectRecordsSurviveAMakeCurrentAndOnlyTheWorkingStateIsReset.)
|
||||
MGPipeApplierReleaseObjectRecords();
|
||||
EXPECT_TRUE(MGPipeApplier().Resources.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
// The buffer half of MGPSubData is a convention over a texture record's box, and
|
||||
@@ -531,9 +507,6 @@ namespace {
|
||||
// lets the client half land without changing a single observable - and every one of them
|
||||
// hands the backend a HANDLE and a payload, never a frontend object.
|
||||
TEST(ResourceEmit, EveryResourceCallDispatchesByHandleThroughTheInstalledTableOnly) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{4, 9};
|
||||
const Uint8 bytes[64] = {};
|
||||
@@ -586,7 +559,6 @@ namespace {
|
||||
MGPipeApplyResourceSubData(BufferWrite(res, 0, 64), bytes);
|
||||
EXPECT_EQ(g_spy.SubDatas, 1u);
|
||||
EXPECT_EQ(RecordOf(res.Slot).Serial, 5u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// map-persistent-roundtrips counts every ACQUISITION ATTEMPT, mint or decline, because
|
||||
@@ -595,9 +567,6 @@ namespace {
|
||||
// defined this way the number is the same in both modes, is one per storage definition,
|
||||
// and is assertable today.
|
||||
TEST(ResourceEmit, MapPersistentCountsEveryAttemptWhetherItMintsOrDeclines) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{3, 2};
|
||||
const Uint8 bytes[64] = {};
|
||||
@@ -629,7 +598,6 @@ namespace {
|
||||
// Per context, like every other member of the applier's state.
|
||||
MGPipeApplierReset();
|
||||
EXPECT_EQ(MGPipeApplier().MapPersistentRoundtrips, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE BOUNDS GATE, AND THE REASON IT IS A TRIP WIRE RATHER THAN A DROPPED CALL: a record
|
||||
@@ -643,9 +611,6 @@ namespace {
|
||||
// on from a defined state, so that build asserts the same line plus the fact that the
|
||||
// refused write moved nothing.
|
||||
TEST(ResourceEmit, AWriteOutsideTheDeclaredStorageIsRefusedNamingTheResource) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{7, 3};
|
||||
const Uint8 bytes[256] = {};
|
||||
@@ -682,7 +647,6 @@ namespace {
|
||||
"glName=41}"),
|
||||
std::string::npos)
|
||||
<< "the gate refused the write without saying which record it was";
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -702,7 +666,6 @@ namespace {
|
||||
// arm all have a case here that fails by field or by name when they are removed.
|
||||
// =====================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPHandleOnly ElementsHandle(MGPipeHandle cso) {
|
||||
return MGPHandleOnly{cso, static_cast<Uint32>(MGPipeKind::VertexElementsCso), 0};
|
||||
}
|
||||
@@ -821,7 +784,6 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// C1. A make-current is NOT a teardown. MGPipeApplierReset runs at every change of the
|
||||
// current context - including a make-current back to a context that is still alive - and a
|
||||
@@ -830,9 +792,6 @@ namespace {
|
||||
// storage after it, and the write that follows must land rather than resolve to nothing.
|
||||
// Only the applier's own teardown takes the records.
|
||||
TEST(ResourceEmit, TheObjectRecordsSurviveAMakeCurrentAndOnlyTheWorkingStateIsReset) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{7, 3};
|
||||
const MGPipeHandle cso{2, 1};
|
||||
@@ -891,7 +850,6 @@ namespace {
|
||||
EXPECT_TRUE(MGPipeApplier().Resources.empty());
|
||||
EXPECT_TRUE(MGPipeApplier().VertexElementsCsos.empty());
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().BoundVertexElements));
|
||||
#endif
|
||||
}
|
||||
|
||||
// C1's observable. A call that names a record this applier does not have is a DEFINED
|
||||
@@ -901,9 +859,6 @@ namespace {
|
||||
// what all three gate builds and every shipped build are, so a no-op alone would make a
|
||||
// dropped glBufferSubData invisible everywhere it matters. It is counted instead.
|
||||
TEST(ResourceEmit, ACallOnARecordTheApplierDoesNotHaveIsCountedRatherThanSilentlyDropped) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{7, 3};
|
||||
const MGPipeHandle cso{2, 1};
|
||||
@@ -965,16 +920,12 @@ namespace {
|
||||
MGPipeApplierReset();
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, 0u);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedVertexInputCalls, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The blob unpack, over ALL 32 attribute and 32 binding-point slots, and the shrink that
|
||||
// has to leave nothing of the configuration before it. Deleting either memcpy, or the two
|
||||
// zeroing lines that precede them, fails this case by field name.
|
||||
TEST(ResourceEmit, AVertexElementsBlobRoundTripsAndAShrinkLeavesNothingOfTheOneBeforeIt) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle cso{3, 1};
|
||||
const ElementsBlob full = MakeElements(cso, kMGPipeMaxVertexAttribs, kMGPipeMaxVertexAttribs, true);
|
||||
@@ -1019,16 +970,12 @@ namespace {
|
||||
EXPECT_EQ(ElementsOf(recycled.Slot).Gen, recycled.Gen);
|
||||
EXPECT_EQ(ElementsOf(recycled.Slot).ContentSerial, 1u) << "a recycled slot starts over";
|
||||
EXPECT_EQ(ElementsOf(recycled.Slot).AttributeCount, 1u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The counts/blob gate, in both build arms, plus the half of the Blob rule that says a
|
||||
// record which declares NO length is not a fault: 0 means "this record does not declare
|
||||
// its blob", which is what a monolith emission is, and the counts are what bound the read.
|
||||
TEST(ResourceEmit, AVertexElementsRecordThatDoesNotDescribeItsOwnBlobIsRefusedNamingIt) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle cso{5, 2};
|
||||
|
||||
@@ -1068,16 +1015,12 @@ namespace {
|
||||
});
|
||||
EXPECT_EQ(ElementsOf(cso.Slot).ContentSerial, 2u);
|
||||
EXPECT_EQ(ElementsOf(cso.Slot).AttributeCount, 3u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// set_vertex_buffers: the window is the bound, the entries land inside it and nowhere
|
||||
// else, and the base instance is stored RAW. Deleting the copy loop, or the window gate,
|
||||
// fails this case.
|
||||
TEST(ResourceEmit, TheVertexBufferWindowIsBoundedAndItsEntriesLandWhereItSays) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
Array<MGPVertexBuffer, kMGPipeMaxVertexAttribs> wide{};
|
||||
for (Uint32 i = 0; i < kMGPipeMaxVertexAttribs; ++i) {
|
||||
@@ -1146,16 +1089,12 @@ namespace {
|
||||
"entries",
|
||||
[&noEntries]() { MGPipeApplySetVertexBuffers(noEntries, nullptr); });
|
||||
EXPECT_EQ(MGPipeApplier().VertexBuffersSerial, serialBefore + 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
// set_index_buffer is an INDEPENDENT call and not a subset of the vertex-elements
|
||||
// configuration (D5), which is exactly what the backend's two separate compares need; and
|
||||
// the binding follows the handle, including the null one.
|
||||
TEST(ResourceEmit, SetIndexBufferMovesOnlyItsOwnSerialAndTheBindingFollowsTheHandle) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle cso{4, 1};
|
||||
const ElementsBlob elements = MakeElements(cso, 2, 1, true);
|
||||
@@ -1200,7 +1139,6 @@ namespace {
|
||||
EXPECT_EQ(ElementsOf(cso.Slot).ContentSerial, 0u) << "0 means never created";
|
||||
EXPECT_EQ(ElementsOf(cso.Slot).AttributeCount, 0u);
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().BoundVertexElements));
|
||||
#endif
|
||||
}
|
||||
|
||||
// The three refusals the sub-data case above does not reach, each on the call that owns
|
||||
@@ -1208,9 +1146,6 @@ namespace {
|
||||
// and a buffer write whose declared blob length is not its own byte size. Removing any one
|
||||
// of those four gates leaves this case red.
|
||||
TEST(ResourceEmit, EveryContentCallsOwnBoundsGateRefusesAndNamesTheResource) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{6, 2};
|
||||
const Uint8 bytes[256] = {};
|
||||
@@ -1250,7 +1185,6 @@ namespace {
|
||||
"the record's own byte size",
|
||||
[&lyingBlob, &bytes]() { MGPipeApplyResourceSubData(lyingBlob, bytes); });
|
||||
EXPECT_EQ(RecordOf(res.Slot).Serial, 3u) << "not one of the four refusals may move the serial";
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-A4's pin, with the producer this phase does not have. NoResourcePathInThisPhaseLeaves
|
||||
@@ -1260,14 +1194,7 @@ namespace {
|
||||
// flag is set here by hand, which is exactly what the phase that pushes persistent-mapped
|
||||
// host writes will do, and map_persistent is the call it will do it on.
|
||||
TEST(ResourceEmit, TheLiveHostWritesWireFiresOnTheCallAPersistentMapProducerWouldSetItOn) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
// MOBILEGL_PIPE_VERIFY alone, NOT `POISON || VERIFY`. PinNoLiveHostWrites is compiled
|
||||
// under `#if MOBILEGL_PIPE_VERIFY` only (PipeApply.cpp:838-853), so in a split build -
|
||||
// where POISON is armed by MOBILEGL_BUILD_DISAGGREGATED but VERIFY is off - the wire
|
||||
// genuinely is compiled out and this case must skip. The wrong disjunction was masked
|
||||
// until now by POISON being invisible in this TU at all (see the include at the top).
|
||||
#elif !MOBILEGL_PIPE_VERIFY
|
||||
#if !MOBILEGL_PIPE_VERIFY
|
||||
GTEST_SKIP() << "Fatal{PipeLiveHostWrites} is a MOBILEGL_PIPE_VERIFY wire and is compiled out here";
|
||||
// P5 b1: AND IT IS RETIRED IN A SPLIT BUILD, because this is the phase the wire was
|
||||
// waiting for. "HasLiveHostWrites is always false and is written by nobody" cannot
|
||||
@@ -1355,7 +1282,6 @@ namespace {
|
||||
// The helpers are MOBILEGL_PIPE_PUSH-only, like the applier they read: a pull build compiles
|
||||
// these two cases as skips (gate G2 keeps the names in every build), and MGPipeApplier() is
|
||||
// not declared there.
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPResourceDesc Tex2DDesc(MGPipeHandle res, Uint32 extent, Uint32 levels, Uint32 glName) {
|
||||
MGPResourceDesc desc{};
|
||||
desc.Resource = res;
|
||||
@@ -1396,15 +1322,11 @@ namespace {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// THE POSITIVE. A per-level producer that covers its declared range is accepted, and the
|
||||
// accumulated texels of every OTHER level survive it - which is the thing the pin was
|
||||
// standing in front of, checked rather than asserted.
|
||||
TEST(ResourceEmit, APerLevelRespecifyCoveringItsDeclaredRangeKeepsTheOtherLevelsTexels) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
ScopedResourceOps consumer;
|
||||
|
||||
@@ -1433,7 +1355,6 @@ namespace {
|
||||
<< "the level the call DID redefine has a new coordinate system, so its box goes";
|
||||
EXPECT_EQ(ReadLog().find("PipeRespecifyScope"), std::string::npos)
|
||||
<< "the relaxed pin must be silent on a producer that covers its declaration";
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE NEGATIVE, and it is the whole reason the pin is relaxed rather than deleted. A
|
||||
@@ -1442,9 +1363,7 @@ namespace {
|
||||
// naming a different pair erases the wrong key and keeps the one the client stopped owing.
|
||||
// Neither is visible as anything but missing pixels one frame later.
|
||||
TEST(ResourceEmit, APerLevelRespecifyThatDoesNotCoverItsDeclaredRangeIsRefusedByName) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#elif !MOBILEGL_PIPE_VERIFY
|
||||
#if !MOBILEGL_PIPE_VERIFY
|
||||
// MOBILEGL_PIPE_VERIFY alone, NOT `POISON || VERIFY`, for PinNoLiveHostWrites' reason
|
||||
// above: PinRespecifyScopeCoversItsDeclaration is compiled under `#if
|
||||
// MOBILEGL_PIPE_VERIFY` only, so in a plain split build the wire genuinely is compiled
|
||||
@@ -1500,9 +1419,6 @@ namespace {
|
||||
// policed like every other: a slot outside the table's bound is Fatal{ProtocolCorruption}
|
||||
// and never a resize. Removing the bound turns this case into a multi-gigabyte allocation.
|
||||
TEST(ResourceEmit, ASlotOutsideTheRecordTablesBoundIsRefusedRatherThanAllocated) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
// An ordinary slot is ordinary, and the table grows to it and no further.
|
||||
const MGPipeHandle ordinary{9, 1};
|
||||
@@ -1532,7 +1448,6 @@ namespace {
|
||||
"table's bound",
|
||||
[&desc, blobBytes]() { MGPipeApplyCreateVertexElements(desc, blobBytes); });
|
||||
EXPECT_TRUE(MGPipeApplier().VertexElementsCsos.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
// =====================================================================================
|
||||
@@ -1547,7 +1462,6 @@ namespace {
|
||||
// TextureEmitTest beside the emitter cases it belongs with.
|
||||
// =====================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MGPResourceDesc TargetedDesc(MGPipeHandle res, MGPipeResourceTarget target, Uint32 width, Uint32 glName) {
|
||||
MGPResourceDesc desc = BufferDesc(res, width, glName);
|
||||
desc.Target = static_cast<Uint8>(target);
|
||||
@@ -1557,15 +1471,11 @@ namespace {
|
||||
MGPHandleOnly KindHandle(MGPipeHandle res, MGPipeKind kind) {
|
||||
return MGPHandleOnly{res, static_cast<Uint32>(kind), 0};
|
||||
}
|
||||
#endif
|
||||
|
||||
// ONE SLOT NUMBER, THREE LIVE OBJECTS, THREE RECORDS. This is the case that fails the
|
||||
// instant the applier goes back to one table: every assertion below is about slot 7 being
|
||||
// three different things at once, which is exactly what the client allocator hands out.
|
||||
TEST(ResourceEmit, TheThreeResourceKindsKeepTheirOwnSlotSpaceAndDoNotSeeEachOther) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
// The texture and renderbuffer rows below are P4a's, and P4a's belt declines those on a
|
||||
// backend that consumes none of them (ID-39) - so this case says which arm it is about.
|
||||
@@ -1605,7 +1515,6 @@ namespace {
|
||||
EXPECT_TRUE(MGPipeApplier().Resources[7].Live) << "a texture destroy dropped the buffer's record";
|
||||
EXPECT_TRUE(MGPipeApplier().RenderbufferResources[7].Live);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// ID-39: THE APPLIER'S HALF OF THE "NO CONSUMER" RULE, over every P4a-family entry point.
|
||||
@@ -1629,9 +1538,6 @@ namespace {
|
||||
// THE DEATH PATHS ARE DELIBERATELY NOT IN THE LIST and the second half of the case says so:
|
||||
// a destroy is idempotent cleanup that must keep working whatever the registration did.
|
||||
TEST(ResourceEmit, EveryP4aFamilyEntryPointDeclinesWhenNoBackendRegisteredTheConsumer) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard; // leaves the table UNREGISTERED, which is this half's whole point
|
||||
ASSERT_EQ(MGPipeGetResourceOps(), nullptr);
|
||||
|
||||
@@ -1794,16 +1700,12 @@ namespace {
|
||||
EXPECT_FALSE(MGPipeApplier().ShaderCsos[9].Live);
|
||||
EXPECT_FALSE(MGPipeApplier().TextureResources[7].Live);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// Neither branch may fall through to a table it was not named. A target or a kind outside
|
||||
// the catalogue would otherwise land in whichever table the code happened to reach first,
|
||||
// and destroy a live object of a kind the call was never about.
|
||||
TEST(ResourceEmit, AResourceTargetOrKindTheCatalogueDoesNotNameIsRefusedRatherThanRouted) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle res{5, 1};
|
||||
|
||||
@@ -1840,7 +1742,6 @@ namespace {
|
||||
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, 0u)
|
||||
<< "a corrupt record is not a dropped call and must not be counted as one";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A texture's resource calls reach NO backend function pointer, and that is the structural
|
||||
@@ -1848,9 +1749,6 @@ namespace {
|
||||
// dispatches at GL-call time today, so the record IS the publication. A spy table that saw
|
||||
// one of them would mean P4a had grown an op-table path nobody designed.
|
||||
TEST(ResourceEmit, NoTextureOrRenderbufferResourceCallReachesTheBackendOpTable) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
g_spy = SpyState{};
|
||||
MGPipeSetResourceOps(&kSpyOps);
|
||||
@@ -1887,29 +1785,8 @@ namespace {
|
||||
EXPECT_EQ(g_spy.Respecifies, 1u);
|
||||
EXPECT_EQ(g_spy.SubDatas, 1u);
|
||||
EXPECT_EQ(g_spy.Destroys, 1u);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 REQUIRES THE PULL AND PUSH ctest NAME SETS TO BE IDENTICAL, name for name, so a
|
||||
// push-only case cannot be ABSENT from a pull build - it has to be there and SKIP. This
|
||||
// list declares exactly the suite.name pairs the push build gets from the real cases
|
||||
// below, the shape PipeInputsTest and TrackerTest established for the same reason.
|
||||
#define MGL_RESOURCE_EMIT_TEST_LIST(X) \
|
||||
X(ResourceEmit, EveryBufferTargetSetsItsBindMaskBit) \
|
||||
X(ResourceEmit, ABindMaskBitIsStickyAcrossARespecifyThatDoesNotRebind) \
|
||||
X(ResourceEmit, ADestroyedBufferReleasesItsSlotAndAStaleHandleResolvesToNothing) \
|
||||
X(ResourceEmit, AWholeBufferSubDataBeyondTheRecordBoundIsSplitIntoContiguousRecords) \
|
||||
X(ResourceEmit, ABufferCreatedBeforeAMakeCurrentStillLandsItsSubDataAfterOne) \
|
||||
X(ResourceEmit, ADrawTimeIndexBindingPublishesElementArrayEvenWhenTheRespecifyCannotSeeIt) \
|
||||
X(ResourceEmit, ADestroyFollowsTheCreateEvenIfTheOpTableWasUnregisteredMeanwhile) \
|
||||
X(ResourceEmit, ARespecifyPublishesTheCreateAHandleNeverGot)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_RESOURCE_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
using MG_State::GLState::BufferObject;
|
||||
|
||||
@@ -2252,9 +2129,7 @@ namespace {
|
||||
// away. What makes the split reachable in a real lane is the clamp, and the clamp is a pure
|
||||
// function of the segment's size, which is what the walk below is driven at.
|
||||
TEST(ResourceEmit, AWideBufferSubDataSplitsAtTheStageChunkBytes) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#elif !MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if !MOBILEGL_BUILD_DISAGGREGATED
|
||||
GTEST_SKIP() << "there is no stage segment to size a content chunk against without the "
|
||||
"transport built in";
|
||||
#else
|
||||
@@ -2351,9 +2226,7 @@ namespace {
|
||||
// aborts its own binary reports nothing. The child's three observations come back through a
|
||||
// probe file rather than through gtest, whose state a forked child must not be trusted with.
|
||||
TEST(ResourceEmit, AZeroByteRespecifyDefinesTheStoreAndCarriesNoContent) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#elif !MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if !MOBILEGL_BUILD_DISAGGREGATED
|
||||
GTEST_SKIP() << "the arm that reads MappedData() as 'bytes to carry' is the split one; "
|
||||
"without the transport the respecify has no follow-up to get wrong";
|
||||
#elif !MGTEST_HAVE_FORK
|
||||
@@ -2592,7 +2465,6 @@ namespace {
|
||||
EXPECT_EQ(RecordOf(handle.Slot).Desc.Width, 512u);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, refusalsBefore);
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
@@ -53,7 +53,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <cstring>
|
||||
|
||||
#include "Init.h"
|
||||
@@ -72,7 +71,6 @@
|
||||
#include <MG_Impl/Pipe/SlotAllocator.h>
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -88,7 +86,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// `from` is a byte offset, and it exists because of the fork below: the library's log file
|
||||
// is already open by the time a case runs, so the child's lines are APPENDED to it rather
|
||||
// than written to a fresh file, and only what the child appended is this drive's evidence.
|
||||
@@ -189,21 +186,16 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// See FramebufferEmitTest's twin for why this is a shape pin rather than a placeholder.
|
||||
TEST(SamplerEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_EQ(&MGPipeSamplerEmitterInstance(), &MGPipeSamplerEmitterInstance());
|
||||
// One bit for the whole sampler family - the CSO, the view and all three unit sets,
|
||||
// including set_shader_images, whose emitter lives in ImageEmit.h. An operator switching
|
||||
// samplers off has to get the whole family's legacy arm, not two thirds of it.
|
||||
EXPECT_TRUE(kMGPipeWiredSamplerSubsystem == 0 ||
|
||||
kMGPipeWiredSamplerSubsystem == kMGPipeSubsystemSamplers);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client emitter in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// =========================================================================================
|
||||
@@ -214,7 +206,6 @@ TEST(SamplerEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
// is the client package's and lands beside these.
|
||||
// =========================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
// Every field carries a value of its own, INCLUDING borderColorForm and all three border
|
||||
// representations: they are always numerically populated, so the value alone cannot say
|
||||
@@ -272,16 +263,12 @@ namespace {
|
||||
return desc;
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
// A create starts the record over and leaves Serial at 0 - so a fresh backend twin that starts
|
||||
// its own synced serial at 0 agrees without either side publishing anything - while a re-issue
|
||||
// on a LIVE identity counts up, which is how a value change travels on a handle whose
|
||||
// generation moves only on slot reuse.
|
||||
TEST(SamplerEmit, ACreateStoresTheParametersByValueAndAReissueOnALiveIdentityCountsUp) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle cso{6, 2};
|
||||
const SamplerParameters first = SamplerValues(0.5f, BorderColorForm::Int);
|
||||
@@ -315,16 +302,12 @@ TEST(SamplerEmit, ACreateStoresTheParametersByValueAndAReissueOnALiveIdentityCou
|
||||
EXPECT_EQ(MGPipeApplier().SamplerCsos[6].Gen, 3u);
|
||||
EXPECT_EQ(MGPipeApplier().SamplerCsos[6].Serial, 0u) << "a recycled slot kept its predecessor's serial";
|
||||
EXPECT_FLOAT_EQ(MGPipeApplier().SamplerCsos[6].Params.lodBias, 2.5f);
|
||||
#endif
|
||||
}
|
||||
|
||||
// The one Blob rule, on this family's own blob: a non-zero declared length must be exactly one
|
||||
// SamplerParameters, a zero means "this record does not declare its blob" - which is what a
|
||||
// monolith emission is - and either way the bytes read are bounded by the TYPE.
|
||||
TEST(SamplerEmit, ARecordThatDoesNotDescribeItsOwnParametersIsRefusedNamingTheLength) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const SamplerParameters values = SamplerValues(0.0f, BorderColorForm::Float);
|
||||
|
||||
@@ -346,16 +329,12 @@ TEST(SamplerEmit, ARecordThatDoesNotDescribeItsOwnParametersIsRefusedNamingTheLe
|
||||
"bound",
|
||||
[&pastTheBound, &values]() { MGPipeApplyCreateSamplerState(pastTheBound, &values); });
|
||||
EXPECT_TRUE(MGPipeApplier().SamplerCsos.empty()) << "the table was grown by a corrupt slot";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A death notice on a record the applier does not have is the ONE refusal a legal sequence
|
||||
// produces - the teardown order - so it stays a defined no-op, and it is COUNTED because
|
||||
// MOBILEGL_ASSERT compiles out at INFO and every build that matters is one.
|
||||
TEST(SamplerEmit, ADeleteDropsTheRecordAndAStaleNoticeIsCountedRatherThanSilentlyDropped) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle cso{3, 7};
|
||||
const SamplerParameters values = SamplerValues(0.0f, BorderColorForm::Float);
|
||||
@@ -374,7 +353,6 @@ TEST(SamplerEmit, ADeleteDropsTheRecordAndAStaleNoticeIsCountedRatherThanSilentl
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 1u);
|
||||
MGPipeApplyDeleteSamplerState(SamplerHandle(MGPipeHandle{3, 8}));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 2u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// A sampler view is IDENTITY-addressed one per texture object, minted off that object's
|
||||
@@ -383,9 +361,6 @@ TEST(SamplerEmit, ADeleteDropsTheRecordAndAStaleNoticeIsCountedRatherThanSilentl
|
||||
// lookups: the texture bit and the sampler bit are independent, so a view arriving without its
|
||||
// texture is an ordering fact and not a refusal.
|
||||
TEST(SamplerEmit, AViewIsReissuedOnTheSameHandleAndKeepsItsTexturesBackPointerInStep) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{5, 1};
|
||||
const MGPipeHandle view{9, 2};
|
||||
@@ -418,7 +393,6 @@ TEST(SamplerEmit, AViewIsReissuedOnTheSameHandleAndKeepsItsTexturesBackPointerIn
|
||||
<< "the texture kept a back-pointer to a view that is gone";
|
||||
MGPipeApplyDeleteSamplerView(ViewHandle(view));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, 1u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE WINDOW IS THE BOUND AND ENTRIES OUTSIDE IT ARE NOT CLEARED: a set that names four units
|
||||
@@ -426,9 +400,6 @@ TEST(SamplerEmit, AViewIsReissuedOnTheSameHandleAndKeepsItsTexturesBackPointerIn
|
||||
// never mentioned. Deleting the entry loop, the window gate or either serial bump leaves this
|
||||
// red.
|
||||
TEST(SamplerEmit, TheTwoUnitSetsLandInTheirWindowAndLeaveEverythingOutsideItAlone) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
|
||||
MGPBoundView views[2] = {};
|
||||
@@ -476,16 +447,12 @@ TEST(SamplerEmit, TheTwoUnitSetsLandInTheirWindowAndLeaveEverythingOutsideItAlon
|
||||
EXPECT_EQ(MGPipeApplier().SamplerViewCount, 1u);
|
||||
EXPECT_EQ(MGPipeApplier().BoundSamplerViews[5].Texture, (MGPipeHandle{3, 1}))
|
||||
<< "the entry outside the new window was cleared";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The window gate itself, at the bound and one past it, plus the null-tail arm. A header that
|
||||
// describes more than its destination can hold is the same class of fault as a blob outside
|
||||
// its segment, and the destination here is the merged 192-unit space.
|
||||
TEST(SamplerEmit, AUnitWindowPastTheMergedUnitSpaceIsRefusedRatherThanTruncated) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
MGPBoundView entry{};
|
||||
entry.Texture = MGPipeHandle{2, 1};
|
||||
@@ -524,16 +491,12 @@ TEST(SamplerEmit, AUnitWindowPastTheMergedUnitSpaceIsRefusedRatherThanTruncated)
|
||||
|
||||
EXPECT_EQ(MGPipeApplier().SamplerViewsSerial, serialBefore) << "a refused set moved the serial";
|
||||
EXPECT_EQ(MGPipeApplier().SamplerViewStart, kMGPipeMaxTextureUnits - 1);
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-J4 for this family: the CSO and the view are OBJECT records and survive a make-current;
|
||||
// the two unit sets are WORKING state and do not, and their serials advance rather than
|
||||
// restarting.
|
||||
TEST(SamplerEmit, AMakeCurrentTakesTheUnitSetsAndLeavesTheCsoAndViewRecordsStanding) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const SamplerParameters values = SamplerValues(3.0f, BorderColorForm::Float);
|
||||
MGPipeApplyCreateSamplerState(SamplerDesc(MGPipeHandle{2, 1}, 0), &values);
|
||||
@@ -555,34 +518,8 @@ TEST(SamplerEmit, AMakeCurrentTakesTheUnitSetsAndLeavesTheCsoAndViewRecordsStand
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(MGPipeApplier().BoundSamplerViews[0].Texture));
|
||||
EXPECT_GT(MGPipeApplier().SamplerViewsSerial, viewsSerial);
|
||||
EXPECT_GT(MGPipeApplier().SamplerStatesSerial, statesSerial);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 requires the pull and push ctest name sets to be identical, name for name, so every
|
||||
// push-only case is present here and SKIPS rather than being absent.
|
||||
#define MGL_SAMPLER_EMIT_TEST_LIST(X) \
|
||||
X(SamplerEmit, EverySamplerParameterFieldSurvivesTheBlobConversion) \
|
||||
X(SamplerEmit, PaddingCannotChangeTheHash) \
|
||||
X(SamplerEmit, TwoIdenticalSamplersShareOneCso) \
|
||||
X(SamplerEmit, ABorderColorFormChangeAloneMintsANewCso) \
|
||||
X(SamplerEmit, AHashCollisionDoesNotAliasTwoSamplerStates) \
|
||||
X(SamplerEmit, AViewIsReIssuedOnTheSameHandleWhenItsRestrictionsMove) \
|
||||
X(SamplerEmit, AnUnchangedTextureReIssuesNothing) \
|
||||
X(SamplerEmit, OnlyTheProgramResolvedUnitsAreEmitted) \
|
||||
X(SamplerEmit, AnUnchangedSetEmitsNothing) \
|
||||
X(SamplerEmit, ARedundantRebindOfTheSameSamplerEmitsNothing) \
|
||||
X(SamplerEmit, ABoundSamplerStateHoldsItsCsoUntilTheUnitMoves) \
|
||||
X(SamplerEmit, AReferencedCsoIsNeverTheLruVictim) \
|
||||
X(SamplerEmit, AFullyPinnedCacheMintsBeyondItsCapacityAndCountsIt) \
|
||||
X(SamplerEmit, AReleaseThisCacheNeverHandedOutIsCountedRatherThanAbsorbed) \
|
||||
X(SamplerEmit, AResolvedSamplerViewMarksItsTextureAsSamplerBound)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_SAMPLER_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
|
||||
namespace {
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
@@ -1284,7 +1221,6 @@ namespace {
|
||||
GL::UseProgram(0);
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
namespace fs = std::filesystem;
|
||||
@@ -1305,11 +1241,9 @@ int main(int argc, char** argv) {
|
||||
// the library's own, not a copy.
|
||||
g_logPath = MobileGL::MG_Util::Debug::RoleLogPath(g_logPath.c_str(),
|
||||
MobileGL::MG_Util::Debug::LogRole::Client);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// ONE process-wide context for the whole suite, because half these cases need a really
|
||||
// linked program and glslang lives behind this call. Each case uses GL names of its own.
|
||||
MobileGL::Initialize();
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -49,7 +49,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include "Init.h"
|
||||
#include <Config.h>
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere else,
|
||||
@@ -66,7 +65,6 @@
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
#include <MG_Pipe/PipeRoute.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -83,25 +81,6 @@ namespace {
|
||||
}
|
||||
} // namespace
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
// G2/G14: the pull build gets the same ctest names, skipping.
|
||||
#define MGL_SHADER_BUFFER_EMIT_TEST_LIST(X) \
|
||||
X(ShaderBufferEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) \
|
||||
X(ShaderBufferEmit, AnUntouchedClassEmitsNothingWithoutHashing) \
|
||||
X(ShaderBufferEmit, ABaseBindingTravelsAsWholeBufferAndARangeBindingTravelsResolved) \
|
||||
X(ShaderBufferEmit, OnlyTheWritableClassesSetAMaskAndItReachesTheLastPoint) \
|
||||
X(ShaderBufferEmit, EachClassLatchesItsOwnSuppressorSlot) \
|
||||
X(ShaderBufferEmit, TheAppliedWindowIsPerClassAndTheSerialMovesOnEveryRecord) \
|
||||
X(ShaderBufferEmit, AWindowPastTheCapacityOrAnUnknownClassIsRefusedRatherThanStored) \
|
||||
X(ShaderBufferEmit, AResetApplierCarriesNoBindingPointStateOverAndTheSerialAdvances)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_SHADER_BUFFER_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
} // namespace
|
||||
#else
|
||||
|
||||
namespace {
|
||||
namespace GL = MobileGL::MG_Impl::GLImpl;
|
||||
@@ -485,7 +464,6 @@ namespace {
|
||||
<< "ADVANCED, never zeroed: no value this counter has handed a twin may come back";
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
namespace fs = std::filesystem;
|
||||
@@ -506,9 +484,7 @@ int main(int argc, char** argv) {
|
||||
// the library's own, not a copy.
|
||||
g_logPath = MobileGL::MG_Util::Debug::RoleLogPath(g_logPath.c_str(),
|
||||
MobileGL::MG_Util::Debug::LogRole::Client);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MobileGL::Initialize();
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -36,10 +36,8 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/SlotAllocator.h>
|
||||
#include <MG_State/GLState/VertexArrayState/VertexArrayObject.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -55,9 +53,6 @@ namespace {
|
||||
}
|
||||
|
||||
TEST(SlotAllocator, GenMovesOnlyOnSlotReuse) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
MGPipeSlotAllocator allocator;
|
||||
|
||||
const MGPipeHandle first = allocator.Allocate(MGPipeKind::Buffer);
|
||||
@@ -100,13 +95,9 @@ namespace {
|
||||
EXPECT_EQ(texture.Gen, 0u);
|
||||
EXPECT_TRUE(allocator.IsLive(MGPipeKind::Texture, texture));
|
||||
EXPECT_TRUE(allocator.IsLive(MGPipeKind::Buffer, reused));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(SlotAllocator, FreedSlotComesBackBeforeHighWaterGrows) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
MGPipeSlotAllocator allocator;
|
||||
|
||||
MGPipeHandle handles[8];
|
||||
@@ -139,13 +130,9 @@ namespace {
|
||||
EXPECT_EQ(allocator.HighWater(MGPipeKind::Framebuffer), 0u);
|
||||
EXPECT_EQ(allocator.LiveCount(MGPipeKind::Framebuffer), 0u);
|
||||
EXPECT_EQ(allocator.FreeCount(MGPipeKind::Framebuffer), 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(SlotAllocator, SlotZeroIsNeverHandedOut) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
MGPipeSlotAllocator allocator;
|
||||
for (SizeT kindIndex = 1; kindIndex < MGPipeSlotAllocator::kKindCount; ++kindIndex) {
|
||||
const MGPipeKind kind = static_cast<MGPipeKind>(kindIndex);
|
||||
@@ -162,13 +149,9 @@ namespace {
|
||||
// Freeing a slot never puts 0 on the free list, so a churned kind still starts at 1.
|
||||
const MGPipeHandle again = allocator.Allocate(MGPipeKind::Buffer);
|
||||
EXPECT_EQ(again.Slot, kMGPipeFirstAllocatableSlot);
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(SlotAllocator, LifetimeIdSurvivesARecycledAddress) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
using MG_State::GLState::VertexArrayObject;
|
||||
|
||||
// The allocation must actually happen: C++ permits eliding a new/delete pair, and an
|
||||
@@ -242,13 +225,9 @@ namespace {
|
||||
// merely unlikely.
|
||||
EXPECT_FALSE(sharp.IsLive(MGPipeKind::VertexElementsCso, first));
|
||||
EXPECT_TRUE(sharp.IsLive(MGPipeKind::VertexElementsCso, second));
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(SlotAllocator, CompositeShaderBandIsNeverHandedOut) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "push not compiled in (MOBILEGL_PIPE_PUSH=OFF)";
|
||||
#else
|
||||
MGPipeSlotAllocator allocator;
|
||||
// Ordinary programs walk the low slots and never enter the band.
|
||||
for (int i = 0; i < 8; ++i) {
|
||||
@@ -287,6 +266,5 @@ namespace {
|
||||
EXPECT_TRUE(MGPipeHandleIsNull(allocator.Allocate(MGPipeKind::ShaderCso)))
|
||||
<< "the allocator handed out a composite-band slot instead of refusing";
|
||||
#endif // the DEBUG guard on the exhaustion arm
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
}
|
||||
} // namespace
|
||||
|
||||
@@ -57,7 +57,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// MOBILEGL_PIPE_POISON is DERIVED in the header below (PipeInputs.h:20-26) and nowhere
|
||||
// else, so a TU that tests it without this include silently reads it as 0. That is
|
||||
// invisible in a push build (where it really is 0) and in a verify build (where
|
||||
@@ -82,7 +81,6 @@
|
||||
// ResourceEmitTest does for the buffer half's walk.
|
||||
#include <MG_Remote/Client/GpuWritePending.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -98,7 +96,6 @@ namespace {
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
std::string ReadLog() {
|
||||
// BOTH ROLES' LOGS (P6). A death test asserts that the CHILD said something; which
|
||||
// role's thread said it is not what these cases are about, and refusals raised on the
|
||||
@@ -182,20 +179,15 @@ namespace {
|
||||
<< "the gate refused without saying what it refused; wanted \"" << tagged << "\"";
|
||||
#endif
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
// See FramebufferEmitTest's twin for why this is a shape pin rather than a placeholder: a
|
||||
// static holding client state whose destructor an exit handler can run is the exit-order
|
||||
// use-after-free this design closed once already.
|
||||
TEST(TextureEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_EQ(&MGPipeTextureEmitterInstance(), &MGPipeTextureEmitterInstance());
|
||||
EXPECT_TRUE(kMGPipeWiredTextureSubsystem == 0 ||
|
||||
kMGPipeWiredTextureSubsystem == kMGPipeSubsystemTextureResources);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no client emitter in a pull build";
|
||||
#endif
|
||||
}
|
||||
|
||||
// ============================================================================
|
||||
@@ -204,52 +196,6 @@ TEST(TextureEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
|
||||
// TEST bodies in one file, and a collision between them is resolved by UNION, never by
|
||||
// choosing a side.
|
||||
// ============================================================================
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
#define MGL_TEXTURE_EMIT_CLIENT_TEST_LIST(X) \
|
||||
X(TextureEmit, EveryTextureTargetMapsToItsOwnResourceTarget) \
|
||||
X(TextureEmit, EveryBindKindSetsItsBindMaskBit) \
|
||||
X(TextureEmit, ABindMaskBitIsStickyAcrossARespecify) \
|
||||
X(TextureEmit, AnImageBoundTextureCarriesTheImageBindableHintForever) \
|
||||
X(TextureEmit, TheUnionBoxAndTheRegionListDescribeTheSameTexels) \
|
||||
X(TextureEmit, AScatteredUploadCarriesTheLevelShadowsStridesAndNotZero) \
|
||||
X(TextureEmit, AWholeLevelUploadCarriesZeroStrides) \
|
||||
X(TextureEmit, MoreWritesThanTheRectListKeepsCrossAsTheExactFootprint) \
|
||||
X(TextureEmit, MoreThanKMaxDirtyRectsCollapsesToTheBoxWithRegionCountZero) \
|
||||
X(TextureEmit, ASinglePartialWriteCarriesItsBoxAsOneRegion) \
|
||||
X(TextureEmit, ALevelTooLargeForTheStageChunkIsCutIntoSlabs) \
|
||||
X(TextureEmit, AnUploadThroughAViewKeysOnTheStorageOwner) \
|
||||
X(TextureEmit, EveryTexturesParamsNameItsBuiltinSamplerCso) \
|
||||
X(TextureEmit, TwoTexturesWithIdenticalSamplingShareOneBuiltinCso) \
|
||||
X(TextureEmit, ADestroyedTextureReleasesItsResourceViewAndBuiltinSamplerSlots) \
|
||||
X(TextureEmit, ARenderbufferRespecifyPublishesItsExtentWithoutAVersionCounter) \
|
||||
X(TextureEmit, ABailedLevelStaysDirtyAndStaysOnTheDrainList) \
|
||||
X(TextureEmit, TheApplierStoresTheRegionListTheEmitterBuiltAndNotAnEmptyOne) \
|
||||
X(TextureEmit, ARefusedUploadLeavesTheLevelDirtyAndOnTheDrainList) \
|
||||
X(TextureEmit, AnImmutableTexturesImageBindableHintReachesTheApplierAfterItsAllocation) \
|
||||
X(TextureEmit, ALodWriteOnTheBuiltinSamplerRepublishesTheParams) \
|
||||
X(TextureEmit, ATexturesBuiltinSamplerHoldsOneCacheReferenceAndSwapsItWithTheContent) \
|
||||
X(TextureEmit, ARecycledTextureSlotDoesNotInheritItsPredecessorsBindMask) \
|
||||
X(TextureEmit, ALevelMarkedCleanIsCollectedAtTheNextDrain) \
|
||||
X(TextureEmit, WithNoBackendConsumerTheFamilyGateIsFalseAndNothingReachesTheApplier) \
|
||||
X(TextureEmit, WithTheSamplerBitClearTheTextureFamilyGateIsFalseAndNothingReachesTheApplier) \
|
||||
X(TextureEmit, \
|
||||
WithTheBufferResourceBitClearTheTextureFamilyGateIsFalseAndNothingReachesTheApplier) \
|
||||
X(TextureEmit, EveryDKTwoDependencyRowGatesItsOwnFamilyAndTheMirrorPairsStayLive) \
|
||||
X(TextureEmit, ALevelDefinedAfterAnEmittedButUnconsumedUploadKeepsThatUpload) \
|
||||
X(TextureEmit, AChainTruncationKeepsTheSurvivingLevelsPendingUploads) \
|
||||
X(TextureEmit, ARedefinitionOfANonBaseLevelAtANewSizeDropsOnlyThatLevelsPendingUpload) \
|
||||
X(TextureEmit, ADeadTexturesHandleResolvesToNothingAndLeavesTheDrainList) \
|
||||
X(TextureEmit, ATextureRecycledOntoADeadSlotDoesNotInheritTheDrainEntry) \
|
||||
X(TextureEmit, ADeadRenderbuffersEntryIsRetiredWithItsSlot) \
|
||||
X(TextureEmit, ARefusedParamsRecordDoesNotAdvanceTheLatch) \
|
||||
X(TextureEmit, ADeadTexturesSamplerViewLatchIsRetiredAtItsDeath) \
|
||||
X(TextureEmit, ATextureBornBeforeTheConsumerRegisteredGetsItsRecordFromItsFirstParamsPublication)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_TEXTURE_EMIT_CLIENT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
namespace {
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
using MG_State::GLState::MipmapDirtyRegion;
|
||||
@@ -686,9 +632,7 @@ TEST(TextureEmit, ASinglePartialWriteCarriesItsBoxAsOneRegion) {
|
||||
// * EACH PIECE CARRIES AT LEAST ONE REGION, with the LEVEL's pitches - RegionCount == 0 is the
|
||||
// whole-level spelling, so a piece with an empty tail would be read as one.
|
||||
TEST(TextureEmit, ALevelTooLargeForTheStageChunkIsCutIntoSlabs) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no emitter in this build";
|
||||
#elif !MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if !MOBILEGL_BUILD_DISAGGREGATED
|
||||
GTEST_SKIP() << "there is no stage segment to size a content chunk against without the "
|
||||
"transport built in";
|
||||
#else
|
||||
@@ -1982,7 +1926,6 @@ TEST(TextureEmit, ATextureInASecondShareGroupNamesABuiltinSamplerItsOwnGroupHold
|
||||
first.reset();
|
||||
}
|
||||
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// =========================================================================================
|
||||
// The APPLIER's half of the texture family (the wire commits'): set_texture_params on the
|
||||
@@ -1992,7 +1935,6 @@ TEST(TextureEmit, ATextureInASecondShareGroupNamesABuiltinSamplerItsOwnGroupHold
|
||||
// is the client package's and lands beside these.
|
||||
// =========================================================================================
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
constexpr Uint16 kTex2D = static_cast<Uint16>(MGPipeResourceTarget::Tex2D);
|
||||
|
||||
@@ -2057,16 +1999,12 @@ namespace {
|
||||
return MGPipeApplier().TextureResources[slot];
|
||||
}
|
||||
} // namespace
|
||||
#endif
|
||||
|
||||
// set_texture_params IS ADDRESSED BY RESOURCE AND BY NOTHING ELSE, which is the whole reason
|
||||
// the call exists: a texture that is only an FBO attachment, only an image-unit binding or
|
||||
// only a glCopyImageSubData endpoint has no sampler view to hang its parameters on. Deleting
|
||||
// the store or the ParamsSerial bump leaves this red.
|
||||
TEST(TextureEmit, ATexturesParametersLandOnItsOwnRecordAndMoveOnlyTheirOwnSerial) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{7, 3};
|
||||
const MGPipeHandle sampler{2, 1};
|
||||
@@ -2106,7 +2044,6 @@ TEST(TextureEmit, ATexturesParametersLandOnItsOwnRecordAndMoveOnlyTheirOwnSerial
|
||||
// is a refusal rather than a parameter push onto somebody else's record.
|
||||
MGPipeApplySetTextureParams(TextureParams(MGPipeHandle{9, 1}, sampler, 1));
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, refusedBefore + 2);
|
||||
#endif
|
||||
}
|
||||
|
||||
// EVERY ITextureObject OWNS A SamplerObject, so a null built-in sampler CSO is not "no
|
||||
@@ -2114,9 +2051,6 @@ TEST(TextureEmit, ATexturesParametersLandOnItsOwnRecordAndMoveOnlyTheirOwnSerial
|
||||
// state the unit last left behind. It is the corrupt-record verdict rather than the dropped-
|
||||
// call one, so it must NOT be counted as a refusal.
|
||||
TEST(TextureEmit, ARecordWithNoBuiltinSamplerCsoIsRefusedNamingTheTexture) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{6, 2};
|
||||
MGPipeApplyResourceCreate(TextureDesc(texture, 0, 77));
|
||||
@@ -2132,7 +2066,6 @@ TEST(TextureEmit, ARecordWithNoBuiltinSamplerCsoIsRefusedNamingTheTexture) {
|
||||
EXPECT_EQ(TextureRecordOf(6).ParamsSerial, 1u);
|
||||
EXPECT_EQ(MGPipeApplier().RefusedObjectCalls, refusedBefore)
|
||||
<< "a corrupt record is not a dropped call and must not be counted as one";
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-D5's safety net. The client clears its own dirty flags AT EMISSION and the backend's
|
||||
@@ -2141,9 +2074,6 @@ TEST(TextureEmit, ARecordWithNoBuiltinSamplerCsoIsRefusedNamingTheTexture) {
|
||||
// side says "box only" the entry becomes box only - which is the frontend's own model, where
|
||||
// zero rects means "upload the union box instead" and covers every reason at once.
|
||||
TEST(TextureEmit, AnAccumulatedUploadUnionsItsBoxesAndCollapsesToTheBoxWhenARectListCannotDescribeIt) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{4, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2186,16 +2116,12 @@ TEST(TextureEmit, AnAccumulatedUploadUnionsItsBoxesAndCollapsesToTheBoxWhenARect
|
||||
ASSERT_EQ(TextureRecordOf(4).PendingUploads.size(), 2u);
|
||||
EXPECT_EQ(TextureRecordOf(4).PendingUploads[1].Level, 3u);
|
||||
EXPECT_EQ(TextureRecordOf(4).PendingUploads[0].UnionBox.W, 64u) << "level 3 rewrote level 0's box";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The texture half of the sub-data validator. Each of its four statements is about a record
|
||||
// that would make the server upload texels it was never told about, or read a tail it was not
|
||||
// given; removing any one of them leaves this red.
|
||||
TEST(TextureEmit, TheSubDataValidatorRefusesALevelABoxAndARegionTheRecordCannotDescribe) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{5, 2};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2242,7 +2168,6 @@ TEST(TextureEmit, TheSubDataValidatorRefusesALevelABoxAndARegionTheRecordCannotD
|
||||
EXPECT_EQ(TextureRecordOf(5).PendingUploads.size(), 1u)
|
||||
<< "a refused record was accumulated anyway";
|
||||
EXPECT_EQ(TextureRecordOf(5).Serial, serialBefore) << "not one refusal may move the serial";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A WHOLE-RESOURCE respecify - a null MGPRespecifiedLevel*, which is every glBufferData,
|
||||
@@ -2252,9 +2177,6 @@ TEST(TextureEmit, TheSubDataValidatorRefusesALevelABoxAndARegionTheRecordCannotD
|
||||
// whole-resource arm ONLY, and its per-level twin below proves that the other arm may not do
|
||||
// this.
|
||||
TEST(TextureEmit, ARespecifyDropsThePendingUploadsAgainstTheStorageItReplaces) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{3, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2268,7 +2190,6 @@ TEST(TextureEmit, ARespecifyDropsThePendingUploadsAgainstTheStorageItReplaces) {
|
||||
EXPECT_TRUE(TextureRecordOf(3).PendingUploads.empty())
|
||||
<< "a 64-wide box survived onto an 8-wide store";
|
||||
EXPECT_EQ(TextureRecordOf(3).Desc.Width, 8u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// C1, AND IT IS THE CANONICAL MIP-BUILDING SEQUENCE. A mutable texture defines its levels one
|
||||
@@ -2280,9 +2201,6 @@ TEST(TextureEmit, ARespecifyDropsThePendingUploadsAgainstTheStorageItReplaces) {
|
||||
// build, with no counter and no log line: this case goes red the moment the level scoping is
|
||||
// dropped and green with it.
|
||||
TEST(TextureEmit, ARespecifyOfOneLevelKeepsThePendingUploadsOfTheOthers) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{10, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2348,7 +2266,6 @@ TEST(TextureEmit, ARespecifyOfOneLevelKeepsThePendingUploadsOfTheOthers) {
|
||||
EXPECT_FALSE(entry.UploadTarget == kTex2D && entry.Level == 1u)
|
||||
<< "the redefined (upload target, level) survived";
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
// THE OTHER HALF OF THE LEVEL-SCOPED ERASE KEY (wire review v2 MINOR-1, integrator grant).
|
||||
@@ -2372,9 +2289,6 @@ TEST(TextureEmit, ARespecifyOfOneLevelKeepsThePendingUploadsOfTheOthers) {
|
||||
// above, so this is a real storage redefinition and not ID-18 M4's metadata update - which
|
||||
// drops nothing at all and would make the case vacuous in the other direction.
|
||||
TEST(TextureEmit, ARespecifyOfOneCubeFaceKeepsTheOtherFacesUploadOfTheSameLevel) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{11, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2452,7 +2366,6 @@ TEST(TextureEmit, ARespecifyOfOneCubeFaceKeepsTheOtherFacesUploadOfTheSameLevel)
|
||||
EXPECT_EQ(TextureRecordOf(11).PendingUploads[0].Level, 0u);
|
||||
EXPECT_EQ(TextureRecordOf(11).PendingUploads[0].UnionBox.W, 64u)
|
||||
<< "the untouched face's box was rewritten by the other face's redefinition";
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-D5 step 1 says the client clears its dirty flag "only for levels whose record the applier
|
||||
@@ -2461,9 +2374,6 @@ TEST(TextureEmit, ARespecifyOfOneCubeFaceKeepsTheOtherFacesUploadOfTheSameLevel)
|
||||
// shipped push build a refused upload and an accumulated one are otherwise identical from the
|
||||
// call site. An emitter that clears on the strength of having emitted loses those texels.
|
||||
TEST(TextureEmit, TheSubDataCallAnswersWhetherTheRecordWasAcceptedSoTheClientCanClearItsFlag) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{8, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2500,7 +2410,6 @@ TEST(TextureEmit, TheSubDataCallAnswersWhetherTheRecordWasAcceptedSoTheClientCan
|
||||
EXPECT_TRUE(MGPipeApplyResourceSubData(write, texels));
|
||||
write.Res = MGPipeHandle{8, 9};
|
||||
EXPECT_FALSE(MGPipeApplyResourceSubData(write, texels));
|
||||
#endif
|
||||
}
|
||||
|
||||
// m3. MGPSubData::Target is PACKED - low byte = MGPipeResourceTarget, high byte = the cube-face
|
||||
@@ -2510,9 +2419,6 @@ TEST(TextureEmit, TheSubDataCallAnswersWhetherTheRecordWasAcceptedSoTheClientCan
|
||||
// ResourceTableForTarget makes for returning null on an unknown enumerator, and the same
|
||||
// verdict: acting outside the storage the record names is corruption, not a dropped call.
|
||||
TEST(TextureEmit, ASubDataRecordWhoseResourceTargetNamesNoTextureIsRefusedRatherThanRouted) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{9, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2550,16 +2456,12 @@ TEST(TextureEmit, ASubDataRecordWhoseResourceTargetNamesNoTextureIsRefusedRather
|
||||
EXPECT_EQ(TextureRecordOf(9).Serial, serialBefore) << "not one refusal may move the serial";
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, refusedBefore)
|
||||
<< "a corrupt record is not a dropped call and must not be counted as one";
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-J4, for the kind that made the rule matter: a TEXTURE lives in a share group exactly as a
|
||||
// buffer does, so its record - and the parameters and the pending uploads that ride on it -
|
||||
// outlives a make-current, and only the applier's own teardown takes it.
|
||||
TEST(TextureEmit, TheTextureRecordAndItsParamsAndPendingUploadsSurviveAMakeCurrent) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{2, 5};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2585,7 +2487,6 @@ TEST(TextureEmit, TheTextureRecordAndItsParamsAndPendingUploadsSurviveAMakeCurre
|
||||
// And the teardown scope - the only other thing that clears a record - does take it.
|
||||
MGPipeApplierReleaseObjectRecords();
|
||||
EXPECT_TRUE(MGPipeApplier().TextureResources.empty());
|
||||
#endif
|
||||
}
|
||||
|
||||
// ID-18 M4, AND IT IS THE ONE ARM AN IMMUTABLE TEXTURE HAS. A sticky BindMask /
|
||||
@@ -2598,9 +2499,6 @@ TEST(TextureEmit, TheTextureRecordAndItsParamsAndPendingUploadsSurviveAMakeCurre
|
||||
// system moved. A mask change landing between a glTexSubImage2D and the sync that consumes it
|
||||
// must not eat those texels, which is C1's bug with a different trigger and just as silent.
|
||||
TEST(TextureEmit, ARespecifyThatRedefinesNoStorageCarriesTheStickyMaskAndKeepsThePendingUploads) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{11, 1};
|
||||
const Uint8 texels[4096] = {};
|
||||
@@ -2670,7 +2568,6 @@ TEST(TextureEmit, ARespecifyThatRedefinesNoStorageCarriesTheStickyMaskAndKeepsTh
|
||||
EXPECT_TRUE(TextureRecordOf(11).PendingUploads.empty())
|
||||
<< "a 64-wide box survived a redefinition onto a 32-wide level";
|
||||
EXPECT_EQ(MGPipeApplier().RefusedResourceCalls, 0u);
|
||||
#endif
|
||||
}
|
||||
|
||||
// D-D5 step 1 again, for the two calls that DEFINE the storage an upload lands in (ID-18 M3).
|
||||
@@ -2680,9 +2577,6 @@ TEST(TextureEmit, ARespecifyThatRedefinesNoStorageCarriesTheStickyMaskAndKeepsTh
|
||||
// clear a level's dirty flags, or to advance its own descriptor dedupe, on the strength of
|
||||
// having emitted has lost those texels for good.
|
||||
TEST(TextureEmit, TheCreateAndRespecifyCallsAnswerWhetherTheRecordWasAccepted) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
ApplierGuard guard;
|
||||
const MGPipeHandle texture{12, 1};
|
||||
EXPECT_TRUE(MGPipeApplyResourceCreate(TextureDesc(texture, 0, 161)));
|
||||
@@ -2717,7 +2611,6 @@ TEST(TextureEmit, TheCreateAndRespecifyCallsAnswerWhetherTheRecordWasAccepted) {
|
||||
MGPResourceDesc deadBuffer = buffer;
|
||||
deadBuffer.Resource.Gen = 7;
|
||||
EXPECT_FALSE(MGPipeApplyResourceRespecify(deadBuffer, nullptr));
|
||||
#endif
|
||||
}
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
@@ -2732,7 +2625,6 @@ int main(int argc, char** argv) {
|
||||
#else
|
||||
setenv("MOBILEGL_LOG_FILE_PATH", g_logPath.c_str(), 1);
|
||||
#endif
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// ID-39: A BACKEND IS PRESENT, for the whole binary. Since ID-39 every P4a-family entry
|
||||
// point in MG_Pipe/PipeApply.cpp declines a record - and the client's own gate in
|
||||
// MG_Impl/Pipe/PipeFill.cpp emits none at all - when no backend has registered
|
||||
@@ -2745,7 +2637,6 @@ int main(int argc, char** argv) {
|
||||
// WithNoBackendConsumerTheFamilyGateIsFalseAndNothingReachesTheApplier takes it away again.
|
||||
static const MGPipeResourceOps kConsumerPresent{};
|
||||
MGPipeSetResourceOps(&kConsumerPresent);
|
||||
#endif
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
const int rc = RUN_ALL_TESTS();
|
||||
fs::remove(path, ec);
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <Config.h>
|
||||
// P5e (sb): the binding-point shutter cases drive the REAL glBindBufferBase entry point,
|
||||
// because the claim they make is about what a frontend mutator publishes.
|
||||
@@ -36,7 +35,6 @@
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -47,69 +45,6 @@ namespace {
|
||||
EXPECT_EQ(kMGPipeSubsystemsMigratedAtP2 & kMGPipeBehaviourNoCsoContentAddressing, 0ull);
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 REQUIRES THE PULL AND PUSH CTEST NAME SETS TO BE IDENTICAL, name for name. A
|
||||
// push-only case therefore cannot be ABSENT from a pull build; it has to be there and
|
||||
// SKIP, which is the shape PipeInputsTest.cpp established for the same reason. This list
|
||||
// declares exactly the suite.name pairs the push build gets from the real cases below, so
|
||||
// a case added on one side and forgotten on the other shows up as a ctest-name diff
|
||||
// rather than as a test that silently is not there.
|
||||
#define MGL_TRACKER_TEST_LIST(X) \
|
||||
X(TrackerAggregates, EveryAggregateStartsAtZero) \
|
||||
X(TrackerAggregates, AVertexArrayAttributeMovesOnlyTheVaoAggregate) \
|
||||
X(TrackerAggregates, AFramebufferObjectWriteMovesOnlyTheFramebufferAggregate) \
|
||||
X(TrackerAggregates, AFramebufferDefaultSetterMovesOnlyTheFramebufferAggregate) \
|
||||
X(TrackerAggregates, ATextureContentWriteMovesOnlyTheContentAggregate) \
|
||||
X(TrackerAggregates, ATextureParameterMovesOnlyTheParamsAggregate) \
|
||||
X(TrackerAggregates, ASamplerParameterMovesOnlyTheParamsAggregate) \
|
||||
X(TrackerAggregates, ABufferRespecifyMovesOnlyTheBufferAggregate) \
|
||||
X(TrackerAggregates, AVertexAttribDefaultMovesOnlyItsOwnAggregate) \
|
||||
X(TrackerAggregates, ANoteWithoutALiveContextIsANoOp) \
|
||||
X(TrackerWalk, EveryBitHasAName) \
|
||||
X(TrackerWalk, OnlyTheFiveEmittedBitsNameASubsystem) \
|
||||
X(TrackerWalk, TheFirstWalkOnAFreshContextPublishesEverything) \
|
||||
X(TrackerWalk, SteadyStateEmitsNothing) \
|
||||
X(TrackerWalk, BlendToggleReusesTwoCsos) \
|
||||
X(TrackerWalk, ViewportDoesNotMintACso) \
|
||||
X(TrackerWalk, WrapAroundRePushesButNeverMisses) \
|
||||
X(TrackerWalk, AggregateGenerationCatchesABoundTextureMoving) \
|
||||
X(TrackerWalk, ANaNPatchLevelEqualsItselfAndDoesNotFireForever) \
|
||||
X(TrackerWalk, ThePixelPackShutterIsAByteCompareOfThePackHalfOnly) \
|
||||
X(TrackerWalk, TheFireTalliesOnlyRunWhilePipeStatsIsOn) \
|
||||
X(TrackerWalk, TheIndexBufferBitDoesNotFireOnAnUnrelatedBufferWrite) \
|
||||
X(TrackerWalk, TheIndexBufferBitFiresWhenTheSlotVersionWrapsOntoADifferentBuffer) \
|
||||
X(TrackerWalk, ABaseInstanceSurvivesTheFirstWalkOnAFreshContext) \
|
||||
X(TrackerWalk, ASamplerBindAloneFiresTheSamplerStateBit) \
|
||||
X(TrackerWalk, ARedundantDefaultBindStillPublishesAGrowingSamplerWindow) \
|
||||
X(TrackerWalk, ARestagedProgramPipelineFiresTheProgramBits) \
|
||||
X(TrackerWalk, ARelinkOfAStageProgramFiresTheProgramBits) \
|
||||
X(TrackerWalk, UseProgramZeroLeavesTheBoundPipelineDrivingTheProgramBits) \
|
||||
X(TrackerAggregates, ATextureStorageDefinitionMovesTheFramebufferAggregateToo) \
|
||||
X(TrackerAggregates, ARenderbufferStorageDefinitionMovesTheFramebufferAggregate) \
|
||||
X(TrackerWalk, AProgramSwitchAloneFiresTheSamplerViewBit) \
|
||||
X(TrackerWalk, ATextureParameterAloneFiresTheSamplerViewBit) \
|
||||
X(TrackerWalk, AProgramSwitchBetweenEqualImageUnitCountersFiresTheShaderImageBit) \
|
||||
X(TrackerWalk, ARebindOfOneUniformPointToADifferentBufferFiresTheConstBufferBit) \
|
||||
X(TrackerWalk, TheBindingPointBitsDoNotFireOnAnUnrelatedBufferWrite) \
|
||||
X(TrackerAttribPayload, AFloatWriteCarriesTheFloatBitsAndNamesItsClass) \
|
||||
X(TrackerAttribPayload, AnIntWriteCarriesTheIntWordsAndNamesItsClass) \
|
||||
X(TrackerAttribPayload, AUintWriteCarriesTheUintWordsAndNamesItsClass) \
|
||||
X(TrackerAttribPayload, TheSameNumbersWrittenThroughADifferentClassAreADifferentValue) \
|
||||
X(TrackerShippedEmitter, ABlendToggleThroughTheValidatePointMintsTwoCsos) \
|
||||
X(TrackerShippedEmitter, CollidingVaoShuttersStillPublishTheCurrentElementsAndBufferWindow) \
|
||||
X(TrackerShippedEmitter, TheSteadyStateThroughTheValidatePointEmitsNothing) \
|
||||
X(TrackerShippedEmitter, APushedAttributeDefaultTheApplierCannotReproduceIsRepaired) \
|
||||
X(TrackerShippedEmitter, AViewportThroughTheValidatePointMintsNoCso) \
|
||||
X(TrackerShippedEmitter, AClipDistanceEnableReArmsTheResidualBlock) \
|
||||
X(TrackerShippedEmitter, AFreshContextRepublishesEveryVertexAttributeDefault) \
|
||||
X(TrackerShippedEmitter, AFreshContextResetsTheApplierWithTheRenderStateSubsystemOff) \
|
||||
X(TrackerShippedEmitter, ABaseInstancedDrawAfterAMakeCurrentPublishesItsOwnBaseInstance)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_TRACKER_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
|
||||
using MG_State::GLState::TextureObjectBase;
|
||||
@@ -1369,5 +1304,4 @@ namespace {
|
||||
MG_State::pGLContext = Move(parked);
|
||||
}
|
||||
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
@@ -47,7 +47,6 @@
|
||||
|
||||
#include "Includes.h"
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <algorithm>
|
||||
|
||||
#include <Config.h>
|
||||
@@ -58,7 +57,6 @@
|
||||
#include <MG_Pipe/PipeMutation.h>
|
||||
#include <MG_State/GLState/Core.h>
|
||||
#include <MG_State/GLState/StateObjectDeathNotice.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
using namespace MobileGL::MG_Pipe;
|
||||
@@ -92,9 +90,6 @@ namespace {
|
||||
// TheObjectRecordsSurviveAMakeCurrentAndOnlyTheWorkingStateIsReset is where that is driven
|
||||
// with live records in the table.
|
||||
TEST(VertexInputEmit, AResetApplierCarriesNoVertexInputStateOver) {
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: there is no applier in this build";
|
||||
#else
|
||||
MGPipeApplierState& applier = MGPipeApplier();
|
||||
applier.BoundVertexElements = MGPipeHandle{7, 3};
|
||||
applier.VertexBufferStart = 1;
|
||||
@@ -118,29 +113,8 @@ namespace {
|
||||
EXPECT_EQ(MGPipeApplier().IndexBufferSerial, 44u);
|
||||
EXPECT_GT(MGPipeApplier().VertexBuffersSerial, 42u);
|
||||
EXPECT_GT(MGPipeApplier().IndexBufferSerial, 43u);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if !MOBILEGL_PIPE_PUSH
|
||||
// G2 requires the pull and push ctest name sets to be identical, name for name, so a
|
||||
// push-only case is present and SKIPS rather than being absent.
|
||||
#define MGL_VERTEX_INPUT_EMIT_TEST_LIST(X) \
|
||||
X(VertexInputEmit, EveryAttributeFieldSurvivesTheWireConversion) \
|
||||
X(VertexInputEmit, ABindingModelStrideOfZeroSurvivesAsZero) \
|
||||
X(VertexInputEmit, IsLongAndFloat64TravelSeparately) \
|
||||
X(VertexInputEmit, ABaseInstanceChangeAloneStillEmitsTheVertexBufferSet) \
|
||||
X(VertexInputEmit, AnUnchangedSetWithAnUnchangedBaseInstanceEmitsNothing) \
|
||||
X(VertexInputEmit, TheVertexBufferWindowCoversEveryAttributeTheCsoDeclaresEnabled) \
|
||||
X(VertexInputEmit, RebindingTheSameVaoEmitsABindAndNoCreate) \
|
||||
X(VertexInputEmit, PingPongingBetweenTwoVaosNeverRecreatesEither) \
|
||||
X(VertexInputEmit, DestroyedVertexArraysReturnTheirCsoSlotsAndRecords) \
|
||||
X(VertexInputEmit, ADoubleReleaseOfAVertexElementsSlotIsHarmless)
|
||||
|
||||
#define MGL_DECLARE_PULL_SKIP(Suite, Name) \
|
||||
TEST(Suite, Name) { GTEST_SKIP() << "compiled only under MOBILEGL_PIPE_PUSH"; }
|
||||
MGL_VERTEX_INPUT_EMIT_TEST_LIST(MGL_DECLARE_PULL_SKIP)
|
||||
#undef MGL_DECLARE_PULL_SKIP
|
||||
#else
|
||||
using GLContext = MG_State::GLState::GLContext;
|
||||
using MG_State::GLState::BufferObject;
|
||||
using MG_State::GLState::VertexArrayObject;
|
||||
@@ -684,7 +658,6 @@ namespace {
|
||||
EXPECT_NE(successor.Gen, handle.Gen);
|
||||
slots.Free(MGPipeKind::VertexElementsCso, successor);
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
} // namespace
|
||||
|
||||
int main(int argc, char** argv) {
|
||||
|
||||
@@ -43,12 +43,9 @@
|
||||
#endif
|
||||
|
||||
#include "Includes.h"
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_State/GLState/ProgramState/ProgramArtifactsCodec.h>
|
||||
#endif
|
||||
|
||||
using namespace MobileGL;
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
using namespace MobileGL::MG_State::GLState;
|
||||
|
||||
namespace {
|
||||
@@ -236,14 +233,12 @@ namespace {
|
||||
return spirv;
|
||||
}
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// The round trip, field by field. A re-encode equality alone would prove the codec is
|
||||
// self-consistent and nothing else - a field it skips in BOTH directions round-trips
|
||||
// perfectly - so the members are read back explicitly first, and the byte comparison is the
|
||||
// catch-all underneath them.
|
||||
TEST(ProgramArtifactsCodec, RoundTripsAFullyPopulatedArchive) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
const LinkArtifacts link = MakeLinkArtifacts();
|
||||
const SpirvArtifacts spirv = MakeSpirvArtifacts();
|
||||
|
||||
@@ -324,9 +319,6 @@ TEST(ProgramArtifactsCodec, RoundTripsAFullyPopulatedArchive) {
|
||||
Vector<Uint8> reencoded;
|
||||
EncodeProgramArtifacts(decodedLink, decodedSpirv, reencoded);
|
||||
EXPECT_EQ(reencoded, bytes);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A COMPACT archive - one whose wire form is SMALLER than its in-memory form - is still an archive
|
||||
@@ -339,7 +331,6 @@ TEST(ProgramArtifactsCodec, RoundTripsAFullyPopulatedArchive) {
|
||||
// charge put back to sizeof(Element): the decode answers false. Each case's ASSERT_LT is the
|
||||
// fixture's own proof that it can go red that way.
|
||||
TEST(ProgramArtifactsCodec, ACompactArchiveOfTenShortXfbNamesRoundTrips) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
{
|
||||
LinkArtifacts link{};
|
||||
link.xfbInterfaceNames = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j"};
|
||||
@@ -364,15 +355,11 @@ TEST(ProgramArtifactsCodec, ACompactArchiveOfTenShortXfbNamesRoundTrips) {
|
||||
EncodeProgramArtifacts(decodedLink, decodedSpirv, reencoded);
|
||||
EXPECT_EQ(reencoded, bytes);
|
||||
}
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The same compact shape one level down: a Vector<Vector<unsigned>> element (one SPIR-V module) is
|
||||
// its u64 count on the wire when empty and a 24-byte object in memory.
|
||||
TEST(ProgramArtifactsCodec, ACompactArchiveOfTenEmptySpirvModulesRoundTrips) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
{
|
||||
SpirvArtifacts spirv{};
|
||||
spirv.generatedSpirv.resize(10);
|
||||
@@ -393,16 +380,12 @@ TEST(ProgramArtifactsCodec, ACompactArchiveOfTenEmptySpirvModulesRoundTrips) {
|
||||
EncodeProgramArtifacts(decodedLink, decodedSpirv, reencoded);
|
||||
EXPECT_EQ(reencoded, bytes);
|
||||
}
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// Negative control 1. Every prefix length is checked against the bytes that REMAIN, so a
|
||||
// stream cut anywhere has to come back false with both outputs defaulted - never a partially
|
||||
// filled archive, and never a resize driven by a count the stream cannot back.
|
||||
TEST(ProgramArtifactsCodec, ATruncatedStreamIsRefusedNotGuessed) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
Vector<Uint8> bytes;
|
||||
EncodeProgramArtifacts(MakeLinkArtifacts(), MakeSpirvArtifacts(), bytes);
|
||||
ASSERT_GT(bytes.size(), 64u);
|
||||
@@ -428,9 +411,6 @@ TEST(ProgramArtifactsCodec, ATruncatedStreamIsRefusedNotGuessed) {
|
||||
LinkArtifacts link;
|
||||
SpirvArtifacts spirv;
|
||||
EXPECT_FALSE(DecodeProgramArtifacts(withTail.data(), withTail.size(), link, spirv));
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// A count is not permission to reserve a container larger than the bytes left in the
|
||||
@@ -441,7 +421,6 @@ TEST(ProgramArtifactsCodec, ATruncatedStreamIsRefusedNotGuessed) {
|
||||
// out of bytes, so the decode is false either way. ACountOnlyTheByteBoundAdmitsIsRefusedBeforeItsResize
|
||||
// is the case that goes red.)
|
||||
TEST(ProgramArtifactsCodec, AVectorCountCannotReservePastTheRemainingArchiveBytes) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
Vector<Uint8> bytes;
|
||||
EncodeProgramArtifacts(LinkArtifacts{}, SpirvArtifacts{}, bytes);
|
||||
constexpr SizeT countOffset = sizeof(Uint32) + sizeof(Uint64);
|
||||
@@ -462,9 +441,6 @@ TEST(ProgramArtifactsCodec, AVectorCountCannotReservePastTheRemainingArchiveByte
|
||||
EXPECT_FALSE(DecodeProgramArtifacts(bytes.data(), bytes.size(), link, spirv));
|
||||
EXPECT_TRUE(link.uniformReflection.empty());
|
||||
EXPECT_TRUE(spirv.generatedSpirv.empty());
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// PH-5's DISCRIMINATING control (P7 F2 latch). The case above cannot fail on PH-5's account: its
|
||||
@@ -479,7 +455,7 @@ TEST(ProgramArtifactsCodec, AVectorCountCannotReservePastTheRemainingArchiveByte
|
||||
// resizes to Remaining() elements of sizeof(UniformReflection) each, far past the headroom, and
|
||||
// the child dies of std::bad_alloc. The same shape crosses the wire in PeerLatchTest's
|
||||
// D11ArchiveVectorCount row.
|
||||
#if MOBILEGL_PIPE_PUSH && !defined(_WIN32)
|
||||
#if !defined(_WIN32)
|
||||
namespace {
|
||||
[[noreturn]] void DecodeACountOnlyTheByteBoundAdmitsUnderACapAndExit() {
|
||||
Vector<Uint8> bytes;
|
||||
@@ -512,7 +488,7 @@ namespace {
|
||||
#endif
|
||||
|
||||
TEST(ProgramArtifactsCodec, ACountOnlyTheByteBoundAdmitsIsRefusedBeforeItsResize) {
|
||||
#if MOBILEGL_PIPE_PUSH && !defined(_WIN32)
|
||||
#if !defined(_WIN32)
|
||||
EXPECT_EXIT(DecodeACountOnlyTheByteBoundAdmitsUnderACapAndExit(), ::testing::ExitedWithCode(0), ".*")
|
||||
<< "std::bad_alloc escaping the child is the resize PH-5 exists to refuse: the vector count was "
|
||||
"charged one byte per element instead of its minimum encoded size; exit 3 is a decode that "
|
||||
@@ -525,7 +501,6 @@ TEST(ProgramArtifactsCodec, ACountOnlyTheByteBoundAdmitsIsRefusedBeforeItsResize
|
||||
// Negative control 2: both the version and schema word must refuse mismatches.
|
||||
// Monolith v1 retains the old native-size echo in that second word.
|
||||
TEST(ProgramArtifactsCodec, AVersionMismatchIsRefused) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
Vector<Uint8> bytes;
|
||||
EncodeProgramArtifacts(MakeLinkArtifacts(), MakeSpirvArtifacts(), bytes);
|
||||
ASSERT_GT(bytes.size(), 12u);
|
||||
@@ -547,9 +522,6 @@ TEST(ProgramArtifactsCodec, AVersionMismatchIsRefused) {
|
||||
|
||||
// A null pointer is refused rather than dereferenced.
|
||||
EXPECT_FALSE(DecodeProgramArtifacts(nullptr, 0, link, spirv));
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
// The codec walks the VisitFields tables and nothing else, so what those tables visit IS the
|
||||
@@ -557,7 +529,6 @@ TEST(ProgramArtifactsCodec, AVersionMismatchIsRefused) {
|
||||
// TProgram, which is null for every archived instance by construction and points into an arena
|
||||
// no archive owns. A codec arm for it would be a use-after-free waiting for a cache hit.
|
||||
TEST(ProgramArtifactsCodec, TheTablesVisitEveryMemberExceptTheLiveProgram) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
// P7 OQ-8: 59 members, 58 visited. The 59th is still the live TProgram; the 58th is
|
||||
// storageBlocks, which exists only in this build (ProgramArtifacts.h guards it so the pull
|
||||
@@ -571,13 +542,10 @@ TEST(ProgramArtifactsCodec, TheTablesVisitEveryMemberExceptTheLiveProgram) {
|
||||
EXPECT_EQ(ProgramArtifactsVisitedFieldCount<ResourceReflection>(), 14u);
|
||||
EXPECT_EQ(ProgramArtifactsVisitedFieldCount<XfbVarying>(), 11u);
|
||||
EXPECT_EQ(ProgramArtifactsVisitedFieldCount<TypeFacts>(), 20u);
|
||||
#else
|
||||
GTEST_SKIP() << "MOBILEGL_PIPE_PUSH is off: the archive codec is push-only";
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(ProgramArtifactsCodec, PortableHeaderUsesWireSchemaRatherThanNativeContainerSize) {
|
||||
#if MOBILEGL_PIPE_PUSH && MOBILEGL_BUILD_DISAGGREGATED
|
||||
#if MOBILEGL_BUILD_DISAGGREGATED
|
||||
Vector<Uint8> bytes;
|
||||
EncodeProgramArtifacts(MakeLinkArtifacts(), MakeSpirvArtifacts(), bytes);
|
||||
ASSERT_GT(bytes.size(), 12u);
|
||||
|
||||
@@ -27,11 +27,9 @@
|
||||
#include <MG_State/GLState/FramebufferState/FramebufferObject.h>
|
||||
#include <MG_State/GLState/TextureState/TextureState.h>
|
||||
#include <MG_Test/ScopedPipeVerb.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// P5 b1: MGPipeResourceTrackerInstance(), so the split probe case can ask the PRODUCTION
|
||||
// tracker for a buffer's handle instead of minting one by hand.
|
||||
#include <MG_Impl/Pipe/ResourceTracker.h>
|
||||
#endif
|
||||
#include <MG_Backend/DirectVulkan/Renderer/ProgramFactory.h>
|
||||
#include <MG_Backend/DirectVulkan/Renderer/UniformManager.h>
|
||||
#include <MG_Backend/DirectVulkan/Renderer/VkRenderPassManager.h>
|
||||
@@ -72,7 +70,6 @@
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// PipeApply.h does not guard itself (its push-only property comes from the root
|
||||
// CMakeLists), so it is included from inside this arm and nowhere else.
|
||||
#include <MG_Pipe/PipeApply.h>
|
||||
@@ -118,7 +115,6 @@ namespace {
|
||||
const ::testing::Environment* g_esprytSlotArmEnvironment =
|
||||
::testing::AddGlobalTestEnvironment(new EsprytSlotArmEnvironment());
|
||||
} // namespace
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
namespace {
|
||||
class DynamicParameterBackend final : public MobileGL::MG_Backend::BackendObject {
|
||||
@@ -3174,7 +3170,6 @@ TEST(DirectGLESTextureSync, UnitMemoRefusesToDriveATwinFromAnotherTexture) {
|
||||
MG_Impl::GLImpl::BindTexture(GL_TEXTURE_2D, 0);
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// P5e (tx2), CONTRACT-P5E §4.3: THE HANDLE ARM'S SIBLING OF THE CASE ABOVE, WITH ABA AS THE
|
||||
// HAZARD INSTEAD OF A SILENT SLOT SWAP.
|
||||
//
|
||||
@@ -3256,12 +3251,6 @@ TEST(DirectGLESTextureSync, ARecycledTextureSlotReMintsTheTwinOnTheHandleArm) {
|
||||
|
||||
MG_Pipe::MGPipeSlots().Free(MG_Pipe::MGPipeKind::Texture, second);
|
||||
}
|
||||
#else
|
||||
// G2/G14: the same ctest entry exists in the pull build and skips visibly.
|
||||
TEST(DirectGLESTextureSync, ARecycledTextureSlotReMintsTheTwinOnTheHandleArm) {
|
||||
GTEST_SKIP() << "the by-handle texture twin is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
#endif
|
||||
|
||||
namespace {
|
||||
// What glTexParameteri actually reached the driver, and which backend texture was bound
|
||||
@@ -3357,7 +3346,6 @@ TEST(DirectGLESTextureSync, AnAttachmentOnlyTexturesParametersReachTheDriverWith
|
||||
}
|
||||
ASSERT_NE(twin, nullptr);
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
const MG_Pipe::MGPipeHandle res = registry.HandleOf(texture.get());
|
||||
MG_Pipe::MGPipeHandle builtinSampler = MG_Pipe::kMGPipeNullHandle;
|
||||
if (MG_Backend::DirectGLES::TextureResourceSubsystemEnabled()) {
|
||||
@@ -3408,7 +3396,6 @@ TEST(DirectGLESTextureSync, AnAttachmentOnlyTexturesParametersReachTheDriverWith
|
||||
nullptr)
|
||||
<< "a sampler view was minted for a texture nothing sampled";
|
||||
}
|
||||
#endif
|
||||
|
||||
const SizeT before = params.size();
|
||||
twin->SyncTextureParamsToBackend(texture);
|
||||
@@ -3426,12 +3413,10 @@ TEST(DirectGLESTextureSync, AnAttachmentOnlyTexturesParametersReachTheDriverWith
|
||||
"parameter push is gated on something being bound, which is the deferral G9's public "
|
||||
"scenario cannot observe";
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
if (!MG_Pipe::MGPipeHandleIsNull(builtinSampler)) {
|
||||
MG_Pipe::MGPipeApplyDeleteSamplerState(MG_Pipe::MGPHandleOnly{builtinSampler});
|
||||
MG_Pipe::MGPipeSlots().Free(MG_Pipe::MGPipeKind::SamplerCso, builtinSampler);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
TEST(DirectVulkanSanity, GraphicsSamplerFeedbackOnlyAliasesWritableOverlappingMip) {
|
||||
@@ -3597,7 +3582,6 @@ TEST(GetterSanity, CombinedUniformComponentsSaturateInsteadOfOverflowing) {
|
||||
}
|
||||
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
namespace {
|
||||
// A stand-in frontend object for the twin table. It carries the one thing the table asks of a
|
||||
// state object - GetLifetimeId() - so these cases can pin the identity contract without a
|
||||
@@ -4671,55 +4655,8 @@ TEST(DirectGLESSlotTable, ASavedCopyOfARealRegistryDropsTheTwinOnTheSameNotice)
|
||||
// checks the message and not only the signal, because an operator who is handed a bare
|
||||
// "Subprocess aborted" has been told nothing about which two knobs they set.
|
||||
TEST(DirectGLESSlotTable, AnArmlessKnobCombinationStopsInsteadOfSkippingTheLane) {
|
||||
#if !MOBILEGL_PIPE_LEGACY_MEMOS
|
||||
GTEST_SKIP() << "this build compiles no legacy twin registry, so no knob combination can "
|
||||
"leave the process without an arm";
|
||||
#else
|
||||
using namespace MobileGL;
|
||||
namespace fs = std::filesystem;
|
||||
using MG_Backend::DirectGLES::EsprytSlotArmVerdict;
|
||||
|
||||
// The pure half: all four knob combinations, no process required.
|
||||
EXPECT_EQ(MG_Backend::DirectGLES::ClassifyEsprytSlotArm(true, true), EsprytSlotArmVerdict::Handles);
|
||||
EXPECT_EQ(MG_Backend::DirectGLES::ClassifyEsprytSlotArm(true, false), EsprytSlotArmVerdict::Handles);
|
||||
EXPECT_EQ(MG_Backend::DirectGLES::ClassifyEsprytSlotArm(false, true), EsprytSlotArmVerdict::Legacy);
|
||||
EXPECT_EQ(MG_Backend::DirectGLES::ClassifyEsprytSlotArm(false, false), EsprytSlotArmVerdict::NoArm);
|
||||
|
||||
// Both guards restore on every exit path - a failed ASSERT included - so no later case in
|
||||
// this binary runs on a mutated config or without the operator's file log, and the log
|
||||
// path is unique per process and per case (the round-4 review's minor 5).
|
||||
const ScopedArmlessKnobPair knobs;
|
||||
ASSERT_EQ(MG_Backend::DirectGLES::CurrentEsprytSlotArmVerdict(), EsprytSlotArmVerdict::NoArm);
|
||||
const ScopedLogFileRedirect log(UniqueScratchLogPath("mobilegl-espryt-armless-knobs"));
|
||||
|
||||
// Bring-up's half of the split. It must NAME the knobs and it must RETURN: this call is the
|
||||
// one InitDisplayAndContext() makes, and it runs inside the harness's forked pre-flight
|
||||
// child. If it ever stops again, this line takes the whole binary down and the case is red.
|
||||
// (That the call SITE still makes this call and not the stopping one is
|
||||
// EglBringUpUnderTheArmlessKnobPairReturnsInsteadOfStopping below.)
|
||||
MG_Backend::DirectGLES::DiagnoseEsprytSlotArm();
|
||||
|
||||
#if !defined(_WIN32)
|
||||
// First-use's half: the stop, raised in a forked child so it is a datum rather than the end
|
||||
// of this process. In production the caller is a twin lookup inside a scenario body, where
|
||||
// ctest reports the crash as a FAILING test rather than as a missing GPU.
|
||||
EXPECT_EXIT((void)MG_Backend::DirectGLES::ResolveEsprytSlotTablesArm(),
|
||||
::testing::KilledBySignal(SIGABRT), "");
|
||||
#endif
|
||||
|
||||
const std::string contents = log.Contents();
|
||||
ASSERT_FALSE(contents.empty()) << "neither the diagnosis nor the fatal wrote a line an "
|
||||
"operator could read";
|
||||
|
||||
EXPECT_NE(contents.find("PipeLegacyMemosDisabled"), std::string::npos) << contents;
|
||||
EXPECT_NE(contents.find("MOBILEGL_PIPE_PUSH"), std::string::npos) << contents;
|
||||
EXPECT_NE(contents.find("MOBILEGL_PIPE_LEGACY_MEMOS=0"), std::string::npos) << contents;
|
||||
EXPECT_NE(contents.find("kMGPipeSubsystemEsprytSlots"), std::string::npos) << contents;
|
||||
#if !defined(_WIN32)
|
||||
EXPECT_NE(contents.find("Fatal{"), std::string::npos)
|
||||
<< "the diagnosis was logged but the first-use stop was not: " << contents;
|
||||
#endif
|
||||
#endif // MOBILEGL_PIPE_LEGACY_MEMOS
|
||||
}
|
||||
|
||||
// The two guards the armless cases stand on, pinned on their own: whatever an operator had in
|
||||
@@ -4742,12 +4679,6 @@ TEST(DirectGLESSlotTable, TheArmlessCasesLeaveTheLogPathAndTheConfigAsTheyFoundT
|
||||
{
|
||||
const ScopedArmlessKnobPair knobs;
|
||||
const ScopedLogFileRedirect redirect(UniqueScratchLogPath("mobilegl-espryt-guard"));
|
||||
#if MOBILEGL_PIPE_LEGACY_MEMOS
|
||||
// Only a build with the legacy arm can be left armless; without it the verdict is
|
||||
// Handles whatever the knobs say, and what is pinned here is the restore, not the arm.
|
||||
EXPECT_EQ(MG_Backend::DirectGLES::CurrentEsprytSlotArmVerdict(),
|
||||
MG_Backend::DirectGLES::EsprytSlotArmVerdict::NoArm);
|
||||
#endif
|
||||
EXPECT_EQ(MG_Config::Features.PipePush & MG_Pipe::kMGPipeSubsystemEsprytSlots, 0ull);
|
||||
EXPECT_FALSE(MG_Config::Features.PipeLegacyMemos);
|
||||
EXPECT_STRNE(std::getenv("MOBILEGL_LOG_FILE_PATH"), operatorPath.string().c_str());
|
||||
@@ -4817,17 +4748,6 @@ TEST(DirectGLESSlotTable, EglBringUpUnderTheArmlessKnobPairReturnsInsteadOfStopp
|
||||
"on the armless knob pair again instead of diagnosing it, and the integration "
|
||||
"harness's forked pre-flight turns that stop into a lane that skips every scenario";
|
||||
|
||||
#if MOBILEGL_PIPE_LEGACY_MEMOS
|
||||
// And it diagnosed, by name, on the way through - the operator is told which two knobs
|
||||
// they set before the first draw - without a Fatal{} anywhere in bring-up.
|
||||
const std::string contents = log.Contents();
|
||||
EXPECT_NE(contents.find("PipeLegacyMemosDisabled"), std::string::npos)
|
||||
<< "bring-up returned but did not diagnose the armless pair: " << contents;
|
||||
EXPECT_NE(contents.find("MOBILEGL_PIPE_PUSH"), std::string::npos) << contents;
|
||||
EXPECT_NE(contents.find("MOBILEGL_PIPE_LEGACY_MEMOS=0"), std::string::npos) << contents;
|
||||
EXPECT_EQ(contents.find("Fatal{"), std::string::npos)
|
||||
<< "bring-up wrote a Fatal{} - the stop is back inside EGL bring-up: " << contents;
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -5446,113 +5366,6 @@ TEST(DirectGLESVertexInputDraw, TheIndexArmTakesItsBufferAndItsSerialFromTheReco
|
||||
#endif
|
||||
}
|
||||
|
||||
#else
|
||||
// G2 wants the pull and the push build to list the SAME ctest entries. The twin table only
|
||||
// exists under MOBILEGL_PIPE_PUSH, so in the pull build each case above keeps its name and
|
||||
// skips visibly - a vanishing test is exactly what that gate is there to stop.
|
||||
TEST(DirectGLESSlotTable, ARecycledSlotIsANewHandleAndTheStaleOneResolvesToNothing) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, RepeatedLookupsOfALiveObjectKeepOneHandle) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, FindNeverMutatesTheTable) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, AWholeTableSavesResetsAndRestores) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, TwoTablesOfTheSameKindShareOneSlotAndKeepTheirOwnTwin) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, AnnouncedDeathKeepsObjectChurnFromAccumulatingWithoutASweep) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, GetOrCreateToleratesANullStateObject) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, TheTwinRegistryCasesInThisBinaryRunOnTheHandleArm) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, AnAnnouncedDeathReturnsTheSlotWithoutASweep) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, EveryReKeyedObjectClassAnnouncesItsOwnDeath) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, TheHandleArmInstallsTheDeathNoticeConsumer) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, AnArmlessKnobCombinationStopsInsteadOfSkippingTheLane) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, EverySwitchedOverKindResolvesItsTwinThroughTheHandleArm) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, ANegativeLookupIsNotCachedAcrossAnotherHoldersAcquire) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, OneDeathNoticeDropsTheTwinInEveryHolderOfTheKind) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, ASavedCopyOfARealRegistryDropsTheTwinOnTheSameNotice) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, EglBringUpUnderTheArmlessKnobPairReturnsInsteadOfStopping) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, TheArmlessCasesLeaveTheLogPathAndTheConfigAsTheyFoundThem) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, AGenerationBehindTheLiveTwinIsRefusedRatherThanAdopted) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, ACompositeHandleDoesNotGrowTheOrdinaryTable) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESSlotTable, ADeathNoticeForEveryP4aKindIsIdempotent) {
|
||||
GTEST_SKIP() << "the {slot, gen} twin table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESBufferDrawProbe, ALiveHostMapKeepsTheHandleArmProbeDirtyBetweenTwoDraws) {
|
||||
GTEST_SKIP() << "the handle-keyed resource table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESBufferDrawProbe, UnderSplitTheRecordAloneAnswersTheLiveHostMapQuestion) {
|
||||
GTEST_SKIP() << "the handle-keyed resource table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
|
||||
TEST(DirectGLESBufferDrawProbe, ACapsMaskWithoutTheResourceFamilyEmitsNothingAndCountsTheRefusal) {
|
||||
GTEST_SKIP() << "the handle-keyed resource table is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
// P5e (vi): G2/G14's skip twins for the two record-arm cases above.
|
||||
TEST(DirectGLESVertexInputDraw, TheAttributeWalkTakesItsBuffersFromTheRecordNotTheFrontendVao) {
|
||||
GTEST_SKIP() << "the record arm of the attribute walk is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
TEST(DirectGLESVertexInputDraw, TheIndexArmTakesItsBufferAndItsSerialFromTheRecord) {
|
||||
GTEST_SKIP() << "the record arm of the index-buffer sync is compiled only under MOBILEGL_PIPE_PUSH";
|
||||
}
|
||||
#endif // MOBILEGL_PIPE_PUSH
|
||||
|
||||
// P12 (on-screen server window): A SERVER SESSION ENDS IN A PROCESS THAT OUTLIVES IT.
|
||||
//
|
||||
|
||||
@@ -8,9 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
#include <MG_Pipe/MGPipe.h>
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
#include <MG_Impl/Pipe/PipeFill.h>
|
||||
#endif
|
||||
|
||||
namespace MobileGL::MG_Test {
|
||||
// "This test is standing inside verb X."
|
||||
@@ -43,14 +41,9 @@ namespace MobileGL::MG_Test {
|
||||
class ScopedPipeVerb {
|
||||
public:
|
||||
explicit ScopedPipeVerb([[maybe_unused]] MG_Pipe::MGPipeVerb verb)
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
: m_verb(verb) {
|
||||
MG_Pipe::MGPipeValidateForVerb(m_verb);
|
||||
}
|
||||
#else
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
ScopedPipeVerb(const ScopedPipeVerb&) = delete;
|
||||
ScopedPipeVerb& operator=(const ScopedPipeVerb&) = delete;
|
||||
@@ -59,12 +52,9 @@ namespace MobileGL::MG_Test {
|
||||
// again after the test moved frontend state sees the new values, the way the next GL
|
||||
// entry point's MGP_FILL would.
|
||||
void Renew() {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
MG_Pipe::MGPipeValidateForVerb(m_verb);
|
||||
#endif
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// Leaving bumps the serial and puts the current verb back to "none": every field
|
||||
// this scope stamped goes stale, and a later test that forgets its own declaration
|
||||
// aborts with "<Field>@<none>" rather than with the name of a verb it never issued.
|
||||
@@ -74,6 +64,5 @@ namespace MobileGL::MG_Test {
|
||||
|
||||
private:
|
||||
MG_Pipe::MGPipeVerb m_verb;
|
||||
#endif
|
||||
};
|
||||
} // namespace MobileGL::MG_Test
|
||||
|
||||
@@ -134,19 +134,15 @@ namespace {
|
||||
PS::Init();
|
||||
|
||||
for (Uint32 i = 0; i < 5; ++i) {
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
PS::PublishGauge(PS::Gauge::ServerWaits, static_cast<Uint64>(100 * (i + 1)));
|
||||
#endif
|
||||
PS::OnPresent();
|
||||
}
|
||||
EXPECT_EQ(PS::FrameCount(), 5u);
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// The gauge is a RUN TOTAL: publishing five increasing values leaves the last one,
|
||||
// never their sum. This is the mistake the report's first aggregation script made.
|
||||
// Gauges are push-only (gate G1, see PipeStats.h); the pull flavour keeps the case
|
||||
// registered for name parity and asserts only the window arithmetic above.
|
||||
EXPECT_EQ(PS::GaugeValue(PS::Gauge::ServerWaits), 500u);
|
||||
#endif
|
||||
|
||||
MobileGL::MG_Config::Features.PipeStatsPeriod = saved;
|
||||
PS::Init();
|
||||
@@ -268,7 +264,6 @@ namespace {
|
||||
}
|
||||
EXPECT_NE(line.find("gates["), String::npos) << line;
|
||||
EXPECT_NE(line.find("tex[emit="), String::npos) << line;
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// P2's two render-state CSO counters ride the same line, short-named. Push-only:
|
||||
// the pull build has no CSO to mint and must stay symbol-identical.
|
||||
EXPECT_NE(line.find("cso[csom="), String::npos) << line;
|
||||
@@ -311,7 +306,6 @@ namespace {
|
||||
EXPECT_NE(line.find(" wlivepk="), String::npos) << line;
|
||||
EXPECT_NE(line.find(" wdefpk="), String::npos) << line;
|
||||
EXPECT_NE(line.find(" wdefsync="), String::npos) << line;
|
||||
#endif
|
||||
}
|
||||
|
||||
// Per-frame fields carry two decimals for the same reason acc/draw does: they are small
|
||||
@@ -329,7 +323,6 @@ namespace {
|
||||
EXPECT_NE(line.find("buf=97.14"), String::npos) << line;
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// P6 GATE 8's TWO NUMBERS (CONTRACT-P6.md §9 item 8), and each half is pinned because each
|
||||
// half is a way the deliverable can be wrong without looking wrong.
|
||||
//
|
||||
@@ -435,7 +428,6 @@ namespace {
|
||||
json.find("\"staged-blob-bytes-histogram\""))
|
||||
<< json;
|
||||
}
|
||||
#endif
|
||||
|
||||
// Successive summaries report WINDOWS, not run totals: a run total over a workload that
|
||||
// changes shape (load, then steady state) averages away the very number section 2.3.1
|
||||
@@ -536,7 +528,6 @@ namespace {
|
||||
EXPECT_STREQ(PS::NameOf(PS::ByteClass::StageIndirectCmd), "stage-indirect-cmd");
|
||||
EXPECT_STREQ(PS::NameOf(PS::ByteClass::PersistentMapPush), "persistent-map-push");
|
||||
EXPECT_STREQ(PS::NameOf(PS::ByteClass::ResidualValueBlock), "residual-value-block");
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::RenderStateCsoMints), "render-state-cso-mints");
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::RenderStateCsoBinds), "render-state-cso-binds");
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::MapPersistentRoundtrips), "map-persistent-roundtrips");
|
||||
@@ -556,7 +547,6 @@ namespace {
|
||||
// MEASUREMENTS.md entry will quote.
|
||||
EXPECT_STREQ(PS::NameOf(PS::ByteClass::StageSegmentBytes), "stage-segment-bytes");
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::WireRecords), "wire-records");
|
||||
#endif
|
||||
EXPECT_STREQ(PS::NameOf(PS::Gate::EsprytRenderState), "espryt-render-state");
|
||||
EXPECT_STREQ(PS::NameOf(PS::Gate::EsprytTextureSyncList), "espryt-texture-sync-list");
|
||||
EXPECT_STREQ(PS::NameOf(PS::Gate::EsprytUnitBindingsEpoch), "espryt-unit-bindings-epoch");
|
||||
@@ -575,7 +565,6 @@ namespace {
|
||||
EXPECT_EQ(PS::FrameCount(), PS::SummaryFramePeriod());
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// P8-D: the Magma wire arm's indirect-draw bracket. Its short names are what the create
|
||||
// fixtures' measurement (notes/p8/D.md) reads off the server's line, and its long names are
|
||||
// what Harness/WireIndirectPeek.cpp's readers expect in the JSON dump.
|
||||
@@ -594,5 +583,4 @@ namespace {
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::WireHostWaitsIndirect), "wire-host-waits-indirect");
|
||||
EXPECT_STREQ(PS::NameOf(PS::CallClass::WireHostWaitMicros), "wire-host-wait-us");
|
||||
}
|
||||
#endif
|
||||
} // namespace
|
||||
|
||||
@@ -747,7 +747,6 @@ namespace {
|
||||
return clear;
|
||||
}
|
||||
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// PH-5's RAW-PEER CONTROL, MADE TO DISCRIMINATE. What PH-5 changed (ProgramArtifactsCodec.cpp
|
||||
// TakeCount, 1ae7474d) is the CHARGE for a vector count: it used to be one byte per element
|
||||
// (`count <= Remaining()`), and PH-5 charges each element its minimum encoded size before the
|
||||
@@ -804,7 +803,6 @@ namespace {
|
||||
return Note(r, "prlimit(RLIMIT_AS) write failed"), false;
|
||||
return true;
|
||||
}
|
||||
#endif
|
||||
|
||||
constexpr Uint8 kCreateWindowSurface = static_cast<Uint8>(::MobileGL::Wire::SurfaceOpKind::CreateWindowSurface);
|
||||
|
||||
@@ -1364,7 +1362,6 @@ namespace {
|
||||
r.applied = Emit(c, P::MGPWireOp::MemoryBarrier, &barrier, sizeof(barrier)) ? 1 : 0;
|
||||
return true;
|
||||
}},
|
||||
#if MOBILEGL_PIPE_PUSH
|
||||
// PH-5. Its file is the codec's, not PipeWireCodec.cpp's: the line it ends on is the
|
||||
// decoder's CreateShaderState.Reflection latch, but what it CONTROLS is TakeCount's
|
||||
// element charge (see ArchiveWhoseCountOnlyTheByteBoundAdmits), so the site map does
|
||||
@@ -1383,7 +1380,6 @@ namespace {
|
||||
d.Reflection = c.Encoder().StageBytes(archive.data(), archive.size());
|
||||
return Forge(c, r, P::MGPWireOp::CreateShaderState, Bytes(d));
|
||||
}},
|
||||
#endif
|
||||
{"D11StagedRunPastTheLevelBound", "StagedTextureStore.h", "StagedTextureStore.CopyRunInto",
|
||||
Outcome::Fatal, "Fatal{ProtocolCorruption, \"StagedTextureStore.CopyRunInto\"}", false,
|
||||
[](Client::ClientSession& c, PeerReport& r) {
|
||||
|
||||
Reference in New Issue
Block a user