[Docs, Chore] (docs, tools, MobileGL, scripts, CONTRIBUTING.md, .gitignore): translate the documentation and use US spelling

This commit is contained in:
BZLZHH
2026-10-31 19:58:19 +08:00
parent 47892afddc
commit 4f50bedde0
512 changed files with 2955 additions and 2945 deletions
@@ -915,7 +915,7 @@ TEST_F(BackendObjectEglRegister, APbufferNeedsADisplayASurfaceAndAPositiveExtent
EXPECT_TRUE(Trace().empty());
}
// Re-registering replaces the whole record. A pending destroy is cancelled and
// Re-registering replaces the whole record. A pending destroy is canceled and
// Activated is reset (the next real activation re-probes); the active view is left as it was.
TEST_F(BackendObjectEglRegister, ReRegisteringReplacesTheWholeRecord) {
ASSERT_TRUE(Init());
@@ -930,7 +930,7 @@ TEST_F(BackendObjectEglRegister, ReRegisteringReplacesTheWholeRecord) {
EXPECT_TRUE(WindowIs(b->WindowHandleNow(), kWin1));
EXPECT_TRUE(b->CapsProbed());
EXPECT_TRUE(Trace().empty());
// The cancelled destroy does not complete when the binding goes.
// The canceled destroy does not complete when the binding goes.
EXPECT_TRUE(Release());
EXPECT_TRUE(b->IsRegistered(kS1));
EXPECT_TRUE(Trace().empty());
@@ -814,7 +814,7 @@ void main()
EXPECT_FALSE(Contains(out, "g_image[")) << out;
}
// ...and the suffix is not a licence to accept anything else that ends in one: `iu` is not a
// ...and the suffix is not a license to accept anything else that ends in one: `iu` is not a
// literal, and neither is a bare `u`.
TEST(RemapImageArrayElementUnitsTest, ASuffixAloneDoesNotMakeAnExpressionALiteral) {
const String source = R"(#version 320 es
@@ -919,7 +919,7 @@ void main()
// image ARRAY, and the regression it caused was in the SCALAR images sitting next to one. A
// scalar with an explicit binding has to come out of the whole chain still on ITS OWN unit,
// still spelled once, and named the same thing every stage would name it - it is the array that
// needs repairing, not its neighbour.
// needs repairing, not its neighbor.
TEST(RemapImageArrayElementUnitsTest, AScalarImageWithItsOwnBindingIsUntouchedByTheArrayRepair) {
const String source = R"(#version 320 es
layout(rgba8, binding = 7) uniform highp image2D goku;
@@ -1226,7 +1226,7 @@ void main() { imageStore(uni_image, ivec2(0), uvec4(1u)); }
}
// Never speculatively: `#extension` naming an extension the driver does not advertise is itself a
// compile error, so the caller's "not needed" answer has to be honoured exactly.
// compile error, so the caller's "not needed" answer has to be honored exactly.
TEST(RequestExtendedImageFormatsTest, NotNeededMeansNotEmitted) {
const String source = R"(#version 320 es
layout(rgba8ui, binding = 1) uniform writeonly highp uimage2D uni_image;
@@ -1262,7 +1262,7 @@ void main() { gl_ViewportIndex = gl_InvocationID; EmitVertex(); }
}
// Never speculatively: ARM's compiler hard-errors on an `#extension` naming a string the driver
// does not advertise, so the caller's "not needed" answer has to be honoured exactly. A driver
// does not advertise, so the caller's "not needed" answer has to be honored exactly. A driver
// without the extension gets the LowerViewportIndexPass fallback instead.
TEST(RequestViewportArrayExtensionTest, NotNeededMeansNotEmitted) {
const String source = R"(#version 320 es
@@ -1377,7 +1377,7 @@ void main() { gl_ViewportIndex = 1; gl_PointSize = 2.0; EmitVertex(); }
// Desktop GL makes the tessellation control stage optional and takes the levels from
// PATCH_DEFAULT_OUTER_LEVEL / PATCH_DEFAULT_INNER_LEVEL; ES 3.2 has neither, and rejects a
// program that has an evaluation stage without a control stage - with an EMPTY info log. The
// synthesized stage is what stands in, and it has to MIRROR its two neighbours' gl_PerVertex
// synthesized stage is what stands in, and it has to MIRROR its two neighbors' gl_PerVertex
// rather than pick a shape, because a redeclaration that disagrees with the stage it feeds is an
// ES link error against a program that has nothing else wrong with it.
@@ -1386,7 +1386,7 @@ namespace {
const FloatVec2 kDefaultInner(1.0f, 1.0f);
} // namespace
// The synthesized stage mirrors its neighbours' gl_PerVertex, so it can be the thing that
// The synthesized stage mirrors its neighbors' gl_PerVertex, so it can be the thing that
// declares gl_PointSize - and in ESSL a redeclaration is exactly as illegal as a reference
// without the extension. The directive has to survive being applied to its output.
TEST(RequestPointSizeExtensionTest, CoversAMirroredPassthroughControlStage) {
@@ -1411,7 +1411,7 @@ TEST(PassthroughTessControlEsslTest, DeclaresThePatchSizeAndWritesEveryTessLevel
"gl_TessLevelOuter[3]", "gl_TessLevelInner[0]", "gl_TessLevelInner[1]"}) {
EXPECT_TRUE(Contains(out, String(level) + " = 1.0;")) << level << "\n" << out;
}
// Nothing redeclared when the neighbours redeclared nothing - the driver's own built-in
// Nothing redeclared when the neighbors redeclared nothing - the driver's own built-in
// gl_in/gl_out is then what both sides agree on, and redeclaring is what would break it.
EXPECT_FALSE(Contains(out, "gl_PerVertex")) << out;
}
@@ -9,7 +9,7 @@
// A vertex stage armed with the narrow-integer seeds, through the same steps the DirectGLES build
// takes: the array-input split, the RuntimeWidths pass, ESSL 3.00 emission and the uniform
// promotion. The two widths have to come out as `uniform highp uint` (anything else is read
// uninitialised or at too low a precision) and the result has to be ESSL 3.00 a compiler accepts.
// uninitialized or at too low a precision) and the result has to be ESSL 3.00 a compiler accepts.
// The emission here uses plain ESSL 3.00 options, not the build's whole pass chain; the
// integration lanes run that chain (NarrowIntegerAttributeScenario).
@@ -95,7 +95,7 @@ void main() { color = vec4(a) + vec4(b); }
return result != nullptr ? String(result) : String{};
}
// Declarations of `name` as a uint, whatever their qualifiers or initialiser.
// Declarations of `name` as a uint, whatever their qualifiers or initializer.
SizeT CountUintDeclarations(const String& source, const char* name) {
SizeT count = 0;
for (const char* suffix : {";", " ="}) {
@@ -170,7 +170,7 @@ void main()
// A stage the pass declines must reach the driver exactly as it arrived, not half-rewritten.
// The caller logs the decline and the program still renders - unrouted, which is the old
// behaviour - so a partially edited source here would turn a degradation into a broken shader.
// behavior - so a partially edited source here would turn a degradation into a broken shader.
TEST(ViewportIndexRoutingTest, AStageWithNoEntryPointIsDeclinedWithoutBeingEdited) {
const String before = "#version 320 es\nprecision highp int;\nhighp int f() { return gl_ViewportIndex; }\n";
String source = before;
@@ -38,7 +38,7 @@ namespace {
// Behavior knobs, configured per test before running the probe.
GLint maxVertexSsboBlocks = 4;
// GL_MAX_COMPUTE_WORK_GROUP_COUNT / _SIZE per axis, answered through glGetIntegeri_v.
// Above the GL minimums and distinct per axis, so a loader that left an initialiser in
// Above the GL minimums and distinct per axis, so a loader that left an initializer in
// place or copied one axis into another is caught.
GLint maxComputeWorkGroupCount[3] = {70001, 70002, 70003};
GLint maxComputeWorkGroupSize[3] = {1500, 1501, 100};
@@ -463,7 +463,7 @@ namespace {
// ---- what the located-interface-block probe draws with -------------------------
// Enough of a rasterizer for ProbeLocatedIoBlocksLosePayload to reach a verdict: it
// builds three programs, draws each to a 1x1 target and reads the pixel back, and the
// fake decides what each read returns. Default behaviour is a CONFORMING driver, so
// fake decides what each read returns. Default behavior is a CONFORMING driver, so
// every test that predates this one sees the probe reach "not affected" and no
// capability it asserts on moves.
funcs.glCheckFramebufferStatus = [](GLenum) -> GLenum { return GL_FRAMEBUFFER_COMPLETE; };
@@ -1724,7 +1724,7 @@ TEST(LocatedIoBlockProbe, ReportsTheDefectOnlyWhenTheUnlocatedControlCarriesTheP
// The six per-axis compute limits are the backend-owned answers that cross the MGPipe boundary
// inside MGPCaps (DynamicBackendParameters::MaxComputeWorkGroupCount/Size), so the loader has
// to take EACH axis from glGetIntegeri_v rather than leave an initialiser - or one axis's
// to take EACH axis from glGetIntegeri_v rather than leave an initializer - or one axis's
// answer - in the other slots. The integration side (AdvertisedLimitsScenario) pins the copy
// against the live getter on both backends; this pins the driver-to-caps step on its own.
TEST(ComputeWorkGroupCapabilities, TakesEveryAxisFromTheIndexedQuery) {
@@ -1736,8 +1736,8 @@ TEST(ComputeWorkGroupCapabilities, TakesEveryAxisFromTheIndexedQuery) {
EXPECT_EQ(caps.MaxComputeWorkGroupCount[axis], g_fake.maxComputeWorkGroupCount[axis]) << "axis " << axis;
EXPECT_EQ(caps.MaxComputeWorkGroupSize[axis], g_fake.maxComputeWorkGroupSize[axis]) << "axis " << axis;
}
// The initialisers are the GL 4.3 minimums and every fake answer is above them, so a
// value equal to its initialiser here would mean the query never ran.
// The initializers are the GL 4.3 minimums and every fake answer is above them, so a
// value equal to its initializer here would mean the query never ran.
EXPECT_GT(caps.MaxComputeWorkGroupCount[0], 65535);
EXPECT_GT(caps.MaxComputeWorkGroupSize[2], 64);
}
+2 -2
View File
@@ -1419,7 +1419,7 @@ TEST_F(GeneralBufferTest, General_PersistentExplicitFlushOnlyDirtiesFlushedRange
// The explicit flush is what GL 4.6 6.2.1 promises reaches the store. (Until P13 W6 this also
// asserted that a per-draw sync moved nothing; the record arm's push publishes the map itself,
// so that was the deleted frontend arm's behaviour, not a rule.)
// so that was the deleted frontend arm's behavior, not a rule.)
FlushMappedBufferRange(GL_ARRAY_BUFFER, sizeof(GLint), sizeof(GLint));
EXPECT_GT(bufferObject->GetChangeSerial(), baseSerial);
@@ -2019,7 +2019,7 @@ TEST_F(BufferTest, RedefiningANonAdoptedBufferIsUnchanged) {
// in place and never has a staging copy - so the unmap simply skipped the copy-back
// for a resident store. Residency now also comes from a shader storage binding
// (EnsureGpuResidentStorage at draw time) and from large-store adoption, both of which
// an application then re-initialises through an ordinary map/write/unmap: the
// an application then re-initializes through an ordinary map/write/unmap: the
// conformance suite re-seeds every SSBO that way before each draw, and every re-seed
// after the first draw was dropped on the floor. These pin the landing for each map
// shape, on the backend that writes the coherent mapping in place and on the one that
+2 -2
View File
@@ -208,7 +208,7 @@ TEST_F(SplitBufferSet, Row2AWritableImageBufferTextureIsMarkedByADraw) {
binding = MG_State::GLState::ImageTextureBinding{};
}
// Row 2's BOUND, and it is the half an optimisation is allowed to get wrong in exactly one
// Row 2's BOUND, and it is the half an optimization is allowed to get wrong in exactly one
// direction (P5d round 3, package C). The sweep used to be MAX_TEXTURE_IMAGE_UNITS wide on every
// draw - 2.15% self of the GL thread on the Minecraft inproc profile, in a workload with no image
// binding anywhere - and is now bounded by the frontend's image-unit high-water mark.
@@ -376,7 +376,7 @@ TEST_F(SplitBufferSet, TheAdoptedArmIsNotAMemberAndItIsTheChainRowThatSaysSo) {
// The SET agrees with the predicate, asked through the production entry point rather than by
// reading a member: NoteMapStateChanged is what every one of the five maintenance events
// calls, and it must refuse to enrol an adopted store.
// calls, and it must refuse to enroll an adopted store.
PersistentMapTracker::Instance().NoteMapStateChanged(*adopted);
EXPECT_EQ(PersistentMapTracker::Instance().MemberCount(), 1u)
<< "only the declined twin: enrolling an adopted store would make the push read its "
@@ -843,7 +843,7 @@ TEST_F(FramebufferTest, NonRenderableColorFormatsReportUnsupportedFramebuffer) {
EXPECT_EQ(MG_Impl::GLImpl::GetError(), GL_INVALID_FRAMEBUFFER_OPERATION);
}
// ---- Three-channel colour attachments: the Complementary Reimagined / Iris load failure --------
// ---- Three-channel color attachments: the Complementary Reimagined / Iris load failure --------
//
// Complementary declares colortex1 = RGB8_SNORM and colortex2 = RGB16F. No real OpenGL ES driver
// renders to a three-channel image (EXT_render_snorm covers R/RG/RGBA only; EXT_color_buffer_float
@@ -929,7 +929,7 @@ namespace {
} // namespace
TEST_F(FramebufferTest, ThreeChannelColorAttachmentsAreUnsupportedWithoutTheWidenedSubstitution) {
// The pre-fix behaviour, pinned so a regression is a red test rather than a shaderpack that
// The pre-fix behavior, pinned so a regression is a red test rather than a shaderpack that
// silently stops loading: no caveat capability, so nothing makes these renderable.
ScopedBackendOverride backend(MakeUnique<ThreeChannelAttachmentBackend>(/*substituted=*/false));
@@ -987,7 +987,7 @@ TEST_F(FramebufferTest, TwoAttachmentCompositeFramebufferMatchesIrisComplementar
// buffer's alpha write mask forced off so nothing can move it again.
//
// These cases pin the two halves of that pairing at the seam where they are visible - what the ES
// driver is actually handed - and pin the invariant that the application's own colour mask is
// driver is actually handed - and pin the invariant that the application's own color mask is
// never touched.
namespace {
struct RecordedColorMask {
@@ -1246,7 +1246,7 @@ TEST_F(FramebufferTest, ClearIntoAWidenedDrawBufferKeepsAlphaWritableAndSubstitu
MG_Test::ScopedPipeVerb clear(MG_Pipe::MGPipeVerb::Clear);
MG_Backend::DirectGLES::RenderStateImpl::SyncRenderState(/*forColorClear=*/true);
}
ASSERT_TRUE(g_driverIndexedColorMasks[1].seen) << "the clear must re-push the colour mask";
ASSERT_TRUE(g_driverIndexedColorMasks[1].seen) << "the clear must re-push the color mask";
EXPECT_EQ(g_driverIndexedColorMasks[1].a, GL_TRUE) << "a clear is what puts the 1.0 in the stored alpha";
// The value that clear writes: the application's RGB, alpha replaced by the 1.0 the
@@ -1446,7 +1446,7 @@ TEST_F(FramebufferTest, DualSourceFactorsAreDeclinedEvenWithBlendingDisabled) {
}
// A clear reaches the same block by the same route (SyncRenderState(forColorClear=true)), and
// the flag only steers the alpha-widen colour mask, so it must not reopen this either.
// the flag only steers the alpha-widen color mask, so it must not reopen this either.
MG_Impl::GLImpl::BlendFunc(GL_SRC1_COLOR, GL_ONE_MINUS_SRC1_COLOR);
ResetRecordedBlend();
{
@@ -1529,7 +1529,7 @@ TEST_F(FramebufferTest, FramebufferTextureRejectsAColourAttachmentPastTheLimit)
? static_cast<GLint>(MG_Backend::pActiveBackendObject->GetDynamicParameters().MaxColorAttachments)
: static_cast<GLint>(MG_State::GLState::FramebufferObject::MAX_DRAW_BUFFERS);
ASSERT_GT(limit, 0);
ASSERT_LT(limit, 32) << "the test needs a colour attachment enum past the limit to exist";
ASSERT_LT(limit, 32) << "the test needs a color attachment enum past the limit to exist";
MG_Impl::GLImpl::FramebufferTexture(GL_DRAW_FRAMEBUFFER, static_cast<GLenum>(GL_COLOR_ATTACHMENT0 + limit), texture,
0);
@@ -1584,7 +1584,7 @@ TEST_F(FramebufferTest, FramebufferTextureRejectsALevelTheTextureDoesNotHave) {
// than through the shared helper - so each of them has to be asked separately or one entry point
// answers differently from its aliases. glFramebufferTexture2D is the most-used of the five, and
// the default-framebuffer case is the damaging one: the attach used to succeed and replace
// framebuffer 0's colour attachment, which nothing ever puts back.
// framebuffer 0's color attachment, which nothing ever puts back.
TEST_F(FramebufferTest, FramebufferTexture2DRejectsTheDefaultFramebufferAndBadAttachments) {
GLuint texture = 0;
@@ -1606,7 +1606,7 @@ TEST_F(FramebufferTest, FramebufferTexture2DRejectsTheDefaultFramebufferAndBadAt
EXPECT_EQ(colorAfter.IsTexture(), hadTextureBefore);
if (colorAfter.IsTexture() && hadTextureBefore) {
EXPECT_NE(colorAfter.GetTexture()->GetExternalIndex(), texture)
<< "the refused attach must not have replaced framebuffer 0's colour attachment";
<< "the refused attach must not have replaced framebuffer 0's color attachment";
}
GLuint framebuffer = 0;
@@ -65,7 +65,7 @@
#include <MG_Impl/Pipe/SlotAllocator.h>
#include <MG_Pipe/PipeApply.h>
#include <MG_State/GLState/Core.h>
// create_shader_state takes the two artefact structs by pointer beside the record, so a case
// create_shader_state takes the two artifact structs by pointer beside the record, so a case
// that mints a composite record needs their definitions.
#include <MG_State/GLState/ProgramState/ProgramArtifacts.h>
+8 -8
View File
@@ -13,7 +13,7 @@
// the ARITHMETIC cases run in any push build and say the table PARTITIONS the field set -
// 70 rows, four classes, every BARRIER-PULLED row naming the phase that retires it;
//
// the BEHAVIOUR cases run only in a split build and say the table is LOAD-BEARING - that a
// the BEHAVIOR cases run only in a split build and say the table is LOAD-BEARING - that a
// server verb stamp makes the record-supplied fields readable and withdraws the rest, that a
// retired pointer/forward reads are unconditionally named Fatal on the server, and that
// monolith storage remains readable without ever borrowing a server stamp.
@@ -359,7 +359,7 @@ TEST_F(FieldOwnershipTest, TheAdmittedPullTableIsID84sDerivationAndNotAList) {
}
// ---------------------------------------------------------------------------------------
// The behaviour: the table is load-bearing. Split builds only - it is the server verb stamp
// The behavior: the table is load-bearing. Split builds only - it is the server verb stamp
// that arms all of it, and nothing in a monolith lane stamps.
// ---------------------------------------------------------------------------------------
@@ -371,7 +371,7 @@ TEST_F(FieldOwnershipTest, TheAdmittedPullTableIsID84sDerivationAndNotAList) {
// not an abort: the walk stamps FilledGen from the verb serial whether or not it copied, so the
// field reads FRESH with the previous verb's value and the draw goes out with a stale binding
// slot. Poison catches an UNSTAMPED read; it cannot catch a stamped-but-uncopied one. That is
// exactly why this case exists - there is no second line of defence behind it.
// exactly why this case exists - there is no second line of defense behind it.
//
// So each input is moved on its own with the answer read back in between, and in an order where
// a memo that ignored that input would have to return the stale answer rather than the right one
@@ -461,7 +461,7 @@ TEST_F(FieldOwnershipTest, TheResidualFillsSuppliedMemoReKeysOnEveryInputThatMov
EXPECT_EQ(MGPipeFieldMaskHas(withConsumer, field), MGPipeFieldMaskHas(withoutConsumer, field))
<< kMGPipeInputFieldNames[i]
<< "'s supplied answer moved with the P4a consumer signal. That is CORRECT "
"behaviour and this assertion is a trip wire, not a defect report: the "
"behavior and this assertion is a trip wire, not a defect report: the "
"conjunct stopped being dominated, so the memo's fourth key input is now "
"observable and needs the move-it-and-read-it-back pair steps 1-3 give the "
"other three - under split through CapsMirrorInstance().Adopt() with and "
@@ -510,7 +510,7 @@ TEST_F(FieldOwnershipTest, AServerStampMakesRecordSuppliedFieldsFreshAndWithdraw
EXPECT_FALSE(MGPipeInputFieldIsFresh(filled, MGPipeInputField::RecordError)); // sticky
}
// THE STICKY EXEMPTION, CANCELLED. generated/PipeFilled.inc answers "fresh" for a sticky field
// THE STICKY EXEMPTION, CANCELED. generated/PipeFilled.inc answers "fresh" for a sticky field
// whatever the serial says - but it tests "never filled" FIRST, so the stamp's withdrawal
// (FilledGen = 0) wins over kMGPipeInputFieldSticky without a line of the generated file
// changing. Before this, the seven most dangerous fields were exempt by construction.
@@ -628,7 +628,7 @@ TEST_F(FieldOwnershipTest, AStickyForwardIsCountedAsAResidualPull) {
}
// ... and outside a server-stamped verb they are ordinary monolith calls, which is what keeps
// InvalidateCompileEnv reachable from backend initialisation - the case the exemption exists
// InvalidateCompileEnv reachable from backend initialization - the case the exemption exists
// for - and what keeps build-split's monolith lanes behaving as a verify build's do.
TEST_F(FieldOwnershipTest, NothingIsCountedOutsideAServerStampedVerb) {
MGPipeValidateForVerb(MGPipeVerb::ReadPixels);
@@ -643,7 +643,7 @@ TEST_F(FieldOwnershipTest, NothingIsCountedOutsideAServerStampedVerb) {
// server MG_Impl is not in the process, so MGPipeValidateForVerb/MGPipeLeaveVerb never run and
// MGPipeServerClearVerbBoundary is the ONLY thing that can disarm the flag; without it the
// server latches TRUE after its first stamp and the sticky exemption - the one
// InvalidateCompileEnv is reached from backend initialisation under - is gone for good.
// InvalidateCompileEnv is reached from backend initialization under - is gone for good.
TEST_F(FieldOwnershipTest, TheAppliersOwnClearDisarmsTheStampWithoutTheClientsFill) {
MGPipeServerStampVerbBoundary(MGPipeVerb::ReadPixels);
ASSERT_TRUE(gPipeInputs->ServerStampedVerb());
@@ -864,7 +864,7 @@ TEST_F(FieldOwnershipTest, RoleSplitGivesTheFillSideADistinctBlockTheStampNeverT
// And the server block's identity is server-owned under the rehearsal (§3.2's other half):
// the stamp set it, and it is non-null - a null identity reads as a hit against
// DirectGLES' zero-initialised fb-slot memo cache, which is the unnamed crash this line
// DirectGLES' zero-initialized fb-slot memo cache, which is the unnamed crash this line
// exists to preclude.
EXPECT_NE(gPipeInputs->ContextIdentity(), nullptr);
}
+24 -24
View File
@@ -377,7 +377,7 @@ TEST(FramebufferEmit, OneObjectBoundToBothTargetsEmitsOneRecordWithTargetBoth) {
// array, at the verb, from the framebuffer state it then holds - precisely so a program can
// relink inside the same draw. A hash that did not cover the array would let a suppressed
// set_framebuffer_state mean "the draw buffers did not move" when they had, and the shader
// would be specialised for the previous output shape.
// would be specialized for the previous output shape.
TEST(FramebufferEmit, ADrawBufferChangeAloneStillMovesTheContentHash) {
FramebufferScope scope;
const auto color0 = MakeColorTexture(6, 32);
@@ -472,21 +472,21 @@ TEST(FramebufferEmit, EveryAttachmentFieldSurvivesTheSurfaceConversion) {
const MGPSurface& surface = record.Color[i];
const MGPipeHandle expected =
MGPipeSlots().FindByLifetimeId(MGPipeKind::Texture, attachment.GetTexture()->GetLifetimeId());
EXPECT_TRUE(surface.Res == expected) << "MGPSurface::Res at colour point " << i;
EXPECT_EQ(surface.Kind, kMGPipeSurfaceKindTexture) << "MGPSurface::Kind at colour point " << i;
EXPECT_TRUE(surface.Res == expected) << "MGPSurface::Res at color point " << i;
EXPECT_EQ(surface.Kind, kMGPipeSurfaceKindTexture) << "MGPSurface::Kind at color point " << i;
EXPECT_EQ(surface.InternalFormat, static_cast<Uint32>(attachment.GetTexture()->GetFormat()))
<< "MGPSurface::InternalFormat at colour point " << i;
<< "MGPSurface::InternalFormat at color point " << i;
EXPECT_EQ(surface.Level, static_cast<Uint16>(attachment.GetTextureLevel()))
<< "MGPSurface::Level at colour point " << i;
<< "MGPSurface::Level at color point " << i;
EXPECT_EQ(surface.Layer, static_cast<Uint32>(attachment.GetTextureLayer()))
<< "MGPSurface::Layer at colour point " << i;
EXPECT_EQ(surface.Layered, attachment.IsLayered() ? 1 : 0) << "MGPSurface::Layered at colour point " << i;
<< "MGPSurface::Layer at color point " << i;
EXPECT_EQ(surface.Layered, attachment.IsLayered() ? 1 : 0) << "MGPSurface::Layered at color point " << i;
EXPECT_EQ(surface.UploadTarget, static_cast<Uint16>(TextureUploadTarget::Texture2D))
<< "MGPSurface::UploadTarget at colour point " << i;
<< "MGPSurface::UploadTarget at color point " << i;
// ID-12 DV-5: three of the four cross-object masks reduce to (format, TEXTURE TARGET)
// and no TextureUploadTarget -> TextureTarget inverse exists anywhere in the tree.
EXPECT_EQ(surface.TextureTarget, static_cast<Uint16>(attachment.GetTexture()->GetTarget()))
<< "MGPSurface::TextureTarget at colour point " << i;
<< "MGPSurface::TextureTarget at color point " << i;
}
EXPECT_EQ(record.Depth.Kind, kMGPipeSurfaceKindRenderbuffer) << "MGPSurface::Kind on the depth point";
@@ -552,7 +552,7 @@ TEST(FramebufferEmit, AnAttachmentPointAboveTheWireWidthIsRefusedNotTruncated) {
// THE SERVER TWIN of AnAttachmentPointAboveTheWireWidthIsRefusedNotTruncated above.
//
// That case pins the CLIENT half: a framebuffer holding a point at or above the wire width is
// refused rather than truncated. P5e turns that refusal into a licence the server SPENDS - the
// refused rather than truncated. P5e turns that refusal into a license the server SPENDS - the
// by-handle attachment walk stopped iterating the frontend's 41 points and now walks
// Color[0..7] + Depth + Stencil and nothing else, on the argument that the record's eleven
// surfaces ARE the point set. So the statement the server relies on needs a case of its own,
@@ -566,7 +566,7 @@ TEST(FramebufferEmit, AnAttachmentPointAboveTheWireWidthIsRefusedNotTruncated) {
//
// Half 2 is the one that would go quiet on its own. A truncating emitter would still refuse
// nothing, publish a record, and leave the server's walk perfectly self-consistent over eight
// colour points while one attachment silently stopped existing.
// color points while one attachment silently stopped existing.
TEST(FramebufferEmit, TheRecordsElevenSurfacesAreTheWholePointSetTheServerReads) {
FramebufferScope scope;
const auto fbo = MakeShared<FramebufferObject>(21);
@@ -589,7 +589,7 @@ TEST(FramebufferEmit, TheRecordsElevenSurfacesAreTheWholePointSetTheServerReads)
Framebuffers().EmitFramebufferState(Ctx());
ASSERT_EQ(Framebuffers().RefusedCount(), 0u) << "a full but legal framebuffer was refused";
// The wire's colour width and the server's walk width are ONE number.
// The wire's color width and the server's walk width are ONE number.
static_assert(std::size(MGPFramebufferState{}.Color) == kMGPipeMaxColorAttachments,
"the server walks Color[0..kMGPipeMaxColorAttachments); the array must be that wide");
@@ -597,9 +597,9 @@ TEST(FramebufferEmit, TheRecordsElevenSurfacesAreTheWholePointSetTheServerReads)
ASSERT_NE(applied, nullptr);
for (Uint i = 0; i < kMGPipeMaxColorAttachments; ++i) {
const MGPipeHandle expected = MGPipeSlots().FindByLifetimeId(MGPipeKind::Texture, colors[i]->GetLifetimeId());
EXPECT_FALSE(MGPipeHandleIsNull(expected)) << "colour point " << i << " minted no handle";
EXPECT_TRUE(applied->Color[i].Res == expected) << "colour point " << i << " did not reach the server's record";
EXPECT_EQ(applied->Color[i].Kind, kMGPipeSurfaceKindTexture) << "at colour point " << i;
EXPECT_FALSE(MGPipeHandleIsNull(expected)) << "color point " << i << " minted no handle";
EXPECT_TRUE(applied->Color[i].Res == expected) << "color point " << i << " did not reach the server's record";
EXPECT_EQ(applied->Color[i].Kind, kMGPipeSurfaceKindTexture) << "at color point " << i;
}
EXPECT_EQ(applied->Depth.Kind, kMGPipeSurfaceKindRenderbuffer) << "the Depth point";
EXPECT_EQ(applied->Stencil.Kind, kMGPipeSurfaceKindRenderbuffer) << "the Stencil point";
@@ -634,7 +634,7 @@ TEST(FramebufferEmit, TheRecordsElevenSurfacesAreTheWholePointSetTheServerReads)
// (ClientSession's surface-changed consumer -> TextureObjectBase::PipePublishLevelDescriptor ->
// MGP_NOTE_AGGREGATE(FramebufferAttachment) -> the framebuffer shutter) and told fb to pin it.
//
// THE CASE DRIVES THE CONSUMER'S OWN CALL, not a synthetic bump: AllocateStorage on the colour
// THE CASE DRIVES THE CONSUMER'S OWN CALL, not a synthetic bump: AllocateStorage on the color
// attachment at the new extent is literally what ClientSession does when the swapchain
// publishes a new size. No rebind, no re-attach, no draw-buffer edit - which is exactly the
// shape that would have been suppressed.
@@ -696,8 +696,8 @@ TEST(FramebufferEmit, TheDefaultFramebuffersRecordNamesNoSurfaceAShareGroupWould
ASSERT_NE(applied, nullptr) << "the default framebuffer's record did not reach the applier";
EXPECT_EQ(applied->IsDefault, 1) << "MGPFramebufferState::IsDefault";
for (Uint i = 0; i < kMGPipeMaxColorAttachments; ++i) {
EXPECT_EQ(applied->Color[i].Kind, kMGPipeSurfaceKindNone) << "MGPSurface::Kind at colour point " << i;
EXPECT_TRUE(MGPipeHandleIsNull(applied->Color[i].Res)) << "MGPSurface::Res at colour point " << i;
EXPECT_EQ(applied->Color[i].Kind, kMGPipeSurfaceKindNone) << "MGPSurface::Kind at color point " << i;
EXPECT_TRUE(MGPipeHandleIsNull(applied->Color[i].Res)) << "MGPSurface::Res at color point " << i;
}
EXPECT_EQ(applied->Depth.Kind, kMGPipeSurfaceKindNone) << "MGPSurface::Kind on the depth point";
EXPECT_EQ(applied->Stencil.Kind, kMGPipeSurfaceKindNone) << "MGPSurface::Kind on the stencil point";
@@ -836,7 +836,7 @@ TEST(FramebufferEmit, ADrawBufferTokenAboveTheWireWidthIsRefusedNotTruncated) {
static_cast<Int>(kMGPipeMaxColorAttachments) + 2));
Framebuffers().EmitFramebufferState(Ctx());
EXPECT_EQ(Framebuffers().EmissionCount(), 1u)
<< "a draw-buffer token naming a colour point at or above the wire width was truncated "
<< "a draw-buffer token naming a color point at or above the wire width was truncated "
"into a record instead of refused";
EXPECT_GE(Framebuffers().RefusedCount(), 1u) << "the refusal was not counted";
}
@@ -882,7 +882,7 @@ TEST(FramebufferEmit, EveryNonTexturePointCarriesTheUnknownSentinelsRatherThanZe
Framebuffers().EmitFramebufferState(Ctx());
const MGPFramebufferState& record = Framebuffers().LastDraw();
// The RENDERBUFFER point, the EMPTY colour points and the STENCIL point that names nothing.
// The RENDERBUFFER point, the EMPTY color points and the STENCIL point that names nothing.
for (const MGPSurface* surface : {&record.Depth, &record.Stencil, &record.Color[1]}) {
EXPECT_NE(surface->Kind, kMGPipeSurfaceKindTexture);
EXPECT_EQ(surface->UploadTarget, static_cast<Uint16>(TextureUploadTarget::Unknown))
@@ -1001,7 +1001,7 @@ TEST(FramebufferEmit, ATargetOutsideTheThreeBindingsIsRefusedNamingTheRecord) {
}
// 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,
// outside that range would have the server read a color attachment the record does not carry,
// which is the truncation the wire width's cap refusal exists to prevent upstream.
TEST(FramebufferEmit, ADrawBufferEntryOutsideTheRecordsOwnArrayIsRefusedRatherThanRead) {
ApplierGuard guard;
@@ -1018,13 +1018,13 @@ TEST(FramebufferEmit, ADrawBufferEntryOutsideTheRecordsOwnArrayIsRefusedRatherTh
MGPFramebufferState past = FramebufferRecord(MGPipeHandle{8, 1}, MGPipeFramebufferTarget::Draw, 111);
past.DrawBuffers[3] = static_cast<Int8>(kMGPipeMaxColorAttachments);
ExpectRefusedNaming("set_framebuffer_state {slot=8, gen=1, target=0}: a draw-buffer entry names a "
"colour attachment outside the record's own array",
"color attachment outside the record's own array",
[&past]() { MGPipeApplySetFramebufferState(past); });
MGPFramebufferState negative = FramebufferRecord(MGPipeHandle{8, 1}, MGPipeFramebufferTarget::Draw, 222);
negative.DrawBuffers[0] = -2;
ExpectRefusedNaming("set_framebuffer_state {slot=8, gen=1, target=0}: a draw-buffer entry names a "
"colour attachment outside the record's own array",
"color attachment outside the record's own array",
[&negative]() { MGPipeApplySetFramebufferState(negative); });
ASSERT_NE(MGPipeApplier().DrawFramebuffer(), nullptr);
@@ -1179,7 +1179,7 @@ TEST(FramebufferEmit, ANamedRecordDescribesTheFramebufferItNamesWithoutMovingEit
// never destroyed on the wire, so its slot is simply overwritten by its successor - and until
// that successor describes itself, a handle naming the DEAD one must be refused rather than
// answered with the predecessor's attachments. That answer would be a blit or a clear into
// somebody else's colour buffer. It is LOUD (counted, and logged once) because the only way to
// somebody else's color buffer. It is LOUD (counted, and logged once) because the only way to
// 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) {
+2 -2
View File
@@ -12,7 +12,7 @@
// WHAT THIS SUITE IS FOR. The image set is the one whose ContentHash has to cover more than
// the binding: InternalFormat and Access are live glBindImageTexture state that the
// format-less image bake keys on, so a set whose only movement is an access mode still has to
// go out. And the zero early-out is the property an optimisation deletes by accident - it is
// go out. And the zero early-out is the property an optimization deletes by accident - it is
// what makes every draw of every application that never binds an image pay one integer test.
//
// THE SUITE IS `ImageEmit`, not `ImageEmitTest`: the file is XTest.cpp and the suite is X.
@@ -372,7 +372,7 @@ namespace {
return name;
}
// PROPERTY 1 OF D-G4, and it is the one an optimisation deletes: an application that never
// PROPERTY 1 OF D-G4, and it is the one an optimization deletes: an application that never
// binds an image pays one integer test per draw, taken BEFORE any hash and before any
// 192-entry walk.
//
+23 -23
View File
@@ -6,7 +6,7 @@
// SPDX-License-Identifier: LGPL-3.0-only
// End of Source File Header
// The arithmetic of the MGPipe catalogue (plan B section 4.4, appendix A). Everything here
// The arithmetic of the MGPipe catalog (plan B section 4.4, appendix A). Everything here
// is cheap on purpose: it is the test that fails when PipeCalls.def and the seven generated
// files stop agreeing, and it must not need a GL context to say so.
@@ -23,7 +23,7 @@
#include "Includes.h"
#include <MG_Pipe/MGPipe.h>
// P4a: MGPipeUnmigratedEmulation's declaration, and the applier's records the catalogue's size
// P4a: MGPipeUnmigratedEmulation's declaration, and the applier's records the catalog'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.
#include <MG_Impl/Pipe/SlotAllocator.h>
@@ -61,7 +61,7 @@ TEST(PipeCatalogue, FrontendNeverTakesAnApplierAddress) {
}
namespace {
// Counting expansions of the catalogue. The Class parameter is a real enumerator, so a
// Counting expansions of the catalog. The Class parameter is a real enumerator, so a
// per-class count is a constant expression too.
#define MGP_COUNT_ONE(Name, Payload, Class, Flags, Wait) +1
#define MGP_COUNT_CLASS(Name, Payload, Class, Flags, Wait) +((Class) == countedClass ? 1 : 0)
@@ -73,7 +73,7 @@ namespace {
return 0 MGP_CALL_LIST(MGP_COUNT_CLASS);
}
// Every payload named in the catalogue must be a memcpy-able POD, and so must every
// Every payload named in the catalog must be a memcpy-able POD, and so must every
// payload the verify comparator knows about.
#define MGP_ASSERT_CALL_PAYLOAD_POD(Name, Payload, Class, Flags, Wait) \
static_assert(std::is_trivially_copyable_v<Payload>, #Name "'s payload " #Payload " is not trivially copyable");
@@ -83,9 +83,9 @@ namespace {
static_assert(std::is_trivially_copyable_v<Payload>, #Payload " is not trivially copyable");
MGP_VERIFY_PAYLOAD_LIST(MGP_ASSERT_VERIFY_PAYLOAD_POD)
// The catalogue's own spelling of an opcode, for a failure message. The wire codec has one
// The catalog's own spelling of an opcode, for a failure message. The wire codec has one
// of these and MG_Pipe may not reach it (MG_Remote is above this layer), so the table is
// expanded from the catalogue here rather than a name being duplicated per EXPECT.
// expanded from the catalog here rather than a name being duplicated per EXPECT.
#define MGP_CATALOGUE_NAME_ROW(Name, Payload, Class, Flags, Wait) #Name,
constexpr const char* kCatalogueOpNames[] = {"<kInvalid>", MGP_CALL_LIST(MGP_CATALOGUE_NAME_ROW)};
#undef MGP_CATALOGUE_NAME_ROW
@@ -114,7 +114,7 @@ TEST(PipeCatalogue, HandleIsEightBytes) {
EXPECT_FALSE(MGPipeIsCompositeShaderSlot(kMGPipeShaderCsoSlotLimit));
}
// The catalogue, the number documented in its header, and the two generated tables are one
// The catalog, the number documented in its header, and the two generated tables are one
// fact stated three times. This is the test that notices when they stop being.
TEST(PipeCatalogue, EntryCountMatchesTheDocumentedCount) {
static_assert(kExpandedCallCount == MGP_CALL_LIST_DOCUMENTED_COUNT);
@@ -201,7 +201,7 @@ TEST(PipeCatalogue, UninstalledTablesAreAllNull) {
EXPECT_EQ(gMGPipeScreen.FenceCreate, nullptr);
EXPECT_EQ(gMGPipeScreen.ApplierReset, nullptr);
EXPECT_EQ(gMGPipeContext.ObjectDeath, nullptr);
// P5e's opcode 80 joins them: the row is catalogued, its codec layout is written and its
// P5e's opcode 80 joins them: the row is cataloged, its codec layout is written and its
// 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);
@@ -218,7 +218,7 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
// 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
// another - the object file carrying a static initializer was dropped by the linker in the
// binaries that did not name a symbol in it.
MGPipeInstallMonolithTables();
@@ -290,7 +290,7 @@ TEST(PipeCatalogue, ExactlyTheRoutedRowsAreInstalledAndTheRestAreStillNull) {
// notice's mailbox are the producers, byte for byte as before (G1/G2).
EXPECT_EQ(gMGPipeScreen.ApplierReset, nullptr);
EXPECT_EQ(gMGPipeContext.ObjectDeath, nullptr);
// P5e's set_program_bindings (CONTRACT-P5E.md §1): catalogued with a null route until pg
// P5e's set_program_bindings (CONTRACT-P5E.md §1): cataloged with a null route until pg
// installs the applier entry point and the adapter beside it.
EXPECT_EQ(gMGPipeContext.SetProgramBindings, nullptr);
}
@@ -384,7 +384,7 @@ TEST(PipeCatalogue, TextureParamsNameTheirBuiltinSamplerAndFramebufferStateNames
// the enum is the only thing that says what fits.
EXPECT_LE(static_cast<Uint32>(MGPipeFramebufferTarget::Count), 256u);
EXPECT_EQ(sizeof(MGPFramebufferState::Target), 1u);
// The wire's colour-attachment width is ONE width, and it is the wire's rather than the
// The wire's color-attachment width is ONE width, and it is the wire's rather than the
// driver's: a driver reporting more attachments than this is refused at bring-up, never
// truncated into the record.
EXPECT_EQ(kMGPipeMaxColorAttachments, 8u);
@@ -410,12 +410,12 @@ TEST(PipeCatalogue, EveryTextureTargetMapsToItsOwnResourceTarget) {
<< "TextureTarget " << i << " has no MGPResourceDesc::Target row";
EXPECT_LT(MGPipeResourceTargetForTextureTarget(target), static_cast<Uint32>(MGPipeResourceTarget::Count));
}
// Buffer is 0 and stays 0: P3a's constant is what a zero-initialised record already says,
// Buffer is 0 and stays 0: P3a's constant is what a zero-initialized record already says,
// and the narrowed ack predicate below compares against it.
EXPECT_EQ(static_cast<Uint32>(MGPipeResourceTarget::Buffer), 0u);
EXPECT_EQ(kMGPipeResourceTargetBuffer, 0u);
// No texture target may collide with the buffer target, or a texture descriptor would ask
// for a synchronous acknowledgement.
// for a synchronous acknowledgment.
for (SizeT i = 0; i < static_cast<SizeT>(TextureTarget::TextureTargetCount); ++i) {
EXPECT_NE(MGPipeResourceTargetForTextureTarget(static_cast<TextureTarget>(i)),
static_cast<Uint32>(kMGPipeResourceTargetBuffer));
@@ -512,7 +512,7 @@ TEST(PipeCatalogue, SurfaceNamesItsKindItsTextureTargetAndItsDepthStencilAspect)
EXPECT_EQ(kMGPipeSurfaceKindTexture, static_cast<Uint8>(MGPipeKind::Texture));
EXPECT_EQ(kMGPipeSurfaceKindRenderbuffer, static_cast<Uint8>(MGPipeKind::Renderbuffer));
EXPECT_NE(kMGPipeSurfaceKindTexture, kMGPipeSurfaceKindRenderbuffer);
// None == 0 is load-bearing: it is what makes a zero-initialised record already BE the
// None == 0 is load-bearing: it is what makes a zero-initialized record already BE the
// empty attachment point, which every emitter and every reader relies on.
EXPECT_EQ(kMGPipeSurfaceKindNone, 0u);
@@ -611,7 +611,7 @@ TEST(PipeCatalogue, LateArrivalsAreAppendedWithoutRenumbering) {
// P5e (§1) appended ONE more, by the same rule: opcode 80, and
// nothing before it moved. set_program_bindings is a kCtxState row with THREE tails and a
// host span in the third; it lands with a null route and a sink that refuses it by name,
// exactly as set_shader_buffers has sat catalogued-and-dead since P4a.
// exactly as set_shader_buffers has sat cataloged-and-dead since P4a.
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::SetProgramBindings), 80);
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::DeleteStreamOutput), 81);
// P9 (§1) appended the two pack-buffer readbacks, by the same rule:
@@ -824,7 +824,7 @@ TEST(PipeCatalogue, EveryRowCarriesTheWaitClassTheContractGivesIt) {
}
// The partition, by count. 15 + 1 + 1 = 17 rows wait (shared_image made the reply rows 15; P15
// left one kWaitApplied row); every other row of the catalogue does
// left one kWaitApplied row); every other row of the catalog does
// not. A row that changed class moves two of these numbers at once - which is why the
// kWaitApplied count went 9 -> 10 and the kWaitNone offset 24 -> 25 in the SAME commit that
// moved resource_copy_region (P5e gl, ID-118).
@@ -854,8 +854,8 @@ TEST(PipeCatalogue, EveryRowCarriesTheWaitClassTheContractGivesIt) {
EXPECT_EQ(none, static_cast<SizeT>(kMGPipeCallCount) - 17u);
EXPECT_EQ(other, 0u) << "a row carries the kWaitClassCount terminator as its class";
// And the reply half of the partition BOTH WAYS, over the whole catalogue: exactly the rows
// that own a slot wait for one. gen_pipe.py refuses a catalogue where they disagree; this
// And the reply half of the partition BOTH WAYS, over the whole catalog: exactly the rows
// that own a slot wait for one. gen_pipe.py refuses a catalog where they disagree; this
// is the same statement where a reader of the table will look for it.
for (SizeT i = 1; i < static_cast<SizeT>(MGPWireOp::kOpCount); ++i) {
const auto op = static_cast<MGPWireOp>(i);
@@ -1016,7 +1016,7 @@ TEST(PipeCatalogue, FloatVectorsCompareBitwise) {
EXPECT_FALSE(MGPipeVerify(leftState, rightState, &inner));
EXPECT_STREQ(inner, "BlendStates");
// P2's three new capability bools are members like any other, so the comparator names
// them rather than folding them into a neighbour's padding.
// them rather than folding them into a neighbor's padding.
rightState = leftState;
rightState.FramebufferSrgbEnabled = true;
EXPECT_FALSE(MGPipeVerify(leftState, rightState, &inner));
@@ -1390,7 +1390,7 @@ TEST(PipeCatalogue, ResourceRespecifyAcksOnlyImmutableStorage) {
// started acknowledging every immutable texture allocation the moment P4a's texture family
// landed. Texture allocation is already deferred to sync time in monolith (glTexImage* and
// glTexStorage* only mark the storage dirty, and even glRenderbufferStorage* allocates
// lazily inside SyncToBackend), so splitting changes no observable behaviour and this batch
// lazily inside SyncToBackend), so splitting changes no observable behavior and this batch
// must not ack. glBufferStorage stays the only entry point allowed a synchronous one.
//
// This is the negative control for a future widening, in both directions: a predicate that
@@ -1411,13 +1411,13 @@ TEST(PipeCatalogue, ResourceRespecifyAcksOnlyImmutableStorage) {
EXPECT_FALSE(MGPipeResourceRespecifyNeedsAck(renderbuffer));
// And the buffer half still answers true with the target spelled explicitly rather than
// relying on a zero-initialised record to mean "buffer".
// relying on a zero-initialized record to mean "buffer".
MGPResourceDesc immutableBuffer{};
immutableBuffer.Immutable = 1;
immutableBuffer.Target = kMGPipeResourceTargetBuffer;
EXPECT_TRUE(MGPipeResourceRespecifyNeedsAck(immutableBuffer));
// And the opcode did not move: a flag-word edit is not a catalogue edit.
// And the opcode did not move: a flag-word edit is not a catalog edit.
EXPECT_EQ(static_cast<Uint16>(MGPWireOp::ResourceRespecify), 3);
// P4a, ID-18 M4. The metadata-update rule is a PROSE contract stated beside the predicate
@@ -1436,7 +1436,7 @@ TEST(PipeCatalogue, ResourceRespecifyAcksOnlyImmutableStorage) {
EXPECT_NE(offsetof(MGPResourceDesc, HasDefinedContent), offsetof(MGPResourceDesc, ImageBindableHint));
}
// G13b, D-M: "emulation 在 split 下显式 Fatal 直到 P8" costs P4a a NAMED, GREPPABLE call site
// G13b, D-M: "emulations are an explicit Fatal under split until P8" costs P4a a NAMED, GREPPABLE call site
// per unmigrated emulation and nothing else - in monolith MGPipeUnmigratedEmulation is a no-op
// and the emulation still runs on exactly the code path it runs on today. What this pins is
// the LIST, because the whole value of the mechanism is that P5 and P8 edit one function
+2 -4
View File
@@ -76,9 +76,7 @@ namespace {
m_previous = MG_State::pGLContext.Take();
MG_State::pGLContext = MakeUnique<GLContext>();
}
void TearDown() override {
MG_State::pGLContext = Move(m_previous);
}
void TearDown() override { MG_State::pGLContext = Move(m_previous); }
SharedPtr<GLContext> m_previous;
};
@@ -250,7 +248,7 @@ TEST_F(PipeInputsTest, ReadingAFilledFieldCompletes) {
// The window before the first verb (P1 brief D6: "<Field>@<none>"). Nothing has filled this
// process's block, so a backend-style read of a value field is Fatal naming no verb: the
// serial and every stamp are 0, and 0 == 0 is not fresh. In a verify build the child also
// sets the lane's knob first, the shape of a read reached from initialisation: the poison
// sets the lane's knob first, the shape of a read reached from initialization: the poison
// fires at MGP_INPUT_CHECK, before the read hook (armed only by the first fill) could matter.
TEST_F(PipeInputsTest, ReadingBeforeAnyFillAbortsNamingNoVerb) {
#if !MOBILEGL_PIPE_POISON
+7 -7
View File
@@ -62,7 +62,7 @@
#include <MG_Impl/Pipe/SlotAllocator.h>
#include <MG_Impl/Pipe/Tracker.h>
#include <MG_Pipe/PipeApply.h>
// The applier takes the two artefact structs BY POINTER beside the record, so a case that
// The applier takes the two artifact structs BY POINTER beside the record, so a case that
// drives create_shader_state needs their definitions - the applier's own header deliberately
// only forward-declares them.
#include <MG_State/GLState/ProgramState/ProgramArtifacts.h>
@@ -217,7 +217,7 @@ namespace {
desc.PointSizeDemoted = 1;
desc.EnableSpirvValidation = 1;
// ALL SEVEN BLOB REFS ARE DECLARED WITH Size 0 - "this record does not declare its
// blob" - which is exactly what a monolith emission is: the artefacts ride beside the
// blob" - which is exactly what a monolith emission is: the artifacts ride beside the
// record through the two companion pointers and the codec is never called.
return desc;
}
@@ -283,7 +283,7 @@ TEST(ProgramEmit, ACreateStoresTheDescriptorAndARelinkCountsUpAndDropsTheBlockKe
EXPECT_EQ(ProgramRecordOf(5).Desc.StageMask, 0x1u);
}
// The three refusals a create can produce: no artefacts at all behind seven undeclared blobs, a
// The three refusals a create can produce: no artifacts 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) {
ApplierGuard guard;
@@ -292,10 +292,10 @@ TEST(ProgramEmit, ACreateWithNoArtefactsAnOversizedBlockOrACorruptSlotIsRefusedN
const MGPProgramDesc desc = ProgramDesc(MGPipeHandle{4, 1}, 0x3u, 0);
ExpectRefusedNaming("create_shader_state {slot=4, gen=1}: the record declares no blobs and carries no "
"artefacts",
"artifacts",
[&desc, &spirv]() { MGPipeApplyCreateShaderState(desc, nullptr, &spirv, nullptr); });
ExpectRefusedNaming("create_shader_state {slot=4, gen=1}: the record declares no blobs and carries no "
"artefacts",
"artifacts",
[&desc, &link]() { MGPipeApplyCreateShaderState(desc, &link, nullptr, nullptr); });
EXPECT_TRUE(MGPipeApplier().ShaderCsos.empty());
@@ -568,7 +568,7 @@ void main() { gl_Position = vec4(0.0); EmitVertex(); }
// PINNED AS A PREDICATE rather than by driving the counter to ~0u, and the reason is
// written down instead of hidden: reaching that value takes four billion
// MarkUBOContentDirty calls, which is not a test. The predicate is the thing
// EmitGlobalConstants consults, so pinning it pins the behaviour, and a deletion of the
// EmitGlobalConstants consults, so pinning it pins the behavior, and a deletion of the
// guard is a compile error here.
TEST(ProgramEmit, TheNeverUploadedSentinelIsNeverEmitted) {
EmitterScope scope;
@@ -1050,7 +1050,7 @@ void main() { gl_Position = u_a + u_b + u_c + u_d; }
"the frontend reports unlinked";
EXPECT_EQ(Emitter().LastProgramDesc().LinkStatus, 0u) << "the re-issue claims the program linked";
EXPECT_TRUE(MGPipeSlots().IsLive(MGPipeKind::ShaderCso, cso))
<< "a failed relink must never be modelled as an object_death";
<< "a failed relink must never be modeled as an object_death";
}
// The frame, both ways round. SpirvArtifacts carries no stage list and MGPProgramDesc::
+3 -3
View File
@@ -18,7 +18,7 @@
// * the verb session (MG_Record::SetVerbSessionResolver), i.e. every verb record the emitters
// in MG_Impl/Pipe/Verb plan - the same bytes a transport would carry.
//
// Each record is NORMALISED (the one thing in a payload that is not a function of the GL calls is
// Each record is NORMALIZED (the one thing in a payload that is not a function of the GL calls is
// an address: an MGPBlobRef / MGHostSpan naming caller memory - zeroed, the size kept; the bytes
// they name are hashed instead) and hashed with its companion bytes and tails. The golden is one
// line per record - index, call name, size, hash - in goldens/recorder/<fixture>.txt, small enough
@@ -100,7 +100,7 @@ namespace {
g_stream->push_back(Record{op, bytes, hash.Value});
}
// ---- normalisation: addresses out, sizes kept --------------------------------------------------
// ---- normalization: addresses out, sizes kept --------------------------------------------------
void Scrub(MGPBlobRef& blob) {
if (blob.Seg == kMGHostSpanSegNone) blob.Offset = 0;
@@ -210,7 +210,7 @@ namespace {
return HashRest(hash, op, blob, blobBytes) + HashRest(hash, op, tail, count);
}
// ---- the table wrappers, one per catalogue row -------------------------------------------------
// ---- the table wrappers, one per catalog row -------------------------------------------------
template <const char* Name, typename Fn>
struct Wrap;
@@ -165,7 +165,7 @@ namespace {
EXPECT_EQ(gotSrcA, wantSrcA) << "blend func " << i;
EXPECT_EQ(gotDstA, wantDstA) << "blend func " << i;
EXPECT_EQ(gPipeInputs->GetColorMaskIndexed(i), ctx.GetColorMaskIndexed(i)) << "colour mask " << i;
EXPECT_EQ(gPipeInputs->GetColorMaskIndexed(i), ctx.GetColorMaskIndexed(i)) << "color mask " << i;
EXPECT_EQ(gPipeInputs->IsCapabilityEnabledIndexed(CapabilityInput::Blend, i),
ctx.IsCapabilityEnabledIndexed(CapabilityInput::Blend, i))
<< "indexed blend enable " << i;
@@ -503,7 +503,7 @@ namespace {
StencilOperation::IncrementWrap);
});
// ---- Colour mask, clear state, sampling ----
// ---- Color mask, clear state, sampling ----
check("SetColorMask", [](RenderState& s) { s.SetColorMask(BoolVec4(true, false, true, false)); });
check("SetColorMaskIndexed",
[](RenderState& s) { s.SetColorMaskIndexed(6, BoolVec4(false, false, true, true)); });
@@ -867,7 +867,7 @@ namespace {
BlendFactor::SrcAlpha);
ctx.SetBlendEquationIndexed(5, BlendEquation::ReverseSubtract, BlendEquation::Max);
ctx.SetColorMaskIndexed(0, BoolVec4(false, true, false, true));
push("step 3: blend and colour mask (pipeline chunk P1)");
push("step 3: blend and color mask (pipeline chunk P1)");
ctx.SetCapabilityIndexed(CapabilityInput::Blend, 0, true);
push("step 4: indexed blend enable at index 0");
+6 -6
View File
@@ -503,7 +503,7 @@ namespace {
EXPECT_TRUE(MGPipeSetSubDataBufferRange(record, 0, 0xFFFFFFFFull));
}
// BEHAVIOUR NEUTRALITY, ASSERTED RATHER THAN ASSUMED. Every dispatch in the family is a
// BEHAVIOR NEUTRALITY, ASSERTED RATHER THAN ASSUMED. Every dispatch in the family is a
// null check that falls through while no backend has installed a table - which is what
// 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.
@@ -1456,9 +1456,9 @@ namespace {
// The slot spaces of kinds Buffer, Texture and Renderbuffer are independent - the client
// allocator is per kind - so one slot-indexed table would alias three live objects onto one
// record. These cases are about the branch and nothing else: which table a call lands in,
// that the three do not see each other, and that a target or a kind the catalogue does not
// that the three do not see each other, and that a target or a kind the catalog does not
// name is refused rather than routed to whichever table came first. The texture family's
// own behaviour (parameters, the sub-data validator, the pending-upload set) is in
// own behavior (parameters, the sub-data validator, the pending-upload set) is in
// TextureEmitTest beside the emitter cases it belongs with.
// =====================================================================================
@@ -1699,7 +1699,7 @@ namespace {
}
// 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,
// the catalog 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) {
ApplierGuard guard;
@@ -1896,7 +1896,7 @@ namespace {
//
// Every enumerator, one fresh buffer each, so the assertion is an EQUALITY rather than a
// "has the bit": a target that maps to no bit at all (the transfer and query targets)
// must leave the mask empty, and a table row that leaked a neighbour's bit fails here.
// must leave the mask empty, and a table row that leaked a neighbor's bit fails here.
//
// ON CREATE the mask is necessarily empty and that is not a gap in the test: the create
// is emitted from the buffer object's CONSTRUCTOR, and nothing can be bound to an object
@@ -2171,7 +2171,7 @@ namespace {
EXPECT_EQ(covered, whole) << "the split covered the range more or less than exactly once";
};
// Three chunks and a remainder: the smallest range that says the cap is being honoured
// Three chunks and a remainder: the smallest range that says the cap is being honored
// rather than the record's own bound - and at that bound the same range is ONE record,
// so what cuts it below is the stage chunk and nothing else.
constexpr Uint64 kThreeChunks = kChunk * 3 + 7;
+6 -6
View File
@@ -11,13 +11,13 @@
//
// THIS SUITE IS A NAMED GATE (`ctest -R 'SamplerEmit\.'`), and its negative control is a
// script that stops the conversion copying SamplerParameters::borderColorForm and expects this
// suite to go red NAMING that field - which it must, because all three border-colour
// suite to go red NAMING that field - which it must, because all three border-color
// representations are always numerically populated and the value alone cannot say which driver
// entry point to use.
//
// THE ONE CASE THAT LOOKS LIKE PARANOIA AND IS NOT: SamplerParameters is 100 bytes with THREE
// BYTES OF TRAILING PADDING, so a cache that hashes or memcmps the object's own bytes reads
// uninitialised memory and mints a fresh CSO per call - a 256-entry cache with a hit rate of
// uninitialized memory and mints a fresh CSO per call - a 256-entry cache with a hit rate of
// zero, and nobody notices, because the pixels are right. The case that writes garbage into
// the padding through a byte pointer is what turns that into a red gate.
//
@@ -202,7 +202,7 @@ TEST(SamplerEmit, TheEmitterIsOneNeverDestroyedProcessSingleton) {
// =========================================================================================
// The APPLIER's half of the sampler family (the wire commits'): the CSO record, the
// identity-addressed view record and its back-pointer, and the two unit sets. The emitter's
// half - the content-addressed 256-entry cache, the canonical zero-initialised copy the hash
// half - the content-addressed 256-entry cache, the canonical zero-initialized copy the hash
// and the memcmp run over, the padding that cannot change the hash, borderColorForm crossing -
// is the client package's and lands beside these.
// =========================================================================================
@@ -531,7 +531,7 @@ namespace {
// gtest refuses to mix TEST and TEST_F under one suite name.
//
// UNLIKE VertexInputEmitTest's, this scope does NOT replace pGLContext: half these cases
// need a really linked program, so the process is initialised once in main() and the cases
// need a really linked program, so the process is initialized once in main() and the cases
// share that context, each using GL names of its own. What the scope does is put the
// emitter, its counters and the suppressor back to a known state.
struct EmitterScope {
@@ -660,7 +660,7 @@ namespace {
Uint64 payload = 0;
const MGPipeHandle first = Cache().Acquire(clean, payload);
const MGPipeHandle second = Cache().Acquire(dirty, payload);
EXPECT_EQ(first, second) << "uninitialised padding must not mint a second CSO";
EXPECT_EQ(first, second) << "uninitialized padding must not mint a second CSO";
EXPECT_EQ(Cache().GetCounters().Mints, 1u);
EXPECT_EQ(Cache().GetCounters().Hits, 1u);
}
@@ -689,7 +689,7 @@ namespace {
params.borderColorForm = BorderColorForm::Uint;
const MGPipeHandle asUint = Cache().Acquire(params, payload);
EXPECT_NE(asInt, asUint) << "the form is the only thing that says which driver entry "
"point applies; the three colour values did not move";
"point applies; the three color values did not move";
EXPECT_EQ(Cache().GetCounters().Mints, 2u);
}
@@ -10,7 +10,7 @@
// (§5.6, rulings 10 and 11; package sb).
//
// WHAT THIS SUITE IS FOR. Three properties of this family are invisible in a picture and are
// exactly what an optimisation or a merge deletes:
// exactly what an optimization or a merge deletes:
// 1. the ZERO EARLY-OUT - a class nothing has bound emits nothing, before any hash;
// 2. a BASE binding travels as kMGPipeWholeBuffer and never as a resolved extent, so a
// glBufferData between the emission and the apply binds the NEW extent as GL does;
+3 -3
View File
@@ -2213,7 +2213,7 @@ TEST(TextureEmit, ARespecifyOfOneLevelKeepsThePendingUploadsOfTheOthers) {
EXPECT_EQ(TextureRecordOf(10).PendingUploads[1].UploadTarget, secondFace);
// And the key it DOES name goes, because that level's coordinate system has been replaced.
// The redefinition modelled here is glTexImage2D(level 1) with a NEW internal format - a
// The redefinition modeled here is glTexImage2D(level 1) with a NEW internal format - a
// legal thing to do to a mutable texture, and a real redefinition of that level's storage,
// so the descriptor moves and the metadata arm does not claim it.
ASSERT_TRUE(MGPipeApplyResourceSubData(TextureUpload(texture, 1, MGPBox{0, 0, 0, 32, 32, 1}, 0), texels));
@@ -2393,7 +2393,7 @@ TEST(TextureEmit, ASubDataRecordWhoseResourceTargetNamesNoTextureIsRefusedRather
"to upload into",
[&renderbuffer, &texels]() { MGPipeApplyResourceSubData(renderbuffer, texels); });
// And so is a value at or above the catalogue, and so is the buffer target arriving with a
// And so is a value at or above the catalog, and so is the buffer target arriving with a
// non-zero upload-target half - which the whole-field buffer test above cannot see.
MGPSubData pastTheCatalogue = renderbuffer;
pastTheCatalogue.Target = static_cast<Uint16>(MGPipeResourceTarget::Count);
@@ -2479,7 +2479,7 @@ TEST(TextureEmit, ARespecifyThatRedefinesNoStorageCarriesTheStickyMaskAndKeepsTh
masked.BindMask = static_cast<Uint16>(allocated.BindMask | kMGPipeBindShaderImage);
masked.ImageBindableHint = 1;
ASSERT_FALSE(MGPipeResourceRespecifyNeedsAck(masked))
<< "a metadata respecify must never ask for a reallocation acknowledgement";
<< "a metadata respecify must never ask for a reallocation acknowledgment";
ASSERT_TRUE(MGPipeApplyResourceRespecify(masked, nullptr));
EXPECT_EQ(TextureRecordOf(11).Desc.BindMask, masked.BindMask)
+1 -1
View File
@@ -1209,7 +1209,7 @@ namespace {
ASSERT_EQ(MGPipeVertexAttribDefaultsLastHeader().Count, 1u)
<< "a steady context published more than the one attribute that moved";
// A different context, whose 32 defaults are the value-initialised {0,0,0,1} the
// A different context, whose 32 defaults are the value-initialized {0,0,0,1} the
// tracker's own reset produces - so a diff against the staging mirror finds nothing.
MG_State::pGLContext = MakeUnique<GLContext>();
Draw();
@@ -673,7 +673,7 @@ namespace {
constexpr int kChurn = 64;
Uint32 peakLive = 0;
for (int round = 0; round < kChurn; ++round) {
// Through the name allocator, so MarkVertexArrayForDeletion recognises the name and
// Through the name allocator, so MarkVertexArrayForDeletion recognizes the name and
// actually drops the slot's reference - and so the recycled NAME is part of the
// shape, exactly as a chunk renderer's is. The lifetime id is fresh every round
// whatever the name does, which is what the free has to key on.
@@ -63,7 +63,7 @@ namespace {
// The built-in members of every block in the module, keyed by the struct's result id, in
// member order. A gl_PerVertex is exactly such a struct, and its member list IS the shape the
// neighbouring stage has to agree with.
// neighboring stage has to agree with.
constexpr Uint32 kOpTypeStruct = 30;
std::map<Uint32, Vector<Uint32>> BuiltInBlockShapes(const Vector<Uint32>& spirv) {
@@ -212,7 +212,7 @@ TEST_F(PassthroughTessControlTest, CompilesWithNonDefaultLevels) {
EXPECT_TRUE(shaderResult) << (shaderResult ? String{} : shaderResult.error().log) << source;
}
// The generator honours the mask it is given, in both directions. This is what covers the
// The generator honors the mask it is given, in both directions. This is what covers the
// pre-cutoff three-member form now that no authorable tessellation evaluation stage produces it
// (ARB_tessellation_shader is GL 4.0 and gl_CullDistance joins the block at 400), and it is also
// the fallback ReflectPassthroughTessControlNeed uses when it cannot read a module's block.
@@ -253,7 +253,7 @@ TEST_F(PassthroughTessControlTest, RedeclaresExactlyTheRequestedMembers) {
TEST_F(PassthroughTessControlTest, MatchesTheFrontendPerVertexBlock) {
using namespace MG_Util::ShaderTranspiler;
// MORE THAN ONE VERSION, because the shape is a function of the neighbour's GLSL version and
// MORE THAN ONE VERSION, because the shape is a function of the neighbor's GLSL version and
// a single-version case cannot see that. glslang gates gl_PerVertex's gl_CullDistance member
// on a version cutoff, and this case used to link #version 430 ONLY - which is exactly why a
// generator hardcoded to the pre-cutoff three-member form looked correct while every program
@@ -663,7 +663,7 @@ TEST(PipelineQuirkTest, WireDepthResolveProbeKnobReplacesTheMeasurementNotTheVer
EXPECT_FALSE(clean.preferShader);
EXPECT_EQ(measured, 0) << "a forced verdict must not also run the device probe";
const auto other = ChooseWireDepthResolveArm(WireDepthResolveProbeKnob::Unrecognised, true, measure);
EXPECT_EQ(measured, 1) << "an unrecognised value runs the probe as if the knob were unset";
EXPECT_EQ(measured, 1) << "an unrecognized value runs the probe as if the knob were unset";
EXPECT_FALSE(other.measurement.fromKnob);
EXPECT_EQ(other.verdict, WireDepthResolveProbeVerdict::Clean);
// `elide-subject` is the REAL probe's negative control: it decides nothing here - the device
@@ -856,11 +856,11 @@ TEST(PipelineQuirkTest, WirePlaceholderKeysArePrivatePerShapeAndUnitAndBounded)
}
// P7 g3-blit (g3det, ~/w7/logs/g3det/VERDICT.md section 3): WHICH SAMPLER THE WIRE ARM'S SHADER
// COLOUR BLIT USES (WireColorBlitFilter.h). GL filters only a STRETCHED blit, so a 1:1 blit is a copy
// COLOR BLIT USES (WireColorBlitFilter.h). GL filters only a STRETCHED blit, so a 1:1 blit is a copy
// whatever `filter` says. The wire pass sampled every GL_LINEAR blit through its linear sampler; on
// Adreno 830 the sub-texel coordinate quantisation moved create-instancing's 1:1 GL_LINEAR blit into
// FB 0 by 1 LSB on 712 edge pixels, while the monolith's vkCmdBlitImage copied them exactly.
// Lavapipe samples texel centres exactly and shows the same picture on both samplers, so no host
// Lavapipe samples texel centers exactly and shows the same picture on both samplers, so no host
// lane can see this; the choice is pinned here instead.
//
// Red once (executed, reverted): WireColorBlitFilterFor reduced to the old mapping
@@ -902,7 +902,7 @@ TEST(PipelineQuirkTest, WireColorBlitSamplesNearestWhereTheBlitIsACopy) {
};
for (const auto& copy : copies) {
EXPECT_TRUE(WireBlitIsUnscaled(copy.source, copy.destination)) << copy.what;
// A quarter turn maps logical pixel centres onto native ones (the native extent is the
// A quarter turn maps logical pixel centers onto native ones (the native extent is the
// logical one swapped), so a copy is still a copy on every rotated surface.
for (const auto transform : kExpressedTransforms) {
EXPECT_EQ(WireColorBlitFilterFor(copy.source, copy.destination, GL_LINEAR, transform), VK_FILTER_NEAREST)
@@ -330,9 +330,9 @@ void main() { fragColor = vec4(1.0); }
// ---------------------------------------------------------------------------------------
// The state the split invented and GL gives no way out of: phase A published LINK_STATUS
// GL_TRUE, and phase B then settled CANCELLED rather than Complete - its body threw
// GL_TRUE, and phase B then settled CANCELED rather than Complete - its body threw
// (bad_alloc out of GlslangToSpv/spirv-opt under pack-load memory pressure), the pool failed
// to enqueue it, or teardown cancelled it while it was queued. The shadow is then a
// to enqueue it, or teardown canceled it while it was queued. The shadow is then a
// default-constructed SpirvArtifacts: empty uniformOffsets, null scratch, spirvStatus false -
// while the whole phase-A query surface, IsValidUniformLocation() included, keeps answering.
//
@@ -366,7 +366,7 @@ TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInste
++cancelled;
// ---- the contract: linked, fully queryable, not drawable ----
EXPECT_TRUE(object->GetLinkStatus()) << "a cancelled phase B must not retract LINK_STATUS";
EXPECT_TRUE(object->GetLinkStatus()) << "a canceled phase B must not retract LINK_STATUS";
EXPECT_EQ(QueryLinkStatus(program), GL_TRUE);
EXPECT_FALSE(object->GetSpirvStatus());
EXPECT_TRUE(object->IsSpirvComplete());
@@ -420,7 +420,7 @@ TEST_F(AsyncSpirvPhaseTest, ALinkedProgramWhoseSpirvJobWasCancelledDegradesInste
EXPECT_EQ(GetError(), GL_NO_ERROR);
}
EXPECT_GT(cancelled, 0) << "no phase B was ever cancelled; this case proved nothing";
EXPECT_GT(cancelled, 0) << "no phase B was ever canceled; this case proved nothing";
}
// The mirror image: with async off the state is not reachable at all, because both bodies run
@@ -791,7 +791,7 @@ TEST_F(AsyncSpirvPhaseTest, RelinkingOverAPendingSpirvJobIsClean) {
GetUniformfv(program, secondTint, tint);
for (int c = 0; c < 3; ++c) {
EXPECT_FLOAT_EQ(tint[c], 0.0f)
<< "a uniform write buffered against the cancelled link leaked into the relink, component " << c;
<< "a uniform write buffered against the canceled link leaked into the relink, component " << c;
}
}
@@ -110,7 +110,7 @@ TEST(AsyncTeardown, DestroyWithCompilesAndLinksInFlight) {
MobileGL::Destroy();
// Back up again. The pool stays stopped for the rest of the process (a one-way latch), so
// this second life is synchronous - which is exactly the documented behaviour, and it has
// this second life is synchronous - which is exactly the documented behavior, and it has
// to still be a WORKING one.
MobileGL::Initialize();
const GLuint vs2 = MakeShader(GL_VERTEX_SHADER, kVs);
@@ -327,7 +327,7 @@ void main() { fragColor = thisIdentifierWasNeverDeclared; }
// With the quirk unset (Auto = the shipped default), GL_COMPILE_STATUS on a pending compile
// must join it: after the query, the node is terminal. This is the case that guards the
// default against ever silently flipping. No blocker here - a blocked pool would turn the
// (correct) joining behaviour into a deadlock; a plain backlog only makes the pre-join
// (correct) joining behavior into a deadlock; a plain backlog only makes the pre-join
// state likely, and the assertion is valid either way.
TEST_F(OptimisticStatusTest, OffByDefaultTheStatusStillJoins) {
const AsyncModeScope async(true);
@@ -16,7 +16,7 @@
// * GL_MAX_SHADER_COMPILER_THREADS_KHR;
// * the extension string itself, which must appear if and only if asynchronous
// compilation is enabled - the kill switch has to revert the application-visible
// behaviour change, not only the threading.
// behavior change, not only the threading.
//
// Like the other async suites, every case drives the real GL entry points and flips
// MG_Config::Features.AsyncShaderCompile itself, so the file behaves identically whether or
@@ -1974,7 +1974,7 @@ void main() { color = u + v; }
// ------------------------------------------------------------- length on every path ----
// glGetProgramResourceiv's *length is the caller's only signal for how many entries params
// holds, and callers are entitled to leave it uninitialised: the CTS declares `GLsizei
// holds, and callers are entitled to leave it uninitialized: the CTS declares `GLsizei
// length;` next to a 1000-entry stack array and then loops `for (i = 0; i < length; ++i)`
// (gl4cProgramInterfaceQueryTests.cpp:2172). Leaving it untouched on an error path therefore
// does not "return nothing" - it hands the caller whatever was on its stack and makes it walk
+15 -15
View File
@@ -428,7 +428,7 @@ void main() {
//
// THE REFERENCE IS COMPUTED HERE, not copied as a constant, and it is computed with the same
// algorithm the old consumer used: per module in linked-stage order, STORAGE_BUFFER
// descriptors only, sorted by (normalised name, binding), deduplicated across modules by name.
// descriptors only, sorted by (normalized name, binding), deduplicated across modules by name.
// Comparing against a hand-written expected list would only pin what the author believed.
//
// THE PROGRAM IS THE ONE THE CONTRACT ASKS FOR: multi-stage (vertex + fragment), with an
@@ -605,7 +605,7 @@ void main() {
// The arrayed block must appear ONCE, under its stripped name: glslang reflects it per
// element and SPIR-V carries one descriptor, and collapsing the two is the whole reason
// the archive normalises.
// the archive normalizes.
EXPECT_EQ(std::count(archived.begin(), archived.end(), String("Blocks")), 1)
<< "the arrayed SSBO must collapse to one entry named without its subscript";
// The atomic counter is in the BACKEND's space even though GL's own enumeration excludes it.
@@ -2866,7 +2866,7 @@ TEST_F(ProgramTest, UniformBlockListExcludesStorageAndAtomicCounterBlocks) {
GetActiveUniformBlockiv(program, blk2, GL_UNIFORM_BLOCK_BINDING, &binding);
EXPECT_EQ(binding, 7);
GetActiveUniformBlockiv(program, blk, GL_UNIFORM_BLOCK_BINDING, &binding);
EXPECT_NE(binding, 7) << "the rebind must not have leaked onto the neighbouring block";
EXPECT_NE(binding, 7) << "the rebind must not have leaked onto the neighboring block";
EXPECT_EQ(GetError(), GL_NO_ERROR);
// An index past the end of the (now shorter) list is GL_INVALID_VALUE, not a silently
@@ -3679,11 +3679,11 @@ TEST_F(ProgramTest, TwoShaderObjectsWithIdenticalSourceLinkIndependently) {
// single parse - made safe by ClaimParsedShader's CAS, exactly as it already was for
// one shader object attached to two programs. ShaderCompileAdoptionTest pins that
// down by linking both objects and comparing the generated SPIR-V.
// * The translation memo's compile half (L1c) recognises the second object's source and
// * The translation memo's compile half (L1c) recognizes the second object's source and
// publishes its verdict WITHOUT parsing, so that object legitimately holds no TShader
// at all until a link asks ClaimParsedShader for one. Asserting a non-null parse here
// would be asserting that the parse had NOT been skipped - i.e. testing the absence
// of the optimisation rather than the invariant.
// of the optimization rather than the invariant.
//
// So the pointer assertion applies only where the two objects are genuinely INDEPENDENT,
// i.e. where job adoption is not in play. What every mode has to agree on is the two
@@ -3694,7 +3694,7 @@ TEST_F(ProgramTest, TwoShaderObjectsWithIdenticalSourceLinkIndependently) {
// Either may legitimately hold NO parse: that is an L1c hit, where the AST is made on
// demand at link instead. So this asserts they are not the SAME non-null parse, and
// deliberately not that both have one - the latter would be asserting that the
// optimisation had not happened.
// optimization had not happened.
if (shaderA != nullptr && shaderB != nullptr) {
EXPECT_NE(shaderA, shaderB) << "two independent shader objects share one consume-once parse";
}
@@ -3771,7 +3771,7 @@ TEST_F(ProgramTest, PreprocessCacheOverflowKeepsCompilingCorrectly) {
// glUniformMatrix{2x3,2x4,3x2,3x4,4x2,4x3}fv and their twelve glProgramUniformMatrix* twins were
// validate-only no-ops: they never took the value pointer at all. They upload column-at-a-time at
// the std140 16-byte column stride, honouring `transpose`, and glGetUniformfv undoes that padding.
// the std140 16-byte column stride, honoring `transpose`, and glGetUniformfv undoes that padding.
TEST_F(ProgramTest, NonSquareMatrixUniformsRoundTripThroughTheGlobalUbo) {
const char* vsSource = R"(#version 430 core
uniform mat2x3 uM2x3;
@@ -3889,7 +3889,7 @@ void main() { fragColor = vec4(1.0); }
EXPECT_EQ(GetError(), GL_NO_ERROR);
}
// GL 4.6 core 7.1: shaderType is an enum, so an unrecognised one is INVALID_ENUM - it used to be
// GL 4.6 core 7.1: shaderType is an enum, so an unrecognized one is INVALID_ENUM - it used to be
// reported as INVALID_VALUE. glCreateShaderProgramv adds a count < 0 gate ahead of everything.
TEST_F(ProgramTest, CreateShaderAndCreateShaderProgramvReportTheRightErrorClasses) {
while (GetError() != GL_NO_ERROR) {}
@@ -4366,10 +4366,10 @@ void main() { mgColor = vec4(1.0); }
)";
} // namespace
// Two fragment outputs on ONE location with DIFFERENT colour indices is not an aliasing error -
// Two fragment outputs on ONE location with DIFFERENT color indices is not an aliasing error -
// it is dual-source blending (GL 4.6 core 11.1.3 / ARB_blend_func_extended, core since 3.3), and
// the GL_SRC1_* blend factors have nothing to read without it. The link-time aliasing check keyed
// on the colour number alone, so every such program failed to link with "alias color number 0"
// on the color number alone, so every such program failed to link with "alias color number 0"
// and the whole feature was unreachable from shader-side GLSL.
TEST_F(ProgramTest, FragmentOutputsMayShareALocationWhenTheirColorIndexDiffers) {
constexpr const char* dualSourceFs = R"(#version 460 core
@@ -4385,7 +4385,7 @@ void main() { fragColor0 = vec4(1.0); fragColor1 = vec4(0.5); }
GetProgramInfoLog(program, sizeof(log), nullptr, log);
return std::string(log);
}();
// Both outputs are active and both sit on colour number 0 - which is the shape that used to be
// Both outputs are active and both sit on color number 0 - which is the shape that used to be
// refused. (glGetFragDataIndex still answers 0 for the index-1 output: it reports only what
// glBindFragDataLocationIndexed bound, and reflecting the shader-side qualifier is a separate
// gap, so it is deliberately not asserted here.)
@@ -4394,7 +4394,7 @@ void main() { fragColor0 = vec4(1.0); fragColor1 = vec4(0.5); }
EXPECT_EQ(GetError(), GL_NO_ERROR);
}
// The check it must NOT stop making: two outputs on the same colour number AND the same index
// The check it must NOT stop making: two outputs on the same color number AND the same index
// really do alias, and that link has to fail. Aliased through glBindFragDataLocation rather than
// through two `layout(location = 0)` qualifiers on purpose - the qualifier form is caught by
// glslang at COMPILE time, so it would never reach the link-time rule this pins.
@@ -4426,7 +4426,7 @@ void main() { fragColorA = vec4(1.0); fragColorB = vec4(0.5); }
GetProgramInfoLog(program, sizeof(infoLog), nullptr, infoLog);
EXPECT_NE(std::string(infoLog).find("alias color number"), std::string::npos) << infoLog;
// ...and the same pair separated by the colour INDEX links, which is the whole point of the
// ...and the same pair separated by the color INDEX links, which is the whole point of the
// key being a pair.
BindFragDataLocationIndexed(program, 0, 1, "fragColorB");
LinkProgram(program);
@@ -4439,7 +4439,7 @@ void main() { fragColorA = vec4(1.0); fragColorB = vec4(0.5); }
for (int i = 0; i < 32 && GetError() != GL_NO_ERROR; ++i) {}
}
// An API colour index of ZERO is "no override", not "index 0". glBindFragDataLocation is
// An API color index of ZERO is "no override", not "index 0". glBindFragDataLocation is
// glBindFragDataLocationIndexed with index 0 (GL_Program.cpp), so the blanket-bind pattern -
// portable code that binds every output name it knows about, without caring about dual-source -
// writes a real 0 into the frag-data index map for an output whose shader qualifier says 1.
@@ -4468,7 +4468,7 @@ void main() { fragColor0 = vec4(1.0); fragColor1 = vec4(0.5); }
AttachShader(program, fs);
DeleteShader(fs);
// The blanket bind: colour number 0, index 0, on the output the shader put at index 1.
// The blanket bind: color number 0, index 0, on the output the shader put at index 1.
BindFragDataLocation(program, 0, "fragColor0");
BindFragDataLocation(program, 0, "fragColor1");
LinkProgram(program);
+8 -8
View File
@@ -665,7 +665,7 @@ void main() {
// declaration, so measure the line rather than assuming its length.
EXPECT_EQ(outputPos, source.find('\n', versionPos) + 1);
EXPECT_NE(source.find("// #version 460 core"), String::npos);
// This #line sits ahead of the version directive, where GLSL would never have honoured it, so
// This #line sits ahead of the version directive, where GLSL would never have honored it, so
// it is still dropped. Directives that follow the version line are kept - see
// PreprocessKeepsPlainLineDirectivesAndSparesLookalikeIdentifiers.
EXPECT_EQ(source.find("#line"), String::npos);
@@ -995,7 +995,7 @@ void main() {
TEST_F(ProgramUtilTest, RetargetLegacyVersionDirectiveOnlyTouchesNormalizedDesktopCore) {
using namespace MG_Util::ShaderTranspiler;
// Only MobileGL's own normalization is retargetable, and it is recognised by the marker the
// Only MobileGL's own normalization is retargetable, and it is recognized by the marker the
// preprocessor leaves on the directive line - so normalize a legacy source rather than
// hand-writing the directive the marker belongs to.
String normalized = "#version 130\nvoid main() {}\n";
@@ -2386,7 +2386,7 @@ TEST_F(ProgramUtilTest, CompileEnvWithoutBackendAdvertisesEverything) {
EXPECT_TRUE(env.IsExtensionAdvertised(MobileGL::E_GL_ARB_gpu_shader_int64));
}
// P0b layer 2: ShaderPreprocessCache, tested directly. The GL-level behaviour it
// P0b layer 2: ShaderPreprocessCache, tested directly. The GL-level behavior it
// enables is covered end to end in ProgramTest; these pin the container itself,
// where the interesting cases (hash collisions, both eviction budgets) are hard
// to provoke through glCompileShader.
@@ -3350,7 +3350,7 @@ void main() {
const Vector<Uint32> spirv = BuildSpirvForStage(vs, GL_VERTEX_SHADER);
ASSERT_FALSE(spirv.empty());
EXPECT_TRUE(ShaderCompiler::ModuleDeclaresBufferTextureSampler(spirv))
<< "an isamplerBuffer must be recognised as a buffer texture";
<< "an isamplerBuffer must be recognized as a buffer texture";
}
// The float and unsigned spellings lower to the same Dim=Buffer image with a different
@@ -3396,7 +3396,7 @@ void main() { fragColor = texture(Albedo, vUv) + vec4(texelFetch(Ids, ivec2(0),
<< "only Dim=Buffer images are buffer textures";
}
// Pins the SPIRV-Cross behaviour the whole defect rests on: below ESSL 320 it synthesizes an
// Pins the SPIRV-Cross behavior the whole defect rests on: below ESSL 320 it synthesizes an
// EXT_texture_buffer requirement from the image type itself. There is nothing in the module
// to strip - which is why the OES driver is served by retargeting the emitted directive
// (RetargetTextureBufferExtension) rather than by rewriting the SPIR-V.
@@ -3501,7 +3501,7 @@ void main() { ssb.sum = imageAtomicAdd(i0, 2, 7u); }
// The negative control, and the whole reason the pass exists: SPIRV-Cross's ES emulation of 1D
// images does not ask whether the type is arrayed, so it wraps an already-two-component
// coordinate in a two-component constructor. Pinning the upstream behaviour here means that if a
// coordinate in a two-component constructor. Pinning the upstream behavior here means that if a
// future SPIRV-Cross bump fixes it, this test fails and says so, rather than the pass quietly
// becoming dead weight.
TEST_F(ProgramUtilTest, SpirvCrossEmitsAMalformedCoordinateFor1DArrayImages) {
@@ -3638,7 +3638,7 @@ void main() { ssb.sum = imageLoad(i0, 2).r; }
// all: SPIRV-Cross widens a 1D image coordinate in OpImageRead and OpImageWrite but not in
// OpImageTexelPointer, so the atomic comes out addressing an `uimage2D` with a scalar. Every ES
// driver answers "no matching overloaded function found" and the whole stage - with every other
// image in it - is lost. Pinning the upstream behaviour here means a future SPIRV-Cross bump that
// image in it - is lost. Pinning the upstream behavior here means a future SPIRV-Cross bump that
// fixes it fails this test instead of leaving the lowering as silent dead weight.
TEST_F(ProgramUtilTest, SpirvCrossEmitsAScalarCoordinateForA1DImageAtomic) {
using namespace MG_Util::ShaderTranspiler;
@@ -3805,7 +3805,7 @@ void main() { ssb.data = textureLodOffset(g_sampler4, vec2(0.5, 1.0), 0.0, 0); }
// The negative control, and the whole reason the pass exists: SPIRV-Cross emits the sampler as 2D
// and widens the coordinate, then hands the scalar offset straight through. Pinning the upstream
// behaviour here means that if a future SPIRV-Cross bump fixes it, this test fails and says so,
// behavior here means that if a future SPIRV-Cross bump fixes it, this test fails and says so,
// rather than the pass quietly becoming dead weight.
TEST_F(ProgramUtilTest, SpirvCrossEmitsAScalarOffsetFor1DSamplers) {
using namespace MG_Util::ShaderTranspiler;
@@ -13,7 +13,7 @@
// two programs linking that one node to byte-identical SPIR-V;
// * that sharing did not make a cancel dangerous. Before this stage a node had exactly one
// shader object, so "this object stopped caring" and "nothing can observe this result"
// were the same statement and CancelCompile() cancelled unconditionally. They are not the
// were the same statement and CancelCompile() canceled unconditionally. They are not the
// same statement any more, and the four mutation paths that used to reach that cancel -
// re-source, delete, the orphan-name sweep, the destructor - are each covered below with
// a second object still holding the node.
@@ -453,9 +453,9 @@ TEST_F(ShaderCompileAdoptionTest, DeletingOneSharerLeavesTheOtherIntact) {
// RunBody() for it - when the last holder releases it. ReleaseCompileNode fires Cancel(),
// but JobNode::Cancel on a Running node only sets the cancellation-REQUEST flag; the state
// stays Running until the worker's body returns and JobNode::Run forces the final transition
// to Cancelled (see JobNode::Run's tail: it takes Cancelled instead of Complete whenever
// to Canceled (see JobNode::Run's tail: it takes Canceled instead of Complete whenever
// m_cancelled is set, regardless of how the body finished). FindAdoptable must refuse a node
// in that in-between state - not just one already settled as Cancelled - or C inherits a
// in that in-between state - not just one already settled as Canceled - or C inherits a
// doomed node and glGetShaderiv reports GL_FALSE with an empty info log for valid source.
TEST_F(ShaderCompileAdoptionTest, RunningCancelRequestedNodeIsNotAdopted) {
const AsyncModeScope async(true);
@@ -584,7 +584,7 @@ TEST_F(ShaderCompileAdoptionTest, OrphanSweepWithALinkPinnedSharedNodeHoldsBoth)
}
// Every sharer released, in turn, with nothing pinning the node: the LAST release is the one
// that may cancel, and afterwards the map must not hand the cancelled node to anybody. The
// that may cancel, and afterwards the map must not hand the canceled node to anybody. The
// property asserted is the one that matters and it is timing-free: whatever happened to the
// old node, a later object with the same source must end up with a CORRECT compile.
TEST_F(ShaderCompileAdoptionTest, AfterEverySharerIsGoneTheNextCompileIsStillCorrect) {
@@ -613,7 +613,7 @@ TEST_F(ShaderCompileAdoptionTest, AfterEverySharerIsGoneTheNextCompileIsStillCor
ShaderSource(c, 1, &text, nullptr);
CompileShader(c);
ASSERT_EQ(QueryCompileStatus(c), GL_TRUE)
<< "a cancelled node must never be adopted - it can only ever report GL_FALSE. " << QueryShaderInfoLog(c);
<< "a canceled node must never be adopted - it can only ever report GL_FALSE. " << QueryShaderInfoLog(c);
const GLuint program = LinkWith(c);
ASSERT_EQ(QueryLinkStatus(program), GL_TRUE);
EXPECT_GE(GetUniformLocation(program, "uSeed240"), 0);
@@ -621,7 +621,7 @@ TEST_F(ShaderCompileAdoptionTest, AfterEverySharerIsGoneTheNextCompileIsStillCor
}
// ---------------------------------------------------------------------------------------
// The bypasses: both must be byte-identical to the pre-stage-6 behaviour
// The bypasses: both must be byte-identical to the pre-stage-6 behavior
// ---------------------------------------------------------------------------------------
// The kill switch. With the flag off, compilation is synchronous and NOTHING is adopted -
@@ -737,7 +737,7 @@ TEST_F(ShaderCompileAdoptionTest, StressFortyEightObjectsOverSixSources) {
// The adversarial interleaving, with duplicates everywhere: compile, query, re-source,
// re-compile, delete, all with the pool busy and most objects sharing nodes. Nothing here
// asserts timing - what it hunts for is a node cancelled out from under a sharer, which
// asserts timing - what it hunts for is a node canceled out from under a sharer, which
// surfaces as a wrong status, a wrong uniform, or a crash.
TEST_F(ShaderCompileAdoptionTest, StressSharedNodesUnderResourceAndDelete) {
const AsyncModeScope async(true);
@@ -796,7 +796,7 @@ TEST_F(ShaderCompileAdoptionTest, StressSharedNodesUnderResourceAndDelete) {
// The map itself, driven directly
// ---------------------------------------------------------------------------------------
// Two of the map's rules cannot be forced deterministically through the GL surface - a
// cancelled node depends on beating a worker to it, and a CompileEnv re-capture needs a
// canceled node depends on beating a worker to it, and a CompileEnv re-capture needs a
// backend swap. Both are unconditional properties of the class, so they are asserted here
// against the class.
@@ -853,7 +853,7 @@ TEST(ShaderCompileAdoptionMapTest, EnvFingerprintMismatchIsNotAdopted) {
EXPECT_EQ(map.GetAdoptionCount(), 0u);
}
// A node that settled as Cancelled published nothing, so adopting it would hand the new
// A node that settled as Canceled published nothing, so adopting it would hand the new
// object a compile that can only ever report GL_FALSE. It must be a miss, and the dead entry
// must be pruned where it is found rather than waiting for the amortized sweep.
TEST(ShaderCompileAdoptionMapTest, CancelledNodeIsNotAdoptedAndIsPruned) {
@@ -862,7 +862,7 @@ TEST(ShaderCompileAdoptionMapTest, CancelledNodeIsNotAdoptedAndIsPruned) {
const String text = "#version 460\nvoid main() {}\n";
const SharedPtr<ShaderCompileTask> node = MakeNode(text, ShaderStage::Fragment, env);
map.Register(node);
// Never posted, so this settles the node as Cancelled right here.
// Never posted, so this settles the node as Canceled right here.
node->Cancel();
ASSERT_TRUE(node->IsCancelled());
ASSERT_EQ(map.GetEntryCount(), 1u);
+6 -6
View File
@@ -102,8 +102,8 @@ namespace {
// ctest -R Sanity` is the legacy-arm run of the same binary and the A/B is one env var.
//
// It runs as a gtest Environment rather than a static initializer on purpose:
// MG_Config::Features has a String member, so it is dynamically initialised, and writing
// to it from another TU's static initializer would be an initialisation-order race.
// MG_Config::Features has a String member, so it is dynamically initialized, and writing
// to it from another TU's static initializer would be an initialization-order race.
// SetUp() runs inside RUN_ALL_TESTS, long after every static initializer, and before the
// first test - hence before anything can latch EsprytSlotTablesEnabled().
class EsprytSlotArmEnvironment final : public ::testing::Environment {
@@ -542,7 +542,7 @@ TEST(DirectVulkanSanity, SampledViewAspectFollowsDepthStencilTextureMode) {
static_cast<VkImageAspectFlags>(VK_IMAGE_ASPECT_DEPTH_BIT));
EXPECT_EQ(VkTextureManager::ResolveSampledImageViewAspectMask(kPacked, GL_STENCIL_INDEX),
static_cast<VkImageAspectFlags>(VK_IMAGE_ASPECT_STENCIL_BIT));
// The default argument is the pre-existing behaviour, for the call sites with no texture.
// The default argument is the pre-existing behavior, for the call sites with no texture.
EXPECT_EQ(VkTextureManager::ResolveSampledImageViewAspectMask(kPacked),
static_cast<VkImageAspectFlags>(VK_IMAGE_ASPECT_DEPTH_BIT));
@@ -1531,7 +1531,7 @@ TEST(GetterSanity, MaxElementIndexIsTheFull32BitIndexCeiling) {
// GL 4.6 core table 23.53 gives GL_MAX_SAMPLES a minimum of four and the three per-category
// ceilings a minimum of ONE. Flooring the latter at four is the advertised-caps lie that made
// KHR-GL46.sample_variables.mask.rgba8i run at all: the frontend promised four integer samples,
// the backend clamped the realised allocation to the one the driver can back, and the application
// the backend clamped the realized allocation to the one the driver can back, and the application
// wrote per-sample data it could never read.
TEST(GetterSanity, PerCategoryMultisampleCeilingsAreProbedRatherThanFlooredAtFour) {
using namespace MobileGL;
@@ -2971,7 +2971,7 @@ TEST(DirectGLESStateGuards, DefaultFramebufferBindGoesThroughShadow) {
// first mass eviction during world load - the failure FastSTL's double-advancing
// erase actually produced before it was fixed).
//
// These pin the behaviour the call sites rely on, not one map's implementation, so
// These pin the behavior the call sites rely on, not one map's implementation, so
// they are written against MobileGL::UnorderedMap and survive changing what it
// names. Under ska::flat_hash_map the mechanism is different - erase backward-shifts
// the rest of the probe cluster into the hole and hands back the same slot, which
@@ -3806,7 +3806,7 @@ TEST(DirectGLESSlotTable, EveryReKeyedObjectClassAnnouncesItsOwnDeath) {
expected.emplace_back(MG_Pipe::MGPipeKind::VertexElementsCso, vertexArray->GetLifetimeId());
// P3a, and it is DELIBERATELY NOT in `expected`: the buffer is the seventh re-keyed
// class and the only one whose death does not travel on this notice. The catalogue
// class and the only one whose death does not travel on this notice. The catalog
// has a call for it - resource_destroy - so no seventh NotifyStateObjectDestroyed
// raiser was added (D-L). StateObjectDeathNotice.h exists for kinds that have NO
// such call, and a buffer raising one too would be two death signals for one object,
@@ -104,7 +104,7 @@ namespace {
// Probe 5's inconclusive path: nothing compiles, including the location-0 control.
bool everyCompileFails = false;
// Probe 6: a blit writes the destination array layer the framebuffer names, or always
// layer 0. The second knob is the inconclusive path - a driver that does not honour the
// layer 0. The second knob is the inconclusive path - a driver that does not honor the
// SOURCE layer either fails the probe's control.
bool blitIgnoresDestinationLayer = false;
bool blitIgnoresSourceLayer = false;
@@ -112,7 +112,7 @@ namespace {
// Probe 7: the driver stores a WHOLE 16-bit packed ALLOCATION with its fields packed
// from the other end of the word - on the measured device, every level of the probe's
// 30x30x12 three-level array, while same-shape plain-2D images stay in the canonical
// order. Modelled at the raw copy, which is the only path that can observe it (uploads
// order. Modeled at the raw copy, which is the only path that can observe it (uploads
// and readbacks of the same image decode the driver's own layout consistently): a copy
// whose SOURCE is any level of the mirrored allocation delivers the mirrored
// re-encoding, which the plain-2D readback then decodes with the non-REV order -
@@ -178,7 +178,7 @@ namespace {
// The device rule the probe reproduces: the mirrored layout is only picked when
// the levels were uploaded onto a texture still at the driver defaults - any
// glTexParameteri BEFORE the first upload steers the driver to the plain layout.
// Modelling it makes a params-first probe (the round-one regression: it measured
// Modeling it makes a params-first probe (the round-one regression: it measured
// "clean" in the very context whose params-after textures mirrored) stop
// detecting, which turns that mistake into a red test instead of a silent miss.
bool paramsTouchedBeforeUpload = false;
@@ -639,7 +639,7 @@ namespace {
g_fake.lastSampledValue = 0.0f;
} else if (g_fake.msaaSwizzledAlphaCorrupted && swizzle == GL_RED && component == 'w' &&
sampleIndex != 0 && g_fake.sampledMultisampleProgramCount >= 2) {
// Uninitialised memory: a value that is neither the answer nor the clear.
// Uninitialized memory: a value that is neither the answer nor the clear.
g_fake.lastSampledValue = -1.34954e-17f;
}
return;
@@ -11,7 +11,7 @@
// GPU; the two pure functions are where the cheap mistakes live - a verdict that reads a
// half-broken driver as healthy, an override arm swapped so ForceOn disarms, a
// substitute ranked below a worse one - and every driver the campaign has
// characterised is written down here as a fake measurement so the mapping cannot
// characterized is written down here as a fake measurement so the mapping cannot
// drift without a red:
// - a conforming driver (stream counts everywhere),
// - lavapipe as measured 2026-08: stream silent everywhere, the dedicated
@@ -191,7 +191,7 @@ void main() {
}
)";
// The colour class, which real devices squeeze to something above 1 rather than to 1.
// The color class, which real devices squeeze to something above 1 rather than to 1.
const char* const kColorMultisampleFetch = R"(#version 410 core
uniform sampler2DMS colorMs;
out vec4 fragColor;
@@ -268,7 +268,7 @@ TEST_F(ClampMultisampleFetchTest, TheCombinedProbeAgreesWithThePerGateOnes) {
// The overwhelming majority of modules. Behind the probe they never reach the pass at all, but the
// pass has to be inert for them on its own, or a future caller that forgets the gate silently
// re-serialises every shader in the program.
// re-serializes every shader in the program.
TEST_F(ClampMultisampleFetchTest, LeavesAModuleWithoutAMultisampledImageUntouched) {
const Vector<Uint32> input = CompileFragment(kNoMultisampleFetch);
ASSERT_FALSE(input.empty());
@@ -328,7 +328,7 @@ TEST_F(ClampMultisampleFetchTest, ReplacesAnOutOfRangeIntegerSampleWithZero) {
}
// The same shader on a device whose integer ceiling really is what MobileGL advertises. Nothing is
// out of range, so nothing may be rewritten - and the module must not even be re-serialised.
// out of range, so nothing may be rewritten - and the module must not even be re-serialized.
TEST_F(ClampMultisampleFetchTest, LeavesTheFetchAloneWhenTheCategoryReachesTheAdvertisedMaximum) {
const Vector<Uint32> input = CompileFragment(kIntegerMultisampleFetch);
ASSERT_FALSE(input.empty());
@@ -412,7 +412,7 @@ void main() {
}
} // namespace
// Integer colour squeezed to one sample but depth/stencil at four (Adreno): a usampler2DMS fetch
// Integer color squeezed to one sample but depth/stencil at four (Adreno): a usampler2DMS fetch
// straight from its uniform is handed to the runtime bound and keeps sample 3 - a stencil texture
// really has it - while the fetch through a parameter and the signed one still read sample 0.
TEST_F(ClampMultisampleFetchTest, DefersADirectUnsignedFetchToTheRuntimeBound) {
@@ -800,7 +800,7 @@ TEST_F(DemoteFloat64Test, TheThirtyTwoBitBehaviourIsUnchanged) {
EXPECT_FALSE(RewritesToAnAbsoluteValueTest(CompareAgainst("float", "1.0")))
<< "a float compared against 1.0 must not be rewritten";
EXPECT_TRUE(RewritesToAnAbsoluteValueTest(CompareAgainst("float", "0.0")))
<< "the 32-bit behaviour this pass shipped with must be preserved exactly";
<< "the 32-bit behavior this pass shipped with must be preserved exactly";
}
// The pass matches ZERO, not "small". The old constant-is-zero test was `fabs(v) <= 1e-4`, so a
@@ -169,7 +169,7 @@ TEST(ExtendNarrowIntegerVertexInputsRuntimeWidths, SeedsEveryIntegerInputFromThe
EXPECT_EQ(ValidationError(output), String{});
const String text = Disassemble(output);
// The two globals: named, Private, initialised to 0 and never stored.
// The two globals: named, Private, initialized to 0 and never stored.
for (const char* name : {kNarrowIntegerWidths8GlobalName, kNarrowIntegerWidths16GlobalName}) {
const String id = String("%") + name;
EXPECT_NE(text.find(id + " = OpVariable %_ptr_Private_uint Private %uint_0"), String::npos) << name << "\n"
@@ -227,7 +227,7 @@ TEST(ExtendNarrowIntegerVertexInputs, LeavesEverythingElseUnchanged) {
}
// From SPIR-V 1.4 an entry point lists every global it uses, so the Private copies have to join
// the new Inputs in the interface. Checked by re-labelling the module 1.4 and validating it for an
// the new Inputs in the interface. Checked by re-labeling the module 1.4 and validating it for an
// environment that accepts 1.4.
TEST(ExtendNarrowIntegerVertexInputs, ListsPrivateCopiesInASpirv14Interface) {
MobileGL::Initialize();
@@ -252,7 +252,7 @@ TEST(FixIterationRPSubgroupScratchPass, GrowsTheExposureScratchForNarrowSubgroup
ASSERT_EQ(WorkgroupArrayLengths(input), (std::vector<Uint32>{4u, 32u}));
// lavapipe: 8-lane subgroups over 512 invocations need 64 entries; the
// plainly indexed neighbour must keep its 4.
// plainly indexed neighbor must keep its 4.
Vector<Uint32> output;
ASSERT_TRUE(ShaderCompiler::FixIterationRPSubgroupScratchForVulkan(input, output, 8u, 32768u, true));
EXPECT_EQ(WorkgroupArrayLengths(output), (std::vector<Uint32>{4u, 64u}));
@@ -8,7 +8,7 @@
//
// FlattenFloat64StorageBlockPass, over the module the production chain actually hands it:
// ShaderCompiler::SanitizeAndOptimizeBinary, where the pass sits immediately before the fp64
// demotion. The behavioural half - that a block copied through the flattened words comes back
// demotion. The behavioral half - that a block copied through the flattened words comes back
// byte for byte - is DoublePrecisionScenario's; what only a module walk can say is WHICH blocks
// were flattened, how wide, and that the ones this pass must not touch came through unchanged.
@@ -401,7 +401,7 @@ TEST_F(FlattenFloat64StorageBlockTest, TheNativePathLeavesTheBlockAndItsDoublesA
// And the control: the SAME module through the SAME entry point with the bit clear is flattened
// exactly as it always was. This is the pair that pins "capability-false is byte-for-byte the old
// behaviour" at the level the device A/B checks.
// behavior" at the level the device A/B checks.
TEST_F(FlattenFloat64StorageBlockTest, TheDemotedPathIsUnchangedByTheCapabilityArgument) {
const Vector<Uint32> input = CompileToSpirv(GL_COMPUTE_SHADER, kStd140BlockSource);
ASSERT_FALSE(input.empty());
@@ -352,7 +352,7 @@ void main() { gl_Position = vec4(two_d[1][2] + three_d[1][1][3] + one_d[2]); }
EXPECT_EQ(locations.count("one_d[0]"), 0u);
}
// A DELIBERATE BEHAVIOUR CHANGE, recorded here because it is the one place the migration does
// A DELIBERATE BEHAVIOR CHANGE, recorded here because it is the one place the migration does
// not reproduce the old answer.
//
// The lexical extractor advanced the location across the declarators of one statement, so
@@ -471,7 +471,7 @@ void main() { realBlock.u = atomicCounterIncrement(counterA) + atomicCounterIncr
ASSERT_TRUE(capture.linked) << capture.log;
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("RealBlock"), 1u)
<< "the application's own unqualified block is still recognised";
<< "the application's own unqualified block is still recognized";
for (const String& name : capture.storageBlocksWithoutBinding) {
EXPECT_FALSE(name.starts_with(MG_Util::ShaderTranspiler::ATOMIC_COUNTER_BLOCK_PREFIX))
<< "a synthesized atomic-counter block reached the storage-block capture: " << name;
@@ -557,7 +557,7 @@ void main() {
ASSERT_TRUE(capture.linked) << capture.log;
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("OutputBuffer"), 1u)
<< "the block the test binds at 0 with glBindBufferBase must be recognised";
<< "the block the test binds at 0 with glBindBufferBase must be recognized";
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("BoundBlock"), 0u)
<< "a declared binding must never be defaulted away";
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("BoundFirst"), 0u)
@@ -683,7 +683,7 @@ void main() {
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("PlainLayout"), 1u)
<< "std430/row_major are layout identifiers, not bindings";
EXPECT_EQ(capture.storageBlocksWithoutBinding.count("ReallyUnqualified"), 1u)
<< "a block that truly declares no binding is still recognised in the same shader";
<< "a block that truly declares no binding is still recognized in the same shader";
}
// THE NEGATIVE CONTROL for the storage-block capture.
@@ -714,8 +714,8 @@ void main() { gl_Position = vec4(float(sharedInstance.u + vertexOnly.v)); }
const String fragment = R"(#version 430 core
layout(std430) buffer SharedBlock { uint u; } sharedInstance;
layout(std430, binding = 4) buffer FragmentBound { uint f; } fragmentBound;
out vec4 colour;
void main() { colour = vec4(float(sharedInstance.u + fragmentBound.f)); }
out vec4 color;
void main() { color = vec4(float(sharedInstance.u + fragmentBound.f)); }
)";
const LinkCapture capture = CaptureFromLink({{GL_VERTEX_SHADER, vertex}, {GL_FRAGMENT_SHADER, fragment}});
@@ -109,7 +109,7 @@ void main()
)";
// A stage with no interface block at all: the pass must leave its located varyings alone
// and report that it changed nothing, so the caller declines the re-serialised module.
// and report that it changed nothing, so the caller declines the re-serialized module.
const char* kNoBlockTessEvalSource = R"(#version 420 core
layout(isolines, point_mode) in;
@@ -267,7 +267,7 @@ TEST_F(StripIoBlockLocationsTest, ReportsNoChangeForAStageWithoutInterfaceBlocks
Vector<Uint32> output;
ShaderCompiler::StripIoBlockLocationsForEssl(input, true, true, strippedAny, output, true);
EXPECT_FALSE(strippedAny) << "a stage with no interface block must report nothing stripped, or "
"the caller adopts a re-serialised module for nothing";
"the caller adopts a re-serialized module for nothing";
// gl_PerVertex is an Input AND an Output block in this stage and must not be touched; the
// located plain varyings must not be either. Either way the emitted ESSL is unchanged.
if (!output.empty()) {
@@ -283,5 +283,5 @@ TEST_F(StripIoBlockLocationsTest, DeclinesWhenNeitherDirectionIsArmed) {
Vector<Uint32> output;
EXPECT_FALSE(ShaderCompiler::StripIoBlockLocationsForEssl(input, false, false, strippedAny, output, true));
EXPECT_FALSE(strippedAny);
EXPECT_TRUE(output.empty()) << "an unarmed call must not even re-serialise the module";
EXPECT_TRUE(output.empty()) << "an unarmed call must not even re-serialize the module";
}
@@ -9,7 +9,7 @@
// The two-level shader translation memo (MG_Util/ShaderTranspiler/TranslationCache.h).
//
// A wrong hit here is a silently miscompiled shader, so the cases below are weighted
// heavily towards the KEY rather than towards the plumbing: for each level there is one
// heavily toward the KEY rather than toward the plumbing: for each level there is one
// case per input that can change the output, asserting that moving that input alone moves
// the key. That is the test that catches an under-specified key, which is the only way
// this feature can produce a wrong answer.
@@ -481,7 +481,7 @@ TEST_F(TranslationCacheTest, L1KeyMovesWithEveryInputThatMovesTheSpirv) {
// map is an OUTPUT of mapIO (TMglGlslIoResolver writes it and never reads it), so it is a
// pure function of the stage sources this key already carries in full. It was dropped from
// SpirvTranslationKeyInputs with the glslang-capture migration; kKeyLayoutVersion moved to
// 4 so no blob written under the old shape can be honoured.
// 4 so no blob written under the old shape can be honored.
{ // ShaderCompileBits (0 on both production parse paths; keyed so a future value
// cannot alias a module parsed without it)
SpirvTranslationKeyInputs v = base;
@@ -1328,7 +1328,7 @@ namespace {
}
// A source no other case in this file uses, so the process-global L1c cache cannot be
// pre-warmed by a neighbour and turn a "must miss" assertion green by accident.
// pre-warmed by a neighbor and turn a "must miss" assertion green by accident.
String UniqueFragment(const String& tag) {
return "#version 460\n"
"in vec3 vPos;\n"
@@ -1403,11 +1403,11 @@ TEST_F(TranslationCacheTest, TheParseVerdictKeyIgnoresBackendOnlyDifferences) {
EXPECT_TRUE(BuildShaderParseVerdictKey(onA) == BuildShaderParseVerdictKey(onB));
}
// The headline behaviour: a second shader object handed the same source does not parse.
// The headline behavior: a second shader object handed the same source does not parse.
//
// Synchronous, deliberately. Under async, ShaderCompileAdoptionMap would hand the second
// object the FIRST one whole compile node and no second compile would run at all - a
// different (and older) optimisation, which would make this case pass without L1c existing.
// different (and older) optimization, which would make this case pass without L1c existing.
TEST_F(TranslationCacheTest, ASecondCompileOfTheSameSourceSkipsTheParse) {
const SyncCompileScope sync;
const CacheModeScope cacheOn(true);
@@ -1524,7 +1524,7 @@ TEST_F(TranslationCacheTest, TheEscapeHatchDisablesL1c) {
EXPECT_EQ(after.hits - before.hits, 0u);
EXPECT_EQ(after.misses - before.misses, 0u) << "the cache was consulted with the escape hatch set";
EXPECT_EQ(after.inserts - before.inserts, 0u);
// With the level off, BOTH compiles parse - which is the pre-L1c behaviour exactly.
// With the level off, BOTH compiles parse - which is the pre-L1c behavior exactly.
EXPECT_TRUE(ShaderHasParse(first));
EXPECT_TRUE(ShaderHasParse(second));
}
@@ -249,7 +249,7 @@ TEST_F(UniquifyIoBlockNamesTest, ReportsNothingWhenThePlanNamesNoBlockThisStageD
Vector<Uint32> output;
ASSERT_TRUE(ShaderCompiler::UniquifyIoBlockNamesForEssl(input, renames, renames, renamed, output, true));
// Empty is what tells the DirectGLES program build to keep the module it already had
// instead of adopting the optimizer's re-serialised copy.
// instead of adopting the optimizer's re-serialized copy.
EXPECT_TRUE(renamed.empty());
const String dis = Disassemble(output);
@@ -559,7 +559,7 @@ void main() { g_color = vec4(1); }
GL_INVALID_VALUE},
{"glBlitFramebuffer with a filter that is neither GL_NEAREST nor GL_LINEAR",
[] { BlitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT, GL_NONE); }, GL_INVALID_ENUM},
{"glBlitFramebuffer of colour+stencil with GL_LINEAR",
{"glBlitFramebuffer of color+stencil with GL_LINEAR",
[] {
BlitFramebuffer(0, 0, 16, 16, 0, 0, 16, 16, GL_COLOR_BUFFER_BIT | GL_STENCIL_BUFFER_BIT, GL_LINEAR);
},
@@ -74,7 +74,7 @@ namespace {
// 0 is the "this slot holds nothing" value in every memo that stores an
// id, so a live object must never be able to answer to a zeroed slot.
EXPECT_NE(lifetimeId, 0u) << typeName << " handed out lifetime id 0 (attempt " << attempt
<< "), which is the value a zero-initialised memo slot already carries";
<< "), which is the value a zero-initialized memo slot already carries";
EXPECT_GT(lifetimeId, previousId)
<< typeName << " lifetime ids must be strictly increasing, so an id is never handed out twice "
<< "(attempt " << attempt << ")";
+1 -1
View File
@@ -588,7 +588,7 @@ TEST_F(RenderStateTest, IndexedRectangleQueriesRejectAnOutOfRangeIndex) {
// window", which the frontend cannot spell before a surface exists). DirectGLES resolved the two
// by looking at the EXTENT and so inverted every deliberately empty box into the full surface -
// KHR-GL43.viewport_array.scissor_zero_dimension is exactly that draw, and it came back holding
// the drawn colour where the untouched fill was required.
// the drawn color where the untouched fill was required.
//
// These drive RenderState directly instead of the GL entry points on purpose: the flag's whole
// content is what it says BEFORE the first scissor call of a context, and this binary shares one
@@ -59,7 +59,7 @@ TEST(TransformFeedbackLifetimeIdTest, AnObjectAtARecycledNameCarriesAFreshLifeti
context.BindTransformFeedbackObject(name);
const Uint64 firstId = context.GetBoundTransformFeedbackLifetimeId();
EXPECT_NE(firstId, 0u) << "a live transform feedback object answered to id 0, which is the value a "
"zero-initialised backend slot already carries";
"zero-initialized backend slot already carries";
// The default object is a different object and must not share the id.
context.BindTransformFeedbackObject(0);
+25 -25
View File
@@ -621,7 +621,7 @@ TEST_F(TextureTest, EverySamplerEntryPointRejectsAnUnknownNameWithInvalidOperati
// ===================== GL_TEXTURE_BORDER_COLOR (KHR-GL46.texture_border_clamp) =====================
// GL 4.6 core 8.10 / equation 2.2, and 8.11 / equation 2.3: glTexParameteriv normalizes its integer
// components into the floating-point border colour and glGetTexParameteriv converts back. The pair is
// components into the floating-point border color and glGetTexParameteriv converts back. The pair is
// exact for small integers, which is what the CTS's samplerparameteri_border_color checks with
// {0,1,2,4}; reading the float back with a truncating cast answered {0,0,0,0}.
TEST_F(TextureTest, BorderColorIntegerFormNormalizesAndRoundTripsPerEquations22And23) {
@@ -644,7 +644,7 @@ TEST_F(TextureTest, BorderColorIntegerFormNormalizesAndRoundTripsPerEquations22A
EXPECT_EQ(readBack[3], 4);
// The stored value really is the normalized fraction, not the raw integer - otherwise the round
// trip above would pass for the wrong reason (two missing conversions cancelling).
// trip above would pass for the wrong reason (two missing conversions canceling).
GLfloat asFloats[4] = {-1.0f, -1.0f, -1.0f, -1.0f};
MG_Impl::GLImpl::GetTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, asFloats);
EXPECT_EQ(MG_Impl::GLImpl::GetError(), GL_NO_ERROR);
@@ -668,7 +668,7 @@ TEST_F(TextureTest, BorderColorIntegerFormNormalizesAndRoundTripsPerEquations22A
// The sampler-object twin of the test above. It used to pass for the wrong reason: glSamplerParameteriv
// and glSamplerParameterIiv were literally the same call, so the raw integers went in and came back
// out unconverted and the two missing conversions cancelled - which also meant a border of 255 set
// out unconverted and the two missing conversions canceled - which also meant a border of 255 set
// through glSamplerParameteriv became float 255.0 instead of the spec's ~1.19e-7.
TEST_F(TextureTest, SamplerBorderColorSeparatesTheIntegerFormFromTheNormalizedForm) {
GLuint sampler = 0;
@@ -707,10 +707,10 @@ TEST_F(TextureTest, SamplerBorderColorSeparatesTheIntegerFormFromTheNormalizedFo
DrainPendingGlErrors();
}
// A border colour's FORM is state in its own right: the three representations are kept numerically in
// A border color's FORM is state in its own right: the three representations are kept numerically in
// step, so a float (0,0,0,1) followed by an integer (0,0,0,1) moves no number at all - but it is a
// real change, and the backends memoise on the version. Swallowing it left DirectGLES forwarding the
// colour through glTexParameterfv forever, which is what made an integer border of 255 come back from
// color through glTexParameterfv forever, which is what made an integer border of 255 come back from
// an isampler2D as 1132396544 (the IEEE-754 bits of 255.0f).
TEST_F(TextureTest, BorderColorFormChangeBumpsTheVersionEvenWhenTheNumbersDoNotMove) {
GLuint sampler = 0;
@@ -1089,7 +1089,7 @@ TEST_F(TextureTest, EverySamplerScalarPnameConvertsToTheQueriedType) {
}
// The unsigned spelling of a NEGATIVE float state: the conversion has to go through GLint, since
// a direct float -> GLuint cast of a negative value is undefined behaviour.
// a direct float -> GLuint cast of a negative value is undefined behavior.
GLuint negativeAsUnsigned = 0;
MG_Impl::GLImpl::GetSamplerParameterIuiv(sampler, GL_TEXTURE_MIN_LOD, &negativeAsUnsigned);
EXPECT_EQ(MG_Impl::GLImpl::GetError(), GL_NO_ERROR);
@@ -1707,12 +1707,12 @@ TEST_F(TextureTest, StencilIndexIsATextureInternalFormatPairedOnlyWithStencilSto
ASSERT_NE(textureObject, nullptr);
EXPECT_EQ(textureObject->GetFormat(), TextureInternalFormat::StencilIndex8);
// A colour transfer format against stencil storage is still INVALID_OPERATION, so the clear
// A color transfer format against stencil storage is still INVALID_OPERATION, so the clear
// the conformance case makes next fails the way it is supposed to.
MG_Impl::GLImpl::ClearTexImage(texture, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
ExpectSingleGlError(GL_INVALID_OPERATION);
// ...and the other direction: GL_STENCIL_INDEX against colour storage stays illegal.
// ...and the other direction: GL_STENCIL_INDEX against color storage stays illegal.
MG_Impl::GLImpl::TexImage2D(GL_TEXTURE_2D, 0, GL_RGBA8, 4, 4, 0, GL_STENCIL_INDEX, GL_UNSIGNED_BYTE, nullptr);
ExpectSingleGlError(GL_INVALID_OPERATION);
}
@@ -2436,7 +2436,7 @@ TEST_F(TextureTest, CompressedInternalFormatsResolveToTheirUncompressedStorage)
}
}
// Resolving to uncompressed storage is a storage decision, not a licence to answer the level
// Resolving to uncompressed storage is a storage decision, not a license to answer the level
// queries as if the application had asked for an uncompressed format. GL 4.6 core 8.5 lets the
// implementation choose for the GENERIC formats (GL_COMPRESSED_RED and friends), but a SPECIFIC
// one commits the level: GL_TEXTURE_COMPRESSED is true, GL_TEXTURE_INTERNAL_FORMAT is the token
@@ -2584,7 +2584,7 @@ namespace {
// KHR-GL43.copy_image.non_existent_mipmap. Level 1 of a texture that has only level 0 is
// not a level: GL 4.6 core 18.3.2 asks for GL_INVALID_VALUE. Until this check existed the
// level travelled all the way into the backends, and DirectVulkan built a VkImageCopy
// level traveled all the way into the backends, and DirectVulkan built a VkImageCopy
// naming mip 1 of a VkImage created with one mip - which Adreno answered with a SIGSEGV
// inside vkCmdCopyImage, killing the glcts process in the middle of a negative test.
TEST_F(TextureTest, CopyImageSubDataRejectsALevelTheTextureDoesNotHave) {
@@ -4580,7 +4580,7 @@ TEST(SharedExponentRGB9E5Test, RedundantPackedEncodingIsRGB9E5Only) {
// The other three packed 32-bit layouts round-trip through float32 bit-exactly (each field is
// either an integer or a unique float encoding), so a GPU readback still serves them - which
// matters because RGB10_A2 and R11F_G11F_B10F ARE colour-renderable and their shadow can
// matters because RGB10_A2 and R11F_G11F_B10F ARE color-renderable and their shadow can
// legitimately be stale.
EXPECT_FALSE(HasRedundantPackedEncoding(TextureInternalFormat::RGB10A2));
EXPECT_FALSE(HasRedundantPackedEncoding(TextureInternalFormat::RGB10A2UI));
@@ -4895,9 +4895,9 @@ TEST_F(TextureTest, NamedTextureCallKeepsUnitBindingAccountingCoherent) {
DrainPendingGlErrors();
}
// ---- Three-channel colour-renderable widening (Complementary Reimagined / Iris) ----------------
// ---- Three-channel color-renderable widening (Complementary Reimagined / Iris) ----------------
//
// No real OpenGL ES driver renders to a three-channel image, so a colour attachment the
// No real OpenGL ES driver renders to a three-channel image, so a color attachment the
// application asked for as GL_RGB8_SNORM or GL_RGB16F has to be stored in the four-channel
// sibling. The bit that says so used to be reachable for multisample storage only, which is why
// an ordinary GL_TEXTURE_2D attachment in one of those formats had no fallback at all and the
@@ -4911,7 +4911,7 @@ TEST_F(TextureTest, ColorAttachableTargetsRequestTheThreeChannelWidening) {
capabilities.SupportsRenderSnorm = true;
capabilities.SupportsNorm16Texture = true;
// Every image that can be a colour attachment, not just the multisample pair: an ordinary 2D
// Every image that can be a color attachment, not just the multisample pair: an ordinary 2D
// texture is what Iris attaches, and it used to be excluded.
for (const TextureTarget target :
{TextureTarget::Texture2D, TextureTarget::Texture3D, TextureTarget::TextureCubeMap,
@@ -4943,7 +4943,7 @@ TEST_F(TextureTest, ColorAttachableTargetsRequestTheThreeChannelWidening) {
PixelFormatNormalizeOptionBit::NoSnorm16RenderTarget);
// ...and neither can an 8-bit one. That half of the answer used to be missing entirely, which
// is why an R8_SNORM / RG8_SNORM colour attachment got no substitute at all on a driver
// is why an R8_SNORM / RG8_SNORM color attachment got no substitute at all on a driver
// without EXT_render_snorm.
EXPECT_TRUE(GetRenderTargetNormalizeOptions(noSnormCapabilities, texture2DIndex) &
PixelFormatNormalizeOptionBit::NoSnorm8RenderTarget);
@@ -4963,10 +4963,10 @@ TEST_F(TextureTest, ColorAttachableTargetsRequestTheThreeChannelWidening) {
PixelFormatNormalizeOptionBit::NoSnorm8RenderTarget);
}
// ---- Signed-normalized colour-renderable substitution (KHR-GL4x.texture_swizzle on Mali) -------
// ---- Signed-normalized color-renderable substitution (KHR-GL4x.texture_swizzle on Mali) -------
//
// A driver without GL_EXT_render_snorm treats every signed-normalized format as texture-only, so a
// colour attachment in one of them leaves the ES framebuffer incomplete: the draw lands nowhere and
// color attachment in one of them leaves the ES framebuffer incomplete: the draw lands nowhere and
// the readback falls through to the CPU shadow, which for a glTexImage2D(..., nullptr) output
// texture is all zeroes. The render-target bits used to reach GL_RGB16_SNORM alone, so five of the
// eight SNORM formats - and in particular the single-channel GL_R8_SNORM / GL_R16_SNORM that
@@ -5305,7 +5305,7 @@ TEST_F(TextureTest, WidenedRenderTargetUploadExpandsThreeChannelDataWithOpaqueAl
}
// No widening in effect (or nothing to convert): the caller's pointer comes straight back, so
// the sub-rect upload fast path still recognises an unconverted level.
// the sub-rect upload fast path still recognizes an unconverted level.
{
const Float source[] = {1.0f, 2.0f, 3.0f, 4.0f};
Vector<Uint8> widened;
@@ -5340,7 +5340,7 @@ namespace {
g_copyTexImage2DCall = {true, target, level, internalformat, width, height};
}
// A colour read framebuffer of the requested sized format, bound to GL_READ_FRAMEBUFFER, which
// A color read framebuffer of the requested sized format, bound to GL_READ_FRAMEBUFFER, which
// is what glCopyTexImage2D takes its source base format from.
void BindReadFramebufferWithColorFormat(GLenum sizedInternalFormat) {
GLuint framebuffer = 0;
@@ -5368,7 +5368,7 @@ TEST_F(TextureTest, CopyTexImage2DAcceptsEveryComponentSubsetOfTheReadBuffer) {
ASSERT_EQ(MG_Impl::GLImpl::GetError(), GL_NO_ERROR) << "read framebuffer setup itself failed";
// GL 4.6 sec. 8.6: internalformat may name a SUBSET of the read buffer's components. This is
// exactly the list KHR-GL30.api.coverage walks against an rgba8888 colour buffer, and it is
// exactly the list KHR-GL30.api.coverage walks against an rgba8888 color buffer, and it is
// also what an ordinary GL app does with glCopyTexImage2D(GL_RGB) from an RGBA8 framebuffer.
for (const GLenum internalFormat : {GL_RED, GL_RG, GL_RGB, GL_RGBA}) {
BindFreshMutableTexture2D();
@@ -6301,7 +6301,7 @@ TEST_F(TextureTest, CopyImageSubDataDoesNotApplyMipmapCompletenessToMultisampleT
// GL 4.6 core 8.11 makes GL_IMAGE_FORMAT_COMPATIBILITY_TYPE readable through every
// GetTexParameter form. Three of MobileGL's four getters answered it and glGetTexParameterfv did
// not, so the float query raised GL_INVALID_ENUM and left the caller's float uninitialised
// not, so the float query raised GL_INVALID_ENUM and left the caller's float uninitialized
// (KHR-GL4x.shader_image_load_store.basic-api-texParam reads it with both iv and fv and compares
// them). Asserted across all four here, because an enum present in three of four parallel
// switches is the drift shape that comes back.
@@ -7008,8 +7008,8 @@ TEST(EtcDecoder, DecodesTheConformanceSuitesEtc2RgbImage) {
}
// The EAC half: a block whose multiplier is 0 still moves every texel by the bare modifier, and a
// base of 128 with modifier index 4 (+2 in table 0) reads 130 in the alpha channel; the colour half
// is an individual-mode block of one flat colour (all-zero indices: +2 on 0x88 = 138).
// base of 128 with modifier index 4 (+2 in table 0) reads 130 in the alpha channel; the color half
// is an individual-mode block of one flat color (all-zero indices: +2 on 0x88 = 138).
TEST(EtcDecoder, DecodesAnEacAlphaBlockAndAnIndividualModeColourBlock) {
Uint8 block[16] = {};
block[0] = 128; // alpha base
@@ -7018,7 +7018,7 @@ TEST(EtcDecoder, DecodesAnEacAlphaBlockAndAnIndividualModeColourBlock) {
const Uint64 indices = 0x924924924924ull;
for (Int i = 0; i < 6; ++i)
block[2 + i] = static_cast<Uint8>(indices >> (40 - 8 * i));
// Colour: individual mode, both subblocks 0x8 per channel, codewords 0, all indices 0.
// Color: individual mode, both subblocks 0x8 per channel, codewords 0, all indices 0.
block[8] = 0x88;
block[9] = 0x88;
block[10] = 0x88;
@@ -7055,7 +7055,7 @@ TEST_F(TextureTest, CompressedTexImage2DDecodesEtc2IntoTheTexels) {
}
}
// A sub-image replace decodes too: the top-left block becomes a flat individual-mode colour.
// A sub-image replace decodes too: the top-left block becomes a flat individual-mode color.
const Uint8 flat[8] = {0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00};
MG_Impl::GLImpl::CompressedTexSubImage2D(GL_TEXTURE_2D, 0, 0, 0, 4, 4, GL_COMPRESSED_RGB8_ETC2,
static_cast<GLsizei>(sizeof(flat)), flat);
+1 -1
View File
@@ -98,7 +98,7 @@ TEST(Damage, NormalizeMergesDownToTheLimitAndStillCoversEverything) {
for (const Rect& r : input)
EXPECT_TRUE(Covers(region, r, 1000, 700)) << r.X << "," << r.Y;
// Two neighbours and one far away, limit 2: the neighbours merge, the far one stays apart.
// Two neighbors and one far away, limit 2: the neighbors merge, the far one stays apart.
Region three = Of({{0, 0, 10, 10}, {10, 0, 10, 10}, {500, 500, 10, 10}});
three.Normalize(1000, 1000, 2);
EXPECT_EQ(three, Of({{0, 0, 20, 10}, {500, 500, 10, 10}}));
+2 -2
View File
@@ -368,7 +368,7 @@ TEST(JobNodeCancel, CancelBeforeAnyDispatchSettlesTheNodeAndSkipsTheBody) {
EXPECT_TRUE(job->IsTerminal());
EXPECT_FALSE(job->IsComplete());
// Posting an already-cancelled node is a no-op, not a second run.
// Posting an already-canceled node is a no-op, not a second run.
pool.Post(job);
job->Wait();
EXPECT_EQ(job->ran.load(), 0u);
@@ -425,7 +425,7 @@ TEST(JobNodeCancel, CancelReleasesContinuationsSoDependentsAreNotStranded) {
job->Cancel();
EXPECT_EQ(fired.load(), 1u);
job->Wait(); // must not hang: a cancelled pending node is terminal
job->Wait(); // must not hang: a canceled pending node is terminal
EXPECT_TRUE(job->IsCancelled());
}
+1 -1
View File
@@ -179,7 +179,7 @@ namespace {
GTEST_SKIP() << "asserts are live in this configuration; see AssertIsLiveInDebugBuilds";
} else {
// If MOBILEGL_ASSERT were live here this would TRAP and take the process
// down, which is the behavioural half of the contract.
// down, which is the behavioral half of the contract.
MOBILEGL_ASSERT(false, "this assert must be compiled out at %s", "INFO");
SUCCEED();
}
@@ -301,7 +301,7 @@ TEST_F(VertexArrayTest, CurrentVertexAttributeStorageCoversFullCapacity) {
EXPECT_FLOAT_EQ(stored.floatValue[0], 1.0f);
EXPECT_FLOAT_EQ(stored.floatValue[3], 4.0f);
// Neighbouring slots keep the GL default of (0, 0, 0, 1).
// Neighboring slots keep the GL default of (0, 0, 0, 1).
const auto& untouched = MG_State::pGLContext->GetCurrentVertexAttribute(highIndex - 1);
EXPECT_FLOAT_EQ(untouched.floatValue[0], 0.0f);
EXPECT_FLOAT_EQ(untouched.floatValue[3], 1.0f);
@@ -165,7 +165,7 @@ namespace {
void SetUp() override {
MobileGL::Initialize();
// A fresh context per case: the state model under test is cumulative, so a leftover
// VAO binding from a neighbour would silently change what "default state" means.
// VAO binding from a neighbor would silently change what "default state" means.
MG_State::pGLContext = MakeUnique<MG_State::GLState::GLContext>();
GenVertexArrays(1, &m_vao);
BindVertexArray(m_vao);
+1 -1
View File
@@ -8,7 +8,7 @@
// A CLIENT OUTLIVES ITS LOST SESSION. A GPU device loss ends exactly one session on the server
// (MultiSessionTest.ADeviceLossEndsOnlyItsOwnSession); this suite is the client's half. A real
// MobileGL client - the EGL and GL entry points, MobileGL's own initialisation, a unix spawn
// MobileGL client - the EGL and GL entry points, MobileGL's own initialization, a unix spawn
// session - against the in-process display server, whose debug knob makes the second device check
// in the server process (this client's second read-back) report the device lost.
//
@@ -10,8 +10,8 @@
// thread of its own, every window with its own context. Normally they all share with one global
// context; after a device loss that share context is lost, so the replacements are created without
// sharing - one share group per window, drawing at the same time. Each thread here owns a pbuffer,
// a context and a textured draw of its own colour, and reads it back over and over - through the
// exported EGL and GL entry points, which is where the client serialises its threads.
// a context and a textured draw of its own color, and reads it back over and over - through the
// exported EGL and GL entry points, which is where the client serializes its threads.
//
// Every shape below has one rule in common: a thread's records apply under ITS context, whatever the
// other threads bind, release or destroy meanwhile. The shapes differ in what the other threads do:
@@ -115,7 +115,7 @@ namespace {
return 0xFF000000u | (0x40u + 0x50u * static_cast<Uint32>(index % 3)) << 8 |
(0x20u + 0x30u * static_cast<Uint32>(index / 3));
}
// The clear colour of a churn cycle (ReadbackRace): a different one per thread and cycle.
// The clear color of a churn cycle (ReadbackRace): a different one per thread and cycle.
Uint32 ChurnColourOf(int index, int cycle) {
return 0xFF000000u | (0x10u * static_cast<Uint32>(index)) << 16 |
(static_cast<Uint32>(cycle * 7) & 0xFFu) << 8 | 0x80u;
@@ -154,7 +154,7 @@ namespace {
Uint32 colour = 0;
};
// The thread's program, vertex array and one-texel texture of its own colour.
// The thread's program, vertex array and one-texel texture of its own color.
Drawing BuildDrawing(int index, ThreadReport* out) {
static const char* kVertex =
"#version 330 core\n"
@@ -495,7 +495,7 @@ namespace {
control->SendFrame(MobileGLByteSpan{builder.GetBufferPointer(), builder.GetSize()}) == MOBILEGL_OK;
}
// A LogFlush that asks for an acknowledgement (ack=false is the REQUEST; the server's answer
// A LogFlush that asks for an acknowledgment (ack=false is the REQUEST; the server's answer
// carries ack=true), exactly the frame ClientSession::SyncPeerLog sends - minus the drain that
// SyncPeerLog does first.
bool SendLogFlush(Client::ClientSession& client, std::uint64_t seq) {
@@ -1055,7 +1055,7 @@ namespace {
ASSERT_EQ(ServerLog(logBase).find("recv failed"), std::string::npos)
<< "the flood finished only after the control connection died - the stall was ended by "
"TCP_USER_TIMEOUT, not survived";
// (2) The peer reads again and synchronises its log.
// (2) The peer reads again and synchronizes its log.
const char go = 1;
ASSERT_EQ(::write(release[1], &go, 1), 1);
struct pollfd wait{synced[0], POLLIN, 0};
+1 -1
View File
@@ -108,7 +108,7 @@ TEST(FatalFamily, TheAnchorFamiliesProjectWhereTheirMeaningSays) {
// The liveness families are what a WAITING peer attributes to the other side being gone.
EXPECT_EQ(FatalCodeForFamily(MGFatalFamily::BarrierTimeout), FatalCode::ServerCrashed);
EXPECT_EQ(FatalCodeForFamily(MGFatalFamily::ApplyThreadNotRunning), FatalCode::ServerCrashed);
// An unmigrated verb is a protocol-level "cannot honour this", not a crash.
// An unmigrated verb is a protocol-level "cannot honor this", not a crash.
EXPECT_EQ(FatalCodeForFamily(MGFatalFamily::UnmigratedVerb), FatalCode::ProtocolCorruption);
}
+1 -1
View File
@@ -632,7 +632,7 @@ namespace {
// The same stall over the real thing: a SocketTransport pair whose far end does not read until
// the caller is done. The socket fills, the sender blocks inside SendFrame (as it would on TCP),
// and the caller - 20,000 WARN lines of ~600 bytes, ~12 MB, far past any socket buffer - never
// waits on it. Then the far end reads, and what it gets is levelled LogLines with the gap
// waits on it. Then the far end reads, and what it gets is leveled LogLines with the gap
// marked. Close() needs no cut: the reader drains.
TEST(LogForwardChannel, OverARealSocketThePeerNotReadingNeverHoldsTheCaller) {
std::unique_ptr<SocketTransport> client, server;
+11 -11
View File
@@ -18,8 +18,8 @@
// * TwoSessionsInOneProcessAreServedAtOnce - both clients are live AT THE SAME TIME and every
// Welcome names the SAME server process (red once by restoring the one-at-a-time supervisor:
// the second Hello is Refuse{Busy} and `started` is 0). With headless EGL, each session clears
// its own colour and reads it back - the clear's colour travels in that session's records, so a
// read-back that came from the other session's state would be the other colour.
// its own color and reads it back - the clear's color travels in that session's records, so a
// read-back that came from the other session's state would be the other color.
// * SameNamesInTwoSessionsDoNotCollide - the two sessions mint the SAME names: the same client
// context token (the session's {token -> ContextRuntime} table) and the same allocatable render
// state handle and generation (the session's applier table). Both must be accepted, because a
@@ -59,7 +59,7 @@ namespace {
// ---- a peer this test drives STEP BY STEP, so a case can interleave two sessions: everything
// the peer does is decided by the parent over a pipe, and every step answers with a report.
// The two clear colours, packed the way the read-back hands them back (A<<24|B<<16|G<<8|R,
// The two clear colors, packed the way the read-back hands them back (A<<24|B<<16|G<<8|R,
// the little-endian bytes of a GL_RGBA/GL_UNSIGNED_BYTE texel).
constexpr Uint32 kGreen = 0xFF00FF00u;
constexpr Uint32 kRed = 0xFF0000FFu;
@@ -67,7 +67,7 @@ namespace {
enum PeerOp : Uint32 {
kOpApplyRecord = 1, // one record through the applier (no GL)
kOpCreateContext = 2, // ServerCreateEGLContext(arg) - the session's context token table
kOpHealthySession = 3, // the rig's whole healthy session, `arg` = the clear colour
kOpHealthySession = 3, // the rig's whole healthy session, `arg` = the clear color
kOpStop = 4, // ClientSession::Stop, then the child leaves
// P14 S5: mint context `arg` in share group `aux` (a real frontend share-group token, so
// two contexts that pass different ones are a NON-shared pair and two that pass the same
@@ -286,8 +286,8 @@ TEST_F(MultiSessionFixture, TwoShmSessionsInOneProcessAreServedAtOnce) {
<< server.Log();
EXPECT_EQ(Count(server.Log(), "SessionLatch{"), 0u) << "a session latched a fault: " << server.Log();
// THE RENDER HALF, one session at a time, BOTH STILL LIVE: each session's clear colour travels
// in its own records and its read-back must be that colour. (The two sessions' native state is
// THE RENDER HALF, one session at a time, BOTH STILL LIVE: each session's clear color travels
// in its own records and its read-back must be that color. (The two sessions' native state is
// P14b's; see this file's header for why the halves are sequential.)
const StepReport aGl = a.Step(kOpHealthySession, kGreen);
const StepReport bGl = b.Step(kOpHealthySession, kRed);
@@ -298,11 +298,11 @@ TEST_F(MultiSessionFixture, TwoShmSessionsInOneProcessAreServedAtOnce) {
EXPECT_EQ(aGl.session.applied, 1) << aGl.session.note;
EXPECT_EQ(aGl.session.status, Remote::Wire::ReplySink::kStatusOk) << aGl.session.note;
EXPECT_EQ(aGl.session.pixel, kGreen) << "session A read back " << std::hex << aGl.session.pixel
<< ", not its own clear colour";
<< ", not its own clear color";
EXPECT_EQ(bGl.session.applied, 1) << bGl.session.note;
EXPECT_EQ(bGl.session.status, Remote::Wire::ReplySink::kStatusOk) << bGl.session.note;
EXPECT_EQ(bGl.session.pixel, kRed) << "session B read back " << std::hex << bGl.session.pixel
<< ", not its own clear colour";
<< ", not its own clear color";
b.Close();
a.Close();
@@ -404,8 +404,8 @@ TEST_F(MultiSessionFixture, ClosingOneSessionLeavesTheOtherServing) {
// client emits on a real eglMakeCurrent) and then runs a whole clear-and-read-back through that
// context. The two peers alternate, so every round crosses a context switch AND a session.
//
// THE COLOUR IS THE WITNESS. Green and red are read back only through the applier the record was
// attributed to, so a session that read the other's working state would read the other's colour;
// THE COLOR IS THE WITNESS. Green and red are read back only through the applier the record was
// attributed to, so a session that read the other's working state would read the other's color;
// a context that inherited its sibling's cleared inputs would fail the read-back's own
// completeness check. Red once by making MGPipeApplier() ignore the resolver: the two contexts of
// one session share one applier and one of the two clears lands on top of the other.
@@ -472,7 +472,7 @@ TEST_F(MultiSessionFixture, TwoSessionsInterleaveTwoContextsEachWithoutCrossTalk
// one session's apply thread and died (Magma's wire funnels did: a failed submit took
// Fatal{UnmigratedVerb, "Magma:wire-verb-flush"} and SIGABRT) took the compositor and every other
// client down with it. A backend now hands a loss to MGPipeSessionLatch: that session latches
// Fatal{BackendDeviceLost}, declines what it was doing and closes (exit 75), and its neighbours
// Fatal{BackendDeviceLost}, declines what it was doing and closes (exit 75), and its neighbors
// keep applying. The loss is the debug knob's (MGPipeDebugDeviceLossDue) - the same device check
// the backends make at their readbacks and frame boundaries - because no GPU here faults on
// demand: the 2nd check in the process (session A's read-back, after B's) reports "lost".
+3 -3
View File
@@ -175,7 +175,7 @@ namespace {
// A forked child's "I got there" to the test that forked it: the child writes one byte, the
// test waits for it. Made before the fork; the test drops its copy of the child's end right
// after it, so a child that exits without signalling ends the wait too.
// after it, so a child that exits without signaling ends the wait too.
class ReadyPipe {
public:
ReadyPipe() {
@@ -470,7 +470,7 @@ namespace {
}
// A HEALTHY SESSION: one record applied and, with headless EGL, a clear read back -
// PeerLatchTest's session B, verbatim in what it sends. P14 S2: the clear's colour is
// PeerLatchTest's session B, verbatim in what it sends. P14 S2: the clear's color is
// HealthySessionWithColor's parameter so a suite that runs several sessions can tell whose
// read-back it is reading; HealthySession keeps the two-argument shape every existing
// caller takes its address of.
@@ -478,7 +478,7 @@ namespace {
// THE PACKING IS THE READ-BACK'S OWN, A<<24|B<<16|G<<8|R - a GL_RGBA/GL_UNSIGNED_BYTE
// texel little-endian in a Uint32, which is how PeerReport::pixel comes back and how every
// expectation on it is written (green (0,1,0,1) is 0xFF00FF00). Decoding it in the other
// order would clear the complement of the colour the caller asked for.
// order would clear the complement of the color the caller asked for.
inline void HealthySessionWithColor(Remote::Client::ClientSession& client, PeerReport& r, Uint32 rgba) {
P::MGPMemoryBarrier barrier{};
barrier.Bits = 0x2000u;
+2 -2
View File
@@ -348,7 +348,7 @@ namespace {
}
// ------------------------------------------------------------------------------------
// The raw-record peer driver (F2's, generalised)
// The raw-record peer driver (F2's, generalized)
// ------------------------------------------------------------------------------------
constexpr Uint64 Align8(Uint64 value) {
@@ -544,7 +544,7 @@ namespace {
samplers.Count = 1;
const P::MGPipeHandle unboundSampler = P::kMGPipeNullHandle;
const P::MGPContextValues context{};
// A render state with the GL-initial colour writemask. The server reads the mask from
// A render state with the GL-initial color writemask. The server reads the mask from
// the bound CSO and nowhere else, so without one a clear writes nothing (the mask is
// the struct's zero, not RenderState's all-true constructor).
MobileGL::RenderStateParameters params{};
@@ -20,7 +20,7 @@
// DEVICE produced (docs/archive/notes/p7/device-window-1,
// improved-transparency-minecraft-26.3 under inproc: x0 b4000073ac9a5000 against
// "fault addr 0x00000073ac9a5000"). That works on any host only because the
// normalisation is written without an architecture guard - masking bits 56-63 is the
// normalization is written without an architecture guard - masking bits 56-63 is the
// identity for every valid userspace address off arm64 - and that was a deliberate
// choice: an `#if defined(__aarch64__)` would have put the only gate that can catch
// this defect on the one platform CI never runs, which is how it reached the phone.
@@ -89,7 +89,7 @@ namespace {
// =====================================================================================
// THE CASE THAT WOULD HAVE CAUGHT THE DEVICE CRASH ON A HOST, and it runs on every host:
// both addresses are the device's literal ones and the normalisation they need is written
// both addresses are the device's literal ones and the normalization they need is written
// without an architecture guard precisely so this can be a gate rather than a phone-only
// hope. The predicate must say the kernel's untagged fault address belongs to the slot a
// bionic-tagged shadow pointer published.
@@ -103,7 +103,7 @@ TEST(PersistentMapFaultOwnership, AKernelsUntaggedFaultAddressIsOwnedByATaggedSh
}
// The same row without needing the host to ignore a top byte at all: the predicate is fed a
// composed slot, so it runs everywhere and goes red everywhere the normalisation is dropped.
// composed slot, so it runs everywhere and goes red everywhere the normalization is dropped.
// This is the case the gate rests on; the one above is the device's literal reproduction.
TEST(PersistentMapFaultOwnership, TheOwnershipRowNormalisesBothSidesBeforeItCompares) {
SizeT pageIndex = ~static_cast<SizeT>(0);
@@ -131,7 +131,7 @@ TEST(PersistentMapFaultOwnership, UntagAddressClearsTheTopByteAndNothingBelowIt)
EXPECT_EQ(PersistentMapTracker::UntagAddressForTest(kDeviceTaggedShadowBase), kDeviceKernelFaultAddress)
<< "bionic's 0xb4 heap tag must come off, or the table and the kernel disagree";
EXPECT_EQ(PersistentMapTracker::UntagAddressForTest(kDeviceKernelFaultAddress), kDeviceKernelFaultAddress)
<< "normalising an already-normal address is the identity, or the handler would move "
<< "normalizing an already-normal address is the identity, or the handler would move "
"a legitimate fault out of its own slot";
// Bit 55 is ADDRESS, not tag: userspace lives in TTBR0 on arm64 and below TASK_SIZE_MAX
// on x86-64, and both keep every bit under 56 meaningful.
+12 -12
View File
@@ -881,7 +881,7 @@ TEST_F(PipeWireCodecTest, SetShaderBuffersCarriesBothTailsWhenTheSpanTailIsPrese
}
TEST_F(PipeWireCodecTest, ResourceSubDataCarriesABlobAndARegionTailTogether) {
// The only row in the catalogue that is BOTH kHasBlob and kVarTail, and the one rule A
// The only row in the catalog that is BOTH kHasBlob and kVarTail, and the one rule A
// changes most: the texture half declared Size 0 in monolith "because the byte count is
// the server's to compute", which cannot be a bounds check.
Wire2 wire;
@@ -1403,7 +1403,7 @@ TEST_F(PipeWireCodecTest, ObjectDeathReachesTheSinkWithItsHandleAndKind) {
//
// Not a sink row: the decoder's arm runs the REAL applier (MGPipeApplySetContextValues), so
// the round trip is read back out of gPipeInputs - under a server stamp, because a
// RECORD-SUPPLIED read outside one is the pre-stamp behaviour this build still tests
// RECORD-SUPPLIED read outside one is the pre-stamp behavior this build still tests
// elsewhere, and the fields' own poison would otherwise (correctly) refuse the read.
TEST_F(PipeWireCodecTest, SetContextValuesRoundTripsIntoPipeInputs) {
@@ -1678,7 +1678,7 @@ TEST_F(PipeWireCodecTest, CreateShaderStateCrossesAsOneArchiveAndSixUndeclaredRu
desc.SpirvStatus = 1;
// The ruling: Reflection names the WHOLE archive - which already carries every stage's
// modules - and Spirv[0..5] stay all-zero. Shipping the modules twice would double the
// biggest record in the catalogue for a reader that does not exist.
// biggest record in the catalog for a reader that does not exist.
desc.Reflection = wire.Encoder().StageBytes(archive.data(), archive.size());
for (Uint32 i = 0; i < 6; ++i) {
EXPECT_EQ(desc.Spirv[i].Size, 0u);
@@ -1878,7 +1878,7 @@ TEST_F(PipeWireCodecTest, MaxRecordBytesSeenStaysFarBelowHalfTheRing) {
EXPECT_GT(largest, 0u);
EXPECT_EQ(largest, 8u + sizeof(MGPDrawInfo) + 64u * sizeof(MGPDrawRange));
EXPECT_LT(largest, wire.Cmd().MaxRecordBytes());
// The biggest fixed payload in the whole catalogue is MGPProgramDesc at 192 bytes plus
// The biggest fixed payload in the whole catalog is MGPProgramDesc at 192 bytes plus
// MGPFramebufferState at 304, so a record only ever grows through its TAIL - which is why
// the counter is on the encoder and not a constant.
EXPECT_LT(8u + sizeof(MGPFramebufferState), wire.Cmd().MaxRecordBytes());
@@ -1928,7 +1928,7 @@ TEST_F(PipeWireCodecTest, TheCommandRingWrapCountIsWhatTheHeadActuallyDid) {
// One trip round and a little more, draining after every record so the producer never meets
// its own tail. This is the same shape the split lane has under the verb barrier: one
// record in flight at a time, the ring recycled behind it - so a wrap here is a wrap
// there, and not an artefact of a backed-up queue.
// there, and not an artifact of a backed-up queue.
const Uint64 records = (Wire2::kCmdBytes / stride) + 3;
for (Uint64 i = 1; i < records; ++i) {
ASSERT_NE(wire.Encoder().EncodeRecord(MGPWireOp::BindRenderState, &bind, sizeof(bind)), kInvalidSeq)
@@ -1945,7 +1945,7 @@ TEST_F(PipeWireCodecTest, TheCommandRingWrapCountIsWhatTheHeadActuallyDid) {
// DIVIDES the capacity and the same trip produces no pad at all - measured in the split
// lane, where 1310824 bytes of clears and draws through a 1 MiB SEG_CMD reported
// ringwraps=1 ringpads=0. That is why exit gate E3(e) asserts the WRAP and only records
// the pad: a gate on the pad count would be a gate on the sizes in the record catalogue.
// the pad: a gate on the pad count would be a gate on the sizes in the record catalog.
EXPECT_EQ(Wire2::kCmdBytes % stride, 16u) << "stride " << stride;
EXPECT_EQ(wire.Encoder().CmdWrapPads(), 1u);
}
@@ -1954,7 +1954,7 @@ TEST_F(PipeWireCodecTest, ABigProgramArchiveDoesNotGrowItsRecordAtAll) {
// THE POINT OF R-10's "every blob goes through SEG_STAGE": create_shader_state's RECORD is
// 8 + sizeof(MGPProgramDesc) == 200 bytes whether the archive is one kilobyte or one
// megabyte, because the record carries {Seg, Offset, Size} and nothing else. So
// create_shader_state is one of the SMALLEST records in the catalogue, not the one most
// create_shader_state is one of the SMALLEST records in the catalog, not the one most
// likely to approach MaxRecordBytes(); what approaches that cap is a var-tail, and the
// archive's own bound is MOBILEGL_IPC_STAGE_MB with a Fatal of its own.
Wire2 wire;
@@ -2105,10 +2105,10 @@ TEST_F(PipeWireCodecTest, NoReplyIsWrittenForARowTheCatalogueGivesNoReplySlot) {
// this case still asserts.
//
// WHAT CHANGED IS THE ROW IT ASSERTS IT ABOUT (ID-31 fallout, closed by c1 round 2). It
// used to name ResourceCreate and SetTextureParams as rows "the catalogue gives no reply
// used to name ResourceCreate and SetTextureParams as rows "the catalog gives no reply
// slot", which ID-31 made false - it gave ResourceCreate the flag, and all four Bool
// acceptance rows carry it now. A case that names a kReplySlot row while asserting a row
// has no slot is not testing the rule, it is testing a stale catalogue, so the row moved
// has no slot is not testing the rule, it is testing a stale catalog, so the row moved
// to one that genuinely carries kNone and the rule stayed exactly where it was.
Wire2 wire;
ASSERT_EQ(MGPipeCallFlagsFor(MGPWireOp::ResourceDestroy) & static_cast<Uint32>(kReplySlot), 0u)
@@ -2157,7 +2157,7 @@ TEST_F(PipeWireCodecTest, EveryRowThatDoesWriteAReplyCarriesKReplySlot) {
TEST_F(PipeWireCodecTest, TheFourAcceptanceRowsAnswerThroughTheSlotAndNotOnlyThroughTheTally) {
// R-17's server half, and the reason c1 could not simply write thirty-seven emitters: the
// client asks the CATALOGUE whether a row owns a slot (ClientSession::EmitAndWait), so the
// client asks the CATALOG whether a row owns a slot (ClientSession::EmitAndWait), so the
// moment ID-31 gave these rows kReplySlot, a decoder that answered only into
// LastAcceptance() left the client parked in the barrier until Fatal{ReplyMissing}.
//
@@ -2403,7 +2403,7 @@ TEST_F(PipeWireCodecTest, ARecordLargerThanHalfTheRingIsFatalRingOverrun) {
// producing side, rather than becoming a nullptr from Reserve that some caller reads as
// "the ring is full, wait" - which on an EMPTY ring would be a wait that never ends.
//
// The oversized record is a REAL one from the catalogue with a long var-tail, not a forged
// The oversized record is a REAL one from the catalog with a long var-tail, not a forged
// header: MGPDrawInfo declares NumDraws and the encoder cross-checks the tail against the
// layout that number implies, so this is the shape a genuine emitter bug would take.
const ChildResult r = RunInChild([] {
@@ -2810,7 +2810,7 @@ TEST_F(PipeWireCodecTest, AnIndirectDrawThatDeclaresRangesIsFatal) {
}
TEST_F(PipeWireCodecTest, BufferSubDataResidentMayNotDeclareRegions) {
// Its catalogue row has no kVarTail and its applier takes no regions, so a non-zero
// Its catalog row has no kVarTail and its applier takes no regions, so a non-zero
// RegionCount is a fault rather than a tail. The layout used to share ResourceSubData's
// arm, which REQUIRED 80 bytes of tail the arm then dropped.
const ChildResult r = RunInChild([] {
@@ -1342,7 +1342,7 @@ TEST(RemoteClientControls, ABufferRespecifyTakesNoReplyWhileATextureOneStillDoes
// assertion the device cannot make: set the knob as high as it goes and the row must STILL take the
// blocking path on a link that cannot retain.
//
// THE WINDOW'S OWN BEHAVIOUR IS PINNED ELSEWHERE, ON THE ARM IT SHIPS ON: StreamLinkTest's
// THE WINDOW'S OWN BEHAVIOR IS PINNED ELSEWHERE, ON THE ARM IT SHIPS ON: StreamLinkTest's
// declared-answer cases for the store, and the stream-arm window case for the row. That split is
// not tidiness - three rounds of this feature were green here while being inert on the device,
// because these gates and the device run on different transports.
@@ -1468,7 +1468,7 @@ TEST(RemoteClientControls, ARefusedCreateUnlatchesItsObjectAndItsNextCreateBlock
std::memset(pixels, 0x21, sizeof(pixels));
Srv::ServerSessionInstance().SetConsumedSubsystems(
kMGPipeSubsystemsMigratedAtP4a & ~kMGPipeSubsystemTextureResources);
// ---- one object we can name, then enough neighbours to fill and drain the window ----
// ---- one object we can name, then enough neighbors to fill and drain the window ----
// The drain is what READS a deferred answer, so the refusal of the first create is only
// discovered once later creates have pushed the ring past its ceiling.
const auto defineStorage = [&](GLuint name, Int32 extent) {
+7 -7
View File
@@ -357,7 +357,7 @@ TEST(RemoteEmitTable, EachUnmigratedShapeRefusalNamesItsOwnShape) {
// P5b d1: a class-B draw slot with no session aborts Fatal{NoClientSession, "<slot>"} - the
// class-B shape - and NOT Fatal{UnmigratedVerb}: that is what distinguishes a flipped slot from
// the stub it replaced, by behaviour rather than by pointer. Red once by: moving DrawElements
// the stub it replaced, by behavior rather than by pointer. Red once by: moving DrawElements
// back into MGR_UNMIGRATED_D1_SLOTS - the log then reads UnmigratedVerb.
TEST(RemoteEmitTable, AFlippedDrawSlotDemandsASessionRatherThanNamingItselfUnmigrated) {
const ChildResult r = RunInChild(
@@ -432,7 +432,7 @@ TEST(RemoteEmitTable, AClassBSlotWithNoSessionAbortsRatherThanFallingThrough) {
}
TEST(RemoteEmitTable, EachI1SlotReachesRequireSessionUnderItsOwnName) {
// The behavioural half: an i1 slot is class B, so with no ClientSession it reaches
// The behavioral half: an i1 slot is class B, so with no ClientSession it reaches
// RequireSession and aborts Fatal{NoClientSession, "<slot>"} - NOT Fatal{UnmigratedVerb}
// (which would mean the flip never happened) and NOT quietly (which is the split lane
// running monolith and going green, R-4). The name in the message is the slot's own, which
@@ -1441,7 +1441,7 @@ TEST(PipeRouting, TheTablesAreInstalledWithoutAnybodyHavingRememberedTo) {
// The gate on the install MECHANISM rather than on the table contents (PipeCatalogueTest
// owns the partition). Nothing in this file calls an installer; the tables are installed
// because MG_Pipe/PipeRoute.h's inline variable is in this binary, which is the property
// that a static initialiser inside PipeRoute.cpp did NOT have - the linker dropped that
// that a static initializer inside PipeRoute.cpp did NOT have - the linker dropped that
// object from every test binary that named no symbol in it, and five CsoCacheTest cases
// took a null function pointer.
EXPECT_TRUE(MGPipeTablesAreInstalled());
@@ -1539,7 +1539,7 @@ TEST(PipeRouting, TheInstalledClientArmIsWireAndNotMonolithAndEveryRoutedRowMove
// WHAT B3 SAYS IS MISSING. PipeCatalogueTest installs and COUNTS the monolith table, so a
// client row that was never overwritten stays non-null and still counts - deleting one
// `gMGPipe*.X = &Wire_X` assignment left every gate green (the cross-family verifier
// reproduced it: catalogue 32/32, all lanes green). The only thing that catches it is
// reproduced it: catalog 32/32, all lanes green). The only thing that catches it is
// observing that the CLIENT install actually MOVED each routed row off the monolith adapter.
//
// The monolith adapters are kept beside the installed tables (MGPipeMonolith*()), so the
@@ -1622,7 +1622,7 @@ TEST(PipeRouting, TheInstalledClientArmIsWireAndNotMonolithAndEveryRoutedRowMove
#if MGTEST_HAVE_FORK
TEST(PipeRouting, AClientWireRowWithNoSessionRefusesByNameRatherThanApplying) {
// THE RUNTIME HALF of B3, and it distinguishes a Wire_* row from the monolith adapter by
// BEHAVIOUR: with the client tables installed and no session, a routed call reaches
// BEHAVIOR: with the client tables installed and no session, a routed call reaches
// RequireSession and aborts Fatal{NoClientSession}. The monolith adapter (the deleted-
// assignment state) would instead run MGPipeApply* and NOT abort with that string - so the
// control goes red the moment a row falls back to monolith.
@@ -1642,7 +1642,7 @@ TEST(PipeRouting, AClientWireRowWithNoSessionRefusesByNameRatherThanApplying) {
TEST(PipeRouting, ARoutedCallDuringTeardownRefusesByNameNotRunsTheApplier) {
// codex 4: UninstallClientWireTables marks the tables uninstalled; a routed call in that
// window must abort by name rather than run the applier on the caller. Reverting Uninstall
// to reinstall the monolith adapters (round 2's behaviour) makes this call run the applier
// to reinstall the monolith adapters (round 2's behavior) makes this call run the applier
// and NOT abort with this string - the red-once.
const ChildResult child = RunInChild([] {
InstallClientWireTables();
@@ -3113,7 +3113,7 @@ TEST(RemoteRunAhead, AnEventBurstBehindAnUnwaitedSequenceFlowControlsInsteadOfAb
// (what a headless compositor sizes its output from) and reallocate the default framebuffer's
// attachments at it; a format-only event must change no size. Red with the drain's
// ApplyServerOwnedSurfaceExtent call deleted (exit 93: the query keeps 1920x1080) and with
// ApplySurfaceChangedToClient's extent arm deleted (exit 94: the colour stays at the placeholder's).
// ApplySurfaceChangedToClient's extent arm deleted (exit 94: the color stays at the placeholder's).
TEST(RemoteRunAhead, ARepublishedServerWindowExtentResizesTheServerOwnedSurfaceAndTheDefaultFramebuffer) {
const auto child = RunInChild([] {
StartRunAheadSession();
+4 -4
View File
@@ -358,10 +358,10 @@ TEST(RingTest, HardDrainBumpsTheGenerationOnlyWhenQuiesced) {
TEST(RingTest, CorruptHeaderIsRefusedRatherThanDispatched) {
// SEG_CMD is written by the peer process, so a compile-time size assert on
// the record catalogue proves nothing about what is actually in the
// the record catalog proves nothing about what is actually in the
// mapping. Hand-build a ring whose first header is impossible (a size that
// is not a multiple of 8) and check the consumer refuses it instead of
// dispatching into undefined behaviour.
// dispatching into undefined behavior.
alignas(4096) RingControl control{};
InitRingControl(control);
std::vector<std::uint8_t> bytes(256, 0);
@@ -744,7 +744,7 @@ TEST(RingTest, TheTwoFlagSpacesAreDisjointByTranslation) {
// RingProducer::Reserve MASKS kRecPad OUT of whatever the caller passes
// (Ring.cpp: `flags & ~kRecPad`). So the worst of the three collisions - a real record
// framed as a wrap filler and skipped by Pop - is ALREADY DEFENDED for anyone who goes
// through Reserve. That defence is worth knowing about and worth pinning, because it is
// through Reserve. That defense is worth knowing about and worth pinning, because it is
// also exactly one bit wide: the other two collisions pass straight through.
RingFixture ring(1024);
const std::uint32_t drawVboCallFlags = MGPipeCallFlagsFor(MGPWireOp::DrawVbo);
@@ -780,7 +780,7 @@ TEST(RingTest, TheTwoFlagSpacesAreDisjointByTranslation) {
// What saves it is the KIND. RingConsumer::Pop skips a record only when it carries kRecPad
// AND kind == kRingPadRecordKind (Ring.cpp: `(header.flags & kRecPad) != 0 && header.kind ==
// kRingPadRecordKind` - "BOTH, not just the flag"). Kind 0 is the wrap filler's and nothing
// else's, because the call catalogue starts at 1. So the stamped record is DELIVERED, lies
// else's, because the call catalog starts at 1. So the stamped record is DELIVERED, lies
// and all, and the decoder can reject it by name - which it can only do because it got it.
// THE ASSERT AND THE EXPECTS BELOW ARE THE CONTROL ON THAT KIND CHECK: delete the
// `&& header.kind == kRingPadRecordKind` half of Pop's condition and this record vanishes
@@ -55,7 +55,7 @@ TEST(ServerContextLiveTest, OneSessionsReleaseDoesNotKillANeighboursContext) {
Bool appLive = true;
OnSessionThread(*kwinBlock, [&] { kwinLive = MG_Pipe::MGPipeServerContextIsLive(); });
OnSessionThread(*appBlock, [&] { appLive = MG_Pipe::MGPipeServerContextIsLive(); });
EXPECT_TRUE(kwinLive) << "a neighbour session's release marked this session's context dead";
EXPECT_TRUE(kwinLive) << "a neighbor session's release marked this session's context dead";
EXPECT_FALSE(appLive);
MG_Pipe::g_pipeInputsThreadResolver = previous;
+9 -9
View File
@@ -753,17 +753,17 @@ TEST(ServerLoopTest, TheAffinityStringResolvesToAMaskAndTheMaskIsLogged) {
<< "the apply thread did not log its resolved affinity mask; an affinity that silently "
"did nothing is indistinguishable from one that worked";
EXPECT_NE(log.find("mgl-srv-apply started"), std::string::npos);
// M-4: `off` must be a RECOGNISED string, not fall through to the numeric-parse "not
// recognised" arm. Deleting the `off` branch in RequestedAffinityMask makes off unrecognised;
// M-4: `off` must be a RECOGNIZED string, not fall through to the numeric-parse "not
// recognized" arm. Deleting the `off` branch in RequestedAffinityMask makes off unrecognized;
// this asserts it did not, so that branch's deletion goes red here (its own reason).
EXPECT_EQ(log.find("is not `auto`, `off` or a number"), std::string::npos)
<< "`off` was treated as an unrecognised affinity string; its own branch is gone";
<< "`off` was treated as an unrecognized affinity string; its own branch is gone";
fixture.Stop();
MG_Config::Ipc.ServerAffinity = saved;
}
// M-4, the explicit-mask half: an EXPLICIT mask the box can honour must resolve to itself and be
// M-4, the explicit-mask half: an EXPLICIT mask the box can honor must resolve to itself and be
// LOGGED. `off` -> 0 and `0x3` -> 0x3 are two answers that must DIFFER, so the resolver cannot be a
// constant. This case does NOT gate codex 11's effective-mask read-back - on an unrestricted box the
// request and the effective set are the same and `return requested` stays green here (review v2
@@ -773,7 +773,7 @@ TEST(ServerLoopTest, TheAffinityStringResolvesToAMaskAndTheMaskIsLogged) {
TEST(ServerLoopTest, TheExplicitAffinityMaskResolvesToItselfAndIsLogged) {
#if defined(__linux__) || defined(__ANDROID__)
if (std::thread::hardware_concurrency() < 2) {
GTEST_SKIP() << "needs at least 2 online cpus to honour 0x3";
GTEST_SKIP() << "needs at least 2 online cpus to honor 0x3";
}
const String saved = MG_Config::Ipc.ServerAffinity;
MG_Config::Ipc.ServerAffinity = "0x3"; // cpu 0 and cpu 1, both online on any 2+-cpu box
@@ -784,7 +784,7 @@ TEST(ServerLoopTest, TheExplicitAffinityMaskResolvesToItselfAndIsLogged) {
ASSERT_TRUE(fixture.WaitUntilTrulyParked());
EXPECT_EQ(Server::ServerLoopInstance().ResolvedAffinityMask(), 0x3u)
<< "an explicit mask the box can honour did not resolve to itself (0x3); the effective "
<< "an explicit mask the box can honor did not resolve to itself (0x3); the effective "
"mask read back from the kernel differs from the request, or the resolver is broken";
const std::string log = ReadLog();
EXPECT_NE(log.find("RESOLVED mask 0x3"), std::string::npos) << "the logged RESOLVED mask is not the effective 0x3";
@@ -1510,7 +1510,7 @@ TEST(ServerLoopTest, TheSevenFormatCapabilityReadsAnswerFromTheServersBackendNot
<< "the renderbuffer sample clamp answered from the global's probed counts (6), not the server's";
// (B) the null-check reads: global NULL, server present. RGB8_SNORM, not RGB8: the fallback
// normalisation's three-channel widening is APPLICABLE to GL_RGB8_SNORM and not to GL_RGB8
// normalization's three-channel widening is APPLICABLE to GL_RGB8_SNORM and not to GL_RGB8
// (TextureFormatProcessor.cpp's applicability table), so it is the format whose answer the
// "no backend" arm actually changes - the first cut of this case used RGB8 and both arms agreed.
MG_Backend::pActiveBackendObject.reset();
@@ -1521,7 +1521,7 @@ TEST(ServerLoopTest, TheSevenFormatCapabilityReadsAnswerFromTheServersBackendNot
TextureImpl::GenerateTextureFormatInfo(TextureInternalFormat::RGB8Snorm, &internalFormat, &format, &type,
TextureTarget::Texture2D);
EXPECT_EQ(internalFormat, kGlRgb8Snorm)
<< "the format info followed the global (null, so the fallback normalisation widened RGB8_SNORM) "
<< "the format info followed the global (null, so the fallback normalization widened RGB8_SNORM) "
"instead of the server's backend (present, so native RGB8_SNORM); got 0x"
<< std::hex << internalFormat;
EXPECT_FALSE(TextureImpl::BackendTextureFormatAddsAlpha(TextureInternalFormat::RGB8Snorm, TextureTarget::Texture2D))
@@ -2018,7 +2018,7 @@ namespace {
}
// THE WINDOW, HELD OPEN. The server acknowledges a record before it looks for the next one, so a
// record published right after that acknowledgement can be popped by the SAME drain, past the
// record published right after that acknowledgment can be popped by the SAME drain, past the
// apply loop's per-wake fault poll. The between-records hook makes that happen every time: it
// holds the drain after the healthy record until GUILTY is in the ring, and the client publishes
// GUILTY once the hold is entered. The hold is armed by the healthy record's seq: the wait for the
@@ -7,7 +7,7 @@
// End of Source File Header
// P12 (on-screen server window), END TO END ON THE HOST: a real MobileGL client - the EGL entry
// points, MobileGL's own initialisation, the spawn/tcp session - against a real `--serve` supervisor
// points, MobileGL's own initialization, the spawn/tcp session - against a real `--serve` supervisor
// that, like every host server, owns NO display.
//
// What is proven, each on both sides of the wire:
+2 -2
View File
@@ -981,7 +981,7 @@ TEST(ServerSpawnTest, AnEglControlOpCrossesToTheOtherProcessAndAnswers) {
const bool ok = Server::ServerInitializeEGLDisplay(EGL_NO_DISPLAY, &major, &minor);
// WHAT IS ASSERTED IS THE ROUND TRIP, not the EGL result. A headless CI
// machine has no display to initialise, so `ok` is expected to be false -
// machine has no display to initialize, so `ok` is expected to be false -
// and that is fine, because `cp` is done when the op reaches the other
// process and an answer comes back.
//
@@ -1274,7 +1274,7 @@ TEST(ServerSpawnTest, AnOrderlyStopIsNotADeviceLoss) {
TEST(ServerSpawnTest, ADeadBellIsNotAlwaysAHungUpPeer) {
// THE ASSERTION THAT MAKES `dl`'s CAUSE/FACT SPLIT LOAD-BEARING, and it exists because the
// session-level control above turned out not to. Park() latches m_dead for several reasons
// that are NOT a peer death - POLLERR, POLLNVAL, an unrecognised revents - and each of them
// that are NOT a peer death - POLLERR, POLLNVAL, an unrecognized revents - and each of them
// is a fault in THIS process's descriptor. A latch armed from Dead() would report a lost
// GPU for a bug in our own fd handling.
//
@@ -346,7 +346,7 @@ TEST(SessionHandshakeTest, ForkRefusesDifferentBuildWithIdenticalWire) {
//
// Hello.linkTerms carries four byte counts a client may fill in, and nothing on the server reads
// them for sizing: Accept builds the segments from its own SetSegmentSizes and Welcome states
// those. That was stated (CONTRACT-P65 LinkTerms) and never pinned, so a refactor that "honoured
// those. That was stated (CONTRACT-P65 LinkTerms) and never pinned, so a refactor that "honored
// the client's request" would have handed any peer a 64 GiB allocation per connection. Here a
// Hello asks for 64 GiB in every window and the Welcome must come back with the server's own
// 4 KiB terms and 4 KiB segments - the allocation that happened is the one Welcome describes.
@@ -400,7 +400,7 @@ TEST(SessionHandshakeTest, AHelloAskingFor64GiBIsClampedToTheServersTermsAndAllo
EXPECT_EQ(welcome->linkTerms()->maxReplyBytes(), 4096u / sizes.ReplySlotCount - sizeof(Transport::ReplySlotHeader))
<< "the reply bound echoed the Hello";
// The segments that EXIST are the server's: each announced size is a few pages at most, never
// the ask. A 64 GiB request that had been honoured would show here even if Welcome's terms
// the ask. A 64 GiB request that had been honored would show here even if Welcome's terms
// had been rewritten afterwards.
for (const auto* segment : {welcome->cmdRing(), welcome->stageRing(), welcome->replyPool(), welcome->eventRing()}) {
ASSERT_NE(segment, nullptr);
+2 -2
View File
@@ -137,7 +137,7 @@ TEST(SessionTest, SessionSegmentsAreRealSharedMemoryAndNotAHeapAllocation) {
EXPECT_GE(segments.DescriptorFor(SessionSegmentSlot::Reply), 0);
EXPECT_GE(segments.DescriptorFor(SessionSegmentSlot::Event), 0);
#endif
// Both control pages start initialised, with the two generations at 1 and every watermark
// Both control pages start initialized, with the two generations at 1 and every watermark
// at 0 - the two conventions are opposite on purpose (Ring.h).
ASSERT_NE(segments.CmdControl(), nullptr);
ASSERT_NE(segments.EventControl(), nullptr);
@@ -509,7 +509,7 @@ TEST(SessionTest, RetiredSeqMayTrailTheApplyButCanNeverOvertakeIt) {
}
// completedFrameSerial: the SERVER's, advanced when a present completes. It trails appliedSeq
// by the GPU's own depth and must never be conflated with it - recycling and ageing wait on
// by the GPU's own depth and must never be conflated with it - recycling and aging wait on
// this one and would free a resource the GPU is still reading if they waited on the other.
TEST(SessionTest, CompletedFrameSerialIsTheServersAndIsIndependentOfAppliedSeq) {
SessionFixture session;
+5 -5
View File
@@ -9,7 +9,7 @@
// Shared images: the server's registry, a
// session's references, and the aux-socket inbox that carries an import's descriptor beside T0's
// Offers. On a host the image memory is a memfd, which is enough for everything here: what is
// under test is that a descriptor which travelled through SCM_RIGHTS still names its image.
// under test is that a descriptor which traveled through SCM_RIGHTS still names its image.
#include <MG_Pipe/MGPipeTypes.h>
#include <MG_Remote/Server/AdoptInbox.h>
@@ -167,7 +167,7 @@ TEST(SharedImage, TheInboxKeepsSharedImageAndT0DescriptorsApart) {
EXPECT_EQ(inbox.TakeSharedImageFd(7, 20, &fd, why), Server::AdoptInbox::Outcome::TimedOut);
}
// ---- synchronisation. A pipe stands in for a sync_file: its read end polls readable (signaled)
// ---- synchronization. A pipe stands in for a sync_file: its read end polls readable (signaled)
// once something is written to it, which is all the registry asks of a fence.
namespace {
struct FakeFence {
@@ -502,8 +502,8 @@ TEST(SharedImageYuv, ThePlaneCopyFillsEveryDestinationLayout) {
EXPECT_EQ(chroma16[r * 16 + c], c16[r][c]);
}
// The conversion an import's hints select: BT.709 narrow-range codes of saturated colours decode
// to those colours, and the defaults are BT.601 narrow.
// The conversion an import's hints select: BT.709 narrow-range codes of saturated colors decode
// to those colors, and the defaults are BT.601 narrow.
TEST(SharedImageYuv, TheConversionDecodesTheHintedColourSpace) {
const auto decode = [](const SI::Yuv::Conversion& c, double y, double cb, double cr, double max) {
const double in[3] = {y / max - c.Offset[0], cb / max - c.Offset[1], cr / max - c.Offset[2]};
@@ -523,7 +523,7 @@ TEST(SharedImageYuv, TheConversionDecodesTheHintedColourSpace) {
for (int i = 0; i < 4; ++i) {
const auto rgb = decode(c709, codes[i][0], codes[i][1], codes[i][2], 255.0);
for (int k = 0; k < 3; ++k)
EXPECT_NEAR(rgb[k], want[i][k], 0.02) << "colour " << i << " channel " << k;
EXPECT_NEAR(rgb[k], want[i][k], 0.02) << "color " << i << " channel " << k;
}
// Full range: Y passes through.
SI::Yuv::Hints full;
@@ -337,7 +337,7 @@ TEST(StagedTextureStoreTest, TwoSessionsHoldTheSameHandleAndOneSessionsDropAllSp
EnterBucket(1, 10);
ASSERT_TRUE(store.IsLevelDefined(key, kTex2DTarget, 0))
<< "a neighbour session's teardown dropped this session's declared level";
<< "a neighbor session's teardown dropped this session's declared level";
EXPECT_TRUE(store.IsCovered(key, kTex2DTarget, 0));
EXPECT_NE(store.AdoptRun(key, kTex2DTarget, 0, IntVec3{4, 4, 1}, 0, kwinBytes.data(), kwinBytes.size()), nullptr);
@@ -366,7 +366,7 @@ TEST(StagedTextureStoreTest, OneSessionsBufferDropAllSparesTheOthersShadows) {
store.DropAll();
EXPECT_FALSE(store.HasShadow(&appTwin));
EXPECT_TRUE(store.HasShadow(&kwinTwin)) << "a neighbour session's teardown dropped this session's bytes";
EXPECT_TRUE(store.HasShadow(&kwinTwin)) << "a neighbor session's teardown dropped this session's bytes";
EXPECT_TRUE(store.IsCovered(&kwinTwin, 0, bytes.size()));
t_testBucketSet = false;
@@ -991,7 +991,7 @@ TEST(StagedTextureProductionTest, TextureSubDataThroughTheRealOpsTableCopiesAndS
desc.Resource = res;
desc.Target = static_cast<Uint8>(MG_Pipe::MGPipeResourceTarget::Tex2D);
// RGBA8: the 64 bytes below are 4x4 texels of four bytes, and PH-4 bounds the run by the
// declared level's w*h*d*bpp (a zero-initialised format is R8, one byte a texel).
// declared level's w*h*d*bpp (a zero-initialized format is R8, one byte a texel).
desc.InternalFormat = static_cast<Uint32>(TextureInternalFormat::RGBA8);
desc.Width = 4;
desc.Height = 4;
+1 -1
View File
@@ -371,7 +371,7 @@ namespace {
// PH-7 (4), ID-P7-3, through the Transport factory pair ServerSession::Accept uses so that
// session code never names the concrete link (scripts/ci/link_seam_purity.py). In the
// production order: created without a descriptor, endpoints initialised, then bound once.
// production order: created without a descriptor, endpoints initialized, then bound once.
// A second bind, and a bind onto a link the factory did not make as a stream, are refused
// and leave the descriptor with the caller; the bound link then carries a record.
TEST(StreamLinkFactory, DeferredServerLinkBindsOnceAndThenCarriesARecord) {
+1 -1
View File
@@ -206,7 +206,7 @@ namespace {
EXPECT_NE(inA, inB);
// This is what DropEveryTwinForEndedServerSession now does, and the reason it is scoped:
// it runs on the apply thread of the session that is ENDING, while a neighbour session
// it runs on the apply thread of the session that is ENDING, while a neighbor session
// may still be rendering in this process (P14 S2).
EXPECT_EQ(table.DropBucketsOfSession(kSessionA), 1u) << "the ended session's group was not dropped";
BindKey(kSessionA, kGroupOne);