Module: Mesa Branch: staging/19.1 Commit: c6e5e30fd54ef396c49c8bb25c43169537d78623 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=c6e5e30fd54ef396c49c8bb25c43169537d78623
Author: Danylo Piliaiev <[email protected]> Date: Tue Sep 24 14:12:39 2019 +0300 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: <[email protected]> Signed-off-by: Danylo Piliaiev <[email protected]> Reviewed-by: Axel Davy <[email protected]> (cherry picked from commit 2d8f77db839cb3a83f0b1575a028d5aa4258c322) --- src/gallium/state_trackers/nine/nine_shader.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/nine/nine_shader.c b/src/gallium/state_trackers/nine/nine_shader.c index 212fd60255a..1bd513b1f6d 100644 --- a/src/gallium/state_trackers/nine/nine_shader.c +++ b/src/gallium/state_trackers/nine/nine_shader.c @@ -1802,7 +1802,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; } _______________________________________________ mesa-commit mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-commit
