Skip to content

Conversation

@solstice0
Copy link

@solstice0 solstice0 commented Nov 18, 2025

cgcomp will segfault for some fragment shaders. This is caused by a bug in the parser that tokenizes nv40 asm in order to create an rsx compatible binary.

Example:

MOVH  oCol(NE.y), fragment.color.primary;

The problem was with parsing oCol dst mask. It would get tokenized as 'oCol(' which is not a valid token . The reg variable would not get set which causes a segfault later in processing.

Reading the code, its clear the intent was to skip over the oCol token, then parser.cpp line 232 would hit the paren and parse condition instructions.

PR also here for this fork maintained by scummvm team that is still active ps3aqua#2

@Fancy2209
Copy link

@shagkur any chance this could be merged?
Pinging since you seem to have been mentioned in other PRs/Issues related to cgcomp and librsx

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants