mirror of
https://github.com/MobileGL-Dev/MobileGL
synced 2026-11-07 01:53:24 +09:00
- GenerateTextureMipmap and CopyTextureSubImage2D emit the records their target slots emit - RemoteEmitTable.TheThreeClassesPartitionAllSeventyOneSlots is renamed ...PartitionEverySlot
447 lines
26 KiB
C++
447 lines
26 KiB
C++
// MobileGL - MobileGL/MG_Pipe/generated/PipeFieldOwnership.inc
|
|
// 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
|
|
|
|
// TABLE 2: PipeInputs field ownership (CONTRACT-P5.md section 3, R-7).
|
|
//
|
|
// GENERATED by scripts/gen_pipe_field_ownership.py from Coverage.def, FieldOwnership.def and
|
|
// MG_Impl/Pipe/PipeFill.cpp - DO NOT EDIT. Regenerate with
|
|
// `python3 scripts/gen_pipe_field_ownership.py`; CI runs it and diffs the result.
|
|
//
|
|
// Included from MG_Backend/MGPipe/PipeInputs.h inside namespace MobileGL::MG_Pipe, which is
|
|
// the one header that both the poison check and the server's verb stamp already see. It is
|
|
// NOT included from MG_Pipe/MGPipe.h with the other seven generated files, on purpose: that
|
|
// header is in the PULL build's include closure and G1 admits no symbol motion there.
|
|
|
|
|
|
// The four classes. kUnclassified exists so the static_assert below has something to refuse;
|
|
// the generator never emits it, which is what makes "a field in no class fails the build"
|
|
// true at two independent points rather than one.
|
|
enum class MGPipeFieldOwnership : Uint8 {
|
|
kUnclassified = 0,
|
|
kRecordSupplied, // a pushed record supplies the WHOLE field
|
|
kApplierDerived, // the applier writes it out of records it already applies
|
|
kBarrierPulled, // P5's debt: read out of the client's residual fill under the verb barrier
|
|
kFatal, // no carrier and the reduced path never reads it
|
|
};
|
|
|
|
inline constexpr const char* kMGPipeFieldOwnershipNames[] = {
|
|
"UNCLASSIFIED", "RECORD-SUPPLIED", "APPLIER-DERIVED", "BARRIER-PULLED", "FATAL",
|
|
};
|
|
|
|
inline constexpr MGPipeFieldOwnership kMGPipeFieldOwnership[kMGPipeInputFieldCount] = {
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetActiveTextureUnit
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetBlendColor
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetBlendEquationIndexed
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetBlendFuncIndexed
|
|
MGPipeFieldOwnership::kFatal, // GetBoundTransformFeedbackName
|
|
MGPipeFieldOwnership::kFatal, // GetBoundVertexArray
|
|
MGPipeFieldOwnership::kFatal, // GetBufferBindingSlot
|
|
MGPipeFieldOwnership::kFatal, // GetBufferBindingPoint
|
|
MGPipeFieldOwnership::kApplierDerived, // GetBufferBindingPointCount
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetTouchedBufferBindingPointCount
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetClampReadColor
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetClearColor
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetClearDepth
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetClearStencil
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetColorMaskIndexed
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetCullFaceMode
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetCurrentVertexAttribute
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetDepthFunc
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetDepthMask
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetDepthRangeIndexed
|
|
MGPipeFieldOwnership::kFatal, // GetFramebufferBindingSlot
|
|
MGPipeFieldOwnership::kFatal, // GetImageTextureBinding
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetLineWidth
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetLogicOp
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetMaxTouchedTextureUnit
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetMinSampleShadingValue
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPatchDefaultInnerLevel
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPatchDefaultOuterLevel
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPatchVertices
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPipelineStateVersion
|
|
MGPipeFieldOwnership::kApplierDerived, // GetPixelStoreParameters
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPolygonModeFront
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPolygonOffsetFactor
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPolygonOffsetUnits
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetPrimitiveRestartIndex
|
|
MGPipeFieldOwnership::kFatal, // GetProgramForDispatch
|
|
MGPipeFieldOwnership::kFatal, // GetProgramForDraw
|
|
MGPipeFieldOwnership::kFatal, // GetProgramObject
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetProvokingVertexMode
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetRenderStateParameters
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetRenderStateParametersVersion
|
|
MGPipeFieldOwnership::kApplierDerived, // GetSamplingResolutionGeneration
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetScissorBox
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetStencilState
|
|
MGPipeFieldOwnership::kApplierDerived, // GetTextureBindGeneration
|
|
MGPipeFieldOwnership::kApplierDerived, // GetTextureContextId
|
|
MGPipeFieldOwnership::kFatal, // GetTextureObject
|
|
MGPipeFieldOwnership::kFatal, // GetTextureUnitObject
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetTransformFeedbackCapturedVertices
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetTransformFeedbackGeneration
|
|
MGPipeFieldOwnership::kFatal, // GetTransformFeedbackPausedPrimitiveCounter
|
|
MGPipeFieldOwnership::kFatal, // GetTransformFeedbackProgram
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetViewport
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetViewportIndexed
|
|
MGPipeFieldOwnership::kRecordSupplied, // IsCapabilityEnabled
|
|
MGPipeFieldOwnership::kRecordSupplied, // IsCapabilityEnabledIndexed
|
|
MGPipeFieldOwnership::kRecordSupplied, // IsTransformFeedbackActive
|
|
MGPipeFieldOwnership::kRecordSupplied, // IsTransformFeedbackPaused
|
|
MGPipeFieldOwnership::kFatal, // InvalidateCompileEnv
|
|
MGPipeFieldOwnership::kFatal, // ValidateProgramName
|
|
MGPipeFieldOwnership::kFatal, // RecordError
|
|
MGPipeFieldOwnership::kRecordSupplied, // GetBoundTransformFeedbackLifetimeId
|
|
MGPipeFieldOwnership::kApplierDerived, // HasOpenTransformFeedbackSpan
|
|
};
|
|
|
|
// The ROADMAP phase whose row retires the pull. "-" for every class but BARRIER-PULLED.
|
|
inline constexpr const char* kMGPipeFieldRetiringPhase[kMGPipeInputFieldCount] = {
|
|
"-", // GetActiveTextureUnit
|
|
"-", // GetBlendColor
|
|
"-", // GetBlendEquationIndexed
|
|
"-", // GetBlendFuncIndexed
|
|
"-", // GetBoundTransformFeedbackName
|
|
"-", // GetBoundVertexArray
|
|
"-", // GetBufferBindingSlot
|
|
"-", // GetBufferBindingPoint
|
|
"-", // GetBufferBindingPointCount
|
|
"-", // GetTouchedBufferBindingPointCount
|
|
"-", // GetClampReadColor
|
|
"-", // GetClearColor
|
|
"-", // GetClearDepth
|
|
"-", // GetClearStencil
|
|
"-", // GetColorMaskIndexed
|
|
"-", // GetCullFaceMode
|
|
"-", // GetCurrentVertexAttribute
|
|
"-", // GetDepthFunc
|
|
"-", // GetDepthMask
|
|
"-", // GetDepthRangeIndexed
|
|
"-", // GetFramebufferBindingSlot
|
|
"-", // GetImageTextureBinding
|
|
"-", // GetLineWidth
|
|
"-", // GetLogicOp
|
|
"-", // GetMaxTouchedTextureUnit
|
|
"-", // GetMinSampleShadingValue
|
|
"-", // GetPatchDefaultInnerLevel
|
|
"-", // GetPatchDefaultOuterLevel
|
|
"-", // GetPatchVertices
|
|
"-", // GetPipelineStateVersion
|
|
"-", // GetPixelStoreParameters
|
|
"-", // GetPolygonModeFront
|
|
"-", // GetPolygonOffsetFactor
|
|
"-", // GetPolygonOffsetUnits
|
|
"-", // GetPrimitiveRestartIndex
|
|
"-", // GetProgramForDispatch
|
|
"-", // GetProgramForDraw
|
|
"-", // GetProgramObject
|
|
"-", // GetProvokingVertexMode
|
|
"-", // GetRenderStateParameters
|
|
"-", // GetRenderStateParametersVersion
|
|
"-", // GetSamplingResolutionGeneration
|
|
"-", // GetScissorBox
|
|
"-", // GetStencilState
|
|
"-", // GetTextureBindGeneration
|
|
"-", // GetTextureContextId
|
|
"-", // GetTextureObject
|
|
"-", // GetTextureUnitObject
|
|
"-", // GetTransformFeedbackCapturedVertices
|
|
"-", // GetTransformFeedbackGeneration
|
|
"-", // GetTransformFeedbackPausedPrimitiveCounter
|
|
"-", // GetTransformFeedbackProgram
|
|
"-", // GetViewport
|
|
"-", // GetViewportIndexed
|
|
"-", // IsCapabilityEnabled
|
|
"-", // IsCapabilityEnabledIndexed
|
|
"-", // IsTransformFeedbackActive
|
|
"-", // IsTransformFeedbackPaused
|
|
"-", // InvalidateCompileEnv
|
|
"-", // ValidateProgramName
|
|
"-", // RecordError
|
|
"-", // GetBoundTransformFeedbackLifetimeId
|
|
"-", // HasOpenTransformFeedbackSpan
|
|
};
|
|
|
|
// The seven sticky forwards, which are among the 63 above and need a row of their own:
|
|
// they are the ones that hand the server a raw frontend object or write into the
|
|
// frontend, so the exit gate is structurally blind on them without one.
|
|
inline constexpr SizeT kMGPipeFieldOwnershipForwardCount = 7;
|
|
static_assert(kMGPipeFieldOwnershipForwardCount == kMGPipeInputStickyFieldCount,
|
|
"the forward rows and Coverage.def's sticky set are the same seven");
|
|
inline constexpr MGPipeInputField kMGPipeFieldOwnershipForwardField[kMGPipeFieldOwnershipForwardCount] = {
|
|
MGPipeInputField::GetBufferBindingPointCount,
|
|
MGPipeInputField::GetProgramObject,
|
|
MGPipeInputField::GetTextureObject,
|
|
MGPipeInputField::HasOpenTransformFeedbackSpan,
|
|
MGPipeInputField::ValidateProgramName,
|
|
MGPipeInputField::InvalidateCompileEnv,
|
|
MGPipeInputField::RecordError,
|
|
};
|
|
inline constexpr MGPipeFieldOwnership kMGPipeFieldOwnershipForward[kMGPipeFieldOwnershipForwardCount] = {
|
|
MGPipeFieldOwnership::kApplierDerived, // GetBufferBindingPointCount
|
|
MGPipeFieldOwnership::kFatal, // GetProgramObject
|
|
MGPipeFieldOwnership::kFatal, // GetTextureObject
|
|
MGPipeFieldOwnership::kApplierDerived, // HasOpenTransformFeedbackSpan
|
|
MGPipeFieldOwnership::kFatal, // ValidateProgramName
|
|
MGPipeFieldOwnership::kFatal, // InvalidateCompileEnv
|
|
MGPipeFieldOwnership::kFatal, // RecordError
|
|
};
|
|
inline constexpr const char* kMGPipeFieldOwnershipForwardMechanism[kMGPipeFieldOwnershipForwardCount] = {
|
|
"fixed indexed binding-point capacity; no client lookup", // GetBufferBindingPointCount, retires in -
|
|
"program identity is resolved on the client and crosses as a shader-CSO handle", // GetProgramObject, retires in -
|
|
"texture identity crosses as a handle; no server GL-name lookup into the client", // GetTextureObject, retires in -
|
|
"server Begin/End snapshot table keyed by XFB lifetime id", // HasOpenTransformFeedbackSpan, retires in -
|
|
"validation belongs to the client; the server validates the carried handle", // ValidateProgramName, retires in -
|
|
"transport caps republication replaces direct frontend invalidation", // InvalidateCompileEnv, retires in -
|
|
"transport OnGlError posts an event before the legacy frontend-error-queue arm", // RecordError, retires in -
|
|
};
|
|
|
|
// CONTRACT-P5.md section 3: "70 rows, each in exactly one class".
|
|
inline constexpr SizeT kMGPipeFieldOwnershipRowCount =
|
|
kMGPipeInputFieldCount + kMGPipeFieldOwnershipForwardCount;
|
|
static_assert(kMGPipeFieldOwnershipRowCount == 70, "table 2's row count moved");
|
|
|
|
// An ARGUMENT-KEYED narrowing of one field. The field keeps its single row above; this
|
|
// says that one argument value of it belongs to a different class. Coverage.def's comment on the
|
|
// GetBufferBindingSlot row already rules the shape - "The field is one array, so it stays one
|
|
// row" - and m_pixelStore[2] is the same shape indexed by its own isUnpack argument.
|
|
struct MGPipeFieldArgumentOwnership {
|
|
MGPipeInputField Field;
|
|
Uint32 Arg0;
|
|
MGPipeFieldOwnership Class;
|
|
};
|
|
inline constexpr SizeT kMGPipeFieldArgumentOwnershipCount = 1;
|
|
inline constexpr MGPipeFieldArgumentOwnership
|
|
kMGPipeFieldArgumentOwnership[kMGPipeFieldArgumentOwnershipCount] = {
|
|
{MGPipeInputField::GetPixelStoreParameters, 1u, MGPipeFieldOwnership::kFatal}, // the unpack half has no carrier AND no backend reader; all six gPipeInputs sites pass false
|
|
};
|
|
|
|
constexpr MGPipeFieldOwnership MGPipeFieldOwnershipOf(MGPipeInputField field) {
|
|
return kMGPipeFieldOwnership[static_cast<SizeT>(field)];
|
|
}
|
|
|
|
// The same answer, narrowed by the accessor's first argument. Every accessor that takes one
|
|
// may call this; only the fields with a row above answer differently from the field's class.
|
|
constexpr MGPipeFieldOwnership MGPipeFieldOwnershipOf(MGPipeInputField field, Uint32 arg0) {
|
|
for (SizeT i = 0; i < kMGPipeFieldArgumentOwnershipCount; ++i) {
|
|
if (kMGPipeFieldArgumentOwnership[i].Field == field &&
|
|
kMGPipeFieldArgumentOwnership[i].Arg0 == arg0) {
|
|
return kMGPipeFieldArgumentOwnership[i].Class;
|
|
}
|
|
}
|
|
return MGPipeFieldOwnershipOf(field);
|
|
}
|
|
|
|
constexpr const char* MGPipeFieldOwnershipName(MGPipeFieldOwnership ownership) {
|
|
return kMGPipeFieldOwnershipNames[static_cast<SizeT>(ownership)];
|
|
}
|
|
|
|
// THE BUILD FAILURE R-7.1 ASKS FOR. The generator refuses to emit an unclassified row, so
|
|
// this can only fire on a hand-edited header - which is exactly the edit the DO NOT EDIT
|
|
// banner cannot prevent on its own.
|
|
constexpr Bool MGPipeEveryFieldIsClassified() {
|
|
for (SizeT i = 0; i < kMGPipeInputFieldCount; ++i) {
|
|
if (kMGPipeFieldOwnership[i] == MGPipeFieldOwnership::kUnclassified) return false;
|
|
}
|
|
for (SizeT i = 0; i < kMGPipeFieldOwnershipForwardCount; ++i) {
|
|
if (kMGPipeFieldOwnershipForward[i] == MGPipeFieldOwnership::kUnclassified) return false;
|
|
}
|
|
return true;
|
|
}
|
|
static_assert(MGPipeEveryFieldIsClassified(),
|
|
"a PipeInputs field is in none of the four ownership classes (CONTRACT-P5 table 2, R-7.1)");
|
|
|
|
// WHERE THE SERVER STAMPS. The wire's op and the fill's verb are different name spaces
|
|
// and do not line up by name (draw_vbo is DrawArrays, blit is BlitFramebuffer), so this is the
|
|
// join. An op with no row is NOT a verb boundary and the applier must not stamp on it.
|
|
//
|
|
// EVERY VERB-SHAPED CALL IS ANSWERED HERE OR EXEMPTED BY NAME, and the generator refuses an
|
|
// omission: a verb-shaped record with no row would apply under the PREVIOUS verb's serial,
|
|
// mask and name, so a field inside that mask would read FRESH while holding the previous
|
|
// verb's value - the one silent failure this table has. The exemptions:
|
|
// Flush not a verb at all: the verb census (BRIEF §12 C-3) found Flush is not a GLFunctionsTable
|
|
// Present Present and SetSwapInterval go through BackendObject virtuals and
|
|
// SetSwapInterval not a verb for the same reason as Present, and it is class C besides
|
|
constexpr MGPipeVerb MGPipeVerbForWireOp(MGPWireOp op) {
|
|
switch (op) {
|
|
case MGPWireOp::Clear: return MGPipeVerb::Clear;
|
|
case MGPWireOp::DrawVbo: return MGPipeVerb::DrawArrays;
|
|
case MGPWireOp::ReadPixels: return MGPipeVerb::ReadPixels;
|
|
case MGPWireOp::Blit: return MGPipeVerb::BlitFramebuffer;
|
|
case MGPWireOp::LaunchGrid: return MGPipeVerb::DispatchCompute;
|
|
case MGPWireOp::MemoryBarrier: return MGPipeVerb::MemoryBarrier;
|
|
case MGPWireOp::BeginStreamOutput: return MGPipeVerb::BeginTransformFeedback;
|
|
case MGPWireOp::EndStreamOutput: return MGPipeVerb::EndTransformFeedback;
|
|
case MGPWireOp::PauseStreamOutput: return MGPipeVerb::PauseTransformFeedback;
|
|
case MGPWireOp::ResumeStreamOutput: return MGPipeVerb::ResumeTransformFeedback;
|
|
case MGPWireOp::GenerateMipmap: return MGPipeVerb::GenerateMipmap;
|
|
case MGPWireOp::GetTextureImage: return MGPipeVerb::GetTextureImage;
|
|
case MGPWireOp::ResourceCopyRegion: return MGPipeVerb::CopyImageSubData;
|
|
case MGPWireOp::BindShaderImage: return MGPipeVerb::BindImageTexture;
|
|
case MGPWireOp::PatchParameter: return MGPipeVerb::PatchParameteri;
|
|
case MGPWireOp::BindStreamOutput: return MGPipeVerb::BindTransformFeedback;
|
|
case MGPWireOp::SetStorageBlockBinding: return MGPipeVerb::ShaderStorageBlockBinding;
|
|
case MGPWireOp::CopyFramebufferToTexture: return MGPipeVerb::CopyTexImage2D;
|
|
case MGPWireOp::FenceCreate: return MGPipeVerb::FenceSync;
|
|
case MGPWireOp::FenceStatus: return MGPipeVerb::GetSyncStatus;
|
|
case MGPWireOp::FenceWait: return MGPipeVerb::ClientWaitSync;
|
|
case MGPWireOp::FenceDestroy: return MGPipeVerb::DeleteSync;
|
|
case MGPWireOp::FenceWaitServer: return MGPipeVerb::WaitSync;
|
|
case MGPWireOp::QueryCreate: return MGPipeVerb::BeginXfbPrimitivesQuery;
|
|
case MGPWireOp::QueryBegin: return MGPipeVerb::BeginXfbPrimitivesQuery;
|
|
case MGPWireOp::QueryEnd: return MGPipeVerb::EndXfbPrimitivesQuery;
|
|
case MGPWireOp::QueryAvailable: return MGPipeVerb::IsQueryResultAvailable;
|
|
case MGPWireOp::QueryResult: return MGPipeVerb::GetQueryResult64;
|
|
case MGPWireOp::QueryDestroy: return MGPipeVerb::DeleteBackendQuery;
|
|
case MGPWireOp::QueryCounter: return MGPipeVerb::QueryCounterTimestamp;
|
|
case MGPWireOp::QueryTimestamp: return MGPipeVerb::GetGpuTimestampNs;
|
|
case MGPWireOp::DeleteStreamOutput: return MGPipeVerb::DeleteTransformFeedback;
|
|
case MGPWireOp::ReadPixelsToBuffer: return MGPipeVerb::ReadPixels;
|
|
case MGPWireOp::GetTextureImageToBuffer: return MGPipeVerb::GetTextureImage;
|
|
default:
|
|
return MGPipeVerb::kVerbCount;
|
|
}
|
|
}
|
|
|
|
inline constexpr SizeT kMGPipeVerbBoundaryOpCount = 34;
|
|
inline constexpr SizeT kMGPipeVerbBoundaryExemptCount = 3;
|
|
|
|
// ---- THE §7 ALLOWLIST, DERIVED RATHER THAN WRITTEN (ID-116) --------------------------
|
|
//
|
|
// CONTRACT-P5E §7 lists the barrier-pulled reads the phase ADMITS: debts that are real, ordered
|
|
// and fresh because the client is parked behind the record, and that a LATER phase retires. It
|
|
// was also kept by hand in .github/workflows/test.yml, and that copy was wrong in both
|
|
// directions at once - it omitted GetFramebufferBindingSlot@ReadPixels, the largest survivor,
|
|
// and carried GetTextureObject@CopyImageSubData, which nothing made safe.
|
|
//
|
|
// THE RULE IS ID-84 SAID IN TABLES THAT ALREADY EXIST. A <field>@<verb> pull is admitted iff
|
|
//
|
|
// 1. the field's ownership row is BARRIER-PULLED - it is a debt and not a defect;
|
|
// 2. the verb's wire op is STATICALLY BARRIERED (kMGPipeWaitClasses[op] != kWaitNone), which
|
|
// is exactly "the client is parked in its own wait for this record", so P5C's semantics
|
|
// survive the flip for it; and
|
|
// 3. the field is inside kMGPipeClassFieldMask[class of the verb] - a field outside the
|
|
// verb's own may-read table was never filled for it, so a read there is stale by
|
|
// construction whatever its ownership row says.
|
|
//
|
|
// Which makes the allowlist move with the code instead of beside it: retiring a verb's wait
|
|
// class NARROWS it with no edit, and a new BARRIER_PULLED row widens it only on verbs that
|
|
// wait. A verb with no stamp row admits nothing - the server stamps only MGP_VERB_OP_LIST's
|
|
// ops, so no other verb can be the one a residual pull is reported against.
|
|
inline constexpr MGPipeFieldMask kMGPipeAdmittedPullMask[kMGPipeVerbCount] = {
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawArrays
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElements
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsBaseVertex
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawArrays
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawElements
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawElementsBaseVertex
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawElementsIndirect
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawArraysIndirect
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawElementsIndirectCount
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MultiDrawArraysIndirectCount
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawRangeElementsBaseVertex
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawRangeElements
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsInstancedBaseVertexBaseInstance
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsInstancedBaseVertex
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsInstancedBaseInstance
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsInstanced
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawArraysInstancedBaseInstance
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawArraysInstanced
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawElementsIndirect
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DrawArraysIndirect
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // Clear
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearBufferfi
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearBufferfv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearBufferuiv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearBufferiv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearNamedFramebufferfv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearNamedFramebufferfi
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearNamedFramebufferiv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClearNamedFramebufferuiv
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BlitFramebuffer
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BlitNamedFramebuffer
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // CopyTexImage2D
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // CopyTexSubImage2D
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // CopyTextureSubImage2D
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // CopyImageSubData
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GenerateMipmap
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GenerateTextureMipmap
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ReadPixels
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetTexImage
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetTextureImage
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DispatchCompute
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DispatchComputeIndirect
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MemoryBarrier
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // MemoryBarrierByRegion
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BindImageTexture
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetIntegeri_v
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ShaderStorageBlockBinding
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // FenceSync
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ClientWaitSync
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // WaitSync
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DeleteSync
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetSyncStatus
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // IsTimerQuerySupported
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BeginTimeElapsedQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // EndTimeElapsedQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // QueryCounterTimestamp
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // IsQueryResultAvailable
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetQueryResult64
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DeleteBackendQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BeginOcclusionQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // EndOcclusionQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BeginXfbPrimitivesQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // EndXfbPrimitivesQuery
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // PatchParameteri
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BeginTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // EndTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // PauseTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // ResumeTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // BindTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // DeleteTransformFeedback
|
|
{{0x0000000000000000ull, 0x0000000000000000ull}}, // GetGpuTimestampNs
|
|
};
|
|
|
|
inline constexpr SizeT kMGPipeAdmittedPullPairCount = 0;
|
|
|
|
// THE PREDICATE THE STRICT KNOB ASKS (ID-117). A 69 x 128-bit table, so this costs a shift and
|
|
// a test on the apply thread - the same shape MGPipeFieldMaskHas already has.
|
|
constexpr Bool MGPipeBarrierPullAdmitted(MGPipeInputField field, MGPipeVerb verb) {
|
|
const SizeT index = static_cast<SizeT>(verb);
|
|
return index < kMGPipeVerbCount && MGPipeFieldMaskHas(kMGPipeAdmittedPullMask[index], field);
|
|
}
|
|
|
|
// THE HAND-EDIT CONTROL, MGPipeEveryFieldIsClassified's shape and for its reason: the generator
|
|
// cannot emit a bit that fails this, so it can only fire on an edited header - which is exactly
|
|
// the edit the DO NOT EDIT banner cannot prevent on its own. An admitted bit that was not a
|
|
// BARRIER-PULLED field of its verb's class would be the allowlist quietly forgiving a read that
|
|
// is torn rather than merely unmigrated.
|
|
constexpr Bool MGPipeEveryAdmittedPullIsADebtOfItsVerbsClass() {
|
|
for (SizeT v = 0; v < kMGPipeVerbCount; ++v) {
|
|
const MGPipeFieldMask& admitted = kMGPipeAdmittedPullMask[v];
|
|
const MGPipeFieldMask& mayRead =
|
|
kMGPipeClassFieldMask[static_cast<SizeT>(kMGPipeVerbClass[v])];
|
|
for (SizeT f = 0; f < kMGPipeInputFieldCount; ++f) {
|
|
const auto field = static_cast<MGPipeInputField>(f);
|
|
if (!MGPipeFieldMaskHas(admitted, field)) continue;
|
|
if (kMGPipeFieldOwnership[f] != MGPipeFieldOwnership::kBarrierPulled) return false;
|
|
if (!MGPipeFieldMaskHas(mayRead, field)) return false;
|
|
}
|
|
}
|
|
return true;
|
|
}
|
|
static_assert(MGPipeEveryAdmittedPullIsADebtOfItsVerbsClass(),
|
|
"an admitted barrier pull is not a BARRIER-PULLED field of its verb's class "
|
|
"(CONTRACT-P5E section 7, ID-84 / ID-116)");
|
|
|
|
// The class sizes, as constants a test can pin without recounting the table.
|
|
inline constexpr SizeT kMGPipeRecordSuppliedFieldCount = 41;
|
|
inline constexpr SizeT kMGPipeApplierDerivedFieldCount = 6;
|
|
inline constexpr SizeT kMGPipeBarrierPulledFieldCount = 0;
|
|
inline constexpr SizeT kMGPipeFatalFieldCount = 16;
|
|
static_assert(kMGPipeRecordSuppliedFieldCount + kMGPipeApplierDerivedFieldCount + kMGPipeBarrierPulledFieldCount + kMGPipeFatalFieldCount == kMGPipeInputFieldCount, "the four class sizes do not partition the field set");
|