Repository navigation
docs(blog): follow one RGB triangle through the PS3 and WebGL pipelines - #309
Merged
Merged
Conversation
Section 02 of the PS3 post now draws the triangle it talks about: red, green and blue corners, at each stage as what it is there. An overview of the five stages (84 bytes, three vertices, two uniforms, 259,200 pixels, a frame on the TV), each with who carries it on in a browser and on a PS3, then a figure per stage before its code: 1. the 84 bytes, little-endian in a browser and big-endian on the Cell, and where they go (the driver's memory, or GDDR3 at vb_off) 2. three points in clip space; one pool of unified cores against 8 vertex units and 24 pixel pipelines, and how each program reaches them 3. the colours times uTint; uMVP as four registers, uTint as 16 bytes inside the fragment program in VRAM 4. the 1080p surface in 40-pixel squares, lit in their centre pixels' colours. Point at one to follow it: weights, vColor, times uTint, then readPixels's RGBA bytes from the bottom row up beside the A8R8G8B8 word at fb + y * 7680 + x * 4. The viewport's Y scale toggles, so +540 shows the triangle upside down. 5. two colour buffers and the flip, beside the canvas and the compositor The figures are static HTML and SVG; only stage 4's readout and toggle use script. Stage 4's code also binds the colour attribute now (COLOR0, v[3], 12 bytes in), which the vertex program reads. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Section 02 of the PS3 post (
site/blog/ps3/) now draws the triangle it talks about: red, green and blue corners, shown at each stage as what it is there, with who carries it to the next stage in a browser and on a PS3.The figures
Float32Arraygoing to the driver's memory, besidememcpy+eieiointo GDDR3 atvb_offand the cache flush.c[0..3], uTint as the 16 bytes at+0x10inside the fragment program.readPixels's RGBA bytes (rows counted from the bottom) beside the A8R8G8B8 word atfb + y × 7680 + x × 4. A toggle switches the viewport'sscale.ybetween −540 and +540; +540 draws the triangle upside down.Stage 4's code now also binds the colour attribute (
GCM_VERTEX_ATTRIB_COLOR0,v[3], 12 bytes in, as PocketJS'srsx_driver.cdoes), which the vertex program reads.The figures are static HTML and SVG, so they render without script. The RGB fill is three gradients blended with
screen, one channel each, which gives exact interpolation; the pixel squares were computed with the same arithmetic the page's script uses. Only stage 4's readout and toggle use script.Checked in Chrome at 1440 and 390 px wide;
bun site/tools/build.tsbuilds.🤖 Generated with Claude Code