OSDN Git Service

nir/builder: Add an init function that creates a simple shader for you
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Dec 2015 17:56:44 +0000 (09:56 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 29 Dec 2015 21:44:05 +0000 (13:44 -0800)
commit0119773ffca586c9e51fa19248c3dfaab0500b25
tree8a2fc7dd315a956146e69c41115cf7e17a5b1e2d
parent55ca5b0e74dff2b2f7df57af332b73e2a1b7d081
nir/builder: Add an init function that creates a simple shader for you

A hugely common case when using nir_builder is to have a shader with a
single function called main.  This adds a helper that gives you just that.
This commit also makes us use it in the NIR control-flow unit tests as well
as tgsi_to_nir and prog_to_nir.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
src/gallium/auxiliary/nir/tgsi_to_nir.c
src/glsl/nir/nir_builder.h
src/glsl/nir/tests/control_flow_tests.cpp
src/mesa/program/prog_to_nir.c