ANYPS5_ENABLE_SPIRV_TOOLS: CCP turns a constant byte store into an 8-bit OpConstant that the module cannot declare #1276
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by arreina on 2026-10-07T21:22:02Z.
What
With
ANYPS5_ENABLE_SPIRV_TOOLS=ON,Recompilecan reject a module that validated a moment earlier. A global store whose data is a compile-time constant ends with:The module is valid before optimization, and
APS5_SPIRV_OPT=nonerecompiles it. Running the passes ofValidateAndOptimizeSpirvone at a time,CCPis the first one after which anOpConstantof the 8-bit type exists. What it changes:These are the byte stores of the unaligned path of a guest memory write (
get_bda_write_pointer,note_bda_write). The module declaresStorageBuffer8BitAccess(BdaFeaturesrequiresstorageBuffer8BitAccess) but neverInt8, and an 8-bit constant needsInt8. With the option on, the optimized module replaces the emitted one, soRecompilethrows and the shader fails to recompile. Default builds do not run this step.Found by fuzzing the recompiler with mutated synthetic shaders: 4 of 30000 cases, all with this message. No title was used.
Reproduction
Built with
-DANYPS5_ENABLE_SPIRV_TOOLS=ON, registered likeagc_pixel_position_export(it needs onlyshader_recompiler_agc_driverandlibc), this recompiles a 14-word vertex shader:global_store_dwordwith an unwritten data register, then an export.Int8ConstantFold.cpp
It prints the message above. With
APS5_SPIRV_OPT=noneit printsrecompiled.What I checked on this input:
s_nop) it recompiles.Directions
I am not sure which one fits the project:
Int8when the device reportsshaderInt8, and skipCCPwhen it does not.CCPout of the pipeline.Which would you prefer? I can send a pull request for the one you choose.
AI-assisted: yes (Claude Code found and analysed this; the run is on my machine).