Commit 2963e9fa authored by Danylo Piliaiev's avatar Danylo Piliaiev Committed by Juan Suárez Romero

st/nine: Ignore D3DSIO_RET if it is the last instruction in a shader

RET as a last instruction could be safely ignored.
Remove it to prevent crashes/warnings in case underlying driver
doesn't implement arbitrary returns.

A better way would be to remove the RET after the whole shader
is parsed which will handle a possible case when the last RET is
followed by a comment.

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Danylo Piliaiev's avatarDanylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Axel Davy's avatarAxel Davy <davyaxel0@gmail.com>
(cherry picked from commit 2d8f77db)
parent a74657d4
...@@ -1802,7 +1802,13 @@ DECL_SPECIAL(LOOP) ...@@ -1802,7 +1802,13 @@ DECL_SPECIAL(LOOP)
DECL_SPECIAL(RET) DECL_SPECIAL(RET)
{ {
ureg_RET(tx->ureg); /* RET as a last instruction could be safely ignored.
* Remove it to prevent crashes/warnings in case underlying
* driver doesn't implement arbitrary returns.
*/
if (*(tx->parse_next) != NINED3DSP_END) {
ureg_RET(tx->ureg);
}
return D3D_OK; return D3D_OK;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment