Skip to content

Fix frag shader parser bug#2

Open
solstice0 wants to merge 1 commit intops3aqua:masterfrom
solstice0:frag-shader-parser-fix
Open

Fix frag shader parser bug#2
solstice0 wants to merge 1 commit intops3aqua:masterfrom
solstice0:frag-shader-parser-fix

Conversation

@solstice0
Copy link

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.

ps Thank you Scummvm team for actively maintaining psl1ght!

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.

1 participant