mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 18:18:06 +02:00
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 <danylo.piliaiev@globallogic.com> Reviewed-by: Axel Davy <davyaxel0@gmail.com>
This commit is contained in:
parent
60861388e7
commit
2d8f77db83
1 changed files with 7 additions and 1 deletions
|
|
@ -1803,7 +1803,13 @@ DECL_SPECIAL(LOOP)
|
|||
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue