Render
The render system draws each frame and presents it to the screen. This page covers the per-frame render update and the objects it walks, the pacing of each present, the first pieces of the YEBIS post-processing middleware, and the GPU helper library compiled into the game: its command writers, state setters, shader-stage wrappers (geometry shaders included), swap chain and shader uploads, and how they now report to Paleblood's renderer.
At a glance
- Scope
render_frame_update_02377bd0and its list and object helpers,render_swap_chain_present, three YEBIS functions, and the GPU helper library's command writers, state setters, shader-stage wrappers, swap chain and shader uploads.- Verified
- All three: the reference-counted object list, the vblank pacing of the present, and the blur sample counts.
- Open
- What kinds of object the per-frame list holds and what the two children are; the engine's own drawing code above the GPU library, materials, and most of YEBIS. Many GPU library functions are mapped and edge-verified, none yet on recorded game frames; they tell Paleblood's renderer what they set.
Summary
The per-frame update
render_frame_update_02377bd0 (0x02377bd0) runs once a frame:
- It walks a list of reference-counted objects and updates each one.
- An object whose update says it is finished loses its reference (destroyed at the last one; an underflow is reported as "DLReferenceCountObject: Invalid Unref() call"), and its node is unlinked and freed.
- It updates a
RendMan-side child (RendMan: singleton0x05940298). - It steps another child by a frame time of 1/30 s, or 0 while that child is held.
Several of its helpers are replaced and edge-verified, all by @FFwLo (#969 unless noted):
- Updating one object.
render_object_update_02373850(0x02373850) first refreshes the object's visible flag: from the owner's query when the object asks for that, otherwise by comparing the object's two masks against a view's (the owner's, else the render manager's, else defaults). Then it runs the object's life cycle: an idle object starts, a running one is updated with the frame step, and a finishing one finishes. A finish or notify request skips the start; a notify request hands the object a one-entry parameter set. It answers false once the object is done, and the frame update drops it. - Moving list nodes.
render_list_prepare_02379d60(0x02379d60) is the engine list's splice: it moves a range of another list's nodes in front of a position in this one. When both lists draw from the same heap the nodes are simply relinked; otherwise each value is copied into a new node and the old range is freed. A size past the list's maximum throws the engine's length error. - Notify parameters. The parameter set handed over by a notify request is a sorted table of
keys and values.
render_set_parameter_02c51f60(0x02c51f60) finds a key by binary search and stores its value only when the key is present;render_clear_parameter_set_02c51fc0(0x02c51fc0) frees the table (#1007).
Pacing the present
render_swap_chain_present (0x025b2fb0, the graphics framework's GXSwapChainCtrl) paces
each present:
- It waits until the requested number of 60 Hz vblanks has passed since the last present. It sleeps until 17 ms before that time, then polls the clock.
- It maps the interval to a flip mode.
- It presents.
In Iosefka's Clinic the game presents with interval 1 and does not wait here; the frame limiter sets the pace.
Blur sampling (YEBIS)
render_yebis_get_recursive_sample_parameters (0x00fbc3e0) belongs to YEBIS, the
post-processing middleware. Its GPUTexUtil_GetRecursiveSampleParameters works out:
- how many recursive passes a blur needs;
- how many samples the last one takes;
- how far apart the first one samples.
It carries the middleware's own assertions.
Two pieces of the middleware's set-up are replaced and edge-verified, by @evill33t:
- Creating a context.
render_yebis_context_instantiate(0x00fb4ac0, YEBIS'sIPfxContext::Instantiate) asks the current allocator for a 0x178-byte context (passing the source location the allocator records), initialises its base, installs the context's vtable, builds the small GNM adapter object it embeds at+0x18, and returns the new context. Like the original, it does not check for a failed allocation (#1130, 135 cases). - The interface base.
render_yebis_initialize_interface(0x00fb6d20) sets up the base every YEBIS interface object shares: its vtable, a reference count of one and an empty instance pointer, leaving the rest of the object untouched (#1134, 41 cases).
The post-processing effects themselves are not mapped yet.
Scope still to map: the engine's draw submission above the GPU library, materials and post-processing.
The game's shaders ship as compiled AMD GPU code in its shader bundles. A census tool in the code repository decodes the shaders in your own copy and counts the instructions they use, for Paleblood's shader translator (Paleblood #316). It prints counts only; no shader code leaves your machine.
Writing GPU commands and presenting
The engine builds the GPU's command buffers itself (see Runtime syscalls), as AMD "PM4" packets: each packet is a header word naming the operation, followed by its arguments. The first of the engine's own packet writers are mapped, all by @evill33t:
- The command buffer. One shared structure describes it: where it begins and ends, the
cursor where the next word goes, and a callback the engine calls to get more room when it runs
out.
render_command_prepare_submission(0x014784a0) reserves 64 words before a submission, andrender_command_emit_counter_operation(0x01477b30) writes a seven-word packet that makes the GPU wait on a value in memory (PM4WAIT_REG_MEM) (#208). - The pool counter.
render_read_present_pool_counter(0x0247eb80) reads a 64-bit counter atomically, with a locked compare-and-exchange loop (#279). - Present records.
render_present_record_consume(0x02ab5a70) turns a pending present record into commands: it classifies the record, clamps its range, copies its payload and writes the final fields (#286). - Building present records.
render_build_present_source_record(0x0256e1d0) builds the record for a present, by mode, keeping partial output, unsigned divisions and the packed auxiliary requirements as the original does;render_choose_record_constructor_selector(0x02ab7a20),render_combine_record_parameters(0x02ab7ab0) andrender_reduce_record_parameter(0x02ab7e40, a four-entry scale table, zero past its end) pick and combine its constructor choices (#473, from #268; edge-verified on synthetic cases). - A record test.
render_record_auxiliary_predicate(0x02abb4f0) answers yes or no for a record's selector: always yes for two selector values, a flag bit for the next two, no otherwise (#293, from #266). - Presenting a swap-chain image.
render_swap_chain_present_mode(0x02ad5dd0) waits until the display has flipped far enough and picks the flip mode, andrender_swap_chain_submit(0x02ad6e50) submits the frame, advances the frame counter and checks its owner again (#287). They use the public layouts of the video-out flip status and kernel events. - Depth and stencil clears.
render_emit_present_preparation_scalar(0x01473590) andrender_emit_present_preparation_byte(0x014735f0) write the depth and stencil clear values (AMD'sDB_DEPTH_CLEARandDB_STENCIL_CLEARregisters) #325, from #210. - The last record's depth settings.
render_emit_present_last_record_packet(0x014769e0) writesDB_RENDER_CONTROL. Two setters turn its depth and stencil compression off or on (0x01485070,0x01485080), one replaces two packed indices (0x014721d0), andrender_reset_present_preparation_dirty(0x02ad2c30) writes only the clear values that changed and remembers them #326, from #211. - Resource records. A record describes a GPU resource's layout. The reviews tie its fields to AMD's public tiling and format fields, though the full meaning is still open. The mapped parts:
- mapping:
render_pack_record_mapping_word(0x01471310) packs its mapping word andrender_read_record_mapping_word(0x01486cf0) reads one back #321, from #212; - encoding: three lookups decode the encoding byte's metadata, component arrangement and
category (
0x01471730,0x014717a0,0x014719a0), andrender_record_set_encoding(0x01486540) stores it #327, from #261; - parameters:
render_record_apply_parameter_tuple(0x0149c850) picks a record parameter from a normalisation table, with its classification helpers (0x0149e900–0x0149ea70) #322, from #223; - sizes:
render_calculate_second_auxiliary(0x0149e570) works out the size and alignment of a second auxiliary area #323, from #228; - fields: seven setters (
0x01486520–0x01486800) replace one field each, keeping the rest of the word #324, from #236; - construction:
render_record_constructor(0x01485f90) clears a record's 44-byte prefix and fills in the record and its auxiliary outputs, returning a packed 64-bit result;render_record_constructor_pack_pair(0x01471600) packs a selector pair into an encoding, and two optional steps (0x0149e2d0,0x0149e400) align paired components and work out the geometry, writing their outputs even when a helper reports an error #478, from #246 (edge-verified on synthetic cases); - normalisation:
render_record_normalize_mode2,…mode3and…mode4(0x025710a0,0x025711d0,0x02571340) bring a record's input into one normalised form, copying the words they do not interpret unchanged and keeping each helper's writes and failure codes in order, andrender_record_translate_selector(0x02ab7310) maps a record selector to one output word, answering status 12 for a selector it does not support #249 (edge-verified on synthetic cases).
Setting GPU state and drawing
The GPU helper library keeps no state of its own: each setter writes its value straight into the command buffer as a register packet, and the GPU reads it from there. A large group of setters and draw writers was mapped and replaced by @evill33t, each verified to write exactly the original packets:
- Blending and colour output #411 (from #233):
render_set_cb_blend_control(0x01473090, one colour buffer's blend equation,CB_BLENDn_CONTROL),render_set_cb_color_control(0x01473320, the colour output mode and raster operation,CB_COLOR_CONTROL) andrender_set_cb_target_mask(0x01472fd0, which colour components each target writes,CB_TARGET_MASK). - Depth and stencil #411:
render_set_db_depth_control(0x014733a0, the depth and stencil tests and writes) andrender_set_db_stencil_control(0x01473400, the front- and back-face stencil operations). - What is drawn #411:
render_set_vgt_primitive_type(0x01473fe0, triangles, strips, rectangles and so on),render_emit_num_instances(0x01475370, how many copies a draw makes),render_emit_draw_index_auto(0x014741b0, a draw of consecutive vertices) andrender_emit_event_write(0x01475da0, a GPU event such as a cache flush), with two record helpers (0x01485390,0x014853f0) and the one call that asks the system whether the GPU's performance-analysis mode is on (0x01489c40). - Where on screen #364 (from #232):
render_configure_viewport(0x014765e0, the viewport's scale, offset and depth range),render_configure_screen_scissor(0x01476790),render_set_screen_offset(0x01473650), the guard-band clip and discard adjustments (0x014736d0,0x01473750) and the viewport-transform controls (0x01476980,0x01485220). - A present's context section #365 (from #231):
render_emit_present_context_section(0x01472870) reserves room and writes the context registers a present needs.
Command buffers, swap chain and shader uploads
- Command buffers #360 (from #256):
render_command_buffer_init(0x01471270) sets up a command buffer's pointers and its "need more room" callback.render_command_submit_batch(0x02ab0ce0),render_command_submit_snapshot(0x02ab0e30) andrender_command_submit_present(0x02aafb30) hand finished regions to the system's submit call, with the waits the GPU needs. The room check that every packet writer makes before writing is now shared code #291. - The swap chain #361 (from #254):
render_setup_swap_chain(0x02ad5e90) allocates and registers the swap chain's frame buffers with video out and sets up its cached resource data and tone curves; two cleanups release the curve and the cached record (0x02571c60,0x02572290, #359, from #244). The set-up's object creation (0x0247c4e0) is a short forwarder to the owner's allocator (#789), and its resource set-up copies each texture level's initial data withrender_copy_initial_level_014a3410(0x014a3410), measuring block-compressed formats in 4x4 blocks (#969); both by @FFwLo. - The last present record #354 (from #260):
render_present_last_record_consume(0x02ab6810) consumes the final record of a present, or only updates its tracking when the commands do not fit. - Shaders #263, #363 (from #251):
render_flush_shader_preparation(0x02ab9850) flushes a pending barrier before a shader event, andrender_allocate_shader_upload(0x02aaddc0) finds room of at most 64 KiB for a shader's code, reclaiming once if none is free. - Resource descriptors #357 (from #255), #358 (from #222): the records that
describe a texture's layout, its mip levels and their offsets (
0x014a1e80,0x014a2c40), its encoding (0x014712d0,0x01471770,0x01489910-0x01489960) and its tiling (0x0149cc60, which converts a tile-mode table index), and how its parameters are derived (0x02abaf10,0x0149cb30).
Render targets, descriptors and the present path (10 November)
Forty-five more of the library's functions were replaced on 10 November, all
@evill33t's work, brought up to date with main and merged as
#482, #485, #486, #487 and the batch #489:
- Render targets #489:
render_set_render_target(0x014738b0) writes a colour target's register block, or switches the target off when there is no descriptor;render_set_depth_render_target(0x014739b0) does the same for the depth target.render_restore_color_target_from_bankandrender_restore_depth_target_from_bank(0x02ad1e30,0x02ad1e70) put a saved target back from one of two banks, andrender_present_slot_emit(0x01473840) writes a colour target's two clear words. - Rasterizer state #489:
render_configure_viewport_and_guard_band(0x01496f60) sets the viewport and the guard band, the region outside the screen where triangles are kept rather than clipped;render_set_pa_sc_mode_cntl_0(0x01477150) switches multisampling and the viewport scissor. - Linking shaders #489:
render_build_shader_link_words(0x014873a0) matches a vertex shader's outputs to a pixel shader's inputs and builds the words that connect them;render_emit_shader_link_words(0x01475000) writes them.render_configure_record_shader, its secondary path andrender_finish_record_shader(0x02ace1e0,0x02ace5e0,0x02acfc20) set up and finish a recorded shader's state. - Descriptor geometry #482, #485, #486, #489 (from #237, #247, #238): building a
resource descriptor and the requirements it adds up (
render_prepare_resource_descriptor,0x02fa6af0), the two- and three-part record descriptors and their size (0x01487ee0,0x01488590,0x01488370,0x014a27c0,0x01471a40), converting a constructor's record (0x01488d90), andrender_record_geometry(0x0149ce10) with its helpers (0x0149c4e0-0x0149ed30), which work out an image's dimensions and alignment for the record constructor. - The swap chain's resources #487, #489 (from #245):
render_initialize_swap_chain_resource(0x02565f90) checks a frame buffer's parameters, prepares its storage and wraps it;render_prepare_swap_chain_resource_info(0x02571d60) allocates that storage and publishes its descriptor. - Finishing a present #489: the chain that closes a frame's command lists and hands them on.
render_finish_present_commands(0x02aaf700) finishes pending lists and submits the pending snapshot when there is room (render_submit_present_finish_snapshot,0x02ab0b00;render_managed_present_capacity,0x02aaf030); a pool of present buffers is claimed and released (0x02ad3b80,0x02ad3c80,0x02ad3d40,0x02aaa5a0); the release packets that tell the GPU a buffer may be reused are written (0x014778f0,0x02abb6d0); and the present's sources are prepared and their state flushed (0x02ad1eb0,0x02ad1f80), with the encoding helpers0x02564ed0and0x02565130and the context finisher0x02568530. - Resetting a present's context #557 (from #257, 11 November): five finishers put a
present's context back to its starting state.
render_reset_present_context_preparation(0x02ad2d20) resets both nine-entry banks of preparation records and the state around them;render_prepare_present_context_scratch(0x02ad3070) prepares the live bank's changed records before the present finishes, reloading the bank on every pass;render_reset_present_context_shader_state(0x02acd190) clears the conditional-command flag and refills the shader state, keeping the invalid-value markers between fills; and two small resets (0x02abba10,0x02ad3300) set one embedded state block to zero and that marker, leaving padding and a shared scalar's bits as they were. What each bank's records stand for is still open.
Wind on models
render_update_model_wind (0x02713870) gives each model its wind, which the grass
and tree shaders read as WindForceAndTime and PointWindForce. Every model draw calls it
(0x0216f9d0, 0x02124660). For the model's wind receiver it:
- ages the influences it keeps: each fades out over its last 0.75 s while its wave time advances by the wind step;
- copies the live influences, up to four in each of two lists, to the output;
- samples every attached wind source: a base speed, a gust from fractal noise, and a direction turned by noisy angles;
- adds or refreshes that source's influence, ramping it in over 0.1 s. Kinds 0 and 3 go to the first list, which keeps the strongest four once full.
It was the last function on the list of frame-rate-patched functions in issue #32, now closed
(#568, 11 November). The patches point its three 1/30 s step loads at their own frame-time cell
and rewrite one to use the measured frame time; BB_TARGET_FPS does the same in code
(see The frame limiter). Three quirks of the original are kept:
three stale stack bytes copied into every influence, a failed lookup keeping the previous source's
jitter, gust and cycle values, and a hold flag that zeroes the step for every later source. What
each source kind stands for is still open.
How the wind update was verified
Edge-verified: 120 constructed cases pass against the original stock and with the pinned
community patch file for 30 FPS++, 60 FPS++ and Uncap FPS++ (each run with the matching
BB_TARGET_FPS); 109 of the original's 125 branches were seen both ways, and every
non-equivalent one of 70 deliberate mutants fails in at least one mode. A separate review
session that did not write the code requested changes, then approved the fixes. It becomes
verified once recordings from the game exist.
More GPU library replacements (13 November)
Contributor @FFwLo replaced functions that earlier replacements still
called as originals, all edge-verified: three shader packet writers, among them the pixel shader
setter (#769); the two cache-coherence packets (ACQUIRE_MEM) that shader preparation emits
(#770); the two selector translations of the command record's normalization, which sort a
selector code into one of three groups (#779); four small queries of the swap chain's resource
info (#784); and the block manager of the shader upload arena, which tiles its memory with
range records kept in address order with a free list (#794). The fractal noise that the
model wind samples for its gusts and its jittered direction (0x02a85e30) is
replaced too, with results compared bit for bit (#792); the base noise under it stays
original.
He also replaced three steps around command submission, all edge-verified:
render_submit_pending_commands_02aafa00 (0x02aafa00), which the present calls when a GPU reset
was requested, hands the commands written so far to the snapshot submitter and starts the next
region at the cursor; with too little room for its counter wait it submits nothing
(#880). The two steps that end the swap
chain's resource processing write a completion label, a release-memory packet that stores the next
value of a shared counter (skipping one reserved value), and submit the pending packets as one range
(0x02ab1930, 0x02ab18c0, #811). And six
shader register writers are replaced
(#777): the shader-stage setter
(0x01476030, which writes VGT_SHADER_STAGES_EN only for the five modes the game uses), and the
writers that put a 16- or 32-byte descriptor, a sampler, a 64-bit address or one word into a
stage's user-data registers (0x014761a0, 0x01476240, 0x014762f0, 0x01476390, 0x01476420).
Shader stages and more register writers (13 to 15 November)
The GPU has separate shader stages: vertex, pixel and compute, plus the optional local, hull and export stages that tessellation uses and a geometry stage that can make new primitives. The library sets each one up with a small wrapper that reserves room in the command buffer, hands the shader's registers to the console's GNM library to write, and moves the cursor on only when that call succeeds. @evill33t replaced a large set of these wrappers and single-register writers, all edge-verified; the register names come from AMD's public register definitions, while what values the game passes in play is still open:
- Shader-stage wrappers: the compute (
0x01475840), export (0x01475560), hull (0x014755d0) and local (0x014757d0) shader setters, and the updates of a vertex shader (0x014754f0) and a hull shader (0x01475640) (#947, #956, #922). - Geometry shaders: the geometry shader's set and update wrappers (
0x014759d0,0x01475a30); the geometry mode (0x014756b0,VGT_GS_MODE, which for mode zero also resets stream output); the on-chip subgroup sizes (0x01475750,VGT_GS_ONCHIP_CNTL); the primitive-group size (0x01475960,IA_MULTI_VGT_PARAM); and the sizes of the rings that pass vertices between stages (0x01475a90,VGT_ESGS_RING_ITEMSIZE;0x01475af0, the four stream item sizes, three ring offsets, the most vertices a geometry shader may emit, and the total item size) (#1019, #1026, #1034, #1048, #1056, #1071, #1088). - Single registers: vertex reuse (
0x01474f30), the two instance step rates (0x01474f90), the dispatch draw index (0x01474a30), the primitive-ID enable (0x01475900), the texture border-colour table's address (0x014758a0), theGDS_OAregister (0x014749c0) and the depth block's override bits (0x01475210,DB_RENDER_OVERRIDE) (#840, #844, #848, #853, #856, #871, #947). - A draw and a wait:
render_emit_draw_opaque_auto(0x01474250) writes a fixed-count automatic draw marked as opaque, followed by a trace marker or a filler word depending on a system query (#560);render_wait_register(0x01475ec0) writes a packet that makes the GPU wait until a register, rather than a memory location, holds a value (#1097). No callers of the wait writer were found, so whether the game uses it is unknown.
Every writer keeps the library's shared quirks: the room check works on the free space in whole
words, any non-zero answer from the "need more room" callback lets it go ahead without checking
again, and the cursor moves only after all the packet's words are stored. #947 and #956 carry
evill33t's contributions (#860, #865, #882, #888, #901 and #934) onto main unchanged.
How the renderer learns what the game draws
Paleblood does not replay the finished GPU commands. Instead, the GPU library's replacements, with their packets unchanged, also tell Paleblood's renderer what they set, and the renderer draws that on your GPU (see Runtime: the renderer):
- Observer calls in replacements #414: the blend, colour, depth, stencil,
primitive-type, instance-count, viewport and draw replacements above each report the same value
they write, with the place in the command buffer where they wrote it. Under the verification
harness the calls do nothing. The depth and stencil clear values and
DB_RENDER_CONTROLreplacements report too #435. - Observed functions without replacements yet #416, #418, #435,
#441: where a library function has no replacement, the runtime watches its arguments at
its entry and lets the original run. These were
setRenderTarget(0x014738b0) and the depth target (0x014739b0) and five of the shaders' user-data writers (0x014761a0-0x01476420), now replaced (above), and still are the stencil references (0x01473190,0x014731f0), the last user-data writer (0x014764a0), the indexed-draw setters and draw (0x01475270-0x01475320,0x01474420) and two compute dispatch writers (0x01474c50,0x0148a350). - The compute command buffer's user data #510: that buffer's six user-data writers
(
0x0148aad0-0x0148ada0) take no stage argument and were not observed, so a compute pass ran with whatever user data the record held from before; one colour lookup-table pass read another pass's table. They now report through the same observers as the stage writers. - Clinic loading #649, #654, #655, #652: the load into Iosefka's Clinic (12 November, local runs)
reached five more library functions without replacements, now observed at their entry: the
indirect-argument base (
0x014742f0, which writesSET_BASEwith base index 1), the indirect dispatch (0x01474de0,DISPATCH_INDIRECTwith a data offset; the GPU reads the three workgroup counts at the base plus that offset) and the depth bounds setter (0x01473520), whose two bounds arrive as floats inxmm0andxmm1and are written asDB_DEPTH_BOUNDS_MINand_MAX. The fourth is the shader-stage setter (0x01476030, since replaced, #777), which writesVGT_SHADER_STAGES_ENfor five values only (0, 0x45, 0xad, 0xb0, 0x200) and nothing for any other: 0x45 turns on the local, hull and vertex stages of tessellation, 0xad adds a geometry shader, 0xb0 is export plus geometry. The engine's indirect draw caller (0x02569a4c) picks the local stage's user data exactly for 0x45 and 0xad. The fifth is the indirect draw (0x014744d0: command buffer, data offset, stage, and the SGPRs for the base vertex and start instance, each 0 for none), which writesDRAW_INDIRECT; the GPU reads the four arguments (vertices per instance, instances, start vertex, start instance) at the indirect base plus the offset. Its caller at0x02569a89passes no SGPRs. A related dispatch writer with a third argument (0x01474e80) is not observed yet. - Iosefka's Clinic #761, #802, #807: three more library functions are observed
at their entry. The addressed indexed-draw writer (
0x01474360: command buffer, count, index address) writesDRAW_INDEX_2; the YEBIS post-processing chain draws with it, so until it was observed nothing read the clinic's HDR scene target and the scene behind the HUD was flat grey. The clip-control setter (0x01476b30) writesPA_CL_CLIP_CNTL, which says among other things whether depth clipping is on. The viewport-scissor setter (0x014766d0: command buffer, viewport, left, top, right, bottom, and a seventh argument on the stack, the window-offset mode) writesPA_SC_VPORT_SCISSOR_n_TLand_BR. The game draws each deferred light as a full-screen quad once per 128x128 screen tile, with the tile as the viewport scissor (about 340 light draws a frame); without the scissor every tile's draw lit the whole screen, and the clinic was about eight times too bright. ThePA_SC_MODE_CNTL_0replacement now reports its value too, which turns the viewport scissor on (its packet is unchanged; recorded 98/98 and edge 15/15 again). - Packets that move to a new chunk #914: the command buffer is filled in chunks. When a packet does not fit in the rest of a chunk, its writer asks for room and writes the packet at the start of the next chunk. An observer runs before its writer, so it used to report such a packet where the old chunk ended, past what that chunk submits, and a compute dispatch at the clinic's entrance then ran with the previous dispatch's user data and stopped the run. Each observer now makes the same room request first and reports the packet where it will really land. In the maintainer's local clinic runs this stop no longer happened (3 of 3 runs, against 2 of 3 stopping before).
This needs the game library built from the decompilation (tools/boot.py --game-lib). In the
maintainer's local runs it was enough to draw the studio logos and the title screen #441.
How the library functions were verified
Each replacement above was checked against the original instructions on constructed edge cases,
which also caught deliberately broken variants; none was checked on recorded game frames. All
are edge-verified. They are @evill33t's work, brought up to date
with main and merged from the PRs named in brackets; #362 adds cases for the shader
preparation's reset modes (from #350) and #352 derives the packet tests' addresses from the
harness. The observer calls were added afterwards and leave the packets unchanged. The
functions of 10 November (#482, #485-#487, #489) were checked the same way and are
edge-verified; #489 lists each one's cases in its session report.
The five context finishers of #557 pass 3, 6, 3, 34 and 3 cases; an independent re-review
on the merged tree caught four of five planted mistakes, and the claim the fifth would have
tested (the order of one scalar load) was taken out of its note.
The shader-stage wrappers, geometry-shader writers, register writers, the opaque draw, the
register wait and the two YEBIS functions (13 to 15 November) were compared with the original
on constructed cases built with two compilers, and deliberately broken versions were rejected;
all their cases are synthetic, and none is verified. @FFwLo's
replacements (#777, #789,
#811, #880,
#969, #1007) are edge-verified the same way,
with the mutants each PR lists killed.
How these were verified
Each was checked against the original instructions on constructed edge cases by an independent
review, which also caught deliberately broken variants; none was checked on recorded game
frames. #279, #286 and #287 were brought up to date with main from #209, #259 and #267, and
321 to #327 from #212, #223, #228, #236, #210, #211 and #261.
Key functions
| Address | Size | Name | Status | Notes |
|---|---|---|---|---|
0x00fb4ac0 |
89 | render_yebis_context_instantiate |
edge-verified | YEBIS IPfxContext::Instantiate allocates a context; initializes its base; publishes its vtable then constructs the GNM shim; returns the allocation pointer |
0x00fb6d20 |
30 | render_yebis_initialize_interface |
edge-verified | Sets the IPfxInterface vtable; initializes the reference count to one; clears the instance pointer |
0x00fbc3e0 |
670 | render_yebis_get_recursive_sample_parameters |
verified | YEBIS GPUTexUtil_GetRecursiveSampleParameters: blur pass count; last-pass samples and scale; the FPS patches drop its first assertion |
0x01471270 |
57 | render_command_buffer_init |
verified | Initialize command pointers and callback; rounding capacity down to complete DWORDs while preserving auxiliary fields. |
0x014712d0 |
51 | render_compose_record_encoding_fields |
verified | Pack one byte and five masked fields into an encoding DWORD; no memory access. |
0x01471310 |
544 | render_pack_record_mapping_word |
verified | Pack numeric mapping fields with priority masks and full-width mode handling; return a zero-extended DWORD. |
0x01471600 |
190 | render_record_constructor_pack_pair |
edge-verified | Pack a full DWORD selector pair into an encoding; the first selector controls flag handling. |
0x01471730 |
21 | render_record_encoding_metadata |
edge-verified | Bounded first-byte metadata lookup; preserve original table entries and zero fallback. |
0x01471770 |
27 | render_record_encoding_byte_flags |
edge-verified | Map encoding byte 4 to 3; byte 2 to 1; and all other byte values to zero. |
0x014717a0 |
505 | render_record_encoding_components |
verified | Select ordered packed component arrangement; optional output only on success and Boolean AL contract. |
0x014719a0 |
117 | render_record_encoding_category |
verified | Decode accepted category nibbles; optional DWORD output untouched on rejection. |
0x01471a40 |
73 | render_read_record_descriptor_component |
edge-verified | Read one encoding DWORD and extract one of four 3-bit components; invalid selectors return 2 without reading input. |
0x014721d0 |
31 | render_set_present_last_record_indices |
verified | Replace two packed indices while preserving the remaining bits. Return the old preserved bits. |
0x01472870 |
90 | render_emit_present_context_section |
verified | Keep the low-DWORD capacity decision separate from the full remaining-word count sent to the original import. Its effects may change the live cursor. |
0x01472fd0 |
86 | render_set_cb_target_mask |
verified | Write the complete CB_TARGET_MASK value; preserving all supplied component-enable bits. |
0x01473090 |
109 | render_set_cb_blend_control |
verified | Write masked CB_BLENDn_CONTROL for the selected color-buffer bank. |
0x01473320 |
117 | render_set_cb_color_control |
verified | Write CB_COLOR_CONTROL.MODE and ROP3 from their masked input fields. |
0x014733a0 |
93 | render_set_db_depth_control |
verified | Write the observed mask of DB_DEPTH_CONTROL depth/stencil test and write-control fields. |
0x01473400 |
93 | render_set_db_stencil_control |
verified | Write the low 24 bits of DB_STENCIL_CONTROL; including front- and back-face stencil operations. |
0x01473590 |
95 | render_emit_present_preparation_scalar |
verified | Write the captured float bits to DB_DEPTH_CLEAR. Admission tests the callback low byte; rejection returns its full 64-bit result. |
0x014735f0 |
89 | render_emit_present_preparation_byte |
verified | Write the captured input low byte to DB_STENCIL_CLEAR. Admission tests the callback low byte; rejection returns its full 64-bit result. |
0x01473650 |
116 | render_set_screen_offset |
verified | Write the observed masked X/Y fields of PA_SU_HARDWARE_SCREEN_OFFSET. |
0x014736d0 |
124 | render_set_guard_band_clip_adjust |
verified | Write vertical then horizontal guard-band clip adjustments as unchanged float bit patterns. Capture both float representations before the capacity callback and publish from the captured cursor. |
0x01473750 |
124 | render_set_guard_band_discard_adjust |
verified | Write vertical then horizontal guard-band discard adjustments as unchanged float bit patterns. Capture both float representations before the capacity callback and publish from the captured cursor. |
0x01473840 |
104 | render_present_slot_emit |
verified | Write the selected color target's two clear-word registers. Prefix stores precede an aliased input read; the final increment uses the live stored cursor. |
0x014738b0 |
246 | render_set_render_target |
verified | Emit color-buffer registers; or clear CB_COLORn_INFO for an absent descriptor; then append its NOP payload. Recheck validity after admission and reload the cursor before overlapping trailing writes. |
0x014739b0 |
344 | render_set_depth_render_target |
verified | Emit depth/stencil; view and HTILE registers; or clear DB_Z_INFO and DB_STENCIL_INFO for an absent descriptor. Preserve repeated validity tests and delayed reads when output overlaps descriptor state. |
0x01473fe0 |
90 | render_set_vgt_primitive_type |
verified | Write the low six primitive-type bits to VGT_PRIMITIVE_TYPE. |
0x014741b0 |
156 | render_emit_draw_index_auto |
verified | Emit DRAW_INDEX_AUTO and a query-selected THREAD_TRACE_MARKER event or NOP. Reload flags and cursor after overlapping packet stores before selecting and publishing the trailing packet. |
0x01474250 |
157 | render_emit_draw_opaque_auto |
edge-verified | Emit the fixed opaque DRAW_INDEX_AUTO profile and query-selected trace marker or NOP. Preserve live flags and distinct cursor publications under overlapping packet stores. |
0x014749c0 |
97 | render_set_gds_oa |
edge-verified | Writes a five-word SET_UCONFIG_REG packet with full DWORD GDS_OA_CNTL and cleared counter and address; byte-result callback admission; publishes the live cursor after all stores |
0x01474a30 |
86 | render_set_dispatch_draw_index |
edge-verified | Write the unmasked VGT_DISPATCH_DRAW_INDEX DWORD after three-word admission; publish from the captured cursor after the packet stores. |
0x01474f30 |
92 | render_set_vertex_reuse |
edge-verified | Write VGT_REUSE_OFF as the input byte XOR 1; reserve three DWORDs and publish from the captured cursor after ordered stores. |
0x01474f90 |
99 | render_set_instance_step_rates |
edge-verified | Write two unmasked VGT_INSTANCE_STEP_RATE DWORDs after four-word admission, then advance the live cursor after the packet stores. |
0x01475000 |
397 | render_emit_shader_link_words |
verified | Write SPI_PS_INPUT_CNTL entries from last word to first to preserve overlapping reads; retain the unmasked count shift for zero and oversized counts. |
0x01475210 |
93 | render_set_db_render_override |
edge-verified | Writes DB_RENDER_OVERRIDE with input DWORD masked by 0xf8000040; byte-result callback admission and cursor redirection; publishes the captured cursor after all stores |
0x01475370 |
76 | render_emit_num_instances |
verified | Emit NUM_INSTANCES with the complete supplied instance count. |
0x014753c0 |
86 | render_emit_set_ps_shader_014753c0 |
edge-verified | Packet writer: reserves 40 words (space callback when short); sceGnmSetPsShader at the cursor; cursor advanced only on success |
0x01475420 |
86 | render_emit_update_ps_shader_01475420 |
edge-verified | Packet writer: reserves 40 words (space callback when short); sceGnmUpdatePsShader at the cursor; cursor advanced only on success |
0x01475480 |
98 | render_emit_set_vs_shader_01475480 |
edge-verified | Packet writer: reserves 29 words (space callback when short); sceGnmSetVsShader with the shader modifier; cursor advanced only on success |
0x014754f0 |
98 | render_update_vs_shader |
edge-verified | Reserves 29 words with byte-result callback admission; forwards opaque registers and full DWORD modifier to sceGnmUpdateVsShader; advances the live cursor by 116 bytes only on a zero DWORD result |
0x01475560 |
98 | render_set_es_shader |
edge-verified | Reserves 20 words with byte-result callback admission; forwards opaque registers and full DWORD modifier to sceGnmSetEsShader; advances the live cursor by 80 bytes only on a zero DWORD result |
0x014755d0 |
98 | render_set_hs_shader |
edge-verified | Reserve 30 DWORDs; read configuration DWORD after callback admission; forward opaque registers to sceGnmSetHsShader; zero low-DWORD result adds 120 to live cursor; AL admits without retry |
0x01475640 |
98 | render_update_hs_shader |
edge-verified | Reserve 30 DWORDs; read configuration DWORD after callback admission; forward opaque registers to sceGnmUpdateHsShader; zero low-DWORD result adds 120 to live cursor; AL admits without retry |
0x014756b0 |
152 | render_set_gs_mode |
edge-verified | Emit VGT_GS_MODE with cut bits; raw zero also resets VGT_STRMOUT_CONFIG; reserve six or three DWORDs with AL callback admission and captured cursor publication |
0x01475750 |
116 | render_set_gs_onchip_control |
edge-verified | Emit VGT_GS_ONCHIP_CNTL from two low eleven-bit fields; reserve three DWORDs with AL callback admission and captured cursor publication |
0x014757d0 |
98 | render_set_ls_shader |
edge-verified | Reserve 23 DWORDs; forward opaque registers and DWORD modifier to sceGnmSetLsShader; zero low-DWORD result adds 92 to live cursor; AL callback admission reloads without capacity retry |
0x01475840 |
83 | render_set_compute_shader |
edge-verified | Reserves 25 words through byte-result capacity admission; forwards the opaque register block to sceGnmSetCsShader; advances the live cursor by 100 bytes only when the low DWORD result is zero |
0x014758a0 |
90 | render_set_border_color_base |
edge-verified | Write GPU address bits 8-39 to TA_BC_BASE_ADDR after three-word admission; discard low and upper address bits and publish from the captured cursor. |
0x01475900 |
89 | render_set_primitive_id_enable |
edge-verified | Write the complete input byte to VGT_PRIMITIVEID_EN after three-word admission; preserve noncanonical byte values and publish from the captured cursor. |
0x01475960 |
109 | render_set_multi_vgt_param |
edge-verified | Emit IA_MULTI_VGT_PARAM from a primitive group size byte and the low PARTIAL_VS_WAVE_ON input bit; reserve three DWORDs with AL callback admission and captured cursor publication |
0x014759d0 |
83 | render_set_gs_shader |
edge-verified | Reserve 29 DWORDs; forward the opaque full register pointer including null to sceGnmSetGsShader; zero low-DWORD result adds 116 to the live cursor; AL callback admission reloads without capacity retry |
0x01475a30 |
83 | render_update_gs_shader |
edge-verified | Reserve 29 DWORDs; forward the opaque register pointer to sceGnmUpdateGsShader; a zero low-DWORD result adds 116 to the live cursor; AL callback admission reloads without capacity retry |
0x01475a90 |
93 | render_set_esgs_ring_itemsize |
edge-verified | Write the low 15 bits to VGT_ESGS_RING_ITEMSIZE after three-word admission; publish from the captured cursor and retain final-packet observation |
0x01475af0 |
279 | render_set_gs_ring_sizes |
edge-verified | Reserve 17 DWORDs; write four GS item sizes and GSVS offsets with masked maximum and total; retain live cursor reloads and late descriptor reads |
0x01475da0 |
101 | render_emit_event_write |
verified | Emit EVENT_WRITE with a masked event type and the original table-selected event index. |
0x01475e10 |
173 | render_emit_shader_preparation_range_01475e10 |
edge-verified | ACQUIRE_MEM packet (7 words) for a memory range: coherence control from the cache actions, targets and top flag; reserve via the space callback |
0x01475ec0 |
135 | render_wait_register |
edge-verified | Emit register-space WAIT_REG_MEM with a low16 address and low3 comparison; preserve full reference and mask then increment the live cursor after seven stores |
0x01476030 |
140 | render_set_shader_stages_01476030 |
edge-verified | SET_CONTEXT_REG VGT_SHADER_STAGES_EN (0x2d5) to the stages (3 words), only for the values the game uses; reserve via the space callback first |
0x014761a0 |
156 | render_emit_shader_descriptor16_014761a0 |
edge-verified | NOP with descriptor control 0x68750004, then SET_SH_REG of a 16-byte descriptor at the stage base plus slot (8 words) |
0x01476240 |
172 | render_emit_shader_descriptor32_01476240 |
edge-verified | NOP with descriptor control 0x68750005, then SET_SH_REG of a 32-byte descriptor at the stage base plus slot (12 words) |
0x014762f0 |
156 | render_emit_shader_sampler16_014762f0 |
edge-verified | NOP with descriptor control 0x68750006, then SET_SH_REG of a 16-byte sampler at the stage base plus slot (8 words) |
0x01476390 |
133 | render_emit_shader_address_01476390 |
edge-verified | SET_SH_REG of a 64-bit address (two words) at the stage base plus slot; flag bit 1 in the header |
0x01476420 |
126 | render_emit_shader_word_01476420 |
edge-verified | SET_SH_REG of one word at the stage base plus slot; flag bit 1 in the header |
0x014765e0 |
238 | render_configure_viewport |
verified | Write viewport ZMIN/ZMAX; then X/Y/Z scale and offset values for the selected viewport. Capture all six borrowed source words before output; retain the live and captured cursor publications. |
0x01476790 |
135 | render_configure_screen_scissor |
verified | Write PA_SC_SCREEN_SCISSOR_TL/BR using the low 16 bits of each supplied coordinate. Packet stores may overlap the cursor; its final increment reads the stored value after those writes. |
0x01476980 |
93 | render_emit_pa_cl_vte_cntl |
verified | Write PA_CL_VTE_CNTL viewport-transform enable/format bits after capacity admission. |
0x014769e0 |
93 | render_emit_present_last_record_packet |
verified | Write DB_RENDER_CONTROL for the last-record path. Publish and return the captured cursor plus twelve bytes; return the full callback result on rejection. |
0x01477150 |
109 | render_set_pa_sc_mode_cntl_0 |
verified | Write MSAA_ENABLE and VPORT_SCISSOR_ENABLE in PA_SC_MODE_CNTL_0 after reserving three packet words. |
0x014778f0 |
204 | render_emit_present_release_packet |
verified | Emit EVENT_WRITE_EOP with by-value selectors; address and data; preserve the complete callback rejection result and final live cursor increment. |
0x01477b30 |
172 | render_command_emit_counter_operation |
verified | Emit the seven-word counter packet; callback admission uses its low byte; and the label range selects the masked encoding. |
0x01477f40 |
160 | render_emit_shader_preparation_event_01477f40 |
edge-verified | ACQUIRE_MEM packet (7 words) for all memory (size 1, base 0): coherence control from the cache actions, targets and top flag |
0x014784a0 |
82 | render_command_prepare_submission |
verified | Reserve 64 command words; callback admission uses its low byte before two marker stores and the cursor advance. |
0x01485070 |
16 | render_set_present_last_record_depth_compress_disable |
verified | Replace DEPTH_COMPRESS_DISABLE in the saved DB_RENDER_CONTROL word using the input low bit. Return the old bits with that flag cleared. |
0x01485080 |
16 | render_set_present_last_record_stencil_compress_disable |
verified | Replace STENCIL_COMPRESS_DISABLE in the saved DB_RENDER_CONTROL word using the input low bit. Return the old bits with that flag cleared. |
0x01485220 |
81 | render_set_pa_cl_vte_cntl |
verified | Expand the toggled input byte into overlapping register fields. The original result is the shifted byte; independent of the preserved old bits or the final stored word. |
0x01485390 |
24 | render_set_record_register_range |
verified | Pack one bit from the first input and three from the last; preserving all other bits. |
0x014853f0 |
16 | render_set_record_register_enabled |
verified | Preserve the original byte-wide input: doubling it can contribute bits beyond bit one. |
0x01485f90 |
1410 | render_record_constructor |
edge-verified | Clear the 44-byte record prefix and publish partial record and auxiliary outputs; return the packed 64-bit result. |
0x01486520 |
31 | render_record_set_word_0c_fields |
verified | Store two masked fields; return masked old word. No constructor add/subtract. |
0x01486540 |
305 | render_record_set_encoding |
verified | Pack accepted encoding into record DWORD10 preserving other bits; invalid input has undefined native extractor locals. |
0x014866e0 |
33 | render_record_set_word_04_repeated_field |
verified | Duplicate supplied low 11 bits; return preserved old word. |
0x01486710 |
20 | render_record_set_word_08_low22 |
verified | Replace this word's low 22 bits and return the preserved old upper bits. |
0x01486760 |
20 | render_record_set_word_14_second_low5_field |
verified | Replace the second five-bit field and return the preserved old word bits. |
0x014867c0 |
21 | render_record_set_first_auxiliary_flag |
verified | Clear only bit 13 then OR full input byte shifted13; return preserved old word. |
0x014867e0 |
21 | render_record_set_second_auxiliary_flag |
verified | Clear only bit 14 then OR full input byte shifted14; return preserved old word. |
0x01486800 |
20 | render_record_set_word_28_low22 |
verified | Replace this word's low 22 bits and return the preserved old upper bits. |
0x01486cf0 |
38 | render_read_record_mapping_word |
verified | Read one unaligned mapping DWORD and delegate three extracted fields to the original encoder. Full return is zero-extended. |
0x014873a0 |
163 | render_build_shader_link_words |
verified | Match byte-pair keys; then publish each packed word in the original four-store order. |
0x01487ee0 |
1090 | render_initialize_pair_record_descriptor |
edge-verified | Clear 32 bytes; admit counts after float rounding; test flag bytes independently; and return packed requirements. |
0x01488370 |
17 | render_record_descriptor_set_high_field |
verified | Set the descriptor top nibble and return the preserved old low 28 bits. |
0x01488590 |
969 | render_initialize_triple_record_descriptor |
edge-verified | Clear 32 bytes in order; delegate flags; retain partial writes and return packed requirements. |
0x01488d90 |
813 | render_convert_constructor_record |
edge-verified | Convert a constructor record into a GCN image descriptor. Preserve overlapping reads; ordered component calls and independent low/middle-field tests when choosing its type. |
0x01489910 |
24 | render_record_descriptor_level_count |
edge-verified | Read bits 16..19 below the upper descriptor partition; otherwise return zero. |
0x01489940 |
24 | render_record_descriptor_count_exponent |
edge-verified | Read bits 16..19 in the upper descriptor partition; otherwise return zero. |
0x01489960 |
68 | render_record_descriptor_encoding |
verified | Read packed words at offsets 0x04 then 0x0c; pass six extracted fields to the encoding packer. |
0x01489c40 |
16 | render_record_step_user_pa_enabled |
verified | Query the actual import once; no cached global; fallback or service value is invented. |
0x01496f60 |
525 | render_configure_viewport_and_guard_band |
verified | Configure viewport transforms; scissor extent and guard-band pairs using ordered float arithmetic; floor rounding and the original upper clamp. |
0x0149c4e0 |
114 | render_initialize_record_geometry_flags |
edge-verified | Clear the output before selector admission; selectors 7-12 copy the parameter flag only when the full 32-bit parameter equals 1. |
0x0149c660 |
486 | render_record_geometry_resolve_parameter_index |
edge-verified | Resolve the packed parameter-table index with the original validation order and wrapping scale operations. |
0x0149c850 |
672 | render_record_apply_parameter_tuple |
edge-verified | Select one output code from normalization tuple; ordered overrides and rejection preserve output. |
0x0149cb30 |
204 | render_record_apply_mapping |
edge-verified | Map derived normalization code to original layout-helper tuple; unsupported code preserves output. |
0x0149cc60 |
350 | render_convert_record_descriptor_classification |
edge-verified | Convert a tile-mode table index for the requested array mode; preserve output on error and bypass already matching modes. |
0x0149ce10 |
5124 | render_record_geometry |
edge-verified | Calculate record dimensions and alignment; preserving staged output on failure and live reads when descriptor and result overlap. |
0x0149e2d0 |
295 | render_record_constructor_optional_first |
edge-verified | Align paired components; retain the pre-increment product and 55-bit quantity; then publish optional outputs in order. |
0x0149e400 |
358 | render_record_constructor_optional_second |
edge-verified | Calculate geometry and publish zeroed or partial auxiliary outputs even when a helper reports an error. |
0x0149e570 |
279 | render_calculate_second_auxiliary |
edge-verified | Calculate the second auxiliary layout through two ordered unit admissions and wrapped alignment. Publish its four optional size and alignment outputs in 8/4/4/4-byte order. |
0x0149e8d0 |
40 | render_record_geometry_round_up_power_of_two |
verified | Round upward in the unsigned 32-bit domain; zero and an overflowing next power wrap to zero. |
0x0149e900 |
16 | render_record_tuple_parameter_supported |
edge-verified | Nonzero power-of-two test with Boolean AL interface. |
0x0149e920 |
18 | render_record_geometry_index_logarithm |
verified | Extract the exponent after converting the positive integer to float; including float rounding near powers of two. |
0x0149e960 |
129 | render_record_tuple_transform_classification |
edge-verified | Transform admitted classifications after wrapping 32-bit scaling and unsigned thresholds. |
0x0149ea20 |
28 | render_record_tuple_classification_group |
edge-verified | Bounded classification-to-group lookup with fallback one and original shared table. |
0x0149ea70 |
25 | render_record_tuple_alternate_classification |
edge-verified | Recognize bounded alternate-classification subset with zero fallback. |
0x0149ea90 |
40 | render_record_geometry_category |
edge-verified | Read the three-bit category of a bounded record word; rejection leaves output untouched. |
0x0149eac0 |
40 | render_record_geometry_classification |
edge-verified | Read the four-bit classification of a bounded record word before publishing to possibly aliased output. |
0x0149eb20 |
40 | render_record_geometry_first_exponent |
edge-verified | Extract the first three-bit exponent used by the record geometry arithmetic. |
0x0149eb50 |
40 | render_record_geometry_second_exponent |
edge-verified | Extract the second two-bit exponent; reject invalid indices or null output before reading the table. |
0x0149ed30 |
174 | render_record_geometry_parameters |
edge-verified | Split one captured parameter word into four optional two-bit outputs; preserving write order when outputs alias. |
0x014a1e80 |
803 | render_initialize_record_level_descriptor |
edge-verified | Publish a partial level descriptor in order; reread the source between helper calls; then convert its tile mode. |
0x014a27c0 |
627 | render_get_record_descriptor_size |
edge-verified | Initialize mandatory outputs after the decoder call; accumulate live values and retain partial outputs on error. |
0x014a2c40 |
595 | render_calculate_record_descriptor_level_offset |
edge-verified | Accumulate levels inclusively using partial helper totals even after errors; publish the two QWORD outputs in order. |
0x014a3410 |
250 | render_copy_initial_level_014a3410 |
edge-verified | Render: copies one level of initial data through the box copy, in 4x4 blocks for block-compressed or blocked levels; a null level is refused |
0x02373850 |
590 | render_object_update_02373850 |
edge-verified | Render: refreshes an object's visible flag (owner query or view masks), then idle/running/finishing life cycle with finish and notify requests; false once done |
0x02377bd0 |
399 | render_frame_update_02377bd0 |
verified | per-frame: ages a list of ref-counted objects; updates RendMan-side child; steps another child by 1/30 s (Uncap: measured frame time) |
0x02379d60 |
391 | render_list_prepare_02379d60 |
edge-verified | Render: engine list splice of another list's range; relinks on one heap (size limit), else inserts each value and erases the range from the other list |
0x0247c4e0 |
24 | render_setup_create_object_0247c4e0 |
edge-verified | Thunk: the owner's vtable slot 0x58 called as (owner, first, second, first), second again in r8, candidate in r9; returns its result |
0x0247eb80 |
16 | render_read_present_pool_counter |
edge-verified | full-QWORD locked read/writeback retry; XOR before each attempt; caller adds one. Real AMD64 write cycles retained; non-AMD64 bridge unresolved Synthetic edges pass; no recordings. |
0x02564ed0 |
25 | render_present_encoding_units |
edge-verified | Return the full 64-bit entry for wrapped encoding minus one when its index is below 99; otherwise return zero. |
0x02565130 |
30 | render_present_record_bit_width |
verified | Return the bit width of the OR of three 32-bit inputs. All-zero input returns zero; the presentation fallback passes one as the third input. |
0x02565f90 |
855 | render_initialize_swap_chain_resource |
edge-verified | Validate resource parameters; choose independent allocator and owner defaults; prepare resource storage and publish its wrapper. Allocation failure clears the output and releases prepared storage. |
0x02568530 |
190 | render_finish_present_context |
verified | Run the presentation context's finishing calls in order with a zeroed snapshot. |
0x0256e1d0 |
6280 | render_build_present_source_record |
edge-verified | Build a mode-specific presentation record; preserving partial output; unsigned division and packed auxiliary requirements. Constructor selectors are 32-bit values even in stack slots. |
0x025710a0 |
301 | render_record_normalize_mode2 |
edge-verified | Normalize mode-2 input; preserve ordered 36-byte copy; supplied parameter bypass and helper error/status ordering. |
0x025711d0 |
361 | render_record_normalize_mode3 |
edge-verified | Normalize mode 3 input through an ordered 48-byte copy; cache mapping across conditional parameter helpers and preserve statuses and padding. |
0x02571340 |
303 | render_record_normalize_mode4 |
edge-verified | Normalize mode-4 input; preserve ordered 40-byte copy; optional parameter path and status/reload ordering. |
0x02571c60 |
47 | render_clear_swap_chain_curve |
edge-verified | Release the swap-chain curve resource through its owner; clear only the resource after the callback. |
0x02571d60 |
1324 | render_prepare_swap_chain_resource_info |
edge-verified | Allocate resource storage and publish its descriptor before copying initial data. Re-read entry counts after processing/copy callbacks; copy failures preserve partial output. |
0x02572290 |
47 | render_clear_swap_chain_cached_record |
edge-verified | Release the swap-chain cached-record resource through its owner; clear only the resource after the callback. |
0x025b2fb0 |
768 | render_swap_chain_present |
verified | GXSwapChainCtrl present: waits for the present interval in 60 Hz vblanks; maps it to a flip mode; presents (Uncap: mode 0) |
0x02713870 |
11646 | render_update_model_wind |
edge-verified | Ages a model wind receiver's kept influences; lists the live ones and adds or refreshes one per attached wind source; applies selected frame-rate steps |
0x02a85e30 |
153 | render_fractal_noise_02a85e30 |
edge-verified | Sums octaves of the base noise 0x02a85950: scale from 1 times the step, amplitude from 0.5 times the persistence; zero octaves give +0 |
0x02aa9d50 |
87 | render_acquire_shader_upload_block_02aa9d50 |
edge-verified | Under the manager lock (+0xd8, slots 0x18/0x28), one range from the allocator at 0x02aa9db0 with 16-byte alignment |
0x02aa9db0 |
487 | render_allocate_shader_upload_range_02aa9db0 |
edge-verified | First fit on the free list for size rounded to 16; splits off aligned padding and rest as free ranges when the node pool gives records; counts in use and free bytes |
0x02aaa5a0 |
124 | render_release_present_finish_node |
verified | Release the finish node through the manager helper; retaining its head-match decision and reloading commands across retries. |
0x02aaa860 |
697 | render_reclaim_shader_upload_blocks_02aaa860 |
edge-verified | Under the lock drains pending lists +0xa8 +0xb0 +0x98 +0xa0; frees state-4 blocks merging free neighbours; puts the rest back; sets event bits 3 and 0x08000000 |
0x02aaddc0 |
393 | render_allocate_shader_upload |
verified | Allocate one shader-upload slice of at most 64 KiB. If no suitable block exists; acquire once; reclaim; then retry once. Preserve zero-size requests and delegate block policy to the original manager. |
0x02aaf030 |
508 | render_managed_present_capacity |
edge-verified | Acquire managed command space; preserve partial block publication and copy the saved command snapshot in reverse order. |
0x02aaf700 |
750 | render_finish_present_commands |
edge-verified | Finish pending command lists with live block and counter reads; then conditionally submit the cursor snapshot. |
0x02aafa00 |
294 | render_submit_pending_commands_02aafa00 |
edge-verified | Submit the command buffer's region up to the cursor (with the context when a counter wait needs 7 free words; too few asks the space callback for 0 and returns), then restart the region at the cursor |
0x02aafb30 |
509 | render_command_submit_present |
verified | Prepare and delegate a present submission; preserving capacity-failure returns and resetting begin markers to the live cursor. |
0x02ab0b00 |
326 | render_submit_present_finish_snapshot |
verified | Emit required counter waits and submit nonempty command regions in order; construct an empty second region when optional commands are absent. |
0x02ab0ce0 |
326 | render_command_submit_batch |
verified | Emit counter waits and submit nonempty regions with the packed video/index handle; or delegate the snapshot when no optional context exists. |
0x02ab0e30 |
213 | render_command_submit_snapshot |
verified | Initialize the auxiliary command buffer and submit nonempty regions using only the video handle. |
0x02ab18c0 |
98 | render_resource_info_submit_pending_commands_02ab18c0 |
edge-verified | Submits the packets since the buffer start as one range (low 32-bit byte count, whole words) to the queue at +0x58, then sets the start to the cursor |
0x02ab1930 |
96 | render_resource_info_write_completion_label_02ab1930 |
edge-verified | Takes the next label from the services counter (again if it equals the 64-bit reserved value) and writes a compute-done release-memory packet storing it |
0x02ab5a70 |
1235 | render_present_record_consume |
verified | Track a resource range or emit record commands; preserve cached tokens; index wrap and final state resets. |
0x02ab6810 |
1173 | render_present_last_record_consume |
edge-verified | Consume the final record range; or update its tracking bank when commands are not admitted. |
0x02ab7310 |
629 | render_record_translate_selector |
edge-verified | Map supported selectors to one output DWORD; unsupported selectors return status 12 and zero the output. |
0x02ab7720 |
83 | render_translate_record_secondary_02ab7720 |
edge-verified | Selector to secondary value: 0x13-0x16 and 0x27-0x2b give 3, 0x35-0x3b give 1 (status 0); other codes store 0 and return 12 |
0x02ab78a0 |
83 | render_translate_record_tertiary_02ab78a0 |
edge-verified | Selector to tertiary value: 0x13-0x16 give 1, 0x27-0x2b and 0x35-0x3b give 0 (status 0); other codes store 0 and return 12 |
0x02ab7a20 |
66 | render_choose_record_constructor_selector |
edge-verified | Choose a constructor selector from supported input values; only the low flag byte affects the extended case. |
0x02ab7ab0 |
124 | render_combine_record_parameters |
edge-verified | Combine constructor choices; using only the low flag byte and bounding the four-entry original table before access. |
0x02ab7e40 |
22 | render_reduce_record_parameter |
edge-verified | Return the original four-entry scale table value; or zero for an out-of-range unsigned index. |
0x02ab9850 |
374 | render_flush_shader_preparation |
verified | Flush the pending barrier/range before the event. Mode 0 keeps the range fields; and a suppressed state returns without touching either group of fields. |
0x02abad70 |
80 | render_resource_info_alternate_copy_admitted_02abad70 |
edge-verified | True when sceKernelQueryMemoryProtection succeeds for a nonzero address and reports CPU read (bit 0) |
0x02abadd0 |
83 | render_resource_info_storage_admitted_02abadd0 |
edge-verified | True when sceKernelQueryMemoryProtection succeeds for a nonzero address and reports GPU read (bit 4) |
0x02abaef0 |
23 | render_resource_info_current_mode_02abaef0 |
edge-verified | Atomically increments the shared counter at 0x056ba180 and returns its old value masked to 24 bits |
0x02abaf10 |
78 | render_record_derive_parameter |
edge-verified | Derive numeric normalization code; flag priority and mode-dependent base. |
0x02abb4b0 |
52 | render_resource_info_needs_initial_copy_02abb4b0 |
edge-verified | False for selector 0, 0x59, 0x13-0x16, 0x2c-0x2f and 0x42-0x45 (signed compare); true otherwise |
0x02abb4f0 |
31 | render_record_auxiliary_predicate |
edge-verified | Return the auxiliary-processing predicate: selectors 0x13/0x14 enable it; 0x15/0x16 use flag bit 6; and all other selectors disable it. |
0x02abb6d0 |
48 | render_emit_present_release_delegate |
verified | Forward address and data to the release writer with fixed flags and mode and a zero final selector. |
0x02abba10 |
22 | render_reset_present_context_state_b518 |
verified | Reset the first 64-bit field to zero and the second to the packed invalid-value sentinel. |
0x02acd190 |
601 | render_reset_present_context_shader_state |
verified | Clear the conditional command flag; then preserve the sentinel stores around each distinct state-fill call. |
0x02ace1e0 |
1016 | render_configure_record_shader |
verified | Populate sparse primary and optional shader bindings; update special-slot caches; bind VS/PS programs; and emit up to 32 PS link words. |
0x02ace5e0 |
5473 | render_configure_record_shader_secondary |
edge-verified | Consume two sparse shader binding banks; emit descriptor and address packets; copy selected upload spans; and update shared upload caches. |
0x02acfc20 |
207 | render_finish_record_shader |
verified | Finalize two dirty-state passes using cached event flags; clear the source dirty flags; then read the current command mode and apply a pending mode change. |
0x02ad1e30 |
55 | render_restore_color_target_from_bank |
verified | Restore one color target from the bank selected by flag bit 0. Keep the preparation cache unchanged while delegating the register writes. |
0x02ad1e70 |
61 | render_restore_depth_target_from_bank |
verified | Restore the depth target from the bank selected by flag bit 1; independently of the color-target bank in flag bit 0. |
0x02ad1eb0 |
194 | render_present_source_prepare |
edge-verified | Flush source state and select an explicit or derived record count. Stop at the first builder error; reload the source parameter before consuming each successful record. |
0x02ad1f80 |
385 | render_present_source_flush_state |
verified | Emit dirty non-null slots from the selected bank. Keep count and flags cached on skips; reload the pending value; flags and slot count after each emission. |
0x02ad2c30 |
120 | render_reset_present_preparation_dirty |
verified | Emit changed depth and stencil clear values; then cache their post-call values. Preserve the second writer's upper return bits while replacing its low word. |
0x02ad2d20 |
517 | render_reset_present_context_preparation |
verified | Reset both nine-entry banks and surrounding state; interleave the first eight entries before loading the live scalar. |
0x02ad3070 |
351 | render_prepare_present_context_scratch |
edge-verified | Prepare changed live-bank records before finishing; retain eligible pointers across refresh calls and reload the bank each iteration. |
0x02ad3300 |
76 | render_reset_present_context_state_b528 |
verified | Reset the embedded state without changing padding; copy the shared scalar bits unchanged. |
0x02ad3b80 |
252 | render_pop_present_buffer_pool |
edge-verified | Scan pool entries using the original counter and compare/exchange calls; publish the counter before successful output. |
0x02ad3c80 |
42 | render_process_present_finish_item |
verified | Mark the final pool word as processed; pass its address and a fixed selector to the release delegate; forwarding the packet result. |
0x02ad3d40 |
35 | render_capture_present_buffer_pool_record |
edge-verified | Return zero for a zero begin address; otherwise locate the containing pool record using wrapped subtraction; arithmetic shift and unsigned division remainder. |
0x02ad5dd0 |
27 | render_swap_chain_present_mode |
edge-verified | Validates low DWORD mode; retains object; loads full source pointer at +0x33d0; forwards mode to lower submit Synthetic GCC/Clang edges pass; no recordings. |
0x02ad5e90 |
3005 | render_setup_swap_chain |
edge-verified | Allocate and register swap-chain buffers; initialize cached resource data and tone curves; and retain partial publications on the corresponding failure paths. |
0x02ad6e50 |
499 | render_swap_chain_submit |
edge-verified | Owned-thread flip polling; source binding and submission; every exit reloads the global guard pointer. Native GPU helper effects remain original Synthetic GCC/Clang edges pass; no recordings. |
0x02c51f60 |
87 | render_set_parameter_02c51f60 |
edge-verified | Parameter set: finds the key among the sorted keys (lower bound) and stores the value beside it when found |
0x02c51fc0 |
42 | render_clear_parameter_set_02c51fc0 |
edge-verified | Parameter set: frees its block of keys and values through its allocator (slot 0x70) and clears the pointer, when there is one |
0x02fa6af0 |
2214 | render_prepare_resource_descriptor |
edge-verified | Build the resource descriptor and requirements through ordered original helpers; preserve partial writes on errors and live parameter reads between calls. |
Structs and globals
The update's owner
| Offset | Field |
|---|---|
+0x10 |
list sentinel (next +0x0, prev +0x8, object +0x10) |
+0x18 |
count |
+0x20 |
allocator (frees nodes through vtable slot +0x70) |
+0x70 |
child, stepped through vtable slot +0x40 |
+0x80 |
child |
+0x8c |
the held flag |
+0x98 |
a byte copied into the +0x70 child each frame |
Reference-counted objects: vtable slot 0 destroys, count at +0x8 (atomic). The engine shares this
reference counting across systems since #185;
the frame update was re-verified unchanged on all its recorded and edge cases.
Patch points
The frame-rate patches are described in Frame timing.
Uncap FPS++makes the+0x70child's step the flipper's measured frame time (+0x264) whatever the held flag says, through a small code cave inside the function, and drops theRendMancheck. The 1/30 s it reads otherwise is the shared constant at0x04d29170, which the 60, 90 and uncapped patches rewrite in the data segment.Uncap FPS++presents with flip mode 0 (no vblank sync) at the end of0x025b2fb0.- Every frame-rate patch removes the first assertion of
0x00fbc3e0(at least 3 base samples): at higher frame rates the blur gets fewer samples.
Open questions
- What the reference-counted objects in the per-frame list are, and what the two children are.
- The engine's own drawing code above the GPU library, its materials and post-processing have not been studied yet; of YEBIS only the blur sample counts, the context factory and the interface base are mapped.
- What the objects' two visibility masks select, and what the notify request's parameter keys mean.
- Which geometry-shader settings and ring sizes the game actually uses, and whether the register-space wait writer is reached at all.
- Which GCN descriptor kinds the user-data writers' NOP markers (
0x68750004,0x68750005,0x68750006) name. - What the fifth argument of the dispatch writers' relatives (
0x01474d10,0x0148a410) selects.