OSDN Git Service

glsl/tests: Verify vertex shader built-ins generated by _mesa_glsl_initialize_variables
authorIan Romanick <ian.d.romanick@intel.com>
Thu, 3 Oct 2013 22:05:44 +0000 (15:05 -0700)
committerIan Romanick <ian.d.romanick@intel.com>
Tue, 22 Oct 2013 22:23:30 +0000 (15:23 -0700)
commitd05202900bcbe2d0bb8dabcbb3048f3a31b82bbd
treea2c827d26ae4c540ce52c008f3cb81428e0d8421
parent78b70ceae1c0155b3f832cb052dfb6fff3530ff4
glsl/tests: Verify vertex shader built-ins generated by _mesa_glsl_initialize_variables

Checks that the variables generated meet certain criteria.

 - Vertex shader inputs have an explicit location.

 - Vertex shader outputs have an explicit location.

 - Fragment shader-only varying locations are not used.

 - Vertex shader uniforms and system values don't have an explicit
   location.

 - Vertex shader constants don't have an explicit location and are
   read-only.

 - No other kinds of vertex variables exist.

It does not verify that an specific variables exist.

v2: Fix memory management mistakes in
common_builtin::string_starts_with_prefix.  Clean up error message
reporting in common_builtin::no_invalid_variable_modes.  Both suggested
by Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
src/glsl/Makefile.am
src/glsl/tests/builtin_variable_test.cpp [new file with mode: 0644]