mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-18 15:33:22 +09:00
- MGPShaderBuffers::WritableMask is Uint32[3] and the POD grows 32 -> 40 (ID-104). One Uint32 could describe only the first 32 of an 84-point window, so a storage buffer bound at point 32 or above read as unwritable with nothing able to see it; the ruling widens the field rather than narrowing the window, which would change what an application may bind. MGPipeShaderBufferMaskHas / ...Set are the one spelling of the mask, so the emitter, the applier and the four backend sites cannot disagree about which word a point lives in. - MGPipeApplySetShaderBuffers has its body: per-class window, Start/Count validated against the capacity, the mask copied by word, ONE ShaderBuffersSerial advanced on every applied record and ADVANCED - never zeroed - by both resets, which also clear the three windows. - Route rows for opcode 38 on both arms (Mono_ and Wire_) and the server sink in the wire codec's decode switch, which is where a kCtxState row's sink lives - PipeApplier.cpp's ServerVerbSink has no method for it and the brief's "OnSetShaderBuffers" names no code. The codec also bounds Class and Start+Count where Count becomes a byte length. - New MG_Impl/Pipe/ShaderBufferEmit.h: one record per class, window = the touched high-water mark clamped to 84, zero early-out before any hash, a BASE binding travelling as kMGPipeWholeBuffer so the server re-resolves the extent at use, three suppressor slots (ruling 11), and the writable mask that replaces the backend's GPU-write walk. - BufferState gains a per-target bind-point generation (push-only, G1) and dirty bits 15/16/17 shutter on it instead of the buffer CONTENT aggregate. That aggregate answered the wrong question in both directions: any glBufferSubData fired all three, and glBindBufferBase fired none of them, because it mutates a binding point through a returned reference. Same defect class as P4a's glBindSampler hole. - Init.cpp publishes consumer bit 13 for DirectGLES and not for Magma (ID-106), in the same commit as the wired constant, and PipeFill's liveness gate asks R-8 for bit 13 in particular plus bit 13-requires-bit-7. - `Touch` joins the dirty-surface scanner's mutator prefixes; TouchBufferBindingPoint gets its row and SetNamedTransformFeedbackBinding's is rewritten now that bit 17 reads a generation a binding moves. Negative control 6 is re-pointed: the pair it used to refute is a live answer, and a control that has quietly become positive is what the self-test is for.
459 lines
38 KiB
Modula-2
459 lines
38 KiB
Modula-2
// MobileGL - MobileGL/MG_Pipe/DirtySurface.def
|
|
// Copyright (c) 2025-2026 MobileGL-Dev
|
|
// Licensed under the GNU Lesser General Public License v3.0:
|
|
// https://www.gnu.org/licenses/gpl-3.0.txt
|
|
// https://www.gnu.org/licenses/lgpl-3.0.txt
|
|
// SPDX-License-Identifier: LGPL-3.0-only
|
|
// End of Source File Header
|
|
|
|
// The dirty-surface mapping (ARCHITECTURE.md 5.2 corollary 4, P2 brief D16).
|
|
//
|
|
// MGPipe replaces "the backend rediscovers what changed" with "the frontend says what
|
|
// changed", which only works if EVERY frontend mutation a backend can observe has an answer
|
|
// to "what publishes this". The failure mode is silent and one-directional: a mutation that
|
|
// forgets to publish renders stale, and no purity gate can see it.
|
|
//
|
|
// So the surface is enumerated MECHANICALLY. scripts/gen_pipe_dirty_surface.py scans
|
|
// MG_Impl/GLImpl AND MG_State/GLState for every pGLContext-> mutator call and every
|
|
// MGP_NOTE_MUTATION site, and, with --check, fails if a scanned mutator has no row here or a
|
|
// row here names a mutator the scan no longer finds. Both directions, so a deleted mutator
|
|
// cannot leave a stale row behind either.
|
|
//
|
|
// THE SECOND ROOT AND THE SECOND MECHANISM ARE P3a's, and they were not cosmetic: reading
|
|
// MG_State/GLState found BumpSamplingResolutionGeneration, a mutator with no row at all
|
|
// whose every caller lives in that directory, and reading MGP_NOTE_MUTATION brought
|
|
// NoteUnitTouched - which no `pGLContext->` pattern can see, because every texture and
|
|
// sampler bind routes through it rather than calling it through the context - inside the
|
|
// gate. A notice site carries a FIELD name, so the mutator a row names is the ENCLOSING
|
|
// function.
|
|
//
|
|
// ANSWERS. A row lists EVERY publisher that fires on EVERY path through that mutator,
|
|
// and only those; several are joined with '|'. A publisher that fires on some paths but
|
|
// not all must not appear, because a shutter built from this file would then UNDER-fire,
|
|
// and ARCHITECTURE.md 13.2 names under-firing as the dangerous direction. The one row that
|
|
// carries a bit which fires on only some paths says so in its answer - kPulledPartialShutter
|
|
// joined with that bit - because the alternative, dropping the bit, tells a reader of this
|
|
// file that a bit P2 already emits a call for has no shutter at all.
|
|
//
|
|
// "EVERY PATH" MEANS EVERY PATH THAT MUTATES. A setter that returns early because the value
|
|
// did not change publishes nothing and needs to publish nothing - there is no mutation to
|
|
// carry - so a redundant-write guard (SetColorMask's `if (changed) BumpVersions();`, the
|
|
// BitwiseEqual guards on the patch levels) does not make its publisher conditional in the
|
|
// sense this rule cares about. A publisher reached on only SOME of the paths that DO mutate
|
|
// - SetCapability's ClipDistance arms, SetStencilFunc's reference-only call - is the thing
|
|
// that must not be named.
|
|
//
|
|
// EVERY BIT ANSWER IN THIS FILE IS DERIVED AND CHECKED, in two families and one
|
|
// direction. The RenderState family (45 rows) is checked both ways against RenderState.cpp,
|
|
// below. Every other NEW_* answer is checked against the shutter Tracker.h builds for that
|
|
// bit: gen_pipe_dirty_surface.py resolves what the shutter READS and what each mutator
|
|
// transitively WRITES (through MGP_NOTE_AGGREGATE too, whose hop it reads out of
|
|
// MGPipeNoteAggregate's own switch, and through the function-like macros of MG_State, which
|
|
// it EXPANDS - sixteen of RenderState.cpp's writes exist only after the preprocessor has
|
|
// pasted them together) to the SAME two-level token, MEM:<member> plus FIELD:<member>.<leaf>,
|
|
// and fails a row that names a bit whose shutter its mutator moves on no path at all. That
|
|
// half is one-directional on purpose - "it does write something the shutter reads" cannot
|
|
// prove it does so on EVERY path - so it catches under-firing and not over-claiming.
|
|
//
|
|
// AN ABSENCE CLAIM IS ONLY WORTH THE READING BEHIND IT, and this gate learned that twice:
|
|
// its write analysis first recorded a write through a member's field as the field alone
|
|
// and never the member, so --check printed, as a fact about RenderState.cpp, that
|
|
// SetPixelStoreParam "writes nothing NEW_PIXEL_PACK's shutter reads" about a setter whose
|
|
// whole body is sixteen writes to exactly that member; then, once it read the member, it
|
|
// still could not see a write through a REFERENCE (SetBlendEquation's `for (auto&
|
|
// blendState : m_parameters.BlendStates)`) and said the same false thing about seven more
|
|
// setters - while its reader side resolved `render.PatchVertices` to the WHOLE of
|
|
// m_parameters, so every setter that touched any byte of it "supported" NEW_PATCH_STATE and
|
|
// a row saying glClearColor publishes the patch state was green. So now: a reference or
|
|
// pointer bound to a member-rooted lvalue is followed, and its writes are credited to the
|
|
// member and the field it was bound to; a write whose root the analysis cannot place (a
|
|
// reference parameter, a call result, a member without the m_ prefix, a token it could not
|
|
// expand) TAINTS the function, and every answer that depends on a tainted function is
|
|
// UNDECIDED - printed with its reason, never a verdict; a writer supports a bit only when
|
|
// the two sides share a member AND, both resolved to fields, their field sets intersect (a
|
|
// whole-member write or read is every field); a member in common with no field information
|
|
// on one side is COARSE, reported and never counted. --check counts only the supported
|
|
// answers as derived, prints the COARSE and UNDECIDED tallies, and FAILS on an UNDECIDED
|
|
// row unless MGP_DIRTY_SURFACE_UNDECIDED_LIST at the bottom of this file marks it - a
|
|
// mark that outlives its reason is a red gate too. What it still cannot claim: a shutter
|
|
// member written outside MG_State/GLState + MG_Impl/Pipe is undecided in the absence
|
|
// direction, a call is resolved by NAME to every body of that name, and a FIELD token is
|
|
// not scoped to a type - all three only widen what a mutator is credited with, and the
|
|
// second is also how a taint spreads.
|
|
//
|
|
// The prose answers (kImmediate, kExplicitDestroy, kUnpublishedDestroy, kNoBackendRead,
|
|
// kPulledEveryVerb, kPulledPartialShutter, kReverseChannel) are statements no derivation
|
|
// checks - except the bits a kPulledPartialShutter row names, which are checked like any
|
|
// other bit answer. --check prints how many rows carry a prose answer, so "all mapped" can
|
|
// never be read as "all verified".
|
|
//
|
|
// For the RenderState family that answer is not a matter of taste and it is CHECKED
|
|
// rather than asserted: scripts/gen_pipe_dirty_surface.py reads RenderState.cpp and
|
|
// derives, per setter, which of NEW_RENDER_STATE / NEW_PIPELINE_STATE moves on every
|
|
// path - BumpVersions() moves both, a bare ++m_version moves only NEW_RENDER_STATE, and
|
|
// a setter with both kinds of path therefore always-fires only NEW_RENDER_STATE - and
|
|
// --check fails when a row disagrees, in either direction. That check exists because
|
|
// this file got exactly two rows wrong: SetCapability, whose ClipDistance0..7 arms move
|
|
// only m_version, and SetStencilFunc, whose pipeline bump is conditional on Func moving.
|
|
// Both named NEW_PIPELINE_STATE, which does not fire for glEnable(GL_CLIP_DISTANCE0) or
|
|
// for a reference-only glStencilFunc.
|
|
//
|
|
// NEW_* a MGPipeDirty bit (MG_Impl/Pipe/Tracker.h). The tracker's shutter for
|
|
// that bit moves when this mutator runs, so the next verb publishes it.
|
|
// kImmediate the mutating function also reaches the backend in the same body, so the
|
|
// mutation is published inline and needs no shutter at all.
|
|
// kReverseChannel not state: a write INTO the frontend from the backend's side.
|
|
// kNoBackendRead no backend read point observes this state at all.
|
|
// kExplicitDestroy published by the delete_* / resource_destroy call the Track H slice
|
|
// emits when the object's last reference drops - an object's DEATH,
|
|
// which no generation shutters because there is no longer an object
|
|
// to carry one. Only for a kind that HAS an identity on the wire to
|
|
// destroy: the resources and CSOs of PipeCalls.def, which is what P2
|
|
// brief D13 scopes Espryt 0b's explicit destroy to.
|
|
// kUnpublishedDestroy
|
|
// the same event for a kind NOTHING publishes: a program, a program
|
|
// pipeline and a shader have no per-object handle on the wire at all
|
|
// in P2 - resource_destroy and the delete_* family name resources and
|
|
// CSOs - so their DirectGLES twins are still reclaimed by the
|
|
// backend's own registry teardown and no frontend call says they
|
|
// died. Recorded as a hole rather than dressed up as a mechanism that
|
|
// exists; naming kExplicitDestroy here would be the same defect the
|
|
// RenderState derivation above exists to stop, one class down in
|
|
// stakes. (D13's prose says 'six kinds' while the Core.cpp ranges it
|
|
// cites also cover MarkProgram/MarkShaderForDeletion; the tree
|
|
// decides, and the tree has no wire object for those three.)
|
|
// kPulledEveryVerb no shutter exists at all - no MGPipeDirty bit moves on any path through
|
|
// this mutator - and none is needed yet: the PipeInputs field it writes is
|
|
// in its verb class's may-read mask, so the residual fill copies it at
|
|
// EVERY verb of that class. A shutter here is a P3/P4 optimisation, not a
|
|
// correctness gap.
|
|
// kPulledPartialShutter
|
|
// the same pull, but a bit DOES move - on some of the paths that mutate,
|
|
// not all of them - so this row must never be read as "no shutter exists".
|
|
// The bits that move are named after the '|', which is the one place this
|
|
// file joins a prose answer with a bit, and the reason is exactly that a
|
|
// P3a shutter builder has to be able to tell "no bit covers this" from "a
|
|
// bit covers half of it". The named bits are checked the same way every
|
|
// other bit answer is - a dead one is a red gate - but they are NOT a
|
|
// licence to narrow: what holds on every mutating path is the pull.
|
|
// Which rows need this answer is a human judgement and stays one: the
|
|
// derivation's "it does move that shutter" direction over-approximates
|
|
// (a call name resolves to every body of that name, a write inside an
|
|
// `if` counts), so it can refute a named bit but cannot find the rows
|
|
// that should have named one.
|
|
//
|
|
// KNOWN BLIND SPOTS OF THE SCANNER, recorded here rather than left implicit
|
|
// (gen_pipe_dirty_surface.py's own notes plus its scan roots):
|
|
// 1. it matches braced function bodies textually, so a mutator inside a LAMBDA is
|
|
// attributed to the enclosing function;
|
|
// 2. a mutation published through a HELPER the entry point calls reads as deferred here.
|
|
// 3. CLOSED AT P3a. The scan root was MG_Impl/GLImpl only, so the four MGP_NOTE_MUTATION
|
|
// sites in MG_State/GLState/TextureState/TextureState.h were outside it entirely. The
|
|
// root is now both directories and the notice is a recognised publish mechanism; what
|
|
// that found is the two rows marked "P3a" below.
|
|
// The gate is therefore a COMPLETENESS gate over what the scanner does see. The semantic
|
|
// proof stays the MOBILEGL_PIPE_VERIFY lane, which is blind to none of them.
|
|
//
|
|
// THE MUTATOR PREFIX SET WIDENS AT P4a, and what it does NOT gain is the more interesting
|
|
// half. `pGLContext->` + Add|Set|Mark|Bump|Allocate|Truncate|Record|Notify|Begin|End could
|
|
// not see `UseProgram`, `BindVertexArray`, `BindProgramPipelineObject` or
|
|
// `BindTransformFeedbackObject` - four mutators that each move a field P3a or P4a pushes -
|
|
// because none of them starts with one of those words. `Use` and `Bind` are added, and the
|
|
// complete set the widening surfaces was enumerated by grep at the phase's base ref so it
|
|
// cannot surprise anybody: exactly those four names, on seven call sites.
|
|
//
|
|
// `Create*` and `Pop*` are DELIBERATELY NOT ADDED. They create or destroy objects rather than
|
|
// move a pushed field, and each object class's creation and destruction is already answered
|
|
// twice over - by its own Mark*ForDeletion row below and by the constructor-time
|
|
// resource_create - so adding them would produce rows that restate an answer this file already
|
|
// gives, and every one of them would have to be maintained against a mechanism that is not
|
|
// theirs. A gate whose rows do not each carry their own question is a gate nobody reads.
|
|
//
|
|
// clang-format off
|
|
|
|
// X(Mutator, Answer)
|
|
#define MGP_DIRTY_SURFACE_LIST(X) \
|
|
/* ---- the reverse channel: 836 of the 926 calls, 90% of the surface ---- */ \
|
|
X(RecordError, kReverseChannel) \
|
|
/* ---- immediate publish points: the same body reaches the backend ---- */ \
|
|
X(SetActiveTextureUnit, kImmediate) \
|
|
X(BeginTransformFeedback, kImmediate) \
|
|
X(EndTransformFeedback, kImmediate) \
|
|
X(SetTransformFeedbackPaused, kImmediate) \
|
|
X(MarkTransformFeedbackObjectForDeletion, kImmediate) \
|
|
/* ---- the render state. Derived from RenderState.cpp and gated by --check: */ \
|
|
/* a setter that calls BumpVersions() on every path publishes BOTH counters; */ \
|
|
/* one that also has a bare ++m_version path publishes only NEW_RENDER_STATE. */ \
|
|
X(SetBlendEquation, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetBlendEquationIndexed, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetBlendFunc, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetBlendFuncIndexed, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
/* SetCapability's ClipDistance0..7 arms write ClipDistanceEnabledMask (dynamic */ \
|
|
/* chunk D7) and deliberately do NOT BumpVersions, so NEW_PIPELINE_STATE does */ \
|
|
/* not fire at all for glEnable(GL_CLIP_DISTANCE0): set_dynamic_state publishes */ \
|
|
/* it, and NEW_RENDER_STATE is the only answer that holds on every arm. */ \
|
|
X(SetCapability, NEW_RENDER_STATE) \
|
|
X(SetCapabilityIndexed, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetColorMask, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetColorMaskIndexed, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetCullFaceMode, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetDepthFunc, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetDepthMask, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetFrontFaceMode, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetLogicOp, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetMinSampleShadingValue, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetPolygonMode, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetProvokingVertexMode, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetSampleCoverage, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetSampleMaskValue, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
/* SetStencilFunc writes Func (pipeline chunk P2/P3) AND Ref/ValueMask (dynamic */ \
|
|
/* D3/D4), and ++m_pipelineStateVersion is CONDITIONAL on Func moving - which is */ \
|
|
/* what keeps a glStencilFunc that moves only the reference from evicting a */ \
|
|
/* cached pipeline, and is why only NEW_RENDER_STATE fires on every call. */ \
|
|
/* SetStencilOp is wholly pipeline, SetStencilMask wholly dynamic. */ \
|
|
X(SetStencilFunc, NEW_RENDER_STATE) \
|
|
X(SetStencilOp, NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetStencilMask, NEW_RENDER_STATE) \
|
|
X(SetBlendColor, NEW_RENDER_STATE) \
|
|
X(SetClampReadColor, NEW_RENDER_STATE) \
|
|
X(SetClearColor, NEW_RENDER_STATE) \
|
|
X(SetClearDepth, NEW_RENDER_STATE) \
|
|
X(SetClearStencil, NEW_RENDER_STATE) \
|
|
X(SetClipControl, NEW_RENDER_STATE) \
|
|
X(SetDepthRange, NEW_RENDER_STATE) \
|
|
X(SetDepthRangeIndexed, NEW_RENDER_STATE) \
|
|
X(SetHint, NEW_RENDER_STATE) \
|
|
X(SetLineWidth, NEW_RENDER_STATE) \
|
|
X(SetPointFadeThresholdSize, NEW_RENDER_STATE) \
|
|
X(SetPointSize, NEW_RENDER_STATE) \
|
|
X(SetPointSpriteCoordOrigin, NEW_RENDER_STATE) \
|
|
X(SetPolygonOffset, NEW_RENDER_STATE) \
|
|
X(SetPolygonOffsetClamped, NEW_RENDER_STATE) \
|
|
X(SetPrimitiveRestartIndex, NEW_RENDER_STATE) \
|
|
X(SetScissorBox, NEW_RENDER_STATE) \
|
|
X(SetScissorBoxIndexed, NEW_RENDER_STATE) \
|
|
X(SetViewport, NEW_RENDER_STATE) \
|
|
X(SetViewportIndexed, NEW_RENDER_STATE) \
|
|
/* ---- the other value-class bits ---- */ \
|
|
/* kPulledPartialShutter, NOT kPulledEveryVerb, and NOT a bare NEW_PIXEL_PACK: */ \
|
|
/* RenderState::SetPixelStoreParam writes BOTH halves - eight Pack arms and eight */ \
|
|
/* Unpack arms - while the tracker's bit 2 is a byte compare of the PACK half alone */ \
|
|
/* (Tracker.h), because set_pixel_pack_state deliberately has no unpack counterpart */ \
|
|
/* (ARCHITECTURE.md 4.6). So glPixelStorei(GL_PACK_ALIGNMENT, 8) DOES move bit 2 and */ \
|
|
/* glPixelStorei(GL_UNPACK_ALIGNMENT, 8) moves nothing at all, and a shutter narrowed */ \
|
|
/* to bit 2 would under-fire for eight of the sixteen arms. What is true on every path */ \
|
|
/* is the pull: GetPixelStoreParameters is one of the two Coverage.def rows an emitted */ \
|
|
/* call does not supply completely (PipeFill.cpp), so the residual fill copies both */ \
|
|
/* halves at every verb of the class. The bit is named anyway because P2 already EMITS */ \
|
|
/* set_pixel_pack_state off it: a row that said "no shutter exists" about the only */ \
|
|
/* mutator behind a shipped call would be a false answer to the one question D16 hands */ \
|
|
/* P3a. Splitting this setter into a pack half and an unpack half is what would let the */ \
|
|
/* pack half answer NEW_PIXEL_PACK outright; that is P3's move, not P2's. */ \
|
|
X(SetPixelStoreParam, kPulledPartialShutter|NEW_PIXEL_PACK) \
|
|
X(SetPatchDefaultInnerLevel, NEW_PATCH_STATE|NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetPatchDefaultOuterLevel, NEW_PATCH_STATE|NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
/* Also an immediate publish point, but it has a real bit and the bit is */ \
|
|
/* the more useful answer: set_patch_state carries it whatever the caller */ \
|
|
/* does next. */ \
|
|
X(SetPatchVertices, NEW_PATCH_STATE|NEW_RENDER_STATE|NEW_PIPELINE_STATE) \
|
|
X(SetCurrentVertexAttributeFloat, NEW_VERTEX_ATTRIB_DEFAULTS) \
|
|
X(SetCurrentVertexAttributeInt, NEW_VERTEX_ATTRIB_DEFAULTS) \
|
|
X(SetCurrentVertexAttributeUint, NEW_VERTEX_ATTRIB_DEFAULTS) \
|
|
/* ---- object class ---- */ \
|
|
X(BumpTextureBindGeneration, NEW_SAMPLER_VIEWS) \
|
|
/* P3a, FOUND BY THE WIDENED SCAN ROOT and not by anything before it: every caller of */ \
|
|
/* this one is inside MG_State/GLState (SamplerObject::BumpVersion for any sampler */ \
|
|
/* parameter, TextureObjectBase's shape bump), which the scan did not read, so it had */ \
|
|
/* no row at all while its sibling above did. NEW_SAMPLERS is the bit whose shutter */ \
|
|
/* mixes the texture-params aggregate with exactly this generation, and the bump is */ \
|
|
/* unconditional on every path that reaches it - the early-outs are in the setters */ \
|
|
/* above it, which is the redundant-write guard this file's rule explicitly allows. */ \
|
|
X(BumpSamplingResolutionGeneration, NEW_SAMPLERS) \
|
|
/* P3a, and the reason the scan now reads MGP_NOTE_MUTATION as a publish mechanism of */ \
|
|
/* its own: this function is not a pGLContext-> mutator at all - every texture and */ \
|
|
/* sampler bind entry point routes THROUGH it - and it moves two pushed PipeInputs */ \
|
|
/* fields with two different answers. */ \
|
|
/* GetTextureBindGeneration moves only on the bindingChanged arm, so NEW_SAMPLER_ */ \
|
|
/* VIEWS fires on SOME of the paths that mutate and not all: a redundant re-bind */ \
|
|
/* of the object a unit already holds advances the high-water mark alone. That is */ \
|
|
/* precisely what kPulledPartialShutter is for. */ \
|
|
/* GetMaxTouchedTextureUnit has no shutter at all; it is in its verb class's may-read */ \
|
|
/* mask and the residual fill copies it at every verb. */ \
|
|
/* Both are ALSO published inline by MGP_NOTE_MUTATION when the write happens inside a */ \
|
|
/* verb already in flight - a backend binding its own synthesised fallback texture - */ \
|
|
/* which is the window no shutter and no pull can cover, and the reason those sites */ \
|
|
/* had to come inside this gate rather than stay a recorded blind spot. */ \
|
|
X(NoteUnitTouched, kPulledPartialShutter|NEW_SAMPLER_VIEWS) \
|
|
/* P5e (sb) REWRITES THIS ROW, AND THE OLD ONE ENDED WITH ITS OWN CONDITION: "narrowing */ \
|
|
/* it is P3b's, when it takes the subsystem over and the binding points get a */ \
|
|
/* generation of their own". They have one now (BufferState::NoteBindPointChanged), bit */ \
|
|
/* 17's shutter reads it, and this function bumps it - so the paragraph that said */ \
|
|
/* NEW_SO_TARGETS was "false on EVERY path" is withdrawn, because what made it false */ \
|
|
/* was that the bit mixed the buffer-CONTENT aggregate, which no binding has ever moved.*/ \
|
|
/* */ \
|
|
/* kPulledPartialShutter AND NOT A BARE BIT, because the function has two arms: with */ \
|
|
/* `index == m_boundTransformFeedback` it binds a real BufferState binding point and */ \
|
|
/* bumps, and otherwise it writes the NAMED object's saved-bindings entry, which is not */ \
|
|
/* a binding point at all and deliberately bumps nothing. So the bit fires on some of */ \
|
|
/* the paths that mutate and not all, which is exactly what this answer is for; what */ \
|
|
/* holds on every mutating path is still the pull through GetBufferBindingPoint. */ \
|
|
X(SetNamedTransformFeedbackBinding, kPulledPartialShutter|NEW_SO_TARGETS) \
|
|
/* P5e (sb), THE ONE NAME THE `Touch` PREFIX SURFACES, on two call sites - GL_Buffer.cpp's*/ \
|
|
/* BindBufferBase_State and BindBufferRange_State. It moves the per-target high-water */ \
|
|
/* mark that bounds every indexed-binding-point walk there is: the backend's, the */ \
|
|
/* client's GPU-write sweep's, and set_shader_buffers' emitted window. */ \
|
|
/* */ \
|
|
/* kPulledEveryVerb, in GetMaxTouchedTextureUnit's exact words one family over: the */ \
|
|
/* field it writes (GetTouchedBufferBindingPointCount) has no shutter of its own and */ \
|
|
/* needs none - it is in kDraw's, kDispatch's and kXfbSpan's may-read masks, so the */ \
|
|
/* residual fill copies it at every verb of those classes, and since P5c rv */ \
|
|
/* set_context_values carries it as a value whose gate is the whole-record hash. */ \
|
|
/* */ \
|
|
/* IT NAMES NO BIT, AND THAT IS NOT THE SAME AS THE MUTATION GOING UNPUBLISHED. Both */ \
|
|
/* call sites bump the bind-point generation on the line below this call, so bits 15/16/ */ \
|
|
/* 17 fire for the bind - but they fire for the BINDING, through a different member, and */ \
|
|
/* a row here that named them would claim this mutator moves a shutter it does not touch */ \
|
|
/* (the derivation refutes exactly that, which is how the claim was tested). */ \
|
|
X(TouchBufferBindingPoint, kPulledEveryVerb) \
|
|
/* ---- P4a, THE FOUR THE WIDENED PREFIX SET SURFACES. Every one of them moves a field */ \
|
|
/* P3a or P4a pushes and none of them was visible to the scan before, because none */ \
|
|
/* begins with one of the ten words the pattern matched. */ \
|
|
/* UseProgram is bit 6's whole subject: the shutter is */ \
|
|
/* Mix(GetCurrentProgram()->GetLifetimeId(), GetLinkVersion()) and glUseProgram is */ \
|
|
/* what moves the object it reads through. Two call sites. AND SINCE THE FABLE */ \
|
|
/* SEAM ROUND (F-1 / F-2) IT IS BITS 12 AND 14's TOO: set_sampler_views is */ \
|
|
/* resolved for the program in use and set_shader_images' window is the highest */ \
|
|
/* image unit the program in use names, so both shutters mix the same identity */ \
|
|
/* bit 6 reads, and a glUseProgram alone moves all three. Undecided for the same */ \
|
|
/* reason as bit 6 (the taint below), marked the same way. */ \
|
|
/* BindVertexArray is bit 5's, for the same reason one level down: the shutter mixes */ \
|
|
/* the bound VAO's identity with its configuration version, and this is the bind. */ \
|
|
/* Three call sites. */ \
|
|
X(UseProgram, NEW_SHADER|NEW_SAMPLER_VIEWS|NEW_SHADER_IMAGES) \
|
|
X(BindVertexArray, NEW_VERTEX_ELEMENTS) \
|
|
/* NOT NEW_SHADER, and the derivation refutes it outright rather than leaving it a */ \
|
|
/* judgement: this mutator writes m_boundProgramPipeline (plus the pipeline name table) */ \
|
|
/* and bit 6's shutter reads m_currentProgram's lifetime id and link version - disjoint */ \
|
|
/* sets, on every path. That is not an oversight in the shutter either: it reads */ \
|
|
/* GetCurrentProgram() and DELIBERATELY NOT GetProgramForDraw(), because the tracker */ \
|
|
/* must not force a compile just to answer "did the shader move", and flattening a */ \
|
|
/* pipeline into its composite is exactly the compile it would force. What a bind moves */ \
|
|
/* is which program the validate point will flatten, and that field - */ \
|
|
/* GetProgramForDraw - is in the may-read mask of every class that draws and is copied */ \
|
|
/* by the residual fill at every verb of those classes, EMITTED-AND-STILL-PULLED like */ \
|
|
/* GetBoundVertexArray. So the pull is what holds on every path, and it is the answer. */ \
|
|
X(BindProgramPipelineObject, kPulledEveryVerb) \
|
|
/* No shutter at all, and none is needed: the transform-feedback binding reaches the */ \
|
|
/* backend through GetBoundTransformFeedbackLifetimeId and its siblings, which are in */ \
|
|
/* the kDraw and kXfbSpan may-read masks, so the residual fill copies them at every */ \
|
|
/* verb of those classes. Narrowing it is P4b's, with set_stream_output_targets. */ \
|
|
X(BindTransformFeedbackObject, kPulledEveryVerb) \
|
|
/* ---- an object's death: no generation, because there is no longer an object */ \
|
|
/* to carry one. Espryt 0b's delete_* / resource_destroy publishes the kinds */ \
|
|
/* that have a handle on the wire; programs, program pipelines and shaders have */ \
|
|
/* none in P2, so nothing publishes theirs - kUnpublishedDestroy, a known hole. */ \
|
|
/* TWO OF THESE ROWS STOPPED BEING ASPIRATIONAL AT P3a, and the call that makes */ \
|
|
/* each true is named rather than implied: */ \
|
|
/* MarkBufferObjectForDeletion -> resource_destroy (PipeCalls.def), emitted */ \
|
|
/* from ~BufferObject the moment the last reference drops - which is the */ \
|
|
/* glDelete* that only marks the name, followed by whatever unbind actually */ \
|
|
/* releases it - and followed IN THAT ORDER by the client freeing the slot. */ \
|
|
/* MarkVertexArrayForDeletion -> delete_vertex_elements, published through the */ \
|
|
/* death notice ~VertexArrayObject already raises for the VertexElementsCso */ \
|
|
/* kind; the CSO handle is minted per frontend VAO off its lifetime id. */ \
|
|
/* THE PUBLISHER IS THE BACKEND'S (Managers.cpp's OnFrontendStateObject- */ \
|
|
/* Destroyed consumer, package espryt), not the client's: the client mints */ \
|
|
/* the CSO handle and emits create/bind, and the free rides with that */ \
|
|
/* consumer. Until it lands the row states the design, not the tree. */ \
|
|
/* P4a CLOSES ONE OF THE THREE HOLES ABOVE AND STATES WHY THE OTHER TWO ARE NOT HOLES. */ \
|
|
/* MarkProgramForDeletion -> kExplicitDestroy. delete_shader_state exists now and */ \
|
|
/* ~ProgramObject emits it through the client-side death helper, in the fixed */ \
|
|
/* order: the wire delete first, the backend notice second, the slot free last. A */ \
|
|
/* program pipeline COMPOSITE takes the same call on the same helper - the server */ \
|
|
/* never learns it is a composite. */ \
|
|
/* MarkProgramPipelineForDeletion stays kUnpublishedDestroy, and it is NOT waiting */ \
|
|
/* for a later phase: a ProgramPipelineObject has no lifetime id and no wire object */ \
|
|
/* at all (its only identity is m_everBound). It never gets a handle, so there is */ \
|
|
/* nothing for a delete to name. What its cache's eviction DOES publish is the */ \
|
|
/* composite's delete_shader_state, which is the row above. */ \
|
|
/* MarkShaderForDeletion stays kUnpublishedDestroy for the same kind of reason: a */ \
|
|
/* ShaderObject has no lifetime id and never crosses the boundary - the payload is */ \
|
|
/* per-stage SPIR-V plus the reflection archive, not source, and glslang lives */ \
|
|
/* entirely on the client. */ \
|
|
X(MarkBufferObjectForDeletion, kExplicitDestroy) \
|
|
X(MarkFramebufferObjectForDeletion, kExplicitDestroy) \
|
|
X(MarkProgramForDeletion, kExplicitDestroy) \
|
|
X(MarkProgramPipelineForDeletion, kUnpublishedDestroy) \
|
|
X(MarkRenderbufferObjectForDeletion, kExplicitDestroy) \
|
|
X(MarkSamplerObjectForDeletion, kExplicitDestroy) \
|
|
X(MarkShaderForDeletion, kUnpublishedDestroy) \
|
|
X(MarkTextureObjectForDeletion, kExplicitDestroy) \
|
|
X(MarkVertexArrayForDeletion, kExplicitDestroy) \
|
|
/* ---- no backend read point observes these at all ---- */ \
|
|
/* GL_ANY_SAMPLES_PASSED conditional rendering is resolved wholly in the */ \
|
|
/* frontend: IsConditionalRenderActive / GetConditionalRenderQuery have no */ \
|
|
/* reader under MG_Backend and no Coverage.def row. */ \
|
|
X(BeginConditionalRender, kNoBackendRead) \
|
|
X(EndConditionalRender, kNoBackendRead) \
|
|
/* ---- pulled at every verb of the class, so the next verb publishes them */ \
|
|
/* unconditionally. The transform-feedback accounting counters reach the */ \
|
|
/* backend through GetTransformFeedbackCapturedVertices and friends, which */ \
|
|
/* are in the kDraw and kXfbSpan may-read masks. */ \
|
|
X(AddTransformFeedbackAccountedCaptureDraw, kPulledEveryVerb) \
|
|
X(AddTransformFeedbackCapturedVertices, kPulledEveryVerb) \
|
|
X(AddTransformFeedbackGeometryCaptureDraw, kPulledEveryVerb) \
|
|
X(AddTransformFeedbackInputPrimitives, kPulledEveryVerb) \
|
|
X(AddTransformFeedbackPausedPrimitives, kPulledEveryVerb) \
|
|
X(AddTransformFeedbackPrimitives, kPulledEveryVerb)
|
|
|
|
// X(Mutator, Bit) - the (row, bit) pairs above whose derivation is KNOWN to come out
|
|
// UNDECIDED, each with the reason --check prints for it. Every bit answer NOT listed here
|
|
// is marked derived: --check fails when the derivation cannot decide it, and fails again
|
|
// when a mark here names a pair the derivation now decides, so this list can neither hide a
|
|
// row nor outlive its reason.
|
|
//
|
|
// IT WAS EMPTY UNTIL P4a, and it stops being empty for a reason that is a property of the
|
|
// SCANNER rather than of the rows. Every entry below is a bit answer that is plainly true -
|
|
// glUseProgram is what moves the object bits 6, 12 and 14's shutters read through (the
|
|
// program in use; bits 12 and 14 since the fable seam round, F-1 / F-2), and glBindVertexArray
|
|
// is what moves the object bit 5's shutter reads through - and the write analysis cannot say
|
|
// so, because each of the two mutators reaches, BY NAME, a body that writes a member with no
|
|
// m_ prefix:
|
|
//
|
|
// UseProgram -> DestroyProgramSlot() writes `attachedShaders`
|
|
// BindVertexArray -> a call spelled `Bind(` resolves to every body of that name, one of
|
|
// which (ImageTextureBinding::Bind) writes `Access`
|
|
//
|
|
// A call resolved by name to every body of that name is one of the three over-approximations
|
|
// this analysis documents about itself, and an unplaceable write TAINTS the body it is in -
|
|
// which is the right default, because "it does not write anything the shutter reads" must
|
|
// never be claimed about code the script could not read. Widening the taint rule to ignore
|
|
// non-m_ writes would weaken the one mechanism that catches a genuine under-fire, so the rows
|
|
// are MARKED, with the tool's own reason, rather than the tool being made more permissive.
|
|
// Control 21 is what proves every marked row still needs its mark (it reads this list, so a
|
|
// row that gains a bit here is counted rather than assumed), and control 18 is what fails the
|
|
// moment any of them becomes decidable and the mark outlives its reason.
|
|
//
|
|
// The ten mutators that reach a tainted body (--check prints the count) all carry a prose
|
|
// answer, which no derivation checks; these two mutators are the first that carry a bit answer.
|
|
//
|
|
// P5e (sb) ADDS A THIRD, for the same property of the scanner and a third unplaceable write:
|
|
//
|
|
// SetNamedTransformFeedbackBinding
|
|
// -> MGPipeSlots().Acquire() calls GetLifetimeId() through its reference
|
|
// parameter `buffer`, which the analysis cannot root in a member
|
|
//
|
|
// The claim it marks is plain: the bound arm of this function bumps the transform-feedback
|
|
// target's bind-point generation (BufferState::NoteBindPointChanged), which is exactly what
|
|
// bit 17's shutter reads since P5e. The mark is on the BIT the kPulledPartialShutter row
|
|
// names, not on the pull, so what this list suspends is the narrowing claim and never the
|
|
// answer that holds on every path.
|
|
#define MGP_DIRTY_SURFACE_UNDECIDED_LIST(X) \
|
|
X(UseProgram, NEW_SHADER) \
|
|
X(UseProgram, NEW_SAMPLER_VIEWS) \
|
|
X(UseProgram, NEW_SHADER_IMAGES) \
|
|
X(BindVertexArray, NEW_VERTEX_ELEMENTS) \
|
|
X(SetNamedTransformFeedbackBinding, NEW_SO_TARGETS)
|
|
|
|
// clang-format on
|