29 shaderconds="$shaderconds$LF$*"
35 parse_conditional $2 $3
38 shadertext="$shadertext$LF$TAB$*"
40 parse_shaderstage_pre()
42 shadertext="$shadertext$LF$TAB{"
44 parse_shaderstage_line()
48 parse_conditional $2 $3
51 shadertext="$shadertext$LF$TAB$TAB$*"
53 parse_shaderstage_post()
55 shadertext="$shadertext$LF$TAB}"
57 # note: the conds are what is FALSE, not TRUE
60 parseALLtheconds=$conds
62 case "$parseALLtheconds" in
67 thiscond=${parseALLtheconds%%$LF*}
68 parseALLtheconds=${parseALLtheconds#*$LF}
71 thiscond=$parseALLtheconds
75 [ -n "$thiscond" ] || continue
76 echo "$TAB""dpshaderkillifcvar $thiscond"
81 echo "$shadertext" | {
83 while IFS= read -r L; do
84 [ -n "$L" ] || continue
90 case "$LF$conds$LF" in
100 if [ -z "$condstack" ]; then
101 err "unmatched #else"
105 condstack=1${condstack#0}
108 condstack=0${condstack#1}
113 if [ -z "$condstack" ]; then
114 err "unmatched #endif"
116 condstack=${condstack#?}
129 if [ -n "$condstack" ]; then
139 echo "$parsing_shader"
148 firstcond="${1%%$LF*}"
157 conds="$conds$LF$firstcond"
158 conditionalize "$restcond"
170 set -- "$1" "$op" "$3"
172 conditionalize "$restcond"
177 allconds=`echo "$shaderconds" | sort -u | grep . || true`
179 conditionalize "$allconds"