Repository navigation
iOS 27 camera, display side: the memoryless fetch is right; the preview reaches backboardd's framebuffer and goes to the display as its own layer (diagnostics) - #418
Draft
claudiusthebot wants to merge 3 commits into
Conversation
… preview, and note CoreAnimation's draw of it Diagnostics in the Metal frontend, all off unless set in /var/local/mtl2-env: - SWEET_MTL2_YCCPROBE=1 (YCbCrProbe.h/.metal): at bindings of a converted two-plane YCbCr texture (formats 500-510), read an 8x8 grid on the process's own GPU (compute read, linear and nearest samples; fragment-stage half samples from slot 3, linear and nearest) beside the processor's read of the surface. - SWEET_MTL2_DRAWNOTE=1 (DrawNote.h): once per pipeline, the full state of a draw that samples such a texture (fragment function, attachments, blending, samplers, fragment bytes, first vertex floats). - SWEET_MTL2_YCCFLAT=1: a test switch that binds a BGRA8 copy of such a texture instead. Run on phone 1 (24 Nov, D1-D7): the texture reads the picture in every mode; with the BGRA8 copy the viewfinder is still black. CoreAnimation draws the camera into a memoryless color attachment (TimgA3S1Xhfu_Ixrg) and composites it later in the pass; that is the next place to measure. docs/ios27/CAMERA.md, 'The display side'. The frontend's size allowance goes from 2767 to 2777 lines for the three hooks.
… (no pass split, no notice)
…ttachment is right on PanVK; the steady preview is drawn into backboardd's framebuffer and handed to the display as a layer of its own FetchProbe.h/.metal (SWEET_MTL2_FBPROBE=1/2/3, off by default): a self-test of a draw that writes a memoryless RGBA16Float color 1 read back by framebuffer fetch (right on phone 1), a stored shadow of the main pass's color 1 during a camera session (empty on steady frames), and a read of color 0's surface after the steady camera draw (holds the picture). DrawNote.h modes 2 and 3. docs/ios27/CAMERA.md: the measurements, and the display layer (SweetFramebuffer SwapEnd) as the next place.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Builds on #416 (its two commits are under this one). Diagnostics only, all off unless set in
/var/local/mtl2-env. Draft: nothing here fixes the viewfinder; it moves the search out of the Metal layer.Measured on phone 1 (iOS 27.2.1, kernel k1 +
cam_trace=1 cam_metal=1, root as handed back + this StarbiteMetal), 24 November:SWEET_MTL2_FBPROBE=1: framebuffer fetch through a memorylessRGBA16Floatcolor 1 (written by a draw with color 0 masked off, then read by[[color(1)]]into color 0) is exact on PanVK/Mali-G72 (B G R 191 128 64). Private color 1, two attachments, clear + fetch, and self-fetch of color 0 are right too. Mechanism: metal2vulkan's input attachments withVK_EXT_rasterization_order_attachment_access(PanVK v6 has it throughmesa26-panvk-ios.patch), lowered toLD_TILEfrom the tile buffer.SWEET_MTL2_FBPROBE=2: in a camera session the 828x1702 main pass's color 1, made a stored private texture, is empty in all 20 reads. TheS1draws into color 1 belong to the flip animation, not steady frames. The_Isupinputs are a sampled backdrop texture, not color 1.SWEET_MTL2_FBPROBE=3: the steady preview draw (TimgA3Xhf_Ixrg, format 500 texture over the sink's surfaces) puts the picture into backboardd's framebuffer surface (viewfinder RGB 16-21, 10-17 of 64 lit; sink luma mean 21 in that dim room). The screen at the same moment is 0 over the viewfinder.layer 2 surface 284 at 0,0 828x1702: surface 284 is a420fsink surface. backboardd hands the preview to the display as its own layer. SwapEnd (SweetFramebuffer.cppin the xnu fork) copies and blends 4-byte BGRA layers only (read in the code).Next: the display path (what SwapEnd gets for the preview layer, and a YCbCr layer there), not the Metal layer. The
.mmedits keep it at its size allowance. The last refactor (FetchProbe.h included from DrawNote.h, the constants read through the existing property) was built but not booted; the logic booted as builds F1-F5. Notes:~/s9/agents/fbfetch-1124/NOTES.mdon the mini.