[Mesa-dev] [PATCH 2/3] glsl: Implement the GLSL 1.30+ discard control flow rule in GLSL IR.

Kenneth Graunke kenneth at whitecape.org
Tue May 8 18:11:54 PDT 2012


On 05/04/2012 01:58 PM, Eric Anholt wrote:
> Previously, I tried implementing this in the i965 driver, but did so
> in a way that violated the intent of the spec, and broke Tropics.
> ---
>   src/glsl/Makefile.sources       |    1 +
>   src/glsl/ir_optimization.h      |    1 +
>   src/glsl/linker.cpp             |   11 +++
>   src/glsl/lower_discard_flow.cpp |  144 +++++++++++++++++++++++++++++++++++++++
>   4 files changed, 157 insertions(+)
>   create mode 100644 src/glsl/lower_discard_flow.cpp

This series seems reasonable to me.  By breaking out of all of the 
loops...and GLSL's lack of recursion...we guarantee that programs will 
terminate.  Yet, we still run through the program as much as possible, 
getting a better derivative...

Still, yeah, that's a weird part of the spec.

For the series:
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the mesa-dev mailing list