Skip to content

shaders: record the graphics stages' FLOAT_MODE / IEEE / DX10_CLAMP in the pipeline manifest #237

Done

Description

@simnJS

Follow-up of the float-mode survey on #217: across 33,611 recorded shader programs from 7 titles, no shader writes MODE and every compute module has the default FLOAT_MODE (0xc0). The one thing we can't see yet is the graphics stages, because the pipeline manifest records the compute FLOAT_MODE but not the SPI_SHADER_PGM_RSRC1_{VS,PS,HS,GS,ES,LS} fields of draws.

What to do. When a graphics pipeline is recorded in the manifest (core/kyty/graphics/host_gpu/renderer/pipeline/pipelineManifest.cpp), also record, per stage, the FLOAT_MODE, IEEE and DX10_CLAMP fields of that stage's PGM_RSRC1, and bump the manifest version if its format requires it. Then add a line to the summary (or a small tool in tools/) that counts the non-default values per title.

Check: a unit test that writes and reads back the new fields; ctest; conventions. Then a run of any title with KYTY_* defaults: post the counts here (counts only, no shader bytes).

Why it matters: if any title draws with a non-default float mode, the recompiler has to model it (#217 lists the modes). If none does, we can close the question.

Activity

  1. added
    enhancement
    good first issue
    area: shaders
    needs: game
    on Nov 22, 2026
  2. Celegans12 commented on Nov 23, 2026

    @Celegans12
    Collaborator

    I'll take this one. I'll record the three fields per graphics stage in the manifest with a read-back test, then post the counts from a Ghost of Yōtei session here.

    AI-assisted: yes

  3. Celegans12 commented on Nov 23, 2026

    @Celegans12
    Collaborator

    I recorded the float modes in a Ghost of Yōtei session (PPSA26344 v1.008), and every graphics stage it drew uses the same values: FLOAT_MODE 0xc0, IEEE 0 and DX10_CLAMP 1. Nothing non-default for FLOAT_MODE or IEEE anywhere, and together with the compute side that means Yōtei gives no reason to model another float mode.

    The one thing that isn't "off" is DX10_CLAMP, which is set on every stage. With it set, the hardware turns a NaN into 0 when an instruction clamps its result. The recompiler doesn't read the bit, but its f32 clamp (EmitFPSaturate32, NClamp to [0, 1]) already gives 0 for a NaN, so that matches. I haven't checked the f16 and f64 clamps. Compute modules only carry FLOAT_MODE in the manifest, so I can't say anything about their IEEE/DX10_CLAMP from this.

    This is from one 300 s session standing at the Teshio save on the branch of #281 (with KYTY_* defaults), so it covers the 1,196 of the manifest's 1,426 graphics pipelines that were drawn there, not the whole game. The counts came from tools/kyty_manifest_float_modes.py on the rewritten manifest. If you run it over the manifests of your other titles, it prints the same table per title.

    Counts (Ghost of Yōtei, PPSA26344_01.008.000.kpm)
    1426 graphics pipelines, 1196 with float modes
      stage   stages  recorded  FLOAT_MODE!=c0  IEEE=1  DX10_CLAMP=1  values (FLOAT_MODE.IEEE.DX10_CLAMP)
      vs        1419      1191               0       0          1191  c0.0.1 x1191
      ls           7         5               0       0             5  c0.0.1 x5
      hs           7         5               0       0             5  c0.0.1 x5
      tes          7         5               0       0             5  c0.0.1 x5
      ps        1391      1162               0       0          1162  c0.0.1 x1162
      cs         757       757               0       -             -  c0 x757 (modules)
    
    • Vertex and evaluation stages read SPI_SHADER_PGM_RSRC1_GS, local and hull stages SPI_SHADER_PGM_RSRC1_HS, pixel stages SPI_SHADER_PGM_RSRC1_PS. This tree has no handler for the VS, ES or LS PGM_RSRC1 registers; writing one would show up as an ignored-register notice, and the session had none.
    • 34 of the 1,196 drawn pipelines have no pixel stage. No pipeline was drawn with more than one set of modes, and every drawn pipeline linked to modules the manifest lists.
    • Windows 11, RTX 3080 Laptop (NVIDIA 621.14), 1080p, warm shader cache; 0 errors, ~9.4 FPS as usual.

    AI-assisted: yes

  4. simnJS commented on Nov 25, 2026

    @simnJS
    OwnerAuthor

    Done in #281 (09ce911): the pipeline manifest now records the graphics stages' float modes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: shadersenhancementgood first issueneeds: game

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions