From 80a6b3900311b47e18cb92fac28b775cc3193e83 Mon Sep 17 00:00:00 2001 From: Swung0x48 Date: Sun, 6 Sep 2026 05:31:50 -0400 Subject: [PATCH] [Fix] (Pipe): fill the capability set on a texture op and a dispatch, and the shader blit's viewport, provoking vertex and buffer bindings - The verify retrace aborted four cases with Fatal{UnmigratedPipeInput, "IsCapabilityEnabled@GenerateMipmap"} (x3) and "@DispatchCompute" (x1): Magma materialises a texture's queued clear inside both verbs (GenerateMipmap -> MaterializePendingClearForTexture, DispatchCompute -> PrepareStorageImageTextures -> the same), and the clear pre-compensates its colour against GL_FRAMEBUFFER_SRGB in VkClearManager::PreCompensateSrgbClearColor. Neither class named the field. - Audited every class the same way rather than stopping at those two rows. Two more helper-program draws sit inside verbs whose class did not name what they read: GenerateMipmap takes GenerateDepthMipmapWithShader for a depth texture and BlitFramebuffer takes TryBlitToDefaultFramebufferWithShader for the default framebuffer. Both bind their helper's descriptors through BindProgramUniformBuffers, whose sampler resolver reads the draw framebuffer for its feedback-loop check and whose buffer-block resolvers read the frontend binding points; the blit additionally sets the dynamic viewport through ApplyGLViewportState -> ComputeGLViewport and picks its pipeline's provoking vertex through GetOrCreateBlitPipeline -> SelectProvokingVertexMode. - kTextureOp gains IsCapabilityEnabled, GetFramebufferBindingSlot and GetBufferBindingPoint; kDispatch gains IsCapabilityEnabled; kBlitOrCopy gains GetViewportIndexed, GetDepthRangeIndexed, GetProvokingVertexMode and GetBufferBindingPoint. Every row carries the path it was derived from. - Also unfolds the kReadback transform-feedback rows 9087f133 landed on one 1200-column line back into the file's one-row-per-line shape; no row changes. --- MobileGL/MG_Pipe/FillPoints.def | 31 ++++++++++++++++++- MobileGL/MG_Pipe/generated/PipeFillPoints.inc | 12 +++---- 2 files changed, 36 insertions(+), 7 deletions(-) diff --git a/MobileGL/MG_Pipe/FillPoints.def b/MobileGL/MG_Pipe/FillPoints.def index e66bff85..b71a9b4c 100644 --- a/MobileGL/MG_Pipe/FillPoints.def +++ b/MobileGL/MG_Pipe/FillPoints.def @@ -173,6 +173,10 @@ X(kDispatch, GetSamplingResolutionGeneration) \ X(kDispatch, GetImageTextureBinding) \ X(kDispatch, GetFramebufferBindingSlot) \ + /* Magma's PrepareStorageImageTextures materialises a queued clear for every */ \ + /* storage image the dispatch writes, and the clear pre-compensates its colour */ \ + /* against GL_FRAMEBUFFER_SRGB (VkClearManager::PreCompensateSrgbClearColor). */ \ + X(kDispatch, IsCapabilityEnabled) \ X(kDispatch, GetPatchVertices) \ X(kDispatch, GetPatchDefaultOuterLevel) \ X(kDispatch, GetPatchDefaultInnerLevel) \ @@ -214,6 +218,17 @@ X(kBlitOrCopy, GetColorMaskIndexed) \ X(kBlitOrCopy, GetDepthMask) \ X(kBlitOrCopy, GetStencilState) \ + /* Magma's shader blit to the default framebuffer */ \ + /* (TryBlitToDefaultFramebufferWithShader) is a real draw of a backend-owned */ \ + /* helper program: it sets the dynamic viewport through ApplyGLViewportState */ \ + /* -> ComputeGLViewport (viewport 0 and its depth range), picks the pipeline's */ \ + /* provoking vertex through GetOrCreateBlitPipeline -> SelectProvokingVertexMode, */ \ + /* and binds the helper's descriptors through BindProgramUniformBuffers, whose */ \ + /* buffer-block resolvers read the frontend binding points. */ \ + X(kBlitOrCopy, GetViewportIndexed) \ + X(kBlitOrCopy, GetDepthRangeIndexed) \ + X(kBlitOrCopy, GetProvokingVertexMode) \ + X(kBlitOrCopy, GetBufferBindingPoint) \ /* kTextureOp */ \ X(kTextureOp, GetActiveTextureUnit) \ X(kTextureOp, GetTextureUnitObject) \ @@ -222,6 +237,15 @@ X(kTextureOp, GetSamplingResolutionGeneration) \ X(kTextureOp, GetTextureBindGeneration) \ X(kTextureOp, GetMaxTouchedTextureUnit) \ + /* Magma's GenerateMipmap materialises the texture's queued clear before it */ \ + /* blits (MaterializePendingClearForTexture -> PreCompensateSrgbClearColor, */ \ + /* which reads GL_FRAMEBUFFER_SRGB), and a depth texture takes the shader path */ \ + /* (GenerateDepthMipmapWithShader -> BindProgramUniformBuffers), whose sampler */ \ + /* resolver reads the draw framebuffer for the feedback-loop check and whose */ \ + /* buffer-block resolvers read the frontend binding points. */ \ + X(kTextureOp, IsCapabilityEnabled) \ + X(kTextureOp, GetFramebufferBindingSlot) \ + X(kTextureOp, GetBufferBindingPoint) \ /* kReadback */ \ X(kReadback, GetPixelStoreParameters) \ X(kReadback, GetBufferBindingSlot) \ @@ -237,7 +261,12 @@ X(kReadback, GetSamplingResolutionGeneration) \ X(kReadback, GetTextureBindGeneration) \ X(kReadback, GetMaxTouchedTextureUnit) \ - X(kReadback, GetImageTextureBinding) /* The depth/stencil read emulation draws (ScopedEmulationDrawState, */ /* DirectGLES.cpp:5224) and pauses an active capture around its own draw, so */ /* a readback reads the transform-feedback state exactly as a draw does. */ X(kReadback, IsTransformFeedbackActive) X(kReadback, IsTransformFeedbackPaused) \ + X(kReadback, GetImageTextureBinding) \ + /* The depth/stencil read emulation draws (ScopedEmulationDrawState, */ \ + /* DirectGLES.cpp) and pauses an active capture around its own draw, so a */ \ + /* readback reads the transform-feedback state exactly as a draw does. */ \ + X(kReadback, IsTransformFeedbackActive) \ + X(kReadback, IsTransformFeedbackPaused) \ /* kXfbSpan */ \ X(kXfbSpan, GetTransformFeedbackProgram) \ X(kXfbSpan, GetBufferBindingPoint) \ diff --git a/MobileGL/MG_Pipe/generated/PipeFillPoints.inc b/MobileGL/MG_Pipe/generated/PipeFillPoints.inc index 41c6c2f0..1512f363 100644 --- a/MobileGL/MG_Pipe/generated/PipeFillPoints.inc +++ b/MobileGL/MG_Pipe/generated/PipeFillPoints.inc @@ -279,14 +279,14 @@ inline constexpr Bool MGPipeFieldMaskHas(const MGPipeFieldMask& mask, MGPipeInpu inline constexpr MGPipeFieldMask kMGPipeClassFieldMask[kMGPipeVerbClassCount] = { // kDraw: 54 fields (47 own + 7 sticky) {{0x7ffbfff7bfffc3eeull, 0x0000000000000000ull}}, - // kDispatch: 21 fields (14 own + 7 sticky) - {{0x5c00f2281d3003c0ull, 0x0000000000000000ull}}, + // kDispatch: 22 fields (15 own + 7 sticky) + {{0x5c40f2281d3003c0ull, 0x0000000000000000ull}}, // kClear: 25 fields (18 own + 7 sticky) {{0x5c50ffa001347900ull, 0x0000000000000000ull}}, - // kBlitOrCopy: 25 fields (18 own + 7 sticky) - {{0x5f50ffa001344101ull, 0x0000000000000000ull}}, - // kTextureOp: 14 fields (7 own + 7 sticky) - {{0x5c00f22001200101ull, 0x0000000000000000ull}}, + // kBlitOrCopy: 29 fields (22 own + 7 sticky) + {{0x5f70ffe0013c4181ull, 0x0000000000000000ull}}, + // kTextureOp: 17 fields (10 own + 7 sticky) + {{0x5c40f22001300181ull, 0x0000000000000000ull}}, // kReadback: 24 fields (17 own + 7 sticky) {{0x5f50f3a041300541ull, 0x0000000000000000ull}}, // kXfbSpan: 15 fields (8 own + 7 sticky)