From 0bbf59c3052a7b4f6f8330985317adce2bfd0fef Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 11 Jun 2009 14:04:39 +0200 Subject: glsl: Add preprocessor purifier. --- src/SConscript | 1 + src/glsl/pp/SConscript | 21 +++++ src/glsl/pp/sl_pp_purify.c | 204 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_purify.h | 41 +++++++++ 4 files changed, 267 insertions(+) create mode 100644 src/glsl/pp/SConscript create mode 100644 src/glsl/pp/sl_pp_purify.c create mode 100644 src/glsl/pp/sl_pp_purify.h diff --git a/src/SConscript b/src/SConscript index 5440acd1351..1ece895c63a 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,6 +1,7 @@ Import('*') SConscript('gallium/SConscript') +SConscript('glsl/pp/SConscript') if 'mesa' in env['statetrackers']: SConscript('mesa/SConscript') diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript new file mode 100644 index 00000000000..08f202e2367 --- /dev/null +++ b/src/glsl/pp/SConscript @@ -0,0 +1,21 @@ +Import('*') + +if env['platform'] not in ['windows']: + Return() + +env = env.Clone() + +glsl = env.StaticLibrary( + target = 'glsl', + source = [ + 'sl_pp_purify.c', + ], +) + +env = env.Clone() + +if env['platform'] == 'windows': + env.PrependUnique(LIBS = [ + 'user32', + ]) +env.Prepend(LIBS = [glsl]) diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c new file mode 100644 index 00000000000..7fbfc78d426 --- /dev/null +++ b/src/glsl/pp/sl_pp_purify.c @@ -0,0 +1,204 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_purify.h" + + +/* + * Preprocessor purifier performs the following tasks. + * - Convert all variants of newlines into a Unix newline. + * - Merge continued lines into a single long line. + * - Remove line comments and replace block comments with whitespace. + */ + + +static unsigned int +_purify_newline(const char *input, + char *out) +{ + if (input[0] == '\n') { + *out = '\n'; + if (input[1] == '\r') { + /* + * The GLSL spec is not explicit about whether this + * combination is a valid newline or not. + * Let's assume it is acceptable. + */ + return 2; + } + return 1; + } + if (input[0] == '\r') { + *out = '\n'; + if (input[1] == '\n') { + return 2; + } + return 1; + } + *out = input[0]; + return 1; +} + + +static unsigned int +_purify_backslash(const char *input, + char *out) +{ + unsigned int eaten = 0; + + for (;;) { + if (input[0] == '\\') { + char next; + unsigned int next_eaten; + + eaten++; + input++; + + next_eaten = _purify_newline(input, &next); + if (next == '\n') { + /* + * If this is really a line continuation sequence, eat + * it and do not exit the loop. + */ + eaten += next_eaten; + input += next_eaten; + } else { + /* + * It is an error to put anything between a backslash + * and a newline and still expect it to behave like a line + * continuation sequence. + * Even if it is an innocent whitespace. + */ + *out = '\\'; + break; + } + } else { + eaten += _purify_newline(input, out); + break; + } + } + return eaten; +} + + +static unsigned int +_purify_comment(const char *input, + char *out) +{ + unsigned int eaten; + char curr; + + eaten = _purify_backslash(input, &curr); + input += eaten; + if (curr == '/') { + char next; + unsigned int next_eaten; + + next_eaten = _purify_backslash(input, &next); + if (next == '/') { + eaten += next_eaten; + input += next_eaten; + + /* Replace a line comment with either a newline or nil. */ + for (;;) { + next_eaten = _purify_backslash(input, &next); + eaten += next_eaten; + input += next_eaten; + if (next == '\n' || next == '\0') { + *out = next; + return eaten; + } + } + } else if (next == '*') { + eaten += next_eaten; + input += next_eaten; + + /* Replace a block comment with a whitespace. */ + for (;;) { + next_eaten = _purify_backslash(input, &next); + eaten += next_eaten; + input += next_eaten; + while (next == '*') { + next_eaten = _purify_backslash(input, &next); + eaten += next_eaten; + input += next_eaten; + if (next == '/') { + *out = ' '; + return eaten; + } + } + } + } + } + *out = curr; + return eaten; +} + + +int +sl_pp_purify(const char *input, + const struct sl_pp_purify_options *options, + char **output) +{ + char *out = NULL; + unsigned int out_len = 0; + unsigned int out_max = 0; + + for (;;) { + char c; + + input += _purify_comment(input, &c); + + if (out_len >= out_max) { + unsigned int new_max = out_max; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + out = realloc(out, new_max); + if (!out) { + return -1; + } + out_max = new_max; + } + + out[out_len++] = c; + + if (c == '\0') { + break; + } + } + + *output = out; + return 0; +} diff --git a/src/glsl/pp/sl_pp_purify.h b/src/glsl/pp/sl_pp_purify.h new file mode 100644 index 00000000000..011b117937e --- /dev/null +++ b/src/glsl/pp/sl_pp_purify.h @@ -0,0 +1,41 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_PURIFY_H +#define SL_PP_PURIFY_H + +struct sl_pp_purify_options { + unsigned int preserve_columns:1; + unsigned int tab_width:4; +}; + +int +sl_pp_purify(const char *input, + const struct sl_pp_purify_options *options, + char **output); + +#endif /* SL_PP_PURIFY_H */ -- cgit v1.2.3 From 121769eeb314ea580a3292309332ebbf0a409b3c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 11 Jun 2009 18:56:10 +0200 Subject: glsl: Add a purify command-line tool. --- src/SConscript | 1 + src/glsl/apps/SConscript | 18 ++++++++++ src/glsl/apps/purify.c | 93 ++++++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/SConscript | 9 +---- 4 files changed, 113 insertions(+), 8 deletions(-) create mode 100644 src/glsl/apps/SConscript create mode 100644 src/glsl/apps/purify.c diff --git a/src/SConscript b/src/SConscript index 1ece895c63a..28105f71917 100644 --- a/src/SConscript +++ b/src/SConscript @@ -2,6 +2,7 @@ Import('*') SConscript('gallium/SConscript') SConscript('glsl/pp/SConscript') +SConscript('glsl/apps/SConscript') if 'mesa' in env['statetrackers']: SConscript('mesa/SConscript') diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript new file mode 100644 index 00000000000..d68e6b23b35 --- /dev/null +++ b/src/glsl/apps/SConscript @@ -0,0 +1,18 @@ +Import('*') + +if env['platform'] not in ['windows']: + Return() + +env = env.Clone() + +if env['platform'] == 'windows': + env.PrependUnique(LIBS = [ + 'user32', + ]) + +env.Prepend(LIBS = [glsl]) + +env.Program( + target = 'purify', + source = ['purify.c'], +) diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c new file mode 100644 index 00000000000..7dff8aea456 --- /dev/null +++ b/src/glsl/apps/purify.c @@ -0,0 +1,93 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include "../pp/sl_pp_purify.h" + + +int +main(int argc, + char *argv[]) +{ + FILE *in; + long size; + char *inbuf; + struct sl_pp_purify_options options; + char *outbuf; + FILE *out; + + if (argc != 3) { + return 1; + } + + in = fopen(argv[1], "rb"); + if (!in) { + return 1; + } + + fseek(in, 0, SEEK_END); + size = ftell(in); + fseek(in, 0, SEEK_SET); + + inbuf = malloc(size + 1); + if (!inbuf) { + fclose(in); + return 1; + } + + if (fread(inbuf, 1, size, in) != size) { + free(inbuf); + fclose(in); + return 1; + } + inbuf[size] = '\0'; + + fclose(in); + + memset(&options, 0, sizeof(options)); + + if (sl_pp_purify(inbuf, &options, &outbuf)) { + free(inbuf); + return 1; + } + + free(inbuf); + + out = fopen(argv[2], "wb"); + if (!out) { + free(outbuf); + return 1; + } + + fwrite(outbuf, 1, strlen(outbuf), out); + + free(outbuf); + fclose(out); + + return 0; +} diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 08f202e2367..ac58a3e5fd2 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -11,11 +11,4 @@ glsl = env.StaticLibrary( 'sl_pp_purify.c', ], ) - -env = env.Clone() - -if env['platform'] == 'windows': - env.PrependUnique(LIBS = [ - 'user32', - ]) -env.Prepend(LIBS = [glsl]) +Export('glsl') -- cgit v1.2.3 From 2c9a627b48119b3cafc9fb25239fe929bc4cf8d8 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 12 Jun 2009 12:57:29 +0200 Subject: glsl: Add a preprocessor tokeniser. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_token.c | 401 ++++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_token.h | 107 +++++++++++++ 3 files changed, 509 insertions(+) create mode 100644 src/glsl/pp/sl_pp_token.c create mode 100644 src/glsl/pp/sl_pp_token.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index ac58a3e5fd2..a08f5cf6321 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -9,6 +9,7 @@ glsl = env.StaticLibrary( target = 'glsl', source = [ 'sl_pp_purify.c', + 'sl_pp_token.c', ], ) Export('glsl') diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c new file mode 100644 index 00000000000..6402c6a95b2 --- /dev/null +++ b/src/glsl/pp/sl_pp_token.c @@ -0,0 +1,401 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_directive.h" +#include "sl_pp_token.h" + + +static int +_tokenise_identifier(const char **pinput, + struct sl_pp_token_info *info) +{ + const char *input = *pinput; + char identifier[256]; /* XXX: Remove this artifical limit. */ + unsigned int i = 0; + + info->token = SL_PP_IDENTIFIER; + info->data.identifier = NULL; + + identifier[i++] = *input++; + while ((*input >= 'a' && *input <= 'z') || + (*input >= 'A' && *input <= 'Z') || + (*input >= '0' && *input <= '9') || + (*input == '_')) { + if (i >= sizeof(identifier) - 1) { + return -1; + } + identifier[i++] = *input++; + } + identifier[i++] = '\0'; + + info->data.identifier = malloc(i); + if (!info->data.identifier) { + return -1; + } + memcpy(info->data.identifier, identifier, i); + + *pinput = input; + return 0; +} + + +static int +_tokenise_number(const char **pinput, + struct sl_pp_token_info *info) +{ + const char *input = *pinput; + char number[256]; /* XXX: Remove this artifical limit. */ + unsigned int i = 0; + + info->token = SL_PP_NUMBER; + info->data.number = NULL; + + number[i++] = *input++; + while ((*input >= '0' && *input <= '9') || + (*input >= 'a' && *input <= 'f') || + (*input >= 'A' && *input <= 'F') || + (*input == 'x') || + (*input == 'X') || + (*input == '+') || + (*input == '-') || + (*input == '.')) { + if (i >= sizeof(number) - 1) { + return -1; + } + number[i++] = *input++; + } + number[i++] = '\0'; + + info->data.number = malloc(i); + if (!info->data.number) { + return -1; + } + memcpy(info->data.number, number, i); + + *pinput = input; + return 0; +} + + +int +sl_pp_tokenise(const char *input, + struct sl_pp_token_info **output) +{ + struct sl_pp_token_info *out = NULL; + unsigned int out_len = 0; + unsigned int out_max = 0; + + for (;;) { + struct sl_pp_token_info info; + + switch (*input) { + case ' ': + case '\t': + input++; + info.token = SL_PP_WHITESPACE; + break; + + case '\n': + input++; + info.token = SL_PP_NEWLINE; + break; + + case '#': + input++; + info.token = SL_PP_HASH; + break; + + case ',': + input++; + info.token = SL_PP_COMMA; + break; + + case ';': + input++; + info.token = SL_PP_SEMICOLON; + break; + + case '{': + input++; + info.token = SL_PP_LBRACE; + break; + + case '}': + input++; + info.token = SL_PP_RBRACE; + break; + + case '(': + input++; + info.token = SL_PP_LPAREN; + break; + + case ')': + input++; + info.token = SL_PP_RPAREN; + break; + + case '[': + input++; + info.token = SL_PP_LBRACKET; + break; + + case ']': + input++; + info.token = SL_PP_RBRACKET; + break; + + case '.': + if (input[1] >= '0' && input[1] <= '9') { + if (_tokenise_number(&input, &info)) { + free(out); + return -1; + } + } else { + input++; + info.token = SL_PP_DOT; + } + break; + + case '+': + input++; + if (*input == '+') { + input++; + info.token = SL_PP_INCREMENT; + } else if (*input == '=') { + input++; + info.token = SL_PP_ADDASSIGN; + } else { + info.token = SL_PP_PLUS; + } + break; + + case '-': + input++; + if (*input == '-') { + input++; + info.token = SL_PP_DECREMENT; + } else if (*input == '=') { + input++; + info.token = SL_PP_SUBASSIGN; + } else { + info.token = SL_PP_MINUS; + } + break; + + case '~': + input++; + info.token = SL_PP_BITNOT; + break; + + case '!': + input++; + if (*input == '=') { + input++; + info.token = SL_PP_NOTEQUAL; + } else { + info.token = SL_PP_NOT; + } + break; + + case '*': + input++; + if (*input == '=') { + input++; + info.token = SL_PP_MULASSIGN; + } else { + info.token = SL_PP_STAR; + } + break; + + case '/': + input++; + if (*input == '=') { + input++; + info.token = SL_PP_DIVASSIGN; + } else { + info.token = SL_PP_SLASH; + } + break; + + case '%': + input++; + if (*input == '=') { + input++; + info.token = SL_PP_MODASSIGN; + } else { + info.token = SL_PP_MODULO; + } + break; + + case '<': + input++; + if (*input == '<') { + input++; + if (*input == '=') { + input++; + info.token = SL_PP_LSHIFTASSIGN; + } else { + info.token = SL_PP_LSHIFT; + } + } else if (*input == '=') { + input++; + info.token = SL_PP_LESSEQUAL; + } else { + info.token = SL_PP_LESS; + } + break; + + case '>': + input++; + if (*input == '>') { + input++; + if (*input == '=') { + input++; + info.token = SL_PP_RSHIFTASSIGN; + } else { + info.token = SL_PP_RSHIFT; + } + } else if (*input == '=') { + input++; + info.token = SL_PP_GREATEREQUAL; + } else { + info.token = SL_PP_GREATER; + } + break; + + case '=': + input++; + if (*input == '=') { + input++; + info.token = SL_PP_EQUAL; + } else { + info.token = SL_PP_ASSIGN; + } + break; + + case '&': + input++; + if (*input == '&') { + input++; + info.token = SL_PP_AND; + } else if (*input == '=') { + input++; + info.token = SL_PP_BITANDASSIGN; + } else { + info.token = SL_PP_BITAND; + } + break; + + case '^': + input++; + if (*input == '^') { + input++; + info.token = SL_PP_XOR; + } else if (*input == '=') { + input++; + info.token = SL_PP_BITXORASSIGN; + } else { + info.token = SL_PP_BITXOR; + } + break; + + case '|': + input++; + if (*input == '|') { + input++; + info.token = SL_PP_OR; + } else if (*input == '=') { + input++; + info.token = SL_PP_BITORASSIGN; + } else { + info.token = SL_PP_BITOR; + } + break; + + case '?': + input++; + info.token = SL_PP_QUESTION; + break; + + case ':': + input++; + info.token = SL_PP_COLON; + break; + + case '\0': + info.token = SL_PP_EOF; + break; + + default: + if ((*input >= 'a' && *input <= 'z') || + (*input >= 'A' && *input <= 'Z') || + (*input == '_')) { + if (_tokenise_identifier(&input, &info)) { + free(out); + return -1; + } + } else if (*input >= '0' && *input <= '9') { + if (_tokenise_number(&input, &info)) { + free(out); + return -1; + } + } else { + info.data.other = *input++; + info.token = SL_PP_OTHER; + } + } + + if (out_len >= out_max) { + unsigned int new_max = out_max; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + out = realloc(out, new_max * sizeof(struct sl_pp_token_info)); + if (!out) { + return -1; + } + out_max = new_max; + } + + out[out_len++] = info; + + if (info.token == SL_PP_EOF) { + break; + } + } + + *output = out; + return 0; +} diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h new file mode 100644 index 00000000000..5e7fae7d29c --- /dev/null +++ b/src/glsl/pp/sl_pp_token.h @@ -0,0 +1,107 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_TOKEN_H +#define SL_PP_TOKEN_H + + +enum sl_pp_token { + SL_PP_WHITESPACE, + SL_PP_NEWLINE, + SL_PP_HASH, /* # */ + + SL_PP_COMMA, /* , */ + SL_PP_SEMICOLON, /* ; */ + SL_PP_LBRACE, /* { */ + SL_PP_RBRACE, /* } */ + SL_PP_LPAREN, /* ( */ + SL_PP_RPAREN, /* ) */ + SL_PP_LBRACKET, /* [ */ + SL_PP_RBRACKET, /* ] */ + SL_PP_DOT, /* . */ + SL_PP_INCREMENT, /* ++ */ + SL_PP_ADDASSIGN, /* += */ + SL_PP_PLUS, /* + */ + SL_PP_DECREMENT, /* -- */ + SL_PP_SUBASSIGN, /* -= */ + SL_PP_MINUS, /* - */ + SL_PP_BITNOT, /* ~ */ + SL_PP_NOTEQUAL, /* != */ + SL_PP_NOT, /* ! */ + SL_PP_MULASSIGN, /* *= */ + SL_PP_STAR, /* * */ + SL_PP_DIVASSIGN, /* /= */ + SL_PP_SLASH, /* / */ + SL_PP_MODASSIGN, /* %= */ + SL_PP_MODULO, /* % */ + SL_PP_LSHIFTASSIGN, /* <<= */ + SL_PP_LSHIFT, /* << */ + SL_PP_LESSEQUAL, /* <= */ + SL_PP_LESS, /* < */ + SL_PP_RSHIFTASSIGN, /* >>= */ + SL_PP_RSHIFT, /* >> */ + SL_PP_GREATEREQUAL, /* >= */ + SL_PP_GREATER, /* > */ + SL_PP_EQUAL, /* == */ + SL_PP_ASSIGN, /* = */ + SL_PP_AND, /* && */ + SL_PP_BITANDASSIGN, /* &= */ + SL_PP_BITAND, /* & */ + SL_PP_XOR, /* ^^ */ + SL_PP_BITXORASSIGN, /* ^= */ + SL_PP_BITXOR, /* ^ */ + SL_PP_OR, /* || */ + SL_PP_BITORASSIGN, /* |= */ + SL_PP_BITOR, /* | */ + SL_PP_QUESTION, /* ? */ + SL_PP_COLON, /* : */ + + SL_PP_IDENTIFIER, + + SL_PP_NUMBER, + + SL_PP_OTHER, + + SL_PP_EOF +}; + +union sl_pp_token_data { + char *identifier; + char *number; + char other; +}; + +struct sl_pp_token_info { + enum sl_pp_token token; + union sl_pp_token_data data; +}; + +int +sl_pp_tokenise(const char *input, + struct sl_pp_token_info **output); + +#endif /* SL_PP_TOKEN_H */ -- cgit v1.2.3 From 0d5ef796f847bc51888a8883110cc607494a61f0 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 12 Jun 2009 12:57:59 +0200 Subject: glsl: Add a tokenise app. --- src/glsl/apps/SConscript | 5 + src/glsl/apps/tokenise.c | 318 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 323 insertions(+) create mode 100644 src/glsl/apps/tokenise.c diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index d68e6b23b35..6af1e552535 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -16,3 +16,8 @@ env.Program( target = 'purify', source = ['purify.c'], ) + +env.Program( + target = 'tokenise', + source = ['tokenise.c'], +) diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c new file mode 100644 index 00000000000..2631b829986 --- /dev/null +++ b/src/glsl/apps/tokenise.c @@ -0,0 +1,318 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include +#include "../pp/sl_pp_purify.h" +#include "../pp/sl_pp_token.h" + + +int +main(int argc, + char *argv[]) +{ + FILE *in; + long size; + char *inbuf; + struct sl_pp_purify_options options; + char *outbuf; + struct sl_pp_token_info *tokens; + FILE *out; + unsigned int i; + + if (argc != 3) { + return 1; + } + + in = fopen(argv[1], "rb"); + if (!in) { + return 1; + } + + fseek(in, 0, SEEK_END); + size = ftell(in); + fseek(in, 0, SEEK_SET); + + inbuf = malloc(size + 1); + if (!inbuf) { + fclose(in); + return 1; + } + + if (fread(inbuf, 1, size, in) != size) { + free(inbuf); + fclose(in); + return 1; + } + inbuf[size] = '\0'; + + fclose(in); + + memset(&options, 0, sizeof(options)); + + if (sl_pp_purify(inbuf, &options, &outbuf)) { + free(inbuf); + return 1; + } + + free(inbuf); + + if (sl_pp_tokenise(outbuf, &tokens)) { + free(outbuf); + return 1; + } + + free(outbuf); + + out = fopen(argv[2], "wb"); + if (!out) { + free(tokens); + return 1; + } + + for (i = 0; tokens[i].token != SL_PP_EOF; i++) { + switch (tokens[i].token) { + case SL_PP_WHITESPACE: + break; + + case SL_PP_NEWLINE: + fprintf(out, "\n"); + break; + + case SL_PP_HASH: + fprintf(out, "# "); + break; + + case SL_PP_COMMA: + fprintf(out, ", "); + break; + + case SL_PP_SEMICOLON: + fprintf(out, "; "); + break; + + case SL_PP_LBRACE: + fprintf(out, "{ "); + break; + + case SL_PP_RBRACE: + fprintf(out, "} "); + break; + + case SL_PP_LPAREN: + fprintf(out, "( "); + break; + + case SL_PP_RPAREN: + fprintf(out, ") "); + break; + + case SL_PP_LBRACKET: + fprintf(out, "[ "); + break; + + case SL_PP_RBRACKET: + fprintf(out, "] "); + break; + + case SL_PP_DOT: + fprintf(out, ". "); + break; + + case SL_PP_INCREMENT: + fprintf(out, "++ "); + break; + + case SL_PP_ADDASSIGN: + fprintf(out, "+= "); + break; + + case SL_PP_PLUS: + fprintf(out, "+ "); + break; + + case SL_PP_DECREMENT: + fprintf(out, "-- "); + break; + + case SL_PP_SUBASSIGN: + fprintf(out, "-= "); + break; + + case SL_PP_MINUS: + fprintf(out, "- "); + break; + + case SL_PP_BITNOT: + fprintf(out, "~ "); + break; + + case SL_PP_NOTEQUAL: + fprintf(out, "!= "); + break; + + case SL_PP_NOT: + fprintf(out, "! "); + break; + + case SL_PP_MULASSIGN: + fprintf(out, "*= "); + break; + + case SL_PP_STAR: + fprintf(out, "* "); + break; + + case SL_PP_DIVASSIGN: + fprintf(out, "/= "); + break; + + case SL_PP_SLASH: + fprintf(out, "/ "); + break; + + case SL_PP_MODASSIGN: + fprintf(out, "%= "); + break; + + case SL_PP_MODULO: + fprintf(out, "% "); + break; + + case SL_PP_LSHIFTASSIGN: + fprintf(out, "<<= "); + break; + + case SL_PP_LSHIFT: + fprintf(out, "<< "); + break; + + case SL_PP_LESSEQUAL: + fprintf(out, "<= "); + break; + + case SL_PP_LESS: + fprintf(out, "< "); + break; + + case SL_PP_RSHIFTASSIGN: + fprintf(out, ">>= "); + break; + + case SL_PP_RSHIFT: + fprintf(out, ">> "); + break; + + case SL_PP_GREATEREQUAL: + fprintf(out, ">= "); + break; + + case SL_PP_GREATER: + fprintf(out, "> "); + break; + + case SL_PP_EQUAL: + fprintf(out, "== "); + break; + + case SL_PP_ASSIGN: + fprintf(out, "= "); + break; + + case SL_PP_AND: + fprintf(out, "&& "); + break; + + case SL_PP_BITANDASSIGN: + fprintf(out, "&= "); + break; + + case SL_PP_BITAND: + fprintf(out, "& "); + break; + + case SL_PP_XOR: + fprintf(out, "^^ "); + break; + + case SL_PP_BITXORASSIGN: + fprintf(out, "^= "); + break; + + case SL_PP_BITXOR: + fprintf(out, "^ "); + break; + + case SL_PP_OR: + fprintf(out, "|| "); + break; + + case SL_PP_BITORASSIGN: + fprintf(out, "|= "); + break; + + case SL_PP_BITOR: + fprintf(out, "| "); + break; + + case SL_PP_QUESTION: + fprintf(out, "? "); + break; + + case SL_PP_COLON: + fprintf(out, ": "); + break; + + case SL_PP_IDENTIFIER: + fprintf(out, "%s ", tokens[i].data.identifier); + free(tokens[i].data.identifier); + break; + + case SL_PP_NUMBER: + fprintf(out, "(%s) ", tokens[i].data.number); + free(tokens[i].data.number); + break; + + case SL_PP_OTHER: + if (tokens[i].data.other == '\'') { + fprintf(out, "'\\'' "); + } else { + fprintf(out, "'%c' ", tokens[i].data.other); + } + break; + + default: + assert(0); + } + } + + free(tokens); + fclose(out); + + return 0; +} -- cgit v1.2.3 From 229e72956ca6844647bd64d864716b8e21aff89b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 13 Jun 2009 13:43:22 +0200 Subject: glsl: Parse optional version directive. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_version.c | 150 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_version.h | 39 ++++++++++++ 3 files changed, 190 insertions(+) create mode 100644 src/glsl/pp/sl_pp_version.c create mode 100644 src/glsl/pp/sl_pp_version.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index a08f5cf6321..0bc519759d0 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -10,6 +10,7 @@ glsl = env.StaticLibrary( source = [ 'sl_pp_purify.c', 'sl_pp_token.c', + 'sl_pp_version.c', ], ) Export('glsl') diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c new file mode 100644 index 00000000000..f4b4b829d1e --- /dev/null +++ b/src/glsl/pp/sl_pp_version.c @@ -0,0 +1,150 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include "sl_pp_version.h" + + +static int +_parse_integer(const char *input, + unsigned int *number) +{ + unsigned int n = 0; + + while (*input >= '0' && *input <= '9') { + if (n * 10 < n) { + /* Overflow. */ + return -1; + } + + n = n * 10 + (*input++ - '0'); + } + + if (*input != '\0') { + /* Invalid decimal number. */ + return -1; + } + + *number = n; + return 0; +} + + +int +sl_pp_version(const struct sl_pp_token_info *input, + unsigned int *version, + unsigned int *tokens_eaten) +{ + unsigned int i = 0; + int found_hash = 0; + int found_version = 0; + int found_number = 0; + + /* Default values if `#version' is not present. */ + *version = 110; + *tokens_eaten = 0; + + /* Skip whitespace and newlines and seek for hash. */ + while (!found_hash) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + case SL_PP_NEWLINE: + i++; + break; + + case SL_PP_HASH: + i++; + found_hash = 1; + break; + + default: + return 0; + } + } + + /* Skip whitespace and seek for `version'. */ + while (!found_version) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_IDENTIFIER: + if (strcmp(input[i].data.identifier, "version")) { + return 0; + } + i++; + found_version = 1; + break; + + default: + return 0; + } + } + + /* Skip whitespace and seek for version number. */ + while (!found_number) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_NUMBER: + if (_parse_integer(input[i].data.number, version)) { + /* Expected version number. */ + return -1; + } + i++; + found_number = 1; + break; + + default: + /* Expected version number. */ + return -1; + } + } + + /* Skip whitespace and seek for either newline or eof. */ + for (;;) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_NEWLINE: + case SL_PP_EOF: + i++; + *tokens_eaten = i; + return 0; + + default: + /* Expected end of line. */ + return -1; + } + } + + /* Should not get here. */ +} diff --git a/src/glsl/pp/sl_pp_version.h b/src/glsl/pp/sl_pp_version.h new file mode 100644 index 00000000000..7deee1a1349 --- /dev/null +++ b/src/glsl/pp/sl_pp_version.h @@ -0,0 +1,39 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_VERSION_H +#define SL_PP_VERSION_H + +#include "sl_pp_token.h" + + +int +sl_pp_version(const struct sl_pp_token_info *input, + unsigned int *version, + unsigned int *tokens_eaten); + +#endif /* SL_PP_VERSION_H */ -- cgit v1.2.3 From af617c603720cf41ec433f1653cc6dbdcffd8e31 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 13 Jun 2009 13:44:56 +0200 Subject: glsl/apps: Add version test app. --- src/glsl/apps/SConscript | 5 +++ src/glsl/apps/version.c | 110 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 115 insertions(+) create mode 100644 src/glsl/apps/version.c diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index 6af1e552535..ce4c6ec3909 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -21,3 +21,8 @@ env.Program( target = 'tokenise', source = ['tokenise.c'], ) + +env.Program( + target = 'version', + source = ['version.c'], +) diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c new file mode 100644 index 00000000000..e774c4a8f16 --- /dev/null +++ b/src/glsl/apps/version.c @@ -0,0 +1,110 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include +#include "../pp/sl_pp_purify.h" +#include "../pp/sl_pp_version.h" + + +int +main(int argc, + char *argv[]) +{ + FILE *in; + long size; + char *inbuf; + struct sl_pp_purify_options options; + char *outbuf; + struct sl_pp_token_info *tokens; + unsigned int version; + unsigned int tokens_eaten; + FILE *out; + + if (argc != 3) { + return 1; + } + + in = fopen(argv[1], "rb"); + if (!in) { + return 1; + } + + fseek(in, 0, SEEK_END); + size = ftell(in); + fseek(in, 0, SEEK_SET); + + inbuf = malloc(size + 1); + if (!inbuf) { + fclose(in); + return 1; + } + + if (fread(inbuf, 1, size, in) != size) { + free(inbuf); + fclose(in); + return 1; + } + inbuf[size] = '\0'; + + fclose(in); + + memset(&options, 0, sizeof(options)); + + if (sl_pp_purify(inbuf, &options, &outbuf)) { + free(inbuf); + return 1; + } + + free(inbuf); + + if (sl_pp_tokenise(outbuf, &tokens)) { + free(outbuf); + return 1; + } + + free(outbuf); + + if (sl_pp_version(tokens, &version, &tokens_eaten)) { + free(tokens); + return -1; + } + + free(tokens); + + out = fopen(argv[2], "wb"); + if (!out) { + return 1; + } + + fprintf(out, "%u\n", version); + + fclose(out); + + return 0; +} -- cgit v1.2.3 From 474f754282c06014fa0f687c08f4e97323166f83 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 13 Jun 2009 13:50:45 +0200 Subject: glsl: Raise an error on an unfinished comment block. --- src/glsl/pp/sl_pp_purify.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c index 7fbfc78d426..ded4dc8963b 100644 --- a/src/glsl/pp/sl_pp_purify.c +++ b/src/glsl/pp/sl_pp_purify.c @@ -152,6 +152,9 @@ _purify_comment(const char *input, return eaten; } } + if (next == '\0') { + return 0; + } } } } @@ -171,8 +174,13 @@ sl_pp_purify(const char *input, for (;;) { char c; + unsigned int eaten; - input += _purify_comment(input, &c); + eaten = _purify_comment(input, &c); + if (!eaten) { + return -1; + } + input += eaten; if (out_len >= out_max) { unsigned int new_max = out_max; -- cgit v1.2.3 From 55f75c13f05ea6373b95f0777078fcdec226672a Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 13 Jun 2009 19:42:11 +0200 Subject: glsl/apps: Print out the number of tokens eaten in version test. --- src/glsl/apps/version.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index e774c4a8f16..b49395ba97f 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -102,7 +102,10 @@ main(int argc, return 1; } - fprintf(out, "%u\n", version); + fprintf(out, + "%u\n%u\n", + version, + tokens_eaten); fclose(out); -- cgit v1.2.3 From b4e92367f33c8bdd14337ced63abe82685f08cb3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 15 Jun 2009 09:50:48 +0200 Subject: glsl: Allow for multiple version statements. --- src/glsl/pp/sl_pp_version.c | 144 +++++++++++++++++++++++--------------------- 1 file changed, 76 insertions(+), 68 deletions(-) diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index f4b4b829d1e..e743a098417 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -59,90 +59,98 @@ sl_pp_version(const struct sl_pp_token_info *input, unsigned int *tokens_eaten) { unsigned int i = 0; - int found_hash = 0; - int found_version = 0; - int found_number = 0; /* Default values if `#version' is not present. */ *version = 110; *tokens_eaten = 0; - /* Skip whitespace and newlines and seek for hash. */ - while (!found_hash) { - switch (input[i].token) { - case SL_PP_WHITESPACE: - case SL_PP_NEWLINE: - i++; - break; - - case SL_PP_HASH: - i++; - found_hash = 1; - break; - - default: - return 0; + /* There can be multiple `#version' directives present. + * Accept the value of the last one. + */ + for (;;) { + int found_hash = 0; + int found_version = 0; + int found_number = 0; + int found_end = 0; + + /* Skip whitespace and newlines and seek for hash. */ + while (!found_hash) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + case SL_PP_NEWLINE: + i++; + break; + + case SL_PP_HASH: + i++; + found_hash = 1; + break; + + default: + return 0; + } } - } - /* Skip whitespace and seek for `version'. */ - while (!found_version) { - switch (input[i].token) { - case SL_PP_WHITESPACE: - i++; - break; - - case SL_PP_IDENTIFIER: - if (strcmp(input[i].data.identifier, "version")) { + /* Skip whitespace and seek for `version'. */ + while (!found_version) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_IDENTIFIER: + if (strcmp(input[i].data.identifier, "version")) { + return 0; + } + i++; + found_version = 1; + break; + + default: return 0; } - i++; - found_version = 1; - break; - - default: - return 0; } - } - - /* Skip whitespace and seek for version number. */ - while (!found_number) { - switch (input[i].token) { - case SL_PP_WHITESPACE: - i++; - break; - case SL_PP_NUMBER: - if (_parse_integer(input[i].data.number, version)) { + /* Skip whitespace and seek for version number. */ + while (!found_number) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_NUMBER: + if (_parse_integer(input[i].data.number, version)) { + /* Expected version number. */ + return -1; + } + i++; + found_number = 1; + break; + + default: /* Expected version number. */ return -1; } - i++; - found_number = 1; - break; - - default: - /* Expected version number. */ - return -1; } - } - /* Skip whitespace and seek for either newline or eof. */ - for (;;) { - switch (input[i].token) { - case SL_PP_WHITESPACE: - i++; - break; - - case SL_PP_NEWLINE: - case SL_PP_EOF: - i++; - *tokens_eaten = i; - return 0; - - default: - /* Expected end of line. */ - return -1; + /* Skip whitespace and seek for either newline or eof. */ + while (!found_end) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_NEWLINE: + case SL_PP_EOF: + i++; + *tokens_eaten = i; + found_end = 1; + break; + + default: + /* Expected end of line. */ + return -1; + } } } -- cgit v1.2.3 From 5d26deef981d201573252125a8a106b87f66a73c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 15 Jun 2009 10:44:57 +0200 Subject: glsl: Remove bogus sl_pp_directive.h include. --- src/glsl/pp/sl_pp_token.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 6402c6a95b2..4001fe54c8b 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -26,7 +26,6 @@ **************************************************************************/ #include -#include "sl_pp_directive.h" #include "sl_pp_token.h" -- cgit v1.2.3 From 9d336c5264d59e455380a305ee99675e2219ae06 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 15 Jun 2009 11:01:20 +0200 Subject: glsl: Add preprocessor skeleton for directive parsing. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_process.c | 157 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.h | 38 +++++++++++ 3 files changed, 196 insertions(+) create mode 100644 src/glsl/pp/sl_pp_process.c create mode 100644 src/glsl/pp/sl_pp_process.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 0bc519759d0..0be21147946 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -8,6 +8,7 @@ env = env.Clone() glsl = env.StaticLibrary( target = 'glsl', source = [ + 'sl_pp_process.c', 'sl_pp_purify.c', 'sl_pp_token.c', 'sl_pp_version.c', diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c new file mode 100644 index 00000000000..56b8fab52a0 --- /dev/null +++ b/src/glsl/pp/sl_pp_process.c @@ -0,0 +1,157 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include "sl_pp_process.h" + + +enum process_state { + state_seek_hash, + state_seek_directive, + state_seek_newline, + state_expand +}; + +int +sl_pp_process(const struct sl_pp_token_info *input, + struct sl_pp_token_info **output) +{ + unsigned int i = 0; + enum process_state state = state_seek_hash; + struct sl_pp_token_info *out = NULL; + unsigned int out_len = 0; + unsigned int out_max = 0; + + for (;;) { + struct sl_pp_token_info info; + int info_valid = 0; + + switch (input[i].token) { + case SL_PP_WHITESPACE: + /* Drop whitespace alltogether at this point. */ + i++; + break; + + case SL_PP_NEWLINE: + case SL_PP_EOF: + /* Preserve newline just for the sake of line numbering. */ + info = input[i]; + info_valid = 1; + i++; + /* Restart directive parsing. */ + state = state_seek_hash; + break; + + case SL_PP_HASH: + if (state == state_seek_hash) { + i++; + state = state_seek_directive; + } else { + /* Error: unexpected token. */ + return -1; + } + break; + + case SL_PP_IDENTIFIER: + if (state == state_seek_hash) { + info = input[i]; + info_valid = 1; + i++; + state = state_expand; + } else if (state == state_seek_directive) { + i++; + state = state_seek_newline; + } else if (state == state_expand) { + info = input[i]; + info_valid = 1; + i++; + } else { + i++; + } + break; + + default: + if (state == state_seek_hash) { + info = input[i]; + info_valid = 1; + i++; + state = state_expand; + } else if (state == state_seek_directive) { + /* Error: expected directive name. */ + return -1; + } else if (state == state_expand) { + info = input[i]; + info_valid = 1; + i++; + } else { + i++; + } + } + + if (info_valid) { + if (out_len >= out_max) { + unsigned int new_max = out_max; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + out = realloc(out, new_max * sizeof(struct sl_pp_token_info)); + if (!out) { + return -1; + } + out_max = new_max; + } + + if (info.token == SL_PP_IDENTIFIER) { + info.data.identifier = strdup(info.data.identifier); + if (!info.data.identifier) { + return -1; + } + } else if (info.token == SL_PP_NUMBER) { + info.data.number = strdup(info.data.number); + if (!info.data.number) { + return -1; + } + } + + out[out_len++] = info; + + if (info.token == SL_PP_EOF) { + break; + } + } + } + + *output = out; + return 0; +} diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h new file mode 100644 index 00000000000..6e930ca567a --- /dev/null +++ b/src/glsl/pp/sl_pp_process.h @@ -0,0 +1,38 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_PROCESS_H +#define SL_PP_PROCESS_H + +#include "sl_pp_token.h" + + +int +sl_pp_process(const struct sl_pp_token_info *input, + struct sl_pp_token_info **output); + +#endif /* SL_PP_PROCESS_H */ -- cgit v1.2.3 From f24ec185c531d2b2209df01901c90eca57ca711f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 15 Jun 2009 11:02:04 +0200 Subject: glsl: Add `process' test app that returns tokenised and preprocessed text. --- src/glsl/apps/SConscript | 5 + src/glsl/apps/process.c | 323 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 328 insertions(+) create mode 100644 src/glsl/apps/process.c diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index ce4c6ec3909..12a0018d1c2 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -26,3 +26,8 @@ env.Program( target = 'version', source = ['version.c'], ) + +env.Program( + target = 'process', + source = ['process.c'], +) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c new file mode 100644 index 00000000000..6e2828aa411 --- /dev/null +++ b/src/glsl/apps/process.c @@ -0,0 +1,323 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include +#include "../pp/sl_pp_purify.h" +#include "../pp/sl_pp_version.h" +#include "../pp/sl_pp_process.h" + + +int +main(int argc, + char *argv[]) +{ + FILE *in; + long size; + char *inbuf; + struct sl_pp_purify_options options; + char *outbuf; + struct sl_pp_token_info *tokens; + unsigned int version; + unsigned int tokens_eaten; + struct sl_pp_token_info *outtokens; + FILE *out; + unsigned int i; + + if (argc != 3) { + return 1; + } + + in = fopen(argv[1], "rb"); + if (!in) { + return 1; + } + + fseek(in, 0, SEEK_END); + size = ftell(in); + fseek(in, 0, SEEK_SET); + + inbuf = malloc(size + 1); + if (!inbuf) { + fclose(in); + return 1; + } + + if (fread(inbuf, 1, size, in) != size) { + free(inbuf); + fclose(in); + return 1; + } + inbuf[size] = '\0'; + + fclose(in); + + memset(&options, 0, sizeof(options)); + + if (sl_pp_purify(inbuf, &options, &outbuf)) { + free(inbuf); + return 1; + } + + free(inbuf); + + if (sl_pp_tokenise(outbuf, &tokens)) { + free(outbuf); + return 1; + } + + free(outbuf); + + if (sl_pp_version(tokens, &version, &tokens_eaten)) { + free(tokens); + return -1; + } + + if (sl_pp_process(&tokens[tokens_eaten], &outtokens)) { + free(tokens); + return -1; + } + + free(tokens); + + out = fopen(argv[2], "wb"); + if (!out) { + free(outtokens); + return 1; + } + + for (i = 0; outtokens[i].token != SL_PP_EOF; i++) { + switch (outtokens[i].token) { + case SL_PP_NEWLINE: + fprintf(out, "\n"); + break; + + case SL_PP_COMMA: + fprintf(out, ", "); + break; + + case SL_PP_SEMICOLON: + fprintf(out, "; "); + break; + + case SL_PP_LBRACE: + fprintf(out, "{ "); + break; + + case SL_PP_RBRACE: + fprintf(out, "} "); + break; + + case SL_PP_LPAREN: + fprintf(out, "( "); + break; + + case SL_PP_RPAREN: + fprintf(out, ") "); + break; + + case SL_PP_LBRACKET: + fprintf(out, "[ "); + break; + + case SL_PP_RBRACKET: + fprintf(out, "] "); + break; + + case SL_PP_DOT: + fprintf(out, ". "); + break; + + case SL_PP_INCREMENT: + fprintf(out, "++ "); + break; + + case SL_PP_ADDASSIGN: + fprintf(out, "+= "); + break; + + case SL_PP_PLUS: + fprintf(out, "+ "); + break; + + case SL_PP_DECREMENT: + fprintf(out, "-- "); + break; + + case SL_PP_SUBASSIGN: + fprintf(out, "-= "); + break; + + case SL_PP_MINUS: + fprintf(out, "- "); + break; + + case SL_PP_BITNOT: + fprintf(out, "~ "); + break; + + case SL_PP_NOTEQUAL: + fprintf(out, "!= "); + break; + + case SL_PP_NOT: + fprintf(out, "! "); + break; + + case SL_PP_MULASSIGN: + fprintf(out, "*= "); + break; + + case SL_PP_STAR: + fprintf(out, "* "); + break; + + case SL_PP_DIVASSIGN: + fprintf(out, "/= "); + break; + + case SL_PP_SLASH: + fprintf(out, "/ "); + break; + + case SL_PP_MODASSIGN: + fprintf(out, "%= "); + break; + + case SL_PP_MODULO: + fprintf(out, "% "); + break; + + case SL_PP_LSHIFTASSIGN: + fprintf(out, "<<= "); + break; + + case SL_PP_LSHIFT: + fprintf(out, "<< "); + break; + + case SL_PP_LESSEQUAL: + fprintf(out, "<= "); + break; + + case SL_PP_LESS: + fprintf(out, "< "); + break; + + case SL_PP_RSHIFTASSIGN: + fprintf(out, ">>= "); + break; + + case SL_PP_RSHIFT: + fprintf(out, ">> "); + break; + + case SL_PP_GREATEREQUAL: + fprintf(out, ">= "); + break; + + case SL_PP_GREATER: + fprintf(out, "> "); + break; + + case SL_PP_EQUAL: + fprintf(out, "== "); + break; + + case SL_PP_ASSIGN: + fprintf(out, "= "); + break; + + case SL_PP_AND: + fprintf(out, "&& "); + break; + + case SL_PP_BITANDASSIGN: + fprintf(out, "&= "); + break; + + case SL_PP_BITAND: + fprintf(out, "& "); + break; + + case SL_PP_XOR: + fprintf(out, "^^ "); + break; + + case SL_PP_BITXORASSIGN: + fprintf(out, "^= "); + break; + + case SL_PP_BITXOR: + fprintf(out, "^ "); + break; + + case SL_PP_OR: + fprintf(out, "|| "); + break; + + case SL_PP_BITORASSIGN: + fprintf(out, "|= "); + break; + + case SL_PP_BITOR: + fprintf(out, "| "); + break; + + case SL_PP_QUESTION: + fprintf(out, "? "); + break; + + case SL_PP_COLON: + fprintf(out, ": "); + break; + + case SL_PP_IDENTIFIER: + fprintf(out, "%s ", outtokens[i].data.identifier); + free(outtokens[i].data.identifier); + break; + + case SL_PP_NUMBER: + fprintf(out, "(%s) ", outtokens[i].data.number); + free(outtokens[i].data.number); + break; + + case SL_PP_OTHER: + fprintf(out, "%c", outtokens[i].data.other); + break; + + default: + assert(0); + } + } + + free(outtokens); + fclose(out); + + return 0; +} -- cgit v1.2.3 From f24322fbf6599b31f07ebc548e390c77b803d67c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 17 Jun 2009 13:49:06 +0200 Subject: glsl: Introduce sl_pp_context and maintain a reuseable pool of strings. --- src/glsl/apps/process.c | 21 ++++++++----- src/glsl/apps/tokenise.c | 15 ++++++--- src/glsl/apps/version.c | 10 ++++-- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_context.c | 77 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_context.h | 52 ++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 16 ++-------- src/glsl/pp/sl_pp_process.h | 3 +- src/glsl/pp/sl_pp_token.c | 29 ++++++++--------- src/glsl/pp/sl_pp_token.h | 7 +++-- src/glsl/pp/sl_pp_version.c | 35 +++++++++++++++------ src/glsl/pp/sl_pp_version.h | 4 ++- 12 files changed, 213 insertions(+), 57 deletions(-) create mode 100644 src/glsl/pp/sl_pp_context.c create mode 100644 src/glsl/pp/sl_pp_context.h diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 6e2828aa411..abcf1a92b83 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -28,6 +28,7 @@ #include #include #include +#include "../pp/sl_pp_context.h" #include "../pp/sl_pp_purify.h" #include "../pp/sl_pp_version.h" #include "../pp/sl_pp_process.h" @@ -42,6 +43,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + struct sl_pp_context context; struct sl_pp_token_info *tokens; unsigned int version; unsigned int tokens_eaten; @@ -86,19 +88,24 @@ main(int argc, free(inbuf); - if (sl_pp_tokenise(outbuf, &tokens)) { + sl_pp_context_init(&context); + + if (sl_pp_tokenise(&context, outbuf, &tokens)) { + sl_pp_context_destroy(&context); free(outbuf); return 1; } free(outbuf); - if (sl_pp_version(tokens, &version, &tokens_eaten)) { + if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { + sl_pp_context_destroy(&context); free(tokens); return -1; } - if (sl_pp_process(&tokens[tokens_eaten], &outtokens)) { + if (sl_pp_process(&context, &tokens[tokens_eaten], &outtokens)) { + sl_pp_context_destroy(&context); free(tokens); return -1; } @@ -107,6 +114,7 @@ main(int argc, out = fopen(argv[2], "wb"); if (!out) { + sl_pp_context_destroy(&context); free(outtokens); return 1; } @@ -298,13 +306,11 @@ main(int argc, break; case SL_PP_IDENTIFIER: - fprintf(out, "%s ", outtokens[i].data.identifier); - free(outtokens[i].data.identifier); + fprintf(out, "%s ", sl_pp_context_cstr(&context, outtokens[i].data.identifier)); break; case SL_PP_NUMBER: - fprintf(out, "(%s) ", outtokens[i].data.number); - free(outtokens[i].data.number); + fprintf(out, "%s ", sl_pp_context_cstr(&context, outtokens[i].data.number)); break; case SL_PP_OTHER: @@ -316,6 +322,7 @@ main(int argc, } } + sl_pp_context_destroy(&context); free(outtokens); fclose(out); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 2631b829986..b5092ba35f6 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -28,6 +28,7 @@ #include #include #include +#include "../pp/sl_pp_context.h" #include "../pp/sl_pp_purify.h" #include "../pp/sl_pp_token.h" @@ -41,6 +42,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + struct sl_pp_context context; struct sl_pp_token_info *tokens; FILE *out; unsigned int i; @@ -82,7 +84,10 @@ main(int argc, free(inbuf); - if (sl_pp_tokenise(outbuf, &tokens)) { + sl_pp_context_init(&context); + + if (sl_pp_tokenise(&context, outbuf, &tokens)) { + sl_pp_context_destroy(&context); free(outbuf); return 1; } @@ -91,6 +96,7 @@ main(int argc, out = fopen(argv[2], "wb"); if (!out) { + sl_pp_context_destroy(&context); free(tokens); return 1; } @@ -289,13 +295,11 @@ main(int argc, break; case SL_PP_IDENTIFIER: - fprintf(out, "%s ", tokens[i].data.identifier); - free(tokens[i].data.identifier); + fprintf(out, "%s ", sl_pp_context_cstr(&context, tokens[i].data.identifier)); break; case SL_PP_NUMBER: - fprintf(out, "(%s) ", tokens[i].data.number); - free(tokens[i].data.number); + fprintf(out, "(%s) ", sl_pp_context_cstr(&context, tokens[i].data.number)); break; case SL_PP_OTHER: @@ -311,6 +315,7 @@ main(int argc, } } + sl_pp_context_destroy(&context); free(tokens); fclose(out); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index b49395ba97f..c56ae9dde9a 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -41,6 +41,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + struct sl_pp_context context; struct sl_pp_token_info *tokens; unsigned int version; unsigned int tokens_eaten; @@ -83,18 +84,23 @@ main(int argc, free(inbuf); - if (sl_pp_tokenise(outbuf, &tokens)) { + sl_pp_context_init(&context); + + if (sl_pp_tokenise(&context, outbuf, &tokens)) { + sl_pp_context_destroy(&context); free(outbuf); return 1; } free(outbuf); - if (sl_pp_version(tokens, &version, &tokens_eaten)) { + if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { + sl_pp_context_destroy(&context); free(tokens); return -1; } + sl_pp_context_destroy(&context); free(tokens); out = fopen(argv[2], "wb"); diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 0be21147946..3d4a1cb967c 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -8,6 +8,7 @@ env = env.Clone() glsl = env.StaticLibrary( target = 'glsl', source = [ + 'sl_pp_context.c', 'sl_pp_process.c', 'sl_pp_purify.c', 'sl_pp_token.c', diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c new file mode 100644 index 00000000000..71712de1fe2 --- /dev/null +++ b/src/glsl/pp/sl_pp_context.c @@ -0,0 +1,77 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_context.h" + + +void +sl_pp_context_init(struct sl_pp_context *context) +{ + memset(context, 0, sizeof(struct sl_pp_context)); +} + +void +sl_pp_context_destroy(struct sl_pp_context *context) +{ + free(context->cstr_pool); +} + +int +sl_pp_context_add_str(struct sl_pp_context *context, + const char *str) +{ + unsigned int size; + unsigned int offset; + + size = strlen(str) + 1; + + if (context->cstr_pool_len + size > context->cstr_pool_max) { + context->cstr_pool_max = (context->cstr_pool_len + size + 0xffff) & ~0xffff; + context->cstr_pool = realloc(context->cstr_pool, context->cstr_pool_max); + } + + if (!context->cstr_pool) { + return -1; + } + + offset = context->cstr_pool_len; + memcpy(&context->cstr_pool[offset], str, size); + context->cstr_pool_len += size; + + return offset; +} + +const char * +sl_pp_context_cstr(const struct sl_pp_context *context, + int offset) +{ + if (offset == -1) { + return NULL; + } + return &context->cstr_pool[offset]; +} diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h new file mode 100644 index 00000000000..3a1e215625c --- /dev/null +++ b/src/glsl/pp/sl_pp_context.h @@ -0,0 +1,52 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_CONTEXT_H +#define SL_PP_CONTEXT_H + + +struct sl_pp_context { + char *cstr_pool; + unsigned int cstr_pool_max; + unsigned int cstr_pool_len; +}; + +void +sl_pp_context_init(struct sl_pp_context *context); + +void +sl_pp_context_destroy(struct sl_pp_context *context); + +int +sl_pp_context_add_str(struct sl_pp_context *context, + const char *str); + +const char * +sl_pp_context_cstr(const struct sl_pp_context *context, + int offset); + +#endif /* SL_PP_VERSION_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 56b8fab52a0..a97c750de46 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -26,7 +26,6 @@ **************************************************************************/ #include -#include #include "sl_pp_process.h" @@ -38,7 +37,8 @@ enum process_state { }; int -sl_pp_process(const struct sl_pp_token_info *input, +sl_pp_process(struct sl_pp_context *context, + const struct sl_pp_token_info *input, struct sl_pp_token_info **output) { unsigned int i = 0; @@ -132,18 +132,6 @@ sl_pp_process(const struct sl_pp_token_info *input, out_max = new_max; } - if (info.token == SL_PP_IDENTIFIER) { - info.data.identifier = strdup(info.data.identifier); - if (!info.data.identifier) { - return -1; - } - } else if (info.token == SL_PP_NUMBER) { - info.data.number = strdup(info.data.number); - if (!info.data.number) { - return -1; - } - } - out[out_len++] = info; if (info.token == SL_PP_EOF) { diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 6e930ca567a..b71ee4466a1 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -32,7 +32,8 @@ int -sl_pp_process(const struct sl_pp_token_info *input, +sl_pp_process(struct sl_pp_context *context, + const struct sl_pp_token_info *input, struct sl_pp_token_info **output); #endif /* SL_PP_PROCESS_H */ diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 4001fe54c8b..e200b961aaf 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -30,7 +30,8 @@ static int -_tokenise_identifier(const char **pinput, +_tokenise_identifier(struct sl_pp_context *context, + const char **pinput, struct sl_pp_token_info *info) { const char *input = *pinput; @@ -38,7 +39,7 @@ _tokenise_identifier(const char **pinput, unsigned int i = 0; info->token = SL_PP_IDENTIFIER; - info->data.identifier = NULL; + info->data.identifier = -1; identifier[i++] = *input++; while ((*input >= 'a' && *input <= 'z') || @@ -52,11 +53,10 @@ _tokenise_identifier(const char **pinput, } identifier[i++] = '\0'; - info->data.identifier = malloc(i); - if (!info->data.identifier) { + info->data.identifier = sl_pp_context_add_str(context, identifier); + if (info->data.identifier == -1) { return -1; } - memcpy(info->data.identifier, identifier, i); *pinput = input; return 0; @@ -64,7 +64,8 @@ _tokenise_identifier(const char **pinput, static int -_tokenise_number(const char **pinput, +_tokenise_number(struct sl_pp_context *context, + const char **pinput, struct sl_pp_token_info *info) { const char *input = *pinput; @@ -72,7 +73,7 @@ _tokenise_number(const char **pinput, unsigned int i = 0; info->token = SL_PP_NUMBER; - info->data.number = NULL; + info->data.number = -1; number[i++] = *input++; while ((*input >= '0' && *input <= '9') || @@ -90,11 +91,10 @@ _tokenise_number(const char **pinput, } number[i++] = '\0'; - info->data.number = malloc(i); - if (!info->data.number) { + info->data.number = sl_pp_context_add_str(context, number); + if (info->data.number == -1) { return -1; } - memcpy(info->data.number, number, i); *pinput = input; return 0; @@ -102,7 +102,8 @@ _tokenise_number(const char **pinput, int -sl_pp_tokenise(const char *input, +sl_pp_tokenise(struct sl_pp_context *context, + const char *input, struct sl_pp_token_info **output) { struct sl_pp_token_info *out = NULL; @@ -171,7 +172,7 @@ sl_pp_tokenise(const char *input, case '.': if (input[1] >= '0' && input[1] <= '9') { - if (_tokenise_number(&input, &info)) { + if (_tokenise_number(context, &input, &info)) { free(out); return -1; } @@ -355,12 +356,12 @@ sl_pp_tokenise(const char *input, if ((*input >= 'a' && *input <= 'z') || (*input >= 'A' && *input <= 'Z') || (*input == '_')) { - if (_tokenise_identifier(&input, &info)) { + if (_tokenise_identifier(context, &input, &info)) { free(out); return -1; } } else if (*input >= '0' && *input <= '9') { - if (_tokenise_number(&input, &info)) { + if (_tokenise_number(context, &input, &info)) { free(out); return -1; } diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 5e7fae7d29c..c801804ae6e 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -90,8 +90,8 @@ enum sl_pp_token { }; union sl_pp_token_data { - char *identifier; - char *number; + int identifier; + int number; char other; }; @@ -101,7 +101,8 @@ struct sl_pp_token_info { }; int -sl_pp_tokenise(const char *input, +sl_pp_tokenise(struct sl_pp_context *context, + const char *input, struct sl_pp_token_info **output); #endif /* SL_PP_TOKEN_H */ diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index e743a098417..89c3cfa1a5b 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -54,7 +54,8 @@ _parse_integer(const char *input, int -sl_pp_version(const struct sl_pp_token_info *input, +sl_pp_version(struct sl_pp_context *context, + const struct sl_pp_token_info *input, unsigned int *version, unsigned int *tokens_eaten) { @@ -99,11 +100,18 @@ sl_pp_version(const struct sl_pp_token_info *input, break; case SL_PP_IDENTIFIER: - if (strcmp(input[i].data.identifier, "version")) { - return 0; + { + const char *id = sl_pp_context_cstr(context, input[i].data.identifier); + + if (!id) { + return -1; + } + if (strcmp(id, "version")) { + return 0; + } + i++; + found_version = 1; } - i++; - found_version = 1; break; default: @@ -119,12 +127,19 @@ sl_pp_version(const struct sl_pp_token_info *input, break; case SL_PP_NUMBER: - if (_parse_integer(input[i].data.number, version)) { - /* Expected version number. */ - return -1; + { + const char *num = sl_pp_context_cstr(context, input[i].data.number); + + if (!num) { + return -1; + } + if (_parse_integer(num, version)) { + /* Expected version number. */ + return -1; + } + i++; + found_number = 1; } - i++; - found_number = 1; break; default: diff --git a/src/glsl/pp/sl_pp_version.h b/src/glsl/pp/sl_pp_version.h index 7deee1a1349..cee9f55bc6c 100644 --- a/src/glsl/pp/sl_pp_version.h +++ b/src/glsl/pp/sl_pp_version.h @@ -28,11 +28,13 @@ #ifndef SL_PP_VERSION_H #define SL_PP_VERSION_H +#include "sl_pp_context.h" #include "sl_pp_token.h" int -sl_pp_version(const struct sl_pp_token_info *input, +sl_pp_version(struct sl_pp_context *context, + const struct sl_pp_token_info *input, unsigned int *version, unsigned int *tokens_eaten); -- cgit v1.2.3 From 3ce5e668180748e2eccd1a8d3931ab98c2919df3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 17 Jun 2009 20:29:46 +0200 Subject: glsl: Simplify directive parser skeleton. --- src/glsl/pp/sl_pp_context.h | 2 +- src/glsl/pp/sl_pp_process.c | 229 +++++++++++++++++++++++++++----------------- src/glsl/pp/sl_pp_process.h | 1 + 3 files changed, 141 insertions(+), 91 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 3a1e215625c..e4686b89e33 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -49,4 +49,4 @@ const char * sl_pp_context_cstr(const struct sl_pp_context *context, int offset); -#endif /* SL_PP_VERSION_H */ +#endif /* SL_PP_CONTEXT_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index a97c750de46..1005c501050 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -29,117 +29,166 @@ #include "sl_pp_process.h" -enum process_state { - state_seek_hash, - state_seek_directive, - state_seek_newline, - state_expand +static void +skip_whitespace(const struct sl_pp_token_info *input, + unsigned int *pi) +{ + while (input[*pi].token == SL_PP_WHITESPACE) { + (*pi)++; + } +} + + +struct process_state { + struct sl_pp_token_info *out; + unsigned int out_len; + unsigned int out_max; }; + +static int +out_token(struct process_state *state, + const struct sl_pp_token_info *token) +{ + if (state->out_len >= state->out_max) { + unsigned int new_max = state->out_max; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + state->out = realloc(state->out, new_max * sizeof(struct sl_pp_token_info)); + if (!state->out) { + return -1; + } + state->out_max = new_max; + } + + state->out[state->out_len++] = *token; + return 0; +} + + int sl_pp_process(struct sl_pp_context *context, const struct sl_pp_token_info *input, struct sl_pp_token_info **output) { unsigned int i = 0; - enum process_state state = state_seek_hash; - struct sl_pp_token_info *out = NULL; - unsigned int out_len = 0; - unsigned int out_max = 0; - - for (;;) { - struct sl_pp_token_info info; - int info_valid = 0; - - switch (input[i].token) { - case SL_PP_WHITESPACE: - /* Drop whitespace alltogether at this point. */ - i++; - break; + int found_eof = 0; + struct process_state state; + + memset(&state, 0, sizeof(state)); - case SL_PP_NEWLINE: - case SL_PP_EOF: - /* Preserve newline just for the sake of line numbering. */ - info = input[i]; - info_valid = 1; + while (!found_eof) { + skip_whitespace(input, &i); + if (input[i].token == SL_PP_HASH) { i++; - /* Restart directive parsing. */ - state = state_seek_hash; - break; + skip_whitespace(input, &i); + switch (input[i].token) { + case SL_PP_IDENTIFIER: + { + const char *name; + int found_eol = 0; + + name = sl_pp_context_cstr(context, input[i].data.identifier); + i++; + skip_whitespace(input, &i); + + while (!found_eol) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + /* Drop whitespace all together at this point. */ + i++; + break; + + case SL_PP_NEWLINE: + /* Preserve newline just for the sake of line numbering. */ + if (out_token(&state, &input[i])) { + return -1; + } + i++; + found_eol = 1; + break; + + case SL_PP_EOF: + if (out_token(&state, &input[i])) { + return -1; + } + i++; + found_eof = 1; + found_eol = 1; + break; + + default: + i++; + } + } + } + break; - case SL_PP_HASH: - if (state == state_seek_hash) { + case SL_PP_NEWLINE: + /* Empty directive. */ + if (out_token(&state, &input[i])) { + return -1; + } i++; - state = state_seek_directive; - } else { - /* Error: unexpected token. */ - return -1; - } - break; + break; - case SL_PP_IDENTIFIER: - if (state == state_seek_hash) { - info = input[i]; - info_valid = 1; - i++; - state = state_expand; - } else if (state == state_seek_directive) { - i++; - state = state_seek_newline; - } else if (state == state_expand) { - info = input[i]; - info_valid = 1; - i++; - } else { + case SL_PP_EOF: + /* Empty directive. */ + if (out_token(&state, &input[i])) { + return -1; + } i++; - } - break; + found_eof = 1; + break; - default: - if (state == state_seek_hash) { - info = input[i]; - info_valid = 1; - i++; - state = state_expand; - } else if (state == state_seek_directive) { - /* Error: expected directive name. */ + default: return -1; - } else if (state == state_expand) { - info = input[i]; - info_valid = 1; - i++; - } else { - i++; } - } - - if (info_valid) { - if (out_len >= out_max) { - unsigned int new_max = out_max; - - if (new_max < 0x100) { - new_max = 0x100; - } else if (new_max < 0x10000) { - new_max *= 2; - } else { - new_max += 0x10000; + } else { + int found_eol = 0; + + while (!found_eol) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + /* Drop whitespace all together at this point. */ + i++; + break; + + case SL_PP_NEWLINE: + /* Preserve newline just for the sake of line numbering. */ + if (out_token(&state, &input[i])) { + return -1; + } + i++; + found_eol = 1; + break; + + case SL_PP_EOF: + if (out_token(&state, &input[i])) { + return -1; + } + i++; + found_eof = 1; + found_eol = 1; + break; + + default: + if (out_token(&state, &input[i])) { + return -1; + } + i++; } - - out = realloc(out, new_max * sizeof(struct sl_pp_token_info)); - if (!out) { - return -1; - } - out_max = new_max; - } - - out[out_len++] = info; - - if (info.token == SL_PP_EOF) { - break; } } } - *output = out; + *output = state.out; return 0; } diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index b71ee4466a1..d6401de960e 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -28,6 +28,7 @@ #ifndef SL_PP_PROCESS_H #define SL_PP_PROCESS_H +#include "sl_pp_context.h" #include "sl_pp_token.h" -- cgit v1.2.3 From fd991d845a5f639b9b675a4840ad234c151d56b4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 19 Jun 2009 12:02:28 +0200 Subject: glsl: Parse define directive in preprocessor. --- src/glsl/pp/SConscript | 2 + src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 4 ++ src/glsl/pp/sl_pp_define.c | 156 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_macro.c | 51 +++++++++++++++ src/glsl/pp/sl_pp_macro.h | 50 ++++++++++++++ src/glsl/pp/sl_pp_process.c | 29 ++++++-- src/glsl/pp/sl_pp_process.h | 8 +++ 8 files changed, 296 insertions(+), 5 deletions(-) create mode 100644 src/glsl/pp/sl_pp_define.c create mode 100644 src/glsl/pp/sl_pp_macro.c create mode 100644 src/glsl/pp/sl_pp_macro.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 3d4a1cb967c..1fde3dfccf3 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -9,6 +9,8 @@ glsl = env.StaticLibrary( target = 'glsl', source = [ 'sl_pp_context.c', + 'sl_pp_define.c', + 'sl_pp_macro.c', 'sl_pp_process.c', 'sl_pp_purify.c', 'sl_pp_token.c', diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 71712de1fe2..8722376ae52 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -39,6 +39,7 @@ void sl_pp_context_destroy(struct sl_pp_context *context) { free(context->cstr_pool); + sl_pp_macro_free(context->macro); } int diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index e4686b89e33..cb81f73ab9e 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -28,11 +28,15 @@ #ifndef SL_PP_CONTEXT_H #define SL_PP_CONTEXT_H +#include "sl_pp_macro.h" + struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; unsigned int cstr_pool_len; + + struct sl_pp_macro *macro; }; void diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c new file mode 100644 index 00000000000..5ce0f0551b8 --- /dev/null +++ b/src/glsl/pp/sl_pp_define.c @@ -0,0 +1,156 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_process.h" + + +static void +skip_whitespace(const struct sl_pp_token_info *input, + unsigned int *first, + unsigned int last) +{ + while (*first < last && input[*first].token == SL_PP_WHITESPACE) { + (*first)++; + } +} + + +static int +_parse_formal_args(const struct sl_pp_token_info *input, + unsigned int *first, + unsigned int last, + struct sl_pp_macro *macro) +{ + struct sl_pp_macro_formal_arg **arg; + + skip_whitespace(input, first, last); + if (*first < last) { + if (input[*first].token == SL_PP_RPAREN) { + (*first)++; + return 0; + } + } else { + /* Expected either an identifier or `)'. */ + return -1; + } + + arg = ¯o->arg; + + for (;;) { + if (*first < last && input[*first].token != SL_PP_IDENTIFIER) { + /* Expected an identifier. */ + return -1; + } + + *arg = malloc(sizeof(struct sl_pp_macro_formal_arg)); + if (!*arg) { + return -1; + } + + (**arg).name = input[*first].data.identifier; + (*first)++; + + (**arg).next = NULL; + arg = &(**arg).next; + + skip_whitespace(input, first, last); + if (*first < last) { + if (input[*first].token == SL_PP_COMMA) { + (*first)++; + } else if (input[*first].token == SL_PP_RPAREN) { + (*first)++; + return 0; + } else { + /* Expected either `,' or `)'. */ + return -1; + } + } else { + /* Expected either `,' or `)'. */ + return -1; + } + } +} + + +int +sl_pp_process_define(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_macro *macro) +{ + macro->name = -1; + macro->arg = NULL; + macro->body = NULL; + macro->next = NULL; + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + macro->name = input[first].data.identifier; + first++; + } + + if (macro->name == -1) { + return -1; + } + + /* + * If there is no whitespace between macro name and left paren, a macro + * formal argument list follows. This is the only place where the presence + * of a whitespace matters and it's the only reason why we are dealing + * with whitespace at this level. + */ + if (first < last && input[first].token == SL_PP_LPAREN) { + first++; + if (_parse_formal_args(input, &first, last, macro)) { + return -1; + } + } + + /* Trim whitespace from the left side. */ + skip_whitespace(input, &first, last); + + /* Trom whitespace from the right side. */ + while (first < last && input[last - 1].token == SL_PP_WHITESPACE) { + last--; + } + + /* All that is left between first and last is the macro definition. */ + macro->body_len = last - first; + if (macro->body_len) { + macro->body = malloc(sizeof(struct sl_pp_token_info) * macro->body_len); + if (!macro->body) { + return -1; + } + + memcpy(macro->body, + &input[first], + sizeof(struct sl_pp_token_info) * macro->body_len); + } + + return 0; +} diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c new file mode 100644 index 00000000000..eed09783040 --- /dev/null +++ b/src/glsl/pp/sl_pp_macro.c @@ -0,0 +1,51 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_macro.h" + + +void +sl_pp_macro_free(struct sl_pp_macro *macro) +{ + while (macro) { + struct sl_pp_macro *next_macro = macro->next; + struct sl_pp_macro_formal_arg *arg = macro->arg; + + while (arg) { + struct sl_pp_macro_formal_arg *next_arg = arg->next; + + free(arg); + arg = next_arg; + } + + free(macro->body); + + free(macro); + macro = next_macro; + } +} diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h new file mode 100644 index 00000000000..4ebbff55906 --- /dev/null +++ b/src/glsl/pp/sl_pp_macro.h @@ -0,0 +1,50 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_MACRO_H +#define SL_PP_MACRO_H + +#include "sl_pp_token.h" + + +struct sl_pp_macro_formal_arg { + int name; + struct sl_pp_macro_formal_arg *next; +}; + +struct sl_pp_macro { + int name; + struct sl_pp_macro_formal_arg *arg; + struct sl_pp_token_info *body; + unsigned int body_len; + struct sl_pp_macro *next; +}; + +void +sl_pp_macro_free(struct sl_pp_macro *macro); + +#endif /* SL_PP_MACRO_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 1005c501050..2a375df71a4 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -80,8 +80,10 @@ sl_pp_process(struct sl_pp_context *context, { unsigned int i = 0; int found_eof = 0; + struct sl_pp_macro **macro; struct process_state state; + macro = &context->macro; memset(&state, 0, sizeof(state)); while (!found_eof) { @@ -94,18 +96,18 @@ sl_pp_process(struct sl_pp_context *context, { const char *name; int found_eol = 0; + unsigned int first; + unsigned int last; + /* Directive name. */ name = sl_pp_context_cstr(context, input[i].data.identifier); i++; skip_whitespace(input, &i); + first = i; + while (!found_eol) { switch (input[i].token) { - case SL_PP_WHITESPACE: - /* Drop whitespace all together at this point. */ - i++; - break; - case SL_PP_NEWLINE: /* Preserve newline just for the sake of line numbering. */ if (out_token(&state, &input[i])) { @@ -128,6 +130,23 @@ sl_pp_process(struct sl_pp_context *context, i++; } } + + last = i - 1; + + if (!strcmp(name, "define")) { + *macro = malloc(sizeof(struct sl_pp_macro)); + if (!*macro) { + return -1; + } + + if (sl_pp_process_define(context, input, first, last, *macro)) { + return -1; + } + + macro = &(**macro).next; + } else { + /* XXX: Ignore. */ + } } break; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index d6401de960e..f7df9a2850a 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -29,6 +29,7 @@ #define SL_PP_PROCESS_H #include "sl_pp_context.h" +#include "sl_pp_macro.h" #include "sl_pp_token.h" @@ -37,4 +38,11 @@ sl_pp_process(struct sl_pp_context *context, const struct sl_pp_token_info *input, struct sl_pp_token_info **output); +int +sl_pp_process_define(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_macro *macro); + #endif /* SL_PP_PROCESS_H */ -- cgit v1.2.3 From 5e8e3cddae9b2797cfa525c643c701debe2f4c04 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sun, 21 Jun 2009 17:03:15 +0200 Subject: glsl: Rename sl_pp_context_add_str to sl_pp_context_add_unique_str. Return the same offset for same strings. Allows to compare strings by comparing their's offsets. --- src/glsl/pp/sl_pp_context.c | 20 +++++++++++++++++--- src/glsl/pp/sl_pp_context.h | 4 ++-- src/glsl/pp/sl_pp_token.c | 4 ++-- src/glsl/pp/sl_pp_token.h | 2 ++ 4 files changed, 23 insertions(+), 7 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 8722376ae52..6d3076b8697 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -43,14 +43,28 @@ sl_pp_context_destroy(struct sl_pp_context *context) } int -sl_pp_context_add_str(struct sl_pp_context *context, - const char *str) +sl_pp_context_add_unique_str(struct sl_pp_context *context, + const char *str) { unsigned int size; - unsigned int offset; + unsigned int offset = 0; size = strlen(str) + 1; + /* Find out if this is a unique string. */ + while (offset < context->cstr_pool_len) { + const char *str2; + unsigned int size2; + + str2 = &context->cstr_pool[offset]; + size2 = strlen(str2) + 1; + if (size == size2 && !memcmp(str, str2, size - 1)) { + return offset; + } + + offset += size2; + } + if (context->cstr_pool_len + size > context->cstr_pool_max) { context->cstr_pool_max = (context->cstr_pool_len + size + 0xffff) & ~0xffff; context->cstr_pool = realloc(context->cstr_pool, context->cstr_pool_max); diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index cb81f73ab9e..56f70777507 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -46,8 +46,8 @@ void sl_pp_context_destroy(struct sl_pp_context *context); int -sl_pp_context_add_str(struct sl_pp_context *context, - const char *str); +sl_pp_context_add_unique_str(struct sl_pp_context *context, + const char *str); const char * sl_pp_context_cstr(const struct sl_pp_context *context, diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index e200b961aaf..68c8fbe2ec4 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -53,7 +53,7 @@ _tokenise_identifier(struct sl_pp_context *context, } identifier[i++] = '\0'; - info->data.identifier = sl_pp_context_add_str(context, identifier); + info->data.identifier = sl_pp_context_add_unique_str(context, identifier); if (info->data.identifier == -1) { return -1; } @@ -91,7 +91,7 @@ _tokenise_number(struct sl_pp_context *context, } number[i++] = '\0'; - info->data.number = sl_pp_context_add_str(context, number); + info->data.number = sl_pp_context_add_unique_str(context, number); if (info->data.number == -1) { return -1; } diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index c801804ae6e..a53720be802 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -28,6 +28,8 @@ #ifndef SL_PP_TOKEN_H #define SL_PP_TOKEN_H +#include "sl_pp_context.h" + enum sl_pp_token { SL_PP_WHITESPACE, -- cgit v1.2.3 From 6a11d4150cfcdd646c17f8b365b5481c2c583208 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 22 Jun 2009 09:05:29 +0200 Subject: glsl: Implement macro expansion. --- src/glsl/pp/sl_pp_define.c | 38 +++++---- src/glsl/pp/sl_pp_macro.c | 204 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_macro.h | 9 +- src/glsl/pp/sl_pp_process.c | 31 ++++--- src/glsl/pp/sl_pp_process.h | 6 ++ 5 files changed, 259 insertions(+), 29 deletions(-) diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index 5ce0f0551b8..39d14350641 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -48,6 +48,8 @@ _parse_formal_args(const struct sl_pp_token_info *input, { struct sl_pp_macro_formal_arg **arg; + macro->num_args = 0; + skip_whitespace(input, first, last); if (*first < last) { if (input[*first].token == SL_PP_RPAREN) { @@ -78,6 +80,8 @@ _parse_formal_args(const struct sl_pp_token_info *input, (**arg).next = NULL; arg = &(**arg).next; + macro->num_args++; + skip_whitespace(input, first, last); if (*first < last) { if (input[*first].token == SL_PP_COMMA) { @@ -104,7 +108,12 @@ sl_pp_process_define(struct sl_pp_context *context, unsigned int last, struct sl_pp_macro *macro) { + unsigned int i; + unsigned int body_len; + unsigned int j; + macro->name = -1; + macro->num_args = -1; macro->arg = NULL; macro->body = NULL; macro->next = NULL; @@ -131,26 +140,25 @@ sl_pp_process_define(struct sl_pp_context *context, } } - /* Trim whitespace from the left side. */ - skip_whitespace(input, &first, last); + /* Calculate body size, trim out whitespace, make room for EOF. */ + body_len = 1; + for (i = first; i < last; i++) { + if (input[i].token != SL_PP_WHITESPACE) { + body_len++; + } + } - /* Trom whitespace from the right side. */ - while (first < last && input[last - 1].token == SL_PP_WHITESPACE) { - last--; + macro->body = malloc(sizeof(struct sl_pp_token_info) * body_len); + if (!macro->body) { + return -1; } - /* All that is left between first and last is the macro definition. */ - macro->body_len = last - first; - if (macro->body_len) { - macro->body = malloc(sizeof(struct sl_pp_token_info) * macro->body_len); - if (!macro->body) { - return -1; + for (j = 0, i = first; i < last; i++) { + if (input[i].token != SL_PP_WHITESPACE) { + macro->body[j++] = input[i]; } - - memcpy(macro->body, - &input[first], - sizeof(struct sl_pp_token_info) * macro->body_len); } + macro->body[j++].token = SL_PP_EOF; return 0; } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index eed09783040..82591b9d77d 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -27,8 +27,18 @@ #include #include "sl_pp_macro.h" +#include "sl_pp_process.h" +static void +skip_whitespace(const struct sl_pp_token_info *input, + unsigned int *pi) +{ + while (input[*pi].token == SL_PP_WHITESPACE) { + (*pi)++; + } +} + void sl_pp_macro_free(struct sl_pp_macro *macro) { @@ -49,3 +59,197 @@ sl_pp_macro_free(struct sl_pp_macro *macro) macro = next_macro; } } + +int +sl_pp_macro_expand(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int *pi, + struct sl_pp_macro *local, + struct sl_pp_process_state *state) +{ + int macro_name; + struct sl_pp_macro *macro = NULL; + struct sl_pp_macro *actual_arg = NULL; + unsigned int j; + + if (input[*pi].token != SL_PP_IDENTIFIER) { + return -1; + } + + macro_name = input[*pi].data.identifier; + + if (local) { + for (macro = local; macro; macro = macro->next) { + if (macro->name == macro_name) { + break; + } + } + } + + if (!macro) { + for (macro = context->macro; macro; macro = macro->next) { + if (macro->name == macro_name) { + break; + } + } + } + + if (!macro) { + if (sl_pp_process_out(state, &input[*pi])) { + return -1; + } + (*pi)++; + return 0; + } + + (*pi)++; + + if (macro->num_args >= 0) { + skip_whitespace(input, pi); + if (input[*pi].token != SL_PP_LPAREN) { + return -1; + } + (*pi)++; + skip_whitespace(input, pi); + } + + if (macro->num_args > 0) { + struct sl_pp_macro_formal_arg *formal_arg = macro->arg; + struct sl_pp_macro **pmacro = &actual_arg; + + for (j = 0; j < (unsigned int)macro->num_args; j++) { + unsigned int body_len; + unsigned int i; + int done = 0; + unsigned int paren_nesting = 0; + unsigned int k; + + *pmacro = malloc(sizeof(struct sl_pp_macro)); + if (!*pmacro) { + return -1; + } + + (**pmacro).name = formal_arg->name; + (**pmacro).num_args = -1; + (**pmacro).arg = NULL; + (**pmacro).body = NULL; + (**pmacro).next = NULL; + + body_len = 1; + for (i = *pi; !done; i++) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + break; + + case SL_PP_COMMA: + if (!paren_nesting) { + if (j < (unsigned int)macro->num_args - 1) { + done = 1; + } else { + return -1; + } + } else { + body_len++; + } + break; + + case SL_PP_LPAREN: + paren_nesting++; + body_len++; + break; + + case SL_PP_RPAREN: + if (!paren_nesting) { + if (j == (unsigned int)macro->num_args - 1) { + done = 1; + } else { + return -1; + } + } else { + paren_nesting--; + body_len++; + } + break; + + case SL_PP_EOF: + return -1; + + default: + body_len++; + } + } + + (**pmacro).body = malloc(sizeof(struct sl_pp_token_info) * body_len); + if (!(**pmacro).body) { + return -1; + } + + for (done = 0, k = 0, i = *pi; !done; i++) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + break; + + case SL_PP_COMMA: + if (!paren_nesting && j < (unsigned int)macro->num_args - 1) { + done = 1; + } else { + (**pmacro).body[k++] = input[i]; + } + break; + + case SL_PP_LPAREN: + paren_nesting++; + (**pmacro).body[k++] = input[i]; + break; + + case SL_PP_RPAREN: + if (!paren_nesting && j == (unsigned int)macro->num_args - 1) { + done = 1; + } else { + paren_nesting--; + (**pmacro).body[k++] = input[i]; + } + break; + + default: + (**pmacro).body[k++] = input[i]; + } + } + + (**pmacro).body[k++].token = SL_PP_EOF; + (*pi) = i; + + formal_arg = formal_arg->next; + pmacro = &(**pmacro).next; + } + } + + /* Right paren for non-empty argument list has already been eaten. */ + if (macro->num_args == 0) { + skip_whitespace(input, pi); + if (input[*pi].token != SL_PP_RPAREN) { + return -1; + } + (*pi)++; + } + + for (j = 0;;) { + switch (macro->body[j].token) { + case SL_PP_IDENTIFIER: + if (sl_pp_macro_expand(context, macro->body, &j, actual_arg, state)) { + return -1; + } + break; + + case SL_PP_EOF: + sl_pp_macro_free(actual_arg); + return 0; + + default: + if (sl_pp_process_out(state, ¯o->body[j])) { + return -1; + } + j++; + } + } +} diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index 4ebbff55906..eeb338eec45 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -38,13 +38,20 @@ struct sl_pp_macro_formal_arg { struct sl_pp_macro { int name; + int num_args; struct sl_pp_macro_formal_arg *arg; struct sl_pp_token_info *body; - unsigned int body_len; struct sl_pp_macro *next; }; void sl_pp_macro_free(struct sl_pp_macro *macro); +int +sl_pp_macro_expand(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int *pi, + struct sl_pp_macro *local, + struct sl_pp_process_state *state); + #endif /* SL_PP_MACRO_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 2a375df71a4..e930966604c 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -39,16 +39,16 @@ skip_whitespace(const struct sl_pp_token_info *input, } -struct process_state { +struct sl_pp_process_state { struct sl_pp_token_info *out; unsigned int out_len; unsigned int out_max; }; -static int -out_token(struct process_state *state, - const struct sl_pp_token_info *token) +int +sl_pp_process_out(struct sl_pp_process_state *state, + const struct sl_pp_token_info *token) { if (state->out_len >= state->out_max) { unsigned int new_max = state->out_max; @@ -72,7 +72,6 @@ out_token(struct process_state *state, return 0; } - int sl_pp_process(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -81,7 +80,7 @@ sl_pp_process(struct sl_pp_context *context, unsigned int i = 0; int found_eof = 0; struct sl_pp_macro **macro; - struct process_state state; + struct sl_pp_process_state state; macro = &context->macro; memset(&state, 0, sizeof(state)); @@ -110,7 +109,7 @@ sl_pp_process(struct sl_pp_context *context, switch (input[i].token) { case SL_PP_NEWLINE: /* Preserve newline just for the sake of line numbering. */ - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -118,7 +117,7 @@ sl_pp_process(struct sl_pp_context *context, break; case SL_PP_EOF: - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -152,7 +151,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_NEWLINE: /* Empty directive. */ - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -160,7 +159,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_EOF: /* Empty directive. */ - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -182,7 +181,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_NEWLINE: /* Preserve newline just for the sake of line numbering. */ - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -190,7 +189,7 @@ sl_pp_process(struct sl_pp_context *context, break; case SL_PP_EOF: - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; @@ -198,8 +197,14 @@ sl_pp_process(struct sl_pp_context *context, found_eol = 1; break; + case SL_PP_IDENTIFIER: + if (sl_pp_macro_expand(context, input, &i, NULL, &state)) { + return -1; + } + break; + default: - if (out_token(&state, &input[i])) { + if (sl_pp_process_out(&state, &input[i])) { return -1; } i++; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index f7df9a2850a..37cdc4c9a78 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -33,6 +33,8 @@ #include "sl_pp_token.h" +struct sl_pp_process_state; + int sl_pp_process(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -45,4 +47,8 @@ sl_pp_process_define(struct sl_pp_context *context, unsigned int last, struct sl_pp_macro *macro); +int +sl_pp_process_out(struct sl_pp_process_state *state, + const struct sl_pp_token_info *token); + #endif /* SL_PP_PROCESS_H */ -- cgit v1.2.3 From 2dad8ed9d68289ba25a4023da12fc5ddf6a621dd Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 22 Jun 2009 09:14:14 +0200 Subject: glsl: Centralise sl_pp_macro constructor. --- src/glsl/pp/sl_pp_define.c | 6 ------ src/glsl/pp/sl_pp_macro.c | 29 +++++++++++++++++++---------- src/glsl/pp/sl_pp_macro.h | 5 ++++- src/glsl/pp/sl_pp_process.c | 2 +- 4 files changed, 24 insertions(+), 18 deletions(-) diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index 39d14350641..e8a23fedcd8 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -112,12 +112,6 @@ sl_pp_process_define(struct sl_pp_context *context, unsigned int body_len; unsigned int j; - macro->name = -1; - macro->num_args = -1; - macro->arg = NULL; - macro->body = NULL; - macro->next = NULL; - if (first < last && input[first].token == SL_PP_IDENTIFIER) { macro->name = input[first].data.identifier; first++; diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 82591b9d77d..0138270c67b 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -30,13 +30,17 @@ #include "sl_pp_process.h" -static void -skip_whitespace(const struct sl_pp_token_info *input, - unsigned int *pi) +struct sl_pp_macro * +sl_pp_macro_new(void) { - while (input[*pi].token == SL_PP_WHITESPACE) { - (*pi)++; + struct sl_pp_macro *macro; + + macro = calloc(1, sizeof(struct sl_pp_macro)); + if (macro) { + macro->name = -1; + macro->num_args = -1; } + return macro; } void @@ -60,6 +64,15 @@ sl_pp_macro_free(struct sl_pp_macro *macro) } } +static void +skip_whitespace(const struct sl_pp_token_info *input, + unsigned int *pi) +{ + while (input[*pi].token == SL_PP_WHITESPACE) { + (*pi)++; + } +} + int sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -124,16 +137,12 @@ sl_pp_macro_expand(struct sl_pp_context *context, unsigned int paren_nesting = 0; unsigned int k; - *pmacro = malloc(sizeof(struct sl_pp_macro)); + *pmacro = sl_pp_macro_new(); if (!*pmacro) { return -1; } (**pmacro).name = formal_arg->name; - (**pmacro).num_args = -1; - (**pmacro).arg = NULL; - (**pmacro).body = NULL; - (**pmacro).next = NULL; body_len = 1; for (i = *pi; !done; i++) { diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index eeb338eec45..63edd21aa24 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -38,12 +38,15 @@ struct sl_pp_macro_formal_arg { struct sl_pp_macro { int name; - int num_args; + int num_args; /* -1 means no args, 0 means `()' */ struct sl_pp_macro_formal_arg *arg; struct sl_pp_token_info *body; struct sl_pp_macro *next; }; +struct sl_pp_macro * +sl_pp_macro_new(void); + void sl_pp_macro_free(struct sl_pp_macro *macro); diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index e930966604c..baffaf2cd95 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -133,7 +133,7 @@ sl_pp_process(struct sl_pp_context *context, last = i - 1; if (!strcmp(name, "define")) { - *macro = malloc(sizeof(struct sl_pp_macro)); + *macro = sl_pp_macro_new(); if (!*macro) { return -1; } -- cgit v1.2.3 From 3bb446ba6e890bc3f60a34318a5a0fe860e53cbb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 26 Jun 2009 10:59:25 +0200 Subject: glsl: Add expression interpreter. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_expression.c | 407 +++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_expression.h | 40 ++++ 3 files changed, 448 insertions(+) create mode 100644 src/glsl/pp/sl_pp_expression.c create mode 100644 src/glsl/pp/sl_pp_expression.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 1fde3dfccf3..623d2362ce0 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -10,6 +10,7 @@ glsl = env.StaticLibrary( source = [ 'sl_pp_context.c', 'sl_pp_define.c', + 'sl_pp_expression.c', 'sl_pp_macro.c', 'sl_pp_process.c', 'sl_pp_purify.c', diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c new file mode 100644 index 00000000000..a692430abbf --- /dev/null +++ b/src/glsl/pp/sl_pp_expression.c @@ -0,0 +1,407 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_expression.h" + + +struct parse_context { + struct sl_pp_context *context; + const struct sl_pp_token_info *input; +}; + +static int +_parse_or(struct parse_context *ctx, + int *result); + +static int +_parse_primary(struct parse_context *ctx, + int *result) +{ + if (ctx->input->token == SL_PP_NUMBER) { + *result = atoi(sl_pp_context_cstr(ctx->context, ctx->input->data.number)); + ctx->input++; + } else { + if (ctx->input->token != SL_PP_LPAREN) { + return -1; + } + ctx->input++; + if (_parse_or(ctx, result)) { + return -1; + } + if (ctx->input->token != SL_PP_RPAREN) { + return -1; + } + ctx->input++; + } + return 0; +} + +static int +_parse_unary(struct parse_context *ctx, + int *result) +{ + if (!_parse_primary(ctx, result)) { + return 0; + } + + switch (ctx->input->token) { + case SL_PP_PLUS: + ctx->input++; + if (_parse_unary(ctx, result)) { + return -1; + } + *result = +*result; + break; + + case SL_PP_MINUS: + ctx->input++; + if (_parse_unary(ctx, result)) { + return -1; + } + *result = -*result; + break; + + case SL_PP_NOT: + ctx->input++; + if (_parse_unary(ctx, result)) { + return -1; + } + *result = !*result; + break; + + case SL_PP_BITNOT: + ctx->input++; + if (_parse_unary(ctx, result)) { + return -1; + } + *result = ~*result; + break; + + default: + return -1; + } + + return 0; +} + +static int +_parse_multiplicative(struct parse_context *ctx, + int *result) +{ + if (_parse_unary(ctx, result)) { + return -1; + } + for (;;) { + int right; + + switch (ctx->input->token) { + case SL_PP_STAR: + ctx->input++; + if (_parse_unary(ctx, &right)) { + return -1; + } + *result = *result * right; + break; + + case SL_PP_SLASH: + ctx->input++; + if (_parse_unary(ctx, &right)) { + return -1; + } + *result = *result / right; + break; + + case SL_PP_MODULO: + ctx->input++; + if (_parse_unary(ctx, &right)) { + return -1; + } + *result = *result % right; + break; + + default: + return 0; + } + } +} + +static int +_parse_additive(struct parse_context *ctx, + int *result) +{ + if (_parse_multiplicative(ctx, result)) { + return -1; + } + for (;;) { + int right; + + switch (ctx->input->token) { + case SL_PP_PLUS: + ctx->input++; + if (_parse_multiplicative(ctx, &right)) { + return -1; + } + *result = *result + right; + break; + + case SL_PP_MINUS: + ctx->input++; + if (_parse_multiplicative(ctx, &right)) { + return -1; + } + *result = *result - right; + break; + + default: + return 0; + } + } +} + +static int +_parse_shift(struct parse_context *ctx, + int *result) +{ + if (_parse_additive(ctx, result)) { + return -1; + } + for (;;) { + int right; + + switch (ctx->input->token) { + case SL_PP_LSHIFT: + ctx->input++; + if (_parse_additive(ctx, &right)) { + return -1; + } + *result = *result << right; + break; + + case SL_PP_RSHIFT: + ctx->input++; + if (_parse_additive(ctx, &right)) { + return -1; + } + *result = *result >> right; + break; + + default: + return 0; + } + } +} + +static int +_parse_relational(struct parse_context *ctx, + int *result) +{ + if (_parse_shift(ctx, result)) { + return -1; + } + for (;;) { + int right; + + switch (ctx->input->token) { + case SL_PP_LESSEQUAL: + ctx->input++; + if (_parse_shift(ctx, &right)) { + return -1; + } + *result = *result <= right; + break; + + case SL_PP_GREATEREQUAL: + ctx->input++; + if (_parse_shift(ctx, &right)) { + return -1; + } + *result = *result >= right; + break; + + case SL_PP_LESS: + ctx->input++; + if (_parse_shift(ctx, &right)) { + return -1; + } + *result = *result < right; + break; + + case SL_PP_GREATER: + ctx->input++; + if (_parse_shift(ctx, &right)) { + return -1; + } + *result = *result > right; + break; + + default: + return 0; + } + } +} + +static int +_parse_equality(struct parse_context *ctx, + int *result) +{ + if (_parse_relational(ctx, result)) { + return -1; + } + for (;;) { + int right; + + switch (ctx->input->token) { + case SL_PP_EQUAL: + ctx->input++; + if (_parse_relational(ctx, &right)) { + return -1; + } + *result = *result == right; + break; + + case SL_PP_NOTEQUAL: + ctx->input++; + if (_parse_relational(ctx, &right)) { + return -1; + } + *result = *result != right; + break; + + default: + return 0; + } + } +} + +static int +_parse_bitand(struct parse_context *ctx, + int *result) +{ + if (_parse_equality(ctx, result)) { + return -1; + } + while (ctx->input->token == SL_PP_BITAND) { + int right; + + ctx->input++; + if (_parse_equality(ctx, &right)) { + return -1; + } + *result = *result & right; + } + return 0; +} + +static int +_parse_xor(struct parse_context *ctx, + int *result) +{ + if (_parse_bitand(ctx, result)) { + return -1; + } + while (ctx->input->token == SL_PP_XOR) { + int right; + + ctx->input++; + if (_parse_bitand(ctx, &right)) { + return -1; + } + *result = *result ^ right; + } + return 0; +} + +static int +_parse_bitor(struct parse_context *ctx, + int *result) +{ + if (_parse_xor(ctx, result)) { + return -1; + } + while (ctx->input->token == SL_PP_BITOR) { + int right; + + ctx->input++; + if (_parse_xor(ctx, &right)) { + return -1; + } + *result = *result | right; + } + return 0; +} + +static int +_parse_and(struct parse_context *ctx, + int *result) +{ + if (_parse_bitor(ctx, result)) { + return -1; + } + while (ctx->input->token == SL_PP_AND) { + int right; + + ctx->input++; + if (_parse_bitor(ctx, &right)) { + return -1; + } + *result = *result && right; + } + return 0; +} + +static int +_parse_or(struct parse_context *ctx, + int *result) +{ + if (_parse_and(ctx, result)) { + return -1; + } + while (ctx->input->token == SL_PP_OR) { + int right; + + ctx->input++; + if (_parse_and(ctx, &right)) { + return -1; + } + *result = *result || right; + } + return 0; +} + +int +sl_pp_execute_expression(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + int *result) +{ + struct parse_context ctx; + + ctx.context = context; + ctx.input = input; + + return _parse_or(&ctx, result); +} diff --git a/src/glsl/pp/sl_pp_expression.h b/src/glsl/pp/sl_pp_expression.h new file mode 100644 index 00000000000..377d5b4cbd9 --- /dev/null +++ b/src/glsl/pp/sl_pp_expression.h @@ -0,0 +1,40 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_EXPRESSION_H +#define SL_PP_EXPRESSION_H + +#include "sl_pp_context.h" +#include "sl_pp_token.h" + + +int +sl_pp_execute_expression(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + int *result); + +#endif /* SL_PP_EXPRESSION_H */ -- cgit v1.2.3 From 3b027bca9d54383b2fc8b2ad5a9cb6d2166c7acc Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 26 Jun 2009 11:44:43 +0200 Subject: glsl: Support if preprocessor directive and friends. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_context.c | 2 + src/glsl/pp/sl_pp_context.h | 6 + src/glsl/pp/sl_pp_if.c | 276 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_macro.c | 24 +++- src/glsl/pp/sl_pp_macro.h | 3 +- src/glsl/pp/sl_pp_process.c | 59 +++++++--- src/glsl/pp/sl_pp_process.h | 42 ++++++- 8 files changed, 388 insertions(+), 25 deletions(-) create mode 100644 src/glsl/pp/sl_pp_if.c diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 623d2362ce0..c7718d1d8fd 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -11,6 +11,7 @@ glsl = env.StaticLibrary( 'sl_pp_context.c', 'sl_pp_define.c', 'sl_pp_expression.c', + 'sl_pp_if.c', 'sl_pp_macro.c', 'sl_pp_process.c', 'sl_pp_purify.c', diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 6d3076b8697..1afe9a5d5e0 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -33,6 +33,8 @@ void sl_pp_context_init(struct sl_pp_context *context) { memset(context, 0, sizeof(struct sl_pp_context)); + context->if_ptr = SL_PP_MAX_IF_NESTING; + context->if_value = 1; } void diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 56f70777507..e8200d55d7f 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -31,12 +31,18 @@ #include "sl_pp_macro.h" +#define SL_PP_MAX_IF_NESTING 64 + struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; unsigned int cstr_pool_len; struct sl_pp_macro *macro; + + unsigned int if_stack[SL_PP_MAX_IF_NESTING]; + unsigned int if_ptr; + int if_value; }; void diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c new file mode 100644 index 00000000000..e331acc4cd5 --- /dev/null +++ b/src/glsl/pp/sl_pp_if.c @@ -0,0 +1,276 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_expression.h" +#include "sl_pp_process.h" + + +static int +_evaluate_if_stack(struct sl_pp_context *context) +{ + unsigned int i; + + for (i = context->if_ptr; i < SL_PP_MAX_IF_NESTING; i++) { + if (!(context->if_stack[i] & 1)) { + return 0; + } + } + return 1; +} + +static int +_parse_if(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + unsigned int i; + struct sl_pp_process_state state; + struct sl_pp_token_info eof; + int result; + + if (!context->if_ptr) { + /* #if nesting too deep. */ + return -1; + } + + memset(&state, 0, sizeof(state)); + for (i = first; i < last;) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_IDENTIFIER: + if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + free(state.out); + return -1; + } + break; + + default: + if (sl_pp_process_out(&state, &input[i])) { + free(state.out); + return -1; + } + i++; + } + } + + eof.token = SL_PP_EOF; + if (sl_pp_process_out(&state, &eof)) { + free(state.out); + return -1; + } + + if (sl_pp_execute_expression(context, state.out, &result)) { + free(state.out); + return -1; + } + + free(state.out); + + context->if_ptr--; + context->if_stack[context->if_ptr] = result ? 1 : 0; + context->if_value = _evaluate_if_stack(context); + + return 0; +} + +static int +_parse_else(struct sl_pp_context *context) +{ + if (context->if_ptr == SL_PP_MAX_IF_NESTING) { + /* No matching #if. */ + return -1; + } + + /* Bit b1 indicates we already went through #else. */ + if (context->if_stack[context->if_ptr] & 2) { + /* No matching #if. */ + return -1; + } + + /* Invert current condition value and mark that we are in the #else block. */ + context->if_stack[context->if_ptr] = (1 - (context->if_stack[context->if_ptr] & 1)) | 2; + context->if_value = _evaluate_if_stack(context); + + return 0; +} + +int +sl_pp_process_if(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + return _parse_if(context, input, first, last); +} + +int +sl_pp_process_ifdef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + unsigned int i; + + if (!context->if_ptr) { + /* #if nesting too deep. */ + return -1; + } + + for (i = first; i < last; i++) { + switch (input[i].token) { + case SL_PP_IDENTIFIER: + { + struct sl_pp_macro *macro; + int macro_name = input[i].data.identifier; + int defined = 0; + + for (macro = context->macro; macro; macro = macro->next) { + if (macro->name == macro_name) { + defined = 1; + break; + } + } + + context->if_ptr--; + context->if_stack[context->if_ptr] = defined ? 1 : 0; + context->if_value = _evaluate_if_stack(context); + } + return 0; + + case SL_PP_WHITESPACE: + break; + + default: + /* Expected an identifier. */ + return -1; + } + } + + /* Expected an identifier. */ + return -1; +} + +int +sl_pp_process_ifndef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + unsigned int i; + + if (!context->if_ptr) { + /* #if nesting too deep. */ + return -1; + } + + for (i = first; i < last; i++) { + switch (input[i].token) { + case SL_PP_IDENTIFIER: + { + struct sl_pp_macro *macro; + int macro_name = input[i].data.identifier; + int defined = 0; + + for (macro = context->macro; macro; macro = macro->next) { + if (macro->name == macro_name) { + defined = 1; + break; + } + } + + context->if_ptr--; + context->if_stack[context->if_ptr] = defined ? 0 : 1; + context->if_value = _evaluate_if_stack(context); + } + return 0; + + case SL_PP_WHITESPACE: + break; + + default: + /* Expected an identifier. */ + return -1; + } + } + + /* Expected an identifier. */ + return -1; +} + +int +sl_pp_process_elif(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + if (_parse_else(context)) { + return -1; + } + + if (context->if_stack[context->if_ptr] & 1) { + context->if_ptr++; + if (_parse_if(context, input, first, last)) { + return -1; + } + } + + /* We are still in the #if block. */ + context->if_stack[context->if_ptr] = context->if_stack[context->if_ptr] & ~2; + + return 0; +} + +int +sl_pp_process_else(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + return _parse_else(context); +} + +int +sl_pp_process_endif(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + if (context->if_ptr == SL_PP_MAX_IF_NESTING) { + /* No matching #if. */ + return -1; + } + + context->if_ptr++; + context->if_value = _evaluate_if_stack(context); + + return 0; +} diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 0138270c67b..a8412f0651c 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -78,7 +78,8 @@ sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int *pi, struct sl_pp_macro *local, - struct sl_pp_process_state *state) + struct sl_pp_process_state *state, + int mute) { int macro_name; struct sl_pp_macro *macro = NULL; @@ -108,8 +109,10 @@ sl_pp_macro_expand(struct sl_pp_context *context, } if (!macro) { - if (sl_pp_process_out(state, &input[*pi])) { - return -1; + if (!mute) { + if (sl_pp_process_out(state, &input[*pi])) { + return -1; + } } (*pi)++; return 0; @@ -244,8 +247,15 @@ sl_pp_macro_expand(struct sl_pp_context *context, for (j = 0;;) { switch (macro->body[j].token) { + case SL_PP_NEWLINE: + if (sl_pp_process_out(state, ¯o->body[j])) { + return -1; + } + j++; + break; + case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, macro->body, &j, actual_arg, state)) { + if (sl_pp_macro_expand(context, macro->body, &j, actual_arg, state, mute)) { return -1; } break; @@ -255,8 +265,10 @@ sl_pp_macro_expand(struct sl_pp_context *context, return 0; default: - if (sl_pp_process_out(state, ¯o->body[j])) { - return -1; + if (!mute) { + if (sl_pp_process_out(state, ¯o->body[j])) { + return -1; + } } j++; } diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index 63edd21aa24..476991d581d 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -55,6 +55,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int *pi, struct sl_pp_macro *local, - struct sl_pp_process_state *state); + struct sl_pp_process_state *state, + int mute); #endif /* SL_PP_MACRO_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index baffaf2cd95..441de9439c5 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -38,14 +38,6 @@ skip_whitespace(const struct sl_pp_token_info *input, } } - -struct sl_pp_process_state { - struct sl_pp_token_info *out; - unsigned int out_len; - unsigned int out_max; -}; - - int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token) @@ -133,16 +125,42 @@ sl_pp_process(struct sl_pp_context *context, last = i - 1; if (!strcmp(name, "define")) { - *macro = sl_pp_macro_new(); - if (!*macro) { + if (context->if_value) { + *macro = sl_pp_macro_new(); + if (!*macro) { + return -1; + } + + if (sl_pp_process_define(context, input, first, last, *macro)) { + return -1; + } + + macro = &(**macro).next; + } + } else if (!strcmp(name, "if")) { + if (sl_pp_process_if(context, input, first, last)) { return -1; } - - if (sl_pp_process_define(context, input, first, last, *macro)) { + } else if (!strcmp(name, "ifdef")) { + if (sl_pp_process_ifdef(context, input, first, last)) { + return -1; + } + } else if (!strcmp(name, "ifndef")) { + if (sl_pp_process_ifndef(context, input, first, last)) { + return -1; + } + } else if (!strcmp(name, "elif")) { + if (sl_pp_process_elif(context, input, first, last)) { + return -1; + } + } else if (!strcmp(name, "else")) { + if (sl_pp_process_else(context, input, first, last)) { + return -1; + } + } else if (!strcmp(name, "endif")) { + if (sl_pp_process_endif(context, input, first, last)) { return -1; } - - macro = &(**macro).next; } else { /* XXX: Ignore. */ } @@ -198,14 +216,16 @@ sl_pp_process(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, input, &i, NULL, &state)) { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, !context->if_value)) { return -1; } break; default: - if (sl_pp_process_out(&state, &input[i])) { - return -1; + if (context->if_value) { + if (sl_pp_process_out(&state, &input[i])) { + return -1; + } } i++; } @@ -213,6 +233,11 @@ sl_pp_process(struct sl_pp_context *context, } } + if (context->if_ptr != SL_PP_MAX_IF_NESTING) { + /* #endif expected. */ + return -1; + } + *output = state.out; return 0; } diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 37cdc4c9a78..cc934bd89c5 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -33,7 +33,11 @@ #include "sl_pp_token.h" -struct sl_pp_process_state; +struct sl_pp_process_state { + struct sl_pp_token_info *out; + unsigned int out_len; + unsigned int out_max; +}; int sl_pp_process(struct sl_pp_context *context, @@ -47,6 +51,42 @@ sl_pp_process_define(struct sl_pp_context *context, unsigned int last, struct sl_pp_macro *macro); +int +sl_pp_process_if(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + +int +sl_pp_process_ifdef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + +int +sl_pp_process_ifndef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + +int +sl_pp_process_elif(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + +int +sl_pp_process_else(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + +int +sl_pp_process_endif(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token); -- cgit v1.2.3 From 153b179862411e9de14d26bbcff16bc81f1edc91 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 26 Jun 2009 11:53:13 +0200 Subject: glsl: Handle `defined' preprocessor operator. --- src/glsl/pp/sl_pp_if.c | 82 ++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 79 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index e331acc4cd5..90b80512375 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -30,6 +30,70 @@ #include "sl_pp_process.h" +static void +skip_whitespace(const struct sl_pp_token_info *input, + unsigned int *pi) +{ + while (input[*pi].token == SL_PP_WHITESPACE) { + (*pi)++; + } +} + +static int +_parse_defined(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int *pi, + struct sl_pp_process_state *state) +{ + int parens = 0; + int macro_name; + struct sl_pp_macro *macro; + int defined = 0; + struct sl_pp_token_info result; + + skip_whitespace(input, pi); + if (input[*pi].token == SL_PP_LPAREN) { + (*pi)++; + skip_whitespace(input, pi); + parens = 1; + } + + if (input[*pi].token != SL_PP_IDENTIFIER) { + /* Identifier expected. */ + return -1; + } + + macro_name = input[*pi].data.identifier; + for (macro = context->macro; macro; macro = macro->next) { + if (macro->name == macro_name) { + defined = 1; + break; + } + } + (*pi)++; + + if (parens) { + skip_whitespace(input, pi); + if (input[*pi].token != SL_PP_RPAREN) { + /* `)' expected */ + return -1; + } + (*pi)++; + } + + result.token = SL_PP_NUMBER; + if (defined) { + result.data.number = sl_pp_context_add_unique_str(context, "1"); + } else { + result.data.number = sl_pp_context_add_unique_str(context, "0"); + } + if (result.data.number == -1) { + return -1; + } + + return sl_pp_process_out(state, &result); +} + static int _evaluate_if_stack(struct sl_pp_context *context) { @@ -67,9 +131,21 @@ _parse_if(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { - free(state.out); - return -1; + { + const char *id = sl_pp_context_cstr(context, input[i].data.identifier); + + if (!strcmp(id, "defined")) { + i++; + if (_parse_defined(context, input, &i, &state)) { + free(state.out); + return -1; + } + } else { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + free(state.out); + return -1; + } + } } break; -- cgit v1.2.3 From a294715612d14d64e12026361ff7cc29321607d6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 26 Jun 2009 12:26:05 +0200 Subject: glsl: Allow for preprocessor macro redefinition. --- src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 1 + src/glsl/pp/sl_pp_define.c | 30 +++++++++++++++++++++++++----- src/glsl/pp/sl_pp_macro.c | 45 +++++++++++++++++++++++++++++++++------------ src/glsl/pp/sl_pp_macro.h | 3 +++ src/glsl/pp/sl_pp_process.c | 11 +---------- src/glsl/pp/sl_pp_process.h | 3 +-- 7 files changed, 65 insertions(+), 29 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 1afe9a5d5e0..50ec790cc50 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -33,6 +33,7 @@ void sl_pp_context_init(struct sl_pp_context *context) { memset(context, 0, sizeof(struct sl_pp_context)); + context->macro_tail = &context->macro; context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; } diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index e8200d55d7f..1dbd10e30ee 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -39,6 +39,7 @@ struct sl_pp_context { unsigned int cstr_pool_len; struct sl_pp_macro *macro; + struct sl_pp_macro **macro_tail; unsigned int if_stack[SL_PP_MAX_IF_NESTING]; unsigned int if_ptr; diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index e8a23fedcd8..0509646430a 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -105,22 +105,42 @@ int sl_pp_process_define(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int first, - unsigned int last, - struct sl_pp_macro *macro) + unsigned int last) { + int macro_name = -1; + struct sl_pp_macro *macro; unsigned int i; unsigned int body_len; unsigned int j; if (first < last && input[first].token == SL_PP_IDENTIFIER) { - macro->name = input[first].data.identifier; + macro_name = input[first].data.identifier; first++; } - - if (macro->name == -1) { + if (macro_name == -1) { return -1; } + for (macro = context->macro; macro; macro = macro->next) { + if (macro->name == macro_name) { + break; + } + } + + if (!macro) { + macro = sl_pp_macro_new(); + if (!macro) { + return -1; + } + + *context->macro_tail = macro; + context->macro_tail = ¯o->next; + } else { + sl_pp_macro_reset(macro); + } + + macro->name = macro_name; + /* * If there is no whitespace between macro name and left paren, a macro * formal argument list follows. This is the only place where the presence diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index a8412f0651c..a82c30cb167 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -30,6 +30,15 @@ #include "sl_pp_process.h" +static void +_macro_init(struct sl_pp_macro *macro) +{ + macro->name = -1; + macro->num_args = -1; + macro->arg = NULL; + macro->body = NULL; +} + struct sl_pp_macro * sl_pp_macro_new(void) { @@ -37,33 +46,45 @@ sl_pp_macro_new(void) macro = calloc(1, sizeof(struct sl_pp_macro)); if (macro) { - macro->name = -1; - macro->num_args = -1; + _macro_init(macro); } return macro; } +static void +_macro_destroy(struct sl_pp_macro *macro) +{ + struct sl_pp_macro_formal_arg *arg = macro->arg; + + while (arg) { + struct sl_pp_macro_formal_arg *next_arg = arg->next; + + free(arg); + arg = next_arg; + } + + free(macro->body); +} + void sl_pp_macro_free(struct sl_pp_macro *macro) { while (macro) { struct sl_pp_macro *next_macro = macro->next; - struct sl_pp_macro_formal_arg *arg = macro->arg; - - while (arg) { - struct sl_pp_macro_formal_arg *next_arg = arg->next; - - free(arg); - arg = next_arg; - } - - free(macro->body); + _macro_destroy(macro); free(macro); macro = next_macro; } } +void +sl_pp_macro_reset(struct sl_pp_macro *macro) +{ + _macro_destroy(macro); + _macro_init(macro); +} + static void skip_whitespace(const struct sl_pp_token_info *input, unsigned int *pi) diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index 476991d581d..7af11c5ece7 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -50,6 +50,9 @@ sl_pp_macro_new(void); void sl_pp_macro_free(struct sl_pp_macro *macro); +void +sl_pp_macro_reset(struct sl_pp_macro *macro); + int sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 441de9439c5..4715eed2fcd 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -71,10 +71,8 @@ sl_pp_process(struct sl_pp_context *context, { unsigned int i = 0; int found_eof = 0; - struct sl_pp_macro **macro; struct sl_pp_process_state state; - macro = &context->macro; memset(&state, 0, sizeof(state)); while (!found_eof) { @@ -126,16 +124,9 @@ sl_pp_process(struct sl_pp_context *context, if (!strcmp(name, "define")) { if (context->if_value) { - *macro = sl_pp_macro_new(); - if (!*macro) { + if (sl_pp_process_define(context, input, first, last)) { return -1; } - - if (sl_pp_process_define(context, input, first, last, *macro)) { - return -1; - } - - macro = &(**macro).next; } } else if (!strcmp(name, "if")) { if (sl_pp_process_if(context, input, first, last)) { diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index cc934bd89c5..66d61496a2d 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -48,8 +48,7 @@ int sl_pp_process_define(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int first, - unsigned int last, - struct sl_pp_macro *macro); + unsigned int last); int sl_pp_process_if(struct sl_pp_context *context, -- cgit v1.2.3 From 3dc2b5f71c2a519409becb6c1f177b5981fbacf7 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 26 Jun 2009 12:48:14 +0200 Subject: glsl: Implement `undef' preprocessor directive. --- src/glsl/pp/sl_pp_define.c | 35 +++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 22 +++++++++++++--------- src/glsl/pp/sl_pp_process.h | 6 ++++++ 3 files changed, 54 insertions(+), 9 deletions(-) diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index 0509646430a..9bc9fb53599 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -176,3 +176,38 @@ sl_pp_process_define(struct sl_pp_context *context, return 0; } + + +int +sl_pp_process_undef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + int macro_name = -1; + struct sl_pp_macro **pmacro; + struct sl_pp_macro *macro; + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + macro_name = input[first].data.identifier; + } + if (macro_name == -1) { + return 0; + } + + for (pmacro = &context->macro; *pmacro; pmacro = &(**pmacro).next) { + if ((**pmacro).name == macro_name) { + break; + } + } + if (!*pmacro) { + return 0; + } + + macro = *pmacro; + *pmacro = macro->next; + macro->next = NULL; + sl_pp_macro_free(macro); + + return 0; +} diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 4715eed2fcd..c17a3ac7ce8 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -122,13 +122,7 @@ sl_pp_process(struct sl_pp_context *context, last = i - 1; - if (!strcmp(name, "define")) { - if (context->if_value) { - if (sl_pp_process_define(context, input, first, last)) { - return -1; - } - } - } else if (!strcmp(name, "if")) { + if (!strcmp(name, "if")) { if (sl_pp_process_if(context, input, first, last)) { return -1; } @@ -152,8 +146,18 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_endif(context, input, first, last)) { return -1; } - } else { - /* XXX: Ignore. */ + } else if (context->if_value) { + if (!strcmp(name, "define")) { + if (sl_pp_process_define(context, input, first, last)) { + return -1; + } + } else if (!strcmp(name, "undef")) { + if (sl_pp_process_undef(context, input, first, last)) { + return -1; + } + } else { + /* XXX: Ignore. */ + } } } break; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 66d61496a2d..61e67fef0b7 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -50,6 +50,12 @@ sl_pp_process_define(struct sl_pp_context *context, unsigned int first, unsigned int last); +int +sl_pp_process_undef(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + int sl_pp_process_if(struct sl_pp_context *context, const struct sl_pp_token_info *input, -- cgit v1.2.3 From f9bd6f7152047e6230c85d76e412a5bb524e0413 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 08:14:48 +0200 Subject: glsl: Implement `error' preprocessor directive. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 4 + src/glsl/pp/sl_pp_error.c | 263 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 3 + src/glsl/pp/sl_pp_process.h | 6 + 6 files changed, 278 insertions(+) create mode 100644 src/glsl/pp/sl_pp_error.c diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index c7718d1d8fd..13fc230b96e 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -10,6 +10,7 @@ glsl = env.StaticLibrary( source = [ 'sl_pp_context.c', 'sl_pp_define.c', + 'sl_pp_error.c', 'sl_pp_expression.c', 'sl_pp_if.c', 'sl_pp_macro.c', diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 50ec790cc50..38d633baeff 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -36,6 +36,7 @@ sl_pp_context_init(struct sl_pp_context *context) context->macro_tail = &context->macro; context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; + memset(context->error_msg, 0, sizeof(context->error_msg)); } void diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 1dbd10e30ee..65ce3e37b7b 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -33,6 +33,8 @@ #define SL_PP_MAX_IF_NESTING 64 +#define SL_PP_MAX_ERROR_MSG 1024 + struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; @@ -44,6 +46,8 @@ struct sl_pp_context { unsigned int if_stack[SL_PP_MAX_IF_NESTING]; unsigned int if_ptr; int if_value; + + char error_msg[SL_PP_MAX_ERROR_MSG]; }; void diff --git a/src/glsl/pp/sl_pp_error.c b/src/glsl/pp/sl_pp_error.c new file mode 100644 index 00000000000..d42568d23dc --- /dev/null +++ b/src/glsl/pp/sl_pp_error.c @@ -0,0 +1,263 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_process.h" + + +void +sl_pp_process_error(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + unsigned int out_len = 0; + unsigned int i; + + for (i = first; i < last; i++) { + const char *s = NULL; + char buf[2]; + + switch (input[i].token) { + case SL_PP_WHITESPACE: + s = " "; + break; + + case SL_PP_NEWLINE: + s = "\n"; + break; + + case SL_PP_HASH: + s = "#"; + break; + + case SL_PP_COMMA: + s = ","; + break; + + case SL_PP_SEMICOLON: + s = ";"; + break; + + case SL_PP_LBRACE: + s = "{"; + break; + + case SL_PP_RBRACE: + s = "}"; + break; + + case SL_PP_LPAREN: + s = "("; + break; + + case SL_PP_RPAREN: + s = ")"; + break; + + case SL_PP_LBRACKET: + s = "["; + break; + + case SL_PP_RBRACKET: + s = "]"; + break; + + case SL_PP_DOT: + s = "."; + break; + + case SL_PP_INCREMENT: + s = "++"; + break; + + case SL_PP_ADDASSIGN: + s = "+="; + break; + + case SL_PP_PLUS: + s = "+"; + break; + + case SL_PP_DECREMENT: + s = "--"; + break; + + case SL_PP_SUBASSIGN: + s = "-="; + break; + + case SL_PP_MINUS: + s = "-"; + break; + + case SL_PP_BITNOT: + s = "~"; + break; + + case SL_PP_NOTEQUAL: + s = "!="; + break; + + case SL_PP_NOT: + s = "!"; + break; + + case SL_PP_MULASSIGN: + s = "*="; + break; + + case SL_PP_STAR: + s = "*"; + break; + + case SL_PP_DIVASSIGN: + s = "/="; + break; + + case SL_PP_SLASH: + s = "/"; + break; + + case SL_PP_MODASSIGN: + s = "%="; + break; + + case SL_PP_MODULO: + s = "%"; + break; + + case SL_PP_LSHIFTASSIGN: + s = "<<="; + break; + + case SL_PP_LSHIFT: + s = "<<"; + break; + + case SL_PP_LESSEQUAL: + s = "<="; + break; + + case SL_PP_LESS: + s = "<"; + break; + + case SL_PP_RSHIFTASSIGN: + s = ">>="; + break; + + case SL_PP_RSHIFT: + s = ">>"; + break; + + case SL_PP_GREATEREQUAL: + s = ">="; + break; + + case SL_PP_GREATER: + s = ">"; + break; + + case SL_PP_EQUAL: + s = "=="; + break; + + case SL_PP_ASSIGN: + s = "="; + break; + + case SL_PP_AND: + s = "&&"; + break; + + case SL_PP_BITANDASSIGN: + s = "&="; + break; + + case SL_PP_BITAND: + s = "&"; + break; + + case SL_PP_XOR: + s = "^^"; + break; + + case SL_PP_BITXORASSIGN: + s = "^="; + break; + + case SL_PP_BITXOR: + s = "^"; + break; + + case SL_PP_OR: + s = "||"; + break; + + case SL_PP_BITORASSIGN: + s = "|="; + break; + + case SL_PP_BITOR: + s = "|"; + break; + + case SL_PP_QUESTION: + s = "?"; + break; + + case SL_PP_COLON: + s = ":"; + break; + + case SL_PP_IDENTIFIER: + s = sl_pp_context_cstr(context, input[i].data.identifier); + break; + + case SL_PP_NUMBER: + s = sl_pp_context_cstr(context, input[i].data.number); + break; + + case SL_PP_OTHER: + buf[0] = input[i].data.other; + buf[1] = '\0'; + s = buf; + break; + + default: + strcpy(context->error_msg, "internal error"); + return; + } + + while (*s != '\0' && out_len < sizeof(context->error_msg) - 1) { + context->error_msg[out_len++] = *s++; + } + } + + context->error_msg[out_len] = '\0'; +} diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index c17a3ac7ce8..117aa01688d 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -151,6 +151,9 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_define(context, input, first, last)) { return -1; } + } else if (!strcmp(name, "error")) { + sl_pp_process_error(context, input, first, last); + return -1; } else if (!strcmp(name, "undef")) { if (sl_pp_process_undef(context, input, first, last)) { return -1; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 61e67fef0b7..11a94921d82 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -92,6 +92,12 @@ sl_pp_process_endif(struct sl_pp_context *context, unsigned int first, unsigned int last); +void +sl_pp_process_error(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token); -- cgit v1.2.3 From c42428c787aae4bc560adf507991f1e274407135 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 08:16:14 +0200 Subject: glsl: Print out error message in apps/process. --- src/glsl/apps/process.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index abcf1a92b83..d01294f3407 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -104,21 +104,24 @@ main(int argc, return -1; } - if (sl_pp_process(&context, &tokens[tokens_eaten], &outtokens)) { + out = fopen(argv[2], "wb"); + if (!out) { sl_pp_context_destroy(&context); free(tokens); - return -1; + return 1; } - free(tokens); + if (sl_pp_process(&context, &tokens[tokens_eaten], &outtokens)) { + fprintf(out, "$ERROR: `%s'\n", context.error_msg); - out = fopen(argv[2], "wb"); - if (!out) { sl_pp_context_destroy(&context); - free(outtokens); - return 1; + free(tokens); + fclose(out); + return -1; } + free(tokens); + for (i = 0; outtokens[i].token != SL_PP_EOF; i++) { switch (outtokens[i].token) { case SL_PP_NEWLINE: -- cgit v1.2.3 From 0e046420e468bcb81301aa5a5e4de736a8b4844a Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 10:48:51 +0200 Subject: glsl: Implement `pragma' preprocessor directive. Handle `optimize(on|off)' and `debug(on|off)' pragmas. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_pragma.c | 106 ++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 4 ++ src/glsl/pp/sl_pp_process.h | 7 +++ src/glsl/pp/sl_pp_token.h | 4 ++ 5 files changed, 122 insertions(+) create mode 100644 src/glsl/pp/sl_pp_pragma.c diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 13fc230b96e..0c1b4ac2e99 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -14,6 +14,7 @@ glsl = env.StaticLibrary( 'sl_pp_expression.c', 'sl_pp_if.c', 'sl_pp_macro.c', + 'sl_pp_pragma.c', 'sl_pp_process.c', 'sl_pp_purify.c', 'sl_pp_token.c', diff --git a/src/glsl/pp/sl_pp_pragma.c b/src/glsl/pp/sl_pp_pragma.c new file mode 100644 index 00000000000..059bc6f2886 --- /dev/null +++ b/src/glsl/pp/sl_pp_pragma.c @@ -0,0 +1,106 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_process.h" + + +int +sl_pp_process_pragma(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_process_state *state) +{ + const char *pragma_name = NULL; + struct sl_pp_token_info out; + const char *arg_name = NULL; + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + pragma_name = sl_pp_context_cstr(context, input[first].data.identifier); + first++; + } + if (!pragma_name) { + return 0; + } + + if (!strcmp(pragma_name, "optimize")) { + out.token = SL_PP_PRAGMA_OPTIMIZE; + } else if (!strcmp(pragma_name, "debug")) { + out.token = SL_PP_PRAGMA_DEBUG; + } else { + return 0; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last && input[first].token == SL_PP_LPAREN) { + first++; + } else { + return 0; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + arg_name = sl_pp_context_cstr(context, input[first].data.identifier); + first++; + } + if (!arg_name) { + return 0; + } + + if (!strcmp(arg_name, "off")) { + out.data.pragma = 0; + } else if (!strcmp(arg_name, "on")) { + out.data.pragma = 1; + } else { + return 0; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last && input[first].token == SL_PP_RPAREN) { + first++; + } else { + return 0; + } + + /* Ignore the tokens that follow. */ + + if (sl_pp_process_out(state, &out)) { + return -1; + } + + return 0; +} diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 117aa01688d..62b73426c5f 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -154,6 +154,10 @@ sl_pp_process(struct sl_pp_context *context, } else if (!strcmp(name, "error")) { sl_pp_process_error(context, input, first, last); return -1; + } else if (!strcmp(name, "pragma")) { + if (sl_pp_process_pragma(context, input, first, last, &state)) { + return -1; + } } else if (!strcmp(name, "undef")) { if (sl_pp_process_undef(context, input, first, last)) { return -1; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 11a94921d82..9a29c03a701 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -98,6 +98,13 @@ sl_pp_process_error(struct sl_pp_context *context, unsigned int first, unsigned int last); +int +sl_pp_process_pragma(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_process_state *state); + int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token); diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index a53720be802..566274ea90e 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -88,6 +88,9 @@ enum sl_pp_token { SL_PP_OTHER, + SL_PP_PRAGMA_OPTIMIZE, + SL_PP_PRAGMA_DEBUG, + SL_PP_EOF }; @@ -95,6 +98,7 @@ union sl_pp_token_data { int identifier; int number; char other; + int pragma; }; struct sl_pp_token_info { -- cgit v1.2.3 From 94321b44416f47eb08bf72c93f4299ff7dc47017 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 10:49:12 +0200 Subject: glsl: Handle pragma tokens in apps/process. --- src/glsl/apps/process.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index d01294f3407..9a450ce5a7b 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -320,6 +320,14 @@ main(int argc, fprintf(out, "%c", outtokens[i].data.other); break; + case SL_PP_PRAGMA_OPTIMIZE: + fprintf(out, "#pragma optimize(%s)", outtokens[i].data.pragma ? "on" : "off"); + break; + + case SL_PP_PRAGMA_DEBUG: + fprintf(out, "#pragma debug(%s)", outtokens[i].data.pragma ? "on" : "off"); + break; + default: assert(0); } -- cgit v1.2.3 From 87d2de04fbb7d9ea8eae9c58f7c7fb842ffe06f6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 11:32:46 +0200 Subject: glsl: Implement `extension' preprocessor directive. No extensions supported. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_extension.c | 129 ++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 4 ++ src/glsl/pp/sl_pp_process.h | 7 +++ src/glsl/pp/sl_pp_token.h | 6 ++ 5 files changed, 147 insertions(+) create mode 100644 src/glsl/pp/sl_pp_extension.c diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 0c1b4ac2e99..dae8830eeb6 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -12,6 +12,7 @@ glsl = env.StaticLibrary( 'sl_pp_define.c', 'sl_pp_error.c', 'sl_pp_expression.c', + 'sl_pp_extension.c', 'sl_pp_if.c', 'sl_pp_macro.c', 'sl_pp_pragma.c', diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c new file mode 100644 index 00000000000..3d223a1a548 --- /dev/null +++ b/src/glsl/pp/sl_pp_extension.c @@ -0,0 +1,129 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_process.h" + + +int +sl_pp_process_extension(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_process_state *state) +{ + int all_extensions = -1; + const char *extension_name = NULL; + const char *behavior = NULL; + struct sl_pp_token_info out; + + all_extensions = sl_pp_context_add_unique_str(context, "all"); + if (all_extensions == -1) { + return -1; + } + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + extension_name = sl_pp_context_cstr(context, input[first].data.identifier); + first++; + } + if (!extension_name) { + strcpy(context->error_msg, "expected identifier after `#extension'"); + return -1; + } + + if (!strcmp(extension_name, "all")) { + out.data.extension = all_extensions; + } else { + out.data.extension = -1; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last && input[first].token == SL_PP_COLON) { + first++; + } else { + strcpy(context->error_msg, "expected `:' after extension name"); + return -1; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last && input[first].token == SL_PP_IDENTIFIER) { + behavior = sl_pp_context_cstr(context, input[first].data.identifier); + first++; + } + if (!behavior) { + strcpy(context->error_msg, "expected identifier after `:'"); + return -1; + } + + if (!strcmp(behavior, "require")) { + strcpy(context->error_msg, "unable to enable required extension"); + return -1; + } else if (!strcmp(behavior, "enable")) { + if (out.data.extension == all_extensions) { + strcpy(context->error_msg, "unable to enable all extensions"); + return -1; + } else { + return 0; + } + } else if (!strcmp(behavior, "warn")) { + if (out.data.extension == all_extensions) { + out.token = SL_PP_EXTENSION_WARN; + } else { + return 0; + } + } else if (!strcmp(behavior, "disable")) { + if (out.data.extension == all_extensions) { + out.token = SL_PP_EXTENSION_DISABLE; + } else { + return 0; + } + } else { + strcpy(context->error_msg, "unrecognised behavior name"); + return -1; + } + + while (first < last && input[first].token == SL_PP_WHITESPACE) { + first++; + } + + if (first < last) { + strcpy(context->error_msg, "expected end of line after behavior name"); + return -1; + } + + if (sl_pp_process_out(state, &out)) { + return -1; + } + + return 0; +} diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 62b73426c5f..be01f9139c1 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -154,6 +154,10 @@ sl_pp_process(struct sl_pp_context *context, } else if (!strcmp(name, "error")) { sl_pp_process_error(context, input, first, last); return -1; + } else if (!strcmp(name, "extension")) { + if (sl_pp_process_extension(context, input, first, last, &state)) { + return -1; + } } else if (!strcmp(name, "pragma")) { if (sl_pp_process_pragma(context, input, first, last, &state)) { return -1; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 9a29c03a701..58918665434 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -105,6 +105,13 @@ sl_pp_process_pragma(struct sl_pp_context *context, unsigned int last, struct sl_pp_process_state *state); +int +sl_pp_process_extension(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last, + struct sl_pp_process_state *state); + int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token); diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 566274ea90e..7b60183a041 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -91,6 +91,11 @@ enum sl_pp_token { SL_PP_PRAGMA_OPTIMIZE, SL_PP_PRAGMA_DEBUG, + SL_PP_EXTENSION_REQUIRE, + SL_PP_EXTENSION_ENABLE, + SL_PP_EXTENSION_WARN, + SL_PP_EXTENSION_DISABLE, + SL_PP_EOF }; @@ -99,6 +104,7 @@ union sl_pp_token_data { int number; char other; int pragma; + int extension; }; struct sl_pp_token_info { -- cgit v1.2.3 From 7f187583c14448047c95d933a96b190273a881e5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 11:33:15 +0200 Subject: glsl: Handle extension tokens in apps/proces. --- src/glsl/apps/process.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 9a450ce5a7b..b40ad442bbb 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -328,6 +328,22 @@ main(int argc, fprintf(out, "#pragma debug(%s)", outtokens[i].data.pragma ? "on" : "off"); break; + case SL_PP_EXTENSION_REQUIRE: + fprintf(out, "#extension %s : require", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + break; + + case SL_PP_EXTENSION_ENABLE: + fprintf(out, "#extension %s : enable", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + break; + + case SL_PP_EXTENSION_WARN: + fprintf(out, "#extension %s : warn", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + break; + + case SL_PP_EXTENSION_DISABLE: + fprintf(out, "#extension %s : disable", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + break; + default: assert(0); } -- cgit v1.2.3 From ddd8ae7fbc643892b08ddf66c67bca36d42b53a6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 11:39:30 +0200 Subject: glsl: Output endof token after processing a directive. Some directives may output tokens as a result of their operation. --- src/glsl/pp/sl_pp_process.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index be01f9139c1..18289790d19 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -87,6 +87,7 @@ sl_pp_process(struct sl_pp_context *context, int found_eol = 0; unsigned int first; unsigned int last; + struct sl_pp_token_info endof; /* Directive name. */ name = sl_pp_context_cstr(context, input[i].data.identifier); @@ -99,17 +100,13 @@ sl_pp_process(struct sl_pp_context *context, switch (input[i].token) { case SL_PP_NEWLINE: /* Preserve newline just for the sake of line numbering. */ - if (sl_pp_process_out(&state, &input[i])) { - return -1; - } + endof = input[i]; i++; found_eol = 1; break; case SL_PP_EOF: - if (sl_pp_process_out(&state, &input[i])) { - return -1; - } + endof = input[i]; i++; found_eof = 1; found_eol = 1; @@ -170,6 +167,10 @@ sl_pp_process(struct sl_pp_context *context, /* XXX: Ignore. */ } } + + if (sl_pp_process_out(&state, &endof)) { + return -1; + } } break; -- cgit v1.2.3 From bb8f38ea6f71179cd4adb0ca33c464716be17dcb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 11:58:19 +0200 Subject: glsl: Implement `line' preprocessor directive. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_line.c | 95 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_process.c | 7 +++- src/glsl/pp/sl_pp_process.h | 6 +++ 4 files changed, 108 insertions(+), 1 deletion(-) create mode 100644 src/glsl/pp/sl_pp_line.c diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index dae8830eeb6..cc930380c21 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -14,6 +14,7 @@ glsl = env.StaticLibrary( 'sl_pp_expression.c', 'sl_pp_extension.c', 'sl_pp_if.c', + 'sl_pp_line.c', 'sl_pp_macro.c', 'sl_pp_pragma.c', 'sl_pp_process.c', diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c new file mode 100644 index 00000000000..3300a4785ba --- /dev/null +++ b/src/glsl/pp/sl_pp_line.c @@ -0,0 +1,95 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include "sl_pp_process.h" + + +int +sl_pp_process_line(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last) +{ + unsigned int i; + struct sl_pp_process_state state; + int line_number = -1; + int file_number = -1; + + memset(&state, 0, sizeof(state)); + for (i = first; i < last;) { + switch (input[i].token) { + case SL_PP_WHITESPACE: + i++; + break; + + case SL_PP_IDENTIFIER: + if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + free(state.out); + return -1; + } + break; + + default: + if (sl_pp_process_out(&state, &input[i])) { + free(state.out); + return -1; + } + i++; + } + } + + if (state.out_len > 0 && state.out[0].token == SL_PP_NUMBER) { + line_number = state.out[0].data.number; + } else { + strcpy(context->error_msg, "expected number after `#line'"); + free(state.out); + return -1; + } + + if (state.out_len > 1) { + if (state.out[1].token == SL_PP_NUMBER) { + file_number = state.out[1].data.number; + } else { + strcpy(context->error_msg, "expected number after line number"); + free(state.out); + return -1; + } + + if (state.out_len > 2) { + strcpy(context->error_msg, "expected end of line after file number"); + free(state.out); + return -1; + } + } + + free(state.out); + + /* TODO: Do something with line and file numbers. */ + + return 0; +} diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 18289790d19..5479e8a8683 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -155,6 +155,10 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_extension(context, input, first, last, &state)) { return -1; } + } else if (!strcmp(name, "line")) { + if (sl_pp_process_line(context, input, first, last)) { + return -1; + } } else if (!strcmp(name, "pragma")) { if (sl_pp_process_pragma(context, input, first, last, &state)) { return -1; @@ -164,7 +168,8 @@ sl_pp_process(struct sl_pp_context *context, return -1; } } else { - /* XXX: Ignore. */ + strcpy(context->error_msg, "unrecognised directive name"); + return -1; } } diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 58918665434..6f90fbd3e77 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -112,6 +112,12 @@ sl_pp_process_extension(struct sl_pp_context *context, unsigned int last, struct sl_pp_process_state *state); +int +sl_pp_process_line(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int first, + unsigned int last); + int sl_pp_process_out(struct sl_pp_process_state *state, const struct sl_pp_token_info *token); -- cgit v1.2.3 From e8afc6558909d9503a83c8cc184a2e2bb008746b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 13:30:40 +0200 Subject: glsl: Implement predefinded macros. The values are hardcoded: __LINE__ = 1, __FILE__ = 0 and __VERSION__ = 110. --- src/glsl/pp/sl_pp_macro.c | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index a82c30cb167..bacd468964c 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_macro.h" #include "sl_pp_process.h" @@ -94,6 +95,21 @@ skip_whitespace(const struct sl_pp_token_info *input, } } +static int +_out_number(struct sl_pp_context *context, + struct sl_pp_process_state *state, + unsigned int number) +{ + char buf[32]; + struct sl_pp_token_info ti; + + sprintf(buf, "%u", number); + + ti.token = SL_PP_NUMBER; + ti.data.number = sl_pp_context_add_unique_str(context, buf); + return sl_pp_process_out(state, &ti); +} + int sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -103,6 +119,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, int mute) { int macro_name; + const char *macro_str; struct sl_pp_macro *macro = NULL; struct sl_pp_macro *actual_arg = NULL; unsigned int j; @@ -112,6 +129,30 @@ sl_pp_macro_expand(struct sl_pp_context *context, } macro_name = input[*pi].data.identifier; + macro_str = sl_pp_context_cstr(context, macro_name); + + /* TODO: Having the following built-ins hardcoded is a bit lame. */ + if (!strcmp(macro_str, "__LINE__")) { + if (!mute && _out_number(context, state, 1)) { + return -1; + } + (*pi)++; + return 0; + } + if (!strcmp(macro_str, "__FILE__")) { + if (!mute && _out_number(context, state, 0)) { + return -1; + } + (*pi)++; + return 0; + } + if (!strcmp(macro_str, "__VERSION__")) { + if (!mute && _out_number(context, state, 110)) { + return -1; + } + (*pi)++; + return 0; + } if (local) { for (macro = local; macro; macro = macro->next) { -- cgit v1.2.3 From 0d9c5eafeb35fdd2e5009ba0b397d1acdfbd3205 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:11:58 +0200 Subject: glsl: Preserve newline inside comment blocks. --- src/glsl/pp/sl_pp_purify.c | 89 ++++++++++++++++++++++++++++++---------------- 1 file changed, 58 insertions(+), 31 deletions(-) diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c index ded4dc8963b..3fb91430f37 100644 --- a/src/glsl/pp/sl_pp_purify.c +++ b/src/glsl/pp/sl_pp_purify.c @@ -106,9 +106,44 @@ _purify_backslash(const char *input, } +struct out_buf { + char *out; + unsigned int len; + unsigned int capacity; +}; + + +static int +_out_buf_putc(struct out_buf *obuf, + char c) +{ + if (obuf->len >= obuf->capacity) { + unsigned int new_max = obuf->capacity; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + obuf->out = realloc(obuf->out, new_max); + if (!obuf->out) { + return -1; + } + obuf->capacity = new_max; + } + + obuf->out[obuf->len++] = c; + + return 0; +} + + static unsigned int _purify_comment(const char *input, - char *out) + struct out_buf *obuf) { unsigned int eaten; char curr; @@ -130,7 +165,9 @@ _purify_comment(const char *input, eaten += next_eaten; input += next_eaten; if (next == '\n' || next == '\0') { - *out = next; + if (_out_buf_putc(obuf, next)) { + return 0; + } return eaten; } } @@ -148,17 +185,26 @@ _purify_comment(const char *input, eaten += next_eaten; input += next_eaten; if (next == '/') { - *out = ' '; + if (_out_buf_putc(obuf, ' ')) { + return 0; + } return eaten; } } + if (next == '\n') { + if (_out_buf_putc(obuf, '\n')) { + return 0; + } + } if (next == '\0') { return 0; } } } } - *out = curr; + if (_out_buf_putc(obuf, curr)) { + return 0; + } return eaten; } @@ -168,45 +214,26 @@ sl_pp_purify(const char *input, const struct sl_pp_purify_options *options, char **output) { - char *out = NULL; - unsigned int out_len = 0; - unsigned int out_max = 0; + struct out_buf obuf; + + obuf.out = NULL; + obuf.len = 0; + obuf.capacity = 0; for (;;) { - char c; unsigned int eaten; - eaten = _purify_comment(input, &c); + eaten = _purify_comment(input, &obuf); if (!eaten) { return -1; } input += eaten; - if (out_len >= out_max) { - unsigned int new_max = out_max; - - if (new_max < 0x100) { - new_max = 0x100; - } else if (new_max < 0x10000) { - new_max *= 2; - } else { - new_max += 0x10000; - } - - out = realloc(out, new_max); - if (!out) { - return -1; - } - out_max = new_max; - } - - out[out_len++] = c; - - if (c == '\0') { + if (obuf.out[obuf.len - 1] == '\0') { break; } } - *output = out; + *output = obuf.out; return 0; } -- cgit v1.2.3 From 4aa3222df315e3b36c73374e9000a6607c3b995c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:16:21 +0200 Subject: glsl: Correctly handle line numbering. --- src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 2 ++ src/glsl/pp/sl_pp_line.c | 47 +++++++++++++++++++++++++++++++++++++++++++-- src/glsl/pp/sl_pp_macro.c | 4 ++-- src/glsl/pp/sl_pp_process.c | 20 ++++++++++++++++++- src/glsl/pp/sl_pp_process.h | 3 ++- src/glsl/pp/sl_pp_token.h | 3 +++ src/glsl/pp/sl_pp_version.c | 8 +++++++- 8 files changed, 81 insertions(+), 7 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 38d633baeff..6aaf76828cc 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -37,6 +37,7 @@ sl_pp_context_init(struct sl_pp_context *context) context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; memset(context->error_msg, 0, sizeof(context->error_msg)); + context->line = 1; } void diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 65ce3e37b7b..d656648d0dc 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -48,6 +48,8 @@ struct sl_pp_context { int if_value; char error_msg[SL_PP_MAX_ERROR_MSG]; + + unsigned int line; }; void diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 3300a4785ba..b62af185bf5 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -29,16 +29,44 @@ #include "sl_pp_process.h" +static int +_parse_integer(const char *input, + unsigned int *number) +{ + unsigned int n = 0; + + while (*input >= '0' && *input <= '9') { + if (n * 10 < n) { + /* Overflow. */ + return -1; + } + + n = n * 10 + (*input++ - '0'); + } + + if (*input != '\0') { + /* Invalid decimal number. */ + return -1; + } + + *number = n; + return 0; +} + + int sl_pp_process_line(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int first, - unsigned int last) + unsigned int last, + struct sl_pp_process_state *pstate) { unsigned int i; struct sl_pp_process_state state; int line_number = -1; int file_number = -1; + const char *str; + unsigned int line; memset(&state, 0, sizeof(state)); for (i = first; i < last;) { @@ -89,7 +117,22 @@ sl_pp_process_line(struct sl_pp_context *context, free(state.out); - /* TODO: Do something with line and file numbers. */ + str = sl_pp_context_cstr(context, line_number); + if (_parse_integer(str, &line)) { + return -1; + } + + if (context->line != line) { + struct sl_pp_token_info ti; + + ti.token = SL_PP_LINE; + ti.data.line = line; + if (sl_pp_process_out(pstate, &ti)) { + return -1; + } + } + + /* TODO: Do something with the file number. */ return 0; } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index bacd468964c..b6214f66edc 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -131,14 +131,14 @@ sl_pp_macro_expand(struct sl_pp_context *context, macro_name = input[*pi].data.identifier; macro_str = sl_pp_context_cstr(context, macro_name); - /* TODO: Having the following built-ins hardcoded is a bit lame. */ if (!strcmp(macro_str, "__LINE__")) { - if (!mute && _out_number(context, state, 1)) { + if (!mute && _out_number(context, state, context->line)) { return -1; } (*pi)++; return 0; } + /* TODO: Having the following built-ins hardcoded is a bit lame. */ if (!strcmp(macro_str, "__FILE__")) { if (!mute && _out_number(context, state, 0)) { return -1; diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 5479e8a8683..c4d6efaed38 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -75,6 +75,21 @@ sl_pp_process(struct sl_pp_context *context, memset(&state, 0, sizeof(state)); + if (context->line > 1) { + struct sl_pp_token_info ti; + + ti.token = SL_PP_LINE; + ti.data.line = context->line - 1; + if (sl_pp_process_out(&state, &ti)) { + return -1; + } + + ti.token = SL_PP_NEWLINE; + if (sl_pp_process_out(&state, &ti)) { + return -1; + } + } + while (!found_eof) { skip_whitespace(input, &i); if (input[i].token == SL_PP_HASH) { @@ -156,7 +171,7 @@ sl_pp_process(struct sl_pp_context *context, return -1; } } else if (!strcmp(name, "line")) { - if (sl_pp_process_line(context, input, first, last)) { + if (sl_pp_process_line(context, input, first, last, &state)) { return -1; } } else if (!strcmp(name, "pragma")) { @@ -176,6 +191,7 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_out(&state, &endof)) { return -1; } + context->line++; } break; @@ -184,6 +200,7 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_out(&state, &input[i])) { return -1; } + context->line++; i++; break; @@ -214,6 +231,7 @@ sl_pp_process(struct sl_pp_context *context, if (sl_pp_process_out(&state, &input[i])) { return -1; } + context->line++; i++; found_eol = 1; break; diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index 6f90fbd3e77..adc08c18ae3 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -116,7 +116,8 @@ int sl_pp_process_line(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int first, - unsigned int last); + unsigned int last, + struct sl_pp_process_state *state); int sl_pp_process_out(struct sl_pp_process_state *state, diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 7b60183a041..b347e5cf7a9 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -96,6 +96,8 @@ enum sl_pp_token { SL_PP_EXTENSION_WARN, SL_PP_EXTENSION_DISABLE, + SL_PP_LINE, + SL_PP_EOF }; @@ -105,6 +107,7 @@ union sl_pp_token_data { char other; int pragma; int extension; + unsigned int line; }; struct sl_pp_token_info { diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 89c3cfa1a5b..80f7e971016 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -60,6 +60,7 @@ sl_pp_version(struct sl_pp_context *context, unsigned int *tokens_eaten) { unsigned int i = 0; + unsigned int line = context->line; /* Default values if `#version' is not present. */ *version = 110; @@ -77,8 +78,10 @@ sl_pp_version(struct sl_pp_context *context, /* Skip whitespace and newlines and seek for hash. */ while (!found_hash) { switch (input[i].token) { - case SL_PP_WHITESPACE: case SL_PP_NEWLINE: + line++; + /* pass thru */ + case SL_PP_WHITESPACE: i++; break; @@ -156,9 +159,12 @@ sl_pp_version(struct sl_pp_context *context, break; case SL_PP_NEWLINE: + line++; + /* pass thru */ case SL_PP_EOF: i++; *tokens_eaten = i; + context->line = line; found_end = 1; break; -- cgit v1.2.3 From b6df77fb9a6093eb8ed13b5c7c1327c162c41584 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:16:42 +0200 Subject: glsl: Handle line tokens in apps/process. --- src/glsl/apps/process.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index b40ad442bbb..ca96d62f784 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -344,6 +344,10 @@ main(int argc, fprintf(out, "#extension %s : disable", sl_pp_context_cstr(&context, outtokens[i].data.extension)); break; + case SL_PP_LINE: + fprintf(out, "#line %u", outtokens[i].data.line); + break; + default: assert(0); } -- cgit v1.2.3 From 2d2d6384448baae3c04eced3373d96907def4e13 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:20:31 +0200 Subject: glsl: Actually respect the hash-line directive. --- src/glsl/pp/sl_pp_line.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index b62af185bf5..9b9f45dcedd 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -130,6 +130,8 @@ sl_pp_process_line(struct sl_pp_context *context, if (sl_pp_process_out(pstate, &ti)) { return -1; } + + context->line = line; } /* TODO: Do something with the file number. */ -- cgit v1.2.3 From a64ba93aab6de7ee2ceb70f39cf2dbe794940c97 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:27:08 +0200 Subject: glsl: Handle file numbering. --- src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 1 + src/glsl/pp/sl_pp_line.c | 21 ++++++++++++++++++++- src/glsl/pp/sl_pp_macro.c | 3 +-- src/glsl/pp/sl_pp_token.h | 2 ++ 5 files changed, 25 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 6aaf76828cc..2fca3791a26 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -38,6 +38,7 @@ sl_pp_context_init(struct sl_pp_context *context) context->if_value = 1; memset(context->error_msg, 0, sizeof(context->error_msg)); context->line = 1; + context->file = 0; } void diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index d656648d0dc..c7e6770f449 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -50,6 +50,7 @@ struct sl_pp_context { char error_msg[SL_PP_MAX_ERROR_MSG]; unsigned int line; + unsigned int file; }; void diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 9b9f45dcedd..a56417a8610 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -134,7 +134,26 @@ sl_pp_process_line(struct sl_pp_context *context, context->line = line; } - /* TODO: Do something with the file number. */ + if (file_number != -1) { + unsigned int file; + + str = sl_pp_context_cstr(context, file_number); + if (_parse_integer(str, &file)) { + return -1; + } + + if (context->file != file) { + struct sl_pp_token_info ti; + + ti.token = SL_PP_FILE; + ti.data.file = file; + if (sl_pp_process_out(pstate, &ti)) { + return -1; + } + + context->file = file; + } + } return 0; } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index b6214f66edc..d14c9825557 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -138,9 +138,8 @@ sl_pp_macro_expand(struct sl_pp_context *context, (*pi)++; return 0; } - /* TODO: Having the following built-ins hardcoded is a bit lame. */ if (!strcmp(macro_str, "__FILE__")) { - if (!mute && _out_number(context, state, 0)) { + if (!mute && _out_number(context, state, context->file)) { return -1; } (*pi)++; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index b347e5cf7a9..59019593839 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -97,6 +97,7 @@ enum sl_pp_token { SL_PP_EXTENSION_DISABLE, SL_PP_LINE, + SL_PP_FILE, SL_PP_EOF }; @@ -108,6 +109,7 @@ union sl_pp_token_data { int pragma; int extension; unsigned int line; + unsigned int file; }; struct sl_pp_token_info { -- cgit v1.2.3 From b7960b3d3ac347604bfec705a50d6c2eda439eef Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 4 Sep 2009 15:29:35 +0200 Subject: glsl: Handle file tokens in apps/process. --- src/glsl/apps/process.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index ca96d62f784..71211ccb727 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -348,6 +348,10 @@ main(int argc, fprintf(out, "#line %u", outtokens[i].data.line); break; + case SL_PP_FILE: + fprintf(out, " #file %u", outtokens[i].data.file); + break; + default: assert(0); } -- cgit v1.2.3 From 5ad89377522061775b467d84bf6dc14305cccfbf Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 10:01:11 +0200 Subject: glsl: Add error messages for version parser. --- src/glsl/pp/sl_pp_version.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 80f7e971016..82acdd1d5a4 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -137,7 +137,7 @@ sl_pp_version(struct sl_pp_context *context, return -1; } if (_parse_integer(num, version)) { - /* Expected version number. */ + strcpy(context->error_msg, "expected version number after `#version'"); return -1; } i++; @@ -146,7 +146,7 @@ sl_pp_version(struct sl_pp_context *context, break; default: - /* Expected version number. */ + strcpy(context->error_msg, "expected version number after `#version'"); return -1; } } @@ -169,7 +169,7 @@ sl_pp_version(struct sl_pp_context *context, break; default: - /* Expected end of line. */ + strcpy(context->error_msg, "expected end of line after version number"); return -1; } } -- cgit v1.2.3 From 8bed21ecf9ff3f0244de2011f5177f16136e255f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 10:55:45 +0200 Subject: grammar: Remove grammar_check(). --- src/mesa/shader/grammar/grammar.c | 5 ----- src/mesa/shader/grammar/grammar.h | 8 -------- 2 files changed, 13 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index a9775961d3a..f1e3b837c44 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -3091,11 +3091,6 @@ static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned i return 1; } -int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size) -{ - return _grammar_check (id, text, prod, size, 0, 0); -} - int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size, unsigned int estimate_prod_size) { diff --git a/src/mesa/shader/grammar/grammar.h b/src/mesa/shader/grammar/grammar.h index 591e38aefa6..151b5f082b9 100644 --- a/src/mesa/shader/grammar/grammar.h +++ b/src/mesa/shader/grammar/grammar.h @@ -61,19 +61,11 @@ grammar grammar_load_from_text (const byte *text); int grammar_set_reg8 (grammar id, const byte *name, byte value); /* - this function is obsolete, use only for debugging purposes - checks if a null-terminated matches given grammar returns 0 on error (call grammar_get_last_error to retrieve the error text) returns 1 on success, the points to newly allocated buffer with production and is filled with the production size call grammar_alloc_free to free the memory block pointed by -*/ -int grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size); - -/* - does the same what grammar_check does but much more (approx. 4 times) faster - use this function instead of grammar_check is a hint - the initial production buffer size will be of this size, but if more room is needed it will be safely resized; set it to 0x1000 or so */ -- cgit v1.2.3 From b97a73465816652dda36b08c19038f06964ff130 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 17:45:26 +0200 Subject: grammar: Remove dead code. --- src/mesa/shader/grammar/grammar.c | 88 +++++++++++---------------------------- 1 file changed, 25 insertions(+), 63 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index f1e3b837c44..999cd3f3a53 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -3013,14 +3013,18 @@ int grammar_set_reg8 (grammar id, const byte *name, byte value) return 1; } -/* - internal checking function used by both grammar_check and grammar_fast_check functions -*/ -static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size, int use_fast_path) -{ - dict *di = NULL; +int +grammar_fast_check (grammar id, + const byte *text, + byte **prod, + unsigned int *size, + unsigned int estimate_prod_size) +{ + dict *di = NULL; int index = 0; + regbyte_ctx *rbc = NULL; + bytepool *bp = NULL; + int _P = 0; clear_last_error (); @@ -3034,69 +3038,27 @@ static int _grammar_check (grammar id, const byte *text, byte **prod, unsigned i *prod = NULL; *size = 0; - if (use_fast_path) - { - regbyte_ctx *rbc = NULL; - bytepool *bp = NULL; - int _P = 0; - - bytepool_create (&bp, estimate_prod_size); - if (bp == NULL) - return 0; - - if (fast_match (di, text, &index, di->m_syntax, &_P, bp, 0, &rbc) != mr_matched) - { - bytepool_destroy (&bp); - free_regbyte_ctx_stack (rbc, NULL); - return 0; - } - - free_regbyte_ctx_stack (rbc, NULL); - - *prod = bp->_F; - *size = _P; - bp->_F = NULL; - bytepool_destroy (&bp); - } - else - { - regbyte_ctx *rbc = NULL; - barray *ba = NULL; - - barray_create (&ba); - if (ba == NULL) - return 0; - - if (match (di, text, &index, di->m_syntax, &ba, 0, &rbc) != mr_matched) - { - barray_destroy (&ba); - free_regbyte_ctx_stack (rbc, NULL); - return 0; - } + bytepool_create (&bp, estimate_prod_size); + if (bp == NULL) + return 0; - free_regbyte_ctx_stack (rbc, NULL); + if (fast_match (di, text, &index, di->m_syntax, &_P, bp, 0, &rbc) != mr_matched) + { + bytepool_destroy (&bp); + free_regbyte_ctx_stack (rbc, NULL); + return 0; + } - *prod = (byte *) mem_alloc (ba->len * sizeof (byte)); - if (*prod == NULL) - { - barray_destroy (&ba); - return 0; - } + free_regbyte_ctx_stack (rbc, NULL); - mem_copy (*prod, ba->data, ba->len * sizeof (byte)); - *size = ba->len; - barray_destroy (&ba); - } + *prod = bp->_F; + *size = _P; + bp->_F = NULL; + bytepool_destroy (&bp); return 1; } -int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size) -{ - return _grammar_check (id, text, prod, size, estimate_prod_size, 1); -} - int grammar_destroy (grammar id) { dict **di = &g_dicts; -- cgit v1.2.3 From d26d77295b87cbd61ccafcf03d30b0c900d22a5f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 21:23:43 +0200 Subject: gdi: Add glsl to LIBS. --- src/gallium/winsys/gdi/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 86eb9ef55ed..243146fca7f 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -35,5 +35,5 @@ if env['platform'] == 'windows': env.SharedLibrary( target ='opengl32', source = sources, - LIBS = wgl + glapi + mesa + drivers + auxiliaries + env['LIBS'], + LIBS = wgl + glapi + mesa + drivers + auxiliaries + glsl + env['LIBS'], ) -- cgit v1.2.3 From ce9309d24595af324a2c7222a96100cddf5f2c9b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 21:27:42 +0200 Subject: grammar: Adapt grammar to the glsl preprocessor. --- src/mesa/shader/grammar/grammar.c | 358 ++++++++++++++++++++++++++------- src/mesa/shader/grammar/grammar_mesa.h | 6 + 2 files changed, 286 insertions(+), 78 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 999cd3f3a53..fdbdcd40c09 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -566,7 +566,7 @@ static void emit_destroy (emit **em) } } -static unsigned int emit_size (emit *_E) +static unsigned int emit_size (emit *_E, const char *str) { unsigned int n = 0; @@ -576,7 +576,9 @@ static unsigned int emit_size (emit *_E) { if (_E->m_emit_type == et_position) n += 4; /* position is a 32-bit unsigned integer */ - else + else if (_E->m_emit_type == et_stream) { + n += strlen(str) + 1; + } else n++; } _E = _E->m_next; @@ -585,7 +587,7 @@ static unsigned int emit_size (emit *_E) return n; } -static int emit_push (emit *_E, byte *_P, byte c, unsigned int _Pos, regbyte_ctx **_Ctx) +static int emit_push (emit *_E, byte *_P, const char *str, unsigned int _Pos, regbyte_ctx **_Ctx) { while (_E != NULL) { @@ -593,9 +595,10 @@ static int emit_push (emit *_E, byte *_P, byte c, unsigned int _Pos, regbyte_ctx { if (_E->m_emit_type == et_byte) *_P++ = _E->m_byte; - else if (_E->m_emit_type == et_stream) - *_P++ = c; - else /* _Em->type == et_position */ + else if (_E->m_emit_type == et_stream) { + strcpy(_P, str); + _P += strlen(str) + 1; + } else /* _Em->type == et_position */ { *_P++ = (byte) (_Pos); *_P++ = (byte) (_Pos >> 8); @@ -617,7 +620,7 @@ static int emit_push (emit *_E, byte *_P, byte c, unsigned int _Pos, regbyte_ctx if (_E->m_emit_type == et_byte) new_rbc->m_current_value = _E->m_byte; else if (_E->m_emit_type == et_stream) - new_rbc->m_current_value = c; + new_rbc->m_current_value = str[0]; } _E = _E->m_next; @@ -727,6 +730,7 @@ typedef enum spec_type_ { st_false, st_true, + st_token, st_byte, st_byte_range, st_string, @@ -741,6 +745,7 @@ typedef enum spec_type_ typedef struct spec_ { spec_type m_spec_type; + enum sl_pp_token m_token; /* st_token */ byte m_byte[2]; /* st_byte, st_byte_range */ byte *m_string; /* st_string */ struct rule_ *m_rule; /* st_identifier, st_identifier_loop */ @@ -979,12 +984,12 @@ static int barray_append (barray **ba, barray **nb) */ static int barray_push (barray **ba, emit *em, byte c, unsigned int pos, regbyte_ctx **rbc) { - unsigned int count = emit_size (em); + unsigned int count = emit_size(em, " "); if (barray_resize (ba, (**ba).len + count)) return 1; - return emit_push (em, (**ba).data + ((**ba).len - count), c, pos, rbc); + return emit_push (em, (**ba).data + ((**ba).len - count), " ", pos, rbc); } /* @@ -1967,7 +1972,110 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb } eat_spaces (&t); - s->m_spec_type = st_string; + /* Try to convert string to a token. */ + if (s->m_string[0] == '@') { + s->m_spec_type = st_token; + if (!strcmp(s->m_string, "@,")) { + s->m_token = SL_PP_COMMA; + } else if (!strcmp(s->m_string, "@;")) { + s->m_token = SL_PP_SEMICOLON; + } else if (!strcmp(s->m_string, "@{")) { + s->m_token = SL_PP_LBRACE; + } else if (!strcmp(s->m_string, "@}")) { + s->m_token = SL_PP_RBRACE; + } else if (!strcmp(s->m_string, "@(")) { + s->m_token = SL_PP_LPAREN; + } else if (!strcmp(s->m_string, "@)")) { + s->m_token = SL_PP_RPAREN; + } else if (!strcmp(s->m_string, "@[")) { + s->m_token = SL_PP_LBRACKET; + } else if (!strcmp(s->m_string, "@]")) { + s->m_token = SL_PP_RBRACKET; + } else if (!strcmp(s->m_string, "@.")) { + s->m_token = SL_PP_DOT; + } else if (!strcmp(s->m_string, "@++")) { + s->m_token = SL_PP_INCREMENT; + } else if (!strcmp(s->m_string, "@+=")) { + s->m_token = SL_PP_ADDASSIGN; + } else if (!strcmp(s->m_string, "@+")) { + s->m_token = SL_PP_PLUS; + } else if (!strcmp(s->m_string, "@--")) { + s->m_token = SL_PP_DECREMENT; + } else if (!strcmp(s->m_string, "@-=")) { + s->m_token = SL_PP_SUBASSIGN; + } else if (!strcmp(s->m_string, "@-")) { + s->m_token = SL_PP_MINUS; + } else if (!strcmp(s->m_string, "@~")) { + s->m_token = SL_PP_BITNOT; + } else if (!strcmp(s->m_string, "@!=")) { + s->m_token = SL_PP_NOTEQUAL; + } else if (!strcmp(s->m_string, "@!")) { + s->m_token = SL_PP_NOT; + } else if (!strcmp(s->m_string, "@*=")) { + s->m_token = SL_PP_MULASSIGN; + } else if (!strcmp(s->m_string, "@*")) { + s->m_token = SL_PP_STAR; + } else if (!strcmp(s->m_string, "@/=")) { + s->m_token = SL_PP_DIVASSIGN; + } else if (!strcmp(s->m_string, "@/")) { + s->m_token = SL_PP_SLASH; + } else if (!strcmp(s->m_string, "@%=")) { + s->m_token = SL_PP_MODASSIGN; + } else if (!strcmp(s->m_string, "@%")) { + s->m_token = SL_PP_MODULO; + } else if (!strcmp(s->m_string, "@<<=")) { + s->m_token = SL_PP_LSHIFTASSIGN; + } else if (!strcmp(s->m_string, "@<<")) { + s->m_token = SL_PP_LSHIFT; + } else if (!strcmp(s->m_string, "@<=")) { + s->m_token = SL_PP_LESSEQUAL; + } else if (!strcmp(s->m_string, "@<")) { + s->m_token = SL_PP_LESS; + } else if (!strcmp(s->m_string, "@>>=")) { + s->m_token = SL_PP_RSHIFTASSIGN; + } else if (!strcmp(s->m_string, "@>>")) { + s->m_token = SL_PP_RSHIFT; + } else if (!strcmp(s->m_string, "@>=")) { + s->m_token = SL_PP_GREATEREQUAL; + } else if (!strcmp(s->m_string, "@>")) { + s->m_token = SL_PP_GREATER; + } else if (!strcmp(s->m_string, "@==")) { + s->m_token = SL_PP_EQUAL; + } else if (!strcmp(s->m_string, "@=")) { + s->m_token = SL_PP_ASSIGN; + } else if (!strcmp(s->m_string, "@&&")) { + s->m_token = SL_PP_AND; + } else if (!strcmp(s->m_string, "@&=")) { + s->m_token = SL_PP_BITANDASSIGN; + } else if (!strcmp(s->m_string, "@&")) { + s->m_token = SL_PP_BITAND; + } else if (!strcmp(s->m_string, "@^^")) { + s->m_token = SL_PP_XOR; + } else if (!strcmp(s->m_string, "@^=")) { + s->m_token = SL_PP_BITXORASSIGN; + } else if (!strcmp(s->m_string, "@^")) { + s->m_token = SL_PP_BITXOR; + } else if (!strcmp(s->m_string, "@||")) { + s->m_token = SL_PP_OR; + } else if (!strcmp(s->m_string, "@|=")) { + s->m_token = SL_PP_BITORASSIGN; + } else if (!strcmp(s->m_string, "@|")) { + s->m_token = SL_PP_BITOR; + } else if (!strcmp(s->m_string, "@?")) { + s->m_token = SL_PP_QUESTION; + } else if (!strcmp(s->m_string, "@:")) { + s->m_token = SL_PP_COLON; + } else if (!strcmp(s->m_string, "@ID")) { + s->m_token = SL_PP_IDENTIFIER; + } else if (!strcmp(s->m_string, "@NUM")) { + s->m_token = SL_PP_NUMBER; + } else { + spec_destroy(&s); + return 1; + } + } else { + s->m_spec_type = st_string; + } } else if (*t == '.') { @@ -2518,11 +2626,17 @@ match (dict *di, const byte *text, int *index, rule *ru, barray **ba, int filter } static match_result -fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool *_BP, - int filtering_string, regbyte_ctx **rbc) +fast_match(dict *di, + const struct sl_pp_token_info *tokens, + int *index, + rule *ru, + int *_PP, + bytepool *_BP, + regbyte_ctx **rbc, + struct sl_pp_context *context) { int ind = *index; - int _P = filtering_string ? 0 : *_PP; + int _P = *_PP; int _P2; match_result status = mr_not_matched; spec *sp = ru->m_specs; @@ -2531,9 +2645,9 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool /* for every specifier in the rule */ while (sp) { - int i, len, save_ind = ind; + int save_ind = ind; - _P2 = _P + (sp->m_emits ? emit_size (sp->m_emits) : 0); + _P2 = _P + (sp->m_emits ? emit_size(sp->m_emits, sl_pp_context_cstr(context, tokens[ind].data.identifier)) : 0); if (bytepool_reserve (_BP, _P2)) { free_regbyte_ctx_stack (ctx, *rbc); @@ -2545,7 +2659,7 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool switch (sp->m_spec_type) { case st_identifier: - status = fast_match (di, text, &ind, sp->m_rule, &_P2, _BP, filtering_string, &ctx); + status = fast_match(di, tokens, &ind, sp->m_rule, &_P2, _BP, &ctx, context); if (status == mr_internal_error) { @@ -2553,58 +2667,38 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool return mr_internal_error; } break; - case st_string: - len = str_length (sp->m_string); - - /* prefilter the stream */ - if (!filtering_string && di->m_string) - { - int filter_index = 0; - match_result result; - regbyte_ctx *null_ctx = NULL; - - result = fast_match (di, text + ind, &filter_index, di->m_string, NULL, _BP, 1, &null_ctx); - - if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - if (result != mr_matched) - { - status = mr_not_matched; - break; - } + case st_token: + if (tokens[ind].token == sp->m_token) { + status = mr_matched; + ind++; + } else { + status = mr_not_matched; + } + break; - if (filter_index != len || !str_equal_n (sp->m_string, text + ind, len)) - { - status = mr_not_matched; - break; - } + case st_string: + if (tokens[ind].token != SL_PP_IDENTIFIER) { + status = mr_not_matched; + break; + } - status = mr_matched; - ind += len; - } - else - { - status = mr_matched; - for (i = 0; status == mr_matched && i < len; i++) - if (text[ind + i] != sp->m_string[i]) - status = mr_not_matched; + if (!strcmp(sl_pp_context_cstr(context, tokens[ind].data.identifier), sp->m_string)) { + status = mr_matched; + ind++; + } else { + status = mr_not_matched; + } + break; - if (status == mr_matched) - ind += len; - } - break; case st_byte: - status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched; + /**status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched;**/ if (status == mr_matched) ind++; break; case st_byte_range: - status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? - mr_matched : mr_not_matched; + /**status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? + mr_matched : mr_not_matched;**/ if (status == mr_matched) ind++; break; @@ -2624,7 +2718,7 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool match_result result; save_ind = ind; - result = fast_match (di, text, &ind, sp->m_rule, &_P2, _BP, filtering_string, &ctx); + result = fast_match(di, tokens, &ind, sp->m_rule, &_P2, _BP, &ctx, context); if (result == mr_error_raised) { @@ -2633,11 +2727,9 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool } else if (result == mr_matched) { - if (!filtering_string) - { if (sp->m_emits != NULL) { - if (emit_push (sp->m_emits, _BP->_F + _P, text[ind - 1], save_ind, &ctx)) + if (emit_push (sp->m_emits, _BP->_F + _P, sl_pp_context_cstr(context, tokens[ind - 1].data.identifier), save_ind, &ctx)) { free_regbyte_ctx_stack (ctx, *rbc); return mr_internal_error; @@ -2645,13 +2737,12 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool } _P = _P2; - _P2 += sp->m_emits ? emit_size (sp->m_emits) : 0; + _P2 += sp->m_emits ? emit_size(sp->m_emits, sl_pp_context_cstr(context, tokens[ind].data.identifier)) : 0; if (bytepool_reserve (_BP, _P2)) { free_regbyte_ctx_stack (ctx, *rbc); return mr_internal_error; } - } } else if (result == mr_internal_error) { @@ -2682,8 +2773,8 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool if (sp->m_errtext) { - set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, - ind), ind); + /**set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, + ind), ind);**/ return mr_error_raised; } @@ -2694,8 +2785,8 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool if (status == mr_matched) { if (sp->m_emits != NULL) { - const byte ch = (ind <= 0) ? 0 : text[ind - 1]; - if (emit_push (sp->m_emits, _BP->_F + _P, ch, save_ind, &ctx)) + const char *str = (ind <= 0) ? "" : sl_pp_context_cstr(context, tokens[ind - 1].data.identifier); + if (emit_push (sp->m_emits, _BP->_F + _P, str, save_ind, &ctx)) { free_regbyte_ctx_stack (ctx, *rbc); return mr_internal_error; @@ -2710,7 +2801,6 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool { *index = ind; *rbc = ctx; - if (!filtering_string) *_PP = _P; return mr_matched; } @@ -2723,7 +2813,6 @@ fast_match (dict *di, const byte *text, int *index, rule *ru, int *_PP, bytepool { *index = ind; *rbc = ctx; - if (!filtering_string) *_PP = _P; return mr_matched; } @@ -3021,6 +3110,8 @@ grammar_fast_check (grammar id, unsigned int estimate_prod_size) { dict *di = NULL; + struct sl_pp_context context; + struct sl_pp_token_info *tokens; int index = 0; regbyte_ctx *rbc = NULL; bytepool *bp = NULL; @@ -3038,25 +3129,136 @@ grammar_fast_check (grammar id, *prod = NULL; *size = 0; - bytepool_create (&bp, estimate_prod_size); - if (bp == NULL) - return 0; + /* + * Preprocess the source string with a GLSL preprocessor. + * This is a hack but since nowadays we use grammar only for + * GLSL compiler, and that also is going away, we'll do it anyway. + */ - if (fast_match (di, text, &index, di->m_syntax, &_P, bp, 0, &rbc) != mr_matched) { + struct sl_pp_purify_options options; + char *outbuf; + struct sl_pp_token_info *intokens; + unsigned int version; + unsigned int tokens_eaten; + + memset(&options, 0, sizeof(options)); + if (sl_pp_purify((const char *)text, &options, &outbuf)) { + return 0; + } + + sl_pp_context_init(&context); + + if (sl_pp_tokenise(&context, outbuf, &intokens)) { + sl_pp_context_destroy(&context); + free(outbuf); + return 0; + } + + free(outbuf); + + if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { + sl_pp_context_destroy(&context); + free(intokens); + return 0; + } + + if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { + sl_pp_context_destroy(&context); + free(intokens); + return 0; + } + + free(intokens); + + /* For the time being we care about only a handful of tokens. */ + { + const struct sl_pp_token_info *src = tokens; + struct sl_pp_token_info *dst = tokens; + + while (src->token != SL_PP_EOF) { + switch (src->token) { + case SL_PP_COMMA: + case SL_PP_SEMICOLON: + case SL_PP_LBRACE: + case SL_PP_RBRACE: + case SL_PP_LPAREN: + case SL_PP_RPAREN: + case SL_PP_LBRACKET: + case SL_PP_RBRACKET: + case SL_PP_DOT: + case SL_PP_INCREMENT: + case SL_PP_ADDASSIGN: + case SL_PP_PLUS: + case SL_PP_DECREMENT: + case SL_PP_SUBASSIGN: + case SL_PP_MINUS: + case SL_PP_BITNOT: + case SL_PP_NOTEQUAL: + case SL_PP_NOT: + case SL_PP_MULASSIGN: + case SL_PP_STAR: + case SL_PP_DIVASSIGN: + case SL_PP_SLASH: + case SL_PP_MODASSIGN: + case SL_PP_MODULO: + case SL_PP_LSHIFTASSIGN: + case SL_PP_LSHIFT: + case SL_PP_LESSEQUAL: + case SL_PP_LESS: + case SL_PP_RSHIFTASSIGN: + case SL_PP_RSHIFT: + case SL_PP_GREATEREQUAL: + case SL_PP_GREATER: + case SL_PP_EQUAL: + case SL_PP_ASSIGN: + case SL_PP_AND: + case SL_PP_BITANDASSIGN: + case SL_PP_BITAND: + case SL_PP_XOR: + case SL_PP_BITXORASSIGN: + case SL_PP_BITXOR: + case SL_PP_OR: + case SL_PP_BITORASSIGN: + case SL_PP_BITOR: + case SL_PP_QUESTION: + case SL_PP_COLON: + case SL_PP_IDENTIFIER: + case SL_PP_NUMBER: + *dst++ = *src++; + + default: + src++; + } + } + } + } + + bytepool_create(&bp, estimate_prod_size); + if (bp == NULL) { + sl_pp_context_destroy(&context); + free(tokens); + return 0; + } + + if (fast_match(di, tokens, &index, di->m_syntax, &_P, bp, &rbc, &context) != mr_matched) { + sl_pp_context_destroy(&context); + free(tokens); bytepool_destroy (&bp); free_regbyte_ctx_stack (rbc, NULL); return 0; } - free_regbyte_ctx_stack (rbc, NULL); + sl_pp_context_destroy(&context); + free(tokens); + free_regbyte_ctx_stack(rbc, NULL); *prod = bp->_F; *size = _P; bp->_F = NULL; - bytepool_destroy (&bp); + bytepool_destroy(&bp); - return 1; + return 1; } int grammar_destroy (grammar id) diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h index 6c92c5812da..7f4370f32d0 100644 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ b/src/mesa/shader/grammar/grammar_mesa.h @@ -26,6 +26,12 @@ #define GRAMMAR_MESA_H +#include "../../glsl/pp/sl_pp_context.h" +#include "../../glsl/pp/sl_pp_purify.h" +#include "../../glsl/pp/sl_pp_version.h" +#include "../../glsl/pp/sl_pp_process.h" + + #include "main/imports.h" /* NOTE: include Mesa 3-D specific headers here */ -- cgit v1.2.3 From 5ddcdc42277ee2ba011980aebac7f3a12bd80c9d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Sep 2009 21:30:34 +0200 Subject: slang: Adapt shader syntax description to grammar parser changes. --- src/mesa/shader/slang/library/slang_shader.syn | 209 +++++------------------ src/mesa/shader/slang/library/slang_shader_syn.h | 172 +++++-------------- 2 files changed, 78 insertions(+), 303 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index cc5c70a02f8..cfd7b17b35d 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -1412,83 +1412,18 @@ function_definition * helper rules, not part of the official language syntax */ -digit_oct - '0'-'7'; - -digit_dec - '0'-'9'; - -digit_hex - '0'-'9' .or 'A'-'F' .or 'a'-'f'; - -id_character_first - 'a'-'z' .or 'A'-'Z' .or '_'; - -id_character_next - id_character_first .or digit_dec; - identifier - id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\0'; + "@ID" .emit *; float - float_1 .or float_2 .or float_3; -float_1 - float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix; -float_2 - float_digit_sequence .and .true .emit '\0' .and float_exponent_part .and optional_f_suffix; -float_3 - float_digit_sequence .and .true .emit '\0' .and 'f' .emit '\0'; - -float_fractional_constant - float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3; -float_fractional_constant_1 - float_digit_sequence .and '.' .and float_digit_sequence; -float_fractional_constant_2 - float_digit_sequence .and '.' .and .true .emit '\0'; -float_fractional_constant_3 - '.' .emit '\0' .and float_digit_sequence; - -float_optional_exponent_part - float_exponent_part .or .true .emit '\0'; - -float_digit_sequence - digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -float_exponent_part - float_exponent_part_1 .or float_exponent_part_2; -float_exponent_part_1 - 'e' .and float_optional_sign .and float_digit_sequence; -float_exponent_part_2 - 'E' .and float_optional_sign .and float_digit_sequence; - -float_optional_sign - float_sign .or .true; - -float_sign - '+' .or '-' .emit '-'; - -optional_f_suffix - 'f' .or .true; - + "@NUM" .emit *; integer - integer_hex .or integer_oct .or integer_dec; - -integer_hex - '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and - .true .emit '\0'; -integer_hex_1 - 'x' .or 'X'; - -integer_oct - '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\0'; - -integer_dec - digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; + "@NUM" .emit *; boolean - "true" .emit 2 .emit '1' .emit '\0' .or - "false" .emit 2 .emit '0' .emit '\0'; + "true" .emit '1' .emit '\0' .or + "false" .emit '0' .emit '\0'; type_name identifier; @@ -1506,53 +1441,10 @@ boolconstant boolean .emit OP_PUSH_BOOL; optional_space - .loop single_space; + .true; space - single_space .and .loop single_space; - -single_space - white_char .or c_style_comment_block .or cpp_style_comment_block; - -white_char - ' ' .or '\t' .or new_line .or '\v' .or '\f'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; + .true; /* lexical rules */ @@ -1560,7 +1452,7 @@ cpp_style_comment_char optional_space .and '&' .and optional_space;*/ ampersandampersand - optional_space .and '&' .and '&' .and optional_space; + "@&&"; /*ampersandequals optional_space .and '&' .and '=' .and optional_space;*/ @@ -1569,46 +1461,46 @@ ampersandampersand optional_space .and '|' .and optional_space;*/ barbar - optional_space .and '|' .and '|' .and optional_space; + "@||"; /*barequals optional_space .and '|' .and '=' .and optional_space;*/ bang - optional_space .and '!' .and optional_space; + "@!"; bangequals - optional_space .and '!' .and '=' .and optional_space; + "@!="; /*caret optional_space .and '^' .and optional_space;*/ caretcaret - optional_space .and '^' .and '^' .and optional_space; + "@^^"; /*caretequals optional_space .and '^' .and '=' .and optional_space;*/ colon - optional_space .and ':' .and optional_space; + "@:"; comma - optional_space .and ',' .and optional_space; + "@,"; dot - optional_space .and '.' .and optional_space; + "@."; equals - optional_space .and '=' .and optional_space; + "@="; equalsequals - optional_space .and '=' .and '=' .and optional_space; + "@=="; greater - optional_space .and '>' .and optional_space; + "@>"; greaterequals - optional_space .and '>' .and '=' .and optional_space; + "@>="; /*greatergreater optional_space .and '>' .and '>' .and optional_space;*/ @@ -1617,16 +1509,16 @@ greaterequals optional_space .and '>' .and '>' .and '=' .and optional_space;*/ lbrace - optional_space .and '{' .and optional_space; + "@{"; lbracket - optional_space .and '[' .and optional_space; + "@["; less - optional_space .and '<' .and optional_space; + "@<"; lessequals - optional_space .and '<' .and '=' .and optional_space; + "@<="; /*lessless optional_space .and '<' .and '<' .and optional_space;*/ @@ -1635,16 +1527,16 @@ lessequals optional_space .and '<' .and '<' .and '=' .and optional_space;*/ lparen - optional_space .and '(' .and optional_space; + "@("; minus - optional_space .and '-' .and optional_space; + "@-"; minusequals - optional_space .and '-' .and '=' .and optional_space; + "@-="; minusminus - optional_space .and '-' .and '-' .and optional_space; + "@--"; /*percent optional_space .and '%' .and optional_space;*/ @@ -1653,64 +1545,41 @@ minusminus optional_space .and '%' .and '=' .and optional_space;*/ plus - optional_space .and '+' .and optional_space; + "@+"; plusequals - optional_space .and '+' .and '=' .and optional_space; + "@+="; plusplus - optional_space .and '+' .and '+' .and optional_space; + "@++"; question - optional_space .and '?' .and optional_space; + "@?"; rbrace - optional_space .and '}' .and optional_space; + "@}"; rbracket - optional_space .and ']' .and optional_space; + "@]"; rparen - optional_space .and ')' .and optional_space; + "@)"; semicolon - optional_space .and ';' .and optional_space; + "@;"; slash - optional_space .and '/' .and optional_space; + "@/"; slashequals - optional_space .and '/' .and '=' .and optional_space; + "@/="; star - optional_space .and '*' .and optional_space; + "@*"; starequals - optional_space .and '*' .and '=' .and optional_space; + "@*="; /*tilde optional_space .and '~' .and optional_space;*/ -/* string rules - these are used internally by the parser when parsing quoted strings */ - -.string string_lexer; - -string_lexer - lex_first_identifier_character .and .loop lex_next_identifier_character; - -lex_first_identifier_character - 'a'-'z' .or 'A'-'Z' .or '_'; - -lex_next_identifier_character - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - -/* error rules - these are used by error messages */ - -err_token - '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or - '-' .or '+' .or '=' .or '|' .or '\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '"' .or - '\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier; - -err_identifier - id_character_first .and .loop id_character_next; - diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index 6a382970e1a..d7ee0765613 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -682,64 +682,15 @@ " \"invariant\" .and space .and identifier .and semicolon;\n" "function_definition\n" " function_prototype .and compound_statement_no_new_scope;\n" -"digit_oct\n" -" '0'-'7';\n" -"digit_dec\n" -" '0'-'9';\n" -"digit_hex\n" -" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n" -"id_character_first\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"id_character_next\n" -" id_character_first .or digit_dec;\n" "identifier\n" -" id_character_first .emit * .and .loop id_character_next .emit * .and .true .emit '\\0';\n" +" \"@ID\" .emit *;\n" "float\n" -" float_1 .or float_2 .or float_3;\n" -"float_1\n" -" float_fractional_constant .and float_optional_exponent_part .and optional_f_suffix;\n" -"float_2\n" -" float_digit_sequence .and .true .emit '\\0' .and float_exponent_part .and optional_f_suffix;\n" -"float_3\n" -" float_digit_sequence .and .true .emit '\\0' .and 'f' .emit '\\0';\n" -"float_fractional_constant\n" -" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n" -"float_fractional_constant_1\n" -" float_digit_sequence .and '.' .and float_digit_sequence;\n" -"float_fractional_constant_2\n" -" float_digit_sequence .and '.' .and .true .emit '\\0';\n" -"float_fractional_constant_3\n" -" '.' .emit '\\0' .and float_digit_sequence;\n" -"float_optional_exponent_part\n" -" float_exponent_part .or .true .emit '\\0';\n" -"float_digit_sequence\n" -" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"float_exponent_part\n" -" float_exponent_part_1 .or float_exponent_part_2;\n" -"float_exponent_part_1\n" -" 'e' .and float_optional_sign .and float_digit_sequence;\n" -"float_exponent_part_2\n" -" 'E' .and float_optional_sign .and float_digit_sequence;\n" -"float_optional_sign\n" -" float_sign .or .true;\n" -"float_sign\n" -" '+' .or '-' .emit '-';\n" -"optional_f_suffix\n" -" 'f' .or .true;\n" +" \"@NUM\" .emit *;\n" "integer\n" -" integer_hex .or integer_oct .or integer_dec;\n" -"integer_hex\n" -" '0' .and integer_hex_1 .emit 0x10 .and digit_hex .emit * .and .loop digit_hex .emit * .and\n" -" .true .emit '\\0';\n" -"integer_hex_1\n" -" 'x' .or 'X';\n" -"integer_oct\n" -" '0' .emit 8 .emit * .and .loop digit_oct .emit * .and .true .emit '\\0';\n" -"integer_dec\n" -" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" +" \"@NUM\" .emit *;\n" "boolean\n" -" \"true\" .emit 2 .emit '1' .emit '\\0' .or\n" -" \"false\" .emit 2 .emit '0' .emit '\\0';\n" +" \"true\" .emit '1' .emit '\\0' .or\n" +" \"false\" .emit '0' .emit '\\0';\n" "type_name\n" " identifier;\n" "field_selection\n" @@ -751,116 +702,71 @@ "boolconstant\n" " boolean .emit OP_PUSH_BOOL;\n" "optional_space\n" -" .loop single_space;\n" +" .true;\n" "space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" white_char .or c_style_comment_block .or cpp_style_comment_block;\n" -"white_char\n" -" ' ' .or '\\t' .or new_line .or '\\v' .or '\\f';\n" -"new_line\n" -" cr_lf .or lf_cr .or '\\n' .or '\\r';\n" -"cr_lf\n" -" '\\r' .and '\\n';\n" -"lf_cr\n" -" '\\n' .and '\\r';\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest;\n" -"c_style_comment_rest\n" -" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n" -"c_style_comment_rest_1\n" -" c_style_comment_end .or c_style_comment_rest_2;\n" -"c_style_comment_rest_2\n" -" '*' .and c_style_comment_rest;\n" -"c_style_comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_end\n" -" '*' .and '/';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" +" .true;\n" "ampersandampersand\n" -" optional_space .and '&' .and '&' .and optional_space;\n" +" \"@&&\";\n" "barbar\n" -" optional_space .and '|' .and '|' .and optional_space;\n" +" \"@||\";\n" "bang\n" -" optional_space .and '!' .and optional_space;\n" +" \"@!\";\n" "bangequals\n" -" optional_space .and '!' .and '=' .and optional_space;\n" +" \"@!=\";\n" "caretcaret\n" -" optional_space .and '^' .and '^' .and optional_space;\n" +" \"@^^\";\n" "colon\n" -" optional_space .and ':' .and optional_space;\n" +" \"@:\";\n" "comma\n" -" optional_space .and ',' .and optional_space;\n" +" \"@,\";\n" "dot\n" -" optional_space .and '.' .and optional_space;\n" +" \"@.\";\n" "equals\n" -" optional_space .and '=' .and optional_space;\n" +" \"@=\";\n" "equalsequals\n" -" optional_space .and '=' .and '=' .and optional_space;\n" +" \"@==\";\n" "greater\n" -" optional_space .and '>' .and optional_space;\n" +" \"@>\";\n" "greaterequals\n" -" optional_space .and '>' .and '=' .and optional_space;\n" +" \"@>=\";\n" "lbrace\n" -" optional_space .and '{' .and optional_space;\n" +" \"@{\";\n" "lbracket\n" -" optional_space .and '[' .and optional_space;\n" +" \"@[\";\n" "less\n" -" optional_space .and '<' .and optional_space;\n" +" \"@<\";\n" "lessequals\n" -" optional_space .and '<' .and '=' .and optional_space;\n" +" \"@<=\";\n" "lparen\n" -" optional_space .and '(' .and optional_space;\n" +" \"@(\";\n" "minus\n" -" optional_space .and '-' .and optional_space;\n" +" \"@-\";\n" "minusequals\n" -" optional_space .and '-' .and '=' .and optional_space;\n" +" \"@-=\";\n" "minusminus\n" -" optional_space .and '-' .and '-' .and optional_space;\n" +" \"@--\";\n" "plus\n" -" optional_space .and '+' .and optional_space;\n" +" \"@+\";\n" "plusequals\n" -" optional_space .and '+' .and '=' .and optional_space;\n" +" \"@+=\";\n" "plusplus\n" -" optional_space .and '+' .and '+' .and optional_space;\n" +" \"@++\";\n" "question\n" -" optional_space .and '?' .and optional_space;\n" +" \"@?\";\n" "rbrace\n" -" optional_space .and '}' .and optional_space;\n" +" \"@}\";\n" "rbracket\n" -" optional_space .and ']' .and optional_space;\n" +" \"@]\";\n" "rparen\n" -" optional_space .and ')' .and optional_space;\n" +" \"@)\";\n" "semicolon\n" -" optional_space .and ';' .and optional_space;\n" +" \"@;\";\n" "slash\n" -" optional_space .and '/' .and optional_space;\n" +" \"@/\";\n" "slashequals\n" -" optional_space .and '/' .and '=' .and optional_space;\n" +" \"@/=\";\n" "star\n" -" optional_space .and '*' .and optional_space;\n" +" \"@*\";\n" "starequals\n" -" optional_space .and '*' .and '=' .and optional_space;\n" -".string string_lexer;\n" -"string_lexer\n" -" lex_first_identifier_character .and .loop lex_next_identifier_character;\n" -"lex_first_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"lex_next_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"err_token\n" -" '~' .or '`' .or '!' .or '@' .or '#' .or '$' .or '%' .or '^' .or '&' .or '*' .or '(' .or ')' .or\n" -" '-' .or '+' .or '=' .or '|' .or '\\\\' .or '[' .or ']' .or '{' .or '}' .or ':' .or ';' .or '\"' .or\n" -" '\\'' .or '<' .or ',' .or '>' .or '.' .or '/' .or '?' .or err_identifier;\n" -"err_identifier\n" -" id_character_first .and .loop id_character_next;\n" +" \"@*=\";\n" "" -- cgit v1.2.3 From 0aeff7638b4ae14a9142ff05390cbc89a058d57e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 10:22:07 +0200 Subject: gdi: Fix prototype of gdi_softpipe_surface_buffer_create(). --- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 33826524d7a..66120a6a983 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -166,6 +166,7 @@ gdi_softpipe_surface_buffer_create(struct pipe_winsys *winsys, unsigned width, unsigned height, enum pipe_format format, unsigned usage, + unsigned tex_usage, unsigned *stride) { const unsigned alignment = 64; -- cgit v1.2.3 From 7e6e5cd60a4ce2f63cd2563307d79fc0ed7218cd Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 10:33:49 +0200 Subject: slang: Remove dependencies on error tokens. --- src/mesa/shader/slang/library/slang_shader.syn | 10 +++++----- src/mesa/shader/slang/library/slang_shader_syn.h | 10 +++++----- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index cfd7b17b35d..f35356bf4a0 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -274,11 +274,11 @@ /* any syntax errors... */ .errtext INVALID_EXTERNAL_DECLARATION "2001: Syntax error." .errtext INVALID_OPERATOR_OVERRIDE "2002: Invalid operator override." -.errtext LBRACE_EXPECTED "2003: '{' expected but '$err_token$' found." -.errtext LPAREN_EXPECTED "2004: '(' expected but '$err_token$' found." -.errtext RPAREN_EXPECTED "2005: ')' expected but '$err_token$' found." -.errtext INVALID_PRECISION "2006: Invalid precision specifier '$err_token$'." -.errtext INVALID_PRECISION_TYPE "2007: Invalid precision type '$err_token$'." +.errtext LBRACE_EXPECTED "2003: '{' expected but token found." +.errtext LPAREN_EXPECTED "2004: '(' expected but token found." +.errtext RPAREN_EXPECTED "2005: ')' expected but token found." +.errtext INVALID_PRECISION "2006: Invalid precision specifier." +.errtext INVALID_PRECISION_TYPE "2007: Invalid precision type." /* diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index d7ee0765613..ca62d41b7f4 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -150,11 +150,11 @@ ".emtcode PARAMETER_ARRAY_PRESENT 1\n" ".errtext INVALID_EXTERNAL_DECLARATION \"2001: Syntax error.\"\n" ".errtext INVALID_OPERATOR_OVERRIDE \"2002: Invalid operator override.\"\n" -".errtext LBRACE_EXPECTED \"2003: '{' expected but '$err_token$' found.\"\n" -".errtext LPAREN_EXPECTED \"2004: '(' expected but '$err_token$' found.\"\n" -".errtext RPAREN_EXPECTED \"2005: ')' expected but '$err_token$' found.\"\n" -".errtext INVALID_PRECISION \"2006: Invalid precision specifier '$err_token$'.\"\n" -".errtext INVALID_PRECISION_TYPE \"2007: Invalid precision type '$err_token$'.\"\n" +".errtext LBRACE_EXPECTED \"2003: '{' expected but token found.\"\n" +".errtext LPAREN_EXPECTED \"2004: '(' expected but token found.\"\n" +".errtext RPAREN_EXPECTED \"2005: ')' expected but token found.\"\n" +".errtext INVALID_PRECISION \"2006: Invalid precision specifier.\"\n" +".errtext INVALID_PRECISION_TYPE \"2007: Invalid precision type.\"\n" ".regbyte parsing_builtin 0\n" ".regbyte shader_type 0\n" "variable_identifier\n" -- cgit v1.2.3 From d06069f30513163108489dd189dc8027cb4ad643 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 10:46:29 +0200 Subject: slang: Remove the old preprocessor. --- src/mesa/SConscript | 1 - src/mesa/shader/slang/descrip.mms | 3 +- src/mesa/shader/slang/library/Makefile | 11 +- .../shader/slang/library/slang_pp_directives.syn | 405 ------ .../shader/slang/library/slang_pp_directives_syn.h | 250 ---- .../shader/slang/library/slang_pp_expression.syn | 265 ---- .../shader/slang/library/slang_pp_expression_syn.h | 179 --- src/mesa/shader/slang/library/slang_pp_version.syn | 122 -- .../shader/slang/library/slang_pp_version_syn.h | 69 - src/mesa/shader/slang/library/slang_version.syn | 118 -- src/mesa/shader/slang/slang_compile.c | 20 +- src/mesa/shader/slang/slang_preprocess.c | 1406 -------------------- src/mesa/shader/slang/slang_preprocess.h | 41 - src/mesa/sources.mak | 1 - 14 files changed, 5 insertions(+), 2886 deletions(-) delete mode 100644 src/mesa/shader/slang/library/slang_pp_directives.syn delete mode 100644 src/mesa/shader/slang/library/slang_pp_directives_syn.h delete mode 100644 src/mesa/shader/slang/library/slang_pp_expression.syn delete mode 100644 src/mesa/shader/slang/library/slang_pp_expression_syn.h delete mode 100644 src/mesa/shader/slang/library/slang_pp_version.syn delete mode 100644 src/mesa/shader/slang/library/slang_pp_version_syn.h delete mode 100644 src/mesa/shader/slang/library/slang_version.syn delete mode 100644 src/mesa/shader/slang/slang_preprocess.c delete mode 100644 src/mesa/shader/slang/slang_preprocess.h diff --git a/src/mesa/SConscript b/src/mesa/SConscript index cad56763208..dde9bb08a99 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -225,7 +225,6 @@ if env['platform'] != 'winddk': 'shader/slang/slang_link.c', 'shader/slang/slang_log.c', 'shader/slang/slang_mem.c', - 'shader/slang/slang_preprocess.c', 'shader/slang/slang_print.c', 'shader/slang/slang_simplify.c', 'shader/slang/slang_storage.c', diff --git a/src/mesa/shader/slang/descrip.mms b/src/mesa/shader/slang/descrip.mms index 6eefbcf5bdd..759a01cf040 100644 --- a/src/mesa/shader/slang/descrip.mms +++ b/src/mesa/shader/slang/descrip.mms @@ -22,7 +22,7 @@ LIBDIR = [----.lib] CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm SOURCES = \ - slang_compile.c,slang_preprocess.c + slang_compile.c OBJECTS = slang_builtin.obj,slang_codegen.obj,slang_compile.obj,\ slang_compile_function.obj,slang_compile_operation.obj,\ @@ -59,7 +59,6 @@ slang_library_noise.obj : slang_library_noise.c slang_link.obj : slang_link.c slang_log.obj : slang_log.c slang_mem.obj : slang_mem.c -slang_preprocess.obj : slang_preprocess.c slang_print.obj : slang_print.c slang_simplify.obj : slang_simplify.c slang_storage.obj : slang_storage.c diff --git a/src/mesa/shader/slang/library/Makefile b/src/mesa/shader/slang/library/Makefile index 0e03fac2ee1..5033d887c5b 100644 --- a/src/mesa/shader/slang/library/Makefile +++ b/src/mesa/shader/slang/library/Makefile @@ -19,7 +19,7 @@ default: syntax builtin clean: -rm -f syn_to_c gc_to_bin *_syn.h *_gc.h -syntax: slang_pp_directives_syn.h slang_pp_expression_syn.h slang_shader_syn.h slang_pp_version_syn.h +syntax: slang_shader_syn.h builtin: builtin_110 builtin_120 @@ -37,18 +37,9 @@ gc_to_bin: gc_to_bin.c slang_shader_syn.h # syntax scripts # -slang_pp_directives_syn.h: syn_to_c slang_pp_directives.syn - ./syn_to_c slang_pp_directives.syn > slang_pp_directives_syn.h - -slang_pp_expression_syn.h: syn_to_c slang_pp_expression.syn - ./syn_to_c slang_pp_expression.syn > slang_pp_expression_syn.h - slang_shader_syn.h: syn_to_c slang_shader.syn ./syn_to_c slang_shader.syn > slang_shader_syn.h -slang_pp_version_syn.h: syn_to_c slang_pp_version.syn - ./syn_to_c slang_pp_version.syn > slang_pp_version_syn.h - # # builtin library sources # diff --git a/src/mesa/shader/slang/library/slang_pp_directives.syn b/src/mesa/shader/slang/library/slang_pp_directives.syn deleted file mode 100644 index b51d168cc03..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_directives.syn +++ /dev/null @@ -1,405 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file slang_pp_directives.syn - * slang preprocessor directives parser - * \author Michal Krol - */ - -.syntax source; - -/* - * This syntax script preprocesses a GLSL shader. - * It is assumed, that the #version directive has been parsed. Separate pass for parsing - * version gives better control on behavior depending on the version number given. - * - * The output is a source string with comments and directives removed. White spaces and comments - * are replaced with on or more spaces. All new-lines are preserved and converted to Linux format. - * Directives are escaped with a null character. The end of the source string is marked by - * two consecutive null characters. The consumer is responsible for executing the escaped - * directives, removing dead portions of code and expanding macros. - */ - -.emtcode ESCAPE_TOKEN 0 - -/* - * The TOKEN_* symbols follow the ESCAPE_TOKEN. - * - * NOTE: - * There is no TOKEN_IFDEF and neither is TOKEN_IFNDEF. They are handled with TOKEN_IF and - * operator defined. - * The "#ifdef SYMBOL" is replaced with "#if defined SYMBOL" - * The "#ifndef SYMBOL" is replaced with "#if !defined SYMBOL" - */ -.emtcode TOKEN_END 0 -.emtcode TOKEN_DEFINE 1 -.emtcode TOKEN_UNDEF 2 -.emtcode TOKEN_IF 3 -.emtcode TOKEN_ELSE 4 -.emtcode TOKEN_ELIF 5 -.emtcode TOKEN_ENDIF 6 -.emtcode TOKEN_ERROR 7 -.emtcode TOKEN_PRAGMA 8 -.emtcode TOKEN_EXTENSION 9 -.emtcode TOKEN_LINE 10 - -/* - * The PARAM_* symbols follow the TOKEN_DEFINE. - */ -.emtcode PARAM_END 0 -.emtcode PARAM_PARAMETER 1 - -/* - * The BEHAVIOR_* symbols follow the TOKEN_EXTENSION. - */ -.emtcode BEHAVIOR_REQUIRE 1 -.emtcode BEHAVIOR_ENABLE 2 -.emtcode BEHAVIOR_WARN 3 -.emtcode BEHAVIOR_DISABLE 4 - -/* - * The PRAGMA_* symbols follow TOKEN_PRAGMA - */ -.emtcode PRAGMA_NO_PARAM 0 -.emtcode PRAGMA_PARAM 1 - -source - optional_directive .and .loop source_element .and '\0' .emit ESCAPE_TOKEN .emit TOKEN_END; - -source_element - c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest .and .true .emit ' '; - -c_style_comment_rest - .loop c_style_comment_body .and c_style_comment_end; - -c_style_comment_body - c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar; - -c_style_comment_char_nostar - new_line .or '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_char_star_noslashstar - '*' .and c_style_comment_char_star_noslashstar_1; -c_style_comment_char_star_noslashstar_1 - c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar; - -c_style_comment_char_noslashstar - new_line .or '\x30'-'\xFF' .or '\x01'-'\x29' .or '\x2B'-'\x2E'; - -c_style_comment_end - '*' .and .loop c_style_comment_char_star .and '/'; - -c_style_comment_char_star - '*'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line_directive; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line_directive - new_line .and optional_directive; - -new_line - generic_new_line .emit '\n'; - -generic_new_line - carriage_return_line_feed .or line_feed_carriage_return .or '\n' .or '\r'; - -carriage_return_line_feed - '\r' .and '\n'; - -line_feed_carriage_return - '\n' .and '\r'; - -optional_directive - directive .emit ESCAPE_TOKEN .or .true; - -directive - dir_define .emit TOKEN_DEFINE .or - dir_undef .emit TOKEN_UNDEF .or - dir_if .emit TOKEN_IF .or - dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd' - .emit ' ' .or - dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' - .emit 'd' .emit ' ' .or - dir_else .emit TOKEN_ELSE .or - dir_elif .emit TOKEN_ELIF .or - dir_endif .emit TOKEN_ENDIF .or - dir_ext .emit TOKEN_EXTENSION .or - dir_pragma .emit TOKEN_PRAGMA .or - dir_line .emit TOKEN_LINE; - -dir_define - optional_space .and '#' .and optional_space .and "define" .and symbol .and opt_parameters .and - definition; - -dir_undef - optional_space .and '#' .and optional_space .and "undef" .and symbol; - -dir_if - optional_space .and '#' .and optional_space .and "if" .and expression; - -dir_ifdef - optional_space .and '#' .and optional_space .and "ifdef" .and symbol; - -dir_ifndef - optional_space .and '#' .and optional_space .and "ifndef" .and symbol; - -dir_else - optional_space .and '#' .and optional_space .and "else"; - -dir_elif - optional_space .and '#' .and optional_space .and "elif" .and expression; - -dir_endif - optional_space .and '#' .and optional_space .and "endif"; - -dir_ext - optional_space .and '#' .and optional_space .and "extension" .and space .and extension_name .and - optional_space .and ':' .and optional_space .and extension_behavior; - -dir_line - optional_space .and '#' .and optional_space .and "line" .and expression; - -dir_pragma - optional_space .and '#' .and optional_space .and "pragma" .and symbol .and opt_pragma_param; - - -opt_pragma_param - pragma_param .or .true .emit PRAGMA_NO_PARAM; - -pragma_param - optional_space .and '(' .emit PRAGMA_PARAM .and optional_space .and symbol_no_space .and optional_space .and ')'; - -symbol_no_space - symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -symbol - space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -opt_parameters - parameters .or .true .emit PARAM_END; - -parameters - '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END; -parameters_1 - parameters_2 .or .true; -parameters_2 - parameter .emit PARAM_PARAMETER .and .loop parameters_3; -parameters_3 - optional_space .and ',' .and parameter .emit PARAM_PARAMETER; - -parameter - optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and - .true .emit '\0'; - -definition - .loop definition_character .emit * .and .true .emit '\0'; - -definition_character - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -expression - expression_element .and .loop expression_element .and .true .emit '\0'; - -expression_element - expression_character .emit *; - -expression_character - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -extension_name - symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\0'; - -extension_behavior - "require" .emit BEHAVIOR_REQUIRE .or - "enable" .emit BEHAVIOR_ENABLE .or - "warn" .emit BEHAVIOR_WARN .or - "disable" .emit BEHAVIOR_DISABLE; - -optional_space - .loop single_space; - -space - single_space .and .loop single_space; - -single_space - ' ' .or '\t'; - -source_token - space .emit ' ' .or complex_token .or source_token_1; -source_token_1 - simple_token .emit ' ' .and .true .emit ' '; - -/* - * All possible tokens. - */ - -complex_token - identifier .or number; - -simple_token - increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or - addto .or subtractfrom .or multiplyto .or divideto .or other; - -identifier - identifier_char1 .emit * .and .loop identifier_char2 .emit *; -identifier_char1 - 'a'-'z' .or 'A'-'Z' .or '_'; -identifier_char2 - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - -number - float .or integer; - -digit_oct - '0'-'7'; - -digit_dec - '0'-'9'; - -digit_hex - '0'-'9' .or 'A'-'F' .or 'a'-'f'; - -float - float_1 .or float_2; -float_1 - float_fractional_constant .and float_optional_exponent_part; -float_2 - float_digit_sequence .and float_exponent_part; - -float_fractional_constant - float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3; -float_fractional_constant_1 - float_digit_sequence .and '.' .emit '.' .and float_digit_sequence; -float_fractional_constant_2 - float_digit_sequence .and '.' .emit '.'; -float_fractional_constant_3 - '.' .emit '.' .and float_digit_sequence; - -float_optional_exponent_part - float_exponent_part .or .true; - -float_digit_sequence - digit_dec .emit * .and .loop digit_dec .emit *; - -float_exponent_part - float_exponent_part_1 .or float_exponent_part_2; -float_exponent_part_1 - 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence; -float_exponent_part_2 - 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence; - -float_optional_sign - '+' .emit '+' .or '-' .emit '-' .or .true; - -integer - integer_hex .or integer_oct .or integer_dec; - -integer_hex - '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and - .loop digit_hex .emit *; -integer_hex_1 - 'x' .or 'X'; - -integer_oct - '0' .emit '0' .and .loop digit_oct .emit *; - -integer_dec - digit_dec .emit * .and .loop digit_dec .emit *; - -increment - '+' .emit * .and '+' .emit *; - -decrement - '-' .emit * .and '-' .emit *; - -lequal - '<' .emit * .and '=' .emit *; - -gequal - '>' .emit * .and '=' .emit *; - -equal - '=' .emit * .and '=' .emit *; - -nequal - '!' .emit * .and '=' .emit *; - -and - '&' .emit * .and '&' .emit *; - -xor - '^' .emit * .and '^' .emit *; - -or - '|' .emit * .and '|' .emit *; - -addto - '+' .emit * .and '=' .emit *; - -subtractfrom - '-' .emit * .and '=' .emit *; - -multiplyto - '*' .emit * .and '=' .emit *; - -divideto - '/' .emit * .and '=' .emit *; - -/* - * All characters except '\0' and '#'. - */ -other - '\x24'-'\xFF' .emit * .or '\x01'-'\x22' .emit *; - -symbol_character - 'A'-'Z' .or 'a'-'z' .or '_'; - -symbol_character2 - 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_'; - -.string string_lexer; - -string_lexer - lex_first_identifier_character .and .loop lex_next_identifier_character; - -lex_first_identifier_character - 'a'-'z' .or 'A'-'Z' .or '_'; - -lex_next_identifier_character - 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_'; - diff --git a/src/mesa/shader/slang/library/slang_pp_directives_syn.h b/src/mesa/shader/slang/library/slang_pp_directives_syn.h deleted file mode 100644 index 430f8d8217c..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_directives_syn.h +++ /dev/null @@ -1,250 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax source;\n" -".emtcode ESCAPE_TOKEN 0\n" -".emtcode TOKEN_END 0\n" -".emtcode TOKEN_DEFINE 1\n" -".emtcode TOKEN_UNDEF 2\n" -".emtcode TOKEN_IF 3\n" -".emtcode TOKEN_ELSE 4\n" -".emtcode TOKEN_ELIF 5\n" -".emtcode TOKEN_ENDIF 6\n" -".emtcode TOKEN_ERROR 7\n" -".emtcode TOKEN_PRAGMA 8\n" -".emtcode TOKEN_EXTENSION 9\n" -".emtcode TOKEN_LINE 10\n" -".emtcode PARAM_END 0\n" -".emtcode PARAM_PARAMETER 1\n" -".emtcode BEHAVIOR_REQUIRE 1\n" -".emtcode BEHAVIOR_ENABLE 2\n" -".emtcode BEHAVIOR_WARN 3\n" -".emtcode BEHAVIOR_DISABLE 4\n" -".emtcode PRAGMA_NO_PARAM 0\n" -".emtcode PRAGMA_PARAM 1\n" -"source\n" -" optional_directive .and .loop source_element .and '\\0' .emit ESCAPE_TOKEN .emit TOKEN_END;\n" -"source_element\n" -" c_style_comment_block .or cpp_style_comment_block .or new_line_directive .or source_token;\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest .and .true .emit ' ';\n" -"c_style_comment_rest\n" -" .loop c_style_comment_body .and c_style_comment_end;\n" -"c_style_comment_body\n" -" c_style_comment_char_nostar .or c_style_comment_char_star_noslashstar;\n" -"c_style_comment_char_nostar\n" -" new_line .or '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_char_star_noslashstar\n" -" '*' .and c_style_comment_char_star_noslashstar_1;\n" -"c_style_comment_char_star_noslashstar_1\n" -" c_style_comment_char_noslashstar .or c_style_comment_char_star_noslashstar;\n" -"c_style_comment_char_noslashstar\n" -" new_line .or '\\x30'-'\\xFF' .or '\\x01'-'\\x29' .or '\\x2B'-'\\x2E';\n" -"c_style_comment_end\n" -" '*' .and .loop c_style_comment_char_star .and '/';\n" -"c_style_comment_char_star\n" -" '*';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line_directive;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"new_line_directive\n" -" new_line .and optional_directive;\n" -"new_line\n" -" generic_new_line .emit '\\n';\n" -"generic_new_line\n" -" carriage_return_line_feed .or line_feed_carriage_return .or '\\n' .or '\\r';\n" -"carriage_return_line_feed\n" -" '\\r' .and '\\n';\n" -"line_feed_carriage_return\n" -" '\\n' .and '\\r';\n" -"optional_directive\n" -" directive .emit ESCAPE_TOKEN .or .true;\n" -"directive\n" -" dir_define .emit TOKEN_DEFINE .or\n" -" dir_undef .emit TOKEN_UNDEF .or\n" -" dir_if .emit TOKEN_IF .or\n" -" dir_ifdef .emit TOKEN_IF .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e' .emit 'd'\n" -" .emit ' ' .or\n" -" dir_ifndef .emit TOKEN_IF .emit '!' .emit 'd' .emit 'e' .emit 'f' .emit 'i' .emit 'n' .emit 'e'\n" -" .emit 'd' .emit ' ' .or\n" -" dir_else .emit TOKEN_ELSE .or\n" -" dir_elif .emit TOKEN_ELIF .or\n" -" dir_endif .emit TOKEN_ENDIF .or\n" -" dir_ext .emit TOKEN_EXTENSION .or\n" -" dir_pragma .emit TOKEN_PRAGMA .or\n" -" dir_line .emit TOKEN_LINE;\n" -"dir_define\n" -" optional_space .and '#' .and optional_space .and \"define\" .and symbol .and opt_parameters .and\n" -" definition;\n" -"dir_undef\n" -" optional_space .and '#' .and optional_space .and \"undef\" .and symbol;\n" -"dir_if\n" -" optional_space .and '#' .and optional_space .and \"if\" .and expression;\n" -"dir_ifdef\n" -" optional_space .and '#' .and optional_space .and \"ifdef\" .and symbol;\n" -"dir_ifndef\n" -" optional_space .and '#' .and optional_space .and \"ifndef\" .and symbol;\n" -"dir_else\n" -" optional_space .and '#' .and optional_space .and \"else\";\n" -"dir_elif\n" -" optional_space .and '#' .and optional_space .and \"elif\" .and expression;\n" -"dir_endif\n" -" optional_space .and '#' .and optional_space .and \"endif\";\n" -"dir_ext\n" -" optional_space .and '#' .and optional_space .and \"extension\" .and space .and extension_name .and\n" -" optional_space .and ':' .and optional_space .and extension_behavior;\n" -"dir_line\n" -" optional_space .and '#' .and optional_space .and \"line\" .and expression;\n" -"dir_pragma\n" -" optional_space .and '#' .and optional_space .and \"pragma\" .and symbol .and opt_pragma_param;\n" -"opt_pragma_param\n" -" pragma_param .or .true .emit PRAGMA_NO_PARAM;\n" -"pragma_param\n" -" optional_space .and '(' .emit PRAGMA_PARAM .and optional_space .and symbol_no_space .and optional_space .and ')';\n" -"symbol_no_space\n" -" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"symbol\n" -" space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"opt_parameters\n" -" parameters .or .true .emit PARAM_END;\n" -"parameters\n" -" '(' .and parameters_1 .and optional_space .and ')' .emit PARAM_END;\n" -"parameters_1\n" -" parameters_2 .or .true;\n" -"parameters_2\n" -" parameter .emit PARAM_PARAMETER .and .loop parameters_3;\n" -"parameters_3\n" -" optional_space .and ',' .and parameter .emit PARAM_PARAMETER;\n" -"parameter\n" -" optional_space .and symbol_character .emit * .and .loop symbol_character2 .emit * .and\n" -" .true .emit '\\0';\n" -"definition\n" -" .loop definition_character .emit * .and .true .emit '\\0';\n" -"definition_character\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"expression\n" -" expression_element .and .loop expression_element .and .true .emit '\\0';\n" -"expression_element\n" -" expression_character .emit *;\n" -"expression_character\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"extension_name\n" -" symbol_character .emit * .and .loop symbol_character2 .emit * .and .true .emit '\\0';\n" -"extension_behavior\n" -" \"require\" .emit BEHAVIOR_REQUIRE .or\n" -" \"enable\" .emit BEHAVIOR_ENABLE .or\n" -" \"warn\" .emit BEHAVIOR_WARN .or\n" -" \"disable\" .emit BEHAVIOR_DISABLE;\n" -"optional_space\n" -" .loop single_space;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"source_token\n" -" space .emit ' ' .or complex_token .or source_token_1;\n" -"source_token_1\n" -" simple_token .emit ' ' .and .true .emit ' ';\n" -"complex_token\n" -" identifier .or number;\n" -"simple_token\n" -" increment .or decrement .or lequal .or gequal .or equal .or nequal .or and .or xor .or or .or\n" -" addto .or subtractfrom .or multiplyto .or divideto .or other;\n" -"identifier\n" -" identifier_char1 .emit * .and .loop identifier_char2 .emit *;\n" -"identifier_char1\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"identifier_char2\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"number\n" -" float .or integer;\n" -"digit_oct\n" -" '0'-'7';\n" -"digit_dec\n" -" '0'-'9';\n" -"digit_hex\n" -" '0'-'9' .or 'A'-'F' .or 'a'-'f';\n" -"float\n" -" float_1 .or float_2;\n" -"float_1\n" -" float_fractional_constant .and float_optional_exponent_part;\n" -"float_2\n" -" float_digit_sequence .and float_exponent_part;\n" -"float_fractional_constant\n" -" float_fractional_constant_1 .or float_fractional_constant_2 .or float_fractional_constant_3;\n" -"float_fractional_constant_1\n" -" float_digit_sequence .and '.' .emit '.' .and float_digit_sequence;\n" -"float_fractional_constant_2\n" -" float_digit_sequence .and '.' .emit '.';\n" -"float_fractional_constant_3\n" -" '.' .emit '.' .and float_digit_sequence;\n" -"float_optional_exponent_part\n" -" float_exponent_part .or .true;\n" -"float_digit_sequence\n" -" digit_dec .emit * .and .loop digit_dec .emit *;\n" -"float_exponent_part\n" -" float_exponent_part_1 .or float_exponent_part_2;\n" -"float_exponent_part_1\n" -" 'e' .emit 'e' .and float_optional_sign .and float_digit_sequence;\n" -"float_exponent_part_2\n" -" 'E' .emit 'E' .and float_optional_sign .and float_digit_sequence;\n" -"float_optional_sign\n" -" '+' .emit '+' .or '-' .emit '-' .or .true;\n" -"integer\n" -" integer_hex .or integer_oct .or integer_dec;\n" -"integer_hex\n" -" '0' .emit '0' .and integer_hex_1 .emit * .and digit_hex .emit * .and\n" -" .loop digit_hex .emit *;\n" -"integer_hex_1\n" -" 'x' .or 'X';\n" -"integer_oct\n" -" '0' .emit '0' .and .loop digit_oct .emit *;\n" -"integer_dec\n" -" digit_dec .emit * .and .loop digit_dec .emit *;\n" -"increment\n" -" '+' .emit * .and '+' .emit *;\n" -"decrement\n" -" '-' .emit * .and '-' .emit *;\n" -"lequal\n" -" '<' .emit * .and '=' .emit *;\n" -"gequal\n" -" '>' .emit * .and '=' .emit *;\n" -"equal\n" -" '=' .emit * .and '=' .emit *;\n" -"nequal\n" -" '!' .emit * .and '=' .emit *;\n" -"and\n" -" '&' .emit * .and '&' .emit *;\n" -"xor\n" -" '^' .emit * .and '^' .emit *;\n" -"or\n" -" '|' .emit * .and '|' .emit *;\n" -"addto\n" -" '+' .emit * .and '=' .emit *;\n" -"subtractfrom\n" -" '-' .emit * .and '=' .emit *;\n" -"multiplyto\n" -" '*' .emit * .and '=' .emit *;\n" -"divideto\n" -" '/' .emit * .and '=' .emit *;\n" -"other\n" -" '\\x24'-'\\xFF' .emit * .or '\\x01'-'\\x22' .emit *;\n" -"symbol_character\n" -" 'A'-'Z' .or 'a'-'z' .or '_';\n" -"symbol_character2\n" -" 'A'-'Z' .or 'a'-'z' .or '0'-'9' .or '_';\n" -".string string_lexer;\n" -"string_lexer\n" -" lex_first_identifier_character .and .loop lex_next_identifier_character;\n" -"lex_first_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"lex_next_identifier_character\n" -" 'a'-'z' .or 'A'-'Z' .or '0'-'9' .or '_';\n" -"" diff --git a/src/mesa/shader/slang/library/slang_pp_expression.syn b/src/mesa/shader/slang/library/slang_pp_expression.syn deleted file mode 100644 index bfdb220bf5c..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_expression.syn +++ /dev/null @@ -1,265 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file slang_pp_expression.syn - * slang preprocessor expression parser - * \author Michal Krol - */ - -/* - * Parses one or two (optional) expressions on literal integer constants. Those expressions come - * from #if #elif and #line directives. The preprocessor already parsed those directives and - * expanded the expression (expressions). All occurences of the operator "defined" are already - * replaced with either "0" or "1" literals. - */ - -.syntax expression; - -/* - * Those separate individual expressions. - * For #if/#elif case it is: EXP_EXPRESSION ... EXP_END - * For #line case it may be: EXP_EXPRESSION ... EXP_EXPRESSION ... EXP_END - */ -.emtcode EXP_END 0 -.emtcode EXP_EXPRESSION 1 - -.emtcode OP_END 0 -.emtcode OP_PUSHINT 1 -.emtcode OP_LOGICALOR 2 -.emtcode OP_LOGICALAND 3 -.emtcode OP_OR 4 -.emtcode OP_XOR 5 -.emtcode OP_AND 6 -.emtcode OP_EQUAL 7 -.emtcode OP_NOTEQUAL 8 -.emtcode OP_LESSEQUAL 9 -.emtcode OP_GREATEREQUAL 10 -.emtcode OP_LESS 11 -.emtcode OP_GREATER 12 -.emtcode OP_LEFTSHIFT 13 -.emtcode OP_RIGHTSHIFT 14 -.emtcode OP_ADD 15 -.emtcode OP_SUBTRACT 16 -.emtcode OP_MULTIPLY 17 -.emtcode OP_DIVIDE 18 -.emtcode OP_MODULUS 19 -.emtcode OP_PLUS 20 -.emtcode OP_MINUS 21 -.emtcode OP_NEGATE 22 -.emtcode OP_COMPLEMENT 23 - -expression - first_expression .and optional_second_expression .and optional_space .and '\0' .emit EXP_END; - -first_expression - optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END; - -optional_second_expression - second_expression .or .true; - -second_expression - space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END; - -logical_or_expression - logical_and_expression .and .loop logical_or_expression_1; -logical_or_expression_1 - barbar .and logical_and_expression .and .true .emit OP_LOGICALOR; - -logical_and_expression - or_expression .and .loop logical_and_expression_1; -logical_and_expression_1 - ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND; - -or_expression - xor_expression .and .loop or_expression_1; -or_expression_1 - bar .and xor_expression .and .true .emit OP_OR; - -xor_expression - and_expression .and .loop xor_expression_1; -xor_expression_1 - caret .and and_expression .and .true .emit OP_XOR; - -and_expression - equality_expression .and .loop and_expression_1; -and_expression_1 - ampersand .and equality_expression .and .true .emit OP_AND; - -equality_expression - relational_expression .and .loop equality_expression_1; -equality_expression_1 - equality_expression_2 .or equality_expression_3; -equality_expression_2 - equalsequals .and relational_expression .and .true .emit OP_EQUAL; -equality_expression_3 - bangequals .and relational_expression .and .true .emit OP_NOTEQUAL; - -relational_expression - shift_expression .and .loop relational_expression_1; -relational_expression_1 - relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or - relational_expression_5; -relational_expression_2 - lessequals .and shift_expression .and .true .emit OP_LESSEQUAL; -relational_expression_3 - greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL; -relational_expression_4 - less .and shift_expression .and .true .emit OP_LESS; -relational_expression_5 - greater .and shift_expression .and .true .emit OP_GREATER; - -shift_expression - additive_expression .and .loop shift_expression_1; -shift_expression_1 - shift_expression_2 .or shift_expression_3; -shift_expression_2 - lessless .and additive_expression .and .true .emit OP_LEFTSHIFT; -shift_expression_3 - greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT; - -additive_expression - multiplicative_expression .and .loop additive_expression_1; -additive_expression_1 - additive_expression_2 .or additive_expression_3; -additive_expression_2 - plus .and multiplicative_expression .and .true .emit OP_ADD; -additive_expression_3 - dash .and multiplicative_expression .and .true .emit OP_SUBTRACT; - -multiplicative_expression - unary_expression .and .loop multiplicative_expression_1; -multiplicative_expression_1 - multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4; -multiplicative_expression_2 - star .and unary_expression .and .true .emit OP_MULTIPLY; -multiplicative_expression_3 - slash .and unary_expression .and .true .emit OP_DIVIDE; -multiplicative_expression_4 - percent .and unary_expression .and .true .emit OP_MODULUS; - -unary_expression - primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or - unary_expression_4; -unary_expression_1 - plus .and unary_expression .and .true .emit OP_PLUS; -unary_expression_2 - dash .and unary_expression .and .true .emit OP_MINUS; -unary_expression_3 - bang .and unary_expression .and .true .emit OP_NEGATE; -unary_expression_4 - tilda .and unary_expression .and .true .emit OP_COMPLEMENT; - -primary_expression - intconstant .or primary_expression_1; -primary_expression_1 - lparen .and logical_or_expression .and rparen; - -intconstant - integer .emit OP_PUSHINT; - -integer - integer_dec; - -integer_dec - digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -digit_dec - '0'-'9'; - -optional_space - .loop single_space; - -space - single_space .and .loop single_space; - -single_space - ' ' .or '\t'; - -ampersand - optional_space .and '&' .and optional_space; - -ampersandampersand - optional_space .and '&' .and '&' .and optional_space; - -bang - optional_space .and '!' .and optional_space; - -bangequals - optional_space .and '!' .and '=' .and optional_space; - -bar - optional_space .and '|' .and optional_space; - -barbar - optional_space .and '|' .and '|' .and optional_space; - -caret - optional_space .and '^' .and optional_space; - -dash - optional_space .and '-' .and optional_space; - -equalsequals - optional_space .and '=' .and '=' .and optional_space; - -greater - optional_space .and '>' .and optional_space; - -greaterequals - optional_space .and '>' .and '=' .and optional_space; - -greatergreater - optional_space .and '>' .and '>' .and optional_space; - -less - optional_space .and '<' .and optional_space; - -lessequals - optional_space .and '<' .and '=' .and optional_space; - -lessless - optional_space .and '<' .and '<' .and optional_space; - -lparen - optional_space .and '(' .and optional_space; - -percent - optional_space .and '%' .and optional_space; - -plus - optional_space .and '+' .and optional_space; - -rparen - optional_space .and ')' .and optional_space; - -slash - optional_space .and '/' .and optional_space; - -star - optional_space .and '*' .and optional_space; - -tilda - optional_space .and '~' .and optional_space; - diff --git a/src/mesa/shader/slang/library/slang_pp_expression_syn.h b/src/mesa/shader/slang/library/slang_pp_expression_syn.h deleted file mode 100644 index f3e9ef6b229..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_expression_syn.h +++ /dev/null @@ -1,179 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax expression;\n" -".emtcode EXP_END 0\n" -".emtcode EXP_EXPRESSION 1\n" -".emtcode OP_END 0\n" -".emtcode OP_PUSHINT 1\n" -".emtcode OP_LOGICALOR 2\n" -".emtcode OP_LOGICALAND 3\n" -".emtcode OP_OR 4\n" -".emtcode OP_XOR 5\n" -".emtcode OP_AND 6\n" -".emtcode OP_EQUAL 7\n" -".emtcode OP_NOTEQUAL 8\n" -".emtcode OP_LESSEQUAL 9\n" -".emtcode OP_GREATEREQUAL 10\n" -".emtcode OP_LESS 11\n" -".emtcode OP_GREATER 12\n" -".emtcode OP_LEFTSHIFT 13\n" -".emtcode OP_RIGHTSHIFT 14\n" -".emtcode OP_ADD 15\n" -".emtcode OP_SUBTRACT 16\n" -".emtcode OP_MULTIPLY 17\n" -".emtcode OP_DIVIDE 18\n" -".emtcode OP_MODULUS 19\n" -".emtcode OP_PLUS 20\n" -".emtcode OP_MINUS 21\n" -".emtcode OP_NEGATE 22\n" -".emtcode OP_COMPLEMENT 23\n" -"expression\n" -" first_expression .and optional_second_expression .and optional_space .and '\\0' .emit EXP_END;\n" -"first_expression\n" -" optional_space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" -"optional_second_expression\n" -" second_expression .or .true;\n" -"second_expression\n" -" space .and logical_or_expression .emit EXP_EXPRESSION .and .true .emit OP_END;\n" -"logical_or_expression\n" -" logical_and_expression .and .loop logical_or_expression_1;\n" -"logical_or_expression_1\n" -" barbar .and logical_and_expression .and .true .emit OP_LOGICALOR;\n" -"logical_and_expression\n" -" or_expression .and .loop logical_and_expression_1;\n" -"logical_and_expression_1\n" -" ampersandampersand .and or_expression .and .true .emit OP_LOGICALAND;\n" -"or_expression\n" -" xor_expression .and .loop or_expression_1;\n" -"or_expression_1\n" -" bar .and xor_expression .and .true .emit OP_OR;\n" -"xor_expression\n" -" and_expression .and .loop xor_expression_1;\n" -"xor_expression_1\n" -" caret .and and_expression .and .true .emit OP_XOR;\n" -"and_expression\n" -" equality_expression .and .loop and_expression_1;\n" -"and_expression_1\n" -" ampersand .and equality_expression .and .true .emit OP_AND;\n" -"equality_expression\n" -" relational_expression .and .loop equality_expression_1;\n" -"equality_expression_1\n" -" equality_expression_2 .or equality_expression_3;\n" -"equality_expression_2\n" -" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n" -"equality_expression_3\n" -" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n" -"relational_expression\n" -" shift_expression .and .loop relational_expression_1;\n" -"relational_expression_1\n" -" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n" -" relational_expression_5;\n" -"relational_expression_2\n" -" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n" -"relational_expression_3\n" -" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n" -"relational_expression_4\n" -" less .and shift_expression .and .true .emit OP_LESS;\n" -"relational_expression_5\n" -" greater .and shift_expression .and .true .emit OP_GREATER;\n" -"shift_expression\n" -" additive_expression .and .loop shift_expression_1;\n" -"shift_expression_1\n" -" shift_expression_2 .or shift_expression_3;\n" -"shift_expression_2\n" -" lessless .and additive_expression .and .true .emit OP_LEFTSHIFT;\n" -"shift_expression_3\n" -" greatergreater .and additive_expression .and .true .emit OP_RIGHTSHIFT;\n" -"additive_expression\n" -" multiplicative_expression .and .loop additive_expression_1;\n" -"additive_expression_1\n" -" additive_expression_2 .or additive_expression_3;\n" -"additive_expression_2\n" -" plus .and multiplicative_expression .and .true .emit OP_ADD;\n" -"additive_expression_3\n" -" dash .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n" -"multiplicative_expression\n" -" unary_expression .and .loop multiplicative_expression_1;\n" -"multiplicative_expression_1\n" -" multiplicative_expression_2 .or multiplicative_expression_3 .or multiplicative_expression_4;\n" -"multiplicative_expression_2\n" -" star .and unary_expression .and .true .emit OP_MULTIPLY;\n" -"multiplicative_expression_3\n" -" slash .and unary_expression .and .true .emit OP_DIVIDE;\n" -"multiplicative_expression_4\n" -" percent .and unary_expression .and .true .emit OP_MODULUS;\n" -"unary_expression\n" -" primary_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" -" unary_expression_4;\n" -"unary_expression_1\n" -" plus .and unary_expression .and .true .emit OP_PLUS;\n" -"unary_expression_2\n" -" dash .and unary_expression .and .true .emit OP_MINUS;\n" -"unary_expression_3\n" -" bang .and unary_expression .and .true .emit OP_NEGATE;\n" -"unary_expression_4\n" -" tilda .and unary_expression .and .true .emit OP_COMPLEMENT;\n" -"primary_expression\n" -" intconstant .or primary_expression_1;\n" -"primary_expression_1\n" -" lparen .and logical_or_expression .and rparen;\n" -"intconstant\n" -" integer .emit OP_PUSHINT;\n" -"integer\n" -" integer_dec;\n" -"integer_dec\n" -" digit_dec .emit 10 .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"digit_dec\n" -" '0'-'9';\n" -"optional_space\n" -" .loop single_space;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"ampersand\n" -" optional_space .and '&' .and optional_space;\n" -"ampersandampersand\n" -" optional_space .and '&' .and '&' .and optional_space;\n" -"bang\n" -" optional_space .and '!' .and optional_space;\n" -"bangequals\n" -" optional_space .and '!' .and '=' .and optional_space;\n" -"bar\n" -" optional_space .and '|' .and optional_space;\n" -"barbar\n" -" optional_space .and '|' .and '|' .and optional_space;\n" -"caret\n" -" optional_space .and '^' .and optional_space;\n" -"dash\n" -" optional_space .and '-' .and optional_space;\n" -"equalsequals\n" -" optional_space .and '=' .and '=' .and optional_space;\n" -"greater\n" -" optional_space .and '>' .and optional_space;\n" -"greaterequals\n" -" optional_space .and '>' .and '=' .and optional_space;\n" -"greatergreater\n" -" optional_space .and '>' .and '>' .and optional_space;\n" -"less\n" -" optional_space .and '<' .and optional_space;\n" -"lessequals\n" -" optional_space .and '<' .and '=' .and optional_space;\n" -"lessless\n" -" optional_space .and '<' .and '<' .and optional_space;\n" -"lparen\n" -" optional_space .and '(' .and optional_space;\n" -"percent\n" -" optional_space .and '%' .and optional_space;\n" -"plus\n" -" optional_space .and '+' .and optional_space;\n" -"rparen\n" -" optional_space .and ')' .and optional_space;\n" -"slash\n" -" optional_space .and '/' .and optional_space;\n" -"star\n" -" optional_space .and '*' .and optional_space;\n" -"tilda\n" -" optional_space .and '~' .and optional_space;\n" -"" diff --git a/src/mesa/shader/slang/library/slang_pp_version.syn b/src/mesa/shader/slang/library/slang_pp_version.syn deleted file mode 100644 index 3fe1a57ba2c..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_version.syn +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 2005-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file slang_pp_version.syn - * slang #version directive syntax - * \author Michal Krol - */ - -.syntax version_directive; - -version_directive - version_directive_1; -version_directive_1 - prior_optional_spaces .and optional_version_directive .and .true .emit $; - -optional_version_directive - version_directive_body .or .true .emit 10 .emit 1; - -version_directive_body - '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and - new_line; - -version_number - version_number_100 .or version_number_110 .or version_number_120; - -version_number_100 - leading_zeroes .and "100" .emit 0 .emit 1; - -version_number_110 - leading_zeroes .and "110" .emit 10 .emit 1; - -version_number_120 - leading_zeroes .and "120" .emit 20 .emit 1; - -leading_zeroes - .loop zero; - -zero - '0'; - -space - single_space .and .loop single_space; - -optional_space - .loop single_space; - -single_space - ' ' .or '\t'; - -prior_optional_spaces - .loop prior_space; - -prior_space - c_style_comment_block .or cpp_style_comment_block .or space .or new_line; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -.string __string_filter; - -__string_filter - .loop __identifier_char; - -__identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/src/mesa/shader/slang/library/slang_pp_version_syn.h b/src/mesa/shader/slang/library/slang_pp_version_syn.h deleted file mode 100644 index 54aee3ff282..00000000000 --- a/src/mesa/shader/slang/library/slang_pp_version_syn.h +++ /dev/null @@ -1,69 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax version_directive;\n" -"version_directive\n" -" version_directive_1;\n" -"version_directive_1\n" -" prior_optional_spaces .and optional_version_directive .and .true .emit $;\n" -"optional_version_directive\n" -" version_directive_body .or .true .emit 10 .emit 1;\n" -"version_directive_body\n" -" '#' .and optional_space .and \"version\" .and space .and version_number .and optional_space .and\n" -" new_line;\n" -"version_number\n" -" version_number_100 .or version_number_110 .or version_number_120;\n" -"version_number_100\n" -" leading_zeroes .and \"100\" .emit 0 .emit 1;\n" -"version_number_110\n" -" leading_zeroes .and \"110\" .emit 10 .emit 1;\n" -"version_number_120\n" -" leading_zeroes .and \"120\" .emit 20 .emit 1;\n" -"leading_zeroes\n" -" .loop zero;\n" -"zero\n" -" '0';\n" -"space\n" -" single_space .and .loop single_space;\n" -"optional_space\n" -" .loop single_space;\n" -"single_space\n" -" ' ' .or '\\t';\n" -"prior_optional_spaces\n" -" .loop prior_space;\n" -"prior_space\n" -" c_style_comment_block .or cpp_style_comment_block .or space .or new_line;\n" -"c_style_comment_block\n" -" '/' .and '*' .and c_style_comment_rest;\n" -"c_style_comment_rest\n" -" .loop c_style_comment_char_no_star .and c_style_comment_rest_1;\n" -"c_style_comment_rest_1\n" -" c_style_comment_end .or c_style_comment_rest_2;\n" -"c_style_comment_rest_2\n" -" '*' .and c_style_comment_rest;\n" -"c_style_comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"c_style_comment_end\n" -" '*' .and '/';\n" -"cpp_style_comment_block\n" -" '/' .and '/' .and cpp_style_comment_block_1;\n" -"cpp_style_comment_block_1\n" -" cpp_style_comment_block_2 .or cpp_style_comment_block_3;\n" -"cpp_style_comment_block_2\n" -" .loop cpp_style_comment_char .and new_line;\n" -"cpp_style_comment_block_3\n" -" .loop cpp_style_comment_char;\n" -"cpp_style_comment_char\n" -" '\\x0E'-'\\xFF' .or '\\x01'-'\\x09' .or '\\x0B'-'\\x0C';\n" -"new_line\n" -" cr_lf .or lf_cr .or '\\n' .or '\\r';\n" -"cr_lf\n" -" '\\r' .and '\\n';\n" -"lf_cr\n" -" '\\n' .and '\\r';\n" -".string __string_filter;\n" -"__string_filter\n" -" .loop __identifier_char;\n" -"__identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n" -"" diff --git a/src/mesa/shader/slang/library/slang_version.syn b/src/mesa/shader/slang/library/slang_version.syn deleted file mode 100644 index aaf8bef342f..00000000000 --- a/src/mesa/shader/slang/library/slang_version.syn +++ /dev/null @@ -1,118 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.3 - * - * Copyright (C) 2005 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file slang_version.syn - * slang #version directive syntax - * \author Michal Krol - */ - -.syntax version_directive; - -version_directive - version_directive_1 .and .loop version_directive_2; -version_directive_1 - prior_optional_spaces .and optional_version_directive .and .true .emit $; -version_directive_2 - prior_optional_spaces .and version_directive_body .and .true .emit $; - -optional_version_directive - version_directive_body .or .true .emit 10 .emit 1; - -version_directive_body - '#' .and optional_space .and "version" .and space .and version_number .and optional_space .and - new_line; - -version_number - version_number_110; - -version_number_110 - leading_zeroes .and "110" .emit 10 .emit 1; - -leading_zeroes - .loop zero; - -zero - '0'; - -space - single_space .and .loop single_space; - -optional_space - .loop single_space; - -single_space - ' ' .or '\t'; - -prior_optional_spaces - .loop prior_space; - -prior_space - c_style_comment_block .or cpp_style_comment_block .or space .or new_line; - -c_style_comment_block - '/' .and '*' .and c_style_comment_rest; - -c_style_comment_rest - .loop c_style_comment_char_no_star .and c_style_comment_rest_1; -c_style_comment_rest_1 - c_style_comment_end .or c_style_comment_rest_2; -c_style_comment_rest_2 - '*' .and c_style_comment_rest; - -c_style_comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -c_style_comment_end - '*' .and '/'; - -cpp_style_comment_block - '/' .and '/' .and cpp_style_comment_block_1; -cpp_style_comment_block_1 - cpp_style_comment_block_2 .or cpp_style_comment_block_3; -cpp_style_comment_block_2 - .loop cpp_style_comment_char .and new_line; -cpp_style_comment_block_3 - .loop cpp_style_comment_char; - -cpp_style_comment_char - '\x0E'-'\xFF' .or '\x01'-'\x09' .or '\x0B'-'\x0C'; - -new_line - cr_lf .or lf_cr .or '\n' .or '\r'; - -cr_lf - '\r' .and '\n'; - -lf_cr - '\n' .and '\r'; - -.string __string_filter; - -__string_filter - .loop __identifier_char; - -__identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index c1b97c7cb70..f988c58c8af 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -38,7 +38,6 @@ #include "shader/grammar/grammar_mesa.h" #include "slang_codegen.h" #include "slang_compile.h" -#include "slang_preprocess.h" #include "slang_storage.h" #include "slang_emit.h" #include "slang_log.h" @@ -2496,8 +2495,7 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, struct gl_sl_pragmas *pragmas) { byte *prod; - GLuint size, start, version; - slang_string preprocessed; + GLuint size, version; GLuint maxVersion; #if FEATURE_ARB_shading_language_120 @@ -2509,8 +2507,7 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, #endif /* First retrieve the version number. */ - if (!_slang_preprocess_version(source, &version, &start, infolog)) - return GL_FALSE; + version = 110; if (version > maxVersion) { slang_info_log_error(infolog, @@ -2519,23 +2516,13 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, return GL_FALSE; } - /* Now preprocess the source string. */ - slang_string_init(&preprocessed); - if (!_slang_preprocess_directives(&preprocessed, &source[start], - infolog, extensions, pragmas)) { - slang_string_free(&preprocessed); - slang_info_log_error(infolog, "failed to preprocess the source."); - return GL_FALSE; - } - /* Finally check the syntax and generate its binary representation. */ if (!grammar_fast_check(id, - (const byte *) (slang_string_cstr(&preprocessed)), + (const byte *)source, &prod, &size, 65536)) { char buf[1024]; GLint pos; - slang_string_free(&preprocessed); grammar_get_last_error((byte *) (buf), sizeof(buf), &pos); slang_info_log_error(infolog, buf); /* syntax error (possibly in library code) */ @@ -2551,7 +2538,6 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, #endif return GL_FALSE; } - slang_string_free(&preprocessed); /* Syntax is okay - translate it to internal representation. */ if (!compile_binary(prod, unit, version, type, infolog, builtin, diff --git a/src/mesa/shader/slang/slang_preprocess.c b/src/mesa/shader/slang/slang_preprocess.c deleted file mode 100644 index e9a24cc009a..00000000000 --- a/src/mesa/shader/slang/slang_preprocess.c +++ /dev/null @@ -1,1406 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file slang_preprocess.c - * slang preprocessor - * \author Michal Krol - */ - -#include "main/imports.h" -#include "shader/grammar/grammar_mesa.h" -#include "slang_preprocess.h" - -LONGSTRING static const char *slang_pp_directives_syn = -#include "library/slang_pp_directives_syn.h" -; - -LONGSTRING static const char *slang_pp_expression_syn = -#include "library/slang_pp_expression_syn.h" -; - -LONGSTRING static const char *slang_pp_version_syn = -#include "library/slang_pp_version_syn.h" -; - -static GLvoid -grammar_error_to_log (slang_info_log *log) -{ - char buf[1024]; - GLint pos; - - grammar_get_last_error ((byte *) (buf), sizeof (buf), &pos); - if (buf[0] == 0) { - _mesa_snprintf(buf, sizeof(buf), "Preprocessor error"); - } - slang_info_log_error (log, buf); -} - -GLboolean -_slang_preprocess_version (const char *text, GLuint *version, GLuint *eaten, slang_info_log *log) -{ - grammar id; - byte *prod, *I; - unsigned int size; - - id = grammar_load_from_text ((const byte *) (slang_pp_version_syn)); - if (id == 0) { - grammar_error_to_log (log); - return GL_FALSE; - } - - if (!grammar_fast_check (id, (const byte *) (text), &prod, &size, 8)) { - grammar_error_to_log (log); - grammar_destroy (id); - return GL_FALSE; - } - - /* there can be multiple #version directives - grab the last one */ - I = &prod[size - 6]; - *version = (GLuint) (I[0]) + (GLuint) (I[1]) * 100; - *eaten = (GLuint) (I[2]) + ((GLuint) (I[3]) << 8) + ((GLuint) (I[4]) << 16) + ((GLuint) (I[5]) << 24); - - grammar_destroy (id); - grammar_alloc_free (prod); - return GL_TRUE; -} - -/* - * The preprocessor does the following work. - * 1. Remove comments. Each comment block is replaced with a single space and if the - * block contains new-lines, they are preserved. This ensures that line numbers - * stay the same and if a comment block delimits two tokens, the are delitmited - * by the space after comment removal. - * 2. Remove preprocessor directives from the source string, checking their syntax and - * executing them if appropriate. Again, new-lines are preserved. - * 3. Expand macros. - * 4. Tokenize the source string by ensuring there is at least one space between every - * two adjacent tokens. - */ - -#define PP_ANNOTATE 0 - -static GLvoid -pp_annotate (slang_string *output, const char *fmt, ...) -{ -#if PP_ANNOTATE - va_list va; - char buffer[1024]; - - va_start (va, fmt); - _mesa_vsprintf (buffer, fmt, va); - va_end (va); - slang_string_pushs (output, buffer, _mesa_strlen (buffer)); -#else - (GLvoid) (output); - (GLvoid) (fmt); -#endif -} - - /* - * The expression is executed on a fixed-sized stack. The PUSH macro makes a runtime - * check if the stack is not overflown by too complex expressions. In that situation the - * GLSL preprocessor should report internal compiler error. - * The BINARYDIV makes a runtime check if the divider is not 0. If it is, it reports - * compilation error. - */ - -#define EXECUTION_STACK_SIZE 1024 - -#define PUSH(x)\ - do {\ - if (sp == 0) {\ - slang_info_log_error (elog, "internal compiler error: preprocessor execution stack overflow.");\ - return GL_FALSE;\ - }\ - stack[--sp] = x;\ - } while (GL_FALSE) - -#define POP(x)\ - do {\ - assert (sp < EXECUTION_STACK_SIZE);\ - x = stack[sp++];\ - } while (GL_FALSE) - -#define BINARY(op)\ - do {\ - GLint a, b;\ - POP(b);\ - POP(a);\ - PUSH(a op b);\ - } while (GL_FALSE) - -#define BINARYDIV(op)\ - do {\ - GLint a, b;\ - POP(b);\ - POP(a);\ - if (b == 0) {\ - slang_info_log_error (elog, "division by zero in preprocessor expression.");\ - return GL_FALSE;\ - }\ - PUSH(a op b);\ - } while (GL_FALSE) - -#define UNARY(op)\ - do {\ - GLint a;\ - POP(a);\ - PUSH(op a);\ - } while (GL_FALSE) - -#define OP_END 0 -#define OP_PUSHINT 1 -#define OP_LOGICALOR 2 -#define OP_LOGICALAND 3 -#define OP_OR 4 -#define OP_XOR 5 -#define OP_AND 6 -#define OP_EQUAL 7 -#define OP_NOTEQUAL 8 -#define OP_LESSEQUAL 9 -#define OP_GREATEREQUAL 10 -#define OP_LESS 11 -#define OP_GREATER 12 -#define OP_LEFTSHIFT 13 -#define OP_RIGHTSHIFT 14 -#define OP_ADD 15 -#define OP_SUBTRACT 16 -#define OP_MULTIPLY 17 -#define OP_DIVIDE 18 -#define OP_MODULUS 19 -#define OP_PLUS 20 -#define OP_MINUS 21 -#define OP_NEGATE 22 -#define OP_COMPLEMENT 23 - -static GLboolean -execute_expression (slang_string *output, const byte *code, GLuint *pi, GLint *result, - slang_info_log *elog) -{ - GLuint i = *pi; - GLint stack[EXECUTION_STACK_SIZE]; - GLuint sp = EXECUTION_STACK_SIZE; - - while (code[i] != OP_END) { - switch (code[i++]) { - case OP_PUSHINT: - i++; - PUSH(_mesa_atoi ((const char *) (&code[i]))); - i += _mesa_strlen ((const char *) (&code[i])) + 1; - break; - case OP_LOGICALOR: - BINARY(||); - break; - case OP_LOGICALAND: - BINARY(&&); - break; - case OP_OR: - BINARY(|); - break; - case OP_XOR: - BINARY(^); - break; - case OP_AND: - BINARY(&); - break; - case OP_EQUAL: - BINARY(==); - break; - case OP_NOTEQUAL: - BINARY(!=); - break; - case OP_LESSEQUAL: - BINARY(<=); - break; - case OP_GREATEREQUAL: - BINARY(>=); - break; - case OP_LESS: - BINARY(<); - break; - case OP_GREATER: - BINARY(>); - break; - case OP_LEFTSHIFT: - BINARY(<<); - break; - case OP_RIGHTSHIFT: - BINARY(>>); - break; - case OP_ADD: - BINARY(+); - break; - case OP_SUBTRACT: - BINARY(-); - break; - case OP_MULTIPLY: - BINARY(*); - break; - case OP_DIVIDE: - BINARYDIV(/); - break; - case OP_MODULUS: - BINARYDIV(%); - break; - case OP_PLUS: - UNARY(+); - break; - case OP_MINUS: - UNARY(-); - break; - case OP_NEGATE: - UNARY(!); - break; - case OP_COMPLEMENT: - UNARY(~); - break; - default: - assert (0); - } - } - - /* Write-back the index skipping the OP_END. */ - *pi = i + 1; - - /* There should be exactly one value left on the stack. This is our result. */ - POP(*result); - pp_annotate (output, "%d ", *result); - assert (sp == EXECUTION_STACK_SIZE); - return GL_TRUE; -} - -/* - * Function execute_expressions() executes up to 2 expressions. The second expression is there - * for the #line directive which takes 1 or 2 expressions that indicate line and file numbers. - * If it fails, it returns 0. If it succeeds, it returns the number of executed expressions. - */ - -#define EXP_END 0 -#define EXP_EXPRESSION 1 - -static GLuint -execute_expressions (slang_string *output, grammar eid, const byte *expr, GLint results[2], - slang_info_log *elog) -{ - GLint success; - byte *code; - GLuint size, count = 0; - - success = grammar_fast_check (eid, expr, &code, &size, 64); - if (success) { - GLuint i = 0; - - while (code[i++] == EXP_EXPRESSION) { - assert (count < 2); - - if (!execute_expression (output, code, &i, &results[count], elog)) { - count = 0; - break; - } - count++; - } - grammar_alloc_free (code); - } - else { - slang_info_log_error (elog, "syntax error in preprocessor expression.");\ - } - return count; -} - -/* - * The pp_symbol structure is used to hold macro definitions and macro formal parameters. The - * pp_symbols strcture is a collection of pp_symbol. It is used both for storing macro formal - * parameters and all global macro definitions. Making this unification wastes some memory, - * becuse macro formal parameters don't need further lists of symbols. We lose 8 bytes per - * formal parameter here, but making this we can use the same code to substitute macro parameters - * as well as macros in the source string. - */ - -typedef struct -{ - struct pp_symbol_ *symbols; - GLuint count; -} pp_symbols; - -static GLvoid -pp_symbols_init (pp_symbols *self) -{ - self->symbols = NULL; - self->count = 0; -} - -static GLvoid -pp_symbols_free (pp_symbols *); - -typedef struct pp_symbol_ -{ - slang_string name; - slang_string replacement; - pp_symbols parameters; -} pp_symbol; - -static GLvoid -pp_symbol_init (pp_symbol *self) -{ - slang_string_init (&self->name); - slang_string_init (&self->replacement); - pp_symbols_init (&self->parameters); -} - -static GLvoid -pp_symbol_free (pp_symbol *self) -{ - slang_string_free (&self->name); - slang_string_free (&self->replacement); - pp_symbols_free (&self->parameters); -} - -static GLvoid -pp_symbol_reset (pp_symbol *self) -{ - /* Leave symbol name intact. */ - slang_string_reset (&self->replacement); - pp_symbols_free (&self->parameters); - pp_symbols_init (&self->parameters); -} - -static GLvoid -pp_symbols_free (pp_symbols *self) -{ - GLuint i; - - for (i = 0; i < self->count; i++) - pp_symbol_free (&self->symbols[i]); - _mesa_free (self->symbols); -} - -static pp_symbol * -pp_symbols_push (pp_symbols *self) -{ - self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, self->count * sizeof (pp_symbol), - (self->count + 1) * sizeof (pp_symbol))); - if (self->symbols == NULL) - return NULL; - pp_symbol_init (&self->symbols[self->count]); - return &self->symbols[self->count++]; -} - -static GLboolean -pp_symbols_erase (pp_symbols *self, pp_symbol *symbol) -{ - assert (symbol >= self->symbols && symbol < self->symbols + self->count); - - self->count--; - pp_symbol_free (symbol); - if (symbol < self->symbols + self->count) - _mesa_memcpy (symbol, symbol + 1, sizeof (pp_symbol) * (self->symbols + self->count - symbol)); - self->symbols = (pp_symbol *) (_mesa_realloc (self->symbols, (self->count + 1) * sizeof (pp_symbol), - self->count * sizeof (pp_symbol))); - return self->symbols != NULL; -} - -static pp_symbol * -pp_symbols_find (pp_symbols *self, const char *name) -{ - GLuint i; - - for (i = 0; i < self->count; i++) - if (_mesa_strcmp (name, slang_string_cstr (&self->symbols[i].name)) == 0) - return &self->symbols[i]; - return NULL; -} - -/* - * The condition context of a single #if/#else/#endif level. Those can be nested, so there - * is a stack of condition contexts. - * There is a special global context on the bottom of the stack. It is there to simplify - * context handling. - */ - -typedef struct -{ - GLboolean current; /* The condition value of this level. */ - GLboolean effective; /* The effective product of current condition, outer level conditions - * and position within #if-#else-#endif sections. */ - GLboolean else_allowed; /* TRUE if in #if-#else section, FALSE if in #else-#endif section - * and for global context. */ - GLboolean endif_required; /* FALSE for global context only. */ -} pp_cond_ctx; - -/* Should be enuff. */ -#define CONDITION_STACK_SIZE 64 - -typedef struct -{ - pp_cond_ctx stack[CONDITION_STACK_SIZE]; - pp_cond_ctx *top; -} pp_cond_stack; - -static GLboolean -pp_cond_stack_push (pp_cond_stack *self, slang_info_log *elog) -{ - if (self->top == self->stack) { - slang_info_log_error (elog, "internal compiler error: preprocessor condition stack overflow."); - return GL_FALSE; - } - self->top--; - return GL_TRUE; -} - -static GLvoid -pp_cond_stack_reevaluate (pp_cond_stack *self) -{ - /* There must be at least 2 conditions on the stack - one global and one being evaluated. */ - assert (self->top <= &self->stack[CONDITION_STACK_SIZE - 2]); - - self->top->effective = self->top->current && self->top[1].effective; -} - - -/** - * Extension enables through #extension directive. - * NOTE: Currently, only enable/disable state is stored. - */ -typedef struct -{ - GLboolean ARB_draw_buffers; - GLboolean ARB_texture_rectangle; -} pp_ext; - - -/** - * Disable all extensions. Called at startup and on #extension all: disable. - */ -static GLvoid -pp_ext_disable_all(pp_ext *self) -{ - _mesa_memset(self, 0, sizeof(self)); -} - - -/** - * Called during preprocessor initialization to set the initial enable/disable - * state of extensions. - */ -static GLvoid -pp_ext_init(pp_ext *self, const struct gl_extensions *extensions) -{ - pp_ext_disable_all (self); - self->ARB_draw_buffers = GL_TRUE; - if (extensions->NV_texture_rectangle) - self->ARB_texture_rectangle = GL_TRUE; -} - -/** - * Called in response to #extension directives to enable/disable - * the named extension. - */ -static GLboolean -pp_ext_set(pp_ext *self, const char *name, GLboolean enable) -{ - if (_mesa_strcmp (name, "GL_ARB_draw_buffers") == 0) - self->ARB_draw_buffers = enable; - else if (_mesa_strcmp (name, "GL_ARB_texture_rectangle") == 0) - self->ARB_texture_rectangle = enable; - else - return GL_FALSE; - return GL_TRUE; -} - - -/** - * Called in response to #pragma. For example, "#pragma debug(on)" would - * call this function as pp_pragma("debug", "on"). - * \return GL_TRUE if pragma is valid, GL_FALSE if invalid - */ -static GLboolean -pp_pragma(struct gl_sl_pragmas *pragmas, const char *pragma, const char *param) -{ -#if 0 - printf("#pragma %s %s\n", pragma, param); -#endif - if (_mesa_strcmp(pragma, "optimize") == 0) { - if (!param) - return GL_FALSE; /* missing required param */ - if (_mesa_strcmp(param, "on") == 0) { - if (!pragmas->IgnoreOptimize) - pragmas->Optimize = GL_TRUE; - } - else if (_mesa_strcmp(param, "off") == 0) { - if (!pragmas->IgnoreOptimize) - pragmas->Optimize = GL_FALSE; - } - else { - return GL_FALSE; /* invalid param */ - } - } - else if (_mesa_strcmp(pragma, "debug") == 0) { - if (!param) - return GL_FALSE; /* missing required param */ - if (_mesa_strcmp(param, "on") == 0) { - if (!pragmas->IgnoreDebug) - pragmas->Debug = GL_TRUE; - } - else if (_mesa_strcmp(param, "off") == 0) { - if (!pragmas->IgnoreDebug) - pragmas->Debug = GL_FALSE; - } - else { - return GL_FALSE; /* invalid param */ - } - } - /* all other pragmas are silently ignored */ - return GL_TRUE; -} - - -/** - * The state of preprocessor: current line, file and version number, list - * of all defined macros and the #if/#endif context. - */ -typedef struct -{ - GLint line; - GLint file; - GLint version; - pp_symbols symbols; - pp_ext ext; - slang_info_log *elog; - pp_cond_stack cond; -} pp_state; - -static GLvoid -pp_state_init (pp_state *self, slang_info_log *elog, - const struct gl_extensions *extensions) -{ - self->line = 0; - self->file = 1; -#if FEATURE_es2_glsl - self->version = 100; -#else - self->version = 110; -#endif - pp_symbols_init (&self->symbols); - pp_ext_init (&self->ext, extensions); - self->elog = elog; - - /* Initialize condition stack and create the global context. */ - self->cond.top = &self->cond.stack[CONDITION_STACK_SIZE - 1]; - self->cond.top->current = GL_TRUE; - self->cond.top->effective = GL_TRUE; - self->cond.top->else_allowed = GL_FALSE; - self->cond.top->endif_required = GL_FALSE; -} - -static GLvoid -pp_state_free (pp_state *self) -{ - pp_symbols_free (&self->symbols); -} - -#define IS_FIRST_ID_CHAR(x) (((x) >= 'a' && (x) <= 'z') || ((x) >= 'A' && (x) <= 'Z') || (x) == '_') -#define IS_NEXT_ID_CHAR(x) (IS_FIRST_ID_CHAR(x) || ((x) >= '0' && (x) <= '9')) -#define IS_WHITE(x) ((x) == ' ' || (x) == '\n') -#define IS_NULL(x) ((x) == '\0') - -#define SKIP_WHITE(x) do { while (IS_WHITE(*(x))) (x)++; } while (GL_FALSE) - -typedef struct -{ - slang_string *output; - const char *input; - pp_state *state; -} expand_state; - -static GLboolean -expand_defined (expand_state *e, slang_string *buffer) -{ - GLboolean in_paren = GL_FALSE; - const char *id; - - /* Parse the optional opening parenthesis. */ - SKIP_WHITE(e->input); - if (*e->input == '(') { - e->input++; - in_paren = GL_TRUE; - SKIP_WHITE(e->input); - } - - /* Parse operand. */ - if (!IS_FIRST_ID_CHAR(*e->input)) { - slang_info_log_error (e->state->elog, - "preprocess error: identifier expected after operator 'defined'."); - return GL_FALSE; - } - slang_string_reset (buffer); - slang_string_pushc (buffer, *e->input++); - while (IS_NEXT_ID_CHAR(*e->input)) - slang_string_pushc (buffer, *e->input++); - id = slang_string_cstr (buffer); - - /* Check if the operand is defined. Output 1 if it is defined, output 0 if not. */ - if (pp_symbols_find (&e->state->symbols, id) == NULL) - slang_string_pushs (e->output, " 0 ", 3); - else - slang_string_pushs (e->output, " 1 ", 3); - - /* Parse the closing parentehesis if the opening one was there. */ - if (in_paren) { - SKIP_WHITE(e->input); - if (*e->input != ')') { - slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - return GL_TRUE; -} - -static GLboolean -expand (expand_state *, pp_symbols *); - -static GLboolean -expand_symbol (expand_state *e, pp_symbol *symbol) -{ - expand_state es; - - /* If the macro has some parameters, we need to parse them. */ - if (symbol->parameters.count != 0) { - GLuint i; - - /* Parse the opening parenthesis. */ - SKIP_WHITE(e->input); - if (*e->input != '(') { - slang_info_log_error (e->state->elog, "preprocess error: '(' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - - /* Parse macro actual parameters. This can be anything, separated by a colon. - */ - for (i = 0; i < symbol->parameters.count; i++) { - GLuint nested_paren_count = 0; /* track number of nested parentheses */ - - if (*e->input == ')') { - slang_info_log_error (e->state->elog, "preprocess error: unexpected ')'."); - return GL_FALSE; - } - - /* Eat all characters up to the comma or closing parentheses. */ - pp_symbol_reset (&symbol->parameters.symbols[i]); - while (!IS_NULL(*e->input)) { - /* Exit loop only when all nested parens have been eaten. */ - if (nested_paren_count == 0 && (*e->input == ',' || *e->input == ')')) - break; - - /* Actually count nested parens here. */ - if (*e->input == '(') - nested_paren_count++; - else if (*e->input == ')') - nested_paren_count--; - - slang_string_pushc (&symbol->parameters.symbols[i].replacement, *e->input++); - } - - /* If it was not the last paremeter, skip the comma. Otherwise, skip the - * closing parentheses. */ - if (i + 1 == symbol->parameters.count) { - /* This is the last paremeter - skip the closing parentheses. */ - if (*e->input != ')') { - slang_info_log_error (e->state->elog, "preprocess error: ')' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - else { - /* Skip the separating comma. */ - if (*e->input != ',') { - slang_info_log_error (e->state->elog, "preprocess error: ',' expected."); - return GL_FALSE; - } - e->input++; - SKIP_WHITE(e->input); - } - } - } - - /* Expand the macro. Use its parameters as a priority symbol list to expand - * macro parameters correctly. */ - es.output = e->output; - es.input = slang_string_cstr (&symbol->replacement); - es.state = e->state; - slang_string_pushc (e->output, ' '); - if (!expand (&es, &symbol->parameters)) - return GL_FALSE; - slang_string_pushc (e->output, ' '); - return GL_TRUE; -} - -/* - * Function expand() expands source text from to . The expansion is made using - * the list passed in parameter. It allows us to expand macro formal parameters with - * actual parameters. The global list of symbols from pp state is used when doing a recursive - * call of expand(). - */ - -static GLboolean -expand (expand_state *e, pp_symbols *symbols) -{ - while (!IS_NULL(*e->input)) { - if (IS_FIRST_ID_CHAR(*e->input)) { - slang_string buffer; - const char *id; - - /* Parse the identifier. */ - slang_string_init (&buffer); - slang_string_pushc (&buffer, *e->input++); - while (IS_NEXT_ID_CHAR(*e->input)) - slang_string_pushc (&buffer, *e->input++); - id = slang_string_cstr (&buffer); - - /* Now check if the identifier is special in some way. The "defined" identifier is - * actually an operator that we must handle here and expand it either to " 0 " or " 1 ". - * The other identifiers start with "__" and we expand it to appropriate values - * taken from the preprocessor state. */ - if (_mesa_strcmp (id, "defined") == 0) { - if (!expand_defined (e, &buffer)) - return GL_FALSE; - } - else if (_mesa_strcmp (id, "__LINE__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->line); - slang_string_pushc (e->output, ' '); - } - else if (_mesa_strcmp (id, "__FILE__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->file); - slang_string_pushc (e->output, ' '); - } - else if (_mesa_strcmp (id, "__VERSION__") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, e->state->version); - slang_string_pushc (e->output, ' '); - } -#if FEATURE_es2_glsl - else if (_mesa_strcmp (id, "GL_ES") == 0 || - _mesa_strcmp (id, "GL_FRAGMENT_PRECISION_HIGH") == 0) { - slang_string_pushc (e->output, ' '); - slang_string_pushi (e->output, '1'); - slang_string_pushc (e->output, ' '); - } -#endif - else { - pp_symbol *symbol; - - /* The list of symbols from take precedence over the list from . - * Note that in some cases this is the same list so avoid double look-up. */ - symbol = pp_symbols_find (symbols, id); - if (symbol == NULL && symbols != &e->state->symbols) - symbol = pp_symbols_find (&e->state->symbols, id); - - /* If the symbol was found, recursively expand its definition. */ - if (symbol != NULL) { - if (!expand_symbol (e, symbol)) { - slang_string_free (&buffer); - return GL_FALSE; - } - } - else { - slang_string_push (e->output, &buffer); - } - } - slang_string_free (&buffer); - } - else if (IS_WHITE(*e->input)) { - slang_string_pushc (e->output, *e->input++); - } - else { - while (!IS_WHITE(*e->input) && !IS_NULL(*e->input) && !IS_FIRST_ID_CHAR(*e->input)) - slang_string_pushc (e->output, *e->input++); - } - } - return GL_TRUE; -} - -static GLboolean -parse_if (slang_string *output, const byte *prod, GLuint *pi, GLint *result, pp_state *state, - grammar eid) -{ - const char *text; - GLuint len; - - text = (const char *) (&prod[*pi]); - len = _mesa_strlen (text); - - if (state->cond.top->effective) { - slang_string expr; - GLuint count; - GLint results[2]; - expand_state es; - - /* Expand the expression. */ - slang_string_init (&expr); - es.output = &expr; - es.input = text; - es.state = state; - if (!expand (&es, &state->symbols)) - return GL_FALSE; - - /* Execute the expression. */ - count = execute_expressions (output, eid, (const byte *) (slang_string_cstr (&expr)), - results, state->elog); - slang_string_free (&expr); - if (count != 1) - return GL_FALSE; - *result = results[0]; - } - else { - /* The directive is dead. */ - *result = 0; - } - - *pi += len + 1; - return GL_TRUE; -} - -#define ESCAPE_TOKEN 0 - -#define TOKEN_END 0 -#define TOKEN_DEFINE 1 -#define TOKEN_UNDEF 2 -#define TOKEN_IF 3 -#define TOKEN_ELSE 4 -#define TOKEN_ELIF 5 -#define TOKEN_ENDIF 6 -#define TOKEN_ERROR 7 -#define TOKEN_PRAGMA 8 -#define TOKEN_EXTENSION 9 -#define TOKEN_LINE 10 - -#define PARAM_END 0 -#define PARAM_PARAMETER 1 - -#define BEHAVIOR_REQUIRE 1 -#define BEHAVIOR_ENABLE 2 -#define BEHAVIOR_WARN 3 -#define BEHAVIOR_DISABLE 4 - -#define PRAGMA_NO_PARAM 0 -#define PRAGMA_PARAM 1 - - -static GLboolean -preprocess_source (slang_string *output, const char *source, - grammar pid, grammar eid, - slang_info_log *elog, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - static const char *predefined[] = { - "__FILE__", - "__LINE__", - "__VERSION__", -#if FEATURE_es2_glsl - "GL_ES", - "GL_FRAGMENT_PRECISION_HIGH", -#endif - NULL - }; - byte *prod; - GLuint size, i; - pp_state state; - - if (!grammar_fast_check (pid, (const byte *) (source), &prod, &size, 65536)) { - grammar_error_to_log (elog); - return GL_FALSE; - } - - pp_state_init (&state, elog, extensions); - - /* add the predefined symbols to the symbol table */ - for (i = 0; predefined[i]; i++) { - pp_symbol *symbol = NULL; - symbol = pp_symbols_push(&state.symbols); - assert(symbol); - slang_string_pushs(&symbol->name, - predefined[i], _mesa_strlen(predefined[i])); - } - - i = 0; - while (i < size) { - if (prod[i] != ESCAPE_TOKEN) { - if (state.cond.top->effective) { - slang_string input; - expand_state es; - - /* Eat only one line of source code to expand it. - * FIXME: This approach has one drawback. If a macro with parameters spans across - * multiple lines, the preprocessor will raise an error. */ - slang_string_init (&input); - while (prod[i] != '\0' && prod[i] != '\n') - slang_string_pushc (&input, prod[i++]); - if (prod[i] != '\0') - slang_string_pushc (&input, prod[i++]); - - /* Increment line number. */ - state.line++; - - es.output = output; - es.input = slang_string_cstr (&input); - es.state = &state; - if (!expand (&es, &state.symbols)) - goto error; - - slang_string_free (&input); - } - else { - /* Condition stack is disabled - keep track on line numbers and output only newlines. */ - if (prod[i] == '\n') { - state.line++; - /*pp_annotate (output, "%c", prod[i]);*/ - } - else { - /*pp_annotate (output, "%c", prod[i]);*/ - } - i++; - } - } - else { - const char *id; - GLuint idlen; - GLubyte token; - - i++; - token = prod[i++]; - switch (token) { - - case TOKEN_END: - /* End of source string. - * Check if all #ifs have been terminated by matching #endifs. - * On condition stack there should be only the global condition context. */ - if (state.cond.top->endif_required) { - slang_info_log_error (elog, "end of source without matching #endif."); - return GL_FALSE; - } - break; - - case TOKEN_DEFINE: - { - pp_symbol *symbol = NULL; - - /* Parse macro name. */ - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - pp_annotate (output, "// #define %s(", id); - - /* If the symbol is already defined, override it. */ - symbol = pp_symbols_find (&state.symbols, id); - if (symbol == NULL) { - symbol = pp_symbols_push (&state.symbols); - if (symbol == NULL) - goto error; - slang_string_pushs (&symbol->name, id, idlen); - } - else { - pp_symbol_reset (symbol); - } - } - i += idlen + 1; - - /* Parse optional macro parameters. */ - while (prod[i++] != PARAM_END) { - pp_symbol *param; - - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - pp_annotate (output, "%s, ", id); - param = pp_symbols_push (&symbol->parameters); - if (param == NULL) - goto error; - slang_string_pushs (¶m->name, id, idlen); - } - i += idlen + 1; - } - - /* Parse macro replacement. */ - id = (const char *) (&prod[i]); - idlen = _mesa_strlen (id); - if (state.cond.top->effective) { - slang_string replacement; - expand_state es; - - pp_annotate (output, ") %s", id); - - slang_string_init(&replacement); - slang_string_pushs(&replacement, id, idlen); - - /* Expand macro replacement. */ - es.output = &symbol->replacement; - es.input = slang_string_cstr(&replacement); - es.state = &state; - if (!expand(&es, &state.symbols)) { - slang_string_free(&replacement); - goto error; - } - slang_string_free(&replacement); - } - i += idlen + 1; - } - break; - - case TOKEN_UNDEF: - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - if (state.cond.top->effective) { - pp_symbol *symbol; - - pp_annotate (output, "// #undef %s", id); - /* Try to find symbol with given name and remove it. */ - symbol = pp_symbols_find (&state.symbols, id); - if (symbol != NULL) - if (!pp_symbols_erase (&state.symbols, symbol)) - goto error; - } - break; - - case TOKEN_IF: - { - GLint result; - - /* Parse #if expression end execute it. */ - pp_annotate (output, "// #if "); - if (!parse_if (output, prod, &i, &result, &state, eid)) - goto error; - - /* Push new condition on the stack. */ - if (!pp_cond_stack_push (&state.cond, state.elog)) - goto error; - state.cond.top->current = result ? GL_TRUE : GL_FALSE; - state.cond.top->else_allowed = GL_TRUE; - state.cond.top->endif_required = GL_TRUE; - pp_cond_stack_reevaluate (&state.cond); - } - break; - - case TOKEN_ELSE: - /* Check if #else is alloved here. */ - if (!state.cond.top->else_allowed) { - slang_info_log_error (elog, "#else without matching #if."); - goto error; - } - - /* Negate current condition and reevaluate it. */ - state.cond.top->current = !state.cond.top->current; - state.cond.top->else_allowed = GL_FALSE; - pp_cond_stack_reevaluate (&state.cond); - if (state.cond.top->effective) - pp_annotate (output, "// #else"); - break; - - case TOKEN_ELIF: - /* Check if #elif is alloved here. */ - if (!state.cond.top->else_allowed) { - slang_info_log_error (elog, "#elif without matching #if."); - goto error; - } - - /* Negate current condition and reevaluate it. */ - state.cond.top->current = !state.cond.top->current; - pp_cond_stack_reevaluate (&state.cond); - - if (state.cond.top->effective) - pp_annotate (output, "// #elif "); - - { - GLint result; - - /* Parse #elif expression end execute it. */ - if (!parse_if (output, prod, &i, &result, &state, eid)) - goto error; - - /* Update current condition and reevaluate it. */ - state.cond.top->current = result ? GL_TRUE : GL_FALSE; - pp_cond_stack_reevaluate (&state.cond); - } - break; - - case TOKEN_ENDIF: - /* Check if #endif is alloved here. */ - if (!state.cond.top->endif_required) { - slang_info_log_error (elog, "#endif without matching #if."); - goto error; - } - - /* Pop the condition off the stack. */ - state.cond.top++; - if (state.cond.top->effective) - pp_annotate (output, "// #endif"); - break; - - case TOKEN_EXTENSION: - /* Parse the extension name. */ - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - if (state.cond.top->effective) - pp_annotate (output, "// #extension %s: ", id); - - /* Parse and apply extension behavior. */ - if (state.cond.top->effective) { - switch (prod[i++]) { - - case BEHAVIOR_REQUIRE: - pp_annotate (output, "require"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") == 0) { - slang_info_log_error (elog, "require: bad behavior for #extension all."); - goto error; - } - else { - slang_info_log_error (elog, "%s: required extension is not supported.", id); - goto error; - } - } - break; - - case BEHAVIOR_ENABLE: - pp_annotate (output, "enable"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") == 0) { - slang_info_log_error (elog, "enable: bad behavior for #extension all."); - goto error; - } - else { - slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); - } - } - break; - - case BEHAVIOR_WARN: - pp_annotate (output, "warn"); - if (!pp_ext_set (&state.ext, id, GL_TRUE)) { - if (_mesa_strcmp (id, "all") != 0) { - slang_info_log_warning (elog, "%s: enabled extension is not supported.", id); - } - } - break; - - case BEHAVIOR_DISABLE: - pp_annotate (output, "disable"); - if (!pp_ext_set (&state.ext, id, GL_FALSE)) { - if (_mesa_strcmp (id, "all") == 0) { - pp_ext_disable_all (&state.ext); - } - else { - slang_info_log_warning (elog, "%s: disabled extension is not supported.", id); - } - } - break; - - default: - assert (0); - } - } - break; - - case TOKEN_PRAGMA: - { - GLint have_param; - const char *pragma, *param; - - pragma = (const char *) (&prod[i]); - i += _mesa_strlen(pragma) + 1; - have_param = (prod[i++] == PRAGMA_PARAM); - if (have_param) { - param = (const char *) (&prod[i]); - i += _mesa_strlen(param) + 1; - } - else { - param = NULL; - } - pp_pragma(pragmas, pragma, param); - } - break; - - case TOKEN_LINE: - id = (const char *) (&prod[i]); - i += _mesa_strlen (id) + 1; - - if (state.cond.top->effective) { - slang_string buffer; - GLuint count; - GLint results[2]; - expand_state es; - - slang_string_init (&buffer); - state.line++; - es.output = &buffer; - es.input = id; - es.state = &state; - if (!expand (&es, &state.symbols)) - goto error; - - pp_annotate (output, "// #line "); - count = execute_expressions (output, eid, - (const byte *) (slang_string_cstr (&buffer)), - results, state.elog); - slang_string_free (&buffer); - if (count == 0) - goto error; - - state.line = results[0] - 1; - if (count == 2) - state.file = results[1]; - } - break; - } - } - } - - /* Check for missing #endifs. */ - if (state.cond.top->endif_required) { - slang_info_log_error (elog, "#endif expected but end of source found."); - goto error; - } - - grammar_alloc_free(prod); - pp_state_free (&state); - return GL_TRUE; - -error: - grammar_alloc_free(prod); - pp_state_free (&state); - return GL_FALSE; -} - - -/** - * Remove the continuation characters from the input string. - * This is the very first step in preprocessing and is effective - * even inside comment blocks. - * If there is a whitespace between a backslash and a newline, - * this is not considered as a line continuation. - * \return GL_TRUE for success, GL_FALSE otherwise. - */ -static GLboolean -_slang_preprocess_backslashes(slang_string *output, - const char *input) -{ - while (*input) { - if (input[0] == '\\') { - /* If a newline follows, eat the backslash and the newline. */ - if (input[1] == '\r') { - if (input[2] == '\n') { - input += 3; - } else { - input += 2; - } - } else if (input[1] == '\n') { - if (input[2] == '\r') { - input += 3; - } else { - input += 2; - } - } else { - /* Leave the backslash alone. */ - slang_string_pushc(output, *input++); - } - } else { - slang_string_pushc(output, *input++); - } - } - return GL_TRUE; -} - - -/** - * Run preprocessor on source code. - * \param extensions indicates which GL extensions are enabled - * \param output the post-process results - * \param input the input text - * \param elog log to record warnings, errors - * \param extensions out extension settings - * \param pragmas in/out #pragma settings - * \return GL_TRUE for success, GL_FALSE for error - */ -GLboolean -_slang_preprocess_directives(slang_string *output, - const char *input, - slang_info_log *elog, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) -{ - grammar pid, eid; - GLboolean success; - slang_string without_backslashes; - - pid = grammar_load_from_text ((const byte *) (slang_pp_directives_syn)); - if (pid == 0) { - grammar_error_to_log (elog); - return GL_FALSE; - } - eid = grammar_load_from_text ((const byte *) (slang_pp_expression_syn)); - if (eid == 0) { - grammar_error_to_log (elog); - grammar_destroy (pid); - return GL_FALSE; - } - - slang_string_init(&without_backslashes); - success = _slang_preprocess_backslashes(&without_backslashes, input); - - if (0) { - _mesa_printf("Pre-processed shader:\n"); - _mesa_printf("%s", slang_string_cstr(&without_backslashes)); - _mesa_printf("----------------------\n"); - } - - if (success) { - success = preprocess_source(output, - slang_string_cstr(&without_backslashes), - pid, - eid, - elog, - extensions, - pragmas); - } - - slang_string_free(&without_backslashes); - grammar_destroy (eid); - grammar_destroy (pid); - - if (0) { - _mesa_printf("Post-processed shader:\n"); - _mesa_printf("%s", slang_string_cstr(output)); - _mesa_printf("----------------------\n"); - } - - return success; -} - diff --git a/src/mesa/shader/slang/slang_preprocess.h b/src/mesa/shader/slang/slang_preprocess.h deleted file mode 100644 index f344820daef..00000000000 --- a/src/mesa/shader/slang/slang_preprocess.h +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2005-2008 Brian Paul All Rights Reserved. - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef SLANG_PREPROCESS_H -#define SLANG_PREPROCESS_H - -#include "slang_compile.h" -#include "slang_log.h" - - -extern GLboolean -_slang_preprocess_version (const char *, GLuint *, GLuint *, slang_info_log *); - -extern GLboolean -_slang_preprocess_directives(slang_string *output, const char *input, - slang_info_log *, - const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas); - -#endif /* SLANG_PREPROCESS_H */ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index fa2a6307a4b..0c78733ea78 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -255,7 +255,6 @@ SLANG_SOURCES = \ shader/slang/slang_link.c \ shader/slang/slang_log.c \ shader/slang/slang_mem.c \ - shader/slang/slang_preprocess.c \ shader/slang/slang_print.c \ shader/slang/slang_simplify.c \ shader/slang/slang_storage.c \ -- cgit v1.2.3 From b837f6c372f0059170d93ac564f58aeebca3c70a Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 10:57:39 +0200 Subject: grammar: Fix token stripping. --- src/mesa/shader/grammar/grammar.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index fdbdcd40c09..36ed9d5603b 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -3226,11 +3226,15 @@ grammar_fast_check (grammar id, case SL_PP_IDENTIFIER: case SL_PP_NUMBER: *dst++ = *src++; + break; default: src++; } } + + /* The end of stream token. */ + *dst = *src; } } -- cgit v1.2.3 From 58fa89c90279e2bdfc7331d7b632a748e2126ca1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 12:46:34 +0200 Subject: slang: Correctly parse numbers from the new preprocessor. --- src/mesa/shader/slang/library/slang_shader.syn | 4 +- src/mesa/shader/slang/library/slang_shader_syn.h | 4 +- src/mesa/shader/slang/slang_compile.c | 153 ++++++++++++++++++----- 3 files changed, 123 insertions(+), 38 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index f35356bf4a0..af83543cbb8 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -1416,10 +1416,10 @@ identifier "@ID" .emit *; float - "@NUM" .emit *; + "@NUM" .emit 1 .emit *; integer - "@NUM" .emit *; + "@NUM" .emit 1 .emit *; boolean "true" .emit '1' .emit '\0' .or diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index ca62d41b7f4..98e6453a00b 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -685,9 +685,9 @@ "identifier\n" " \"@ID\" .emit *;\n" "float\n" -" \"@NUM\" .emit *;\n" +" \"@NUM\" .emit 1 .emit *;\n" "integer\n" -" \"@NUM\" .emit *;\n" +" \"@NUM\" .emit 1 .emit *;\n" "boolean\n" " \"true\" .emit '1' .emit '\\0' .or\n" " \"false\" .emit '0' .emit '\\0';\n" diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index f988c58c8af..75dd8a045bd 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -182,23 +182,103 @@ parse_identifier(slang_parse_ctx * C) return slang_atom_pool_atom(C->atoms, id); } +static int +is_hex_digit(char c) +{ + return (c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F'); +} + +static int +parse_general_number(slang_parse_ctx *ctx, float *number) +{ + char *flt = NULL; + + if (*ctx->I == '0') { + int value = 0; + const byte *pi; + + if (ctx->I[1] == 'x' || ctx->I[1] == 'X') { + ctx->I += 2; + if (!is_hex_digit(*ctx->I)) { + return 0; + } + do { + int digit; + + if (*ctx->I >= '0' && *ctx->I <= '9') { + digit = (int)(*ctx->I - '0'); + } else if (*ctx->I >= 'a' && *ctx->I <= 'f') { + digit = (int)(*ctx->I - 'a') + 10; + } else { + digit = (int)(*ctx->I - 'A') + 10; + } + value = value * 0x10 + digit; + ctx->I++; + } while (is_hex_digit(*ctx->I)); + if (*ctx->I != '\0') { + return 0; + } + ctx->I++; + *number = (float)value; + return 1; + } + + pi = ctx->I; + pi++; + while (*pi >= '0' && *pi <= '7') { + int digit; + + digit = (int)(*pi - '0'); + value = value * 010 + digit; + pi++; + } + if (*pi == '\0') { + pi++; + ctx->I = pi; + *number = (float)value; + return 1; + } + } + + parse_identifier_str(ctx, &flt); + flt = strdup(flt); + if (!flt) { + return 0; + } + if (flt[strlen(flt) - 1] == 'f' || flt[strlen(flt) - 1] == 'F') { + flt[strlen(flt) - 1] = '\0'; + } + *number = (float)_mesa_strtod(flt, (char **)NULL); + free(flt); + + return 1; +} + static int parse_number(slang_parse_ctx * C, int *number) { const int radix = (int) (*C->I++); - *number = 0; - while (*C->I != '\0') { - int digit; - if (*C->I >= '0' && *C->I <= '9') - digit = (int) (*C->I - '0'); - else if (*C->I >= 'A' && *C->I <= 'Z') - digit = (int) (*C->I - 'A') + 10; - else - digit = (int) (*C->I - 'a') + 10; - *number = *number * radix + digit; + + if (radix == 1) { + float f = 0.0f; + + parse_general_number(C, &f); + *number = (int)f; + } else { + *number = 0; + while (*C->I != '\0') { + int digit; + if (*C->I >= '0' && *C->I <= '9') + digit = (int) (*C->I - '0'); + else if (*C->I >= 'A' && *C->I <= 'Z') + digit = (int) (*C->I - 'A') + 10; + else + digit = (int) (*C->I - 'a') + 10; + *number = *number * radix + digit; + C->I++; + } C->I++; } - C->I++; if (*number > 65535) slang_info_log_warning(C->L, "%d: literal integer overflow.", *number); return 1; @@ -207,32 +287,37 @@ parse_number(slang_parse_ctx * C, int *number) static int parse_float(slang_parse_ctx * C, float *number) { - char *integral = NULL; - char *fractional = NULL; - char *exponent = NULL; - char *whole = NULL; - - parse_identifier_str(C, &integral); - parse_identifier_str(C, &fractional); - parse_identifier_str(C, &exponent); - - whole = (char *) _slang_alloc((_mesa_strlen(integral) + - _mesa_strlen(fractional) + - _mesa_strlen(exponent) + 3) * sizeof(char)); - if (whole == NULL) { - slang_info_log_memory(C->L); - RETURN0; - } + if (*C->I == 1) { + C->I++; + parse_general_number(C, number); + } else { + char *integral = NULL; + char *fractional = NULL; + char *exponent = NULL; + char *whole = NULL; + + parse_identifier_str(C, &integral); + parse_identifier_str(C, &fractional); + parse_identifier_str(C, &exponent); + + whole = (char *) _slang_alloc((_mesa_strlen(integral) + + _mesa_strlen(fractional) + + _mesa_strlen(exponent) + 3) * sizeof(char)); + if (whole == NULL) { + slang_info_log_memory(C->L); + RETURN0; + } - slang_string_copy(whole, integral); - slang_string_concat(whole, "."); - slang_string_concat(whole, fractional); - slang_string_concat(whole, "E"); - slang_string_concat(whole, exponent); + slang_string_copy(whole, integral); + slang_string_concat(whole, "."); + slang_string_concat(whole, fractional); + slang_string_concat(whole, "E"); + slang_string_concat(whole, exponent); - *number = (float) (_mesa_strtod(whole, (char **) NULL)); + *number = (float) (_mesa_strtod(whole, (char **) NULL)); - _slang_free(whole); + _slang_free(whole); + } return 1; } -- cgit v1.2.3 From 2ec2936454a4a69b5b3b438ab66f00a5b7d2a5e5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 13:29:17 +0200 Subject: slang: Do not parse whitespace. The preprocessor tokeniser deals with those. --- src/mesa/shader/slang/library/slang_shader.syn | 132 +++++++---------------- src/mesa/shader/slang/library/slang_shader_syn.h | 130 +++++++--------------- 2 files changed, 72 insertions(+), 190 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index af83543cbb8..4558ed58b07 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -692,11 +692,7 @@ function_header_with_parameters_1 * ::= "(" */ function_header - function_header_nospace .or function_header_space; -function_header_space - fully_specified_type_space .and space .and function_decl_identifier .and lparen; -function_header_nospace - fully_specified_type_nospace .and function_decl_identifier .and lparen; + fully_specified_type .and function_decl_identifier .and lparen; /* * ::= "__constructor" @@ -793,11 +789,7 @@ overriden_operator * | "[" "]" */ parameter_declarator - parameter_declarator_nospace .or parameter_declarator_space; -parameter_declarator_nospace - type_specifier_nospace .and identifier .and parameter_declarator_1; -parameter_declarator_space - type_specifier_space .and space .and identifier .and parameter_declarator_1; + type_specifier .and identifier .and parameter_declarator_1; parameter_declarator_1 parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or .true .emit PARAMETER_ARRAY_NOT_PRESENT; @@ -825,15 +817,13 @@ parameter_declaration parameter_declaration_1 parameter_declaration_2 .or parameter_declaration_3; parameter_declaration_2 - type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4; + type_qualifier .and parameter_qualifier .and parameter_declaration_4; parameter_declaration_3 parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4; parameter_declaration_4 parameter_declaration_optprec .and parameter_declaration_rest; parameter_declaration_optprec - parameter_declaration_prec .or .true .emit PRECISION_DEFAULT; -parameter_declaration_prec - precision .and space; + precision .or .true .emit PRECISION_DEFAULT; parameter_declaration_rest parameter_declarator .or parameter_type_specifier; @@ -846,8 +836,6 @@ parameter_declaration_rest parameter_qualifier parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN; parameter_qualifier_1 - parameter_qualifier_2 .and space; -parameter_qualifier_2 "in" .emit PARAM_QUALIFIER_IN .or "out" .emit PARAM_QUALIFIER_OUT .or "inout" .emit PARAM_QUALIFIER_INOUT; @@ -857,9 +845,7 @@ parameter_qualifier_2 * | "[" "]" */ parameter_type_specifier - parameter_type_specifier_1 .and .true .emit '\0' .and parameter_type_specifier_2; -parameter_type_specifier_1 - type_specifier_nospace .or type_specifier_space; + type_specifier .and .true .emit '\0' .and parameter_type_specifier_2; parameter_type_specifier_2 parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or .true .emit PARAMETER_ARRAY_NOT_PRESENT; @@ -895,18 +881,10 @@ init_declarator_list_5 * | "=" */ single_declaration - single_declaration_nospace .or single_declaration_space; -single_declaration_space - fully_specified_type_space .and single_declaration_space_1; -single_declaration_nospace - fully_specified_type_nospace .and single_declaration_nospace_1; -single_declaration_space_1 - single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; -single_declaration_nospace_1 - single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; -single_declaration_space_2 - space .and identifier .and single_declaration_3; -single_declaration_nospace_2 + fully_specified_type .and single_declaration_1; +single_declaration_1 + single_declaration_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; +single_declaration_2 identifier .and single_declaration_3; single_declaration_3 single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE; @@ -922,26 +900,16 @@ single_declaration_6 * * Example: "invariant varying highp vec3" */ -fully_specified_type_space - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space; -fully_specified_type_nospace - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace; +fully_specified_type + fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier; fully_specified_type_optinvariant - fully_specified_type_invariant .or .true .emit TYPE_VARIANT; -fully_specified_type_invariant - invariant_qualifier .and space; + invariant_qualifier .or .true .emit TYPE_VARIANT; fully_specified_type_optcentroid - fully_specified_type_centroid .or .true .emit TYPE_CENTER; -fully_specified_type_centroid - centroid_qualifier .and space; + centroid_qualifier .or .true .emit TYPE_CENTER; fully_specified_type_optqual - fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE; -fully_specified_type_qual - type_qualifier .and space; + type_qualifier .or .true .emit TYPE_QUALIFIER_NONE; fully_specified_type_optprec - fully_specified_type_prec .or .true .emit PRECISION_DEFAULT; -fully_specified_type_prec - precision .and space; + precision .or .true .emit PRECISION_DEFAULT; /* * ::= "invariant" @@ -1006,7 +974,8 @@ type_qualifier * | * | */ -type_specifier_nonarray_space +type_specifier_nonarray + struct_specifier .emit TYPE_SPECIFIER_STRUCT .or "void" .emit TYPE_SPECIFIER_VOID .or "float" .emit TYPE_SPECIFIER_FLOAT .or "int" .emit TYPE_SPECIFIER_INT .or @@ -1038,22 +1007,16 @@ type_specifier_nonarray_space "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or type_name .emit TYPE_SPECIFIER_TYPENAME; -type_specifier_nonarray_nospace - struct_specifier .emit TYPE_SPECIFIER_STRUCT; -type_specifier_nonarray - type_specifier_nonarray_nospace .or type_specifier_nonarray_space; /* * ::= * | "[" "]" */ -type_specifier_space - type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY; -type_specifier_nospace - type_specifier_nospace_array .or type_specifier_nospace_1; -type_specifier_nospace_1 - type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY; -type_specifier_nospace_array +type_specifier + type_specifier_array .or type_specifier_1; +type_specifier_1 + type_specifier_nonarray .and .true .emit TYPE_SPECIFIER_NONARRAY; +type_specifier_array type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket; /* @@ -1061,12 +1024,10 @@ type_specifier_nospace_array * | "struct" "{" "}" */ struct_specifier - "struct" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and + "struct" .and struct_specifier_1 .and lbrace .error LBRACE_EXPECTED .and struct_declaration_list .and rbrace .emit FIELD_NONE; struct_specifier_1 - struct_specifier_2 .or .true .emit '\0'; -struct_specifier_2 - space .and identifier; + identifier .or .true .emit '\0'; /* * ::= @@ -1079,11 +1040,7 @@ struct_declaration_list * ::= ";" */ struct_declaration - struct_declaration_nospace .or struct_declaration_space; -struct_declaration_space - type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE; -struct_declaration_nospace - type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE; + type_specifier .and struct_declarator_list .and semicolon .emit FIELD_NONE; /* * ::= @@ -1123,10 +1080,6 @@ declaration_statement */ statement compound_statement .or simple_statement; -statement_space - compound_statement .or statement_space_1; -statement_space_1 - space .and simple_statement; /* * ::= <__asm_statement> @@ -1209,7 +1162,7 @@ selection_rest_statement selection_rest_statement_1 selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END; selection_rest_statement_2 - "else" .and optional_space .and statement; + "else" .and statement; /* * ::= @@ -1220,17 +1173,11 @@ selection_rest_statement_2 */ condition condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or - condition_3 .emit OP_EXPRESSION; + condition_2 .emit OP_EXPRESSION; condition_1 - condition_1_nospace .or condition_1_space; -condition_1_nospace - fully_specified_type_nospace .and condition_2; -condition_1_space - fully_specified_type_space .and space .and condition_2; + fully_specified_type .and identifier .emit VARIABLE_IDENTIFIER .and + equals .emit VARIABLE_INITIALIZER .and initializer .and .true .emit DECLARATOR_NONE; condition_2 - identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and - initializer .and .true .emit DECLARATOR_NONE; -condition_3 expression .and .true .emit OP_END; /* @@ -1244,7 +1191,7 @@ iteration_statement_1 "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and rparen .error RPAREN_EXPECTED .and statement; iteration_statement_2 - "do" .emit OP_DO .and statement_space .and "while" .and lparen .error LPAREN_EXPECTED .and + "do" .emit OP_DO .and statement .and "while" .and lparen .error LPAREN_EXPECTED .and expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon; iteration_statement_3 "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and @@ -1295,7 +1242,7 @@ jump_statement_1 jump_statement_2 "break" .and semicolon .emit OP_BREAK; jump_statement_3 - "return" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END; + "return" .emit OP_RETURN .and expression .and semicolon .emit OP_END; jump_statement_4 "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END; jump_statement_5 @@ -1308,7 +1255,7 @@ jump_statement_5 * normally slang disallows __asm statements */ __asm_statement - "__asm" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END; + "__asm" .and identifier .and asm_arguments .and semicolon .emit OP_END; /* * ::= @@ -1343,9 +1290,8 @@ var_with_field * | */ translation_unit - optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and - .loop external_declaration .and optional_space .and - '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; + .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and + .loop external_declaration .and '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; /* @@ -1363,7 +1309,7 @@ external_declaration * ::= "precision" */ precision_stmt - "precision" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon; + "precision" .and precision .error INVALID_PRECISION .and prectype .error INVALID_PRECISION_TYPE .and semicolon; /* * ::= "lowp" @@ -1397,7 +1343,7 @@ prectype * ::= "invariant" identifier; */ invariant_stmt - "invariant" .and space .and identifier .and semicolon; + "invariant" .and identifier .and semicolon; /* @@ -1440,12 +1386,6 @@ intconstant boolconstant boolean .emit OP_PUSH_BOOL; -optional_space - .true; - -space - .true; - /* lexical rules */ /*ampersand diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index 98e6453a00b..e94238e0125 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -321,11 +321,7 @@ "function_header_with_parameters_1\n" " comma .and parameter_declaration;\n" "function_header\n" -" function_header_nospace .or function_header_space;\n" -"function_header_space\n" -" fully_specified_type_space .and space .and function_decl_identifier .and lparen;\n" -"function_header_nospace\n" -" fully_specified_type_nospace .and function_decl_identifier .and lparen;\n" +" fully_specified_type .and function_decl_identifier .and lparen;\n" "function_decl_identifier\n" " .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n" " .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n" @@ -362,11 +358,7 @@ " \n" " caretcaret .emit OPERATOR_LOGICALXOR ;\n" "parameter_declarator\n" -" parameter_declarator_nospace .or parameter_declarator_space;\n" -"parameter_declarator_nospace\n" -" type_specifier_nospace .and identifier .and parameter_declarator_1;\n" -"parameter_declarator_space\n" -" type_specifier_space .and space .and identifier .and parameter_declarator_1;\n" +" type_specifier .and identifier .and parameter_declarator_1;\n" "parameter_declarator_1\n" " parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n" " .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" @@ -377,29 +369,23 @@ "parameter_declaration_1\n" " parameter_declaration_2 .or parameter_declaration_3;\n" "parameter_declaration_2\n" -" type_qualifier .and space .and parameter_qualifier .and parameter_declaration_4;\n" +" type_qualifier .and parameter_qualifier .and parameter_declaration_4;\n" "parameter_declaration_3\n" " parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n" "parameter_declaration_4\n" " parameter_declaration_optprec .and parameter_declaration_rest;\n" "parameter_declaration_optprec\n" -" parameter_declaration_prec .or .true .emit PRECISION_DEFAULT;\n" -"parameter_declaration_prec\n" -" precision .and space;\n" +" precision .or .true .emit PRECISION_DEFAULT;\n" "parameter_declaration_rest\n" " parameter_declarator .or parameter_type_specifier;\n" "parameter_qualifier\n" " parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n" "parameter_qualifier_1\n" -" parameter_qualifier_2 .and space;\n" -"parameter_qualifier_2\n" " \"in\" .emit PARAM_QUALIFIER_IN .or\n" " \"out\" .emit PARAM_QUALIFIER_OUT .or\n" " \"inout\" .emit PARAM_QUALIFIER_INOUT;\n" "parameter_type_specifier\n" -" parameter_type_specifier_1 .and .true .emit '\\0' .and parameter_type_specifier_2;\n" -"parameter_type_specifier_1\n" -" type_specifier_nospace .or type_specifier_space;\n" +" type_specifier .and .true .emit '\\0' .and parameter_type_specifier_2;\n" "parameter_type_specifier_2\n" " parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n" " .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" @@ -419,18 +405,10 @@ "init_declarator_list_5\n" " constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" "single_declaration\n" -" single_declaration_nospace .or single_declaration_space;\n" -"single_declaration_space\n" -" fully_specified_type_space .and single_declaration_space_1;\n" -"single_declaration_nospace\n" -" fully_specified_type_nospace .and single_declaration_nospace_1;\n" -"single_declaration_space_1\n" -" single_declaration_space_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" -"single_declaration_nospace_1\n" -" single_declaration_nospace_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" -"single_declaration_space_2\n" -" space .and identifier .and single_declaration_3;\n" -"single_declaration_nospace_2\n" +" fully_specified_type .and single_declaration_1;\n" +"single_declaration_1\n" +" single_declaration_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" +"single_declaration_2\n" " identifier .and single_declaration_3;\n" "single_declaration_3\n" " single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n" @@ -440,26 +418,16 @@ " lbracket .and single_declaration_6 .and rbracket;\n" "single_declaration_6\n" " constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" -"fully_specified_type_space\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_space;\n" -"fully_specified_type_nospace\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier_nospace;\n" +"fully_specified_type\n" +" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier;\n" "fully_specified_type_optinvariant\n" -" fully_specified_type_invariant .or .true .emit TYPE_VARIANT;\n" -"fully_specified_type_invariant\n" -" invariant_qualifier .and space;\n" +" invariant_qualifier .or .true .emit TYPE_VARIANT;\n" "fully_specified_type_optcentroid\n" -" fully_specified_type_centroid .or .true .emit TYPE_CENTER;\n" -"fully_specified_type_centroid\n" -" centroid_qualifier .and space;\n" +" centroid_qualifier .or .true .emit TYPE_CENTER;\n" "fully_specified_type_optqual\n" -" fully_specified_type_qual .or .true .emit TYPE_QUALIFIER_NONE;\n" -"fully_specified_type_qual\n" -" type_qualifier .and space;\n" +" type_qualifier .or .true .emit TYPE_QUALIFIER_NONE;\n" "fully_specified_type_optprec\n" -" fully_specified_type_prec .or .true .emit PRECISION_DEFAULT;\n" -"fully_specified_type_prec\n" -" precision .and space;\n" +" precision .or .true .emit PRECISION_DEFAULT;\n" "invariant_qualifier\n" " \"invariant\" .emit TYPE_INVARIANT;\n" "centroid_qualifier\n" @@ -471,7 +439,8 @@ " \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n" " .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n" " .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n" -"type_specifier_nonarray_space\n" +"type_specifier_nonarray\n" +" struct_specifier .emit TYPE_SPECIFIER_STRUCT .or\n" " \"void\" .emit TYPE_SPECIFIER_VOID .or\n" " \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" " \"int\" .emit TYPE_SPECIFIER_INT .or\n" @@ -503,33 +472,21 @@ " \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" " \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or\n" " type_name .emit TYPE_SPECIFIER_TYPENAME;\n" -"type_specifier_nonarray_nospace\n" -" struct_specifier .emit TYPE_SPECIFIER_STRUCT;\n" -"type_specifier_nonarray\n" -" type_specifier_nonarray_nospace .or type_specifier_nonarray_space;\n" -"type_specifier_space\n" -" type_specifier_nonarray_space .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" -"type_specifier_nospace\n" -" type_specifier_nospace_array .or type_specifier_nospace_1;\n" -"type_specifier_nospace_1\n" -" type_specifier_nonarray_nospace .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" -"type_specifier_nospace_array\n" +"type_specifier\n" +" type_specifier_array .or type_specifier_1;\n" +"type_specifier_1\n" +" type_specifier_nonarray .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" +"type_specifier_array\n" " type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;\n" "struct_specifier\n" -" \"struct\" .and struct_specifier_1 .and optional_space .and lbrace .error LBRACE_EXPECTED .and\n" +" \"struct\" .and struct_specifier_1 .and lbrace .error LBRACE_EXPECTED .and\n" " struct_declaration_list .and rbrace .emit FIELD_NONE;\n" "struct_specifier_1\n" -" struct_specifier_2 .or .true .emit '\\0';\n" -"struct_specifier_2\n" -" space .and identifier;\n" +" identifier .or .true .emit '\\0';\n" "struct_declaration_list\n" " struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n" "struct_declaration\n" -" struct_declaration_nospace .or struct_declaration_space;\n" -"struct_declaration_space\n" -" type_specifier_space .and space .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" -"struct_declaration_nospace\n" -" type_specifier_nospace .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" +" type_specifier .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" "struct_declarator_list\n" " struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n" "struct_declarator_list_1\n" @@ -546,10 +503,6 @@ " declaration;\n" "statement\n" " compound_statement .or simple_statement;\n" -"statement_space\n" -" compound_statement .or statement_space_1;\n" -"statement_space_1\n" -" space .and simple_statement;\n" "simple_statement\n" " .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n" " selection_statement .or\n" @@ -590,20 +543,14 @@ "selection_rest_statement_1\n" " selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n" "selection_rest_statement_2\n" -" \"else\" .and optional_space .and statement;\n" +" \"else\" .and statement;\n" "condition\n" " condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n" -" condition_3 .emit OP_EXPRESSION;\n" +" condition_2 .emit OP_EXPRESSION;\n" "condition_1\n" -" condition_1_nospace .or condition_1_space;\n" -"condition_1_nospace\n" -" fully_specified_type_nospace .and condition_2;\n" -"condition_1_space\n" -" fully_specified_type_space .and space .and condition_2;\n" +" fully_specified_type .and identifier .emit VARIABLE_IDENTIFIER .and\n" +" equals .emit VARIABLE_INITIALIZER .and initializer .and .true .emit DECLARATOR_NONE;\n" "condition_2\n" -" identifier .emit VARIABLE_IDENTIFIER .and equals .emit VARIABLE_INITIALIZER .and\n" -" initializer .and .true .emit DECLARATOR_NONE;\n" -"condition_3\n" " expression .and .true .emit OP_END;\n" "iteration_statement\n" " iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n" @@ -611,7 +558,7 @@ " \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n" " rparen .error RPAREN_EXPECTED .and statement;\n" "iteration_statement_2\n" -" \"do\" .emit OP_DO .and statement_space .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n" +" \"do\" .emit OP_DO .and statement .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n" " expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n" "iteration_statement_3\n" " \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n" @@ -635,13 +582,13 @@ "jump_statement_2\n" " \"break\" .and semicolon .emit OP_BREAK;\n" "jump_statement_3\n" -" \"return\" .emit OP_RETURN .and optional_space .and expression .and semicolon .emit OP_END;\n" +" \"return\" .emit OP_RETURN .and expression .and semicolon .emit OP_END;\n" "jump_statement_4\n" " \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n" "jump_statement_5\n" " \"discard\" .and semicolon .emit OP_DISCARD;\n" "__asm_statement\n" -" \"__asm\" .and space .and identifier .and space .and asm_arguments .and semicolon .emit OP_END;\n" +" \"__asm\" .and identifier .and asm_arguments .and semicolon .emit OP_END;\n" "asm_arguments\n" " asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n" "asm_arguments_1\n" @@ -653,16 +600,15 @@ "var_with_field\n" " variable_identifier .and dot .and field_selection .emit OP_FIELD;\n" "translation_unit\n" -" optional_space .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n" -" .loop external_declaration .and optional_space .and\n" -" '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" +" .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n" +" .loop external_declaration .and '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" "external_declaration\n" " precision_stmt .emit DEFAULT_PRECISION .or\n" " function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n" " invariant_stmt .emit INVARIANT_STMT .or\n" " declaration .emit EXTERNAL_DECLARATION;\n" "precision_stmt\n" -" \"precision\" .and space .and precision .error INVALID_PRECISION .and space .and prectype .error INVALID_PRECISION_TYPE .and semicolon;\n" +" \"precision\" .and precision .error INVALID_PRECISION .and prectype .error INVALID_PRECISION_TYPE .and semicolon;\n" "precision\n" " \"lowp\" .emit PRECISION_LOW .or\n" " \"mediump\" .emit PRECISION_MEDIUM .or\n" @@ -679,7 +625,7 @@ " \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" " \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW;\n" "invariant_stmt\n" -" \"invariant\" .and space .and identifier .and semicolon;\n" +" \"invariant\" .and identifier .and semicolon;\n" "function_definition\n" " function_prototype .and compound_statement_no_new_scope;\n" "identifier\n" @@ -701,10 +647,6 @@ " integer .emit OP_PUSH_INT;\n" "boolconstant\n" " boolean .emit OP_PUSH_BOOL;\n" -"optional_space\n" -" .true;\n" -"space\n" -" .true;\n" "ampersandampersand\n" " \"@&&\";\n" "barbar\n" -- cgit v1.2.3 From fab99092a0879531442d1dd20f971ae7eda824eb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 8 Sep 2009 13:32:20 +0200 Subject: slang: Correctly handle end of tokens marker. --- src/mesa/shader/grammar/grammar.c | 2 ++ src/mesa/shader/slang/library/slang_shader.syn | 2 +- src/mesa/shader/slang/library/slang_shader_syn.h | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 36ed9d5603b..54e94bbf6a9 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -2069,6 +2069,8 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_token = SL_PP_IDENTIFIER; } else if (!strcmp(s->m_string, "@NUM")) { s->m_token = SL_PP_NUMBER; + } else if (!strcmp(s->m_string, "@EOF")) { + s->m_token = SL_PP_EOF; } else { spec_destroy(&s); return 1; diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index 4558ed58b07..f6bf7f1e546 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -1291,7 +1291,7 @@ var_with_field */ translation_unit .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and - .loop external_declaration .and '\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; + .loop external_declaration .and "@EOF" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; /* diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index e94238e0125..9a56643d2f1 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -601,7 +601,7 @@ " variable_identifier .and dot .and field_selection .emit OP_FIELD;\n" "translation_unit\n" " .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n" -" .loop external_declaration .and '\\0' .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" +" .loop external_declaration .and \"@EOF\" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" "external_declaration\n" " precision_stmt .emit DEFAULT_PRECISION .or\n" " function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n" -- cgit v1.2.3 From a67f32289a6e22daa2665310f4a8f26979f7ed60 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 14 Sep 2009 13:07:25 +0200 Subject: glsl/pp: Add a dictionary to a context. --- src/glsl/pp/SConscript | 1 + src/glsl/pp/sl_pp_context.c | 10 +++++++- src/glsl/pp/sl_pp_context.h | 4 +++- src/glsl/pp/sl_pp_dict.c | 56 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_dict.h | 46 +++++++++++++++++++++++++++++++++++++ 5 files changed, 115 insertions(+), 2 deletions(-) create mode 100644 src/glsl/pp/sl_pp_dict.c create mode 100644 src/glsl/pp/sl_pp_dict.h diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index cc930380c21..621db1e765c 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -10,6 +10,7 @@ glsl = env.StaticLibrary( source = [ 'sl_pp_context.c', 'sl_pp_define.c', + 'sl_pp_dict.c', 'sl_pp_error.c', 'sl_pp_expression.c', 'sl_pp_extension.c', diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 2fca3791a26..88a002c1c73 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -29,16 +29,24 @@ #include "sl_pp_context.h" -void +int sl_pp_context_init(struct sl_pp_context *context) { memset(context, 0, sizeof(struct sl_pp_context)); + + if (sl_pp_dict_init(context)) { + sl_pp_context_destroy(context); + return -1; + } + context->macro_tail = &context->macro; context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; memset(context->error_msg, 0, sizeof(context->error_msg)); context->line = 1; context->file = 0; + + return 0; } void diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index c7e6770f449..5826f9448d0 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -28,6 +28,7 @@ #ifndef SL_PP_CONTEXT_H #define SL_PP_CONTEXT_H +#include "sl_pp_dict.h" #include "sl_pp_macro.h" @@ -39,6 +40,7 @@ struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; unsigned int cstr_pool_len; + struct sl_pp_dict dict; struct sl_pp_macro *macro; struct sl_pp_macro **macro_tail; @@ -53,7 +55,7 @@ struct sl_pp_context { unsigned int file; }; -void +int sl_pp_context_init(struct sl_pp_context *context); void diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c new file mode 100644 index 00000000000..65b91d9e989 --- /dev/null +++ b/src/glsl/pp/sl_pp_dict.c @@ -0,0 +1,56 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include "sl_pp_context.h" +#include "sl_pp_dict.h" + + +#define ADD_NAME_STR(CTX, NAME, STR)\ + do {\ + (CTX)->dict.NAME = sl_pp_context_add_unique_str((CTX), (STR));\ + if ((CTX)->dict.NAME == -1) {\ + return -1;\ + }\ + } while (0) + +#define ADD_NAME(CTX, NAME) ADD_NAME_STR(CTX, NAME, #NAME) + + +int +sl_pp_dict_init(struct sl_pp_context *context) +{ + ADD_NAME(context, all); + ADD_NAME_STR(context, _GL_ARB_draw_buffers, "GL_ARB_draw_buffers"); + ADD_NAME_STR(context, _GL_ARB_texture_rectangle, "GL_ARB_texture_rectangle"); + + ADD_NAME(context, require); + ADD_NAME(context, enable); + ADD_NAME(context, warn); + ADD_NAME(context, disable); + + return 0; +} diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h new file mode 100644 index 00000000000..ce138d98f51 --- /dev/null +++ b/src/glsl/pp/sl_pp_dict.h @@ -0,0 +1,46 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_DICT_H +#define SL_PP_DICT_H + +struct sl_pp_dict { + int all; + int _GL_ARB_draw_buffers; + int _GL_ARB_texture_rectangle; + + int require; + int enable; + int warn; + int disable; +}; + + +int +sl_pp_dict_init(struct sl_pp_context *context); + +#endif /* SL_PP_DICT_H */ -- cgit v1.2.3 From 169aead1b55446c7bfe669b6a822d56e8af15f7f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 14 Sep 2009 13:08:07 +0200 Subject: glsl/apps: Adapt to pp interface change. --- src/glsl/apps/process.c | 5 ++++- src/glsl/apps/tokenise.c | 5 ++++- src/glsl/apps/version.c | 5 ++++- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 71211ccb727..a11f9741f5a 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -88,7 +88,10 @@ main(int argc, free(inbuf); - sl_pp_context_init(&context); + if (sl_pp_context_init(&context)) { + free(outbuf); + return 1; + } if (sl_pp_tokenise(&context, outbuf, &tokens)) { sl_pp_context_destroy(&context); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index b5092ba35f6..64b0a2f05eb 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -84,7 +84,10 @@ main(int argc, free(inbuf); - sl_pp_context_init(&context); + if (sl_pp_context_init(&context)) { + free(outbuf); + return 1; + } if (sl_pp_tokenise(&context, outbuf, &tokens)) { sl_pp_context_destroy(&context); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index c56ae9dde9a..9e579043b28 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -84,7 +84,10 @@ main(int argc, free(inbuf); - sl_pp_context_init(&context); + if (sl_pp_context_init(&context)) { + free(outbuf); + return 1; + } if (sl_pp_tokenise(&context, outbuf, &tokens)) { sl_pp_context_destroy(&context); -- cgit v1.2.3 From cd26ccf6fecd03ca66731340c7bb7341eaa093a1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 14 Sep 2009 13:08:16 +0200 Subject: grammar: Adapt to pp interface change. --- src/mesa/shader/grammar/grammar.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index 54e94bbf6a9..ebfcef06800 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -3149,7 +3149,10 @@ grammar_fast_check (grammar id, return 0; } - sl_pp_context_init(&context); + if (sl_pp_context_init(&context)) { + free(outbuf); + return 1; + } if (sl_pp_tokenise(&context, outbuf, &intokens)) { sl_pp_context_destroy(&context); -- cgit v1.2.3 From 0f302b60fd6d43a47e208979d0677e09f4a802fc Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 14 Sep 2009 13:09:36 +0200 Subject: glsl/pp: Support GL_ARB_draw_buffers and GL_ARB_texture_rectangle. --- src/glsl/pp/sl_pp_extension.c | 83 +++++++++++++++++++++++++------------------ 1 file changed, 49 insertions(+), 34 deletions(-) diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 3d223a1a548..33193d03a8c 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -36,86 +36,101 @@ sl_pp_process_extension(struct sl_pp_context *context, unsigned int last, struct sl_pp_process_state *state) { - int all_extensions = -1; - const char *extension_name = NULL; - const char *behavior = NULL; + int extensions[] = { + context->dict.all, + context->dict._GL_ARB_draw_buffers, + context->dict._GL_ARB_texture_rectangle, + -1 + }; + int extension_name = -1; + int *ext; + int behavior = -1; struct sl_pp_token_info out; - all_extensions = sl_pp_context_add_unique_str(context, "all"); - if (all_extensions == -1) { - return -1; - } - + /* Grab the extension name. */ if (first < last && input[first].token == SL_PP_IDENTIFIER) { - extension_name = sl_pp_context_cstr(context, input[first].data.identifier); + extension_name = input[first].data.identifier; first++; } - if (!extension_name) { + if (extension_name == -1) { strcpy(context->error_msg, "expected identifier after `#extension'"); return -1; } - if (!strcmp(extension_name, "all")) { - out.data.extension = all_extensions; - } else { - out.data.extension = -1; + /* Make sure the extension is supported. */ + out.data.extension = -1; + for (ext = extensions; *ext != -1; ext++) { + if (extension_name == *ext) { + out.data.extension = extension_name; + break; + } } + /* Grab the colon separating the extension name and behavior. */ while (first < last && input[first].token == SL_PP_WHITESPACE) { first++; } - if (first < last && input[first].token == SL_PP_COLON) { first++; } else { strcpy(context->error_msg, "expected `:' after extension name"); return -1; } - while (first < last && input[first].token == SL_PP_WHITESPACE) { first++; } + /* Grab the behavior name. */ if (first < last && input[first].token == SL_PP_IDENTIFIER) { - behavior = sl_pp_context_cstr(context, input[first].data.identifier); + behavior = input[first].data.identifier; first++; } - if (!behavior) { + if (behavior == -1) { strcpy(context->error_msg, "expected identifier after `:'"); return -1; } - if (!strcmp(behavior, "require")) { - strcpy(context->error_msg, "unable to enable required extension"); - return -1; - } else if (!strcmp(behavior, "enable")) { - if (out.data.extension == all_extensions) { - strcpy(context->error_msg, "unable to enable all extensions"); + if (behavior == context->dict.require) { + if (out.data.extension == -1) { + strcpy(context->error_msg, "the required extension is not supported"); + return -1; + } + if (out.data.extension == context->dict.all) { + strcpy(context->error_msg, "invalid behavior for `all' extension: `require'"); return -1; - } else { + } + out.token = SL_PP_EXTENSION_REQUIRE; + } else if (behavior == context->dict.enable) { + if (out.data.extension == -1) { + /* Warning: the extension cannot be enabled. */ return 0; } - } else if (!strcmp(behavior, "warn")) { - if (out.data.extension == all_extensions) { - out.token = SL_PP_EXTENSION_WARN; - } else { + if (out.data.extension == context->dict.all) { + strcpy(context->error_msg, "invalid behavior for `all' extension: `enable'"); + return -1; + } + out.token = SL_PP_EXTENSION_ENABLE; + } else if (behavior == context->dict.warn) { + if (out.data.extension == -1) { + /* Warning: the extension is not supported. */ return 0; } - } else if (!strcmp(behavior, "disable")) { - if (out.data.extension == all_extensions) { - out.token = SL_PP_EXTENSION_DISABLE; - } else { + out.token = SL_PP_EXTENSION_WARN; + } else if (behavior == context->dict.disable) { + if (out.data.extension == -1) { + /* Warning: the extension is not supported. */ return 0; } + out.token = SL_PP_EXTENSION_DISABLE; } else { strcpy(context->error_msg, "unrecognised behavior name"); return -1; } + /* Grab the end of line. */ while (first < last && input[first].token == SL_PP_WHITESPACE) { first++; } - if (first < last) { strcpy(context->error_msg, "expected end of line after behavior name"); return -1; -- cgit v1.2.3 From eeb5202e5ddf1cc95c35d46fd425afd0695b85bb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 19:24:50 +0200 Subject: slang: Invoke the preprocessor from withing the slang compiler. This allows us to validate the shader version number. --- src/mesa/shader/grammar/grammar.c | 125 +------------------------------ src/mesa/shader/grammar/grammar.h | 9 ++- src/mesa/shader/grammar/grammar_mesa.h | 4 - src/mesa/shader/slang/slang_compile.c | 131 ++++++++++++++++++++++++++++++--- 4 files changed, 132 insertions(+), 137 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index ebfcef06800..eb58e0cddd6 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -3106,14 +3106,13 @@ int grammar_set_reg8 (grammar id, const byte *name, byte value) int grammar_fast_check (grammar id, - const byte *text, + struct sl_pp_context *context, + struct sl_pp_token_info *tokens, byte **prod, unsigned int *size, unsigned int estimate_prod_size) { dict *di = NULL; - struct sl_pp_context context; - struct sl_pp_token_info *tokens; int index = 0; regbyte_ctx *rbc = NULL; bytepool *bp = NULL; @@ -3131,135 +3130,17 @@ grammar_fast_check (grammar id, *prod = NULL; *size = 0; - /* - * Preprocess the source string with a GLSL preprocessor. - * This is a hack but since nowadays we use grammar only for - * GLSL compiler, and that also is going away, we'll do it anyway. - */ - - { - struct sl_pp_purify_options options; - char *outbuf; - struct sl_pp_token_info *intokens; - unsigned int version; - unsigned int tokens_eaten; - - memset(&options, 0, sizeof(options)); - if (sl_pp_purify((const char *)text, &options, &outbuf)) { - return 0; - } - - if (sl_pp_context_init(&context)) { - free(outbuf); - return 1; - } - - if (sl_pp_tokenise(&context, outbuf, &intokens)) { - sl_pp_context_destroy(&context); - free(outbuf); - return 0; - } - - free(outbuf); - - if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { - sl_pp_context_destroy(&context); - free(intokens); - return 0; - } - - if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { - sl_pp_context_destroy(&context); - free(intokens); - return 0; - } - - free(intokens); - - /* For the time being we care about only a handful of tokens. */ - { - const struct sl_pp_token_info *src = tokens; - struct sl_pp_token_info *dst = tokens; - - while (src->token != SL_PP_EOF) { - switch (src->token) { - case SL_PP_COMMA: - case SL_PP_SEMICOLON: - case SL_PP_LBRACE: - case SL_PP_RBRACE: - case SL_PP_LPAREN: - case SL_PP_RPAREN: - case SL_PP_LBRACKET: - case SL_PP_RBRACKET: - case SL_PP_DOT: - case SL_PP_INCREMENT: - case SL_PP_ADDASSIGN: - case SL_PP_PLUS: - case SL_PP_DECREMENT: - case SL_PP_SUBASSIGN: - case SL_PP_MINUS: - case SL_PP_BITNOT: - case SL_PP_NOTEQUAL: - case SL_PP_NOT: - case SL_PP_MULASSIGN: - case SL_PP_STAR: - case SL_PP_DIVASSIGN: - case SL_PP_SLASH: - case SL_PP_MODASSIGN: - case SL_PP_MODULO: - case SL_PP_LSHIFTASSIGN: - case SL_PP_LSHIFT: - case SL_PP_LESSEQUAL: - case SL_PP_LESS: - case SL_PP_RSHIFTASSIGN: - case SL_PP_RSHIFT: - case SL_PP_GREATEREQUAL: - case SL_PP_GREATER: - case SL_PP_EQUAL: - case SL_PP_ASSIGN: - case SL_PP_AND: - case SL_PP_BITANDASSIGN: - case SL_PP_BITAND: - case SL_PP_XOR: - case SL_PP_BITXORASSIGN: - case SL_PP_BITXOR: - case SL_PP_OR: - case SL_PP_BITORASSIGN: - case SL_PP_BITOR: - case SL_PP_QUESTION: - case SL_PP_COLON: - case SL_PP_IDENTIFIER: - case SL_PP_NUMBER: - *dst++ = *src++; - break; - - default: - src++; - } - } - - /* The end of stream token. */ - *dst = *src; - } - } - bytepool_create(&bp, estimate_prod_size); if (bp == NULL) { - sl_pp_context_destroy(&context); - free(tokens); return 0; } - if (fast_match(di, tokens, &index, di->m_syntax, &_P, bp, &rbc, &context) != mr_matched) { - sl_pp_context_destroy(&context); - free(tokens); + if (fast_match(di, tokens, &index, di->m_syntax, &_P, bp, &rbc, context) != mr_matched) { bytepool_destroy (&bp); free_regbyte_ctx_stack (rbc, NULL); return 0; } - sl_pp_context_destroy(&context); - free(tokens); free_regbyte_ctx_stack(rbc, NULL); *prod = bp->_F; diff --git a/src/mesa/shader/grammar/grammar.h b/src/mesa/shader/grammar/grammar.h index 151b5f082b9..c3c21659d6c 100644 --- a/src/mesa/shader/grammar/grammar.h +++ b/src/mesa/shader/grammar/grammar.h @@ -69,8 +69,13 @@ int grammar_set_reg8 (grammar id, const byte *name, byte value); is a hint - the initial production buffer size will be of this size, but if more room is needed it will be safely resized; set it to 0x1000 or so */ -int grammar_fast_check (grammar id, const byte *text, byte **prod, unsigned int *size, - unsigned int estimate_prod_size); +int +grammar_fast_check (grammar id, + struct sl_pp_context *context, + struct sl_pp_token_info *tokens, + byte **prod, + unsigned int *size, + unsigned int estimate_prod_size); /* destroys grammar object identified by diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h index 7f4370f32d0..20d13da8381 100644 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ b/src/mesa/shader/grammar/grammar_mesa.h @@ -27,10 +27,6 @@ #include "../../glsl/pp/sl_pp_context.h" -#include "../../glsl/pp/sl_pp_purify.h" -#include "../../glsl/pp/sl_pp_version.h" -#include "../../glsl/pp/sl_pp_process.h" - #include "main/imports.h" /* NOTE: include Mesa 3-D specific headers here */ diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 75dd8a045bd..8ea86756184 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -36,6 +36,10 @@ #include "shader/prog_print.h" #include "shader/prog_parameter.h" #include "shader/grammar/grammar_mesa.h" +#include "../../glsl/pp/sl_pp_context.h" +#include "../../glsl/pp/sl_pp_purify.h" +#include "../../glsl/pp/sl_pp_version.h" +#include "../../glsl/pp/sl_pp_process.h" #include "slang_codegen.h" #include "slang_compile.h" #include "slang_storage.h" @@ -2579,9 +2583,115 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, const struct gl_extensions *extensions, struct gl_sl_pragmas *pragmas) { + struct sl_pp_context context; + struct sl_pp_token_info *tokens; byte *prod; - GLuint size, version; - GLuint maxVersion; + GLuint size; + unsigned int version; + unsigned int maxVersion; + int result; + struct sl_pp_purify_options options; + char *outbuf; + struct sl_pp_token_info *intokens; + unsigned int tokens_eaten; + + memset(&options, 0, sizeof(options)); + if (sl_pp_purify(source, &options, &outbuf)) { + return GL_FALSE; + } + + if (sl_pp_context_init(&context)) { + free(outbuf); + return GL_FALSE; + } + + if (sl_pp_tokenise(&context, outbuf, &intokens)) { + sl_pp_context_destroy(&context); + free(outbuf); + return GL_FALSE; + } + + free(outbuf); + + if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { + sl_pp_context_destroy(&context); + free(intokens); + return GL_FALSE; + } + + if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { + sl_pp_context_destroy(&context); + free(intokens); + return GL_FALSE; + } + + free(intokens); + + /* For the time being we care about only a handful of tokens. */ + { + const struct sl_pp_token_info *src = tokens; + struct sl_pp_token_info *dst = tokens; + + while (src->token != SL_PP_EOF) { + switch (src->token) { + case SL_PP_COMMA: + case SL_PP_SEMICOLON: + case SL_PP_LBRACE: + case SL_PP_RBRACE: + case SL_PP_LPAREN: + case SL_PP_RPAREN: + case SL_PP_LBRACKET: + case SL_PP_RBRACKET: + case SL_PP_DOT: + case SL_PP_INCREMENT: + case SL_PP_ADDASSIGN: + case SL_PP_PLUS: + case SL_PP_DECREMENT: + case SL_PP_SUBASSIGN: + case SL_PP_MINUS: + case SL_PP_BITNOT: + case SL_PP_NOTEQUAL: + case SL_PP_NOT: + case SL_PP_MULASSIGN: + case SL_PP_STAR: + case SL_PP_DIVASSIGN: + case SL_PP_SLASH: + case SL_PP_MODASSIGN: + case SL_PP_MODULO: + case SL_PP_LSHIFTASSIGN: + case SL_PP_LSHIFT: + case SL_PP_LESSEQUAL: + case SL_PP_LESS: + case SL_PP_RSHIFTASSIGN: + case SL_PP_RSHIFT: + case SL_PP_GREATEREQUAL: + case SL_PP_GREATER: + case SL_PP_EQUAL: + case SL_PP_ASSIGN: + case SL_PP_AND: + case SL_PP_BITANDASSIGN: + case SL_PP_BITAND: + case SL_PP_XOR: + case SL_PP_BITXORASSIGN: + case SL_PP_BITXOR: + case SL_PP_OR: + case SL_PP_BITORASSIGN: + case SL_PP_BITOR: + case SL_PP_QUESTION: + case SL_PP_COLON: + case SL_PP_IDENTIFIER: + case SL_PP_NUMBER: + *dst++ = *src++; + break; + + default: + src++; + } + } + + /* The end of stream token. */ + *dst = *src; + } #if FEATURE_ARB_shading_language_120 maxVersion = 120; @@ -2591,20 +2701,23 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, maxVersion = 110; #endif - /* First retrieve the version number. */ - version = 110; - - if (version > maxVersion) { + if (version > maxVersion || + (version != 100 && version != 110 && version != 120)) { slang_info_log_error(infolog, "language version %.2f is not supported.", version * 0.01); + sl_pp_context_destroy(&context); + free(tokens); return GL_FALSE; } /* Finally check the syntax and generate its binary representation. */ - if (!grammar_fast_check(id, - (const byte *)source, - &prod, &size, 65536)) { + result = grammar_fast_check(id, &context, tokens, &prod, &size, 65536); + + sl_pp_context_destroy(&context); + free(tokens); + + if (!result) { char buf[1024]; GLint pos; -- cgit v1.2.3 From d4638f5dce4cb2c873acafb289036fd59c7a3c78 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 20:27:59 +0200 Subject: glsl/pp: Add more error messages. --- src/glsl/pp/sl_pp_process.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index c4d6efaed38..03a3051838f 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -81,11 +81,13 @@ sl_pp_process(struct sl_pp_context *context, ti.token = SL_PP_LINE; ti.data.line = context->line - 1; if (sl_pp_process_out(&state, &ti)) { + strcpy(context->error_msg, "out of memory"); return -1; } ti.token = SL_PP_NEWLINE; if (sl_pp_process_out(&state, &ti)) { + strcpy(context->error_msg, "out of memory"); return -1; } } @@ -189,6 +191,7 @@ sl_pp_process(struct sl_pp_context *context, } if (sl_pp_process_out(&state, &endof)) { + strcpy(context->error_msg, "out of memory"); return -1; } context->line++; @@ -198,6 +201,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_NEWLINE: /* Empty directive. */ if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); return -1; } context->line++; @@ -207,6 +211,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_EOF: /* Empty directive. */ if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); return -1; } i++; @@ -214,6 +219,7 @@ sl_pp_process(struct sl_pp_context *context, break; default: + strcpy(context->error_msg, "expected a directive name"); return -1; } } else { @@ -229,6 +235,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_NEWLINE: /* Preserve newline just for the sake of line numbering. */ if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); return -1; } context->line++; @@ -238,6 +245,7 @@ sl_pp_process(struct sl_pp_context *context, case SL_PP_EOF: if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); return -1; } i++; @@ -254,6 +262,7 @@ sl_pp_process(struct sl_pp_context *context, default: if (context->if_value) { if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); return -1; } } @@ -264,7 +273,7 @@ sl_pp_process(struct sl_pp_context *context, } if (context->if_ptr != SL_PP_MAX_IF_NESTING) { - /* #endif expected. */ + strcpy(context->error_msg, "expected `#endif' directive"); return -1; } -- cgit v1.2.3 From c9de313f1b6d0ee8d9304fc3fe11fb84ff494f12 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 20:28:20 +0200 Subject: slang: Propagate error messages from preprocessor. --- src/mesa/shader/slang/slang_compile.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 8ea86756184..19fec53877f 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2597,15 +2597,18 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, memset(&options, 0, sizeof(options)); if (sl_pp_purify(source, &options, &outbuf)) { + slang_info_log_error(infolog, "unable to preprocess the source"); return GL_FALSE; } if (sl_pp_context_init(&context)) { + slang_info_log_error(infolog, "out of memory"); free(outbuf); return GL_FALSE; } if (sl_pp_tokenise(&context, outbuf, &intokens)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(outbuf); return GL_FALSE; @@ -2614,12 +2617,14 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, free(outbuf); if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(intokens); return GL_FALSE; } if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { + slang_info_log_error(infolog, "%s", context.error_msg); sl_pp_context_destroy(&context); free(intokens); return GL_FALSE; -- cgit v1.2.3 From de0753e4cb64792d257ad3799932a77321fc3c49 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 20:40:02 +0200 Subject: glsl/pp: Add more error messages. --- src/glsl/pp/sl_pp_token.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 68c8fbe2ec4..95fe4f7d85e 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -47,6 +47,7 @@ _tokenise_identifier(struct sl_pp_context *context, (*input >= '0' && *input <= '9') || (*input == '_')) { if (i >= sizeof(identifier) - 1) { + strcpy(context->error_msg, "out of memory"); return -1; } identifier[i++] = *input++; @@ -85,6 +86,7 @@ _tokenise_number(struct sl_pp_context *context, (*input == '-') || (*input == '.')) { if (i >= sizeof(number) - 1) { + strcpy(context->error_msg, "out of memory"); return -1; } number[i++] = *input++; @@ -384,6 +386,7 @@ sl_pp_tokenise(struct sl_pp_context *context, out = realloc(out, new_max * sizeof(struct sl_pp_token_info)); if (!out) { + strcpy(context->error_msg, "out of memory"); return -1; } out_max = new_max; -- cgit v1.2.3 From a7382628f2ed5a2886a1828dd847d75bf8e9b38e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 21:51:12 +0200 Subject: glsl/pp: Validate numbers. --- src/glsl/pp/sl_pp_token.c | 250 +++++++++++++++++++++++++++++++++++++++++----- 1 file changed, 227 insertions(+), 23 deletions(-) diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 95fe4f7d85e..a6a2bb27485 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -29,6 +29,13 @@ #include "sl_pp_token.h" +static int +_is_identifier_char(char c) +{ + return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; +} + + static int _tokenise_identifier(struct sl_pp_context *context, const char **pinput, @@ -42,10 +49,7 @@ _tokenise_identifier(struct sl_pp_context *context, info->data.identifier = -1; identifier[i++] = *input++; - while ((*input >= 'a' && *input <= 'z') || - (*input >= 'A' && *input <= 'Z') || - (*input >= '0' && *input <= '9') || - (*input == '_')) { + while (_is_identifier_char(*input)) { if (i >= sizeof(identifier) - 1) { strcpy(context->error_msg, "out of memory"); return -1; @@ -64,41 +68,241 @@ _tokenise_identifier(struct sl_pp_context *context, } +/* + * Return the number of consecutive decimal digits in the input stream. + */ +static unsigned int +_parse_float_digits(const char *input) +{ + unsigned int eaten = 0; + + while (input[eaten] >= '0' && input[eaten] <= '9') { + eaten++; + } + return eaten; +} + + +/* + * Try to match one of the following patterns for the fractional part + * of a floating point number. + * + * digits . [digits] + * . digits + * + * Return 0 if the pattern could not be matched, otherwise the number + * of eaten characters from the input stream. + */ +static unsigned int +_parse_float_frac(const char *input) +{ + unsigned int eaten; + + if (input[0] == '.') { + eaten = _parse_float_digits(&input[1]); + if (eaten) { + return eaten + 1; + } + return 0; + } + + eaten = _parse_float_digits(input); + if (eaten && input[eaten] == '.') { + unsigned int trailing; + + trailing = _parse_float_digits(&input[eaten + 1]); + if (trailing) { + return eaten + trailing + 1; + } + return eaten + 1; + } + + return 0; +} + + +/* + * Try to match the following pattern for the exponential part + * of a floating point number. + * + * (e|E) [(+|-)] digits + * + * Return 0 if the pattern could not be matched, otherwise the number + * of eaten characters from the input stream. + */ +static unsigned int +_parse_float_exp(const char *input) +{ + unsigned int eaten, digits; + + if (input[0] != 'e' && input[0] != 'E') { + return 0; + } + + if (input[1] == '-' || input[1] == '+') { + eaten = 2; + } else { + eaten = 1; + } + + digits = _parse_float_digits(&input[eaten]); + if (!digits) { + return 0; + } + + return eaten + digits; +} + + +/* + * Try to match one of the following patterns for a floating point number. + * + * fract [exp] [(f|F)] + * digits exp [(f|F)] + * + * Return 0 if the pattern could not be matched, otherwise the number + * of eaten characters from the input stream. + */ +static unsigned int +_parse_float(const char *input) +{ + unsigned int eaten; + + eaten = _parse_float_frac(input); + if (eaten) { + unsigned int exponent; + + exponent = _parse_float_exp(&input[eaten]); + if (exponent) { + eaten += exponent; + } + + if (input[eaten] == 'f' || input[eaten] == 'F') { + eaten++; + } + + return eaten; + } + + eaten = _parse_float_digits(input); + if (eaten) { + unsigned int exponent; + + exponent = _parse_float_exp(&input[eaten]); + if (exponent) { + eaten += exponent; + + if (input[eaten] == 'f' || input[eaten] == 'F') { + eaten++; + } + + return eaten; + } + } + + return 0; +} + + +static unsigned int +_parse_hex(const char *input) +{ + unsigned int n; + + if (input[0] != '0') { + return 0; + } + + if (input[1] != 'x' && input[1] != 'X') { + return 0; + } + + n = 2; + while ((input[n] >= '0' && input[n] <= '9') || + (input[n] >= 'a' && input[n] <= 'f') || + (input[n] >= 'A' && input[n] <= 'F')) { + n++; + } + + if (n > 2) { + return n; + } + + return 0; +} + + +static unsigned int +_parse_oct(const char *input) +{ + unsigned int n; + + if (input[0] != '0') { + return 0; + } + + n = 1; + while ((input[n] >= '0' && input[n] <= '7')) { + n++; + } + + return n; +} + + +static unsigned int +_parse_dec(const char *input) +{ + unsigned int n = 0; + + while ((input[n] >= '0' && input[n] <= '9')) { + n++; + } + + return n; +} + + static int _tokenise_number(struct sl_pp_context *context, const char **pinput, struct sl_pp_token_info *info) { const char *input = *pinput; + unsigned int eaten; char number[256]; /* XXX: Remove this artifical limit. */ - unsigned int i = 0; - info->token = SL_PP_NUMBER; - info->data.number = -1; - - number[i++] = *input++; - while ((*input >= '0' && *input <= '9') || - (*input >= 'a' && *input <= 'f') || - (*input >= 'A' && *input <= 'F') || - (*input == 'x') || - (*input == 'X') || - (*input == '+') || - (*input == '-') || - (*input == '.')) { - if (i >= sizeof(number) - 1) { - strcpy(context->error_msg, "out of memory"); - return -1; + eaten = _parse_float(input); + if (!eaten) { + eaten = _parse_hex(input); + if (!eaten) { + eaten = _parse_oct(input); + if (!eaten) { + eaten = _parse_dec(input); + } } - number[i++] = *input++; } - number[i++] = '\0'; + if (!eaten || _is_identifier_char(input[eaten])) { + strcpy(context->error_msg, "expected a number"); + return -1; + } + + if (eaten > sizeof(number) - 1) { + strcpy(context->error_msg, "out of memory"); + return -1; + } + + memcpy(number, input, eaten); + number[eaten] = '\0'; + + info->token = SL_PP_NUMBER; info->data.number = sl_pp_context_add_unique_str(context, number); if (info->data.number == -1) { return -1; } - *pinput = input; + *pinput = input + eaten; return 0; } -- cgit v1.2.3 From cc629940d4a47c998d0ed5dbcc0f396025932e0e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 16 Sep 2009 22:04:22 +0200 Subject: glsl/apps: Always write out error condition. --- src/glsl/apps/process.c | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index a11f9741f5a..678b1005f89 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -64,14 +64,26 @@ main(int argc, size = ftell(in); fseek(in, 0, SEEK_SET); + out = fopen(argv[2], "wb"); + if (!out) { + fclose(in); + return 1; + } + inbuf = malloc(size + 1); if (!inbuf) { + fprintf(out, "$OOMERROR\n"); + + fclose(out); fclose(in); return 1; } if (fread(inbuf, 1, size, in) != size) { + fprintf(out, "$READERROR\n"); + free(inbuf); + fclose(out); fclose(in); return 1; } @@ -82,36 +94,41 @@ main(int argc, memset(&options, 0, sizeof(options)); if (sl_pp_purify(inbuf, &options, &outbuf)) { + fprintf(out, "$PURIFYERROR\n"); + free(inbuf); + fclose(out); return 1; } free(inbuf); if (sl_pp_context_init(&context)) { + fprintf(out, "$CONTEXERROR\n"); + free(outbuf); + fclose(out); return 1; } if (sl_pp_tokenise(&context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", context.error_msg); + sl_pp_context_destroy(&context); free(outbuf); + fclose(out); return 1; } free(outbuf); if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { - sl_pp_context_destroy(&context); - free(tokens); - return -1; - } + fprintf(out, "$ERROR: `%s'\n", context.error_msg); - out = fopen(argv[2], "wb"); - if (!out) { sl_pp_context_destroy(&context); free(tokens); - return 1; + fclose(out); + return -1; } if (sl_pp_process(&context, &tokens[tokens_eaten], &outtokens)) { -- cgit v1.2.3 From 69bdd47dba1f7331a632316e4f9cc9942fb93ca4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 10:45:16 +0200 Subject: glsl/apps: Always write out error condition. --- src/glsl/apps/purify.c | 21 +++++++++++++++------ src/glsl/apps/tokenise.c | 28 +++++++++++++++++++++------- src/glsl/apps/version.c | 29 ++++++++++++++++++++++++----- 3 files changed, 60 insertions(+), 18 deletions(-) diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 7dff8aea456..d4c53704e54 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -54,14 +54,26 @@ main(int argc, size = ftell(in); fseek(in, 0, SEEK_SET); + out = fopen(argv[2], "wb"); + if (!out) { + fclose(in); + return 1; + } + inbuf = malloc(size + 1); if (!inbuf) { + fprintf(out, "$OOMERROR\n"); + + fclose(out); fclose(in); return 1; } if (fread(inbuf, 1, size, in) != size) { + fprintf(out, "$READERROR\n"); + free(inbuf); + fclose(out); fclose(in); return 1; } @@ -72,18 +84,15 @@ main(int argc, memset(&options, 0, sizeof(options)); if (sl_pp_purify(inbuf, &options, &outbuf)) { + fprintf(out, "$PURIFYERROR\n"); + free(inbuf); + fclose(out); return 1; } free(inbuf); - out = fopen(argv[2], "wb"); - if (!out) { - free(outbuf); - return 1; - } - fwrite(outbuf, 1, strlen(outbuf), out); free(outbuf); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 64b0a2f05eb..1746e20c13b 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -60,14 +60,26 @@ main(int argc, size = ftell(in); fseek(in, 0, SEEK_SET); + out = fopen(argv[2], "wb"); + if (!out) { + fclose(in); + return 1; + } + inbuf = malloc(size + 1); if (!inbuf) { + fprintf(out, "$OOMERROR\n"); + + fclose(out); fclose(in); return 1; } if (fread(inbuf, 1, size, in) != size) { + fprintf(out, "$READERROR\n"); + free(inbuf); + fclose(out); fclose(in); return 1; } @@ -78,32 +90,34 @@ main(int argc, memset(&options, 0, sizeof(options)); if (sl_pp_purify(inbuf, &options, &outbuf)) { + fprintf(out, "$PURIFYERROR\n"); + free(inbuf); + fclose(out); return 1; } free(inbuf); if (sl_pp_context_init(&context)) { + fprintf(out, "$CONTEXERROR\n"); + free(outbuf); + fclose(out); return 1; } if (sl_pp_tokenise(&context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", context.error_msg); + sl_pp_context_destroy(&context); free(outbuf); + fclose(out); return 1; } free(outbuf); - out = fopen(argv[2], "wb"); - if (!out) { - sl_pp_context_destroy(&context); - free(tokens); - return 1; - } - for (i = 0; tokens[i].token != SL_PP_EOF; i++) { switch (tokens[i].token) { case SL_PP_WHITESPACE: diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 9e579043b28..50c564b470b 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -60,14 +60,26 @@ main(int argc, size = ftell(in); fseek(in, 0, SEEK_SET); + out = fopen(argv[2], "wb"); + if (!out) { + fclose(in); + return 1; + } + inbuf = malloc(size + 1); if (!inbuf) { + fprintf(out, "$OOMERROR\n"); + + fclose(out); fclose(in); return 1; } if (fread(inbuf, 1, size, in) != size) { + fprintf(out, "$READERROR\n"); + free(inbuf); + fclose(out); fclose(in); return 1; } @@ -78,39 +90,46 @@ main(int argc, memset(&options, 0, sizeof(options)); if (sl_pp_purify(inbuf, &options, &outbuf)) { + fprintf(out, "$PURIFYERROR\n"); + free(inbuf); + fclose(out); return 1; } free(inbuf); if (sl_pp_context_init(&context)) { + fprintf(out, "$CONTEXERROR\n"); + free(outbuf); + fclose(out); return 1; } if (sl_pp_tokenise(&context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", context.error_msg); + sl_pp_context_destroy(&context); free(outbuf); + fclose(out); return 1; } free(outbuf); if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { + fprintf(out, "$ERROR: `%s'\n", context.error_msg); + sl_pp_context_destroy(&context); free(tokens); + fclose(out); return -1; } sl_pp_context_destroy(&context); free(tokens); - out = fopen(argv[2], "wb"); - if (!out) { - return 1; - } - fprintf(out, "%u\n%u\n", version, -- cgit v1.2.3 From 0ddf41d34d511b339e0bb5a59673765f1bf0b3a5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 11:51:35 +0200 Subject: glsl/pp: Add remaining error messages. --- src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_context.h | 2 +- src/glsl/pp/sl_pp_define.c | 19 ++++++++++++------ src/glsl/pp/sl_pp_expression.c | 2 ++ src/glsl/pp/sl_pp_if.c | 35 +++++++++++++++++++------------- src/glsl/pp/sl_pp_line.c | 45 ++++++++---------------------------------- src/glsl/pp/sl_pp_macro.c | 18 ++++++++++++++++- src/glsl/pp/sl_pp_pragma.c | 1 + src/glsl/pp/sl_pp_version.c | 42 ++++----------------------------------- 9 files changed, 68 insertions(+), 97 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 88a002c1c73..b196d8102a0 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -85,6 +85,7 @@ sl_pp_context_add_unique_str(struct sl_pp_context *context, } if (!context->cstr_pool) { + strcpy(context->error_msg, "out of memory"); return -1; } diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 5826f9448d0..8bed1420454 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -47,7 +47,7 @@ struct sl_pp_context { unsigned int if_stack[SL_PP_MAX_IF_NESTING]; unsigned int if_ptr; - int if_value; + unsigned int if_value; char error_msg[SL_PP_MAX_ERROR_MSG]; diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index 9bc9fb53599..391178aa696 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -41,7 +41,8 @@ skip_whitespace(const struct sl_pp_token_info *input, static int -_parse_formal_args(const struct sl_pp_token_info *input, +_parse_formal_args(struct sl_pp_context *context, + const struct sl_pp_token_info *input, unsigned int *first, unsigned int last, struct sl_pp_macro *macro) @@ -57,7 +58,7 @@ _parse_formal_args(const struct sl_pp_token_info *input, return 0; } } else { - /* Expected either an identifier or `)'. */ + strcpy(context->error_msg, "expected either an identifier or `)'"); return -1; } @@ -65,12 +66,13 @@ _parse_formal_args(const struct sl_pp_token_info *input, for (;;) { if (*first < last && input[*first].token != SL_PP_IDENTIFIER) { - /* Expected an identifier. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } *arg = malloc(sizeof(struct sl_pp_macro_formal_arg)); if (!*arg) { + strcpy(context->error_msg, "out of memory"); return -1; } @@ -90,14 +92,16 @@ _parse_formal_args(const struct sl_pp_token_info *input, (*first)++; return 0; } else { - /* Expected either `,' or `)'. */ + strcpy(context->error_msg, "expected either `,' or `)'"); return -1; } } else { - /* Expected either `,' or `)'. */ + strcpy(context->error_msg, "expected either `,' or `)'"); return -1; } } + + /* Should not gete here. */ } @@ -118,6 +122,7 @@ sl_pp_process_define(struct sl_pp_context *context, first++; } if (macro_name == -1) { + strcpy(context->error_msg, "expected an identifier"); return -1; } @@ -130,6 +135,7 @@ sl_pp_process_define(struct sl_pp_context *context, if (!macro) { macro = sl_pp_macro_new(); if (!macro) { + strcpy(context->error_msg, "out of memory"); return -1; } @@ -149,7 +155,7 @@ sl_pp_process_define(struct sl_pp_context *context, */ if (first < last && input[first].token == SL_PP_LPAREN) { first++; - if (_parse_formal_args(input, &first, last, macro)) { + if (_parse_formal_args(context, input, &first, last, macro)) { return -1; } } @@ -164,6 +170,7 @@ sl_pp_process_define(struct sl_pp_context *context, macro->body = malloc(sizeof(struct sl_pp_token_info) * body_len); if (!macro->body) { + strcpy(context->error_msg, "out of memory"); return -1; } diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c index a692430abbf..6b2329ed1a7 100644 --- a/src/glsl/pp/sl_pp_expression.c +++ b/src/glsl/pp/sl_pp_expression.c @@ -47,6 +47,7 @@ _parse_primary(struct parse_context *ctx, ctx->input++; } else { if (ctx->input->token != SL_PP_LPAREN) { + strcpy(ctx->context->error_msg, "expected `('"); return -1; } ctx->input++; @@ -54,6 +55,7 @@ _parse_primary(struct parse_context *ctx, return -1; } if (ctx->input->token != SL_PP_RPAREN) { + strcpy(ctx->context->error_msg, "expected `)'"); return -1; } ctx->input++; diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index 90b80512375..44bbefa3577 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -59,7 +59,7 @@ _parse_defined(struct sl_pp_context *context, } if (input[*pi].token != SL_PP_IDENTIFIER) { - /* Identifier expected. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } @@ -75,7 +75,7 @@ _parse_defined(struct sl_pp_context *context, if (parens) { skip_whitespace(input, pi); if (input[*pi].token != SL_PP_RPAREN) { - /* `)' expected */ + strcpy(context->error_msg, "expected `)'"); return -1; } (*pi)++; @@ -91,10 +91,15 @@ _parse_defined(struct sl_pp_context *context, return -1; } - return sl_pp_process_out(state, &result); + if (sl_pp_process_out(state, &result)) { + strcpy(context->error_msg, "out of memory"); + return -1; + } + + return 0; } -static int +static unsigned int _evaluate_if_stack(struct sl_pp_context *context) { unsigned int i; @@ -119,7 +124,7 @@ _parse_if(struct sl_pp_context *context, int result; if (!context->if_ptr) { - /* #if nesting too deep. */ + strcpy(context->error_msg, "`#if' nesting too deep"); return -1; } @@ -151,6 +156,7 @@ _parse_if(struct sl_pp_context *context, default: if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); free(state.out); return -1; } @@ -160,6 +166,7 @@ _parse_if(struct sl_pp_context *context, eof.token = SL_PP_EOF; if (sl_pp_process_out(&state, &eof)) { + strcpy(context->error_msg, "out of memory"); free(state.out); return -1; } @@ -182,13 +189,13 @@ static int _parse_else(struct sl_pp_context *context) { if (context->if_ptr == SL_PP_MAX_IF_NESTING) { - /* No matching #if. */ + strcpy(context->error_msg, "no matching `#if'"); return -1; } /* Bit b1 indicates we already went through #else. */ if (context->if_stack[context->if_ptr] & 2) { - /* No matching #if. */ + strcpy(context->error_msg, "no matching `#if'"); return -1; } @@ -217,7 +224,7 @@ sl_pp_process_ifdef(struct sl_pp_context *context, unsigned int i; if (!context->if_ptr) { - /* #if nesting too deep. */ + strcpy(context->error_msg, "`#if' nesting too deep"); return -1; } @@ -246,12 +253,12 @@ sl_pp_process_ifdef(struct sl_pp_context *context, break; default: - /* Expected an identifier. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } } - /* Expected an identifier. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } @@ -264,7 +271,7 @@ sl_pp_process_ifndef(struct sl_pp_context *context, unsigned int i; if (!context->if_ptr) { - /* #if nesting too deep. */ + strcpy(context->error_msg, "`#if' nesting too deep"); return -1; } @@ -293,12 +300,12 @@ sl_pp_process_ifndef(struct sl_pp_context *context, break; default: - /* Expected an identifier. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } } - /* Expected an identifier. */ + strcpy(context->error_msg, "expected an identifier"); return -1; } @@ -341,7 +348,7 @@ sl_pp_process_endif(struct sl_pp_context *context, unsigned int last) { if (context->if_ptr == SL_PP_MAX_IF_NESTING) { - /* No matching #if. */ + strcpy(context->error_msg, "no matching `#if'"); return -1; } diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index a56417a8610..c38f4b0f2e6 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -29,31 +29,6 @@ #include "sl_pp_process.h" -static int -_parse_integer(const char *input, - unsigned int *number) -{ - unsigned int n = 0; - - while (*input >= '0' && *input <= '9') { - if (n * 10 < n) { - /* Overflow. */ - return -1; - } - - n = n * 10 + (*input++ - '0'); - } - - if (*input != '\0') { - /* Invalid decimal number. */ - return -1; - } - - *number = n; - return 0; -} - - int sl_pp_process_line(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -65,7 +40,6 @@ sl_pp_process_line(struct sl_pp_context *context, struct sl_pp_process_state state; int line_number = -1; int file_number = -1; - const char *str; unsigned int line; memset(&state, 0, sizeof(state)); @@ -84,6 +58,7 @@ sl_pp_process_line(struct sl_pp_context *context, default: if (sl_pp_process_out(&state, &input[i])) { + strcpy(context->error_msg, "out of memory"); free(state.out); return -1; } @@ -94,7 +69,7 @@ sl_pp_process_line(struct sl_pp_context *context, if (state.out_len > 0 && state.out[0].token == SL_PP_NUMBER) { line_number = state.out[0].data.number; } else { - strcpy(context->error_msg, "expected number after `#line'"); + strcpy(context->error_msg, "expected a number after `#line'"); free(state.out); return -1; } @@ -103,13 +78,13 @@ sl_pp_process_line(struct sl_pp_context *context, if (state.out[1].token == SL_PP_NUMBER) { file_number = state.out[1].data.number; } else { - strcpy(context->error_msg, "expected number after line number"); + strcpy(context->error_msg, "expected a number after line number"); free(state.out); return -1; } if (state.out_len > 2) { - strcpy(context->error_msg, "expected end of line after file number"); + strcpy(context->error_msg, "expected an end of line after file number"); free(state.out); return -1; } @@ -117,10 +92,7 @@ sl_pp_process_line(struct sl_pp_context *context, free(state.out); - str = sl_pp_context_cstr(context, line_number); - if (_parse_integer(str, &line)) { - return -1; - } + line = atoi(sl_pp_context_cstr(context, line_number)); if (context->line != line) { struct sl_pp_token_info ti; @@ -128,6 +100,7 @@ sl_pp_process_line(struct sl_pp_context *context, ti.token = SL_PP_LINE; ti.data.line = line; if (sl_pp_process_out(pstate, &ti)) { + strcpy(context->error_msg, "out of memory"); return -1; } @@ -137,10 +110,7 @@ sl_pp_process_line(struct sl_pp_context *context, if (file_number != -1) { unsigned int file; - str = sl_pp_context_cstr(context, file_number); - if (_parse_integer(str, &file)) { - return -1; - } + file_number = atoi(sl_pp_context_cstr(context, file_number)); if (context->file != file) { struct sl_pp_token_info ti; @@ -148,6 +118,7 @@ sl_pp_process_line(struct sl_pp_context *context, ti.token = SL_PP_FILE; ti.data.file = file; if (sl_pp_process_out(pstate, &ti)) { + strcpy(context->error_msg, "out of memory"); return -1; } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index d14c9825557..7793562781f 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -107,7 +107,12 @@ _out_number(struct sl_pp_context *context, ti.token = SL_PP_NUMBER; ti.data.number = sl_pp_context_add_unique_str(context, buf); - return sl_pp_process_out(state, &ti); + if (sl_pp_process_out(state, &ti)) { + strcpy(context->error_msg, "out of memory"); + return -1; + } + + return 0; } int @@ -125,6 +130,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, unsigned int j; if (input[*pi].token != SL_PP_IDENTIFIER) { + strcpy(context->error_msg, "expected an identifier"); return -1; } @@ -172,6 +178,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, if (!macro) { if (!mute) { if (sl_pp_process_out(state, &input[*pi])) { + strcpy(context->error_msg, "out of memory"); return -1; } } @@ -184,6 +191,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, if (macro->num_args >= 0) { skip_whitespace(input, pi); if (input[*pi].token != SL_PP_LPAREN) { + strcpy(context->error_msg, "expected `('"); return -1; } (*pi)++; @@ -203,6 +211,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, *pmacro = sl_pp_macro_new(); if (!*pmacro) { + strcpy(context->error_msg, "out of memory"); return -1; } @@ -219,6 +228,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, if (j < (unsigned int)macro->num_args - 1) { done = 1; } else { + strcpy(context->error_msg, "too many actual macro arguments"); return -1; } } else { @@ -236,6 +246,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, if (j == (unsigned int)macro->num_args - 1) { done = 1; } else { + strcpy(context->error_msg, "too few actual macro arguments"); return -1; } } else { @@ -245,6 +256,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, break; case SL_PP_EOF: + strcpy(context->error_msg, "too few actual macro arguments"); return -1; default: @@ -254,6 +266,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, (**pmacro).body = malloc(sizeof(struct sl_pp_token_info) * body_len); if (!(**pmacro).body) { + strcpy(context->error_msg, "out of memory"); return -1; } @@ -301,6 +314,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, if (macro->num_args == 0) { skip_whitespace(input, pi); if (input[*pi].token != SL_PP_RPAREN) { + strcpy(context->error_msg, "expected `)'"); return -1; } (*pi)++; @@ -310,6 +324,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, switch (macro->body[j].token) { case SL_PP_NEWLINE: if (sl_pp_process_out(state, ¯o->body[j])) { + strcpy(context->error_msg, "out of memory"); return -1; } j++; @@ -328,6 +343,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, default: if (!mute) { if (sl_pp_process_out(state, ¯o->body[j])) { + strcpy(context->error_msg, "out of memory"); return -1; } } diff --git a/src/glsl/pp/sl_pp_pragma.c b/src/glsl/pp/sl_pp_pragma.c index 059bc6f2886..1cd9fd82348 100644 --- a/src/glsl/pp/sl_pp_pragma.c +++ b/src/glsl/pp/sl_pp_pragma.c @@ -99,6 +99,7 @@ sl_pp_process_pragma(struct sl_pp_context *context, /* Ignore the tokens that follow. */ if (sl_pp_process_out(state, &out)) { + strcpy(context->error_msg, "out of memory"); return -1; } diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 82acdd1d5a4..6cd63f4925c 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -25,34 +25,10 @@ * **************************************************************************/ +#include #include "sl_pp_version.h" -static int -_parse_integer(const char *input, - unsigned int *number) -{ - unsigned int n = 0; - - while (*input >= '0' && *input <= '9') { - if (n * 10 < n) { - /* Overflow. */ - return -1; - } - - n = n * 10 + (*input++ - '0'); - } - - if (*input != '\0') { - /* Invalid decimal number. */ - return -1; - } - - *number = n; - return 0; -} - - int sl_pp_version(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -130,19 +106,9 @@ sl_pp_version(struct sl_pp_context *context, break; case SL_PP_NUMBER: - { - const char *num = sl_pp_context_cstr(context, input[i].data.number); - - if (!num) { - return -1; - } - if (_parse_integer(num, version)) { - strcpy(context->error_msg, "expected version number after `#version'"); - return -1; - } - i++; - found_number = 1; - } + *version = atoi(sl_pp_context_cstr(context, input[i].data.number)); + i++; + found_number = 1; break; default: -- cgit v1.2.3 From ce8f486156f5c4b28b51954ea862675275c38f6d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 12:12:34 +0200 Subject: slang/pp: Use a dictionary for the remaining string literals. --- src/glsl/pp/sl_pp_dict.c | 27 +++++++++++++++++++++++++++ src/glsl/pp/sl_pp_dict.h | 27 +++++++++++++++++++++++++++ src/glsl/pp/sl_pp_if.c | 24 ++++++++++-------------- src/glsl/pp/sl_pp_macro.c | 8 +++----- src/glsl/pp/sl_pp_pragma.c | 20 ++++++++++---------- src/glsl/pp/sl_pp_process.c | 28 ++++++++++++++-------------- src/glsl/pp/sl_pp_version.c | 15 ++++----------- 7 files changed, 95 insertions(+), 54 deletions(-) diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index 65b91d9e989..f2885c763d7 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -52,5 +52,32 @@ sl_pp_dict_init(struct sl_pp_context *context) ADD_NAME(context, warn); ADD_NAME(context, disable); + ADD_NAME(context, defined); + + ADD_NAME_STR(context, ___LINE__, "__LINE__"); + ADD_NAME_STR(context, ___FILE__, "__FILE__"); + ADD_NAME(context, __VERSION__); + + ADD_NAME(context, optimize); + ADD_NAME(context, debug); + + ADD_NAME(context, off); + ADD_NAME(context, on); + + ADD_NAME(context, define); + ADD_NAME(context, elif); + ADD_NAME_STR(context, _else, "else"); + ADD_NAME(context, endif); + ADD_NAME(context, error); + ADD_NAME(context, extension); + ADD_NAME_STR(context, _if, "if"); + ADD_NAME(context, ifdef); + ADD_NAME(context, ifndef); + ADD_NAME(context, line); + ADD_NAME(context, pragma); + ADD_NAME(context, undef); + + ADD_NAME(context, version); + return 0; } diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h index ce138d98f51..ba82b389b23 100644 --- a/src/glsl/pp/sl_pp_dict.h +++ b/src/glsl/pp/sl_pp_dict.h @@ -37,6 +37,33 @@ struct sl_pp_dict { int enable; int warn; int disable; + + int defined; + + int ___LINE__; + int ___FILE__; + int __VERSION__; + + int optimize; + int debug; + + int off; + int on; + + int define; + int elif; + int _else; + int endif; + int error; + int extension; + int _if; + int ifdef; + int ifndef; + int line; + int pragma; + int undef; + + int version; }; diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index 44bbefa3577..cf1c746d5f6 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -136,20 +136,16 @@ _parse_if(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - { - const char *id = sl_pp_context_cstr(context, input[i].data.identifier); - - if (!strcmp(id, "defined")) { - i++; - if (_parse_defined(context, input, &i, &state)) { - free(state.out); - return -1; - } - } else { - if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { - free(state.out); - return -1; - } + if (input[i].data.identifier == context->dict.defined) { + i++; + if (_parse_defined(context, input, &i, &state)) { + free(state.out); + return -1; + } + } else { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + free(state.out); + return -1; } } break; diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 7793562781f..6772100847b 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -124,7 +124,6 @@ sl_pp_macro_expand(struct sl_pp_context *context, int mute) { int macro_name; - const char *macro_str; struct sl_pp_macro *macro = NULL; struct sl_pp_macro *actual_arg = NULL; unsigned int j; @@ -135,23 +134,22 @@ sl_pp_macro_expand(struct sl_pp_context *context, } macro_name = input[*pi].data.identifier; - macro_str = sl_pp_context_cstr(context, macro_name); - if (!strcmp(macro_str, "__LINE__")) { + if (macro_name == context->dict.___LINE__) { if (!mute && _out_number(context, state, context->line)) { return -1; } (*pi)++; return 0; } - if (!strcmp(macro_str, "__FILE__")) { + if (macro_name == context->dict.___FILE__) { if (!mute && _out_number(context, state, context->file)) { return -1; } (*pi)++; return 0; } - if (!strcmp(macro_str, "__VERSION__")) { + if (macro_name == context->dict.__VERSION__) { if (!mute && _out_number(context, state, 110)) { return -1; } diff --git a/src/glsl/pp/sl_pp_pragma.c b/src/glsl/pp/sl_pp_pragma.c index 1cd9fd82348..03269b63db7 100644 --- a/src/glsl/pp/sl_pp_pragma.c +++ b/src/glsl/pp/sl_pp_pragma.c @@ -36,21 +36,21 @@ sl_pp_process_pragma(struct sl_pp_context *context, unsigned int last, struct sl_pp_process_state *state) { - const char *pragma_name = NULL; + int pragma_name = -1; struct sl_pp_token_info out; - const char *arg_name = NULL; + int arg_name = -1; if (first < last && input[first].token == SL_PP_IDENTIFIER) { - pragma_name = sl_pp_context_cstr(context, input[first].data.identifier); + pragma_name = input[first].data.identifier; first++; } - if (!pragma_name) { + if (pragma_name == -1) { return 0; } - if (!strcmp(pragma_name, "optimize")) { + if (pragma_name == context->dict.optimize) { out.token = SL_PP_PRAGMA_OPTIMIZE; - } else if (!strcmp(pragma_name, "debug")) { + } else if (pragma_name == context->dict.debug) { out.token = SL_PP_PRAGMA_DEBUG; } else { return 0; @@ -71,16 +71,16 @@ sl_pp_process_pragma(struct sl_pp_context *context, } if (first < last && input[first].token == SL_PP_IDENTIFIER) { - arg_name = sl_pp_context_cstr(context, input[first].data.identifier); + arg_name = input[first].data.identifier; first++; } - if (!arg_name) { + if (arg_name == -1) { return 0; } - if (!strcmp(arg_name, "off")) { + if (arg_name == context->dict.off) { out.data.pragma = 0; - } else if (!strcmp(arg_name, "on")) { + } else if (arg_name == context->dict.on) { out.data.pragma = 1; } else { return 0; diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 03a3051838f..ab2f2d8eb45 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -100,14 +100,14 @@ sl_pp_process(struct sl_pp_context *context, switch (input[i].token) { case SL_PP_IDENTIFIER: { - const char *name; + int name; int found_eol = 0; unsigned int first; unsigned int last; struct sl_pp_token_info endof; /* Directive name. */ - name = sl_pp_context_cstr(context, input[i].data.identifier); + name = input[i].data.identifier; i++; skip_whitespace(input, &i); @@ -136,51 +136,51 @@ sl_pp_process(struct sl_pp_context *context, last = i - 1; - if (!strcmp(name, "if")) { + if (name == context->dict._if) { if (sl_pp_process_if(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "ifdef")) { + } else if (name == context->dict.ifdef) { if (sl_pp_process_ifdef(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "ifndef")) { + } else if (name == context->dict.ifndef) { if (sl_pp_process_ifndef(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "elif")) { + } else if (name == context->dict.elif) { if (sl_pp_process_elif(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "else")) { + } else if (name == context->dict._else) { if (sl_pp_process_else(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "endif")) { + } else if (name == context->dict.endif) { if (sl_pp_process_endif(context, input, first, last)) { return -1; } } else if (context->if_value) { - if (!strcmp(name, "define")) { + if (name == context->dict.define) { if (sl_pp_process_define(context, input, first, last)) { return -1; } - } else if (!strcmp(name, "error")) { + } else if (name == context->dict.error) { sl_pp_process_error(context, input, first, last); return -1; - } else if (!strcmp(name, "extension")) { + } else if (name == context->dict.extension) { if (sl_pp_process_extension(context, input, first, last, &state)) { return -1; } - } else if (!strcmp(name, "line")) { + } else if (name == context->dict.line) { if (sl_pp_process_line(context, input, first, last, &state)) { return -1; } - } else if (!strcmp(name, "pragma")) { + } else if (name == context->dict.pragma) { if (sl_pp_process_pragma(context, input, first, last, &state)) { return -1; } - } else if (!strcmp(name, "undef")) { + } else if (name == context->dict.undef) { if (sl_pp_process_undef(context, input, first, last)) { return -1; } diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 6cd63f4925c..814da46a672 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -79,18 +79,11 @@ sl_pp_version(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - { - const char *id = sl_pp_context_cstr(context, input[i].data.identifier); - - if (!id) { - return -1; - } - if (strcmp(id, "version")) { - return 0; - } - i++; - found_version = 1; + if (input[i].data.identifier != context->dict.version) { + return 0; } + i++; + found_version = 1; break; default: -- cgit v1.2.3 From 4fcda5000eed29b7c2ba70506ae34b209239eec6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 12:14:12 +0200 Subject: slang/pp: Fix file number parsing. --- src/glsl/pp/sl_pp_line.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index c38f4b0f2e6..504c20ebcdd 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -110,7 +110,7 @@ sl_pp_process_line(struct sl_pp_context *context, if (file_number != -1) { unsigned int file; - file_number = atoi(sl_pp_context_cstr(context, file_number)); + file = atoi(sl_pp_context_cstr(context, file_number)); if (context->file != file) { struct sl_pp_token_info ti; -- cgit v1.2.3 From 90daefd1c474a6e0502df5053b581987c12b8673 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 17 Sep 2009 12:33:26 +0200 Subject: glsl/pp: Add a TODO for FEATURE_es2_glsl. --- src/glsl/pp/sl_pp_macro.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 6772100847b..878b22ed9c3 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -157,6 +157,11 @@ sl_pp_macro_expand(struct sl_pp_context *context, return 0; } + /* TODO: For FEATURE_es2_glsl, expand to 1 the following symbols. + * GL_ES + * GL_FRAGMENT_PRECISION_HIGH + */ + if (local) { for (macro = local; macro; macro = macro->next) { if (macro->name == macro_name) { -- cgit v1.2.3 From 95956bb8cb9513c429b9749426720be94f4cf5a8 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 18 Sep 2009 11:19:25 +0200 Subject: glsl/pp: Define a public interface for external modules. Make sl_pp_context struct opaque. Move all public declarations to sl_pp_public.h. --- src/glsl/pp/sl_pp_context.c | 29 ++++++++++++++++----- src/glsl/pp/sl_pp_context.h | 10 ------- src/glsl/pp/sl_pp_line.c | 1 + src/glsl/pp/sl_pp_process.h | 5 ---- src/glsl/pp/sl_pp_public.h | 63 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/pp/sl_pp_token.c | 1 + src/glsl/pp/sl_pp_token.h | 2 -- src/glsl/pp/sl_pp_version.c | 3 ++- src/glsl/pp/sl_pp_version.h | 41 ----------------------------- 9 files changed, 89 insertions(+), 66 deletions(-) create mode 100644 src/glsl/pp/sl_pp_public.h delete mode 100644 src/glsl/pp/sl_pp_version.h diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index b196d8102a0..fd205de5d32 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -26,17 +26,23 @@ **************************************************************************/ #include +#include "sl_pp_public.h" #include "sl_pp_context.h" -int -sl_pp_context_init(struct sl_pp_context *context) +struct sl_pp_context * +sl_pp_context_create(void) { - memset(context, 0, sizeof(struct sl_pp_context)); + struct sl_pp_context *context; + + context = calloc(1, sizeof(struct sl_pp_context)); + if (!context) { + return NULL; + } if (sl_pp_dict_init(context)) { sl_pp_context_destroy(context); - return -1; + return NULL; } context->macro_tail = &context->macro; @@ -46,14 +52,23 @@ sl_pp_context_init(struct sl_pp_context *context) context->line = 1; context->file = 0; - return 0; + return context; } void sl_pp_context_destroy(struct sl_pp_context *context) { - free(context->cstr_pool); - sl_pp_macro_free(context->macro); + if (context) { + free(context->cstr_pool); + sl_pp_macro_free(context->macro); + free(context); + } +} + +const char * +sl_pp_context_error_message(const struct sl_pp_context *context) +{ + return context->error_msg; } int diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 8bed1420454..6b8cc2f960d 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -55,18 +55,8 @@ struct sl_pp_context { unsigned int file; }; -int -sl_pp_context_init(struct sl_pp_context *context); - -void -sl_pp_context_destroy(struct sl_pp_context *context); - int sl_pp_context_add_unique_str(struct sl_pp_context *context, const char *str); -const char * -sl_pp_context_cstr(const struct sl_pp_context *context, - int offset); - #endif /* SL_PP_CONTEXT_H */ diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 504c20ebcdd..cab0262686c 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include "sl_pp_public.h" #include "sl_pp_process.h" diff --git a/src/glsl/pp/sl_pp_process.h b/src/glsl/pp/sl_pp_process.h index adc08c18ae3..24311bab603 100644 --- a/src/glsl/pp/sl_pp_process.h +++ b/src/glsl/pp/sl_pp_process.h @@ -39,11 +39,6 @@ struct sl_pp_process_state { unsigned int out_max; }; -int -sl_pp_process(struct sl_pp_context *context, - const struct sl_pp_token_info *input, - struct sl_pp_token_info **output); - int sl_pp_process_define(struct sl_pp_context *context, const struct sl_pp_token_info *input, diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h new file mode 100644 index 00000000000..b1d92d02a7a --- /dev/null +++ b/src/glsl/pp/sl_pp_public.h @@ -0,0 +1,63 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_PP_PUBLIC_H +#define SL_PP_PUBLIC_H + + +struct sl_pp_context; + + +#include "sl_pp_purify.h" +#include "sl_pp_token.h" + + +struct sl_pp_context * +sl_pp_context_create(void); + +void +sl_pp_context_destroy(struct sl_pp_context *context); + +const char * +sl_pp_context_error_message(const struct sl_pp_context *context); + +const char * +sl_pp_context_cstr(const struct sl_pp_context *context, + int offset); + +int +sl_pp_version(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int *version, + unsigned int *tokens_eaten); + +int +sl_pp_process(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + struct sl_pp_token_info **output); + +#endif /* SL_PP_PUBLIC_H */ diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index a6a2bb27485..3a7ffe7db15 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include "sl_pp_context.h" #include "sl_pp_token.h" diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 59019593839..4131be6bdad 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -28,8 +28,6 @@ #ifndef SL_PP_TOKEN_H #define SL_PP_TOKEN_H -#include "sl_pp_context.h" - enum sl_pp_token { SL_PP_WHITESPACE, diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 814da46a672..825967d4c10 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -26,7 +26,8 @@ **************************************************************************/ #include -#include "sl_pp_version.h" +#include "sl_pp_public.h" +#include "sl_pp_context.h" int diff --git a/src/glsl/pp/sl_pp_version.h b/src/glsl/pp/sl_pp_version.h deleted file mode 100644 index cee9f55bc6c..00000000000 --- a/src/glsl/pp/sl_pp_version.h +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************** - * - * Copyright 2009 VMware, Inc. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - -#ifndef SL_PP_VERSION_H -#define SL_PP_VERSION_H - -#include "sl_pp_context.h" -#include "sl_pp_token.h" - - -int -sl_pp_version(struct sl_pp_context *context, - const struct sl_pp_token_info *input, - unsigned int *version, - unsigned int *tokens_eaten); - -#endif /* SL_PP_VERSION_H */ -- cgit v1.2.3 From 8302208b02739904cfeb5bcc22e63b15c8ec26e9 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 18 Sep 2009 11:19:54 +0200 Subject: slang: Use glsl pp public interface. --- src/mesa/shader/slang/slang_compile.c | 34 ++++++++++++++++------------------ 1 file changed, 16 insertions(+), 18 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 19fec53877f..fb452e5d2c5 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -36,10 +36,7 @@ #include "shader/prog_print.h" #include "shader/prog_parameter.h" #include "shader/grammar/grammar_mesa.h" -#include "../../glsl/pp/sl_pp_context.h" -#include "../../glsl/pp/sl_pp_purify.h" -#include "../../glsl/pp/sl_pp_version.h" -#include "../../glsl/pp/sl_pp_process.h" +#include "../../glsl/pp/sl_pp_public.h" #include "slang_codegen.h" #include "slang_compile.h" #include "slang_storage.h" @@ -2583,7 +2580,7 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, const struct gl_extensions *extensions, struct gl_sl_pragmas *pragmas) { - struct sl_pp_context context; + struct sl_pp_context *context; struct sl_pp_token_info *tokens; byte *prod; GLuint size; @@ -2601,31 +2598,32 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, return GL_FALSE; } - if (sl_pp_context_init(&context)) { + context = sl_pp_context_create(); + if (!context) { slang_info_log_error(infolog, "out of memory"); free(outbuf); return GL_FALSE; } - if (sl_pp_tokenise(&context, outbuf, &intokens)) { - slang_info_log_error(infolog, "%s", context.error_msg); - sl_pp_context_destroy(&context); + if (sl_pp_tokenise(context, outbuf, &intokens)) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); free(outbuf); return GL_FALSE; } free(outbuf); - if (sl_pp_version(&context, intokens, &version, &tokens_eaten)) { - slang_info_log_error(infolog, "%s", context.error_msg); - sl_pp_context_destroy(&context); + if (sl_pp_version(context, intokens, &version, &tokens_eaten)) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); free(intokens); return GL_FALSE; } - if (sl_pp_process(&context, &intokens[tokens_eaten], &tokens)) { - slang_info_log_error(infolog, "%s", context.error_msg); - sl_pp_context_destroy(&context); + if (sl_pp_process(context, &intokens[tokens_eaten], &tokens)) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); free(intokens); return GL_FALSE; } @@ -2711,15 +2709,15 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, slang_info_log_error(infolog, "language version %.2f is not supported.", version * 0.01); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); return GL_FALSE; } /* Finally check the syntax and generate its binary representation. */ - result = grammar_fast_check(id, &context, tokens, &prod, &size, 65536); + result = grammar_fast_check(id, context, tokens, &prod, &size, 65536); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); if (!result) { -- cgit v1.2.3 From 5f9f30a75268bf6803627930ce982aede2c870f5 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 18 Sep 2009 11:20:42 +0200 Subject: glsl/apps: Use glsl pp public interface. --- src/glsl/apps/process.c | 42 ++++++++++++++++++++---------------------- src/glsl/apps/purify.c | 2 +- src/glsl/apps/tokenise.c | 21 ++++++++++----------- src/glsl/apps/version.c | 22 +++++++++++----------- 4 files changed, 42 insertions(+), 45 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 678b1005f89..1fdb09670cc 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -28,10 +28,7 @@ #include #include #include -#include "../pp/sl_pp_context.h" -#include "../pp/sl_pp_purify.h" -#include "../pp/sl_pp_version.h" -#include "../pp/sl_pp_process.h" +#include "../pp/sl_pp_public.h" int @@ -43,7 +40,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; - struct sl_pp_context context; + struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; unsigned int tokens_eaten; @@ -103,7 +100,8 @@ main(int argc, free(inbuf); - if (sl_pp_context_init(&context)) { + context = sl_pp_context_create(); + if (!context) { fprintf(out, "$CONTEXERROR\n"); free(outbuf); @@ -111,10 +109,10 @@ main(int argc, return 1; } - if (sl_pp_tokenise(&context, outbuf, &tokens)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_tokenise(context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(outbuf); fclose(out); return 1; @@ -122,19 +120,19 @@ main(int argc, free(outbuf); - if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fclose(out); return -1; } - if (sl_pp_process(&context, &tokens[tokens_eaten], &outtokens)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fclose(out); return -1; @@ -329,11 +327,11 @@ main(int argc, break; case SL_PP_IDENTIFIER: - fprintf(out, "%s ", sl_pp_context_cstr(&context, outtokens[i].data.identifier)); + fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data.identifier)); break; case SL_PP_NUMBER: - fprintf(out, "%s ", sl_pp_context_cstr(&context, outtokens[i].data.number)); + fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data.number)); break; case SL_PP_OTHER: @@ -349,19 +347,19 @@ main(int argc, break; case SL_PP_EXTENSION_REQUIRE: - fprintf(out, "#extension %s : require", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + fprintf(out, "#extension %s : require", sl_pp_context_cstr(context, outtokens[i].data.extension)); break; case SL_PP_EXTENSION_ENABLE: - fprintf(out, "#extension %s : enable", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + fprintf(out, "#extension %s : enable", sl_pp_context_cstr(context, outtokens[i].data.extension)); break; case SL_PP_EXTENSION_WARN: - fprintf(out, "#extension %s : warn", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + fprintf(out, "#extension %s : warn", sl_pp_context_cstr(context, outtokens[i].data.extension)); break; case SL_PP_EXTENSION_DISABLE: - fprintf(out, "#extension %s : disable", sl_pp_context_cstr(&context, outtokens[i].data.extension)); + fprintf(out, "#extension %s : disable", sl_pp_context_cstr(context, outtokens[i].data.extension)); break; case SL_PP_LINE: @@ -377,7 +375,7 @@ main(int argc, } } - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(outtokens); fclose(out); diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index d4c53704e54..435bdbe5145 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -27,7 +27,7 @@ #include #include -#include "../pp/sl_pp_purify.h" +#include "../pp/sl_pp_public.h" int diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 1746e20c13b..2b3ebcf283d 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -28,9 +28,7 @@ #include #include #include -#include "../pp/sl_pp_context.h" -#include "../pp/sl_pp_purify.h" -#include "../pp/sl_pp_token.h" +#include "../pp/sl_pp_public.h" int @@ -42,7 +40,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; - struct sl_pp_context context; + struct sl_pp_context *context; struct sl_pp_token_info *tokens; FILE *out; unsigned int i; @@ -99,7 +97,8 @@ main(int argc, free(inbuf); - if (sl_pp_context_init(&context)) { + context = sl_pp_context_create(); + if (!context) { fprintf(out, "$CONTEXERROR\n"); free(outbuf); @@ -107,10 +106,10 @@ main(int argc, return 1; } - if (sl_pp_tokenise(&context, outbuf, &tokens)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_tokenise(context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(outbuf); fclose(out); return 1; @@ -312,11 +311,11 @@ main(int argc, break; case SL_PP_IDENTIFIER: - fprintf(out, "%s ", sl_pp_context_cstr(&context, tokens[i].data.identifier)); + fprintf(out, "%s ", sl_pp_context_cstr(context, tokens[i].data.identifier)); break; case SL_PP_NUMBER: - fprintf(out, "(%s) ", sl_pp_context_cstr(&context, tokens[i].data.number)); + fprintf(out, "(%s) ", sl_pp_context_cstr(context, tokens[i].data.number)); break; case SL_PP_OTHER: @@ -332,7 +331,7 @@ main(int argc, } } - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fclose(out); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 50c564b470b..f2594319921 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -28,8 +28,7 @@ #include #include #include -#include "../pp/sl_pp_purify.h" -#include "../pp/sl_pp_version.h" +#include "../pp/sl_pp_public.h" int @@ -41,7 +40,7 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; - struct sl_pp_context context; + struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; unsigned int tokens_eaten; @@ -99,7 +98,8 @@ main(int argc, free(inbuf); - if (sl_pp_context_init(&context)) { + context = sl_pp_context_create(); + if (!context) { fprintf(out, "$CONTEXERROR\n"); free(outbuf); @@ -107,10 +107,10 @@ main(int argc, return 1; } - if (sl_pp_tokenise(&context, outbuf, &tokens)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_tokenise(context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(outbuf); fclose(out); return 1; @@ -118,16 +118,16 @@ main(int argc, free(outbuf); - if (sl_pp_version(&context, tokens, &version, &tokens_eaten)) { - fprintf(out, "$ERROR: `%s'\n", context.error_msg); + if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fclose(out); return -1; } - sl_pp_context_destroy(&context); + sl_pp_context_destroy(context); free(tokens); fprintf(out, -- cgit v1.2.3 From bb32b0908ff0d3a99758abd46356676fc1ec2369 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 18 Sep 2009 11:42:30 +0200 Subject: progs/perf: Fix newlines. --- progs/perf/drawoverhead.c | 266 +++++++++++------------ progs/perf/teximage.c | 420 +++++++++++++++++------------------ progs/perf/vbo.c | 276 +++++++++++------------ progs/perf/vertexrate.c | 542 +++++++++++++++++++++++----------------------- 4 files changed, 752 insertions(+), 752 deletions(-) diff --git a/progs/perf/drawoverhead.c b/progs/perf/drawoverhead.c index 8c99804d342..36d756b6bc3 100644 --- a/progs/perf/drawoverhead.c +++ b/progs/perf/drawoverhead.c @@ -1,133 +1,133 @@ -/* - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Measure drawing overhead - * - * This is the first in a series of simple performance benchmarks. - * The code in this file should be as simple as possible to make it - * easily portable to other APIs. - * - * All the window-system stuff should be contained in glmain.c (or TBDmain.c). - * All the re-usable, generic code should be in common.c (XXX not done yet). - * - * Brian Paul - * 15 Sep 2009 - */ - -#include "glmain.h" -#include "common.h" - - -int WinWidth = 100, WinHeight = 100; - -static GLuint VBO; - -struct vertex -{ - GLfloat x, y; -}; - -static const struct vertex vertices[4] = { - { -1.0, -1.0 }, - { 1.0, -1.0 }, - { 1.0, 1.0 }, - { -1.0, 1.0 } -}; - - -/** Called from test harness/main */ -void -PerfInit(void) -{ - /* setup VBO w/ vertex data */ - glGenBuffersARB(1, &VBO); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, - sizeof(vertices), vertices, GL_STATIC_DRAW_ARB); - glVertexPointer(2, GL_FLOAT, sizeof(struct vertex), (void *) 0); - glEnableClientState(GL_VERTEX_ARRAY); - - /* misc GL state */ - glAlphaFunc(GL_ALWAYS, 0.0); -} - - -static void -DrawNoStateChange(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - glDrawArrays(GL_POINTS, 0, 4); - } - glFinish(); -} - - -static void -DrawNopStateChange(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - glDisable(GL_ALPHA_TEST); - glDrawArrays(GL_POINTS, 0, 4); - } - glFinish(); -} - - -static void -DrawStateChange(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - if (i & 1) - glEnable(GL_TEXTURE_GEN_S); - else - glDisable(GL_TEXTURE_GEN_S); - glDrawArrays(GL_POINTS, 0, 4); - } - glFinish(); -} - - -/** Called from test harness/main */ -void -PerfDraw(void) -{ - double rate0, rate1, rate2, overhead; - - rate0 = PerfMeasureRate(DrawNoStateChange); - printf(" Draw only: %.1f draws/second\n", rate0); - - rate1 = PerfMeasureRate(DrawNopStateChange); - overhead = 1000.0 * (1.0 / rate1 - 1.0 / rate0); - printf(" Draw w/ nop state change: %.1f draws/sec (overhead: %f ms/draw)\n", - rate1, overhead); - - rate2 = PerfMeasureRate(DrawStateChange); - overhead = 1000.0 * (1.0 / rate2 - 1.0 / rate0); - printf(" Draw w/ state change: %.1f draws/sec (overhead: %f ms/draw)\n", - rate2, overhead); - - exit(0); -} - +/* + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Measure drawing overhead + * + * This is the first in a series of simple performance benchmarks. + * The code in this file should be as simple as possible to make it + * easily portable to other APIs. + * + * All the window-system stuff should be contained in glmain.c (or TBDmain.c). + * All the re-usable, generic code should be in common.c (XXX not done yet). + * + * Brian Paul + * 15 Sep 2009 + */ + +#include "glmain.h" +#include "common.h" + + +int WinWidth = 100, WinHeight = 100; + +static GLuint VBO; + +struct vertex +{ + GLfloat x, y; +}; + +static const struct vertex vertices[4] = { + { -1.0, -1.0 }, + { 1.0, -1.0 }, + { 1.0, 1.0 }, + { -1.0, 1.0 } +}; + + +/** Called from test harness/main */ +void +PerfInit(void) +{ + /* setup VBO w/ vertex data */ + glGenBuffersARB(1, &VBO); + glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, + sizeof(vertices), vertices, GL_STATIC_DRAW_ARB); + glVertexPointer(2, GL_FLOAT, sizeof(struct vertex), (void *) 0); + glEnableClientState(GL_VERTEX_ARRAY); + + /* misc GL state */ + glAlphaFunc(GL_ALWAYS, 0.0); +} + + +static void +DrawNoStateChange(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + glDrawArrays(GL_POINTS, 0, 4); + } + glFinish(); +} + + +static void +DrawNopStateChange(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + glDisable(GL_ALPHA_TEST); + glDrawArrays(GL_POINTS, 0, 4); + } + glFinish(); +} + + +static void +DrawStateChange(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + if (i & 1) + glEnable(GL_TEXTURE_GEN_S); + else + glDisable(GL_TEXTURE_GEN_S); + glDrawArrays(GL_POINTS, 0, 4); + } + glFinish(); +} + + +/** Called from test harness/main */ +void +PerfDraw(void) +{ + double rate0, rate1, rate2, overhead; + + rate0 = PerfMeasureRate(DrawNoStateChange); + printf(" Draw only: %.1f draws/second\n", rate0); + + rate1 = PerfMeasureRate(DrawNopStateChange); + overhead = 1000.0 * (1.0 / rate1 - 1.0 / rate0); + printf(" Draw w/ nop state change: %.1f draws/sec (overhead: %f ms/draw)\n", + rate1, overhead); + + rate2 = PerfMeasureRate(DrawStateChange); + overhead = 1000.0 * (1.0 / rate2 - 1.0 / rate0); + printf(" Draw w/ state change: %.1f draws/sec (overhead: %f ms/draw)\n", + rate2, overhead); + + exit(0); +} + diff --git a/progs/perf/teximage.c b/progs/perf/teximage.c index b6d4f644dec..a0ce2604e0d 100644 --- a/progs/perf/teximage.c +++ b/progs/perf/teximage.c @@ -1,210 +1,210 @@ -/* - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Measure glTexSubImage2D rate - * - * Brian Paul - * 16 Sep 2009 - */ - -#include "glmain.h" -#include "common.h" - - -int WinWidth = 100, WinHeight = 100; - -static GLuint VBO; -static GLuint TexObj = 0; -static GLubyte *TexImage = NULL; -static GLsizei TexSize; -static GLenum TexSrcFormat, TexSrcType; - -static const GLboolean DrawPoint = GL_TRUE; -static const GLboolean TexSubImage4 = GL_TRUE; - -struct vertex -{ - GLfloat x, y, s, t; -}; - -static const struct vertex vertices[1] = { - { 0.0, 0.0, 0.5, 0.5 }, -}; - - -#define VOFFSET(F) ((void *) offsetof(struct vertex, F)) - -/** Called from test harness/main */ -void -PerfInit(void) -{ - /* setup VBO w/ vertex data */ - glGenBuffersARB(1, &VBO); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, - sizeof(vertices), vertices, GL_STATIC_DRAW_ARB); - glVertexPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(x)); - glTexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(s)); - glEnableClientState(GL_VERTEX_ARRAY); - glEnableClientState(GL_TEXTURE_COORD_ARRAY); - - /* texture */ - glGenTextures(1, &TexObj); - glBindTexture(GL_TEXTURE_2D, TexObj); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); - glEnable(GL_TEXTURE_2D); -} - - -static void -UploadTexImage2D(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - /* XXX is this equivalent to a glTexSubImage call since we're - * always specifying the same image size? That case isn't optimized - * in Mesa but may be optimized in other drivers. Note sure how - * much difference that might make. - */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - TexSize, TexSize, 0, - TexSrcFormat, TexSrcType, TexImage); - if (DrawPoint) - glDrawArrays(GL_POINTS, 0, 1); - } - glFinish(); -} - - -static void -UploadTexSubImage2D(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - if (TexSubImage4) { - GLsizei halfSize = (TexSize == 1) ? 1 : TexSize / 2; - GLsizei halfPos = TexSize - halfSize; - /* do glTexSubImage2D in four pieces */ - /* lower-left */ - glPixelStorei(GL_UNPACK_ROW_LENGTH, TexSize); - glTexSubImage2D(GL_TEXTURE_2D, 0, - 0, 0, halfSize, halfSize, - TexSrcFormat, TexSrcType, TexImage); - /* lower-right */ - glPixelStorei(GL_UNPACK_SKIP_PIXELS, halfPos); - glTexSubImage2D(GL_TEXTURE_2D, 0, - halfPos, 0, halfSize, halfSize, - TexSrcFormat, TexSrcType, TexImage); - /* upper-left */ - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, halfPos); - glTexSubImage2D(GL_TEXTURE_2D, 0, - 0, halfPos, halfSize, halfSize, - TexSrcFormat, TexSrcType, TexImage); - /* upper-right */ - glPixelStorei(GL_UNPACK_SKIP_PIXELS, halfPos); - glPixelStorei(GL_UNPACK_SKIP_ROWS, halfPos); - glTexSubImage2D(GL_TEXTURE_2D, 0, - halfPos, halfPos, halfSize, halfSize, - TexSrcFormat, TexSrcType, TexImage); - /* reset the unpacking state */ - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); - glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); - } - else { - /* replace whole texture image at once */ - glTexSubImage2D(GL_TEXTURE_2D, 0, - 0, 0, TexSize, TexSize, - TexSrcFormat, TexSrcType, TexImage); - } - if (DrawPoint) - glDrawArrays(GL_POINTS, 0, 1); - } - glFinish(); -} - - -/* XXX any other formats to measure? */ -static const struct { - GLenum format, type; - const char *name; -} SrcFormats[] = { - { GL_RGBA, GL_UNSIGNED_BYTE, "GL_RGBA/GLubyte" }, - { GL_BGRA, GL_UNSIGNED_BYTE, "GL_BGRA/GLubyte" }, - { 0, 0, NULL } -}; - - - -/** Called from test harness/main */ -void -PerfDraw(void) -{ - GLint maxSize; - double rate; - GLint fmt, subImage; - - glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize); - - /* loop over source data formats */ - for (fmt = 0; SrcFormats[fmt].format; fmt++) { - TexSrcFormat = SrcFormats[fmt].format; - TexSrcType = SrcFormats[fmt].type; - - /* loop over glTexImage, glTexSubImage */ - for (subImage = 0; subImage < 2; subImage++) { - - /* loop over texture sizes */ - for (TexSize = 16; TexSize <= maxSize; TexSize *= 2) { - GLint bytesPerImage; - double mbPerSec; - - bytesPerImage = TexSize * TexSize * 4; - TexImage = malloc(bytesPerImage); - - if (subImage) { - /* create initial, empty texture */ - glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, - TexSize, TexSize, 0, - TexSrcFormat, TexSrcType, NULL); - rate = PerfMeasureRate(UploadTexSubImage2D); - } - else { - rate = PerfMeasureRate(UploadTexImage2D); - } - - mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0); - - printf(" glTex%sImage2D(%s %d x %d): " - "%.1f images/sec, %.1f MB/sec\n", - (subImage ? "Sub" : ""), - SrcFormats[fmt].name, TexSize, TexSize, rate, mbPerSec); - - free(TexImage); - } - } - } - - exit(0); -} +/* + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Measure glTexSubImage2D rate + * + * Brian Paul + * 16 Sep 2009 + */ + +#include "glmain.h" +#include "common.h" + + +int WinWidth = 100, WinHeight = 100; + +static GLuint VBO; +static GLuint TexObj = 0; +static GLubyte *TexImage = NULL; +static GLsizei TexSize; +static GLenum TexSrcFormat, TexSrcType; + +static const GLboolean DrawPoint = GL_TRUE; +static const GLboolean TexSubImage4 = GL_TRUE; + +struct vertex +{ + GLfloat x, y, s, t; +}; + +static const struct vertex vertices[1] = { + { 0.0, 0.0, 0.5, 0.5 }, +}; + + +#define VOFFSET(F) ((void *) offsetof(struct vertex, F)) + +/** Called from test harness/main */ +void +PerfInit(void) +{ + /* setup VBO w/ vertex data */ + glGenBuffersARB(1, &VBO); + glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, + sizeof(vertices), vertices, GL_STATIC_DRAW_ARB); + glVertexPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(x)); + glTexCoordPointer(2, GL_FLOAT, sizeof(struct vertex), VOFFSET(s)); + glEnableClientState(GL_VERTEX_ARRAY); + glEnableClientState(GL_TEXTURE_COORD_ARRAY); + + /* texture */ + glGenTextures(1, &TexObj); + glBindTexture(GL_TEXTURE_2D, TexObj); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + glEnable(GL_TEXTURE_2D); +} + + +static void +UploadTexImage2D(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + /* XXX is this equivalent to a glTexSubImage call since we're + * always specifying the same image size? That case isn't optimized + * in Mesa but may be optimized in other drivers. Note sure how + * much difference that might make. + */ + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, + TexSize, TexSize, 0, + TexSrcFormat, TexSrcType, TexImage); + if (DrawPoint) + glDrawArrays(GL_POINTS, 0, 1); + } + glFinish(); +} + + +static void +UploadTexSubImage2D(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + if (TexSubImage4) { + GLsizei halfSize = (TexSize == 1) ? 1 : TexSize / 2; + GLsizei halfPos = TexSize - halfSize; + /* do glTexSubImage2D in four pieces */ + /* lower-left */ + glPixelStorei(GL_UNPACK_ROW_LENGTH, TexSize); + glTexSubImage2D(GL_TEXTURE_2D, 0, + 0, 0, halfSize, halfSize, + TexSrcFormat, TexSrcType, TexImage); + /* lower-right */ + glPixelStorei(GL_UNPACK_SKIP_PIXELS, halfPos); + glTexSubImage2D(GL_TEXTURE_2D, 0, + halfPos, 0, halfSize, halfSize, + TexSrcFormat, TexSrcType, TexImage); + /* upper-left */ + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS, halfPos); + glTexSubImage2D(GL_TEXTURE_2D, 0, + 0, halfPos, halfSize, halfSize, + TexSrcFormat, TexSrcType, TexImage); + /* upper-right */ + glPixelStorei(GL_UNPACK_SKIP_PIXELS, halfPos); + glPixelStorei(GL_UNPACK_SKIP_ROWS, halfPos); + glTexSubImage2D(GL_TEXTURE_2D, 0, + halfPos, halfPos, halfSize, halfSize, + TexSrcFormat, TexSrcType, TexImage); + /* reset the unpacking state */ + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_SKIP_PIXELS, 0); + glPixelStorei(GL_UNPACK_SKIP_ROWS, 0); + } + else { + /* replace whole texture image at once */ + glTexSubImage2D(GL_TEXTURE_2D, 0, + 0, 0, TexSize, TexSize, + TexSrcFormat, TexSrcType, TexImage); + } + if (DrawPoint) + glDrawArrays(GL_POINTS, 0, 1); + } + glFinish(); +} + + +/* XXX any other formats to measure? */ +static const struct { + GLenum format, type; + const char *name; +} SrcFormats[] = { + { GL_RGBA, GL_UNSIGNED_BYTE, "GL_RGBA/GLubyte" }, + { GL_BGRA, GL_UNSIGNED_BYTE, "GL_BGRA/GLubyte" }, + { 0, 0, NULL } +}; + + + +/** Called from test harness/main */ +void +PerfDraw(void) +{ + GLint maxSize; + double rate; + GLint fmt, subImage; + + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &maxSize); + + /* loop over source data formats */ + for (fmt = 0; SrcFormats[fmt].format; fmt++) { + TexSrcFormat = SrcFormats[fmt].format; + TexSrcType = SrcFormats[fmt].type; + + /* loop over glTexImage, glTexSubImage */ + for (subImage = 0; subImage < 2; subImage++) { + + /* loop over texture sizes */ + for (TexSize = 16; TexSize <= maxSize; TexSize *= 2) { + GLint bytesPerImage; + double mbPerSec; + + bytesPerImage = TexSize * TexSize * 4; + TexImage = malloc(bytesPerImage); + + if (subImage) { + /* create initial, empty texture */ + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, + TexSize, TexSize, 0, + TexSrcFormat, TexSrcType, NULL); + rate = PerfMeasureRate(UploadTexSubImage2D); + } + else { + rate = PerfMeasureRate(UploadTexImage2D); + } + + mbPerSec = rate * bytesPerImage / (1024.0 * 1024.0); + + printf(" glTex%sImage2D(%s %d x %d): " + "%.1f images/sec, %.1f MB/sec\n", + (subImage ? "Sub" : ""), + SrcFormats[fmt].name, TexSize, TexSize, rate, mbPerSec); + + free(TexImage); + } + } + } + + exit(0); +} diff --git a/progs/perf/vbo.c b/progs/perf/vbo.c index 8545a33b7e3..dba7e4515ba 100644 --- a/progs/perf/vbo.c +++ b/progs/perf/vbo.c @@ -1,138 +1,138 @@ -/* - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Measure VBO upload speed. - * That is, measure glBufferDataARB() and glBufferSubDataARB(). - * - * Brian Paul - * 16 Sep 2009 - */ - -#include -#include "glmain.h" -#include "common.h" - - -int WinWidth = 100, WinHeight = 100; - -static GLuint VBO; - -static GLsizei VBOSize = 0; -static GLubyte *VBOData = NULL; - -static const GLboolean DrawPoint = GL_TRUE; -static const GLboolean BufferSubDataInHalves = GL_TRUE; - -static const GLfloat Vertex0[2] = { 0.0, 0.0 }; - - -/** Called from test harness/main */ -void -PerfInit(void) -{ - /* setup VBO */ - glGenBuffersARB(1, &VBO); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); - glVertexPointer(2, GL_FLOAT, sizeof(Vertex0), (void *) 0); - glEnableClientState(GL_VERTEX_ARRAY); -} - - -static void -UploadVBO(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - glBufferDataARB(GL_ARRAY_BUFFER, VBOSize, VBOData, GL_STREAM_DRAW_ARB); - - if (DrawPoint) - glDrawArrays(GL_POINTS, 0, 1); - } - glFinish(); -} - - -static void -UploadSubVBO(unsigned count) -{ - unsigned i; - for (i = 0; i < count; i++) { - if (BufferSubDataInHalves) { - GLsizei half = VBOSize / 2; - glBufferSubDataARB(GL_ARRAY_BUFFER, 0, half, VBOData); - glBufferSubDataARB(GL_ARRAY_BUFFER, half, half, VBOData + half); - } - else { - glBufferSubDataARB(GL_ARRAY_BUFFER, 0, VBOSize, VBOData); - } - - if (DrawPoint) - glDrawArrays(GL_POINTS, 0, 1); - } - glFinish(); -} - - -static const GLsizei Sizes[] = { - 64, - 1024, - 16*1024, - 256*1024, - 1024*1024, - 16*1024*1024, - 0 /* end of list */ -}; - - -/** Called from test harness/main */ -void -PerfDraw(void) -{ - double rate, mbPerSec; - int sub, sz; - - /* loop over whole/sub buffer upload */ - for (sub = 0; sub < 2; sub++) { - - /* loop over VBO sizes */ - for (sz = 0; Sizes[sz]; sz++) { - VBOSize = Sizes[sz]; - - VBOData = malloc(VBOSize); - memcpy(VBOData, Vertex0, sizeof(Vertex0)); - - if (sub) - rate = PerfMeasureRate(UploadSubVBO); - else - rate = PerfMeasureRate(UploadVBO); - - mbPerSec = rate * VBOSize / (1024.0 * 1024.0); - - printf(" glBuffer%sDataARB(size = %d): %.1f MB/sec\n", - (sub ? "Sub" : ""), VBOSize, mbPerSec); - - free(VBOData); - } - } - - exit(0); -} +/* + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Measure VBO upload speed. + * That is, measure glBufferDataARB() and glBufferSubDataARB(). + * + * Brian Paul + * 16 Sep 2009 + */ + +#include +#include "glmain.h" +#include "common.h" + + +int WinWidth = 100, WinHeight = 100; + +static GLuint VBO; + +static GLsizei VBOSize = 0; +static GLubyte *VBOData = NULL; + +static const GLboolean DrawPoint = GL_TRUE; +static const GLboolean BufferSubDataInHalves = GL_TRUE; + +static const GLfloat Vertex0[2] = { 0.0, 0.0 }; + + +/** Called from test harness/main */ +void +PerfInit(void) +{ + /* setup VBO */ + glGenBuffersARB(1, &VBO); + glBindBufferARB(GL_ARRAY_BUFFER_ARB, VBO); + glVertexPointer(2, GL_FLOAT, sizeof(Vertex0), (void *) 0); + glEnableClientState(GL_VERTEX_ARRAY); +} + + +static void +UploadVBO(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + glBufferDataARB(GL_ARRAY_BUFFER, VBOSize, VBOData, GL_STREAM_DRAW_ARB); + + if (DrawPoint) + glDrawArrays(GL_POINTS, 0, 1); + } + glFinish(); +} + + +static void +UploadSubVBO(unsigned count) +{ + unsigned i; + for (i = 0; i < count; i++) { + if (BufferSubDataInHalves) { + GLsizei half = VBOSize / 2; + glBufferSubDataARB(GL_ARRAY_BUFFER, 0, half, VBOData); + glBufferSubDataARB(GL_ARRAY_BUFFER, half, half, VBOData + half); + } + else { + glBufferSubDataARB(GL_ARRAY_BUFFER, 0, VBOSize, VBOData); + } + + if (DrawPoint) + glDrawArrays(GL_POINTS, 0, 1); + } + glFinish(); +} + + +static const GLsizei Sizes[] = { + 64, + 1024, + 16*1024, + 256*1024, + 1024*1024, + 16*1024*1024, + 0 /* end of list */ +}; + + +/** Called from test harness/main */ +void +PerfDraw(void) +{ + double rate, mbPerSec; + int sub, sz; + + /* loop over whole/sub buffer upload */ + for (sub = 0; sub < 2; sub++) { + + /* loop over VBO sizes */ + for (sz = 0; Sizes[sz]; sz++) { + VBOSize = Sizes[sz]; + + VBOData = malloc(VBOSize); + memcpy(VBOData, Vertex0, sizeof(Vertex0)); + + if (sub) + rate = PerfMeasureRate(UploadSubVBO); + else + rate = PerfMeasureRate(UploadVBO); + + mbPerSec = rate * VBOSize / (1024.0 * 1024.0); + + printf(" glBuffer%sDataARB(size = %d): %.1f MB/sec\n", + (sub ? "Sub" : ""), VBOSize, mbPerSec); + + free(VBOData); + } + } + + exit(0); +} diff --git a/progs/perf/vertexrate.c b/progs/perf/vertexrate.c index f7e02624cc9..d24a39195fe 100644 --- a/progs/perf/vertexrate.c +++ b/progs/perf/vertexrate.c @@ -1,271 +1,271 @@ -/* - * Copyright (C) 2009 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * Measure simple vertex processing rate via: - * - immediate mode - * - vertex arrays - * - VBO vertex arrays - * - glDrawElements - * - VBO glDrawElements - * - glDrawRangeElements - * - VBO glDrawRangeElements - * - * Brian Paul - * 16 Sep 2009 - */ - -#include -#include -#include "glmain.h" -#include "common.h" - - -#define MAX_VERTS (100 * 100) - -/** glVertex2/3/4 size */ -#define VERT_SIZE 4 - -int WinWidth = 500, WinHeight = 500; - -static GLuint VertexBO, ElementBO; - -static unsigned NumVerts = MAX_VERTS; -static unsigned VertBytes = VERT_SIZE * sizeof(float); -static float *VertexData = NULL; - -static unsigned NumElements = MAX_VERTS; -static GLuint *Elements = NULL; - - -/** - * Load VertexData buffer with a 2-D grid of points in the range [-1,1]^2. - */ -static void -InitializeVertexData(void) -{ - unsigned i; - float x = -1.0, y = -1.0; - float dx = 2.0 / 100; - float dy = 2.0 / 100; - - VertexData = (float *) malloc(NumVerts * VertBytes); - - for (i = 0; i < NumVerts; i++) { - VertexData[i * VERT_SIZE + 0] = x; - VertexData[i * VERT_SIZE + 1] = y; - VertexData[i * VERT_SIZE + 2] = 0.0; - VertexData[i * VERT_SIZE + 3] = 1.0; - x += dx; - if (x > 1.0) { - x = -1.0; - y += dy; - } - } - - Elements = (GLuint *) malloc(NumVerts * sizeof(GLuint)); - - for (i = 0; i < NumVerts; i++) { - Elements[i] = NumVerts - i - 1; - } -} - - -/** Called from test harness/main */ -void -PerfInit(void) -{ - InitializeVertexData(); - - /* setup VertexBO */ - glGenBuffersARB(1, &VertexBO); - glBindBufferARB(GL_ARRAY_BUFFER_ARB, VertexBO); - glBufferDataARB(GL_ARRAY_BUFFER_ARB, - NumVerts * VertBytes, VertexData, GL_STATIC_DRAW_ARB); - glEnableClientState(GL_VERTEX_ARRAY); - - /* setup ElementBO */ - glGenBuffersARB(1, &ElementBO); - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, ElementBO); - glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, - NumElements * sizeof(GLuint), Elements, GL_STATIC_DRAW_ARB); -} - - -static void -DrawImmediate(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBufferARB(GL_ARRAY_BUFFER, 0); - for (i = 0; i < count; i++) { - unsigned j; - glBegin(GL_POINTS); - for (j = 0; j < NumVerts; j++) { -#if VERT_SIZE == 4 - glVertex4fv(VertexData + j * 4); -#elif VERT_SIZE == 3 - glVertex3fv(VertexData + j * 3); -#elif VERT_SIZE == 2 - glVertex2fv(VertexData + j * 2); -#else - abort(); -#endif - } - glEnd(); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawArraysMem(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBufferARB(GL_ARRAY_BUFFER, 0); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); - for (i = 0; i < count; i++) { - glDrawArrays(GL_POINTS, 0, NumVerts); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawArraysVBO(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); - for (i = 0; i < count; i++) { - glDrawArrays(GL_POINTS, 0, NumVerts); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawElementsMem(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBufferARB(GL_ARRAY_BUFFER, 0); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); - for (i = 0; i < count; i++) { - glDrawElements(GL_POINTS, NumVerts, GL_UNSIGNED_INT, Elements); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawElementsBO(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, ElementBO); - glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); - for (i = 0; i < count; i++) { - glDrawElements(GL_POINTS, NumVerts, GL_UNSIGNED_INT, (void *) 0); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawRangeElementsMem(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); - glBindBufferARB(GL_ARRAY_BUFFER, 0); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); - for (i = 0; i < count; i++) { - glDrawRangeElements(GL_POINTS, 0, NumVerts - 1, - NumVerts, GL_UNSIGNED_INT, Elements); - } - glFinish(); - PerfSwapBuffers(); -} - - -static void -DrawRangeElementsBO(unsigned count) -{ - unsigned i; - glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, ElementBO); - glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); - glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); - for (i = 0; i < count; i++) { - glDrawRangeElements(GL_POINTS, 0, NumVerts - 1, - NumVerts, GL_UNSIGNED_INT, (void *) 0); - } - glFinish(); - PerfSwapBuffers(); -} - - -/** Called from test harness/main */ -void -PerfDraw(void) -{ - double rate; - - glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - - printf("Vertex rate (%d x Vertex%df)\n", NumVerts, VERT_SIZE); - - rate = PerfMeasureRate(DrawImmediate); - rate *= NumVerts; - printf(" Immediate mode: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawArraysMem); - rate *= NumVerts; - printf(" glDrawArrays: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawArraysVBO); - rate *= NumVerts; - printf(" VBO glDrawArrays: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawElementsMem); - rate *= NumVerts; - printf(" glDrawElements: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawElementsBO); - rate *= NumVerts; - printf(" VBO glDrawElements: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawRangeElementsMem); - rate *= NumVerts; - printf(" glDrawRangeElements: %.1f verts/sec\n", rate); - - rate = PerfMeasureRate(DrawRangeElementsBO); - rate *= NumVerts; - printf(" VBO glDrawRangeElements: %.1f verts/sec\n", rate); - - exit(0); -} +/* + * Copyright (C) 2009 VMware, Inc. All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * VMWARE BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ + +/** + * Measure simple vertex processing rate via: + * - immediate mode + * - vertex arrays + * - VBO vertex arrays + * - glDrawElements + * - VBO glDrawElements + * - glDrawRangeElements + * - VBO glDrawRangeElements + * + * Brian Paul + * 16 Sep 2009 + */ + +#include +#include +#include "glmain.h" +#include "common.h" + + +#define MAX_VERTS (100 * 100) + +/** glVertex2/3/4 size */ +#define VERT_SIZE 4 + +int WinWidth = 500, WinHeight = 500; + +static GLuint VertexBO, ElementBO; + +static unsigned NumVerts = MAX_VERTS; +static unsigned VertBytes = VERT_SIZE * sizeof(float); +static float *VertexData = NULL; + +static unsigned NumElements = MAX_VERTS; +static GLuint *Elements = NULL; + + +/** + * Load VertexData buffer with a 2-D grid of points in the range [-1,1]^2. + */ +static void +InitializeVertexData(void) +{ + unsigned i; + float x = -1.0, y = -1.0; + float dx = 2.0 / 100; + float dy = 2.0 / 100; + + VertexData = (float *) malloc(NumVerts * VertBytes); + + for (i = 0; i < NumVerts; i++) { + VertexData[i * VERT_SIZE + 0] = x; + VertexData[i * VERT_SIZE + 1] = y; + VertexData[i * VERT_SIZE + 2] = 0.0; + VertexData[i * VERT_SIZE + 3] = 1.0; + x += dx; + if (x > 1.0) { + x = -1.0; + y += dy; + } + } + + Elements = (GLuint *) malloc(NumVerts * sizeof(GLuint)); + + for (i = 0; i < NumVerts; i++) { + Elements[i] = NumVerts - i - 1; + } +} + + +/** Called from test harness/main */ +void +PerfInit(void) +{ + InitializeVertexData(); + + /* setup VertexBO */ + glGenBuffersARB(1, &VertexBO); + glBindBufferARB(GL_ARRAY_BUFFER_ARB, VertexBO); + glBufferDataARB(GL_ARRAY_BUFFER_ARB, + NumVerts * VertBytes, VertexData, GL_STATIC_DRAW_ARB); + glEnableClientState(GL_VERTEX_ARRAY); + + /* setup ElementBO */ + glGenBuffersARB(1, &ElementBO); + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER_ARB, ElementBO); + glBufferDataARB(GL_ELEMENT_ARRAY_BUFFER_ARB, + NumElements * sizeof(GLuint), Elements, GL_STATIC_DRAW_ARB); +} + + +static void +DrawImmediate(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, 0); + for (i = 0; i < count; i++) { + unsigned j; + glBegin(GL_POINTS); + for (j = 0; j < NumVerts; j++) { +#if VERT_SIZE == 4 + glVertex4fv(VertexData + j * 4); +#elif VERT_SIZE == 3 + glVertex3fv(VertexData + j * 3); +#elif VERT_SIZE == 2 + glVertex2fv(VertexData + j * 2); +#else + abort(); +#endif + } + glEnd(); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawArraysMem(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, 0); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); + for (i = 0; i < count; i++) { + glDrawArrays(GL_POINTS, 0, NumVerts); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawArraysVBO(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); + for (i = 0; i < count; i++) { + glDrawArrays(GL_POINTS, 0, NumVerts); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawElementsMem(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, 0); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); + for (i = 0; i < count; i++) { + glDrawElements(GL_POINTS, NumVerts, GL_UNSIGNED_INT, Elements); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawElementsBO(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, ElementBO); + glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); + for (i = 0; i < count; i++) { + glDrawElements(GL_POINTS, NumVerts, GL_UNSIGNED_INT, (void *) 0); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawRangeElementsMem(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, 0); + glBindBufferARB(GL_ARRAY_BUFFER, 0); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, VertexData); + for (i = 0; i < count; i++) { + glDrawRangeElements(GL_POINTS, 0, NumVerts - 1, + NumVerts, GL_UNSIGNED_INT, Elements); + } + glFinish(); + PerfSwapBuffers(); +} + + +static void +DrawRangeElementsBO(unsigned count) +{ + unsigned i; + glBindBufferARB(GL_ELEMENT_ARRAY_BUFFER, ElementBO); + glBindBufferARB(GL_ARRAY_BUFFER, VertexBO); + glVertexPointer(VERT_SIZE, GL_FLOAT, VertBytes, (void *) 0); + for (i = 0; i < count; i++) { + glDrawRangeElements(GL_POINTS, 0, NumVerts - 1, + NumVerts, GL_UNSIGNED_INT, (void *) 0); + } + glFinish(); + PerfSwapBuffers(); +} + + +/** Called from test harness/main */ +void +PerfDraw(void) +{ + double rate; + + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); + + printf("Vertex rate (%d x Vertex%df)\n", NumVerts, VERT_SIZE); + + rate = PerfMeasureRate(DrawImmediate); + rate *= NumVerts; + printf(" Immediate mode: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawArraysMem); + rate *= NumVerts; + printf(" glDrawArrays: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawArraysVBO); + rate *= NumVerts; + printf(" VBO glDrawArrays: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawElementsMem); + rate *= NumVerts; + printf(" glDrawElements: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawElementsBO); + rate *= NumVerts; + printf(" VBO glDrawElements: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawRangeElementsMem); + rate *= NumVerts; + printf(" glDrawRangeElements: %.1f verts/sec\n", rate); + + rate = PerfMeasureRate(DrawRangeElementsBO); + rate *= NumVerts; + printf(" VBO glDrawRangeElements: %.1f verts/sec\n", rate); + + exit(0); +} -- cgit v1.2.3 From 0481e85af7195e13c30580afba233a80feeee740 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 22 Sep 2009 12:51:08 +0200 Subject: glsl/pp: Differentiate between integer and floating-point number tokens. --- src/glsl/pp/sl_pp_error.c | 8 ++++++-- src/glsl/pp/sl_pp_expression.c | 4 ++-- src/glsl/pp/sl_pp_if.c | 8 ++++---- src/glsl/pp/sl_pp_line.c | 8 ++++---- src/glsl/pp/sl_pp_macro.c | 4 ++-- src/glsl/pp/sl_pp_token.c | 19 +++++++++++++++---- src/glsl/pp/sl_pp_token.h | 6 ++++-- src/glsl/pp/sl_pp_version.c | 4 ++-- 8 files changed, 39 insertions(+), 22 deletions(-) diff --git a/src/glsl/pp/sl_pp_error.c b/src/glsl/pp/sl_pp_error.c index d42568d23dc..e591f4beef9 100644 --- a/src/glsl/pp/sl_pp_error.c +++ b/src/glsl/pp/sl_pp_error.c @@ -239,8 +239,12 @@ sl_pp_process_error(struct sl_pp_context *context, s = sl_pp_context_cstr(context, input[i].data.identifier); break; - case SL_PP_NUMBER: - s = sl_pp_context_cstr(context, input[i].data.number); + case SL_PP_UINT: + s = sl_pp_context_cstr(context, input[i].data._uint); + break; + + case SL_PP_FLOAT: + s = sl_pp_context_cstr(context, input[i].data._float); break; case SL_PP_OTHER: diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c index 6b2329ed1a7..5093ef6cc9d 100644 --- a/src/glsl/pp/sl_pp_expression.c +++ b/src/glsl/pp/sl_pp_expression.c @@ -42,8 +42,8 @@ static int _parse_primary(struct parse_context *ctx, int *result) { - if (ctx->input->token == SL_PP_NUMBER) { - *result = atoi(sl_pp_context_cstr(ctx->context, ctx->input->data.number)); + if (ctx->input->token == SL_PP_UINT) { + *result = atoi(sl_pp_context_cstr(ctx->context, ctx->input->data._uint)); ctx->input++; } else { if (ctx->input->token != SL_PP_LPAREN) { diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index cf1c746d5f6..5fa27fcf053 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -81,13 +81,13 @@ _parse_defined(struct sl_pp_context *context, (*pi)++; } - result.token = SL_PP_NUMBER; + result.token = SL_PP_UINT; if (defined) { - result.data.number = sl_pp_context_add_unique_str(context, "1"); + result.data._uint = sl_pp_context_add_unique_str(context, "1"); } else { - result.data.number = sl_pp_context_add_unique_str(context, "0"); + result.data._uint = sl_pp_context_add_unique_str(context, "0"); } - if (result.data.number == -1) { + if (result.data._uint == -1) { return -1; } diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index cab0262686c..e8f751003ac 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -67,8 +67,8 @@ sl_pp_process_line(struct sl_pp_context *context, } } - if (state.out_len > 0 && state.out[0].token == SL_PP_NUMBER) { - line_number = state.out[0].data.number; + if (state.out_len > 0 && state.out[0].token == SL_PP_UINT) { + line_number = state.out[0].data._uint; } else { strcpy(context->error_msg, "expected a number after `#line'"); free(state.out); @@ -76,8 +76,8 @@ sl_pp_process_line(struct sl_pp_context *context, } if (state.out_len > 1) { - if (state.out[1].token == SL_PP_NUMBER) { - file_number = state.out[1].data.number; + if (state.out[1].token == SL_PP_UINT) { + file_number = state.out[1].data._uint; } else { strcpy(context->error_msg, "expected a number after line number"); free(state.out); diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 878b22ed9c3..3956ba3b574 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -105,8 +105,8 @@ _out_number(struct sl_pp_context *context, sprintf(buf, "%u", number); - ti.token = SL_PP_NUMBER; - ti.data.number = sl_pp_context_add_unique_str(context, buf); + ti.token = SL_PP_UINT; + ti.data._uint = sl_pp_context_add_unique_str(context, buf); if (sl_pp_process_out(state, &ti)) { strcpy(context->error_msg, "out of memory"); return -1; diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 3a7ffe7db15..99a32a6e671 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -271,6 +271,7 @@ _tokenise_number(struct sl_pp_context *context, { const char *input = *pinput; unsigned int eaten; + unsigned int is_float = 0; char number[256]; /* XXX: Remove this artifical limit. */ eaten = _parse_float(input); @@ -282,6 +283,8 @@ _tokenise_number(struct sl_pp_context *context, eaten = _parse_dec(input); } } + } else { + is_float = 1; } if (!eaten || _is_identifier_char(input[eaten])) { @@ -297,10 +300,18 @@ _tokenise_number(struct sl_pp_context *context, memcpy(number, input, eaten); number[eaten] = '\0'; - info->token = SL_PP_NUMBER; - info->data.number = sl_pp_context_add_unique_str(context, number); - if (info->data.number == -1) { - return -1; + if (is_float) { + info->token = SL_PP_FLOAT; + info->data._float = sl_pp_context_add_unique_str(context, number); + if (info->data._float == -1) { + return -1; + } + } else { + info->token = SL_PP_UINT; + info->data._uint = sl_pp_context_add_unique_str(context, number); + if (info->data._uint == -1) { + return -1; + } } *pinput = input + eaten; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 4131be6bdad..2a7b79ea3f7 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -82,7 +82,8 @@ enum sl_pp_token { SL_PP_IDENTIFIER, - SL_PP_NUMBER, + SL_PP_UINT, + SL_PP_FLOAT, SL_PP_OTHER, @@ -102,7 +103,8 @@ enum sl_pp_token { union sl_pp_token_data { int identifier; - int number; + int _uint; + int _float; char other; int pragma; int extension; diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index 825967d4c10..adf3017bf21 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -99,8 +99,8 @@ sl_pp_version(struct sl_pp_context *context, i++; break; - case SL_PP_NUMBER: - *version = atoi(sl_pp_context_cstr(context, input[i].data.number)); + case SL_PP_UINT: + *version = atoi(sl_pp_context_cstr(context, input[i].data._uint)); i++; found_number = 1; break; -- cgit v1.2.3 From 125691dda3d261d3115bf85265428e28d2bbf6c8 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 22 Sep 2009 12:52:21 +0200 Subject: glsl/apps: Update after recent pp interface changes. --- src/glsl/apps/process.c | 8 ++++++-- src/glsl/apps/tokenise.c | 8 ++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 1fdb09670cc..4fff3570c1a 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -330,8 +330,12 @@ main(int argc, fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data.identifier)); break; - case SL_PP_NUMBER: - fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data.number)); + case SL_PP_UINT: + fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data._uint)); + break; + + case SL_PP_FLOAT: + fprintf(out, "%s ", sl_pp_context_cstr(context, outtokens[i].data._float)); break; case SL_PP_OTHER: diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 2b3ebcf283d..9f95424f5c8 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -314,8 +314,12 @@ main(int argc, fprintf(out, "%s ", sl_pp_context_cstr(context, tokens[i].data.identifier)); break; - case SL_PP_NUMBER: - fprintf(out, "(%s) ", sl_pp_context_cstr(context, tokens[i].data.number)); + case SL_PP_UINT: + fprintf(out, "(%s) ", sl_pp_context_cstr(context, tokens[i].data._uint)); + break; + + case SL_PP_FLOAT: + fprintf(out, "(%s) ", sl_pp_context_cstr(context, tokens[i].data._float)); break; case SL_PP_OTHER: -- cgit v1.2.3 From cd41395073839365b79e6b1cca2e35e08a57bf7b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 22 Sep 2009 12:52:53 +0200 Subject: grammar: Differentiate between uints and floats. --- src/mesa/shader/grammar/grammar.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c index eb58e0cddd6..b83920a089b 100644 --- a/src/mesa/shader/grammar/grammar.c +++ b/src/mesa/shader/grammar/grammar.c @@ -2067,8 +2067,10 @@ static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb s->m_token = SL_PP_COLON; } else if (!strcmp(s->m_string, "@ID")) { s->m_token = SL_PP_IDENTIFIER; - } else if (!strcmp(s->m_string, "@NUM")) { - s->m_token = SL_PP_NUMBER; + } else if (!strcmp(s->m_string, "@UINT")) { + s->m_token = SL_PP_UINT; + } else if (!strcmp(s->m_string, "@FLOAT")) { + s->m_token = SL_PP_FLOAT; } else if (!strcmp(s->m_string, "@EOF")) { s->m_token = SL_PP_EOF; } else { -- cgit v1.2.3 From b1e6514a94effb1a5ea03c31f5a50e9e60638e51 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 22 Sep 2009 12:54:45 +0200 Subject: slang: Differentiate between uints and floats. --- src/mesa/shader/slang/library/slang_shader.syn | 4 ++-- src/mesa/shader/slang/library/slang_shader_syn.h | 4 ++-- src/mesa/shader/slang/slang_compile.c | 3 ++- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn index f6bf7f1e546..11f9825c016 100644 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ b/src/mesa/shader/slang/library/slang_shader.syn @@ -1362,10 +1362,10 @@ identifier "@ID" .emit *; float - "@NUM" .emit 1 .emit *; + "@FLOAT" .emit 1 .emit *; integer - "@NUM" .emit 1 .emit *; + "@UINT" .emit 1 .emit *; boolean "true" .emit '1' .emit '\0' .or diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h index 9a56643d2f1..488cf1a5044 100644 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ b/src/mesa/shader/slang/library/slang_shader_syn.h @@ -631,9 +631,9 @@ "identifier\n" " \"@ID\" .emit *;\n" "float\n" -" \"@NUM\" .emit 1 .emit *;\n" +" \"@FLOAT\" .emit 1 .emit *;\n" "integer\n" -" \"@NUM\" .emit 1 .emit *;\n" +" \"@UINT\" .emit 1 .emit *;\n" "boolean\n" " \"true\" .emit '1' .emit '\\0' .or\n" " \"false\" .emit '0' .emit '\\0';\n" diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index fb452e5d2c5..ce3a85ebf8a 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2683,7 +2683,8 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, case SL_PP_QUESTION: case SL_PP_COLON: case SL_PP_IDENTIFIER: - case SL_PP_NUMBER: + case SL_PP_UINT: + case SL_PP_FLOAT: *dst++ = *src++; break; -- cgit v1.2.3 From 32966991c629fa43818f42912deb9deca913ef60 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 23 Sep 2009 09:33:12 +0200 Subject: glsl/pp: Check for reserved macro names. --- src/glsl/pp/sl_pp_define.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index 391178aa696..d18a7ee2895 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -26,7 +26,9 @@ **************************************************************************/ #include +#include #include "sl_pp_process.h" +#include "sl_pp_public.h" static void @@ -126,6 +128,20 @@ sl_pp_process_define(struct sl_pp_context *context, return -1; } + /* Check for reserved macro names */ + { + const char *name = sl_pp_context_cstr(context, macro_name); + + if (strstr(name, "__")) { + strcpy(context->error_msg, "macro names containing `__' are reserved"); + return 1; + } + if (name[0] == 'G' && name[1] == 'L' && name[2] == '_') { + strcpy(context->error_msg, "macro names prefixed with `GL_' are reserved"); + return 1; + } + } + for (macro = context->macro; macro; macro = macro->next) { if (macro->name == macro_name) { break; -- cgit v1.2.3 From 2f89e1a5a18c4c3c88d4e7613cbfc0f85a5fcfc9 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 23 Sep 2009 09:37:37 +0200 Subject: glsl/pp: Add `0' and `1' to dictionary. --- src/glsl/pp/sl_pp_dict.c | 3 +++ src/glsl/pp/sl_pp_dict.h | 3 +++ src/glsl/pp/sl_pp_if.c | 9 +-------- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index f2885c763d7..0e1fa368577 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -79,5 +79,8 @@ sl_pp_dict_init(struct sl_pp_context *context) ADD_NAME(context, version); + ADD_NAME_STR(context, _0, "0"); + ADD_NAME_STR(context, _1, "1"); + return 0; } diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h index ba82b389b23..683752e000a 100644 --- a/src/glsl/pp/sl_pp_dict.h +++ b/src/glsl/pp/sl_pp_dict.h @@ -64,6 +64,9 @@ struct sl_pp_dict { int undef; int version; + + int _0; + int _1; }; diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index 5fa27fcf053..c8e958eab49 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -82,14 +82,7 @@ _parse_defined(struct sl_pp_context *context, } result.token = SL_PP_UINT; - if (defined) { - result.data._uint = sl_pp_context_add_unique_str(context, "1"); - } else { - result.data._uint = sl_pp_context_add_unique_str(context, "0"); - } - if (result.data._uint == -1) { - return -1; - } + result.data._uint = (defined ? context->dict._1 : context->dict._0); if (sl_pp_process_out(state, &result)) { strcpy(context->error_msg, "out of memory"); -- cgit v1.2.3 From 1ed1dc8b4197ef5a6b0b1fab6ef0694f379642d8 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 23 Sep 2009 09:40:24 +0200 Subject: glsl/pp: Include missing headers. --- src/glsl/pp/sl_pp_error.c | 1 + src/glsl/pp/sl_pp_expression.c | 1 + 2 files changed, 2 insertions(+) diff --git a/src/glsl/pp/sl_pp_error.c b/src/glsl/pp/sl_pp_error.c index e591f4beef9..df9b191dfeb 100644 --- a/src/glsl/pp/sl_pp_error.c +++ b/src/glsl/pp/sl_pp_error.c @@ -27,6 +27,7 @@ #include #include "sl_pp_process.h" +#include "sl_pp_public.h" void diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c index 5093ef6cc9d..3f6dfb5a6d3 100644 --- a/src/glsl/pp/sl_pp_expression.c +++ b/src/glsl/pp/sl_pp_expression.c @@ -27,6 +27,7 @@ #include #include "sl_pp_expression.h" +#include "sl_pp_public.h" struct parse_context { -- cgit v1.2.3 From 8212e4d9fabb0c441575975c12d656364baba6fe Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 23 Sep 2009 09:40:40 +0200 Subject: grammar: Include the correct glsl pp header. --- src/mesa/shader/grammar/grammar_mesa.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h index 20d13da8381..beabf1e4e17 100644 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ b/src/mesa/shader/grammar/grammar_mesa.h @@ -26,7 +26,7 @@ #define GRAMMAR_MESA_H -#include "../../glsl/pp/sl_pp_context.h" +#include "../../glsl/pp/sl_pp_public.h" #include "main/imports.h" /* NOTE: include Mesa 3-D specific headers here */ -- cgit v1.2.3 From 9a1447d449209635e481c7f9bd02084864e17419 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 08:43:05 +0200 Subject: glsl/pp: Store both line number and file index in a single token. --- src/glsl/pp/sl_pp_line.c | 31 ++++++++++--------------------- src/glsl/pp/sl_pp_process.c | 3 ++- src/glsl/pp/sl_pp_token.h | 7 ++++--- 3 files changed, 16 insertions(+), 25 deletions(-) diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index e8f751003ac..41ddaf6ba25 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -42,6 +42,7 @@ sl_pp_process_line(struct sl_pp_context *context, int line_number = -1; int file_number = -1; unsigned int line; + unsigned int file; memset(&state, 0, sizeof(state)); for (i = first; i < last;) { @@ -94,37 +95,25 @@ sl_pp_process_line(struct sl_pp_context *context, free(state.out); line = atoi(sl_pp_context_cstr(context, line_number)); + if (file_number != -1) { + file = atoi(sl_pp_context_cstr(context, file_number)); + } else { + file = context->file; + } - if (context->line != line) { + if (context->line != line || context->file != file) { struct sl_pp_token_info ti; ti.token = SL_PP_LINE; - ti.data.line = line; + ti.data.line.lineno = line; + ti.data.line.fileno = file; if (sl_pp_process_out(pstate, &ti)) { strcpy(context->error_msg, "out of memory"); return -1; } context->line = line; - } - - if (file_number != -1) { - unsigned int file; - - file = atoi(sl_pp_context_cstr(context, file_number)); - - if (context->file != file) { - struct sl_pp_token_info ti; - - ti.token = SL_PP_FILE; - ti.data.file = file; - if (sl_pp_process_out(pstate, &ti)) { - strcpy(context->error_msg, "out of memory"); - return -1; - } - - context->file = file; - } + context->file = file; } return 0; diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index ab2f2d8eb45..67ed5888187 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -79,7 +79,8 @@ sl_pp_process(struct sl_pp_context *context, struct sl_pp_token_info ti; ti.token = SL_PP_LINE; - ti.data.line = context->line - 1; + ti.data.line.lineno = context->line - 1; + ti.data.line.fileno = context->file; if (sl_pp_process_out(&state, &ti)) { strcpy(context->error_msg, "out of memory"); return -1; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 2a7b79ea3f7..b1f3389b32c 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -96,7 +96,6 @@ enum sl_pp_token { SL_PP_EXTENSION_DISABLE, SL_PP_LINE, - SL_PP_FILE, SL_PP_EOF }; @@ -108,8 +107,10 @@ union sl_pp_token_data { char other; int pragma; int extension; - unsigned int line; - unsigned int file; + union { + unsigned int lineno: 24; + unsigned int fileno: 8; + } line; }; struct sl_pp_token_info { -- cgit v1.2.3 From 13f9a39cea81bf8f1efd4aca1467c63a49a42dab Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 08:43:54 +0200 Subject: glsl/apps: Fix apps after pp interface changes. --- src/glsl/apps/process.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 4fff3570c1a..28b415c3ffd 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -367,11 +367,7 @@ main(int argc, break; case SL_PP_LINE: - fprintf(out, "#line %u", outtokens[i].data.line); - break; - - case SL_PP_FILE: - fprintf(out, " #file %u", outtokens[i].data.file); + fprintf(out, "#line %u %u", outtokens[i].data.line.lineno, outtokens[i].data.line.fileno); break; default: -- cgit v1.2.3 From a58360dbc2ee1ef919ecd50bd46cb57a151b8550 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 09:04:15 +0200 Subject: glsl/pp: Use struct instead of union. --- src/glsl/pp/sl_pp_token.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index b1f3389b32c..cece30b62dd 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -107,7 +107,7 @@ union sl_pp_token_data { char other; int pragma; int extension; - union { + struct { unsigned int lineno: 24; unsigned int fileno: 8; } line; -- cgit v1.2.3 From db097a9a3ff532d37875b8cd911dda0515a60dcd Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:54:56 +0200 Subject: glsl/apps: Allow builds on all platforms. --- src/glsl/apps/SConscript | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index 12a0018d1c2..5802011bf5e 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -1,8 +1,5 @@ Import('*') -if env['platform'] not in ['windows']: - Return() - env = env.Clone() if env['platform'] == 'windows': -- cgit v1.2.3 From e8e3fe15e1b0f75c43e197f8875a7fae1468f584 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:55:37 +0200 Subject: glsl/apps: Include missing header, properly escape format strings. --- src/glsl/apps/process.c | 5 +++-- src/glsl/apps/purify.c | 1 + src/glsl/apps/tokenise.c | 5 +++-- src/glsl/apps/version.c | 1 + 4 files changed, 8 insertions(+), 4 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 28b415c3ffd..e20b68b1a9a 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -27,6 +27,7 @@ #include #include +#include #include #include "../pp/sl_pp_public.h" @@ -235,11 +236,11 @@ main(int argc, break; case SL_PP_MODASSIGN: - fprintf(out, "%= "); + fprintf(out, "%%= "); break; case SL_PP_MODULO: - fprintf(out, "% "); + fprintf(out, "%% "); break; case SL_PP_LSHIFTASSIGN: diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 435bdbe5145..53ba2530225 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -27,6 +27,7 @@ #include #include +#include #include "../pp/sl_pp_public.h" diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 9f95424f5c8..d6b9c4fa045 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -27,6 +27,7 @@ #include #include +#include #include #include "../pp/sl_pp_public.h" @@ -219,11 +220,11 @@ main(int argc, break; case SL_PP_MODASSIGN: - fprintf(out, "%= "); + fprintf(out, "%%= "); break; case SL_PP_MODULO: - fprintf(out, "% "); + fprintf(out, "%% "); break; case SL_PP_LSHIFTASSIGN: diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index f2594319921..4570f86217e 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -27,6 +27,7 @@ #include #include +#include #include #include "../pp/sl_pp_public.h" -- cgit v1.2.3 From e1eed5670246e08119ed7e4afa5313e7717b8128 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:56:01 +0200 Subject: glsl/pp: Allow builds on all platforms. --- src/glsl/pp/SConscript | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript index 621db1e765c..5bd615c8d7f 100644 --- a/src/glsl/pp/SConscript +++ b/src/glsl/pp/SConscript @@ -1,8 +1,5 @@ Import('*') -if env['platform'] not in ['windows']: - Return() - env = env.Clone() glsl = env.StaticLibrary( -- cgit v1.2.3 From 7a95a3c7c4ba49ec174681c36951e3c0672df06c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:56:46 +0200 Subject: glsl/pp: Include missing headers. --- src/glsl/pp/sl_pp_context.c | 1 + src/glsl/pp/sl_pp_error.c | 1 + src/glsl/pp/sl_pp_expression.c | 1 + src/glsl/pp/sl_pp_extension.c | 1 + src/glsl/pp/sl_pp_if.c | 1 + src/glsl/pp/sl_pp_line.c | 1 + src/glsl/pp/sl_pp_pragma.c | 1 + src/glsl/pp/sl_pp_process.c | 2 ++ src/glsl/pp/sl_pp_token.c | 1 + src/glsl/pp/sl_pp_version.c | 1 + 10 files changed, 11 insertions(+) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index fd205de5d32..8ce189d955c 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_public.h" #include "sl_pp_context.h" diff --git a/src/glsl/pp/sl_pp_error.c b/src/glsl/pp/sl_pp_error.c index df9b191dfeb..a9eeff98ba5 100644 --- a/src/glsl/pp/sl_pp_error.c +++ b/src/glsl/pp/sl_pp_error.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_process.h" #include "sl_pp_public.h" diff --git a/src/glsl/pp/sl_pp_expression.c b/src/glsl/pp/sl_pp_expression.c index 3f6dfb5a6d3..ec904787dd7 100644 --- a/src/glsl/pp/sl_pp_expression.c +++ b/src/glsl/pp/sl_pp_expression.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_expression.h" #include "sl_pp_public.h" diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 33193d03a8c..4148fd9a5a3 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_process.h" diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index c8e958eab49..a0b3635dd5a 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_expression.h" #include "sl_pp_process.h" diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index 41ddaf6ba25..fc2dd89e68b 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_public.h" #include "sl_pp_process.h" diff --git a/src/glsl/pp/sl_pp_pragma.c b/src/glsl/pp/sl_pp_pragma.c index 03269b63db7..489eb17b8eb 100644 --- a/src/glsl/pp/sl_pp_pragma.c +++ b/src/glsl/pp/sl_pp_pragma.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_process.h" diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 67ed5888187..4b783e40b4d 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -26,7 +26,9 @@ **************************************************************************/ #include +#include #include "sl_pp_process.h" +#include "sl_pp_public.h" static void diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 99a32a6e671..f232dafc682 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_context.h" #include "sl_pp_token.h" diff --git a/src/glsl/pp/sl_pp_version.c b/src/glsl/pp/sl_pp_version.c index adf3017bf21..db06523749c 100644 --- a/src/glsl/pp/sl_pp_version.c +++ b/src/glsl/pp/sl_pp_version.c @@ -26,6 +26,7 @@ **************************************************************************/ #include +#include #include "sl_pp_public.h" #include "sl_pp_context.h" -- cgit v1.2.3 From 69fec23251740c3071ffc3fefc8981599bdb22ef Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:57:32 +0200 Subject: glsl/pp: Avoid using `__VERSION__' as an identifier. --- src/glsl/pp/sl_pp_dict.c | 2 +- src/glsl/pp/sl_pp_dict.h | 5 ++++- src/glsl/pp/sl_pp_macro.c | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index 0e1fa368577..82fb9127b50 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -56,7 +56,7 @@ sl_pp_dict_init(struct sl_pp_context *context) ADD_NAME_STR(context, ___LINE__, "__LINE__"); ADD_NAME_STR(context, ___FILE__, "__FILE__"); - ADD_NAME(context, __VERSION__); + ADD_NAME_STR(context, ___VERSION__, "__VERSION__"); ADD_NAME(context, optimize); ADD_NAME(context, debug); diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h index 683752e000a..49f0e0bf9fa 100644 --- a/src/glsl/pp/sl_pp_dict.h +++ b/src/glsl/pp/sl_pp_dict.h @@ -28,6 +28,9 @@ #ifndef SL_PP_DICT_H #define SL_PP_DICT_H + +struct sl_pp_context; + struct sl_pp_dict { int all; int _GL_ARB_draw_buffers; @@ -42,7 +45,7 @@ struct sl_pp_dict { int ___LINE__; int ___FILE__; - int __VERSION__; + int ___VERSION__; int optimize; int debug; diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 3956ba3b574..a4e78861d69 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -27,6 +27,7 @@ #include #include +#include #include "sl_pp_macro.h" #include "sl_pp_process.h" @@ -149,7 +150,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, (*pi)++; return 0; } - if (macro_name == context->dict.__VERSION__) { + if (macro_name == context->dict.___VERSION__) { if (!mute && _out_number(context, state, 110)) { return -1; } -- cgit v1.2.3 From 92e33569f39a2fa9061a0c35c233c1db33820033 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 24 Sep 2009 10:57:55 +0200 Subject: glsl/pp: Add forward decls to silence gcc warnings. --- src/glsl/pp/sl_pp_macro.h | 3 +++ src/glsl/pp/sl_pp_token.h | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index 7af11c5ece7..e3ae2fc7125 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -31,6 +31,9 @@ #include "sl_pp_token.h" +struct sl_pp_context; +struct sl_pp_process_state; + struct sl_pp_macro_formal_arg { int name; struct sl_pp_macro_formal_arg *next; diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index cece30b62dd..29c7571711e 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -29,6 +29,8 @@ #define SL_PP_TOKEN_H +struct sl_pp_context; + enum sl_pp_token { SL_PP_WHITESPACE, SL_PP_NEWLINE, -- cgit v1.2.3 From c4bd6ccde8241d6a5eb631c713ba79db51163701 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 28 Sep 2009 11:30:15 +0200 Subject: glsl/pp: Expand macro actual arguments before pasting into its body. --- src/glsl/pp/sl_pp_macro.c | 102 ++++++++++++++++++++++++---------------------- 1 file changed, 53 insertions(+), 49 deletions(-) diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index a4e78861d69..d6c32a0e782 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -136,6 +136,9 @@ sl_pp_macro_expand(struct sl_pp_context *context, macro_name = input[*pi].data.identifier; + /* First look for predefined macros. + */ + if (macro_name == context->dict.___LINE__) { if (!mute && _out_number(context, state, context->line)) { return -1; @@ -207,55 +210,73 @@ sl_pp_macro_expand(struct sl_pp_context *context, struct sl_pp_macro **pmacro = &actual_arg; for (j = 0; j < (unsigned int)macro->num_args; j++) { - unsigned int body_len; + struct sl_pp_process_state arg_state; unsigned int i; int done = 0; unsigned int paren_nesting = 0; - unsigned int k; - - *pmacro = sl_pp_macro_new(); - if (!*pmacro) { - strcpy(context->error_msg, "out of memory"); - return -1; - } + struct sl_pp_token_info eof; - (**pmacro).name = formal_arg->name; + memset(&arg_state, 0, sizeof(arg_state)); - body_len = 1; - for (i = *pi; !done; i++) { + for (i = *pi; !done;) { switch (input[i].token) { case SL_PP_WHITESPACE: + i++; break; case SL_PP_COMMA: if (!paren_nesting) { if (j < (unsigned int)macro->num_args - 1) { done = 1; + i++; } else { strcpy(context->error_msg, "too many actual macro arguments"); return -1; } } else { - body_len++; + if (sl_pp_process_out(&arg_state, &input[i])) { + strcpy(context->error_msg, "out of memory"); + free(arg_state.out); + return -1; + } + i++; } break; case SL_PP_LPAREN: paren_nesting++; - body_len++; + if (sl_pp_process_out(&arg_state, &input[i])) { + strcpy(context->error_msg, "out of memory"); + free(arg_state.out); + return -1; + } + i++; break; case SL_PP_RPAREN: if (!paren_nesting) { if (j == (unsigned int)macro->num_args - 1) { done = 1; + i++; } else { strcpy(context->error_msg, "too few actual macro arguments"); return -1; } } else { paren_nesting--; - body_len++; + if (sl_pp_process_out(&arg_state, &input[i])) { + strcpy(context->error_msg, "out of memory"); + free(arg_state.out); + return -1; + } + i++; + } + break; + + case SL_PP_IDENTIFIER: + if (sl_pp_macro_expand(context, input, &i, local, &arg_state, 0)) { + free(arg_state.out); + return -1; } break; @@ -264,50 +285,33 @@ sl_pp_macro_expand(struct sl_pp_context *context, return -1; default: - body_len++; + if (sl_pp_process_out(&arg_state, &input[i])) { + strcpy(context->error_msg, "out of memory"); + free(arg_state.out); + return -1; + } + i++; } } - (**pmacro).body = malloc(sizeof(struct sl_pp_token_info) * body_len); - if (!(**pmacro).body) { + (*pi) = i; + + eof.token = SL_PP_EOF; + if (sl_pp_process_out(&arg_state, &eof)) { strcpy(context->error_msg, "out of memory"); + free(arg_state.out); return -1; } - for (done = 0, k = 0, i = *pi; !done; i++) { - switch (input[i].token) { - case SL_PP_WHITESPACE: - break; - - case SL_PP_COMMA: - if (!paren_nesting && j < (unsigned int)macro->num_args - 1) { - done = 1; - } else { - (**pmacro).body[k++] = input[i]; - } - break; - - case SL_PP_LPAREN: - paren_nesting++; - (**pmacro).body[k++] = input[i]; - break; - - case SL_PP_RPAREN: - if (!paren_nesting && j == (unsigned int)macro->num_args - 1) { - done = 1; - } else { - paren_nesting--; - (**pmacro).body[k++] = input[i]; - } - break; - - default: - (**pmacro).body[k++] = input[i]; - } + *pmacro = sl_pp_macro_new(); + if (!*pmacro) { + strcpy(context->error_msg, "out of memory"); + free(arg_state.out); + return -1; } - (**pmacro).body[k++].token = SL_PP_EOF; - (*pi) = i; + (**pmacro).name = formal_arg->name; + (**pmacro).body = arg_state.out; formal_arg = formal_arg->next; pmacro = &(**pmacro).next; -- cgit v1.2.3 From d37f7694b60d3dad8daf9e2af4e509c15b996553 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 00:15:33 +0100 Subject: glsl/pp: Have sl_pp_purify() return error msg/line no. --- src/glsl/pp/sl_pp_purify.c | 56 +++++++++++++++++++++++++++++++++++++--------- src/glsl/pp/sl_pp_purify.h | 5 ++++- 2 files changed, 50 insertions(+), 11 deletions(-) diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c index 3fb91430f37..272da1e6ea9 100644 --- a/src/glsl/pp/sl_pp_purify.c +++ b/src/glsl/pp/sl_pp_purify.c @@ -26,6 +26,8 @@ **************************************************************************/ #include +#include +#include #include "sl_pp_purify.h" @@ -39,10 +41,12 @@ static unsigned int _purify_newline(const char *input, - char *out) + char *out, + unsigned int *current_line) { if (input[0] == '\n') { *out = '\n'; + (*current_line)++; if (input[1] == '\r') { /* * The GLSL spec is not explicit about whether this @@ -55,6 +59,7 @@ _purify_newline(const char *input, } if (input[0] == '\r') { *out = '\n'; + (*current_line)++; if (input[1] == '\n') { return 2; } @@ -67,7 +72,8 @@ _purify_newline(const char *input, static unsigned int _purify_backslash(const char *input, - char *out) + char *out, + unsigned int *current_line) { unsigned int eaten = 0; @@ -75,11 +81,12 @@ _purify_backslash(const char *input, if (input[0] == '\\') { char next; unsigned int next_eaten; + unsigned int next_line = *current_line; eaten++; input++; - next_eaten = _purify_newline(input, &next); + next_eaten = _purify_newline(input, &next, &next_line); if (next == '\n') { /* * If this is really a line continuation sequence, eat @@ -87,6 +94,7 @@ _purify_backslash(const char *input, */ eaten += next_eaten; input += next_eaten; + *current_line = next_line; } else { /* * It is an error to put anything between a backslash @@ -98,7 +106,7 @@ _purify_backslash(const char *input, break; } } else { - eaten += _purify_newline(input, out); + eaten += _purify_newline(input, out, current_line); break; } } @@ -110,9 +118,25 @@ struct out_buf { char *out; unsigned int len; unsigned int capacity; + unsigned int current_line; + char *errormsg; + unsigned int cberrormsg; }; +static void +_report_error(struct out_buf *obuf, + const char *msg, + ...) +{ + va_list args; + + va_start(args, msg); + vsnprintf(obuf->errormsg, obuf->cberrormsg, msg, args); + va_end(args); +} + + static int _out_buf_putc(struct out_buf *obuf, char c) @@ -130,6 +154,7 @@ _out_buf_putc(struct out_buf *obuf, obuf->out = realloc(obuf->out, new_max); if (!obuf->out) { + _report_error(obuf, "out of memory"); return -1; } obuf->capacity = new_max; @@ -148,20 +173,22 @@ _purify_comment(const char *input, unsigned int eaten; char curr; - eaten = _purify_backslash(input, &curr); + eaten = _purify_backslash(input, &curr, &obuf->current_line); input += eaten; if (curr == '/') { char next; unsigned int next_eaten; + unsigned int next_line = obuf->current_line; - next_eaten = _purify_backslash(input, &next); + next_eaten = _purify_backslash(input, &next, &next_line); if (next == '/') { eaten += next_eaten; input += next_eaten; + obuf->current_line = next_line; /* Replace a line comment with either a newline or nil. */ for (;;) { - next_eaten = _purify_backslash(input, &next); + next_eaten = _purify_backslash(input, &next, &obuf->current_line); eaten += next_eaten; input += next_eaten; if (next == '\n' || next == '\0') { @@ -174,14 +201,15 @@ _purify_comment(const char *input, } else if (next == '*') { eaten += next_eaten; input += next_eaten; + obuf->current_line = next_line; /* Replace a block comment with a whitespace. */ for (;;) { - next_eaten = _purify_backslash(input, &next); + next_eaten = _purify_backslash(input, &next, &obuf->current_line); eaten += next_eaten; input += next_eaten; while (next == '*') { - next_eaten = _purify_backslash(input, &next); + next_eaten = _purify_backslash(input, &next, &obuf->current_line); eaten += next_eaten; input += next_eaten; if (next == '/') { @@ -197,6 +225,7 @@ _purify_comment(const char *input, } } if (next == '\0') { + _report_error(obuf, "expected `*/' but end of translation unit found"); return 0; } } @@ -212,19 +241,26 @@ _purify_comment(const char *input, int sl_pp_purify(const char *input, const struct sl_pp_purify_options *options, - char **output) + char **output, + char *errormsg, + unsigned int cberrormsg, + unsigned int *errorline) { struct out_buf obuf; obuf.out = NULL; obuf.len = 0; obuf.capacity = 0; + obuf.current_line = 1; + obuf.errormsg = errormsg; + obuf.cberrormsg = cberrormsg; for (;;) { unsigned int eaten; eaten = _purify_comment(input, &obuf); if (!eaten) { + *errorline = obuf.current_line; return -1; } input += eaten; diff --git a/src/glsl/pp/sl_pp_purify.h b/src/glsl/pp/sl_pp_purify.h index 011b117937e..88ea9c9e7a7 100644 --- a/src/glsl/pp/sl_pp_purify.h +++ b/src/glsl/pp/sl_pp_purify.h @@ -36,6 +36,9 @@ struct sl_pp_purify_options { int sl_pp_purify(const char *input, const struct sl_pp_purify_options *options, - char **output); + char **output, + char *errormsg, + unsigned int cberrormsg, + unsigned int *errorline); #endif /* SL_PP_PURIFY_H */ -- cgit v1.2.3 From b5c8c87eab4cbc4f05cbd98d7647b9b83607f976 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 00:15:54 +0100 Subject: glsl/apps: Update for glsl/pp interface changes. --- src/glsl/apps/process.c | 6 ++++-- src/glsl/apps/purify.c | 6 ++++-- src/glsl/apps/tokenise.c | 6 ++++-- src/glsl/apps/version.c | 6 ++++-- 4 files changed, 16 insertions(+), 8 deletions(-) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index e20b68b1a9a..7f392613e09 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -41,6 +41,8 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + char errmsg[100] = ""; + unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; @@ -91,8 +93,8 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf)) { - fprintf(out, "$PURIFYERROR\n"); + if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + fprintf(out, "$PURIFYERROR %s\n", errmsg); free(inbuf); fclose(out); diff --git a/src/glsl/apps/purify.c b/src/glsl/apps/purify.c index 53ba2530225..8c01f4fc6a3 100644 --- a/src/glsl/apps/purify.c +++ b/src/glsl/apps/purify.c @@ -40,6 +40,8 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + char errmsg[100] = ""; + unsigned int errline = 0; FILE *out; if (argc != 3) { @@ -84,8 +86,8 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf)) { - fprintf(out, "$PURIFYERROR\n"); + if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + fprintf(out, "$PURIFYERROR %u: %s\n", errline, errmsg); free(inbuf); fclose(out); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index d6b9c4fa045..9dd9631a4ed 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -41,6 +41,8 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + char errmsg[100] = ""; + unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; FILE *out; @@ -88,8 +90,8 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf)) { - fprintf(out, "$PURIFYERROR\n"); + if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + fprintf(out, "$PURIFYERROR %s\n", errmsg); free(inbuf); fclose(out); diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 4570f86217e..1127dae5161 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -41,6 +41,8 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char *outbuf; + char errmsg[100] = ""; + unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; @@ -89,8 +91,8 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf)) { - fprintf(out, "$PURIFYERROR\n"); + if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + fprintf(out, "$PURIFYERROR %s\n", errmsg); free(inbuf); fclose(out); -- cgit v1.2.3 From 4703d7d3f8d50a0ff00dd043e999b0b8b11d45e6 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 00:16:09 +0100 Subject: slang: Update for glsl/pp interface changes. --- src/mesa/shader/slang/slang_compile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index ce3a85ebf8a..b8b7b3d494a 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2589,12 +2589,14 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, int result; struct sl_pp_purify_options options; char *outbuf; + char errmsg[200] = ""; + unsigned int errline = 0; struct sl_pp_token_info *intokens; unsigned int tokens_eaten; memset(&options, 0, sizeof(options)); - if (sl_pp_purify(source, &options, &outbuf)) { - slang_info_log_error(infolog, "unable to preprocess the source"); + if (sl_pp_purify(source, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + slang_info_log_error(infolog, errmsg); return GL_FALSE; } -- cgit v1.2.3 From d44cebd1ee7b3e461e264150a28c9d49a0f69f8f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 10 Nov 2009 20:49:45 +0100 Subject: glsl/pp: Add sl_pp_purify_getc(). --- src/glsl/pp/sl_pp_purify.c | 201 +++++++++++++++++++++++++-------------------- src/glsl/pp/sl_pp_purify.h | 19 +++++ 2 files changed, 133 insertions(+), 87 deletions(-) diff --git a/src/glsl/pp/sl_pp_purify.c b/src/glsl/pp/sl_pp_purify.c index 272da1e6ea9..b50f8192517 100644 --- a/src/glsl/pp/sl_pp_purify.c +++ b/src/glsl/pp/sl_pp_purify.c @@ -114,130 +114,150 @@ _purify_backslash(const char *input, } -struct out_buf { - char *out; - unsigned int len; - unsigned int capacity; - unsigned int current_line; - char *errormsg; - unsigned int cberrormsg; -}; - - static void -_report_error(struct out_buf *obuf, +_report_error(char *buf, + unsigned int cbbuf, const char *msg, ...) { va_list args; va_start(args, msg); - vsnprintf(obuf->errormsg, obuf->cberrormsg, msg, args); + vsnprintf(buf, cbbuf, msg, args); va_end(args); } -static int -_out_buf_putc(struct out_buf *obuf, - char c) +void +sl_pp_purify_state_init(struct sl_pp_purify_state *state, + const char *input, + const struct sl_pp_purify_options *options) { - if (obuf->len >= obuf->capacity) { - unsigned int new_max = obuf->capacity; + state->options = *options; + state->input = input; + state->current_line = 1; + state->inside_c_comment = 0; +} - if (new_max < 0x100) { - new_max = 0x100; - } else if (new_max < 0x10000) { - new_max *= 2; - } else { - new_max += 0x10000; - } - obuf->out = realloc(obuf->out, new_max); - if (!obuf->out) { - _report_error(obuf, "out of memory"); - return -1; +unsigned int +_purify_comment(struct sl_pp_purify_state *state, + char *output, + unsigned int *current_line, + char *errormsg, + unsigned int cberrormsg) +{ + for (;;) { + unsigned int eaten; + char next; + + eaten = _purify_backslash(state->input, &next, current_line); + state->input += eaten; + while (next == '*') { + eaten = _purify_backslash(state->input, &next, current_line); + state->input += eaten; + if (next == '/') { + *output = ' '; + state->inside_c_comment = 0; + return 1; + } + } + if (next == '\n') { + *output = '\n'; + state->inside_c_comment = 1; + return 1; + } + if (next == '\0') { + _report_error(errormsg, cberrormsg, "expected `*/' but end of translation unit found"); + return 0; } - obuf->capacity = new_max; } - - obuf->out[obuf->len++] = c; - - return 0; } -static unsigned int -_purify_comment(const char *input, - struct out_buf *obuf) +unsigned int +sl_pp_purify_getc(struct sl_pp_purify_state *state, + char *output, + unsigned int *current_line, + char *errormsg, + unsigned int cberrormsg) { unsigned int eaten; - char curr; - eaten = _purify_backslash(input, &curr, &obuf->current_line); - input += eaten; - if (curr == '/') { + if (state->inside_c_comment) { + return _purify_comment(state, output, current_line, errormsg, cberrormsg); + } + + eaten = _purify_backslash(state->input, output, current_line); + state->input += eaten; + if (*output == '/') { char next; - unsigned int next_eaten; - unsigned int next_line = obuf->current_line; + unsigned int next_line = *current_line; - next_eaten = _purify_backslash(input, &next, &next_line); + eaten = _purify_backslash(state->input, &next, &next_line); if (next == '/') { - eaten += next_eaten; - input += next_eaten; - obuf->current_line = next_line; + state->input += eaten; + *current_line = next_line; /* Replace a line comment with either a newline or nil. */ for (;;) { - next_eaten = _purify_backslash(input, &next, &obuf->current_line); - eaten += next_eaten; - input += next_eaten; + eaten = _purify_backslash(state->input, &next, current_line); + state->input += eaten; if (next == '\n' || next == '\0') { - if (_out_buf_putc(obuf, next)) { - return 0; - } + *output = next; return eaten; } } } else if (next == '*') { - eaten += next_eaten; - input += next_eaten; - obuf->current_line = next_line; + state->input += eaten; + *current_line = next_line; - /* Replace a block comment with a whitespace. */ - for (;;) { - next_eaten = _purify_backslash(input, &next, &obuf->current_line); - eaten += next_eaten; - input += next_eaten; - while (next == '*') { - next_eaten = _purify_backslash(input, &next, &obuf->current_line); - eaten += next_eaten; - input += next_eaten; - if (next == '/') { - if (_out_buf_putc(obuf, ' ')) { - return 0; - } - return eaten; - } - } - if (next == '\n') { - if (_out_buf_putc(obuf, '\n')) { - return 0; - } - } - if (next == '\0') { - _report_error(obuf, "expected `*/' but end of translation unit found"); - return 0; - } - } + return _purify_comment(state, output, current_line, errormsg, cberrormsg); } } - if (_out_buf_putc(obuf, curr)) { - return 0; - } return eaten; } +struct out_buf { + char *out; + unsigned int len; + unsigned int capacity; + unsigned int current_line; + char *errormsg; + unsigned int cberrormsg; +}; + + +static int +_out_buf_putc(struct out_buf *obuf, + char c) +{ + if (obuf->len >= obuf->capacity) { + unsigned int new_max = obuf->capacity; + + if (new_max < 0x100) { + new_max = 0x100; + } else if (new_max < 0x10000) { + new_max *= 2; + } else { + new_max += 0x10000; + } + + obuf->out = realloc(obuf->out, new_max); + if (!obuf->out) { + _report_error(obuf->errormsg, obuf->cberrormsg, "out of memory"); + return -1; + } + obuf->capacity = new_max; + } + + obuf->out[obuf->len++] = c; + + return 0; +} + + int sl_pp_purify(const char *input, const struct sl_pp_purify_options *options, @@ -247,6 +267,7 @@ sl_pp_purify(const char *input, unsigned int *errorline) { struct out_buf obuf; + struct sl_pp_purify_state state; obuf.out = NULL; obuf.len = 0; @@ -255,17 +276,23 @@ sl_pp_purify(const char *input, obuf.errormsg = errormsg; obuf.cberrormsg = cberrormsg; + sl_pp_purify_state_init(&state, input, options); + for (;;) { unsigned int eaten; + char c; - eaten = _purify_comment(input, &obuf); + eaten = sl_pp_purify_getc(&state, &c, &obuf.current_line, errormsg, cberrormsg); if (!eaten) { *errorline = obuf.current_line; return -1; } - input += eaten; + if (_out_buf_putc(&obuf, c)) { + *errorline = obuf.current_line; + return -1; + } - if (obuf.out[obuf.len - 1] == '\0') { + if (c == '\0') { break; } } diff --git a/src/glsl/pp/sl_pp_purify.h b/src/glsl/pp/sl_pp_purify.h index 88ea9c9e7a7..c0f55cbfd89 100644 --- a/src/glsl/pp/sl_pp_purify.h +++ b/src/glsl/pp/sl_pp_purify.h @@ -41,4 +41,23 @@ sl_pp_purify(const char *input, unsigned int cberrormsg, unsigned int *errorline); +struct sl_pp_purify_state { + struct sl_pp_purify_options options; + const char *input; + unsigned int current_line; + unsigned int inside_c_comment:1; +}; + +void +sl_pp_purify_state_init(struct sl_pp_purify_state *state, + const char *input, + const struct sl_pp_purify_options *options); + +unsigned int +sl_pp_purify_getc(struct sl_pp_purify_state *state, + char *output, + unsigned int *current_line, + char *errormsg, + unsigned int cberrormsg); + #endif /* SL_PP_PURIFY_H */ -- cgit v1.2.3 From 08e90bdea1e4828abfdff6fedfe9e669bfee9ff1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 03:00:45 +0100 Subject: glsl/cl: Add a hard-coded syntax parser. --- src/SConscript | 1 + src/glsl/cl/SConscript | 11 + src/glsl/cl/sl_cl_parse.c | 2647 +++++++++++++++++++++++++++++++++++++++++++++ src/glsl/cl/sl_cl_parse.h | 38 + 4 files changed, 2697 insertions(+) create mode 100644 src/glsl/cl/SConscript create mode 100644 src/glsl/cl/sl_cl_parse.c create mode 100644 src/glsl/cl/sl_cl_parse.h diff --git a/src/SConscript b/src/SConscript index 28105f71917..0fe0798b395 100644 --- a/src/SConscript +++ b/src/SConscript @@ -2,6 +2,7 @@ Import('*') SConscript('gallium/SConscript') SConscript('glsl/pp/SConscript') +SConscript('glsl/cl/SConscript') SConscript('glsl/apps/SConscript') if 'mesa' in env['statetrackers']: diff --git a/src/glsl/cl/SConscript b/src/glsl/cl/SConscript new file mode 100644 index 00000000000..9a4e4c15b6d --- /dev/null +++ b/src/glsl/cl/SConscript @@ -0,0 +1,11 @@ +Import('*') + +env = env.Clone() + +glslcl = env.StaticLibrary( + target = 'glslcl', + source = [ + 'sl_cl_parse.c', + ], +) +Export('glslcl') diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c new file mode 100644 index 00000000000..06224b31ec0 --- /dev/null +++ b/src/glsl/cl/sl_cl_parse.c @@ -0,0 +1,2647 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include +#include "../pp/sl_pp_public.h" +#include "sl_cl_parse.h" + + +/* revision number - increment after each change affecting emitted output */ +#define REVISION 5 + +/* external declaration (or precision or invariant stmt) */ +#define EXTERNAL_NULL 0 +#define EXTERNAL_FUNCTION_DEFINITION 1 +#define EXTERNAL_DECLARATION 2 +#define DEFAULT_PRECISION 3 +#define INVARIANT_STMT 4 + +/* precision */ +#define PRECISION_DEFAULT 0 +#define PRECISION_LOW 1 +#define PRECISION_MEDIUM 2 +#define PRECISION_HIGH 3 + +/* declaration */ +#define DECLARATION_FUNCTION_PROTOTYPE 1 +#define DECLARATION_INIT_DECLARATOR_LIST 2 + +/* function type */ +#define FUNCTION_ORDINARY 0 +#define FUNCTION_CONSTRUCTOR 1 +#define FUNCTION_OPERATOR 2 + +/* function call type */ +#define FUNCTION_CALL_NONARRAY 0 +#define FUNCTION_CALL_ARRAY 1 + +/* operator type */ +#define OPERATOR_ADDASSIGN 1 +#define OPERATOR_SUBASSIGN 2 +#define OPERATOR_MULASSIGN 3 +#define OPERATOR_DIVASSIGN 4 +/*#define OPERATOR_MODASSIGN 5*/ +/*#define OPERATOR_LSHASSIGN 6*/ +/*#define OPERATOR_RSHASSIGN 7*/ +/*#define OPERATOR_ORASSIGN 8*/ +/*#define OPERATOR_XORASSIGN 9*/ +/*#define OPERATOR_ANDASSIGN 10*/ +#define OPERATOR_LOGICALXOR 11 +/*#define OPERATOR_BITOR 12*/ +/*#define OPERATOR_BITXOR 13*/ +/*#define OPERATOR_BITAND 14*/ +#define OPERATOR_LESS 15 +#define OPERATOR_GREATER 16 +#define OPERATOR_LESSEQUAL 17 +#define OPERATOR_GREATEREQUAL 18 +/*#define OPERATOR_LSHIFT 19*/ +/*#define OPERATOR_RSHIFT 20*/ +#define OPERATOR_MULTIPLY 21 +#define OPERATOR_DIVIDE 22 +/*#define OPERATOR_MODULUS 23*/ +#define OPERATOR_INCREMENT 24 +#define OPERATOR_DECREMENT 25 +#define OPERATOR_PLUS 26 +#define OPERATOR_MINUS 27 +/*#define OPERATOR_COMPLEMENT 28*/ +#define OPERATOR_NOT 29 + +/* init declarator list */ +#define DECLARATOR_NONE 0 +#define DECLARATOR_NEXT 1 + +/* variable declaration */ +#define VARIABLE_NONE 0 +#define VARIABLE_IDENTIFIER 1 +#define VARIABLE_INITIALIZER 2 +#define VARIABLE_ARRAY_EXPLICIT 3 +#define VARIABLE_ARRAY_UNKNOWN 4 + +/* type qualifier */ +#define TYPE_QUALIFIER_NONE 0 +#define TYPE_QUALIFIER_CONST 1 +#define TYPE_QUALIFIER_ATTRIBUTE 2 +#define TYPE_QUALIFIER_VARYING 3 +#define TYPE_QUALIFIER_UNIFORM 4 +#define TYPE_QUALIFIER_FIXEDOUTPUT 5 +#define TYPE_QUALIFIER_FIXEDINPUT 6 + +/* invariant qualifier */ +#define TYPE_VARIANT 90 +#define TYPE_INVARIANT 91 + +/* centroid qualifier */ +#define TYPE_CENTER 95 +#define TYPE_CENTROID 96 + +/* type specifier */ +#define TYPE_SPECIFIER_VOID 0 +#define TYPE_SPECIFIER_BOOL 1 +#define TYPE_SPECIFIER_BVEC2 2 +#define TYPE_SPECIFIER_BVEC3 3 +#define TYPE_SPECIFIER_BVEC4 4 +#define TYPE_SPECIFIER_INT 5 +#define TYPE_SPECIFIER_IVEC2 6 +#define TYPE_SPECIFIER_IVEC3 7 +#define TYPE_SPECIFIER_IVEC4 8 +#define TYPE_SPECIFIER_FLOAT 9 +#define TYPE_SPECIFIER_VEC2 10 +#define TYPE_SPECIFIER_VEC3 11 +#define TYPE_SPECIFIER_VEC4 12 +#define TYPE_SPECIFIER_MAT2 13 +#define TYPE_SPECIFIER_MAT3 14 +#define TYPE_SPECIFIER_MAT4 15 +#define TYPE_SPECIFIER_SAMPLER1D 16 +#define TYPE_SPECIFIER_SAMPLER2D 17 +#define TYPE_SPECIFIER_SAMPLER3D 18 +#define TYPE_SPECIFIER_SAMPLERCUBE 19 +#define TYPE_SPECIFIER_SAMPLER1DSHADOW 20 +#define TYPE_SPECIFIER_SAMPLER2DSHADOW 21 +#define TYPE_SPECIFIER_SAMPLER2DRECT 22 +#define TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23 +#define TYPE_SPECIFIER_STRUCT 24 +#define TYPE_SPECIFIER_TYPENAME 25 + +/* OpenGL 2.1 */ +#define TYPE_SPECIFIER_MAT23 26 +#define TYPE_SPECIFIER_MAT32 27 +#define TYPE_SPECIFIER_MAT24 28 +#define TYPE_SPECIFIER_MAT42 29 +#define TYPE_SPECIFIER_MAT34 30 +#define TYPE_SPECIFIER_MAT43 31 + +/* type specifier array */ +#define TYPE_SPECIFIER_NONARRAY 0 +#define TYPE_SPECIFIER_ARRAY 1 + +/* structure field */ +#define FIELD_NONE 0 +#define FIELD_NEXT 1 +#define FIELD_ARRAY 2 + +/* operation */ +#define OP_END 0 +#define OP_BLOCK_BEGIN_NO_NEW_SCOPE 1 +#define OP_BLOCK_BEGIN_NEW_SCOPE 2 +#define OP_DECLARE 3 +#define OP_ASM 4 +#define OP_BREAK 5 +#define OP_CONTINUE 6 +#define OP_DISCARD 7 +#define OP_RETURN 8 +#define OP_EXPRESSION 9 +#define OP_IF 10 +#define OP_WHILE 11 +#define OP_DO 12 +#define OP_FOR 13 +#define OP_PUSH_VOID 14 +#define OP_PUSH_BOOL 15 +#define OP_PUSH_INT 16 +#define OP_PUSH_FLOAT 17 +#define OP_PUSH_IDENTIFIER 18 +#define OP_SEQUENCE 19 +#define OP_ASSIGN 20 +#define OP_ADDASSIGN 21 +#define OP_SUBASSIGN 22 +#define OP_MULASSIGN 23 +#define OP_DIVASSIGN 24 +/*#define OP_MODASSIGN 25*/ +/*#define OP_LSHASSIGN 26*/ +/*#define OP_RSHASSIGN 27*/ +/*#define OP_ORASSIGN 28*/ +/*#define OP_XORASSIGN 29*/ +/*#define OP_ANDASSIGN 30*/ +#define OP_SELECT 31 +#define OP_LOGICALOR 32 +#define OP_LOGICALXOR 33 +#define OP_LOGICALAND 34 +/*#define OP_BITOR 35*/ +/*#define OP_BITXOR 36*/ +/*#define OP_BITAND 37*/ +#define OP_EQUAL 38 +#define OP_NOTEQUAL 39 +#define OP_LESS 40 +#define OP_GREATER 41 +#define OP_LESSEQUAL 42 +#define OP_GREATEREQUAL 43 +/*#define OP_LSHIFT 44*/ +/*#define OP_RSHIFT 45*/ +#define OP_ADD 46 +#define OP_SUBTRACT 47 +#define OP_MULTIPLY 48 +#define OP_DIVIDE 49 +/*#define OP_MODULUS 50*/ +#define OP_PREINCREMENT 51 +#define OP_PREDECREMENT 52 +#define OP_PLUS 53 +#define OP_MINUS 54 +/*#define OP_COMPLEMENT 55*/ +#define OP_NOT 56 +#define OP_SUBSCRIPT 57 +#define OP_CALL 58 +#define OP_FIELD 59 +#define OP_POSTINCREMENT 60 +#define OP_POSTDECREMENT 61 +#define OP_PRECISION 62 +#define OP_METHOD 63 + +/* parameter qualifier */ +#define PARAM_QUALIFIER_IN 0 +#define PARAM_QUALIFIER_OUT 1 +#define PARAM_QUALIFIER_INOUT 2 + +/* function parameter */ +#define PARAMETER_NONE 0 +#define PARAMETER_NEXT 1 + +/* function parameter array presence */ +#define PARAMETER_ARRAY_NOT_PRESENT 0 +#define PARAMETER_ARRAY_PRESENT 1 + + +struct parse_dict { + int _void; + int _float; + int _int; + int _bool; + int vec2; + int vec3; + int vec4; + int bvec2; + int bvec3; + int bvec4; + int ivec2; + int ivec3; + int ivec4; + int mat2; + int mat3; + int mat4; + int mat2x3; + int mat3x2; + int mat2x4; + int mat4x2; + int mat3x4; + int mat4x3; + int sampler1D; + int sampler2D; + int sampler3D; + int samplerCube; + int sampler1DShadow; + int sampler2DShadow; + int sampler2DRect; + int sampler2DRectShadow; + + int invariant; + + int centroid; + + int precision; + int lowp; + int mediump; + int highp; + + int _const; + int attribute; + int varying; + int uniform; + int __fixed_output; + int __fixed_input; + + int in; + int out; + int inout; + + int _struct; + + int __constructor; + int __operator; + int ___asm; + + int _if; + int _else; + int _for; + int _while; + int _do; + + int _continue; + int _break; + int _return; + int discard; + + int _false; + int _true; +}; + + +struct parse_context { + struct sl_pp_context *context; + const struct sl_pp_token_info *input; + + struct parse_dict dict; + + unsigned char *out_buf; + unsigned int out_cap; + + unsigned int shader_type; + unsigned int parsing_builtin; +}; + + +struct parse_state { + unsigned int in; + unsigned int out; +}; + + +static __inline unsigned int +_emit(struct parse_context *ctx, + unsigned int *out, + unsigned char b) +{ + if (*out == ctx->out_cap) { + ctx->out_cap += 4096; + ctx->out_buf = (unsigned char *)realloc(ctx->out_buf, ctx->out_cap * sizeof(unsigned char)); + } + ctx->out_buf[*out] = b; + return (*out)++; +} + + +static void +_update(struct parse_context *ctx, + unsigned int out, + unsigned char b) +{ + ctx->out_buf[out] = b; +} + + +static int +_parse_token(struct parse_context *ctx, + enum sl_pp_token token, + struct parse_state *ps) +{ + if (ctx->input[ps->in].token == token) { + ps->in++; + return 0; + } + return -1; +} + + +static int +_parse_id(struct parse_context *ctx, + int id, + struct parse_state *ps) +{ + if (ctx->input[ps->in].token == SL_PP_IDENTIFIER && + ctx->input[ps->in].data.identifier == id) { + ps->in++; + return 0; + } + return -1; +} + + +static int +_parse_identifier(struct parse_context *ctx, + struct parse_state *ps) +{ + if (ctx->input[ps->in].token == SL_PP_IDENTIFIER) { + const char *cstr = sl_pp_context_cstr(ctx->context, ctx->input[ps->in].data.identifier); + + do { + _emit(ctx, &ps->out, *cstr); + } while (*cstr++); + ps->in++; + return 0; + } + return -1; +} + + +static int +_parse_float(struct parse_context *ctx, + struct parse_state *ps) +{ + if (ctx->input[ps->in].token == SL_PP_FLOAT) { + const char *cstr = sl_pp_context_cstr(ctx->context, ctx->input[ps->in].data._float); + + _emit(ctx, &ps->out, 1); + do { + _emit(ctx, &ps->out, *cstr); + } while (*cstr++); + ps->in++; + return 0; + } + return -1; +} + + +static int +_parse_uint(struct parse_context *ctx, + struct parse_state *ps) +{ + if (ctx->input[ps->in].token == SL_PP_UINT) { + const char *cstr = sl_pp_context_cstr(ctx->context, ctx->input[ps->in].data._uint); + + _emit(ctx, &ps->out, 1); + do { + _emit(ctx, &ps->out, *cstr); + } while (*cstr++); + ps->in++; + return 0; + } + return -1; +} + + +/**************************************/ + + +static int +_parse_unary_expression(struct parse_context *ctx, + struct parse_state *ps); + +static int +_parse_conditional_expression(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_constant_expression(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_primary_expression(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_statement(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_type_specifier(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_declaration(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_statement_list(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_assignment_expression(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_precision(struct parse_context *ctx, + struct parse_state *ps); + + +static int +_parse_overriden_operator(struct parse_context *ctx, + struct parse_state *ps) +{ + unsigned int op; + + if (_parse_token(ctx, SL_PP_INCREMENT, ps) == 0) { + op = OPERATOR_INCREMENT; + } else if (_parse_token(ctx, SL_PP_ADDASSIGN, ps) == 0) { + op = OPERATOR_ADDASSIGN; + } else if (_parse_token(ctx, SL_PP_PLUS, ps) == 0) { + op = OPERATOR_PLUS; + } else if (_parse_token(ctx, SL_PP_DECREMENT, ps) == 0) { + op = OPERATOR_DECREMENT; + } else if (_parse_token(ctx, SL_PP_SUBASSIGN, ps) == 0) { + op = OPERATOR_SUBASSIGN; + } else if (_parse_token(ctx, SL_PP_MINUS, ps) == 0) { + op = OPERATOR_MINUS; + } else if (_parse_token(ctx, SL_PP_NOT, ps) == 0) { + op = OPERATOR_NOT; + } else if (_parse_token(ctx, SL_PP_MULASSIGN, ps) == 0) { + op = OPERATOR_MULASSIGN; + } else if (_parse_token(ctx, SL_PP_STAR, ps) == 0) { + op = OPERATOR_MULTIPLY; + } else if (_parse_token(ctx, SL_PP_DIVASSIGN, ps) == 0) { + op = OPERATOR_DIVASSIGN; + } else if (_parse_token(ctx, SL_PP_SLASH, ps) == 0) { + op = OPERATOR_DIVIDE; + } else if (_parse_token(ctx, SL_PP_LESSEQUAL, ps) == 0) { + op = OPERATOR_LESSEQUAL; + } else if (_parse_token(ctx, SL_PP_LESS, ps) == 0) { + op = OPERATOR_LESS; + } else if (_parse_token(ctx, SL_PP_GREATEREQUAL, ps) == 0) { + op = OPERATOR_GREATEREQUAL; + } else if (_parse_token(ctx, SL_PP_GREATER, ps) == 0) { + op = OPERATOR_GREATER; + } else if (_parse_token(ctx, SL_PP_XOR, ps) == 0) { + op = OPERATOR_LOGICALXOR; + } else { + return -1; + } + + _emit(ctx, &ps->out, op); + return 0; +} + + +static int +_parse_function_decl_identifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, 0); + + if (ctx->parsing_builtin && _parse_id(ctx, ctx->dict.__constructor, &p) == 0) { + _update(ctx, e, FUNCTION_CONSTRUCTOR); + *ps = p; + return 0; + } + + if (ctx->parsing_builtin && _parse_id(ctx, ctx->dict.__operator, &p) == 0) { + _update(ctx, e, FUNCTION_OPERATOR); + if (_parse_overriden_operator(ctx, &p) == 0) { + *ps = p; + return 0; + } + return -1; + } + + if (_parse_identifier(ctx, &p) == 0) { + _update(ctx, e, FUNCTION_ORDINARY); + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_invariant_qualifier(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_id(ctx, ctx->dict.invariant, ps)) { + return -1; + } + _emit(ctx, &ps->out, TYPE_INVARIANT); + return 0; +} + + +static int +_parse_centroid_qualifier(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_id(ctx, ctx->dict.centroid, ps)) { + return -1; + } + _emit(ctx, &ps->out, TYPE_CENTROID); + return 0; +} + + +static int +_parse_type_qualifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, 0); + int id; + + if (ctx->input[p.in].token != SL_PP_IDENTIFIER) { + return -1; + } + id = ctx->input[p.in].data.identifier; + + if (id == ctx->dict._const) { + _update(ctx, e, TYPE_QUALIFIER_CONST); + } else if (ctx->shader_type == 2 && id == ctx->dict.attribute) { + _update(ctx, e, TYPE_QUALIFIER_ATTRIBUTE); + } else if (id == ctx->dict.varying) { + _update(ctx, e, TYPE_QUALIFIER_VARYING); + } else if (id == ctx->dict.uniform) { + _update(ctx, e, TYPE_QUALIFIER_UNIFORM); + } else if (ctx->parsing_builtin && id == ctx->dict.__fixed_output) { + _update(ctx, e, TYPE_QUALIFIER_FIXEDOUTPUT); + } else if (ctx->parsing_builtin && id == ctx->dict.__fixed_input) { + _update(ctx, e, TYPE_QUALIFIER_FIXEDINPUT); + } else { + return -1; + } + _parse_token(ctx, SL_PP_IDENTIFIER, &p); + *ps = p; + return 0; +} + + +static int +_parse_struct_declarator(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e; + + if (_parse_identifier(ctx, &p)) { + return -1; + } + e = _emit(ctx, &p.out, FIELD_NONE); + *ps = p; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p)) { + return 0; + } + if (_parse_constant_expression(ctx, &p)) { + return 0; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return 0; + } + _update(ctx, e, FIELD_ARRAY); + *ps = p; + return 0; +} + + +static int +_parse_struct_declarator_list(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_struct_declarator(ctx, &p)) { + return -1; + } + + for (;;) { + *ps = p; + _emit(ctx, &p.out, FIELD_NEXT); + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + return 0; + } + if (_parse_struct_declarator(ctx, &p)) { + return 0; + } + } +} + + +static int +_parse_struct_declaration(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_type_specifier(ctx, &p)) { + return -1; + } + if (_parse_struct_declarator_list(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + _emit(ctx, &p.out, FIELD_NONE); + *ps = p; + return 0; +} + + +static int +_parse_struct_declaration_list(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_struct_declaration(ctx, &p)) { + return -1; + } + + for (;;) { + *ps = p; + _emit(ctx, &p.out, FIELD_NEXT); + if (_parse_struct_declaration(ctx, &p)) { + return 0; + } + } +} + + +static int +_parse_struct_specifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_id(ctx, ctx->dict._struct, &p)) { + return -1; + } + if (_parse_identifier(ctx, &p)) { + _emit(ctx, &p.out, '\0'); + } + if (_parse_token(ctx, SL_PP_LBRACE, &p)) { + return -1; + } + if (_parse_struct_declaration_list(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RBRACE, &p)) { + return -1; + } + _emit(ctx, &p.out, FIELD_NONE); + *ps = p; + return 0; +} + + +static int +_parse_type_specifier_nonarray(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, 0); + int id; + + if (_parse_struct_specifier(ctx, &p) == 0) { + _update(ctx, e, TYPE_SPECIFIER_STRUCT); + *ps = p; + return 0; + } + + if (ctx->input[p.in].token != SL_PP_IDENTIFIER) { + return -1; + } + id = ctx->input[p.in].data.identifier; + + if (id == ctx->dict._void) { + _update(ctx, e, TYPE_SPECIFIER_VOID); + } else if (id == ctx->dict._float) { + _update(ctx, e, TYPE_SPECIFIER_FLOAT); + } else if (id == ctx->dict._int) { + _update(ctx, e, TYPE_SPECIFIER_INT); + } else if (id == ctx->dict._bool) { + _update(ctx, e, TYPE_SPECIFIER_BOOL); + } else if (id == ctx->dict.vec2) { + _update(ctx, e, TYPE_SPECIFIER_VEC2); + } else if (id == ctx->dict.vec3) { + _update(ctx, e, TYPE_SPECIFIER_VEC3); + } else if (id == ctx->dict.vec4) { + _update(ctx, e, TYPE_SPECIFIER_VEC4); + } else if (id == ctx->dict.bvec2) { + _update(ctx, e, TYPE_SPECIFIER_BVEC2); + } else if (id == ctx->dict.bvec3) { + _update(ctx, e, TYPE_SPECIFIER_BVEC3); + } else if (id == ctx->dict.bvec4) { + _update(ctx, e, TYPE_SPECIFIER_BVEC4); + } else if (id == ctx->dict.ivec2) { + _update(ctx, e, TYPE_SPECIFIER_IVEC2); + } else if (id == ctx->dict.ivec3) { + _update(ctx, e, TYPE_SPECIFIER_IVEC3); + } else if (id == ctx->dict.ivec4) { + _update(ctx, e, TYPE_SPECIFIER_IVEC4); + } else if (id == ctx->dict.mat2) { + _update(ctx, e, TYPE_SPECIFIER_MAT2); + } else if (id == ctx->dict.mat3) { + _update(ctx, e, TYPE_SPECIFIER_MAT3); + } else if (id == ctx->dict.mat4) { + _update(ctx, e, TYPE_SPECIFIER_MAT4); + } else if (id == ctx->dict.mat2x3) { + _update(ctx, e, TYPE_SPECIFIER_MAT23); + } else if (id == ctx->dict.mat3x2) { + _update(ctx, e, TYPE_SPECIFIER_MAT32); + } else if (id == ctx->dict.mat2x4) { + _update(ctx, e, TYPE_SPECIFIER_MAT24); + } else if (id == ctx->dict.mat4x2) { + _update(ctx, e, TYPE_SPECIFIER_MAT42); + } else if (id == ctx->dict.mat3x4) { + _update(ctx, e, TYPE_SPECIFIER_MAT34); + } else if (id == ctx->dict.mat4x3) { + _update(ctx, e, TYPE_SPECIFIER_MAT43); + } else if (id == ctx->dict.sampler1D) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER1D); + } else if (id == ctx->dict.sampler2D) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER2D); + } else if (id == ctx->dict.sampler3D) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER3D); + } else if (id == ctx->dict.samplerCube) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLERCUBE); + } else if (id == ctx->dict.sampler1DShadow) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER1DSHADOW); + } else if (id == ctx->dict.sampler2DShadow) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER2DSHADOW); + } else if (id == ctx->dict.sampler2DRect) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECT); + } else if (id == ctx->dict.sampler2DRectShadow) { + _update(ctx, e, TYPE_SPECIFIER_SAMPLER2DRECTSHADOW); + } else if (_parse_identifier(ctx, &p) == 0) { + _update(ctx, e, TYPE_SPECIFIER_TYPENAME); + *ps = p; + return 0; + } else { + return -1; + } + + _parse_token(ctx, SL_PP_IDENTIFIER, &p); + *ps = p; + return 0; +} + + +static int +_parse_type_specifier_array(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p)) { + return -1; + } + if (_parse_constant_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_type_specifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e; + + if (_parse_type_specifier_nonarray(ctx, &p)) { + return -1; + } + + e = _emit(ctx, &p.out, TYPE_SPECIFIER_ARRAY); + if (_parse_type_specifier_array(ctx, &p)) { + _update(ctx, e, TYPE_SPECIFIER_NONARRAY); + } + *ps = p; + return 0; +} + + +static int +_parse_fully_specified_type(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_invariant_qualifier(ctx, &p)) { + _emit(ctx, &p.out, TYPE_VARIANT); + } + if (_parse_centroid_qualifier(ctx, &p)) { + _emit(ctx, &p.out, TYPE_CENTER); + } + if (_parse_type_qualifier(ctx, &p)) { + _emit(ctx, &p.out, TYPE_QUALIFIER_NONE); + } + if (_parse_precision(ctx, &p)) { + _emit(ctx, &p.out, PRECISION_DEFAULT); + } + if (_parse_type_specifier(ctx, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_function_header(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_fully_specified_type(ctx, &p)) { + return -1; + } + if (_parse_function_decl_identifier(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_parameter_qualifier(struct parse_context *ctx, + struct parse_state *ps) +{ + unsigned int e = _emit(ctx, &ps->out, PARAM_QUALIFIER_IN); + + if (_parse_id(ctx, ctx->dict.out, ps) == 0) { + _update(ctx, e, PARAM_QUALIFIER_OUT); + } else if (_parse_id(ctx, ctx->dict.inout, ps) == 0) { + _update(ctx, e, PARAM_QUALIFIER_INOUT); + } else { + _parse_id(ctx, ctx->dict.in, ps); + } + return 0; +} + + +static int +_parse_function_identifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + unsigned int e; + + if (_parse_identifier(ctx, ps)) { + return -1; + } + e = _emit(ctx, &ps->out, FUNCTION_CALL_NONARRAY); + + p = *ps; + if (_parse_token(ctx, SL_PP_LBRACKET, &p)) { + return 0; + } + if (_parse_constant_expression(ctx, &p)) { + return 0; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return 0; + } + _update(ctx, e, FUNCTION_CALL_ARRAY); + *ps = p; + return 0; +} + + +static int +_parse_function_call_header(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_identifier(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_assign_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int op; + + if (_parse_unary_expression(ctx, &p)) { + return -1; + } + + if (_parse_token(ctx, SL_PP_ASSIGN, &p) == 0) { + op = OP_ASSIGN; + } else if (_parse_token(ctx, SL_PP_MULASSIGN, &p) == 0) { + op = OP_MULASSIGN; + } else if (_parse_token(ctx, SL_PP_DIVASSIGN, &p) == 0) { + op = OP_DIVASSIGN; + } else if (_parse_token(ctx, SL_PP_ADDASSIGN, &p) == 0) { + op = OP_ADDASSIGN; + } else if (_parse_token(ctx, SL_PP_SUBASSIGN, &p) == 0) { + op = OP_SUBASSIGN; + } else { + return -1; + } + + if (_parse_assignment_expression(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, op); + + *ps = p; + return 0; +} + + +static int +_parse_assignment_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_assign_expression(ctx, ps) == 0) { + return 0; + } + + if (_parse_conditional_expression(ctx, ps) == 0) { + return 0; + } + + return -1; +} + + +static int +_parse_function_call_header_with_parameters(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_call_header(ctx, &p)) { + return -1; + } + if (_parse_assignment_expression(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + return 0; + } + if (_parse_assignment_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_END); + } +} + + +static int +_parse_function_call_header_no_parameters(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_function_call_header(ctx, ps)) { + return -1; + } + _parse_id(ctx, ctx->dict._void, ps); + return 0; +} + + +static int +_parse_function_call_generic(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_call_header_with_parameters(ctx, &p) == 0) { + if (_parse_token(ctx, SL_PP_RPAREN, &p) == 0) { + *ps = p; + return 0; + } + } + + p = *ps; + if (_parse_function_call_header_no_parameters(ctx, &p) == 0) { + if (_parse_token(ctx, SL_PP_RPAREN, &p) == 0) { + *ps = p; + return 0; + } + } + + return -1; +} + + +static int +_parse_method_call(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_METHOD); + if (_parse_identifier(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_DOT, &p)) { + return -1; + } + if (_parse_function_call_generic(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_regular_function_call(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_CALL); + if (_parse_function_call_generic(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_function_call(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_regular_function_call(ctx, ps) == 0) { + return 0; + } + + if (_parse_method_call(ctx, ps) == 0) { + return 0; + } + + return -1; +} + + +static int +_parse_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_assignment_expression(ctx, &p)) { + return -1; + } + + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + return 0; + } + if (_parse_assignment_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_SEQUENCE); + } +} + + +static int +_parse_postfix_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + + if (_parse_function_call(ctx, ps)) { + if (_parse_primary_expression(ctx, ps)) { + return -1; + } + } + + for (p = *ps;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_INCREMENT, &p) == 0) { + _emit(ctx, &p.out, OP_POSTINCREMENT); + } else if (_parse_token(ctx, SL_PP_DECREMENT, &p) == 0) { + _emit(ctx, &p.out, OP_POSTDECREMENT); + } else if (_parse_token(ctx, SL_PP_LBRACKET, &p) == 0) { + if (_parse_expression(ctx, &p)) { + return 0; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_SUBSCRIPT); + } else if (_parse_token(ctx, SL_PP_DOT, &p) == 0) { + _emit(ctx, &p.out, OP_FIELD); + if (_parse_identifier(ctx, &p)) { + return 0; + } + } else { + return 0; + } + } +} + + +static int +_parse_unary_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + unsigned int op; + + if (_parse_postfix_expression(ctx, ps) == 0) { + return 0; + } + + p = *ps; + if (_parse_token(ctx, SL_PP_INCREMENT, &p) == 0) { + op = OP_PREINCREMENT; + } else if (_parse_token(ctx, SL_PP_DECREMENT, &p) == 0) { + op = OP_PREDECREMENT; + } else if (_parse_token(ctx, SL_PP_PLUS, &p) == 0) { + op = OP_PLUS; + } else if (_parse_token(ctx, SL_PP_MINUS, &p) == 0) { + op = OP_MINUS; + } else if (_parse_token(ctx, SL_PP_NOT, &p) == 0) { + op = OP_NOT; + } else { + return -1; + } + + if (_parse_unary_expression(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, op); + *ps = p; + return 0; +} + + +static int +_parse_multiplicative_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_unary_expression(ctx, &p)) { + return -1; + } + for (;;) { + unsigned int op; + + *ps = p; + if (_parse_token(ctx, SL_PP_STAR, &p) == 0) { + op = OP_MULTIPLY; + } else if (_parse_token(ctx, SL_PP_SLASH, &p) == 0) { + op = OP_DIVIDE; + } else { + return 0; + } + if (_parse_unary_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, op); + } +} + + +static int +_parse_additive_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_multiplicative_expression(ctx, &p)) { + return -1; + } + for (;;) { + unsigned int op; + + *ps = p; + if (_parse_token(ctx, SL_PP_PLUS, &p) == 0) { + op = OP_ADD; + } else if (_parse_token(ctx, SL_PP_MINUS, &p) == 0) { + op = OP_SUBTRACT; + } else { + return 0; + } + if (_parse_multiplicative_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, op); + } +} + + +static int +_parse_relational_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_additive_expression(ctx, &p)) { + return -1; + } + for (;;) { + unsigned int op; + + *ps = p; + if (_parse_token(ctx, SL_PP_LESS, &p) == 0) { + op = OP_LESS; + } else if (_parse_token(ctx, SL_PP_GREATER, &p) == 0) { + op = OP_GREATER; + } else if (_parse_token(ctx, SL_PP_LESSEQUAL, &p) == 0) { + op = OP_LESSEQUAL; + } else if (_parse_token(ctx, SL_PP_GREATEREQUAL, &p) == 0) { + op = OP_GREATEREQUAL; + } else { + return 0; + } + if (_parse_additive_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, op); + } +} + + +static int +_parse_equality_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_relational_expression(ctx, &p)) { + return -1; + } + for (;;) { + unsigned int op; + + *ps = p; + if (_parse_token(ctx, SL_PP_EQUAL, &p) == 0) { + op = OP_EQUAL; + } else if (_parse_token(ctx, SL_PP_NOTEQUAL, &p) == 0) { + op = OP_NOTEQUAL; + } else { + return 0; + } + if (_parse_relational_expression(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, op); + } +} + + +static int +_parse_logical_and_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_equality_expression(ctx, &p)) { + return -1; + } + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_AND, &p)) { + return 0; + } + if (_parse_equality_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_LOGICALAND); + } +} + + +static int +_parse_logical_xor_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_logical_and_expression(ctx, &p)) { + return -1; + } + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_XOR, &p)) { + return 0; + } + if (_parse_logical_and_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_LOGICALXOR); + } +} + + +static int +_parse_logical_or_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_logical_xor_expression(ctx, &p)) { + return -1; + } + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_OR, &p)) { + return 0; + } + if (_parse_logical_xor_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_LOGICALOR); + } +} + + +static int +_parse_conditional_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_logical_or_expression(ctx, &p)) { + return -1; + } + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_QUESTION, &p)) { + return 0; + } + if (_parse_expression(ctx, &p)) { + return 0; + } + if (_parse_token(ctx, SL_PP_COLON, &p)) { + return 0; + } + if (_parse_conditional_expression(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_SELECT); + } +} + + +static int +_parse_constant_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_conditional_expression(ctx, ps)) { + return -1; + } + _emit(ctx, &ps->out, OP_END); + return 0; +} + + +static int +_parse_parameter_declarator_array(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p)) { + return -1; + } + if (_parse_constant_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_parameter_declarator(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e; + + if (_parse_type_specifier(ctx, &p)) { + return -1; + } + if (_parse_identifier(ctx, &p)) { + return -1; + } + e = _emit(ctx, &p.out, PARAMETER_ARRAY_PRESENT); + if (_parse_parameter_declarator_array(ctx, &p)) { + _update(ctx, e, PARAMETER_ARRAY_NOT_PRESENT); + } + *ps = p; + return 0; +} + + +static int +_parse_parameter_type_specifier_array(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p)) { + return -1; + } + if (_parse_constant_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_parameter_type_specifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e; + + if (_parse_type_specifier(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, '\0'); + + e = _emit(ctx, &p.out, PARAMETER_ARRAY_PRESENT); + if (_parse_parameter_type_specifier_array(ctx, &p)) { + _update(ctx, e, PARAMETER_ARRAY_NOT_PRESENT); + } + *ps = p; + return 0; +} + + +static int +_parse_parameter_declaration(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, PARAMETER_NEXT); + + if (_parse_type_qualifier(ctx, &p)) { + _emit(ctx, &p.out, TYPE_QUALIFIER_NONE); + } + _parse_parameter_qualifier(ctx, &p); + if (_parse_precision(ctx, &p)) { + _emit(ctx, &p.out, PRECISION_DEFAULT); + } + if (_parse_parameter_declarator(ctx, &p) == 0) { + *ps = p; + return 0; + } + if (_parse_parameter_type_specifier(ctx, &p) == 0) { + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_function_header_with_parameters(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_header(ctx, &p)) { + return -1; + } + if (_parse_parameter_declaration(ctx, &p)) { + return -1; + } + + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + return 0; + } + if (_parse_parameter_declaration(ctx, &p)) { + return 0; + } + } +} + + +static int +_parse_function_declarator(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_function_header_with_parameters(ctx, ps) == 0) { + return 0; + } + + if (_parse_function_header(ctx, ps) == 0) { + return 0; + } + + return -1; +} + + +static int +_parse_function_prototype(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_header(ctx, &p) == 0) { + if (_parse_id(ctx, ctx->dict._void, &p) == 0) { + if (_parse_token(ctx, SL_PP_RPAREN, &p) == 0) { + _emit(ctx, &p.out, PARAMETER_NONE); + *ps = p; + return 0; + } + } + } + + p = *ps; + if (_parse_function_declarator(ctx, &p) == 0) { + if (_parse_token(ctx, SL_PP_RPAREN, &p) == 0) { + _emit(ctx, &p.out, PARAMETER_NONE); + *ps = p; + return 0; + } + } + + return -1; +} + + +static int +_parse_precision(struct parse_context *ctx, + struct parse_state *ps) +{ + int id; + unsigned int precision; + + if (ctx->input[ps->in].token != SL_PP_IDENTIFIER) { + return -1; + } + id = ctx->input[ps->in].data.identifier; + + if (id == ctx->dict.lowp) { + precision = PRECISION_LOW; + } else if (id == ctx->dict.mediump) { + precision = PRECISION_MEDIUM; + } else if (id == ctx->dict.highp) { + precision = PRECISION_HIGH; + } else { + return -1; + } + + _parse_token(ctx, SL_PP_IDENTIFIER, ps); + _emit(ctx, &ps->out, precision); + return 0; +} + + +static int +_parse_prectype(struct parse_context *ctx, + struct parse_state *ps) +{ + int id; + unsigned int type; + + if (ctx->input[ps->in].token != SL_PP_IDENTIFIER) { + return -1; + } + id = ctx->input[ps->in].data.identifier; + + if (id == ctx->dict._int) { + type = TYPE_SPECIFIER_INT; + } else if (id == ctx->dict._float) { + type = TYPE_SPECIFIER_FLOAT; + } else if (id == ctx->dict.sampler1D) { + type = TYPE_SPECIFIER_SAMPLER1D; + } else if (id == ctx->dict.sampler2D) { + type = TYPE_SPECIFIER_SAMPLER2D; + } else if (id == ctx->dict.sampler3D) { + type = TYPE_SPECIFIER_SAMPLER3D; + } else if (id == ctx->dict.samplerCube) { + type = TYPE_SPECIFIER_SAMPLERCUBE; + } else if (id == ctx->dict.sampler1DShadow) { + type = TYPE_SPECIFIER_SAMPLER1DSHADOW; + } else if (id == ctx->dict.sampler2DShadow) { + type = TYPE_SPECIFIER_SAMPLER2DSHADOW; + } else if (id == ctx->dict.sampler2DRect) { + type = TYPE_SPECIFIER_SAMPLER2DRECT; + } else if (id == ctx->dict.sampler2DRectShadow) { + type = TYPE_SPECIFIER_SAMPLER2DRECTSHADOW; + } else { + return -1; + } + + _parse_token(ctx, SL_PP_IDENTIFIER, ps); + _emit(ctx, &ps->out, type); + return 0; +} + + +static int +_parse_precision_stmt(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_id(ctx, ctx->dict.precision, &p)) { + return -1; + } + if (_parse_precision(ctx, &p)) { + return -1; + } + if (_parse_prectype(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_floatconstant(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_PUSH_FLOAT); + if (_parse_float(ctx, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_intconstant(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_PUSH_INT); + if (_parse_uint(ctx, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_boolconstant(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_id(ctx, ctx->dict._false, ps) == 0) { + _emit(ctx, &ps->out, OP_PUSH_BOOL); + _emit(ctx, &ps->out, '0'); + _emit(ctx, &ps->out, '\0'); + return 0; + } + + if (_parse_id(ctx, ctx->dict._true, ps) == 0) { + _emit(ctx, &ps->out, OP_PUSH_BOOL); + _emit(ctx, &ps->out, '1'); + _emit(ctx, &ps->out, '\0'); + return 0; + } + + return -1; +} + + +static int +_parse_variable_identifier(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_PUSH_IDENTIFIER); + if (_parse_identifier(ctx, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_primary_expression(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + + if (_parse_floatconstant(ctx, ps) == 0) { + return 0; + } + if (_parse_boolconstant(ctx, ps) == 0) { + return 0; + } + if (_parse_intconstant(ctx, ps) == 0) { + return 0; + } + if (_parse_variable_identifier(ctx, ps) == 0) { + return 0; + } + + p = *ps; + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + if (_parse_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + return -1; + } + + *ps = p; + return 0; +} + + +static int +_parse_asm_argument(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_variable_identifier(ctx, ps) == 0) { + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_DOT, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_FIELD); + if (_parse_identifier(ctx, &p)) { + return 0; + } + *ps = p; + return 0; + } + + if (_parse_floatconstant(ctx, ps) == 0) { + return 0; + } + + return -1; +} + + +static int +_parse_asm_arguments(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_asm_argument(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + + for (;;) { + *ps = p; + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + return 0; + } + if (_parse_asm_argument(ctx, &p)) { + return 0; + } + _emit(ctx, &p.out, OP_END); + } +} + + +static int +_parse_asm_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_id(ctx, ctx->dict.___asm, &p)) { + return -1; + } + if (_parse_identifier(ctx, &p)) { + return -1; + } + if (_parse_asm_arguments(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_selection_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_IF); + if (_parse_id(ctx, ctx->dict._if, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + if (_parse_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + if (_parse_statement(ctx, &p)) { + return -1; + } + + *ps = p; + if (_parse_id(ctx, ctx->dict._else, &p) == 0) { + if (_parse_statement(ctx, &p) == 0) { + *ps = p; + return 0; + } + } + + _emit(ctx, &ps->out, OP_EXPRESSION); + _emit(ctx, &ps->out, OP_PUSH_VOID); + _emit(ctx, &ps->out, OP_END); + return 0; +} + + +static int +_parse_expression_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_expression(ctx, &p)) { + _emit(ctx, &p.out, OP_PUSH_VOID); + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_for_init_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, OP_EXPRESSION); + + if (_parse_expression_statement(ctx, &p) == 0) { + *ps = p; + return 0; + } + + if (_parse_declaration(ctx, &p) == 0) { + _update(ctx, e, OP_DECLARE); + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_initializer(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_assignment_expression(ctx, ps) == 0) { + _emit(ctx, &ps->out, OP_END); + return 0; + } + return -1; +} + + +static int +_parse_condition_initializer(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + _emit(ctx, &p.out, OP_DECLARE); + _emit(ctx, &p.out, DECLARATION_INIT_DECLARATOR_LIST); + if (_parse_fully_specified_type(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, VARIABLE_IDENTIFIER); + if (_parse_identifier(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_ASSIGN, &p)) { + return -1; + } + _emit(ctx, &p.out, VARIABLE_INITIALIZER); + if (_parse_initializer(ctx, &p)) { + return -1; + } + _emit(ctx, &p.out, DECLARATOR_NONE); + *ps = p; + return 0; +} + + +static int +_parse_condition(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + + if (_parse_condition_initializer(ctx, ps) == 0) { + return 0; + } + + p = *ps; + _emit(ctx, &p.out, OP_EXPRESSION); + if (_parse_expression(ctx, &p) == 0) { + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_for_rest_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_condition(ctx, &p)) { + _emit(ctx, &p.out, OP_EXPRESSION); + _emit(ctx, &p.out, OP_PUSH_BOOL); + _emit(ctx, &p.out, 2); + _emit(ctx, &p.out, '1'); + _emit(ctx, &p.out, '\0'); + _emit(ctx, &p.out, OP_END); + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + if (_parse_expression(ctx, &p)) { + _emit(ctx, &p.out, OP_PUSH_VOID); + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_iteration_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_id(ctx, ctx->dict._while, &p) == 0) { + _emit(ctx, &p.out, OP_WHILE); + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + if (_parse_condition(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + return -1; + } + if (_parse_statement(ctx, &p)) { + return -1; + } + *ps = p; + return 0; + } + + if (_parse_id(ctx, ctx->dict._do, &p) == 0) { + _emit(ctx, &p.out, OP_DO); + if (_parse_statement(ctx, &p)) { + return -1; + } + if (_parse_id(ctx, ctx->dict._while, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + if (_parse_expression(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + *ps = p; + return 0; + } + + if (_parse_id(ctx, ctx->dict._for, &p) == 0) { + _emit(ctx, &p.out, OP_FOR); + if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + return -1; + } + if (_parse_for_init_statement(ctx, &p)) { + return -1; + } + if (_parse_for_rest_statement(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + return -1; + } + if (_parse_statement(ctx, &p)) { + return -1; + } + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_jump_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, 0); + + if (_parse_id(ctx, ctx->dict._continue, &p) == 0) { + _update(ctx, e, OP_CONTINUE); + } else if (_parse_id(ctx, ctx->dict._break, &p) == 0) { + _update(ctx, e, OP_BREAK); + } else if (_parse_id(ctx, ctx->dict._return, &p) == 0) { + _update(ctx, e, OP_RETURN); + if (_parse_expression(ctx, &p)) { + _emit(ctx, &p.out, OP_PUSH_VOID); + } + _emit(ctx, &p.out, OP_END); + } else if (ctx->shader_type == 1 && _parse_id(ctx, ctx->dict.discard, &p) == 0) { + _update(ctx, e, OP_DISCARD); + } else { + return -1; + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_simple_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p; + unsigned int e; + + if (_parse_selection_statement(ctx, ps) == 0) { + return 0; + } + + if (_parse_iteration_statement(ctx, ps) == 0) { + return 0; + } + + if (_parse_jump_statement(ctx, ps) == 0) { + return 0; + } + + p = *ps; + e = _emit(ctx, &p.out, OP_EXPRESSION); + if (_parse_expression_statement(ctx, &p) == 0) { + *ps = p; + return 0; + } + + if (_parse_precision_stmt(ctx, &p) == 0) { + _update(ctx, e, OP_PRECISION); + *ps = p; + return 0; + } + + if (ctx->parsing_builtin && _parse_asm_statement(ctx, &p) == 0) { + _update(ctx, e, OP_ASM); + *ps = p; + return 0; + } + + if (_parse_declaration(ctx, &p) == 0) { + _update(ctx, e, OP_DECLARE); + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_compound_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACE, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_BLOCK_BEGIN_NEW_SCOPE); + _parse_statement_list(ctx, &p); + if (_parse_token(ctx, SL_PP_RBRACE, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_statement(struct parse_context *ctx, + struct parse_state *ps) +{ + if (_parse_compound_statement(ctx, ps) == 0) { + return 0; + } + + if (_parse_simple_statement(ctx, ps) == 0) { + return 0; + } + + return -1; +} + + +static int +_parse_statement_list(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_statement(ctx, &p)) { + return -1; + } + + for (;;) { + *ps = p; + if (_parse_statement(ctx, &p)) { + return 0; + } + } +} + + +static int +_parse_compound_statement_no_new_scope(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACE, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_BLOCK_BEGIN_NO_NEW_SCOPE); + _parse_statement_list(ctx, &p); + if (_parse_token(ctx, SL_PP_RBRACE, &p)) { + return -1; + } + _emit(ctx, &p.out, OP_END); + *ps = p; + return 0; +} + + +static int +_parse_function_definition(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_function_prototype(ctx, &p)) { + return -1; + } + if (_parse_compound_statement_no_new_scope(ctx, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_invariant_stmt(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_id(ctx, ctx->dict.invariant, &p)) { + return -1; + } + if (_parse_identifier(ctx, &p)) { + return -1; + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_single_declaration(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e; + + if (_parse_fully_specified_type(ctx, &p)) { + return -1; + } + + e = _emit(ctx, &p.out, VARIABLE_IDENTIFIER); + if (_parse_identifier(ctx, &p)) { + _update(ctx, e, VARIABLE_NONE); + *ps = p; + return 0; + } + + e = _emit(ctx, &p.out, VARIABLE_NONE); + *ps = p; + + if (_parse_token(ctx, SL_PP_ASSIGN, &p) == 0) { + _update(ctx, e, VARIABLE_INITIALIZER); + if (_parse_initializer(ctx, &p) == 0) { + *ps = p; + return 0; + } + } + p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p) == 0) { + if (_parse_constant_expression(ctx, &p)) { + _update(ctx, e, VARIABLE_ARRAY_UNKNOWN); + } else { + _update(ctx, e, VARIABLE_ARRAY_EXPLICIT); + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p) == 0) { + *ps = p; + return 0; + } + } + return 0; +} + + +static int +_parse_init_declarator_list(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + + if (_parse_single_declaration(ctx, &p)) { + return -1; + } + + for (;;) { + unsigned int e; + + *ps = p; + if (_parse_token(ctx, SL_PP_COMMA, &p)) { + break; + } + _emit(ctx, &p.out, DECLARATOR_NEXT); + _emit(ctx, &p.out, VARIABLE_IDENTIFIER); + if (_parse_identifier(ctx, &p)) { + break; + } + + e = _emit(ctx, &p.out, VARIABLE_NONE); + *ps = p; + + if (_parse_token(ctx, SL_PP_ASSIGN, &p) == 0) { + if (_parse_initializer(ctx, &p) == 0) { + _update(ctx, e, VARIABLE_INITIALIZER); + *ps = p; + continue; + } + } + p = *ps; + + if (_parse_token(ctx, SL_PP_LBRACKET, &p) == 0) { + unsigned int arr; + + if (_parse_constant_expression(ctx, &p)) { + arr = VARIABLE_ARRAY_UNKNOWN; + } else { + arr = VARIABLE_ARRAY_EXPLICIT; + } + if (_parse_token(ctx, SL_PP_RBRACKET, &p) == 0) { + _update(ctx, e, arr); + *ps = p; + continue; + } + } + p = *ps; + } + + _emit(ctx, &ps->out, DECLARATOR_NONE); + return 0; +} + + +static int +_parse_declaration(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, DECLARATION_FUNCTION_PROTOTYPE); + + if (_parse_function_prototype(ctx, &p)) { + if (_parse_init_declarator_list(ctx, &p)) { + return -1; + } + _update(ctx, e, DECLARATION_INIT_DECLARATOR_LIST); + } + if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + return -1; + } + *ps = p; + return 0; +} + + +static int +_parse_external_declaration(struct parse_context *ctx, + struct parse_state *ps) +{ + struct parse_state p = *ps; + unsigned int e = _emit(ctx, &p.out, 0); + + if (_parse_precision_stmt(ctx, &p) == 0) { + _update(ctx, e, DEFAULT_PRECISION); + *ps = p; + return 0; + } + + if (_parse_function_definition(ctx, &p) == 0) { + _update(ctx, e, EXTERNAL_FUNCTION_DEFINITION); + *ps = p; + return 0; + } + + if (_parse_invariant_stmt(ctx, &p) == 0) { + _update(ctx, e, INVARIANT_STMT); + *ps = p; + return 0; + } + + if (_parse_declaration(ctx, &p) == 0) { + _update(ctx, e, EXTERNAL_DECLARATION); + *ps = p; + return 0; + } + + return -1; +} + + +static int +_parse_translation_unit(struct parse_context *ctx, + struct parse_state *ps) +{ + _emit(ctx, &ps->out, REVISION); + if (_parse_external_declaration(ctx, ps)) { + return -1; + } + while (_parse_external_declaration(ctx, ps) == 0) { + } + _emit(ctx, &ps->out, EXTERNAL_NULL); + if (_parse_token(ctx, SL_PP_EOF, ps)) { + return -1; + } + return 0; +} + + +#define ADD_NAME_STR(CTX, NAME, STR)\ + do {\ + (CTX).dict.NAME = sl_pp_context_add_unique_str((CTX).context, (STR));\ + if ((CTX).dict.NAME == -1) {\ + return -1;\ + }\ + } while (0) + +#define ADD_NAME(CTX, NAME) ADD_NAME_STR(CTX, NAME, #NAME) + + +int +sl_cl_compile(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int shader_type, + unsigned char **output, + unsigned int *cboutput) +{ + struct parse_context ctx; + struct parse_state ps; + + ctx.context = context; + ctx.input = input; + + ADD_NAME_STR(ctx, _void, "void"); + ADD_NAME_STR(ctx, _float, "float"); + ADD_NAME_STR(ctx, _int, "int"); + ADD_NAME_STR(ctx, _bool, "bool"); + ADD_NAME(ctx, vec2); + ADD_NAME(ctx, vec3); + ADD_NAME(ctx, vec4); + ADD_NAME(ctx, bvec2); + ADD_NAME(ctx, bvec3); + ADD_NAME(ctx, bvec4); + ADD_NAME(ctx, ivec2); + ADD_NAME(ctx, ivec3); + ADD_NAME(ctx, ivec4); + ADD_NAME(ctx, mat2); + ADD_NAME(ctx, mat3); + ADD_NAME(ctx, mat4); + ADD_NAME(ctx, mat2x3); + ADD_NAME(ctx, mat3x2); + ADD_NAME(ctx, mat2x4); + ADD_NAME(ctx, mat4x2); + ADD_NAME(ctx, mat3x4); + ADD_NAME(ctx, mat4x3); + ADD_NAME(ctx, sampler1D); + ADD_NAME(ctx, sampler2D); + ADD_NAME(ctx, sampler3D); + ADD_NAME(ctx, samplerCube); + ADD_NAME(ctx, sampler1DShadow); + ADD_NAME(ctx, sampler2DShadow); + ADD_NAME(ctx, sampler2DRect); + ADD_NAME(ctx, sampler2DRectShadow); + + ADD_NAME(ctx, invariant); + + ADD_NAME(ctx, centroid); + + ADD_NAME(ctx, precision); + ADD_NAME(ctx, lowp); + ADD_NAME(ctx, mediump); + ADD_NAME(ctx, highp); + + ADD_NAME_STR(ctx, _const, "const"); + ADD_NAME(ctx, attribute); + ADD_NAME(ctx, varying); + ADD_NAME(ctx, uniform); + ADD_NAME(ctx, __fixed_output); + ADD_NAME(ctx, __fixed_input); + + ADD_NAME(ctx, in); + ADD_NAME(ctx, out); + ADD_NAME(ctx, inout); + + ADD_NAME_STR(ctx, _struct, "struct"); + + ADD_NAME(ctx, __constructor); + ADD_NAME(ctx, __operator); + ADD_NAME_STR(ctx, ___asm, "__asm"); + + ADD_NAME_STR(ctx, _if, "if"); + ADD_NAME_STR(ctx, _else, "else"); + ADD_NAME_STR(ctx, _for, "for"); + ADD_NAME_STR(ctx, _while, "while"); + ADD_NAME_STR(ctx, _do, "do"); + + ADD_NAME_STR(ctx, _continue, "continue"); + ADD_NAME_STR(ctx, _break, "break"); + ADD_NAME_STR(ctx, _return, "return"); + ADD_NAME(ctx, discard); + + ADD_NAME_STR(ctx, _false, "false"); + ADD_NAME_STR(ctx, _true, "true"); + + ctx.out_buf = NULL; + ctx.out_cap = 0; + + ctx.shader_type = shader_type; + ctx.parsing_builtin = 1; + + ps.in = 0; + ps.out = 0; + + if (_parse_translation_unit(&ctx, &ps)) { + return -1; + } + + *output = ctx.out_buf; + *cboutput = ps.out; + return 0; +} diff --git a/src/glsl/cl/sl_cl_parse.h b/src/glsl/cl/sl_cl_parse.h new file mode 100644 index 00000000000..5b4abe54fd0 --- /dev/null +++ b/src/glsl/cl/sl_cl_parse.h @@ -0,0 +1,38 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef SL_CL_PARSE_H +#define SL_CL_PARSE_H + +int +sl_cl_compile(struct sl_pp_context *context, + const struct sl_pp_token_info *input, + unsigned int shader_type, + unsigned char **output, + unsigned int *cboutput); + +#endif /* SL_CL_PARSE_H */ -- cgit v1.2.3 From 38a1f0b5d1062f8051ac6bb4e3c35fbbf4615163 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 03:02:14 +0100 Subject: glsl/apps: Add GLSL compiler that translates source text into binary stream. Should be used in place of gc_to_bin utility to precompile builtin library. --- src/glsl/apps/SConscript | 7 +- src/glsl/apps/compile.c | 213 +++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 219 insertions(+), 1 deletion(-) create mode 100644 src/glsl/apps/compile.c diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index 5802011bf5e..4a89e3f1dfe 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -7,7 +7,7 @@ if env['platform'] == 'windows': 'user32', ]) -env.Prepend(LIBS = [glsl]) +env.Prepend(LIBS = [glsl, glslcl]) env.Program( target = 'purify', @@ -28,3 +28,8 @@ env.Program( target = 'process', source = ['process.c'], ) + +env.Program( + target = 'compile', + source = ['compile.c'], +) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c new file mode 100644 index 00000000000..f99d1413b68 --- /dev/null +++ b/src/glsl/apps/compile.c @@ -0,0 +1,213 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#include +#include +#include +#include +#include "../pp/sl_pp_public.h" +#include "../cl/sl_cl_parse.h" + + +int +main(int argc, + char *argv[]) +{ + FILE *in; + long size; + char *inbuf; + struct sl_pp_purify_options options; + char *outbuf; + char errmsg[100] = ""; + unsigned int errline = 0; + struct sl_pp_context *context; + struct sl_pp_token_info *tokens; + unsigned int version; + unsigned int tokens_eaten; + struct sl_pp_token_info *outtokens; + FILE *out; + unsigned int i, j; + unsigned char *outbytes; + unsigned int cboutbytes; + unsigned int shader_type; + + if (argc != 4) { + return 1; + } + + if (!strcmp(argv[1], "fragment")) { + shader_type = 1; + } else if (!strcmp(argv[1], "vertex")) { + shader_type = 2; + } else { + return 1; + } + + in = fopen(argv[2], "rb"); + if (!in) { + return 1; + } + + fseek(in, 0, SEEK_END); + size = ftell(in); + fseek(in, 0, SEEK_SET); + + out = fopen(argv[3], "w"); + if (!out) { + fclose(in); + return 1; + } + + inbuf = malloc(size + 1); + if (!inbuf) { + fprintf(out, "$OOMERROR\n"); + + fclose(out); + fclose(in); + return 1; + } + + if (fread(inbuf, 1, size, in) != size) { + fprintf(out, "$READERROR\n"); + + free(inbuf); + fclose(out); + fclose(in); + return 1; + } + inbuf[size] = '\0'; + + fclose(in); + + memset(&options, 0, sizeof(options)); + + if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { + fprintf(out, "$PURIFYERROR %s\n", errmsg); + + free(inbuf); + fclose(out); + return 1; + } + + free(inbuf); + + context = sl_pp_context_create(); + if (!context) { + fprintf(out, "$CONTEXERROR\n"); + + free(outbuf); + fclose(out); + return 1; + } + + if (sl_pp_tokenise(context, outbuf, &tokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + sl_pp_context_destroy(context); + free(outbuf); + fclose(out); + return 1; + } + + free(outbuf); + + if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + sl_pp_context_destroy(context); + free(tokens); + fclose(out); + return -1; + } + + if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + sl_pp_context_destroy(context); + free(tokens); + fclose(out); + return -1; + } + + free(tokens); + + for (i = j = 0; outtokens[i].token != SL_PP_EOF; i++) { + switch (outtokens[i].token) { + case SL_PP_NEWLINE: + case SL_PP_EXTENSION_REQUIRE: + case SL_PP_EXTENSION_ENABLE: + case SL_PP_EXTENSION_WARN: + case SL_PP_EXTENSION_DISABLE: + case SL_PP_LINE: + break; + default: + outtokens[j++] = outtokens[i]; + } + } + outtokens[j] = outtokens[i]; + + if (sl_cl_compile(context, outtokens, shader_type, &outbytes, &cboutbytes) == 0) { + unsigned int i; + unsigned int line = 0; + + fprintf(out, "\n/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */"); + fprintf(out, "\n/* %s */", argv[2]); + fprintf(out, "\n\n"); + + for (i = 0; i < cboutbytes; i++) { + unsigned int a; + + if (outbytes[i] < 10) { + a = 1; + } else if (outbytes[i] < 100) { + a = 2; + } else { + a = 3; + } + if (i < cboutbytes - 1) { + a++; + } + if (line + a >= 100) { + fprintf (out, "\n"); + line = 0; + } + line += a; + fprintf (out, "%u", outbytes[i]); + if (i < cboutbytes - 1) { + fprintf (out, ","); + } + } + fprintf (out, "\n"); + free(outbytes); + } + + sl_pp_context_destroy(context); + free(outtokens); + fclose(out); + + return 0; +} -- cgit v1.2.3 From f5b6e0639065eed99c491a1eb5413b96957b3b6a Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 05:49:25 +0100 Subject: gdi: Link to glslcl. --- src/gallium/winsys/gdi/SConscript | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 9fbe9e800c3..5b6364a01df 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -39,5 +39,5 @@ if env['platform'] == 'windows': env.SharedLibrary( target ='opengl32', source = sources, - LIBS = wgl + glapi + mesa + drivers + auxiliaries + glsl + env['LIBS'], + LIBS = wgl + glapi + mesa + drivers + auxiliaries + glsl + glslcl + env['LIBS'], ) -- cgit v1.2.3 From cd5553b457e2111f7057201aed4ad537e2f31ff9 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 05:52:39 +0100 Subject: slang: Plug in the new syntax parser. --- src/mesa/shader/slang/slang_compile.c | 115 +++++++++++++++++----------------- 1 file changed, 58 insertions(+), 57 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index b8b7b3d494a..830a2d00bc4 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -35,8 +35,8 @@ #include "shader/prog_optimize.h" #include "shader/prog_print.h" #include "shader/prog_parameter.h" -#include "shader/grammar/grammar_mesa.h" #include "../../glsl/pp/sl_pp_public.h" +#include "../../glsl/cl/sl_cl_parse.h" #include "slang_codegen.h" #include "slang_compile.h" #include "slang_storage.h" @@ -128,7 +128,7 @@ _slang_code_object_dtr(slang_code_object * self) typedef struct slang_parse_ctx_ { - const byte *I; + const unsigned char *I; slang_info_log *L; int parsing_builtin; GLboolean global_scope; /**< Is object being declared a global? */ @@ -196,7 +196,7 @@ parse_general_number(slang_parse_ctx *ctx, float *number) if (*ctx->I == '0') { int value = 0; - const byte *pi; + const unsigned char *pi; if (ctx->I[1] == 'x' || ctx->I[1] == 'X') { ctx->I += 2; @@ -2540,7 +2540,7 @@ parse_code_unit(slang_parse_ctx * C, slang_code_unit * unit, } static GLboolean -compile_binary(const byte * prod, slang_code_unit * unit, +compile_binary(const unsigned char * prod, slang_code_unit * unit, GLuint version, slang_unit_type type, slang_info_log * infolog, slang_code_unit * builtin, slang_code_unit * downlink, @@ -2573,16 +2573,20 @@ compile_binary(const byte * prod, slang_code_unit * unit, } static GLboolean -compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, - slang_unit_type type, slang_info_log * infolog, - slang_code_unit * builtin, +compile_with_grammar(const char *source, + slang_code_unit *unit, + slang_unit_type type, + slang_info_log *infolog, + slang_code_unit *builtin, struct gl_shader *shader, const struct gl_extensions *extensions, - struct gl_sl_pragmas *pragmas) + struct gl_sl_pragmas *pragmas, + unsigned int shader_type, + unsigned int parsing_builtin) { struct sl_pp_context *context; struct sl_pp_token_info *tokens; - byte *prod; + unsigned char *prod; GLuint size; unsigned int version; unsigned int maxVersion; @@ -2718,17 +2722,17 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, } /* Finally check the syntax and generate its binary representation. */ - result = grammar_fast_check(id, context, tokens, &prod, &size, 65536); + result = sl_cl_compile(context, tokens, shader_type, &prod, &size); sl_pp_context_destroy(context); free(tokens); - if (!result) { - char buf[1024]; - GLint pos; + if (result) { + /*char buf[1024]; + GLint pos;*/ - grammar_get_last_error((byte *) (buf), sizeof(buf), &pos); - slang_info_log_error(infolog, buf); + /*slang_info_log_error(infolog, buf);*/ + slang_info_log_error(infolog, "Syntax error."); /* syntax error (possibly in library code) */ #if 0 { @@ -2747,10 +2751,10 @@ compile_with_grammar(grammar id, const char *source, slang_code_unit * unit, if (!compile_binary(prod, unit, version, type, infolog, builtin, &builtin[SLANG_BUILTIN_TOTAL - 1], shader)) { - grammar_alloc_free(prod); + free(prod); return GL_FALSE; } - grammar_alloc_free(prod); + free(prod); return GL_TRUE; } @@ -2758,60 +2762,53 @@ LONGSTRING static const char *slang_shader_syn = #include "library/slang_shader_syn.h" ; -static const byte slang_core_gc[] = { +static const unsigned char slang_core_gc[] = { #include "library/slang_core_gc.h" }; -static const byte slang_120_core_gc[] = { +static const unsigned char slang_120_core_gc[] = { #include "library/slang_120_core_gc.h" }; -static const byte slang_120_fragment_gc[] = { +static const unsigned char slang_120_fragment_gc[] = { #include "library/slang_builtin_120_fragment_gc.h" }; -static const byte slang_common_builtin_gc[] = { +static const unsigned char slang_common_builtin_gc[] = { #include "library/slang_common_builtin_gc.h" }; -static const byte slang_fragment_builtin_gc[] = { +static const unsigned char slang_fragment_builtin_gc[] = { #include "library/slang_fragment_builtin_gc.h" }; -static const byte slang_vertex_builtin_gc[] = { +static const unsigned char slang_vertex_builtin_gc[] = { #include "library/slang_vertex_builtin_gc.h" }; static GLboolean -compile_object(grammar * id, const char *source, slang_code_object * object, - slang_unit_type type, slang_info_log * infolog, +compile_object(const char *source, + slang_code_object *object, + slang_unit_type type, + slang_info_log *infolog, struct gl_shader *shader, const struct gl_extensions *extensions, struct gl_sl_pragmas *pragmas) { slang_code_unit *builtins = NULL; GLuint base_version = 110; - - /* load GLSL grammar */ - *id = grammar_load_from_text((const byte *) (slang_shader_syn)); - if (*id == 0) { - byte buf[1024]; - int pos; - - grammar_get_last_error(buf, 1024, &pos); - slang_info_log_error(infolog, (const char *) (buf)); - return GL_FALSE; - } + unsigned int shader_type; + unsigned int parsing_builtin; /* set shader type - the syntax is slightly different for different shaders */ - if (type == SLANG_UNIT_FRAGMENT_SHADER - || type == SLANG_UNIT_FRAGMENT_BUILTIN) - grammar_set_reg8(*id, (const byte *) "shader_type", 1); - else - grammar_set_reg8(*id, (const byte *) "shader_type", 2); + if (type == SLANG_UNIT_FRAGMENT_SHADER || type == SLANG_UNIT_FRAGMENT_BUILTIN) { + shader_type = 1; + } else { + shader_type = 2; + } /* enable language extensions */ - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); + parsing_builtin = 1; /* if parsing user-specified shader, load built-in library */ if (type == SLANG_UNIT_FRAGMENT_SHADER || type == SLANG_UNIT_VERTEX_SHADER) { @@ -2877,16 +2874,24 @@ compile_object(grammar * id, const char *source, slang_code_object * object, /* disable language extensions */ #if NEW_SLANG /* allow-built-ins */ - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 1); + parsing_builtin = 1; #else - grammar_set_reg8(*id, (const byte *) "parsing_builtin", 0); + parsing_builtin = 0; #endif builtins = object->builtin; } /* compile the actual shader - pass-in built-in library for external shader */ - return compile_with_grammar(*id, source, &object->unit, type, infolog, - builtins, shader, extensions, pragmas); + return compile_with_grammar(source, + &object->unit, + type, + infolog, + builtins, + shader, + extensions, + pragmas, + shader_type, + parsing_builtin); } @@ -2895,9 +2900,6 @@ compile_shader(GLcontext *ctx, slang_code_object * object, slang_unit_type type, slang_info_log * infolog, struct gl_shader *shader) { - GLboolean success; - grammar id = 0; - #if 0 /* for debug */ _mesa_printf("********* COMPILE SHADER ***********\n"); _mesa_printf("%s\n", shader->Source); @@ -2909,14 +2911,13 @@ compile_shader(GLcontext *ctx, slang_code_object * object, _slang_code_object_dtr(object); _slang_code_object_ctr(object); - success = compile_object(&id, shader->Source, object, type, infolog, shader, - &ctx->Extensions, &shader->Pragmas); - if (id != 0) - grammar_destroy(id); - if (!success) - return GL_FALSE; - - return GL_TRUE; + return compile_object(shader->Source, + object, + type, + infolog, + shader, + &ctx->Extensions, + &shader->Pragmas); } -- cgit v1.2.3 From 7593562a61ed59e5b645d9285a957a57704bfd6d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 05:58:46 +0100 Subject: slang: Get rid of the old syntax file and utilities. --- src/mesa/shader/slang/library/gc_to_bin.c | 85 -- src/mesa/shader/slang/library/slang_shader.syn | 1525 ---------------------- src/mesa/shader/slang/library/slang_shader_syn.h | 714 ---------- src/mesa/shader/slang/library/syn_to_c.c | 72 - src/mesa/shader/slang/slang_compile.c | 4 - 5 files changed, 2400 deletions(-) delete mode 100644 src/mesa/shader/slang/library/gc_to_bin.c delete mode 100644 src/mesa/shader/slang/library/slang_shader.syn delete mode 100644 src/mesa/shader/slang/library/slang_shader_syn.h delete mode 100644 src/mesa/shader/slang/library/syn_to_c.c diff --git a/src/mesa/shader/slang/library/gc_to_bin.c b/src/mesa/shader/slang/library/gc_to_bin.c deleted file mode 100644 index 8aef7b54124..00000000000 --- a/src/mesa/shader/slang/library/gc_to_bin.c +++ /dev/null @@ -1,85 +0,0 @@ -#include "../../grammar/grammar_crt.h" -#include "../../grammar/grammar_crt.c" -#include -#include - -static const char *slang_shader_syn = -#include "slang_shader_syn.h" -; - -static int gc_to_bin (grammar id, const char *in, const char *out) -{ - FILE *f; - byte *source, *prod; - unsigned int size, i, line = 0; - - printf ("Precompiling %s\n", in); - - f = fopen (in, "r"); - if (f == NULL) - return 1; - fseek (f, 0, SEEK_END); - size = ftell (f); - fseek (f, 0, SEEK_SET); - source = (byte *) grammar_alloc_malloc (size + 1); - source[fread (source, 1, size, f)] = '\0'; - fclose (f); - - if (!grammar_fast_check (id, source, &prod, &size, 65536)) - { - grammar_alloc_free (source); - return 1; - } - - f = fopen (out, "w"); - fprintf (f, "\n"); - fprintf (f, "/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */\n"); - fprintf (f, "/* %s */\n", in); - fprintf (f, "\n"); - for (i = 0; i < size; i++) - { - unsigned int a; - if (prod[i] < 10) - a = 1; - else if (prod[i] < 100) - a = 2; - else - a = 3; - if (i < size - 1) - a++; - if (line + a >= 100) - { - fprintf (f, "\n"); - line = 0; - } - line += a; - fprintf (f, "%d", prod[i]); - if (i < size - 1) - fprintf (f, ","); - } - fprintf (f, "\n"); - fclose (f); - grammar_alloc_free (prod); - return 0; -} - -int main (int argc, char *argv[]) -{ - grammar id; - - id = grammar_load_from_text ((const byte *) slang_shader_syn); - if (id == 0) { - fprintf(stderr, "Error loading grammar from text\n"); - return 1; - } - grammar_set_reg8 (id, (const byte *) "parsing_builtin", 1); - grammar_set_reg8 (id, (const byte *) "shader_type", atoi (argv[1])); - if (gc_to_bin (id, argv[2], argv[3])) { - fprintf(stderr, "Error in gc_to_bin %s %s\n", argv[2], argv[3]); - grammar_destroy (id); - return 1; - } - grammar_destroy (id); - return 0; -} - diff --git a/src/mesa/shader/slang/library/slang_shader.syn b/src/mesa/shader/slang/library/slang_shader.syn deleted file mode 100644 index 11f9825c016..00000000000 --- a/src/mesa/shader/slang/library/slang_shader.syn +++ /dev/null @@ -1,1525 +0,0 @@ -/* - * Mesa 3-D graphics library - * - * Copyright (C) 2004-2006 Brian Paul All Rights Reserved. - * Copyright (C) 2008 VMware, Inc. All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/* - * \file slang_shader.syn - * slang vertex/fragment shader syntax - * \author Michal Krol - */ - -/* - * usage: - * syn2c slang_shader.syn > slang_shader_syn.h - * - * when modifying or extending this file, several things must be taken into - * consideration: - * - * - when adding new operators that were marked as reserved in the - * initial specification, one must only uncomment particular lines of - * code that refer to operators being added; - * - * - when adding new shader targets, one must reserve a new value for - * shader_type register and use it in .if constructs for symbols that - * are exclusive for that shader; - * - * - some symbols mimic output of other symbols - the best example is - * the "for" construct: expression "for (foo(); ; bar())" is seen as - * "for (foo(); true; bar())" by the output processor - hence, special - * care must be taken when rearranging output of essential symbols; - * - * - order of single-quoted tokens does matter in alternatives - so do not - * parse "<" operator before "<<" and "<<" before "<<="; - * - * - all double-quoted tokens are internally preprocessed to eliminate - * problems with parsing strings that are prefixes of other strings, - * like "sampler1D" and "sampler1DShadow"; - */ - -.syntax translation_unit; - -/* revision number - increment after each change affecting emitted output */ -.emtcode REVISION 5 - -/* external declaration (or precision or invariant stmt) */ -.emtcode EXTERNAL_NULL 0 -.emtcode EXTERNAL_FUNCTION_DEFINITION 1 -.emtcode EXTERNAL_DECLARATION 2 -.emtcode DEFAULT_PRECISION 3 -.emtcode INVARIANT_STMT 4 - -/* precision */ -.emtcode PRECISION_DEFAULT 0 -.emtcode PRECISION_LOW 1 -.emtcode PRECISION_MEDIUM 2 -.emtcode PRECISION_HIGH 3 - -/* declaration */ -.emtcode DECLARATION_FUNCTION_PROTOTYPE 1 -.emtcode DECLARATION_INIT_DECLARATOR_LIST 2 - -/* function type */ -.emtcode FUNCTION_ORDINARY 0 -.emtcode FUNCTION_CONSTRUCTOR 1 -.emtcode FUNCTION_OPERATOR 2 - -/* function call type */ -.emtcode FUNCTION_CALL_NONARRAY 0 -.emtcode FUNCTION_CALL_ARRAY 1 - -/* operator type */ -.emtcode OPERATOR_ADDASSIGN 1 -.emtcode OPERATOR_SUBASSIGN 2 -.emtcode OPERATOR_MULASSIGN 3 -.emtcode OPERATOR_DIVASSIGN 4 -/*.emtcode OPERATOR_MODASSIGN 5*/ -/*.emtcode OPERATOR_LSHASSIGN 6*/ -/*.emtcode OPERATOR_RSHASSIGN 7*/ -/*.emtcode OPERATOR_ORASSIGN 8*/ -/*.emtcode OPERATOR_XORASSIGN 9*/ -/*.emtcode OPERATOR_ANDASSIGN 10*/ -.emtcode OPERATOR_LOGICALXOR 11 -/*.emtcode OPERATOR_BITOR 12*/ -/*.emtcode OPERATOR_BITXOR 13*/ -/*.emtcode OPERATOR_BITAND 14*/ -.emtcode OPERATOR_LESS 15 -.emtcode OPERATOR_GREATER 16 -.emtcode OPERATOR_LESSEQUAL 17 -.emtcode OPERATOR_GREATEREQUAL 18 -/*.emtcode OPERATOR_LSHIFT 19*/ -/*.emtcode OPERATOR_RSHIFT 20*/ -.emtcode OPERATOR_MULTIPLY 21 -.emtcode OPERATOR_DIVIDE 22 -/*.emtcode OPERATOR_MODULUS 23*/ -.emtcode OPERATOR_INCREMENT 24 -.emtcode OPERATOR_DECREMENT 25 -.emtcode OPERATOR_PLUS 26 -.emtcode OPERATOR_MINUS 27 -/*.emtcode OPERATOR_COMPLEMENT 28*/ -.emtcode OPERATOR_NOT 29 - -/* init declarator list */ -.emtcode DECLARATOR_NONE 0 -.emtcode DECLARATOR_NEXT 1 - -/* variable declaration */ -.emtcode VARIABLE_NONE 0 -.emtcode VARIABLE_IDENTIFIER 1 -.emtcode VARIABLE_INITIALIZER 2 -.emtcode VARIABLE_ARRAY_EXPLICIT 3 -.emtcode VARIABLE_ARRAY_UNKNOWN 4 - -/* type qualifier */ -.emtcode TYPE_QUALIFIER_NONE 0 -.emtcode TYPE_QUALIFIER_CONST 1 -.emtcode TYPE_QUALIFIER_ATTRIBUTE 2 -.emtcode TYPE_QUALIFIER_VARYING 3 -.emtcode TYPE_QUALIFIER_UNIFORM 4 -.emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5 -.emtcode TYPE_QUALIFIER_FIXEDINPUT 6 - -/* invariant qualifier */ -.emtcode TYPE_VARIANT 90 -.emtcode TYPE_INVARIANT 91 - -/* centroid qualifier */ -.emtcode TYPE_CENTER 95 -.emtcode TYPE_CENTROID 96 - -/* type specifier */ -.emtcode TYPE_SPECIFIER_VOID 0 -.emtcode TYPE_SPECIFIER_BOOL 1 -.emtcode TYPE_SPECIFIER_BVEC2 2 -.emtcode TYPE_SPECIFIER_BVEC3 3 -.emtcode TYPE_SPECIFIER_BVEC4 4 -.emtcode TYPE_SPECIFIER_INT 5 -.emtcode TYPE_SPECIFIER_IVEC2 6 -.emtcode TYPE_SPECIFIER_IVEC3 7 -.emtcode TYPE_SPECIFIER_IVEC4 8 -.emtcode TYPE_SPECIFIER_FLOAT 9 -.emtcode TYPE_SPECIFIER_VEC2 10 -.emtcode TYPE_SPECIFIER_VEC3 11 -.emtcode TYPE_SPECIFIER_VEC4 12 -.emtcode TYPE_SPECIFIER_MAT2 13 -.emtcode TYPE_SPECIFIER_MAT3 14 -.emtcode TYPE_SPECIFIER_MAT4 15 -.emtcode TYPE_SPECIFIER_SAMPLER1D 16 -.emtcode TYPE_SPECIFIER_SAMPLER2D 17 -.emtcode TYPE_SPECIFIER_SAMPLER3D 18 -.emtcode TYPE_SPECIFIER_SAMPLERCUBE 19 -.emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20 -.emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21 -.emtcode TYPE_SPECIFIER_SAMPLER2DRECT 22 -.emtcode TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23 -.emtcode TYPE_SPECIFIER_STRUCT 24 -.emtcode TYPE_SPECIFIER_TYPENAME 25 - -/* OpenGL 2.1 */ -.emtcode TYPE_SPECIFIER_MAT23 26 -.emtcode TYPE_SPECIFIER_MAT32 27 -.emtcode TYPE_SPECIFIER_MAT24 28 -.emtcode TYPE_SPECIFIER_MAT42 29 -.emtcode TYPE_SPECIFIER_MAT34 30 -.emtcode TYPE_SPECIFIER_MAT43 31 - -/* type specifier array */ -.emtcode TYPE_SPECIFIER_NONARRAY 0 -.emtcode TYPE_SPECIFIER_ARRAY 1 - -/* structure field */ -.emtcode FIELD_NONE 0 -.emtcode FIELD_NEXT 1 -.emtcode FIELD_ARRAY 2 - -/* operation */ -.emtcode OP_END 0 -.emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1 -.emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2 -.emtcode OP_DECLARE 3 -.emtcode OP_ASM 4 -.emtcode OP_BREAK 5 -.emtcode OP_CONTINUE 6 -.emtcode OP_DISCARD 7 -.emtcode OP_RETURN 8 -.emtcode OP_EXPRESSION 9 -.emtcode OP_IF 10 -.emtcode OP_WHILE 11 -.emtcode OP_DO 12 -.emtcode OP_FOR 13 -.emtcode OP_PUSH_VOID 14 -.emtcode OP_PUSH_BOOL 15 -.emtcode OP_PUSH_INT 16 -.emtcode OP_PUSH_FLOAT 17 -.emtcode OP_PUSH_IDENTIFIER 18 -.emtcode OP_SEQUENCE 19 -.emtcode OP_ASSIGN 20 -.emtcode OP_ADDASSIGN 21 -.emtcode OP_SUBASSIGN 22 -.emtcode OP_MULASSIGN 23 -.emtcode OP_DIVASSIGN 24 -/*.emtcode OP_MODASSIGN 25*/ -/*.emtcode OP_LSHASSIGN 26*/ -/*.emtcode OP_RSHASSIGN 27*/ -/*.emtcode OP_ORASSIGN 28*/ -/*.emtcode OP_XORASSIGN 29*/ -/*.emtcode OP_ANDASSIGN 30*/ -.emtcode OP_SELECT 31 -.emtcode OP_LOGICALOR 32 -.emtcode OP_LOGICALXOR 33 -.emtcode OP_LOGICALAND 34 -/*.emtcode OP_BITOR 35*/ -/*.emtcode OP_BITXOR 36*/ -/*.emtcode OP_BITAND 37*/ -.emtcode OP_EQUAL 38 -.emtcode OP_NOTEQUAL 39 -.emtcode OP_LESS 40 -.emtcode OP_GREATER 41 -.emtcode OP_LESSEQUAL 42 -.emtcode OP_GREATEREQUAL 43 -/*.emtcode OP_LSHIFT 44*/ -/*.emtcode OP_RSHIFT 45*/ -.emtcode OP_ADD 46 -.emtcode OP_SUBTRACT 47 -.emtcode OP_MULTIPLY 48 -.emtcode OP_DIVIDE 49 -/*.emtcode OP_MODULUS 50*/ -.emtcode OP_PREINCREMENT 51 -.emtcode OP_PREDECREMENT 52 -.emtcode OP_PLUS 53 -.emtcode OP_MINUS 54 -/*.emtcode OP_COMPLEMENT 55*/ -.emtcode OP_NOT 56 -.emtcode OP_SUBSCRIPT 57 -.emtcode OP_CALL 58 -.emtcode OP_FIELD 59 -.emtcode OP_POSTINCREMENT 60 -.emtcode OP_POSTDECREMENT 61 -.emtcode OP_PRECISION 62 -.emtcode OP_METHOD 63 - -/* parameter qualifier */ -.emtcode PARAM_QUALIFIER_IN 0 -.emtcode PARAM_QUALIFIER_OUT 1 -.emtcode PARAM_QUALIFIER_INOUT 2 - -/* function parameter */ -.emtcode PARAMETER_NONE 0 -.emtcode PARAMETER_NEXT 1 - -/* function parameter array presence */ -.emtcode PARAMETER_ARRAY_NOT_PRESENT 0 -.emtcode PARAMETER_ARRAY_PRESENT 1 - -/* INVALID_EXTERNAL_DECLARATION seems to be reported when there's */ -/* any syntax errors... */ -.errtext INVALID_EXTERNAL_DECLARATION "2001: Syntax error." -.errtext INVALID_OPERATOR_OVERRIDE "2002: Invalid operator override." -.errtext LBRACE_EXPECTED "2003: '{' expected but token found." -.errtext LPAREN_EXPECTED "2004: '(' expected but token found." -.errtext RPAREN_EXPECTED "2005: ')' expected but token found." -.errtext INVALID_PRECISION "2006: Invalid precision specifier." -.errtext INVALID_PRECISION_TYPE "2007: Invalid precision type." - - -/* - * tells whether the shader that is being parsed is a built-in shader or not - * 0 - normal behaviour - * 1 - accepts constructor and operator definitions and __asm statements - * the implementation will set it to 1 when compiling internal built-in shaders - */ -.regbyte parsing_builtin 0 - -/* - * holds the type of the shader being parsed; possible values are - * listed below. - * FRAGMENT_SHADER 1 - * VERTEX_SHADER 2 - * shader type is set by the caller before parsing - */ -.regbyte shader_type 0 - -/* - * ::= - */ -variable_identifier - identifier .emit OP_PUSH_IDENTIFIER; - -/* - * ::= - * | - * | - * | - * | "(" ")" - */ -primary_expression - floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1; -primary_expression_1 - lparen .and expression .and rparen; - -/* - * ::= - * | "[" "]" - * | - * | "." - * | "++" - * | "--" - */ -postfix_expression - postfix_expression_1 .and .loop postfix_expression_2; -postfix_expression_1 - function_call .or primary_expression; -postfix_expression_2 - postfix_expression_3 .or postfix_expression_4 .or - plusplus .emit OP_POSTINCREMENT .or - minusminus .emit OP_POSTDECREMENT; -postfix_expression_3 - lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT; -postfix_expression_4 - dot .and field_selection .emit OP_FIELD; - -/* - * ::= - */ -integer_expression - expression; - -/* - * ::= - */ -function_call - function_call_or_method; - -/* - * ::= - * | "." - */ -function_call_or_method - regular_function_call .or method_call; - -/* - * ::= "." - */ -method_call - identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END; - -/* - * ::= - */ -regular_function_call - function_call_generic .emit OP_CALL .and .true .emit OP_END; - -/* - * ::= ")" - * | ")" - */ -function_call_generic - function_call_generic_1 .or function_call_generic_2; -function_call_generic_1 - function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED; -function_call_generic_2 - function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED; - -/* - * ::= "void" - * | - */ -function_call_header_no_parameters - function_call_header .and function_call_header_no_parameters_1; -function_call_header_no_parameters_1 - "void" .or .true; - -/* - * ::= - * | "," - */ -function_call_header_with_parameters - function_call_header .and assignment_expression .and .true .emit OP_END .and - .loop function_call_header_with_parameters_1; -function_call_header_with_parameters_1 - comma .and assignment_expression .and .true .emit OP_END; - -/* - * ::= "(" - */ -function_call_header - function_identifier .and lparen; - -/* - * ::= - * | - * | - * - * note: and have been deleted - */ -function_identifier - identifier .and function_identifier_opt_array; -function_identifier_opt_array - function_identifier_array .emit FUNCTION_CALL_ARRAY .or - .true .emit FUNCTION_CALL_NONARRAY; -function_identifier_array - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * | "++" - * | "--" - * | - * - * ::= "+" - * | "-" - * | "!" - * | "~" // reserved - */ -unary_expression - postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or - unary_expression_4 .or unary_expression_5/* .or unary_expression_6*/; -unary_expression_1 - plusplus .and unary_expression .and .true .emit OP_PREINCREMENT; -unary_expression_2 - minusminus .and unary_expression .and .true .emit OP_PREDECREMENT; -unary_expression_3 - plus .and unary_expression .and .true .emit OP_PLUS; -unary_expression_4 - minus .and unary_expression .and .true .emit OP_MINUS; -unary_expression_5 - bang .and unary_expression .and .true .emit OP_NOT; -/*unary_expression_6 - tilde .and unary_expression .and .true .emit OP_COMPLEMENT;*/ - -/* - * ::= - * | "*" - * | "/" - * | "%" // reserved - */ -multiplicative_expression - unary_expression .and .loop multiplicative_expression_1; -multiplicative_expression_1 - multiplicative_expression_2 .or multiplicative_expression_3/* .or multiplicative_expression_4*/; -multiplicative_expression_2 - star .and unary_expression .and .true .emit OP_MULTIPLY; -multiplicative_expression_3 - slash .and unary_expression .and .true .emit OP_DIVIDE; -/*multiplicative_expression_4 - percent .and unary_expression .and .true .emit OP_MODULUS;*/ - -/* - * ::= - * | "+" - * | "-" - */ -additive_expression - multiplicative_expression .and .loop additive_expression_1; -additive_expression_1 - additive_expression_2 .or additive_expression_3; -additive_expression_2 - plus .and multiplicative_expression .and .true .emit OP_ADD; -additive_expression_3 - minus .and multiplicative_expression .and .true .emit OP_SUBTRACT; - -/* - * ::= - * | "<<" // reserved - * | ">>" // reserved - */ -shift_expression - additive_expression/* .and .loop shift_expression_1*/; -/*shift_expression_1 - shift_expression_2 .or shift_expression_3;*/ -/*shift_expression_2 - lessless .and additive_expression .and .true .emit OP_LSHIFT;*/ -/*shift_expression_3 - greatergreater .and additive_expression .and .true .emit OP_RSHIFT;*/ - -/* - * ::= - * | "<" - * | ">" - * | "<=" - * | ">=" - */ -relational_expression - shift_expression .and .loop relational_expression_1; -relational_expression_1 - relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or - relational_expression_5; -relational_expression_2 - lessequals .and shift_expression .and .true .emit OP_LESSEQUAL; -relational_expression_3 - greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL; -relational_expression_4 - less .and shift_expression .and .true .emit OP_LESS; -relational_expression_5 - greater .and shift_expression .and .true .emit OP_GREATER; - -/* - * ::= - * | "==" - * | "!=" - */ -equality_expression - relational_expression .and .loop equality_expression_1; -equality_expression_1 - equality_expression_2 .or equality_expression_3; -equality_expression_2 - equalsequals .and relational_expression .and .true .emit OP_EQUAL; -equality_expression_3 - bangequals .and relational_expression .and .true .emit OP_NOTEQUAL; - -/* - * ::= - * | "&" // reserved - */ -and_expression - equality_expression/* .and .loop and_expression_1*/; -/*and_expression_1 - ampersand .and equality_expression .and .true .emit OP_BITAND;*/ - -/* - * ::= - * | "^" // reserved - */ -exclusive_or_expression - and_expression/* .and .loop exclusive_or_expression_1*/; -/*exclusive_or_expression_1 - caret .and and_expression .and .true .emit OP_BITXOR;*/ - -/* - * ::= - * | "|" // reserved - */ -inclusive_or_expression - exclusive_or_expression/* .and .loop inclusive_or_expression_1*/; -/*inclusive_or_expression_1 - bar .and exclusive_or_expression .and .true .emit OP_BITOR;*/ - -/* - * ::= - * | "&&" - */ -logical_and_expression - inclusive_or_expression .and .loop logical_and_expression_1; -logical_and_expression_1 - ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND; - -/* - * ::= - * | "^^" - */ -logical_xor_expression - logical_and_expression .and .loop logical_xor_expression_1; -logical_xor_expression_1 - caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR; - -/* - * ::= - * | "||" - */ -logical_or_expression - logical_xor_expression .and .loop logical_or_expression_1; -logical_or_expression_1 - barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR; - -/* - * ::= - * | "?" ":" - */ -conditional_expression - logical_or_expression .and .loop conditional_expression_1; -conditional_expression_1 - question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT; - -/* - * ::= - * | - * - * ::= "=" - * | "*=" - * | "/=" - * | "+=" - * | "-=" - * | "%=" // reserved - * | "<<=" // reserved - * | ">>=" // reserved - * | "&=" // reserved - * | "^=" // reserved - * | "|=" // reserved - */ -assignment_expression - assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or - assignment_expression_4 .or assignment_expression_5/* .or assignment_expression_6 .or - assignment_expression_7 .or assignment_expression_8 .or assignment_expression_9 .or - assignment_expression_10 .or assignment_expression_11*/ .or conditional_expression; -assignment_expression_1 - unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN; -assignment_expression_2 - unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN; -assignment_expression_3 - unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN; -assignment_expression_4 - unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN; -assignment_expression_5 - unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN; -/*assignment_expression_6 - unary_expression .and percentequals .and assignment_expression .and .true .emit OP_MODASSIGN;*/ -/*assignment_expression_7 - unary_expression .and lesslessequals .and assignment_expression .and .true .emit OP_LSHASSIGN;*/ -/*assignment_expression_8 - unary_expression .and greatergreaterequals .and assignment_expression .and - .true .emit OP_RSHASSIGN;*/ -/*assignment_expression_9 - unary_expression .and ampersandequals .and assignment_expression .and .true .emit OP_ANDASSIGN;*/ -/*assignment_expression_10 - unary_expression .and caretequals .and assignment_expression .and .true .emit OP_XORASSIGN;*/ -/*assignment_expression_11 - unary_expression .and barequals .and assignment_expression .and .true .emit OP_ORASSIGN;*/ - -/* - * ::= - * | "," - */ -expression - assignment_expression .and .loop expression_1; -expression_1 - comma .and assignment_expression .and .true .emit OP_SEQUENCE; - -/* - * ::= - */ -constant_expression - conditional_expression .and .true .emit OP_END; - -/* - * ::= ";" - * | ";" - */ -declaration - declaration_1 .or declaration_2; -declaration_1 - function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon; -declaration_2 - init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon; - -/* - * ::= "void" ")" - * | ")" - */ -function_prototype - function_prototype_1 .or function_prototype_2; -function_prototype_1 - function_header .and "void" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE; -function_prototype_2 - function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE; - -/* - * ::= - * | - */ -function_declarator - function_header_with_parameters .or function_header; - -/* - * ::= - * | "," - * - */ -function_header_with_parameters - function_header .and parameter_declaration .and .loop function_header_with_parameters_1; -function_header_with_parameters_1 - comma .and parameter_declaration; - -/* - * ::= "(" - */ -function_header - fully_specified_type .and function_decl_identifier .and lparen; - -/* - * ::= "__constructor" - * | <__operator> - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator and constructor prototypes and definitions - */ -function_decl_identifier - .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or - .if (parsing_builtin != 0) "__constructor" .emit FUNCTION_CONSTRUCTOR .or - identifier .emit FUNCTION_ORDINARY; - -/* - * <__operator> ::= "__operator" - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator prototypes and definitions - */ -__operator - "__operator" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE; - -/* - * ::= "=" - * | "+=" - * | "-=" - * | "*=" - * | "/=" - * | "%=" // reserved - * | "<<=" // reserved - * | ">>=" // reserved - * | "&=" // reserved - * | "^=" // reserved - * | "|=" // reserved - * | "^^" - * | "|" // reserved - * | "^" // reserved - * | "&" // reserved - * | "==" - * | "!=" - * | "<" - * | ">" - * | "<=" - * | ">=" - * | "<<" // reserved - * | ">>" // reserved - * | "*" - * | "/" - * | "%" // reserved - * | "++" - * | "--" - * | "+" - * | "-" - * | "~" // reserved - * | "!" - * - * note: this is an extension to the standard language specification. - * normally slang disallows operator prototypes and definitions - */ -overriden_operator - plusplus .emit OPERATOR_INCREMENT .or - plusequals .emit OPERATOR_ADDASSIGN .or - plus .emit OPERATOR_PLUS .or - minusminus .emit OPERATOR_DECREMENT .or - minusequals .emit OPERATOR_SUBASSIGN .or - minus .emit OPERATOR_MINUS .or - bang .emit OPERATOR_NOT .or - starequals .emit OPERATOR_MULASSIGN .or - star .emit OPERATOR_MULTIPLY .or - slashequals .emit OPERATOR_DIVASSIGN .or - slash .emit OPERATOR_DIVIDE .or - lessequals .emit OPERATOR_LESSEQUAL .or - /*lesslessequals .emit OPERATOR_LSHASSIGN .or*/ - /*lessless .emit OPERATOR_LSHIFT .or*/ - less .emit OPERATOR_LESS .or - greaterequals .emit OPERATOR_GREATEREQUAL .or - /*greatergreaterequals .emit OPERATOR_RSHASSIGN .or*/ - /*greatergreater .emit OPERATOR_RSHIFT .or*/ - greater .emit OPERATOR_GREATER .or - /*percentequals .emit OPERATOR_MODASSIGN .or*/ - /*percent .emit OPERATOR_MODULUS .or*/ - /*ampersandequals .emit OPERATOR_ANDASSIGN */ - /*ampersand .emit OPERATOR_BITAND .or*/ - /*barequals .emit OPERATOR_ORASSIGN .or*/ - /*bar .emit OPERATOR_BITOR .or*/ - /*tilde .emit OPERATOR_COMPLEMENT .or*/ - /*caretequals .emit OPERATOR_XORASSIGN .or*/ - caretcaret .emit OPERATOR_LOGICALXOR /*.or - caret .emit OPERATOR_BITXOR*/; - -/* - * ::= - * | "[" "]" - */ -parameter_declarator - type_specifier .and identifier .and parameter_declarator_1; -parameter_declarator_1 - parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or - .true .emit PARAMETER_ARRAY_NOT_PRESENT; -parameter_declarator_2 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * - * | - * - * | - * - * | - * - * | - * - * | - * - * | - * | - */ -parameter_declaration - parameter_declaration_1 .emit PARAMETER_NEXT; -parameter_declaration_1 - parameter_declaration_2 .or parameter_declaration_3; -parameter_declaration_2 - type_qualifier .and parameter_qualifier .and parameter_declaration_4; -parameter_declaration_3 - parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4; -parameter_declaration_4 - parameter_declaration_optprec .and parameter_declaration_rest; -parameter_declaration_optprec - precision .or .true .emit PRECISION_DEFAULT; -parameter_declaration_rest - parameter_declarator .or parameter_type_specifier; - -/* - * ::= "in" - * | "out" - * | "inout" - * | "" - */ -parameter_qualifier - parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN; -parameter_qualifier_1 - "in" .emit PARAM_QUALIFIER_IN .or - "out" .emit PARAM_QUALIFIER_OUT .or - "inout" .emit PARAM_QUALIFIER_INOUT; - -/* - * ::= - * | "[" "]" - */ -parameter_type_specifier - type_specifier .and .true .emit '\0' .and parameter_type_specifier_2; -parameter_type_specifier_2 - parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or - .true .emit PARAMETER_ARRAY_NOT_PRESENT; -parameter_type_specifier_3 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - * | "," - * | "," "[" "]" - * | "," "[" "]" - * | "," "=" - */ -init_declarator_list - single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and - .true .emit DECLARATOR_NONE; -init_declarator_list_1 - comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2; -init_declarator_list_2 - init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE; -init_declarator_list_3 - equals .and initializer .emit VARIABLE_INITIALIZER; -init_declarator_list_4 - lbracket .and init_declarator_list_5 .and rbracket; -init_declarator_list_5 - constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; - -/* - * ::= - * | - * | "[" "]" - * | "[" "]" - * | "=" - */ -single_declaration - fully_specified_type .and single_declaration_1; -single_declaration_1 - single_declaration_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE; -single_declaration_2 - identifier .and single_declaration_3; -single_declaration_3 - single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE; -single_declaration_4 - equals .and initializer .emit VARIABLE_INITIALIZER; -single_declaration_5 - lbracket .and single_declaration_6 .and rbracket; -single_declaration_6 - constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN; - -/* - * ::= - * - * Example: "invariant varying highp vec3" - */ -fully_specified_type - fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier; -fully_specified_type_optinvariant - invariant_qualifier .or .true .emit TYPE_VARIANT; -fully_specified_type_optcentroid - centroid_qualifier .or .true .emit TYPE_CENTER; -fully_specified_type_optqual - type_qualifier .or .true .emit TYPE_QUALIFIER_NONE; -fully_specified_type_optprec - precision .or .true .emit PRECISION_DEFAULT; - -/* - * ::= "invariant" - */ -invariant_qualifier - "invariant" .emit TYPE_INVARIANT; - -centroid_qualifier - "centroid" .emit TYPE_CENTROID; - - -/* - * ::= "const" - * | "attribute" // Vertex only. - * | "varying" - * | "uniform" - * | "__fixed_output" - * | "__fixed_input" - * - * note: this is an extension to the standard language specification, - * normally slang disallows __fixed_output and __fixed_input type qualifiers - */ -type_qualifier - "const" .emit TYPE_QUALIFIER_CONST .or - .if (shader_type == 2) "attribute" .emit TYPE_QUALIFIER_ATTRIBUTE .or - "varying" .emit TYPE_QUALIFIER_VARYING .or - "uniform" .emit TYPE_QUALIFIER_UNIFORM .or - .if (parsing_builtin != 0) "__fixed_output" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or - .if (parsing_builtin != 0) "__fixed_input" .emit TYPE_QUALIFIER_FIXEDINPUT; - -/* - * ::= "void" - * | "float" - * | "int" - * | "bool" - * | "vec2" - * | "vec3" - * | "vec4" - * | "bvec2" - * | "bvec3" - * | "bvec4" - * | "ivec2" - * | "ivec3" - * | "ivec4" - * | "mat2" - * | "mat3" - * | "mat4" - * | "mat2x3" - * | "mat3x2" - * | "mat2x4" - * | "mat4x2" - * | "mat3x4" - * | "mat4x3" - * | "sampler1D" - * | "sampler2D" - * | "sampler3D" - * | "samplerCube" - * | "sampler1DShadow" - * | "sampler2DShadow" - * | "sampler2DRect" - * | "sampler2DRectShadow" - * | - * | - */ -type_specifier_nonarray - struct_specifier .emit TYPE_SPECIFIER_STRUCT .or - "void" .emit TYPE_SPECIFIER_VOID .or - "float" .emit TYPE_SPECIFIER_FLOAT .or - "int" .emit TYPE_SPECIFIER_INT .or - "bool" .emit TYPE_SPECIFIER_BOOL .or - "vec2" .emit TYPE_SPECIFIER_VEC2 .or - "vec3" .emit TYPE_SPECIFIER_VEC3 .or - "vec4" .emit TYPE_SPECIFIER_VEC4 .or - "bvec2" .emit TYPE_SPECIFIER_BVEC2 .or - "bvec3" .emit TYPE_SPECIFIER_BVEC3 .or - "bvec4" .emit TYPE_SPECIFIER_BVEC4 .or - "ivec2" .emit TYPE_SPECIFIER_IVEC2 .or - "ivec3" .emit TYPE_SPECIFIER_IVEC3 .or - "ivec4" .emit TYPE_SPECIFIER_IVEC4 .or - "mat2" .emit TYPE_SPECIFIER_MAT2 .or - "mat3" .emit TYPE_SPECIFIER_MAT3 .or - "mat4" .emit TYPE_SPECIFIER_MAT4 .or - "mat2x3" .emit TYPE_SPECIFIER_MAT23 .or - "mat3x2" .emit TYPE_SPECIFIER_MAT32 .or - "mat2x4" .emit TYPE_SPECIFIER_MAT24 .or - "mat4x2" .emit TYPE_SPECIFIER_MAT42 .or - "mat3x4" .emit TYPE_SPECIFIER_MAT34 .or - "mat4x3" .emit TYPE_SPECIFIER_MAT43 .or - "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or - "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or - "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or - "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or - "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or - "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or - "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or - "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or - type_name .emit TYPE_SPECIFIER_TYPENAME; - -/* - * ::= - * | "[" "]" - */ -type_specifier - type_specifier_array .or type_specifier_1; -type_specifier_1 - type_specifier_nonarray .and .true .emit TYPE_SPECIFIER_NONARRAY; -type_specifier_array - type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket; - -/* - * ::= "struct" "{" "}" - * | "struct" "{" "}" - */ -struct_specifier - "struct" .and struct_specifier_1 .and lbrace .error LBRACE_EXPECTED .and - struct_declaration_list .and rbrace .emit FIELD_NONE; -struct_specifier_1 - identifier .or .true .emit '\0'; - -/* - * ::= - * | - */ -struct_declaration_list - struct_declaration .and .loop struct_declaration .emit FIELD_NEXT; - -/* - * ::= ";" - */ -struct_declaration - type_specifier .and struct_declarator_list .and semicolon .emit FIELD_NONE; - -/* - * ::= - * | "," - */ -struct_declarator_list - struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT; -struct_declarator_list_1 - comma .and struct_declarator; - -/* - * ::= - * | "[" "]" - */ -struct_declarator - identifier .and struct_declarator_1; -struct_declarator_1 - struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE; -struct_declarator_2 - lbracket .and constant_expression .and rbracket; - -/* - * ::= - */ -initializer - assignment_expression .and .true .emit OP_END; - -/* - * ::= - */ -declaration_statement - declaration; - -/* - * ::= - * | - */ -statement - compound_statement .or simple_statement; - -/* - * ::= <__asm_statement> - * | - * | - * | - * | - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows use of __asm statements - */ -simple_statement - .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or - selection_statement .or - iteration_statement .or - precision_stmt .emit OP_PRECISION .or - jump_statement .or - expression_statement .emit OP_EXPRESSION .or - declaration_statement .emit OP_DECLARE; - -/* - * ::= "{" "}" - * | "{" "}" - */ -compound_statement - compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END; -compound_statement_1 - compound_statement_2 .or compound_statement_3; -compound_statement_2 - lbrace .and rbrace; -compound_statement_3 - lbrace .and statement_list .and rbrace; - -/* - * ::= "{" "}" - * | "{" "}" - */ -compound_statement_no_new_scope - compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END; -compound_statement_no_new_scope_1 - compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3; -compound_statement_no_new_scope_2 - lbrace .and rbrace; -compound_statement_no_new_scope_3 - lbrace .and statement_list .and rbrace; - - -/* - * ::= - * | - */ -statement_list - statement .and .loop statement; - -/* - * ::= ";" - * | ";" - */ -expression_statement - expression_statement_1 .or expression_statement_2; -expression_statement_1 - semicolon .emit OP_PUSH_VOID .emit OP_END; -expression_statement_2 - expression .and semicolon .emit OP_END; - -/* - * ::= "if" "(" ")" - */ -selection_statement - "if" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and - rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement; - -/* - * ::= "else" - * | - */ -selection_rest_statement - statement .and selection_rest_statement_1; -selection_rest_statement_1 - selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END; -selection_rest_statement_2 - "else" .and statement; - -/* - * ::= - * | "=" - * - * note: if is executed, the emit format must - * match emit format - */ -condition - condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or - condition_2 .emit OP_EXPRESSION; -condition_1 - fully_specified_type .and identifier .emit VARIABLE_IDENTIFIER .and - equals .emit VARIABLE_INITIALIZER .and initializer .and .true .emit DECLARATOR_NONE; -condition_2 - expression .and .true .emit OP_END; - -/* - * ::= "while" "(" ")" - * | "do" "while" "(" ")" ";" - * | "for" "(" ")" - */ -iteration_statement - iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3; -iteration_statement_1 - "while" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and - rparen .error RPAREN_EXPECTED .and statement; -iteration_statement_2 - "do" .emit OP_DO .and statement .and "while" .and lparen .error LPAREN_EXPECTED .and - expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon; -iteration_statement_3 - "for" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and - for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement; - -/* - * ::= - * | - */ -for_init_statement - expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE; - -/* - * ::= - * | "" - * - * note: is used only by "for" statement. - * if is ommitted, parser simulates default behaviour, - * that is simulates "true" expression - */ -conditionopt - condition .or - .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\0' .emit OP_END; - -/* - * ::= ";" - * | ";" - */ -for_rest_statement - conditionopt .and semicolon .and for_rest_statement_1; -for_rest_statement_1 - for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END; -for_rest_statement_2 - expression .and .true .emit OP_END; - -/* - * ::= "continue" ";" - * | "break" ";" - * | "return" ";" - * | "return" ";" - * | "discard" ";" // Fragment shader only. - */ -jump_statement - jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or - .if (shader_type == 1) jump_statement_5; -jump_statement_1 - "continue" .and semicolon .emit OP_CONTINUE; -jump_statement_2 - "break" .and semicolon .emit OP_BREAK; -jump_statement_3 - "return" .emit OP_RETURN .and expression .and semicolon .emit OP_END; -jump_statement_4 - "return" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END; -jump_statement_5 - "discard" .and semicolon .emit OP_DISCARD; - -/* - * <__asm_statement> ::= "__asm" ";" - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -__asm_statement - "__asm" .and identifier .and asm_arguments .and semicolon .emit OP_END; - -/* - * ::= - * | "," - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -asm_arguments - asm_argument .and .true .emit OP_END .and .loop asm_arguments_1; -asm_arguments_1 - comma .and asm_argument .and .true .emit OP_END; - -/* - * ::= - * | - * - * note: this is an extension to the standard language specification. - * normally slang disallows __asm statements - */ -asm_argument - var_with_field .or - variable_identifier .or - floatconstant; - -var_with_field - variable_identifier .and dot .and field_selection .emit OP_FIELD; - - -/* - * ::= - * | - */ -translation_unit - .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and - .loop external_declaration .and "@EOF" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL; - - -/* - * ::= - * | - */ -external_declaration - precision_stmt .emit DEFAULT_PRECISION .or - function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or - invariant_stmt .emit INVARIANT_STMT .or - declaration .emit EXTERNAL_DECLARATION; - - -/* - * ::= "precision" - */ -precision_stmt - "precision" .and precision .error INVALID_PRECISION .and prectype .error INVALID_PRECISION_TYPE .and semicolon; - -/* - * ::= "lowp" - * | "mediump" - * | "highp" - */ -precision - "lowp" .emit PRECISION_LOW .or - "mediump" .emit PRECISION_MEDIUM .or - "highp" .emit PRECISION_HIGH; - -/* - * ::= "int" - * | "float" - * | "a sampler type" - */ -prectype - "int" .emit TYPE_SPECIFIER_INT .or - "float" .emit TYPE_SPECIFIER_FLOAT .or - "sampler1D" .emit TYPE_SPECIFIER_SAMPLER1D .or - "sampler2D" .emit TYPE_SPECIFIER_SAMPLER2D .or - "sampler3D" .emit TYPE_SPECIFIER_SAMPLER3D .or - "samplerCube" .emit TYPE_SPECIFIER_SAMPLERCUBE .or - "sampler1DShadow" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or - "sampler2DShadow" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or - "sampler2DRect" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or - "sampler2DRectShadow" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW; - - -/* - * ::= "invariant" identifier; - */ -invariant_stmt - "invariant" .and identifier .and semicolon; - - -/* - * :: - */ -function_definition - function_prototype .and compound_statement_no_new_scope; - - - -/* - * helper rules, not part of the official language syntax - */ - -identifier - "@ID" .emit *; - -float - "@FLOAT" .emit 1 .emit *; - -integer - "@UINT" .emit 1 .emit *; - -boolean - "true" .emit '1' .emit '\0' .or - "false" .emit '0' .emit '\0'; - -type_name - identifier; - -field_selection - identifier; - -floatconstant - float .emit OP_PUSH_FLOAT; - -intconstant - integer .emit OP_PUSH_INT; - -boolconstant - boolean .emit OP_PUSH_BOOL; - -/* lexical rules */ - -/*ampersand - optional_space .and '&' .and optional_space;*/ - -ampersandampersand - "@&&"; - -/*ampersandequals - optional_space .and '&' .and '=' .and optional_space;*/ - -/*bar - optional_space .and '|' .and optional_space;*/ - -barbar - "@||"; - -/*barequals - optional_space .and '|' .and '=' .and optional_space;*/ - -bang - "@!"; - -bangequals - "@!="; - -/*caret - optional_space .and '^' .and optional_space;*/ - -caretcaret - "@^^"; - -/*caretequals - optional_space .and '^' .and '=' .and optional_space;*/ - -colon - "@:"; - -comma - "@,"; - -dot - "@."; - -equals - "@="; - -equalsequals - "@=="; - -greater - "@>"; - -greaterequals - "@>="; - -/*greatergreater - optional_space .and '>' .and '>' .and optional_space;*/ - -/*greatergreaterequals - optional_space .and '>' .and '>' .and '=' .and optional_space;*/ - -lbrace - "@{"; - -lbracket - "@["; - -less - "@<"; - -lessequals - "@<="; - -/*lessless - optional_space .and '<' .and '<' .and optional_space;*/ - -/*lesslessequals - optional_space .and '<' .and '<' .and '=' .and optional_space;*/ - -lparen - "@("; - -minus - "@-"; - -minusequals - "@-="; - -minusminus - "@--"; - -/*percent - optional_space .and '%' .and optional_space;*/ - -/*percentequals - optional_space .and '%' .and '=' .and optional_space;*/ - -plus - "@+"; - -plusequals - "@+="; - -plusplus - "@++"; - -question - "@?"; - -rbrace - "@}"; - -rbracket - "@]"; - -rparen - "@)"; - -semicolon - "@;"; - -slash - "@/"; - -slashequals - "@/="; - -star - "@*"; - -starequals - "@*="; - -/*tilde - optional_space .and '~' .and optional_space;*/ - diff --git a/src/mesa/shader/slang/library/slang_shader_syn.h b/src/mesa/shader/slang/library/slang_shader_syn.h deleted file mode 100644 index 488cf1a5044..00000000000 --- a/src/mesa/shader/slang/library/slang_shader_syn.h +++ /dev/null @@ -1,714 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */ - -".syntax translation_unit;\n" -".emtcode REVISION 5\n" -".emtcode EXTERNAL_NULL 0\n" -".emtcode EXTERNAL_FUNCTION_DEFINITION 1\n" -".emtcode EXTERNAL_DECLARATION 2\n" -".emtcode DEFAULT_PRECISION 3\n" -".emtcode INVARIANT_STMT 4\n" -".emtcode PRECISION_DEFAULT 0\n" -".emtcode PRECISION_LOW 1\n" -".emtcode PRECISION_MEDIUM 2\n" -".emtcode PRECISION_HIGH 3\n" -".emtcode DECLARATION_FUNCTION_PROTOTYPE 1\n" -".emtcode DECLARATION_INIT_DECLARATOR_LIST 2\n" -".emtcode FUNCTION_ORDINARY 0\n" -".emtcode FUNCTION_CONSTRUCTOR 1\n" -".emtcode FUNCTION_OPERATOR 2\n" -".emtcode FUNCTION_CALL_NONARRAY 0\n" -".emtcode FUNCTION_CALL_ARRAY 1\n" -".emtcode OPERATOR_ADDASSIGN 1\n" -".emtcode OPERATOR_SUBASSIGN 2\n" -".emtcode OPERATOR_MULASSIGN 3\n" -".emtcode OPERATOR_DIVASSIGN 4\n" -".emtcode OPERATOR_LOGICALXOR 11\n" -".emtcode OPERATOR_LESS 15\n" -".emtcode OPERATOR_GREATER 16\n" -".emtcode OPERATOR_LESSEQUAL 17\n" -".emtcode OPERATOR_GREATEREQUAL 18\n" -".emtcode OPERATOR_MULTIPLY 21\n" -".emtcode OPERATOR_DIVIDE 22\n" -".emtcode OPERATOR_INCREMENT 24\n" -".emtcode OPERATOR_DECREMENT 25\n" -".emtcode OPERATOR_PLUS 26\n" -".emtcode OPERATOR_MINUS 27\n" -".emtcode OPERATOR_NOT 29\n" -".emtcode DECLARATOR_NONE 0\n" -".emtcode DECLARATOR_NEXT 1\n" -".emtcode VARIABLE_NONE 0\n" -".emtcode VARIABLE_IDENTIFIER 1\n" -".emtcode VARIABLE_INITIALIZER 2\n" -".emtcode VARIABLE_ARRAY_EXPLICIT 3\n" -".emtcode VARIABLE_ARRAY_UNKNOWN 4\n" -".emtcode TYPE_QUALIFIER_NONE 0\n" -".emtcode TYPE_QUALIFIER_CONST 1\n" -".emtcode TYPE_QUALIFIER_ATTRIBUTE 2\n" -".emtcode TYPE_QUALIFIER_VARYING 3\n" -".emtcode TYPE_QUALIFIER_UNIFORM 4\n" -".emtcode TYPE_QUALIFIER_FIXEDOUTPUT 5\n" -".emtcode TYPE_QUALIFIER_FIXEDINPUT 6\n" -".emtcode TYPE_VARIANT 90\n" -".emtcode TYPE_INVARIANT 91\n" -".emtcode TYPE_CENTER 95\n" -".emtcode TYPE_CENTROID 96\n" -".emtcode TYPE_SPECIFIER_VOID 0\n" -".emtcode TYPE_SPECIFIER_BOOL 1\n" -".emtcode TYPE_SPECIFIER_BVEC2 2\n" -".emtcode TYPE_SPECIFIER_BVEC3 3\n" -".emtcode TYPE_SPECIFIER_BVEC4 4\n" -".emtcode TYPE_SPECIFIER_INT 5\n" -".emtcode TYPE_SPECIFIER_IVEC2 6\n" -".emtcode TYPE_SPECIFIER_IVEC3 7\n" -".emtcode TYPE_SPECIFIER_IVEC4 8\n" -".emtcode TYPE_SPECIFIER_FLOAT 9\n" -".emtcode TYPE_SPECIFIER_VEC2 10\n" -".emtcode TYPE_SPECIFIER_VEC3 11\n" -".emtcode TYPE_SPECIFIER_VEC4 12\n" -".emtcode TYPE_SPECIFIER_MAT2 13\n" -".emtcode TYPE_SPECIFIER_MAT3 14\n" -".emtcode TYPE_SPECIFIER_MAT4 15\n" -".emtcode TYPE_SPECIFIER_SAMPLER1D 16\n" -".emtcode TYPE_SPECIFIER_SAMPLER2D 17\n" -".emtcode TYPE_SPECIFIER_SAMPLER3D 18\n" -".emtcode TYPE_SPECIFIER_SAMPLERCUBE 19\n" -".emtcode TYPE_SPECIFIER_SAMPLER1DSHADOW 20\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DSHADOW 21\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DRECT 22\n" -".emtcode TYPE_SPECIFIER_SAMPLER2DRECTSHADOW 23\n" -".emtcode TYPE_SPECIFIER_STRUCT 24\n" -".emtcode TYPE_SPECIFIER_TYPENAME 25\n" -".emtcode TYPE_SPECIFIER_MAT23 26\n" -".emtcode TYPE_SPECIFIER_MAT32 27\n" -".emtcode TYPE_SPECIFIER_MAT24 28\n" -".emtcode TYPE_SPECIFIER_MAT42 29\n" -".emtcode TYPE_SPECIFIER_MAT34 30\n" -".emtcode TYPE_SPECIFIER_MAT43 31\n" -".emtcode TYPE_SPECIFIER_NONARRAY 0\n" -".emtcode TYPE_SPECIFIER_ARRAY 1\n" -".emtcode FIELD_NONE 0\n" -".emtcode FIELD_NEXT 1\n" -".emtcode FIELD_ARRAY 2\n" -".emtcode OP_END 0\n" -".emtcode OP_BLOCK_BEGIN_NO_NEW_SCOPE 1\n" -".emtcode OP_BLOCK_BEGIN_NEW_SCOPE 2\n" -".emtcode OP_DECLARE 3\n" -".emtcode OP_ASM 4\n" -".emtcode OP_BREAK 5\n" -".emtcode OP_CONTINUE 6\n" -".emtcode OP_DISCARD 7\n" -".emtcode OP_RETURN 8\n" -".emtcode OP_EXPRESSION 9\n" -".emtcode OP_IF 10\n" -".emtcode OP_WHILE 11\n" -".emtcode OP_DO 12\n" -".emtcode OP_FOR 13\n" -".emtcode OP_PUSH_VOID 14\n" -".emtcode OP_PUSH_BOOL 15\n" -".emtcode OP_PUSH_INT 16\n" -".emtcode OP_PUSH_FLOAT 17\n" -".emtcode OP_PUSH_IDENTIFIER 18\n" -".emtcode OP_SEQUENCE 19\n" -".emtcode OP_ASSIGN 20\n" -".emtcode OP_ADDASSIGN 21\n" -".emtcode OP_SUBASSIGN 22\n" -".emtcode OP_MULASSIGN 23\n" -".emtcode OP_DIVASSIGN 24\n" -".emtcode OP_SELECT 31\n" -".emtcode OP_LOGICALOR 32\n" -".emtcode OP_LOGICALXOR 33\n" -".emtcode OP_LOGICALAND 34\n" -".emtcode OP_EQUAL 38\n" -".emtcode OP_NOTEQUAL 39\n" -".emtcode OP_LESS 40\n" -".emtcode OP_GREATER 41\n" -".emtcode OP_LESSEQUAL 42\n" -".emtcode OP_GREATEREQUAL 43\n" -".emtcode OP_ADD 46\n" -".emtcode OP_SUBTRACT 47\n" -".emtcode OP_MULTIPLY 48\n" -".emtcode OP_DIVIDE 49\n" -".emtcode OP_PREINCREMENT 51\n" -".emtcode OP_PREDECREMENT 52\n" -".emtcode OP_PLUS 53\n" -".emtcode OP_MINUS 54\n" -".emtcode OP_NOT 56\n" -".emtcode OP_SUBSCRIPT 57\n" -".emtcode OP_CALL 58\n" -".emtcode OP_FIELD 59\n" -".emtcode OP_POSTINCREMENT 60\n" -".emtcode OP_POSTDECREMENT 61\n" -".emtcode OP_PRECISION 62\n" -".emtcode OP_METHOD 63\n" -".emtcode PARAM_QUALIFIER_IN 0\n" -".emtcode PARAM_QUALIFIER_OUT 1\n" -".emtcode PARAM_QUALIFIER_INOUT 2\n" -".emtcode PARAMETER_NONE 0\n" -".emtcode PARAMETER_NEXT 1\n" -".emtcode PARAMETER_ARRAY_NOT_PRESENT 0\n" -".emtcode PARAMETER_ARRAY_PRESENT 1\n" -".errtext INVALID_EXTERNAL_DECLARATION \"2001: Syntax error.\"\n" -".errtext INVALID_OPERATOR_OVERRIDE \"2002: Invalid operator override.\"\n" -".errtext LBRACE_EXPECTED \"2003: '{' expected but token found.\"\n" -".errtext LPAREN_EXPECTED \"2004: '(' expected but token found.\"\n" -".errtext RPAREN_EXPECTED \"2005: ')' expected but token found.\"\n" -".errtext INVALID_PRECISION \"2006: Invalid precision specifier.\"\n" -".errtext INVALID_PRECISION_TYPE \"2007: Invalid precision type.\"\n" -".regbyte parsing_builtin 0\n" -".regbyte shader_type 0\n" -"variable_identifier\n" -" identifier .emit OP_PUSH_IDENTIFIER;\n" -"primary_expression\n" -" floatconstant .or boolconstant .or intconstant .or variable_identifier .or primary_expression_1;\n" -"primary_expression_1\n" -" lparen .and expression .and rparen;\n" -"postfix_expression\n" -" postfix_expression_1 .and .loop postfix_expression_2;\n" -"postfix_expression_1\n" -" function_call .or primary_expression;\n" -"postfix_expression_2\n" -" postfix_expression_3 .or postfix_expression_4 .or\n" -" plusplus .emit OP_POSTINCREMENT .or\n" -" minusminus .emit OP_POSTDECREMENT;\n" -"postfix_expression_3\n" -" lbracket .and integer_expression .and rbracket .emit OP_SUBSCRIPT;\n" -"postfix_expression_4\n" -" dot .and field_selection .emit OP_FIELD;\n" -"integer_expression\n" -" expression;\n" -"function_call\n" -" function_call_or_method;\n" -"function_call_or_method\n" -" regular_function_call .or method_call;\n" -"method_call\n" -" identifier .emit OP_METHOD .and dot .and function_call_generic .and .true .emit OP_END;\n" -"regular_function_call\n" -" function_call_generic .emit OP_CALL .and .true .emit OP_END;\n" -"function_call_generic\n" -" function_call_generic_1 .or function_call_generic_2;\n" -"function_call_generic_1\n" -" function_call_header_with_parameters .and rparen .error RPAREN_EXPECTED;\n" -"function_call_generic_2\n" -" function_call_header_no_parameters .and rparen .error RPAREN_EXPECTED;\n" -"function_call_header_no_parameters\n" -" function_call_header .and function_call_header_no_parameters_1;\n" -"function_call_header_no_parameters_1\n" -" \"void\" .or .true;\n" -"function_call_header_with_parameters\n" -" function_call_header .and assignment_expression .and .true .emit OP_END .and\n" -" .loop function_call_header_with_parameters_1;\n" -"function_call_header_with_parameters_1\n" -" comma .and assignment_expression .and .true .emit OP_END;\n" -"function_call_header\n" -" function_identifier .and lparen;\n" -"function_identifier\n" -" identifier .and function_identifier_opt_array;\n" -"function_identifier_opt_array\n" -" function_identifier_array .emit FUNCTION_CALL_ARRAY .or\n" -" .true .emit FUNCTION_CALL_NONARRAY;\n" -"function_identifier_array\n" -" lbracket .and constant_expression .and rbracket;\n" -"unary_expression\n" -" postfix_expression .or unary_expression_1 .or unary_expression_2 .or unary_expression_3 .or\n" -" unary_expression_4 .or unary_expression_5;\n" -"unary_expression_1\n" -" plusplus .and unary_expression .and .true .emit OP_PREINCREMENT;\n" -"unary_expression_2\n" -" minusminus .and unary_expression .and .true .emit OP_PREDECREMENT;\n" -"unary_expression_3\n" -" plus .and unary_expression .and .true .emit OP_PLUS;\n" -"unary_expression_4\n" -" minus .and unary_expression .and .true .emit OP_MINUS;\n" -"unary_expression_5\n" -" bang .and unary_expression .and .true .emit OP_NOT;\n" -"multiplicative_expression\n" -" unary_expression .and .loop multiplicative_expression_1;\n" -"multiplicative_expression_1\n" -" multiplicative_expression_2 .or multiplicative_expression_3;\n" -"multiplicative_expression_2\n" -" star .and unary_expression .and .true .emit OP_MULTIPLY;\n" -"multiplicative_expression_3\n" -" slash .and unary_expression .and .true .emit OP_DIVIDE;\n" -"additive_expression\n" -" multiplicative_expression .and .loop additive_expression_1;\n" -"additive_expression_1\n" -" additive_expression_2 .or additive_expression_3;\n" -"additive_expression_2\n" -" plus .and multiplicative_expression .and .true .emit OP_ADD;\n" -"additive_expression_3\n" -" minus .and multiplicative_expression .and .true .emit OP_SUBTRACT;\n" -"shift_expression\n" -" additive_expression;\n" -"relational_expression\n" -" shift_expression .and .loop relational_expression_1;\n" -"relational_expression_1\n" -" relational_expression_2 .or relational_expression_3 .or relational_expression_4 .or\n" -" relational_expression_5;\n" -"relational_expression_2\n" -" lessequals .and shift_expression .and .true .emit OP_LESSEQUAL;\n" -"relational_expression_3\n" -" greaterequals .and shift_expression .and .true .emit OP_GREATEREQUAL;\n" -"relational_expression_4\n" -" less .and shift_expression .and .true .emit OP_LESS;\n" -"relational_expression_5\n" -" greater .and shift_expression .and .true .emit OP_GREATER;\n" -"equality_expression\n" -" relational_expression .and .loop equality_expression_1;\n" -"equality_expression_1\n" -" equality_expression_2 .or equality_expression_3;\n" -"equality_expression_2\n" -" equalsequals .and relational_expression .and .true .emit OP_EQUAL;\n" -"equality_expression_3\n" -" bangequals .and relational_expression .and .true .emit OP_NOTEQUAL;\n" -"and_expression\n" -" equality_expression;\n" -"exclusive_or_expression\n" -" and_expression;\n" -"inclusive_or_expression\n" -" exclusive_or_expression;\n" -"logical_and_expression\n" -" inclusive_or_expression .and .loop logical_and_expression_1;\n" -"logical_and_expression_1\n" -" ampersandampersand .and inclusive_or_expression .and .true .emit OP_LOGICALAND;\n" -"logical_xor_expression\n" -" logical_and_expression .and .loop logical_xor_expression_1;\n" -"logical_xor_expression_1\n" -" caretcaret .and logical_and_expression .and .true .emit OP_LOGICALXOR;\n" -"logical_or_expression\n" -" logical_xor_expression .and .loop logical_or_expression_1;\n" -"logical_or_expression_1\n" -" barbar .and logical_xor_expression .and .true .emit OP_LOGICALOR;\n" -"conditional_expression\n" -" logical_or_expression .and .loop conditional_expression_1;\n" -"conditional_expression_1\n" -" question .and expression .and colon .and conditional_expression .and .true .emit OP_SELECT;\n" -"assignment_expression\n" -" assignment_expression_1 .or assignment_expression_2 .or assignment_expression_3 .or\n" -" assignment_expression_4 .or assignment_expression_5 .or conditional_expression;\n" -"assignment_expression_1\n" -" unary_expression .and equals .and assignment_expression .and .true .emit OP_ASSIGN;\n" -"assignment_expression_2\n" -" unary_expression .and starequals .and assignment_expression .and .true .emit OP_MULASSIGN;\n" -"assignment_expression_3\n" -" unary_expression .and slashequals .and assignment_expression .and .true .emit OP_DIVASSIGN;\n" -"assignment_expression_4\n" -" unary_expression .and plusequals .and assignment_expression .and .true .emit OP_ADDASSIGN;\n" -"assignment_expression_5\n" -" unary_expression .and minusequals .and assignment_expression .and .true .emit OP_SUBASSIGN;\n" -"expression\n" -" assignment_expression .and .loop expression_1;\n" -"expression_1\n" -" comma .and assignment_expression .and .true .emit OP_SEQUENCE;\n" -"constant_expression\n" -" conditional_expression .and .true .emit OP_END;\n" -"declaration\n" -" declaration_1 .or declaration_2;\n" -"declaration_1\n" -" function_prototype .emit DECLARATION_FUNCTION_PROTOTYPE .and semicolon;\n" -"declaration_2\n" -" init_declarator_list .emit DECLARATION_INIT_DECLARATOR_LIST .and semicolon;\n" -"function_prototype\n" -" function_prototype_1 .or function_prototype_2;\n" -"function_prototype_1\n" -" function_header .and \"void\" .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n" -"function_prototype_2\n" -" function_declarator .and rparen .error RPAREN_EXPECTED .emit PARAMETER_NONE;\n" -"function_declarator\n" -" function_header_with_parameters .or function_header;\n" -"function_header_with_parameters\n" -" function_header .and parameter_declaration .and .loop function_header_with_parameters_1;\n" -"function_header_with_parameters_1\n" -" comma .and parameter_declaration;\n" -"function_header\n" -" fully_specified_type .and function_decl_identifier .and lparen;\n" -"function_decl_identifier\n" -" .if (parsing_builtin != 0) __operator .emit FUNCTION_OPERATOR .or\n" -" .if (parsing_builtin != 0) \"__constructor\" .emit FUNCTION_CONSTRUCTOR .or\n" -" identifier .emit FUNCTION_ORDINARY;\n" -"__operator\n" -" \"__operator\" .and overriden_operator .error INVALID_OPERATOR_OVERRIDE;\n" -"overriden_operator\n" -" plusplus .emit OPERATOR_INCREMENT .or\n" -" plusequals .emit OPERATOR_ADDASSIGN .or\n" -" plus .emit OPERATOR_PLUS .or\n" -" minusminus .emit OPERATOR_DECREMENT .or\n" -" minusequals .emit OPERATOR_SUBASSIGN .or\n" -" minus .emit OPERATOR_MINUS .or\n" -" bang .emit OPERATOR_NOT .or\n" -" starequals .emit OPERATOR_MULASSIGN .or\n" -" star .emit OPERATOR_MULTIPLY .or\n" -" slashequals .emit OPERATOR_DIVASSIGN .or\n" -" slash .emit OPERATOR_DIVIDE .or\n" -" lessequals .emit OPERATOR_LESSEQUAL .or\n" -" \n" -" \n" -" less .emit OPERATOR_LESS .or\n" -" greaterequals .emit OPERATOR_GREATEREQUAL .or\n" -" \n" -" \n" -" greater .emit OPERATOR_GREATER .or\n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" \n" -" caretcaret .emit OPERATOR_LOGICALXOR ;\n" -"parameter_declarator\n" -" type_specifier .and identifier .and parameter_declarator_1;\n" -"parameter_declarator_1\n" -" parameter_declarator_2 .emit PARAMETER_ARRAY_PRESENT .or\n" -" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" -"parameter_declarator_2\n" -" lbracket .and constant_expression .and rbracket;\n" -"parameter_declaration\n" -" parameter_declaration_1 .emit PARAMETER_NEXT;\n" -"parameter_declaration_1\n" -" parameter_declaration_2 .or parameter_declaration_3;\n" -"parameter_declaration_2\n" -" type_qualifier .and parameter_qualifier .and parameter_declaration_4;\n" -"parameter_declaration_3\n" -" parameter_qualifier .emit TYPE_QUALIFIER_NONE .and parameter_declaration_4;\n" -"parameter_declaration_4\n" -" parameter_declaration_optprec .and parameter_declaration_rest;\n" -"parameter_declaration_optprec\n" -" precision .or .true .emit PRECISION_DEFAULT;\n" -"parameter_declaration_rest\n" -" parameter_declarator .or parameter_type_specifier;\n" -"parameter_qualifier\n" -" parameter_qualifier_1 .or .true .emit PARAM_QUALIFIER_IN;\n" -"parameter_qualifier_1\n" -" \"in\" .emit PARAM_QUALIFIER_IN .or\n" -" \"out\" .emit PARAM_QUALIFIER_OUT .or\n" -" \"inout\" .emit PARAM_QUALIFIER_INOUT;\n" -"parameter_type_specifier\n" -" type_specifier .and .true .emit '\\0' .and parameter_type_specifier_2;\n" -"parameter_type_specifier_2\n" -" parameter_type_specifier_3 .emit PARAMETER_ARRAY_PRESENT .or\n" -" .true .emit PARAMETER_ARRAY_NOT_PRESENT;\n" -"parameter_type_specifier_3\n" -" lbracket .and constant_expression .and rbracket;\n" -"init_declarator_list\n" -" single_declaration .and .loop init_declarator_list_1 .emit DECLARATOR_NEXT .and\n" -" .true .emit DECLARATOR_NONE;\n" -"init_declarator_list_1\n" -" comma .and identifier .emit VARIABLE_IDENTIFIER .and init_declarator_list_2;\n" -"init_declarator_list_2\n" -" init_declarator_list_3 .or init_declarator_list_4 .or .true .emit VARIABLE_NONE;\n" -"init_declarator_list_3\n" -" equals .and initializer .emit VARIABLE_INITIALIZER;\n" -"init_declarator_list_4\n" -" lbracket .and init_declarator_list_5 .and rbracket;\n" -"init_declarator_list_5\n" -" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" -"single_declaration\n" -" fully_specified_type .and single_declaration_1;\n" -"single_declaration_1\n" -" single_declaration_2 .emit VARIABLE_IDENTIFIER .or .true .emit VARIABLE_NONE;\n" -"single_declaration_2\n" -" identifier .and single_declaration_3;\n" -"single_declaration_3\n" -" single_declaration_4 .or single_declaration_5 .or .true .emit VARIABLE_NONE;\n" -"single_declaration_4\n" -" equals .and initializer .emit VARIABLE_INITIALIZER;\n" -"single_declaration_5\n" -" lbracket .and single_declaration_6 .and rbracket;\n" -"single_declaration_6\n" -" constant_expression .emit VARIABLE_ARRAY_EXPLICIT .or .true .emit VARIABLE_ARRAY_UNKNOWN;\n" -"fully_specified_type\n" -" fully_specified_type_optinvariant .and fully_specified_type_optcentroid .and fully_specified_type_optqual .and fully_specified_type_optprec .and type_specifier;\n" -"fully_specified_type_optinvariant\n" -" invariant_qualifier .or .true .emit TYPE_VARIANT;\n" -"fully_specified_type_optcentroid\n" -" centroid_qualifier .or .true .emit TYPE_CENTER;\n" -"fully_specified_type_optqual\n" -" type_qualifier .or .true .emit TYPE_QUALIFIER_NONE;\n" -"fully_specified_type_optprec\n" -" precision .or .true .emit PRECISION_DEFAULT;\n" -"invariant_qualifier\n" -" \"invariant\" .emit TYPE_INVARIANT;\n" -"centroid_qualifier\n" -" \"centroid\" .emit TYPE_CENTROID;\n" -"type_qualifier\n" -" \"const\" .emit TYPE_QUALIFIER_CONST .or\n" -" .if (shader_type == 2) \"attribute\" .emit TYPE_QUALIFIER_ATTRIBUTE .or\n" -" \"varying\" .emit TYPE_QUALIFIER_VARYING .or\n" -" \"uniform\" .emit TYPE_QUALIFIER_UNIFORM .or\n" -" .if (parsing_builtin != 0) \"__fixed_output\" .emit TYPE_QUALIFIER_FIXEDOUTPUT .or\n" -" .if (parsing_builtin != 0) \"__fixed_input\" .emit TYPE_QUALIFIER_FIXEDINPUT;\n" -"type_specifier_nonarray\n" -" struct_specifier .emit TYPE_SPECIFIER_STRUCT .or\n" -" \"void\" .emit TYPE_SPECIFIER_VOID .or\n" -" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" -" \"int\" .emit TYPE_SPECIFIER_INT .or\n" -" \"bool\" .emit TYPE_SPECIFIER_BOOL .or\n" -" \"vec2\" .emit TYPE_SPECIFIER_VEC2 .or\n" -" \"vec3\" .emit TYPE_SPECIFIER_VEC3 .or\n" -" \"vec4\" .emit TYPE_SPECIFIER_VEC4 .or\n" -" \"bvec2\" .emit TYPE_SPECIFIER_BVEC2 .or\n" -" \"bvec3\" .emit TYPE_SPECIFIER_BVEC3 .or\n" -" \"bvec4\" .emit TYPE_SPECIFIER_BVEC4 .or\n" -" \"ivec2\" .emit TYPE_SPECIFIER_IVEC2 .or\n" -" \"ivec3\" .emit TYPE_SPECIFIER_IVEC3 .or\n" -" \"ivec4\" .emit TYPE_SPECIFIER_IVEC4 .or\n" -" \"mat2\" .emit TYPE_SPECIFIER_MAT2 .or\n" -" \"mat3\" .emit TYPE_SPECIFIER_MAT3 .or\n" -" \"mat4\" .emit TYPE_SPECIFIER_MAT4 .or\n" -" \"mat2x3\" .emit TYPE_SPECIFIER_MAT23 .or\n" -" \"mat3x2\" .emit TYPE_SPECIFIER_MAT32 .or\n" -" \"mat2x4\" .emit TYPE_SPECIFIER_MAT24 .or\n" -" \"mat4x2\" .emit TYPE_SPECIFIER_MAT42 .or\n" -" \"mat3x4\" .emit TYPE_SPECIFIER_MAT34 .or\n" -" \"mat4x3\" .emit TYPE_SPECIFIER_MAT43 .or\n" -" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n" -" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n" -" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n" -" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n" -" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n" -" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n" -" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" -" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW .or\n" -" type_name .emit TYPE_SPECIFIER_TYPENAME;\n" -"type_specifier\n" -" type_specifier_array .or type_specifier_1;\n" -"type_specifier_1\n" -" type_specifier_nonarray .and .true .emit TYPE_SPECIFIER_NONARRAY;\n" -"type_specifier_array\n" -" type_specifier_nonarray .and lbracket .emit TYPE_SPECIFIER_ARRAY .and constant_expression .and rbracket;\n" -"struct_specifier\n" -" \"struct\" .and struct_specifier_1 .and lbrace .error LBRACE_EXPECTED .and\n" -" struct_declaration_list .and rbrace .emit FIELD_NONE;\n" -"struct_specifier_1\n" -" identifier .or .true .emit '\\0';\n" -"struct_declaration_list\n" -" struct_declaration .and .loop struct_declaration .emit FIELD_NEXT;\n" -"struct_declaration\n" -" type_specifier .and struct_declarator_list .and semicolon .emit FIELD_NONE;\n" -"struct_declarator_list\n" -" struct_declarator .and .loop struct_declarator_list_1 .emit FIELD_NEXT;\n" -"struct_declarator_list_1\n" -" comma .and struct_declarator;\n" -"struct_declarator\n" -" identifier .and struct_declarator_1;\n" -"struct_declarator_1\n" -" struct_declarator_2 .emit FIELD_ARRAY .or .true .emit FIELD_NONE;\n" -"struct_declarator_2\n" -" lbracket .and constant_expression .and rbracket;\n" -"initializer\n" -" assignment_expression .and .true .emit OP_END;\n" -"declaration_statement\n" -" declaration;\n" -"statement\n" -" compound_statement .or simple_statement;\n" -"simple_statement\n" -" .if (parsing_builtin != 0) __asm_statement .emit OP_ASM .or\n" -" selection_statement .or\n" -" iteration_statement .or\n" -" precision_stmt .emit OP_PRECISION .or\n" -" jump_statement .or\n" -" expression_statement .emit OP_EXPRESSION .or\n" -" declaration_statement .emit OP_DECLARE;\n" -"compound_statement\n" -" compound_statement_1 .emit OP_BLOCK_BEGIN_NEW_SCOPE .and .true .emit OP_END;\n" -"compound_statement_1\n" -" compound_statement_2 .or compound_statement_3;\n" -"compound_statement_2\n" -" lbrace .and rbrace;\n" -"compound_statement_3\n" -" lbrace .and statement_list .and rbrace;\n" -"compound_statement_no_new_scope\n" -" compound_statement_no_new_scope_1 .emit OP_BLOCK_BEGIN_NO_NEW_SCOPE .and .true .emit OP_END;\n" -"compound_statement_no_new_scope_1\n" -" compound_statement_no_new_scope_2 .or compound_statement_no_new_scope_3;\n" -"compound_statement_no_new_scope_2\n" -" lbrace .and rbrace;\n" -"compound_statement_no_new_scope_3\n" -" lbrace .and statement_list .and rbrace;\n" -"statement_list\n" -" statement .and .loop statement;\n" -"expression_statement\n" -" expression_statement_1 .or expression_statement_2;\n" -"expression_statement_1\n" -" semicolon .emit OP_PUSH_VOID .emit OP_END;\n" -"expression_statement_2\n" -" expression .and semicolon .emit OP_END;\n" -"selection_statement\n" -" \"if\" .emit OP_IF .and lparen .error LPAREN_EXPECTED .and expression .and\n" -" rparen .error RPAREN_EXPECTED .emit OP_END .and selection_rest_statement;\n" -"selection_rest_statement\n" -" statement .and selection_rest_statement_1;\n" -"selection_rest_statement_1\n" -" selection_rest_statement_2 .or .true .emit OP_EXPRESSION .emit OP_PUSH_VOID .emit OP_END;\n" -"selection_rest_statement_2\n" -" \"else\" .and statement;\n" -"condition\n" -" condition_1 .emit OP_DECLARE .emit DECLARATION_INIT_DECLARATOR_LIST .or\n" -" condition_2 .emit OP_EXPRESSION;\n" -"condition_1\n" -" fully_specified_type .and identifier .emit VARIABLE_IDENTIFIER .and\n" -" equals .emit VARIABLE_INITIALIZER .and initializer .and .true .emit DECLARATOR_NONE;\n" -"condition_2\n" -" expression .and .true .emit OP_END;\n" -"iteration_statement\n" -" iteration_statement_1 .or iteration_statement_2 .or iteration_statement_3;\n" -"iteration_statement_1\n" -" \"while\" .emit OP_WHILE .and lparen .error LPAREN_EXPECTED .and condition .and\n" -" rparen .error RPAREN_EXPECTED .and statement;\n" -"iteration_statement_2\n" -" \"do\" .emit OP_DO .and statement .and \"while\" .and lparen .error LPAREN_EXPECTED .and\n" -" expression .and rparen .error RPAREN_EXPECTED .emit OP_END .and semicolon;\n" -"iteration_statement_3\n" -" \"for\" .emit OP_FOR .and lparen .error LPAREN_EXPECTED .and for_init_statement .and\n" -" for_rest_statement .and rparen .error RPAREN_EXPECTED .and statement;\n" -"for_init_statement\n" -" expression_statement .emit OP_EXPRESSION .or declaration_statement .emit OP_DECLARE;\n" -"conditionopt\n" -" condition .or\n" -" .true .emit OP_EXPRESSION .emit OP_PUSH_BOOL .emit 2 .emit '1' .emit '\\0' .emit OP_END;\n" -"for_rest_statement\n" -" conditionopt .and semicolon .and for_rest_statement_1;\n" -"for_rest_statement_1\n" -" for_rest_statement_2 .or .true .emit OP_PUSH_VOID .emit OP_END;\n" -"for_rest_statement_2\n" -" expression .and .true .emit OP_END;\n" -"jump_statement\n" -" jump_statement_1 .or jump_statement_2 .or jump_statement_3 .or jump_statement_4 .or\n" -" .if (shader_type == 1) jump_statement_5;\n" -"jump_statement_1\n" -" \"continue\" .and semicolon .emit OP_CONTINUE;\n" -"jump_statement_2\n" -" \"break\" .and semicolon .emit OP_BREAK;\n" -"jump_statement_3\n" -" \"return\" .emit OP_RETURN .and expression .and semicolon .emit OP_END;\n" -"jump_statement_4\n" -" \"return\" .emit OP_RETURN .and semicolon .emit OP_PUSH_VOID .emit OP_END;\n" -"jump_statement_5\n" -" \"discard\" .and semicolon .emit OP_DISCARD;\n" -"__asm_statement\n" -" \"__asm\" .and identifier .and asm_arguments .and semicolon .emit OP_END;\n" -"asm_arguments\n" -" asm_argument .and .true .emit OP_END .and .loop asm_arguments_1;\n" -"asm_arguments_1\n" -" comma .and asm_argument .and .true .emit OP_END;\n" -"asm_argument\n" -" var_with_field .or\n" -" variable_identifier .or\n" -" floatconstant;\n" -"var_with_field\n" -" variable_identifier .and dot .and field_selection .emit OP_FIELD;\n" -"translation_unit\n" -" .true .emit REVISION .and external_declaration .error INVALID_EXTERNAL_DECLARATION .and\n" -" .loop external_declaration .and \"@EOF\" .error INVALID_EXTERNAL_DECLARATION .emit EXTERNAL_NULL;\n" -"external_declaration\n" -" precision_stmt .emit DEFAULT_PRECISION .or\n" -" function_definition .emit EXTERNAL_FUNCTION_DEFINITION .or\n" -" invariant_stmt .emit INVARIANT_STMT .or\n" -" declaration .emit EXTERNAL_DECLARATION;\n" -"precision_stmt\n" -" \"precision\" .and precision .error INVALID_PRECISION .and prectype .error INVALID_PRECISION_TYPE .and semicolon;\n" -"precision\n" -" \"lowp\" .emit PRECISION_LOW .or\n" -" \"mediump\" .emit PRECISION_MEDIUM .or\n" -" \"highp\" .emit PRECISION_HIGH;\n" -"prectype\n" -" \"int\" .emit TYPE_SPECIFIER_INT .or\n" -" \"float\" .emit TYPE_SPECIFIER_FLOAT .or\n" -" \"sampler1D\" .emit TYPE_SPECIFIER_SAMPLER1D .or\n" -" \"sampler2D\" .emit TYPE_SPECIFIER_SAMPLER2D .or\n" -" \"sampler3D\" .emit TYPE_SPECIFIER_SAMPLER3D .or\n" -" \"samplerCube\" .emit TYPE_SPECIFIER_SAMPLERCUBE .or\n" -" \"sampler1DShadow\" .emit TYPE_SPECIFIER_SAMPLER1DSHADOW .or\n" -" \"sampler2DShadow\" .emit TYPE_SPECIFIER_SAMPLER2DSHADOW .or\n" -" \"sampler2DRect\" .emit TYPE_SPECIFIER_SAMPLER2DRECT .or\n" -" \"sampler2DRectShadow\" .emit TYPE_SPECIFIER_SAMPLER2DRECTSHADOW;\n" -"invariant_stmt\n" -" \"invariant\" .and identifier .and semicolon;\n" -"function_definition\n" -" function_prototype .and compound_statement_no_new_scope;\n" -"identifier\n" -" \"@ID\" .emit *;\n" -"float\n" -" \"@FLOAT\" .emit 1 .emit *;\n" -"integer\n" -" \"@UINT\" .emit 1 .emit *;\n" -"boolean\n" -" \"true\" .emit '1' .emit '\\0' .or\n" -" \"false\" .emit '0' .emit '\\0';\n" -"type_name\n" -" identifier;\n" -"field_selection\n" -" identifier;\n" -"floatconstant\n" -" float .emit OP_PUSH_FLOAT;\n" -"intconstant\n" -" integer .emit OP_PUSH_INT;\n" -"boolconstant\n" -" boolean .emit OP_PUSH_BOOL;\n" -"ampersandampersand\n" -" \"@&&\";\n" -"barbar\n" -" \"@||\";\n" -"bang\n" -" \"@!\";\n" -"bangequals\n" -" \"@!=\";\n" -"caretcaret\n" -" \"@^^\";\n" -"colon\n" -" \"@:\";\n" -"comma\n" -" \"@,\";\n" -"dot\n" -" \"@.\";\n" -"equals\n" -" \"@=\";\n" -"equalsequals\n" -" \"@==\";\n" -"greater\n" -" \"@>\";\n" -"greaterequals\n" -" \"@>=\";\n" -"lbrace\n" -" \"@{\";\n" -"lbracket\n" -" \"@[\";\n" -"less\n" -" \"@<\";\n" -"lessequals\n" -" \"@<=\";\n" -"lparen\n" -" \"@(\";\n" -"minus\n" -" \"@-\";\n" -"minusequals\n" -" \"@-=\";\n" -"minusminus\n" -" \"@--\";\n" -"plus\n" -" \"@+\";\n" -"plusequals\n" -" \"@+=\";\n" -"plusplus\n" -" \"@++\";\n" -"question\n" -" \"@?\";\n" -"rbrace\n" -" \"@}\";\n" -"rbracket\n" -" \"@]\";\n" -"rparen\n" -" \"@)\";\n" -"semicolon\n" -" \"@;\";\n" -"slash\n" -" \"@/\";\n" -"slashequals\n" -" \"@/=\";\n" -"star\n" -" \"@*\";\n" -"starequals\n" -" \"@*=\";\n" -"" diff --git a/src/mesa/shader/slang/library/syn_to_c.c b/src/mesa/shader/slang/library/syn_to_c.c deleted file mode 100644 index f997edfd8b5..00000000000 --- a/src/mesa/shader/slang/library/syn_to_c.c +++ /dev/null @@ -1,72 +0,0 @@ -#include - -static int was_space = 0; -static int first_char = 1; - -static void put_char (int c) -{ - if (c == '\n') { - if (!first_char) { - fputs ("\\n\"\n\"", stdout); - first_char = 1; - } - } - else { - first_char = 0; - if (c == '\\') - fputs ("\\\\", stdout); - else if (c == '\"') - fputs ("\\\"", stdout); - else if (!was_space || !(c == ' ' || c == '\t')) - fputc (c, stdout); - was_space = (c == ' ' || c == '\t'); - } -} - -int main (int argc, char *argv[]) -{ - int c; - FILE *f; - - if (argc == 1) - return 1; - f = fopen (argv[1], "r"); - if (f == NULL) - return 1; - - fputs ("\n", stdout); - fputs ("/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE .syn FILE */\n", stdout); - fputs ("\n", stdout); - fputs ("\"", stdout); - c = getc (f); - while (c != EOF) { - if (c == '/') { - int c2 = getc (f); - if (c2 == '*') { - was_space = 0; - c = getc (f); - for (;;) { - if (c == '*') { - c2 = getc (f); - if (c2 == '/') - break; - } - c = getc (f); - } - } - else { - put_char (c); - put_char (c2); - } - } - else { - put_char (c); - } - c = getc (f); - } - fputs ("\"\n", stdout); - - fclose (f); - return 0; -} - diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 830a2d00bc4..7669b7e8a6e 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2758,10 +2758,6 @@ compile_with_grammar(const char *source, return GL_TRUE; } -LONGSTRING static const char *slang_shader_syn = -#include "library/slang_shader_syn.h" - ; - static const unsigned char slang_core_gc[] = { #include "library/slang_core_gc.h" }; -- cgit v1.2.3 From b385312bc7f0b0b0d7410ef88eaa712831929abc Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 06:03:56 +0100 Subject: slang: Regenerate .gc files. --- src/mesa/shader/slang/library/slang_120_core_gc.h | 1465 +++++++++-------- .../slang/library/slang_builtin_120_common_gc.h | 201 ++- .../shader/slang/library/slang_common_builtin_gc.h | 1659 +++++++++---------- src/mesa/shader/slang/library/slang_core_gc.h | 1686 ++++++++++---------- .../shader/slang/library/slang_vertex_builtin_gc.h | 160 +- 5 files changed, 2581 insertions(+), 2590 deletions(-) diff --git a/src/mesa/shader/slang/library/slang_120_core_gc.h b/src/mesa/shader/slang/library/slang_120_core_gc.h index 1fdbddf7c3e..76c77631ea5 100644 --- a/src/mesa/shader/slang/library/slang_120_core_gc.h +++ b/src/mesa/shader/slang/library/slang_120_core_gc.h @@ -4,761 +4,756 @@ 5,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0, 1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0, -18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -5,0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95, +101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0, +18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1, +48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,5, +0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95, 114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, 1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95, 114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -11,0,99,48,0,0,1,1,0,0,11,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99,48, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0, +11,0,99,48,0,0,1,1,0,0,11,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,99,48, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0, 0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0, 1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51, -49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119, -0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0, +49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,1,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119, +0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17, +1,48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0, 0,28,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0, 0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0, 0,28,0,1,1,1,0,0,1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0, 0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0, -28,0,1,1,1,0,0,12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95, +28,0,1,1,1,0,0,12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1,90,95, 0,0,27,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9, 0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0, -0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,5,0,105,0,0,0, -1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0, +18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,5,0,105,0,0,0,1, +3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, 97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,1,0,98,0,0,0,1, 3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, 108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,10,0,99,48,0,0,1, -1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, +1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, +99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, 0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0,1,1,0,0,9,0,102,48,49,0,0, 1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51,49,0,0,1,1,0,0,9,0,102,48, 50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,50,50,0,0,1,1,0,0,9,0,102,51,50,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59, -122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,102,51,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,119, -0,18,102,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,50,0,57,59,119,0,18,102,51,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0, -17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17, -48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2, +95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59, +122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119,0,18,102,51,48,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,119,0, +18,102,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0, +57,59,119,0,18,102,51,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48, +46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1, +48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2, 90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97, 108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,1,0,98,0,0,0,1,3, 2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, 108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,12,0,99,48,0,0,1, -1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, +1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, +99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, 0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0, 1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120, -0,18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0, -18,102,49,51,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,52,120,50,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,16,10,52,0,0,17,48,0,48, -0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,5,0, -105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,1,0, -98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,10, -0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,1,1,0,0,10,0,99,51,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,48,48,0,0,1, -1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49, -0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102, -50,50,0,0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,1,1,0,0,9,0,102,50,51,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,102,48, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,102,50, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,59,122,0,18,102,50,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0, -0,0,17,48,0,48,0,0,0,18,102,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,102,0,0,17, -48,0,48,0,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,5,0,105,0,0,0, -1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,1,0,98,0,0,0,1, -3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,11,0,99,48,0,0,1, -1,0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,1,1,0,0,11,0,99,51,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1, -90,95,0,0,13,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0, -18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0, -18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16, -10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57, -59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121, -0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0, -1,90,95,0,0,13,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0, -0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0, -26,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,26, -0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109, -0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,31,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16, -10,49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59, -120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57, -59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0, -57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48, -0,48,0,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17, -48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0, -0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0, -0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,0,20,0,0,1, -90,95,0,0,28,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90, -95,0,0,28,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52, -0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,15,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,0,18, -109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, -0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0, -28,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17, -48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10, -49,0,57,59,122,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0, -16,8,48,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57, -59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,122,0,0,17,48,0,48,0,0,0,0, -20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0, -0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0, -48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0, -57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,29,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0, -18,109,0,16,8,48,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,18,109,0,16,10,49,0,57,59,120,0, -0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1, -1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,27,0,1,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8, -48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,14, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57, -0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,30,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120, -0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59, -121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0, -27,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,121, -0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16, -10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0, -1,90,95,0,0,27,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,58,118,101,99,50,0,0,17,48,0,48,0,0,0, -0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16, -10,49,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0, -1,90,95,0,0,27,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0, -57,59,120,0,0,18,109,0,16,10,49,0,57,59,121,0,0,17,48,0,48,0,0,0,17,48,0,48,0,0,0,0,20,0,0,1,90,95, -0,0,14,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0, -14,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0, -16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0, -0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57, -59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122, -0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0, -18,109,0,16,10,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,26,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0, -57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,28,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,59,120,121,122,0,0, -18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90, -95,0,0,14,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0, -17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0, -0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,13,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18, -109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0, -30,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,30, -0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109, -0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1, -0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0, -0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10, -49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1, -0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0, -0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0, -16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0, -20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,51,120,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17, -48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -30,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18, -109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,29, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,31,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57, -59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109, -0,16,10,51,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16, -10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,18,109,0,16,10,51,0,57,59,120,121, -0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18, -109,0,16,10,50,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0, -30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0, -57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,18,109,0,16,10,50,0,57,59,120,121,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0,57,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120, -121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,59,120,121,0,0,18,109,0,16,10,49,0,57,59,120,121,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,31,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,15,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,59,120, -121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50,0,57,59,120,121,122,0,0,18, -109,0,16,10,51,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10, -49,0,57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -31,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, -109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,18,109,0,16,10,50, -0,57,59,120,121,122,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0, -0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,26,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16, -10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0, -20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,52,120,51,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18, -109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0, -31,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, -109,0,16,8,48,0,57,59,120,121,122,0,0,18,109,0,16,10,49,0,57,59,120,121,122,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1, -0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,8, -48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0, -0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,15,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,30,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,18,109,0,16,10,49,0, -57,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1, -90,95,0,0,15,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0, -18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0, -57,0,17,48,0,0,0,0,18,109,0,16,10,51,0,57,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,28,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,18,109, -0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0, -0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,49,0,0,0,0,17,48, -0,0,0,0,18,109,0,16,10,51,0,57,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0, -14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0, -17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17,48,0,0,0,0,17,48, -0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0,0,0, -18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17, -48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,27,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57,0,17,48,0,0, -0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,50,0,57,0,17, -49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,0,20,0,0,1,90,95, -0,0,15,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109, -0,16,8,48,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0,18,109,0,16,10,49,0,57,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,48,0,0,0,0,17,48,0,0,0,0,17,49,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0,17,48,0,0,0,0, -17,49,0,0,0,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109, -0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1, -90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2, -0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21, -0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -21,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10, -51,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,110,0,16,8,48,0,57,21,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,21,0,9,18,109,0, -16,10,50,0,57,18,110,0,16,10,50,0,57,21,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,21,0,0,1, -90,95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2, -0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18, -109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27,0,109,0,0,1,1,0,0, -27,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18, -110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,22,0,0,1,90,95,0,0,0,0,2, -2,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,22,0, -9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0, -57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,110,0,16,8,48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,90, -95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,22,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,22,0,9,18,109,0,16,10,50,0,57,18,110, -0,16,10,50,0,57,22,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,22,0,0,1,90,95,0,0,0,0,2,4,1, -0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1, -0,0,28,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9, -18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0, -0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,0,1,90,95,0, -0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,24,0,9,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,24,0,9,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0, -31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,24,0,9,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,24,0,9,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,24,0,9, -18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,24,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,26,0,109,0,0,1, -1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8, -48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0, -18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20, -0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0, -16,10,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18, -109,0,16,8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18,118, -0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, -18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59, -119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59, -121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121, -0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0, -57,59,121,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118, -0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0, -48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59, -121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10, -50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0, -16,8,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0, -18,109,0,16,10,50,0,57,59,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59, -120,0,18,109,0,16,8,48,0,57,59,119,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,119,0,48,46,18, -118,0,59,122,0,18,109,0,16,10,50,0,57,59,119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,29,0,109, -0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109, -0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0,48,46,18,118,0,59,122, -0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,120,0,48,46,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,121,0,48, -18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57, -59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,0,1,90,95,0,0,11,0,2, -21,1,1,0,0,31,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -118,0,59,120,0,18,109,0,16,8,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,120,0, -48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59,120,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51, -0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16, -8,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,10,49,0,57,59,121,0,48,46,18,118,0,59,122,0,18, -109,0,16,10,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,121,0,48,46,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,8,48,0,57,59,122,0,48,18, -118,0,59,121,0,18,109,0,16,10,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,10,50,0,57,59, -122,0,48,46,18,118,0,59,119,0,18,109,0,16,10,51,0,57,59,122,0,48,46,20,0,0,1,90,95,0,0,27,0,2,21,1, -1,0,0,13,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109, -0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50, -0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51, -0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0, -13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1, -90,95,0,0,14,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,29,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1, -0,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0, -16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0, -28,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18, -110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16, -10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20, -0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90, -95,0,0,29,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110, -0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21, -1,1,0,0,14,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18, -110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16, -10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0, -57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30, -0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110, -0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48, -20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, -109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,28,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0, -0,27,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18, -110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,31,0, -109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0, -16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0, -57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0, -1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0, -28,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,30,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,18,110,0,16,8,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,0,0,2, -3,1,0,2,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0, -0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90, -95,0,0,0,0,2,3,1,0,2,0,27,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0, -0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0, -48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18, -110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,27,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10, -50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10, -51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20, -0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0, -20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90, -95,0,0,11,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0, -0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18, -109,0,16,10,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1, -9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1, -0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49, -0,57,18,97,0,21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0, -9,18,109,0,16,10,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0,21,0,9,18,109,0,16,10, -50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,21,0,9,18,109,0,16,10,49,0,57,18,97,0, -21,0,9,18,109,0,16,10,50,0,57,18,97,0,21,0,9,18,109,0,16,10,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0, -2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16, -10,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109, -0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27, -0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18, -97,0,22,0,9,18,109,0,16,10,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,30,0,109,0,0,1,1,0,0, -9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109, -0,16,10,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9, -18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18,109,0,16,10,50,0,57, -18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1, -0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,22,0,9,18,109,0,16,10,49,0,57,18,97,0,22,0,9,18, -109,0,16,10,50,0,57,18,97,0,22,0,9,18,109,0,16,10,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,3,1,0,2, -0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0, -57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0, -23,0,9,18,109,0,16,10,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0, -16,10,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, -109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109,0,16,10,50,0,57,18, -97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0, -9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,23,0,9,18,109,0,16,10,49,0,57,18,97,0,23,0,9,18,109, -0,16,10,50,0,57,18,97,0,23,0,9,18,109,0,16,10,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0, -26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57, -18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48, -0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0, -9,18,109,0,16,10,50,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10, -50,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0, -16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0,16,10,50,0,57,18,97,0, -24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,9,18,109,0,16,8,48,0,57,18,97,0,24,0,9,18,109,0,16,10,49,0,57,18,97,0,24,0,9,18,109,0, -16,10,50,0,57,18,97,0,24,0,9,18,109,0,16,10,51,0,57,18,97,0,24,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0, -26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0, -16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1, -1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,27,0, -2,26,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48, -0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10, -50,0,57,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0, -110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,0,0, -0,1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, -57,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116, -52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,0,18,109,0,16,10,49,0,57,18,110,0,16, -10,49,0,57,46,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,0,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58, -109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0, -0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0, -110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0, -0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -47,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0, -109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1, -0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,47,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,0,18,109,0,16,10,50,0,57, -18,110,0,16,10,50,0,57,47,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0, -26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0,0,0,1,90, -95,0,0,28,0,2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,0, -0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50, -0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,0,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,30,0, -109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8, -48,0,57,49,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16, -10,50,0,57,49,0,0,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109, -97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10,49,0,57,18, -110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16,10,51,0,57, -18,110,0,16,10,51,0,57,49,0,0,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, -0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,0,18,109,0,16,10, -49,0,57,18,110,0,16,10,49,0,57,49,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,0,18,109,0,16, -10,51,0,57,18,110,0,16,10,51,0,57,49,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0, -110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109, -97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0, -1,90,95,0,0,28,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1, -1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18, -98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0, -0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110, -0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,46,0,18, -109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1, -1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,8,48,0, -57,46,0,18,97,0,18,110,0,16,10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,0,0,0,1,90,95,0,0, -30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8, -48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46,0,0,0,0, -1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, -109,0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0, -46,0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,29, -0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,90, -95,0,0,31,0,2,26,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109, -0,16,8,48,0,57,18,98,0,46,0,18,109,0,16,10,49,0,57,18,98,0,46,0,18,109,0,16,10,50,0,57,18,98,0,46, -0,18,109,0,16,10,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0, -110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,97,0,18,110,0,16,8,48,0,57,46,0,18,97,0,18,110,0,16, -10,49,0,57,46,0,18,97,0,18,110,0,16,10,50,0,57,46,0,18,97,0,18,110,0,16,10,51,0,57,46,0,0,0,0,1,90, -95,0,0,26,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0, -18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, -26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,47, -0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0, -110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16, -10,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109, -97,116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,0,0,0, -1,90,95,0,0,27,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51, -120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18,98,0,47,0,18,109,0,16,10, -50,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58, -109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18, -97,0,18,110,0,16,10,50,0,57,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0, -0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49,0,57,18, -98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1, -0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10, -49,0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0, -1,90,95,0,0,29,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,98,0,47,0,18,109,0,16,10,49, -0,57,18,98,0,47,0,18,109,0,16,10,50,0,57,18,98,0,47,0,18,109,0,16,10,51,0,57,18,98,0,47,0,0,0,0,1, -90,95,0,0,31,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18, -97,0,18,110,0,16,8,48,0,57,47,0,18,97,0,18,110,0,16,10,49,0,57,47,0,18,97,0,18,110,0,16,10,50,0,57, -47,0,18,97,0,18,110,0,16,10,51,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,26, -0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90, -95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0, -28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0, -0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, -8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48, -20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57, -18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,29,0,2,21,1, -1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0, -1,90,95,0,0,29,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, -18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0, -16,10,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0, -0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,28, -0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,28,0,2,22, -1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18, -98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0, -48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,30,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0, -57,48,20,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0, -9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2, -22,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0, -18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0, -57,48,20,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,49,0,48,0,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18, -109,0,16,10,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,31, -0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,49,0,48,0,0,18,97,0,49,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,105,110,118,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,18,105,110,118,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,50,0,57,18,105,110,118,0,18,110,0,16,10,50,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,51,0,57,18,105,110,118,0,18,110,0,16,10,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,27, -1,1,0,0,26,0,109,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10, -49,0,57,54,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18, -109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0, -0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109, -0,16,10,50,0,57,54,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,0,1,8,58,109,97,116,51,120, -52,0,0,18,109,0,16,8,48,0,57,54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,0,0,0,1, -90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,8,48,0,57, -54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1, -90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57, -54,0,18,109,0,16,10,49,0,57,54,0,18,109,0,16,10,50,0,57,54,0,18,109,0,16,10,51,0,57,54,0,0,0,0,1, -90,95,0,0,0,0,2,25,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57, -52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10, -49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,27,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109, -0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,30,0,109,0,0,0,1, -9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,0,1,90,95, -0,0,0,0,2,25,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9, -18,109,0,16,10,50,0,57,52,0,9,18,109,0,16,10,51,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,31,0,109, -0,0,0,1,9,18,109,0,16,8,48,0,57,52,0,9,18,109,0,16,10,49,0,57,52,0,9,18,109,0,16,10,50,0,57,52,0,9, -18,109,0,16,10,51,0,57,52,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,8,48,0, -57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0, -16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,27,0,109,0,0,0,1,9, -18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,0,1,90,95,0, -0,0,0,2,24,1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0,57,51,0,9, -18,109,0,16,10,50,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,8,48,0, -57,51,0,9,18,109,0,16,10,49,0,57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0, -0,1,90,95,0,0,0,0,2,24,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,51,0,9,18,109,0,16,10,49,0, -57,51,0,9,18,109,0,16,10,50,0,57,51,0,9,18,109,0,16,10,51,0,57,51,0,0,0 +101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0, +18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, +57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,121,0,18,102,49, +51,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,50,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,16,1,52,0,0,17,1,48,46,48,0,0, +17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,5,0,105, +0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,1,0,98, +0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,10,0,99, +48,0,0,1,1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,1,1,0,0,10,0,99,51,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99, +49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9, +0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1, +0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,50,50,0, +0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,1,1,0,0,9,0,102,50,51,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0, +18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0, +57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,102,49, +50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,1,51,0,57,59,121,0,18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,122, +0,18,102,50,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0, +18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1, +48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2,90,95,1,0,9, +0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,1,0,98,0,0,0,1,3,2,90,95,1,0,9, +0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,11,0,99,48,0,0,1,1,0,0,11,0,99,49, +0,0,1,1,0,0,11,0,99,50,0,0,1,1,0,0,11,0,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0, +57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57, +18,99,51,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,109,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, +109,97,116,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1, +0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57, +0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59, +120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0, +20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90, +95,0,0,13,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18, +109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1, +1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48, +0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,15,0, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120, +121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,26,0,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,14,0,109,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1, +49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0, +26,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18, +109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0, +0,26,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, +18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, +0,0,26,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, +18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, +0,0,26,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, +18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1, +49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1, +1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0, +16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57, +59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, +29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0, +57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0, +18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,28,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,30,0,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0, +16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95, +0,0,28,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0, +18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0, +17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1, +49,0,57,59,122,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0, +16,1,48,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57, +59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,122,0,0,17,1,48,46,48,0,0,0, +20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, +116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1, +48,0,57,59,122,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121, +0,0,18,109,0,16,1,49,0,57,59,122,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,13,0, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57, +59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0, +57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90, +95,0,0,28,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52, +0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46, +48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48, +46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1, +48,46,48,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0, +17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57, +0,18,109,0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109, +0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0, +0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,120,0, +0,18,109,0,16,1,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1, +48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1, +50,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,15,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120, +0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121, +0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49, +0,57,0,58,118,101,99,50,0,0,17,1,48,46,48,0,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,26,0,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0, +0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0, +0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0, +16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48, +46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0,16,1, +50,0,57,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122, +0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,15,0,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0, +18,109,0,16,1,49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, +0,0,14,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109, +0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1, +90,95,0,0,14,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0, +18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,17,1,48,46,0,0, +17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0, +57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,29, +0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,17,1, +48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,0,20,0,0,1, +90,95,0,0,14,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0, +18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1, +48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0, +16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0, +17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,31,0,109, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17, +1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,0,20,0,0, +1,90,95,0,0,30,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, +120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49, +46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0, +57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0, +0,30,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0, +18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1, +48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0, +0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48, +0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109, +0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,13,0,109,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48, +46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48, +46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0, +16,1,49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0,18,109,0,16,1,51,0,57,59,120,121, +0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, +97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,18, +109,0,16,1,50,0,57,59,120,121,0,0,18,109,0,16,1,51,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,29,0,1, +1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0, +16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1, +1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16, +1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0, +17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1, +49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0, +1,90,95,0,0,29,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52, +120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48, +46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57, +59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29, +0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109, +0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0, +17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1, +49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,18,109,0,16,1,51,0,57,59,120, +121,122,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0,16,1,50,0, +57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,30,0,109,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120, +121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,17,1, +48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0, +18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,18,109,0,16,1,51,0, +57,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0, +0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0, +31,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, +109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0, +17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,28, +0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57, +59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49, +46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,13,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,17,1, +48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1, +48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18, +109,0,16,1,50,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95, +0,0,15,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109, +0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17, +1,48,46,0,0,18,109,0,16,1,51,0,57,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,28,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16, +1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46, +0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0, +18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,17,1, +48,46,0,0,18,109,0,16,1,51,0,57,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0, +0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0, +17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,17,1, +48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,26,0, +109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1, +48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1, +48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1, +1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48, +0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109, +0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1, +49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0, +17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48, +46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109, +0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49, +0,57,18,110,0,16,1,49,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0, +1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57, +21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57, +18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,21,0,9,18,109,0,16,1,50,0, +57,18,110,0,16,1,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1, +9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57, +21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0, +1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0, +57,18,110,0,16,1,49,0,57,21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,9,18,109,0,16,1, +51,0,57,18,110,0,16,1,51,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, +57,21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1, +51,0,57,21,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1, +48,0,57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,0,1,90,95,0, +0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, +57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27,0,109, +0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49, +0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,22,0,0,1,90,95,0,0,0, +0,2,2,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57, +22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, +57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0, +57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1, +50,0,57,18,110,0,16,1,50,0,57,22,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,22,0,0,1,90,95,0, +0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, +57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1, +50,0,57,22,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,22,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,26,0, +109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16, +1,49,0,57,18,110,0,16,1,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0, +0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49, +0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0, +57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,24,0,9,18,109,0,16,1, +50,0,57,18,110,0,16,1,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, +57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,29,0,109, +0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49, +0,57,18,110,0,16,1,49,0,57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,9,18,109,0,16,1, +51,0,57,18,110,0,16,1,51,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, +57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1, +51,0,57,24,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0, +18,109,0,16,1,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59, +120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,121,0,48,46,20, +0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48, +18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,28,0, +109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18, +109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0, +59,121,0,18,109,0,16,1,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18, +118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0, +48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59, +119,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0, +0,27,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59, +120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,18, +118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59, +121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1, +1,0,0,30,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0, +59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46, +18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57, +59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109, +0,16,1,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,122,0,48,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,119,0,48,18,118,0, +59,121,0,18,109,0,16,1,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,119,0,48, +46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18, +109,0,16,1,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,18,118,0, +59,119,0,18,109,0,16,1,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18, +118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,121,0, +48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,1,51,0, +57,59,121,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118, +0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0, +48,46,18,118,0,59,119,0,18,109,0,16,1,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49, +0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18, +109,0,16,1,51,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120, +0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0,48,46,18,118, +0,59,122,0,18,109,0,16,1,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,1,51,0,57,59,122,0, +48,46,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,13,0,109,0,0,1,1, +0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2, +21,1,1,0,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, +110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,26, +0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, +0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0, +0,28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, +109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,27,0,110, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2, +21,1,1,0,0,28,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, +110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, +50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48, +20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1, +1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0, +0,29,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, +109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18, +110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1, +51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,14, +0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, +0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0, +0,28,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, +109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,14,0,110, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2, +21,1,1,0,0,30,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, +110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, +50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48, +20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,29,0,109,0,0,1, +1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0, +0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, +109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18, +110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1, +51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,31, +0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, +0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, +0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, +109,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18, +110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2, +21,1,1,0,0,15,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, +110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, +50,0,57,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18, +109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18, +109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109,0,0,1,1,0,0,14,0,110,0,0,0, +1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,14,0,110, +0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,15, +0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1, +0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,10,0,118, +0,0,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118, +0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0, +18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111, +116,0,0,18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,10,0,118,0,0,1,1, +0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18, +109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118, +0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0, +18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111, +116,0,0,18,118,0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,11,0,118,0,0,1,1, +0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18, +109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118, +0,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,31,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0, +57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16, +1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18, +109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118, +0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,28,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0, +57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16, +1,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,30,0,109,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,50,0, +57,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0, +57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1, +1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,0,1, +90,95,0,0,0,0,2,1,1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0, +9,18,109,0,16,1,49,0,57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1, +0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49, +0,57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0, +1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,9, +18,109,0,16,1,50,0,57,18,97,0,21,0,9,18,109,0,16,1,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0, +2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0, +57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,9,18,109,0,16,1,51,0,57,18,97,0,21,0,0,1,90, +95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9, +18,109,0,16,1,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0, +1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2, +1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1, +49,0,57,18,97,0,22,0,9,18,109,0,16,1,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,30,0,109,0, +0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0, +9,18,109,0,16,1,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,9,18,109,0,16,1,50,0, +57,18,97,0,22,0,9,18,109,0,16,1,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1, +1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,9, +18,109,0,16,1,50,0,57,18,97,0,22,0,9,18,109,0,16,1,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,3,1,0, +2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0, +57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, +48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109,0, +0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0, +9,18,109,0,16,1,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0, +57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, +48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0,57,18,97,0,23,0,9, +18,109,0,16,1,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0, +1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0, +57,18,97,0,23,0,9,18,109,0,16,1,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,26,0,109,0,0,1, +1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,0,1, +90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0, +9,18,109,0,16,1,49,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0, +0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0, +57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, +48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,0,1, +90,95,0,0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0, +9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,9,18,109,0,16,1,51,0,57, +18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48, +0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,9,18, +109,0,16,1,51,0,57,18,97,0,24,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0, +0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109,0,16,1, +49,0,57,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0, +110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109, +0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0,109,0,0,1,1,0,0, +27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18, +109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,0,0,0, +0,1,90,95,0,0,30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0, +0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46, +0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0, +0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, +57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, +57,46,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,31,0, +109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1, +48,0,57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1, +50,0,57,46,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, +26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0, +16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1, +0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18, +110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2, +27,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0, +57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0,16,1,50,0, +57,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0, +0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1, +49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95, +0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0, +16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0, +16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,0,0,0,0,1, +90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18, +109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18, +109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,0,0,0, +0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0, +0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49, +0,0,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120, +52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, +57,49,0,0,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116, +51,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1, +49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,0,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0, +30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0, +16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0, +16,1,50,0,57,49,0,0,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58, +109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18, +110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,18,109,0,16,1,51,0,57,18, +110,0,16,1,51,0,57,49,0,0,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1, +8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0, +57,18,110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,18,109,0,16,1,51,0, +57,18,110,0,16,1,51,0,57,49,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0, +0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57, +46,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50, +120,51,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0, +28,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,97,0,18,110, +0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1,1,0,0,28,0, +109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18, +109,0,16,1,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0, +0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0, +57,46,0,18,97,0,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0,109,0,0,1,1,0, +0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18,109,0,16,1,49, +0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0,0,9,0,97,0, +0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97, +0,18,110,0,16,1,49,0,57,46,0,18,97,0,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0, +0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,98,0, +46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0, +2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0, +57,18,98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,18,109,0,16, +1,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,8, +58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0, +18,97,0,18,110,0,16,1,50,0,57,46,0,18,97,0,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,31,0,2,26, +1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18, +98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,18,109,0,16,1,51,0, +57,18,98,0,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109, +97,116,52,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0,18,97,0, +18,110,0,16,1,50,0,57,46,0,18,97,0,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, +9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,47, +0,18,97,0,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0, +98,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57, +18,98,0,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97, +116,50,120,52,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97,0,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90, +95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109, +0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0, +9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,47, +0,18,97,0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2, +27,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57, +18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18,98,0,47,0,0,0,0,1,90,95,0, +0,30,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18, +110,0,16,1,48,0,57,47,0,18,97,0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,0,0, +0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0, +18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18,98, +0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52, +120,50,0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50, +0,57,18,98,0,47,0,18,109,0,16,1,51,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,9,0,97,0, +0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97, +0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,18,97,0,18,110,0,16,1,51,0,57,47,0, +0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51, +0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18, +98,0,47,0,18,109,0,16,1,51,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0, +0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97,0,18,110, +0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,18,97,0,18,110,0,16,1,51,0,57,47,0,0,0,0,1, +90,95,0,0,26,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, +18,97,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,28, +0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18, +110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1, +0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18, +110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1, +49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48, +20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, +109,0,16,1,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0, +30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, +48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, +98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,48,20,0, +0,1,90,95,0,0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, +109,0,16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1, +51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0, +0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0, +9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110, +0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0, +26,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49, +46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0, +16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16, +1,49,0,57,48,20,0,0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1, +0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48, +0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, +57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, +0,28,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,28,0, +2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48, +0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110, +118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118, +0,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1, +105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, +105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105, +110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110, +118,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0, +0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,9,0, +97,0,0,1,1,0,0,30,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90, +95,0,0,30,0,2,22,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2, +17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0, +57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57, +18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18, +105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, +95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50, +0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, +57,18,109,0,16,1,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, +0,29,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,51,0,57,18,105,110,118,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,22,1, +1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18, +98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0, +48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,105,110,118,0,48,20,0,0, +1,90,95,0,0,31,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118, +0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118, +0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0, +18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18, +110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,105,110,118,0,18,110, +0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,0,1,8,58,109,97,116,50,120,51, +0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0, +109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,0, +0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48, +0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0, +0,30,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57, +54,0,18,109,0,16,1,50,0,57,54,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,0,1,8,58,109,97, +116,52,120,50,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0, +18,109,0,16,1,51,0,57,54,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,0,1,8,58,109,97,116,52, +120,51,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0,18,109, +0,16,1,51,0,57,54,0,0,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52, +0,9,18,109,0,16,1,49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0,16,1,48, +0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,27,0,109,0,0,0,1,9,18,109,0, +16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0,16,1,50,0,57,52,0,0,1,90,95,0,0,0,0,2,25, +1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0,16,1, +50,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109, +0,16,1,49,0,57,52,0,9,18,109,0,16,1,50,0,57,52,0,9,18,109,0,16,1,51,0,57,52,0,0,1,90,95,0,0,0,0,2, +25,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0, +16,1,50,0,57,52,0,9,18,109,0,16,1,51,0,57,52,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,26,0,109,0,0,0,1,9, +18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,28,0,109,0, +0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,27, +0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51, +0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49, +0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0, +16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,9,18,109,0,16,1,51,0, +57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16, +1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,9,18,109,0,16,1,51,0,57,51,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h b/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h index c397b9f0fad..28d7df68f9a 100644 --- a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h +++ b/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h @@ -3,106 +3,105 @@ /* slang_builtin_120_common.gc */ 5,1,90,95,0,0,26,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,0,109,0,0,1, -0,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57, -48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,28,0,0,109,97,116,114, -105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,0,109,0,0,1,0,0,0,28,0,110,0,0,0,1,8,58,109,97, -116,50,120,52,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,27,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,0,27,0,109,0,0,1,0,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,30,0,0,109,97,116,114,105,120,67,111,109,112,77, -117,108,116,0,1,0,0,0,30,0,109,0,0,1,0,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109, -0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,29,0,0,109,97,116,114,105,120,67,111, -109,112,77,117,108,116,0,1,0,0,0,29,0,109,0,0,1,0,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57, -48,0,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0, -57,48,0,0,0,0,1,90,95,0,0,31,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31, -0,109,0,0,1,0,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18,110,0, -16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0,0,13,0,0,111, -117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109, -97,116,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18, -99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14, -0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8, -58,109,97,116,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48, +0,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57, +48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,0,0,0,1,90,95,0,0,28,0,0,109,97,116,114,105, +120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,0,109,0,0,1,0,0,0,28,0,110,0,0,0,1,8,58,109,97,116, +50,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1, +49,0,57,48,0,0,0,0,1,90,95,0,0,27,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0, +0,27,0,109,0,0,1,0,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,110, +0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110, +0,16,1,50,0,57,48,0,0,0,0,1,90,95,0,0,30,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116, +0,1,0,0,0,30,0,109,0,0,1,0,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0, +57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0, +57,18,110,0,16,1,50,0,57,48,0,0,0,0,1,90,95,0,0,29,0,0,109,97,116,114,105,120,67,111,109,112,77, +117,108,116,0,1,0,0,0,29,0,109,0,0,1,0,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0, +16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0, +16,1,50,0,57,18,110,0,16,1,50,0,57,48,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1, +90,95,0,0,31,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31,0,109,0,0,1,0,0, +0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0, +18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48,0, +18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1,90,95,0,0,13,0,0,111,117,116,101,114,80, +114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109,97,116,50,0,0,18,99, +0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114, +0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14,0,0,111,117,116,101, +114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,0, +0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0, +18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0, +48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59, +121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,15,0,0,111, +117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109, +97,116,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18, +99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18, +114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48, +0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0, +18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0, +48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59, +122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,26,0,0,111, +117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109, +97,116,50,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48, 0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, +18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27,0,0,111,117, +116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97, +116,51,120,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, +18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0, +18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,0,0,111,117, +116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109,97, +116,50,120,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, +18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, +18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0, +48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,0,0,111,117,116,101,114,80,114, +111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, +99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18, +114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48, +0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0, +18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,30,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1, +0,0,0,12,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,99,0,59,120,0,18,114,0, +59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18, +99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18, +114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48, +0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0, +18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,0,0,111,117, +116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97, +116,52,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, +18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, 18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, -48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95, -0,0,15,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,12,0,114,0, -0,0,1,8,58,109,97,116,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59, -120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0, -59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0, -59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18, -99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18, -114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48, -0,18,99,0,59,122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0, -0,26,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,10,0,114,0,0, -0,1,8,58,109,97,116,50,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114, -0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18, -99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27, -0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8, -58,109,97,116,51,120,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59, -120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0, -59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,0,0, -111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58, -109,97,116,50,120,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120, -0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59, -120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59, -121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,0,0,111,117,116,101,114,80, -114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97,116,52,120,50,0, -0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, -18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, -48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59, -121,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,30,0,0,111,117,116,101,114,80,114,111,100,117,99, -116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,99,0,59,120,0, -18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0, -48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59, -121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59, -121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0, -59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,0,0, -111,117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58, -109,97,116,52,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120, -0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59, -121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59, -122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0, -59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0, -59,119,0,48,0,0,0,0,1,90,95,0,0,13,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,0,109,0,0,0, -1,8,58,109,97,116,50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109, -0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,0,0,116,114,97, -110,115,112,111,115,101,0,1,0,0,0,14,0,109,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,59, -120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57, -59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0, -57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,0,0,0,1,90,95,0, -0,15,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,15,0,109,0,0,0,1,8,58,109,97,116,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0, -18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0, -0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122, -0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59, -122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,18,109,0,16,10,50,0,57, -59,119,0,0,18,109,0,16,10,51,0,57,59,119,0,0,0,0,0,1,90,95,0,0,26,0,0,116,114,97,110,115,112,111, -115,101,0,1,0,0,0,27,0,109,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0, -18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0, -0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,0,0,116, -114,97,110,115,112,111,115,101,0,1,0,0,0,26,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0, -16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109, -0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0,0,0,0, -0,1,90,95,0,0,28,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,29,0,109,0,0,0,1,8,58,109,97,116, -50,120,52,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50, -0,57,59,120,0,0,18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10, -49,0,57,59,121,0,0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,0,0,0,1,90, -95,0,0,29,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,28,0,109,0,0,0,1,8,58,109,97,116,52,120, -50,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59, -121,0,0,18,109,0,16,10,49,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57, -59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119,0,0,0,0,0,1,90,95,0,0,30, -0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,31,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18, -109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18,109,0,16,10,50,0,57,59,120,0,0, -18,109,0,16,10,51,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0, -0,18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,10,51,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122, -0,0,18,109,0,16,10,49,0,57,59,122,0,0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,10,51,0,57,59, -122,0,0,0,0,0,1,90,95,0,0,31,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,30,0,109,0,0,0,1,8, -58,109,97,116,52,120,51,0,0,18,109,0,16,8,48,0,57,59,120,0,0,18,109,0,16,10,49,0,57,59,120,0,0,18, -109,0,16,10,50,0,57,59,120,0,0,18,109,0,16,8,48,0,57,59,121,0,0,18,109,0,16,10,49,0,57,59,121,0,0, -18,109,0,16,10,50,0,57,59,121,0,0,18,109,0,16,8,48,0,57,59,122,0,0,18,109,0,16,10,49,0,57,59,122,0, -0,18,109,0,16,10,50,0,57,59,122,0,0,18,109,0,16,8,48,0,57,59,119,0,0,18,109,0,16,10,49,0,57,59,119, -0,0,18,109,0,16,10,50,0,57,59,119,0,0,0,0,0,0 +48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59, +120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59, +119,0,48,0,0,0,0,1,90,95,0,0,13,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,0,109,0,0,0,1, +8,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0, +16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,0,0,116,114,97,110, +115,112,111,115,101,0,1,0,0,0,14,0,109,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120, +0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121, +0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122, +0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,0,0,0,1,90,95,0,0,15,0,0,116, +114,97,110,115,112,111,115,101,0,1,0,0,0,15,0,109,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,1,48, +0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51, +0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50, +0,57,59,121,0,0,18,109,0,16,1,51,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49, +0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,18,109,0,16,1,51,0,57,59,122,0,0,18,109,0,16,1,48, +0,57,59,119,0,0,18,109,0,16,1,49,0,57,59,119,0,0,18,109,0,16,1,50,0,57,59,119,0,0,18,109,0,16,1,51, +0,57,59,119,0,0,0,0,0,1,90,95,0,0,26,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,27,0,109,0,0, +0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0, +0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0, +0,18,109,0,16,1,50,0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,0,0,116,114,97,110,115,112,111,115,101,0,1, +0,0,0,26,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16, +1,49,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16, +1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,0,0,0,1,90,95,0,0,28,0,0,116,114,97,110,115, +112,111,115,101,0,1,0,0,0,29,0,109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59, +120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51,0,57,59, +120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59, +121,0,0,18,109,0,16,1,51,0,57,59,121,0,0,0,0,0,1,90,95,0,0,29,0,0,116,114,97,110,115,112,111,115, +101,0,1,0,0,0,28,0,109,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18, +109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18, +109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,48,0,57,59,119,0,0,18, +109,0,16,1,49,0,57,59,119,0,0,0,0,0,1,90,95,0,0,30,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0, +0,31,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49, +0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51,0,57,59,120,0,0,18,109,0,16,1,48, +0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,51, +0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50, +0,57,59,122,0,0,18,109,0,16,1,51,0,57,59,122,0,0,0,0,0,1,90,95,0,0,31,0,0,116,114,97,110,115,112, +111,115,101,0,1,0,0,0,30,0,109,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120, +0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121, +0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122, +0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,18,109,0,16,1,48,0,57,59,119, +0,0,18,109,0,16,1,49,0,57,59,119,0,0,18,109,0,16,1,50,0,57,59,119,0,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h index 78a7b83ec18..b474fe2d62c 100644 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_common_builtin_gc.h @@ -2,186 +2,186 @@ /* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ /* slang_common_builtin.gc */ -5,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,90,95,1,0, -5,0,1,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,90,95,1,0,5, -0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0, -0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2, -16,10,49,54,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,85,110,105,102, -111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,53,49,50,0,0,0,2,2,90,95,1,0,5,0,1, -103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,115,0,2,16,10,51,50,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,114,101,73,109,97,103, -101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,67,111,109,98, -105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,10,50,0,0,0, -2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105, -116,115,0,2,16,10,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116, -85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,90,95, -1,0,5,0,1,103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,90, -95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97, -116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, -120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95, -4,0,14,0,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103, -108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2, -2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110, -118,101,114,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114, -111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,15, -0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111, -115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114, -105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108, -86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112, -111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120, -84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111, -111,114,100,115,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116, -114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0, -1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115, -101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86, -105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101, -84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101, -77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,9,0,1,103,108, -95,78,111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,90,95,0,0,24,103,108,95,68,101,112,116,104,82, -97,110,103,101,80,97,114,97,109,101,116,101,114,115,0,9,0,110,101,97,114,0,0,0,1,9,0,102,97,114,0, -0,0,1,9,0,100,105,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,68,101,112,116,104,82,97,110, -103,101,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101, -0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120, -67,108,105,112,80,108,97,110,101,115,0,0,0,2,2,90,95,0,0,24,103,108,95,80,111,105,110,116,80,97, -114,97,109,101,116,101,114,115,0,9,0,115,105,122,101,0,0,0,1,9,0,115,105,122,101,77,105,110,0,0,0, -1,9,0,115,105,122,101,77,97,120,0,0,0,1,9,0,102,97,100,101,84,104,114,101,115,104,111,108,100,83, -105,122,101,0,0,0,1,9,0,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116,65,116,116,101, -110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,76,105,110,101,97,114,65,116, -116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,81,117,97,100,114,97, -116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,80, -111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,80,111,105,110,116,0,0,0,2,2, -90,95,0,0,24,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,0, -101,109,105,115,115,105,111,110,0,0,0,1,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102, -102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,9,0,115,104,105,110,105,110,101, -115,115,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109, -101,116,101,114,115,0,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,90, -95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103, -108,95,66,97,99,107,77,97,116,101,114,105,97,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104, -116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,12,0,97,109,98,105,101,110,116,0, -0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,12,0,112, -111,115,105,116,105,111,110,0,0,0,1,12,0,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,0,115,112, -111,116,68,105,114,101,99,116,105,111,110,0,0,0,1,9,0,115,112,111,116,67,111,115,67,117,116,111, -102,102,0,0,0,1,9,0,99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0, -1,9,0,108,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,113,117,97,100, -114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,115,112,111,116,69,120,112, -111,110,101,110,116,0,0,0,1,9,0,115,112,111,116,67,117,116,111,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0, -25,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,0,1, -103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116, -115,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101, -116,101,114,115,0,12,0,97,109,98,105,101,110,116,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105, -103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76,105,103, -104,116,77,111,100,101,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108, -80,114,111,100,117,99,116,115,0,12,0,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,0,2,2,90,95, -4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0, -1,103,108,95,66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,0,0,24,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,0,97,109,98,105, -101,110,116,0,0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0, -0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120, -76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99, -116,115,0,0,1,103,108,95,66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108, -95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,84,101,120,116,117,114, -101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97, -103,101,85,110,105,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,83,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,82,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97, -110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2, -90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120, -84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106, -101,99,116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,0,0,24,103, -108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,12,0,99,111,108,111,114,0,0,0,1,9,0,100, -101,110,115,105,116,121,0,0,0,1,9,0,115,116,97,114,116,0,0,0,1,9,0,101,110,100,0,0,0,1,9,0,115,99, -97,108,101,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114, -115,0,0,1,103,108,95,70,111,103,0,0,0,1,90,95,0,0,9,0,0,114,97,100,105,97,110,115,0,1,1,0,0,9,0, -100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,100,101,103,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,114,97,100,105,97,110,115,0,1,1,0,0,10,0,100, -101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0, -49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,114,97, -100,105,97,110,115,0,1,1,0,0,11,0,100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49, -53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59, -120,120,120,0,0,0,0,1,90,95,0,0,12,0,0,114,97,100,105,97,110,115,0,1,1,0,0,12,0,100,101,103,0,0,0, -1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0, -0,18,99,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,100,101,103,114,101,101,115,0,1,1,0,0,9,0, -114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,114,97,100,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,100,101,103,114,101,101,115,0,1,1,0,0,10,0,114, -97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,100,101,103, -114,101,101,115,0,1,1,0,0,11,0,114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0, -17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120, -120,120,0,0,0,0,1,90,95,0,0,12,0,0,100,101,103,114,101,101,115,0,1,1,0,0,12,0,114,97,100,0,0,0,1,3, -2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99, -0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,115,105,110,0,1,1,0,0,9,0,114,97,100,105,97,110,115, -0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100, -105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,115,105,110,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0, -0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,115, -105,110,0,1,1,0,0,11,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108, -111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97, -110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,115,105,110,0,1,1,0,0, -12,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114, -97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,99,111, -115,0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,99, -111,115,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0, -4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,99,111,115,0,1,1,0,0,11,0,114,97,100, +5,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,1,56,0,0,0,2,2,90,95,1,0, +5,0,1,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,1,54,0,0,0,2,2,90,95,1,0,5, +0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,1,56,0,0,0,2,2,90,95, +1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,1,56,0,0,0, +2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,1, +49,54,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,85,110,105,102,111,114, +109,67,111,109,112,111,110,101,110,116,115,0,2,16,1,53,49,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95, +77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,115,0,2,16,1,51,50,0,0,0,2,2,90,95,1,0,5,0,1, +103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110, +105,116,115,0,2,16,1,48,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,67,111,109,98,105,110,101, +100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,1,50,0,0,0,2,2,90,95,1, +0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2, +16,1,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105, +102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,1,54,52,0,0,0,2,2,90,95,1,0,5,0,1, +103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,1,49,0,0,0,2,2,90,95,4,0,15,0, +1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1, +103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1, +103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114, +105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,0,3, +18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,14,0, +1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77, +111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4, +0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114, +115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101, +99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103, +108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,15,0,1,103,108, +95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0, +2,2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114, +97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119, +80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0, +0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110, +115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115, +0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73, +110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,80, +114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110, +115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114, +111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115, +112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, +120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84, +101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,9,0,1,103,108,95,78,111,114,109, +97,108,83,99,97,108,101,0,0,0,2,2,90,95,0,0,24,103,108,95,68,101,112,116,104,82,97,110,103,101,80, +97,114,97,109,101,116,101,114,115,0,9,0,110,101,97,114,0,0,0,1,9,0,102,97,114,0,0,0,1,9,0,100,105, +102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114, +97,109,101,116,101,114,115,0,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,90,95,4, +0,12,0,1,103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80, +108,97,110,101,115,0,0,0,2,2,90,95,0,0,24,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116, +101,114,115,0,9,0,115,105,122,101,0,0,0,1,9,0,115,105,122,101,77,105,110,0,0,0,1,9,0,115,105,122, +101,77,97,120,0,0,0,1,9,0,102,97,100,101,84,104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1, +9,0,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105, +111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,76,105,110,101,97,114,65,116,116,101,110,117,97, +116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,81,117,97,100,114,97,116,105,99,65,116, +116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,80,111,105,110,116,80, +97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,80,111,105,110,116,0,0,0,2,2,90,95,0,0,24,103, +108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,0,101,109,105,115, +115,105,111,110,0,0,0,1,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102,102,117,115,101,0, +0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,9,0,115,104,105,110,105,110,101,115,115,0,0,0,0,0, +0,0,2,2,90,95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115, +0,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,90,95,4,0,25,103,108,95, +77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,66,97,99,107,77, +97,116,101,114,105,97,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,83,111,117,114,99, +101,80,97,114,97,109,101,116,101,114,115,0,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102, +102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,12,0,112,111,115,105,116,105, +111,110,0,0,0,1,12,0,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,0,115,112,111,116,68,105,114, +101,99,116,105,111,110,0,0,0,1,9,0,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,0, +99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,108,105,110, +101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,113,117,97,100,114,97,116,105,99, +65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,115,112,111,116,69,120,112,111,110,101,110, +116,0,0,0,1,9,0,115,112,111,116,67,117,116,111,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95, +76,105,103,104,116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76, +105,103,104,116,83,111,117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2, +90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115, +0,12,0,97,109,98,105,101,110,116,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,77, +111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76,105,103,104,116,77,111, +100,101,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100, +117,99,116,115,0,12,0,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108, +95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103,108,95,70,114,111, +110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,90,95,4,0,25,103, +108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103,108,95,66,97, +99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,90,95,0,0,24,103, +108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,0,97,109,98,105,101,110,116,0,0,0,1, +12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,0,0,0,0,2,2,90, +95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1,103,108,95,70,114,111, +110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104, +116,115,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1, +103,108,95,66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120, +76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,84,101,120,116,117,114,101,69,110,118, +67,111,108,111,114,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110, +105,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,83,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108, +95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111, +111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,82,0,3,18,103, +108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103, +108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67, +111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101, +83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4, +0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101, +120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99, +116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100, +115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108, +95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,0,0,24,103,108,95, +70,111,103,80,97,114,97,109,101,116,101,114,115,0,12,0,99,111,108,111,114,0,0,0,1,9,0,100,101,110, +115,105,116,121,0,0,0,1,9,0,115,116,97,114,116,0,0,0,1,9,0,101,110,100,0,0,0,1,9,0,115,99,97,108, +101,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,0, +1,103,108,95,70,111,103,0,0,0,1,90,95,0,0,9,0,0,114,97,100,105,97,110,115,0,1,1,0,0,9,0,100,101, +103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49, +0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100, +101,103,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,114,97,100,105,97,110,115,0,1,1,0,0,10,0,100,101,103, +0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49,0,0, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, +0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,114,97,100,105,97, +110,115,0,1,1,0,0,11,0,100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50, +54,0,17,1,49,56,48,46,48,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59,120,120, +120,0,0,0,0,1,90,95,0,0,12,0,0,114,97,100,105,97,110,115,0,1,1,0,0,12,0,100,101,103,0,0,0,1,3,2,90, +95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49,0,0,4,118,101,99,52, +95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0,0,18,99,0, +59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,100,101,103,114,101,101,115,0,1,1,0,0,9,0,114,97,100, +0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97, +100,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,100,101,103,114,101,101,115,0,1,1,0,0,10,0,114,97,100,0,0, +0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,100,101,103,114,101, +101,115,0,1,1,0,0,11,0,114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51, +46,49,52,49,53,57,50,54,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120,120,120,0, +0,0,0,1,90,95,0,0,12,0,0,100,101,103,114,101,101,115,0,1,1,0,0,12,0,114,97,100,0,0,0,1,3,2,90,95,1, +0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0,4,118,101,99,52,95, +109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99,0,59, +120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,115,105,110,0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0, +0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105, +97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,115,105,110,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1, +4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97, +100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,115,105, +110,0,1,1,0,0,11,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111, +97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110, +115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,115,105,110,0,1,1,0,0,12, +0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0, +4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97, +100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,99,111,115, +0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0, +18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,99,111, +115,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110, +101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4, +102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114, +97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,99,111,115,0,1,1,0,0,11,0,114,97,100,105, +97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108, +0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0, +4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, +114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,99,111,115,0,1,1,0,0,12,0,114,97,100, 105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97, 108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115, 105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, 0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,99,111,115,0,1,1,0,0,12,0,114,97, -100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111, -115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59, -121,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122, -0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95, -0,0,9,0,0,116,97,110,0,1,1,0,0,9,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,115, -105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,9,0,1,99,0,2,58,99,111,115,0,0,18,97,110, -103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,10,0,0,116,97,110,0,1,1,0,0,10,0,97, -110,103,108,101,0,0,0,1,3,2,90,95,1,0,10,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0, -0,0,0,3,2,90,95,1,0,10,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18, -99,0,49,0,0,1,90,95,0,0,11,0,0,116,97,110,0,1,1,0,0,11,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0, -11,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,11,0,1,99,0,2,58, -99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,12,0,0,116,97, -110,0,1,1,0,0,12,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,12,0,1,115,0,2,58,115,105,110,0,0,18, -97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,12,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0, -0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,9,0,0,97,115,105,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2, -90,95,1,0,9,0,1,97,48,0,2,17,49,0,53,55,48,55,50,56,56,0,0,0,0,3,2,90,95,1,0,9,0,1,97,49,0,2,17,48, -0,50,49,50,49,49,52,52,0,0,54,0,0,3,2,90,95,1,0,9,0,1,97,50,0,2,17,48,0,48,55,52,50,54,49,48,0,0,0, -0,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48, +18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95, +95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9, +0,0,116,97,110,0,1,1,0,0,9,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,115,105,110, +0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,9,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108, +101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,10,0,0,116,97,110,0,1,1,0,0,10,0,97,110,103, +108,101,0,0,0,1,3,2,90,95,1,0,10,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3, +2,90,95,1,0,10,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49, +0,0,1,90,95,0,0,11,0,0,116,97,110,0,1,1,0,0,11,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,11,0,1, +115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,11,0,1,99,0,2,58,99,111, +115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,12,0,0,116,97,110,0, +1,1,0,0,12,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,12,0,1,115,0,2,58,115,105,110,0,0,18,97,110, +103,108,101,0,0,0,0,0,3,2,90,95,1,0,12,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0, +0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,9,0,0,97,115,105,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1, +0,9,0,1,97,48,0,2,17,1,49,46,53,55,48,55,50,56,56,0,0,0,3,2,90,95,1,0,9,0,1,97,49,0,2,17,1,48,46, +50,49,50,49,49,52,52,0,54,0,0,3,2,90,95,1,0,9,0,1,97,50,0,2,17,1,48,46,48,55,52,50,54,49,48,0,0,0, +3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,48,46,53,0,48, 0,0,3,2,90,95,1,0,9,0,1,121,0,2,58,97,98,115,0,0,18,120,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,0,17,49,0,48,0,0,18,121,0,47,0,0,18,97,48,0,18, +0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,0,17,1,49,46,48,0,18,121,0,47,0,0,18,97,48,0,18, 121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58,115,105,103,110,0,0,18,120,0,0,0,48,20,0, 0,1,90,95,0,0,10,0,0,97,115,105,110,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, 59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, @@ -194,679 +194,680 @@ 59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, 122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, 58,97,115,105,110,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,99,111,115,0,1,1,0,0,9,0, -120,0,0,0,1,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0, -53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,97,115,105,110,0,0, -18,120,0,0,0,47,20,0,0,1,90,95,0,0,10,0,0,97,99,111,115,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97, -99,111,115,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115, -0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18, -118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18,118,0, -59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,99,111,115,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,122,0,58,97,99,111,115,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,97,99,111,115,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0, -9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,0,18,120,0,58,105,110,118, -101,114,115,101,115,113,114,116,0,0,18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,90, -95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,121,95,111,118,101,114, -95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118, -101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0, -0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, -58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97, -116,97,110,0,1,1,0,0,12,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,121,95, -111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0,9,0,121,0,0, -1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,10,58,97,98,115,0,0,18,120,0,0,0,17,49,0,48, -0,45,52,0,41,0,2,9,18,114,0,58,97,116,97,110,0,0,18,121,0,18,120,0,49,0,0,20,0,10,18,120,0,17,48,0, -48,0,0,40,0,2,9,18,114,0,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,51,0,49,52,49,53,57,51,0, -0,48,46,20,0,0,9,14,0,0,2,9,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,49,0,53,55,48,55,57,54, -53,0,0,48,20,0,0,8,18,114,0,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10, -0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0,59,120,0,0, -18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,117, -0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,117,0,0, -1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0, -59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110, -0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,116,97, -110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +120,0,0,0,1,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1, +48,46,53,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,97,115,105,110, +0,0,18,120,0,0,0,47,20,0,0,1,90,95,0,0,10,0,0,97,99,111,115,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0, +97,99,111,115,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111, +115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0, +0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18, +118,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,99,111,115,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,119,0,58,97,99,111,115,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97, +110,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,0,18,120,0,58, +105,110,118,101,114,115,101,115,113,114,116,0,0,18,120,0,18,120,0,48,17,1,49,46,48,0,46,0,0,48,0,0, +20,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59, +120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118, +101,114,95,120,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,121,95,111, +118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121, +95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97, +116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0,1,90,95, +0,0,12,0,0,97,116,97,110,0,1,1,0,0,12,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120, +0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111, +118,101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97, +110,0,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1, +1,0,0,9,0,121,0,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,10,58,97,98,115,0,0,18,120, +0,0,0,17,1,49,46,48,101,45,52,0,41,0,2,9,18,114,0,58,97,116,97,110,0,0,18,121,0,18,120,0,49,0,0,20, +0,10,18,120,0,17,1,48,46,48,0,40,0,2,9,18,114,0,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,1, +51,46,49,52,49,53,57,51,0,48,46,20,0,0,9,14,0,0,2,9,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0, +17,1,49,46,53,55,48,55,57,54,53,0,48,20,0,0,8,18,114,0,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1, +0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97, +110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, +58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97, +110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, 97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, 0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,117,0,59,119,0,0,18,118,0,59,119,0, -0,0,20,0,0,1,90,95,0,0,9,0,0,112,111,119,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95, -0,0,10,0,0,112,111,119,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,112,111,119,0,1,1,0,0,11,0,97,0,0,1,1,0, -0,11,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, +116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1, +90,95,0,0,12,0,0,97,116,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18, +118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,117,0, +59,119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,112,111,119,0,1,1,0,0,9,0,97,0,0,1,1,0,0, +9,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18, +97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,112,111,119,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1, +4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, +59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, +86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,112,111,119,0, +1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95, +114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, +112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59, +121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0, +0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,112,111,119,0,1,1,0,0,12,0,97,0,0,1, +1,0,0,12,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108, +0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, 18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111, 97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18, -98,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,112,111,119,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86, -97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, -119,0,0,18,98,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,101,120,112,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,90,95,0,0,10,0,0,101,120,112,0,1,1,0, -0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0, -4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59, -120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -116,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1, -116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101, -120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97, -116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,0,1,90, -95,0,0,12,0,0,101,120,112,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,18,97,0,17,49,0, -52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18, -95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112, -50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,108,111, -103,50,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86, -97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,108,111,103,50,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108, -111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4, -102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,0,1,90,95,0,0,11,0,0,108,111,103,50,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95,108, -111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0, -0,0,1,90,95,0,0,12,0,0,108,111,103,50,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,111,97,116,95,108,111, -103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, -108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111, -97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0, -0,0,1,90,95,0,0,9,0,0,108,111,103,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54, -57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,120,0,0,0,18,99,0,48,0,0,1,90,95,0,0,10, -0,0,108,111,103,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49, -56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,11,0,0,108,111,103,0, -1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8, -58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,12,0,0,108,111,103,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103, -50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,9,0,0,101,120,112,50,0,1,1,0,0,9,0,97,0,0,0,1,4,102, -108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10, -0,0,101,120,112,50,0,1,1,0,0,10,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,50,0,1, -1,0,0,11,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, -108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101,120,112,50,0,1,1,0,0,12,0, -97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121, -0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, -97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114,116,0,1,1,0,0,9,0,120,0,0, -0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0, -10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0, -0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,119,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,0,0,0,0,1,90,95, -0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97, -116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0, -105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114, -115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0, -11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116, -95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0, -0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102, -108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0, -59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, -118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97, -108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115, -101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0, -0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0, -0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0, -0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118, -0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0, +98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, +59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,101,120,112,0,1,1,0,0,9,0, +97,0,0,0,1,3,2,90,95,0,0,9,0,1,116,0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102, +108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,90,95,0,0, +10,0,0,101,120,112,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,18,97,0,17,1,49,46,52,52, +50,54,57,53,48,50,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108, +0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, +86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,0,1,1,0,0,11,0,97,0, +0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102,108, +111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4, +102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121, +0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116, +0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101,120,112,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,116, +0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0, +18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120, +112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95, +101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,4,102,108,111, +97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1, +90,95,0,0,9,0,0,108,111,103,50,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0, +18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,108,111,103,50,0,1,1,0,0,10,0, +118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, +121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,108,111,103,50,0,1,1,0,0,11,0,118,0,0,0,1,4,102, +108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0, +0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59, +121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, +118,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,108,111,103,50,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,111,97, +116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, +108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, +0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, +122,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, +118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,108,111,103,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1,0,9,0,1, +99,0,2,17,1,48,46,54,57,51,49,52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,120,0,0,0,18,99,0,48, +0,0,1,90,95,0,0,10,0,0,108,111,103,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48, +46,54,57,51,49,52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0, +0,11,0,0,108,111,103,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48,46,54,57,51,49, +52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,12,0,0,108, +111,103,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48,46,54,57,51,49,52,55,49,56, +49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,9,0,0,101,120,112,50,0,1, +1,0,0,9,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0, +18,97,0,0,0,0,1,90,95,0,0,10,0,0,101,120,112,50,0,1,1,0,0,10,0,97,0,0,0,1,4,102,108,111,97,116,95, +101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97, +116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,90,95, +0,0,11,0,0,101,120,112,50,0,1,1,0,0,11,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95, +95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50, +0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120, +112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101, +120,112,50,0,1,1,0,0,12,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, +86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, +101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, +95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50, +0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114, +116,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0, +18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18, +114,0,0,0,0,1,90,95,0,0,10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114, +0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95, +114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, +101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0, +118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118, +0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116, +95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95, +114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12, +0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, +118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0, +0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108, +111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111, +97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, +0,0,18,118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, +119,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0, +120,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, +120,0,0,0,0,1,90,95,0,0,10,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0, +0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, +0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118, +0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0, +59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, +118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0, +0,18,118,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0, +12,0,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, +18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59, +121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108, +0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86, +97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0, +1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,17,1,49,46,48,0,20,0,0,1,90,95,0,0,10,0, +0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105, +110,118,101,114,115,101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,0,18,115,0,0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118, +0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0, 18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0, 0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1, -4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0, -97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99, -52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12, -0,0,97,98,115,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,115,105,103,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9, -0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,120,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0, -0,10,0,0,115,105,103,110,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,112,0,0,1,1,110,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99, -52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0, -0,1,90,95,0,0,11,0,0,115,105,103,110,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,112,0,0,1,1, -110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -112,0,0,18,110,0,0,0,0,1,90,95,0,0,12,0,0,115,105,103,110,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0, -0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95, -115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90, -95,0,0,9,0,0,102,108,111,111,114,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,108,111,111,114,0,1,1,0,0, -10,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,108,111,111,114,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1, -90,95,0,0,12,0,0,102,108,111,111,114,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111, -114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,99,101,105,108,0,1,1,0,0, -9,0,97,0,0,0,1,3,2,90,95,0,0,9,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0, -18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,10,0,0,99, -101,105,108,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52, -95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18, -98,0,54,20,0,0,1,90,95,0,0,11,0,0,99,101,105,108,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,98, -0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,90,95,0,0,12,0,0,99,101,105,108,0,1,1,0,0, -12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114, -0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,9,0,0,102, -114,97,99,116,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86, -97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,114,97,99,116,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101, -99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0, -11,0,0,102,114,97,99,116,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,0,0,102,114,97,99,116,0,1,1,0, -0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, -0,0,1,90,95,0,0,9,0,0,109,111,100,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1, -111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0, -0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110, -101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1, +121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122, +101,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111, +116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109, +112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0, +1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, +0,0,1,90,95,0,0,10,0,0,97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0, +97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, +97,0,0,0,0,1,90,95,0,0,12,0,0,97,98,115,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,115,105,103,110,0,1,1,0,0,9,0, +120,0,0,0,1,3,2,90,95,0,0,9,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0, +18,120,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,1,48,46,48,0,0,18, +120,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18, +112,0,0,18,110,0,0,0,0,1,90,95,0,0,10,0,0,115,105,103,110,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0, +10,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0, +17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,1,48,46,48,0,0,18, +118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,11,0,0,115,105,103,110,0,1,1,0,0,11,0,118,0,0,0, +1,3,2,90,95,0,0,11,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121, +122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0, +0,17,1,48,46,48,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,12,0,0,115,105,103, +110,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115, +103,116,0,18,112,0,0,18,118,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17, +1,48,46,48,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, +86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,9,0,0,102,108,111,111,114,0,1,1,0,0,9,0,97,0,0, +0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90, +95,0,0,10,0,0,102,108,111,111,114,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,108,111,111, +114,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,0,0,102,108,111,111,114,0,1,1,0,0,12,0,97,0, +0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1, +90,95,0,0,9,0,0,99,101,105,108,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,9,0,1,98,0,2,18,97,0,54,0,0, +4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, +18,98,0,54,20,0,0,1,90,95,0,0,10,0,0,99,101,105,108,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1, +98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0,1,90,95,0,0,11,0,0,99,101,105,108,0,1,1,0,0, +11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114, +0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,90, +95,0,0,12,0,0,99,101,105,108,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,98,0,2,18,97,0,54,0,0, +4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, +18,98,0,54,20,0,0,1,90,95,0,0,9,0,0,102,114,97,99,116,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95, +102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,114,97,99, +116,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,114,97,99,116,0,1,1,0,0,11,0,97,0,0,0,1,4,118, +101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1, +90,95,0,0,12,0,0,102,114,97,99,116,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18, +95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,109,111,100,0,1,1,0,0,9,0,97,0,0,1, 1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116, 95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101, -114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,111, -110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58, +0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48, +47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0, +0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, +118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58, 102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0, -11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,111,110,101, -79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102, -108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12, -0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,111,110,101,79, -118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, -118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,9,0,0,109,105,110,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105, -110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,105,110,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,0, -109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0, -0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52, -95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109, -105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,105,110,0,1,1,0, -0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,109,97,120,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0, -1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109, -97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59, -120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,97, -120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0, -12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,99,108,97,109,112,0,1,1,0,0,9,0,118,97,108,0,0,1,1,0, -0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108, -97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18, -109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97,108,0,0,1, -1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99, -108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0, -18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0,118,97,108,0,0, -1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95, -99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108, -0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0,0,12,0,118,97,108, -0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, -95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97, -108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97, -108,0,0,1,1,0,0,10,0,109,105,110,86,97,108,0,0,1,1,0,0,10,0,109,97,120,86,97,108,0,0,0,1,4,118,101, -99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110, -86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0, -118,97,108,0,0,1,1,0,0,11,0,109,105,110,86,97,108,0,0,1,1,0,0,11,0,109,97,120,86,97,108,0,0,0,1,4, -118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0, -0,12,0,118,97,108,0,0,1,1,0,0,12,0,109,105,110,86,97,108,0,0,1,1,0,0,12,0,109,97,120,86,97,108,0,0, -0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18, -109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,9,0,0,109,105,120,0,1,1,0,0, -9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1, -0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18, -95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120, -0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112, -0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109, -105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108, -114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0, -0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52, -95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0, -0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90, -95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,12,0,97,0,0,0,1,4, +11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79, +118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18, +98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111, +114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111, +100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66, +0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18, +95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79, +118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0, +10,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118, +101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0, +98,0,0,0,1,3,2,90,95,0,0,11,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95, +114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118, +101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0, +98,0,0,0,1,3,2,90,95,0,0,12,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99, +112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, +116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108, +111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18, +95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79, +118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,9,0,0,109,105,110,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9, +0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0, +0,0,0,1,90,95,0,0,10,0,0,109,105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52, +95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59, +120,121,0,0,0,0,1,90,95,0,0,11,0,0,109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118, +101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121, +122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0, +0,12,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +98,0,0,0,0,1,90,95,0,0,10,0,0,109,105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101, +99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1, +90,95,0,0,11,0,0,109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109, +105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0, +12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,109,97,120,0,1,1,0,0, +9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0, +0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0, +0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120, +121,0,0,18,98,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11, +0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0, +12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, +0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0, +0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18, +98,0,0,0,0,1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99, +52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1, +90,95,0,0,12,0,0,109,97,120,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97, +120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,99,108,97,109, +112,0,1,1,0,0,9,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86, +97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97, +108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97, +109,112,0,1,1,0,0,10,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120, +86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118, +97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108, +97,109,112,0,1,1,0,0,11,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97, +120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18, +118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99, +108,97,109,112,0,1,1,0,0,12,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109, +97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0, +18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0, +99,108,97,109,112,0,1,1,0,0,10,0,118,97,108,0,0,1,1,0,0,10,0,109,105,110,86,97,108,0,0,1,1,0,0,10, +0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0, +11,0,0,99,108,97,109,112,0,1,1,0,0,11,0,118,97,108,0,0,1,1,0,0,11,0,109,105,110,86,97,108,0,0,1,1, +0,0,11,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116, +86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90, +95,0,0,12,0,0,99,108,97,109,112,0,1,1,0,0,12,0,118,97,108,0,0,1,1,0,0,12,0,109,105,110,86,97,108,0, +0,1,1,0,0,12,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114, +101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0, +0,1,90,95,0,0,9,0,0,109,105,120,0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4, 118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, -0,0,1,90,95,0,0,9,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,9,0,120,0,0,0,1,4, -118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0, -0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,10,0,101,100,103,101,0,0,1,1,0,0,10,0,120,0,0,0, -1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18, -101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101,112,0,1,1,0,0,11,0,101,100,103,101,0,0,1,1, -0,0,11,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,12,0, -101,100,103,101,0,0,1,1,0,0,12,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,9, -0,101,100,103,101,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116, -101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90, -95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1, -90,95,0,0,9,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0, -0,9,0,101,100,103,101,49,0,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,116,0,2,58,99,108,97,109, -112,0,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49, -0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18, -116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,10,0,101, -100,103,101,48,0,0,1,1,0,0,10,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0, +0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,9,0,97,0,0, +0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18, +120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,9,0, +97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0, +0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0, +0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0, +1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97, +0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0, +121,0,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0, +0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0, +0,12,0,121,0,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,115,116,101,112,0,1,1,0,0,9,0,101, +100,103,101,0,0,1,1,0,0,9,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86, +97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,10,0, +101,100,103,101,0,0,1,1,0,0,10,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101, +112,0,1,1,0,0,11,0,101,100,103,101,0,0,1,1,0,0,11,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95, +0,0,12,0,0,115,116,101,112,0,1,1,0,0,12,0,101,100,103,101,0,0,1,1,0,0,12,0,120,0,0,0,1,4,118,101, +99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1, +90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118, +101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100, +103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,11,0, +118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103, +101,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0, +0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,9,0,0,115,109,111,111,116,104,115,116,101,112, +0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,9,0,120,0,0,0,1,3, +2,90,95,0,0,9,0,1,116,0,2,58,99,108,97,109,112,0,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100, +103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0, +18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111, +111,116,104,115,116,101,112,0,1,1,0,0,10,0,101,100,103,101,48,0,0,1,1,0,0,10,0,101,100,103,101,49, +0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101, +100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1, +49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1, +90,95,0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,11,0,101,100,103,101,48,0,0,1,1, +0,0,11,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97, +109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47, +49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46, +48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,12, +0,101,100,103,101,48,0,0,1,1,0,0,12,0,101,100,103,101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0, +0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101, +49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0, +48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111,111,116, +104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0, +0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103, +101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46, +48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95, +0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9, +0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97,109, +112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49, +0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0, +18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101, +100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0, 1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, -101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51, -0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116, -101,112,0,1,1,0,0,11,0,101,100,103,101,48,0,0,1,1,0,0,11,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118, -0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47, -18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8, -18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115, -109,111,111,116,104,115,116,101,112,0,1,1,0,0,12,0,101,100,103,101,48,0,0,1,1,0,0,12,0,101,100,103, -101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0, -18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0, -0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0, -0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0, -1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108, -97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0, -47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0, -0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0, -101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49, -0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48, -17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115, -116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0, -47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0, -8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,9,0,0,108, -101,110,103,116,104,0,1,1,0,0,9,0,120,0,0,0,1,8,58,97,98,115,0,0,18,120,0,0,0,0,0,1,90,95,0,0,9,0, -0,108,101,110,103,116,104,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9, -0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90, +101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1, +51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0, +0,9,0,120,0,0,0,1,8,58,97,98,115,0,0,18,120,0,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0, +1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116, +0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,90, +95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2, +90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114, +115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, +108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90, 95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0, 4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1, -0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0, -18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0, -100,105,115,116,97,110,99,101,0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,3,2,90,95,1,0,9,0,1, -100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0, -18,100,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,10,0,118,0,0,1,1,0,0, -10,0,117,0,0,0,1,3,2,90,95,1,0,10,0,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116, -86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,50,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115, -116,97,110,99,101,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,1,0,11,0,1,100,51,0,2, -18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100, -51,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,12,0,118,0,0,1,1,0,0,12, -0,117,0,0,0,1,3,2,90,95,1,0,12,0,1,100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,108,101,110,103,116,104,0,0,18,100,52,0,0,0,20,0,0,1,90,95,0,0,11,0,0,99,114,111,115, -115,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,9,0,0,102,97, -99,101,102,111,114,119,97,114,100,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,114,101, -102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3, -2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0, -0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,10,0,0,102,97,99,101, -102,111,114,119,97,114,100,0,1,1,0,0,10,0,78,0,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,114,101,102,0, -0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8, -58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,11,0,0,102,97,99,101,102, -111,114,119,97,114,100,0,1,1,0,0,11,0,78,0,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,114,101,102,0,0,0, -1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0, -0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58, -109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,12,0,0,102,97,99,101,102,111, -114,119,97,114,100,0,1,1,0,0,12,0,78,0,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,114,101,102,0,0,0,1,3, -2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9, -0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109, -105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,9,0,0,114,101,102,108,101,99,116,0, -1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18, -73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,10,0,0,114,101,102,108,101,99,116,0,1,1,0,0,10,0,73,0,0, -1,1,0,0,10,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78, -0,48,47,0,0,1,90,95,0,0,11,0,0,114,101,102,108,101,99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0, -0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90, -95,0,0,12,0,0,114,101,102,108,101,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,0,1,8,18,73,0, -17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,9,0,0,114, -101,102,114,97,99,116,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2, -90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95, -100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,9,0,1,114,101, -116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,17,48,0,48,0,0, -20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111, -116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97, -108,0,0,0,1,90,95,0,0,10,0,0,114,101,102,114,97,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,1, -1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0, -18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97, -0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0, -3,2,90,95,0,0,10,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116, -118,97,108,0,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116, -97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0, -0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,11,0,0,114,101,102,114,97, -99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0, -1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1, -107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95, -105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,11,0,1,114,101,116,118,97,108,0, -0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101,99,51,0,0,17,48,0,48, -0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95, -100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116, -118,97,108,0,0,0,1,90,95,0,0,12,0,0,114,101,102,114,97,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0, -78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111, -116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, -101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47, -48,47,0,0,3,2,90,95,0,0,12,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18, -114,101,116,118,97,108,0,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108, -0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116, -0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,13,0,0,109,97, -116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,13,0,109,0,0,1,0,0,0,13,0,110,0,0,0,1,8,58, -109,97,116,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,14,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,0,14,0,109,0,0,1,0,0,0,14,0,110,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,15,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108, -116,0,1,0,0,0,15,0,109,0,0,1,0,0,0,15,0,110,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0, -0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99, -52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0, -0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4, -118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0, -1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0, -18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0, -118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118, -0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1, -1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97, -108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115, -84,104,97,110,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95, -115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108, -101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, +18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101, +0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,18,120,0,18,121,0,47,0,0, +9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,0,0,0,20,0,0,1,90,95,0,0, +9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,1,0, +10,0,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103, +116,104,0,0,18,100,50,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,11,0, +118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,1,0,11,0,1,100,51,0,2,18,118,0,18,117,0,47,0,0,9,18,95, +95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,51,0,0,0,20,0,0,1,90,95,0,0,9,0,0, +100,105,115,116,97,110,99,101,0,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,3,2,90,95,1,0,12,0,1, +100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104, +0,0,18,100,52,0,0,0,20,0,0,1,90,95,0,0,11,0,0,99,114,111,115,115,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11, +0,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,9,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1, +0,0,9,0,78,0,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2, +58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101, +99,52,95,115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0, +18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,10,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0, +10,0,78,0,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58, +100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99, +52,95,115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18, +78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,11,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0,11,0, +78,0,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100, +111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95, +115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0, +0,18,115,0,0,0,0,0,1,90,95,0,0,12,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0,12,0,78,0, +0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111, +116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115, +103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18, +115,0,0,0,0,0,1,90,95,0,0,9,0,0,114,101,102,108,101,99,116,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0, +0,1,8,18,73,0,17,1,50,46,48,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90, +95,0,0,10,0,0,114,101,102,108,101,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,0,1,8,18,73,0, +17,1,50,46,48,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,11,0,0, +114,101,102,108,101,99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0,0,0,1,8,18,73,0,17,1,50,46,48,0, +58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,12,0,0,114,101,102,108, +101,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,0,1,8,18,73,0,17,1,50,46,48,0,58,100,111,116, +0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,9,0,0,114,101,102,114,97,99,116,0,1,1,0, +0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111, +116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46, +48,0,18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95, +100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,9,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0, +17,1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,17,1,48,46,48,0,20,0,9,18,114,101,116,118,97, +108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114, +116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,10,0,0, +114,101,102,114,97,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1, +3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2, +90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0,18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110, +95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,10,0,1,114, +101,116,118,97,108,0,0,0,10,18,107,0,17,1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101, +99,50,0,0,17,1,48,46,48,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101, +116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20, +0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,11,0,0,114,101,102,114,97,99,116,0,1,1,0,0,11,0,73, +0,0,1,1,0,0,11,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95, +105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0, +18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95,100, +111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,11,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17, +1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101,99,51,0,0,17,1,48,46,48,0,0,0,20,0,9,18, +114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0, +48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1, +90,95,0,0,12,0,0,114,101,102,114,97,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,1,1,0,0,9,0, +101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0, +18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0,18,101,116,97,0,18,101,116,97,0,48,17, +1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90, +95,0,0,12,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,1,48,46,48,0,40,0,9,18,114,101,116,118, +97,108,0,58,118,101,99,52,0,0,17,1,48,46,48,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97, +0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0, +46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,13,0,0,109,97,116,114,105,120, +67,111,109,112,77,117,108,116,0,1,0,0,0,13,0,109,0,0,1,0,0,0,13,0,110,0,0,0,1,8,58,109,97,116,50,0, +0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48, +0,0,0,0,1,90,95,0,0,14,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,14,0,109, +0,0,1,0,0,0,14,0,110,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48, +0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48, +0,0,0,0,1,90,95,0,0,15,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,15,0,109, +0,0,1,0,0,0,15,0,110,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48, +0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48, +0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104, +97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115, +84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108, +101,115,115,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115, +108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108,101, +115,115,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108, +101,115,115,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,108, +116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4, +0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95, +115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108, +101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118, 101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1, -1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86, -97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,0, -1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101, -114,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0, -103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2, -0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, -101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0, -18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,7, -0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0, -11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113, -117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101, -114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52, -95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95, -0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117, -97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,10, -0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,11,0,117, -0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,12,0,117, -0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0, -18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0, -118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101, -99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0, -110,111,116,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101, -99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, -118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118, -0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4, -118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0, -0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59, -120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59, -120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115, -117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110, -121,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100, -0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100, -100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99, -52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0, -1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0, -0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,3, -0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0, -48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114, -111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0, -59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114, -111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52, -95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,0,110,111, -116,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0, -0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0, -0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112, -114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114, -111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116, -117,114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0, -0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100, -0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95, -112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51, -100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -51,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0, -0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95, -116,101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115, +0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0, +11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, +0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0, +1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101, +116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,69,113, +117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115, +84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95, +115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90, +95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118, +0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, +0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0, +118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, +117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,11,0, +117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104, +97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114, +84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90, +95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0, +1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0, +18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1, +1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, +0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1, +1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114, +84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95, +115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90, +95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1, +0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, +0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1, +1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84, +104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115, +103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, +0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8, +0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18, +118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4, +118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, +0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118, +101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, +0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118, +101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, +0,2,0,0,101,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115, +101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3, +0,0,101,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,101, +113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4, +0,0,101,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,101, +113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117, +97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108, +0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108, +0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101, +116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1, +0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69,113,117,97,108, +0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113, +117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113,117,97, +108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114, +101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69,113, +117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116, +69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0, +18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113, +117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69, +113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110, +111,116,69,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,110, +101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0, +1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18, +115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101, +0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1, +90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118, +101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4, +118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59, +122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117, +109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,4,0,118,0,0,0,1,3,2, +90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18, +118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0, +18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0, +59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18, +95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1,90,95, +0,0,1,0,0,97,108,108,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101, +99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59, +121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0, +0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1, +112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0, +18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, +112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0, +18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0, +97,108,108,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101,99,52,95, +109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0, +18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0, +18,112,114,111,100,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, +86,97,108,0,0,18,112,114,111,100,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,0,1,1,0,0, +2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101, +99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,1,48,46, +48,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113, +0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,12,0,0,116,101, +120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,9,0,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, +97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, +114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111, +114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,0,18,95,95,114,101,116, +86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0, +1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112, +108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100, +95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, +111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, +100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115, 97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -95,49,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111, -106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, -101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, +95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, +0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114, +101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, +100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86, +97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, +101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,0,18,95,95,114,101,116,86,97,108,0,0, +18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116, +117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,95,112,114,111,106,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, +0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,99,117,98,101,0,18,95,95,114,101, 116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,115,104,97,100,111,119,0,18,95,95, +0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, +111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,115,104,97,100,111,119,0,18,95,95, 114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0, -0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111, +0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0, +0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112,114,111, 106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116, -0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99, -52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101, -99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0, -0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22, -0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50, -68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,115,104,97,100,111,119,0,18,95,95,114,101, +0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115, +97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, +95,50,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111, +106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, +101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, 116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116, -95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0, -0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108, -0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108, -111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0, -0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, -101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101, -49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101, -116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0, -46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51, -52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0, -11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120, -0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58, -118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1, -90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55, -0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111, -105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, -105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, -111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, -111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51, -0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49, -0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0, -0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95, +0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1, +1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, +0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, +114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, +114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111, +106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,99,111,111,114, +100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,0,23,0,115,97, +109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, +114,101,99,116,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, +108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,82, +101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111, +114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,95,115,104,97, +100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111, +97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9, +0,0,110,111,105,115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, +50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0, +1,1,0,0,11,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86, +97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4, +102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1, +90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,49,57,46,51,52,0,46,0,0,20,0,0,1,90,95,0,0,10,0, +0,110,111,105,115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, +110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, +111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0, +0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95, 114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53, -0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0, -1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,49, +57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110, +111,105,115,101,50,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, +105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1, +51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, +1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18, +120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0, +17,1,49,57,46,51,52,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, +101,49,0,0,18,120,0,17,1,53,46,52,55,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, +1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, +0,58,118,101,99,50,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,0,46,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,53, +46,52,55,0,0,17,1,49,55,46,56,53,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, +1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, +18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, +0,58,118,101,99,51,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,0,46,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, +99,51,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,0,46,0,0,20,0,0,1, +90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, 108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,17,50,51,0,53, -52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58, -118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0, -110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17, -51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, -49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0, -0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0, -0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101, +59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49,57,46,51,52,0,0,17,1, +55,46,54,54,0,0,17,1,51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,53,46,52,55,0,0, +17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,17,1,49,51,46,49,57,0,0,0,46,0,0,20,0,0,1,90,95,0, +0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, +120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, +58,110,111,105,115,101,49,0,0,18,120,0,17,1,49,57,46,51,52,0,46,0,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,53,46,52,55,0,46,0,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,50,51,46,53,52,0,46,0, +0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101, 116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53,0,52,55,0,0, -0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,50, -51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20, -0,0,0 +97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,49,57,46,51,52, +0,0,17,1,55,46,54,54,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105, +115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,0,46,0,0, +20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, +99,50,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110, +111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, +111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, +105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1, +51,46,50,51,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, +49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48, +52,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18, +120,0,58,118,101,99,51,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,17,1,51,49,46,57,49,0,0, +0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49, +57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0, +17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,17,1,49,51,46,49,57,0,0,0,46, +0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, +101,99,52,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,17,1,51,49,46,57,49,0,0,17,1,51,55, +46,52,56,0,0,0,46,0,0,20,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_core_gc.h b/src/mesa/shader/slang/library/slang_core_gc.h index b3d3e87cf42..511e7d03342 100644 --- a/src/mesa/shader/slang/library/slang_core_gc.h +++ b/src/mesa/shader/slang/library/slang_core_gc.h @@ -6,864 +6,860 @@ 95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,5,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95, 114,101,116,86,97,108,0,18,98,0,20,0,0,1,90,95,0,0,5,0,1,1,1,0,0,5,0,105,0,0,0,1,9,18,95,95,114, 101,116,86,97,108,0,18,105,0,20,0,0,1,90,95,0,0,1,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,102, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,98,0,20,0,0,1,90,95,0,0,9,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118, -101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,1,0,98,0,0, -0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0, -0,0,1,90,95,0,0,9,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0,20,0,0,1, -90,95,0,0,10,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0,1,90,95,0,0,10,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,102,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116, -111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0, -10,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,2,0,98,0,0,0,1,4,105,118, -101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0, -0,0,1,90,95,0,0,10,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,12,0,118, -0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0, -122,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1,90,95,0, -0,11,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101, -99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0, -0,0,1,90,95,0,0,11,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,3,0,98,0, -0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,109,111, -118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,0,0,1,90,95,0,0,12,0,1,1, -1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,122,0,0,1,1,0,0,9,0,119,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,18,119,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,5,0,105,0,0,0,1, -4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0, -0,1,90,95,0,0,12,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,4,0,98,0,0,0,1,4,105,118, -101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0, -0,12,0,1,1,1,0,0,8,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114, -101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,11,0,118,51,0,0,1,1,0,0,9,0,102,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,119,0,18,102,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,10,0,118,50,0,0,1,1,0,0,9,0,102,49, -0,0,1,1,0,0,9,0,102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,18,102,50,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106, -0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,9,0,102,0,0,0,1,4, -118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -102,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0, -105,0,0,1,1,0,0,5,0,106,0,0,1,1,0,0,5,0,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,18,107,0,20,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109, -111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,90,95,0,0,7,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, +115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0, +1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18, +102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,18,98,0,20,0,0,1,90,95,0,0,9,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111, +95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,1,0, +98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18, +98,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0, +20,0,0,1,90,95,0,0,10,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0,1,90,95,0, +0,10,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,0,0,18,102,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52, +95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90, +95,0,0,10,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,2,0,98,0,0,0,1,4, +105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, +98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0, +12,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0, +9,0,122,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1, +90,95,0,0,11,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118, +101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105, +0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52, +0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,3,0, +98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,109, +111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,0,0,1,90,95,0,0,12,0, +1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,122,0,0,1,1,0,0,9,0,119,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111, +118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,5,0,105,0,0, +0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0, +0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0, +18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,4,0,98,0,0,0,1,4,105, +118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90, +95,0,0,12,0,1,1,1,0,0,8,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95, +114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,11,0,118,51,0,0,1,1,0,0,9,0, +102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,119,0,18,102,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,10,0,118,50,0,0,1,1,0,0,9, +0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97, +108,0,59,119,0,18,102,50,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, +0,18,106,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0, +18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,9,0,102,0, +0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,0,0,18,102,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105, +118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,1,1, +1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,1,1,0,0,5,0,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,122,0,18,107,0,20,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101, +99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,90, +95,0,0,7,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,1,0,98,0,0,0,1, +4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0, +0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,120,0,0,1,1,0,0,5,0,121,0,0,1,1,0,0,5,0,122,0,0,1,1,0,0,5,0,119, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101, +99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,8,0,1,1,1, +0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97, +108,0,0,18,102,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105, +118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98, +49,0,0,1,1,0,0,1,0,98,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,49,0,0, +1,1,0,0,5,0,105,50,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +120,0,0,18,105,49,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, +97,108,0,59,121,0,0,18,105,50,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,0,0,0,1,4, +118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1, +90,95,0,0,2,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, +97,108,0,59,120,121,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,0,0,0,1, +4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,17,1, +48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0, +0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1, +0,0,1,0,98,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51, +0,20,0,0,1,90,95,0,0,3,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,0, +1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,17,1, +48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102, +50,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, +122,0,0,18,102,51,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, 52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95, -0,0,8,0,1,1,1,0,0,5,0,120,0,0,1,1,0,0,5,0,121,0,0,1,1,0,0,5,0,122,0,0,1,1,0,0,5,0,119,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109, -111,118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,9,0,102, -0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18, -102,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,49,0,0,1,1, -0,0,1,0,98,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,49,0,0,1,1,0,0,5, -0,105,50,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -105,49,0,0,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,105,50,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, -52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0, -2,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,17,48,0,48,0,0,0,0, -0,1,90,95,0,0,2,0,1,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,6,0,118,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1,0,0,1,0,98,51, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51,0,20,0,0,1,90, -95,0,0,3,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,17,48,0,48,0,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,17,48,0, -48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102,51, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,109,111,118, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0, -9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,17,48,0,48,0,0,0,0,0,1,90, -95,0,0,3,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,7,0,118,0,0,0,1, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1,0,0,1,0,98,51, -0,0,1,1,0,0,1,0,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18, -98,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1,90,95,0,0,4,0,1,1,1,0, -0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,1,1,0,0,9,0,102,52,0,0,0,1,3,2,90, -95,1,0,9,0,1,122,101,114,111,0,2,17,48,0,48,0,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,18,122,101,114,111,0,0,0,4,118,101, -99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102,51,0,0,18,122,101,114, -111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,102,52,0, -0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,109,111, -118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,98,0,0,0,0,1,90,95,0,0,4,0,1, -1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,119,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,105,0,0,17, -48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4, -0,1,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,119,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0,9,0,109,48,48,0,0,1, -1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18, -109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,0,1, -90,95,0,0,13,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,102,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,17,48,0,48,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,17,48,0,48,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,59,121,0,18,102,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109, -97,116,50,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0,1,0,98,0,0, -0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0, -0,10,0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,99, -48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,14,0,1,1, -1,0,0,9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,48,49, -0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,48,50,0,0,1,1,0,0,9,0,109, -49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0, -18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49, -0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,122,0,18,109, -50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48,50,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,9,0,102,0,0,0,1,3,2, -90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,49,0,57,18,118,0,59,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,118, -0,59,121,121,120,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116,51,0,0,58,102, -108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,1,0,98,0,0,0,1,8,58,109,97,116, -51,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,11,0,99,48,0,0,1,1, -0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,109,48,48,0,0,1,1,0, -0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,51,48,0,0,1,1,0,0,9,0,109,48,49,0,0, -1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,51,49,0,0,1,1,0,0,9,0,109,48, -50,0,0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,1,1,0,0,9,0,109,51,50,0,0,1,1,0,0,9,0, -109,48,51,0,0,1,1,0,0,9,0,109,49,51,0,0,1,1,0,0,9,0,109,50,51,0,0,1,1,0,0,9,0,109,51,51,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,59,119,0,18,109,51, -48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -59,119,0,18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,120,0,18,109,48, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,50,0,57,59,122,0,18,109,50,50,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57, -59,120,0,18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,121,0,18,109,49, -51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,59,122,0,18,109,50,51,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,59,119,0,18,109,51,51,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9, -0,102,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,48,0,48,0,0,0,0,0,0, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,118,0,59,121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51, -0,57,18,118,0,59,121,121,121,120,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97, -116,52,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,1,0,98,0,0,0, -1,8,58,109,97,116,52,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0, -12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,1,1,0,0,12,0,99,51,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,99,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,99,50,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,5,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0, -0,5,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,115, +0,0,3,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108, +0,59,120,121,122,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,5,0,105,0,0,0,1,4, +118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,17,1, +48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, +95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1, +1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, +122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50, +0,0,1,1,0,0,1,0,98,51,0,0,1,1,0,0,1,0,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, +98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,59,122,0,18,98,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1, +90,95,0,0,4,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,1,1,0,0,9,0, +102,52,0,0,0,1,3,2,90,95,1,0,9,0,1,122,101,114,111,0,2,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115, +110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,18,122,101,114,111,0,0,0,4,118, +101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,18,122,101, +114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102, +51,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, +59,119,0,0,18,102,52,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118, +101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,98,0,0,0, +0,1,90,95,0,0,4,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,122,119,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,5,0, +105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0, +0,18,105,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95, +115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,1,48,46,48,0,0, +0,0,1,90,95,0,0,4,0,1,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0, +9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,0, +1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18, +109,49,49,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,59,120,0,18,102,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,17,1, +48,46,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,17,1,48,46,48,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,5,0, +105,0,0,0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,13,0, +1,1,1,0,0,1,0,98,0,0,0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90, +95,0,0,13,0,1,1,1,0,0,10,0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1, +90,95,0,0,14,0,1,1,1,0,0,9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1, +0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,48,50,0, +0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, +48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,18, +109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, +59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,109,48,50, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,109,50,50,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,9,0,102, +0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,118,0,59,120,121,121,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,18,118,0,59,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50, +0,57,18,118,0,59,121,121,120,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116, +51,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,1,0,98,0,0,0,1,8, +58,109,97,116,51,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,11,0, +99,48,0,0,1,1,0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, +1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,109,48,48, +0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,51,48,0,0,1,1,0,0,9,0,109, +48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,51,49,0,0,1,1,0,0,9, +0,109,48,50,0,0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,1,1,0,0,9,0,109,51,50,0,0,1,1, +0,0,9,0,109,48,51,0,0,1,1,0,0,9,0,109,49,51,0,0,1,1,0,0,9,0,109,50,51,0,0,1,1,0,0,9,0,109,51,51,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119,0, +18,109,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,109,48,49,0,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, +57,59,119,0,18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,109,48, +50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95, +114,101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,109,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,1,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,120, +0,18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,121,0,18,109,49,51,0,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,122,0,18,109,50,51,0,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,51,0,57,59,119,0,18,109,51,51,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,102,0,0, +0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,49,0,57,18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,50,0,57,18,118,0,59,121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, +118,0,59,121,121,121,120,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116,52,0, +0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,1,0,98,0,0,0,1,8,58, +109,97,116,52,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,12,0,99, +48,0,0,1,1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,1,1,0,0,12,0,99,51,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99, +49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,5,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98, +0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, +1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, +114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,21,1, +1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0, +0,5,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114, +99,112,0,18,98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, +120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95, +95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98, +0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, +1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, +114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,21,1, +1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0,97,0,0,1,1,0, +0,6,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114, +99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52, +0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0,97,0,0,1,1,0, +0,7,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +98,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,115, 117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -5,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,22,1,1,0,0,5,0, -97,0,0,1,1,0,0,5,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, +7,0,2,21,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0, +97,0,0,1,1,0,0,7,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, +97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, +114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112, +0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, 108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,97,0,0,1,1, -0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,115, +52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,8,0,97,0,0,1,1, +0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, +98,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,115, 117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -6,0,2,21,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0, -97,0,0,1,1,0,0,6,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, +8,0,2,21,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,8,0, +97,0,0,1,1,0,0,8,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, 97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105, -118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0, -97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101, -99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,22, -1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95, -105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0, -8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101, -99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,8,0,2,21,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,22, -1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,98,73,110,118,0,59,119,0,0,18,98,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118, -101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,2,26,1,1,0,0,9,0,97, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99, -52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1, -90,95,0,0,9,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,22, -1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,90,95,0, -0,10,0,2,26,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10, -0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0, -118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0, -118,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112, -0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0, -0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1, -1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0, -0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0, -0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117, -0,0,0,1,3,2,90,95,0,0,11,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18, +114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112, +0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73, +110,118,0,59,119,0,0,18,98,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, +120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95, +95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98, +0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, +1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, +114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,21,1, +1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, +0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +98,73,110,118,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, +95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,10,0, +118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0, +117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117, +0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117, +0,0,0,1,3,2,90,95,0,0,10,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18, 117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95, +4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, +0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4, +118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18, +117,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95, +115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18, +117,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95, 109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, -18,119,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52, -95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27, -1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, -95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0, -0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0,12, -0,117,0,0,0,1,3,2,90,95,0,0,12,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120, -0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121, -0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108, -116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,10, -0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1, -0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,9,0,97,0, -0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10, -0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1, -0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2, -21,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,105,110,118,85,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0, -18,105,110,118,85,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118, -66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0, -0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0, -11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,9,0, -97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,27, -1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95, -0,0,11,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121, -122,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59, -120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,3, -2,90,95,0,0,11,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0, -59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0, -0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117, -0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,97,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,22,1, -1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18, -105,110,118,66,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101, -99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0, -2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0, -117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0, -0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0, -12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0, -0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,3,2,90,95,0,0,12,0,1,105,110,118,85,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -105,110,118,85,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,105,110,118,85,0,0,0,0,1,90,95,0,0,12,0,2,22, -1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0, -6,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118, -101,99,50,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,46,20, -0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118, -0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18, -98,0,0,0,47,20,0,0,1,90,95,0,0,6,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,6,0,2,21,1, -1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118, -101,99,50,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90, -95,0,0,6,0,2,22,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0, -0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0, -46,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,5, -0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97, -0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,7,0, -2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101, -99,51,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,48,20,0,0,1, -90,95,0,0,7,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0,118,0,0,1, -1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0, -0,0,49,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0, -0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99, -52,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0, -8,0,2,27,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58, -105,118,101,99,52,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0, -117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,48,20, -0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,5,0,97, -0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0, -0,18,117,0,49,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,5,0,2, -27,1,1,0,0,5,0,97,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,97,0,0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,110, -101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0, -0,7,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0, -18,118,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,0, +18,117,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,0,0, +11,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4, +102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105, +112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,119,0,0,0,0,1,90, +95,0,0,12,0,2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18, +95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0, +0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, +86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0, +117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0, +0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,3, +2,90,95,0,0,12,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108, +111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114, +99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, +121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,9, +0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, +59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,10,0,118,0,0,1, +1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, +0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117, +0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,1,1,0,0,9, +0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, +120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0, +10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0,118, +0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, +116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0, +9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116, +95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114, +99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116, +105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,105,110,118,85,0,59, +120,121,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9, +0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4, +118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, +18,118,0,59,120,121,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0, +11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0, +98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, +118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0, +0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, +121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1, +1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97, +108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,9, +0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0, +11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112, +108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0, +0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,0,0,11,0,1,105, +110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59, +120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0, +0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118, +101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, +18,97,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1, +1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, +18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, +114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,105,110,118,66,0,0,0,0,1, +90,95,0,0,12,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18, +95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,12,0,118,0, +0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,118, +0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99, +52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1, +90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, +114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,21, +1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, +18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118, +0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, +116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0, +117,0,0,0,1,3,2,90,95,0,0,12,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105, +110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118, +85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59, +122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,119,0,0, +18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86, +97,108,0,0,18,97,0,0,18,105,110,118,85,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0, +9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, +105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, +101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,5,0,97,0,0, +1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18, +117,0,46,20,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0, +0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0, +18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0, +0,6,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105, +118,101,99,50,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,6,0,2,21,1,1,0,0,6,0,118,0,0,1,1,0,0, +5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,48, +20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0, +118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0, +0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,7,0,2, +26,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105, +118,101,99,51,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1, +90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,5,0,97,0,0,1, +1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18, +117,0,48,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0, +0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0, +18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0, +0,8,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105, +118,101,99,52,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,8,0,118,0,0,1,1,0,0, +5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,46, +20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0, +118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0, +0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,8,0,2, +21,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105, +118,101,99,52,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1, +90,95,0,0,8,0,2,22,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,0, 1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, -0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,2,27, -1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0, -0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0, -0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,54,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54, -20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10, -49,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,54,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,54,20,0,0,1,90,95,0,0,9,0,0, -100,111,116,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0, -18,98,0,48,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,97,0,59,120,0,18,98,0,59,120,0,48,18,97,0,59,121,0,18,98,0,59,121, -0,48,46,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118, -101,99,51,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -9,0,0,100,111,116,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,1,1,0,2,0,5,0,97,0,0, -1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,2,1,0,2,0, -5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0, -2,3,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90, -95,0,0,5,0,2,4,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97, -0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0, -18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0, -0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0, -1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1, -0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90, -95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8, -18,118,0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9, -18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0, -8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8, -0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118, -0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -49,20,0,8,18,118,0,0,0,1,90,95,0,0,9,0,2,1,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18, -97,0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,2,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9, -18,97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,3,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0, -98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,4,1,0,2,0,9,0,97,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2, -0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90, -95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0, -8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18, -118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0, -0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0, -0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2, -2,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0, -0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118, -0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0, -117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0, -118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2, -1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0, -0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0, -18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6, -0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,49,20,0, -8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0, -0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118, -0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105, -118,101,99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0, -0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1, -90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99, -52,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0, -0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0, -8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18, -97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,1, -1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0, -46,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0, -18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0, -118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58, -118,101,99,50,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1, -0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1, -90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99, -51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97, -0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11, -0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0, -0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, -118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2, -0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,47,20,0, -8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118, -0,58,118,101,99,52,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0, -0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0, -0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2, -27,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57, -18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109, -0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,0,48, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0, -57,59,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,0,48,46,20,0,0,1,90,95, -0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0, -0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0, -16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109, -0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50, -0,57,18,110,0,16,10,50,0,57,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0, -57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121,121,121,0,48,46,18,109, -0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,0,48,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,59,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,49,0,57, -59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,10,50,0,57,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121, -121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,0,48,46,20,0,0,1,90, -95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,0,1,90,95,0,0,15,0,2,26, -1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57, -18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50, -0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0, -15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16, -8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0, -57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109, -0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,8,48,0,57,59,121, -121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,8,48,0,57,59,122,122,122,122,0,48,46,18,109, -0,16,10,51,0,57,18,110,0,16,8,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,49,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,49,0,57,59,120,120,120,120,0,48,18,109,0, -16,10,49,0,57,18,110,0,16,10,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16, -10,49,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,49,0,57,59,119,119,119, -119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,8,48,0,57,18,110,0, -16,10,50,0,57,59,120,120,120,120,0,48,18,109,0,16,10,49,0,57,18,110,0,16,10,50,0,57,59,121,121,121, -121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16, -10,51,0,57,18,110,0,16,10,50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,10,51,0,57,18,109,0,16,8,48,0,57,18,110,0,16,10,51,0,57,59,120,120,120,120,0,48,18,109,0,16, -10,49,0,57,18,110,0,16,10,51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18,110,0,16,10, -51,0,57,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,59,119,119,119, -119,0,48,46,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57, -49,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98, -0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0, -0,1,90,95,0,0,13,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0, -0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,47, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,0,1, -90,95,0,0,13,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0, -98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,0,1,90,95,0, -0,13,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48, -0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97, -0,18,110,0,16,10,49,0,57,49,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,0,1,90,95,0,0,14,0,2, -26,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -97,0,18,110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110, -0,16,10,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50, -0,57,46,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,46,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,9,0,97,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0, -57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,0,1,90,95, -0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18, -109,0,16,10,49,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,98,0,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,14,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,48,20,0,0, -1,90,95,0,0,14,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0, -18,110,0,16,10,50,0,57,49,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,0,1,90,95,0,0,15,0,2,26,1,1,0, -0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18, -110,0,16,8,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10, -49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,46, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,46,20,0,0,1, -90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109, -0,16,10,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51, -0,57,18,98,0,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109,0,0,1,1, -0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0, -47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,47,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,47,20,0,0,1,90,95,0,0,15,0,2, -21,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18, -97,0,18,110,0,16,8,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110, -0,16,10,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50, -0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,48,20, -0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18, -109,0,16,10,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16, -10,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,97,0,18,110,0,16,8,48,0,57,49,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,10,49,0,57,18,97,0,18,110,0,16,10,49,0,57,49,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,10,50,0,57,18,97,0,18,110,0,16,10,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,10,51,0,57,18,97,0,18,110,0,16,10,51,0,57,49,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0, -1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,98, -0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,98,0,49,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,98,0,49,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,98,0,49,20,0,0,1,90,95,0,0,10,0,2, -21,1,1,0,0,13,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8, -48,0,57,18,118,0,59,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,0,48,46,20,0,0,1,90,95, -0,0,10,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2, -21,1,1,0,0,14,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8, -48,0,57,18,118,0,59,120,120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109, -0,16,10,50,0,57,18,118,0,59,122,122,122,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0, -1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0, -18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18, -118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116, -0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0, -0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,8,48,0,57,18,118,0,59,120,120, -120,120,0,48,18,109,0,16,10,49,0,57,18,118,0,59,121,121,121,121,0,48,46,18,109,0,16,10,50,0,57,18, -118,0,59,122,122,122,122,0,48,46,18,109,0,16,10,51,0,57,18,118,0,59,119,119,119,119,0,48,46,20,0,0, -1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,8,48,0,57,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,49,0,57,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,50,0,57,0,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,10,51,0,57,0,0,20,0, -0,1,90,95,0,0,13,0,2,1,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -18,110,0,16,10,49,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,13, -0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,109, -0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0, -13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18, -109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,18,110,0,16,10,49,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0, -0,14,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9, -18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,109,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2, -0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16, -8,48,0,57,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9, -18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,8,18,109,0,0,0,1,90, -95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0, -8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,8, -48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16, -10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,110,0, -16,10,50,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,46,20,0,9,18,109,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,47,20,0,9,18,109,0,16,10, -49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,110,0,16,10,50,0,57,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,110,0, -16,10,51,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0, -0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0, -0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,49, -20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,49,20,0,9,18,109,0,16, -10,50,0,57,18,109,0,16,10,50,0,57,18,110,0,16,10,50,0,57,49,20,0,9,18,109,0,16,10,51,0,57,18,109,0, -16,10,51,0,57,18,110,0,16,10,51,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,1,1,0,2,0,13,0,109, -0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18, -109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10, -49,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0, -0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18, -109,0,16,8,48,0,57,18,118,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,47,20, -0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10, -0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90, -95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118, -101,99,50,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18, -118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90, -95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118, -101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9,18, -109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0, -97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0, -57,18,109,0,16,8,48,0,57,18,118,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0, -47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,47,20,0,8,18,109,0,0,0,1,90,95,0, -0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99, -51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0, -16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0, -57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0, -1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,8,18,109,0,0, -0,1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2,58, -118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,46,20,0,9, -18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0, -16,10,50,0,57,18,118,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,118,0,46,20,0,8, -18,109,0,0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1, -118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,18,118, -0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,47,20,0,9,18,109,0,16,10,50,0, -57,18,109,0,16,10,50,0,57,18,118,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,18,118, -0,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90, -95,0,0,12,0,1,118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8, -48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,18,118,0,48,20,0,9,18,109, -0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51, -0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,3,2,90,95,0,0,12,0,1,118,0,2,58,118,101,99,52,0,0,17,49,0,48,0,0,18,97,0,49,0,0,0,0,9,18,109,0, -16,8,48,0,57,18,109,0,16,8,48,0,57,18,118,0,48,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0, -57,18,118,0,48,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,18,118,0,48,20,0,9,18,109,0,16, -10,51,0,57,18,109,0,16,10,51,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10, -0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, -11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,14,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,118,0,18,118,0, -18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,5,0,2,25,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16, -10,49,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,25,1,0,2,0,6,0, -118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,7,0,2,25,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,51,0,0,16,10,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0, -1,90,95,0,0,8,0,2,25,1,0,2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,10,49, -0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,25,1,0,2,0,9,0, -97,0,0,0,1,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20, -0,0,1,90,95,0,0,10,0,2,25,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49, -0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,25,1,0, -2,0,11,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,12,0,2,25,1,0,2,0,12,0,118,0,0,0,1,9,18,118, -0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,0,1,90,95,0,0,13,0,2,25,1,0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8, -48,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49, -0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0, -20,0,0,1,90,95,0,0,14,0,2,25,1,0,2,0,14,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0, -57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57, -58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58, -118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1, -90,95,0,0,15,0,2,25,1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118, -101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90, -95,0,0,5,0,2,24,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16,10,49,0,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,24,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105, -118,101,99,50,0,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90, -95,0,0,7,0,2,24,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0, -0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,24,1,0,2,0,8,0,118, -0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,10,49,0,0,0,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,24,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18,97,0,17,49,0, -48,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2,24,1,0,2,0,10, -0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,24,1,0,2,0,11,0,118,0,0,0,1,9,18,118,0,18, -118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0, -20,0,0,1,90,95,0,0,12,0,2,24,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17, -49,0,48,0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,13,0,2,24,1, -0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,0,17,49,0, -48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,0,17,49,0,48, -0,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,2,24,1,0,2,0, -14,0,109,0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0, -0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0, -0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0, -46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,24,1,0,2,0,15,0,109, -0,0,0,1,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46, -20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20, -0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0, -9,18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9, -18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,68,101,99, -114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16, -10,49,0,47,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,6,0,118,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16, -10,49,0,0,0,47,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,7,0,118,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0, -16,10,49,0,0,0,47,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,8,0,118,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0, -0,16,10,49,0,0,0,47,20,0,0,1,90,95,0,0,9,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,9,0,97, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,17,49,0,48,0,0,47,20,0,0, -1,90,95,0,0,10,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,47, -20,0,0,1,90,95,0,0,11,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0, -0,47,20,0,0,1,90,95,0,0,12,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0, -0,0,0,47,20,0,0,1,90,95,0,0,13,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,13,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58, -118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58, -118,101,99,50,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,68,101,99, -114,0,1,0,2,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,8,48, -0,57,18,109,0,16,8,48,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,49,0, -57,18,109,0,16,10,49,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,9,18,109,0,16,10,50,0,57, -18,109,0,16,10,50,0,57,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1,90,95,0,0,15,0,0,95,95, -112,111,115,116,68,101,99,114,0,1,0,2,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109, -0,20,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20, -0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0, -9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,9, -18,109,0,16,10,51,0,57,18,109,0,16,10,51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,47,20,0,0,1, -90,95,0,0,9,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,90,95,0,0,10,0,0,95,95,112, -111,115,116,73,110,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0, -20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0,11,0,0,95, -95,112,111,115,116,73,110,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0,12,0, -0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,0,1,90,95,0,0, -5,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,10,49,0,46,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116, -73,110,99,114,0,1,0,2,0,6,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118, -0,18,118,0,58,105,118,101,99,50,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115, -116,73,110,99,114,0,1,0,2,0,7,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18, -118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111, -115,116,73,110,99,114,0,1,0,2,0,8,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9, -18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,10,49,0,0,0,46,20,0,0,1,90,95,0,0,13,0,0,95,95,112, -111,115,116,73,110,99,114,0,1,0,2,0,13,0,109,0,0,0,1,3,2,90,95,0,0,13,0,1,110,0,2,18,109,0,0,0,9, -18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18, -109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,50,0,0,17,49,0,48,0,0,0,0,46,20,0,8,18, -110,0,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,14,0,109,0,0,0,1,3,2,90, -95,0,0,14,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109,0,16,8,48,0,57,58,118,101,99,51, -0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0,16,10,49,0,57,58,118,101,99,51,0, -0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16,10,50,0,57,58,118,101,99,51,0,0, -17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,15,0,0,95,95,112,111,115,116,73,110,99,114,0, -1,0,2,0,15,0,109,0,0,0,1,3,2,90,95,0,0,15,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,8,48,0,57,18,109, -0,16,8,48,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,49,0,57,18,109,0, -16,10,49,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,50,0,57,18,109,0,16, -10,50,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,9,18,109,0,16,10,51,0,57,18,109,0,16,10, -51,0,57,58,118,101,99,52,0,0,17,49,0,48,0,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0, -0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0, -0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,40,0,0,1,90,95, -0,0,1,0,2,16,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,99,0,0,0,4,102,108,111, -97,116,95,108,101,115,115,0,18,99,0,0,18,98,0,0,18,97,0,0,0,8,18,99,0,0,0,1,90,95,0,0,1,0,2,16,1,1, +0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18, +95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,0,1,4,118, +101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0, +0,8,0,2,27,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101, +116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95, +110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,90,95,0,0,10, +0,2,27,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116, +86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0, +0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, +0,18,118,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52, +95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,13,0,2, +27,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57, +54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,0,1,90,95,0, +0,14,0,2,27,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, +48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,54,20,0,0,1,90,95,0,0,15,0,2,27,1, +1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,54,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +51,0,57,18,109,0,16,1,51,0,57,54,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,9,0,97,0,0,1,1,0,0, +9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,48,20,0,0,1,90,95,0,0,9,0,0,100, +111,116,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0, +59,120,0,18,98,0,59,120,0,48,18,97,0,59,121,0,18,98,0,59,121,0,48,46,20,0,0,1,90,95,0,0,9,0,0,100, +111,116,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,51,95,100,111,116,0,18,95,95, +114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,12,0,97, +0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18, +97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,1,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97, +0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,2,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18, +97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,3,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0, +0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,4,1,0,2,0,5,0,97,0,0,1,1,0, +0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0, +118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6, +0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0, +0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, +48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0, +18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0, +0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0, +1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,3,1, +0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90, +95,0,0,7,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8, +18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0, +18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9, +18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0, +8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8, +0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0, +9,0,2,1,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,46,20,0,8,18,97,0,0,0, +1,90,95,0,0,9,0,2,2,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,47,20,0,8, +18,97,0,0,0,1,90,95,0,0,9,0,2,3,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98, +0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,4,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18, +97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0, +0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0, +1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3, +1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0, +1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49, +20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0, +18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0, +117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0, +118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, +11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18, +118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0, +18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1, +9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1, +0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0, +2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90, +95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50, +0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0, +0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6, +0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18, +97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, +18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1, +1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0, +0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0, +18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7, +0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,48,20,0, +8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0, +58,105,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0, +0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,46,20,0,8,18,118, +0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105, +118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0, +0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1, +90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99, +52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97, +0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,10, +0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0, +0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, +118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2, +0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,49,20,0, +8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118, +0,58,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0, +0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0, +0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101, +99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0, +97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0, +12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18, +97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9, +18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0, +2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,48,20, +0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18, +118,0,58,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0, +109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48, +0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1, +49,0,57,18,110,0,16,1,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0, +110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48, +0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1, +49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95, +114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,59,120,120,0,48, +18,109,0,16,1,49,0,57,18,110,0,16,1,48,0,57,59,121,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49,0,57,59,120,120,0,48,18,109,0,16,1,49,0, +57,18,110,0,16,1,49,0,57,59,121,121,0,48,46,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1, +0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110, +0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, +110,0,16,1,49,0,57,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0, +9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20, +0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46, +20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,0,1,90,95,0,0, +14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48, +0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,59,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110, +0,16,1,48,0,57,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,48,0,57,59,122,122,122,0, +48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49, +0,57,59,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,59,121,121,121,0,48,46,18,109, +0,16,1,50,0,57,18,110,0,16,1,49,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, +0,16,1,50,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,50,0,57,59,120,120,120,0,48,18,109,0,16,1,49,0, +57,18,110,0,16,1,50,0,57,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,59,122, +122,122,0,48,46,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95, +95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,20,0,9,18, +95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9, +18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0, +0,1,90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,20,0,0,1,90,95,0,0,15, +0,2,27,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0, +57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49, +0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0, +109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48, +0,57,18,110,0,16,1,48,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,48,0,57,59, +121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,48,0,57,59,122,122,122,122,0,48,46,18, +109,0,16,1,51,0,57,18,110,0,16,1,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49,0,57,59,120,120,120,120,0,48,18,109,0, +16,1,49,0,57,18,110,0,16,1,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1, +49,0,57,59,122,122,122,122,0,48,46,18,109,0,16,1,51,0,57,18,110,0,16,1,49,0,57,59,119,119,119,119, +0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, +50,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,50,0,57,59,121,121,121,121,0, +48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16,1,51,0,57, +18,110,0,16,1,50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, +57,18,109,0,16,1,48,0,57,18,110,0,16,1,51,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18, +110,0,16,1,51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,51,0,57,59,122, +122,122,122,0,48,46,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,59,119,119,119,119,0,48,46,20,0,0, +1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116, +86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,49,20,0,0,1,90,95,0,0,13, +0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, +18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18, +110,0,16,1,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,46,20,0,0,1,90,95,0,0,13,0,2,27,1,1, +0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18, +110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1, +49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,9,0,97, +0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1, +48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48, +20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86, +97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0, +13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,0,1,90, +95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, +1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, +109,0,16,1,49,0,57,18,98,0,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,46,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0, +14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, +48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, +98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,46,20,0, +0,1,90,95,0,0,14,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, +49,0,57,18,97,0,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, +97,0,18,110,0,16,1,50,0,57,47,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,47,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0, +9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110, +0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,0, +1,90,95,0,0,14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, +57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0, +16,1,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9, +18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114, +101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,49,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0, +109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0, +57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0, +49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,49,20,0,0,1, +90,95,0,0,15,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, +18,97,0,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18, +110,0,16,1,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1, +51,0,57,46,20,0,0,1,90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, +109,0,16,1,51,0,57,18,98,0,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,47,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109, +0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57, +18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47, +20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,47,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,47,20,0,0,1,90,95,0,0,15,0,2, +21,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, +97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110, +0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0, +57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0, +1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, +0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, +57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0, +16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57, +18,98,0,48,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114, +101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86, +97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16, +1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, +97,0,18,110,0,16,1,51,0,57,49,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0, +0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,49,20,0,9,18,95, +95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101, +116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97, +108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,49,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,13,0,109, +0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59, +120,120,0,48,18,109,0,16,1,49,0,57,18,118,0,59,121,121,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0, +0,10,0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116, +0,0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100, +111,116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,14,0,109,0,0, +1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59,120, +120,120,0,48,18,109,0,16,1,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,118,0, +59,122,122,122,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,14,0,109,0,0,0,1, +9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0,57,0, +0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,49, +0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0, +16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18, +95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59,120,120,120,120,0,48,18,109,0,16,1, +49,0,57,18,118,0,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,118,0,59,122,122,122,122,0,48, +46,18,109,0,16,1,51,0,57,18,118,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0, +12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0, +0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111, +116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, +100,111,116,0,0,18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, +119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,13,0,2,1,1,0,2,0, +13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, +48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20,0,8,18, +109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0, +57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, +57,18,110,0,16,1,49,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0, +13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0, +13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, +48,0,57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,8,18, +109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,1,48,0, +57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, +57,18,110,0,16,1,49,0,57,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, +57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18, +109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18, +109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18, +110,0,16,1,50,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0, +110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0, +109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, +57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9,18,109,0, +16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2, +1,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18, +110,0,16,1,48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46, +20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,20,0,9,18,109,0,16,1, +51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,2,1, +0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0, +16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9, +18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,9,18,109,0,16,1,51,0,57, +18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15, +0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0, +15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, +57,18,110,0,16,1,48,0,57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, +57,49,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,9,18,109,0, +16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2, +1,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18, +97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,46,20,0,9,18,109,0,16,1,49,0, +57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0, +1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109, +0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, +57,18,118,0,47,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0, +1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109, +0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,8, +18,109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1, +118,0,2,58,118,101,99,50,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0, +16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,8,18, +109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1, +118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118, +0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,9,18,109,0,16,1,50,0,57, +18,109,0,16,1,50,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1, +1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0, +16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, +18,118,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,47,20,0,8,18,109,0,0,0,1, +90,95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118, +101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,48,20,0,9,18, +109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50, +0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0, +0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109, +0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, +57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,48,20,0,8,18,109,0,0,0, +1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2,58, +118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,46,20,0,9, +18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1, +50,0,57,18,118,0,46,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,46,20,0,8,18,109,0, +0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2, +58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20, +0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0, +16,1,50,0,57,18,118,0,47,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,47,20,0,8,18, +109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1, +118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118, +0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57, +18,109,0,16,1,50,0,57,18,118,0,48,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,48, +20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0, +12,0,1,118,0,2,58,118,101,99,52,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109,0,16,1,48,0,57,18, +109,0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0, +9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,48,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16, +1,51,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,13,0, +109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0, +118,0,0,1,1,0,0,14,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, +12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18, +118,0,0,0,1,90,95,0,0,5,0,2,25,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16,1,49,0,47,20,0,9,18,95, +95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,25,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0, +18,118,0,58,105,118,101,99,50,0,0,16,1,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118, +0,20,0,0,1,90,95,0,0,7,0,2,25,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0, +16,1,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,25,1,0, +2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,1,49,0,0,0,47,20,0,9,18,95,95, +114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,25,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18, +97,0,17,1,49,46,48,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2, +25,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,9, +18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,25,1,0,2,0,11,0,118,0,0,0,1,9, +18,118,0,18,118,0,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97, +108,0,18,118,0,20,0,0,1,90,95,0,0,12,0,2,25,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118, +101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90, +95,0,0,13,0,2,25,1,0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101, +99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99, +50,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0, +14,0,2,25,1,0,2,0,14,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51, +0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0, +17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17, +1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,25, +1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1, +49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49, +46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46, +48,0,0,0,47,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48, +0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,2,24,1,0,2,0,5,0, +97,0,0,0,1,9,18,97,0,18,97,0,16,1,49,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1, +90,95,0,0,6,0,2,24,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,1,49,0, +0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,7,0,2,24,1,0,2,0,7,0, +118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,1,49,0,0,0,46,20,0,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,24,1,0,2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0, +58,105,118,101,99,52,0,0,16,1,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0, +1,90,95,0,0,9,0,2,24,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18,97,0,17,1,49,46,48,0,46,20,0,9,18,95,95, +114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2,24,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0, +18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18, +118,0,20,0,0,1,90,95,0,0,11,0,2,24,1,0,2,0,11,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0, +0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,12,0, +2,24,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0, +9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,13,0,2,24,1,0,2,0,13,0,109,0,0,0,1, +9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9, +18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18, +95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,2,24,1,0,2,0,14,0,109,0,0,0,1,9,18, +109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109, +0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0, +16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114, +101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,24,1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,1, +48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49, +0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,50,0, +57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,51,0,57, +18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86, +97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,5,0,97,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,1,49,0,47,20,0,0,1,90, +95,0,0,6,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,6,0,118,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,1,49,0,0,0,47,20,0,0,1, +90,95,0,0,7,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,7,0,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,1,49,0,0,0,47,20,0,0, +1,90,95,0,0,8,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,8,0,118,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,1,49,0,0,0,47,20,0,0, +1,90,95,0,0,9,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101, +116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,17,1,49,46,48,0,47,20,0,0,1,90,95,0,0,10,0,0,95,95, +112,111,115,116,68,101,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118, +0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,11,0,0, +95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, +18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0, +12,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97, +108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95, +0,0,13,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116, +86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,50,0,0,17,1, +49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,50,0,0,17,1,49, +46,48,0,0,0,47,20,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,14,0,109,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, +57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, +58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58, +118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,15,0,0,95,95,112,111,115,116,68,101,99, +114,0,1,0,2,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48, +0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0, +57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57, +18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,51,0,57,18, +109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,9,0,0,95,95,112, +111,115,116,73,110,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0, +9,18,97,0,18,97,0,16,1,49,0,46,20,0,0,1,90,95,0,0,10,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0, +2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118, +101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,11,0,0,95,95,112,111,115,116,73,110,99,114, +0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58, +118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,12,0,0,95,95,112,111,115,116,73,110,99, +114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118, +0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,73, +110,99,114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18, +97,0,16,1,49,0,46,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,6,0,118,0, +0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0, +0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,7,0,118, +0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51, +0,0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,8,0, +118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99, +51,0,0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,13,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,13, +0,109,0,0,0,1,3,2,90,95,0,0,13,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, +57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, +58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,14,0,0,95,95,112,111, +115,116,73,110,99,114,0,1,0,2,0,14,0,109,0,0,0,1,3,2,90,95,0,0,14,0,1,110,0,2,18,109,0,0,0,9,18, +109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109, +0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0, +16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,8,18,110,0,0,0, +1,90,95,0,0,15,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,15,0,109,0,0,0,1,3,2,90,95,0,0,15, +0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1, +49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49, +46,48,0,0,0,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46, +48,0,0,0,46,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48, +0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118, +101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1, +90,95,0,0,1,0,2,15,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0, +0,58,102,108,111,97,116,0,0,18,98,0,0,0,40,0,0,1,90,95,0,0,1,0,2,16,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0, +98,0,0,0,1,3,2,90,95,0,0,1,0,1,99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,98, +0,0,18,97,0,0,0,8,18,99,0,0,0,1,90,95,0,0,1,0,2,16,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58, +102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,41,0,0,1,90,95,0,0,1,0,2, +18,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108, +111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113, +117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,18,1,1, 0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97, -116,0,0,18,98,0,0,0,41,0,0,1,90,95,0,0,1,0,2,18,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, -95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0, -18,97,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103, -0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,18,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111, -97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,43,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,9, -0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95, -108,101,115,115,0,18,103,0,0,18,97,0,0,18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18, -101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,5,0,97,0,0,1, -1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0, -42,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,9,0,102,0,0,0,1,4,102,108,111, -97,116,95,112,114,105,110,116,0,18,102,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0, -1,1,0,0,5,0,105,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,105,0,0,0,0,1,90,95,0,0,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,0,1,0,98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0, -18,98,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,10,0,118,0,0,0,1,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0, -0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,11,0,118,0, -0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77, +116,0,0,18,98,0,0,0,43,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, +95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,97,0,0, +18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103, +0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111, +97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,42,0,0,1,90,95,0,0,0,0,0,112,114,105, +110,116,77,69,83,65,0,1,1,0,0,9,0,102,0,0,0,1,4,102,108,111,97,116,95,112,114,105,110,116,0,18,102, +0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,5,0,105,0,0,0,1,4,105,110,116, +95,112,114,105,110,116,0,18,105,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, +0,1,0,98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,90,95,0,0,0,0,0,112,114, +105,110,116,77,69,83,65,0,1,1,0,0,10,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118, +0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0, +0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,11,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83, +65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9, +58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, +116,77,69,83,65,0,1,1,0,0,12,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, +120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110, +116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, +119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,6,0,118,0,0,0,1,9,58,112, +114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, +18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,7,0,118,0,0, +0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77, 69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,12,0,118,0,0,0,1,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, -118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69, -83,65,0,1,1,0,0,6,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9, -58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, -116,77,69,83,65,0,1,1,0,0,7,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120, +0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,8,0,118,0,0,0,1,9,58,112,114,105, +110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0, +59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105, +110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83, +65,0,1,1,0,0,2,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58, +112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, +116,77,69,83,65,0,1,1,0,0,3,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120, 0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116, 77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1, -0,0,8,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114, +0,0,4,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114, 105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, 118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0, -0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,2,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69, -83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,3,0,118,0,0,0,1,9,58,112,114,105,110, -116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, -121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0, -112,114,105,110,116,77,69,83,65,0,1,1,0,0,4,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112, -114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,13,0,109,0,0, -0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0, -1,1,0,0,14,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83, -65,0,0,18,109,0,16,10,50,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0, -15,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,8,48,0,57,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,109,0,16,10,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,109,0,16,10,50,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,10,51,0,57,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,16,0,101,0,0,0,1,4,105,110,116,95, +0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,13,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69, +83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,49,0, +57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,14,0,109,0,0,0,1,9,58,112, +114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0, +0,18,109,0,16,1,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,50,0,57,0,0,0, +0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,15,0,109,0,0,0,1,9,58,112,114,105, +110,116,77,69,83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, +109,0,16,1,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,50,0,57,0,0,0,9,58, +112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,51,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105, +110,116,77,69,83,65,0,1,1,0,0,16,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0, +0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,17,0,101,0,0,0,1,4,105,110,116,95, 112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0, -17,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,18,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,19,0,101,0,0,0,1,4,105,110,116, +18,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, +105,110,116,77,69,83,65,0,1,1,0,0,19,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, +0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,20,0,101,0,0,0,1,4,105,110,116, 95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, -0,20,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,21,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, -0,0,0,0 +0,21,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h index e5a252b0196..f939aa9673d 100644 --- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h @@ -23,87 +23,87 @@ 114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0, 1,90,95,0,0,12,0,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116,86,97,108,0, 18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116, -114,105,120,0,16,8,48,0,57,18,103,108,95,86,101,114,116,101,120,0,59,120,120,120,120,0,48,18,103, +114,105,120,0,16,1,48,0,57,18,103,108,95,86,101,114,116,101,120,0,59,120,120,120,120,0,48,18,103, 108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105, -120,0,16,10,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,121,121,121,0,48,46,18,103,108, -95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0, -16,10,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,108,95,77, -111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16,10, -51,0,57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0, -0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114, -100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111, -114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97, -115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100, -52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0, -0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100, -0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0, -18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114, -100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0, -18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0, -0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1, -3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111, -111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59, -119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, -99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, -114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, -100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, -114,111,106,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, -100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,76, -111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0, -9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100, -52,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1, -90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90, -95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99, -111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111, -114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115, -0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0, -0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115, +120,0,16,1,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,121,121,121,0,48,46,18,103,108,95, +77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16, +1,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,108,95,77,111, +100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16,1,51,0, +57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0,0,116, +101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,9,0, +99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52, +0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100, +52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18, +95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0, +1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115, +97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, +90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111, +114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0, +18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, +12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,109,112, +108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0, +12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0, +59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108, +111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86, +97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0, +116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0, +10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114, +100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9, +18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, +95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, +111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111, +100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0, +108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, +0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18, +112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, +95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99, +111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111, +100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0, +108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, +0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18, +112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, +95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99, +111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,76,111,100,0,1,1,0,0, +18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0, +0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122, +0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111, +100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116, +101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114, +0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112, +99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59, +120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, +108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101, +116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, +12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115,97,109,112,108,101, +114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, +99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0, +20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95, +99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, +114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,0,115, 97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, 90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99, 111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52, -95,116,101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0, -1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108, -111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59, -120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0, -20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95, -95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1, -90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95, -0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114, -100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18, -99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4, -118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,115,104,97,100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1, -1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111, -114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18, -99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95, -98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108, -101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80, -114,111,106,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, -100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18, -112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, -95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,0 +95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97, +108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115, +104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1, +1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111, +111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99, +111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0, +59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, +101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0, +18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, +100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111, +114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18, +99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0, +59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115, +104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, +111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111, +100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0, +108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, +0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18, +112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114, +100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95, +115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, +112,99,111,111,114,100,0,0,0,0,0 -- cgit v1.2.3 From 99c89ebdb00ff0452f4b106cd53ec4a2e5162137 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 19:51:02 +0100 Subject: glsl/cl: Add simple error reporting. --- src/glsl/cl/sl_cl_parse.c | 77 ++++++++++++++++++++++++++++++++++++++++++----- src/glsl/cl/sl_cl_parse.h | 5 ++- 2 files changed, 74 insertions(+), 8 deletions(-) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 06224b31ec0..5919186c520 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -330,6 +330,8 @@ struct parse_context { unsigned int shader_type; unsigned int parsing_builtin; + + char error[256]; }; @@ -362,6 +364,16 @@ _update(struct parse_context *ctx, } +static void +_error(struct parse_context *ctx, + char *msg) +{ + if (ctx->error[0] == '\0') { + strcpy(ctx->error, msg); + } +} + + static int _parse_token(struct parse_context *ctx, enum sl_pp_token token, @@ -648,10 +660,12 @@ _parse_struct_declarator(struct parse_context *ctx, return 0; } if (_parse_constant_expression(ctx, &p)) { - return 0; + _error(ctx, "expected constant integral expression"); + return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { - return 0; + _error(ctx, "expected `]'"); + return -1; } _update(ctx, e, FIELD_ARRAY); *ps = p; @@ -736,6 +750,7 @@ _parse_struct_specifier(struct parse_context *ctx, _emit(ctx, &p.out, '\0'); } if (_parse_token(ctx, SL_PP_LBRACE, &p)) { + _error(ctx, "expected `{'"); return -1; } if (_parse_struct_declaration_list(ctx, &p)) { @@ -853,9 +868,11 @@ _parse_type_specifier_array(struct parse_context *ctx, return -1; } if (_parse_constant_expression(ctx, &p)) { + _error(ctx, "expected constant integral expression"); return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + _error(ctx, "expected `]'"); return -1; } *ps = p; @@ -963,10 +980,12 @@ _parse_function_identifier(struct parse_context *ctx, return 0; } if (_parse_constant_expression(ctx, &p)) { - return 0; + _error(ctx, "expected constant integral expression"); + return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { - return 0; + _error(ctx, "expected `]'"); + return -1; } _update(ctx, e, FUNCTION_CALL_ARRAY); *ps = p; @@ -1091,6 +1110,8 @@ _parse_function_call_generic(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected `)'"); + return -1; } p = *ps; @@ -1099,6 +1120,8 @@ _parse_function_call_generic(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected `)'"); + return -1; } return -1; @@ -1202,10 +1225,12 @@ _parse_postfix_expression(struct parse_context *ctx, _emit(ctx, &p.out, OP_POSTDECREMENT); } else if (_parse_token(ctx, SL_PP_LBRACKET, &p) == 0) { if (_parse_expression(ctx, &p)) { - return 0; + _error(ctx, "expected an integral expression"); + return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { - return 0; + _error(ctx, "expected `]'"); + return -1; } _emit(ctx, &p.out, OP_SUBSCRIPT); } else if (_parse_token(ctx, SL_PP_DOT, &p) == 0) { @@ -1487,9 +1512,11 @@ _parse_parameter_declarator_array(struct parse_context *ctx, return -1; } if (_parse_constant_expression(ctx, &p)) { + _error(ctx, "expected constant integral expression"); return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + _error(ctx, "expected `]'"); return -1; } *ps = p; @@ -1529,9 +1556,11 @@ _parse_parameter_type_specifier_array(struct parse_context *ctx, return -1; } if (_parse_constant_expression(ctx, &p)) { + _error(ctx, "expected constant integral expression"); return -1; } if (_parse_token(ctx, SL_PP_RBRACKET, &p)) { + _error(ctx, "expected `]'"); return -1; } *ps = p; @@ -1641,6 +1670,8 @@ _parse_function_prototype(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected `)'"); + return -1; } } @@ -1651,6 +1682,8 @@ _parse_function_prototype(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected `)'"); + return -1; } return -1; @@ -1937,12 +1970,15 @@ _parse_selection_statement(struct parse_context *ctx, return -1; } if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + _error(ctx, "expected `('"); return -1; } if (_parse_expression(ctx, &p)) { + _error(ctx, "expected an expression"); return -1; } if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + _error(ctx, "expected `)'"); return -1; } _emit(ctx, &p.out, OP_END); @@ -2033,10 +2069,12 @@ _parse_condition_initializer(struct parse_context *ctx, return -1; } if (_parse_token(ctx, SL_PP_ASSIGN, &p)) { + _error(ctx, "expected `='"); return -1; } _emit(ctx, &p.out, VARIABLE_INITIALIZER); if (_parse_initializer(ctx, &p)) { + _error(ctx, "expected an initialiser"); return -1; } _emit(ctx, &p.out, DECLARATOR_NONE); @@ -2102,12 +2140,15 @@ _parse_iteration_statement(struct parse_context *ctx, if (_parse_id(ctx, ctx->dict._while, &p) == 0) { _emit(ctx, &p.out, OP_WHILE); if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + _error(ctx, "expected `('"); return -1; } if (_parse_condition(ctx, &p)) { + _error(ctx, "expected an expression"); return -1; } if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + _error(ctx, "expected `)'"); return -1; } if (_parse_statement(ctx, &p)) { @@ -2126,16 +2167,20 @@ _parse_iteration_statement(struct parse_context *ctx, return -1; } if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + _error(ctx, "expected `('"); return -1; } if (_parse_expression(ctx, &p)) { + _error(ctx, "expected an expression"); return -1; } if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + _error(ctx, "expected `)'"); return -1; } _emit(ctx, &p.out, OP_END); if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + _error(ctx, "expected `;'"); return -1; } *ps = p; @@ -2145,6 +2190,7 @@ _parse_iteration_statement(struct parse_context *ctx, if (_parse_id(ctx, ctx->dict._for, &p) == 0) { _emit(ctx, &p.out, OP_FOR); if (_parse_token(ctx, SL_PP_LPAREN, &p)) { + _error(ctx, "expected `('"); return -1; } if (_parse_for_init_statement(ctx, &p)) { @@ -2154,6 +2200,7 @@ _parse_iteration_statement(struct parse_context *ctx, return -1; } if (_parse_token(ctx, SL_PP_RPAREN, &p)) { + _error(ctx, "expected `)'"); return -1; } if (_parse_statement(ctx, &p)) { @@ -2384,6 +2431,8 @@ _parse_single_declaration(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected an initialiser"); + return -1; } p = *ps; @@ -2397,6 +2446,8 @@ _parse_single_declaration(struct parse_context *ctx, *ps = p; return 0; } + _error(ctx, "expected `]'"); + return -1; } return 0; } @@ -2434,6 +2485,8 @@ _parse_init_declarator_list(struct parse_context *ctx, *ps = p; continue; } + _error(ctx, "expected an initialiser"); + break; } p = *ps; @@ -2450,6 +2503,8 @@ _parse_init_declarator_list(struct parse_context *ctx, *ps = p; continue; } + _error(ctx, "expected `]'"); + break; } p = *ps; } @@ -2473,6 +2528,7 @@ _parse_declaration(struct parse_context *ctx, _update(ctx, e, DECLARATION_INIT_DECLARATOR_LIST); } if (_parse_token(ctx, SL_PP_SEMICOLON, &p)) { + _error(ctx, "expected `;'"); return -1; } *ps = p; @@ -2511,6 +2567,7 @@ _parse_external_declaration(struct parse_context *ctx, return 0; } + _error(ctx, "expected an identifier"); return -1; } @@ -2548,8 +2605,11 @@ int sl_cl_compile(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int shader_type, + unsigned int parsing_builtin, unsigned char **output, - unsigned int *cboutput) + unsigned int *cboutput, + char *error, + unsigned int cberror) { struct parse_context ctx; struct parse_state ps; @@ -2634,10 +2694,13 @@ sl_cl_compile(struct sl_pp_context *context, ctx.shader_type = shader_type; ctx.parsing_builtin = 1; + ctx.error[0] = '\0'; + ps.in = 0; ps.out = 0; if (_parse_translation_unit(&ctx, &ps)) { + strncpy(error, ctx.error, cberror); return -1; } diff --git a/src/glsl/cl/sl_cl_parse.h b/src/glsl/cl/sl_cl_parse.h index 5b4abe54fd0..23a0d5fee00 100644 --- a/src/glsl/cl/sl_cl_parse.h +++ b/src/glsl/cl/sl_cl_parse.h @@ -32,7 +32,10 @@ int sl_cl_compile(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int shader_type, + unsigned int parsing_builtin, unsigned char **output, - unsigned int *cboutput); + unsigned int *cboutput, + char *error, + unsigned int cberror); #endif /* SL_CL_PARSE_H */ -- cgit v1.2.3 From 3f147c71eda9e8b8f55562f30193584b6fb74704 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 19:51:24 +0100 Subject: slang: Report syntax parser errors. --- src/mesa/shader/slang/slang_compile.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 7669b7e8a6e..44c889734b6 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2722,17 +2722,22 @@ compile_with_grammar(const char *source, } /* Finally check the syntax and generate its binary representation. */ - result = sl_cl_compile(context, tokens, shader_type, &prod, &size); + result = sl_cl_compile(context, + tokens, + shader_type, + parsing_builtin, + &prod, + &size, + errmsg, + sizeof(errmsg)); sl_pp_context_destroy(context); free(tokens); if (result) { - /*char buf[1024]; - GLint pos;*/ + /*GLint pos;*/ - /*slang_info_log_error(infolog, buf);*/ - slang_info_log_error(infolog, "Syntax error."); + slang_info_log_error(infolog, errmsg); /* syntax error (possibly in library code) */ #if 0 { -- cgit v1.2.3 From eaa34c2deac093fc23e2beed9c5580e57289b1e2 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 13 Nov 2009 19:51:49 +0100 Subject: glsl/apps: Report syntax parser errors. --- src/glsl/apps/compile.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index f99d1413b68..edc426528bd 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -170,7 +170,7 @@ main(int argc, } outtokens[j] = outtokens[i]; - if (sl_cl_compile(context, outtokens, shader_type, &outbytes, &cboutbytes) == 0) { + if (sl_cl_compile(context, outtokens, shader_type, 1, &outbytes, &cboutbytes, errmsg, sizeof(errmsg)) == 0) { unsigned int i; unsigned int line = 0; @@ -203,6 +203,9 @@ main(int argc, } fprintf (out, "\n"); free(outbytes); + } else { + fprintf(out, "$SYNTAXERROR: `%s'\n", errmsg); + return -1; } sl_pp_context_destroy(context); -- cgit v1.2.3 From 547ac2869b1e1bbdbf8e51cd40d50e6ab0f4f9f1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 17 Nov 2009 09:06:53 +0100 Subject: glsl/pp: Fix macro formal argument parsing, more descriptive error msgs. --- src/glsl/pp/sl_pp_define.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_define.c b/src/glsl/pp/sl_pp_define.c index d18a7ee2895..e004c9f95b9 100644 --- a/src/glsl/pp/sl_pp_define.c +++ b/src/glsl/pp/sl_pp_define.c @@ -60,7 +60,7 @@ _parse_formal_args(struct sl_pp_context *context, return 0; } } else { - strcpy(context->error_msg, "expected either an identifier or `)'"); + strcpy(context->error_msg, "expected either macro formal argument or `)'"); return -1; } @@ -68,7 +68,7 @@ _parse_formal_args(struct sl_pp_context *context, for (;;) { if (*first < last && input[*first].token != SL_PP_IDENTIFIER) { - strcpy(context->error_msg, "expected an identifier"); + strcpy(context->error_msg, "expected macro formal argument"); return -1; } @@ -90,6 +90,7 @@ _parse_formal_args(struct sl_pp_context *context, if (*first < last) { if (input[*first].token == SL_PP_COMMA) { (*first)++; + skip_whitespace(input, first, last); } else if (input[*first].token == SL_PP_RPAREN) { (*first)++; return 0; @@ -124,7 +125,7 @@ sl_pp_process_define(struct sl_pp_context *context, first++; } if (macro_name == -1) { - strcpy(context->error_msg, "expected an identifier"); + strcpy(context->error_msg, "expected macro name"); return -1; } -- cgit v1.2.3 From b89cd8afc510541a18f2f5c04884637626e104e1 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Fri, 20 Nov 2009 08:59:50 +0100 Subject: glsl/pp: Expand unknown identifiers to 0 in if/elif expressions. --- src/glsl/pp/sl_pp_if.c | 2 +- src/glsl/pp/sl_pp_line.c | 2 +- src/glsl/pp/sl_pp_macro.c | 15 +++++++++++---- src/glsl/pp/sl_pp_macro.h | 8 +++++++- src/glsl/pp/sl_pp_process.c | 3 ++- 5 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/glsl/pp/sl_pp_if.c b/src/glsl/pp/sl_pp_if.c index a0b3635dd5a..6610bc69f3c 100644 --- a/src/glsl/pp/sl_pp_if.c +++ b/src/glsl/pp/sl_pp_if.c @@ -137,7 +137,7 @@ _parse_if(struct sl_pp_context *context, return -1; } } else { - if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, sl_pp_macro_expand_unknown_to_0)) { free(state.out); return -1; } diff --git a/src/glsl/pp/sl_pp_line.c b/src/glsl/pp/sl_pp_line.c index fc2dd89e68b..ed5acc697ce 100644 --- a/src/glsl/pp/sl_pp_line.c +++ b/src/glsl/pp/sl_pp_line.c @@ -53,7 +53,7 @@ sl_pp_process_line(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, input, &i, NULL, &state, 0)) { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, sl_pp_macro_expand_normal)) { free(state.out); return -1; } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index d6c32a0e782..29f1229dd7d 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -28,6 +28,7 @@ #include #include #include +#include "sl_pp_public.h" #include "sl_pp_macro.h" #include "sl_pp_process.h" @@ -122,8 +123,9 @@ sl_pp_macro_expand(struct sl_pp_context *context, unsigned int *pi, struct sl_pp_macro *local, struct sl_pp_process_state *state, - int mute) + enum sl_pp_macro_expand_behaviour behaviour) { + int mute = (behaviour == sl_pp_macro_expand_mute); int macro_name; struct sl_pp_macro *macro = NULL; struct sl_pp_macro *actual_arg = NULL; @@ -183,7 +185,12 @@ sl_pp_macro_expand(struct sl_pp_context *context, } if (!macro) { - if (!mute) { + if (behaviour == sl_pp_macro_expand_unknown_to_0) { + if (_out_number(context, state, 0)) { + strcpy(context->error_msg, "out of memory"); + return -1; + } + } else if (!mute) { if (sl_pp_process_out(state, &input[*pi])) { strcpy(context->error_msg, "out of memory"); return -1; @@ -274,7 +281,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, input, &i, local, &arg_state, 0)) { + if (sl_pp_macro_expand(context, input, &i, local, &arg_state, sl_pp_macro_expand_normal)) { free(arg_state.out); return -1; } @@ -339,7 +346,7 @@ sl_pp_macro_expand(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, macro->body, &j, actual_arg, state, mute)) { + if (sl_pp_macro_expand(context, macro->body, &j, actual_arg, state, behaviour)) { return -1; } break; diff --git a/src/glsl/pp/sl_pp_macro.h b/src/glsl/pp/sl_pp_macro.h index e3ae2fc7125..3ad3438236a 100644 --- a/src/glsl/pp/sl_pp_macro.h +++ b/src/glsl/pp/sl_pp_macro.h @@ -56,12 +56,18 @@ sl_pp_macro_free(struct sl_pp_macro *macro); void sl_pp_macro_reset(struct sl_pp_macro *macro); +enum sl_pp_macro_expand_behaviour { + sl_pp_macro_expand_normal, + sl_pp_macro_expand_mute, + sl_pp_macro_expand_unknown_to_0 +}; + int sl_pp_macro_expand(struct sl_pp_context *context, const struct sl_pp_token_info *input, unsigned int *pi, struct sl_pp_macro *local, struct sl_pp_process_state *state, - int mute); + enum sl_pp_macro_expand_behaviour behaviour); #endif /* SL_PP_MACRO_H */ diff --git a/src/glsl/pp/sl_pp_process.c b/src/glsl/pp/sl_pp_process.c index 4b783e40b4d..e2adc2a0215 100644 --- a/src/glsl/pp/sl_pp_process.c +++ b/src/glsl/pp/sl_pp_process.c @@ -257,7 +257,8 @@ sl_pp_process(struct sl_pp_context *context, break; case SL_PP_IDENTIFIER: - if (sl_pp_macro_expand(context, input, &i, NULL, &state, !context->if_value)) { + if (sl_pp_macro_expand(context, input, &i, NULL, &state, + context->if_value ? sl_pp_macro_expand_normal : sl_pp_macro_expand_mute)) { return -1; } break; -- cgit v1.2.3 From abe1f332983e5c70d75b5ae83f06c0dfdd081a26 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 21 Nov 2009 20:41:48 +0100 Subject: glsl/pp: Do purification and tokenisation in a single step. --- src/glsl/pp/sl_pp_context.c | 7 + src/glsl/pp/sl_pp_context.h | 11 +- src/glsl/pp/sl_pp_dict.c | 1 + src/glsl/pp/sl_pp_public.h | 4 + src/glsl/pp/sl_pp_token.c | 844 ++++++++++++++++++++++++++++---------------- src/glsl/pp/sl_pp_token.h | 1 + 6 files changed, 561 insertions(+), 307 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 8ce189d955c..134588d9066 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -46,6 +46,12 @@ sl_pp_context_create(void) return NULL; } + context->getc_buf = malloc(64 * sizeof(char)); + if (!context->getc_buf) { + sl_pp_context_destroy(context); + return NULL; + } + context->macro_tail = &context->macro; context->if_ptr = SL_PP_MAX_IF_NESTING; context->if_value = 1; @@ -62,6 +68,7 @@ sl_pp_context_destroy(struct sl_pp_context *context) if (context) { free(context->cstr_pool); sl_pp_macro_free(context->macro); + free(context->getc_buf); free(context); } } diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 6b8cc2f960d..569a2d735b9 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -30,6 +30,7 @@ #include "sl_pp_dict.h" #include "sl_pp_macro.h" +#include "sl_pp_purify.h" #define SL_PP_MAX_IF_NESTING 64 @@ -53,10 +54,12 @@ struct sl_pp_context { unsigned int line; unsigned int file; -}; -int -sl_pp_context_add_unique_str(struct sl_pp_context *context, - const char *str); + struct sl_pp_purify_state pure; + + char *getc_buf; + unsigned int getc_buf_size; + unsigned int getc_buf_capacity; +}; #endif /* SL_PP_CONTEXT_H */ diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index 82fb9127b50..2dd77a69e90 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -25,6 +25,7 @@ * **************************************************************************/ +#include "sl_pp_public.h" #include "sl_pp_context.h" #include "sl_pp_dict.h" diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h index b1d92d02a7a..8317c7e378a 100644 --- a/src/glsl/pp/sl_pp_public.h +++ b/src/glsl/pp/sl_pp_public.h @@ -45,6 +45,10 @@ sl_pp_context_destroy(struct sl_pp_context *context); const char * sl_pp_context_error_message(const struct sl_pp_context *context); +int +sl_pp_context_add_unique_str(struct sl_pp_context *context, + const char *str); + const char * sl_pp_context_cstr(const struct sl_pp_context *context, int offset); diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index f232dafc682..03f2f09cfd6 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -25,12 +25,106 @@ * **************************************************************************/ +#include #include #include +#include "sl_pp_public.h" #include "sl_pp_context.h" #include "sl_pp_token.h" +#define PURE_ERROR 256 + +int +_pure_getc(struct sl_pp_context *context) +{ + char c; + unsigned int current_line; + + if (context->getc_buf_size) { + return context->getc_buf[--context->getc_buf_size]; + } + + if (sl_pp_purify_getc(&context->pure, &c, ¤t_line, context->error_msg, sizeof(context->error_msg)) == 0) { + return PURE_ERROR; + } + return c; +} + + +void +_pure_ungetc(struct sl_pp_context *context, + int c) +{ + assert(c != PURE_ERROR); + + if (context->getc_buf_size == context->getc_buf_capacity) { + context->getc_buf_capacity += 64; + context->getc_buf = realloc(context->getc_buf, context->getc_buf_capacity * sizeof(char)); + assert(context->getc_buf); + } + + context->getc_buf[context->getc_buf_size++] = (char)c; +} + + +struct lookahead_state { + char buf[256]; + unsigned int pos; + struct sl_pp_context *context; +}; + + +static void +_lookahead_init(struct lookahead_state *lookahead, + struct sl_pp_context *context) +{ + lookahead->pos = 0; + lookahead->context = context; +} + + +static unsigned int +_lookahead_tell(const struct lookahead_state *lookahead) +{ + return lookahead->pos; +} + + +static const void * +_lookahead_buf(const struct lookahead_state *lookahead) +{ + return lookahead->buf; +} + + +static void +_lookahead_revert(struct lookahead_state *lookahead, + unsigned int pos) +{ + assert(pos <= lookahead->pos); + + while (lookahead->pos > pos) { + _pure_ungetc(lookahead->context, lookahead->buf[--lookahead->pos]); + } +} + + +static int +_lookahead_getc(struct lookahead_state *lookahead) +{ + int c; + + assert(lookahead->pos < sizeof(lookahead->buf) / sizeof(lookahead->buf[0])); + + c = _pure_getc(lookahead->context); + if (c != PURE_ERROR) { + lookahead->buf[lookahead->pos++] = (char)c; + } + return c; +} + + static int _is_identifier_char(char c) { @@ -40,32 +134,51 @@ _is_identifier_char(char c) static int _tokenise_identifier(struct sl_pp_context *context, - const char **pinput, - struct sl_pp_token_info *info) + struct sl_pp_token_info *out) { - const char *input = *pinput; + int c; char identifier[256]; /* XXX: Remove this artifical limit. */ unsigned int i = 0; - info->token = SL_PP_IDENTIFIER; - info->data.identifier = -1; + out->token = SL_PP_IDENTIFIER; + out->data.identifier = -1; - identifier[i++] = *input++; - while (_is_identifier_char(*input)) { - if (i >= sizeof(identifier) - 1) { - strcpy(context->error_msg, "out of memory"); + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + identifier[i++] = (char)c; + for (;;) { + c = _pure_getc(context); + if (c == PURE_ERROR) { return -1; } - identifier[i++] = *input++; + + if (_is_identifier_char((char)c)) { + if (i >= sizeof(identifier) / sizeof(char) - 1) { + strcpy(context->error_msg, "out of memory"); + _pure_ungetc(context, c); + while (i) { + _pure_ungetc(context, identifier[--i]); + } + return -1; + } + identifier[i++] = (char)c; + } else { + _pure_ungetc(context, c); + break; + } } - identifier[i++] = '\0'; + identifier[i] = '\0'; - info->data.identifier = sl_pp_context_add_unique_str(context, identifier); - if (info->data.identifier == -1) { + out->data.identifier = sl_pp_context_add_unique_str(context, identifier); + if (out->data.identifier == -1) { + while (i) { + _pure_ungetc(context, identifier[--i]); + } return -1; } - *pinput = input; return 0; } @@ -74,12 +187,18 @@ _tokenise_identifier(struct sl_pp_context *context, * Return the number of consecutive decimal digits in the input stream. */ static unsigned int -_parse_float_digits(const char *input) +_parse_float_digits(struct lookahead_state *lookahead) { - unsigned int eaten = 0; + unsigned int eaten; + + for (eaten = 0;; eaten++) { + unsigned int pos = _lookahead_tell(lookahead); + char c = _lookahead_getc(lookahead); - while (input[eaten] >= '0' && input[eaten] <= '9') { - eaten++; + if (c < '0' || c > '9') { + _lookahead_revert(lookahead, pos); + break; + } } return eaten; } @@ -96,29 +215,33 @@ _parse_float_digits(const char *input) * of eaten characters from the input stream. */ static unsigned int -_parse_float_frac(const char *input) +_parse_float_frac(struct lookahead_state *lookahead) { + unsigned int pos; + int c; unsigned int eaten; - if (input[0] == '.') { - eaten = _parse_float_digits(&input[1]); + pos = _lookahead_tell(lookahead); + c = _lookahead_getc(lookahead); + if (c == '.') { + eaten = _parse_float_digits(lookahead); if (eaten) { return eaten + 1; } + _lookahead_revert(lookahead, pos); return 0; } - eaten = _parse_float_digits(input); - if (eaten && input[eaten] == '.') { - unsigned int trailing; - - trailing = _parse_float_digits(&input[eaten + 1]); - if (trailing) { - return eaten + trailing + 1; + _lookahead_revert(lookahead, pos); + eaten = _parse_float_digits(lookahead); + if (eaten) { + c = _lookahead_getc(lookahead); + if (c == '.') { + return eaten + 1 + _parse_float_digits(lookahead); } - return eaten + 1; } + _lookahead_revert(lookahead, pos); return 0; } @@ -133,22 +256,31 @@ _parse_float_frac(const char *input) * of eaten characters from the input stream. */ static unsigned int -_parse_float_exp(const char *input) +_parse_float_exp(struct lookahead_state *lookahead) { + unsigned int pos, pos2; + int c; unsigned int eaten, digits; - if (input[0] != 'e' && input[0] != 'E') { + pos = _lookahead_tell(lookahead); + c = _lookahead_getc(lookahead); + if (c != 'e' && c != 'E') { + _lookahead_revert(lookahead, pos); return 0; } - if (input[1] == '-' || input[1] == '+') { + pos2 = _lookahead_tell(lookahead); + c = _lookahead_getc(lookahead); + if (c == '-' || c == '+') { eaten = 2; } else { + _lookahead_revert(lookahead, pos2); eaten = 1; } - digits = _parse_float_digits(&input[eaten]); + digits = _parse_float_digits(lookahead); if (!digits) { + _lookahead_revert(lookahead, pos); return 0; } @@ -166,86 +298,117 @@ _parse_float_exp(const char *input) * of eaten characters from the input stream. */ static unsigned int -_parse_float(const char *input) +_parse_float(struct lookahead_state *lookahead) { unsigned int eaten; - eaten = _parse_float_frac(input); + eaten = _parse_float_frac(lookahead); if (eaten) { - unsigned int exponent; + unsigned int pos; + int c; - exponent = _parse_float_exp(&input[eaten]); - if (exponent) { - eaten += exponent; - } + eaten += _parse_float_exp(lookahead); - if (input[eaten] == 'f' || input[eaten] == 'F') { + pos = _lookahead_tell(lookahead); + c = _lookahead_getc(lookahead); + if (c == 'f' || c == 'F') { eaten++; + } else { + _lookahead_revert(lookahead, pos); } return eaten; } - eaten = _parse_float_digits(input); + eaten = _parse_float_digits(lookahead); if (eaten) { unsigned int exponent; - exponent = _parse_float_exp(&input[eaten]); + exponent = _parse_float_exp(lookahead); if (exponent) { + unsigned int pos; + int c; + eaten += exponent; - if (input[eaten] == 'f' || input[eaten] == 'F') { + pos = _lookahead_tell(lookahead); + c = _lookahead_getc(lookahead); + if (c == 'f' || c == 'F') { eaten++; + } else { + _lookahead_revert(lookahead, pos); } return eaten; } } + _lookahead_revert(lookahead, 0); return 0; } static unsigned int -_parse_hex(const char *input) +_parse_hex(struct lookahead_state *lookahead) { + int c; unsigned int n; - if (input[0] != '0') { + c = _lookahead_getc(lookahead); + if (c != '0') { + _lookahead_revert(lookahead, 0); return 0; } - if (input[1] != 'x' && input[1] != 'X') { + c = _lookahead_getc(lookahead); + if (c != 'x' && c != 'X') { + _lookahead_revert(lookahead, 0); return 0; } - n = 2; - while ((input[n] >= '0' && input[n] <= '9') || - (input[n] >= 'a' && input[n] <= 'f') || - (input[n] >= 'A' && input[n] <= 'F')) { - n++; + for (n = 2;;) { + unsigned int pos = _lookahead_tell(lookahead); + + c = _lookahead_getc(lookahead); + if ((c >= '0' && c <= '9') || (c >= 'a' && c <= 'f') || (c >= 'A' && c <= 'F')) { + n++; + } else { + _lookahead_revert(lookahead, pos); + break; + } } if (n > 2) { return n; } + _lookahead_revert(lookahead, 0); return 0; } static unsigned int -_parse_oct(const char *input) +_parse_oct(struct lookahead_state *lookahead) { + int c; unsigned int n; - if (input[0] != '0') { + c = _lookahead_getc(lookahead); + if (c != '0') { + _lookahead_revert(lookahead, 0); return 0; } - n = 1; - while ((input[n] >= '0' && input[n] <= '7')) { - n++; + for (n = 1;;) { + unsigned int pos = _lookahead_tell(lookahead); + + c = _lookahead_getc(lookahead); + if ((c >= '0' && c <= '7')) { + n++; + } else { + _lookahead_revert(lookahead, pos); + break; + } } return n; @@ -253,12 +416,20 @@ _parse_oct(const char *input) static unsigned int -_parse_dec(const char *input) +_parse_dec(struct lookahead_state *lookahead) { unsigned int n = 0; - while ((input[n] >= '0' && input[n] <= '9')) { - n++; + for (;;) { + unsigned int pos = _lookahead_tell(lookahead); + int c = _lookahead_getc(lookahead); + + if ((c >= '0' && c <= '9')) { + n++; + } else { + _lookahead_revert(lookahead, pos); + break; + } } return n; @@ -267,327 +438,394 @@ _parse_dec(const char *input) static int _tokenise_number(struct sl_pp_context *context, - const char **pinput, - struct sl_pp_token_info *info) + struct sl_pp_token_info *out) { - const char *input = *pinput; + struct lookahead_state lookahead; unsigned int eaten; unsigned int is_float = 0; + unsigned int pos; + int c; char number[256]; /* XXX: Remove this artifical limit. */ - eaten = _parse_float(input); + _lookahead_init(&lookahead, context); + + eaten = _parse_float(&lookahead); if (!eaten) { - eaten = _parse_hex(input); + eaten = _parse_hex(&lookahead); if (!eaten) { - eaten = _parse_oct(input); + eaten = _parse_oct(&lookahead); if (!eaten) { - eaten = _parse_dec(input); + eaten = _parse_dec(&lookahead); } } } else { is_float = 1; } - if (!eaten || _is_identifier_char(input[eaten])) { + if (!eaten) { strcpy(context->error_msg, "expected a number"); return -1; } + pos = _lookahead_tell(&lookahead); + c = _lookahead_getc(&lookahead); + _lookahead_revert(&lookahead, pos); + + if (_is_identifier_char(c)) { + strcpy(context->error_msg, "expected a number"); + _lookahead_revert(&lookahead, 0); + return -1; + } + if (eaten > sizeof(number) - 1) { strcpy(context->error_msg, "out of memory"); + _lookahead_revert(&lookahead, 0); return -1; } - memcpy(number, input, eaten); + assert(_lookahead_tell(&lookahead) == eaten); + + memcpy(number, _lookahead_buf(&lookahead), eaten); number[eaten] = '\0'; if (is_float) { - info->token = SL_PP_FLOAT; - info->data._float = sl_pp_context_add_unique_str(context, number); - if (info->data._float == -1) { + out->token = SL_PP_FLOAT; + out->data._float = sl_pp_context_add_unique_str(context, number); + if (out->data._float == -1) { + _lookahead_revert(&lookahead, 0); return -1; } } else { - info->token = SL_PP_UINT; - info->data._uint = sl_pp_context_add_unique_str(context, number); - if (info->data._uint == -1) { + out->token = SL_PP_UINT; + out->data._uint = sl_pp_context_add_unique_str(context, number); + if (out->data._uint == -1) { + _lookahead_revert(&lookahead, 0); return -1; } } - *pinput = input + eaten; return 0; } int -sl_pp_tokenise(struct sl_pp_context *context, - const char *input, - struct sl_pp_token_info **output) +sl_pp_token_get(struct sl_pp_context *context, + struct sl_pp_token_info *out) { - struct sl_pp_token_info *out = NULL; - unsigned int out_len = 0; - unsigned int out_max = 0; + int c = _pure_getc(context); - for (;;) { - struct sl_pp_token_info info; + switch (c) { + case ' ': + case '\t': + out->token = SL_PP_WHITESPACE; + break; - switch (*input) { - case ' ': - case '\t': - input++; - info.token = SL_PP_WHITESPACE; - break; + case '\n': + out->token = SL_PP_NEWLINE; + break; - case '\n': - input++; - info.token = SL_PP_NEWLINE; - break; + case '#': + out->token = SL_PP_HASH; + break; - case '#': - input++; - info.token = SL_PP_HASH; - break; + case ',': + out->token = SL_PP_COMMA; + break; - case ',': - input++; - info.token = SL_PP_COMMA; - break; + case ';': + out->token = SL_PP_SEMICOLON; + break; - case ';': - input++; - info.token = SL_PP_SEMICOLON; - break; + case '{': + out->token = SL_PP_LBRACE; + break; - case '{': - input++; - info.token = SL_PP_LBRACE; - break; + case '}': + out->token = SL_PP_RBRACE; + break; - case '}': - input++; - info.token = SL_PP_RBRACE; - break; + case '(': + out->token = SL_PP_LPAREN; + break; - case '(': - input++; - info.token = SL_PP_LPAREN; - break; + case ')': + out->token = SL_PP_RPAREN; + break; - case ')': - input++; - info.token = SL_PP_RPAREN; - break; + case '[': + out->token = SL_PP_LBRACKET; + break; - case '[': - input++; - info.token = SL_PP_LBRACKET; - break; + case ']': + out->token = SL_PP_RBRACKET; + break; - case ']': - input++; - info.token = SL_PP_RBRACKET; - break; + case '.': + { + int c2 = _pure_getc(context); - case '.': - if (input[1] >= '0' && input[1] <= '9') { - if (_tokenise_number(context, &input, &info)) { - free(out); + if (c2 == PURE_ERROR) { + return -1; + } + if (c2 >= '0' && c2 <= '9') { + _pure_ungetc(context, c2); + _pure_ungetc(context, c); + if (_tokenise_number(context, out)) { return -1; } } else { - input++; - info.token = SL_PP_DOT; + _pure_ungetc(context, c2); + out->token = SL_PP_DOT; } - break; + } + break; - case '+': - input++; - if (*input == '+') { - input++; - info.token = SL_PP_INCREMENT; - } else if (*input == '=') { - input++; - info.token = SL_PP_ADDASSIGN; - } else { - info.token = SL_PP_PLUS; - } - break; + case '+': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '+') { + out->token = SL_PP_INCREMENT; + } else if (c == '=') { + out->token = SL_PP_ADDASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_PLUS; + } + break; - case '-': - input++; - if (*input == '-') { - input++; - info.token = SL_PP_DECREMENT; - } else if (*input == '=') { - input++; - info.token = SL_PP_SUBASSIGN; - } else { - info.token = SL_PP_MINUS; - } - break; + case '-': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '-') { + out->token = SL_PP_DECREMENT; + } else if (c == '=') { + out->token = SL_PP_SUBASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_MINUS; + } + break; - case '~': - input++; - info.token = SL_PP_BITNOT; - break; + case '~': + out->token = SL_PP_BITNOT; + break; - case '!': - input++; - if (*input == '=') { - input++; - info.token = SL_PP_NOTEQUAL; - } else { - info.token = SL_PP_NOT; - } - break; + case '!': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '=') { + out->token = SL_PP_NOTEQUAL; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_NOT; + } + break; - case '*': - input++; - if (*input == '=') { - input++; - info.token = SL_PP_MULASSIGN; - } else { - info.token = SL_PP_STAR; - } - break; + case '*': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '=') { + out->token = SL_PP_MULASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_STAR; + } + break; - case '/': - input++; - if (*input == '=') { - input++; - info.token = SL_PP_DIVASSIGN; - } else { - info.token = SL_PP_SLASH; - } - break; + case '/': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '=') { + out->token = SL_PP_DIVASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_SLASH; + } + break; - case '%': - input++; - if (*input == '=') { - input++; - info.token = SL_PP_MODASSIGN; - } else { - info.token = SL_PP_MODULO; - } - break; + case '%': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '=') { + out->token = SL_PP_MODASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_MODULO; + } + break; - case '<': - input++; - if (*input == '<') { - input++; - if (*input == '=') { - input++; - info.token = SL_PP_LSHIFTASSIGN; - } else { - info.token = SL_PP_LSHIFT; - } - } else if (*input == '=') { - input++; - info.token = SL_PP_LESSEQUAL; - } else { - info.token = SL_PP_LESS; + case '<': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '<') { + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; } - break; - - case '>': - input++; - if (*input == '>') { - input++; - if (*input == '=') { - input++; - info.token = SL_PP_RSHIFTASSIGN; - } else { - info.token = SL_PP_RSHIFT; - } - } else if (*input == '=') { - input++; - info.token = SL_PP_GREATEREQUAL; + if (c == '=') { + out->token = SL_PP_LSHIFTASSIGN; } else { - info.token = SL_PP_GREATER; + _pure_ungetc(context, c); + out->token = SL_PP_LSHIFT; } - break; + } else if (c == '=') { + out->token = SL_PP_LESSEQUAL; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_LESS; + } + break; - case '=': - input++; - if (*input == '=') { - input++; - info.token = SL_PP_EQUAL; - } else { - info.token = SL_PP_ASSIGN; + case '>': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '>') { + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; } - break; - - case '&': - input++; - if (*input == '&') { - input++; - info.token = SL_PP_AND; - } else if (*input == '=') { - input++; - info.token = SL_PP_BITANDASSIGN; + if (c == '=') { + out->token = SL_PP_RSHIFTASSIGN; } else { - info.token = SL_PP_BITAND; + _pure_ungetc(context, c); + out->token = SL_PP_RSHIFT; } - break; + } else if (c == '=') { + out->token = SL_PP_GREATEREQUAL; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_GREATER; + } + break; - case '^': - input++; - if (*input == '^') { - input++; - info.token = SL_PP_XOR; - } else if (*input == '=') { - input++; - info.token = SL_PP_BITXORASSIGN; - } else { - info.token = SL_PP_BITXOR; - } - break; + case '=': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '=') { + out->token = SL_PP_EQUAL; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_ASSIGN; + } + break; - case '|': - input++; - if (*input == '|') { - input++; - info.token = SL_PP_OR; - } else if (*input == '=') { - input++; - info.token = SL_PP_BITORASSIGN; - } else { - info.token = SL_PP_BITOR; - } - break; + case '&': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '&') { + out->token = SL_PP_AND; + } else if (c == '=') { + out->token = SL_PP_BITANDASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_BITAND; + } + break; - case '?': - input++; - info.token = SL_PP_QUESTION; - break; + case '^': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '^') { + out->token = SL_PP_XOR; + } else if (c == '=') { + out->token = SL_PP_BITXORASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_BITXOR; + } + break; - case ':': - input++; - info.token = SL_PP_COLON; - break; + case '|': + c = _pure_getc(context); + if (c == PURE_ERROR) { + return -1; + } + if (c == '|') { + out->token = SL_PP_OR; + } else if (c == '=') { + out->token = SL_PP_BITORASSIGN; + } else { + _pure_ungetc(context, c); + out->token = SL_PP_BITOR; + } + break; - case '\0': - info.token = SL_PP_EOF; - break; + case '?': + out->token = SL_PP_QUESTION; + break; - default: - if ((*input >= 'a' && *input <= 'z') || - (*input >= 'A' && *input <= 'Z') || - (*input == '_')) { - if (_tokenise_identifier(context, &input, &info)) { - free(out); - return -1; - } - } else if (*input >= '0' && *input <= '9') { - if (_tokenise_number(context, &input, &info)) { - free(out); - return -1; - } - } else { - info.data.other = *input++; - info.token = SL_PP_OTHER; + case ':': + out->token = SL_PP_COLON; + break; + + case '\0': + out->token = SL_PP_EOF; + break; + + case PURE_ERROR: + return -1; + + default: + if ((c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || c == '_') { + _pure_ungetc(context, c); + if (_tokenise_identifier(context, out)) { + return -1; } + } else if (c >= '0' && c <= '9') { + _pure_ungetc(context, c); + if (_tokenise_number(context, out)) { + return -1; + } + } else { + out->data.other = c; + out->token = SL_PP_OTHER; + } + } + + return 0; +} + + +int +sl_pp_tokenise(struct sl_pp_context *context, + const char *input, + const struct sl_pp_purify_options *options, + struct sl_pp_token_info **output) +{ + struct sl_pp_token_info *out = NULL; + unsigned int out_len = 0; + unsigned int out_max = 0; + + sl_pp_purify_state_init(&context->pure, input, options); + + for (;;) { + struct sl_pp_token_info info; + + if (sl_pp_token_get(context, &info)) { + free(out); + return -1; } if (out_len >= out_max) { diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 29c7571711e..7a8fa2f1b9d 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -123,6 +123,7 @@ struct sl_pp_token_info { int sl_pp_tokenise(struct sl_pp_context *context, const char *input, + const struct sl_pp_purify_options *options, struct sl_pp_token_info **output); #endif /* SL_PP_TOKEN_H */ -- cgit v1.2.3 From 1cf021475a6628cdf4c26457bc7ca0c603fe2c7c Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 21 Nov 2009 20:43:02 +0100 Subject: slang: No need to purify source text for tokeniser. --- src/mesa/shader/slang/slang_compile.c | 14 ++------------ 1 file changed, 2 insertions(+), 12 deletions(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 44c889734b6..f2342bfdcbe 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2592,34 +2592,24 @@ compile_with_grammar(const char *source, unsigned int maxVersion; int result; struct sl_pp_purify_options options; - char *outbuf; char errmsg[200] = ""; unsigned int errline = 0; struct sl_pp_token_info *intokens; unsigned int tokens_eaten; - memset(&options, 0, sizeof(options)); - if (sl_pp_purify(source, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { - slang_info_log_error(infolog, errmsg); - return GL_FALSE; - } - context = sl_pp_context_create(); if (!context) { slang_info_log_error(infolog, "out of memory"); - free(outbuf); return GL_FALSE; } - if (sl_pp_tokenise(context, outbuf, &intokens)) { + memset(&options, 0, sizeof(options)); + if (sl_pp_tokenise(context, &options, source, &intokens)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(outbuf); return GL_FALSE; } - free(outbuf); - if (sl_pp_version(context, intokens, &version, &tokens_eaten)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); -- cgit v1.2.3 From 6199a0cf89034ab92ac61158a25902acc17604f4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 21 Nov 2009 20:44:16 +0100 Subject: glsl/apps: No need to purify source text for tokeniser. --- src/glsl/apps/compile.c | 19 ++++--------------- src/glsl/apps/process.c | 19 ++++--------------- src/glsl/apps/tokenise.c | 19 ++++--------------- src/glsl/apps/version.c | 19 ++++--------------- 4 files changed, 16 insertions(+), 60 deletions(-) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index edc426528bd..d16dac58681 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -41,7 +41,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char *outbuf; char errmsg[100] = ""; unsigned int errline = 0; struct sl_pp_context *context; @@ -105,35 +104,25 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { - fprintf(out, "$PURIFYERROR %s\n", errmsg); - - free(inbuf); - fclose(out); - return 1; - } - - free(inbuf); - context = sl_pp_context_create(); if (!context) { fprintf(out, "$CONTEXERROR\n"); - free(outbuf); + free(inbuf); fclose(out); return 1; } - if (sl_pp_tokenise(context, outbuf, &tokens)) { + if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(outbuf); + free(inbuf); fclose(out); return 1; } - free(outbuf); + free(inbuf); if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 7f392613e09..2cec9a99719 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -40,7 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char *outbuf; char errmsg[100] = ""; unsigned int errline = 0; struct sl_pp_context *context; @@ -93,35 +92,25 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { - fprintf(out, "$PURIFYERROR %s\n", errmsg); - - free(inbuf); - fclose(out); - return 1; - } - - free(inbuf); - context = sl_pp_context_create(); if (!context) { fprintf(out, "$CONTEXERROR\n"); - free(outbuf); + free(inbuf); fclose(out); return 1; } - if (sl_pp_tokenise(context, outbuf, &tokens)) { + if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(outbuf); + free(inbuf); fclose(out); return 1; } - free(outbuf); + free(inbuf); if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index 9dd9631a4ed..eb86e3df69e 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -40,7 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char *outbuf; char errmsg[100] = ""; unsigned int errline = 0; struct sl_pp_context *context; @@ -90,35 +89,25 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { - fprintf(out, "$PURIFYERROR %s\n", errmsg); - - free(inbuf); - fclose(out); - return 1; - } - - free(inbuf); - context = sl_pp_context_create(); if (!context) { fprintf(out, "$CONTEXERROR\n"); - free(outbuf); + free(inbuf); fclose(out); return 1; } - if (sl_pp_tokenise(context, outbuf, &tokens)) { + if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(outbuf); + free(inbuf); fclose(out); return 1; } - free(outbuf); + free(inbuf); for (i = 0; tokens[i].token != SL_PP_EOF; i++) { switch (tokens[i].token) { diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index 1127dae5161..b1d0d6ff282 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -40,7 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char *outbuf; char errmsg[100] = ""; unsigned int errline = 0; struct sl_pp_context *context; @@ -91,35 +90,25 @@ main(int argc, memset(&options, 0, sizeof(options)); - if (sl_pp_purify(inbuf, &options, &outbuf, errmsg, sizeof(errmsg), &errline)) { - fprintf(out, "$PURIFYERROR %s\n", errmsg); - - free(inbuf); - fclose(out); - return 1; - } - - free(inbuf); - context = sl_pp_context_create(); if (!context) { fprintf(out, "$CONTEXERROR\n"); - free(outbuf); + free(inbuf); fclose(out); return 1; } - if (sl_pp_tokenise(context, outbuf, &tokens)) { + if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); - free(outbuf); + free(inbuf); fclose(out); return 1; } - free(outbuf); + free(inbuf); if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); -- cgit v1.2.3 From 03f0ebe3bd202b955a0e68bdad65a9a2d27bee2f Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 23 Nov 2009 20:12:17 +0100 Subject: slang: Fix order of parameters to sl_pp_tokenise(). --- src/mesa/shader/slang/slang_compile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index f2342bfdcbe..a194f2fc9e6 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2604,7 +2604,7 @@ compile_with_grammar(const char *source, } memset(&options, 0, sizeof(options)); - if (sl_pp_tokenise(context, &options, source, &intokens)) { + if (sl_pp_tokenise(context, source, &options, &intokens)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); return GL_FALSE; -- cgit v1.2.3 From 3371f7e5025e5288eaba78973a2c81ec5d5b1e4d Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 25 Nov 2009 14:52:21 +0100 Subject: scons: Autogenerate GLSL builtin library *_gc.h from *.gc files. --- src/SConscript | 2 +- src/glsl/apps/SConscript | 3 ++- src/mesa/SConscript | 4 ++- src/mesa/shader/slang/library/SConscript | 44 ++++++++++++++++++++++++++++++++ 4 files changed, 50 insertions(+), 3 deletions(-) create mode 100644 src/mesa/shader/slang/library/SConscript diff --git a/src/SConscript b/src/SConscript index 0fe0798b395..f7fac33790b 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,9 +1,9 @@ Import('*') -SConscript('gallium/SConscript') SConscript('glsl/pp/SConscript') SConscript('glsl/cl/SConscript') SConscript('glsl/apps/SConscript') +SConscript('gallium/SConscript') if 'mesa' in env['statetrackers']: SConscript('mesa/SConscript') diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript index 4a89e3f1dfe..4c81b3be956 100644 --- a/src/glsl/apps/SConscript +++ b/src/glsl/apps/SConscript @@ -29,7 +29,8 @@ env.Program( source = ['process.c'], ) -env.Program( +glsl_compile = env.Program( target = 'compile', source = ['compile.c'], ) +Export('glsl_compile') diff --git a/src/mesa/SConscript b/src/mesa/SConscript index dde9bb08a99..d5a9031f402 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -335,7 +335,9 @@ if env['platform'] != 'winddk': # Add the dir containing the generated header (somewhere inside the # build dir) to the include path env.Append(CPPPATH = [matypes[0].dir]) - + + SConscript('shader/slang/library/SConscript') + # # Libraries # diff --git a/src/mesa/shader/slang/library/SConscript b/src/mesa/shader/slang/library/SConscript new file mode 100644 index 00000000000..8b3fd03b6bc --- /dev/null +++ b/src/mesa/shader/slang/library/SConscript @@ -0,0 +1,44 @@ +####################################################################### +# SConscript for GLSL builtin library + +Import('*') + +env = env.Clone() + +bld_frag = Builder( + action = glsl_compile[0].abspath + ' fragment $SOURCE $TARGET', + suffix = '.gc', + src_suffix = '_gc.h') + +bld_vert = Builder( + action = glsl_compile[0].abspath + ' vertex $SOURCE $TARGET', + suffix = '.gc', + src_suffix = '_gc.h') + +env['BUILDERS']['bld_frag'] = bld_frag +env['BUILDERS']['bld_vert'] = bld_vert + +# Generate GLSL builtin library binaries +env.bld_frag( + '#src/mesa/shader/slang/library/slang_core_gc.h', + '#src/mesa/shader/slang/library/slang_core.gc') +env.bld_frag( + '#src/mesa/shader/slang/library/slang_common_builtin_gc.h', + '#src/mesa/shader/slang/library/slang_common_builtin.gc') +env.bld_frag( + '#src/mesa/shader/slang/library/slang_fragment_builtin_gc.h', + '#src/mesa/shader/slang/library/slang_fragment_builtin.gc') +env.bld_vert( + '#src/mesa/shader/slang/library/slang_vertex_builtin_gc.h', + '#src/mesa/shader/slang/library/slang_vertex_builtin.gc') + +# Generate GLSL 1.20 builtin library binaries +env.bld_frag( + '#src/mesa/shader/slang/library/slang_120_core_gc.h', + '#src/mesa/shader/slang/library/slang_120_core.gc') +env.bld_frag( + '#src/mesa/shader/slang/library/slang_builtin_120_common_gc.h', + '#src/mesa/shader/slang/library/slang_builtin_120_common.gc') +env.bld_frag( + '#src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h', + '#src/mesa/shader/slang/library/slang_builtin_120_fragment.gc') -- cgit v1.2.3 From ee27b713dc6a2d32dc287dc9462359804e051a06 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 25 Nov 2009 14:53:37 +0100 Subject: slang/library: Don't need the *_gc.h files, they are autogenerated now. --- src/mesa/shader/slang/library/slang_120_core_gc.h | 759 ------------------ .../slang/library/slang_builtin_120_common_gc.h | 107 --- .../slang/library/slang_builtin_120_fragment_gc.h | 5 - .../shader/slang/library/slang_common_builtin_gc.h | 873 --------------------- src/mesa/shader/slang/library/slang_core_gc.h | 865 -------------------- .../slang/library/slang_fragment_builtin_gc.h | 110 --- .../shader/slang/library/slang_vertex_builtin_gc.h | 109 --- 7 files changed, 2828 deletions(-) delete mode 100644 src/mesa/shader/slang/library/slang_120_core_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_builtin_120_common_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_common_builtin_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_core_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_fragment_builtin_gc.h delete mode 100644 src/mesa/shader/slang/library/slang_vertex_builtin_gc.h diff --git a/src/mesa/shader/slang/library/slang_120_core_gc.h b/src/mesa/shader/slang/library/slang_120_core_gc.h deleted file mode 100644 index 76c77631ea5..00000000000 --- a/src/mesa/shader/slang/library/slang_120_core_gc.h +++ /dev/null @@ -1,759 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_120_core.gc */ - -5,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0, -1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0, -18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,9,0,102,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1, -48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,5, -0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -11,0,99,48,0,0,1,1,0,0,11,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,99,48, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0, -0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0, -1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51, -49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,1,48,0,57,59,122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119, -0,18,102,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,59,119,0,18,102,51,49,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17, -1,48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0, -0,28,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0, -0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0, -0,28,0,1,1,1,0,0,1,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0, -0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0, -28,0,1,1,1,0,0,12,0,99,48,0,0,1,1,0,0,12,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1,90,95, -0,0,27,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9, -0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0, -18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,5,0,105,0,0,0,1, -3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,1,0,98,0,0,0,1, -3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,10,0,99,48,0,0,1, -1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, -0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,51,48,0,0,1,1,0,0,9,0,102,48,49,0,0, -1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,51,49,0,0,1,1,0,0,9,0,102,48, -50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,50,50,0,0,1,1,0,0,9,0,102,51,50,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59, -122,0,18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119,0,18,102,51,48,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,119,0, -18,102,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0, -57,59,119,0,18,102,51,50,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48, -46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1, -48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2, -90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,1,0,98,0,0,0,1,3, -2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,52,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,12,0,99,48,0,0,1, -1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, -99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0, -0,9,0,102,49,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1,0,0,9,0,102,48,50,0,0, -1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0, -18,102,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,50,0,57,59,121,0,18,102,49,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, -57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,121,0,18,102,49, -51,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,16,1,52,0,0,17,1,48,46,48,0,0, -17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,5,0,105, -0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,1,0,98, -0,0,0,1,3,2,90,95,1,0,9,0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,10,0,99, -48,0,0,1,1,0,0,10,0,99,49,0,0,1,1,0,0,10,0,99,50,0,0,1,1,0,0,10,0,99,51,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,48,48,0,0,1,1,0,0,9, -0,102,49,48,0,0,1,1,0,0,9,0,102,50,48,0,0,1,1,0,0,9,0,102,48,49,0,0,1,1,0,0,9,0,102,49,49,0,0,1,1, -0,0,9,0,102,50,49,0,0,1,1,0,0,9,0,102,48,50,0,0,1,1,0,0,9,0,102,49,50,0,0,1,1,0,0,9,0,102,50,50,0, -0,1,1,0,0,9,0,102,48,51,0,0,1,1,0,0,9,0,102,49,51,0,0,1,1,0,0,9,0,102,50,51,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,102,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,59,121,0,18,102,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0, -18,102,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,102,48,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,49,49,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,59,122,0,18,102,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0, -57,59,120,0,18,102,48,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,102,49, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,102,50,50,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,51,0,57,59,120,0,18,102,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,1,51,0,57,59,121,0,18,102,49,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,122, -0,18,102,50,51,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,52,120,51,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0, -18,102,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,18,102,0,0,17,1,48,46,48,0,0,17,1, -48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,5,0,105,0,0,0,1,3,2,90,95,1,0,9, -0,1,102,0,2,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,1,0,98,0,0,0,1,3,2,90,95,1,0,9, -0,1,102,0,2,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,52,120,51,0,0,18,102,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,11,0,99,48,0,0,1,1,0,0,11,0,99,49, -0,0,1,1,0,0,11,0,99,50,0,0,1,1,0,0,11,0,99,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0, -57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57, -18,99,51,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,109,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58, -109,97,116,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57, -0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59, -120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0, -20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90, -95,0,0,13,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18, -109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1, -1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48, -0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,15,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120, -121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,26,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,14,0,109,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1, -49,0,57,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0, -26,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18, -109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0, -0,26,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, -18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, -0,0,26,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, -18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, -0,0,26,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0, -18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1, -49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1, -1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0, -16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57, -59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,26,0,1,1,1,0,0, -29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0, -57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0, -18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,28,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,30,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0, -16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95, -0,0,28,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0, -18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0, -17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1, -49,0,57,59,122,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0, -16,1,48,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57, -59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,122,0,0,17,1,48,46,48,0,0,0, -20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97, -116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1, -48,0,57,59,122,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121, -0,0,18,109,0,16,1,49,0,57,59,122,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,13,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57, -59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0, -57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90, -95,0,0,28,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,50,120,52, -0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48,46, -48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48,46,48,0,0,17,1,48, -46,48,0,0,0,20,0,0,1,90,95,0,0,28,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,17,1, -48,46,48,0,0,17,1,48,46,48,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0, -17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57, -0,18,109,0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109, -0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0, -0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,120,0, -0,18,109,0,16,1,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1, -48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1, -50,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,121,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,15,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120, -0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121, -0,0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49, -0,57,0,58,118,101,99,50,0,0,17,1,48,46,48,0,0,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,26,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0, -0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0, -0,17,1,48,46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,27,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0, -16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,121,0,0,17,1,48, -46,48,0,0,17,1,48,46,48,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0,16,1, -50,0,57,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122, -0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,15,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0, -18,109,0,16,1,49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,0,20,0,0,1,90,95, -0,0,14,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109, -0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1, -90,95,0,0,14,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0, -18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,17,1,48,46,0,0, -17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0, -57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,29, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,0,17,1, -48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,0,20,0,0,1, -90,95,0,0,14,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,0,0, -18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1, -48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0, -16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0, -17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,31,0,109, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17, -1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,0,20,0,0, -1,90,95,0,0,30,0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51, -120,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49, -46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0, -57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0, -0,30,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0, -18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1, -48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0, -0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48, -0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109, -0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,30,0,1,1,1,0,0,13,0,109,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48, -46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48, -46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0, -16,1,49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0,18,109,0,16,1,51,0,57,59,120,121, -0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109, -97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,18, -109,0,16,1,50,0,57,59,120,121,0,0,18,109,0,16,1,51,0,57,59,120,121,0,0,0,20,0,0,1,90,95,0,0,29,0,1, -1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0, -16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1, -1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16, -1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0, -17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1, -49,0,57,59,120,121,0,0,18,109,0,16,1,50,0,57,59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0, -1,90,95,0,0,29,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52, -120,50,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48, -46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57, -59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,29, -0,1,1,1,0,0,28,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,50,0,0,18,109, -0,16,1,48,0,57,59,120,121,0,0,18,109,0,16,1,49,0,57,59,120,121,0,0,17,1,48,46,0,0,17,1,48,46,0,0, -17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120,121,122,0,0,18,109,0,16,1, -49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,18,109,0,16,1,51,0,57,59,120, -121,122,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18,109,0,16,1,50,0, -57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,30,0,109,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120, -121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,18,109,0,16,1,50,0,57,59,120,121,122,0,0,17,1, -48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0, -18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,18,109,0,16,1,51,0, -57,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0, -0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0, -31,0,1,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18, -109,0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0, -17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,28, -0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57, -59,120,121,122,0,0,18,109,0,16,1,49,0,57,59,120,121,122,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49, -46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,31,0,1,1,1,0,0,13,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,0,17,1, -48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1, -48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,15,0,109,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,30,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16,1,49,0,57,0,18, -109,0,16,1,50,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95, -0,0,15,0,1,1,1,0,0,31,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109, -0,16,1,48,0,57,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17, -1,48,46,0,0,18,109,0,16,1,51,0,57,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,28,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,18,109,0,16, -1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46, -0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,29,0,109,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0, -18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,49,46,0,0,17,1, -48,46,0,0,18,109,0,16,1,51,0,57,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0, -0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0, -17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,18,109,0,16,1,50,0,57,0,17,1,48,46,0,0,17,1, -48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,26,0, -109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1, -48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1, -48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1, -1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,109,97,116,52,0,0,18,109,0,16,1,48, -0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109, -0,16,1,50,0,57,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1, -49,46,0,0,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,0,17,1,48,46,0,0,17,1,48,46,0,0,18,109,0,16,1,49,0,57,0, -17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,17,1,48,46,0,0,17,1,48, -46,0,0,17,1,48,46,0,0,17,1,48,46,0,0,17,1,49,46,0,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109, -0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49, -0,57,18,110,0,16,1,49,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0, -1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57, -21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57, -18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,21,0,9,18,109,0,16,1,50,0, -57,18,110,0,16,1,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1, -9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57, -21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0, -1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0, -57,18,110,0,16,1,49,0,57,21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,9,18,109,0,16,1, -51,0,57,18,110,0,16,1,51,0,57,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,21,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, -57,21,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,21,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1, -51,0,57,21,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1, -48,0,57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,0,1,90,95,0, -0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, -57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,27,0,109, -0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49, -0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,22,0,0,1,90,95,0,0,0, -0,2,2,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57, -22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, -57,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0, -57,18,110,0,16,1,48,0,57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1, -50,0,57,18,110,0,16,1,50,0,57,22,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,22,0,0,1,90,95,0, -0,0,0,2,2,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, -57,22,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,22,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1, -50,0,57,22,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,22,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,26,0, -109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16, -1,49,0,57,18,110,0,16,1,49,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,28,0,110,0, -0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49, -0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,109,0,16,1,48,0, -57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,24,0,9,18,109,0,16,1, -50,0,57,18,110,0,16,1,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, -57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,29,0,109, -0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49, -0,57,18,110,0,16,1,49,0,57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,9,18,109,0,16,1, -51,0,57,18,110,0,16,1,51,0,57,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,24,0,9,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, -57,24,0,9,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,24,0,9,18,109,0,16,1,51,0,57,18,110,0,16,1, -51,0,57,24,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0, -18,109,0,16,1,49,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,118,0,59, -120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,121,0,48,46,20, -0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48, -18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,28,0, -109,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18, -109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0, -59,121,0,18,109,0,16,1,49,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18, -118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0, -48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59, -119,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,119,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0, -0,27,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59, -120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,18, -118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, -0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59, -121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1, -1,0,0,30,0,109,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,118,0, -59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46, -18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57, -59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109, -0,16,1,49,0,57,59,122,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,122,0,48,46,20,0,9,18,95, -95,114,101,116,86,97,108,0,59,119,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,119,0,48,18,118,0, -59,121,0,18,109,0,16,1,49,0,57,59,119,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,119,0,48, -46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118,0,59,121,0,18, -109,0,16,1,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0,48,46,18,118,0, -59,119,0,18,109,0,16,1,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18, -118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,121,0, -48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18,109,0,16,1,51,0, -57,59,121,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,120,0,48,18,118, -0,59,121,0,18,109,0,16,1,49,0,57,59,120,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,120,0, -48,46,18,118,0,59,119,0,18,109,0,16,1,51,0,57,59,120,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,18,118,0,59,120,0,18,109,0,16,1,48,0,57,59,121,0,48,18,118,0,59,121,0,18,109,0,16,1,49, -0,57,59,121,0,48,46,18,118,0,59,122,0,18,109,0,16,1,50,0,57,59,121,0,48,46,18,118,0,59,119,0,18, -109,0,16,1,51,0,57,59,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,118,0,59,120, -0,18,109,0,16,1,48,0,57,59,122,0,48,18,118,0,59,121,0,18,109,0,16,1,49,0,57,59,122,0,48,46,18,118, -0,59,122,0,18,109,0,16,1,50,0,57,59,122,0,48,46,18,118,0,59,119,0,18,109,0,16,1,51,0,57,59,122,0, -48,46,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,13,0,109,0,0,1,1, -0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2, -21,1,1,0,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, -110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,26, -0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, -0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0, -0,28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, -109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,27,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2, -21,1,1,0,0,28,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, -110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, -50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48, -20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1, -1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0, -0,29,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, -109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18, -110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1, -51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,14, -0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, -0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0, -0,28,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, -109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,30,0,109,0,0,1,1,0,0,14,0,110, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,15,0,2, -21,1,1,0,0,30,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, -110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, -50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1,51,0,57,48, -20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,29,0,109,0,0,1, -1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0, -0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, -109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18, -110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18,110,0,16,1, -51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0,31, -0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110, -0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1,50,0,57,48,20,0, -0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, -109,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,18, -110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,30,0,2, -21,1,1,0,0,15,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,109,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,18, -110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,18,110,0,16,1, -50,0,57,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,26,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,18, -109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18, -109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109,0,0,1,1,0,0,14,0,110,0,0,0, -1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,14,0,110, -0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,15, -0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1, -0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,10,0,118, -0,0,1,1,0,0,27,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118, -0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0, -18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111, -116,0,0,18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,10,0,118,0,0,1,1, -0,0,29,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18, -109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118, -0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0, -18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111, -116,0,0,18,118,0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,11,0,118,0,0,1,1, -0,0,26,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18, -109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118, -0,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,31,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0, -57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16, -1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18, -109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,100,111,116,0,0,18,118, -0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,28,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0, -57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16, -1,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,30,0,109,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,50,0, -57,0,0,20,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0, -57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,28,0,109,0,0,1, -1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,0,1, -90,95,0,0,0,0,2,1,1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0, -9,18,109,0,16,1,49,0,57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1, -0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49, -0,57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0,2,0,29,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0,57,18,97,0,21,0,9, -18,109,0,16,1,50,0,57,18,97,0,21,0,9,18,109,0,16,1,51,0,57,18,97,0,21,0,0,1,90,95,0,0,0,0,2,1,1,0, -2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,21,0,9,18,109,0,16,1,49,0, -57,18,97,0,21,0,9,18,109,0,16,1,50,0,57,18,97,0,21,0,9,18,109,0,16,1,51,0,57,18,97,0,21,0,0,1,90, -95,0,0,0,0,2,2,1,0,2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9, -18,109,0,16,1,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0, -1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2, -1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1, -49,0,57,18,97,0,22,0,9,18,109,0,16,1,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,30,0,109,0, -0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0, -9,18,109,0,16,1,50,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,9,18,109,0,16,1,50,0, -57,18,97,0,22,0,9,18,109,0,16,1,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,2,1,0,2,0,31,0,109,0,0,1, -1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,22,0,9,18,109,0,16,1,49,0,57,18,97,0,22,0,9, -18,109,0,16,1,50,0,57,18,97,0,22,0,9,18,109,0,16,1,51,0,57,18,97,0,22,0,0,1,90,95,0,0,0,0,2,3,1,0, -2,0,26,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0, -57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, -48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,27,0,109,0, -0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0, -9,18,109,0,16,1,50,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0, -57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, -48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0,57,18,97,0,23,0,9, -18,109,0,16,1,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,3,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0, -1,9,18,109,0,16,1,48,0,57,18,97,0,23,0,9,18,109,0,16,1,49,0,57,18,97,0,23,0,9,18,109,0,16,1,50,0, -57,18,97,0,23,0,9,18,109,0,16,1,51,0,57,18,97,0,23,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,26,0,109,0,0,1, -1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,0,1, -90,95,0,0,0,0,2,4,1,0,2,0,28,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0, -9,18,109,0,16,1,49,0,57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,27,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0, -57,18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,30,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1, -48,0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,0,1, -90,95,0,0,0,0,2,4,1,0,2,0,29,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48,0,57,18,97,0,24,0, -9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,9,18,109,0,16,1,51,0,57, -18,97,0,24,0,0,1,90,95,0,0,0,0,2,4,1,0,2,0,31,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,109,0,16,1,48, -0,57,18,97,0,24,0,9,18,109,0,16,1,49,0,57,18,97,0,24,0,9,18,109,0,16,1,50,0,57,18,97,0,24,0,9,18, -109,0,16,1,51,0,57,18,97,0,24,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0, -0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109,0,16,1, -49,0,57,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0, -110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109, -0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0,109,0,0,1,1,0,0, -27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18, -109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,0,0,0, -0,1,90,95,0,0,30,0,2,26,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0, -0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46, -0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,29,0,109,0, -0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, -57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, -57,46,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,31,0, -109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1, -48,0,57,46,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,0,18,109,0,16,1,50,0,57,18,110,0,16,1, -50,0,57,46,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, -26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0, -16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1, -0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18, -110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2, -27,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0, -57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0,16,1,50,0, -57,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,30,0,110,0, -0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1, -49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95, -0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0, -16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18,109,0, -16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,0,0,0,0,1, -90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18, -109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,0,18, -109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,0,0,0, -0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0, -0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49, -0,0,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120, -52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, -57,49,0,0,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116, -51,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1, -49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,0,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0, -30,0,109,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0, -16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0, -16,1,50,0,57,49,0,0,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,29,0,110,0,0,0,1,8,58, -109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0,57,18, -110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,18,109,0,16,1,51,0,57,18, -110,0,16,1,51,0,57,49,0,0,0,0,1,90,95,0,0,31,0,2,22,1,1,0,0,31,0,109,0,0,1,1,0,0,31,0,110,0,0,0,1, -8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,0,18,109,0,16,1,49,0, -57,18,110,0,16,1,49,0,57,49,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,0,18,109,0,16,1,51,0, -57,18,110,0,16,1,51,0,57,49,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0, -0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57, -46,0,0,0,0,1,90,95,0,0,26,0,2,26,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50, -120,51,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0, -28,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,97,0,18,110, -0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0,0,0,0,1,90,95,0,0,28,0,2,26,1,1,0,0,28,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18, -109,0,16,1,49,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0, -0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0, -57,46,0,18,97,0,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,27,0,2,26,1,1,0,0,27,0,109,0,0,1,1,0, -0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,98,0,46,0,18,109,0,16,1,49, -0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0,0,9,0,97,0, -0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97, -0,18,110,0,16,1,49,0,57,46,0,18,97,0,18,110,0,16,1,50,0,57,46,0,0,0,0,1,90,95,0,0,30,0,2,26,1,1,0, -0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,18,98,0, -46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0, -2,26,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0, -57,18,98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,18,109,0,16, -1,51,0,57,18,98,0,46,0,0,0,0,1,90,95,0,0,29,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,8, -58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0, -18,97,0,18,110,0,16,1,50,0,57,46,0,18,97,0,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,31,0,2,26, -1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18, -98,0,46,0,18,109,0,16,1,49,0,57,18,98,0,46,0,18,109,0,16,1,50,0,57,18,98,0,46,0,18,109,0,16,1,51,0, -57,18,98,0,46,0,0,0,0,1,90,95,0,0,31,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,8,58,109, -97,116,52,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,46,0,18,97,0,18,110,0,16,1,49,0,57,46,0,18,97,0, -18,110,0,16,1,50,0,57,46,0,18,97,0,18,110,0,16,1,51,0,57,46,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0, -9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,47, -0,18,97,0,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0, -98,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57, -18,98,0,47,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,8,58,109,97, -116,50,120,52,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97,0,18,110,0,16,1,49,0,57,47,0,0,0,0,1,90, -95,0,0,28,0,2,27,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109, -0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,27,0,2,27,1,1,0,0, -9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,47, -0,18,97,0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,0,0,0,1,90,95,0,0,27,0,2, -27,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57, -18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18,98,0,47,0,0,0,0,1,90,95,0, -0,30,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,97,0,18, -110,0,16,1,48,0,57,47,0,18,97,0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,0,0, -0,1,90,95,0,0,30,0,2,27,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,51,120,52,0,0, -18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18,98, -0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52, -120,50,0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50, -0,57,18,98,0,47,0,18,109,0,16,1,51,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,9,0,97,0, -0,1,1,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97, -0,18,110,0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,18,97,0,18,110,0,16,1,51,0,57,47,0, -0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,8,58,109,97,116,52,120,51, -0,0,18,109,0,16,1,48,0,57,18,98,0,47,0,18,109,0,16,1,49,0,57,18,98,0,47,0,18,109,0,16,1,50,0,57,18, -98,0,47,0,18,109,0,16,1,51,0,57,18,98,0,47,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0, -0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,97,0,18,110,0,16,1,48,0,57,47,0,18,97,0,18,110, -0,16,1,49,0,57,47,0,18,97,0,18,110,0,16,1,50,0,57,47,0,18,97,0,18,110,0,16,1,51,0,57,47,0,0,0,0,1, -90,95,0,0,26,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, -18,97,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,26,0,2,21,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,28, -0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,28,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18, -110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,28,0,2,21,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,27,0,2,21,1,1, -0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18, -110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1, -49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48, -20,0,0,1,90,95,0,0,27,0,2,21,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, -109,0,16,1,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,30,0,110,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,30,0,2,21,1,1,0,0, -30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, -48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, -98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,48,20,0, -0,1,90,95,0,0,29,0,2,21,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, -109,0,16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1, -51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,29,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0,29,0,110,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0,31,0,109,0,0,1,1,0, -0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,48,20,0,0,1,90,95,0,0,31,0,2,21,1,1,0,0, -9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110, -0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0, -26,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,26,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49, -46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0, -16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16, -1,49,0,57,48,20,0,0,1,90,95,0,0,26,0,2,22,1,1,0,0,26,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1, -0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48, -0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, -57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,28,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, -0,28,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,0,1,90,95,0,0,28,0, -2,22,1,1,0,0,28,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48, -0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110, -118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118, -0,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,27,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1, -105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, -105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105, -110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110, -118,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90,95,0,0,27,0,2,22,1,1,0,0,27,0,109,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,30,0,2,22,1,1,0,0,9,0, -97,0,0,1,1,0,0,30,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18,110,0,16,1,50,0,57,48,20,0,0,1,90, -95,0,0,30,0,2,22,1,1,0,0,30,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2, -17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0, -57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57, -18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18, -105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,29,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, -95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50, -0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, -57,18,109,0,16,1,51,0,57,18,105,110,118,0,48,20,0,0,1,90,95,0,0,29,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, -0,29,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0,18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18,110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,51,0,57,18,105,110,118,0,18,110,0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,31,0,2,22,1, -1,0,0,31,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118,0,2,17,1,49,46,48,0,18, -98,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,105,110,118,0, -48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,105,110,118,0,48, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,105,110,118,0,48,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,105,110,118,0,48,20,0,0, -1,90,95,0,0,31,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,31,0,110,0,0,0,1,3,2,90,95,1,0,9,0,1,105,110,118, -0,2,17,1,49,46,48,0,18,97,0,49,0,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,105,110,118, -0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,105,110,118,0, -18,110,0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,105,110,118,0,18, -110,0,16,1,50,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,105,110,118,0,18,110, -0,16,1,51,0,57,48,20,0,0,1,90,95,0,0,26,0,2,27,1,1,0,0,26,0,109,0,0,0,1,8,58,109,97,116,50,120,51, -0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,0,0,0,1,90,95,0,0,28,0,2,27,1,1,0,0,28,0, -109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,0, -0,0,1,90,95,0,0,27,0,2,27,1,1,0,0,27,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48, -0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0,0,0,0,1,90,95,0,0,30,0,2,27,1,1,0, -0,30,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57, -54,0,18,109,0,16,1,50,0,57,54,0,0,0,0,1,90,95,0,0,29,0,2,27,1,1,0,0,29,0,109,0,0,0,1,8,58,109,97, -116,52,120,50,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0, -18,109,0,16,1,51,0,57,54,0,0,0,0,1,90,95,0,0,31,0,2,27,1,1,0,0,31,0,109,0,0,0,1,8,58,109,97,116,52, -120,51,0,0,18,109,0,16,1,48,0,57,54,0,18,109,0,16,1,49,0,57,54,0,18,109,0,16,1,50,0,57,54,0,18,109, -0,16,1,51,0,57,54,0,0,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,26,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52, -0,9,18,109,0,16,1,49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,28,0,109,0,0,0,1,9,18,109,0,16,1,48, -0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,27,0,109,0,0,0,1,9,18,109,0, -16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0,16,1,50,0,57,52,0,0,1,90,95,0,0,0,0,2,25, -1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0,16,1, -50,0,57,52,0,0,1,90,95,0,0,0,0,2,25,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109, -0,16,1,49,0,57,52,0,9,18,109,0,16,1,50,0,57,52,0,9,18,109,0,16,1,51,0,57,52,0,0,1,90,95,0,0,0,0,2, -25,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,52,0,9,18,109,0,16,1,49,0,57,52,0,9,18,109,0, -16,1,50,0,57,52,0,9,18,109,0,16,1,51,0,57,52,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,26,0,109,0,0,0,1,9, -18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,28,0,109,0, -0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,27, -0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51, -0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,30,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16,1,49, -0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,29,0,109,0,0,0,1,9,18,109,0, -16,1,48,0,57,51,0,9,18,109,0,16,1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,9,18,109,0,16,1,51,0, -57,51,0,0,1,90,95,0,0,0,0,2,24,1,0,2,0,31,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,51,0,9,18,109,0,16, -1,49,0,57,51,0,9,18,109,0,16,1,50,0,57,51,0,9,18,109,0,16,1,51,0,57,51,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h b/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h deleted file mode 100644 index 28d7df68f9a..00000000000 --- a/src/mesa/shader/slang/library/slang_builtin_120_common_gc.h +++ /dev/null @@ -1,107 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_builtin_120_common.gc */ - -5,1,90,95,0,0,26,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,26,0,109,0,0,1, -0,0,0,26,0,110,0,0,0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57, -48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,0,0,0,1,90,95,0,0,28,0,0,109,97,116,114,105, -120,67,111,109,112,77,117,108,116,0,1,0,0,0,28,0,109,0,0,1,0,0,0,28,0,110,0,0,0,1,8,58,109,97,116, -50,120,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1, -49,0,57,48,0,0,0,0,1,90,95,0,0,27,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0, -0,27,0,109,0,0,1,0,0,0,27,0,110,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,18,110, -0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110, -0,16,1,50,0,57,48,0,0,0,0,1,90,95,0,0,30,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116, -0,1,0,0,0,30,0,109,0,0,1,0,0,0,30,0,110,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0, -57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0, -57,18,110,0,16,1,50,0,57,48,0,0,0,0,1,90,95,0,0,29,0,0,109,97,116,114,105,120,67,111,109,112,77, -117,108,116,0,1,0,0,0,29,0,109,0,0,1,0,0,0,29,0,110,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0, -16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0, -16,1,50,0,57,18,110,0,16,1,50,0,57,48,0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1, -90,95,0,0,31,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,31,0,109,0,0,1,0,0, -0,31,0,110,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0, -18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48,0, -18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1,90,95,0,0,13,0,0,111,117,116,101,114,80, -114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109,97,116,50,0,0,18,99, -0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114, -0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,14,0,0,111,117,116,101, -114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,0, -0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0, -18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0, -48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59, -121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,15,0,0,111, -117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109, -97,116,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18, -99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18, -114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48, -0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0, -18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0, -48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59, -122,0,18,114,0,59,119,0,48,0,18,99,0,59,119,0,18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,26,0,0,111, -117,116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109, -97,116,50,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48, -0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, -18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,27,0,0,111,117, -116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97, -116,51,120,50,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, -18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0, -18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,28,0,0,111,117, -116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,12,0,99,0,0,1,0,0,0,10,0,114,0,0,0,1,8,58,109,97, -116,50,120,52,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, -18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0, -18,114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0, -48,0,18,99,0,59,119,0,18,114,0,59,121,0,48,0,0,0,0,1,90,95,0,0,29,0,0,111,117,116,101,114,80,114, -111,100,117,99,116,0,1,0,0,0,10,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18, -99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18, -114,0,59,121,0,48,0,18,99,0,59,121,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0,48, -0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0, -18,114,0,59,119,0,48,0,0,0,0,1,90,95,0,0,30,0,0,111,117,116,101,114,80,114,111,100,117,99,116,0,1, -0,0,0,12,0,99,0,0,1,0,0,0,11,0,114,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,99,0,59,120,0,18,114,0, -59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0,18,99,0,59,122,0,18,114,0,59,120,0,48,0,18, -99,0,59,119,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0,18, -114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,119,0,18,114,0,59,121,0,48, -0,18,99,0,59,120,0,18,114,0,59,122,0,48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0, -18,114,0,59,122,0,48,0,18,99,0,59,119,0,18,114,0,59,122,0,48,0,0,0,0,1,90,95,0,0,31,0,0,111,117, -116,101,114,80,114,111,100,117,99,116,0,1,0,0,0,11,0,99,0,0,1,0,0,0,12,0,114,0,0,0,1,8,58,109,97, -116,52,120,51,0,0,18,99,0,59,120,0,18,114,0,59,120,0,48,0,18,99,0,59,121,0,18,114,0,59,120,0,48,0, -18,99,0,59,122,0,18,114,0,59,120,0,48,0,18,99,0,59,120,0,18,114,0,59,121,0,48,0,18,99,0,59,121,0, -18,114,0,59,121,0,48,0,18,99,0,59,122,0,18,114,0,59,121,0,48,0,18,99,0,59,120,0,18,114,0,59,122,0, -48,0,18,99,0,59,121,0,18,114,0,59,122,0,48,0,18,99,0,59,122,0,18,114,0,59,122,0,48,0,18,99,0,59, -120,0,18,114,0,59,119,0,48,0,18,99,0,59,121,0,18,114,0,59,119,0,48,0,18,99,0,59,122,0,18,114,0,59, -119,0,48,0,0,0,0,1,90,95,0,0,13,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,13,0,109,0,0,0,1, -8,58,109,97,116,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0, -16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,0,0,0,1,90,95,0,0,14,0,0,116,114,97,110, -115,112,111,115,101,0,1,0,0,0,14,0,109,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,59,120, -0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121, -0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122, -0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,0,0,0,1,90,95,0,0,15,0,0,116, -114,97,110,115,112,111,115,101,0,1,0,0,0,15,0,109,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,1,48, -0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51, -0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50, -0,57,59,121,0,0,18,109,0,16,1,51,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49, -0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,18,109,0,16,1,51,0,57,59,122,0,0,18,109,0,16,1,48, -0,57,59,119,0,0,18,109,0,16,1,49,0,57,59,119,0,0,18,109,0,16,1,50,0,57,59,119,0,0,18,109,0,16,1,51, -0,57,59,119,0,0,0,0,0,1,90,95,0,0,26,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0,0,27,0,109,0,0, -0,1,8,58,109,97,116,50,120,51,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49,0,57,59,120,0, -0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0, -0,18,109,0,16,1,50,0,57,59,121,0,0,0,0,0,1,90,95,0,0,27,0,0,116,114,97,110,115,112,111,115,101,0,1, -0,0,0,26,0,109,0,0,0,1,8,58,109,97,116,51,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16, -1,49,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16, -1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,0,0,0,1,90,95,0,0,28,0,0,116,114,97,110,115, -112,111,115,101,0,1,0,0,0,29,0,109,0,0,0,1,8,58,109,97,116,50,120,52,0,0,18,109,0,16,1,48,0,57,59, -120,0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51,0,57,59, -120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59, -121,0,0,18,109,0,16,1,51,0,57,59,121,0,0,0,0,0,1,90,95,0,0,29,0,0,116,114,97,110,115,112,111,115, -101,0,1,0,0,0,28,0,109,0,0,0,1,8,58,109,97,116,52,120,50,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18, -109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18, -109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,48,0,57,59,119,0,0,18, -109,0,16,1,49,0,57,59,119,0,0,0,0,0,1,90,95,0,0,30,0,0,116,114,97,110,115,112,111,115,101,0,1,0,0, -0,31,0,109,0,0,0,1,8,58,109,97,116,51,120,52,0,0,18,109,0,16,1,48,0,57,59,120,0,0,18,109,0,16,1,49, -0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,51,0,57,59,120,0,0,18,109,0,16,1,48, -0,57,59,121,0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,51, -0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122,0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50, -0,57,59,122,0,0,18,109,0,16,1,51,0,57,59,122,0,0,0,0,0,1,90,95,0,0,31,0,0,116,114,97,110,115,112, -111,115,101,0,1,0,0,0,30,0,109,0,0,0,1,8,58,109,97,116,52,120,51,0,0,18,109,0,16,1,48,0,57,59,120, -0,0,18,109,0,16,1,49,0,57,59,120,0,0,18,109,0,16,1,50,0,57,59,120,0,0,18,109,0,16,1,48,0,57,59,121, -0,0,18,109,0,16,1,49,0,57,59,121,0,0,18,109,0,16,1,50,0,57,59,121,0,0,18,109,0,16,1,48,0,57,59,122, -0,0,18,109,0,16,1,49,0,57,59,122,0,0,18,109,0,16,1,50,0,57,59,122,0,0,18,109,0,16,1,48,0,57,59,119, -0,0,18,109,0,16,1,49,0,57,59,119,0,0,18,109,0,16,1,50,0,57,59,119,0,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h b/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h deleted file mode 100644 index add3b5aeaa9..00000000000 --- a/src/mesa/shader/slang/library/slang_builtin_120_fragment_gc.h +++ /dev/null @@ -1,5 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_builtin_120_fragment.gc */ - -5,2,2,90,95,3,0,10,0,1,103,108,95,80,111,105,110,116,67,111,111,114,100,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h deleted file mode 100644 index b474fe2d62c..00000000000 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ /dev/null @@ -1,873 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_common_builtin.gc */ - -5,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,1,56,0,0,0,2,2,90,95,1,0, -5,0,1,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,1,54,0,0,0,2,2,90,95,1,0,5, -0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,1,56,0,0,0,2,2,90,95, -1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,1,56,0,0,0, -2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2,16,1, -49,54,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,85,110,105,102,111,114, -109,67,111,109,112,111,110,101,110,116,115,0,2,16,1,53,49,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95, -77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,115,0,2,16,1,51,50,0,0,0,2,2,90,95,1,0,5,0,1, -103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110, -105,116,115,0,2,16,1,48,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,67,111,109,98,105,110,101, -100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,1,50,0,0,0,2,2,90,95,1, -0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2, -16,1,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116,85,110,105, -102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,1,54,52,0,0,0,2,2,90,95,1,0,5,0,1, -103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,1,49,0,0,0,2,2,90,95,4,0,15,0, -1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1, -103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1, -103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114, -105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,0,3, -18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,14,0, -1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77, -111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114, -115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101, -99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103, -108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,15,0,1,103,108, -95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0,0, -2,2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114, -97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119, -80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112,111,115,101,0,0, -0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,84,114,97,110, -115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115, -0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73, -110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,80, -114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110, -115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114, -111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115, -112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, -120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84, -101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,9,0,1,103,108,95,78,111,114,109, -97,108,83,99,97,108,101,0,0,0,2,2,90,95,0,0,24,103,108,95,68,101,112,116,104,82,97,110,103,101,80, -97,114,97,109,101,116,101,114,115,0,9,0,110,101,97,114,0,0,0,1,9,0,102,97,114,0,0,0,1,9,0,100,105, -102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,68,101,112,116,104,82,97,110,103,101,80,97,114, -97,109,101,116,101,114,115,0,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101,0,0,0,2,2,90,95,4, -0,12,0,1,103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120,67,108,105,112,80, -108,97,110,101,115,0,0,0,2,2,90,95,0,0,24,103,108,95,80,111,105,110,116,80,97,114,97,109,101,116, -101,114,115,0,9,0,115,105,122,101,0,0,0,1,9,0,115,105,122,101,77,105,110,0,0,0,1,9,0,115,105,122, -101,77,97,120,0,0,0,1,9,0,102,97,100,101,84,104,114,101,115,104,111,108,100,83,105,122,101,0,0,0,1, -9,0,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105, -111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,76,105,110,101,97,114,65,116,116,101,110,117,97, -116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,81,117,97,100,114,97,116,105,99,65,116, -116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,80,111,105,110,116,80, -97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,80,111,105,110,116,0,0,0,2,2,90,95,0,0,24,103, -108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,0,101,109,105,115, -115,105,111,110,0,0,0,1,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102,102,117,115,101,0, -0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,9,0,115,104,105,110,105,110,101,115,115,0,0,0,0,0, -0,0,2,2,90,95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115, -0,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,90,95,4,0,25,103,108,95, -77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,66,97,99,107,77, -97,116,101,114,105,97,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,83,111,117,114,99, -101,80,97,114,97,109,101,116,101,114,115,0,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102, -102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,12,0,112,111,115,105,116,105, -111,110,0,0,0,1,12,0,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,0,115,112,111,116,68,105,114, -101,99,116,105,111,110,0,0,0,1,9,0,115,112,111,116,67,111,115,67,117,116,111,102,102,0,0,0,1,9,0, -99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,108,105,110, -101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,113,117,97,100,114,97,116,105,99, -65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,115,112,111,116,69,120,112,111,110,101,110, -116,0,0,0,1,9,0,115,112,111,116,67,117,116,111,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95, -76,105,103,104,116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76, -105,103,104,116,83,111,117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116,115,0,0,0,2,2, -90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115, -0,12,0,97,109,98,105,101,110,116,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,77, -111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76,105,103,104,116,77,111, -100,101,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100, -117,99,116,115,0,12,0,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108, -95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103,108,95,70,114,111, -110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,90,95,4,0,25,103, -108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103,108,95,66,97, -99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2,2,90,95,0,0,24,103, -108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,0,97,109,98,105,101,110,116,0,0,0,1, -12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,0,0,0,0,2,2,90, -95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1,103,108,95,70,114,111, -110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120,76,105,103,104, -116,115,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1, -103,108,95,66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120, -76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,84,101,120,116,117,114,101,69,110,118, -67,111,108,111,114,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110, -105,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,83,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108, -95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111, -111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,82,0,3,18,103, -108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103, -108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67, -111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101, -83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4, -0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101, -120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99, -116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100, -115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,0,0,24,103,108,95, -70,111,103,80,97,114,97,109,101,116,101,114,115,0,12,0,99,111,108,111,114,0,0,0,1,9,0,100,101,110, -115,105,116,121,0,0,0,1,9,0,115,116,97,114,116,0,0,0,1,9,0,101,110,100,0,0,0,1,9,0,115,99,97,108, -101,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,0, -1,103,108,95,70,111,103,0,0,0,1,90,95,0,0,9,0,0,114,97,100,105,97,110,115,0,1,1,0,0,9,0,100,101, -103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100, -101,103,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,114,97,100,105,97,110,115,0,1,1,0,0,10,0,100,101,103, -0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49,0,0, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, -0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,114,97,100,105,97, -110,115,0,1,1,0,0,11,0,100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50, -54,0,17,1,49,56,48,46,48,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59,120,120, -120,0,0,0,0,1,90,95,0,0,12,0,0,114,97,100,105,97,110,115,0,1,1,0,0,12,0,100,101,103,0,0,0,1,3,2,90, -95,1,0,9,0,1,99,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,49,56,48,46,48,0,49,0,0,4,118,101,99,52, -95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0,0,18,99,0, -59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,100,101,103,114,101,101,115,0,1,1,0,0,9,0,114,97,100, -0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97, -100,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,100,101,103,114,101,101,115,0,1,1,0,0,10,0,114,97,100,0,0, -0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0,4, -118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,100,101,103,114,101, -101,115,0,1,1,0,0,11,0,114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51, -46,49,52,49,53,57,50,54,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120,120,120,0, -0,0,0,1,90,95,0,0,12,0,0,100,101,103,114,101,101,115,0,1,1,0,0,12,0,114,97,100,0,0,0,1,3,2,90,95,1, -0,9,0,1,99,0,2,17,1,49,56,48,46,48,0,17,1,51,46,49,52,49,53,57,50,54,0,49,0,0,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99,0,59, -120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,115,105,110,0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0, -0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105, -97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,115,105,110,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1, -4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97, -100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,115,105, -110,0,1,1,0,0,11,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111, -97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110, -115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,115,105,110,0,1,1,0,0,12, -0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0, -4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,97, -100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,99,111,115, -0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,99,111, -115,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110, -101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4, -102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114, -97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,99,111,115,0,1,1,0,0,11,0,114,97,100,105, -97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108, -0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115,105, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0, -4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, -114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,99,111,115,0,1,1,0,0,12,0,114,97,100, -105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9, -0,0,116,97,110,0,1,1,0,0,9,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,115,105,110, -0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,9,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108, -101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,10,0,0,116,97,110,0,1,1,0,0,10,0,97,110,103, -108,101,0,0,0,1,3,2,90,95,1,0,10,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3, -2,90,95,1,0,10,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49, -0,0,1,90,95,0,0,11,0,0,116,97,110,0,1,1,0,0,11,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,11,0,1, -115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,11,0,1,99,0,2,58,99,111, -115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,12,0,0,116,97,110,0, -1,1,0,0,12,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,12,0,1,115,0,2,58,115,105,110,0,0,18,97,110, -103,108,101,0,0,0,0,0,3,2,90,95,1,0,12,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0, -0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,9,0,0,97,115,105,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1, -0,9,0,1,97,48,0,2,17,1,49,46,53,55,48,55,50,56,56,0,0,0,3,2,90,95,1,0,9,0,1,97,49,0,2,17,1,48,46, -50,49,50,49,49,52,52,0,54,0,0,3,2,90,95,1,0,9,0,1,97,50,0,2,17,1,48,46,48,55,52,50,54,49,48,0,0,0, -3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1,48,46,53,0,48, -0,0,3,2,90,95,1,0,9,0,1,121,0,2,58,97,98,115,0,0,18,120,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,0,17,1,49,46,48,0,18,121,0,47,0,0,18,97,48,0,18, -121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58,115,105,103,110,0,0,18,120,0,0,0,48,20,0, -0,1,90,95,0,0,10,0,0,97,115,105,110,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,115,105,110,0,1,1,0, -0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0, -20,0,0,1,90,95,0,0,12,0,0,97,115,105,110,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, -58,97,115,105,110,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,99,111,115,0,1,1,0,0,9,0, -120,0,0,0,1,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,1,51,46,49,52,49,53,57,50,54,0,17,1, -48,46,53,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,97,115,105,110, -0,0,18,120,0,0,0,47,20,0,0,1,90,95,0,0,10,0,0,97,99,111,115,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0, -97,99,111,115,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111, -115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0, -0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18, -118,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,99,111,115,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,119,0,58,97,99,111,115,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97, -110,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,0,18,120,0,58, -105,110,118,101,114,115,101,115,113,114,116,0,0,18,120,0,18,120,0,48,17,1,49,46,48,0,46,0,0,48,0,0, -20,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118, -101,114,95,120,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,121,95,111, -118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121, -95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97, -116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0,1,90,95, -0,0,12,0,0,97,116,97,110,0,1,1,0,0,12,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120, -0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111, -118,101,114,95,120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97, -110,0,0,18,121,95,111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1, -1,0,0,9,0,121,0,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,10,58,97,98,115,0,0,18,120, -0,0,0,17,1,49,46,48,101,45,52,0,41,0,2,9,18,114,0,58,97,116,97,110,0,0,18,121,0,18,120,0,49,0,0,20, -0,10,18,120,0,17,1,48,46,48,0,40,0,2,9,18,114,0,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,1, -51,46,49,52,49,53,57,51,0,48,46,20,0,0,9,14,0,0,2,9,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0, -17,1,49,46,53,55,48,55,57,54,53,0,48,20,0,0,8,18,114,0,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1, -0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97, -110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97, -110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1, -90,95,0,0,12,0,0,97,116,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18, -118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,117,0, -59,119,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,112,111,119,0,1,1,0,0,9,0,97,0,0,1,1,0,0, -9,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,112,111,119,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1, -4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, -59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,112,111,119,0, -1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95, -114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59, -121,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0, -0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,112,111,119,0,1,1,0,0,12,0,97,0,0,1, -1,0,0,12,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108, -0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, -18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18, -98,0,59,122,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, -59,119,0,0,18,97,0,59,119,0,0,18,98,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,101,120,112,0,1,1,0,0,9,0, -97,0,0,0,1,3,2,90,95,0,0,9,0,1,116,0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102, -108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,90,95,0,0, -10,0,0,101,120,112,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,18,97,0,17,1,49,46,52,52, -50,54,57,53,48,50,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108, -0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, -86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,0,1,1,0,0,11,0,97,0, -0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102,108, -111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4, -102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121, -0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116, -0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101,120,112,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,116, -0,2,18,97,0,17,1,49,46,52,52,50,54,57,53,48,50,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95, -101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,4,102,108,111, -97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1, -90,95,0,0,9,0,0,108,111,103,50,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0, -18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,108,111,103,50,0,1,1,0,0,10,0, -118,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,108,111,103,50,0,1,1,0,0,11,0,118,0,0,0,1,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0, -0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59, -121,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18, -118,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,108,111,103,50,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0, -0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, -122,0,0,0,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18, -118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,108,111,103,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1,0,9,0,1, -99,0,2,17,1,48,46,54,57,51,49,52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,120,0,0,0,18,99,0,48, -0,0,1,90,95,0,0,10,0,0,108,111,103,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48, -46,54,57,51,49,52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0, -0,11,0,0,108,111,103,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48,46,54,57,51,49, -52,55,49,56,49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,12,0,0,108, -111,103,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,1,48,46,54,57,51,49,52,55,49,56, -49,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,9,0,0,101,120,112,50,0,1, -1,0,0,9,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0, -18,97,0,0,0,0,1,90,95,0,0,10,0,0,101,120,112,50,0,1,1,0,0,10,0,97,0,0,0,1,4,102,108,111,97,116,95, -101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97, -116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,90,95, -0,0,11,0,0,101,120,112,50,0,1,1,0,0,11,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101, -120,112,50,0,1,1,0,0,12,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114, -116,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18, -114,0,0,0,0,1,90,95,0,0,10,0,0,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114, -0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,4,102,108,111,97,116,95, -114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,0,1,90,95,0,0,11,0,0,115,113,114,116,0,1,1,0,0,11,0, -118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118, -0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95, -114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12, -0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18, -118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0, -0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,121,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,0,0,0,4,102,108,111, -97,116,95,114,115,113,0,18,114,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -95,95,114,101,116,86,97,108,0,59,122,0,0,18,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114, -0,0,18,118,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -119,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0, -120,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -120,0,0,0,0,1,90,95,0,0,10,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0, -0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118, -0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118, -0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0, -59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0, -0,18,118,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0, -12,0,118,0,0,0,1,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0, -18,118,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59, -121,0,0,18,118,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108, -0,59,122,0,0,18,118,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86, -97,108,0,59,119,0,0,18,118,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0, -1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,17,1,49,46,48,0,20,0,0,1,90,95,0,0,10,0, -0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105, -110,118,101,114,115,101,115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4, -118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,118,0,0,18,115,0,0,0,0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118, -0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0, -18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122, -101,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111, -116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109, -112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0, -1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, -0,0,1,90,95,0,0,10,0,0,97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0, -97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -97,0,0,0,0,1,90,95,0,0,12,0,0,97,98,115,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,115,105,103,110,0,1,1,0,0,9,0, -120,0,0,0,1,3,2,90,95,0,0,9,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0, -18,120,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,1,48,46,48,0,0,18, -120,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18, -112,0,0,18,110,0,0,0,0,1,90,95,0,0,10,0,0,115,105,103,110,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0, -10,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0, -17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,1,48,46,48,0,0,18, -118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,11,0,0,115,105,103,110,0,1,1,0,0,11,0,118,0,0,0, -1,3,2,90,95,0,0,11,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121, -122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0, -0,17,1,48,46,48,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,12,0,0,115,105,103, -110,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115, -103,116,0,18,112,0,0,18,118,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17, -1,48,46,48,0,0,18,118,0,0,0,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, -86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0,0,9,0,0,102,108,111,111,114,0,1,1,0,0,9,0,97,0,0, -0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90, -95,0,0,10,0,0,102,108,111,111,114,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,108,111,111, -114,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,0,0,102,108,111,111,114,0,1,1,0,0,12,0,97,0, -0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1, -90,95,0,0,9,0,0,99,101,105,108,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,9,0,1,98,0,2,18,97,0,54,0,0, -4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, -18,98,0,54,20,0,0,1,90,95,0,0,10,0,0,99,101,105,108,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1, -98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,98,0,54,20,0,0,1,90,95,0,0,11,0,0,99,101,105,108,0,1,1,0,0, -11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114, -0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,90, -95,0,0,12,0,0,99,101,105,108,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,98,0,2,18,97,0,54,0,0, -4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0, -18,98,0,54,20,0,0,1,90,95,0,0,9,0,0,102,114,97,99,116,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95, -102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,114,97,99, -116,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,114,97,99,116,0,1,1,0,0,11,0,97,0,0,0,1,4,118, -101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1, -90,95,0,0,12,0,0,102,114,97,99,116,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18, -95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,109,111,100,0,1,1,0,0,9,0,97,0,0,1, -1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48, -47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0, -0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, -118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58, -102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0, -11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79, -118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18, -98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111, -114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111, -100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66, -0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18, -95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79, -118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0, -10,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118, -101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0, -98,0,0,0,1,3,2,90,95,0,0,11,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118, -101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0, -98,0,0,0,1,3,2,90,95,0,0,12,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99, -112,0,18,111,110,101,79,118,101,114,66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18, -95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79, -118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,9,0,0,109,105,110,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9, -0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0, -0,0,0,1,90,95,0,0,10,0,0,109,105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52, -95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59, -120,121,0,0,0,0,1,90,95,0,0,11,0,0,109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118, -101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121, -122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0, -0,12,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,10,0,0,109,105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101, -99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1, -90,95,0,0,11,0,0,109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109, -105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0, -12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,109,97,120,0,1,1,0,0, -9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0, -0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120, -121,0,0,18,98,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11, -0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0, -12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0, -0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18, -98,0,0,0,0,1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99, -52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1, -90,95,0,0,12,0,0,109,97,120,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97, -120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,99,108,97,109, -112,0,1,1,0,0,9,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86, -97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97, -108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97, -109,112,0,1,1,0,0,10,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120, -86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108, -97,109,112,0,1,1,0,0,11,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97, -120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18, -118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99, -108,97,109,112,0,1,1,0,0,12,0,118,97,108,0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109, -97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0, -18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0, -99,108,97,109,112,0,1,1,0,0,10,0,118,97,108,0,0,1,1,0,0,10,0,109,105,110,86,97,108,0,0,1,1,0,0,10, -0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0, -11,0,0,99,108,97,109,112,0,1,1,0,0,11,0,118,97,108,0,0,1,1,0,0,11,0,109,105,110,86,97,108,0,0,1,1, -0,0,11,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116, -86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90, -95,0,0,12,0,0,99,108,97,109,112,0,1,1,0,0,12,0,118,97,108,0,0,1,1,0,0,12,0,109,105,110,86,97,108,0, -0,1,1,0,0,12,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114, -101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0, -0,1,90,95,0,0,9,0,0,109,105,120,0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4, -118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, -0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,9,0,97,0,0, -0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18, -120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,9,0, -97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0, -0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0, -0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0, -1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97, -0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0, -121,0,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0, -0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0, -0,12,0,121,0,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,115,116,101,112,0,1,1,0,0,9,0,101, -100,103,101,0,0,1,1,0,0,9,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86, -97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,10,0, -101,100,103,101,0,0,1,1,0,0,10,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101, -112,0,1,1,0,0,11,0,101,100,103,101,0,0,1,1,0,0,11,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95, -0,0,12,0,0,115,116,101,112,0,1,1,0,0,12,0,101,100,103,101,0,0,1,1,0,0,12,0,120,0,0,0,1,4,118,101, -99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1, -90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118, -101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100, -103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,11,0, -118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103, -101,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0, -0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,9,0,0,115,109,111,111,116,104,115,116,101,112, -0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,9,0,120,0,0,0,1,3, -2,90,95,0,0,9,0,1,116,0,2,58,99,108,97,109,112,0,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100, -103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0, -18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111, -111,116,104,115,116,101,112,0,1,1,0,0,10,0,101,100,103,101,48,0,0,1,1,0,0,10,0,101,100,103,101,49, -0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101, -100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1, -49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1, -90,95,0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,11,0,101,100,103,101,48,0,0,1,1, -0,0,11,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97, -109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47, -49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46, -48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,12, -0,101,100,103,101,48,0,0,1,1,0,0,12,0,101,100,103,101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0, -0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101, -49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0, -48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111,111,116, -104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0, -0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103, -101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46, -48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95, -0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9, -0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97,109, -112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49, -0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1,51,46,48,0,17,1,50,46,48,0, -18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101, -100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0, -1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, -101,100,103,101,48,0,47,49,0,17,1,48,46,48,0,0,17,1,49,46,48,0,0,0,0,0,8,18,116,0,18,116,0,48,17,1, -51,46,48,0,17,1,50,46,48,0,18,116,0,48,47,48,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0, -0,9,0,120,0,0,0,1,8,58,97,98,115,0,0,18,120,0,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0, -1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116, -0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,0,0,0,0,1,90, -95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2, -90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114, -115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97, -108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90, -95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101, -0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,18,120,0,18,121,0,47,0,0, -9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,0,0,0,20,0,0,1,90,95,0,0, -9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,1,0, -10,0,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103, -116,104,0,0,18,100,50,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,11,0, -118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,1,0,11,0,1,100,51,0,2,18,118,0,18,117,0,47,0,0,9,18,95, -95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,51,0,0,0,20,0,0,1,90,95,0,0,9,0,0, -100,105,115,116,97,110,99,101,0,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,3,2,90,95,1,0,12,0,1, -100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104, -0,0,18,100,52,0,0,0,20,0,0,1,90,95,0,0,11,0,0,99,114,111,115,115,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11, -0,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,9,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1, -0,0,9,0,78,0,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2, -58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101, -99,52,95,115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0, -18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,10,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0, -10,0,78,0,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58, -100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99, -52,95,115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18, -78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,11,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0,11,0, -78,0,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100, -111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95, -115,103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0, -0,18,115,0,0,0,0,0,1,90,95,0,0,12,0,0,102,97,99,101,102,111,114,119,97,114,100,0,1,1,0,0,12,0,78,0, -0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,114,101,102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111, -116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115, -103,116,0,18,115,0,0,17,1,48,46,48,0,0,18,100,0,0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18, -115,0,0,0,0,0,1,90,95,0,0,9,0,0,114,101,102,108,101,99,116,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0, -0,1,8,18,73,0,17,1,50,46,48,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90, -95,0,0,10,0,0,114,101,102,108,101,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,0,1,8,18,73,0, -17,1,50,46,48,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,11,0,0, -114,101,102,108,101,99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0,0,0,1,8,18,73,0,17,1,50,46,48,0, -58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,12,0,0,114,101,102,108, -101,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,0,1,8,18,73,0,17,1,50,46,48,0,58,100,111,116, -0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,9,0,0,114,101,102,114,97,99,116,0,1,1,0, -0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111, -116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46, -48,0,18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95, -100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,9,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0, -17,1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,17,1,48,46,48,0,20,0,9,18,114,101,116,118,97, -108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114, -116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,10,0,0, -114,101,102,114,97,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1, -3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2, -90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0,18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110, -95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,10,0,1,114, -101,116,118,97,108,0,0,0,10,18,107,0,17,1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101, -99,50,0,0,17,1,48,46,48,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101, -116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20, -0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,11,0,0,114,101,102,114,97,99,116,0,1,1,0,0,11,0,73, -0,0,1,1,0,0,11,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95, -105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0, -18,101,116,97,0,18,101,116,97,0,48,17,1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95,100, -111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,11,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17, -1,48,46,48,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101,99,51,0,0,17,1,48,46,48,0,0,0,20,0,9,18, -114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0, -48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1, -90,95,0,0,12,0,0,114,101,102,114,97,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,1,1,0,0,9,0, -101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0, -18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,1,49,46,48,0,18,101,116,97,0,18,101,116,97,0,48,17, -1,49,46,48,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90, -95,0,0,12,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,1,48,46,48,0,40,0,9,18,114,101,116,118, -97,108,0,58,118,101,99,52,0,0,17,1,48,46,48,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97, -0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0, -46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,13,0,0,109,97,116,114,105,120, -67,111,109,112,77,117,108,116,0,1,0,0,0,13,0,109,0,0,1,0,0,0,13,0,110,0,0,0,1,8,58,109,97,116,50,0, -0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48,0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48, -0,0,0,0,1,90,95,0,0,14,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,14,0,109, -0,0,1,0,0,0,14,0,110,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48, -0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48, -0,0,0,0,1,90,95,0,0,15,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,15,0,109, -0,0,1,0,0,0,15,0,110,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,48, -0,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,48,0,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,48, -0,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,48,0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104, -97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115, -84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108, -101,115,115,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115, -108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108,101, -115,115,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,108,116, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108, -101,115,115,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,108, -116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4, -0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95, -115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108, -101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0, -11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0, -1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101, -116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,69,113, -117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115, -84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95, -115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118, -0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0, -118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,11,0, -117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114, -84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90, -95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0, -1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0, -18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1, -1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, -0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1, -1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114, -84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95, -115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1, -0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0, -0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1, -1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115, -103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8, -0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18, -118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4, -118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118, -101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118, -101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,2,0,0,101,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115, -101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3, -0,0,101,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,101, -113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4, -0,0,101,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,101, -113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117, -97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108, -0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108, -0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101, -116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1, -0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69,113,117,97,108, -0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113, -117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113,117,97, -108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69,113, -117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116, -69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0, -18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,69,113, -117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,69, -113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,110, -111,116,69,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,110, -101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0, -1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18, -115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1, -90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118, -101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4, -118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59, -122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117, -109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,4,0,118,0,0,0,1,3,2, -90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18, -118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0, -18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0, -59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18, -95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,1,48,46,48,0,0,0,0,1,90,95, -0,0,1,0,0,97,108,108,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101, -99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59, -121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0, -0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1, -112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0, -18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, -112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0, -18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,0, -97,108,108,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0, -18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0, -18,112,114,111,100,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,112,114,111,100,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,0,110,111,116,0,1,1,0,0, -2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,0,110,111,116,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101, -99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,1,48,46, -48,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113, -0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,12,0,0,116,101, -120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,9,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115, -97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, -114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111, -114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,0,18,95,95,114,101,116, -86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,121,121,0,0,0,0, -1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100, -95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114, -100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114, -101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116, -117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51,100,95,112,114,111,106,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,99,117,98,101,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,115,104,97,100,111,119,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0, -0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112,114,111, -106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -95,50,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111, -106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, -101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,116,101,120,116,117,114,101,50,68,82,101,99,116,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1, -1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117, -114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111, -106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,99,111,111,114, -100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,82,101,99,116,0,1,1,0,0,23,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -114,101,99,116,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112, -108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,82, -101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111, -114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,95,115,104,97, -100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111, -97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9, -0,0,110,111,105,115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101, -50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0, -1,1,0,0,11,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,51,0,18,95,95,114,101,116,86, -97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,12,0,120,0,0,0,1,4, -102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1, -90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,49,57,46,51,52,0,46,0,0,20,0,0,1,90,95,0,0,10,0, -0,110,111,105,115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0, -0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,49, -57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110, -111,105,115,101,50,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1, -51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, -1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0, -17,1,49,57,46,51,52,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115, -101,49,0,0,18,120,0,17,1,53,46,52,55,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, -1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, -18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,50,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,0,46,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,53, -46,52,55,0,0,17,1,49,55,46,56,53,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1, -1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0, -18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,51,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,0,46,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,51,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,0,46,0,0,20,0,0,1, -90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49,57,46,51,52,0,0,17,1, -55,46,54,54,0,0,17,1,51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,53,46,52,55,0,0, -17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,17,1,49,51,46,49,57,0,0,0,46,0,0,20,0,0,1,90,95,0, -0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59, -120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0, -58,110,111,105,115,101,49,0,0,18,120,0,17,1,49,57,46,51,52,0,46,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,53,46,52,55,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,17,1,50,51,46,53,52,0,46,0, -0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,49,57,46,51,52, -0,0,17,1,55,46,54,54,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105, -115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,0,46,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101, -99,50,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110, -111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,49,57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1, -51,46,50,51,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, -49,0,0,18,120,0,58,118,101,99,51,0,0,17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48, -52,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18, -120,0,58,118,101,99,51,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,17,1,51,49,46,57,49,0,0, -0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,1,49, -57,46,51,52,0,0,17,1,55,46,54,54,0,0,17,1,51,46,50,51,0,0,17,1,50,46,55,55,0,0,0,46,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0, -17,1,53,46,52,55,0,0,17,1,49,55,46,56,53,0,0,17,1,49,49,46,48,52,0,0,17,1,49,51,46,49,57,0,0,0,46, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,52,0,0,17,1,50,51,46,53,52,0,0,17,1,50,57,46,49,49,0,0,17,1,51,49,46,57,49,0,0,17,1,51,55, -46,52,56,0,0,0,46,0,0,20,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_core_gc.h b/src/mesa/shader/slang/library/slang_core_gc.h deleted file mode 100644 index 511e7d03342..00000000000 --- a/src/mesa/shader/slang/library/slang_core_gc.h +++ /dev/null @@ -1,865 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_core.gc */ - -5,1,90,95,0,0,5,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18, -95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,5,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,18,98,0,20,0,0,1,90,95,0,0,5,0,1,1,1,0,0,5,0,105,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,18,105,0,20,0,0,1,90,95,0,0,1,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0, -1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18, -102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,1,0,1,1,1,0,0,1,0,98,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,18,98,0,20,0,0,1,90,95,0,0,9,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111, -95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,1,0, -98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18, -98,0,0,0,0,1,90,95,0,0,9,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,102,0, -20,0,0,1,90,95,0,0,10,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121,0,20,0,0,1,90,95,0, -0,10,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,102,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118,101,99,52, -95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90, -95,0,0,10,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,2,0,98,0,0,0,1,4, -105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -98,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,1,1,1,0,0, -12,0,118,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0, -9,0,122,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,0,1, -90,95,0,0,11,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,5,0,105,0,0,0,1,4,105,118, -101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105, -0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,3,0, -98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,109, -111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,0,0,1,90,95,0,0,12,0, -1,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,122,0,0,1,1,0,0,9,0,119,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,121, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,109,111, -118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,102,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,5,0,105,0,0, -0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0, -0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,1,0,98,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0, -18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,4,0,98,0,0,0,1,4,105, -118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90, -95,0,0,12,0,1,1,1,0,0,8,0,105,0,0,0,1,4,105,118,101,99,52,95,116,111,95,118,101,99,52,0,18,95,95, -114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,12,0,1,1,1,0,0,11,0,118,51,0,0,1,1,0,0,9,0, -102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,18,118,51,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,119,0,18,102,0,20,0,0,1,90,95,0,0,12,0,1,1,1,0,0,10,0,118,50,0,0,1,1,0,0,9, -0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18,118,50, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,102,49,0,20,0,9,18,95,95,114,101,116,86,97, -108,0,59,119,0,18,102,50,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121, -0,18,106,0,20,0,0,1,90,95,0,0,6,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101,99,52,95,109,111,118,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,9,0,102,0, -0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,102,0,0,0,0,1,90,95,0,0,6,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105, -118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,1,1, -1,0,0,5,0,105,0,0,1,1,0,0,5,0,106,0,0,1,1,0,0,5,0,107,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,18,105,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,106,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,18,107,0,20,0,0,1,90,95,0,0,7,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101, -99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,0,0,1,90, -95,0,0,7,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,102,0,0,0,0,1,90,95,0,0,7,0,1,1,1,0,0,1,0,98,0,0,0,1, -4,118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0, -0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,120,0,0,1,1,0,0,5,0,121,0,0,1,1,0,0,5,0,122,0,0,1,1,0,0,5,0,119, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,120,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,18,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,122,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,119,0,18,119,0,20,0,0,1,90,95,0,0,8,0,1,1,1,0,0,5,0,105,0,0,0,1,4,118,101, -99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,0,18,105,0,0,0,0,1,90,95,0,0,8,0,1,1,1, -0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95,95,114,101,116,86,97, -108,0,0,18,102,0,0,0,0,1,90,95,0,0,8,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99,52,95,116,111,95,105, -118,101,99,52,0,18,95,95,114,101,116,86,97,108,0,0,18,98,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98, -49,0,0,1,1,0,0,1,0,98,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,49,0,0, -1,1,0,0,5,0,105,50,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,105,49,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, -97,108,0,59,121,0,0,18,105,50,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,1,0,98,0,0,0,1,4, -118,101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,98,0,0,0,0,1, -90,95,0,0,2,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86, -97,108,0,59,120,121,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,5,0,105,0,0,0,1, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,105,0,0,17,1, -48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,2,0,1,1,1,0, -0,6,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50,0,0,1,1, -0,0,1,0,98,51,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18,98,49,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,18,98,51, -0,20,0,0,1,90,95,0,0,3,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,17,1, -48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102, -50,0,0,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59, -122,0,0,18,102,51,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118,101,99, -52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95, -0,0,3,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,5,0,105,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,105,0,0,17,1, -48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,3,0,1,1, -1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,49,0,0,1,1,0,0,1,0,98,50, -0,0,1,1,0,0,1,0,98,51,0,0,1,1,0,0,1,0,98,52,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,18, -98,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,18,98,50,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,122,0,18,98,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,18,98,52,0,20,0,0,1, -90,95,0,0,4,0,1,1,1,0,0,9,0,102,49,0,0,1,1,0,0,9,0,102,50,0,0,1,1,0,0,9,0,102,51,0,0,1,1,0,0,9,0, -102,52,0,0,0,1,3,2,90,95,1,0,9,0,1,122,101,114,111,0,2,17,1,48,46,48,0,0,0,4,118,101,99,52,95,115, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,102,49,0,0,18,122,101,114,111,0,0,0,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,102,50,0,0,18,122,101, -114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,102, -51,0,0,18,122,101,114,111,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,119,0,0,18,102,52,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,1,0,98,0,0,0,1,4,118, -101,99,52,95,109,111,118,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,98,0,0,0, -0,1,90,95,0,0,4,0,1,1,1,0,0,9,0,102,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,122,119,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,5,0, -105,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0, -0,18,105,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,4,0,1,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,1,48,46,48,0,0, -0,0,1,90,95,0,0,4,0,1,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,122,119,0,0,18,118,0,0,17,1,48,46,48,0,0,0,0,1,90,95,0,0,13,0,1,1,1,0,0, -9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18, -109,49,49,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,9,0,102,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,59,120,0,18,102,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,17,1, -48,46,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,17,1,48,46,48,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,102,0,20,0,0,1,90,95,0,0,13,0,1,1,1,0,0,5,0, -105,0,0,0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,13,0, -1,1,1,0,0,1,0,98,0,0,0,1,8,58,109,97,116,50,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90, -95,0,0,13,0,1,1,1,0,0,10,0,99,48,0,0,1,1,0,0,10,0,99,49,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,0,1, -90,95,0,0,14,0,1,1,1,0,0,9,0,109,48,48,0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1, -0,0,9,0,109,48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,48,50,0, -0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1, -48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,121,0,18, -109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,109,48,49,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, -59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,109,48,50, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,109,50,50,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,9,0,102, -0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,118,0,59,120,121,121,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,18,118,0,59,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50, -0,57,18,118,0,59,121,121,120,0,20,0,0,1,90,95,0,0,14,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116, -51,0,0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,1,0,98,0,0,0,1,8, -58,109,97,116,51,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,14,0,1,1,1,0,0,11,0, -99,48,0,0,1,1,0,0,11,0,99,49,0,0,1,1,0,0,11,0,99,50,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99,49,0,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,109,48,48, -0,0,1,1,0,0,9,0,109,49,48,0,0,1,1,0,0,9,0,109,50,48,0,0,1,1,0,0,9,0,109,51,48,0,0,1,1,0,0,9,0,109, -48,49,0,0,1,1,0,0,9,0,109,49,49,0,0,1,1,0,0,9,0,109,50,49,0,0,1,1,0,0,9,0,109,51,49,0,0,1,1,0,0,9, -0,109,48,50,0,0,1,1,0,0,9,0,109,49,50,0,0,1,1,0,0,9,0,109,50,50,0,0,1,1,0,0,9,0,109,51,50,0,0,1,1, -0,0,9,0,109,48,51,0,0,1,1,0,0,9,0,109,49,51,0,0,1,1,0,0,9,0,109,50,51,0,0,1,1,0,0,9,0,109,51,51,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,120,0,18,109,48,48,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,59,121,0,18,109,49,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,59,122,0,18,109,50,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,59,119,0, -18,109,51,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,120,0,18,109,48,49,0,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,59,121,0,18,109,49,49,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,59,122,0,18,109,50,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, -57,59,119,0,18,109,51,49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,120,0,18,109,48, -50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,59,121,0,18,109,49,50,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,16,1,50,0,57,59,122,0,18,109,50,50,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,1,50,0,57,59,119,0,18,109,51,50,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,120, -0,18,109,48,51,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,121,0,18,109,49,51,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,59,122,0,18,109,50,51,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,51,0,57,59,119,0,18,109,51,51,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,9,0,102,0,0, -0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,102,0,0,17,1,48,46,48,0,0,0,0,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,48,0,57,18,118,0,59,120,121,121,121,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,49,0,57,18,118,0,59,121,120,121,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,50,0,57,18,118,0,59,121,121,120,121,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, -118,0,59,121,121,121,120,0,20,0,0,1,90,95,0,0,15,0,1,1,1,0,0,5,0,105,0,0,0,1,8,58,109,97,116,52,0, -0,58,102,108,111,97,116,0,0,18,105,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,1,0,98,0,0,0,1,8,58, -109,97,116,52,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,0,0,0,0,1,90,95,0,0,15,0,1,1,1,0,0,12,0,99, -48,0,0,1,1,0,0,12,0,99,49,0,0,1,1,0,0,12,0,99,50,0,0,1,1,0,0,12,0,99,51,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,16,1,48,0,57,18,99,48,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,99, -49,0,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,99,50,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,51,0,57,18,99,51,0,20,0,0,1,90,95,0,0,5,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98, -0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, -114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,21,1, -1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0, -0,5,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,98,73,110,118,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, -120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95, -95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98, -0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, -114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,21,1, -1,0,0,6,0,97,0,0,1,1,0,0,6,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0,97,0,0,1,1,0, -0,6,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52, -0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,7,0,97,0,0,1,1,0, -0,7,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -7,0,2,21,1,1,0,0,7,0,97,0,0,1,1,0,0,7,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0, -97,0,0,1,1,0,0,7,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112, -0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99, -52,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,8,0,97,0,0,1,1, -0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18, -98,0,0,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0, -8,0,2,21,1,1,0,0,8,0,97,0,0,1,1,0,0,8,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,8,0, -97,0,0,1,1,0,0,8,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,98,73,110,118,0,0,1,1,120,0,0,0,4,102,108,111, -97,116,95,114,99,112,0,18,98,73,110,118,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,99,112,0,18,98,73,110,118,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112, -0,18,98,73,110,118,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,98,73, -110,118,0,59,119,0,0,18,98,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18, -120,0,0,18,97,0,0,18,98,73,110,118,0,0,0,4,118,101,99,52,95,116,111,95,105,118,101,99,52,0,18,95, -95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98, -0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0, -1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, -114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,21,1, -1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0, -0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,98,73,110,118,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -98,73,110,118,0,59,120,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,73,110,118,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,10,0, -118,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0, -117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117, -0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,10,0,117, -0,0,0,1,3,2,90,95,0,0,10,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18, -117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, -0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4, -118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18, -117,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95, -115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18, -117,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, -18,117,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,0,0, -11,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59,120,0,0,0,4, -102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,119,0,0,0,0,1,90, -95,0,0,12,0,2,26,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18, -95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0, -0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116, -86,97,108,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0, -117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0, -0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,3, -2,90,95,0,0,12,0,1,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,120,0,0,18,117,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,119,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108, -111,97,116,95,114,99,112,0,18,119,0,59,122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,119,0,59,119,0,0,18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108, -121,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,119,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,9, -0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,26,1,1,0,0,10,0,118,0,0,1, -1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, -0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,10,0,117, -0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,27,1,1,0,0,10,0,118,0,0,1,1,0,0,9, -0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,9,0,97,0,0,1,1,0,0, -10,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,0,0,18,97,0,0,18,117,0,59,120,121,0,0,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,10,0,118, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0, -9,0,97,0,0,1,1,0,0,10,0,117,0,0,0,1,3,2,90,95,0,0,10,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114, -99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116, -105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,18,105,110,118,85,0,59, -120,121,0,0,0,0,1,90,95,0,0,10,0,2,22,1,1,0,0,10,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9, -0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,66,0,0,18,98,0,0,0,4, -118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0, -18,118,0,59,120,121,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0, -11,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,26,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0, -98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0, -0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0,1, -1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97, -108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,9, -0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,18,117,0,59,120,121,122,0,0,0,0,1,90,95,0,0, -11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,98,0, -0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,0,0,11,0,1,105, -110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,120,0,0,18,117,0,59, -120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,121,0,0,18,117,0,59,121,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,122,0,0,18,117,0,59,122,0,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,97,0,0,18,105,110,118,85,0,59,120,121,122,0,0,0,0,1,90,95,0,0,11,0,2,22,1,1,0,0,11,0,118,0,0,1, -1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,59,120,121,122,0,0,18,105,110,118,66,0,0,0,0,1, -90,95,0,0,12,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18, -95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,26,1,1,0,0,12,0,118,0, -0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,97,100,100,0,18,95,95,114,101,116,86,97,108,0,0,18,118, -0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99, -52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1, -90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,115,117,98,116, -114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,21, -1,1,0,0,9,0,97,0,0,1,1,0,0,12,0,117,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,117,0,0,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,12,0,118, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,12,0, -117,0,0,0,1,3,2,90,95,0,0,12,0,1,105,110,118,85,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105, -110,118,85,0,59,120,0,0,18,117,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118, -85,0,59,121,0,0,18,117,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59, -122,0,0,18,117,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,105,110,118,85,0,59,119,0,0, -18,117,0,59,119,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86, -97,108,0,0,18,97,0,0,18,105,110,118,85,0,0,0,0,1,90,95,0,0,12,0,2,22,1,1,0,0,12,0,118,0,0,1,1,0,0, -9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,105,110,118,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18, -105,110,118,66,0,0,18,98,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114, -101,116,86,97,108,0,0,18,118,0,0,18,105,110,118,66,0,0,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,5,0,97,0,0, -1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18, -117,0,46,20,0,0,1,90,95,0,0,6,0,2,26,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0, -0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,50,0,0, -18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0, -0,6,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105, -118,101,99,50,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,6,0,2,21,1,1,0,0,6,0,118,0,0,1,1,0,0, -5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0,0,18,98,0,0,0,48, -20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,105,118,101,99,50,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,6,0,2,22,1,1,0,0,6,0, -118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,50,0, -0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,7,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,7,0,2, -26,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105, -118,101,99,51,0,0,18,98,0,0,0,46,20,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,7,0,117,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1, -90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,5,0,97,0,0,1, -1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0,18,97,0,0,0,18, -117,0,48,20,0,0,1,90,95,0,0,7,0,2,21,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0, -0,5,0,97,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,51,0,0, -18,97,0,0,0,18,117,0,49,20,0,0,1,90,95,0,0,7,0,2,22,1,1,0,0,7,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,51,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0, -0,8,0,2,26,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105, -118,101,99,52,0,0,18,97,0,0,0,18,117,0,46,20,0,0,1,90,95,0,0,8,0,2,26,1,1,0,0,8,0,118,0,0,1,1,0,0, -5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,46, -20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,47,20,0,0,1,90,95,0,0,8,0,2,27,1,1,0,0,8,0, -118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105,118,101,99,52,0, -0,18,98,0,0,0,47,20,0,0,1,90,95,0,0,8,0,2,21,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,48,20,0,0,1,90,95,0,0,8,0,2, -21,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,58,105, -118,101,99,52,0,0,18,98,0,0,0,48,20,0,0,1,90,95,0,0,8,0,2,22,1,1,0,0,5,0,97,0,0,1,1,0,0,8,0,117,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,105,118,101,99,52,0,0,18,97,0,0,0,18,117,0,49,20,0,0,1, -90,95,0,0,8,0,2,22,1,1,0,0,8,0,118,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,118,0,58,105,118,101,99,52,0,0,18,98,0,0,0,49,20,0,0,1,90,95,0,0,5,0,2,27,1,1,0,0,5,0,97,0,0,0, -1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0, -0,0,0,1,90,95,0,0,6,0,2,27,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18, -95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,7,0,2,27,1,1,0,0,7,0,118,0,0,0,1,4,118, -101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0, -0,8,0,2,27,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101, -116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,9,0,2,27,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95, -110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,0,0,0,1,90,95,0,0,10, -0,2,27,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,2,27,1,1,0,0,11,0,118,0,0, -0,1,4,118,101,99,52,95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,118,0,59,120,121,122,0,0,0,0,1,90,95,0,0,12,0,2,27,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52, -95,110,101,103,97,116,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,0,0,1,90,95,0,0,13,0,2, -27,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57, -54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,0,1,90,95,0, -0,14,0,2,27,1,1,0,0,14,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, -48,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,54,20,0,0,1,90,95,0,0,15,0,2,27,1, -1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,54,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,54,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,54,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -51,0,57,18,109,0,16,1,51,0,57,54,20,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,9,0,97,0,0,1,1,0,0, -9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,48,20,0,0,1,90,95,0,0,9,0,0,100, -111,116,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0, -59,120,0,18,98,0,59,120,0,48,18,97,0,59,121,0,18,98,0,59,121,0,48,46,20,0,0,1,90,95,0,0,9,0,0,100, -111,116,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,51,95,100,111,116,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,100,111,116,0,1,1,0,0,12,0,97, -0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52,95,100,111,116,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,5,0,2,1,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18,97,0,18,97, -0,18,98,0,46,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,2,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,9,18, -97,0,18,97,0,18,98,0,47,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,3,1,0,2,0,5,0,97,0,0,1,1,0,0,5,0,98,0, -0,0,1,9,18,97,0,18,97,0,18,98,0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,5,0,2,4,1,0,2,0,5,0,97,0,0,1,1,0, -0,5,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,6,0,2,1,1,0,2,0,6,0, -118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6, -0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0, -0,0,1,90,95,0,0,6,0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0, -48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0,1,1,0,0,6,0,117,0,0,0,1,9,18,118,0, -18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0, -0,0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0, -1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,3,1, -0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90, -95,0,0,7,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,7,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8, -18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9, -18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0,0, -8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,8, -0,118,0,0,1,1,0,0,8,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0, -9,0,2,1,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,46,20,0,8,18,97,0,0,0, -1,90,95,0,0,9,0,2,2,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98,0,47,20,0,8, -18,97,0,0,0,1,90,95,0,0,9,0,2,3,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18,97,0,18,98, -0,48,20,0,8,18,97,0,0,0,1,90,95,0,0,9,0,2,4,1,0,2,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,97,0,18, -97,0,18,98,0,49,20,0,8,18,97,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0, -0,1,9,18,118,0,18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,2,1,0,2,0,10,0,118,0,0, -1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3, -1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0, -1,90,95,0,0,10,0,2,4,1,0,2,0,10,0,118,0,0,1,1,0,0,10,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49, -20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0, -18,118,0,18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0, -117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0, -118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, -11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18, -118,0,0,0,1,90,95,0,0,12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0, -18,117,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1, -9,18,118,0,18,118,0,18,117,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0,2,0,12,0,118,0,0,1,1, -0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0, -2,0,12,0,118,0,0,1,1,0,0,12,0,117,0,0,0,1,9,18,118,0,18,118,0,18,117,0,49,20,0,8,18,118,0,0,0,1,90, -95,0,0,6,0,2,1,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50, -0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,2,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0, -0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,6, -0,2,3,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,18, -97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,6,0,2,4,1,0,2,0,6,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,105,118,101,99,50,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,1, -1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0, -0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,2,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0, -18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,7,0,2,3,1,0,2,0,7, -0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,18,97,0,0,0,48,20,0, -8,18,118,0,0,0,1,90,95,0,0,8,0,2,4,1,0,2,0,7,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,1,1,0,2,0,8,0,118,0, -0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,46,20,0,8,18,118, -0,0,0,1,90,95,0,0,8,0,2,2,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105, -118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,8,0,2,3,1,0,2,0,8,0,118,0,0,1,1,0, -0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1, -90,95,0,0,8,0,2,4,1,0,2,0,8,0,118,0,0,1,1,0,0,5,0,97,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99, -52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,1,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97, -0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,10, -0,2,2,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0, -0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18, -118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,10,0,2,4,1,0,2, -0,10,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,18,97,0,0,0,49,20,0, -8,18,118,0,0,0,1,90,95,0,0,11,0,2,1,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118, -0,58,118,101,99,51,0,0,18,97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,2,1,0,2,0,11,0,118,0, -0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0, -0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101, -99,51,0,0,18,97,0,0,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,4,1,0,2,0,11,0,118,0,0,1,1,0,0,9,0, -97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0, -12,0,2,1,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18, -97,0,0,0,46,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,2,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9, -18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,47,20,0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,3,1,0, -2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,18,97,0,0,0,48,20, -0,8,18,118,0,0,0,1,90,95,0,0,12,0,2,4,1,0,2,0,12,0,118,0,0,1,1,0,0,9,0,97,0,0,0,1,9,18,118,0,18, -118,0,58,118,101,99,52,0,0,18,97,0,0,0,49,20,0,8,18,118,0,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0, -109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48, -0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1, -49,0,57,18,110,0,16,1,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0, -110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48, -0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1, -49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,59,120,120,0,48, -18,109,0,16,1,49,0,57,18,110,0,16,1,48,0,57,59,121,121,0,48,46,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49,0,57,59,120,120,0,48,18,109,0,16,1,49,0, -57,18,110,0,16,1,49,0,57,59,121,121,0,48,46,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1, -0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110, -0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, -110,0,16,1,49,0,57,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0, -9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20, -0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46, -20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,0,1,90,95,0,0, -14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48, -0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,59,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110, -0,16,1,48,0,57,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,48,0,57,59,122,122,122,0, -48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49, -0,57,59,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,59,121,121,121,0,48,46,18,109, -0,16,1,50,0,57,18,110,0,16,1,49,0,57,59,122,122,122,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108, -0,16,1,50,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,50,0,57,59,120,120,120,0,48,18,109,0,16,1,49,0, -57,18,110,0,16,1,50,0,57,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,59,122, -122,122,0,48,46,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,20,0,9,18, -95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9, -18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0, -0,1,90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,20,0,0,1,90,95,0,0,15, -0,2,27,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0, -57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49, -0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,21,1,1,0,0,15,0, -109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48, -0,57,18,110,0,16,1,48,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,48,0,57,59, -121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,48,0,57,59,122,122,122,122,0,48,46,18, -109,0,16,1,51,0,57,18,110,0,16,1,48,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,49,0,57,59,120,120,120,120,0,48,18,109,0, -16,1,49,0,57,18,110,0,16,1,49,0,57,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1, -49,0,57,59,122,122,122,122,0,48,46,18,109,0,16,1,51,0,57,18,110,0,16,1,49,0,57,59,119,119,119,119, -0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, -50,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18,110,0,16,1,50,0,57,59,121,121,121,121,0, -48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,59,122,122,122,122,0,48,46,18,109,0,16,1,51,0,57, -18,110,0,16,1,50,0,57,59,119,119,119,119,0,48,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0, -57,18,109,0,16,1,48,0,57,18,110,0,16,1,51,0,57,59,120,120,120,120,0,48,18,109,0,16,1,49,0,57,18, -110,0,16,1,51,0,57,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,110,0,16,1,51,0,57,59,122, -122,122,122,0,48,46,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,59,119,119,119,119,0,48,46,20,0,0, -1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116, -86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,49,20,0,0,1,90,95,0,0,13, -0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57, -18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18, -110,0,16,1,49,0,57,46,20,0,0,1,90,95,0,0,13,0,2,26,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,46,20,0,0,1,90,95,0,0,13,0,2,27,1,1, -0,0,9,0,97,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18, -110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1, -49,0,57,47,20,0,0,1,90,95,0,0,13,0,2,27,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,47,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47,20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,9,0,97, -0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1, -48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,48, -20,0,0,1,90,95,0,0,13,0,2,21,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86, -97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,0,1,90,95,0,0,13,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0, -13,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,0,1,90, -95,0,0,13,0,2,22,1,1,0,0,13,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16, -1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18, -109,0,16,1,49,0,57,18,98,0,49,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,46,20,0,0,1,90,95,0,0,14,0,2,26,1,1,0,0, -14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1, -48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18, -98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,46,20,0, -0,1,90,95,0,0,14,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1, -49,0,57,18,97,0,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18, -97,0,18,110,0,16,1,50,0,57,47,20,0,0,1,90,95,0,0,14,0,2,27,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,47,20,0,0,1,90,95,0,0,14,0,2,21,1,1,0,0, -9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110, -0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,48,20,0,0, -1,90,95,0,0,14,0,2,21,1,1,0,0,14,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, -57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0, -16,1,50,0,57,18,98,0,48,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,14,0,110,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114, -101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,49,20,0,0,1,90,95,0,0,14,0,2,22,1,1,0,0,14,0, -109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0, -57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0, -49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,49,20,0,0,1, -90,95,0,0,15,0,2,26,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57, -18,97,0,18,110,0,16,1,49,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18, -110,0,16,1,50,0,57,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1, -51,0,57,46,20,0,0,1,90,95,0,0,15,0,2,26,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, -109,0,16,1,51,0,57,18,98,0,46,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,47,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,47,20,0,0,1,90,95,0,0,15,0,2,27,1,1,0,0,15,0,109, -0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57, -18,98,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,47, -20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,47,20,0,0,1,90,95,0,0,15,0,2, -21,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18, -97,0,18,110,0,16,1,48,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0,57,18,97,0,18,110, -0,16,1,49,0,57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,97,0,18,110,0,16,1,50,0, -57,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,97,0,18,110,0,16,1,51,0,57,48,20,0,0, -1,90,95,0,0,15,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0,0,1,9,18,95,95,114,101,116,86,97,108, -0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,49,0, -57,18,109,0,16,1,49,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,50,0,57,18,109,0, -16,1,50,0,57,18,98,0,48,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18,109,0,16,1,51,0,57, -18,98,0,48,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,9,0,97,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,16,1,48,0,57,18,97,0,18,110,0,16,1,48,0,57,49,20,0,9,18,95,95,114,101,116,86, -97,108,0,16,1,49,0,57,18,97,0,18,110,0,16,1,49,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16, -1,50,0,57,18,97,0,18,110,0,16,1,50,0,57,49,20,0,9,18,95,95,114,101,116,86,97,108,0,16,1,51,0,57,18, -97,0,18,110,0,16,1,51,0,57,49,20,0,0,1,90,95,0,0,15,0,2,22,1,1,0,0,15,0,109,0,0,1,1,0,0,9,0,98,0,0, -0,1,9,18,95,95,114,101,116,86,97,108,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,98,0,49,20,0,9,18,95, -95,114,101,116,86,97,108,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,98,0,49,20,0,9,18,95,95,114,101, -116,86,97,108,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,98,0,49,20,0,9,18,95,95,114,101,116,86,97, -108,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,98,0,49,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0,0,13,0,109, -0,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59, -120,120,0,48,18,109,0,16,1,49,0,57,18,118,0,59,121,121,0,48,46,20,0,0,1,90,95,0,0,10,0,2,21,1,1,0, -0,10,0,118,0,0,1,1,0,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116, -0,0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100, -111,116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,14,0,109,0,0, -1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59,120, -120,120,0,48,18,109,0,16,1,49,0,57,18,118,0,59,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,118,0, -59,122,122,122,0,48,46,20,0,0,1,90,95,0,0,11,0,2,21,1,1,0,0,11,0,118,0,0,1,1,0,0,14,0,109,0,0,0,1, -9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,48,0,57,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,49, -0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,100,111,116,0,0,18,118,0,0,18,109,0, -16,1,50,0,57,0,0,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0,15,0,109,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18, -95,95,114,101,116,86,97,108,0,18,109,0,16,1,48,0,57,18,118,0,59,120,120,120,120,0,48,18,109,0,16,1, -49,0,57,18,118,0,59,121,121,121,121,0,48,46,18,109,0,16,1,50,0,57,18,118,0,59,122,122,122,122,0,48, -46,18,109,0,16,1,51,0,57,18,118,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0,2,21,1,1,0,0, -12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,100,111,116,0, -0,18,118,0,0,18,109,0,16,1,48,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,100,111, -116,0,0,18,118,0,0,18,109,0,16,1,49,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -100,111,116,0,0,18,118,0,0,18,109,0,16,1,50,0,57,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,100,111,116,0,0,18,118,0,0,18,109,0,16,1,51,0,57,0,0,20,0,0,1,90,95,0,0,13,0,2,1,1,0,2,0, -13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, -48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46,20,0,8,18, -109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0, -57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, -57,18,110,0,16,1,49,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0, -13,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0, -13,0,109,0,0,1,1,0,0,13,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1, -48,0,57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,8,18, -109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,1,48,0, -57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, -57,18,110,0,16,1,49,0,57,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0, -57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18, -109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18, -109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18, -110,0,16,1,50,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,14,0, -110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0, -109,0,0,1,1,0,0,14,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0,16,1,48,0, -57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,49,20,0,9,18,109,0, -16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2, -1,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18, -110,0,16,1,48,0,57,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,46, -20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,46,20,0,9,18,109,0,16,1, -51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,46,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,2,1, -0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,110,0, -16,1,48,0,57,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0,57,47,20,0,9, -18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,47,20,0,9,18,109,0,16,1,51,0,57, -18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,47,20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15, -0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,18,109,0,18,110,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0, -15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,15,0,110,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, -57,18,110,0,16,1,48,0,57,49,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,110,0,16,1,49,0, -57,49,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,110,0,16,1,50,0,57,49,20,0,9,18,109,0, -16,1,51,0,57,18,109,0,16,1,51,0,57,18,110,0,16,1,51,0,57,49,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2, -1,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18, -97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,46,20,0,9,18,109,0,16,1,49,0, -57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,2,1,0,2,0,13,0,109,0,0, -1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109, -0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, -57,18,118,0,47,20,0,8,18,109,0,0,0,1,90,95,0,0,13,0,2,3,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0, -1,3,2,90,95,0,0,10,0,1,118,0,2,58,118,101,99,50,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109, -0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,8, -18,109,0,0,0,1,90,95,0,0,13,0,2,4,1,0,2,0,13,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1, -118,0,2,58,118,101,99,50,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0, -16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,8,18, -109,0,0,0,1,90,95,0,0,14,0,2,1,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1, -118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118, -0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,9,18,109,0,16,1,50,0,57, -18,109,0,16,1,50,0,57,18,118,0,46,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,2,1,0,2,0,14,0,109,0,0,1, -1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0, -16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, -18,118,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,47,20,0,8,18,109,0,0,0,1, -90,95,0,0,14,0,2,3,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118, -101,99,51,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,48,20,0,9,18, -109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50, -0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,14,0,2,4,1,0,2,0,14,0,109,0,0,1,1,0,0,9,0,97,0,0, -0,1,3,2,90,95,0,0,11,0,1,118,0,2,58,118,101,99,51,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109, -0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0, -57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,48,20,0,8,18,109,0,0,0, -1,90,95,0,0,15,0,2,1,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2,58, -118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,46,20,0,9, -18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1, -50,0,57,18,118,0,46,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,46,20,0,8,18,109,0, -0,0,1,90,95,0,0,15,0,2,2,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,118,0,2, -58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118,0,47,20, -0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0, -16,1,50,0,57,18,118,0,47,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,47,20,0,8,18, -109,0,0,0,1,90,95,0,0,15,0,2,3,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1, -118,0,2,58,118,101,99,52,0,0,18,97,0,0,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,18,118, -0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0,9,18,109,0,16,1,50,0,57, -18,109,0,16,1,50,0,57,18,118,0,48,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,18,118,0,48, -20,0,8,18,109,0,0,0,1,90,95,0,0,15,0,2,4,1,0,2,0,15,0,109,0,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0,0, -12,0,1,118,0,2,58,118,101,99,52,0,0,17,1,49,46,48,0,18,97,0,49,0,0,0,0,9,18,109,0,16,1,48,0,57,18, -109,0,16,1,48,0,57,18,118,0,48,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,18,118,0,48,20,0, -9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,18,118,0,48,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16, -1,51,0,57,18,118,0,48,20,0,8,18,109,0,0,0,1,90,95,0,0,10,0,2,3,1,0,2,0,10,0,118,0,0,1,1,0,0,13,0, -109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0,11,0,2,3,1,0,2,0,11,0, -118,0,0,1,1,0,0,14,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18,118,0,0,0,1,90,95,0,0, -12,0,2,3,1,0,2,0,12,0,118,0,0,1,1,0,0,15,0,109,0,0,0,1,9,18,118,0,18,118,0,18,109,0,48,20,0,8,18, -118,0,0,0,1,90,95,0,0,5,0,2,25,1,0,2,0,5,0,97,0,0,0,1,9,18,97,0,18,97,0,16,1,49,0,47,20,0,9,18,95, -95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,6,0,2,25,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0, -18,118,0,58,105,118,101,99,50,0,0,16,1,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118, -0,20,0,0,1,90,95,0,0,7,0,2,25,1,0,2,0,7,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0, -16,1,49,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,25,1,0, -2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,1,49,0,0,0,47,20,0,9,18,95,95, -114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,9,0,2,25,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18, -97,0,17,1,49,46,48,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2, -25,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,9, -18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,11,0,2,25,1,0,2,0,11,0,118,0,0,0,1,9, -18,118,0,18,118,0,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,20,0,0,1,90,95,0,0,12,0,2,25,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118, -101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90, -95,0,0,13,0,2,25,1,0,2,0,13,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101, -99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99, -50,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0, -14,0,2,25,1,0,2,0,14,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51, -0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0, -17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17, -1,49,46,48,0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,25, -1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1, -49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49, -46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46, -48,0,0,0,47,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48, -0,0,0,47,20,0,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,2,24,1,0,2,0,5,0, -97,0,0,0,1,9,18,97,0,18,97,0,16,1,49,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,0,1, -90,95,0,0,6,0,2,24,1,0,2,0,6,0,118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,1,49,0, -0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,7,0,2,24,1,0,2,0,7,0, -118,0,0,0,1,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,1,49,0,0,0,46,20,0,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,8,0,2,24,1,0,2,0,8,0,118,0,0,0,1,9,18,118,0,18,118,0, -58,105,118,101,99,52,0,0,16,1,49,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0, -1,90,95,0,0,9,0,2,24,1,0,2,0,9,0,97,0,0,0,1,9,18,97,0,18,97,0,17,1,49,46,48,0,46,20,0,9,18,95,95, -114,101,116,86,97,108,0,18,97,0,20,0,0,1,90,95,0,0,10,0,2,24,1,0,2,0,10,0,118,0,0,0,1,9,18,118,0, -18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18, -118,0,20,0,0,1,90,95,0,0,11,0,2,24,1,0,2,0,11,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,51,0, -0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,12,0, -2,24,1,0,2,0,12,0,118,0,0,0,1,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0, -9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,0,1,90,95,0,0,13,0,2,24,1,0,2,0,13,0,109,0,0,0,1, -9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9, -18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18, -95,95,114,101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,14,0,2,24,1,0,2,0,14,0,109,0,0,0,1,9,18, -109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109, -0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0, -16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114, -101,116,86,97,108,0,18,109,0,20,0,0,1,90,95,0,0,15,0,2,24,1,0,2,0,15,0,109,0,0,0,1,9,18,109,0,16,1, -48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49, -0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,50,0, -57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,51,0,57, -18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,95,95,114,101,116,86, -97,108,0,18,109,0,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,5,0,97,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,16,1,49,0,47,20,0,0,1,90, -95,0,0,6,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,6,0,118,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0,0,16,1,49,0,0,0,47,20,0,0,1, -90,95,0,0,7,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,7,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51,0,0,16,1,49,0,0,0,47,20,0,0, -1,90,95,0,0,8,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,8,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,52,0,0,16,1,49,0,0,0,47,20,0,0, -1,90,95,0,0,9,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,18,97,0,20,0,9,18,97,0,18,97,0,17,1,49,46,48,0,47,20,0,0,1,90,95,0,0,10,0,0,95,95, -112,111,115,116,68,101,99,114,0,1,0,2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118, -0,20,0,9,18,118,0,18,118,0,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,11,0,0, -95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0, -12,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95, -0,0,13,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,13,0,109,0,0,0,1,9,18,95,95,114,101,116, -86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,50,0,0,17,1, -49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,50,0,0,17,1,49, -46,48,0,0,0,47,20,0,0,1,90,95,0,0,14,0,0,95,95,112,111,115,116,68,101,99,114,0,1,0,2,0,14,0,109,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, -57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, -58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58, -118,101,99,51,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,15,0,0,95,95,112,111,115,116,68,101,99, -114,0,1,0,2,0,15,0,109,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,109,0,20,0,9,18,109,0,16,1,48, -0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,49,0, -57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,50,0,57, -18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,9,18,109,0,16,1,51,0,57,18, -109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,47,20,0,0,1,90,95,0,0,9,0,0,95,95,112, -111,115,116,73,110,99,114,0,1,0,2,0,9,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0, -9,18,97,0,18,97,0,16,1,49,0,46,20,0,0,1,90,95,0,0,10,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0, -2,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,118, -101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,11,0,0,95,95,112,111,115,116,73,110,99,114, -0,1,0,2,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58, -118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,12,0,0,95,95,112,111,115,116,73,110,99, -114,0,1,0,2,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118, -0,58,118,101,99,52,0,0,17,1,49,46,48,0,0,0,46,20,0,0,1,90,95,0,0,5,0,0,95,95,112,111,115,116,73, -110,99,114,0,1,0,2,0,5,0,97,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,97,0,20,0,9,18,97,0,18, -97,0,16,1,49,0,46,20,0,0,1,90,95,0,0,6,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,6,0,118,0, -0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,50,0, -0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,7,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,7,0,118, -0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99,51, -0,0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,8,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,8,0, -118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,18,118,0,20,0,9,18,118,0,18,118,0,58,105,118,101,99, -51,0,0,16,1,49,0,0,0,46,20,0,0,1,90,95,0,0,13,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,13, -0,109,0,0,0,1,3,2,90,95,0,0,13,0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0, -57,58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57, -58,118,101,99,50,0,0,17,1,49,46,48,0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,14,0,0,95,95,112,111, -115,116,73,110,99,114,0,1,0,2,0,14,0,109,0,0,0,1,3,2,90,95,0,0,14,0,1,110,0,2,18,109,0,0,0,9,18, -109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109, -0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,9,18,109,0, -16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,51,0,0,17,1,49,46,48,0,0,0,46,20,0,8,18,110,0,0,0, -1,90,95,0,0,15,0,0,95,95,112,111,115,116,73,110,99,114,0,1,0,2,0,15,0,109,0,0,0,1,3,2,90,95,0,0,15, -0,1,110,0,2,18,109,0,0,0,9,18,109,0,16,1,48,0,57,18,109,0,16,1,48,0,57,58,118,101,99,52,0,0,17,1, -49,46,48,0,0,0,46,20,0,9,18,109,0,16,1,49,0,57,18,109,0,16,1,49,0,57,58,118,101,99,52,0,0,17,1,49, -46,48,0,0,0,46,20,0,9,18,109,0,16,1,50,0,57,18,109,0,16,1,50,0,57,58,118,101,99,52,0,0,17,1,49,46, -48,0,0,0,46,20,0,9,18,109,0,16,1,51,0,57,18,109,0,16,1,51,0,57,58,118,101,99,52,0,0,17,1,49,46,48, -0,0,0,46,20,0,8,18,110,0,0,0,1,90,95,0,0,1,0,2,15,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118, -101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,98,0,0,18,97,0,0,0,0,1, -90,95,0,0,1,0,2,15,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0, -0,58,102,108,111,97,116,0,0,18,98,0,0,0,40,0,0,1,90,95,0,0,1,0,2,16,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0, -98,0,0,0,1,3,2,90,95,0,0,1,0,1,99,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,99,0,0,18,98, -0,0,18,97,0,0,0,8,18,99,0,0,0,1,90,95,0,0,1,0,2,16,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58, -102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,41,0,0,1,90,95,0,0,1,0,2, -18,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108, -111,97,116,95,108,101,115,115,0,18,103,0,0,18,98,0,0,18,97,0,0,0,4,102,108,111,97,116,95,101,113, -117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103,0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,18,1,1, -0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111,97,116,0,0,18,97,0,0,0,58,102,108,111,97, -116,0,0,18,98,0,0,0,43,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90, -95,0,0,1,0,1,103,0,0,1,1,101,0,0,0,4,102,108,111,97,116,95,108,101,115,115,0,18,103,0,0,18,97,0,0, -18,98,0,0,0,4,102,108,111,97,116,95,101,113,117,97,108,0,18,101,0,0,18,97,0,0,18,98,0,0,0,8,18,103, -0,18,101,0,32,0,0,1,90,95,0,0,1,0,2,17,1,1,0,0,5,0,97,0,0,1,1,0,0,5,0,98,0,0,0,1,8,58,102,108,111, -97,116,0,0,18,97,0,0,0,58,102,108,111,97,116,0,0,18,98,0,0,0,42,0,0,1,90,95,0,0,0,0,0,112,114,105, -110,116,77,69,83,65,0,1,1,0,0,9,0,102,0,0,0,1,4,102,108,111,97,116,95,112,114,105,110,116,0,18,102, -0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,5,0,105,0,0,0,1,4,105,110,116, -95,112,114,105,110,116,0,18,105,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, -0,1,0,98,0,0,0,1,4,98,111,111,108,95,112,114,105,110,116,0,18,98,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,10,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118, -0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0, -0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,11,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83, -65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9, -58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, -116,77,69,83,65,0,1,1,0,0,12,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, -120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110, -116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59, -119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,6,0,118,0,0,0,1,9,58,112, -114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0, -18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,7,0,118,0,0, -0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77, -69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,8,0,118,0,0,0,1,9,58,112,114,105, -110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0, -59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,9,58,112,114,105, -110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83, -65,0,1,1,0,0,2,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110, -116,77,69,83,65,0,1,1,0,0,3,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120, -0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116, -77,69,83,65,0,0,18,118,0,59,122,0,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1, -0,0,4,0,118,0,0,0,1,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,120,0,0,0,0,9,58,112,114, -105,110,116,77,69,83,65,0,0,18,118,0,59,121,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, -118,0,59,122,0,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,118,0,59,119,0,0,0,0,0,1,90,95,0, -0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,13,0,109,0,0,0,1,9,58,112,114,105,110,116,77,69, -83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,49,0, -57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,14,0,109,0,0,0,1,9,58,112, -114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0, -0,18,109,0,16,1,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,50,0,57,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,15,0,109,0,0,0,1,9,58,112,114,105, -110,116,77,69,83,65,0,0,18,109,0,16,1,48,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18, -109,0,16,1,49,0,57,0,0,0,9,58,112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,50,0,57,0,0,0,9,58, -112,114,105,110,116,77,69,83,65,0,0,18,109,0,16,1,51,0,57,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105, -110,116,77,69,83,65,0,1,1,0,0,16,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0, -0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,17,0,101,0,0,0,1,4,105,110,116,95, -112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0, -18,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114, -105,110,116,77,69,83,65,0,1,1,0,0,19,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0, -0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0,0,20,0,101,0,0,0,1,4,105,110,116, -95,112,114,105,110,116,0,18,101,0,0,0,0,1,90,95,0,0,0,0,0,112,114,105,110,116,77,69,83,65,0,1,1,0, -0,21,0,101,0,0,0,1,4,105,110,116,95,112,114,105,110,116,0,18,101,0,0,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h b/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h deleted file mode 100644 index c5a1cce2a49..00000000000 --- a/src/mesa/shader/slang/library/slang_fragment_builtin_gc.h +++ /dev/null @@ -1,110 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_fragment_builtin.gc */ - -5,2,2,90,95,6,0,12,0,1,103,108,95,70,114,97,103,67,111,111,114,100,0,0,0,2,2,90,95,6,0,1,0,1,103, -108,95,70,114,111,110,116,70,97,99,105,110,103,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103, -67,111,108,111,114,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,70,114,97,103,68,97,116,97,0,3,18,103,108, -95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,0,0,2,2,90,95,5,0,9,0,1,103,108,95,70,114, -97,103,68,101,112,116,104,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95, -3,0,12,0,1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0, -1,103,108,95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101, -67,111,111,114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111, -114,100,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0, -12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0, -20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120, -95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111, -106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0, -98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114, -100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112, -99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95, -98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0, -16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115, -0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0, -18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114, -100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0, -18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0, -0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114, -0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99, -111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120, -121,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116, -101,120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80, -114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1, -0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111, -111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0, -49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101, -120,95,50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114, -0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114, -111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0, -9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111, -114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20, -0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95, -50,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0, -115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0, -1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0, -18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97, -115,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111, -114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59,120,121, -122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97, -115,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,67,117,98,101,0,1,1,0,0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100, -52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111, -111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,99,117,98,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0, -0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0, -0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,99, -111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20, -0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95, -49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97, -109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119, -49,68,80,114,111,106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100, -0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112, -99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,119,0,49, -20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111, -111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105, -97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,0,1,1,0, -0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97, -115,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120, -121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,98,105,97,115,0,20, -0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90, -95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,98,105,97,115,0,0,0,1,3,2,90,95,0,0,12,0,1, -112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59, -120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99, -111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,98,105,97,115,0,20,0,4, -118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114, -101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,9,0,0,100,70,100,120,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100, -120,0,1,1,0,0,10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0, -59,120,121,0,0,18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,120,0,1,1,0,0,11, -0,112,0,0,0,1,4,118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0, -18,112,0,59,120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,120,0,1,1,0,0,12,0,112,0,0,0,1,4, -118,101,99,52,95,100,100,120,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0, -100,70,100,121,0,1,1,0,0,9,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86, -97,108,0,59,120,0,0,18,112,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,10,0,0,100,70,100,121,0,1,1,0, -0,10,0,112,0,0,0,1,4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0, -0,18,112,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,11,0,0,100,70,100,121,0,1,1,0,0,11,0,112,0,0,0,1, -4,118,101,99,52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,112,0,59, -120,121,122,122,0,0,0,0,1,90,95,0,0,12,0,0,100,70,100,121,0,1,1,0,0,12,0,112,0,0,0,1,4,118,101,99, -52,95,100,100,121,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,0,0,1,90,95,0,0,9,0,0,102,119, -105,100,116,104,0,1,1,0,0,9,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0, -0,58,97,98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,10,0,0,102,119,105, -100,116,104,0,1,1,0,0,10,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0, -58,97,98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,11,0,0,102,119,105,100, -116,104,0,1,1,0,0,11,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97, -98,115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,1,90,95,0,0,12,0,0,102,119,105,100,116, -104,0,1,1,0,0,12,0,112,0,0,0,1,8,58,97,98,115,0,0,58,100,70,100,120,0,0,18,112,0,0,0,0,0,58,97,98, -115,0,0,58,100,70,100,121,0,0,18,112,0,0,0,0,0,46,0,0,0 diff --git a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h b/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h deleted file mode 100644 index f939aa9673d..00000000000 --- a/src/mesa/shader/slang/library/slang_vertex_builtin_gc.h +++ /dev/null @@ -1,109 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_vertex_builtin.gc */ - -5,2,2,90,95,5,0,12,0,1,103,108,95,80,111,115,105,116,105,111,110,0,0,0,2,2,90,95,5,0,9,0,1,103,108, -95,80,111,105,110,116,83,105,122,101,0,0,0,2,2,90,95,5,0,12,0,1,103,108,95,67,108,105,112,86,101, -114,116,101,120,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,67,111,108,111,114,0,0,0,2,2,90,95,2,0,12,0, -1,103,108,95,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,2,0,11,0,1,103, -108,95,78,111,114,109,97,108,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,86,101,114,116,101,120,0,0,0,2, -2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,48,0,0,0,2,2,90,95, -2,0,12,0,1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,49,0,0,0,2,2,90,95,2,0,12,0, -1,103,108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,50,0,0,0,2,2,90,95,2,0,12,0,1,103, -108,95,77,117,108,116,105,84,101,120,67,111,111,114,100,51,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95, -77,117,108,116,105,84,101,120,67,111,111,114,100,52,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117, -108,116,105,84,101,120,67,111,111,114,100,53,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116, -105,84,101,120,67,111,111,114,100,54,0,0,0,2,2,90,95,2,0,12,0,1,103,108,95,77,117,108,116,105,84, -101,120,67,111,111,114,100,55,0,0,0,2,2,90,95,2,0,9,0,1,103,108,95,70,111,103,67,111,111,114,100,0, -0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110,116,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0, -1,103,108,95,66,97,99,107,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,70,114,111,110, -116,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108,95,66, -97,99,107,83,101,99,111,110,100,97,114,121,67,111,108,111,114,0,0,0,2,2,90,95,3,0,12,0,1,103,108, -95,84,101,120,67,111,111,114,100,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,90,95,3,0,9,0,1,103,108,95,70,111,103,70,114,97,103,67,111,111,114,100,0,0,0, -1,90,95,0,0,12,0,0,102,116,114,97,110,115,102,111,114,109,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -18,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116, -114,105,120,0,16,1,48,0,57,18,103,108,95,86,101,114,116,101,120,0,59,120,120,120,120,0,48,18,103, -108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105, -120,0,16,1,49,0,57,18,103,108,95,86,101,114,116,101,120,0,59,121,121,121,121,0,48,46,18,103,108,95, -77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16, -1,50,0,57,18,103,108,95,86,101,114,116,101,120,0,59,122,122,122,122,0,48,46,18,103,108,95,77,111, -100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,16,1,51,0, -57,18,103,108,95,86,101,114,116,101,120,0,59,119,119,119,119,0,48,46,20,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,49,68,76,111,100,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,9,0, -99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52, -0,0,0,9,18,99,111,111,114,100,52,0,59,120,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100, -52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18, -95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0, -1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, -90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111, -114,100,0,59,120,0,18,99,111,111,114,100,0,59,121,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0, -18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, -12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,76,111,100,0,1,1,0,0,16,0,115,97,109,112, -108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0, -59,120,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108, -111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,49,100,95,98,105,97,115,0,18,95,95,114,101,116,86, -97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0, -116,101,120,116,117,114,101,50,68,76,111,100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0, -10,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114, -100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,20,0,9, -18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, -95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111, -100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0, -108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, -0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18, -112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, -95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99, -111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,76,111, -100,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0, -108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, -0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,122,0,49,20,0,9,18, -112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100, -95,98,105,97,115,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99, -111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,76,111,100,0,1,1,0,0, -18,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0, -0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122, -0,18,99,111,111,114,100,0,59,120,121,122,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111, -100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,116, -101,120,116,117,114,101,51,68,80,114,111,106,76,111,100,0,1,1,0,0,18,0,115,97,109,112,108,101,114, -0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112, -99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,121,122,0,18,99,111,111,114,100,0,59, -120,121,122,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18, -108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,51,100,95,98,105,97,115,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0, -12,0,0,116,101,120,116,117,114,101,67,117,98,101,76,111,100,0,1,1,0,0,19,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1, -99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0, -20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95, -99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,76,111,100,0,1,1,0,0,20,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2, -90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18,99,111,111,114,100,52,0,59,120,121,122,0,18,99, -111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52, -95,116,101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115, -104,97,100,111,119,49,68,80,114,111,106,76,111,100,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1, -1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111, -111,114,100,0,0,0,9,18,112,99,111,111,114,100,0,59,120,0,18,99,111,111,114,100,0,59,120,0,18,99, -111,111,114,100,0,59,119,0,49,20,0,9,18,112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0, -59,122,0,20,0,9,18,112,99,111,111,114,100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116, -101,120,95,49,100,95,98,105,97,115,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0, -18,115,97,109,112,108,101,114,0,0,18,112,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97, -100,111,119,50,68,76,111,100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111, -114,100,0,0,1,1,0,0,9,0,108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,99,111,111,114,100,52,0,0,0,9,18, -99,111,111,114,100,52,0,59,120,121,122,0,18,99,111,111,114,100,0,20,0,9,18,99,111,111,114,100,52,0, -59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95,115, -104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99, -111,111,114,100,52,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,76,111, -100,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,1,1,0,0,9,0, -108,111,100,0,0,0,1,3,2,90,95,0,0,12,0,1,112,99,111,111,114,100,0,0,0,9,18,112,99,111,111,114,100, -0,59,120,121,0,18,99,111,111,114,100,0,59,120,121,0,18,99,111,111,114,100,0,59,119,0,49,20,0,9,18, -112,99,111,111,114,100,0,59,122,0,18,99,111,111,114,100,0,59,122,0,20,0,9,18,112,99,111,111,114, -100,0,59,119,0,18,108,111,100,0,20,0,4,118,101,99,52,95,116,101,120,95,50,100,95,98,105,97,115,95, -115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18, -112,99,111,111,114,100,0,0,0,0,0 -- cgit v1.2.3 From 77a0a3e5ca5dfa951056d9054b4147e3ea0965f3 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Wed, 25 Nov 2009 14:59:29 +0100 Subject: glsl/apps: Make compile more shell friendly. --- src/glsl/apps/compile.c | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index d16dac58681..03e6e58d604 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -33,6 +33,13 @@ #include "../cl/sl_cl_parse.h" +static void +usage(void) +{ + printf("Usage:\n"); + printf(" compile fragment|vertex \n"); +} + int main(int argc, char *argv[]) @@ -55,6 +62,7 @@ main(int argc, unsigned int shader_type; if (argc != 4) { + usage(); return 1; } @@ -63,11 +71,14 @@ main(int argc, } else if (!strcmp(argv[1], "vertex")) { shader_type = 2; } else { + usage(); return 1; } in = fopen(argv[2], "rb"); if (!in) { + printf("Could not open `%s' for read.\n", argv[2]); + usage(); return 1; } @@ -78,6 +89,8 @@ main(int argc, out = fopen(argv[3], "w"); if (!out) { fclose(in); + printf("Could not open `%s' for write.\n", argv[3]); + usage(); return 1; } @@ -87,7 +100,8 @@ main(int argc, fclose(out); fclose(in); - return 1; + printf("Out of memory.\n"); + return 0; } if (fread(inbuf, 1, size, in) != size) { @@ -96,7 +110,8 @@ main(int argc, free(inbuf); fclose(out); fclose(in); - return 1; + printf("Could not read from `%s'.\n", argv[2]); + return 0; } inbuf[size] = '\0'; @@ -110,16 +125,18 @@ main(int argc, free(inbuf); fclose(out); - return 1; + printf("Could not create parse context.\n"); + return 0; } if (sl_pp_tokenise(context, inbuf, &options, &tokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + printf("Error: %s.\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); free(inbuf); fclose(out); - return 1; + return 0; } free(inbuf); @@ -127,19 +144,21 @@ main(int argc, if (sl_pp_version(context, tokens, &version, &tokens_eaten)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + printf("Error: %s\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); free(tokens); fclose(out); - return -1; + return 0; } if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + printf("Error: %s\n", sl_pp_context_error_message(context)); sl_pp_context_destroy(context); free(tokens); fclose(out); - return -1; + return 0; } free(tokens); @@ -194,12 +213,12 @@ main(int argc, free(outbytes); } else { fprintf(out, "$SYNTAXERROR: `%s'\n", errmsg); - return -1; + + printf("Error: %s\n", errmsg); } sl_pp_context_destroy(context); free(outtokens); fclose(out); - return 0; } -- cgit v1.2.3 From ac400ffce62be47fc77e8d10cabcd39b92b6c627 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 30 Nov 2009 20:29:18 +0100 Subject: gallium: interface cleanups, remove nblocksx/y from pipe_texture and more This patch removes nblocksx, nblocksy arrays from pipe_texture (can be recalculated if needed). Furthermore, pipe_format_block struct is gone completely (again, contains just derived state). nblocksx, nblocksy, block are also removed from pipe_transfer, together with the format enum (can be obtained from the texture associated with the transfer). --- src/gallium/auxiliary/draw/draw_pipe_aaline.c | 1 - src/gallium/auxiliary/draw/draw_pipe_pstipple.c | 1 - src/gallium/auxiliary/util/u_blit.c | 1 - src/gallium/auxiliary/util/u_debug.c | 8 +- src/gallium/auxiliary/util/u_format.h | 2 +- src/gallium/auxiliary/util/u_gen_mipmap.c | 12 +-- src/gallium/auxiliary/util/u_linear.c | 2 +- src/gallium/auxiliary/util/u_linear.h | 19 +++- src/gallium/auxiliary/util/u_rect.c | 71 +++++++------ src/gallium/auxiliary/util/u_rect.h | 4 +- src/gallium/auxiliary/util/u_surface.c | 1 - src/gallium/auxiliary/util/u_tile.c | 29 +++--- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 1 - src/gallium/drivers/softpipe/sp_texture.c | 33 +++--- src/gallium/drivers/softpipe/sp_tile_cache.c | 10 +- src/gallium/include/pipe/p_format.h | 123 ++++++++++------------- src/gallium/include/pipe/p_state.h | 8 -- src/mesa/state_tracker/st_cb_drawpixels.c | 8 +- src/mesa/state_tracker/st_cb_fbo.c | 7 +- src/mesa/state_tracker/st_cb_readpixels.c | 14 +-- src/mesa/state_tracker/st_cb_texture.c | 33 +++--- src/mesa/state_tracker/st_gen_mipmap.c | 4 +- src/mesa/state_tracker/st_texture.c | 4 +- 23 files changed, 191 insertions(+), 205 deletions(-) diff --git a/src/gallium/auxiliary/draw/draw_pipe_aaline.c b/src/gallium/auxiliary/draw/draw_pipe_aaline.c index 31de84b272b..8c631a01afe 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_aaline.c +++ b/src/gallium/auxiliary/draw/draw_pipe_aaline.c @@ -401,7 +401,6 @@ aaline_create_texture(struct aaline_stage *aaline) texTemp.width0 = 1 << MAX_TEXTURE_LEVEL; texTemp.height0 = 1 << MAX_TEXTURE_LEVEL; texTemp.depth0 = 1; - pf_get_block(texTemp.format, &texTemp.block); aaline->texture = screen->texture_create(screen, &texTemp); if (!aaline->texture) diff --git a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c index 27d89721b10..7803946baa8 100644 --- a/src/gallium/auxiliary/draw/draw_pipe_pstipple.c +++ b/src/gallium/auxiliary/draw/draw_pipe_pstipple.c @@ -430,7 +430,6 @@ pstip_create_texture(struct pstip_stage *pstip) texTemp.width0 = 32; texTemp.height0 = 32; texTemp.depth0 = 1; - pf_get_block(texTemp.format, &texTemp.block); pstip->texture = screen->texture_create(screen, &texTemp); if (pstip->texture == NULL) diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index 5372df57352..abe1de3302b 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -357,7 +357,6 @@ util_blit_pixels_writemask(struct blit_state *ctx, texTemp.width0 = srcW; texTemp.height0 = srcH; texTemp.depth0 = 1; - pf_get_block(src->format, &texTemp.block); tex = screen->texture_create(screen, &texTemp); if (!tex) diff --git a/src/gallium/auxiliary/util/u_debug.c b/src/gallium/auxiliary/util/u_debug.c index 96d400c839b..40633574b08 100644 --- a/src/gallium/auxiliary/util/u_debug.c +++ b/src/gallium/auxiliary/util/u_debug.c @@ -669,10 +669,10 @@ void debug_dump_surface(const char *prefix, goto error; debug_dump_image(prefix, - transfer->format, - transfer->block.size, - transfer->nblocksx, - transfer->nblocksy, + texture->format, + pf_get_blocksize(texture->format), + pf_get_nblocksx(texture->format, transfer->width), + pf_get_nblocksy(texture->format, transfer->height), transfer->stride, data); diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 7b5b7fcda5b..6740683a618 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -50,7 +50,7 @@ struct util_format_block /** Block height in pixels */ unsigned height; - /** Block size in bytes */ + /** Block size in bits */ unsigned bits; }; diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index f67f1e458d4..83263d9fe64 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -996,7 +996,7 @@ reduce_2d(enum pipe_format pformat, { enum dtype datatype; uint comps; - const int bpt = pf_get_size(pformat); + const int bpt = pf_get_blocksize(pformat); const ubyte *srcA, *srcB; ubyte *dst; int row; @@ -1035,7 +1035,7 @@ reduce_3d(enum pipe_format pformat, int dstWidth, int dstHeight, int dstDepth, int dstRowStride, ubyte *dstPtr) { - const int bpt = pf_get_size(pformat); + const int bpt = pf_get_blocksize(pformat); const int border = 0; int img, row; int bytesPerSrcImage, bytesPerDstImage; @@ -1159,8 +1159,8 @@ make_2d_mipmap(struct gen_mipmap_state *ctx, const uint zslice = 0; uint dstLevel; - assert(pt->block.width == 1); - assert(pt->block.height == 1); + assert(pf_get_blockwidth(pt->format) == 1); + assert(pf_get_blockheight(pt->format) == 1); for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) { const uint srcLevel = dstLevel - 1; @@ -1204,8 +1204,8 @@ make_3d_mipmap(struct gen_mipmap_state *ctx, struct pipe_screen *screen = pipe->screen; uint dstLevel, zslice = 0; - assert(pt->block.width == 1); - assert(pt->block.height == 1); + assert(pf_get_blockwidth(pt->format) == 1); + assert(pf_get_blockheight(pt->format) == 1); for (dstLevel = baseLevel + 1; dstLevel <= lastLevel; dstLevel++) { const uint srcLevel = dstLevel - 1; diff --git a/src/gallium/auxiliary/util/u_linear.c b/src/gallium/auxiliary/util/u_linear.c index a1dce3f5cf4..f1aef216771 100644 --- a/src/gallium/auxiliary/util/u_linear.c +++ b/src/gallium/auxiliary/util/u_linear.c @@ -82,7 +82,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, void pipe_linear_fill_info(struct pipe_tile_info *t, - const struct pipe_format_block *block, + const struct u_linear_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y) { diff --git a/src/gallium/auxiliary/util/u_linear.h b/src/gallium/auxiliary/util/u_linear.h index b74308ffa3d..42c40b2aa75 100644 --- a/src/gallium/auxiliary/util/u_linear.h +++ b/src/gallium/auxiliary/util/u_linear.h @@ -35,6 +35,19 @@ #include "pipe/p_format.h" +struct u_linear_format_block +{ + /** Block size in bytes */ + unsigned size; + + /** Block width in pixels */ + unsigned width; + + /** Block height in pixels */ + unsigned height; +}; + + struct pipe_tile_info { unsigned size; @@ -49,10 +62,10 @@ struct pipe_tile_info unsigned rows; /* Describe the tile in pixels */ - struct pipe_format_block tile; + struct u_linear_format_block tile; /* Describe each block within the tile */ - struct pipe_format_block block; + struct u_linear_format_block block; }; void pipe_linear_to_tile(size_t src_stride, const void *src_ptr, @@ -71,7 +84,7 @@ void pipe_linear_from_tile(struct pipe_tile_info *t, const void *src_ptr, * @tiles_y number of tiles in y axis */ void pipe_linear_fill_info(struct pipe_tile_info *t, - const struct pipe_format_block *block, + const struct u_linear_format_block *block, unsigned tile_width, unsigned tile_height, unsigned tiles_x, unsigned tiles_y); diff --git a/src/gallium/auxiliary/util/u_rect.c b/src/gallium/auxiliary/util/u_rect.c index 9866b6fc8a0..72725b59d2c 100644 --- a/src/gallium/auxiliary/util/u_rect.c +++ b/src/gallium/auxiliary/util/u_rect.c @@ -44,7 +44,7 @@ */ void util_copy_rect(ubyte * dst, - const struct pipe_format_block *block, + enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, @@ -57,27 +57,30 @@ util_copy_rect(ubyte * dst, { unsigned i; int src_stride_pos = src_stride < 0 ? -src_stride : src_stride; + int blocksize = pf_get_blocksize(format); + int blockwidth = pf_get_blockwidth(format); + int blockheight = pf_get_blockheight(format); - assert(block->size > 0); - assert(block->width > 0); - assert(block->height > 0); + assert(blocksize > 0); + assert(blockwidth > 0); + assert(blockheight > 0); assert(src_x >= 0); assert(src_y >= 0); assert(dst_x >= 0); assert(dst_y >= 0); - dst_x /= block->width; - dst_y /= block->height; - width = (width + block->width - 1)/block->width; - height = (height + block->height - 1)/block->height; - src_x /= block->width; - src_y /= block->height; + dst_x /= blockwidth; + dst_y /= blockheight; + width = (width + blockwidth - 1)/blockwidth; + height = (height + blockheight - 1)/blockheight; + src_x /= blockwidth; + src_y /= blockheight; - dst += dst_x * block->size; - src += src_x * block->size; + dst += dst_x * blocksize; + src += src_x * blocksize; dst += dst_y * dst_stride; src += src_y * src_stride_pos; - width *= block->size; + width *= blocksize; if (width == dst_stride && width == src_stride) memcpy(dst, src, height * width); @@ -92,7 +95,7 @@ util_copy_rect(ubyte * dst, void util_fill_rect(ubyte * dst, - const struct pipe_format_block *block, + enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, @@ -102,23 +105,26 @@ util_fill_rect(ubyte * dst, { unsigned i, j; unsigned width_size; + int blocksize = pf_get_blocksize(format); + int blockwidth = pf_get_blockwidth(format); + int blockheight = pf_get_blockheight(format); - assert(block->size > 0); - assert(block->width > 0); - assert(block->height > 0); + assert(blocksize > 0); + assert(blockwidth > 0); + assert(blockheight > 0); assert(dst_x >= 0); assert(dst_y >= 0); - dst_x /= block->width; - dst_y /= block->height; - width = (width + block->width - 1)/block->width; - height = (height + block->height - 1)/block->height; + dst_x /= blockwidth; + dst_y /= blockheight; + width = (width + blockwidth - 1)/blockwidth; + height = (height + blockheight - 1)/blockheight; - dst += dst_x * block->size; + dst += dst_x * blocksize; dst += dst_y * dst_stride; - width_size = width * block->size; + width_size = width * blocksize; - switch (block->size) { + switch (blocksize) { case 1: if(dst_stride == width_size) memset(dst, (ubyte) value, height * width_size); @@ -172,10 +178,15 @@ util_surface_copy(struct pipe_context *pipe, struct pipe_transfer *src_trans, *dst_trans; void *dst_map; const void *src_map; + enum pipe_format src_format, dst_format; assert(src->texture && dst->texture); if (!src->texture || !dst->texture) return; + + src_format = src->texture->format; + dst_format = dst->texture->format; + src_trans = screen->get_tex_transfer(screen, src->texture, src->face, @@ -192,9 +203,9 @@ util_surface_copy(struct pipe_context *pipe, PIPE_TRANSFER_WRITE, dst_x, dst_y, w, h); - assert(dst_trans->block.size == src_trans->block.size); - assert(dst_trans->block.width == src_trans->block.width); - assert(dst_trans->block.height == src_trans->block.height); + assert(pf_get_blocksize(dst_format) == pf_get_blocksize(src_format)); + assert(pf_get_blockwidth(dst_format) == pf_get_blockwidth(src_format)); + assert(pf_get_blockheight(dst_format) == pf_get_blockheight(src_format)); src_map = pipe->screen->transfer_map(screen, src_trans); dst_map = pipe->screen->transfer_map(screen, dst_trans); @@ -205,7 +216,7 @@ util_surface_copy(struct pipe_context *pipe, if (src_map && dst_map) { /* If do_flip, invert src_y position and pass negative src stride */ util_copy_rect(dst_map, - &dst_trans->block, + dst_format, dst_trans->stride, 0, 0, w, h, @@ -259,11 +270,11 @@ util_surface_fill(struct pipe_context *pipe, if (dst_map) { assert(dst_trans->stride > 0); - switch (dst_trans->block.size) { + switch (pf_get_blocksize(dst_trans->texture->format)) { case 1: case 2: case 4: - util_fill_rect(dst_map, &dst_trans->block, dst_trans->stride, + util_fill_rect(dst_map, dst_trans->texture->format, dst_trans->stride, 0, 0, width, height, value); break; case 8: diff --git a/src/gallium/auxiliary/util/u_rect.h b/src/gallium/auxiliary/util/u_rect.h index daa50834d36..5e444ffae21 100644 --- a/src/gallium/auxiliary/util/u_rect.h +++ b/src/gallium/auxiliary/util/u_rect.h @@ -42,13 +42,13 @@ struct pipe_surface; extern void -util_copy_rect(ubyte * dst, const struct pipe_format_block *block, +util_copy_rect(ubyte * dst, enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned width, unsigned height, const ubyte * src, int src_stride, unsigned src_x, int src_y); extern void -util_fill_rect(ubyte * dst, const struct pipe_format_block *block, +util_fill_rect(ubyte * dst, enum pipe_format format, unsigned dst_stride, unsigned dst_x, unsigned dst_y, unsigned width, unsigned height, uint32_t value); diff --git a/src/gallium/auxiliary/util/u_surface.c b/src/gallium/auxiliary/util/u_surface.c index de8c266db83..f828908f0be 100644 --- a/src/gallium/auxiliary/util/u_surface.c +++ b/src/gallium/auxiliary/util/u_surface.c @@ -82,7 +82,6 @@ util_create_rgba_surface(struct pipe_screen *screen, templ.width0 = width; templ.height0 = height; templ.depth0 = 1; - pf_get_block(format, &templ.block); templ.tex_usage = usage; *textureOut = screen->texture_create(screen, &templ); diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 8a22f584bee..4f34f8a1a6b 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -52,7 +52,7 @@ pipe_get_tile_raw(struct pipe_transfer *pt, const void *src; if (dst_stride == 0) - dst_stride = pf_get_nblocksx(&pt->block, w) * pt->block.size; + dst_stride = pf_get_stride(pt->texture->format, w); if (pipe_clip_tile(x, y, &w, &h, pt)) return; @@ -62,7 +62,7 @@ pipe_get_tile_raw(struct pipe_transfer *pt, if(!src) return; - util_copy_rect(dst, &pt->block, dst_stride, 0, 0, w, h, src, pt->stride, x, y); + util_copy_rect(dst, pt->texture->format, dst_stride, 0, 0, w, h, src, pt->stride, x, y); screen->transfer_unmap(screen, pt); } @@ -78,9 +78,10 @@ pipe_put_tile_raw(struct pipe_transfer *pt, { struct pipe_screen *screen = pt->texture->screen; void *dst; + enum pipe_format format = pt->texture->format; if (src_stride == 0) - src_stride = pf_get_nblocksx(&pt->block, w) * pt->block.size; + src_stride = pf_get_stride(format, w); if (pipe_clip_tile(x, y, &w, &h, pt)) return; @@ -90,7 +91,7 @@ pipe_put_tile_raw(struct pipe_transfer *pt, if(!dst) return; - util_copy_rect(dst, &pt->block, pt->stride, x, y, w, h, src, src_stride, 0, 0); + util_copy_rect(dst, format, pt->stride, x, y, w, h, src, src_stride, 0, 0); screen->transfer_unmap(screen, pt); } @@ -1219,21 +1220,22 @@ pipe_get_tile_rgba(struct pipe_transfer *pt, { unsigned dst_stride = w * 4; void *packed; + enum pipe_format format = pt->texture->format; if (pipe_clip_tile(x, y, &w, &h, pt)) return; - packed = MALLOC(pf_get_nblocks(&pt->block, w, h) * pt->block.size); + packed = MALLOC(pf_get_nblocks(format, w, h) * pf_get_blocksize(format)); if (!packed) return; - if(pt->format == PIPE_FORMAT_YCBCR || pt->format == PIPE_FORMAT_YCBCR_REV) + if(format == PIPE_FORMAT_YCBCR || format == PIPE_FORMAT_YCBCR_REV) assert((x & 1) == 0); pipe_get_tile_raw(pt, x, y, w, h, packed, 0); - pipe_tile_raw_to_rgba(pt->format, packed, w, h, p, dst_stride); + pipe_tile_raw_to_rgba(format, packed, w, h, p, dst_stride); FREE(packed); } @@ -1246,16 +1248,17 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, { unsigned src_stride = w * 4; void *packed; + enum pipe_format format = pt->texture->format; if (pipe_clip_tile(x, y, &w, &h, pt)) return; - packed = MALLOC(pf_get_nblocks(&pt->block, w, h) * pt->block.size); + packed = MALLOC(pf_get_nblocks(format, w, h) * pf_get_blocksize(format)); if (!packed) return; - switch (pt->format) { + switch (format) { case PIPE_FORMAT_A8R8G8B8_UNORM: a8r8g8b8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; @@ -1322,7 +1325,7 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, /*z24s8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride);*/ break; default: - debug_printf("%s: unsupported format %s\n", __FUNCTION__, pf_name(pt->format)); + debug_printf("%s: unsupported format %s\n", __FUNCTION__, pf_name(format)); } pipe_put_tile_raw(pt, x, y, w, h, packed, 0); @@ -1344,6 +1347,7 @@ pipe_get_tile_z(struct pipe_transfer *pt, ubyte *map; uint *pDest = z; uint i, j; + enum pipe_format format = pt->texture->format; if (pipe_clip_tile(x, y, &w, &h, pt)) return; @@ -1354,7 +1358,7 @@ pipe_get_tile_z(struct pipe_transfer *pt, return; } - switch (pt->format) { + switch (format) { case PIPE_FORMAT_Z32_UNORM: { const uint *ptrc @@ -1428,6 +1432,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, const uint *ptrc = zSrc; ubyte *map; uint i, j; + enum pipe_format format = pt->texture->format; if (pipe_clip_tile(x, y, &w, &h, pt)) return; @@ -1438,7 +1443,7 @@ pipe_put_tile_z(struct pipe_transfer *pt, return; } - switch (pt->format) { + switch (format) { case PIPE_FORMAT_Z32_UNORM: { uint *pDest = (uint *) (map + y * pt->stride + x*4); diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index 1934965995f..8b4c0dc3a25 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -840,7 +840,6 @@ init_buffers(struct vl_mpeg12_mc_renderer *r) template.height0 = r->pot_buffers ? util_next_power_of_two(r->picture_height) : r->picture_height; template.depth0 = 1; - pf_get_block(template.format, &template.block); template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_DYNAMIC; r->textures.individual.y = r->pipe->screen->texture_create(r->pipe->screen, &template); diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index ac5f61e46f4..bd653216c08 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -63,13 +63,11 @@ softpipe_texture_layout(struct pipe_screen *screen, pt->depth0 = depth; for (level = 0; level <= pt->last_level; level++) { - pt->nblocksx[level] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[level] = pf_get_nblocksy(&pt->block, height); - spt->stride[level] = pt->nblocksx[level]*pt->block.size; + spt->stride[level] = pf_get_stride(pt->format, width); spt->level_offset[level] = buffer_size; - buffer_size += (pt->nblocksy[level] * + buffer_size += (pf_get_nblocksy(pt->format, u_minify(height, level)) * ((pt->target == PIPE_TEXTURE_CUBE) ? 6 : depth) * spt->stride[level]); @@ -97,9 +95,6 @@ softpipe_displaytarget_layout(struct pipe_screen *screen, PIPE_BUFFER_USAGE_GPU_READ_WRITE); unsigned tex_usage = spt->base.tex_usage; - spt->base.nblocksx[0] = pf_get_nblocksx(&spt->base.block, spt->base.width0); - spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height0); - spt->buffer = screen->surface_buffer_create( screen, spt->base.width0, spt->base.height0, @@ -175,8 +170,6 @@ softpipe_texture_blanket(struct pipe_screen * screen, spt->base = *base; pipe_reference_init(&spt->base.reference, 1); spt->base.screen = screen; - spt->base.nblocksx[0] = pf_get_nblocksx(&spt->base.block, spt->base.width0); - spt->base.nblocksy[0] = pf_get_nblocksy(&spt->base.block, spt->base.height0); spt->stride[0] = stride[0]; pipe_buffer_reference(&spt->buffer, buffer); @@ -244,10 +237,12 @@ softpipe_get_tex_surface(struct pipe_screen *screen, ps->zslice = zslice; if (pt->target == PIPE_TEXTURE_CUBE) { - ps->offset += face * pt->nblocksy[level] * spt->stride[level]; + ps->offset += face * pf_get_nblocksy(pt->format, u_minify(pt->height0, level)) * + spt->stride[level]; } else if (pt->target == PIPE_TEXTURE_3D) { - ps->offset += zslice * pt->nblocksy[level] * spt->stride[level]; + ps->offset += zslice * pf_get_nblocksy(pt->format, u_minify(pt->height0, level)) * + spt->stride[level]; } else { assert(face == 0); @@ -302,15 +297,12 @@ softpipe_get_tex_transfer(struct pipe_screen *screen, spt = CALLOC_STRUCT(softpipe_transfer); if (spt) { struct pipe_transfer *pt = &spt->base; + int nblocksy = pf_get_nblocksy(texture->format, u_minify(texture->height0, level)); pipe_texture_reference(&pt->texture, texture); - pt->format = texture->format; - pt->block = texture->block; pt->x = x; pt->y = y; pt->width = w; pt->height = h; - pt->nblocksx = texture->nblocksx[level]; - pt->nblocksy = texture->nblocksy[level]; pt->stride = sptex->stride[level]; pt->usage = usage; pt->face = face; @@ -320,10 +312,10 @@ softpipe_get_tex_transfer(struct pipe_screen *screen, spt->offset = sptex->level_offset[level]; if (texture->target == PIPE_TEXTURE_CUBE) { - spt->offset += face * pt->nblocksy * pt->stride; + spt->offset += face * nblocksy * pt->stride; } else if (texture->target == PIPE_TEXTURE_3D) { - spt->offset += zslice * pt->nblocksy * pt->stride; + spt->offset += zslice * nblocksy * pt->stride; } else { assert(face == 0); @@ -361,9 +353,11 @@ softpipe_transfer_map( struct pipe_screen *screen, { ubyte *map, *xfer_map; struct softpipe_texture *spt; + enum pipe_format format; assert(transfer->texture); spt = softpipe_texture(transfer->texture); + format = transfer->texture->format; map = pipe_buffer_map(screen, spt->buffer, pipe_transfer_buffer_flags(transfer)); if (map == NULL) @@ -380,8 +374,8 @@ softpipe_transfer_map( struct pipe_screen *screen, } xfer_map = map + softpipe_transfer(transfer)->offset + - transfer->y / transfer->block.height * transfer->stride + - transfer->x / transfer->block.width * transfer->block.size; + transfer->y / pf_get_blockheight(format) * transfer->stride + + transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format); /*printf("map = %p xfer map = %p\n", map, xfer_map);*/ return xfer_map; } @@ -438,7 +432,6 @@ softpipe_video_surface_create(struct pipe_screen *screen, template.width0 = util_next_power_of_two(width); template.height0 = util_next_power_of_two(height); template.depth0 = 1; - pf_get_block(template.format, &template.block); template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_RENDER_TARGET; sp_vsfc->tex = screen->texture_create(screen, &template); diff --git a/src/gallium/drivers/softpipe/sp_tile_cache.c b/src/gallium/drivers/softpipe/sp_tile_cache.c index 65872cecc4f..04f61d16c44 100644 --- a/src/gallium/drivers/softpipe/sp_tile_cache.c +++ b/src/gallium/drivers/softpipe/sp_tile_cache.c @@ -238,7 +238,7 @@ clear_tile(struct softpipe_cached_tile *tile, { uint i, j; - switch (pf_get_size(format)) { + switch (pf_get_blocksize(format)) { case 1: memset(tile->data.any, clear_value, TILE_SIZE * TILE_SIZE); break; @@ -284,8 +284,9 @@ sp_tile_cache_flush_clear(struct softpipe_tile_cache *tc) uint x, y; uint numCleared = 0; + assert(pt->texture); /* clear the scratch tile to the clear value */ - clear_tile(&tc->tile, pt->format, tc->clear_val); + clear_tile(&tc->tile, pt->texture->format, tc->clear_val); /* push the tile to all positions marked as clear */ for (y = 0; y < h; y += TILE_SIZE) { @@ -372,6 +373,7 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc, if (addr.value != tile->addr.value) { + assert(pt->texture); if (tile->addr.bits.invalid == 0) { /* put dirty tile back in framebuffer */ if (tc->depth_stencil) { @@ -395,10 +397,10 @@ sp_find_cached_tile(struct softpipe_tile_cache *tc, if (is_clear_flag_set(tc->clear_flags, addr)) { /* don't get tile from framebuffer, just clear it */ if (tc->depth_stencil) { - clear_tile(tile, pt->format, tc->clear_val); + clear_tile(tile, pt->texture->format, tc->clear_val); } else { - clear_tile_rgba(tile, pt->format, tc->clear_color); + clear_tile_rgba(tile, pt->texture->format, tc->clear_color); } clear_clear_flag(tc->clear_flags, addr); } diff --git a/src/gallium/include/pipe/p_format.h b/src/gallium/include/pipe/p_format.h index af230809201..e6bba777d34 100644 --- a/src/gallium/include/pipe/p_format.h +++ b/src/gallium/include/pipe/p_format.h @@ -422,10 +422,11 @@ static INLINE uint pf_get_component_bits( enum pipe_format format, uint comp ) return size << (pf_mixed_scale8( format ) * 3); } + /** - * Return total bits needed for the pixel format. + * Return total bits needed for the pixel format per block. */ -static INLINE uint pf_get_bits( enum pipe_format format ) +static INLINE uint pf_get_blocksizebits( enum pipe_format format ) { switch (pf_layout(format)) { case PIPE_FORMAT_LAYOUT_RGBAZS: @@ -441,8 +442,24 @@ static INLINE uint pf_get_bits( enum pipe_format format ) pf_get_component_bits( format, PIPE_FORMAT_COMP_S ); case PIPE_FORMAT_LAYOUT_YCBCR: assert( format == PIPE_FORMAT_YCBCR || format == PIPE_FORMAT_YCBCR_REV ); - /* return effective bits per pixel */ - return 16; + return 32; + case PIPE_FORMAT_LAYOUT_DXT: + switch(format) { + case PIPE_FORMAT_DXT1_RGBA: + case PIPE_FORMAT_DXT1_RGB: + case PIPE_FORMAT_DXT1_SRGBA: + case PIPE_FORMAT_DXT1_SRGB: + return 64; + case PIPE_FORMAT_DXT3_RGBA: + case PIPE_FORMAT_DXT5_RGBA: + case PIPE_FORMAT_DXT3_SRGBA: + case PIPE_FORMAT_DXT5_SRGBA: + return 128; + default: + assert( 0 ); + return 0; + } + default: assert( 0 ); return 0; @@ -450,102 +467,66 @@ static INLINE uint pf_get_bits( enum pipe_format format ) } /** - * Return bytes per pixel for the given format. + * Return bytes per element for the given format. */ -static INLINE uint pf_get_size( enum pipe_format format ) +static INLINE uint pf_get_blocksize( enum pipe_format format ) { - assert(pf_get_bits(format) % 8 == 0); - return pf_get_bits(format) / 8; + assert(pf_get_blocksizebits(format) % 8 == 0); + return pf_get_blocksizebits(format) / 8; } -/** - * Describe accurately the pixel format. - * - * The chars-per-pixel concept falls apart with compressed and yuv images, where - * more than one pixel are coded in a single data block. This structure - * describes that block. - * - * Simple pixel formats are effectively a 1x1xcpp block. - */ -struct pipe_format_block +static INLINE uint pf_get_blockwidth( enum pipe_format format ) { - /** Block size in bytes */ - unsigned size; - - /** Block width in pixels */ - unsigned width; - - /** Block height in pixels */ - unsigned height; -}; + switch (pf_layout(format)) { + case PIPE_FORMAT_LAYOUT_YCBCR: + return 2; + case PIPE_FORMAT_LAYOUT_DXT: + return 4; + default: + return 1; + } +} -/** - * Describe pixel format's block. - * - * @sa http://msdn2.microsoft.com/en-us/library/ms796147.aspx - */ -static INLINE void -pf_get_block(enum pipe_format format, struct pipe_format_block *block) +static INLINE uint pf_get_blockheight( enum pipe_format format ) { - switch(format) { - case PIPE_FORMAT_DXT1_RGBA: - case PIPE_FORMAT_DXT1_RGB: - case PIPE_FORMAT_DXT1_SRGBA: - case PIPE_FORMAT_DXT1_SRGB: - block->size = 8; - block->width = 4; - block->height = 4; - break; - case PIPE_FORMAT_DXT3_RGBA: - case PIPE_FORMAT_DXT5_RGBA: - case PIPE_FORMAT_DXT3_SRGBA: - case PIPE_FORMAT_DXT5_SRGBA: - block->size = 16; - block->width = 4; - block->height = 4; - break; - case PIPE_FORMAT_YCBCR: - case PIPE_FORMAT_YCBCR_REV: - block->size = 4; /* 2*cpp */ - block->width = 2; - block->height = 1; - break; + switch (pf_layout(format)) { + case PIPE_FORMAT_LAYOUT_DXT: + return 4; default: - block->size = pf_get_size(format); - block->width = 1; - block->height = 1; - break; + return 1; } } static INLINE unsigned -pf_get_nblocksx(const struct pipe_format_block *block, unsigned x) +pf_get_nblocksx(enum pipe_format format, unsigned x) { - return (x + block->width - 1)/block->width; + unsigned blockwidth = pf_get_blockwidth(format); + return (x + blockwidth - 1) / blockwidth; } static INLINE unsigned -pf_get_nblocksy(const struct pipe_format_block *block, unsigned y) +pf_get_nblocksy(enum pipe_format format, unsigned y) { - return (y + block->height - 1)/block->height; + unsigned blockheight = pf_get_blockheight(format); + return (y + blockheight - 1) / blockheight; } static INLINE unsigned -pf_get_nblocks(const struct pipe_format_block *block, unsigned width, unsigned height) +pf_get_nblocks(enum pipe_format format, unsigned width, unsigned height) { - return pf_get_nblocksx(block, width)*pf_get_nblocksy(block, height); + return pf_get_nblocksx(format, width) * pf_get_nblocksy(format, height); } static INLINE size_t -pf_get_stride(const struct pipe_format_block *block, unsigned width) +pf_get_stride(enum pipe_format format, unsigned width) { - return pf_get_nblocksx(block, width)*block->size; + return pf_get_nblocksx(format, width) * pf_get_blocksize(format); } static INLINE size_t -pf_get_2d_size(const struct pipe_format_block *block, size_t stride, unsigned height) +pf_get_2d_size(enum pipe_format format, size_t stride, unsigned height) { - return pf_get_nblocksy(block, height)*stride; + return pf_get_nblocksy(format, height) * stride; } static INLINE boolean diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 9766e86620c..db83c8e1577 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -315,14 +315,10 @@ struct pipe_surface */ struct pipe_transfer { - enum pipe_format format; /**< PIPE_FORMAT_x */ unsigned x; /**< x offset from start of texture image */ unsigned y; /**< y offset from start of texture image */ unsigned width; /**< logical width in pixels */ unsigned height; /**< logical height in pixels */ - struct pipe_format_block block; - unsigned nblocksx; /**< allocated width in blocks */ - unsigned nblocksy; /**< allocated height in blocks */ unsigned stride; /**< stride in bytes between rows of blocks */ enum pipe_transfer_usage usage; /**< PIPE_TRANSFER_* */ @@ -347,10 +343,6 @@ struct pipe_texture unsigned height0; unsigned depth0; - struct pipe_format_block block; - unsigned nblocksx[PIPE_MAX_TEXTURE_LEVELS]; /**< allocated width in blocks */ - unsigned nblocksy[PIPE_MAX_TEXTURE_LEVELS]; /**< allocated height in blocks */ - unsigned last_level:8; /**< Index of last mipmap level present/defined */ unsigned nr_samples:8; /**< for multisampled surfaces, nr of samples */ diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index a68a29e126e..a15043da78d 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -701,7 +701,7 @@ draw_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } /* now pack the stencil (and Z) values in the dest format */ - switch (pt->format) { + switch (pt->texture->format) { case PIPE_FORMAT_S8_UNORM: { ubyte *dest = stmap + spanY * pt->stride + spanX; @@ -856,8 +856,8 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, usage, dstx, dsty, width, height); - assert(ptDraw->block.width == 1); - assert(ptDraw->block.height == 1); + assert(pf_get_blockwidth(ptDraw->texture->format) == 1); + assert(pf_get_blockheight(ptDraw->texture->format) == 1); /* map the stencil buffer */ drawMap = screen->transfer_map(screen, ptDraw); @@ -878,7 +878,7 @@ copy_stencil_pixels(GLcontext *ctx, GLint srcx, GLint srcy, dst = drawMap + y * ptDraw->stride; src = buffer + i * width; - switch (ptDraw->format) { + switch (ptDraw->texture->format) { case PIPE_FORMAT_S8Z24_UNORM: { uint *dst4 = (uint *) dst; diff --git a/src/mesa/state_tracker/st_cb_fbo.c b/src/mesa/state_tracker/st_cb_fbo.c index 659a6c91938..ead8e228887 100644 --- a/src/mesa/state_tracker/st_cb_fbo.c +++ b/src/mesa/state_tracker/st_cb_fbo.c @@ -98,16 +98,14 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, strb->defined = GL_FALSE; /* undefined contents now */ if(strb->software) { - struct pipe_format_block block; size_t size; _mesa_free(strb->data); assert(strb->format != PIPE_FORMAT_NONE); - pf_get_block(strb->format, &block); - strb->stride = pf_get_stride(&block, width); - size = pf_get_2d_size(&block, strb->stride, height); + strb->stride = pf_get_stride(strb->format, width); + size = pf_get_2d_size(strb->format, strb->stride, height); strb->data = _mesa_malloc(size); @@ -127,7 +125,6 @@ st_renderbuffer_alloc_storage(GLcontext * ctx, struct gl_renderbuffer *rb, memset(&template, 0, sizeof(template)); template.target = PIPE_TEXTURE_2D; template.format = format; - pf_get_block(format, &template.block); template.width0 = width; template.height0 = height; template.depth0 = 1; diff --git a/src/mesa/state_tracker/st_cb_readpixels.c b/src/mesa/state_tracker/st_cb_readpixels.c index 103861d6f9c..6fa7bb64f2e 100644 --- a/src/mesa/state_tracker/st_cb_readpixels.c +++ b/src/mesa/state_tracker/st_cb_readpixels.c @@ -103,7 +103,7 @@ st_read_stencil_pixels(GLcontext *ctx, GLint x, GLint y, } /* get stencil (and Z) values */ - switch (pt->format) { + switch (pt->texture->format) { case PIPE_FORMAT_S8_UNORM: { const ubyte *src = stmap + srcY * pt->stride; @@ -431,8 +431,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, const GLint dstStride = _mesa_image_row_stride(&clippedPacking, width, format, type); - if (trans->format == PIPE_FORMAT_S8Z24_UNORM || - trans->format == PIPE_FORMAT_X8Z24_UNORM) { + if (trans->texture->format == PIPE_FORMAT_S8Z24_UNORM || + trans->texture->format == PIPE_FORMAT_X8Z24_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; @@ -463,8 +463,8 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } - else if (trans->format == PIPE_FORMAT_Z24S8_UNORM || - trans->format == PIPE_FORMAT_Z24X8_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z24S8_UNORM || + trans->texture->format == PIPE_FORMAT_Z24X8_UNORM) { if (format == GL_DEPTH_COMPONENT) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; @@ -490,7 +490,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, } } } - else if (trans->format == PIPE_FORMAT_Z16_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z16_UNORM) { for (i = 0; i < height; i++) { GLushort ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; @@ -505,7 +505,7 @@ st_readpixels(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei height, dst += dstStride; } } - else if (trans->format == PIPE_FORMAT_Z32_UNORM) { + else if (trans->texture->format == PIPE_FORMAT_Z32_UNORM) { for (i = 0; i < height; i++) { GLuint ztemp[MAX_WIDTH]; GLfloat zfloat[MAX_WIDTH]; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 3a2337802fa..6d136f5abf3 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -405,7 +405,6 @@ compress_with_blit(GLcontext * ctx, memset(&templ, 0, sizeof(templ)); templ.target = PIPE_TEXTURE_2D; templ.format = st_mesa_format_to_pipe_format(mesa_format); - pf_get_block(templ.format, &templ.block); templ.width0 = width; templ.height0 = height; templ.depth0 = 1; @@ -833,7 +832,7 @@ decompress_with_blit(GLcontext * ctx, GLenum target, GLint level, /* copy/pack data into user buffer */ if (st_equal_formats(stImage->pt->format, format, type)) { /* memcpy */ - const uint bytesPerRow = width * pf_get_size(stImage->pt->format); + const uint bytesPerRow = width * pf_get_blocksize(stImage->pt->format); ubyte *map = screen->transfer_map(screen, tex_xfer); GLuint row; for (row = 0; row < height; row++) { @@ -915,7 +914,7 @@ st_get_tex_image(GLcontext * ctx, GLenum target, GLint level, PIPE_TRANSFER_READ, 0, 0, stImage->base.Width, stImage->base.Height); - texImage->RowStride = stImage->transfer->stride / stImage->pt->block.size; + texImage->RowStride = stImage->transfer->stride / pf_get_blocksize(stImage->pt->format); } else { /* Otherwise, the image should actually be stored in @@ -1163,10 +1162,10 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_image *texImage) { struct st_texture_image *stImage = st_texture_image(texImage); - struct pipe_format_block block; int srcBlockStride; int dstBlockStride; int y; + enum pipe_format pformat= stImage->pt->format; if (stImage->pt) { unsigned face = _mesa_tex_target_to_face(target); @@ -1178,8 +1177,7 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, xoffset, yoffset, width, height); - block = stImage->pt->block; - srcBlockStride = pf_get_stride(&block, width); + srcBlockStride = pf_get_stride(pformat, width); dstBlockStride = stImage->transfer->stride; } else { assert(stImage->pt); @@ -1193,16 +1191,16 @@ st_CompressedTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, return; } - assert(xoffset % block.width == 0); - assert(yoffset % block.height == 0); - assert(width % block.width == 0); - assert(height % block.height == 0); + assert(xoffset % pf_get_blockwidth(pformat) == 0); + assert(yoffset % pf_get_blockheight(pformat) == 0); + assert(width % pf_get_blockwidth(pformat) == 0); + assert(height % pf_get_blockheight(pformat) == 0); - for (y = 0; y < height; y += block.height) { + for (y = 0; y < height; y += pf_get_blockheight(pformat)) { /* don't need to adjust for xoffset and yoffset as st_texture_image_map does that */ - const char *src = (const char*)data + srcBlockStride * pf_get_nblocksy(&block, y); - char *dst = (char*)texImage->Data + dstBlockStride * pf_get_nblocksy(&block, y); - memcpy(dst, src, pf_get_stride(&block, width)); + const char *src = (const char*)data + srcBlockStride * pf_get_nblocksy(pformat, y); + char *dst = (char*)texImage->Data + dstBlockStride * pf_get_nblocksy(pformat, y); + memcpy(dst, src, pf_get_stride(pformat, width)); } if (stImage->pt) { @@ -1692,10 +1690,10 @@ copy_image_data_to_texture(struct st_context *st, dstLevel, stImage->base.Data, stImage->base.RowStride * - stObj->pt->block.size, + pf_get_blocksize(stObj->pt->format), stImage->base.RowStride * stImage->base.Height * - stObj->pt->block.size); + pf_get_blocksize(stObj->pt->format)); _mesa_align_free(stImage->base.Data); stImage->base.Data = NULL; } @@ -1763,8 +1761,7 @@ st_finalize_texture(GLcontext *ctx, stObj->pt->last_level < stObj->lastLevel || stObj->pt->width0 != firstImage->base.Width2 || stObj->pt->height0 != firstImage->base.Height2 || - stObj->pt->depth0 != firstImage->base.Depth2 || - stObj->pt->block.size != blockSize) + stObj->pt->depth0 != firstImage->base.Depth2) { pipe_texture_reference(&stObj->pt, NULL); ctx->st->dirty.st |= ST_NEW_FRAMEBUFFER; diff --git a/src/mesa/state_tracker/st_gen_mipmap.c b/src/mesa/state_tracker/st_gen_mipmap.c index f8068fa12be..77005518302 100644 --- a/src/mesa/state_tracker/st_gen_mipmap.c +++ b/src/mesa/state_tracker/st_gen_mipmap.c @@ -146,8 +146,8 @@ fallback_generate_mipmap(GLcontext *ctx, GLenum target, srcData = (ubyte *) screen->transfer_map(screen, srcTrans); dstData = (ubyte *) screen->transfer_map(screen, dstTrans); - srcStride = srcTrans->stride / srcTrans->block.size; - dstStride = dstTrans->stride / dstTrans->block.size; + srcStride = srcTrans->stride / pf_get_blocksize(srcTrans->texture->format); + dstStride = dstTrans->stride / pf_get_blocksize(dstTrans->texture->format); _mesa_generate_mipmap_level(target, datatype, comps, 0 /*border*/, diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index dbccee86c1c..3035d78b611 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -104,7 +104,6 @@ st_texture_create(struct st_context *st, pt.width0 = width0; pt.height0 = height0; pt.depth0 = depth0; - pf_get_block(format, &pt.block); pt.tex_usage = usage; newtex = screen->texture_create(screen, &pt); @@ -242,8 +241,9 @@ st_surface_data(struct pipe_context *pipe, struct pipe_screen *screen = pipe->screen; void *map = screen->transfer_map(screen, dst); + assert(dst->texture); util_copy_rect(map, - &dst->block, + dst->texture->format, dst->stride, dstx, dsty, width, height, -- cgit v1.2.3 From decf6ed810eae473d043a4a399a5a84f1378a725 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 30 Nov 2009 23:02:49 +0100 Subject: fixups for interface changes (mostly state trackers) --- src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c | 4 +-- src/gallium/drivers/trace/tr_dump_state.c | 24 --------------- src/gallium/drivers/trace/tr_dump_state.h | 3 -- src/gallium/drivers/trace/tr_rbug.c | 13 +++++--- src/gallium/drivers/trace/tr_screen.c | 3 +- src/gallium/state_trackers/dri/dri_drawable.c | 1 - src/gallium/state_trackers/egl/egl_surface.c | 1 - src/gallium/state_trackers/python/gallium.i | 1 - src/gallium/state_trackers/python/p_device.i | 1 - src/gallium/state_trackers/python/p_format.i | 8 ----- src/gallium/state_trackers/python/p_texture.i | 32 ++++---------------- .../state_trackers/python/retrace/interpreter.py | 3 +- src/gallium/state_trackers/python/st_device.c | 3 -- src/gallium/state_trackers/python/st_sample.c | 35 ++++++++++++---------- src/gallium/state_trackers/python/st_sample.h | 1 - .../state_trackers/python/st_softpipe_winsys.c | 19 ++---------- .../state_trackers/python/tests/surface_copy.py | 7 +++-- .../python/tests/texture_transfer.py | 5 ++-- src/gallium/state_trackers/vega/api_filters.c | 1 - src/gallium/state_trackers/vega/image.c | 1 - src/gallium/state_trackers/vega/mask.c | 1 - src/gallium/state_trackers/vega/paint.c | 1 - src/gallium/state_trackers/vega/renderer.c | 1 - src/gallium/state_trackers/vega/vg_tracker.c | 1 - src/gallium/state_trackers/xorg/xorg_crtc.c | 3 +- src/gallium/state_trackers/xorg/xorg_dri2.c | 1 - src/gallium/state_trackers/xorg/xorg_exa.c | 6 ++-- src/gallium/state_trackers/xorg/xorg_renderer.c | 1 - src/gallium/state_trackers/xorg/xorg_xv.c | 1 - .../winsys/drm/nouveau/drm/nouveau_drm_api.c | 3 +- src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 17 ++++------- src/gallium/winsys/egl_xlib/sw_winsys.c | 19 ++---------- src/gallium/winsys/g3dvl/xlib/xsp_winsys.c | 9 ++---- src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c | 17 ++--------- src/gallium/winsys/gdi/gdi_softpipe_winsys.c | 23 ++++---------- src/gallium/winsys/xlib/xlib_cell.c | 20 +++---------- src/gallium/winsys/xlib/xlib_llvmpipe.c | 15 ++++------ src/gallium/winsys/xlib/xlib_softpipe.c | 15 ++++------ 38 files changed, 87 insertions(+), 233 deletions(-) diff --git a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c index 8b4c0dc3a25..bffc018848f 100644 --- a/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c +++ b/src/gallium/auxiliary/vl/vl_mpeg12_mc_renderer.c @@ -1449,7 +1449,7 @@ grab_blocks(struct vl_mpeg12_mc_renderer *r, unsigned mbx, unsigned mby, assert(r); assert(blocks); - tex_pitch = r->tex_transfer[0]->stride / r->tex_transfer[0]->block.size; + tex_pitch = r->tex_transfer[0]->stride / pf_get_blocksize(r->tex_transfer[0]->texture->format); texels = r->texels[0] + mbpy * tex_pitch + mbpx; for (y = 0; y < 2; ++y) { @@ -1488,7 +1488,7 @@ grab_blocks(struct vl_mpeg12_mc_renderer *r, unsigned mbx, unsigned mby, mbpy /= 2; for (tb = 0; tb < 2; ++tb) { - tex_pitch = r->tex_transfer[tb + 1]->stride / r->tex_transfer[tb + 1]->block.size; + tex_pitch = r->tex_transfer[tb + 1]->stride / pf_get_blocksize(r->tex_transfer[tb + 1]->texture->format); texels = r->texels[tb + 1] + mbpy * tex_pitch + mbpx; if ((cbp >> (1 - tb)) & 1) { diff --git a/src/gallium/drivers/trace/tr_dump_state.c b/src/gallium/drivers/trace/tr_dump_state.c index 6d582092941..0102cc18763 100644 --- a/src/gallium/drivers/trace/tr_dump_state.c +++ b/src/gallium/drivers/trace/tr_dump_state.c @@ -43,19 +43,6 @@ void trace_dump_format(enum pipe_format format) } -void trace_dump_block(const struct pipe_format_block *block) -{ - if (!trace_dumping_enabled_locked()) - return; - - trace_dump_struct_begin("pipe_format_block"); - trace_dump_member(uint, block, size); - trace_dump_member(uint, block, width); - trace_dump_member(uint, block, height); - trace_dump_struct_end(); -} - - static void trace_dump_reference(const struct pipe_reference *reference) { if (!trace_dumping_enabled_locked()) @@ -94,10 +81,6 @@ void trace_dump_template(const struct pipe_texture *templat) trace_dump_uint(templat->depth0); trace_dump_member_end(); - trace_dump_member_begin("block"); - trace_dump_block(&templat->block); - trace_dump_member_end(); - trace_dump_member(uint, templat, last_level); trace_dump_member(uint, templat, tex_usage); @@ -483,16 +466,9 @@ void trace_dump_transfer(const struct pipe_transfer *state) trace_dump_struct_begin("pipe_transfer"); - trace_dump_member(format, state, format); trace_dump_member(uint, state, width); trace_dump_member(uint, state, height); - trace_dump_member_begin("block"); - trace_dump_block(&state->block); - trace_dump_member_end(); - - trace_dump_member(uint, state, nblocksx); - trace_dump_member(uint, state, nblocksy); trace_dump_member(uint, state, stride); trace_dump_member(uint, state, usage); diff --git a/src/gallium/drivers/trace/tr_dump_state.h b/src/gallium/drivers/trace/tr_dump_state.h index 05b821adb64..07ad6fbb205 100644 --- a/src/gallium/drivers/trace/tr_dump_state.h +++ b/src/gallium/drivers/trace/tr_dump_state.h @@ -35,11 +35,8 @@ void trace_dump_format(enum pipe_format format); -void trace_dump_block(const struct pipe_format_block *block); - void trace_dump_template(const struct pipe_texture *templat); - void trace_dump_rasterizer_state(const struct pipe_rasterizer_state *state); void trace_dump_poly_stipple(const struct pipe_poly_stipple *state); diff --git a/src/gallium/drivers/trace/tr_rbug.c b/src/gallium/drivers/trace/tr_rbug.c index b59458c0e37..af1d7f3224e 100644 --- a/src/gallium/drivers/trace/tr_rbug.c +++ b/src/gallium/drivers/trace/tr_rbug.c @@ -203,7 +203,9 @@ trace_rbug_texture_info(struct trace_rbug *tr_rbug, struct rbug_header *header, &t->width0, 1, &t->height0, 1, &t->depth0, 1, - t->block.width, t->block.height, t->block.size, + pf_get_blockwidth(t->format), + pf_get_blockheight(t->format), + pf_get_blocksize(t->format), t->last_level, t->nr_samples, t->tex_usage, @@ -251,9 +253,12 @@ trace_rbug_texture_read(struct trace_rbug *tr_rbug, struct rbug_header *header, map = screen->transfer_map(screen, t); rbug_send_texture_read_reply(tr_rbug->con, serial, - t->format, - t->block.width, t->block.height, t->block.size, - (uint8_t*)map, t->stride * t->nblocksy, + t->texture->format, + pf_get_blockwidth(t->texture->format), + pf_get_blockheight(t->texture->format), + pf_get_blocksize(t->texture->format), + (uint8_t*)map, + t->stride * pf_get_nblocksy(t->texture->format, t->height), t->stride, NULL); diff --git a/src/gallium/drivers/trace/tr_screen.c b/src/gallium/drivers/trace/tr_screen.c index 7da9bd3866b..f69f7da000d 100644 --- a/src/gallium/drivers/trace/tr_screen.c +++ b/src/gallium/drivers/trace/tr_screen.c @@ -35,6 +35,7 @@ #include "tr_screen.h" #include "pipe/p_inlines.h" +#include "pipe/p_format.h" static boolean trace = FALSE; @@ -424,7 +425,7 @@ trace_screen_transfer_unmap(struct pipe_screen *_screen, struct pipe_transfer *transfer = tr_trans->transfer; if(tr_trans->map) { - size_t size = transfer->nblocksy * transfer->stride; + size_t size = pf_get_nblocksy(transfer->texture->format, transfer->width) * transfer->stride; trace_dump_call_begin("pipe_screen", "transfer_write"); diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c index 45a6059ea83..099cf1e0645 100644 --- a/src/gallium/state_trackers/dri/dri_drawable.c +++ b/src/gallium/state_trackers/dri/dri_drawable.c @@ -66,7 +66,6 @@ dri_surface_from_handle(struct drm_api *api, templat.format = format; templat.width0 = width; templat.height0 = height; - pf_get_block(templat.format, &templat.block); texture = api->texture_from_shared_handle(api, screen, &templat, "dri2 buffer", pitch, handle); diff --git a/src/gallium/state_trackers/egl/egl_surface.c b/src/gallium/state_trackers/egl/egl_surface.c index ddd9b04cd48..737bdfdd346 100644 --- a/src/gallium/state_trackers/egl/egl_surface.c +++ b/src/gallium/state_trackers/egl/egl_surface.c @@ -118,7 +118,6 @@ drm_create_texture(_EGLDisplay *dpy, templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; templat.width0 = w; templat.height0 = h; - pf_get_block(templat.format, &templat.block); texture = screen->texture_create(dev->screen, &templat); diff --git a/src/gallium/state_trackers/python/gallium.i b/src/gallium/state_trackers/python/gallium.i index 3f79cc1a3d7..8e323f4896d 100644 --- a/src/gallium/state_trackers/python/gallium.i +++ b/src/gallium/state_trackers/python/gallium.i @@ -80,7 +80,6 @@ %rename(Stencil) pipe_stencil_state; %rename(Alpha) pipe_alpha_state; %rename(DepthStencilAlpha) pipe_depth_stencil_alpha_state; -%rename(FormatBlock) pipe_format_block; %rename(Framebuffer) pipe_framebuffer_state; %rename(PolyStipple) pipe_poly_stipple; %rename(Rasterizer) pipe_rasterizer_state; diff --git a/src/gallium/state_trackers/python/p_device.i b/src/gallium/state_trackers/python/p_device.i index a83bcc71a1a..2dc995adb07 100644 --- a/src/gallium/state_trackers/python/p_device.i +++ b/src/gallium/state_trackers/python/p_device.i @@ -112,7 +112,6 @@ struct st_device { struct pipe_texture templat; memset(&templat, 0, sizeof(templat)); templat.format = format; - pf_get_block(templat.format, &templat.block); templat.width0 = width; templat.height0 = height; templat.depth0 = depth; diff --git a/src/gallium/state_trackers/python/p_format.i b/src/gallium/state_trackers/python/p_format.i index 26fb12b387f..68df0093315 100644 --- a/src/gallium/state_trackers/python/p_format.i +++ b/src/gallium/state_trackers/python/p_format.i @@ -152,11 +152,3 @@ enum pipe_format { PIPE_FORMAT_DXT5_SRGBA, }; - -struct pipe_format_block -{ - unsigned size; - unsigned width; - unsigned height; -}; - diff --git a/src/gallium/state_trackers/python/p_texture.i b/src/gallium/state_trackers/python/p_texture.i index 5416b872f53..1de7f86a3c7 100644 --- a/src/gallium/state_trackers/python/p_texture.i +++ b/src/gallium/state_trackers/python/p_texture.i @@ -69,15 +69,7 @@ unsigned get_depth(unsigned level=0) { return u_minify($self->depth0, level); } - - unsigned get_nblocksx(unsigned level=0) { - return $self->nblocksx[level]; - } - - unsigned get_nblocksy(unsigned level=0) { - return $self->nblocksy[level]; - } - + /** Get a surface which is a "view" into a texture */ struct st_surface * get_surface(unsigned face=0, unsigned level=0, unsigned zslice=0) @@ -126,8 +118,6 @@ struct st_surface unsigned format; unsigned width; unsigned height; - unsigned nblocksx; - unsigned nblocksy; ~st_surface() { pipe_texture_reference(&$self->texture, NULL); @@ -142,8 +132,8 @@ struct st_surface struct pipe_transfer *transfer; unsigned stride; - stride = pf_get_nblocksx(&texture->block, w) * texture->block.size; - *LENGTH = pf_get_nblocksy(&texture->block, h) * stride; + stride = pf_get_stride(texture->format, w); + *LENGTH = pf_get_nblocksy(texture->format, h) * stride; *STRING = (char *) malloc(*LENGTH); if(!*STRING) return; @@ -169,9 +159,9 @@ struct st_surface struct pipe_transfer *transfer; if(stride == 0) - stride = pf_get_nblocksx(&texture->block, w) * texture->block.size; + stride = pf_get_stride(texture->format, w); - if(LENGTH < pf_get_nblocksy(&texture->block, h) * stride) + if(LENGTH < pf_get_nblocksy(texture->format, h) * stride) SWIG_exception(SWIG_ValueError, "offset must be smaller than buffer size"); transfer = screen->get_tex_transfer(screen, @@ -383,18 +373,6 @@ struct st_surface { return u_minify(surface->texture->height0, surface->level); } - - static unsigned - st_surface_nblocksx_get(struct st_surface *surface) - { - return surface->texture->nblocksx[surface->level]; - } - - static unsigned - st_surface_nblocksy_get(struct st_surface *surface) - { - return surface->texture->nblocksy[surface->level]; - } %} /* Avoid naming conflict with p_inlines.h's pipe_buffer_read/write */ diff --git a/src/gallium/state_trackers/python/retrace/interpreter.py b/src/gallium/state_trackers/python/retrace/interpreter.py index d0bcb690a9b..3251046c798 100755 --- a/src/gallium/state_trackers/python/retrace/interpreter.py +++ b/src/gallium/state_trackers/python/retrace/interpreter.py @@ -99,7 +99,6 @@ struct_factories = { "pipe_stencil_state": gallium.Stencil, "pipe_alpha_state": gallium.Alpha, "pipe_depth_stencil_alpha_state": gallium.DepthStencilAlpha, - "pipe_format_block": gallium.FormatBlock, #"pipe_framebuffer_state": gallium.Framebuffer, "pipe_poly_stipple": gallium.PolyStipple, "pipe_rasterizer_state": gallium.Rasterizer, @@ -307,7 +306,7 @@ class Screen(Object): def surface_write(self, surface, data, stride, size): if surface is None: return - assert surface.nblocksy * stride == size +# assert surface.nblocksy * stride == size surface.put_tile_raw(0, 0, surface.width, surface.height, data, stride) def get_tex_transfer(self, texture, face, level, zslice, usage, x, y, w, h): diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index a791113abac..2966b24cdcc 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -249,9 +249,6 @@ st_context_create(struct st_device *st_dev) memset( &templat, 0, sizeof( templat ) ); templat.target = PIPE_TEXTURE_2D; templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; - templat.block.size = 4; - templat.block.width = 1; - templat.block.height = 1; templat.width0 = 1; templat.height0 = 1; templat.depth0 = 1; diff --git a/src/gallium/state_trackers/python/st_sample.c b/src/gallium/state_trackers/python/st_sample.c index 6fee90afdaf..97ca2afc543 100644 --- a/src/gallium/state_trackers/python/st_sample.c +++ b/src/gallium/state_trackers/python/st_sample.c @@ -423,7 +423,6 @@ dxt5_rgba_data[] = { static INLINE void st_sample_dxt_pixel_block(enum pipe_format format, - const struct pipe_format_block *block, uint8_t *raw, float *rgba, unsigned rgba_stride, unsigned w, unsigned h) @@ -462,21 +461,21 @@ st_sample_dxt_pixel_block(enum pipe_format format, for(ch = 0; ch < 4; ++ch) rgba[y*rgba_stride + x*4 + ch] = (float)(data[i].rgba[y*4*4 + x*4 + ch])/255.0f; - memcpy(raw, data[i].raw, block->size); + memcpy(raw, data[i].raw, pf_get_blocksize(format)); } static INLINE void st_sample_generic_pixel_block(enum pipe_format format, - const struct pipe_format_block *block, uint8_t *raw, float *rgba, unsigned rgba_stride, unsigned w, unsigned h) { unsigned i; unsigned x, y, ch; + int blocksize = pf_get_blocksize(format); - for(i = 0; i < block->size; ++i) + for(i = 0; i < blocksize; ++i) raw[i] = (uint8_t)st_random(); @@ -503,7 +502,6 @@ st_sample_generic_pixel_block(enum pipe_format format, */ void st_sample_pixel_block(enum pipe_format format, - const struct pipe_format_block *block, void *raw, float *rgba, unsigned rgba_stride, unsigned w, unsigned h) @@ -513,11 +511,11 @@ st_sample_pixel_block(enum pipe_format format, case PIPE_FORMAT_DXT1_RGBA: case PIPE_FORMAT_DXT3_RGBA: case PIPE_FORMAT_DXT5_RGBA: - st_sample_dxt_pixel_block(format, block, raw, rgba, rgba_stride, w, h); + st_sample_dxt_pixel_block(format, raw, rgba, rgba_stride, w, h); break; default: - st_sample_generic_pixel_block(format, block, raw, rgba, rgba_stride, w, h); + st_sample_generic_pixel_block(format, raw, rgba, rgba_stride, w, h); break; } } @@ -548,18 +546,23 @@ st_sample_surface(struct st_surface *surface, float *rgba) raw = screen->transfer_map(screen, transfer); if (raw) { - const struct pipe_format_block *block = &texture->block; + enum pipe_format format = texture->format; uint x, y; + int nblocksx = pf_get_nblocksx(format, width); + int nblocksy = pf_get_nblocksy(format, height); + int blockwidth = pf_get_blockwidth(format); + int blockheight = pf_get_blockheight(format); + int blocksize = pf_get_blocksize(format); - for (y = 0; y < transfer->nblocksy; ++y) { - for (x = 0; x < transfer->nblocksx; ++x) { - st_sample_pixel_block(texture->format, - block, - (uint8_t *) raw + y * transfer->stride + x * block->size, - rgba + y * block->height * rgba_stride + x * block->width * 4, + + for (y = 0; y < nblocksy; ++y) { + for (x = 0; x < nblocksx; ++x) { + st_sample_pixel_block(format, + (uint8_t *) raw + y * transfer->stride + x * blocksize, + rgba + y * blockheight * rgba_stride + x * blockwidth * 4, rgba_stride, - MIN2(block->width, width - x*block->width), - MIN2(block->height, height - y*block->height)); + MIN2(blockwidth, width - x*blockwidth), + MIN2(blockheight, height - y*blockheight)); } } diff --git a/src/gallium/state_trackers/python/st_sample.h b/src/gallium/state_trackers/python/st_sample.h index 0a27083549f..888114d3021 100644 --- a/src/gallium/state_trackers/python/st_sample.h +++ b/src/gallium/state_trackers/python/st_sample.h @@ -35,7 +35,6 @@ void st_sample_pixel_block(enum pipe_format format, - const struct pipe_format_block *block, void *raw, float *rgba, unsigned rgba_stride, unsigned w, unsigned h); diff --git a/src/gallium/state_trackers/python/st_softpipe_winsys.c b/src/gallium/state_trackers/python/st_softpipe_winsys.c index f0abd12e3dc..43c61af1ffd 100644 --- a/src/gallium/state_trackers/python/st_softpipe_winsys.c +++ b/src/gallium/state_trackers/python/st_softpipe_winsys.c @@ -157,16 +157,6 @@ st_softpipe_user_buffer_create(struct pipe_winsys *winsys, } -/** - * Round n up to next multiple. - */ -static INLINE unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - - static struct pipe_buffer * st_softpipe_surface_buffer_create(struct pipe_winsys *winsys, unsigned width, unsigned height, @@ -176,13 +166,10 @@ st_softpipe_surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; + unsigned nblocksy; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = round_up(nblocksx * block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); return winsys->buffer_create(winsys, alignment, usage, diff --git a/src/gallium/state_trackers/python/tests/surface_copy.py b/src/gallium/state_trackers/python/tests/surface_copy.py index 3ceecbbd3aa..df5babb78af 100755 --- a/src/gallium/state_trackers/python/tests/surface_copy.py +++ b/src/gallium/state_trackers/python/tests/surface_copy.py @@ -98,9 +98,10 @@ class TextureTest(TestCase): y = 0 w = dst_surface.width h = dst_surface.height - - stride = dst_surface.nblocksx * dst_texture.block.size - size = dst_surface.nblocksy * stride + + # ??? + stride = pf_get_stride(texture->format, w) + size = pf_get_nblocksy(texture->format) * stride src_raw = os.urandom(size) src_surface.put_tile_raw(0, 0, w, h, src_raw, stride) diff --git a/src/gallium/state_trackers/python/tests/texture_transfer.py b/src/gallium/state_trackers/python/tests/texture_transfer.py index e65b425adf4..35daca9e498 100755 --- a/src/gallium/state_trackers/python/tests/texture_transfer.py +++ b/src/gallium/state_trackers/python/tests/texture_transfer.py @@ -86,8 +86,9 @@ class TextureTest(TestCase): surface = texture.get_surface(face, level, zslice) - stride = surface.nblocksx * texture.block.size - size = surface.nblocksy * stride + # ??? + stride = pf_get_stride(texture->format, w) + size = pf_get_nblocksy(texture->format) * stride in_raw = os.urandom(size) diff --git a/src/gallium/state_trackers/vega/api_filters.c b/src/gallium/state_trackers/vega/api_filters.c index faf396d0877..eb135c1ff4f 100644 --- a/src/gallium/state_trackers/vega/api_filters.c +++ b/src/gallium/state_trackers/vega/api_filters.c @@ -71,7 +71,6 @@ static INLINE struct pipe_texture *create_texture_1d(struct vg_context *ctx, templ.width0 = color_data_len; templ.height0 = 1; templ.depth0 = 1; - pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block); templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER; tex = screen->texture_create(screen, &templ); diff --git a/src/gallium/state_trackers/vega/image.c b/src/gallium/state_trackers/vega/image.c index 4684a5727dd..172311851e9 100644 --- a/src/gallium/state_trackers/vega/image.c +++ b/src/gallium/state_trackers/vega/image.c @@ -270,7 +270,6 @@ struct vg_image * image_create(VGImageFormat format, memset(&pt, 0, sizeof(pt)); pt.target = PIPE_TEXTURE_2D; pt.format = pformat; - pf_get_block(pformat, &pt.block); pt.last_level = 0; pt.width0 = width; pt.height0 = height; diff --git a/src/gallium/state_trackers/vega/mask.c b/src/gallium/state_trackers/vega/mask.c index b84103fdbac..868c28239a3 100644 --- a/src/gallium/state_trackers/vega/mask.c +++ b/src/gallium/state_trackers/vega/mask.c @@ -491,7 +491,6 @@ struct vg_mask_layer * mask_layer_create(VGint width, VGint height) memset(&pt, 0, sizeof(pt)); pt.target = PIPE_TEXTURE_2D; pt.format = PIPE_FORMAT_A8R8G8B8_UNORM; - pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &pt.block); pt.last_level = 0; pt.width0 = width; pt.height0 = height; diff --git a/src/gallium/state_trackers/vega/paint.c b/src/gallium/state_trackers/vega/paint.c index e8ca7d9e89b..785c9829432 100644 --- a/src/gallium/state_trackers/vega/paint.c +++ b/src/gallium/state_trackers/vega/paint.c @@ -154,7 +154,6 @@ static INLINE struct pipe_texture *create_gradient_texture(struct vg_paint *p) templ.width0 = 1024; templ.height0 = 1; templ.depth0 = 1; - pf_get_block(PIPE_FORMAT_A8R8G8B8_UNORM, &templ.block); templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER; tex = screen->texture_create(screen, &templ); diff --git a/src/gallium/state_trackers/vega/renderer.c b/src/gallium/state_trackers/vega/renderer.c index 9085ed1bfe0..c85dae0282e 100644 --- a/src/gallium/state_trackers/vega/renderer.c +++ b/src/gallium/state_trackers/vega/renderer.c @@ -448,7 +448,6 @@ void renderer_copy_surface(struct renderer *ctx, texTemp.width0 = srcW; texTemp.height0 = srcH; texTemp.depth0 = 1; - pf_get_block(src->format, &texTemp.block); tex = screen->texture_create(screen, &texTemp); if (!tex) diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index d28463dd1b8..ed18dd60751 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -50,7 +50,6 @@ create_texture(struct pipe_context *pipe, enum pipe_format format, } templ.target = PIPE_TEXTURE_2D; - pf_get_block(templ.format, &templ.block); templ.width0 = width; templ.height0 = height; templ.depth0 = 1; diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index c4751724c99..0d1844b53c1 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -191,7 +191,6 @@ crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image) templat.format = PIPE_FORMAT_A8R8G8B8_UNORM; templat.width0 = 64; templat.height0 = 64; - pf_get_block(templat.format, &templat.block); crtcp->cursor_tex = ms->screen->texture_create(ms->screen, &templat); @@ -207,7 +206,7 @@ crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 * image) PIPE_TRANSFER_WRITE, 0, 0, 64, 64); ptr = ms->screen->transfer_map(ms->screen, transfer); - util_copy_rect(ptr, &crtcp->cursor_tex->block, + util_copy_rect(ptr, crtcp->cursor_tex->format, transfer->stride, 0, 0, 64, 64, (void*)image, 64 * 4, 0, 0); ms->screen->transfer_unmap(ms->screen, transfer); diff --git a/src/gallium/state_trackers/xorg/xorg_dri2.c b/src/gallium/state_trackers/xorg/xorg_dri2.c index 406e0afff4b..d3bb3813334 100644 --- a/src/gallium/state_trackers/xorg/xorg_dri2.c +++ b/src/gallium/state_trackers/xorg/xorg_dri2.c @@ -108,7 +108,6 @@ driDoCreateBuffer(DrawablePtr pDraw, DRI2BufferPtr buffer, unsigned int format) else template.format = ms->ds_depth_bits_last ? PIPE_FORMAT_S8Z24_UNORM : PIPE_FORMAT_Z24S8_UNORM; - pf_get_block(template.format, &template.block); template.width0 = pDraw->width; template.height0 = pDraw->height; template.depth0 = 1; diff --git a/src/gallium/state_trackers/xorg/xorg_exa.c b/src/gallium/state_trackers/xorg/xorg_exa.c index a68a626fa48..c02ed39ca1c 100644 --- a/src/gallium/state_trackers/xorg/xorg_exa.c +++ b/src/gallium/state_trackers/xorg/xorg_exa.c @@ -206,7 +206,7 @@ ExaDownloadFromScreen(PixmapPtr pPix, int x, int y, int w, int h, char *dst, x, y, w, h, dst_pitch); #endif - util_copy_rect((unsigned char*)dst, &priv->tex->block, dst_pitch, 0, 0, + util_copy_rect((unsigned char*)dst, priv->tex->format, dst_pitch, 0, 0, w, h, exa->scrn->transfer_map(exa->scrn, transfer), transfer->stride, 0, 0); @@ -246,7 +246,7 @@ ExaUploadToScreen(PixmapPtr pPix, int x, int y, int w, int h, char *src, #endif util_copy_rect(exa->scrn->transfer_map(exa->scrn, transfer), - &priv->tex->block, transfer->stride, 0, 0, w, h, + priv->tex->format, transfer->stride, 0, 0, w, h, (unsigned char*)src, src_pitch, 0, 0); exa->scrn->transfer_unmap(exa->scrn, transfer); @@ -761,7 +761,6 @@ ExaModifyPixmapHeader(PixmapPtr pPixmap, int width, int height, memset(&template, 0, sizeof(template)); template.target = PIPE_TEXTURE_2D; exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &priv->picture_format); - pf_get_block(template.format, &template.block); template.width0 = width; template.height0 = height; template.depth0 = 1; @@ -840,7 +839,6 @@ xorg_exa_create_root_texture(ScrnInfoPtr pScrn, memset(&template, 0, sizeof(template)); template.target = PIPE_TEXTURE_2D; exa_get_pipe_format(depth, &template.format, &bitsPerPixel, &dummy); - pf_get_block(template.format, &template.block); template.width0 = width; template.height0 = height; template.depth0 = 1; diff --git a/src/gallium/state_trackers/xorg/xorg_renderer.c b/src/gallium/state_trackers/xorg/xorg_renderer.c index 418a8dd88bd..5c34e71b1be 100644 --- a/src/gallium/state_trackers/xorg/xorg_renderer.c +++ b/src/gallium/state_trackers/xorg/xorg_renderer.c @@ -733,7 +733,6 @@ create_sampler_texture(struct xorg_renderer *r, templ.width0 = src->width0; templ.height0 = src->height0; templ.depth0 = 1; - pf_get_block(format, &templ.block); templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER; pt = screen->texture_create(screen, &templ); diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index bb515a0f49b..459ab3c64e8 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -170,7 +170,6 @@ create_component_texture(struct pipe_context *pipe, templ.width0 = width; templ.height0 = height; templ.depth0 = 1; - pf_get_block(PIPE_FORMAT_L8_UNORM, &templ.block); templ.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER; tex = screen->texture_create(screen, &templ); diff --git a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c index d4978613247..8d95826c9a2 100644 --- a/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c +++ b/src/gallium/winsys/drm/nouveau/drm/nouveau_drm_api.c @@ -28,7 +28,6 @@ dri_surface_from_handle(struct drm_api *api, struct pipe_screen *pscreen, tmpl.format = format; tmpl.width0 = width; tmpl.height0 = height; - pf_get_block(tmpl.format, &tmpl.block); pt = api->texture_from_shared_handle(api, pscreen, &tmpl, "front buffer", pitch, handle); @@ -247,7 +246,7 @@ nouveau_drm_handle_from_pt(struct drm_api *api, struct pipe_screen *pscreen, return false; *handle = mt->bo->handle; - *stride = mt->base.nblocksx[0] * mt->base.block.size; + *stride = pf_get_stride(mt->base.format, mt->base.width0); return true; } diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 74afffc9cfa..65f7babff2d 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -113,17 +113,13 @@ static struct pipe_buffer *radeon_surface_buffer_create(struct pipe_winsys *ws, unsigned tex_usage, unsigned *stride) { - struct pipe_format_block block; - unsigned nblocksx, nblocksy, size; - - pf_get_block(format, &block); - - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - /* Radeons enjoy things in multiples of 32. */ /* XXX this can be 32 when POT */ - *stride = (nblocksx * block.size + 63) & ~63; + const unsigned alignment = 64; + unsigned nblocksy, size; + + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); size = *stride * nblocksy; return radeon_buffer_create(ws, 64, usage, size); @@ -321,9 +317,6 @@ struct pipe_surface *radeon_surface_from_handle(struct radeon_context *radeon_co tmpl.height0 = h; tmpl.depth0 = 1; tmpl.format = format; - pf_get_block(tmpl.format, &tmpl.block); - tmpl.nblocksx[0] = pf_get_nblocksx(&tmpl.block, w); - tmpl.nblocksy[0] = pf_get_nblocksy(&tmpl.block, h); pt = pipe_screen->texture_blanket(pipe_screen, &tmpl, &pitch, pb); if (pt == NULL) { diff --git a/src/gallium/winsys/egl_xlib/sw_winsys.c b/src/gallium/winsys/egl_xlib/sw_winsys.c index 79ff2cc985d..d5644c161fa 100644 --- a/src/gallium/winsys/egl_xlib/sw_winsys.c +++ b/src/gallium/winsys/egl_xlib/sw_winsys.c @@ -71,16 +71,6 @@ sw_pipe_buffer(struct pipe_buffer *b) } -/** - * Round n up to next multiple. - */ -static INLINE unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - - static const char * get_name(struct pipe_winsys *pws) { @@ -170,13 +160,10 @@ surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; + unsigned nblocksy; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = round_up(nblocksx * block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); return winsys->buffer_create(winsys, alignment, usage, diff --git a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c index 08067aad64c..b8c8502d7bb 100644 --- a/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c +++ b/src/gallium/winsys/g3dvl/xlib/xsp_winsys.c @@ -138,13 +138,10 @@ static struct pipe_buffer* xsp_surface_buffer_create ) { const unsigned int ALIGNMENT = 1; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; + unsigned nblocksy; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = align(nblocksx * block.size, ALIGNMENT); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), ALIGNMENT); return pws->buffer_create(pws, ALIGNMENT, usage, *stride * nblocksy); diff --git a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c index e8bc0f55ac4..81c46c0a96f 100644 --- a/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_llvmpipe_winsys.c @@ -49,7 +49,6 @@ struct gdi_llvmpipe_displaytarget { enum pipe_format format; - struct pipe_format_block block; unsigned width; unsigned height; unsigned stride; @@ -118,16 +117,6 @@ gdi_llvmpipe_displaytarget_destroy(struct llvmpipe_winsys *winsys, } -/** - * Round n up to next multiple. - */ -static INLINE unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - - static struct llvmpipe_displaytarget * gdi_llvmpipe_displaytarget_create(struct llvmpipe_winsys *winsys, enum pipe_format format, @@ -147,10 +136,10 @@ gdi_llvmpipe_displaytarget_create(struct llvmpipe_winsys *winsys, gdt->width = width; gdt->height = height; - bpp = pf_get_bits(format); - cpp = pf_get_size(format); + bpp = pf_get_blocksizebits(format); + cpp = pf_get_blocksize(format); - gdt->stride = round_up(width * cpp, alignment); + gdt->stride = align(width * cpp, alignment); gdt->size = gdt->stride * height; gdt->data = align_malloc(gdt->size, alignment); diff --git a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c index 5e0ccf32f48..173fa5b6fe0 100644 --- a/src/gallium/winsys/gdi/gdi_softpipe_winsys.c +++ b/src/gallium/winsys/gdi/gdi_softpipe_winsys.c @@ -151,16 +151,6 @@ gdi_softpipe_user_buffer_create(struct pipe_winsys *winsys, } -/** - * Round n up to next multiple. - */ -static INLINE unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - - static struct pipe_buffer * gdi_softpipe_surface_buffer_create(struct pipe_winsys *winsys, unsigned width, unsigned height, @@ -170,13 +160,10 @@ gdi_softpipe_surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; + unsigned nblocksy; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = round_up(nblocksx * block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); return winsys->buffer_create(winsys, alignment, usage, @@ -283,10 +270,10 @@ gdi_softpipe_present(struct pipe_screen *screen, memset(&bmi, 0, sizeof(BITMAPINFO)); bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER); - bmi.bmiHeader.biWidth = texture->stride[surface->level] / pf_get_size(surface->format); + bmi.bmiHeader.biWidth = texture->stride[surface->level] / pf_get_blocksize(surface->format); bmi.bmiHeader.biHeight= -(long)surface->height; bmi.bmiHeader.biPlanes = 1; - bmi.bmiHeader.biBitCount = pf_get_bits(surface->format); + bmi.bmiHeader.biBitCount = pf_get_blocksizebits(surface->format); bmi.bmiHeader.biCompression = BI_RGB; bmi.bmiHeader.biSizeImage = 0; bmi.bmiHeader.biXPelsPerMeter = 0; diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 13e609f58fe..6e984ebe3c7 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -277,15 +277,6 @@ xm_user_buffer_create(struct pipe_winsys *pws, void *ptr, unsigned bytes) -/** - * Round n up to next multiple. - */ -static INLINE unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - static struct pipe_buffer * xm_surface_buffer_create(struct pipe_winsys *winsys, unsigned width, unsigned height, @@ -294,18 +285,15 @@ xm_surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy; + unsigned nblocksy; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = round_up(nblocksx * block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); return winsys->buffer_create(winsys, alignment, usage, /* XXX a bit of a hack */ - *stride * round_up(nblocksy, TILE_SIZE)); + *stride * align(nblocksy, TILE_SIZE)); } diff --git a/src/gallium/winsys/xlib/xlib_llvmpipe.c b/src/gallium/winsys/xlib/xlib_llvmpipe.c index 3dd15e099b0..41f3e248e84 100644 --- a/src/gallium/winsys/xlib/xlib_llvmpipe.c +++ b/src/gallium/winsys/xlib/xlib_llvmpipe.c @@ -58,7 +58,6 @@ struct xm_displaytarget { enum pipe_format format; - struct pipe_format_block block; unsigned width; unsigned height; unsigned stride; @@ -262,10 +261,10 @@ xm_llvmpipe_display(struct xmesa_buffer *xm_buffer, { if (xm_dt->tempImage == NULL) { - assert(xm_dt->block.width == 1); - assert(xm_dt->block.height == 1); + assert(pf_get_blockwidth(xm_dt->format) == 1); + assert(pf_get_blockheight(xm_dt->format) == 1); alloc_shm_ximage(xm_dt, xm_buffer, - xm_dt->stride / xm_dt->block.size, + xm_dt->stride / pf_get_blocksize(xm_dt->format), xm_dt->height); } @@ -321,7 +320,7 @@ xm_displaytarget_create(struct llvmpipe_winsys *winsys, unsigned *stride) { struct xm_displaytarget *xm_dt = CALLOC_STRUCT(xm_displaytarget); - unsigned nblocksx, nblocksy, size; + unsigned nblocksy, size; xm_dt = CALLOC_STRUCT(xm_displaytarget); if(!xm_dt) @@ -331,10 +330,8 @@ xm_displaytarget_create(struct llvmpipe_winsys *winsys, xm_dt->width = width; xm_dt->height = height; - pf_get_block(format, &xm_dt->block); - nblocksx = pf_get_nblocksx(&xm_dt->block, width); - nblocksy = pf_get_nblocksy(&xm_dt->block, height); - xm_dt->stride = align(nblocksx * xm_dt->block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + xm_dt->stride = align(pf_get_stride(format, width), alignment); size = xm_dt->stride * nblocksy; #ifdef USE_XSHM diff --git a/src/gallium/winsys/xlib/xlib_softpipe.c b/src/gallium/winsys/xlib/xlib_softpipe.c index 260b39e2a0f..69a5dcc2b78 100644 --- a/src/gallium/winsys/xlib/xlib_softpipe.c +++ b/src/gallium/winsys/xlib/xlib_softpipe.c @@ -254,10 +254,10 @@ xlib_softpipe_display_surface(struct xmesa_buffer *b, { if (xm_buf->tempImage == NULL) { - assert(surf->texture->block.width == 1); - assert(surf->texture->block.height == 1); + assert(pf_get_blockwidth(surf->texture->format) == 1); + assert(pf_get_blockheight(surf->texture->format) == 1); alloc_shm_ximage(xm_buf, b, spt->stride[surf->level] / - surf->texture->block.size, surf->height); + pf_get_blocksize(surf->texture->format), surf->height); } ximage = xm_buf->tempImage; @@ -360,13 +360,10 @@ xm_surface_buffer_create(struct pipe_winsys *winsys, unsigned *stride) { const unsigned alignment = 64; - struct pipe_format_block block; - unsigned nblocksx, nblocksy, size; + unsigned nblocksy, size; - pf_get_block(format, &block); - nblocksx = pf_get_nblocksx(&block, width); - nblocksy = pf_get_nblocksy(&block, height); - *stride = align(nblocksx * block.size, alignment); + nblocksy = pf_get_nblocksy(format, height); + *stride = align(pf_get_stride(format, width), alignment); size = *stride * nblocksy; #ifdef USE_XSHM -- cgit v1.2.3 From 910aaed4daad319b584b68ae2468432c8f6bac21 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 30 Nov 2009 17:55:21 -0800 Subject: mesa: set version string to 7.6.1-rc2 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index 3e9143979a9..e2fed570809 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-rc1" +#define MESA_VERSION_STRING "7.6.1-rc2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 8c26cefec7ad52c4fa52fd1a89e18f463b85257b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 30 Nov 2009 08:41:37 -0700 Subject: st/mesa: updated emit_swz() comment --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 3d6c2158191..bd94c9d79e8 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -278,7 +278,7 @@ static struct ureg_src swizzle_4v( struct ureg_src src, /** - * Translate SWZ instructions into a single MAD. EG: + * Translate a SWZ instruction into a MOV, MUL or MAD instruction. EG: * * SWZ dst, src.x-y10 * -- cgit v1.2.3 From c8cdce665790263bb2142d894a81c87abc4da9fb Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 1 Dec 2009 13:26:15 -0700 Subject: vbo: make flush recursion check code per-context This fixes invalid failed assertions when running multi-threaded apps. --- src/mesa/vbo/vbo_exec.h | 4 ++++ src/mesa/vbo/vbo_exec_api.c | 11 ++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mesa/vbo/vbo_exec.h b/src/mesa/vbo/vbo_exec.h index 0a05b8df894..98c1f363d98 100644 --- a/src/mesa/vbo/vbo_exec.h +++ b/src/mesa/vbo/vbo_exec.h @@ -138,6 +138,10 @@ struct vbo_exec_context */ const struct gl_client_array *inputs[VERT_ATTRIB_MAX]; } array; + +#ifdef DEBUG + GLint flush_call_depth; +#endif }; diff --git a/src/mesa/vbo/vbo_exec_api.c b/src/mesa/vbo/vbo_exec_api.c index c90565eae8c..f0a7eeadd0f 100644 --- a/src/mesa/vbo/vbo_exec_api.c +++ b/src/mesa/vbo/vbo_exec_api.c @@ -876,9 +876,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) #ifdef DEBUG /* debug check: make sure we don't get called recursively */ - static GLuint callDepth = 0; - callDepth++; - assert(callDepth == 1); + exec->flush_call_depth++; + assert(exec->flush_call_depth == 1); #endif if (0) _mesa_printf("%s\n", __FUNCTION__); @@ -886,7 +885,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) if (exec->ctx->Driver.CurrentExecPrimitive != PRIM_OUTSIDE_BEGIN_END) { if (0) _mesa_printf("%s - inside begin/end\n", __FUNCTION__); #ifdef DEBUG - callDepth--; + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); #endif return; } @@ -903,7 +903,8 @@ void vbo_exec_FlushVertices( GLcontext *ctx, GLuint flags ) exec->ctx->Driver.NeedFlush &= ~flags; #ifdef DEBUG - callDepth--; + exec->flush_call_depth--; + assert(exec->flush_call_depth == 0); #endif } -- cgit v1.2.3 From e84dddde9b6eb7727760814ae211c95218bb28a3 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Wed, 2 Dec 2009 11:01:19 +1000 Subject: Revert "radeon/r300: no need to flush the cmdbuf when changing scissors state in KMM mode" This reverts commit 286bf89e5a1fc931dbf523ded861b809859485e2. This doesn't appear to be correct, regression so revert it. http://bugs.freedesktop.org/show_bug.cgi?id=25193 --- src/mesa/drivers/dri/r300/r300_state.c | 3 +-- src/mesa/drivers/dri/radeon/radeon_common.c | 4 +--- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index 1fd32d497b4..ac20c08e201 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -1741,8 +1741,7 @@ static void r300Enable(GLcontext * ctx, GLenum cap, GLboolean state) r300SetPolygonOffsetState(ctx, state); break; case GL_SCISSOR_TEST: - if (!rmesa->radeon.radeonScreen->kernel_mm) - radeon_firevertices(&rmesa->radeon); + radeon_firevertices(&rmesa->radeon); rmesa->radeon.state.scissor.enabled = state; radeonUpdateScissor( ctx ); break; diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 3b4366aa61c..184287aa44c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -257,9 +257,7 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) radeonContextPtr radeon = RADEON_CONTEXT(ctx); if (ctx->Scissor.Enabled) { /* We don't pipeline cliprect changes */ - if (!radeon->radeonScreen->kernel_mm) { - radeon_firevertices(radeon); - } + radeon_firevertices(radeon); radeonUpdateScissor(ctx); } } -- cgit v1.2.3 From b2581dcab41c142c38f2e065c4348cb892931c48 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 2 Dec 2009 17:05:20 +0000 Subject: wgl: Call st_swapbuffers instead of st_notify_swapbuffers. This will get single buffer, double buffer, and joint single/double buffer (typical in CAD applications) done right, at least as far as the frambuffer is concerned. There are still problems with multiple contexts using the same framebuffer because st_framebuffer_* calls assume the framebuffer is bound to a single context. --- src/gallium/state_trackers/wgl/stw_device.c | 14 +---------- src/gallium/state_trackers/wgl/stw_framebuffer.c | 31 ++++++------------------ src/gallium/state_trackers/wgl/stw_framebuffer.h | 3 ++- 3 files changed, 10 insertions(+), 38 deletions(-) diff --git a/src/gallium/state_trackers/wgl/stw_device.c b/src/gallium/state_trackers/wgl/stw_device.c index 985b8f0456a..7785aba4677 100644 --- a/src/gallium/state_trackers/wgl/stw_device.c +++ b/src/gallium/state_trackers/wgl/stw_device.c @@ -72,19 +72,7 @@ stw_flush_frontbuffer(struct pipe_screen *screen, return; } -#if DEBUG - { - /* ensure that a random surface was not passed to us */ - struct pipe_surface *surface2; - - if(!st_get_framebuffer_surface( fb->stfb, ST_SURFACE_FRONT_LEFT, &surface2 )) - assert(0); - else - assert(surface2 == surface); - } -#endif - - stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_FRONT_LEFT); + stw_framebuffer_present_locked(hdc, fb, surface); } diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.c b/src/gallium/state_trackers/wgl/stw_framebuffer.c index 8a3e11b6b40..6d095019815 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.c +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.c @@ -475,8 +475,6 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data) struct stw_framebuffer *fb; struct pipe_screen *screen; struct pipe_surface *surface; - unsigned surface_index; - BOOL ret = FALSE; fb = stw_framebuffer_from_hdc( hdc ); if (fb == NULL) @@ -484,9 +482,7 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data) screen = stw_dev->screen; - surface_index = (unsigned)(uintptr_t)data->pPrivateData; - if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface )) - goto fail; + surface = (struct pipe_surface *)data->pPrivateData; #ifdef DEBUG if(stw_dev->trace_running) { @@ -520,15 +516,11 @@ DrvPresentBuffers(HDC hdc, PGLPRESENTBUFFERSDATA data) stw_dev->stw_winsys->present( screen, surface, hdc ); } - ret = TRUE; - -fail: - stw_framebuffer_update(fb); stw_framebuffer_release(fb); - return ret; + return TRUE; } @@ -540,7 +532,7 @@ fail: BOOL stw_framebuffer_present_locked(HDC hdc, struct stw_framebuffer *fb, - unsigned surface_index) + struct pipe_surface *surface) { if(stw_dev->callbacks.wglCbPresentBuffers && stw_dev->stw_winsys->compose) { @@ -551,7 +543,7 @@ stw_framebuffer_present_locked(HDC hdc, data.magic2 = 0; data.AdapterLuid = stw_dev->AdapterLuid; data.rect = fb->client_rect; - data.pPrivateData = (void *)(uintptr_t)surface_index; + data.pPrivateData = (void *)surface; stw_framebuffer_release(fb); @@ -559,13 +551,6 @@ stw_framebuffer_present_locked(HDC hdc, } else { struct pipe_screen *screen = stw_dev->screen; - struct pipe_surface *surface; - - if(!st_get_framebuffer_surface( fb->stfb, surface_index, &surface )) { - /* FIXME: this shouldn't happen, but does on glean */ - stw_framebuffer_release(fb); - return FALSE; - } #ifdef DEBUG if(stw_dev->trace_running) { @@ -590,6 +575,7 @@ DrvSwapBuffers( HDC hdc ) { struct stw_framebuffer *fb; + struct pipe_surface *surface = NULL; fb = stw_framebuffer_from_hdc( hdc ); if (fb == NULL) @@ -600,12 +586,9 @@ DrvSwapBuffers( return TRUE; } - /* If we're swapping the buffer associated with the current context - * we have to flush any pending rendering commands first. - */ - st_notify_swapbuffers( fb->stfb ); + st_swapbuffers(fb->stfb, &surface, NULL); - return stw_framebuffer_present_locked(hdc, fb, ST_SURFACE_BACK_LEFT); + return stw_framebuffer_present_locked(hdc, fb, surface); } diff --git a/src/gallium/state_trackers/wgl/stw_framebuffer.h b/src/gallium/state_trackers/wgl/stw_framebuffer.h index 5afbe749086..b80d168a7ce 100644 --- a/src/gallium/state_trackers/wgl/stw_framebuffer.h +++ b/src/gallium/state_trackers/wgl/stw_framebuffer.h @@ -34,6 +34,7 @@ #include "pipe/p_thread.h" +struct pipe_surface; struct stw_pixelformat_info; /** @@ -140,7 +141,7 @@ stw_framebuffer_allocate( BOOL stw_framebuffer_present_locked(HDC hdc, struct stw_framebuffer *fb, - unsigned surface_index); + struct pipe_surface *surface); void stw_framebuffer_update( -- cgit v1.2.3 From a7e4a311e971005f7b23572ff3ca93f6d3c17edf Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 11:56:18 -0800 Subject: intel: Fix more front-buffer rendering after Brian's less flushing patch. bcbfda71b03303d3f008a6f3cf8cb7d9667bf8d2 left out many blit paths. This fixes up more of them to get Blender to work again. Bug #25030. --- src/mesa/drivers/dri/intel/intel_pixel_bitmap.c | 2 ++ src/mesa/drivers/dri/intel/intel_pixel_copy.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c index 99330b6ddfe..204a2331737 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_bitmap.c @@ -336,6 +336,8 @@ out: unpack->BufferObj); } + intel_check_front_buffer_rendering(intel); + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/intel/intel_pixel_copy.c b/src/mesa/drivers/dri/intel/intel_pixel_copy.c index f058b3c8e4d..622aaa22d67 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_copy.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_copy.c @@ -222,6 +222,8 @@ do_blit_copypixels(GLcontext * ctx, out: UNLOCK_HARDWARE(intel); + intel_check_front_buffer_rendering(intel); + DBG("%s: success\n", __FUNCTION__); return GL_TRUE; } -- cgit v1.2.3 From 9077ddaa2557e1e76c8a052c8d079ef3d443186b Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Wed, 25 Nov 2009 00:33:43 +0100 Subject: svga: Add header files for overlay support --- src/gallium/drivers/svga/include/svga_escape.h | 89 +++++++++++ src/gallium/drivers/svga/include/svga_overlay.h | 201 ++++++++++++++++++++++++ 2 files changed, 290 insertions(+) create mode 100644 src/gallium/drivers/svga/include/svga_escape.h create mode 100644 src/gallium/drivers/svga/include/svga_overlay.h diff --git a/src/gallium/drivers/svga/include/svga_escape.h b/src/gallium/drivers/svga/include/svga_escape.h new file mode 100644 index 00000000000..7b85e9b8c85 --- /dev/null +++ b/src/gallium/drivers/svga/include/svga_escape.h @@ -0,0 +1,89 @@ +/********************************************************** + * Copyright 2007-2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +/* + * svga_escape.h -- + * + * Definitions for our own (vendor-specific) SVGA Escape commands. + */ + +#ifndef _SVGA_ESCAPE_H_ +#define _SVGA_ESCAPE_H_ + + +/* + * Namespace IDs for the escape command + */ + +#define SVGA_ESCAPE_NSID_VMWARE 0x00000000 +#define SVGA_ESCAPE_NSID_DEVEL 0xFFFFFFFF + + +/* + * Within SVGA_ESCAPE_NSID_VMWARE, we multiplex commands according to + * the first DWORD of escape data (after the nsID and size). As a + * guideline we're using the high word and low word as a major and + * minor command number, respectively. + * + * Major command number allocation: + * + * 0000: Reserved + * 0001: SVGA_ESCAPE_VMWARE_LOG (svga_binary_logger.h) + * 0002: SVGA_ESCAPE_VMWARE_VIDEO (svga_overlay.h) + * 0003: SVGA_ESCAPE_VMWARE_HINT (svga_escape.h) + */ + +#define SVGA_ESCAPE_VMWARE_MAJOR_MASK 0xFFFF0000 + + +/* + * SVGA Hint commands. + * + * These escapes let the SVGA driver provide optional information to + * he host about the state of the guest or guest applications. The + * host can use these hints to make user interface or performance + * decisions. + * + * Notes: + * + * - SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN is deprecated for guests + * that use the SVGA Screen Object extension. Instead of sending + * this escape, use the SVGA_SCREEN_FULLSCREEN_HINT flag on your + * Screen Object. + */ + +#define SVGA_ESCAPE_VMWARE_HINT 0x00030000 +#define SVGA_ESCAPE_VMWARE_HINT_FULLSCREEN 0x00030001 // Deprecated + +typedef +struct { + uint32 command; + uint32 fullscreen; + struct { + int32 x, y; + } monitorPosition; +} SVGAEscapeHintFullscreen; + +#endif /* _SVGA_ESCAPE_H_ */ diff --git a/src/gallium/drivers/svga/include/svga_overlay.h b/src/gallium/drivers/svga/include/svga_overlay.h new file mode 100644 index 00000000000..82c1d3ff3e2 --- /dev/null +++ b/src/gallium/drivers/svga/include/svga_overlay.h @@ -0,0 +1,201 @@ +/********************************************************** + * Copyright 2007-2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +/* + * svga_overlay.h -- + * + * Definitions for video-overlay support. + */ + +#ifndef _SVGA_OVERLAY_H_ +#define _SVGA_OVERLAY_H_ + +#include "svga_reg.h" + +/* + * Video formats we support + */ + +#define VMWARE_FOURCC_YV12 0x32315659 // 'Y' 'V' '1' '2' +#define VMWARE_FOURCC_YUY2 0x32595559 // 'Y' 'U' 'Y' '2' +#define VMWARE_FOURCC_UYVY 0x59565955 // 'U' 'Y' 'V' 'Y' + +typedef enum { + SVGA_OVERLAY_FORMAT_INVALID = 0, + SVGA_OVERLAY_FORMAT_YV12 = VMWARE_FOURCC_YV12, + SVGA_OVERLAY_FORMAT_YUY2 = VMWARE_FOURCC_YUY2, + SVGA_OVERLAY_FORMAT_UYVY = VMWARE_FOURCC_UYVY, +} SVGAOverlayFormat; + +#define SVGA_VIDEO_COLORKEY_MASK 0x00ffffff + +#define SVGA_ESCAPE_VMWARE_VIDEO 0x00020000 + +#define SVGA_ESCAPE_VMWARE_VIDEO_SET_REGS 0x00020001 + /* FIFO escape layout: + * Type, Stream Id, (Register Id, Value) pairs */ + +#define SVGA_ESCAPE_VMWARE_VIDEO_FLUSH 0x00020002 + /* FIFO escape layout: + * Type, Stream Id */ + +typedef +struct SVGAEscapeVideoSetRegs { + struct { + uint32 cmdType; + uint32 streamId; + } header; + + // May include zero or more items. + struct { + uint32 registerId; + uint32 value; + } items[1]; +} SVGAEscapeVideoSetRegs; + +typedef +struct SVGAEscapeVideoFlush { + uint32 cmdType; + uint32 streamId; +} SVGAEscapeVideoFlush; + + +/* + * Struct definitions for the video overlay commands built on + * SVGAFifoCmdEscape. + */ +typedef +struct { + uint32 command; + uint32 overlay; +} SVGAFifoEscapeCmdVideoBase; + +typedef +struct { + SVGAFifoEscapeCmdVideoBase videoCmd; +} SVGAFifoEscapeCmdVideoFlush; + +typedef +struct { + SVGAFifoEscapeCmdVideoBase videoCmd; + struct { + uint32 regId; + uint32 value; + } items[1]; +} SVGAFifoEscapeCmdVideoSetRegs; + +typedef +struct { + SVGAFifoEscapeCmdVideoBase videoCmd; + struct { + uint32 regId; + uint32 value; + } items[SVGA_VIDEO_NUM_REGS]; +} SVGAFifoEscapeCmdVideoSetAllRegs; + + +/* + *---------------------------------------------------------------------- + * + * VMwareVideoGetAttributes -- + * + * Computes the size, pitches and offsets for YUV frames. + * + * Results: + * TRUE on success; otherwise FALSE on failure. + * + * Side effects: + * Pitches and offsets for the given YUV frame are put in 'pitches' + * and 'offsets' respectively. They are both optional though. + * + *---------------------------------------------------------------------- + */ + +static INLINE Bool +VMwareVideoGetAttributes(const SVGAOverlayFormat format, // IN + uint32 *width, // IN / OUT + uint32 *height, // IN / OUT + uint32 *size, // OUT + uint32 *pitches, // OUT (optional) + uint32 *offsets) // OUT (optional) +{ + int tmp; + + *width = (*width + 1) & ~1; + + if (offsets) { + offsets[0] = 0; + } + + switch (format) { + case VMWARE_FOURCC_YV12: + *height = (*height + 1) & ~1; + *size = (*width + 3) & ~3; + + if (pitches) { + pitches[0] = *size; + } + + *size *= *height; + + if (offsets) { + offsets[1] = *size; + } + + tmp = ((*width >> 1) + 3) & ~3; + + if (pitches) { + pitches[1] = pitches[2] = tmp; + } + + tmp *= (*height >> 1); + *size += tmp; + + if (offsets) { + offsets[2] = *size; + } + + *size += tmp; + break; + + case VMWARE_FOURCC_YUY2: + case VMWARE_FOURCC_UYVY: + *size = *width * 2; + + if (pitches) { + pitches[0] = *size; + } + + *size *= *height; + break; + + default: + return FALSE; + } + + return TRUE; +} + +#endif // _SVGA_OVERLAY_H_ -- cgit v1.2.3 From 232e59ca6fe678ac370ee5a45bc31e6f7f3e6bcf Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 1 Dec 2009 17:00:43 +0100 Subject: vmware/core: Update vmwgfx_drm.h to latest version --- src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h | 66 ++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h index 6705dd42897..6bf3183ff54 100644 --- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h +++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h @@ -45,7 +45,7 @@ #define DRM_VMW_UNREF_DMABUF 10 #define DRM_VMW_FIFO_DEBUG 11 #define DRM_VMW_FENCE_WAIT 12 - +#define DRM_VMW_OVERLAY 13 /*************************************************************************/ /** @@ -439,4 +439,68 @@ struct drm_vmw_fence_wait_arg { int32_t pad64; }; +/*************************************************************************/ +/** + * DRM_VMW_OVERLAY - Control overlays. + * + * This IOCTL controls the overlay units of the svga device. + * The SVGA overlay units does not work like regular hardware units in + * that they do not automaticaly read back the contents of the given dma + * buffer. But instead only read back for each call to this ioctl, and + * at any point between this call being made and a following call that + * either changes the buffer or disables the stream. + */ + +/** + * struct drm_vmw_rect + * + * Defines a rectangle. Used in the overlay ioctl to define + * source and destination rectangle. + */ + +struct drm_vmw_rect { + int32_t x; + int32_t y; + uint32_t w; + uint32_t h; +}; + +/** + * struct drm_vmw_overlay_arg + * + * @stream_id: Stearm to control + * @enabled: If false all following arguments are ignored. + * @handle: Handle to buffer for getting data from. + * @format: Format of the overlay as understood by the host. + * @width: Width of the overlay. + * @height: Height of the overlay. + * @size: Size of the overlay in bytes. + * @pitch: Array of pitches, the two last are only used for YUV12 formats. + * @offset: Offset from start of dma buffer to overlay. + * @src: Source rect, must be within the defined area above. + * @dst: Destination rect, x and y may be negative. + * + * Argument to the DRM_VMW_OVERLAY Ioctl. + */ + +struct drm_vmw_overlay_arg { + uint32_t stream_id; + uint32_t enabled; + + uint32_t flags; + uint32_t color_key; + + uint32_t handle; + uint32_t offset; + int32_t format; + uint32_t size; + uint32_t width; + uint32_t height; + uint32_t pitch[3]; + + uint32_t pad64; + struct drm_vmw_rect src; + struct drm_vmw_rect dst; +}; + #endif -- cgit v1.2.3 From bb80a93c9eabb430914011513852b18c943c8cfa Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 24 Nov 2009 22:55:24 +0100 Subject: st/xorg: Create winsys hooks that we call into --- src/gallium/state_trackers/xorg/xorg_driver.c | 6 ++++++ src/gallium/state_trackers/xorg/xorg_tracker.h | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 12915912986..da86295c316 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -652,6 +652,9 @@ drv_screen_init(int scrnIndex, ScreenPtr pScreen, int argc, char **argv) if (serverGeneration == 1) xf86ShowUnusedOptions(pScrn->scrnIndex, pScrn->options); + if (ms->winsys_screen_init) + ms->winsys_screen_init(pScrn); + return drv_enter_vt(scrnIndex, 1); } @@ -768,6 +771,9 @@ drv_close_screen(int scrnIndex, ScreenPtr pScreen) drv_leave_vt(scrnIndex, 0); } + if (ms->winsys_screen_close) + ms->winsys_screen_close(pScrn); + #ifdef DRI2 if (ms->screen) xorg_dri2_close(pScreen); diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index c6c7b2fe158..d5fc18448ef 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -114,6 +114,11 @@ typedef struct _modesettingRec Bool noEvict; Bool debug_fallback; + /* winsys hocks */ + Bool (*winsys_screen_init)(ScrnInfoPtr pScr); + Bool (*winsys_screen_close)(ScrnInfoPtr pScr); + void *winsys_priv; + #ifdef DRM_MODE_FEATURE_DIRTYFB DamagePtr damage; #endif -- cgit v1.2.3 From 64102a56256c95f17f59456a78d9ff2b05889bfb Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 24 Nov 2009 23:51:05 +0100 Subject: vmware/xorg: Create a small driver that sits ontop of st/xorg --- src/gallium/winsys/drm/vmware/xorg/Makefile | 11 ++- src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 55 +++++++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_hook.h | 39 +++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 100 ++++++++++++++++++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c | 4 +- 5 files changed, 205 insertions(+), 4 deletions(-) create mode 100644 src/gallium/winsys/drm/vmware/xorg/vmw_driver.h create mode 100644 src/gallium/winsys/drm/vmware/xorg/vmw_hook.h create mode 100644 src/gallium/winsys/drm/vmware/xorg/vmw_screen.c diff --git a/src/gallium/winsys/drm/vmware/xorg/Makefile b/src/gallium/winsys/drm/vmware/xorg/Makefile index 48a9b08aa76..d9fee4bf3b6 100644 --- a/src/gallium/winsys/drm/vmware/xorg/Makefile +++ b/src/gallium/winsys/drm/vmware/xorg/Makefile @@ -1,10 +1,15 @@ -TARGET = vmwgfx_drv.so -CFILES = $(wildcard ./*.c) -OBJECTS = $(patsubst ./%.c,./%.o,$(CFILES)) TOP = ../../../../../.. include $(TOP)/configs/current +TARGET = vmwgfx_drv.so + +CFILES = \ + vmw_xorg.c \ + vmw_screen.c + +OBJECTS = $(patsubst %.c,%.o,$(CFILES)) + INCLUDES = \ $(shell pkg-config --cflags-only-I pixman-1 xorg-server libdrm xproto) \ -I$(TOP)/src/gallium/include \ diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h new file mode 100644 index 00000000000..e964cb4b57e --- /dev/null +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -0,0 +1,55 @@ +/********************************************************** + * Copyright 2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +/** + * @file + * Contains the shared resources for VMware Xorg driver + * that sits ontop of the Xorg State Traker. + * + * It is initialized in vmw_screen.c. + * + * @author Jakob Bornecrantz + */ + +#ifndef VMW_DRIVER_H_ +#define VMW_DRIVER_H_ + +#include "state_trackers/xorg/xorg_tracker.h" + +struct vmw_driver +{ + int fd; + +}; + +static INLINE struct vmw_driver * +vmw_driver(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + return ms ? (struct vmw_driver *)ms->winsys_priv : NULL; +} + + +#endif diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_hook.h b/src/gallium/winsys/drm/vmware/xorg/vmw_hook.h new file mode 100644 index 00000000000..224a2d92996 --- /dev/null +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_hook.h @@ -0,0 +1,39 @@ +/********************************************************** + * Copyright 2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +#ifndef VMW_HOOK_H_ +#define VMW_HOOK_H_ + +#include "state_trackers/xorg/xorg_winsys.h" + + +/*********************************************************************** + * vmw_screen.c + */ + +void vmw_screen_set_functions(ScrnInfoPtr pScrn); + + +#endif diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c new file mode 100644 index 00000000000..969d48157ca --- /dev/null +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -0,0 +1,100 @@ +/********************************************************** + * Copyright 2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +/** + * @file + * Contains the init code for the VMware Xorg driver. + * + * @author Jakob Bornecrantz + */ + +#include "vmw_hook.h" +#include "vmw_driver.h" + +static Bool +vmw_screen_init(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + struct vmw_driver *vmw; + + /* if gallium is used then we don't need to do anything. */ + if (ms->screen) + return TRUE; + + vmw = xnfcalloc(sizeof(*vmw), 1); + if (!vmw) + return FALSE; + + vmw->fd = ms->fd; + ms->winsys_priv = vmw; + + return TRUE; +} + +static Bool +vmw_screen_close(ScrnInfoPtr pScrn) +{ + modesettingPtr ms = modesettingPTR(pScrn); + struct vmw_driver *vmw = vmw_driver(pScrn); + + if (!vmw) + return TRUE; + + ms->winsys_priv = NULL; + xfree(vmw); + + return TRUE; +} + +/* + * Functions for setting up hooks into the xorg state tracker + */ + +static Bool (*vmw_screen_pre_init_saved)(ScrnInfoPtr pScrn, int flags) = NULL; + +static Bool +vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags) +{ + modesettingPtr ms; + + pScrn->PreInit = vmw_screen_pre_init_saved; + if (!pScrn->PreInit(pScrn, flags)) + return FALSE; + + ms = modesettingPTR(pScrn); + ms->winsys_screen_init = vmw_screen_init; + ms->winsys_screen_close = vmw_screen_close; + + return TRUE; +} + +void +vmw_screen_set_functions(ScrnInfoPtr pScrn) +{ + assert(!vmw_screen_pre_init_saved); + + vmw_screen_pre_init_saved = pScrn->PreInit; + pScrn->PreInit = vmw_screen_pre_init; +} diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c index 3acc110ae79..4b208719ca3 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_xorg.c @@ -31,7 +31,7 @@ * @author Jakob Bornecrantz */ -#include "state_trackers/xorg/xorg_winsys.h" +#include "vmw_hook.h" static void vmw_xorg_identify(int flags); static Bool vmw_xorg_pci_probe(DriverPtr driver, @@ -145,6 +145,8 @@ vmw_xorg_pci_probe(DriverPtr driver, /* Use all the functions from the xorg tracker */ xorg_tracker_set_functions(scrn); + + vmw_screen_set_functions(scrn); } return scrn != NULL; } -- cgit v1.2.3 From 77ff3a5619721cfd917f9fd45e4b3a1c866c578f Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 1 Dec 2009 17:13:41 +0100 Subject: vmware/xorg: Add video support By using the hooks st/xorg provides us we can create a driver specific implementation that uses the svga overlay engines. --- src/gallium/winsys/drm/vmware/xorg/Makefile | 3 + src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 31 + src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 140 ++++ src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 4 + src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 1021 +++++++++++++++++++++++ 5 files changed, 1199 insertions(+) create mode 100644 src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c create mode 100644 src/gallium/winsys/drm/vmware/xorg/vmw_video.c diff --git a/src/gallium/winsys/drm/vmware/xorg/Makefile b/src/gallium/winsys/drm/vmware/xorg/Makefile index d9fee4bf3b6..49e28ae17f5 100644 --- a/src/gallium/winsys/drm/vmware/xorg/Makefile +++ b/src/gallium/winsys/drm/vmware/xorg/Makefile @@ -6,6 +6,8 @@ TARGET = vmwgfx_drv.so CFILES = \ vmw_xorg.c \ + vmw_video.c \ + vmw_ioctl.c \ vmw_screen.c OBJECTS = $(patsubst %.c,%.o,$(CFILES)) @@ -29,6 +31,7 @@ LINKS = \ $(shell pkg-config --libs libdrm) DRIVER_DEFINES = \ + -std=gnu99 \ -DHAVE_CONFIG_H TARGET_STAGING = $(TOP)/$(LIB_DIR)/gallium/$(TARGET) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h index e964cb4b57e..04d446a2dfb 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -38,10 +38,14 @@ #include "state_trackers/xorg/xorg_tracker.h" +struct vmw_dma_buffer; + struct vmw_driver { int fd; + /* vmw_video.c */ + void *video_priv; }; static INLINE struct vmw_driver * @@ -52,4 +56,31 @@ vmw_driver(ScrnInfoPtr pScrn) } +/*********************************************************************** + * vmw_video.c + */ + +Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw); + +Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw); + + +/*********************************************************************** + * vmw_ioctl.c + */ + +struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw, + uint32_t size, + unsigned *handle); + +void * vmw_ioctl_buffer_map(struct vmw_driver *vmw, + struct vmw_dma_buffer *buf); + +void vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, + struct vmw_dma_buffer *buf); + +void vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, + struct vmw_dma_buffer *buf); + + #endif diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c new file mode 100644 index 00000000000..3cac5b7760c --- /dev/null +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -0,0 +1,140 @@ +/********************************************************** + * Copyright 2009 VMware, Inc. All rights reserved. + * + * Permission is hereby granted, free of charge, to any person + * obtaining a copy of this software and associated documentation + * files (the "Software"), to deal in the Software without + * restriction, including without limitation the rights to use, copy, + * modify, merge, publish, distribute, sublicense, and/or sell copies + * of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS + * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN + * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + * + **********************************************************/ + +/** + * @file + * Contains the functions for creating dma buffers by calling + * the kernel via driver specific ioctls. + * + * @author Jakob Bornecrantz + */ + +#define HAVE_STDINT_H +#define _FILE_OFFSET_BITS 64 + +#include +#include +#include + +#include +#include "xf86drm.h" +#include "../core/vmwgfx_drm.h" + +#include "vmw_driver.h" +#include "util/u_debug.h" + +struct vmw_dma_buffer +{ + void *data; + unsigned handle; + uint64_t map_handle; + unsigned map_count; + uint32_t size; +}; + +struct vmw_dma_buffer * +vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle) +{ + struct vmw_dma_buffer *buf; + union drm_vmw_alloc_dmabuf_arg arg; + struct drm_vmw_alloc_dmabuf_req *req = &arg.req; + struct drm_vmw_dmabuf_rep *rep = &arg.rep; + int ret; + + buf = xcalloc(1, sizeof(*buf)); + if (!buf) + goto err; + + memset(&arg, 0, sizeof(arg)); + req->size = size; + do { + ret = drmCommandWriteRead(vmw->fd, DRM_VMW_ALLOC_DMABUF, &arg, sizeof(arg)); + } while (ret == -ERESTART); + + if (ret) { + debug_printf("IOCTL failed %d: %s\n", ret, strerror(-ret)); + goto err_free; + } + + + buf->data = NULL; + buf->handle = rep->handle; + buf->map_handle = rep->map_handle; + buf->map_count = 0; + buf->size = size; + + *handle = rep->handle; + + return buf; + +err_free: + xfree(buf); +err: + return NULL; +} + +void +vmw_ioctl_buffer_destroy(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +{ + struct drm_vmw_unref_dmabuf_arg arg; + + if (buf->data) { + munmap(buf->data, buf->size); + buf->data = NULL; + } + + memset(&arg, 0, sizeof(arg)); + arg.handle = buf->handle; + drmCommandWrite(vmw->fd, DRM_VMW_UNREF_DMABUF, &arg, sizeof(arg)); + + xfree(buf); +} + +void * +vmw_ioctl_buffer_map(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +{ + void *map; + + if (buf->data == NULL) { + map = mmap(NULL, buf->size, PROT_READ | PROT_WRITE, MAP_SHARED, + vmw->fd, buf->map_handle); + if (map == MAP_FAILED) { + debug_printf("%s: Map failed.\n", __FUNCTION__); + return NULL; + } + + buf->data = map; + } + + ++buf->map_count; + + return buf->data; +} + +void +vmw_ioctl_buffer_unmap(struct vmw_driver *vmw, struct vmw_dma_buffer *buf) +{ + --buf->map_count; +} diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 969d48157ca..344ef0b3159 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -50,6 +50,8 @@ vmw_screen_init(ScrnInfoPtr pScrn) vmw->fd = ms->fd; ms->winsys_priv = vmw; + vmw_video_init(pScrn, vmw); + return TRUE; } @@ -62,6 +64,8 @@ vmw_screen_close(ScrnInfoPtr pScrn) if (!vmw) return TRUE; + vmw_video_close(pScrn, vmw); + ms->winsys_priv = NULL; xfree(vmw); diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c new file mode 100644 index 00000000000..6e34aa21f38 --- /dev/null +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -0,0 +1,1021 @@ +/* + * Copyright 2007 by VMware, Inc. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR + * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, + * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR + * OTHER DEALINGS IN THE SOFTWARE. + * + * Except as contained in this notice, the name of the copyright holder(s) + * and author(s) shall not be used in advertising or otherwise to promote + * the sale, use or other dealings in this Software without prior written + * authorization from the copyright holder(s) and author(s). + */ + +/* + * vmwarevideo.c -- + * + * Xv extension support. + * See http://www.xfree86.org/current/DESIGN16.html + * + */ + + +#include "xf86xv.h" +#include "fourcc.h" + +#include "pipe/p_compiler.h" +/* + * We can't incude svga_types.h due to conflicting types for Bool. + */ +typedef int64_t int64; +typedef uint64_t uint64; + +typedef int32_t int32; +typedef uint32_t uint32; + +typedef int16_t int16; +typedef uint16_t uint16; + +typedef int8_t int8; +typedef uint8_t uint8; + +#include "svga/include/svga_reg.h" +#include "svga/include/svga_escape.h" +#include "svga/include/svga_overlay.h" + +#include "vmw_driver.h" + +#include + +#include "xf86drm.h" +#include "../core/vmwgfx_drm.h" + +#define MAKE_ATOM(a) MakeAtom(a, sizeof(a) - 1, TRUE) + +/* + * Number of videos that can be played simultaneously + */ +#define VMWARE_VID_NUM_PORTS 1 + +/* + * Using a dark shade as the default colorKey + */ +#define VMWARE_VIDEO_COLORKEY 0x100701 + +/* + * Maximum dimensions + */ +#define VMWARE_VID_MAX_WIDTH 2048 +#define VMWARE_VID_MAX_HEIGHT 2048 + +#define VMWARE_VID_NUM_ENCODINGS 1 +static XF86VideoEncodingRec vmwareVideoEncodings[] = +{ + { + 0, + "XV_IMAGE", + VMWARE_VID_MAX_WIDTH, VMWARE_VID_MAX_HEIGHT, + {1, 1} + } +}; + +#define VMWARE_VID_NUM_FORMATS 2 +static XF86VideoFormatRec vmwareVideoFormats[] = +{ + { 16, TrueColor}, + { 24, TrueColor} +}; + +#define VMWARE_VID_NUM_IMAGES 3 +static XF86ImageRec vmwareVideoImages[] = +{ + XVIMAGE_YV12, + XVIMAGE_YUY2, + XVIMAGE_UYVY +}; + +#define VMWARE_VID_NUM_ATTRIBUTES 2 +static XF86AttributeRec vmwareVideoAttributes[] = +{ + { + XvGettable | XvSettable, + 0x000000, + 0xffffff, + "XV_COLORKEY" + }, + { + XvGettable | XvSettable, + 0, + 1, + "XV_AUTOPAINT_COLORKEY" + } +}; + +/* + * Video frames are stored in a circular list of buffers. + * Must be power or two, See vmw_video_port_play. + */ +#define VMWARE_VID_NUM_BUFFERS 1 + +/* + * Defines the structure used to hold and pass video data to the host + */ +struct vmw_video_buffer +{ + unsigned handle; + int size; + void *data; + void *extra_data; + struct vmw_dma_buffer *buf; +}; + + +/** + * Structure representing a single video stream, aka port. + * + * Ports maps one to one to a SVGA stream. Port is just + * what Xv calls a SVGA stream. + */ +struct vmw_video_port +{ + /* + * Function prototype same as XvPutImage. + * + * This is either set to vmw_video_port_init or vmw_video_port_play. + * At init this function is set to port_init. In port_init we set it + * to port_play and call it, after initializing the struct. + */ + int (*play)(ScrnInfoPtr, struct vmw_video_port *, + short, short, short, short, short, + short, short, short, int, unsigned char*, + short, short, RegionPtr); + + /* values to go into the SVGAOverlayUnit */ + uint32 streamId; + uint32 colorKey; + uint32 flags; + + /* round robin of buffers */ + unsigned currBuf; + struct vmw_video_buffer bufs[VMWARE_VID_NUM_BUFFERS]; + + /* properties that applies to all buffers */ + int size; + int pitches[3]; + int offsets[3]; + + /* things for X */ + RegionRec clipBoxes; + Bool isAutoPaintColorkey; +}; + + +/** + * Structure holding all the infromation for video. + */ +struct vmw_video_private +{ + int fd; + + /** ports */ + struct vmw_video_port port[VMWARE_VID_NUM_PORTS]; + + /** Used to store port pointers pointers */ + DevUnion port_ptr[VMWARE_VID_NUM_PORTS]; +}; + + +/* + * Callback functions exported to Xv, prefixed with vmw_xv_*. + */ +static int vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y, + short drw_x, short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int image, + unsigned char *buf, short width, short height, + Bool sync, RegionPtr clipBoxes, pointer data, + DrawablePtr dst); +static void vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool Cleanup); +static int vmw_xv_query_image_attributes(ScrnInfoPtr pScrn, int format, + unsigned short *width, + unsigned short *height, int *pitches, + int *offsets); +static int vmw_xv_set_port_attribute(ScrnInfoPtr pScrn, Atom attribute, + INT32 value, pointer data); +static int vmw_xv_get_port_attribute(ScrnInfoPtr pScrn, Atom attribute, + INT32 *value, pointer data); +static void vmw_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion, + short vid_w, short vid_h, short drw_w, + short drw_h, unsigned int *p_w, + unsigned int *p_h, pointer data); + + +/* + * Local functions. + */ +static XF86VideoAdaptorPtr vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_driver *vmw); + +static int vmw_video_port_init(ScrnInfoPtr pScrn, + struct vmw_video_port *port, + short src_x, short src_y, short drw_x, + short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int format, + unsigned char *buf, short width, + short height, RegionPtr clipBoxes); +static int vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port, + short src_x, short src_y, short drw_x, + short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int format, + unsigned char *buf, short width, + short height, RegionPtr clipBoxes); +static void vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port); + +static int vmw_video_buffer_alloc(struct vmw_driver *vmw, int size, + struct vmw_video_buffer *out); +static int vmw_video_buffer_free(struct vmw_driver *vmw, + struct vmw_video_buffer *out); + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_init -- + * + * Initializes Xv support. + * + * Results: + * TRUE on success, FALSE on error. + * + * Side effects: + * Xv support is initialized. Memory is allocated for all supported + * video streams. + * + *----------------------------------------------------------------------------- + */ + +Bool +vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + ScreenPtr pScreen = pScrn->pScreen; + XF86VideoAdaptorPtr *overlayAdaptors, *newAdaptors = NULL; + XF86VideoAdaptorPtr newAdaptor = NULL; + int numAdaptors; + + debug_printf("%s: enter\n", __func__); + + numAdaptors = xf86XVListGenericAdaptors(pScrn, &overlayAdaptors); + + newAdaptor = vmw_video_init_adaptor(pScrn, vmw); + if (!newAdaptor) { + debug_printf("Failed to initialize Xv extension\n"); + return FALSE; + } + + if (!numAdaptors) { + numAdaptors = 1; + overlayAdaptors = &newAdaptor; + } else { + newAdaptors = xalloc((numAdaptors + 1) * + sizeof(XF86VideoAdaptorPtr*)); + if (!newAdaptors) { + xf86XVFreeVideoAdaptorRec(newAdaptor); + return FALSE; + } + + memcpy(newAdaptors, overlayAdaptors, + numAdaptors * sizeof(XF86VideoAdaptorPtr)); + newAdaptors[numAdaptors++] = newAdaptor; + overlayAdaptors = newAdaptors; + } + + if (!xf86XVScreenInit(pScreen, overlayAdaptors, numAdaptors)) { + debug_printf("Failed to initialize Xv extension\n"); + xf86XVFreeVideoAdaptorRec(newAdaptor); + return FALSE; + } + + if (newAdaptors) { + xfree(newAdaptors); + } + + debug_printf("Initialized VMware Xv extension successfully\n"); + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_close -- + * + * Unitializes video. + * + * Results: + * TRUE. + * + * Side effects: + * vmw->video_priv = NULL + * + *----------------------------------------------------------------------------- + */ + +Bool +vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + struct vmw_video_private *video; + int i; + + debug_printf("%s: enter\n", __func__); + + video = vmw->video_priv; + + for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { + vmw_video_port_cleanup(pScrn, &video->port[i]); + } + + /* XXX: I'm sure this function is missing code for turning off Xv */ + + free(vmw->video_priv); + vmw->video_priv = NULL; + + return TRUE; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_init_adaptor -- + * + * Initializes a XF86VideoAdaptor structure with the capabilities and + * functions supported by this video driver. + * + * Results: + * On success initialized XF86VideoAdaptor struct or NULL on error + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static XF86VideoAdaptorPtr +vmw_video_init_adaptor(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + XF86VideoAdaptorPtr adaptor; + struct vmw_video_private *video; + int i; + + debug_printf("%s: enter \n", __func__); + + adaptor = xf86XVAllocateVideoAdaptorRec(pScrn); + if (!adaptor) { + debug_printf("Not enough memory\n"); + return NULL; + } + + video = xcalloc(1, sizeof(*video)); + if (!video) { + debug_printf("Not enough memory.\n"); + xf86XVFreeVideoAdaptorRec(adaptor); + return NULL; + } + + vmw->video_priv = video; + + adaptor->type = XvInputMask | XvImageMask | XvWindowMask; + adaptor->flags = VIDEO_OVERLAID_IMAGES | VIDEO_CLIP_TO_VIEWPORT; + adaptor->name = "VMware Video Engine"; + adaptor->nEncodings = VMWARE_VID_NUM_ENCODINGS; + adaptor->pEncodings = vmwareVideoEncodings; + adaptor->nFormats = VMWARE_VID_NUM_FORMATS; + adaptor->pFormats = vmwareVideoFormats; + adaptor->nPorts = VMWARE_VID_NUM_PORTS; + adaptor->pPortPrivates = video->port_ptr; + + for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { + video->port[i].streamId = i; + video->port[i].play = vmw_video_port_init; + video->port[i].flags = SVGA_VIDEO_FLAG_COLORKEY; + video->port[i].colorKey = VMWARE_VIDEO_COLORKEY; + video->port[i].isAutoPaintColorkey = TRUE; + adaptor->pPortPrivates[i].ptr = &video->port[i]; + } + + adaptor->nAttributes = VMWARE_VID_NUM_ATTRIBUTES; + adaptor->pAttributes = vmwareVideoAttributes; + + adaptor->nImages = VMWARE_VID_NUM_IMAGES; + adaptor->pImages = vmwareVideoImages; + + adaptor->PutVideo = NULL; + adaptor->PutStill = NULL; + adaptor->GetVideo = NULL; + adaptor->GetStill = NULL; + adaptor->StopVideo = vmw_xv_stop_video; + adaptor->SetPortAttribute = vmw_xv_set_port_attribute; + adaptor->GetPortAttribute = vmw_xv_get_port_attribute; + adaptor->QueryBestSize = vmw_xv_query_best_size; + adaptor->PutImage = vmw_xv_put_image; + adaptor->QueryImageAttributes = vmw_xv_query_image_attributes; + + debug_printf("%s: done %p\n", __func__, adaptor); + + return adaptor; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_port_init -- + * + * Initializes a video stream in response to the first PutImage() on a + * video stream. The process goes as follows: + * - Figure out characteristics according to format + * - Allocate offscreen memory + * - Pass on video to Play() functions + * + * Results: + * Success or XvBadAlloc on failure. + * + * Side effects: + * Video stream is initialized and its first frame sent to the host + * (done by VideoPlay() function called at the end) + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_video_port_init(ScrnInfoPtr pScrn, struct vmw_video_port *port, + short src_x, short src_y, short drw_x, + short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int format, + unsigned char *buf, short width, + short height, RegionPtr clipBoxes) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + unsigned short w, h; + int i, ret; + + debug_printf("\t%s: id %d, format %d\n", __func__, port->streamId, format); + + w = width; + h = height; + /* init all the format attributes, used for buffers */ + port->size = vmw_xv_query_image_attributes(pScrn, format, &w, &h, + port->pitches, port->offsets); + + if (port->size == -1) + return XvBadAlloc; + + port->play = vmw_video_port_play; + + for (i = 0; i < VMWARE_VID_NUM_BUFFERS; ++i) { + ret = vmw_video_buffer_alloc(vmw, port->size, &port->bufs[i]); + if (ret != Success) + break; + } + + /* Free all allocated buffers on failure */ + if (ret != Success) { + for (--i; i >= 0; --i) { + vmw_video_buffer_free(vmw, &port->bufs[i]); + } + return ret; + } + + port->currBuf = 0; + + REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes); + + if (port->isAutoPaintColorkey) + xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes); + + return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h, + drw_w, drw_h, format, buf, width, height, clipBoxes); +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_port_play -- + * + * Sends all the attributes associated with the video frame using the + * FIFO ESCAPE mechanism to the host. + * + * Results: + * Always returns Success. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_video_port_play(ScrnInfoPtr pScrn, struct vmw_video_port *port, + short src_x, short src_y, short drw_x, + short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int format, + unsigned char *buf, short width, + short height, RegionPtr clipBoxes) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + struct drm_vmw_overlay_arg arg; + unsigned short w, h; + int size; + int ret; + + debug_printf("\t%s: enter\n", __func__); + + w = width; + h = height; + + /* we don't update the ports size */ + size = vmw_xv_query_image_attributes(pScrn, format, &w, &h, + port->pitches, port->offsets); + + if (size > port->size) { + debug_printf("\t%s: Increase in size of Xv video frame streamId:%d.\n", + __func__, port->streamId); + vmw_xv_stop_video(pScrn, port, TRUE); + return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, + src_h, drw_w, drw_h, format, buf, width, height, + clipBoxes); + } + + memcpy(port->bufs[port->currBuf].data, buf, port->size); + + memset(&arg, 0, sizeof(arg)); + + arg.stream_id = port->streamId; + arg.enabled = TRUE; + arg.flags = port->flags; + arg.color_key = port->colorKey; + arg.handle = port->bufs[port->currBuf].handle; + arg.format = format; + arg.size = port->size; + arg.width = w; + arg.height = h; + arg.src.x = src_x; + arg.src.y = src_y; + arg.src.w = src_w; + arg.src.h = src_h; + arg.dst.x = drw_x; + arg.dst.y = drw_y; + arg.dst.w = drw_w; + arg.dst.h = drw_h; + arg.pitch[0] = port->pitches[0]; + arg.pitch[1] = port->pitches[1]; + arg.pitch[2] = port->pitches[2]; + arg.offset = 0; + + /* + * Update the clipList and paint the colorkey, if required. + */ + if (!REGION_EQUAL(pScrn->pScreen, &port->clipBoxes, clipBoxes)) { + REGION_COPY(pScrn->pScreen, &port->clipBoxes, clipBoxes); + if (port->isAutoPaintColorkey) { + xf86XVFillKeyHelper(pScrn->pScreen, port->colorKey, clipBoxes); + } + } + + ret = drmCommandWrite(vmw->fd, DRM_VMW_OVERLAY, &arg, sizeof(arg)); + if (ret) { + vmw_video_port_cleanup(pScrn, port); + return XvBadAlloc; + } + + port->currBuf = ++port->currBuf & (VMWARE_VID_NUM_BUFFERS - 1); + + return Success; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_port_cleanup -- + * + * Frees up all resources (if any) taken by a video stream. + * + * Results: + * None. + * + * Side effects: + * Same as above. + * + *----------------------------------------------------------------------------- + */ + +static void +vmw_video_port_cleanup(ScrnInfoPtr pScrn, struct vmw_video_port *port) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + uint32 id, colorKey, flags; + Bool isAutoPaintColorkey; + int i; + + debug_printf("\t%s: enter\n", __func__); + + for (i = 0; i < VMWARE_VID_NUM_BUFFERS; i++) { + vmw_video_buffer_free(vmw, &port->bufs[i]); + } + + /* + * reset stream for next video + */ + id = port->streamId; + colorKey = port->colorKey; + flags = port->flags; + isAutoPaintColorkey = port->isAutoPaintColorkey; + + memset(port, 0, sizeof(*port)); + + port->streamId = id; + port->play = vmw_video_port_init; + port->colorKey = colorKey; + port->flags = flags; + port->isAutoPaintColorkey = isAutoPaintColorkey; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_buffer_alloc -- + * + * Allocates and map a kernel buffer to be used as data storage. + * + * Results: + * XvBadAlloc on failure, otherwise Success. + * + * Side effects: + * Calls into the kernel, sets members of out. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_video_buffer_alloc(struct vmw_driver *vmw, int size, + struct vmw_video_buffer *out) +{ + out->buf = vmw_ioctl_buffer_create(vmw, size, &out->handle); + if (!out->buf) + return XvBadAlloc; + + out->data = vmw_ioctl_buffer_map(vmw, out->buf); + if (!out->data) { + vmw_ioctl_buffer_destroy(vmw, out->buf); + + out->handle = 0; + out->buf = NULL; + + return XvBadAlloc; + } + + out->size = size; + out->extra_data = xcalloc(1, size); + + debug_printf("\t\t%s: allocated buffer %p of size %i\n", __func__, out, size); + + return Success; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_video_buffer_free -- + * + * Frees and unmaps an allocated kernel buffer. + * + * Results: + * Success. + * + * Side effects: + * Calls into the kernel, sets members of out to 0. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_video_buffer_free(struct vmw_driver *vmw, + struct vmw_video_buffer *out) +{ + if (out->size == 0) + return Success; + + xfree(out->extra_data); + vmw_ioctl_buffer_unmap(vmw, out->buf); + vmw_ioctl_buffer_destroy(vmw, out->buf); + + out->buf = NULL; + out->data = NULL; + out->handle = 0; + out->size = 0; + + debug_printf("\t\t%s: freed buffer %p\n", __func__, out); + + return Success; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_put_image -- + * + * Main video playback function. It copies the passed data which is in + * the specified format (e.g. FOURCC_YV12) into the overlay. + * + * If sync is TRUE the driver should not return from this + * function until it is through reading the data from buf. + * + * Results: + * Success or XvBadAlloc on failure + * + * Side effects: + * Video port will be played(initialized if 1st frame) on success + * or will fail on error. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_xv_put_image(ScrnInfoPtr pScrn, short src_x, short src_y, + short drw_x, short drw_y, short src_w, short src_h, + short drw_w, short drw_h, int format, + unsigned char *buf, short width, short height, + Bool sync, RegionPtr clipBoxes, pointer data, + DrawablePtr dst) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_video_port *port = data; + + debug_printf("%s: enter (%u, %u) (%ux%u) (%u, %u) (%ux%u) (%ux%u)\n", __func__, + src_x, src_y, src_w, src_h, + drw_x, drw_y, drw_w, drw_h, + width, height); + + if (!vmw->video_priv) + return XvBadAlloc; + + return port->play(pScrn, port, src_x, src_y, drw_x, drw_y, src_w, src_h, + drw_w, drw_h, format, buf, width, height, clipBoxes); +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_stop_video -- + * + * Called when we should stop playing video for a particular stream. If + * Cleanup is FALSE, the "stop" operation is only temporary, and thus we + * don't do anything. If Cleanup is TRUE we kill the video port by + * sending a message to the host and freeing up the stream. + * + * Results: + * None. + * + * Side effects: + * See above. + * + *----------------------------------------------------------------------------- + */ + +static void +vmw_xv_stop_video(ScrnInfoPtr pScrn, pointer data, Bool cleanup) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + struct vmw_video_port *port = data; + struct drm_vmw_overlay_arg arg; + int ret; + + debug_printf("%s: cleanup is %s\n", __func__, cleanup ? "TRUE" : "FALSE"); + + if (!vmw->video_priv) + return; + + if (!cleanup) + return; + + + memset(&arg, 0, sizeof(arg)); + arg.stream_id = port->streamId; + arg.enabled = FALSE; + + ret = drmCommandWrite(vmw->fd, DRM_VMW_OVERLAY, &arg, sizeof(arg)); + assert(ret == 0); + + vmw_video_port_cleanup(pScrn, port); +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_query_image_attributes -- + * + * From the spec: This function is called to let the driver specify how data + * for a particular image of size width by height should be stored. + * Sometimes only the size and corrected width and height are needed. In + * that case pitches and offsets are NULL. + * + * Results: + * The size of the memory required for the image, or -1 on error. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_xv_query_image_attributes(ScrnInfoPtr pScrn, int format, + unsigned short *width, unsigned short *height, + int *pitches, int *offsets) +{ + INT32 size, tmp; + + if (*width > VMWARE_VID_MAX_WIDTH) { + *width = VMWARE_VID_MAX_WIDTH; + } + if (*height > VMWARE_VID_MAX_HEIGHT) { + *height = VMWARE_VID_MAX_HEIGHT; + } + + *width = (*width + 1) & ~1; + if (offsets != NULL) { + offsets[0] = 0; + } + + switch (format) { + case FOURCC_YV12: + *height = (*height + 1) & ~1; + size = (*width + 3) & ~3; + if (pitches) { + pitches[0] = size; + } + size *= *height; + if (offsets) { + offsets[1] = size; + } + tmp = ((*width >> 1) + 3) & ~3; + if (pitches) { + pitches[1] = pitches[2] = tmp; + } + tmp *= (*height >> 1); + size += tmp; + if (offsets) { + offsets[2] = size; + } + size += tmp; + break; + case FOURCC_UYVY: + case FOURCC_YUY2: + size = *width * 2; + if (pitches) { + pitches[0] = size; + } + size *= *height; + break; + default: + debug_printf("Query for invalid video format %d\n", format); + return -1; + } + return size; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_set_port_attribute -- + * + * From the spec: A port may have particular attributes such as colorKey, hue, + * saturation, brightness or contrast. Xv clients set these + * attribute values by sending attribute strings (Atoms) to the server. + * + * Results: + * Success if the attribute exists and XvBadAlloc otherwise. + * + * Side effects: + * The respective attribute gets the new value. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_xv_set_port_attribute(ScrnInfoPtr pScrn, Atom attribute, + INT32 value, pointer data) +{ + struct vmw_video_port *port = data; + Atom xvColorKey = MAKE_ATOM("XV_COLORKEY"); + Atom xvAutoPaint = MAKE_ATOM("XV_AUTOPAINT_COLORKEY"); + + if (attribute == xvColorKey) { + debug_printf("%s: Set colorkey:0x%x\n", __func__, (unsigned)value); + port->colorKey = value; + } else if (attribute == xvAutoPaint) { + debug_printf("%s: Set autoPaint: %s\n", __func__, value? "TRUE": "FALSE"); + port->isAutoPaintColorkey = value; + } else { + return XvBadAlloc; + } + + return Success; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_get_port_attribute -- + * + * From the spec: A port may have particular attributes such as hue, + * saturation, brightness or contrast. Xv clients get these + * attribute values by sending attribute strings (Atoms) to the server + * + * Results: + * Success if the attribute exists and XvBadAlloc otherwise. + * + * Side effects: + * "value" contains the requested attribute on success. + * + *----------------------------------------------------------------------------- + */ + +static int +vmw_xv_get_port_attribute(ScrnInfoPtr pScrn, Atom attribute, + INT32 *value, pointer data) +{ + struct vmw_video_port *port = data; + Atom xvColorKey = MAKE_ATOM("XV_COLORKEY"); + Atom xvAutoPaint = MAKE_ATOM("XV_AUTOPAINT_COLORKEY"); + + if (attribute == xvColorKey) { + *value = port->colorKey; + } else if (attribute == xvAutoPaint) { + *value = port->isAutoPaintColorkey; + } else { + return XvBadAlloc; + } + + return Success; +} + + +/* + *----------------------------------------------------------------------------- + * + * vmw_xv_query_best_size -- + * + * From the spec: QueryBestSize provides the client with a way to query what + * the destination dimensions would end up being if they were to request + * that an area vid_w by vid_h from the video stream be scaled to rectangle + * of drw_w by drw_h on the screen. Since it is not expected that all + * hardware will be able to get the target dimensions exactly, it is + * important that the driver provide this function. + * + * This function seems to never be called, but to be on the safe side + * we apply the same logic that QueryImageAttributes has for width + * and height. + * + * Results: + * None. + * + * Side effects: + * None. + * + *----------------------------------------------------------------------------- + */ + +static void +vmw_xv_query_best_size(ScrnInfoPtr pScrn, Bool motion, + short vid_w, short vid_h, short drw_w, + short drw_h, unsigned int *p_w, + unsigned int *p_h, pointer data) +{ + *p_w = (drw_w + 1) & ~1; + *p_h = drw_h; + + return; +} -- cgit v1.2.3 From d8da270a2be18849eee8a168d1c1528e96677b41 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 24 Nov 2009 11:59:23 -0800 Subject: intel: Remove GL_NV_point_sprite from extension list i830 does not (and cannot!) support the any of the non-default GL_POINT_SPRITE_R_MODE_NV settings. i915 and i965 could, but currently do not. In both cases it would require mucking about with the fragment shader. --- src/mesa/drivers/dri/intel/intel_extensions.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_extensions.c b/src/mesa/drivers/dri/intel/intel_extensions.c index 2e61c556d85..877f5b59710 100644 --- a/src/mesa/drivers/dri/intel/intel_extensions.c +++ b/src/mesa/drivers/dri/intel/intel_extensions.c @@ -114,7 +114,6 @@ static const struct dri_extension card_extensions[] = { { "GL_MESA_pack_invert", NULL }, { "GL_MESA_ycbcr_texture", NULL }, { "GL_NV_blend_square", NULL }, - { "GL_NV_point_sprite", GL_NV_point_sprite_functions }, { "GL_NV_vertex_program", GL_NV_vertex_program_functions }, { "GL_NV_vertex_program1_1", NULL }, { "GL_SGIS_generate_mipmap", NULL }, -- cgit v1.2.3 From b9f4a0bd2b0104ce5f15dcd7d1698db710330418 Mon Sep 17 00:00:00 2001 From: Tom Fogal Date: Tue, 24 Nov 2009 16:46:31 -0700 Subject: Simplify hackery added to fix AIX build. Borrow an idiom from the GNU build system which can handle `for' loops over empty lists. --- progs/Makefile | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) diff --git a/progs/Makefile b/progs/Makefile index d5852fa416c..5bc444e9524 100644 --- a/progs/Makefile +++ b/progs/Makefile @@ -4,7 +4,7 @@ TOP = .. include $(TOP)/configs/current -SUBDIRS = "$(strip "$(PROGRAM_DIRS)")" +SUBDIRS = $(PROGRAM_DIRS) default: message subdirs @@ -15,22 +15,18 @@ message: subdirs: - @if test -n "$(SUBDIRS)" ; then \ - for dir in $(SUBDIRS) ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE)) || exit 1 ; \ - fi \ - done \ - fi + @list='$(SUBDIRS)'; for dir in $$list ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE)) || exit 1 ; \ + fi \ + done # Dummy install target install: clean: - -@if test -n "$(SUBDIRS)" ; then \ - for dir in $(SUBDIRS) tests ; do \ - if [ -d $$dir ] ; then \ - (cd $$dir && $(MAKE) clean) ; \ - fi \ - done \ - fi + @list='$(SUBDIRS)'; for dir in $$list tests ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) clean) ; \ + fi \ + done -- cgit v1.2.3 From ba97b98842ebe0178406258f29c93ca9fa415ff7 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 30 Nov 2009 09:54:27 -0700 Subject: progs/demos: remove unused glFogCoordPointer_ext var --- progs/demos/fogcoord.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/progs/demos/fogcoord.c b/progs/demos/fogcoord.c index 6f50993c98f..7d5c11aabf3 100644 --- a/progs/demos/fogcoord.c +++ b/progs/demos/fogcoord.c @@ -15,8 +15,6 @@ #define DEPTH 5.0f -static PFNGLFOGCOORDPOINTEREXTPROC glFogCoordPointer_ext; - static GLfloat camz; static GLint fogMode; -- cgit v1.2.3 From c78748a5274e58bcbb122923edf81065be9bbe16 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 2 Dec 2009 02:08:26 +0100 Subject: gallium: adapt drivers to interface cleanups --- src/gallium/drivers/cell/ppu/cell_texture.c | 30 +++--- src/gallium/drivers/i915/i915_surface.c | 21 +++-- src/gallium/drivers/i915/i915_texture.c | 125 ++++++++++--------------- src/gallium/drivers/llvmpipe/lp_setup.c | 2 +- src/gallium/drivers/llvmpipe/lp_tex_cache.c | 2 +- src/gallium/drivers/llvmpipe/lp_texture.c | 48 +++++----- src/gallium/drivers/llvmpipe/lp_tile_cache.c | 6 +- src/gallium/drivers/r300/r300_emit.c | 12 +-- src/gallium/drivers/r300/r300_screen.c | 9 +- src/gallium/drivers/r300/r300_texture.c | 12 +-- src/gallium/drivers/svga/svga_screen_texture.c | 37 ++++---- src/gallium/drivers/svga/svga_state_vs.c | 2 +- 12 files changed, 138 insertions(+), 168 deletions(-) diff --git a/src/gallium/drivers/cell/ppu/cell_texture.c b/src/gallium/drivers/cell/ppu/cell_texture.c index e6b8a870452..77a57aef147 100644 --- a/src/gallium/drivers/cell/ppu/cell_texture.c +++ b/src/gallium/drivers/cell/ppu/cell_texture.c @@ -65,14 +65,11 @@ cell_texture_layout(struct cell_texture *ct) w_tile = align(width, TILE_SIZE); h_tile = align(height, TILE_SIZE); - pt->nblocksx[level] = pf_get_nblocksx(&pt->block, w_tile); - pt->nblocksy[level] = pf_get_nblocksy(&pt->block, h_tile); - - ct->stride[level] = pt->nblocksx[level] * pt->block.size; + ct->stride[level] = pf_get_stride(pt->format, w_tile); ct->level_offset[level] = ct->buffer_size; - size = pt->nblocksx[level] * pt->nblocksy[level] * pt->block.size; + size = ct->stride[level] * pf_get_nblocksy(pt->format, h_tile); if (pt->target == PIPE_TEXTURE_CUBE) size *= 6; else @@ -283,10 +280,12 @@ cell_get_tex_surface(struct pipe_screen *screen, ps->zslice = zslice; if (pt->target == PIPE_TEXTURE_CUBE) { - ps->offset += face * pt->nblocksy[level] * ct->stride[level]; + unsigned h_tile = align(ps->height, TILE_SIZE); + ps->offset += face * pf_get_nblocksy(ps->format, h_tile) * ct->stride[level]; } else if (pt->target == PIPE_TEXTURE_3D) { - ps->offset += zslice * pt->nblocksy[level] * ct->stride[level]; + unsigned h_tile = align(ps->height, TILE_SIZE); + ps->offset += zslice * pf_get_nblocksy(ps->format, h_tile) * ct->stride[level]; } else { assert(face == 0); @@ -327,14 +326,10 @@ cell_get_tex_transfer(struct pipe_screen *screen, if (ctrans) { struct pipe_transfer *pt = &ctrans->base; pipe_texture_reference(&pt->texture, texture); - pt->format = texture->format; - pt->block = texture->block; pt->x = x; pt->y = y; pt->width = w; pt->height = h; - pt->nblocksx = texture->nblocksx[level]; - pt->nblocksy = texture->nblocksy[level]; pt->stride = ct->stride[level]; pt->usage = usage; pt->face = face; @@ -344,10 +339,12 @@ cell_get_tex_transfer(struct pipe_screen *screen, ctrans->offset = ct->level_offset[level]; if (texture->target == PIPE_TEXTURE_CUBE) { - ctrans->offset += face * pt->nblocksy * pt->stride; + unsigned h_tile = align(u_minify(texture->height0, level), TILE_SIZE); + ctrans->offset += face * pf_get_nblocksy(texture->format, h_tile) * pt->stride; } else if (texture->target == PIPE_TEXTURE_3D) { - ctrans->offset += zslice * pt->nblocksy * pt->stride; + unsigned h_tile = align(u_minify(texture->height0, level), TILE_SIZE); + ctrans->offset += zslice * pf_get_nblocksy(texture->format, h_tile) * pt->stride; } else { assert(face == 0); @@ -400,7 +397,8 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer) * Create a buffer of ordinary memory for the linear texture. * This is the memory that the user will read/write. */ - size = pt->nblocksx[level] * pt->nblocksy[level] * pt->block.size; + size = pf_get_stride(pt->format, align(texWidth, TILE_SIZE)) * + pf_get_nblocksy(pt->format, align(texHeight, TILE_SIZE)); ctrans->map = align_malloc(size, 16); if (!ctrans->map) @@ -408,7 +406,7 @@ cell_transfer_map(struct pipe_screen *screen, struct pipe_transfer *transfer) if (transfer->usage & PIPE_TRANSFER_READ) { /* need to untwiddle the texture to make a linear version */ - const uint bpp = pf_get_size(ct->base.format); + const uint bpp = pf_get_blocksize(ct->base.format); if (bpp == 4) { const uint *src = (uint *) (ct->mapped + ctrans->offset); uint *dst = ctrans->map; @@ -451,7 +449,7 @@ cell_transfer_unmap(struct pipe_screen *screen, /* The user wrote new texture data into the mapped buffer. * We need to convert the new linear data into the twiddled/tiled format. */ - const uint bpp = pf_get_size(ct->base.format); + const uint bpp = pf_get_blocksize(ct->base.format); if (bpp == 4) { const uint *src = ctrans->map; uint *dst = (uint *) (ct->mapped + ctrans->offset); diff --git a/src/gallium/drivers/i915/i915_surface.c b/src/gallium/drivers/i915/i915_surface.c index ab8331f3e64..24e1024aaa3 100644 --- a/src/gallium/drivers/i915/i915_surface.c +++ b/src/gallium/drivers/i915/i915_surface.c @@ -48,17 +48,19 @@ i915_surface_copy(struct pipe_context *pipe, { struct i915_texture *dst_tex = (struct i915_texture *)dst->texture; struct i915_texture *src_tex = (struct i915_texture *)src->texture; + struct pipe_texture *dpt = &dst_tex->base; + struct pipe_texture *spt = &src_tex->base; assert( dst != src ); - assert( dst_tex->base.block.size == src_tex->base.block.size ); - assert( dst_tex->base.block.width == src_tex->base.block.height ); - assert( dst_tex->base.block.height == src_tex->base.block.height ); - assert( dst_tex->base.block.width == 1 ); - assert( dst_tex->base.block.height == 1 ); + assert( pf_get_blocksize(dpt->format) == pf_get_blocksize(spt->format) ); + assert( pf_get_blockwidth(dpt->format) == pf_get_blockwidth(spt->format) ); + assert( pf_get_blockheight(dpt->format) == pf_get_blockheight(spt->format) ); + assert( pf_get_blockwidth(dpt->format) == 1 ); + assert( pf_get_blockheight(dpt->format) == 1 ); i915_copy_blit( i915_context(pipe), FALSE, - dst_tex->base.block.size, + pf_get_blocksize(dpt->format), (unsigned short) src_tex->stride, src_tex->buffer, src->offset, (unsigned short) dst_tex->stride, dst_tex->buffer, dst->offset, (short) srcx, (short) srcy, (short) dstx, (short) dsty, (short) width, (short) height ); @@ -72,12 +74,13 @@ i915_surface_fill(struct pipe_context *pipe, unsigned width, unsigned height, unsigned value) { struct i915_texture *tex = (struct i915_texture *)dst->texture; + struct pipe_texture *pt = &tex->base; - assert(tex->base.block.width == 1); - assert(tex->base.block.height == 1); + assert(pf_get_blockwidth(pt->format) == 1); + assert(pf_get_blockheight(pt->format) == 1); i915_fill_blit( i915_context(pipe), - tex->base.block.size, + pf_get_blocksize(pt->format), (unsigned short) tex->stride, tex->buffer, dst->offset, (short) dstx, (short) dsty, diff --git a/src/gallium/drivers/i915/i915_texture.c b/src/gallium/drivers/i915/i915_texture.c index c7b86dd4c57..b28b413771d 100644 --- a/src/gallium/drivers/i915/i915_texture.c +++ b/src/gallium/drivers/i915/i915_texture.c @@ -74,6 +74,9 @@ static const int step_offsets[6][2] = { {-1, 1} }; +/* XXX really need twice the size if x is already pot? + Otherwise just use util_next_power_of_two? +*/ static unsigned power_of_two(unsigned x) { @@ -83,13 +86,6 @@ power_of_two(unsigned x) return value; } -static unsigned -round_up(unsigned n, unsigned multiple) -{ - return (n + multiple - 1) & ~(multiple - 1); -} - - /* * More advanced helper funcs */ @@ -101,13 +97,8 @@ i915_miptree_set_level_info(struct i915_texture *tex, unsigned nr_images, unsigned w, unsigned h, unsigned d) { - struct pipe_texture *pt = &tex->base; - assert(level < PIPE_MAX_TEXTURE_LEVELS); - pt->nblocksx[level] = pf_get_nblocksx(&pt->block, w); - pt->nblocksy[level] = pf_get_nblocksy(&pt->block, h); - tex->nr_images[level] = nr_images; /* @@ -138,7 +129,7 @@ i915_miptree_set_image_offset(struct i915_texture *tex, assert(img < tex->nr_images[level]); - tex->image_offset[level][img] = y * tex->stride + x * tex->base.block.size; + tex->image_offset[level][img] = y * tex->stride + x * pf_get_blocksize(tex->base.format); /* printf("%s level %d img %d pos %d,%d image_offset %x\n", @@ -160,28 +151,28 @@ i915_scanout_layout(struct i915_texture *tex) { struct pipe_texture *pt = &tex->base; - if (pt->last_level > 0 || pt->block.size != 4) + if (pt->last_level > 0 || pf_get_blocksize(pt->format) != 4) return FALSE; i915_miptree_set_level_info(tex, 0, 1, - tex->base.width0, - tex->base.height0, + pt->width0, + pt->height0, 1); i915_miptree_set_image_offset(tex, 0, 0, 0, 0); - if (tex->base.width0 >= 240) { - tex->stride = power_of_two(tex->base.nblocksx[0] * pt->block.size); - tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8); + if (pt->width0 >= 240) { + tex->stride = power_of_two(pf_get_stride(pt->format, pt->width0)); + tex->total_nblocksy = align(pf_get_nblocksy(pt->format, pt->height0), 8); tex->hw_tiled = INTEL_TILE_X; - } else if (tex->base.width0 == 64 && tex->base.height0 == 64) { - tex->stride = power_of_two(tex->base.nblocksx[0] * pt->block.size); - tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8); + } else if (pt->width0 == 64 && pt->height0 == 64) { + tex->stride = power_of_two(pf_get_stride(pt->format, pt->width0)); + tex->total_nblocksy = align(pf_get_nblocksy(pt->format, pt->height0), 8); } else { return FALSE; } debug_printf("%s size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__, - tex->base.width0, tex->base.height0, pt->block.size, + pt->width0, pt->height0, pf_get_blocksize(pt->format), tex->stride, tex->total_nblocksy, tex->stride * tex->total_nblocksy); return TRUE; @@ -195,25 +186,25 @@ i915_display_target_layout(struct i915_texture *tex) { struct pipe_texture *pt = &tex->base; - if (pt->last_level > 0 || pt->block.size != 4) + if (pt->last_level > 0 || pf_get_blocksize(pt->format) != 4) return FALSE; /* fallback to normal textures for small textures */ - if (tex->base.width0 < 240) + if (pt->width0 < 240) return FALSE; i915_miptree_set_level_info(tex, 0, 1, - tex->base.width0, - tex->base.height0, + pt->width0, + pt->height0, 1); i915_miptree_set_image_offset(tex, 0, 0, 0, 0); - tex->stride = power_of_two(tex->base.nblocksx[0] * pt->block.size); - tex->total_nblocksy = round_up(tex->base.nblocksy[0], 8); + tex->stride = power_of_two(pf_get_stride(pt->format, pt->width0)); + tex->total_nblocksy = align(pf_get_nblocksy(pt->format, pt->height0), 8); tex->hw_tiled = INTEL_TILE_X; debug_printf("%s size: %d,%d,%d offset %d,%d (0x%x)\n", __FUNCTION__, - tex->base.width0, tex->base.height0, pt->block.size, + pt->width0, pt->height0, pf_get_blocksize(pt->format), tex->stride, tex->total_nblocksy, tex->stride * tex->total_nblocksy); return TRUE; @@ -226,34 +217,32 @@ i915_miptree_layout_2d(struct i915_texture *tex) unsigned level; unsigned width = pt->width0; unsigned height = pt->height0; - unsigned nblocksx = pt->nblocksx[0]; - unsigned nblocksy = pt->nblocksy[0]; + unsigned nblocksy = pf_get_nblocksy(pt->format, pt->width0); /* used for scanouts that need special layouts */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) + if (pt->tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) if (i915_scanout_layout(tex)) return; /* for shared buffers we use some very like scanout */ - if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) + if (pt->tex_usage & PIPE_TEXTURE_USAGE_DISPLAY_TARGET) if (i915_display_target_layout(tex)) return; - tex->stride = round_up(pt->nblocksx[0] * pt->block.size, 4); + tex->stride = align(pf_get_stride(pt->format, pt->width0), 4); tex->total_nblocksy = 0; for (level = 0; level <= pt->last_level; level++) { i915_miptree_set_level_info(tex, level, 1, width, height, 1); i915_miptree_set_image_offset(tex, level, 0, 0, tex->total_nblocksy); - nblocksy = round_up(MAX2(2, nblocksy), 2); + nblocksy = align(MAX2(2, nblocksy), 2); tex->total_nblocksy += nblocksy; width = u_minify(width, 1); height = u_minify(height, 1); - nblocksx = pf_get_nblocksx(&pt->block, width); - nblocksy = pf_get_nblocksy(&pt->block, height); + nblocksy = pf_get_nblocksy(pt->format, height); } } @@ -266,13 +255,12 @@ i915_miptree_layout_3d(struct i915_texture *tex) unsigned width = pt->width0; unsigned height = pt->height0; unsigned depth = pt->depth0; - unsigned nblocksx = pt->nblocksx[0]; - unsigned nblocksy = pt->nblocksy[0]; + unsigned nblocksy = pf_get_nblocksy(pt->format, pt->height0); unsigned stack_nblocksy = 0; /* Calculate the size of a single slice. */ - tex->stride = round_up(pt->nblocksx[0] * pt->block.size, 4); + tex->stride = align(pf_get_stride(pt->format, pt->width0), 4); /* XXX: hardware expects/requires 9 levels at minimum. */ @@ -283,8 +271,7 @@ i915_miptree_layout_3d(struct i915_texture *tex) width = u_minify(width, 1); height = u_minify(height, 1); - nblocksx = pf_get_nblocksx(&pt->block, width); - nblocksy = pf_get_nblocksy(&pt->block, height); + nblocksy = pf_get_nblocksy(pt->format, height); } /* Fixup depth image_offsets: @@ -309,14 +296,14 @@ i915_miptree_layout_cube(struct i915_texture *tex) { struct pipe_texture *pt = &tex->base; unsigned width = pt->width0, height = pt->height0; - const unsigned nblocks = pt->nblocksx[0]; + const unsigned nblocks = pf_get_nblocksx(pt->format, pt->width0); unsigned level; unsigned face; assert(width == height); /* cubemap images are square */ /* double pitch for cube layouts */ - tex->stride = round_up(nblocks * pt->block.size * 2, 4); + tex->stride = align(nblocks * pf_get_blocksize(pt->format) * 2, 4); tex->total_nblocksy = nblocks * 4; for (level = 0; level <= pt->last_level; level++) { @@ -379,8 +366,8 @@ i945_miptree_layout_2d(struct i915_texture *tex) unsigned y = 0; unsigned width = pt->width0; unsigned height = pt->height0; - unsigned nblocksx = pt->nblocksx[0]; - unsigned nblocksy = pt->nblocksy[0]; + unsigned nblocksx = pf_get_nblocksx(pt->format, pt->width0); + unsigned nblocksy = pf_get_nblocksy(pt->format, pt->height0); /* used for scanouts that need special layouts */ if (tex->base.tex_usage & PIPE_TEXTURE_USAGE_PRIMARY) @@ -392,7 +379,7 @@ i945_miptree_layout_2d(struct i915_texture *tex) if (i915_display_target_layout(tex)) return; - tex->stride = round_up(pt->nblocksx[0] * pt->block.size, 4); + tex->stride = align(pf_get_stride(pt->format, pt->width0), 4); /* May need to adjust pitch to accomodate the placement of * the 2nd mipmap level. This occurs when the alignment @@ -401,11 +388,11 @@ i945_miptree_layout_2d(struct i915_texture *tex) */ if (pt->last_level > 0) { unsigned mip1_nblocksx - = align(pf_get_nblocksx(&pt->block, u_minify(width, 1)), align_x) - + pf_get_nblocksx(&pt->block, u_minify(width, 2)); + = align(pf_get_nblocksx(pt->format, u_minify(width, 1)), align_x) + + pf_get_nblocksx(pt->format, u_minify(width, 2)); if (mip1_nblocksx > nblocksx) - tex->stride = mip1_nblocksx * pt->block.size; + tex->stride = mip1_nblocksx * pf_get_blocksize(pt->format); } /* Pitch must be a whole number of dwords @@ -435,8 +422,8 @@ i945_miptree_layout_2d(struct i915_texture *tex) width = u_minify(width, 1); height = u_minify(height, 1); - nblocksx = pf_get_nblocksx(&pt->block, width); - nblocksy = pf_get_nblocksy(&pt->block, height); + nblocksx = pf_get_nblocksx(pt->format, width); + nblocksy = pf_get_nblocksy(pt->format, height); } } @@ -447,17 +434,16 @@ i945_miptree_layout_3d(struct i915_texture *tex) unsigned width = pt->width0; unsigned height = pt->height0; unsigned depth = pt->depth0; - unsigned nblocksx = pt->nblocksx[0]; - unsigned nblocksy = pt->nblocksy[0]; + unsigned nblocksy = pf_get_nblocksy(pt->format, pt->width0); unsigned pack_x_pitch, pack_x_nr; unsigned pack_y_pitch; unsigned level; - tex->stride = round_up(pt->nblocksx[0] * pt->block.size, 4); + tex->stride = align(pf_get_stride(pt->format, pt->width0), 4); tex->total_nblocksy = 0; - pack_y_pitch = MAX2(pt->nblocksy[0], 2); - pack_x_pitch = tex->stride / pt->block.size; + pack_y_pitch = MAX2(nblocksy, 2); + pack_x_pitch = tex->stride / pf_get_blocksize(pt->format); pack_x_nr = 1; for (level = 0; level <= pt->last_level; level++) { @@ -482,7 +468,7 @@ i945_miptree_layout_3d(struct i915_texture *tex) if (pack_x_pitch > 4) { pack_x_pitch >>= 1; pack_x_nr <<= 1; - assert(pack_x_pitch * pack_x_nr * pt->block.size <= tex->stride); + assert(pack_x_pitch * pack_x_nr * pf_get_blocksize(pt->format) <= tex->stride); } if (pack_y_pitch > 2) { @@ -492,8 +478,7 @@ i945_miptree_layout_3d(struct i915_texture *tex) width = u_minify(width, 1); height = u_minify(height, 1); depth = u_minify(depth, 1); - nblocksx = pf_get_nblocksx(&pt->block, width); - nblocksy = pf_get_nblocksy(&pt->block, height); + nblocksy = pf_get_nblocksy(pt->format, height); } } @@ -503,7 +488,7 @@ i945_miptree_layout_cube(struct i915_texture *tex) struct pipe_texture *pt = &tex->base; unsigned level; - const unsigned nblocks = pt->nblocksx[0]; + const unsigned nblocks = pf_get_nblocksx(pt->format, pt->width0); unsigned face; unsigned width = pt->width0; unsigned height = pt->height0; @@ -523,9 +508,9 @@ i945_miptree_layout_cube(struct i915_texture *tex) * or the final row of 4x4, 2x2 and 1x1 faces below this. */ if (nblocks > 32) - tex->stride = round_up(nblocks * pt->block.size * 2, 4); + tex->stride = align(nblocks * pf_get_blocksize(pt->format) * 2, 4); else - tex->stride = 14 * 8 * pt->block.size; + tex->stride = 14 * 8 * pf_get_blocksize(pt->format); tex->total_nblocksy = nblocks * 4; @@ -645,9 +630,6 @@ i915_texture_create(struct pipe_screen *screen, pipe_reference_init(&tex->base.reference, 1); tex->base.screen = screen; - tex->base.nblocksx[0] = pf_get_nblocksx(&tex->base.block, tex->base.width0); - tex->base.nblocksy[0] = pf_get_nblocksy(&tex->base.block, tex->base.height0); - if (is->is_i945) { if (!i945_miptree_layout(tex)) goto fail; @@ -829,14 +811,10 @@ i915_get_tex_transfer(struct pipe_screen *screen, trans = CALLOC_STRUCT(i915_transfer); if (trans) { pipe_texture_reference(&trans->base.texture, texture); - trans->base.format = trans->base.format; trans->base.x = x; trans->base.y = y; trans->base.width = w; trans->base.height = h; - trans->base.block = texture->block; - trans->base.nblocksx = texture->nblocksx[level]; - trans->base.nblocksy = texture->nblocksy[level]; trans->base.stride = tex->stride; trans->offset = offset; trans->base.usage = usage; @@ -852,6 +830,7 @@ i915_transfer_map(struct pipe_screen *screen, struct intel_winsys *iws = i915_screen(tex->base.screen)->iws; char *map; boolean write = FALSE; + enum pipe_format format = tex->base.format; if (transfer->usage & PIPE_TRANSFER_WRITE) write = TRUE; @@ -861,8 +840,8 @@ i915_transfer_map(struct pipe_screen *screen, return NULL; return map + i915_transfer(transfer)->offset + - transfer->y / transfer->block.height * transfer->stride + - transfer->x / transfer->block.width * transfer->block.size; + transfer->y / pf_get_blockheight(format) * transfer->stride + + transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format); } static void diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index ffcbc9a379f..b4aabd4d7cc 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -166,7 +166,7 @@ shade_quads(struct llvmpipe_context *llvmpipe, assert((y % 2) == 0); depth = llvmpipe->zsbuf_map + y*llvmpipe->zsbuf_transfer->stride + - 2*x*llvmpipe->zsbuf_transfer->block.size; + 2*x*pf_get_blocksize(llvmpipe->zsbuf_transfer->texture->format); } else depth = NULL; diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.c b/src/gallium/drivers/llvmpipe/lp_tex_cache.c index c7c4143bc62..5dbc597d2c9 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.c @@ -291,7 +291,7 @@ lp_find_cached_tex_tile(struct llvmpipe_tex_tile_cache *tc, assert(0); } - util_format_read_4ub(tc->tex_trans->format, + util_format_read_4ub(tc->tex_trans->texture->format, (uint8_t *)tile->color, sizeof tile->color[0], tc->tex_trans_map, tc->tex_trans->stride, x, y, w, h); diff --git a/src/gallium/drivers/llvmpipe/lp_texture.c b/src/gallium/drivers/llvmpipe/lp_texture.c index 65d62fd0723..f099f903bd7 100644 --- a/src/gallium/drivers/llvmpipe/lp_texture.c +++ b/src/gallium/drivers/llvmpipe/lp_texture.c @@ -48,7 +48,6 @@ /* Simple, maximally packed layout. */ - /* Conventional allocation path for non-display textures: */ static boolean @@ -63,20 +62,15 @@ llvmpipe_texture_layout(struct llvmpipe_screen *screen, unsigned buffer_size = 0; - pf_get_block(lpt->base.format, &lpt->base.block); - for (level = 0; level <= pt->last_level; level++) { unsigned nblocksx, nblocksy; - pt->nblocksx[level] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[level] = pf_get_nblocksy(&pt->block, height); - /* Allocate storage for whole quads. This is particularly important * for depth surfaces, which are currently stored in a swizzled format. */ - nblocksx = pf_get_nblocksx(&pt->block, align(width, 2)); - nblocksy = pf_get_nblocksy(&pt->block, align(height, 2)); + nblocksx = pf_get_nblocksx(pt->format, align(width, 2)); + nblocksy = pf_get_nblocksy(pt->format, align(height, 2)); - lpt->stride[level] = align(nblocksx*pt->block.size, 16); + lpt->stride[level] = align(nblocksx * pf_get_blocksize(pt->format), 16); lpt->level_offset[level] = buffer_size; @@ -100,10 +94,6 @@ llvmpipe_displaytarget_layout(struct llvmpipe_screen *screen, { struct llvmpipe_winsys *winsys = screen->winsys; - pf_get_block(lpt->base.format, &lpt->base.block); - lpt->base.nblocksx[0] = pf_get_nblocksx(&lpt->base.block, lpt->base.width0); - lpt->base.nblocksy[0] = pf_get_nblocksy(&lpt->base.block, lpt->base.height0); - lpt->dt = winsys->displaytarget_create(winsys, lpt->base.format, lpt->base.width0, @@ -180,8 +170,6 @@ llvmpipe_texture_blanket(struct pipe_screen * screen, lpt->base = *base; pipe_reference_init(&lpt->base.reference, 1); lpt->base.screen = screen; - lpt->base.nblocksx[0] = pf_get_nblocksx(&lpt->base.block, lpt->base.width0); - lpt->base.nblocksy[0] = pf_get_nblocksy(&lpt->base.block, lpt->base.height0); lpt->stride[0] = stride[0]; pipe_buffer_reference(&lpt->buffer, buffer); @@ -255,11 +243,17 @@ llvmpipe_get_tex_surface(struct pipe_screen *screen, ps->level = level; ps->zslice = zslice; + /* XXX shouldn't that rather be + tex_height = align(ps->height, 2); + to account for alignment done in llvmpipe_texture_layout ? + */ if (pt->target == PIPE_TEXTURE_CUBE) { - ps->offset += face * pt->nblocksy[level] * lpt->stride[level]; + unsigned tex_height = ps->height; + ps->offset += face * pf_get_nblocksy(pt->format, tex_height) * lpt->stride[level]; } else if (pt->target == PIPE_TEXTURE_3D) { - ps->offset += zslice * pt->nblocksy[level] * lpt->stride[level]; + unsigned tex_height = ps->height; + ps->offset += zslice * pf_get_nblocksy(pt->format, tex_height) * lpt->stride[level]; } else { assert(face == 0); @@ -300,14 +294,10 @@ llvmpipe_get_tex_transfer(struct pipe_screen *screen, if (lpt) { struct pipe_transfer *pt = &lpt->base; pipe_texture_reference(&pt->texture, texture); - pt->format = texture->format; - pt->block = texture->block; pt->x = x; pt->y = y; pt->width = w; pt->height = h; - pt->nblocksx = texture->nblocksx[level]; - pt->nblocksy = texture->nblocksy[level]; pt->stride = lptex->stride[level]; pt->usage = usage; pt->face = face; @@ -316,11 +306,17 @@ llvmpipe_get_tex_transfer(struct pipe_screen *screen, lpt->offset = lptex->level_offset[level]; + /* XXX shouldn't that rather be + tex_height = align(u_minify(texture->height0, level), 2) + to account for alignment done in llvmpipe_texture_layout ? + */ if (texture->target == PIPE_TEXTURE_CUBE) { - lpt->offset += face * pt->nblocksy * pt->stride; + unsigned tex_height = u_minify(texture->height0, level); + lpt->offset += face * pf_get_nblocksy(texture->format, tex_height) * pt->stride; } else if (texture->target == PIPE_TEXTURE_3D) { - lpt->offset += zslice * pt->nblocksy * pt->stride; + unsigned tex_height = u_minify(texture->height0, level); + lpt->offset += zslice * pf_get_nblocksy(texture->format, tex_height) * pt->stride; } else { assert(face == 0); @@ -352,9 +348,11 @@ llvmpipe_transfer_map( struct pipe_screen *_screen, struct llvmpipe_screen *screen = llvmpipe_screen(_screen); ubyte *map, *xfer_map; struct llvmpipe_texture *lpt; + enum pipe_format format; assert(transfer->texture); lpt = llvmpipe_texture(transfer->texture); + format = lpt->base.format; if(lpt->dt) { struct llvmpipe_winsys *winsys = screen->winsys; @@ -379,8 +377,8 @@ llvmpipe_transfer_map( struct pipe_screen *_screen, } xfer_map = map + llvmpipe_transfer(transfer)->offset + - transfer->y / transfer->block.height * transfer->stride + - transfer->x / transfer->block.width * transfer->block.size; + transfer->y / pf_get_blockheight(format) * transfer->stride + + transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format); /*printf("map = %p xfer map = %p\n", map, xfer_map);*/ return xfer_map; } diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index ec3e002d628..50891c42271 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -252,13 +252,13 @@ lp_flush_tile_cache(struct llvmpipe_tile_cache *tc) case LP_TILE_STATUS_CLEAR: /* Actually clear the tiles which were flagged as being in a * clear state. */ - util_fill_rect(tc->transfer_map, &pt->block, pt->stride, + util_fill_rect(tc->transfer_map, pt->texture->format, pt->stride, x, y, w, h, tc->clear_val); break; case LP_TILE_STATUS_DEFINED: - lp_tile_write_4ub(pt->format, + lp_tile_write_4ub(pt->texture->format, tile->color, tc->transfer_map, pt->stride, x, y, w, h); @@ -306,7 +306,7 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc, y &= ~(TILE_SIZE - 1); if (!pipe_clip_tile(x, y, &w, &h, tc->transfer)) - lp_tile_read_4ub(pt->format, + lp_tile_read_4ub(pt->texture->format, tile->color, tc->transfer_map, tc->transfer->stride, x, y, w, h); diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 98a39390bf9..a479842f9eb 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -631,10 +631,10 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) for (i = 0; i < aos_count - 1; i += 2) { int buf_num1 = velem[i].vertex_buffer_index; int buf_num2 = velem[i+1].vertex_buffer_index; - assert(vbuf[buf_num1].stride % 4 == 0 && pf_get_size(velem[i].src_format) % 4 == 0); - assert(vbuf[buf_num2].stride % 4 == 0 && pf_get_size(velem[i+1].src_format) % 4 == 0); - OUT_CS((pf_get_size(velem[i].src_format) >> 2) | (vbuf[buf_num1].stride << 6) | - (pf_get_size(velem[i+1].src_format) << 14) | (vbuf[buf_num2].stride << 22)); + assert(vbuf[buf_num1].stride % 4 == 0 && pf_get_blocksize(velem[i].src_format) % 4 == 0); + assert(vbuf[buf_num2].stride % 4 == 0 && pf_get_blocksize(velem[i+1].src_format) % 4 == 0); + OUT_CS((pf_get_blocksize(velem[i].src_format) >> 2) | (vbuf[buf_num1].stride << 6) | + (pf_get_blocksize(velem[i+1].src_format) << 14) | (vbuf[buf_num2].stride << 22)); OUT_CS(vbuf[buf_num1].buffer_offset + velem[i].src_offset + offset * vbuf[buf_num1].stride); OUT_CS(vbuf[buf_num2].buffer_offset + velem[i+1].src_offset + @@ -642,8 +642,8 @@ void r300_emit_aos(struct r300_context* r300, unsigned offset) } if (aos_count & 1) { int buf_num = velem[i].vertex_buffer_index; - assert(vbuf[buf_num].stride % 4 == 0 && pf_get_size(velem[i].src_format) % 4 == 0); - OUT_CS((pf_get_size(velem[i].src_format) >> 2) | (vbuf[buf_num].stride << 6)); + assert(vbuf[buf_num].stride % 4 == 0 && pf_get_blocksize(velem[i].src_format) % 4 == 0); + OUT_CS((pf_get_blocksize(velem[i].src_format) >> 2) | (vbuf[buf_num].stride << 6)); OUT_CS(vbuf[buf_num].buffer_offset + velem[i].src_offset + offset * vbuf[buf_num].stride); } diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index 390b63007e5..032fa69ec0f 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -311,14 +311,10 @@ r300_get_tex_transfer(struct pipe_screen *screen, trans = CALLOC_STRUCT(r300_transfer); if (trans) { pipe_texture_reference(&trans->transfer.texture, texture); - trans->transfer.format = texture->format; trans->transfer.x = x; trans->transfer.y = y; trans->transfer.width = w; trans->transfer.height = h; - trans->transfer.block = texture->block; - trans->transfer.nblocksx = texture->nblocksx[level]; - trans->transfer.nblocksy = texture->nblocksy[level]; trans->transfer.stride = r300_texture_get_stride(tex, level); trans->transfer.usage = usage; @@ -344,6 +340,7 @@ static void* r300_transfer_map(struct pipe_screen* screen, { struct r300_texture* tex = (struct r300_texture*)transfer->texture; char* map; + enum pipe_format format = tex->tex.format; map = pipe_buffer_map(screen, tex->buffer, pipe_transfer_buffer_flags(transfer)); @@ -353,8 +350,8 @@ static void* r300_transfer_map(struct pipe_screen* screen, } return map + r300_transfer(transfer)->offset + - transfer->y / transfer->block.height * transfer->stride + - transfer->x / transfer->block.width * transfer->block.size; + transfer->y / pf_get_blockheight(format) * transfer->stride + + transfer->x / pf_get_blockwidth(format) * pf_get_blocksize(format); } static void r300_transfer_unmap(struct pipe_screen* screen, diff --git a/src/gallium/drivers/r300/r300_texture.c b/src/gallium/drivers/r300/r300_texture.c index 093a21ebe24..63fc6a235ac 100644 --- a/src/gallium/drivers/r300/r300_texture.c +++ b/src/gallium/drivers/r300/r300_texture.c @@ -105,7 +105,7 @@ unsigned r300_texture_get_stride(struct r300_texture* tex, unsigned level) return 0; } - return align(pf_get_stride(&tex->tex.block, u_minify(tex->tex.width0, level)), 32); + return align(pf_get_stride(tex->tex.format, u_minify(tex->tex.width0, level)), 32); } static void r300_setup_miptree(struct r300_texture* tex) @@ -115,11 +115,10 @@ static void r300_setup_miptree(struct r300_texture* tex) int i; for (i = 0; i <= base->last_level; i++) { - base->nblocksx[i] = pf_get_nblocksx(&base->block, u_minify(base->width0, i)); - base->nblocksy[i] = pf_get_nblocksy(&base->block, u_minify(base->height0, i)); + unsigned nblocksy = pf_get_nblocksy(base->format, u_minify(base->height0, i)); stride = r300_texture_get_stride(tex, i); - layer_size = stride * base->nblocksy[i]; + layer_size = stride * nblocksy; if (base->target == PIPE_TEXTURE_CUBE) size = layer_size * 6; @@ -129,7 +128,7 @@ static void r300_setup_miptree(struct r300_texture* tex) tex->offset[i] = align(tex->size, 32); tex->size = tex->offset[i] + size; tex->layer_size[i] = layer_size; - tex->pitch[i] = stride / base->block.size; + tex->pitch[i] = stride / pf_get_blocksize(base->format); debug_printf("r300: Texture miptree: Level %d " "(%dx%dx%d px, pitch %d bytes)\n", @@ -245,7 +244,7 @@ static struct pipe_texture* tex->tex.screen = screen; tex->stride_override = *stride; - tex->pitch[0] = *stride / base->block.size; + tex->pitch[0] = *stride / pf_get_blocksize(base->format); r300_setup_flags(tex); r300_setup_texture_state(tex, r300_screen(screen)->caps->is_r500); @@ -283,7 +282,6 @@ r300_video_surface_create(struct pipe_screen *screen, template.width0 = util_next_power_of_two(width); template.height0 = util_next_power_of_two(height); template.depth0 = 1; - pf_get_block(template.format, &template.block); template.tex_usage = PIPE_TEXTURE_USAGE_SAMPLER | PIPE_TEXTURE_USAGE_RENDER_TARGET; diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index fb11b80dcf9..410adf881b8 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -158,7 +158,8 @@ svga_transfer_dma_band(struct svga_transfer *st, st->base.x + st->base.width, y + h, st->base.zslice + 1, - texture->base.block.size*8/(texture->base.block.width*texture->base.block.height)); + pf_get_blocksize(texture->base.format)*8/ + (pf_get_blockwidth(texture->base.format)*pf_get_blockheight(texture->base.format))); box.x = st->base.x; box.y = y; @@ -208,7 +209,8 @@ svga_transfer_dma(struct svga_transfer *st, } else { unsigned y, h, srcy; - h = st->hw_nblocksy * st->base.block.height; + unsigned blockheight = pf_get_blockheight(st->base.texture->format); + h = st->hw_nblocksy * blockheight; srcy = 0; for(y = 0; y < st->base.height; y += h) { unsigned offset, length; @@ -218,11 +220,11 @@ svga_transfer_dma(struct svga_transfer *st, h = st->base.height - y; /* Transfer band must be aligned to pixel block boundaries */ - assert(y % st->base.block.height == 0); - assert(h % st->base.block.height == 0); + assert(y % blockheight == 0); + assert(h % blockheight == 0); - offset = y * st->base.stride / st->base.block.height; - length = h * st->base.stride / st->base.block.height; + offset = y * st->base.stride / blockheight; + length = h * st->base.stride / blockheight; sw = (uint8_t *)st->swbuf + offset; @@ -291,8 +293,6 @@ svga_texture_create(struct pipe_screen *screen, height = templat->height0; depth = templat->depth0; for(level = 0; level <= templat->last_level; ++level) { - tex->base.nblocksx[level] = pf_get_nblocksx(&tex->base.block, width); - tex->base.nblocksy[level] = pf_get_nblocksy(&tex->base.block, height); width = u_minify(width, 1); height = u_minify(height, 1); depth = u_minify(depth, 1); @@ -750,6 +750,8 @@ svga_get_tex_transfer(struct pipe_screen *screen, struct svga_screen *ss = svga_screen(screen); struct svga_winsys_screen *sws = ss->sws; struct svga_transfer *st; + unsigned nblocksx = pf_get_nblocksx(texture->format, w); + unsigned nblocksy = pf_get_nblocksy(texture->format, h); /* We can't map texture storage directly */ if (usage & PIPE_TRANSFER_MAP_DIRECTLY) @@ -759,21 +761,17 @@ svga_get_tex_transfer(struct pipe_screen *screen, if (!st) return NULL; - st->base.format = texture->format; - st->base.block = texture->block; st->base.x = x; st->base.y = y; st->base.width = w; st->base.height = h; - st->base.nblocksx = pf_get_nblocksx(&texture->block, w); - st->base.nblocksy = pf_get_nblocksy(&texture->block, h); - st->base.stride = st->base.nblocksx*st->base.block.size; + st->base.stride = nblocksx*pf_get_blocksize(texture->format); st->base.usage = usage; st->base.face = face; st->base.level = level; st->base.zslice = zslice; - st->hw_nblocksy = st->base.nblocksy; + st->hw_nblocksy = nblocksy; st->hwbuf = svga_winsys_buffer_create(ss, 1, @@ -789,15 +787,15 @@ svga_get_tex_transfer(struct pipe_screen *screen, if(!st->hwbuf) goto no_hwbuf; - if(st->hw_nblocksy < st->base.nblocksy) { + if(st->hw_nblocksy < nblocksy) { /* We couldn't allocate a hardware buffer big enough for the transfer, * so allocate regular malloc memory instead */ debug_printf("%s: failed to allocate %u KB of DMA, splitting into %u x %u KB DMA transfers\n", __FUNCTION__, - (st->base.nblocksy*st->base.stride + 1023)/1024, - (st->base.nblocksy + st->hw_nblocksy - 1)/st->hw_nblocksy, + (nblocksy*st->base.stride + 1023)/1024, + (nblocksy + st->hw_nblocksy - 1)/st->hw_nblocksy, (st->hw_nblocksy*st->base.stride + 1023)/1024); - st->swbuf = MALLOC(st->base.nblocksy*st->base.stride); + st->swbuf = MALLOC(nblocksy*st->base.stride); if(!st->swbuf) goto no_swbuf; } @@ -1046,8 +1044,7 @@ svga_screen_buffer_from_texture(struct pipe_texture *texture, svga_translate_format(texture->format), stex->handle); - *stride = pf_get_nblocksx(&texture->block, texture->width0) * - texture->block.size; + *stride = pf_get_stride(texture->format, texture->width0); return *buffer != NULL; } diff --git a/src/gallium/drivers/svga/svga_state_vs.c b/src/gallium/drivers/svga/svga_state_vs.c index a947745732c..f1b0daf9f6b 100644 --- a/src/gallium/drivers/svga/svga_state_vs.c +++ b/src/gallium/drivers/svga/svga_state_vs.c @@ -210,7 +210,7 @@ static int update_zero_stride( struct svga_context *svga, mapped_buffer = pipe_buffer_map_range(svga->pipe.screen, vbuffer->buffer, vel->src_offset, - pf_get_size(vel->src_format), + pf_get_blocksize(vel->src_format), PIPE_BUFFER_USAGE_CPU_READ); translate->set_buffer(translate, vel->vertex_buffer_index, mapped_buffer, -- cgit v1.2.3 From b47f7316dab5eb81bc7e60dc93bb5dbe824c43d4 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 12:15:46 -0800 Subject: mesa: Fix copy'n'paste problem in al1616 texel fetch. --- src/mesa/main/texfetch_tmp.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/texfetch_tmp.h b/src/mesa/main/texfetch_tmp.h index 1f0d4362361..e6772c89f36 100644 --- a/src/mesa/main/texfetch_tmp.h +++ b/src/mesa/main/texfetch_tmp.h @@ -864,7 +864,7 @@ static void store_texel_al88_rev(struct gl_texture_image *texImage, static void FETCH(f_al1616)( const struct gl_texture_image *texImage, GLint i, GLint j, GLint k, GLfloat *texel ) { - const GLuint s = *TEXEL_ADDR(GLushort, texImage, i, j, k, 1); + const GLuint s = *TEXEL_ADDR(GLuint, texImage, i, j, k, 1); texel[RCOMP] = texel[GCOMP] = texel[BCOMP] = USHORT_TO_FLOAT( s & 0xffff ); -- cgit v1.2.3 From db352f58fab419c475b89418cd27b35f5f5d3822 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 12:42:36 -0800 Subject: mesa: Fix bad conversion in AL1616_REV texstore. --- src/mesa/main/texstore.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/texstore.c b/src/mesa/main/texstore.c index 5387eb12837..792c83141ec 100644 --- a/src/mesa/main/texstore.c +++ b/src/mesa/main/texstore.c @@ -2197,18 +2197,22 @@ _mesa_texstore_al1616(TEXSTORE_PARAMS) GLuint *dstUI = (GLuint *) dstRow; if (dstFormat == MESA_FORMAT_AL1616) { for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUI[col] = PACK_COLOR_1616( FLOAT_TO_USHORT(src[1]), - FLOAT_TO_USHORT(src[0]) ); - src += 2; + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616(a, l); + src += 2; } } else { for (col = 0; col < srcWidth; col++) { - /* src[0] is luminance, src[1] is alpha */ - dstUI[col] = PACK_COLOR_1616_REV( FLOAT_TO_UBYTE(src[1]), - FLOAT_TO_UBYTE(src[0]) ); - src += 2; + GLushort l, a; + + UNCLAMPED_FLOAT_TO_USHORT(l, src[0]); + UNCLAMPED_FLOAT_TO_USHORT(a, src[1]); + dstUI[col] = PACK_COLOR_1616_REV(a, l); + src += 2; } } dstRow += dstRowStride; -- cgit v1.2.3 From 4598942b1b88a2a7d5af7febae7e79eedf00e385 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 2 Dec 2009 13:00:15 -0800 Subject: intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5615040946f..b6e0d823ed2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -126,7 +126,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ + irb->texformat = MESA_FORMAT_XRGB8888; cpp = 4; break; case GL_RGBA: @@ -314,10 +314,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: - /* XXX this is a hack since XRGB surfaces don't seem to work - * properly yet. Reading the alpha channel returns 0 instead of 1. - */ - format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From 7fc75ef7d43038385b5fba73a67f1e4783b045d6 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 3 Dec 2009 18:18:46 +0000 Subject: util: Fix generated swizzle comments. --- src/gallium/auxiliary/util/u_format_table.py | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format_table.py b/src/gallium/auxiliary/util/u_format_table.py index 8834568e8ee..2cd0f956786 100755 --- a/src/gallium/auxiliary/util/u_format_table.py +++ b/src/gallium/auxiliary/util/u_format_table.py @@ -44,11 +44,10 @@ def colorspace_map(colorspace): colorspace_channels_map = { - 'rgb': 'rgba', - 'rgba': 'rgba', - 'zs': 'zs', - 'yuv': ['y1', 'y2', 'u', 'v'], - 'dxt': [] + 'rgb': ['r', 'g', 'b', 'a'], + 'srgb': ['sr', 'sg', 'sb', 'a'], + 'zs': ['z', 's'], + 'yuv': ['y', 'u', 'v'], } @@ -94,7 +93,7 @@ def write_format_table(formats): print " {" print " %s," % (format.name,) print " \"%s\"," % (format.name,) - print " {%u, %u, %u}, /* block */" % (format.block_width, format.block_height, format.block_size()) + print " {%u, %u, %u},\t/* block */" % (format.block_width, format.block_height, format.block_size()) print " %s," % (layout_map(format.layout),) print " {" for i in range(4): @@ -103,7 +102,7 @@ def write_format_table(formats): sep = "," else: sep = "" - print " {%s, %s, %u}%s /* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i]) + print " {%s, %s, %u}%s\t/* %s */" % (kind_map[type.kind], bool_map(type.norm), type.size, sep, "xyzw"[i]) print " }," print " {" for i in range(4): @@ -113,10 +112,10 @@ def write_format_table(formats): else: sep = "" try: - comment = layout_channels_map[format.layout][i] - except: + comment = colorspace_channels_map[format.colorspace][i] + except (KeyError, IndexError): comment = 'ignored' - print " %s%s /* %s */" % (swizzle_map[swizzle], sep, comment) + print " %s%s\t/* %s */" % (swizzle_map[swizzle], sep, comment) print " }," print " %s," % (colorspace_map(format.colorspace),) print " }," -- cgit v1.2.3 From 94b5c28a98850f42fbcdab9ceda1450279e1e6fd Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Wed, 2 Dec 2009 16:55:33 +0100 Subject: gallium: adapt nv drivers to interface cleanups --- src/gallium/drivers/nv04/nv04_miptree.c | 13 ++------ src/gallium/drivers/nv04/nv04_surface_2d.c | 12 ++++---- src/gallium/drivers/nv04/nv04_transfer.c | 9 +----- src/gallium/drivers/nv10/nv10_miptree.c | 11 ++----- src/gallium/drivers/nv10/nv10_transfer.c | 9 +----- src/gallium/drivers/nv20/nv20_miptree.c | 10 ++----- src/gallium/drivers/nv20/nv20_transfer.c | 9 +----- src/gallium/drivers/nv30/nv30_miptree.c | 11 ++----- src/gallium/drivers/nv30/nv30_transfer.c | 9 +----- src/gallium/drivers/nv40/nv40_miptree.c | 11 ++----- src/gallium/drivers/nv40/nv40_transfer.c | 9 +----- src/gallium/drivers/nv50/nv50_miptree.c | 10 +++---- src/gallium/drivers/nv50/nv50_transfer.c | 48 +++++++++++++----------------- 13 files changed, 51 insertions(+), 120 deletions(-) diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c index 4fd72c82e62..eeab6dfa303 100644 --- a/src/gallium/drivers/nv04/nv04_miptree.c +++ b/src/gallium/drivers/nv04/nv04_miptree.c @@ -10,28 +10,21 @@ static void nv04_miptree_layout(struct nv04_miptree *nv04mt) { struct pipe_texture *pt = &nv04mt->base; - uint width = pt->width0, height = pt->height0; uint offset = 0; int nr_faces, l; nr_faces = 1; for (l = 0; l <= pt->last_level; l++) { - - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - nv04mt->level[l].pitch = pt->width0; nv04mt->level[l].pitch = (nv04mt->level[l].pitch + 63) & ~63; - - width = u_minify(width, 1); - height = u_minify(height, 1); } for (l = 0; l <= pt->last_level; l++) { - nv04mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); + /* XXX guess was obviously missing */ + nv04mt->level[l].image_offset[0] = offset; offset += nv04mt->level[l].pitch * u_minify(pt->height0, l); } @@ -128,7 +121,7 @@ nv04_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt, ns->base.zslice = zslice; ns->pitch = nv04mt->level[level].pitch; - ns->base.offset = nv04mt->level[level].image_offset; + ns->base.offset = nv04mt->level[level].image_offset[0]; return &ns->base; } diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 8be134b83dd..932893eef59 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -155,10 +155,10 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, sub_w = MIN2(sub_w, w - x); /* Must be 64-byte aligned */ - assert(!((dst->offset + nv04_swizzle_bits(dx+x, dy+y) * dst->texture->block.size) & 63)); + assert(!((dst->offset + nv04_swizzle_bits(dx+x, dy+y) * pf_get_blocksize(dst->texture->format)) & 63)); BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_OFFSET, 1); - OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(dx+x, dy+y) * dst->texture->block.size, + OUT_RELOCl(chan, dst_bo, dst->offset + nv04_swizzle_bits(dx+x, dy+y) * pf_get_blocksize(dst->texture->format), NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); BEGIN_RING(chan, sifm, NV04_SCALED_IMAGE_FROM_MEMORY_COLOR_CONVERSION, 9); @@ -177,7 +177,7 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, OUT_RING (chan, src_pitch | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_ORIGIN_CENTER | NV04_SCALED_IMAGE_FROM_MEMORY_FORMAT_FILTER_POINT_SAMPLE); - OUT_RELOCl(chan, src_bo, src->offset + (sy+y) * src_pitch + (sx+x) * src->texture->block.size, + OUT_RELOCl(chan, src_bo, src->offset + (sy+y) * src_pitch + (sx+x) * pf_get_blocksize(src->texture->format), NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); OUT_RING (chan, 0); } @@ -198,9 +198,9 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx, unsigned src_pitch = ((struct nv04_surface *)src)->pitch; unsigned dst_pitch = ((struct nv04_surface *)dst)->pitch; unsigned dst_offset = dst->offset + dy * dst_pitch + - dx * dst->texture->block.size; + dx * pf_get_blocksize(dst->texture->format); unsigned src_offset = src->offset + sy * src_pitch + - sx * src->texture->block.size; + sx * pf_get_blocksize(src->texture->format); WAIT_RING (chan, 3 + ((h / 2047) + 1) * 9); BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2); @@ -219,7 +219,7 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_WR); OUT_RING (chan, src_pitch); OUT_RING (chan, dst_pitch); - OUT_RING (chan, w * src->texture->block.size); + OUT_RING (chan, w * pf_get_blocksize(src->texture->format)); OUT_RING (chan, count); OUT_RING (chan, 0x0101); OUT_RING (chan, 0); diff --git a/src/gallium/drivers/nv04/nv04_transfer.c b/src/gallium/drivers/nv04/nv04_transfer.c index e6456429f4e..e8ff686b4ab 100644 --- a/src/gallium/drivers/nv04/nv04_transfer.c +++ b/src/gallium/drivers/nv04/nv04_transfer.c @@ -24,9 +24,6 @@ nv04_compatible_transfer_tex(struct pipe_texture *pt, unsigned level, template->width0 = u_minify(pt->width0, level); template->height0 = u_minify(pt->height0, level); template->depth0 = 1; - template->block = pt->block; - template->nblocksx[0] = pt->nblocksx[level]; - template->nblocksy[0] = pt->nblocksx[level]; template->last_level = 0; template->nr_samples = pt->nr_samples; @@ -49,14 +46,10 @@ nv04_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; tx->base.x = x; tx->base.y = y; tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; tx->base.stride = mt->level[level].pitch; tx->base.usage = usage; tx->base.face = face; @@ -158,7 +151,7 @@ nv04_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx) pipe_transfer_buffer_flags(ptx)); return map + ns->base.offset + - ptx->y * ns->pitch + ptx->x * ptx->block.size; + ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format); } static void diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c index b2a6c59b749..439beeccc32 100644 --- a/src/gallium/drivers/nv10/nv10_miptree.c +++ b/src/gallium/drivers/nv10/nv10_miptree.c @@ -11,7 +11,7 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt) { struct pipe_texture *pt = &nv10mt->base; boolean swizzled = FALSE; - uint width = pt->width0, height = pt->height0; + uint width = pt->width0; uint offset = 0; int nr_faces, l, f; @@ -22,21 +22,16 @@ nv10_miptree_layout(struct nv10_miptree *nv10mt) } for (l = 0; l <= pt->last_level; l++) { - - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (swizzled) - nv10mt->level[l].pitch = pt->nblocksx[l] * pt->block.size; + nv10mt->level[l].pitch = pf_get_stride(pt->format, width); else - nv10mt->level[l].pitch = pt->nblocksx[0] * pt->block.size; + nv10mt->level[l].pitch = pf_get_stride(pt->format, pt->width0); nv10mt->level[l].pitch = (nv10mt->level[l].pitch + 63) & ~63; nv10mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); width = u_minify(width, 1); - height = u_minify(height, 1); } diff --git a/src/gallium/drivers/nv10/nv10_transfer.c b/src/gallium/drivers/nv10/nv10_transfer.c index ec54297ab01..9e44d37367f 100644 --- a/src/gallium/drivers/nv10/nv10_transfer.c +++ b/src/gallium/drivers/nv10/nv10_transfer.c @@ -24,9 +24,6 @@ nv10_compatible_transfer_tex(struct pipe_texture *pt, unsigned level, template->width0 = u_minify(pt->width0, level); template->height0 = u_minify(pt->height0, level); template->depth0 = 1; - template->block = pt->block; - template->nblocksx[0] = pt->nblocksx[level]; - template->nblocksy[0] = pt->nblocksx[level]; template->last_level = 0; template->nr_samples = pt->nr_samples; @@ -49,14 +46,10 @@ nv10_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; tx->base.x = x; tx->base.y = y; tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; tx->base.stride = mt->level[level].pitch; tx->base.usage = usage; tx->base.face = face; @@ -158,7 +151,7 @@ nv10_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx) pipe_transfer_buffer_flags(ptx)); return map + ns->base.offset + - ptx->y * ns->pitch + ptx->x * ptx->block.size; + ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format); } static void diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index 554e28e47dd..2bde9fb75bc 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -10,7 +10,7 @@ static void nv20_miptree_layout(struct nv20_miptree *nv20mt) { struct pipe_texture *pt = &nv20mt->base; - uint width = pt->width0, height = pt->height0; + uint width = pt->width0; uint offset = 0; int nr_faces, l, f; uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER | @@ -26,19 +26,15 @@ nv20_miptree_layout(struct nv20_miptree *nv20mt) } for (l = 0; l <= pt->last_level; l++) { - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) - nv20mt->level[l].pitch = align(pt->width0 * pt->block.size, 64); + nv20mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64); else - nv20mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size; + nv20mt->level[l].pitch = pf_get_stride(pt->format, width); nv20mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); width = u_minify(width, 1); - height = u_minify(height, 1); } for (f = 0; f < nr_faces; f++) { diff --git a/src/gallium/drivers/nv20/nv20_transfer.c b/src/gallium/drivers/nv20/nv20_transfer.c index 87b5c14a3c2..f2e0a34db9f 100644 --- a/src/gallium/drivers/nv20/nv20_transfer.c +++ b/src/gallium/drivers/nv20/nv20_transfer.c @@ -24,9 +24,6 @@ nv20_compatible_transfer_tex(struct pipe_texture *pt, unsigned level, template->width0 = u_minify(pt->width0, level); template->height0 = u_minify(pt->height0, level); template->depth0 = 1; - template->block = pt->block; - template->nblocksx[0] = pt->nblocksx[level]; - template->nblocksy[0] = pt->nblocksx[level]; template->last_level = 0; template->nr_samples = pt->nr_samples; @@ -49,14 +46,10 @@ nv20_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; tx->base.x = x; tx->base.y = y; tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; tx->base.stride = mt->level[level].pitch; tx->base.usage = usage; tx->base.face = face; @@ -158,7 +151,7 @@ nv20_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx) pipe_transfer_buffer_flags(ptx)); return map + ns->base.offset + - ptx->y * ns->pitch + ptx->x * ptx->block.size; + ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format); } static void diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index b4c306d1272..9e50a7cf6bf 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -9,7 +9,7 @@ static void nv30_miptree_layout(struct nv30_miptree *nv30mt) { struct pipe_texture *pt = &nv30mt->base; - uint width = pt->width0, height = pt->height0, depth = pt->depth0; + uint width = pt->width0; uint offset = 0; int nr_faces, l, f; uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER | @@ -28,20 +28,15 @@ nv30_miptree_layout(struct nv30_miptree *nv30mt) } for (l = 0; l <= pt->last_level; l++) { - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) - nv30mt->level[l].pitch = align(pt->width0 * pt->block.size, 64); + nv30mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64); else - nv30mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size; + nv30mt->level[l].pitch = pf_get_stride(pt->format, width); nv30mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); width = u_minify(width, 1); - height = u_minify(height, 1); - depth = u_minify(depth, 1); } for (f = 0; f < nr_faces; f++) { diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c index 5e429b4d85c..c8c3bd1f177 100644 --- a/src/gallium/drivers/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nv30/nv30_transfer.c @@ -24,9 +24,6 @@ nv30_compatible_transfer_tex(struct pipe_texture *pt, unsigned level, template->width0 = u_minify(pt->width0, level); template->height0 = u_minify(pt->height0, level); template->depth0 = 1; - template->block = pt->block; - template->nblocksx[0] = pt->nblocksx[level]; - template->nblocksy[0] = pt->nblocksx[level]; template->last_level = 0; template->nr_samples = pt->nr_samples; @@ -49,14 +46,10 @@ nv30_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; tx->base.x = x; tx->base.y = y; tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; tx->base.stride = mt->level[level].pitch; tx->base.usage = usage; tx->base.face = face; @@ -158,7 +151,7 @@ nv30_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx) pipe_transfer_buffer_flags(ptx)); return map + ns->base.offset + - ptx->y * ns->pitch + ptx->x * ptx->block.size; + ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format); } static void diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index f73bedff6d8..8779c5572b9 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -9,7 +9,7 @@ static void nv40_miptree_layout(struct nv40_miptree *mt) { struct pipe_texture *pt = &mt->base; - uint width = pt->width0, height = pt->height0, depth = pt->depth0; + uint width = pt->width0; uint offset = 0; int nr_faces, l, f; uint wide_pitch = pt->tex_usage & (PIPE_TEXTURE_USAGE_SAMPLER | @@ -28,20 +28,15 @@ nv40_miptree_layout(struct nv40_miptree *mt) } for (l = 0; l <= pt->last_level; l++) { - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); - if (wide_pitch && (pt->tex_usage & NOUVEAU_TEXTURE_USAGE_LINEAR)) - mt->level[l].pitch = align(pt->width0 * pt->block.size, 64); + mt->level[l].pitch = align(pf_get_stride(pt->format, pt->width0), 64); else - mt->level[l].pitch = u_minify(pt->width0, l) * pt->block.size; + mt->level[l].pitch = pf_get_stride(pt->format, width); mt->level[l].image_offset = CALLOC(nr_faces, sizeof(unsigned)); width = u_minify(width, 1); - height = u_minify(height, 1); - depth = u_minify(depth, 1); } for (f = 0; f < nr_faces; f++) { diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c index 36e253c96f9..1ee5cf39e01 100644 --- a/src/gallium/drivers/nv40/nv40_transfer.c +++ b/src/gallium/drivers/nv40/nv40_transfer.c @@ -24,9 +24,6 @@ nv40_compatible_transfer_tex(struct pipe_texture *pt, unsigned level, template->width0 = u_minify(pt->width0, level); template->height0 = u_minify(pt->height0, level); template->depth0 = 1; - template->block = pt->block; - template->nblocksx[0] = pt->nblocksx[level]; - template->nblocksy[0] = pt->nblocksx[level]; template->last_level = 0; template->nr_samples = pt->nr_samples; @@ -49,14 +46,10 @@ nv40_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; tx->base.x = x; tx->base.y = y; tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; tx->base.stride = mt->level[level].pitch; tx->base.usage = usage; tx->base.face = face; @@ -158,7 +151,7 @@ nv40_transfer_map(struct pipe_screen *pscreen, struct pipe_transfer *ptx) pipe_transfer_buffer_flags(ptx)); return map + ns->base.offset + - ptx->y * ns->pitch + ptx->x * ptx->block.size; + ptx->y * ns->pitch + ptx->x * pf_get_blocksize(ptx->texture->format); } static void diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 3d58746793f..40ee6659993 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -91,13 +91,11 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) for (l = 0; l <= pt->last_level; l++) { struct nv50_miptree_level *lvl = &mt->level[l]; - - pt->nblocksx[l] = pf_get_nblocksx(&pt->block, width); - pt->nblocksy[l] = pf_get_nblocksy(&pt->block, height); + unsigned nblocksy = pf_get_nblocksy(pt->format, height); lvl->image_offset = CALLOC(mt->image_nr, sizeof(int)); - lvl->pitch = align(pt->nblocksx[l] * pt->block.size, 64); - lvl->tile_mode = get_tile_mode(pt->nblocksy[l], depth); + lvl->pitch = align(pf_get_stride(pt->format, width), 64); + lvl->tile_mode = get_tile_mode(nblocksy, depth); width = u_minify(width, 1); height = u_minify(height, 1); @@ -118,7 +116,7 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) unsigned tile_d = get_tile_depth(lvl->tile_mode); size = lvl->pitch; - size *= align(pt->nblocksy[l], tile_h); + size *= align(pf_get_nblocksy(pt->format, u_minify(pt->height0, l)), tile_h); size *= align(u_minify(pt->depth0, l), tile_d); lvl->image_offset[i] = mt->total_size; diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index 39d65279fc0..4705f96f572 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -16,6 +16,8 @@ struct nv50_transfer { int level_depth; int level_x; int level_y; + unsigned nblocksx; + unsigned nblocksy; }; static void @@ -151,20 +153,11 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; pipe_texture_reference(&tx->base.texture, pt); - tx->base.format = pt->format; + tx->nblocksx = pf_get_nblocksx(pt->format, u_minify(pt->width0, level)); + tx->nblocksy = pf_get_nblocksy(pt->format, u_minify(pt->height0, level)); tx->base.width = w; tx->base.height = h; - tx->base.block = pt->block; - if (!pt->nblocksx[level]) { - tx->base.nblocksx = pf_get_nblocksx(&pt->block, - u_minify(pt->width0, level)); - tx->base.nblocksy = pf_get_nblocksy(&pt->block, - u_minify(pt->height0, level)); - } else { - tx->base.nblocksx = pt->nblocksx[level]; - tx->base.nblocksy = pt->nblocksy[level]; - } - tx->base.stride = tx->base.nblocksx * pt->block.size; + tx->base.stride = tx->nblocksx * pf_get_blocksize(pt->format); tx->base.usage = usage; tx->level_pitch = lvl->pitch; @@ -173,10 +166,10 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, tx->level_depth = u_minify(mt->base.base.depth0, level); tx->level_offset = lvl->image_offset[image]; tx->level_tiling = lvl->tile_mode; - tx->level_x = pf_get_nblocksx(&tx->base.block, x); - tx->level_y = pf_get_nblocksy(&tx->base.block, y); + tx->level_x = pf_get_nblocksx(pt->format, x); + tx->level_y = pf_get_nblocksy(pt->format, y); ret = nouveau_bo_new(dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, - tx->base.nblocksy * tx->base.stride, &tx->bo); + tx->nblocksy * tx->base.stride, &tx->bo); if (ret) { FREE(tx); return NULL; @@ -185,22 +178,22 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, if (pt->target == PIPE_TEXTURE_3D) tx->level_offset += get_zslice_offset(lvl->tile_mode, zslice, lvl->pitch, - tx->base.nblocksy); + tx->nblocksy); if (usage & PIPE_TRANSFER_READ) { - nx = pf_get_nblocksx(&tx->base.block, tx->base.width); - ny = pf_get_nblocksy(&tx->base.block, tx->base.height); + nx = pf_get_nblocksx(pt->format, tx->base.width); + ny = pf_get_nblocksy(pt->format, tx->base.height); nv50_transfer_rect_m2mf(pscreen, mt->base.bo, tx->level_offset, tx->level_pitch, tx->level_tiling, x, y, - tx->base.nblocksx, tx->base.nblocksy, + tx->nblocksx, tx->nblocksy, tx->level_depth, tx->bo, 0, tx->base.stride, tx->bo->tile_mode, 0, 0, - tx->base.nblocksx, tx->base.nblocksy, 1, - tx->base.block.size, nx, ny, + tx->nblocksx, tx->nblocksy, 1, + pf_get_blocksize(pt->format), nx, ny, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART, NOUVEAU_BO_GART); } @@ -213,23 +206,24 @@ nv50_transfer_del(struct pipe_transfer *ptx) { struct nv50_transfer *tx = (struct nv50_transfer *)ptx; struct nv50_miptree *mt = nv50_miptree(ptx->texture); + struct pipe_texture *pt = ptx->texture; - unsigned nx = pf_get_nblocksx(&tx->base.block, tx->base.width); - unsigned ny = pf_get_nblocksy(&tx->base.block, tx->base.height); + unsigned nx = pf_get_nblocksx(pt->format, tx->base.width); + unsigned ny = pf_get_nblocksy(pt->format, tx->base.height); if (ptx->usage & PIPE_TRANSFER_WRITE) { - struct pipe_screen *pscreen = ptx->texture->screen; + struct pipe_screen *pscreen = pt->screen; nv50_transfer_rect_m2mf(pscreen, tx->bo, 0, tx->base.stride, tx->bo->tile_mode, 0, 0, - tx->base.nblocksx, tx->base.nblocksy, 1, + tx->nblocksx, tx->nblocksy, 1, mt->base.bo, tx->level_offset, tx->level_pitch, tx->level_tiling, tx->level_x, tx->level_y, - tx->base.nblocksx, tx->base.nblocksy, + tx->nblocksx, tx->nblocksy, tx->level_depth, - tx->base.block.size, nx, ny, + pf_get_blocksize(pt->format), nx, ny, NOUVEAU_BO_GART, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART); } -- cgit v1.2.3 From 908a3e56ccf2e6266ebf081e2947e2d6b24f2585 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 2 Dec 2009 09:31:26 -0700 Subject: cell: added tex_usage param to xm_surface_buffer_create() --- src/gallium/winsys/xlib/xlib_cell.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/winsys/xlib/xlib_cell.c b/src/gallium/winsys/xlib/xlib_cell.c index 13e609f58fe..5f8dc2ab241 100644 --- a/src/gallium/winsys/xlib/xlib_cell.c +++ b/src/gallium/winsys/xlib/xlib_cell.c @@ -291,6 +291,7 @@ xm_surface_buffer_create(struct pipe_winsys *winsys, unsigned width, unsigned height, enum pipe_format format, unsigned usage, + unsigned tex_usage, unsigned *stride) { const unsigned alignment = 64; -- cgit v1.2.3 From 67a0628ab2830371fc0a80b58aa4757c099471dc Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 14 Nov 2009 21:36:18 -0800 Subject: progs: Ignore Mac OS dSYM directories. (cherry picked from commit a420056750908f7c2f9a7c18b3ab20f04e49711d) --- progs/.gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 progs/.gitignore diff --git a/progs/.gitignore b/progs/.gitignore new file mode 100644 index 00000000000..cb77d18a4b3 --- /dev/null +++ b/progs/.gitignore @@ -0,0 +1 @@ +*.dSYM -- cgit v1.2.3 From ccea09cd3a3f18c28ebdc07c7fe879a59cd72f60 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 16 Sep 2009 15:49:33 -0600 Subject: progs/glsl: minor Makefile clean-ups (cherry picked from commit 4df2f7af5e9b2c00ead92fe0ae49ed8491aef1d0) --- progs/glsl/Makefile | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index 8103a5cbca0..a8e4cf3e661 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -10,16 +10,15 @@ LIB_DEP = \ $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) \ $(TOP)/$(LIB_DIR)/$(GLUT_LIB_NAME) -LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) - -INCLUDE_DIRS = -I$(TOP)/progs/util +LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ + -l$(GL_LIB) $(APP_LIB_DEPS) # using : to avoid APP_CC pointing to CC loop -CC:=$(APP_CC) +CC := $(APP_CC) CFLAGS += -I$(INCDIR) -LDLIBS=$(LIBS) +LDLIBS = $(LIBS) -DEMO_SOURCES = \ +PROG_SOURCES = \ array.c \ bitmap.c \ brick.c \ @@ -59,8 +58,8 @@ UTIL_SOURCES = \ readtex.c UTIL_OBJS = $(UTIL_SOURCES:.c=.o) -PROG_OBJS = $(DEMO_SOURCES:.c=.o) -PROGS = $(DEMO_SOURCES:%.c=%) +PROG_OBJS = $(PROG_SOURCES:.c=.o) +PROGS = $(PROG_SOURCES:%.c=%) ##### TARGETS ##### -- cgit v1.2.3 From 2a5cd95e243a0e8db25a8c7614c9b9fe5f116044 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 21 Sep 2009 08:44:53 -0600 Subject: progs/glsl: Include local headers before installed headers during compilation. Fixes compilation errors on platforms with insufficient older installed GL headers. (cherry picked from commit d17af7d1e19e637e29db47bd8f6e3e579760c530) --- progs/glsl/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/glsl/Makefile b/progs/glsl/Makefile index a8e4cf3e661..8928c833c0e 100644 --- a/progs/glsl/Makefile +++ b/progs/glsl/Makefile @@ -15,7 +15,7 @@ LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) \ # using : to avoid APP_CC pointing to CC loop CC := $(APP_CC) -CFLAGS += -I$(INCDIR) +CFLAGS := -I$(INCDIR) $(CFLAGS) LDLIBS = $(LIBS) PROG_SOURCES = \ -- cgit v1.2.3 From 832593772dac9b83db1ed44c8654352978e756eb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 23:15:25 -0800 Subject: progs/glsl: Fix mandelbrot GLSL compilation error on Mac OS. (cherry picked from commit 04442841fb7e9138eb50ff692952ad7e8c3877d8) --- progs/glsl/CH18-mandel.frag | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/glsl/CH18-mandel.frag b/progs/glsl/CH18-mandel.frag index a472d812526..a972d68bcfb 100644 --- a/progs/glsl/CH18-mandel.frag +++ b/progs/glsl/CH18-mandel.frag @@ -31,7 +31,7 @@ void main() float iter; // for (iter = 0.0; iter < MaxIterations && r2 < 4.0; ++iter) - for (iter = 0.0; iter < 12 && r2 < 4.0; ++iter) + for (iter = 0.0; iter < 12.0 && r2 < 4.0; ++iter) { float tempreal = real; -- cgit v1.2.3 From 9ed77d12b10c2ed830647bfcadfb3478b2e418d1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 12 Nov 2009 16:20:23 -0800 Subject: progs/glsl: Add missing break statement in multinoise.c. (cherry picked from commit 43080e40aa0d34423e10f1d50aad15289b2b9aec) --- progs/glsl/multinoise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c index 0d4026e29cf..06207f78b58 100644 --- a/progs/glsl/multinoise.c +++ b/progs/glsl/multinoise.c @@ -125,6 +125,7 @@ Key(unsigned char key, int x, int y) case 'a': Anim = !Anim; glutIdleFunc(Anim ? Idle : NULL); + break; case 's': Slice -= step; break; -- cgit v1.2.3 From 8f4d3613daa5684ff8aba75158ef7585a8005ed0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 12:49:31 -0800 Subject: progs/glsl: Fix multinoise GLSL compilation errors on Mac OS. (cherry picked from commit d4dc2e30dada1be425e95ba270920db6eb210982) --- progs/glsl/multinoise.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/progs/glsl/multinoise.c b/progs/glsl/multinoise.c index 06207f78b58..d504ba1cc4e 100644 --- a/progs/glsl/multinoise.c +++ b/progs/glsl/multinoise.c @@ -22,22 +22,22 @@ static const char *FragShaderText[ 4 ] = { "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].w ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n", "void main()\n" "{\n" " gl_FragColor.rgb = noise3( gl_TexCoord[ 0 ].xyzw ) * 0.5 + 0.5;\n" - " gl_FragColor.a = 1;\n" + " gl_FragColor.a = 1.0;\n" "}\n" }; @@ -194,7 +194,7 @@ LoadAndCompileShader(GLuint shader, const char *text) GLchar log[1000]; GLsizei len; glGetShaderInfoLog(shader, 1000, &len, log); - fprintf(stderr, "noise: problem compiling shader: %s\n", log); + fprintf(stderr, "multinoise: problem compiling shader: %s\n", log); exit(1); } else { -- cgit v1.2.3 From 592c8522a280898ba7a797923c0e054ac6df038f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 11 Nov 2009 17:39:58 -0800 Subject: demos/glsl: Add missing break statement to noise test. (cherry picked from commit 7dfea5c0722e9da101805c15b9dd26352816bca9) --- progs/glsl/noise.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/glsl/noise.c b/progs/glsl/noise.c index fdab263ea6a..bb024b50121 100644 --- a/progs/glsl/noise.c +++ b/progs/glsl/noise.c @@ -119,6 +119,7 @@ Key(unsigned char key, int x, int y) case 'a': Anim = !Anim; glutIdleFunc(Anim ? Idle : NULL); + break; case 's': Slice -= step; break; -- cgit v1.2.3 From b094683e7c2f14f61cf3511f286b4cea450609c8 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 13:50:49 -0800 Subject: progs/glsl: Fix noise GLSL compilation error on Mac OS. (cherry picked from commit 0d31990b4742eccdf6ae6a3b3e16c81cc863085d) --- progs/glsl/noise.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/glsl/noise.c b/progs/glsl/noise.c index bb024b50121..1148580ff4d 100644 --- a/progs/glsl/noise.c +++ b/progs/glsl/noise.c @@ -28,7 +28,7 @@ static const char *FragShaderText = " vec4 p;\n" " p.xy = gl_TexCoord[0].xy;\n" " p.z = Slice;\n" - " p.w = 0;\n" + " p.w = 0.0;\n" " vec4 n = noise4(p * scale);\n" " gl_FragColor = n * Scale + Bias;\n" "}\n"; -- cgit v1.2.3 From 0a107d36c2f290cd42e29008dec5194df55b7690 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 14:02:20 -0800 Subject: progs/glsl: Fix trirast GLSL compilation errors on Mac OS. (cherry picked from commit 4b3ec2acf2cc2830b0907e4fb4db8bd1ff4a18e3) --- progs/glsl/trirast.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/progs/glsl/trirast.c b/progs/glsl/trirast.c index 53bd91ef976..857342636dc 100644 --- a/progs/glsl/trirast.c +++ b/progs/glsl/trirast.c @@ -179,9 +179,9 @@ Init(void) "\n" "void main() {\n" " vec2 p = gl_FragCoord.xy; \n" - " if (crs(v1 - v0, p - v0) >= 0 && \n" - " crs(v2 - v1, p - v1) >= 0 && \n" - " crs(v0 - v2, p - v2) >= 0) \n" + " if (crs(v1 - v0, p - v0) >= 0.0 && \n" + " crs(v2 - v1, p - v1) >= 0.0 && \n" + " crs(v0 - v2, p - v2) >= 0.0) \n" " gl_FragColor = vec4(1.0); \n" " else \n" " gl_FragColor = vec4(0.5); \n" -- cgit v1.2.3 From 235c0c81346c44e24909b6e48394ea62b136a36b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 23:56:07 -0800 Subject: progs/vpglsl: Fix psiz-mul.glsl compilation error on Mac OS. (cherry picked from commit b98db7bf697c3ed6e6df303e9dd66f7ac31eb3e2) --- progs/vpglsl/psiz-mul.glsl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/vpglsl/psiz-mul.glsl b/progs/vpglsl/psiz-mul.glsl index 77f4a46b520..d2a90d8578e 100644 --- a/progs/vpglsl/psiz-mul.glsl +++ b/progs/vpglsl/psiz-mul.glsl @@ -1,6 +1,6 @@ void main() { gl_FrontColor = gl_Color; - gl_PointSize = 10 * gl_Color.x; + gl_PointSize = 10.0 * gl_Color.x; gl_Position = gl_Vertex; } -- cgit v1.2.3 From c3b7f93e0284bf3337f32f3ec77fde4dbcc9c283 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Sep 2009 12:31:42 +0100 Subject: scons: Add Mac OS to target platform list. (cherry picked from commit 2c307c775018e5b9680de8022ddf0ce3b6f560be) --- common.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common.py b/common.py index ccb962981d1..3b6bf52c035 100644 --- a/common.py +++ b/common.py @@ -59,7 +59,7 @@ def AddOptions(opts): opts.Add(EnumOption('machine', 'use machine-specific assembly code', default_machine, allowed_values=('generic', 'ppc', 'x86', 'x86_64'))) opts.Add(EnumOption('platform', 'target platform', default_platform, - allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince'))) + allowed_values=('linux', 'cell', 'windows', 'winddk', 'wince', 'darwin'))) opts.Add(EnumOption('toolchain', 'compiler toolchain', 'default', allowed_values=('default', 'crossmingw', 'winsdk', 'winddk'))) opts.Add(BoolOption('llvm', 'use LLVM', 'no')) -- cgit v1.2.3 From 2b5618fc5bdcbee3434f8b5aa3a31eb06fb479c0 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Thu, 3 Dec 2009 11:20:40 -0500 Subject: r200: fix polygon stipple fixes fdo bug 25354 Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/r200/r200_context.c | 4 ++-- src/mesa/drivers/dri/r200/r200_state.c | 7 ++----- src/mesa/drivers/dri/r200/r200_state.h | 2 +- src/mesa/drivers/dri/r200/r200_state_init.c | 15 ++++++--------- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c index 3ddb5bf7d60..4e34e0986d0 100644 --- a/src/mesa/drivers/dri/r200/r200_context.c +++ b/src/mesa/drivers/dri/r200/r200_context.c @@ -325,9 +325,9 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual, _mesa_init_driver_functions(&functions); r200InitDriverFuncs(&functions); r200InitIoctlFuncs(&functions); - r200InitStateFuncs(&functions, screen->kernel_mm); + r200InitStateFuncs(&functions); r200InitTextureFuncs(&functions); - r200InitShaderFuncs(&functions); + r200InitShaderFuncs(&functions); radeonInitQueryObjFunctions(&functions); if (!radeonInitContext(&rmesa->radeon, &functions, diff --git a/src/mesa/drivers/dri/r200/r200_state.c b/src/mesa/drivers/dri/r200/r200_state.c index d28e96d9d98..6d99c039ded 100644 --- a/src/mesa/drivers/dri/r200/r200_state.c +++ b/src/mesa/drivers/dri/r200/r200_state.c @@ -2476,7 +2476,7 @@ static void r200PolygonStipple( GLcontext *ctx, const GLubyte *mask ) } /* Initialize the driver's state functions. */ -void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ) +void r200InitStateFuncs( struct dd_function_table *functions ) { functions->UpdateState = r200InvalidateState; functions->LightingSpaceChange = r200LightingSpaceChange; @@ -2510,10 +2510,7 @@ void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ) functions->LogicOpcode = r200LogicOpCode; functions->PolygonMode = r200PolygonMode; functions->PolygonOffset = r200PolygonOffset; - if (dri2) - functions->PolygonStipple = r200PolygonStipple; - else - functions->PolygonStipple = radeonPolygonStipplePreKMS; + functions->PolygonStipple = r200PolygonStipple; functions->PointParameterfv = r200PointParameter; functions->PointSize = r200PointSize; functions->RenderMode = r200RenderMode; diff --git a/src/mesa/drivers/dri/r200/r200_state.h b/src/mesa/drivers/dri/r200/r200_state.h index 9c62f0a6446..7b9b0c106aa 100644 --- a/src/mesa/drivers/dri/r200/r200_state.h +++ b/src/mesa/drivers/dri/r200/r200_state.h @@ -38,7 +38,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_context.h" extern void r200InitState( r200ContextPtr rmesa ); -extern void r200InitStateFuncs( struct dd_function_table *functions, GLboolean dri2 ); +extern void r200InitStateFuncs( struct dd_function_table *functions ); extern void r200InitTnlFuncs( GLcontext *ctx ); extern void r200UpdateMaterial( GLcontext *ctx ); diff --git a/src/mesa/drivers/dri/r200/r200_state_init.c b/src/mesa/drivers/dri/r200/r200_state_init.c index 7697306d889..8553be01976 100644 --- a/src/mesa/drivers/dri/r200/r200_state_init.c +++ b/src/mesa/drivers/dri/r200/r200_state_init.c @@ -885,10 +885,8 @@ void r200InitState( r200ContextPtr rmesa ) } } } - /* polygon stipple is done with irq for non-kms */ - if (rmesa->radeon.radeonScreen->kernel_mm) { - ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 ); - } + + ALLOC_STATE( stp, always, STP_STATE_SIZE, "STP/stp", 0 ); for (i = 0; i < 6; i++) if (rmesa->radeon.radeonScreen->kernel_mm) @@ -1120,12 +1118,11 @@ void r200InitState( r200ContextPtr rmesa ) rmesa->hw.sci.cmd[SCI_CMD_1] = CP_PACKET0(R200_RE_TOP_LEFT, 0); rmesa->hw.sci.cmd[SCI_CMD_2] = CP_PACKET0(R200_RE_WIDTH_HEIGHT, 0); - if (rmesa->radeon.radeonScreen->kernel_mm) { - - rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0); - rmesa->hw.stp.cmd[STP_DATA_0] = 0; - rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31); + rmesa->hw.stp.cmd[STP_CMD_0] = CP_PACKET0(RADEON_RE_STIPPLE_ADDR, 0); + rmesa->hw.stp.cmd[STP_DATA_0] = 0; + rmesa->hw.stp.cmd[STP_CMD_1] = CP_PACKET0_ONE(RADEON_RE_STIPPLE_DATA, 31); + if (rmesa->radeon.radeonScreen->kernel_mm) { rmesa->hw.mtl[0].emit = mtl_emit; rmesa->hw.mtl[1].emit = mtl_emit; -- cgit v1.2.3 From 8cde43eb19c4dcceb74166e1da123d316a429c21 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Wed, 2 Dec 2009 23:03:51 +0100 Subject: radeon: properly check if image should be placed in the miptree Fixes #25355 --- src/mesa/drivers/dri/radeon/radeon_texture.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 0390d376ba2..00e0658dc54 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -515,7 +515,10 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj, struct gl_texture_image *texImage, unsigned level) { - const struct gl_texture_image *baseImage = texObj->Image[0][level]; + const struct gl_texture_image *baseImage = texObj->Image[0][texObj->BaseLevel]; + + if (!baseImage) + return 0; if (level < texObj->BaseLevel || level > texObj->MaxLevel) return 0; -- cgit v1.2.3 From 6c41bb25a2e260dbce2c2d72ec64d1beb74527de Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Thu, 3 Dec 2009 20:21:16 +0100 Subject: radeon: workaround an FBO issue Fixes #21501 --- src/mesa/drivers/dri/radeon/radeon_fbo.c | 6 ++++++ src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 3 +++ 2 files changed, 9 insertions(+) diff --git a/src/mesa/drivers/dri/radeon/radeon_fbo.c b/src/mesa/drivers/dri/radeon/radeon_fbo.c index 7ec641ff18a..fc21069a92c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_fbo.c +++ b/src/mesa/drivers/dri/radeon/radeon_fbo.c @@ -369,6 +369,12 @@ radeon_framebuffer_renderbuffer(GLcontext * ctx, } +/* TODO: According to EXT_fbo spec internal format of texture image + * once set during glTexImage call, should be preserved when + * attaching image to renderbuffer. When HW doesn't support + * rendering to format of attached image, set framebuffer + * completeness accordingly in radeon_validate_framebuffer (issue #79). + */ static GLboolean radeon_update_wrapper(GLcontext *ctx, struct radeon_renderbuffer *rrb, struct gl_texture_image *texImage) diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index a9d601a0b5f..0415a50d0b3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -421,9 +421,12 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_mipmap_level *srclvl = &image->mt->levels[image->mtlevel]; + /* TODO: bring back these assertions once the FBOs are fixed */ +#if 0 assert(image->mtlevel == level); assert(srclvl->size == dstlvl->size); assert(srclvl->rowstride == dstlvl->rowstride); +#endif radeon_bo_map(image->mt->bo, GL_FALSE); -- cgit v1.2.3 From 35a15f02634a31c1517363d91aaef8f190e24687 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 3 Dec 2009 23:15:38 +0100 Subject: gallium: fix reference counting functions to be strict-aliasing compliant Historically, parts of mesa code are not strict-aliasing safe, hence -fno-strict-aliasing is needed to compile (this got forgotten for scons builds for gallium, which indeed not only caused compiler warnings but also unexplicable crashes in non-debug builds). However, we should try to eliminate code not complying with strict-aliasing code at least for gallium. Hence change pipe_reference functions to make them strict-aliasing compliant. This adds a bit more complexity (especially for derived classes) but is the right thing to do, and it does in fact fix a segfault. --- src/gallium/auxiliary/pipebuffer/pb_buffer.h | 3 ++- src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c | 5 ++++- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 3 +++ src/gallium/drivers/svga/svga_screen_texture.h | 3 ++- src/gallium/include/pipe/p_refcnt.h | 18 ++++++++---------- src/gallium/include/pipe/p_state.h | 9 ++++++--- src/gallium/include/pipe/p_video_state.h | 3 ++- 7 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer.h b/src/gallium/auxiliary/pipebuffer/pb_buffer.h index 4ef372233f0..eb7e84be848 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer.h +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer.h @@ -237,8 +237,9 @@ pb_reference(struct pb_buffer **dst, { struct pb_buffer *old = *dst; - if (pipe_reference((struct pipe_reference**)dst, &src->base.reference)) + if (pipe_reference(&(*dst)->base.reference, &src->base.reference)) pb_destroy( old ); + *dst = src; } diff --git a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c index 2f973684f67..a9375abd218 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c +++ b/src/gallium/auxiliary/pipebuffer/pb_buffer_fenced.c @@ -243,6 +243,7 @@ fenced_buffer_list_check_free_locked(struct fenced_buffer_list *fenced_list, struct pb_fence_ops *ops = fenced_list->ops; struct list_head *curr, *next; struct fenced_buffer *fenced_buf; + struct pb_buffer *pb_buf; struct pipe_fence_handle *prev_fence = NULL; curr = fenced_list->delayed.next; @@ -271,7 +272,9 @@ fenced_buffer_list_check_free_locked(struct fenced_buffer_list *fenced_list, fenced_buffer_remove_locked(fenced_list, fenced_buf); pipe_mutex_unlock(fenced_buf->mutex); - pb_reference((struct pb_buffer **)&fenced_buf, NULL); + pb_buf = &fenced_buf->base; + pb_reference(&pb_buf, NULL); + curr = next; next = curr->next; diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index 57d1ede45a4..f0c88a0ccbf 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -293,8 +293,11 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, if(buf) { LIST_DEL(&buf->head); pipe_mutex_unlock(mgr->mutex); +#if 0 + /* XXX this didn't do anything right??? */ /* Increase refcount */ pb_reference((struct pb_buffer**)&buf, &buf->base); +#endif return &buf->base; } diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h index 1cc4063e653..727f2c51d28 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.h +++ b/src/gallium/drivers/svga/svga_screen_texture.h @@ -164,8 +164,9 @@ svga_sampler_view_reference(struct svga_sampler_view **ptr, struct svga_sampler_ { struct svga_sampler_view *old = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &v->reference)) + if (pipe_reference(&(*ptr)->reference, &v->reference)) svga_destroy_sampler_view_priv(old); + *ptr = v; } extern void diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h index 1f9088b3e9c..f1875b6b822 100644 --- a/src/gallium/include/pipe/p_refcnt.h +++ b/src/gallium/include/pipe/p_refcnt.h @@ -59,30 +59,28 @@ pipe_is_referenced(struct pipe_reference *reference) /** - * Set 'ptr' to point to 'reference' and update reference counting. - * The old thing pointed to, if any, will be unreferenced first. - * 'reference' may be NULL. + * Update reference counting. + * The old thing pointed to, if any, will be unreferenced. + * Both 'ptr' and 'reference' may be NULL. */ static INLINE bool -pipe_reference(struct pipe_reference **ptr, struct pipe_reference *reference) +pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) { bool destroy = FALSE; - if(*ptr != reference) { + if(ptr != reference) { /* bump the reference.count first */ if (reference) { assert(pipe_is_referenced(reference)); p_atomic_inc(&reference->count); } - if (*ptr) { - assert(pipe_is_referenced(*ptr)); - if (p_atomic_dec_zero(&(*ptr)->count)) { + if (ptr) { + assert(pipe_is_referenced(ptr)); + if (p_atomic_dec_zero(&ptr->count)) { destroy = TRUE; } } - - *ptr = reference; } return destroy; diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index 6de7af6a81c..b9dfa1c7d3c 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -400,8 +400,9 @@ pipe_buffer_reference(struct pipe_buffer **ptr, struct pipe_buffer *buf) { struct pipe_buffer *old_buf = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &buf->reference)) + if (pipe_reference(&(*ptr)->reference, &buf->reference)) old_buf->screen->buffer_destroy(old_buf); + *ptr = buf; } static INLINE void @@ -409,8 +410,9 @@ pipe_surface_reference(struct pipe_surface **ptr, struct pipe_surface *surf) { struct pipe_surface *old_surf = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &surf->reference)) + if (pipe_reference(&(*ptr)->reference, &surf->reference)) old_surf->texture->screen->tex_surface_destroy(old_surf); + *ptr = surf; } static INLINE void @@ -418,8 +420,9 @@ pipe_texture_reference(struct pipe_texture **ptr, struct pipe_texture *tex) { struct pipe_texture *old_tex = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &tex->reference)) + if (pipe_reference(&(*ptr)->reference, &tex->reference)) old_tex->screen->texture_destroy(old_tex); + *ptr = tex; } diff --git a/src/gallium/include/pipe/p_video_state.h b/src/gallium/include/pipe/p_video_state.h index 4da26d608cf..b85f01c2b02 100644 --- a/src/gallium/include/pipe/p_video_state.h +++ b/src/gallium/include/pipe/p_video_state.h @@ -56,8 +56,9 @@ pipe_video_surface_reference(struct pipe_video_surface **ptr, struct pipe_video_ { struct pipe_video_surface *old_surf = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &surf->reference)) + if (pipe_reference(&(*ptr)->reference, &surf->reference)) old_surf->screen->video_surface_destroy(old_surf); + *ptr = surf; } struct pipe_video_rect -- cgit v1.2.3 From 13c647fa0d3e361efbb10a6d313bdc6bf7c890e8 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 3 Dec 2009 23:20:56 +0100 Subject: gallium: fix ref counting bug in pb_bufmgr This was discovered by the pipe_reference api change. --- src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c index f0c88a0ccbf..7b34c8e3578 100644 --- a/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c +++ b/src/gallium/auxiliary/pipebuffer/pb_bufmgr_cache.c @@ -293,11 +293,8 @@ pb_cache_manager_create_buffer(struct pb_manager *_mgr, if(buf) { LIST_DEL(&buf->head); pipe_mutex_unlock(mgr->mutex); -#if 0 - /* XXX this didn't do anything right??? */ /* Increase refcount */ - pb_reference((struct pb_buffer**)&buf, &buf->base); -#endif + pipe_reference(NULL, &buf->base.base.reference); return &buf->base; } -- cgit v1.2.3 From 86c8f70db10a584aa78e4d5f397ad3543fdb77d2 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 3 Dec 2009 23:26:13 +0100 Subject: mesa: use _mesa_memcpy for COPY_4FV macro Gets rid of one of the worst strict-aliasing offenders, and actually produces faster code (at least in some cases, when compiler can use for instance 64bit moves for memcpy). (note _mesa_memcpy should get inlined) --- src/mesa/main/macros.h | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h index 3d9a1aba98d..f0ea463fb92 100644 --- a/src/mesa/main/macros.h +++ b/src/mesa/main/macros.h @@ -202,17 +202,12 @@ do { \ #endif /** - * Copy a 4-element float vector (avoid using FPU registers) - * XXX Could use two 64-bit moves on 64-bit systems + * Copy a 4-element float vector + * memcpy seems to be most efficient */ #define COPY_4FV( DST, SRC ) \ do { \ - const GLuint *_s = (const GLuint *) (SRC); \ - GLuint *_d = (GLuint *) (DST); \ - _d[0] = _s[0]; \ - _d[1] = _s[1]; \ - _d[2] = _s[2]; \ - _d[3] = _s[3]; \ + _mesa_memcpy(DST, SRC, sizeof(GLfloat) * 4); \ } while (0) /** Copy \p SZ elements into a 4-element vector */ -- cgit v1.2.3 From 4153ec547cfb7fcb26bbeb09ac9ef19fe88d3e4e Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 3 Dec 2009 23:58:30 +0100 Subject: gallium: fix remaining users of pipe_reference function --- src/gallium/drivers/nouveau/nouveau_stateobj.h | 3 ++- src/gallium/state_trackers/python/st_device.c | 3 ++- src/gallium/winsys/drm/intel/gem/intel_drm_fence.c | 3 ++- src/gallium/winsys/drm/vmware/core/vmw_surface.c | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h index b595405357f..62990f9b6a6 100644 --- a/src/gallium/drivers/nouveau/nouveau_stateobj.h +++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h @@ -48,13 +48,14 @@ so_ref(struct nouveau_stateobj *ref, struct nouveau_stateobj **pso) struct nouveau_stateobj *so = *pso; int i; - if (pipe_reference((struct pipe_reference**)pso, &ref->reference)) { + if (pipe_reference(&(*pso)->reference, &ref->reference)) { free(so->push); for (i = 0; i < so->cur_reloc; i++) nouveau_bo_ref(NULL, &so->reloc[i].bo); free(so->reloc); free(so); } + *pso = ref; } static INLINE void diff --git a/src/gallium/state_trackers/python/st_device.c b/src/gallium/state_trackers/python/st_device.c index a791113abac..f19cf4b5771 100644 --- a/src/gallium/state_trackers/python/st_device.c +++ b/src/gallium/state_trackers/python/st_device.c @@ -62,8 +62,9 @@ st_device_reference(struct st_device **ptr, struct st_device *st_dev) { struct st_device *old_dev = *ptr; - if (pipe_reference((struct pipe_reference **)ptr, &st_dev->reference)) + if (pipe_reference(&(*ptr)->reference, &st_dev->reference)) st_device_really_destroy(old_dev); + *ptr = st_dev; } diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c index e70bfe7b44e..b6248a3bcf7 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c @@ -39,11 +39,12 @@ intel_drm_fence_reference(struct intel_winsys *iws, struct intel_drm_fence *old = (struct intel_drm_fence *)*ptr; struct intel_drm_fence *f = (struct intel_drm_fence *)fence; - if (pipe_reference((struct pipe_reference**)ptr, &f->reference)) { + if (pipe_reference(&(*ptr)->reference, &f->reference)) { if (old->bo) drm_intel_bo_unreference(old->bo); FREE(old); } + *ptr = fence; } static int diff --git a/src/gallium/winsys/drm/vmware/core/vmw_surface.c b/src/gallium/winsys/drm/vmware/core/vmw_surface.c index 64eb32f8b94..5f1b9ad5770 100644 --- a/src/gallium/winsys/drm/vmware/core/vmw_surface.c +++ b/src/gallium/winsys/drm/vmware/core/vmw_surface.c @@ -47,7 +47,7 @@ vmw_svga_winsys_surface_reference(struct vmw_svga_winsys_surface **pdst, src_ref = src ? &src->refcnt : NULL; dst_ref = dst ? &dst->refcnt : NULL; - if (pipe_reference(&dst_ref, src_ref)) { + if (pipe_reference(dst_ref, src_ref)) { vmw_ioctl_surface_destroy(dst->screen, dst->sid); #ifdef DEBUG /* to detect dangling pointers */ -- cgit v1.2.3 From 3910e88ebf636cb34ae75bc4a7916fc8c2f1a9e1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 14 Oct 2009 07:43:18 -0600 Subject: prog/tests: Fix MSVC build. (cherry picked from commit ea862ec8ff4a52b30b822e737d93a49330be9e31) --- progs/tests/arraytexture.c | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/progs/tests/arraytexture.c b/progs/tests/arraytexture.c index 6c0484df0de..28252a354bf 100644 --- a/progs/tests/arraytexture.c +++ b/progs/tests/arraytexture.c @@ -77,10 +77,6 @@ static GLfloat texZ = 0.0; static GLfloat texZ_dir = 0.01; static GLint num_layers; -static PFNGLBINDPROGRAMARBPROC bind_program; -static PFNGLPROGRAMSTRINGARBPROC program_string; -static PFNGLGENPROGRAMSARBPROC gen_programs; - static void PrintString(const char *s) @@ -125,13 +121,13 @@ static void Display(void) glMatrixMode(GL_MODELVIEW); glLoadIdentity(); - (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0); glColor3f(1,1,1); glRasterPos3f(-0.9, -0.9, 0.0); sprintf(str, "Texture Z coordinate = %4.1f", texZ); PrintString(str); - (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 1); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 1); GL_CHECK_ERROR(); glEnable(GL_TEXTURE_2D_ARRAY_EXT); GL_CHECK_ERROR(); @@ -159,7 +155,7 @@ static void Display(void) glDisable(GL_TEXTURE_2D_ARRAY_EXT); GL_CHECK_ERROR(); - (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, 0); + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, 0); GL_CHECK_ERROR(); glutSwapBuffers(); @@ -226,8 +222,8 @@ compile_fragment_program(GLuint id, const char *prog) int err; err = glGetError(); - (*bind_program)(GL_FRAGMENT_PROGRAM_ARB, id); - (*program_string)(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, + glBindProgramARB(GL_FRAGMENT_PROGRAM_ARB, id); + glProgramStringARB(GL_FRAGMENT_PROGRAM_ARB, GL_PROGRAM_FORMAT_ASCII_ARB, strlen(prog), (const GLubyte *) prog); glGetIntegerv(GL_PROGRAM_ERROR_POSITION_ARB, &errorPos); @@ -264,11 +260,6 @@ static void Init(void) require_extension("GL_MESA_texture_array"); require_extension("GL_SGIS_generate_mipmap"); - bind_program = glutGetProcAddress("glBindProgramARB"); - program_string = glutGetProcAddress("glProgramStringARB"); - gen_programs = glutGetProcAddress("glGenProgramsARB"); - - for (num_layers = 0; textures[num_layers] != NULL; num_layers++) /* empty */ ; -- cgit v1.2.3 From 5a25adb646faa970dacec0dbfa2e2bd905e87eba Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 6 Oct 2009 16:02:47 -0600 Subject: progs/tests: fix MSVC build. (cherry picked from commit 9c778a90ea24f25437b68bb67856c81add61e261) --- progs/tests/copypixrate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/tests/copypixrate.c b/progs/tests/copypixrate.c index aa4acfc18b5..f63d59f3cec 100644 --- a/progs/tests/copypixrate.c +++ b/progs/tests/copypixrate.c @@ -69,7 +69,7 @@ DrawTestImage(void) static int Rand(int max) { - return ((int) random()) % max; + return ((int) rand()) % max; } -- cgit v1.2.3 From 89e747920f35f28d651ad89380f58250aab7c2d4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 12 Oct 2009 18:05:05 -0600 Subject: prog/tests: Fix MSVC build. (cherry picked from commit 96fd13c1a024e3b6c0b1c44394c67c772e52b9c9) --- progs/tests/crossbar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/tests/crossbar.c b/progs/tests/crossbar.c index 3dd21372f9a..bd8e05aee13 100644 --- a/progs/tests/crossbar.c +++ b/progs/tests/crossbar.c @@ -145,7 +145,7 @@ static void Init( void ) { const char * const ver_string = (const char * const) glGetString( GL_VERSION ); - float ver = strtof( ver_string, NULL ); + float ver = strtod( ver_string, NULL ); GLint tex_units; GLint temp[ 256 ]; -- cgit v1.2.3 From 791b7546876e72dcbcc012a855df7f610d777297 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 16 Oct 2009 11:36:09 +0100 Subject: prog/tests: Fix MSVC build. (cherry picked from commit 60b6c7458319ff01ecdd9d1650d526ac8f75e194) --- progs/tests/invert.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/tests/invert.c b/progs/tests/invert.c index 63099fbd221..3bc97a460b6 100644 --- a/progs/tests/invert.c +++ b/progs/tests/invert.c @@ -128,7 +128,7 @@ static void Init( void ) { const char * const ver_string = (const char * const) glGetString( GL_VERSION ); - const float ver = strtof( ver_string, NULL ); + const float ver = strtod( ver_string, NULL ); printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); -- cgit v1.2.3 From a38776419b1e18a43e8bab1371dfe802af44d14a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 8 Oct 2009 08:08:11 -0600 Subject: progs/tests: Fix MSVC build. (cherry picked from commit f7455ad7af09b5ef31ccc454b79422a13c59af9a) --- progs/tests/minmag.c | 1 - 1 file changed, 1 deletion(-) diff --git a/progs/tests/minmag.c b/progs/tests/minmag.c index 03019f94faa..179be511207 100644 --- a/progs/tests/minmag.c +++ b/progs/tests/minmag.c @@ -16,7 +16,6 @@ #include #include #include -#include #include #include -- cgit v1.2.3 From bb6e3af93920ca15d19fbb9685e5b6f612cc502c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 16 Oct 2009 11:39:29 +0100 Subject: progs/tests: Use rand() instead of random(). More portable. Same implementation on Linux. (cherry picked from commit 699260b19535abaa3af0a5d33eb039e3d6a30ce9) --- progs/tests/prog_parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c index 6dd956c4023..6123ef7c162 100644 --- a/progs/tests/prog_parameter.c +++ b/progs/tests/prog_parameter.c @@ -116,7 +116,7 @@ static int set_parameter_batch( GLsizei count, GLfloat * param, for ( i = 0 ; i < (4 * count) ; i++ ) { - param[i] = (GLfloat) random() / (GLfloat) random(); + param[i] = (GLfloat) rand() / (GLfloat) rand(); } /* Try using the "classic" interface. -- cgit v1.2.3 From 28474e1225866e6b73928f79722f14cc5d6b35c7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 16 Oct 2009 11:39:29 +0100 Subject: progs/tests: Use rand() instead of random(). Forgot these on previous commit. (cherry picked from commit 166957abebea6aa203eba7e6348e89d53cf0e13e) --- progs/tests/prog_parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c index 6123ef7c162..28e3b537acd 100644 --- a/progs/tests/prog_parameter.c +++ b/progs/tests/prog_parameter.c @@ -153,7 +153,7 @@ static int set_parameter_batch( GLsizei count, GLfloat * param, for ( i = 0 ; i < (4 * count) ; i++ ) { - param[i] = (GLfloat) random() / (GLfloat) random(); + param[i] = (GLfloat) rand() / (GLfloat) rand(); } printf("Testing glProgram%sParameters4fvEXT (count = %u)...\n", name, count); -- cgit v1.2.3 From a99bf51bc845617c2086468a814685672b5de224 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 23 Oct 2009 13:49:02 -0600 Subject: progs/tests: Fix MSVC build. (cherry picked from commit 952bf63e2cf442504ef89b0b1d276da0d52b21d4) --- progs/tests/prog_parameter.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c index 28e3b537acd..0241f3a2496 100644 --- a/progs/tests/prog_parameter.c +++ b/progs/tests/prog_parameter.c @@ -203,20 +203,20 @@ static void Init( void ) } - program_local_parameter4fv = glutGetProcAddress( "glProgramLocalParameter4fvARB" ); - program_env_parameter4fv = glutGetProcAddress( "glProgramEnvParameter4fvARB" ); + program_local_parameter4fv = (PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) glutGetProcAddress( "glProgramLocalParameter4fvARB" ); + program_env_parameter4fv = (PFNGLPROGRAMENVPARAMETER4FVARBPROC) glutGetProcAddress( "glProgramEnvParameter4fvARB" ); - get_program_local_parameterfv = glutGetProcAddress( "glGetProgramLocalParameterfvARB" ); - get_program_env_parameterfv = glutGetProcAddress( "glGetProgramEnvParameterfvARB" ); + get_program_local_parameterfv = (PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) glutGetProcAddress( "glGetProgramLocalParameterfvARB" ); + get_program_env_parameterfv = (PFNGLGETPROGRAMENVPARAMETERFVARBPROC) glutGetProcAddress( "glGetProgramEnvParameterfvARB" ); - bind_program = glutGetProcAddress( "glBindProgramARB" ); - get_program = glutGetProcAddress( "glGetProgramivARB" ); + bind_program = (PFNGLBINDPROGRAMARBPROC) glutGetProcAddress( "glBindProgramARB" ); + get_program = (PFNGLGETPROGRAMIVARBPROC) glutGetProcAddress( "glGetProgramivARB" ); if ( glutExtensionSupported("GL_EXT_gpu_program_parameters") ) { printf("GL_EXT_gpu_program_parameters available, testing that path.\n"); - program_local_parameters4fv = glutGetProcAddress( "glProgramLocalParameters4fvEXT" ); - program_env_parameters4fv = glutGetProcAddress( "glProgramEnvParameters4fvEXT" ); + program_local_parameters4fv = (PFNGLPROGRAMLOCALPARAMETERS4FVEXTPROC) glutGetProcAddress( "glProgramLocalParameters4fvEXT" ); + program_env_parameters4fv = (PFNGLPROGRAMENVPARAMETERS4FVEXTPROC) glutGetProcAddress( "glProgramEnvParameters4fvEXT" ); } else { printf("GL_EXT_gpu_program_parameters not available.\n"); -- cgit v1.2.3 From 9dfbd1be446b9c0680a0d55729fb6b3f5938b0c5 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 4 Dec 2009 00:42:53 +0100 Subject: vega: fix missing include --- src/gallium/state_trackers/vega/vg_tracker.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/state_trackers/vega/vg_tracker.c b/src/gallium/state_trackers/vega/vg_tracker.c index ed18dd60751..5a286b14491 100644 --- a/src/gallium/state_trackers/vega/vg_tracker.c +++ b/src/gallium/state_trackers/vega/vg_tracker.c @@ -33,6 +33,7 @@ #include "pipe/p_screen.h" #include "util/u_memory.h" #include "util/u_math.h" +#include "util/u_rect.h" static struct pipe_texture * create_texture(struct pipe_context *pipe, enum pipe_format format, -- cgit v1.2.3 From 97cbf4943a5926dc1bbec213ff8c919ece66555e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 26 Oct 2009 15:03:31 -0600 Subject: progs/tests: Fix MSVC build. (cherry picked from commit 50e113e375b4ecfdf5b60ccce7bbcdb1c5f2ca11) --- progs/tests/stencil_twoside.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/progs/tests/stencil_twoside.c b/progs/tests/stencil_twoside.c index 1e18ca6b5ea..7d871e5877f 100644 --- a/progs/tests/stencil_twoside.c +++ b/progs/tests/stencil_twoside.c @@ -274,9 +274,9 @@ static void Init( void ) if (atof( ver_string ) < 2.0) { use20syntax = 0; } - stencil_func_separate = glutGetProcAddress( "glStencilFuncSeparate" ); - stencil_func_separate_ati = glutGetProcAddress( "glStencilFuncSeparateATI" ); - stencil_op_separate = glutGetProcAddress( "glStencilOpSeparate" ); + stencil_func_separate = (PFNGLSTENCILFUNCSEPARATEPROC) glutGetProcAddress( "glStencilFuncSeparate" ); + stencil_func_separate_ati = (PFNGLSTENCILFUNCSEPARATEATIPROC) glutGetProcAddress( "glStencilFuncSeparateATI" ); + stencil_op_separate = (PFNGLSTENCILOPSEPARATEPROC) glutGetProcAddress( "glStencilOpSeparate" ); printf("\nAll 5 squares should be the same color.\n"); } -- cgit v1.2.3 From d3208678c2ea0e50be7b8eb68106f7650b37dfc6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 30 Oct 2009 09:39:51 -0600 Subject: progs/tests: fix MSVC build. Signed-off-by: Brian Paul (cherry picked from commit a8ed066858f12290239ddc9165b7c0734ccc0247) --- progs/tests/vao-01.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/progs/tests/vao-01.c b/progs/tests/vao-01.c index 117fae8bd9e..e4a89cb19db 100644 --- a/progs/tests/vao-01.c +++ b/progs/tests/vao-01.c @@ -124,10 +124,10 @@ static void Init( void ) exit(2); } - bind_vertex_array = glutGetProcAddress( "glBindVertexArrayAPPLE" ); - gen_vertex_arrays = glutGetProcAddress( "glGenVertexArraysAPPLE" ); - delete_vertex_arrays = glutGetProcAddress( "glDeleteVertexArraysAPPLE" ); - is_vertex_array = glutGetProcAddress( "glIsVertexArrayAPPLE" ); + bind_vertex_array = (PFNGLBINDVERTEXARRAYAPPLEPROC) glutGetProcAddress( "glBindVertexArrayAPPLE" ); + gen_vertex_arrays = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress( "glGenVertexArraysAPPLE" ); + delete_vertex_arrays = (PFNGLDELETEVERTEXARRAYSAPPLEPROC) glutGetProcAddress( "glDeleteVertexArraysAPPLE" ); + is_vertex_array = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress( "glIsVertexArrayAPPLE" ); (*gen_vertex_arrays)( 1, & obj ); -- cgit v1.2.3 From 005242f1664afdd6f4b832863d569e9e3c583454 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 30 Oct 2009 15:02:21 -0600 Subject: prog/tests: Fix MSVC build. Signed-off-by: Brian Paul (cherry picked from commit 9c3197ef0abc3bf521358ea0c7af0fc6979c82b3) --- progs/tests/vao-02.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/progs/tests/vao-02.c b/progs/tests/vao-02.c index 7764ed51061..9f7f5c27792 100644 --- a/progs/tests/vao-02.c +++ b/progs/tests/vao-02.c @@ -125,10 +125,10 @@ static void Init( void ) exit(2); } - bind_vertex_array = glutGetProcAddress( "glBindVertexArrayAPPLE" ); - gen_vertex_arrays = glutGetProcAddress( "glGenVertexArraysAPPLE" ); - delete_vertex_arrays = glutGetProcAddress( "glDeleteVertexArraysAPPLE" ); - is_vertex_array = glutGetProcAddress( "glIsVertexArrayAPPLE" ); + bind_vertex_array = (PFNGLBINDVERTEXARRAYAPPLEPROC) glutGetProcAddress( "glBindVertexArrayAPPLE" ); + gen_vertex_arrays = (PFNGLGENVERTEXARRAYSAPPLEPROC) glutGetProcAddress( "glGenVertexArraysAPPLE" ); + delete_vertex_arrays = (PFNGLDELETEVERTEXARRAYSAPPLEPROC) glutGetProcAddress( "glDeleteVertexArraysAPPLE" ); + is_vertex_array = (PFNGLISVERTEXARRAYAPPLEPROC) glutGetProcAddress( "glIsVertexArrayAPPLE" ); (*gen_vertex_arrays)( 1, & obj ); -- cgit v1.2.3 From d6a993135f151fca892609f7cf6f471416192217 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 14:41:40 -0800 Subject: progs/fp: Redraw upon keypress. (cherry picked from commit cde66437247feb8b14b6d8f3ec3a8b4665fefa08) --- progs/fp/fp-tri.c | 2 +- progs/fp/point-position.c | 2 +- progs/fp/tri-depth.c | 2 +- progs/fp/tri-depth2.c | 2 +- progs/fp/tri-depthwrite.c | 2 +- progs/fp/tri-depthwrite2.c | 2 +- progs/fp/tri-param.c | 2 +- progs/fp/tri-tex.c | 2 +- 8 files changed, 8 insertions(+), 8 deletions(-) diff --git a/progs/fp/fp-tri.c b/progs/fp/fp-tri.c index 52a8fcfc22a..26af66ad84e 100644 --- a/progs/fp/fp-tri.c +++ b/progs/fp/fp-tri.c @@ -197,7 +197,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/point-position.c b/progs/fp/point-position.c index c0963d7a0b5..1ae753c1d05 100644 --- a/progs/fp/point-position.c +++ b/progs/fp/point-position.c @@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-depth.c b/progs/fp/tri-depth.c index 5488469e806..a9f3a6a5be3 100644 --- a/progs/fp/tri-depth.c +++ b/progs/fp/tri-depth.c @@ -57,7 +57,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-depth2.c b/progs/fp/tri-depth2.c index 6ed23071157..8c4336817be 100644 --- a/progs/fp/tri-depth2.c +++ b/progs/fp/tri-depth2.c @@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-depthwrite.c b/progs/fp/tri-depthwrite.c index 8e4f3e62451..7b9d70f292a 100644 --- a/progs/fp/tri-depthwrite.c +++ b/progs/fp/tri-depthwrite.c @@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-depthwrite2.c b/progs/fp/tri-depthwrite2.c index 3c0b4d30c97..599949551d1 100644 --- a/progs/fp/tri-depthwrite2.c +++ b/progs/fp/tri-depthwrite2.c @@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-param.c b/progs/fp/tri-param.c index 57443d71bd0..26a804d4b38 100644 --- a/progs/fp/tri-param.c +++ b/progs/fp/tri-param.c @@ -54,7 +54,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/fp/tri-tex.c b/progs/fp/tri-tex.c index 1dbbb201cef..64299e94531 100644 --- a/progs/fp/tri-tex.c +++ b/progs/fp/tri-tex.c @@ -76,7 +76,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); -- cgit v1.2.3 From 4ca8e1680ed2e8437653c6f16f39438e51ce24ae Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 16 Nov 2009 18:22:26 -0800 Subject: progs/util: Fix memory leak if LoadYUVImage fails. (cherry picked from commit 0e790ac35327a0b53a4a595a6429135317302269) --- progs/util/readtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 8e923b6eb47..134eb79100a 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -438,6 +438,7 @@ GLushort *LoadYUVImage( const char *imageFile, GLint *width, GLint *height ) fprintf(stderr, "Error in LoadYUVImage %d-component images not implemented\n", image->components ); + FreeImage(image); return NULL; } -- cgit v1.2.3 From 84de1672d3efbfc3b2ae51633b0e503f15e5d62d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 08:29:36 -0800 Subject: progs/util: Fix memory if LoadRGBMipmaps2 fails. (cherry picked from commit 28b8e4bcd76cc072b062e4c8575327c05ecb9a55) --- progs/util/readtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 134eb79100a..4e22bed81af 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -305,6 +305,7 @@ GLboolean LoadRGBMipmaps2( const char *imageFile, GLenum target, fprintf(stderr, "Error in LoadRGBMipmaps %d-component images not implemented\n", image->components ); + FreeImage(image); return GL_FALSE; } -- cgit v1.2.3 From f1172c4030dd0952dfdecda059beb39b1224a8ae Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 10:11:50 -0800 Subject: progs/util: Fix memory leak if LoadRGBImage fails. (cherry picked from commit 041cd0e110d41b543a0fe9cc484ae8373642912b) --- progs/util/readtex.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 4e22bed81af..ec27e20d681 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -357,6 +357,7 @@ GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height, fprintf(stderr, "Error in LoadRGBImage %d-component images not implemented\n", image->components ); + FreeImage(image); return NULL; } @@ -365,8 +366,10 @@ GLubyte *LoadRGBImage( const char *imageFile, GLint *width, GLint *height, bytes = image->sizeX * image->sizeY * image->components; buffer = (GLubyte *) malloc(bytes); - if (!buffer) + if (!buffer) { + FreeImage(image); return NULL; + } memcpy( (void *) buffer, (void *) image->data, bytes ); -- cgit v1.2.3 From 772e00478124074c7b954fad52974057f0669a9b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 11:04:24 -0800 Subject: progs/util: Fix memory leak if malloc fails in tkRGBImageLoad. (cherry picked from commit 786d539511eb3c5a4101b11b7f8e90d60123ac46) --- progs/util/readtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index ec27e20d681..c57b66bd9d3 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -250,6 +250,7 @@ static TK_RGBImageRec *tkRGBImageLoad(const char *fileName) final = (TK_RGBImageRec *)malloc(sizeof(TK_RGBImageRec)); if (final == NULL) { fprintf(stderr, "Out of memory!\n"); + RawImageClose(raw); return NULL; } final->sizeX = raw->sizeX; -- cgit v1.2.3 From 305d4f147ea86d87706dbaf2caad6a131c59fe80 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 13:49:31 -0800 Subject: progs/util: Fix memory leak if fopen fails in RawImageOpen. (cherry picked from commit d9508e8df9da4aa13bc223194c406081738bac91) --- progs/util/readtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index c57b66bd9d3..3922998fd5b 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -109,6 +109,7 @@ static rawImageRec *RawImageOpen(const char *fileName) raw->file = fopen(baseName + 1, "rb"); if(raw->file == NULL) { perror(fileName); + free(raw); return NULL; } } -- cgit v1.2.3 From 0a6acecb35aa5701ee82cf17c2561c172612cb6e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 11:22:13 -0800 Subject: progs/util: Fix memory leak if malloc fails in RawImageOpen. (cherry picked from commit d36cb2396c942f05ba56c5b899792a507bb0f0fd) --- progs/util/readtex.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 3922998fd5b..1e1183cf9ac 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -130,6 +130,12 @@ static rawImageRec *RawImageOpen(const char *fileName) if (raw->tmp == NULL || raw->tmpR == NULL || raw->tmpG == NULL || raw->tmpB == NULL) { fprintf(stderr, "Out of memory!\n"); + free(raw->tmp); + free(raw->tmpR); + free(raw->tmpG); + free(raw->tmpB); + free(raw->tmpA); + free(raw); return NULL; } @@ -139,6 +145,14 @@ static rawImageRec *RawImageOpen(const char *fileName) raw->rowSize = (GLint *)malloc(x); if (raw->rowStart == NULL || raw->rowSize == NULL) { fprintf(stderr, "Out of memory!\n"); + free(raw->tmp); + free(raw->tmpR); + free(raw->tmpG); + free(raw->tmpB); + free(raw->tmpA); + free(raw->rowStart); + free(raw->rowSize); + free(raw); return NULL; } raw->rleEnd = 512 + (2 * x); -- cgit v1.2.3 From a0ac8fc7d8d946183ba0506a8134a6e55819e151 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 12:11:55 -0800 Subject: progs/util: Exit RawImageGetData early if malloc fails. Prevents a null pointer deference later on. (cherry picked from commit e26135a744f740430e3dc341fa692544ba99c11e) --- progs/util/readtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 1e1183cf9ac..81cb626e911 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -230,6 +230,7 @@ static void RawImageGetData(rawImageRec *raw, TK_RGBImageRec *final) final->data = (unsigned char *)malloc((raw->sizeX+1)*(raw->sizeY+1)*4); if (final->data == NULL) { fprintf(stderr, "Out of memory!\n"); + return; } ptr = final->data; -- cgit v1.2.3 From 9e29242331335796c8eeb3d669111844161067f8 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 22:46:19 -0800 Subject: progs/glsl: Redraw upon keypress. (cherry picked from commit 881f55236ad85f95745e70f8363726fa3c201f80) --- progs/glsl/convolutions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/glsl/convolutions.c b/progs/glsl/convolutions.c index c2fb76e1aa5..350e61bbdc5 100644 --- a/progs/glsl/convolutions.c +++ b/progs/glsl/convolutions.c @@ -369,7 +369,7 @@ static void keyPress(unsigned char key, int x, int y) case 27: exit(0); default: - return; + break; } glutPostRedisplay(); } -- cgit v1.2.3 From 34a0b22a741a136687e4feb7216595bf0f8445cb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 13:03:12 -0800 Subject: progs/trivial: Redraw upon keypress. (cherry picked from commit 3790c6a13b86dfe0afd4bb0bf9a4d9f4b429cfd8) --- progs/trivial/clear-fbo-tex.c | 2 +- progs/trivial/clear-fbo.c | 2 +- progs/trivial/clear-random.c | 2 +- progs/trivial/clear-scissor.c | 2 +- progs/trivial/clear.c | 2 +- progs/trivial/createwin.c | 2 +- progs/trivial/dlist-begin-call-end.c | 2 +- progs/trivial/dlist-dangling.c | 2 +- progs/trivial/dlist-edgeflag-dangling.c | 2 +- progs/trivial/dlist-edgeflag.c | 2 +- progs/trivial/dlist-flat-tri.c | 2 +- progs/trivial/dlist-mat-tri.c | 2 +- progs/trivial/dlist-recursive-call.c | 2 +- progs/trivial/dlist-tri-flat-tri.c | 2 +- progs/trivial/dlist-tri-mat-tri.c | 2 +- progs/trivial/line-clip.c | 2 +- progs/trivial/line-cull.c | 2 +- progs/trivial/line-flat.c | 2 +- progs/trivial/line-stipple-wide.c | 2 +- progs/trivial/line-userclip-clip.c | 2 +- progs/trivial/line-userclip-nop-clip.c | 2 +- progs/trivial/line-userclip-nop.c | 2 +- progs/trivial/line-userclip.c | 2 +- progs/trivial/line-wide.c | 2 +- progs/trivial/line.c | 2 +- progs/trivial/lineloop-clip.c | 2 +- progs/trivial/lineloop.c | 2 +- progs/trivial/linestrip-stipple-wide.c | 2 +- progs/trivial/linestrip-stipple.c | 2 +- progs/trivial/point-clip.c | 2 +- progs/trivial/point-param.c | 2 +- progs/trivial/point-sprite.c | 2 +- progs/trivial/point-wide-smooth.c | 2 +- progs/trivial/point-wide.c | 2 +- progs/trivial/point.c | 2 +- progs/trivial/poly-flat-clip.c | 2 +- progs/trivial/poly-flat-unfilled-clip.c | 2 +- progs/trivial/poly-flat.c | 2 +- progs/trivial/poly-unfilled.c | 2 +- progs/trivial/poly.c | 2 +- progs/trivial/quad-clip-all-vertices.c | 2 +- progs/trivial/quad-clip.c | 2 +- progs/trivial/quad-degenerate.c | 2 +- progs/trivial/quad-flat.c | 2 +- progs/trivial/quad-offset-factor.c | 2 +- progs/trivial/quad-offset-unfilled.c | 2 +- progs/trivial/quad-offset-units.c | 2 +- progs/trivial/quad-tex-alpha.c | 2 +- progs/trivial/quad-tex-pbo.c | 2 +- progs/trivial/quad-unfilled-clip.c | 2 +- progs/trivial/quad-unfilled-stipple.c | 2 +- progs/trivial/quad-unfilled.c | 2 +- progs/trivial/quad.c | 2 +- progs/trivial/quads.c | 2 +- progs/trivial/quadstrip-cont.c | 2 +- progs/trivial/quadstrip-flat.c | 2 +- progs/trivial/quadstrip.c | 2 +- progs/trivial/readpixels.c | 2 +- progs/trivial/tri-alpha-tex.c | 2 +- progs/trivial/tri-alpha.c | 2 +- progs/trivial/tri-blend-color.c | 2 +- progs/trivial/tri-clear.c | 2 +- progs/trivial/tri-clip.c | 2 +- progs/trivial/tri-cull-both.c | 2 +- progs/trivial/tri-dlist.c | 2 +- progs/trivial/tri-fbo.c | 2 +- progs/trivial/tri-flat-clip.c | 2 +- progs/trivial/tri-flat.c | 2 +- progs/trivial/tri-fog.c | 2 +- progs/trivial/tri-fp-const-imm.c | 2 +- progs/trivial/tri-fp.c | 2 +- progs/trivial/tri-lit-material.c | 2 +- progs/trivial/tri-lit.c | 2 +- progs/trivial/tri-multitex-vbo.c | 2 +- progs/trivial/tri-orig.c | 2 +- progs/trivial/tri-query.c | 2 +- progs/trivial/tri-scissor-tri.c | 2 +- progs/trivial/tri-square.c | 2 +- progs/trivial/tri-stipple.c | 2 +- progs/trivial/tri-tex-3d.c | 2 +- progs/trivial/tri-tex.c | 2 +- progs/trivial/tri-tri.c | 2 +- progs/trivial/tri-unfilled-clip.c | 2 +- progs/trivial/tri-unfilled-edgeflag.c | 2 +- progs/trivial/tri-unfilled-point.c | 2 +- progs/trivial/tri-unfilled-smooth.c | 2 +- progs/trivial/tri-unfilled-tri-lit.c | 2 +- progs/trivial/tri-unfilled-userclip-stip.c | 2 +- progs/trivial/tri-unfilled-userclip.c | 2 +- progs/trivial/tri-unfilled.c | 2 +- progs/trivial/tri-userclip.c | 2 +- progs/trivial/tri-z-9.c | 2 +- progs/trivial/tri-z-eq.c | 2 +- progs/trivial/trifan-flat-clip.c | 2 +- progs/trivial/trifan-flat-unfilled-clip.c | 2 +- progs/trivial/trifan-flat.c | 2 +- progs/trivial/trifan-unfilled.c | 2 +- progs/trivial/trifan.c | 2 +- progs/trivial/tristrip-clip.c | 2 +- progs/trivial/tristrip-flat.c | 2 +- progs/trivial/tristrip.c | 2 +- progs/trivial/vp-tri-cb-pos.c | 2 +- progs/trivial/vp-tri-cb-tex.c | 2 +- progs/trivial/vp-tri-invariant.c | 2 +- 104 files changed, 104 insertions(+), 104 deletions(-) diff --git a/progs/trivial/clear-fbo-tex.c b/progs/trivial/clear-fbo-tex.c index a206676e48e..238f634bf59 100644 --- a/progs/trivial/clear-fbo-tex.c +++ b/progs/trivial/clear-fbo-tex.c @@ -88,7 +88,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/clear-fbo.c b/progs/trivial/clear-fbo.c index 0aeb45489f2..6435c901adc 100644 --- a/progs/trivial/clear-fbo.c +++ b/progs/trivial/clear-fbo.c @@ -73,7 +73,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/clear-random.c b/progs/trivial/clear-random.c index e3da23a8f55..ab67f84518d 100644 --- a/progs/trivial/clear-random.c +++ b/progs/trivial/clear-random.c @@ -61,7 +61,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(0); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/clear-scissor.c b/progs/trivial/clear-scissor.c index 01735327480..2b6dee77a96 100644 --- a/progs/trivial/clear-scissor.c +++ b/progs/trivial/clear-scissor.c @@ -38,7 +38,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); } diff --git a/progs/trivial/clear.c b/progs/trivial/clear.c index 03857b4b893..56c3ea52e6a 100644 --- a/progs/trivial/clear.c +++ b/progs/trivial/clear.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(0); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/createwin.c b/progs/trivial/createwin.c index f2cc6f1cffc..04a088642b8 100644 --- a/progs/trivial/createwin.c +++ b/progs/trivial/createwin.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-begin-call-end.c b/progs/trivial/dlist-begin-call-end.c index 0d0aed7c729..da3864a02a4 100644 --- a/progs/trivial/dlist-begin-call-end.c +++ b/progs/trivial/dlist-begin-call-end.c @@ -87,7 +87,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-dangling.c b/progs/trivial/dlist-dangling.c index de106280092..756ab93f870 100644 --- a/progs/trivial/dlist-dangling.c +++ b/progs/trivial/dlist-dangling.c @@ -74,7 +74,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-edgeflag-dangling.c b/progs/trivial/dlist-edgeflag-dangling.c index 3d3aaeb6944..51504471e2c 100644 --- a/progs/trivial/dlist-edgeflag-dangling.c +++ b/progs/trivial/dlist-edgeflag-dangling.c @@ -76,7 +76,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-edgeflag.c b/progs/trivial/dlist-edgeflag.c index 8002129ed14..9456b964732 100644 --- a/progs/trivial/dlist-edgeflag.c +++ b/progs/trivial/dlist-edgeflag.c @@ -81,7 +81,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-flat-tri.c b/progs/trivial/dlist-flat-tri.c index c3dd7921e39..3ee9b283a44 100644 --- a/progs/trivial/dlist-flat-tri.c +++ b/progs/trivial/dlist-flat-tri.c @@ -93,7 +93,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-mat-tri.c b/progs/trivial/dlist-mat-tri.c index ed3a4c5981a..d17c4b913b8 100644 --- a/progs/trivial/dlist-mat-tri.c +++ b/progs/trivial/dlist-mat-tri.c @@ -103,7 +103,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-recursive-call.c b/progs/trivial/dlist-recursive-call.c index fe06b2bbd72..90224f63cb2 100644 --- a/progs/trivial/dlist-recursive-call.c +++ b/progs/trivial/dlist-recursive-call.c @@ -118,7 +118,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-tri-flat-tri.c b/progs/trivial/dlist-tri-flat-tri.c index 4dbb7884869..3265a4d6dcd 100644 --- a/progs/trivial/dlist-tri-flat-tri.c +++ b/progs/trivial/dlist-tri-flat-tri.c @@ -99,7 +99,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/dlist-tri-mat-tri.c b/progs/trivial/dlist-tri-mat-tri.c index f69854ae586..053bb124a23 100644 --- a/progs/trivial/dlist-tri-mat-tri.c +++ b/progs/trivial/dlist-tri-mat-tri.c @@ -102,7 +102,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-clip.c b/progs/trivial/line-clip.c index 5276baffd5d..e4e388ed5cd 100644 --- a/progs/trivial/line-clip.c +++ b/progs/trivial/line-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-cull.c b/progs/trivial/line-cull.c index 1e1b77a942c..c531ff132f5 100644 --- a/progs/trivial/line-cull.c +++ b/progs/trivial/line-cull.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-flat.c b/progs/trivial/line-flat.c index 14f0ac07825..e2ddb87b9ef 100644 --- a/progs/trivial/line-flat.c +++ b/progs/trivial/line-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-stipple-wide.c b/progs/trivial/line-stipple-wide.c index 1804ffad3f0..767583bbea5 100644 --- a/progs/trivial/line-stipple-wide.c +++ b/progs/trivial/line-stipple-wide.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-userclip-clip.c b/progs/trivial/line-userclip-clip.c index 8e030b47cea..3265b2c3bfe 100644 --- a/progs/trivial/line-userclip-clip.c +++ b/progs/trivial/line-userclip-clip.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-userclip-nop-clip.c b/progs/trivial/line-userclip-nop-clip.c index 6fcd4bcfe73..0198e27807e 100644 --- a/progs/trivial/line-userclip-nop-clip.c +++ b/progs/trivial/line-userclip-nop-clip.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-userclip-nop.c b/progs/trivial/line-userclip-nop.c index e59fd133a5f..6c863a3c82b 100644 --- a/progs/trivial/line-userclip-nop.c +++ b/progs/trivial/line-userclip-nop.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-userclip.c b/progs/trivial/line-userclip.c index e30be5580bd..6cfcb6fc732 100644 --- a/progs/trivial/line-userclip.c +++ b/progs/trivial/line-userclip.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line-wide.c b/progs/trivial/line-wide.c index b74021dea73..1945712c5d0 100644 --- a/progs/trivial/line-wide.c +++ b/progs/trivial/line-wide.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/line.c b/progs/trivial/line.c index e1d73280bfc..58ab96836f8 100644 --- a/progs/trivial/line.c +++ b/progs/trivial/line.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/lineloop-clip.c b/progs/trivial/lineloop-clip.c index 45fa47491f8..5e6b6217a1a 100644 --- a/progs/trivial/lineloop-clip.c +++ b/progs/trivial/lineloop-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/lineloop.c b/progs/trivial/lineloop.c index c290dbd8cb3..82eccd24f8f 100644 --- a/progs/trivial/lineloop.c +++ b/progs/trivial/lineloop.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/linestrip-stipple-wide.c b/progs/trivial/linestrip-stipple-wide.c index 701c82c266a..0296941a0de 100644 --- a/progs/trivial/linestrip-stipple-wide.c +++ b/progs/trivial/linestrip-stipple-wide.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/linestrip-stipple.c b/progs/trivial/linestrip-stipple.c index df2eef96b5d..a847d47deeb 100644 --- a/progs/trivial/linestrip-stipple.c +++ b/progs/trivial/linestrip-stipple.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/point-clip.c b/progs/trivial/point-clip.c index 4c89ba598d7..23cfd778637 100644 --- a/progs/trivial/point-clip.c +++ b/progs/trivial/point-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/point-param.c b/progs/trivial/point-param.c index 6f43720a892..46bd773265f 100644 --- a/progs/trivial/point-param.c +++ b/progs/trivial/point-param.c @@ -59,7 +59,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); } diff --git a/progs/trivial/point-sprite.c b/progs/trivial/point-sprite.c index 5d29a6a3cf9..16e6771514b 100644 --- a/progs/trivial/point-sprite.c +++ b/progs/trivial/point-sprite.c @@ -96,7 +96,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/point-wide-smooth.c b/progs/trivial/point-wide-smooth.c index f6e9b8df5f9..752cb8aee38 100644 --- a/progs/trivial/point-wide-smooth.c +++ b/progs/trivial/point-wide-smooth.c @@ -63,7 +63,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/point-wide.c b/progs/trivial/point-wide.c index 8abd64c6a99..3b00ee9e500 100644 --- a/progs/trivial/point-wide.c +++ b/progs/trivial/point-wide.c @@ -63,7 +63,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/point.c b/progs/trivial/point.c index 49959dcc487..8f5299cf6b5 100644 --- a/progs/trivial/point.c +++ b/progs/trivial/point.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/poly-flat-clip.c b/progs/trivial/poly-flat-clip.c index 5490068b08e..2a968bed40e 100644 --- a/progs/trivial/poly-flat-clip.c +++ b/progs/trivial/poly-flat-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/poly-flat-unfilled-clip.c b/progs/trivial/poly-flat-unfilled-clip.c index 26b90ef9645..89f4e0656ab 100644 --- a/progs/trivial/poly-flat-unfilled-clip.c +++ b/progs/trivial/poly-flat-unfilled-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/poly-flat.c b/progs/trivial/poly-flat.c index a4e3cdb6334..33c2e04e0f8 100644 --- a/progs/trivial/poly-flat.c +++ b/progs/trivial/poly-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/poly-unfilled.c b/progs/trivial/poly-unfilled.c index 2ad443dc159..c8c0d7a9e37 100644 --- a/progs/trivial/poly-unfilled.c +++ b/progs/trivial/poly-unfilled.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/poly.c b/progs/trivial/poly.c index e5b788ea5be..964eb42d789 100644 --- a/progs/trivial/poly.c +++ b/progs/trivial/poly.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-clip-all-vertices.c b/progs/trivial/quad-clip-all-vertices.c index 60c87fc9ce1..7712d8ca5b7 100644 --- a/progs/trivial/quad-clip-all-vertices.c +++ b/progs/trivial/quad-clip-all-vertices.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-clip.c b/progs/trivial/quad-clip.c index 063de6106a6..2847c9f9608 100644 --- a/progs/trivial/quad-clip.c +++ b/progs/trivial/quad-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-degenerate.c b/progs/trivial/quad-degenerate.c index fdc142bcd61..85e129d4be2 100644 --- a/progs/trivial/quad-degenerate.c +++ b/progs/trivial/quad-degenerate.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-flat.c b/progs/trivial/quad-flat.c index e3147b3b3fe..bed98e31a4e 100644 --- a/progs/trivial/quad-flat.c +++ b/progs/trivial/quad-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-offset-factor.c b/progs/trivial/quad-offset-factor.c index dfe99bbae68..1fc57a54ae7 100644 --- a/progs/trivial/quad-offset-factor.c +++ b/progs/trivial/quad-offset-factor.c @@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-offset-unfilled.c b/progs/trivial/quad-offset-unfilled.c index 06590021fed..62f50fb98cc 100644 --- a/progs/trivial/quad-offset-unfilled.c +++ b/progs/trivial/quad-offset-unfilled.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-offset-units.c b/progs/trivial/quad-offset-units.c index 922529d977e..1ac2338692f 100644 --- a/progs/trivial/quad-offset-units.c +++ b/progs/trivial/quad-offset-units.c @@ -55,7 +55,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-tex-alpha.c b/progs/trivial/quad-tex-alpha.c index eebaf9170ec..9db6792fad3 100644 --- a/progs/trivial/quad-tex-alpha.c +++ b/progs/trivial/quad-tex-alpha.c @@ -88,7 +88,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-tex-pbo.c b/progs/trivial/quad-tex-pbo.c index ad41a9a22e5..b7aa1db4360 100644 --- a/progs/trivial/quad-tex-pbo.c +++ b/progs/trivial/quad-tex-pbo.c @@ -105,7 +105,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-unfilled-clip.c b/progs/trivial/quad-unfilled-clip.c index 761878bd4b6..d2e87187751 100644 --- a/progs/trivial/quad-unfilled-clip.c +++ b/progs/trivial/quad-unfilled-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-unfilled-stipple.c b/progs/trivial/quad-unfilled-stipple.c index cd7d2769284..8c1737e6756 100644 --- a/progs/trivial/quad-unfilled-stipple.c +++ b/progs/trivial/quad-unfilled-stipple.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad-unfilled.c b/progs/trivial/quad-unfilled.c index d64f17fdf95..b756449d7a8 100644 --- a/progs/trivial/quad-unfilled.c +++ b/progs/trivial/quad-unfilled.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quad.c b/progs/trivial/quad.c index d360e309d30..582de783d59 100644 --- a/progs/trivial/quad.c +++ b/progs/trivial/quad.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quads.c b/progs/trivial/quads.c index fe11fef207c..de7854a255e 100644 --- a/progs/trivial/quads.c +++ b/progs/trivial/quads.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quadstrip-cont.c b/progs/trivial/quadstrip-cont.c index 329523531aa..44412698dc5 100644 --- a/progs/trivial/quadstrip-cont.c +++ b/progs/trivial/quadstrip-cont.c @@ -57,7 +57,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quadstrip-flat.c b/progs/trivial/quadstrip-flat.c index 228c6c255e5..0e0b3b49fa6 100644 --- a/progs/trivial/quadstrip-flat.c +++ b/progs/trivial/quadstrip-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/quadstrip.c b/progs/trivial/quadstrip.c index d49a9a53020..1be815fb8cd 100644 --- a/progs/trivial/quadstrip.c +++ b/progs/trivial/quadstrip.c @@ -57,7 +57,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/readpixels.c b/progs/trivial/readpixels.c index 5671618446a..b063f179569 100644 --- a/progs/trivial/readpixels.c +++ b/progs/trivial/readpixels.c @@ -39,7 +39,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(0); default: - return; + break; } glutPostRedisplay(); } diff --git a/progs/trivial/tri-alpha-tex.c b/progs/trivial/tri-alpha-tex.c index 780ebe6be5b..853d564ae7b 100644 --- a/progs/trivial/tri-alpha-tex.c +++ b/progs/trivial/tri-alpha-tex.c @@ -88,7 +88,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-alpha.c b/progs/trivial/tri-alpha.c index aec1cbb3772..bd1c88ecf8e 100644 --- a/progs/trivial/tri-alpha.c +++ b/progs/trivial/tri-alpha.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-blend-color.c b/progs/trivial/tri-blend-color.c index 92f019259ec..629b35c4abb 100644 --- a/progs/trivial/tri-blend-color.c +++ b/progs/trivial/tri-blend-color.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-clear.c b/progs/trivial/tri-clear.c index f49186bd8ae..e52ed81bf44 100644 --- a/progs/trivial/tri-clear.c +++ b/progs/trivial/tri-clear.c @@ -63,7 +63,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-clip.c b/progs/trivial/tri-clip.c index e1deca1bdcf..3e3879c9859 100644 --- a/progs/trivial/tri-clip.c +++ b/progs/trivial/tri-clip.c @@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); } diff --git a/progs/trivial/tri-cull-both.c b/progs/trivial/tri-cull-both.c index 864be710c2a..809599d4a6d 100644 --- a/progs/trivial/tri-cull-both.c +++ b/progs/trivial/tri-cull-both.c @@ -65,7 +65,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-dlist.c b/progs/trivial/tri-dlist.c index c410be221a7..62d0a965d82 100644 --- a/progs/trivial/tri-dlist.c +++ b/progs/trivial/tri-dlist.c @@ -75,7 +75,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-fbo.c b/progs/trivial/tri-fbo.c index 1ed177ffdfb..089180f97ad 100644 --- a/progs/trivial/tri-fbo.c +++ b/progs/trivial/tri-fbo.c @@ -75,7 +75,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-flat-clip.c b/progs/trivial/tri-flat-clip.c index 2aab5ba00a5..a23f8a382b0 100644 --- a/progs/trivial/tri-flat-clip.c +++ b/progs/trivial/tri-flat-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-flat.c b/progs/trivial/tri-flat.c index ea703ec6f3f..0614321844e 100644 --- a/progs/trivial/tri-flat.c +++ b/progs/trivial/tri-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-fog.c b/progs/trivial/tri-fog.c index 0cea3d32582..7fc254a4675 100644 --- a/progs/trivial/tri-fog.c +++ b/progs/trivial/tri-fog.c @@ -72,7 +72,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-fp-const-imm.c b/progs/trivial/tri-fp-const-imm.c index d2df442abfc..accea62042d 100644 --- a/progs/trivial/tri-fp-const-imm.c +++ b/progs/trivial/tri-fp-const-imm.c @@ -92,7 +92,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-fp.c b/progs/trivial/tri-fp.c index 4d1508120ea..8f933befd3d 100644 --- a/progs/trivial/tri-fp.c +++ b/progs/trivial/tri-fp.c @@ -90,7 +90,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-lit-material.c b/progs/trivial/tri-lit-material.c index ff9fb2c4dd6..16cebb2b984 100644 --- a/progs/trivial/tri-lit-material.c +++ b/progs/trivial/tri-lit-material.c @@ -65,7 +65,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-lit.c b/progs/trivial/tri-lit.c index 15a7ad24c51..26ebd99d917 100644 --- a/progs/trivial/tri-lit.c +++ b/progs/trivial/tri-lit.c @@ -65,7 +65,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-multitex-vbo.c b/progs/trivial/tri-multitex-vbo.c index e319447ac15..ca4edaa5ddc 100644 --- a/progs/trivial/tri-multitex-vbo.c +++ b/progs/trivial/tri-multitex-vbo.c @@ -192,7 +192,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-orig.c b/progs/trivial/tri-orig.c index e7cfee3a367..d86d34c39de 100644 --- a/progs/trivial/tri-orig.c +++ b/progs/trivial/tri-orig.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-query.c b/progs/trivial/tri-query.c index 94956a86f33..8898f182c78 100644 --- a/progs/trivial/tri-query.c +++ b/progs/trivial/tri-query.c @@ -72,7 +72,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-scissor-tri.c b/progs/trivial/tri-scissor-tri.c index 608ebf29cff..d65502d91b9 100644 --- a/progs/trivial/tri-scissor-tri.c +++ b/progs/trivial/tri-scissor-tri.c @@ -63,7 +63,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-square.c b/progs/trivial/tri-square.c index 0b82a1dd8e3..2014bd489c3 100644 --- a/progs/trivial/tri-square.c +++ b/progs/trivial/tri-square.c @@ -63,7 +63,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-stipple.c b/progs/trivial/tri-stipple.c index aa94fa224b7..15a08fec7c8 100644 --- a/progs/trivial/tri-stipple.c +++ b/progs/trivial/tri-stipple.c @@ -77,7 +77,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-tex-3d.c b/progs/trivial/tri-tex-3d.c index 3ccbe125105..073a080d7a7 100644 --- a/progs/trivial/tri-tex-3d.c +++ b/progs/trivial/tri-tex-3d.c @@ -97,7 +97,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-tex.c b/progs/trivial/tri-tex.c index 56afb4748d7..244e1545042 100644 --- a/progs/trivial/tri-tex.c +++ b/progs/trivial/tri-tex.c @@ -94,7 +94,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-tri.c b/progs/trivial/tri-tri.c index f996bd01a16..7bf400793ea 100644 --- a/progs/trivial/tri-tri.c +++ b/progs/trivial/tri-tri.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-clip.c b/progs/trivial/tri-unfilled-clip.c index 2fd894a49a8..585919e16d1 100644 --- a/progs/trivial/tri-unfilled-clip.c +++ b/progs/trivial/tri-unfilled-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-edgeflag.c b/progs/trivial/tri-unfilled-edgeflag.c index 11c21d1bf68..f536f642296 100644 --- a/progs/trivial/tri-unfilled-edgeflag.c +++ b/progs/trivial/tri-unfilled-edgeflag.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-point.c b/progs/trivial/tri-unfilled-point.c index 750a254669a..11e276e1a5b 100644 --- a/progs/trivial/tri-unfilled-point.c +++ b/progs/trivial/tri-unfilled-point.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-smooth.c b/progs/trivial/tri-unfilled-smooth.c index eddae176e5f..fa31667e658 100644 --- a/progs/trivial/tri-unfilled-smooth.c +++ b/progs/trivial/tri-unfilled-smooth.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-tri-lit.c b/progs/trivial/tri-unfilled-tri-lit.c index 1d42b40b713..d6baeb46978 100644 --- a/progs/trivial/tri-unfilled-tri-lit.c +++ b/progs/trivial/tri-unfilled-tri-lit.c @@ -65,7 +65,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-userclip-stip.c b/progs/trivial/tri-unfilled-userclip-stip.c index ddc0dffd4f4..02bfa92f835 100644 --- a/progs/trivial/tri-unfilled-userclip-stip.c +++ b/progs/trivial/tri-unfilled-userclip-stip.c @@ -67,7 +67,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-userclip.c b/progs/trivial/tri-unfilled-userclip.c index 0dec0bfc9b4..11e53fc7cc9 100644 --- a/progs/trivial/tri-unfilled-userclip.c +++ b/progs/trivial/tri-unfilled-userclip.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled.c b/progs/trivial/tri-unfilled.c index b98cb9a842a..afa1058dad4 100644 --- a/progs/trivial/tri-unfilled.c +++ b/progs/trivial/tri-unfilled.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-userclip.c b/progs/trivial/tri-userclip.c index 8f37e0fae20..5651c738325 100644 --- a/progs/trivial/tri-userclip.c +++ b/progs/trivial/tri-userclip.c @@ -66,7 +66,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-z-9.c b/progs/trivial/tri-z-9.c index 099e89f6f4a..37b9e2f8732 100644 --- a/progs/trivial/tri-z-9.c +++ b/progs/trivial/tri-z-9.c @@ -61,7 +61,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-z-eq.c b/progs/trivial/tri-z-eq.c index b81c992f7d1..6bdac474196 100644 --- a/progs/trivial/tri-z-eq.c +++ b/progs/trivial/tri-z-eq.c @@ -61,7 +61,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/trifan-flat-clip.c b/progs/trivial/trifan-flat-clip.c index 199f91a637e..89bc471191e 100644 --- a/progs/trivial/trifan-flat-clip.c +++ b/progs/trivial/trifan-flat-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/trifan-flat-unfilled-clip.c b/progs/trivial/trifan-flat-unfilled-clip.c index ea3e1553872..3a1a226e546 100644 --- a/progs/trivial/trifan-flat-unfilled-clip.c +++ b/progs/trivial/trifan-flat-unfilled-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/trifan-flat.c b/progs/trivial/trifan-flat.c index d69b4887e39..d25abdf49eb 100644 --- a/progs/trivial/trifan-flat.c +++ b/progs/trivial/trifan-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/trifan-unfilled.c b/progs/trivial/trifan-unfilled.c index 91447e4e44d..2e3ff8218f0 100644 --- a/progs/trivial/trifan-unfilled.c +++ b/progs/trivial/trifan-unfilled.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/trifan.c b/progs/trivial/trifan.c index 84eb4172de1..b8a76151148 100644 --- a/progs/trivial/trifan.c +++ b/progs/trivial/trifan.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tristrip-clip.c b/progs/trivial/tristrip-clip.c index 343e2938049..4e6ee1fbca2 100644 --- a/progs/trivial/tristrip-clip.c +++ b/progs/trivial/tristrip-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tristrip-flat.c b/progs/trivial/tristrip-flat.c index 02da97efcea..a90b8b6cb68 100644 --- a/progs/trivial/tristrip-flat.c +++ b/progs/trivial/tristrip-flat.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tristrip.c b/progs/trivial/tristrip.c index 77bf2fad282..29915ff111d 100644 --- a/progs/trivial/tristrip.c +++ b/progs/trivial/tristrip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/vp-tri-cb-pos.c b/progs/trivial/vp-tri-cb-pos.c index 42bf9806b19..9cbc4d1193a 100644 --- a/progs/trivial/vp-tri-cb-pos.c +++ b/progs/trivial/vp-tri-cb-pos.c @@ -81,7 +81,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/vp-tri-cb-tex.c b/progs/trivial/vp-tri-cb-tex.c index 8290226675e..e543e2ec3fd 100644 --- a/progs/trivial/vp-tri-cb-tex.c +++ b/progs/trivial/vp-tri-cb-tex.c @@ -114,7 +114,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/vp-tri-invariant.c b/progs/trivial/vp-tri-invariant.c index ff241393659..4dbe95eb9a1 100644 --- a/progs/trivial/vp-tri-invariant.c +++ b/progs/trivial/vp-tri-invariant.c @@ -69,7 +69,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); -- cgit v1.2.3 From 56de7e222ee0f5e44b87ce05dc94733fdd41e4ed Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 22:52:05 -0800 Subject: progs/trivial: Redraw upon keypress. (cherry picked from commit 9553a42f638bd98eb90e5b7fb37d6b82758b6363) --- progs/trivial/linestrip-clip.c | 2 +- progs/trivial/linestrip-flat-stipple.c | 2 +- progs/trivial/linestrip.c | 2 +- progs/trivial/tri-unfilled-tri.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/progs/trivial/linestrip-clip.c b/progs/trivial/linestrip-clip.c index f2528229218..5e90ea2eb05 100644 --- a/progs/trivial/linestrip-clip.c +++ b/progs/trivial/linestrip-clip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/linestrip-flat-stipple.c b/progs/trivial/linestrip-flat-stipple.c index 5caa7244235..bae5c3a1c3b 100644 --- a/progs/trivial/linestrip-flat-stipple.c +++ b/progs/trivial/linestrip-flat-stipple.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/linestrip.c b/progs/trivial/linestrip.c index 0219b1ab70e..b6d68821463 100644 --- a/progs/trivial/linestrip.c +++ b/progs/trivial/linestrip.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); diff --git a/progs/trivial/tri-unfilled-tri.c b/progs/trivial/tri-unfilled-tri.c index 695cc890955..75a70b8a412 100644 --- a/progs/trivial/tri-unfilled-tri.c +++ b/progs/trivial/tri-unfilled-tri.c @@ -62,7 +62,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); -- cgit v1.2.3 From 905e12f3cce7f1bd8cfa990e4d6d7c0b14610f84 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 14:20:15 -0800 Subject: gallium/util: Initialize variables in u_pack_color.h. (cherry picked from commit 36e2074b63e3e5bc489eb74cad0cd97eafcedb40) --- src/gallium/auxiliary/util/u_pack_color.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index eda883b3b92..9dacc6d83db 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -302,7 +302,10 @@ util_unpack_color_ub(enum pipe_format format, const void *src, static INLINE void util_pack_color(const float rgba[4], enum pipe_format format, void *dest) { - ubyte r, g, b, a; + ubyte r = 0; + ubyte g = 0; + ubyte b = 0; + ubyte a = 0; if (pf_size_x(format) <= 8) { /* format uses 8-bit components or less */ -- cgit v1.2.3 From d245a951f39fe480c6268dbcc1fa06d59c40109e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 16 Nov 2009 14:56:07 -0800 Subject: progs/demos: Fix memory leak in fslight.c. (cherry picked from commit aef3218f0bb48fdb286d2008ee07e507ea8aa98e) --- progs/demos/fslight.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/demos/fslight.c b/progs/demos/fslight.c index f0d76a4a06f..acba3e9583f 100644 --- a/progs/demos/fslight.c +++ b/progs/demos/fslight.c @@ -353,6 +353,7 @@ MakeSphere(void) glNewList(SphereList, GL_COMPILE); gluSphere(obj, 2.0f, 10, 5); glEndList(); + gluDeleteQuadric(obj); } static void -- cgit v1.2.3 From fc5f07de1aabddaf2c9d599a85ec74cde674275e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 16 Nov 2009 15:44:52 -0800 Subject: progs/demos: Fix memory leak in ipers.c. (cherry picked from commit a1afe303deda320aadacdaf5b1c72631ca3f734f) --- progs/demos/ipers.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/demos/ipers.c b/progs/demos/ipers.c index 5d82b0dc924..ed03673cb62 100644 --- a/progs/demos/ipers.c +++ b/progs/demos/ipers.c @@ -133,6 +133,8 @@ initdlists(void) glEndList(); } + + gluDeleteQuadric(obj); } static void -- cgit v1.2.3 From 5820dae4ecad11097ddc024441ea45aa9fefa290 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 16 Nov 2009 16:31:34 -0800 Subject: progs/demos: Fix memory leak in projtex.c. (cherry picked from commit ee555e3d69c8820f27e71e5ebc028a768cef7d0b) --- progs/demos/projtex.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/progs/demos/projtex.c b/progs/demos/projtex.c index 99154d7bdc8..ad205c74137 100644 --- a/progs/demos/projtex.c +++ b/progs/demos/projtex.c @@ -245,6 +245,9 @@ loadImageTextures(void) glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); } glTexParameterfv(GL_TEXTURE_2D, GL_TEXTURE_BORDER_COLOR, borderColor); + + free(texData3); + free(texData4); } } -- cgit v1.2.3 From b803abbaad3135047b931c322300b2d12ff255e1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 16 Nov 2009 18:06:40 -0800 Subject: progs/demos: Fix memory leak in ray.c. (cherry picked from commit 6b480dc21dd489d48685b2268e495218aea74293) --- progs/demos/ray.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/demos/ray.c b/progs/demos/ray.c index c2d8e4f545e..e9211aa3399 100644 --- a/progs/demos/ray.c +++ b/progs/demos/ray.c @@ -834,6 +834,8 @@ initdlists(void) gluQuadricTexture(obj, GL_TRUE); gluSphere(obj, SPHERE_RADIUS, 16, 16); glEndList(); + + gluDeleteQuadric(obj); } int -- cgit v1.2.3 From 25fd168f03162d4cb25b50ea9bd5ff56283f6854 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 11:37:48 -0800 Subject: progs/glsl: Change tangentAttrib from GLuint to GLint in bump.c. tangentAtrrib is assigned the result of glGetAttribLocation. The assertion 'assert(tangentAtrrib >= 0)' would be a no-op if tangentAttrib is a GLuint. (cherry picked from commit b8dcb79c53796f37234bd2b0f5e2845f817fc218) --- progs/glsl/bump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index 87669aec736..50a0900f1c7 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -36,7 +36,7 @@ static GLint win = 0; static GLfloat xRot = 20.0f, yRot = 0.0f, zRot = 0.0f; -static GLuint tangentAttrib; +static GLint tangentAttrib; static GLboolean Anim = GL_FALSE; -- cgit v1.2.3 From b1a87a3e0b8a4008be0e544f1b55f6facb01547d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 09:53:19 -0800 Subject: progs/glsl: Fix memory leak in deriv.c. (cherry picked from commit 0e783c7d03128aade3ca50b28a56e254fef6b6ab) --- progs/glsl/deriv.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index 265a5157154..30f2b75fef7 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -140,6 +140,7 @@ MakeSphere(void) glNewList(SphereList, GL_COMPILE); gluSphere(obj, 2.0f, 30, 15); glEndList(); + gluDeleteQuadric(obj); } -- cgit v1.2.3 From b210739aad1233ece4c12e93700768f331f3cac5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 14:10:35 -0800 Subject: progs/redbook: Fix memory leak in quadric.c. (cherry picked from commit 47b5f584a68ceab7c9c1d5279efbc9fe30ff2fcc) --- progs/redbook/quadric.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/redbook/quadric.c b/progs/redbook/quadric.c index 4e46c85f829..7e99098304a 100644 --- a/progs/redbook/quadric.c +++ b/progs/redbook/quadric.c @@ -116,6 +116,8 @@ void init(void) glNewList(startList+3, GL_COMPILE); gluPartialDisk(qobj, 0.0, 1.0, 20, 4, 0.0, 225.0); glEndList(); + + gluDeleteQuadric(qobj); } void display(void) -- cgit v1.2.3 From efb582fde7d1375b21ecb28d8ba5690181a02a93 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 18 Nov 2009 17:30:50 -0800 Subject: progs/tests: Fix memory leak in texdown.c if malloc fails. (cherry picked from commit e3cfd78969cd4a94fc83a5d6fb2f33730cc4e70f) --- progs/tests/texdown.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/tests/texdown.c b/progs/tests/texdown.c index 7e460458325..e6881d39a0a 100644 --- a/progs/tests/texdown.c +++ b/progs/tests/texdown.c @@ -176,6 +176,8 @@ MeasureDownloadRate(void) orig_getImage = (GLubyte *) malloc(image_bytes + ALIGN); if (!orig_texImage || !orig_getImage) { DownloadRate = 0.0; + free(orig_texImage); + free(orig_getImage); return; } -- cgit v1.2.3 From 69ed1147a8a576fb28ba1dc2b030d903ae094eda Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 22:59:01 -0800 Subject: progs/vp: Fix memory leak in vp-tris.c. (cherry picked from commit 760cf71572a071ce43da576ebfeff4a8099150bc) --- progs/vp/vp-tris.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/vp/vp-tris.c b/progs/vp/vp-tris.c index 1356242d971..29cd027b00c 100644 --- a/progs/vp/vp-tris.c +++ b/progs/vp/vp-tris.c @@ -99,9 +99,11 @@ static void Init( void ) sz = (GLuint) fread(buf, 1, sizeof(buf), f); if (!feof(f)) { fprintf(stderr, "file too long\n"); + fclose(f); exit(1); } + fclose(f); fprintf(stderr, "%.*s\n", sz, buf); if (strncmp( buf, "!!VP", 4 ) == 0) { -- cgit v1.2.3 From 68d206fafa4398826cb26da1c66f1bbc4dc66f0c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 15:03:16 -0800 Subject: progs/xdemos: Add assert in corender.c. (cherry picked from commit 66a4ec14c38d407256545e0cf31c98974d621fe4) --- progs/xdemos/corender.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/xdemos/corender.c b/progs/xdemos/corender.c index f2b8145e52b..1b18d9f54e7 100644 --- a/progs/xdemos/corender.c +++ b/progs/xdemos/corender.c @@ -55,6 +55,7 @@ setup_ipc(void) printf("Waiting for connection from another 'corender'\n"); Sock = AcceptConnection(k); + assert(Sock != -1); printf("Got connection, sending windowID\n"); -- cgit v1.2.3 From 7324c22024297d1307f511ee320ebdfd47926228 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 13:01:22 -0800 Subject: progs/xdemos: Fix memory leak in glxinfo.c. (cherry picked from commit f080567f4c4018c4885c105a154cb0eb39e6234f) --- progs/xdemos/glxinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index 445d3ea94b6..c1a032872cd 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -964,8 +964,10 @@ print_fbconfig_info(Display *dpy, int scrnum, InfoMode mode) /* get list of all fbconfigs on this screen */ fbconfigs = glXGetFBConfigs(dpy, scrnum, &numFBConfigs); - if (numFBConfigs == 0) + if (numFBConfigs == 0) { + XFree(fbconfigs); return; + } printf("%d GLXFBConfigs:\n", numFBConfigs); if (mode == Normal) -- cgit v1.2.3 From 83506484010d38dd6d3e17aa4e0d06dc8467992f Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 15:06:56 -0800 Subject: progs/xdemos: Remove duplicate code in glxinfo.c. (cherry picked from commit a4720a1a3206dd2edecf47a21fce547a79b67610) --- progs/xdemos/glxinfo.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index c1a032872cd..b182a3091d1 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -426,8 +426,6 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) GLXFBConfig *configs = NULL; int nConfigs; - if (!visinfo) - configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs); if (!visinfo) configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs); -- cgit v1.2.3 From ba3fedf24610a3db2db0b49b8b84ac3af99a87cb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 19 Nov 2009 14:20:26 -0800 Subject: progs/xdemos: Add missing break statement in offset.c. (cherry picked from commit 4ab8dbe5935d5c946cbc9af6982461073a784d07) --- progs/xdemos/offset.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/xdemos/offset.c b/progs/xdemos/offset.c index 6c5abf383be..314a4fcdd17 100644 --- a/progs/xdemos/offset.c +++ b/progs/xdemos/offset.c @@ -294,6 +294,7 @@ process_input(Display *dpy, Window win) { default: break; } + break; case ButtonPress: prevx = event.xbutton.x; prevy = event.xbutton.y; -- cgit v1.2.3 From 4bf96ebdaeac780a5f28c0413b4e2fc5848f923c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 15:48:29 -0800 Subject: progs/xdemos: Fix memory leak in pbdemo.c. (cherry picked from commit e0857962b911ef317238498305651515d83029ae) --- progs/xdemos/pbdemo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/xdemos/pbdemo.c b/progs/xdemos/pbdemo.c index 2573209336c..277df729246 100644 --- a/progs/xdemos/pbdemo.c +++ b/progs/xdemos/pbdemo.c @@ -131,6 +131,7 @@ MakePbuffer( Display *dpy, int screen, int width, int height ) fbConfigs = ChooseFBConfig(dpy, screen, fbAttribs[attempt], &nConfigs); if (nConfigs==0 || !fbConfigs) { printf("Note: glXChooseFBConfig(%s) failed\n", fbString[attempt]); + XFree(fbConfigs); continue; } -- cgit v1.2.3 From 12a440abfb5a9cb786ed93d9041a6ae0752b9a18 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 13:09:42 -0800 Subject: progs/xdemos: Silence unused value warnings in sharedtex_mt.c. (cherry picked from commit 8556fad75124e1ade9af095e112ebb6ac5cbff61) --- progs/xdemos/sharedtex_mt.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/progs/xdemos/sharedtex_mt.c b/progs/xdemos/sharedtex_mt.c index 07c1bfcc388..f924448cc43 100644 --- a/progs/xdemos/sharedtex_mt.c +++ b/progs/xdemos/sharedtex_mt.c @@ -447,7 +447,7 @@ main(int argc, char *argv[]) const char *dpyName = XDisplayName(NULL); pthread_t t0, t1, t2, t3; struct thread_init_arg tia0, tia1, tia2, tia3; - struct window *h0, *h1, *h2, *h3; + struct window *h0; XInitThreads(); @@ -462,9 +462,9 @@ main(int argc, char *argv[]) /* four windows and contexts sharing display lists and texture objects */ h0 = AddWindow(gDpy, dpyName, 10, 10, gCtx); - h1 = AddWindow(gDpy, dpyName, 330, 10, gCtx); - h2 = AddWindow(gDpy, dpyName, 10, 350, gCtx); - h3 = AddWindow(gDpy, dpyName, 330, 350, gCtx); + (void) AddWindow(gDpy, dpyName, 330, 10, gCtx); + (void) AddWindow(gDpy, dpyName, 10, 350, gCtx); + (void) AddWindow(gDpy, dpyName, 330, 350, gCtx); if (!glXMakeCurrent(gDpy, h0->Win, gCtx)) { Error(dpyName, "glXMakeCurrent failed for init thread."); -- cgit v1.2.3 From d23bb22f6258a4b55af42fdb3f29fec2e694df72 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 22 Nov 2009 01:45:53 -0500 Subject: glu: Fix memory leak in __gl_meshMakeEdge. (cherry picked from commit d3b4c99c703f70a9d0e715a97e52672f7f8fc980) --- src/glu/sgi/libtess/mesh.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/glu/sgi/libtess/mesh.c b/src/glu/sgi/libtess/mesh.c index ae861f86428..95f87cdc949 100644 --- a/src/glu/sgi/libtess/mesh.c +++ b/src/glu/sgi/libtess/mesh.c @@ -284,7 +284,12 @@ GLUhalfEdge *__gl_meshMakeEdge( GLUmesh *mesh ) } e = MakeEdge( &mesh->eHead ); - if (e == NULL) return NULL; + if (e == NULL) { + memFree(newVertex1); + memFree(newVertex2); + memFree(newFace); + return NULL; + } MakeVertex( newVertex1, e, &mesh->vHead ); MakeVertex( newVertex2, e->Sym, &mesh->vHead ); -- cgit v1.2.3 From fe38c16021694145b2c96818e0c0fb095e42c03b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 22 Nov 2009 01:57:35 -0500 Subject: glu/sgi: Fix memory leak in gluScaleImage. (cherry picked from commit a9c540f5dedbf593f8038fdbc95eecb60826ab26) --- src/glu/sgi/libutil/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index af647af73c9..4139c304a1d 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3526,6 +3526,8 @@ gluScaleImage(GLenum format, GLsizei widthin, GLsizei heightin, afterImage = malloc(image_size(widthout, heightout, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; } -- cgit v1.2.3 From 6c1fc2b2a5c80697dff304562e79dae25d9f2cb1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 00:57:37 -0500 Subject: glu/sgi: Fix memory leak in gluScaleImage3D. (cherry picked from commit b611f639b4bffdcca376293f7ce71af9f6bdbff3) --- src/glu/sgi/libutil/mipmap.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 4139c304a1d..223621f49fc 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -7384,6 +7384,8 @@ int gluScaleImage3D(GLenum format, afterImage = malloc(imageSize3D(widthOut, heightOut, depthOut, format, GL_UNSIGNED_SHORT)); if (beforeImage == NULL || afterImage == NULL) { + free(beforeImage); + free(afterImage); return GLU_OUT_OF_MEMORY; } retrieveStoreModes3D(&psm); -- cgit v1.2.3 From 80a3944a4d6a07793872d283633546d482cf61b7 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 01:09:06 -0500 Subject: glu/sgi: Fix memory leak in bitmapBuild2DMipmaps. (cherry picked from commit 5b925b7daa566d799c4f50911a7fcca114131503) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 223621f49fc..c5faebd6a35 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3762,6 +3762,7 @@ static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(newImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 7ed749c062c2bc2b048a34f8e4c6b0a5198e32bb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 24 Nov 2009 01:23:12 -0500 Subject: glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. (cherry picked from commit 326b66d724754ca97012501db1c7c62d7d41a457) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index c5faebd6a35..a5d07a59cf7 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -8232,6 +8232,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 7b5eba453e08dfad151d09ba4d308cbdf4fc83af Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:18:49 -0500 Subject: glu/sgi: Fix memory leak in gluBuild3DMipmapLevelsCore. (cherry picked from commit f895abbd9777c4985aa40cf660c68f6d7333f0ec) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index a5d07a59cf7..22d702291f0 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -8098,6 +8098,7 @@ static int gluBuild3DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); glPixelStorei(GL_UNPACK_SKIP_IMAGES, psm.unpack_skip_images); glPixelStorei(GL_UNPACK_IMAGE_HEIGHT, psm.unpack_image_height); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ -- cgit v1.2.3 From ea487c6d0b261bf90e898f51bc9f872de8166ddb Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:28:56 -0500 Subject: glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. (cherry picked from commit 0d89f3dc7ff3f89ba8d5d664253730485bca35e2) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 22d702291f0..796be0aad38 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -4349,6 +4349,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From 8df551c46bc15a4b1ce1dc11e083498442018418 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 25 Nov 2009 00:39:37 -0500 Subject: glu/sgi: Fix memory leak in gluBuild1DMipmapLevelsCore. (cherry picked from commit 94bcb9f1a43f2ab3bdff09156e3ab5b1c115cbd8) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index 796be0aad38..bf6eaf88c6d 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -3608,6 +3608,7 @@ int gluBuild1DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS,psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(newImage); return GLU_OUT_OF_MEMORY; } } -- cgit v1.2.3 From c74afe0c46dbd0f90361c06526f70885a9061e8e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 26 Nov 2009 00:35:31 -0500 Subject: glu/sgi: Fix memory leak in gluBuild2DMipmapLevelsCore. (cherry picked from commit 808f0376607b0e2d31dfebc888fd8f1e737fed09) --- src/glu/sgi/libutil/mipmap.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/glu/sgi/libutil/mipmap.c b/src/glu/sgi/libutil/mipmap.c index bf6eaf88c6d..d1fd5a7d724 100644 --- a/src/glu/sgi/libutil/mipmap.c +++ b/src/glu/sgi/libutil/mipmap.c @@ -4108,6 +4108,7 @@ static int gluBuild2DMipmapLevelsCore(GLenum target, GLint internalFormat, glPixelStorei(GL_UNPACK_SKIP_PIXELS, psm.unpack_skip_pixels); glPixelStorei(GL_UNPACK_ROW_LENGTH, psm.unpack_row_length); glPixelStorei(GL_UNPACK_SWAP_BYTES, psm.unpack_swap_bytes); + free(srcImage); return GLU_OUT_OF_MEMORY; } /* level userLevel+1 is in srcImage; level userLevel already saved */ -- cgit v1.2.3 From 8ac2503397c0618db9caec1c702622830e1268ff Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:01:41 +0000 Subject: i915g: Do not build winsys and binaries by default Using a hack in the configure script the gallium intel drivers have 3 options. Off, nothing is built. On, the driver and binaries are built. Auto, only the driver but not the binaries and winsys is built. Since the i915g driver builds everywhere its can enable the driver per default, so we can get build coverage. But building the binaries per default is a pain for distributions and testers since they conflict on the install target with the old mesa drivers. Which are more stable/faster/better. So this change gives us the best of both worlds. --- configure.ac | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index f9476a46dda..054857d5599 100644 --- a/configure.ac +++ b/configure.ac @@ -1206,13 +1206,15 @@ dnl dnl Gallium Intel configuration dnl AC_ARG_ENABLE([gallium-intel], - [AS_HELP_STRING([--disable-gallium-intel], - [build gallium intel @<:@default=enabled@:>@])], + [AS_HELP_STRING([--enable-gallium-intel], + [build gallium intel @<:@default=disabled@:>@])], [enable_gallium_intel="$enableval"], - [enable_gallium_intel=yes]) + [enable_gallium_intel=auto]) if test "x$enable_gallium_intel" = xyes; then GALLIUM_WINSYS_DRM_DIRS="$GALLIUM_WINSYS_DRM_DIRS intel" GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" +elif test "x$enable_gallium_intel" = xauto; then + GALLIUM_DRIVERS_DIRS="$GALLIUM_DRIVERS_DIRS i915" fi dnl -- cgit v1.2.3 From bc0532b0ed3c6dca3a198c64384636d96b2056ef Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 18:50:29 +0000 Subject: gallium: DRI drivers enabled by default, Xorg drivers auto by default. This change enabled gallium dri drivers by default under the configure build system. Xorg drivers are built automaticaly if a Xorg dev enviroment is installed and the Xorg version is higher then 1.6.0. --- configure.ac | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 054857d5599..25e4321510f 100644 --- a/configure.ac +++ b/configure.ac @@ -1143,7 +1143,14 @@ yes) GALLIUM_STATE_TRACKERS_DIRS=glx ;; dri) - test "x$enable_egl" = xyes && GALLIUM_STATE_TRACKERS_DIRS=egl + GALLIUM_STATE_TRACKERS_DIRS="dri" + if test "x$enable_egl" = xyes; then + GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS egl" + fi + # Have only tested st/xorg on 1.6.0 servers + PKG_CHECK_MODULES(XORG, [xorg-server >= 1.6.0], + HAVE_XORG="yes"; GALLIUM_STATE_TRACKERS_DIRS="$GALLIUM_STATE_TRACKERS_DIRS xorg", + HAVE_XORG="no") ;; esac ;; -- cgit v1.2.3 From 47e128331a26fa61506920c48bc82eaf5bd0460a Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 09:42:10 +0100 Subject: vmware/core: Update vmwgfx_drm.h to include cursor bypass --- src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h index 6bf3183ff54..56070a1ba10 100644 --- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h +++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h @@ -46,6 +46,7 @@ #define DRM_VMW_FIFO_DEBUG 11 #define DRM_VMW_FENCE_WAIT 12 #define DRM_VMW_OVERLAY 13 +#define DRM_VMW_CURSOR_BYPASS 14 /*************************************************************************/ /** @@ -503,4 +504,35 @@ struct drm_vmw_overlay_arg { struct drm_vmw_rect dst; }; +/*************************************************************************/ +/** + * DRM_VMW_CURSOR_BYPASS - Give extra information about cursor bypass. + * + */ + +#define DRM_VMW_CURSOR_BYPASS_ALL (1 << 0) +#define DRM_VMW_CURSOR_BYPASS_FLAGS (1) + +/** + * struct drm_vmw_cursor_bypass_arg + * + * @flags: Flags. + * @crtc_id: Crtc id, only used if DMR_CURSOR_BYPASS_ALL isn't passed. + * @xpos: X position of cursor. + * @ypos: Y position of cursor. + * @xhot: X hotspot. + * @yhot: Y hotspot. + * + * Argument to the DRM_VMW_CURSOR_BYPASS Ioctl. + */ + +struct drm_vmw_cursor_bypass_arg { + uint32_t flags; + uint32_t crtc_id; + int32_t xpos; + int32_t ypos; + int32_t xhot; + int32_t yhot; +}; + #endif -- cgit v1.2.3 From 12fdef20b02595c10cec91aad75abe6ca59f5513 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 09:40:52 +0100 Subject: vmware/xorg: Handle no init of video in vmw_video_close --- src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c index 6e34aa21f38..d62c3b7296f 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -342,6 +342,8 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) debug_printf("%s: enter\n", __func__); video = vmw->video_priv; + if (!video) + return TRUE; for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { vmw_video_port_cleanup(pScrn, &video->port[i]); -- cgit v1.2.3 From cd4d806a47d2cbb706a9f1cd49d990fcb803efb6 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 09:53:00 +0100 Subject: vmware/xorg: Give kernel infromation about cursor bypass --- src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 4 ++ src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 17 ++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 58 +++++++++++++++++++++++-- 3 files changed, 75 insertions(+), 4 deletions(-) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h index 04d446a2dfb..db6b89b8bcd 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -44,6 +44,8 @@ struct vmw_driver { int fd; + void *cursor_priv; + /* vmw_video.c */ void *video_priv; }; @@ -69,6 +71,8 @@ Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw); * vmw_ioctl.c */ +int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot); + struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle); diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c index 3cac5b7760c..7ec651db05d 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -54,6 +54,23 @@ struct vmw_dma_buffer uint32_t size; }; +int +vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot) +{ + struct drm_vmw_cursor_bypass_arg arg; + int ret; + + memset(&arg, 0, sizeof(arg)); + arg.flags = DRM_VMW_CURSOR_BYPASS_ALL; + arg.xhot = xhot; + arg.yhot = yhot; + + ret = drmCommandWriteRead(vmw->fd, DRM_VMW_CURSOR_BYPASS, + &arg, sizeof(arg)); + + return ret; +} + struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw, uint32_t size, unsigned *handle) { diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 344ef0b3159..421906da996 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -33,16 +33,58 @@ #include "vmw_hook.h" #include "vmw_driver.h" +/* modified version of crtc functions */ +xf86CrtcFuncsRec vmw_screen_crtc_funcs; + +static void +vmw_screen_cursor_load_argb(xf86CrtcPtr crtc, CARD32 *image) +{ + struct vmw_driver *vmw = modesettingPTR(crtc->scrn)->winsys_priv; + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(crtc->scrn); + xf86CrtcFuncsPtr funcs = vmw->cursor_priv; + CursorPtr c = config->cursor; + + /* Run the ioctl before uploading the image */ + vmw_ioctl_cursor_bypass(vmw, c->bits->xhot, c->bits->yhot); + + funcs->load_cursor_argb(crtc, image); +} + +static void +vmw_screen_cursor_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + + /* XXX assume that all crtc's have the same function struct */ + + /* Save old struct need to call the old functions as well */ + vmw->cursor_priv = (void*)(config->crtc[0]->funcs); + memcpy(&vmw_screen_crtc_funcs, vmw->cursor_priv, sizeof(xf86CrtcFuncsRec)); + vmw_screen_crtc_funcs.load_cursor_argb = vmw_screen_cursor_load_argb; + + for (i = 0; i < config->num_crtc; i++) + config->crtc[i]->funcs = &vmw_screen_crtc_funcs; +} + +static void +vmw_screen_cursor_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); + int i; + + vmw_ioctl_cursor_bypass(vmw, 0, 0); + + for (i = 0; i < config->num_crtc; i++) + config->crtc[i]->funcs = vmw->cursor_priv; +} + static Bool vmw_screen_init(ScrnInfoPtr pScrn) { modesettingPtr ms = modesettingPTR(pScrn); struct vmw_driver *vmw; - /* if gallium is used then we don't need to do anything. */ - if (ms->screen) - return TRUE; - vmw = xnfcalloc(sizeof(*vmw), 1); if (!vmw) return FALSE; @@ -50,6 +92,12 @@ vmw_screen_init(ScrnInfoPtr pScrn) vmw->fd = ms->fd; ms->winsys_priv = vmw; + vmw_screen_cursor_init(pScrn, vmw); + + /* if gallium is used then we don't need to do anything more. */ + if (ms->screen) + return TRUE; + vmw_video_init(pScrn, vmw); return TRUE; @@ -64,6 +112,8 @@ vmw_screen_close(ScrnInfoPtr pScrn) if (!vmw) return TRUE; + vmw_screen_cursor_close(pScrn, vmw); + vmw_video_close(pScrn, vmw); ms->winsys_priv = NULL; -- cgit v1.2.3 From 1ef8c493b25cdb4bb006f9198c00acacd19e2c75 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 10:31:51 +0100 Subject: vmware/xorg: Use Write instead of WriteRead for cursor bypass --- src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c index 7ec651db05d..ad6993840d2 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -65,8 +65,8 @@ vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot) arg.xhot = xhot; arg.yhot = yhot; - ret = drmCommandWriteRead(vmw->fd, DRM_VMW_CURSOR_BYPASS, - &arg, sizeof(arg)); + ret = drmCommandWrite(vmw->fd, DRM_VMW_CURSOR_BYPASS, + &arg, sizeof(arg)); return ret; } -- cgit v1.2.3 From a4b3bb12d7627a0bb39dd625e7646c9ef9ccd7fb Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 4 Dec 2009 11:49:42 +0000 Subject: softpipe: fix double-minify in texture layout --- src/gallium/drivers/softpipe/sp_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/softpipe/sp_texture.c b/src/gallium/drivers/softpipe/sp_texture.c index bd653216c08..4f946ccfcf8 100644 --- a/src/gallium/drivers/softpipe/sp_texture.c +++ b/src/gallium/drivers/softpipe/sp_texture.c @@ -67,7 +67,7 @@ softpipe_texture_layout(struct pipe_screen *screen, spt->level_offset[level] = buffer_size; - buffer_size += (pf_get_nblocksy(pt->format, u_minify(height, level)) * + buffer_size += (pf_get_nblocksy(pt->format, height) * ((pt->target == PIPE_TEXTURE_CUBE) ? 6 : depth) * spt->stride[level]); -- cgit v1.2.3 From 6bb415f862fec94b82915f806beb3a7427bd4bb8 Mon Sep 17 00:00:00 2001 From: Keith Whitwell Date: Fri, 4 Dec 2009 14:15:21 +0000 Subject: softpipe: dont claim to support PIPE_FORMAT_NONE --- src/gallium/drivers/softpipe/sp_screen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/softpipe/sp_screen.c b/src/gallium/drivers/softpipe/sp_screen.c index 6bf3df8e6ad..bd3532de4f4 100644 --- a/src/gallium/drivers/softpipe/sp_screen.c +++ b/src/gallium/drivers/softpipe/sp_screen.c @@ -149,6 +149,7 @@ softpipe_is_format_supported( struct pipe_screen *screen, case PIPE_FORMAT_B6UG5SR5S_NORM: case PIPE_FORMAT_X8UB8UG8SR8S_NORM: case PIPE_FORMAT_A8B8G8R8_SNORM: + case PIPE_FORMAT_NONE: return FALSE; default: return TRUE; -- cgit v1.2.3 From 8d8fd9776e23a34e0d22e489ce1f85eb5e383121 Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Fri, 4 Dec 2009 09:52:37 -0500 Subject: radeon: fix polygon stipple fixes fdo bug 25354 Signed-off-by: Alex Deucher --- src/mesa/drivers/dri/radeon/radeon_common.c | 23 ----------------------- src/mesa/drivers/dri/radeon/radeon_common.h | 1 - src/mesa/drivers/dri/radeon/radeon_context.h | 4 ++++ src/mesa/drivers/dri/radeon/radeon_state.c | 25 +++++++++++++++++++++++++ 4 files changed, 29 insertions(+), 24 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 8032cbcd695..5b2bcfdb24d 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -262,29 +262,6 @@ void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h) } } -void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ) -{ - radeonContextPtr radeon = RADEON_CONTEXT(ctx); - GLuint i; - drm_radeon_stipple_t stipple; - - /* Must flip pattern upside down. - */ - for ( i = 0 ; i < 32 ; i++ ) { - stipple.mask[31 - i] = ((GLuint *) mask)[i]; - } - - /* TODO: push this into cmd mechanism - */ - radeon_firevertices(radeon); - LOCK_HARDWARE( radeon ); - - drmCommandWrite( radeon->dri.fd, DRM_RADEON_STIPPLE, - &stipple, sizeof(stipple) ); - UNLOCK_HARDWARE( radeon ); -} - - /* ================================================================ * SwapBuffers with client-side throttling */ diff --git a/src/mesa/drivers/dri/radeon/radeon_common.h b/src/mesa/drivers/dri/radeon/radeon_common.h index f3201911ac6..a9e1ca49eb9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.h +++ b/src/mesa/drivers/dri/radeon/radeon_common.h @@ -10,7 +10,6 @@ void radeonRecalcScissorRects(radeonContextPtr radeon); void radeonSetCliprects(radeonContextPtr radeon); void radeonUpdateScissor( GLcontext *ctx ); void radeonScissor(GLcontext* ctx, GLint x, GLint y, GLsizei w, GLsizei h); -void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ); void radeonWaitForIdleLocked(radeonContextPtr radeon); extern uint32_t radeonGetAge(radeonContextPtr radeon); diff --git a/src/mesa/drivers/dri/radeon/radeon_context.h b/src/mesa/drivers/dri/radeon/radeon_context.h index 4e2c52c835c..12ab33a009c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_context.h @@ -331,8 +331,12 @@ struct r100_hw_state { struct radeon_state_atom stp; }; +struct radeon_stipple_state { + GLuint mask[32]; +}; struct r100_state { + struct radeon_stipple_state stipple; struct radeon_texture_state texture; }; diff --git a/src/mesa/drivers/dri/radeon/radeon_state.c b/src/mesa/drivers/dri/radeon/radeon_state.c index 4d0d35ee0cd..f6c733ab209 100644 --- a/src/mesa/drivers/dri/radeon/radeon_state.c +++ b/src/mesa/drivers/dri/radeon/radeon_state.c @@ -550,6 +550,31 @@ static void radeonPolygonOffset( GLcontext *ctx, rmesa->hw.zbs.cmd[ZBS_SE_ZBIAS_CONSTANT] = constant.ui32; } +static void radeonPolygonStipplePreKMS( GLcontext *ctx, const GLubyte *mask ) +{ + r100ContextPtr rmesa = R100_CONTEXT(ctx); + GLuint i; + drm_radeon_stipple_t stipple; + + /* Must flip pattern upside down. + */ + for ( i = 0 ; i < 32 ; i++ ) { + rmesa->state.stipple.mask[31 - i] = ((GLuint *) mask)[i]; + } + + /* TODO: push this into cmd mechanism + */ + radeon_firevertices(&rmesa->radeon); + LOCK_HARDWARE( &rmesa->radeon ); + + /* FIXME: Use window x,y offsets into stipple RAM. + */ + stipple.mask = rmesa->state.stipple.mask; + drmCommandWrite( rmesa->radeon.dri.fd, DRM_RADEON_STIPPLE, + &stipple, sizeof(drm_radeon_stipple_t) ); + UNLOCK_HARDWARE( &rmesa->radeon ); +} + static void radeonPolygonMode( GLcontext *ctx, GLenum face, GLenum mode ) { r100ContextPtr rmesa = R100_CONTEXT(ctx); -- cgit v1.2.3 From fb83fa26c47a49db1673834fd5f013bbcacadf58 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 4 Dec 2009 08:09:07 -0700 Subject: docs: a few more fixes for 7.6.1 --- docs/relnotes-7.6.1.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index d155cf5a673..752f9cac643 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -56,6 +56,8 @@ tbd
  • Fixed clipping / provoking vertex bugs in i965 driver.
  • Assorted build fixes for AIX.
  • Endianness fixes for the DRI swrast driver (bug 22767).
  • +
  • Point sprite fixes for i915/945 driver. +
  • Fixed assorted memory leaks (usually on error paths)

    Changes

    -- cgit v1.2.3 From ca7cd3ade0f27f8f1d9532ad6281659e2522f0cf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 4 Dec 2009 08:09:55 -0700 Subject: progs/xdemos: fix some visual/fbconfig logic in glxinfo.c The fbAttribSingle/Double arrays had wrong GLX_DOUBLEBUFFER values. We only need to use the glXChooseFBConfig() code when glXChooseVisual() fails (but I don't know when that would happen). Other recent commits errantly removed some code in this area too. --- progs/xdemos/glxinfo.c | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/progs/xdemos/glxinfo.c b/progs/xdemos/glxinfo.c index b182a3091d1..23df82f6f90 100644 --- a/progs/xdemos/glxinfo.c +++ b/progs/xdemos/glxinfo.c @@ -401,6 +401,10 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) root = RootWindow(dpy, scrnum); + /* + * Find a basic GLX visual. We'll then create a rendering context and + * query various info strings. + */ visinfo = glXChooseVisual(dpy, scrnum, attribSingle); if (!visinfo) visinfo = glXChooseVisual(dpy, scrnum, attribDouble); @@ -409,24 +413,29 @@ print_screen_info(Display *dpy, int scrnum, Bool allowDirect, GLboolean limits) ctx = glXCreateContext( dpy, visinfo, NULL, allowDirect ); #ifdef GLX_VERSION_1_3 - { + /* Try glXChooseFBConfig() if glXChooseVisual didn't work. + * XXX when would that happen? + */ + if (!visinfo) { int fbAttribSingle[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, - GLX_DOUBLEBUFFER, GL_TRUE, + GLX_DOUBLEBUFFER, GL_FALSE, None }; int fbAttribDouble[] = { GLX_RENDER_TYPE, GLX_RGBA_BIT, GLX_RED_SIZE, 1, GLX_GREEN_SIZE, 1, GLX_BLUE_SIZE, 1, + GLX_DOUBLEBUFFER, GL_TRUE, None }; GLXFBConfig *configs = NULL; int nConfigs; - if (!visinfo) + configs = glXChooseFBConfig(dpy, scrnum, fbAttribSingle, &nConfigs); + if (!configs) configs = glXChooseFBConfig(dpy, scrnum, fbAttribDouble, &nConfigs); if (configs) { -- cgit v1.2.3 From 225bc70b77fcf107dd8abc93be27a15c27743071 Mon Sep 17 00:00:00 2001 From: Coleman Kane Date: Fri, 4 Dec 2009 08:44:57 -0700 Subject: r300g: use $(MAKE) variable Fixes bug 24501 --- src/gallium/drivers/r300/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index d7a2c8c462c..8d0c6e33bb1 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -38,4 +38,4 @@ include ../../Makefile.template .PHONY : $(COMPILER_ARCHIVE) $(COMPILER_ARCHIVE): - cd $(TOP)/src/mesa/drivers/dri/r300/compiler; make + $(MAKE) -C $(TOP)/src/mesa/drivers/dri/r300/compiler -- cgit v1.2.3 From d5b94b49f602386b75630e73db775a68c72fdf46 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:13:57 +0100 Subject: st/xorg: New libkms destroy api --- src/gallium/state_trackers/xorg/xorg_crtc.c | 4 ++-- src/gallium/state_trackers/xorg/xorg_driver.c | 8 +++----- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index ddcaedde37e..be9fcbc7130 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -257,7 +257,7 @@ crtc_load_cursor_argb_kms(xf86CrtcPtr crtc, CARD32 * image) return; err_bo_destroy: - kms_bo_destroy(crtcp->cursor_bo); + kms_bo_destroy(&crtcp->cursor_bo); } #endif @@ -305,7 +305,7 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc) pipe_texture_reference(&crtcp->cursor_tex, NULL); #ifdef HAVE_LIBKMS if (crtcp->cursor_bo) - kms_bo_destroy(crtcp->cursor_bo); + kms_bo_destroy(&crtcp->cursor_bo); #endif xfree(crtcp); diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index da86295c316..22db8bb3c89 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -260,8 +260,7 @@ drv_close_resource_management(ScrnInfoPtr pScrn) #ifdef HAVE_LIBKMS if (ms->kms) - kms_destroy(ms->kms); - ms->kms = NULL; + kms_destroy(&ms->kms); #endif return TRUE; @@ -898,8 +897,7 @@ drv_destroy_front_buffer_kms(ScrnInfoPtr pScrn) return TRUE; kms_bo_unmap(ms->root_bo); - kms_bo_destroy(ms->root_bo); - ms->root_bo = NULL; + kms_bo_destroy(&ms->root_bo); return TRUE; } @@ -945,7 +943,7 @@ drv_create_front_buffer_kms(ScrnInfoPtr pScrn) return TRUE; err_destroy: - kms_bo_destroy(bo); + kms_bo_destroy(&bo); return FALSE; } -- cgit v1.2.3 From c33520b360780bce496b00516384e25a0908e43c Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:05:03 +0100 Subject: st/xorg: Fix leave enter vt cycle in crtc code --- src/gallium/state_trackers/xorg/xorg_crtc.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_crtc.c b/src/gallium/state_trackers/xorg/xorg_crtc.c index be9fcbc7130..337449a7451 100644 --- a/src/gallium/state_trackers/xorg/xorg_crtc.c +++ b/src/gallium/state_trackers/xorg/xorg_crtc.c @@ -307,8 +307,6 @@ xorg_crtc_cursor_destroy(xf86CrtcPtr crtc) if (crtcp->cursor_bo) kms_bo_destroy(&crtcp->cursor_bo); #endif - - xfree(crtcp); } /* @@ -320,11 +318,12 @@ crtc_destroy(xf86CrtcPtr crtc) { struct crtc_private *crtcp = crtc->driver_private; - if (crtcp->cursor_tex) - pipe_texture_reference(&crtcp->cursor_tex, NULL); + xorg_crtc_cursor_destroy(crtc); drmModeFreeCrtc(crtcp->drm_crtc); + xfree(crtcp); + crtc->driver_private = NULL; } static const xf86CrtcFuncsRec crtc_funcs = { -- cgit v1.2.3 From f2e3fc18141d29ede2b711d7ddbb225145be35e3 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:22:48 +0100 Subject: st/xorg: Add enter/leave vt hooks for winsys --- src/gallium/state_trackers/xorg/xorg_driver.c | 6 ++++++ src/gallium/state_trackers/xorg/xorg_tracker.h | 2 ++ 2 files changed, 8 insertions(+) diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c index 22db8bb3c89..53915958914 100644 --- a/src/gallium/state_trackers/xorg/xorg_driver.c +++ b/src/gallium/state_trackers/xorg/xorg_driver.c @@ -687,6 +687,9 @@ drv_leave_vt(int scrnIndex, int flags) xf86CrtcConfigPtr config = XF86_CRTC_CONFIG_PTR(pScrn); int o; + if (ms->winsys_leave_vt) + ms->winsys_leave_vt(pScrn); + for (o = 0; o < config->num_crtc; o++) { xf86CrtcPtr crtc = config->crtc[o]; @@ -749,6 +752,9 @@ drv_enter_vt(int scrnIndex, int flags) if (!xf86SetDesiredModes(pScrn)) return FALSE; + if (ms->winsys_enter_vt) + ms->winsys_enter_vt(pScrn); + return TRUE; } diff --git a/src/gallium/state_trackers/xorg/xorg_tracker.h b/src/gallium/state_trackers/xorg/xorg_tracker.h index d5fc18448ef..c0cfbe60616 100644 --- a/src/gallium/state_trackers/xorg/xorg_tracker.h +++ b/src/gallium/state_trackers/xorg/xorg_tracker.h @@ -117,6 +117,8 @@ typedef struct _modesettingRec /* winsys hocks */ Bool (*winsys_screen_init)(ScrnInfoPtr pScr); Bool (*winsys_screen_close)(ScrnInfoPtr pScr); + Bool (*winsys_enter_vt)(ScrnInfoPtr pScr); + Bool (*winsys_leave_vt)(ScrnInfoPtr pScr); void *winsys_priv; #ifdef DRM_MODE_FEATURE_DIRTYFB -- cgit v1.2.3 From 124f4bc97712acfe7d08807b013a101a4d6276e1 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:25:59 +0100 Subject: vmware/xorg: Stop video ports on leave vt --- src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 2 ++ src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 22 +++++++++++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 32 +++++++++++++++++++++++++ 3 files changed, 56 insertions(+) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h index db6b89b8bcd..85c21ca60e3 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -66,6 +66,8 @@ Bool vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw); Bool vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw); +void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw); + /*********************************************************************** * vmw_ioctl.c diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 18cb509189a..7c9757cce95 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -124,6 +124,26 @@ vmw_screen_close(ScrnInfoPtr pScrn) return TRUE; } +static Bool +vmw_screen_enter_vt(ScrnInfoPtr pScrn) +{ + debug_printf("%s: enter\n", __func__); + + return TRUE; +} + +static Bool +vmw_screen_leave_vt(ScrnInfoPtr pScrn) +{ + struct vmw_driver *vmw = vmw_driver(pScrn); + + debug_printf("%s: enter\n", __func__); + + vmw_video_stop_all(pScrn, vmw); + + return TRUE; +} + /* * Functions for setting up hooks into the xorg state tracker */ @@ -142,6 +162,8 @@ vmw_screen_pre_init(ScrnInfoPtr pScrn, int flags) ms = modesettingPTR(pScrn); ms->winsys_screen_init = vmw_screen_init; ms->winsys_screen_close = vmw_screen_close; + ms->winsys_enter_vt = vmw_screen_enter_vt; + ms->winsys_leave_vt = vmw_screen_leave_vt; return TRUE; } diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c index d62c3b7296f..ef1e2f1e731 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -358,6 +358,38 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) } +/* + *----------------------------------------------------------------------------- + * + * vmw_video_stop_all -- + * + * Stop all video streams from playing. + * + * Results: + * None. + * + * Side effects: + * All buffers are freed. + * + *----------------------------------------------------------------------------- + */ + +void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw) +{ + struct vmw_video_private *video = vmw->video_priv; + int i; + + debug_printf("%s: enter\n", __func__); + + if (!video) + return; + + for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { + vmw_xv_stop_video(pScrn, &video->port[i], TRUE); + } +} + + /* *----------------------------------------------------------------------------- * -- cgit v1.2.3 From 6f1db18f148b9014af80abe0524827f1cb3ec013 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Fri, 4 Dec 2009 16:44:18 +0100 Subject: vmware/xorg: Also stop ports on close --- src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c index ef1e2f1e731..b99bb2f7e34 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -346,7 +346,8 @@ vmw_video_close(ScrnInfoPtr pScrn, struct vmw_driver *vmw) return TRUE; for (i = 0; i < VMWARE_VID_NUM_PORTS; ++i) { - vmw_video_port_cleanup(pScrn, &video->port[i]); + /* make sure the port is stoped as well */ + vmw_xv_stop_video(pScrn, &video->port[i], TRUE); } /* XXX: I'm sure this function is missing code for turning off Xv */ -- cgit v1.2.3 From c977dd9c7716b0a086eeb0c07f2da148065c3b18 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 4 Dec 2009 18:23:35 +0100 Subject: svga: fix another pipe_reference strict aliasing violation --- src/gallium/drivers/svga/svga_screen_buffer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_screen_buffer.c b/src/gallium/drivers/svga/svga_screen_buffer.c index 1f8a8896723..58a1aba464b 100644 --- a/src/gallium/drivers/svga/svga_screen_buffer.c +++ b/src/gallium/drivers/svga/svga_screen_buffer.c @@ -356,7 +356,8 @@ svga_buffer_upload_flush(struct svga_context *svga, sbuf->hw.boxes = NULL; /* Decrement reference count */ - pipe_buffer_reference((struct pipe_buffer **)&sbuf, NULL); + pipe_reference(&(sbuf->base.reference), NULL); + sbuf = NULL; } -- cgit v1.2.3 From 3da8265cd3233e2b22ab0f8a28fbba892984e399 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 4 Dec 2009 16:06:16 +0100 Subject: r300g: fix warnings --- src/gallium/drivers/r300/r300_context.c | 4 ++-- src/gallium/drivers/r300/r300_winsys.h | 2 ++ src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 2 ++ 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 68a17dcb63d..5b337f03ac4 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -36,8 +36,8 @@ #include "r300_screen.h" #include "r300_state_derived.h" #include "r300_state_invariant.h" - -#include "radeon_winsys.h" +#include "r300_texture.h" +#include "r300_winsys.h" static enum pipe_error r300_clear_hash_table(void* key, void* value, void* data) diff --git a/src/gallium/drivers/r300/r300_winsys.h b/src/gallium/drivers/r300/r300_winsys.h index f86985841f3..1ae6de70fee 100644 --- a/src/gallium/drivers/r300/r300_winsys.h +++ b/src/gallium/drivers/r300/r300_winsys.h @@ -35,6 +35,8 @@ extern "C" { #include "pipe/p_state.h" #include "pipe/internal/p_winsys_screen.h" +#include "radeon_winsys.h" + struct pipe_context* r300_create_context(struct pipe_screen* screen, struct radeon_winsys* radeon_winsys); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 65f7babff2d..0ca7b392554 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -35,7 +35,9 @@ #include "radeon_bo_gem.h" #include "softpipe/sp_texture.h" #include "r300_context.h" +#include "util/u_math.h" #include + struct radeon_vl_context { Display *display; -- cgit v1.2.3 From 7679447b5835fd73ab44b3d77b12a034c95af5c5 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 2 Dec 2009 17:15:27 +0100 Subject: r300g, radeong: fix the CS overflow --- src/gallium/drivers/r300/r300_cs.h | 2 +- src/gallium/drivers/r300/r300_emit.c | 9 ++++++++- src/gallium/winsys/drm/radeon/core/radeon_r300.c | 5 +++-- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 8b100375fdf..9fcf3ab538c 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -55,7 +55,7 @@ int cs_count = 0; #define CHECK_CS(size) \ - cs_winsys->check_cs(cs_winsys, (size)) + assert(cs_winsys->check_cs(cs_winsys, (size))) #define BEGIN_CS(size) do { \ CHECK_CS(size); \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index a479842f9eb..3bb42f9e434 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -871,10 +871,17 @@ void r300_emit_dirty_state(struct r300_context* r300) return; } + /* Check size of CS. */ + /* Make sure we have at least 8*1024 spare dwords. */ + /* XXX It would be nice to know the number of dwords we really need to + * XXX emit. */ + if (!r300->winsys->check_cs(r300->winsys, 8*1024)) { + r300->context.flush(&r300->context, 0, NULL); + } + /* Clean out BOs. */ r300->winsys->reset_bos(r300->winsys); - /* XXX check size */ validate: /* Color buffers... */ for (i = 0; i < r300->framebuffer_state.nr_cbufs; i++) { diff --git a/src/gallium/winsys/drm/radeon/core/radeon_r300.c b/src/gallium/winsys/drm/radeon/core/radeon_r300.c index 7362279b77a..ba0596c30dc 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_r300.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_r300.c @@ -52,8 +52,9 @@ static boolean radeon_validate(struct radeon_winsys* winsys) static boolean radeon_check_cs(struct radeon_winsys* winsys, int size) { - /* XXX check size here, lazy ass! */ - return radeon_validate(winsys); + struct radeon_cs* cs = winsys->priv->cs; + + return radeon_validate(winsys) && cs->cdw + size <= cs->ndw; } static void radeon_begin_cs(struct radeon_winsys* winsys, -- cgit v1.2.3 From 042b524d48ebb15215430149b9b1653f4b46dee3 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Fri, 4 Dec 2009 15:54:29 +0100 Subject: radeong: flush CS if a buffer being mapped is referenced by it Also, overlapping occlusion queries seems to work now. --- src/gallium/drivers/r300/r300_emit.c | 2 -- src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 3bb42f9e434..60be03f54fc 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -382,8 +382,6 @@ static void r300_emit_query_start(struct r300_context *r300) if (!query) return; - /* XXX This will almost certainly not return good results - * for overlapping queries. */ BEGIN_CS(4); if (caps->family == CHIP_FAMILY_RV530) { OUT_CS_REG(RV530_FG_ZBREG_DEST, RV530_FG_ZBREG_DEST_PIPE_SELECT_ALL); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 0ca7b392554..2a8daed051d 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -140,10 +140,15 @@ static void *radeon_buffer_map(struct pipe_winsys *ws, struct pipe_buffer *buffer, unsigned flags) { + struct radeon_winsys_priv *priv = ((struct radeon_winsys *)ws)->priv; struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; int write = 0; + if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) { + priv->cs->space_flush_fn(priv->cs->space_flush_data); + } + if (flags & PIPE_BUFFER_USAGE_DONTBLOCK) { uint32_t domain; -- cgit v1.2.3 From 7d9b2edb97419b562a542b5cd701724c009421d4 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 4 Dec 2009 18:34:52 +0100 Subject: identity: fix copy&paste error --- src/gallium/drivers/identity/id_context.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/identity/id_context.c b/src/gallium/drivers/identity/id_context.c index 4509c7b1e5c..bedab56f59e 100644 --- a/src/gallium/drivers/identity/id_context.c +++ b/src/gallium/drivers/identity/id_context.c @@ -742,7 +742,7 @@ identity_context_create(struct pipe_screen *_screen, struct pipe_context *pipe) id_pipe->base.set_polygon_stipple = identity_set_polygon_stipple; id_pipe->base.set_scissor_state = identity_set_scissor_state; id_pipe->base.set_viewport_state = identity_set_viewport_state; - id_pipe->base.set_fragment_sampler_textures = identity_set_vertex_sampler_textures; + id_pipe->base.set_fragment_sampler_textures = identity_set_fragment_sampler_textures; id_pipe->base.set_vertex_sampler_textures = identity_set_vertex_sampler_textures; id_pipe->base.set_vertex_buffers = identity_set_vertex_buffers; id_pipe->base.set_vertex_elements = identity_set_vertex_elements; -- cgit v1.2.3 From 818fd6b10182931a0727819f275f7f1686df09f5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 4 Dec 2009 12:02:22 +0000 Subject: gallium: Disable force_align_arg_pointer attribute on x86_64. Apparently not only unnecessary but also causes gcc to complain. --- src/gallium/include/pipe/p_compiler.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h index c36286f9bee..f7368bb95b3 100644 --- a/src/gallium/include/pipe/p_compiler.h +++ b/src/gallium/include/pipe/p_compiler.h @@ -167,7 +167,7 @@ typedef unsigned char boolean; #define ALIGN16_ASSIGN(NAME) NAME##___aligned #define ALIGN16_ATTRIB __attribute__(( aligned( 16 ) )) #define ALIGN8_ATTRIB __attribute__(( aligned( 8 ) )) -#if __GNUC__ > 4 || (__GNUC__ == 4 &&__GNUC_MINOR__>1) +#if (__GNUC__ > 4 || (__GNUC__ == 4 &&__GNUC_MINOR__>1)) && !defined(PIPE_ARCH_X86_64) #define ALIGN_STACK __attribute__((force_align_arg_pointer)) #else #define ALIGN_STACK -- cgit v1.2.3 From b00b06b6e486a87dd88a695ae122863df13ad84e Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 4 Dec 2009 18:59:24 +0000 Subject: llvmpipe: Remove debug printf. --- src/gallium/drivers/llvmpipe/lp_tex_cache.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_tex_cache.c b/src/gallium/drivers/llvmpipe/lp_tex_cache.c index 5dbc597d2c9..a6d9a2c1acf 100644 --- a/src/gallium/drivers/llvmpipe/lp_tex_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tex_cache.c @@ -155,7 +155,6 @@ lp_tex_tile_cache_validate_texture(struct llvmpipe_tex_tile_cache *tc) if (lpt->timestamp != tc->timestamp) { /* texture was modified, invalidate all cached tiles */ uint i; - debug_printf("INV %d %d\n", tc->timestamp, lpt->timestamp); for (i = 0; i < NUM_ENTRIES; i++) { tc->entries[i].addr.bits.invalid = 1; } -- cgit v1.2.3 From a312e76468435fc1eb7ec5fe0a98601a7fdfec53 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 4 Dec 2009 21:16:14 +0000 Subject: llvmpipe: Ensure transfers are mapped. This shouldn't happen but it does by some misterious reason. Fail the assertion but at least do not segfault on release builds. --- src/gallium/drivers/llvmpipe/lp_tile_cache.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index 50891c42271..e83210f93bc 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -290,6 +290,10 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc, assert(tc->surface); assert(tc->transfer); + assert(tc->transfer_map); + + if(!tc->transfer_map) + lp_tile_cache_map_transfers(tc); switch(tile->status) { case LP_TILE_STATUS_CLEAR: -- cgit v1.2.3 From c0a13bbae15a471fea278e37b92b874fed1f6b3b Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 4 Dec 2009 21:25:40 +0000 Subject: llvmpipe: Port vertex sampler support from softpipe. Just enough boilerplate code to avoid segfaulting. --- src/gallium/drivers/llvmpipe/lp_context.c | 20 +++++++-- src/gallium/drivers/llvmpipe/lp_context.h | 5 +++ src/gallium/drivers/llvmpipe/lp_screen.c | 4 +- src/gallium/drivers/llvmpipe/lp_state.h | 9 ++++ src/gallium/drivers/llvmpipe/lp_state_derived.c | 12 +++-- src/gallium/drivers/llvmpipe/lp_state_sampler.c | 59 +++++++++++++++++++++++++ 6 files changed, 101 insertions(+), 8 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_context.c b/src/gallium/drivers/llvmpipe/lp_context.c index c081f6de036..679e2442743 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.c +++ b/src/gallium/drivers/llvmpipe/lp_context.c @@ -118,6 +118,11 @@ static void llvmpipe_destroy( struct pipe_context *pipe ) pipe_texture_reference(&llvmpipe->texture[i], NULL); } + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { + lp_destroy_tex_tile_cache(llvmpipe->vertex_tex_cache[i]); + pipe_texture_reference(&llvmpipe->vertex_textures[i], NULL); + } + for (i = 0; i < Elements(llvmpipe->constants); i++) { if (llvmpipe->constants[i].buffer) { pipe_buffer_reference(&llvmpipe->constants[i].buffer, NULL); @@ -145,6 +150,11 @@ llvmpipe_is_texture_referenced( struct pipe_context *pipe, llvmpipe->framebuffer.zsbuf->texture == texture) return PIPE_REFERENCED_FOR_WRITE; } + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { + if (llvmpipe->vertex_tex_cache[i] && + llvmpipe->vertex_tex_cache[i]->texture == texture) + return PIPE_REFERENCED_FOR_READ; + } return PIPE_UNREFERENCED; } @@ -181,6 +191,7 @@ llvmpipe_create( struct pipe_screen *screen ) llvmpipe->pipe.create_sampler_state = llvmpipe_create_sampler_state; llvmpipe->pipe.bind_fragment_sampler_states = llvmpipe_bind_sampler_states; + llvmpipe->pipe.bind_vertex_sampler_states = llvmpipe_bind_vertex_sampler_states; llvmpipe->pipe.delete_sampler_state = llvmpipe_delete_sampler_state; llvmpipe->pipe.create_depth_stencil_alpha_state = llvmpipe_create_depth_stencil_state; @@ -206,6 +217,7 @@ llvmpipe_create( struct pipe_screen *screen ) llvmpipe->pipe.set_polygon_stipple = llvmpipe_set_polygon_stipple; llvmpipe->pipe.set_scissor_state = llvmpipe_set_scissor_state; llvmpipe->pipe.set_fragment_sampler_textures = llvmpipe_set_sampler_textures; + llvmpipe->pipe.set_vertex_sampler_textures = llvmpipe_set_vertex_sampler_textures; llvmpipe->pipe.set_viewport_state = llvmpipe_set_viewport_state; llvmpipe->pipe.set_vertex_buffers = llvmpipe_set_vertex_buffers; @@ -234,13 +246,15 @@ llvmpipe_create( struct pipe_screen *screen ) for (i = 0; i < PIPE_MAX_SAMPLERS; i++) llvmpipe->tex_cache[i] = lp_create_tex_tile_cache( screen ); + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) + llvmpipe->vertex_tex_cache[i] = lp_create_tex_tile_cache(screen); /* vertex shader samplers */ - for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { llvmpipe->tgsi.vert_samplers[i].base.get_samples = lp_get_samples; llvmpipe->tgsi.vert_samplers[i].processor = TGSI_PROCESSOR_VERTEX; - llvmpipe->tgsi.vert_samplers[i].cache = llvmpipe->tex_cache[i]; + llvmpipe->tgsi.vert_samplers[i].cache = llvmpipe->vertex_tex_cache[i]; llvmpipe->tgsi.vert_samplers_list[i] = &llvmpipe->tgsi.vert_samplers[i]; } @@ -260,7 +274,7 @@ llvmpipe_create( struct pipe_screen *screen ) goto fail; draw_texture_samplers(llvmpipe->draw, - PIPE_MAX_SAMPLERS, + PIPE_MAX_VERTEX_SAMPLERS, (struct tgsi_sampler **) llvmpipe->tgsi.vert_samplers_list); diff --git a/src/gallium/drivers/llvmpipe/lp_context.h b/src/gallium/drivers/llvmpipe/lp_context.h index 3ad95d0bfc2..cc4d5ad5fd9 100644 --- a/src/gallium/drivers/llvmpipe/lp_context.h +++ b/src/gallium/drivers/llvmpipe/lp_context.h @@ -55,6 +55,7 @@ struct llvmpipe_context { /** Constant state objects */ const struct pipe_blend_state *blend; const struct pipe_sampler_state *sampler[PIPE_MAX_SAMPLERS]; + struct pipe_sampler_state *vertex_samplers[PIPE_MAX_VERTEX_SAMPLERS]; const struct pipe_depth_stencil_alpha_state *depth_stencil; const struct pipe_rasterizer_state *rasterizer; struct lp_fragment_shader *fs; @@ -68,12 +69,15 @@ struct llvmpipe_context { struct pipe_poly_stipple poly_stipple; struct pipe_scissor_state scissor; struct pipe_texture *texture[PIPE_MAX_SAMPLERS]; + struct pipe_texture *vertex_textures[PIPE_MAX_VERTEX_SAMPLERS]; struct pipe_viewport_state viewport; struct pipe_vertex_buffer vertex_buffer[PIPE_MAX_ATTRIBS]; struct pipe_vertex_element vertex_element[PIPE_MAX_ATTRIBS]; unsigned num_samplers; unsigned num_textures; + unsigned num_vertex_samplers; + unsigned num_vertex_textures; unsigned num_vertex_elements; unsigned num_vertex_buffers; @@ -136,6 +140,7 @@ struct llvmpipe_context { unsigned tex_timestamp; struct llvmpipe_tex_tile_cache *tex_cache[PIPE_MAX_SAMPLERS]; + struct llvmpipe_tex_tile_cache *vertex_tex_cache[PIPE_MAX_VERTEX_SAMPLERS]; unsigned no_rast : 1; diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index a6ecaa0b2be..19fe2850fd1 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -59,7 +59,9 @@ llvmpipe_get_param(struct pipe_screen *screen, int param) case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return PIPE_MAX_SAMPLERS; case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: - return 0; + return PIPE_MAX_VERTEX_SAMPLERS; + case PIPE_CAP_MAX_COMBINED_SAMPLERS: + return PIPE_MAX_SAMPLERS + PIPE_MAX_VERTEX_SAMPLERS; case PIPE_CAP_NPOT_TEXTURES: return 1; case PIPE_CAP_TWO_SIDED_STENCIL: diff --git a/src/gallium/drivers/llvmpipe/lp_state.h b/src/gallium/drivers/llvmpipe/lp_state.h index 7b26ce61a38..d1c74ab07b5 100644 --- a/src/gallium/drivers/llvmpipe/lp_state.h +++ b/src/gallium/drivers/llvmpipe/lp_state.h @@ -126,6 +126,10 @@ void * llvmpipe_create_sampler_state(struct pipe_context *, const struct pipe_sampler_state *); void llvmpipe_bind_sampler_states(struct pipe_context *, unsigned, void **); +void +llvmpipe_bind_vertex_sampler_states(struct pipe_context *, + unsigned num_samplers, + void **samplers); void llvmpipe_delete_sampler_state(struct pipe_context *, void *); void * @@ -172,6 +176,11 @@ void llvmpipe_set_sampler_textures( struct pipe_context *, unsigned num, struct pipe_texture ** ); +void +llvmpipe_set_vertex_sampler_textures(struct pipe_context *, + unsigned num_textures, + struct pipe_texture **); + void llvmpipe_set_viewport_state( struct pipe_context *, const struct pipe_viewport_state * ); diff --git a/src/gallium/drivers/llvmpipe/lp_state_derived.c b/src/gallium/drivers/llvmpipe/lp_state_derived.c index c753b183c0c..e703964aaa8 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_derived.c +++ b/src/gallium/drivers/llvmpipe/lp_state_derived.c @@ -198,10 +198,14 @@ update_tgsi_samplers( struct llvmpipe_context *llvmpipe ) unsigned i; /* vertex shader samplers */ - for (i = 0; i < PIPE_MAX_SAMPLERS; i++) { - llvmpipe->tgsi.vert_samplers[i].sampler = llvmpipe->sampler[i]; - llvmpipe->tgsi.vert_samplers[i].texture = llvmpipe->texture[i]; - llvmpipe->tgsi.frag_samplers[i].base.get_samples = lp_get_samples; + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { + llvmpipe->tgsi.vert_samplers[i].sampler = llvmpipe->vertex_samplers[i]; + llvmpipe->tgsi.vert_samplers[i].texture = llvmpipe->vertex_textures[i]; + llvmpipe->tgsi.vert_samplers[i].base.get_samples = lp_get_samples; + } + + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { + lp_tex_tile_cache_validate_texture( llvmpipe->vertex_tex_cache[i] ); } /* fragment shader samplers */ diff --git a/src/gallium/drivers/llvmpipe/lp_state_sampler.c b/src/gallium/drivers/llvmpipe/lp_state_sampler.c index 8333805a3fd..d382f9ca87e 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_sampler.c +++ b/src/gallium/drivers/llvmpipe/lp_state_sampler.c @@ -77,6 +77,34 @@ llvmpipe_bind_sampler_states(struct pipe_context *pipe, } +void +llvmpipe_bind_vertex_sampler_states(struct pipe_context *pipe, + unsigned num_samplers, + void **samplers) +{ + struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); + unsigned i; + + assert(num_samplers <= PIPE_MAX_VERTEX_SAMPLERS); + + /* Check for no-op */ + if (num_samplers == llvmpipe->num_vertex_samplers && + !memcmp(llvmpipe->vertex_samplers, samplers, num_samplers * sizeof(void *))) + return; + + draw_flush(llvmpipe->draw); + + for (i = 0; i < num_samplers; ++i) + llvmpipe->vertex_samplers[i] = samplers[i]; + for (i = num_samplers; i < PIPE_MAX_VERTEX_SAMPLERS; ++i) + llvmpipe->vertex_samplers[i] = NULL; + + llvmpipe->num_vertex_samplers = num_samplers; + + llvmpipe->dirty |= LP_NEW_SAMPLER; +} + + void llvmpipe_set_sampler_textures(struct pipe_context *pipe, unsigned num, struct pipe_texture **texture) @@ -116,6 +144,37 @@ llvmpipe_set_sampler_textures(struct pipe_context *pipe, } +void +llvmpipe_set_vertex_sampler_textures(struct pipe_context *pipe, + unsigned num_textures, + struct pipe_texture **textures) +{ + struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); + uint i; + + assert(num_textures <= PIPE_MAX_VERTEX_SAMPLERS); + + /* Check for no-op */ + if (num_textures == llvmpipe->num_vertex_textures && + !memcmp(llvmpipe->vertex_textures, textures, num_textures * sizeof(struct pipe_texture *))) { + return; + } + + draw_flush(llvmpipe->draw); + + for (i = 0; i < PIPE_MAX_VERTEX_SAMPLERS; i++) { + struct pipe_texture *tex = i < num_textures ? textures[i] : NULL; + + pipe_texture_reference(&llvmpipe->vertex_textures[i], tex); + lp_tex_tile_cache_set_texture(llvmpipe->vertex_tex_cache[i], tex); + } + + llvmpipe->num_vertex_textures = num_textures; + + llvmpipe->dirty |= LP_NEW_TEXTURE; +} + + void llvmpipe_delete_sampler_state(struct pipe_context *pipe, void *sampler) -- cgit v1.2.3 From e5bc2a19bdaeeda2aa60562f6a580e27c74e9569 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 4 Dec 2009 17:29:53 -0800 Subject: progs/fp: Add tri-inv.c to Makefile. --- progs/fp/Makefile | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/fp/Makefile b/progs/fp/Makefile index 681928cf260..d77cd32b4df 100755 --- a/progs/fp/Makefile +++ b/progs/fp/Makefile @@ -17,6 +17,7 @@ SOURCES = \ tri-depth2.c \ tri-depthwrite.c \ tri-depthwrite2.c \ + tri-inv.c \ tri-param.c \ fp-tri.c -- cgit v1.2.3 From 5683d7d43fd5a02b72f30a2a6d6a9bfeaf2fa781 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 3 Nov 2009 14:41:08 -0700 Subject: progs/util: Fix memory leak if fail to load/compile shader Signed-off-by: Brian Paul (cherry picked from commit c475079ef2d901ba4506ebd53e19419cd46793ab) --- progs/util/shaderutil.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 629b6f1d972..36e07842c6d 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -88,6 +88,7 @@ CompileShaderFile(GLenum shaderType, const char *filename) f = fopen(filename, "r"); if (!f) { fprintf(stderr, "Unable to open shader file %s\n", filename); + free(buffer); return 0; } @@ -98,6 +99,7 @@ CompileShaderFile(GLenum shaderType, const char *filename) shader = CompileShaderText(shaderType, buffer); } else { + free(buffer); return 0; } -- cgit v1.2.3 From 4fb5ae7233e5c358e579ced6155f32461f6edf2d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 17 Nov 2009 12:00:22 -0800 Subject: progs/util: Fix memory leak if fread returns 0 in CompileShaderFile. (cherry picked from commit 11905da8836822f7dd60c84b5eefc72e46c94b50) --- progs/util/shaderutil.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/util/shaderutil.c b/progs/util/shaderutil.c index 36e07842c6d..adcf2149e21 100644 --- a/progs/util/shaderutil.c +++ b/progs/util/shaderutil.c @@ -99,6 +99,7 @@ CompileShaderFile(GLenum shaderType, const char *filename) shader = CompileShaderText(shaderType, buffer); } else { + fclose(f); free(buffer); return 0; } -- cgit v1.2.3 From fe8e18bcd41a19282ba92350a04a34866fda1d7b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 22:04:06 -0500 Subject: mesa: Fix array out-of-bounds access in _mesa_TexEnvf. _mesa_TexEnvf calls _mesa_TexEnvfv, which uses the param argument as an array. (cherry picked from commit a11d60d14caf8efc07f70af63b57b33273f8cf9b) --- src/mesa/main/texenv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texenv.c b/src/mesa/main/texenv.c index 6d86a4275cc..4442fb8cf8e 100644 --- a/src/mesa/main/texenv.c +++ b/src/mesa/main/texenv.c @@ -598,7 +598,10 @@ _mesa_TexEnvfv( GLenum target, GLenum pname, const GLfloat *param ) void GLAPIENTRY _mesa_TexEnvf( GLenum target, GLenum pname, GLfloat param ) { - _mesa_TexEnvfv( target, pname, ¶m ); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0; + _mesa_TexEnvfv( target, pname, p ); } -- cgit v1.2.3 From dd51b4f9091abf762e470f0cd4c802215a108290 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 5 Dec 2009 05:43:10 +0000 Subject: llvmpipe: Stop disassembling when an unsupported opcode is found. Otherwise the terminal gets full of garbage. --- src/gallium/drivers/llvmpipe/lp_bld_debug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_debug.c b/src/gallium/drivers/llvmpipe/lp_bld_debug.c index 59d8f492e60..354b3af49e1 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_debug.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_debug.c @@ -115,7 +115,8 @@ lp_disassemble(const void* func) } } - if (ud_insn_off(&ud_obj) >= max_jmp_pc && ud_obj.mnemonic == UD_Iret) + if ((ud_insn_off(&ud_obj) >= max_jmp_pc && ud_obj.mnemonic == UD_Iret) || + ud_obj.mnemonic == UD_Iinvalid) break; } debug_printf("\n"); -- cgit v1.2.3 From 501989bbcd159f8b44148a22151bb46c4800d298 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 5 Dec 2009 05:43:53 +0000 Subject: llvmpipe: Tweak disassembly to match gdb. Helps verifying udis86 output. --- src/gallium/drivers/llvmpipe/lp_bld_debug.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_debug.c b/src/gallium/drivers/llvmpipe/lp_bld_debug.c index 354b3af49e1..39dfc51e503 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_debug.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_debug.c @@ -77,10 +77,10 @@ lp_disassemble(const void* func) while (ud_disassemble(&ud_obj)) { #ifdef PIPE_ARCH_X86 - debug_printf("%08lx: ", (unsigned long)ud_insn_off(&ud_obj)); + debug_printf("0x%08lx:\t", (unsigned long)ud_insn_off(&ud_obj)); #endif #ifdef PIPE_ARCH_X86_64 - debug_printf("%016llx: ", (unsigned long long)ud_insn_off(&ud_obj)); + debug_printf("0x%016llx:\t", (unsigned long long)ud_insn_off(&ud_obj)); #endif #if 0 @@ -119,6 +119,12 @@ lp_disassemble(const void* func) ud_obj.mnemonic == UD_Iinvalid) break; } + +#if 0 + /* Print GDB command, useful to verify udis86 output */ + debug_printf("disassemble %p %p\n", func, (void*)(uintptr_t)ud_obj.pc); +#endif + debug_printf("\n"); #else (void)func; -- cgit v1.2.3 From 781d8fccba1bdaadbae042d23bf1d17e25c800fd Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 5 Dec 2009 06:05:56 +0000 Subject: svga: Use _debug_printf, so that output may be dumped in release builds too. The dump calls should be wrapped in #ifdef DEBUG .. #endif. --- src/gallium/drivers/svga/svgadump/svga_dump.c | 1122 ++++++++++---------- src/gallium/drivers/svga/svgadump/svga_dump.py | 22 +- .../drivers/svga/svgadump/svga_shader_dump.c | 230 ++-- 3 files changed, 687 insertions(+), 687 deletions(-) diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.c b/src/gallium/drivers/svga/svgadump/svga_dump.c index 910afa25287..18e0eb5139a 100644 --- a/src/gallium/drivers/svga/svgadump/svga_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_dump.c @@ -42,554 +42,554 @@ dump_SVGA3dVertexDecl(const SVGA3dVertexDecl *cmd) { switch((*cmd).identity.type) { case SVGA3D_DECLTYPE_FLOAT1: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT1\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT1\n"); break; case SVGA3D_DECLTYPE_FLOAT2: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT2\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT2\n"); break; case SVGA3D_DECLTYPE_FLOAT3: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT3\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT3\n"); break; case SVGA3D_DECLTYPE_FLOAT4: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT4\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT4\n"); break; case SVGA3D_DECLTYPE_D3DCOLOR: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_D3DCOLOR\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_D3DCOLOR\n"); break; case SVGA3D_DECLTYPE_UBYTE4: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UBYTE4\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UBYTE4\n"); break; case SVGA3D_DECLTYPE_SHORT2: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT2\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT2\n"); break; case SVGA3D_DECLTYPE_SHORT4: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT4\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT4\n"); break; case SVGA3D_DECLTYPE_UBYTE4N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UBYTE4N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UBYTE4N\n"); break; case SVGA3D_DECLTYPE_SHORT2N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT2N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT2N\n"); break; case SVGA3D_DECLTYPE_SHORT4N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT4N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_SHORT4N\n"); break; case SVGA3D_DECLTYPE_USHORT2N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_USHORT2N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_USHORT2N\n"); break; case SVGA3D_DECLTYPE_USHORT4N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_USHORT4N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_USHORT4N\n"); break; case SVGA3D_DECLTYPE_UDEC3: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UDEC3\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_UDEC3\n"); break; case SVGA3D_DECLTYPE_DEC3N: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_DEC3N\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_DEC3N\n"); break; case SVGA3D_DECLTYPE_FLOAT16_2: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT16_2\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT16_2\n"); break; case SVGA3D_DECLTYPE_FLOAT16_4: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT16_4\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_FLOAT16_4\n"); break; case SVGA3D_DECLTYPE_MAX: - debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_MAX\n"); + _debug_printf("\t\t.identity.type = SVGA3D_DECLTYPE_MAX\n"); break; default: - debug_printf("\t\t.identity.type = %i\n", (*cmd).identity.type); + _debug_printf("\t\t.identity.type = %i\n", (*cmd).identity.type); break; } switch((*cmd).identity.method) { case SVGA3D_DECLMETHOD_DEFAULT: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_DEFAULT\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_DEFAULT\n"); break; case SVGA3D_DECLMETHOD_PARTIALU: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_PARTIALU\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_PARTIALU\n"); break; case SVGA3D_DECLMETHOD_PARTIALV: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_PARTIALV\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_PARTIALV\n"); break; case SVGA3D_DECLMETHOD_CROSSUV: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_CROSSUV\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_CROSSUV\n"); break; case SVGA3D_DECLMETHOD_UV: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_UV\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_UV\n"); break; case SVGA3D_DECLMETHOD_LOOKUP: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_LOOKUP\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_LOOKUP\n"); break; case SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED: - debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED\n"); + _debug_printf("\t\t.identity.method = SVGA3D_DECLMETHOD_LOOKUPPRESAMPLED\n"); break; default: - debug_printf("\t\t.identity.method = %i\n", (*cmd).identity.method); + _debug_printf("\t\t.identity.method = %i\n", (*cmd).identity.method); break; } switch((*cmd).identity.usage) { case SVGA3D_DECLUSAGE_POSITION: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_POSITION\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_POSITION\n"); break; case SVGA3D_DECLUSAGE_BLENDWEIGHT: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BLENDWEIGHT\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BLENDWEIGHT\n"); break; case SVGA3D_DECLUSAGE_BLENDINDICES: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BLENDINDICES\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BLENDINDICES\n"); break; case SVGA3D_DECLUSAGE_NORMAL: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_NORMAL\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_NORMAL\n"); break; case SVGA3D_DECLUSAGE_PSIZE: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_PSIZE\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_PSIZE\n"); break; case SVGA3D_DECLUSAGE_TEXCOORD: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TEXCOORD\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TEXCOORD\n"); break; case SVGA3D_DECLUSAGE_TANGENT: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TANGENT\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TANGENT\n"); break; case SVGA3D_DECLUSAGE_BINORMAL: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BINORMAL\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_BINORMAL\n"); break; case SVGA3D_DECLUSAGE_TESSFACTOR: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TESSFACTOR\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_TESSFACTOR\n"); break; case SVGA3D_DECLUSAGE_POSITIONT: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_POSITIONT\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_POSITIONT\n"); break; case SVGA3D_DECLUSAGE_COLOR: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_COLOR\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_COLOR\n"); break; case SVGA3D_DECLUSAGE_FOG: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_FOG\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_FOG\n"); break; case SVGA3D_DECLUSAGE_DEPTH: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_DEPTH\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_DEPTH\n"); break; case SVGA3D_DECLUSAGE_SAMPLE: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_SAMPLE\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_SAMPLE\n"); break; case SVGA3D_DECLUSAGE_MAX: - debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_MAX\n"); + _debug_printf("\t\t.identity.usage = SVGA3D_DECLUSAGE_MAX\n"); break; default: - debug_printf("\t\t.identity.usage = %i\n", (*cmd).identity.usage); + _debug_printf("\t\t.identity.usage = %i\n", (*cmd).identity.usage); break; } - debug_printf("\t\t.identity.usageIndex = %u\n", (*cmd).identity.usageIndex); - debug_printf("\t\t.array.surfaceId = %u\n", (*cmd).array.surfaceId); - debug_printf("\t\t.array.offset = %u\n", (*cmd).array.offset); - debug_printf("\t\t.array.stride = %u\n", (*cmd).array.stride); - debug_printf("\t\t.rangeHint.first = %u\n", (*cmd).rangeHint.first); - debug_printf("\t\t.rangeHint.last = %u\n", (*cmd).rangeHint.last); + _debug_printf("\t\t.identity.usageIndex = %u\n", (*cmd).identity.usageIndex); + _debug_printf("\t\t.array.surfaceId = %u\n", (*cmd).array.surfaceId); + _debug_printf("\t\t.array.offset = %u\n", (*cmd).array.offset); + _debug_printf("\t\t.array.stride = %u\n", (*cmd).array.stride); + _debug_printf("\t\t.rangeHint.first = %u\n", (*cmd).rangeHint.first); + _debug_printf("\t\t.rangeHint.last = %u\n", (*cmd).rangeHint.last); } static void dump_SVGA3dTextureState(const SVGA3dTextureState *cmd) { - debug_printf("\t\t.stage = %u\n", (*cmd).stage); + _debug_printf("\t\t.stage = %u\n", (*cmd).stage); switch((*cmd).name) { case SVGA3D_TS_INVALID: - debug_printf("\t\t.name = SVGA3D_TS_INVALID\n"); + _debug_printf("\t\t.name = SVGA3D_TS_INVALID\n"); break; case SVGA3D_TS_BIND_TEXTURE: - debug_printf("\t\t.name = SVGA3D_TS_BIND_TEXTURE\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BIND_TEXTURE\n"); break; case SVGA3D_TS_COLOROP: - debug_printf("\t\t.name = SVGA3D_TS_COLOROP\n"); + _debug_printf("\t\t.name = SVGA3D_TS_COLOROP\n"); break; case SVGA3D_TS_COLORARG1: - debug_printf("\t\t.name = SVGA3D_TS_COLORARG1\n"); + _debug_printf("\t\t.name = SVGA3D_TS_COLORARG1\n"); break; case SVGA3D_TS_COLORARG2: - debug_printf("\t\t.name = SVGA3D_TS_COLORARG2\n"); + _debug_printf("\t\t.name = SVGA3D_TS_COLORARG2\n"); break; case SVGA3D_TS_ALPHAOP: - debug_printf("\t\t.name = SVGA3D_TS_ALPHAOP\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ALPHAOP\n"); break; case SVGA3D_TS_ALPHAARG1: - debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG1\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG1\n"); break; case SVGA3D_TS_ALPHAARG2: - debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG2\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG2\n"); break; case SVGA3D_TS_ADDRESSU: - debug_printf("\t\t.name = SVGA3D_TS_ADDRESSU\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ADDRESSU\n"); break; case SVGA3D_TS_ADDRESSV: - debug_printf("\t\t.name = SVGA3D_TS_ADDRESSV\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ADDRESSV\n"); break; case SVGA3D_TS_MIPFILTER: - debug_printf("\t\t.name = SVGA3D_TS_MIPFILTER\n"); + _debug_printf("\t\t.name = SVGA3D_TS_MIPFILTER\n"); break; case SVGA3D_TS_MAGFILTER: - debug_printf("\t\t.name = SVGA3D_TS_MAGFILTER\n"); + _debug_printf("\t\t.name = SVGA3D_TS_MAGFILTER\n"); break; case SVGA3D_TS_MINFILTER: - debug_printf("\t\t.name = SVGA3D_TS_MINFILTER\n"); + _debug_printf("\t\t.name = SVGA3D_TS_MINFILTER\n"); break; case SVGA3D_TS_BORDERCOLOR: - debug_printf("\t\t.name = SVGA3D_TS_BORDERCOLOR\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BORDERCOLOR\n"); break; case SVGA3D_TS_TEXCOORDINDEX: - debug_printf("\t\t.name = SVGA3D_TS_TEXCOORDINDEX\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXCOORDINDEX\n"); break; case SVGA3D_TS_TEXTURETRANSFORMFLAGS: - debug_printf("\t\t.name = SVGA3D_TS_TEXTURETRANSFORMFLAGS\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXTURETRANSFORMFLAGS\n"); break; case SVGA3D_TS_TEXCOORDGEN: - debug_printf("\t\t.name = SVGA3D_TS_TEXCOORDGEN\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXCOORDGEN\n"); break; case SVGA3D_TS_BUMPENVMAT00: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT00\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT00\n"); break; case SVGA3D_TS_BUMPENVMAT01: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT01\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT01\n"); break; case SVGA3D_TS_BUMPENVMAT10: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT10\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT10\n"); break; case SVGA3D_TS_BUMPENVMAT11: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT11\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVMAT11\n"); break; case SVGA3D_TS_TEXTURE_MIPMAP_LEVEL: - debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_MIPMAP_LEVEL\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_MIPMAP_LEVEL\n"); break; case SVGA3D_TS_TEXTURE_LOD_BIAS: - debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_LOD_BIAS\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_LOD_BIAS\n"); break; case SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL: - debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL\n"); + _debug_printf("\t\t.name = SVGA3D_TS_TEXTURE_ANISOTROPIC_LEVEL\n"); break; case SVGA3D_TS_ADDRESSW: - debug_printf("\t\t.name = SVGA3D_TS_ADDRESSW\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ADDRESSW\n"); break; case SVGA3D_TS_GAMMA: - debug_printf("\t\t.name = SVGA3D_TS_GAMMA\n"); + _debug_printf("\t\t.name = SVGA3D_TS_GAMMA\n"); break; case SVGA3D_TS_BUMPENVLSCALE: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVLSCALE\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVLSCALE\n"); break; case SVGA3D_TS_BUMPENVLOFFSET: - debug_printf("\t\t.name = SVGA3D_TS_BUMPENVLOFFSET\n"); + _debug_printf("\t\t.name = SVGA3D_TS_BUMPENVLOFFSET\n"); break; case SVGA3D_TS_COLORARG0: - debug_printf("\t\t.name = SVGA3D_TS_COLORARG0\n"); + _debug_printf("\t\t.name = SVGA3D_TS_COLORARG0\n"); break; case SVGA3D_TS_ALPHAARG0: - debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG0\n"); + _debug_printf("\t\t.name = SVGA3D_TS_ALPHAARG0\n"); break; case SVGA3D_TS_MAX: - debug_printf("\t\t.name = SVGA3D_TS_MAX\n"); + _debug_printf("\t\t.name = SVGA3D_TS_MAX\n"); break; default: - debug_printf("\t\t.name = %i\n", (*cmd).name); + _debug_printf("\t\t.name = %i\n", (*cmd).name); break; } - debug_printf("\t\t.value = %u\n", (*cmd).value); - debug_printf("\t\t.floatValue = %f\n", (*cmd).floatValue); + _debug_printf("\t\t.value = %u\n", (*cmd).value); + _debug_printf("\t\t.floatValue = %f\n", (*cmd).floatValue); } static void dump_SVGA3dCopyBox(const SVGA3dCopyBox *cmd) { - debug_printf("\t\t.x = %u\n", (*cmd).x); - debug_printf("\t\t.y = %u\n", (*cmd).y); - debug_printf("\t\t.z = %u\n", (*cmd).z); - debug_printf("\t\t.w = %u\n", (*cmd).w); - debug_printf("\t\t.h = %u\n", (*cmd).h); - debug_printf("\t\t.d = %u\n", (*cmd).d); - debug_printf("\t\t.srcx = %u\n", (*cmd).srcx); - debug_printf("\t\t.srcy = %u\n", (*cmd).srcy); - debug_printf("\t\t.srcz = %u\n", (*cmd).srcz); + _debug_printf("\t\t.x = %u\n", (*cmd).x); + _debug_printf("\t\t.y = %u\n", (*cmd).y); + _debug_printf("\t\t.z = %u\n", (*cmd).z); + _debug_printf("\t\t.w = %u\n", (*cmd).w); + _debug_printf("\t\t.h = %u\n", (*cmd).h); + _debug_printf("\t\t.d = %u\n", (*cmd).d); + _debug_printf("\t\t.srcx = %u\n", (*cmd).srcx); + _debug_printf("\t\t.srcy = %u\n", (*cmd).srcy); + _debug_printf("\t\t.srcz = %u\n", (*cmd).srcz); } static void dump_SVGA3dCmdSetClipPlane(const SVGA3dCmdSetClipPlane *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.index = %u\n", (*cmd).index); - debug_printf("\t\t.plane[0] = %f\n", (*cmd).plane[0]); - debug_printf("\t\t.plane[1] = %f\n", (*cmd).plane[1]); - debug_printf("\t\t.plane[2] = %f\n", (*cmd).plane[2]); - debug_printf("\t\t.plane[3] = %f\n", (*cmd).plane[3]); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.index = %u\n", (*cmd).index); + _debug_printf("\t\t.plane[0] = %f\n", (*cmd).plane[0]); + _debug_printf("\t\t.plane[1] = %f\n", (*cmd).plane[1]); + _debug_printf("\t\t.plane[2] = %f\n", (*cmd).plane[2]); + _debug_printf("\t\t.plane[3] = %f\n", (*cmd).plane[3]); } static void dump_SVGA3dCmdWaitForQuery(const SVGA3dCmdWaitForQuery *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_QUERYTYPE_OCCLUSION: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); break; case SVGA3D_QUERYTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } - debug_printf("\t\t.guestResult.gmrId = %u\n", (*cmd).guestResult.gmrId); - debug_printf("\t\t.guestResult.offset = %u\n", (*cmd).guestResult.offset); + _debug_printf("\t\t.guestResult.gmrId = %u\n", (*cmd).guestResult.gmrId); + _debug_printf("\t\t.guestResult.offset = %u\n", (*cmd).guestResult.offset); } static void dump_SVGA3dCmdSetRenderTarget(const SVGA3dCmdSetRenderTarget *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_RT_DEPTH: - debug_printf("\t\t.type = SVGA3D_RT_DEPTH\n"); + _debug_printf("\t\t.type = SVGA3D_RT_DEPTH\n"); break; case SVGA3D_RT_STENCIL: - debug_printf("\t\t.type = SVGA3D_RT_STENCIL\n"); + _debug_printf("\t\t.type = SVGA3D_RT_STENCIL\n"); break; default: - debug_printf("\t\t.type = SVGA3D_RT_COLOR%u\n", (*cmd).type - SVGA3D_RT_COLOR0); + _debug_printf("\t\t.type = SVGA3D_RT_COLOR%u\n", (*cmd).type - SVGA3D_RT_COLOR0); break; } - debug_printf("\t\t.target.sid = %u\n", (*cmd).target.sid); - debug_printf("\t\t.target.face = %u\n", (*cmd).target.face); - debug_printf("\t\t.target.mipmap = %u\n", (*cmd).target.mipmap); + _debug_printf("\t\t.target.sid = %u\n", (*cmd).target.sid); + _debug_printf("\t\t.target.face = %u\n", (*cmd).target.face); + _debug_printf("\t\t.target.mipmap = %u\n", (*cmd).target.mipmap); } static void dump_SVGA3dCmdSetTextureState(const SVGA3dCmdSetTextureState *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); } static void dump_SVGA3dCmdSurfaceCopy(const SVGA3dCmdSurfaceCopy *cmd) { - debug_printf("\t\t.src.sid = %u\n", (*cmd).src.sid); - debug_printf("\t\t.src.face = %u\n", (*cmd).src.face); - debug_printf("\t\t.src.mipmap = %u\n", (*cmd).src.mipmap); - debug_printf("\t\t.dest.sid = %u\n", (*cmd).dest.sid); - debug_printf("\t\t.dest.face = %u\n", (*cmd).dest.face); - debug_printf("\t\t.dest.mipmap = %u\n", (*cmd).dest.mipmap); + _debug_printf("\t\t.src.sid = %u\n", (*cmd).src.sid); + _debug_printf("\t\t.src.face = %u\n", (*cmd).src.face); + _debug_printf("\t\t.src.mipmap = %u\n", (*cmd).src.mipmap); + _debug_printf("\t\t.dest.sid = %u\n", (*cmd).dest.sid); + _debug_printf("\t\t.dest.face = %u\n", (*cmd).dest.face); + _debug_printf("\t\t.dest.mipmap = %u\n", (*cmd).dest.mipmap); } static void dump_SVGA3dCmdSetMaterial(const SVGA3dCmdSetMaterial *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).face) { case SVGA3D_FACE_INVALID: - debug_printf("\t\t.face = SVGA3D_FACE_INVALID\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_INVALID\n"); break; case SVGA3D_FACE_NONE: - debug_printf("\t\t.face = SVGA3D_FACE_NONE\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_NONE\n"); break; case SVGA3D_FACE_FRONT: - debug_printf("\t\t.face = SVGA3D_FACE_FRONT\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_FRONT\n"); break; case SVGA3D_FACE_BACK: - debug_printf("\t\t.face = SVGA3D_FACE_BACK\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_BACK\n"); break; case SVGA3D_FACE_FRONT_BACK: - debug_printf("\t\t.face = SVGA3D_FACE_FRONT_BACK\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_FRONT_BACK\n"); break; case SVGA3D_FACE_MAX: - debug_printf("\t\t.face = SVGA3D_FACE_MAX\n"); + _debug_printf("\t\t.face = SVGA3D_FACE_MAX\n"); break; default: - debug_printf("\t\t.face = %i\n", (*cmd).face); + _debug_printf("\t\t.face = %i\n", (*cmd).face); break; } - debug_printf("\t\t.material.diffuse[0] = %f\n", (*cmd).material.diffuse[0]); - debug_printf("\t\t.material.diffuse[1] = %f\n", (*cmd).material.diffuse[1]); - debug_printf("\t\t.material.diffuse[2] = %f\n", (*cmd).material.diffuse[2]); - debug_printf("\t\t.material.diffuse[3] = %f\n", (*cmd).material.diffuse[3]); - debug_printf("\t\t.material.ambient[0] = %f\n", (*cmd).material.ambient[0]); - debug_printf("\t\t.material.ambient[1] = %f\n", (*cmd).material.ambient[1]); - debug_printf("\t\t.material.ambient[2] = %f\n", (*cmd).material.ambient[2]); - debug_printf("\t\t.material.ambient[3] = %f\n", (*cmd).material.ambient[3]); - debug_printf("\t\t.material.specular[0] = %f\n", (*cmd).material.specular[0]); - debug_printf("\t\t.material.specular[1] = %f\n", (*cmd).material.specular[1]); - debug_printf("\t\t.material.specular[2] = %f\n", (*cmd).material.specular[2]); - debug_printf("\t\t.material.specular[3] = %f\n", (*cmd).material.specular[3]); - debug_printf("\t\t.material.emissive[0] = %f\n", (*cmd).material.emissive[0]); - debug_printf("\t\t.material.emissive[1] = %f\n", (*cmd).material.emissive[1]); - debug_printf("\t\t.material.emissive[2] = %f\n", (*cmd).material.emissive[2]); - debug_printf("\t\t.material.emissive[3] = %f\n", (*cmd).material.emissive[3]); - debug_printf("\t\t.material.shininess = %f\n", (*cmd).material.shininess); + _debug_printf("\t\t.material.diffuse[0] = %f\n", (*cmd).material.diffuse[0]); + _debug_printf("\t\t.material.diffuse[1] = %f\n", (*cmd).material.diffuse[1]); + _debug_printf("\t\t.material.diffuse[2] = %f\n", (*cmd).material.diffuse[2]); + _debug_printf("\t\t.material.diffuse[3] = %f\n", (*cmd).material.diffuse[3]); + _debug_printf("\t\t.material.ambient[0] = %f\n", (*cmd).material.ambient[0]); + _debug_printf("\t\t.material.ambient[1] = %f\n", (*cmd).material.ambient[1]); + _debug_printf("\t\t.material.ambient[2] = %f\n", (*cmd).material.ambient[2]); + _debug_printf("\t\t.material.ambient[3] = %f\n", (*cmd).material.ambient[3]); + _debug_printf("\t\t.material.specular[0] = %f\n", (*cmd).material.specular[0]); + _debug_printf("\t\t.material.specular[1] = %f\n", (*cmd).material.specular[1]); + _debug_printf("\t\t.material.specular[2] = %f\n", (*cmd).material.specular[2]); + _debug_printf("\t\t.material.specular[3] = %f\n", (*cmd).material.specular[3]); + _debug_printf("\t\t.material.emissive[0] = %f\n", (*cmd).material.emissive[0]); + _debug_printf("\t\t.material.emissive[1] = %f\n", (*cmd).material.emissive[1]); + _debug_printf("\t\t.material.emissive[2] = %f\n", (*cmd).material.emissive[2]); + _debug_printf("\t\t.material.emissive[3] = %f\n", (*cmd).material.emissive[3]); + _debug_printf("\t\t.material.shininess = %f\n", (*cmd).material.shininess); } static void dump_SVGA3dCmdSetLightData(const SVGA3dCmdSetLightData *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.index = %u\n", (*cmd).index); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.index = %u\n", (*cmd).index); switch((*cmd).data.type) { case SVGA3D_LIGHTTYPE_INVALID: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_INVALID\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_INVALID\n"); break; case SVGA3D_LIGHTTYPE_POINT: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_POINT\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_POINT\n"); break; case SVGA3D_LIGHTTYPE_SPOT1: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_SPOT1\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_SPOT1\n"); break; case SVGA3D_LIGHTTYPE_SPOT2: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_SPOT2\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_SPOT2\n"); break; case SVGA3D_LIGHTTYPE_DIRECTIONAL: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_DIRECTIONAL\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_DIRECTIONAL\n"); break; case SVGA3D_LIGHTTYPE_MAX: - debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_MAX\n"); + _debug_printf("\t\t.data.type = SVGA3D_LIGHTTYPE_MAX\n"); break; default: - debug_printf("\t\t.data.type = %i\n", (*cmd).data.type); + _debug_printf("\t\t.data.type = %i\n", (*cmd).data.type); break; } - debug_printf("\t\t.data.inWorldSpace = %u\n", (*cmd).data.inWorldSpace); - debug_printf("\t\t.data.diffuse[0] = %f\n", (*cmd).data.diffuse[0]); - debug_printf("\t\t.data.diffuse[1] = %f\n", (*cmd).data.diffuse[1]); - debug_printf("\t\t.data.diffuse[2] = %f\n", (*cmd).data.diffuse[2]); - debug_printf("\t\t.data.diffuse[3] = %f\n", (*cmd).data.diffuse[3]); - debug_printf("\t\t.data.specular[0] = %f\n", (*cmd).data.specular[0]); - debug_printf("\t\t.data.specular[1] = %f\n", (*cmd).data.specular[1]); - debug_printf("\t\t.data.specular[2] = %f\n", (*cmd).data.specular[2]); - debug_printf("\t\t.data.specular[3] = %f\n", (*cmd).data.specular[3]); - debug_printf("\t\t.data.ambient[0] = %f\n", (*cmd).data.ambient[0]); - debug_printf("\t\t.data.ambient[1] = %f\n", (*cmd).data.ambient[1]); - debug_printf("\t\t.data.ambient[2] = %f\n", (*cmd).data.ambient[2]); - debug_printf("\t\t.data.ambient[3] = %f\n", (*cmd).data.ambient[3]); - debug_printf("\t\t.data.position[0] = %f\n", (*cmd).data.position[0]); - debug_printf("\t\t.data.position[1] = %f\n", (*cmd).data.position[1]); - debug_printf("\t\t.data.position[2] = %f\n", (*cmd).data.position[2]); - debug_printf("\t\t.data.position[3] = %f\n", (*cmd).data.position[3]); - debug_printf("\t\t.data.direction[0] = %f\n", (*cmd).data.direction[0]); - debug_printf("\t\t.data.direction[1] = %f\n", (*cmd).data.direction[1]); - debug_printf("\t\t.data.direction[2] = %f\n", (*cmd).data.direction[2]); - debug_printf("\t\t.data.direction[3] = %f\n", (*cmd).data.direction[3]); - debug_printf("\t\t.data.range = %f\n", (*cmd).data.range); - debug_printf("\t\t.data.falloff = %f\n", (*cmd).data.falloff); - debug_printf("\t\t.data.attenuation0 = %f\n", (*cmd).data.attenuation0); - debug_printf("\t\t.data.attenuation1 = %f\n", (*cmd).data.attenuation1); - debug_printf("\t\t.data.attenuation2 = %f\n", (*cmd).data.attenuation2); - debug_printf("\t\t.data.theta = %f\n", (*cmd).data.theta); - debug_printf("\t\t.data.phi = %f\n", (*cmd).data.phi); + _debug_printf("\t\t.data.inWorldSpace = %u\n", (*cmd).data.inWorldSpace); + _debug_printf("\t\t.data.diffuse[0] = %f\n", (*cmd).data.diffuse[0]); + _debug_printf("\t\t.data.diffuse[1] = %f\n", (*cmd).data.diffuse[1]); + _debug_printf("\t\t.data.diffuse[2] = %f\n", (*cmd).data.diffuse[2]); + _debug_printf("\t\t.data.diffuse[3] = %f\n", (*cmd).data.diffuse[3]); + _debug_printf("\t\t.data.specular[0] = %f\n", (*cmd).data.specular[0]); + _debug_printf("\t\t.data.specular[1] = %f\n", (*cmd).data.specular[1]); + _debug_printf("\t\t.data.specular[2] = %f\n", (*cmd).data.specular[2]); + _debug_printf("\t\t.data.specular[3] = %f\n", (*cmd).data.specular[3]); + _debug_printf("\t\t.data.ambient[0] = %f\n", (*cmd).data.ambient[0]); + _debug_printf("\t\t.data.ambient[1] = %f\n", (*cmd).data.ambient[1]); + _debug_printf("\t\t.data.ambient[2] = %f\n", (*cmd).data.ambient[2]); + _debug_printf("\t\t.data.ambient[3] = %f\n", (*cmd).data.ambient[3]); + _debug_printf("\t\t.data.position[0] = %f\n", (*cmd).data.position[0]); + _debug_printf("\t\t.data.position[1] = %f\n", (*cmd).data.position[1]); + _debug_printf("\t\t.data.position[2] = %f\n", (*cmd).data.position[2]); + _debug_printf("\t\t.data.position[3] = %f\n", (*cmd).data.position[3]); + _debug_printf("\t\t.data.direction[0] = %f\n", (*cmd).data.direction[0]); + _debug_printf("\t\t.data.direction[1] = %f\n", (*cmd).data.direction[1]); + _debug_printf("\t\t.data.direction[2] = %f\n", (*cmd).data.direction[2]); + _debug_printf("\t\t.data.direction[3] = %f\n", (*cmd).data.direction[3]); + _debug_printf("\t\t.data.range = %f\n", (*cmd).data.range); + _debug_printf("\t\t.data.falloff = %f\n", (*cmd).data.falloff); + _debug_printf("\t\t.data.attenuation0 = %f\n", (*cmd).data.attenuation0); + _debug_printf("\t\t.data.attenuation1 = %f\n", (*cmd).data.attenuation1); + _debug_printf("\t\t.data.attenuation2 = %f\n", (*cmd).data.attenuation2); + _debug_printf("\t\t.data.theta = %f\n", (*cmd).data.theta); + _debug_printf("\t\t.data.phi = %f\n", (*cmd).data.phi); } static void dump_SVGA3dCmdSetViewport(const SVGA3dCmdSetViewport *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.rect.x = %u\n", (*cmd).rect.x); - debug_printf("\t\t.rect.y = %u\n", (*cmd).rect.y); - debug_printf("\t\t.rect.w = %u\n", (*cmd).rect.w); - debug_printf("\t\t.rect.h = %u\n", (*cmd).rect.h); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.rect.x = %u\n", (*cmd).rect.x); + _debug_printf("\t\t.rect.y = %u\n", (*cmd).rect.y); + _debug_printf("\t\t.rect.w = %u\n", (*cmd).rect.w); + _debug_printf("\t\t.rect.h = %u\n", (*cmd).rect.h); } static void dump_SVGA3dCmdSetScissorRect(const SVGA3dCmdSetScissorRect *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.rect.x = %u\n", (*cmd).rect.x); - debug_printf("\t\t.rect.y = %u\n", (*cmd).rect.y); - debug_printf("\t\t.rect.w = %u\n", (*cmd).rect.w); - debug_printf("\t\t.rect.h = %u\n", (*cmd).rect.h); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.rect.x = %u\n", (*cmd).rect.x); + _debug_printf("\t\t.rect.y = %u\n", (*cmd).rect.y); + _debug_printf("\t\t.rect.w = %u\n", (*cmd).rect.w); + _debug_printf("\t\t.rect.h = %u\n", (*cmd).rect.h); } static void dump_SVGA3dCopyRect(const SVGA3dCopyRect *cmd) { - debug_printf("\t\t.x = %u\n", (*cmd).x); - debug_printf("\t\t.y = %u\n", (*cmd).y); - debug_printf("\t\t.w = %u\n", (*cmd).w); - debug_printf("\t\t.h = %u\n", (*cmd).h); - debug_printf("\t\t.srcx = %u\n", (*cmd).srcx); - debug_printf("\t\t.srcy = %u\n", (*cmd).srcy); + _debug_printf("\t\t.x = %u\n", (*cmd).x); + _debug_printf("\t\t.y = %u\n", (*cmd).y); + _debug_printf("\t\t.w = %u\n", (*cmd).w); + _debug_printf("\t\t.h = %u\n", (*cmd).h); + _debug_printf("\t\t.srcx = %u\n", (*cmd).srcx); + _debug_printf("\t\t.srcy = %u\n", (*cmd).srcy); } static void dump_SVGA3dCmdSetShader(const SVGA3dCmdSetShader *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_SHADERTYPE_COMPILED_DX8: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); break; case SVGA3D_SHADERTYPE_VS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); break; case SVGA3D_SHADERTYPE_PS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); break; case SVGA3D_SHADERTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } - debug_printf("\t\t.shid = %u\n", (*cmd).shid); + _debug_printf("\t\t.shid = %u\n", (*cmd).shid); } static void dump_SVGA3dCmdEndQuery(const SVGA3dCmdEndQuery *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_QUERYTYPE_OCCLUSION: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); break; case SVGA3D_QUERYTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } - debug_printf("\t\t.guestResult.gmrId = %u\n", (*cmd).guestResult.gmrId); - debug_printf("\t\t.guestResult.offset = %u\n", (*cmd).guestResult.offset); + _debug_printf("\t\t.guestResult.gmrId = %u\n", (*cmd).guestResult.gmrId); + _debug_printf("\t\t.guestResult.offset = %u\n", (*cmd).guestResult.offset); } static void dump_SVGA3dSize(const SVGA3dSize *cmd) { - debug_printf("\t\t.width = %u\n", (*cmd).width); - debug_printf("\t\t.height = %u\n", (*cmd).height); - debug_printf("\t\t.depth = %u\n", (*cmd).depth); + _debug_printf("\t\t.width = %u\n", (*cmd).width); + _debug_printf("\t\t.height = %u\n", (*cmd).height); + _debug_printf("\t\t.depth = %u\n", (*cmd).depth); } static void dump_SVGA3dCmdDestroySurface(const SVGA3dCmdDestroySurface *cmd) { - debug_printf("\t\t.sid = %u\n", (*cmd).sid); + _debug_printf("\t\t.sid = %u\n", (*cmd).sid); } static void dump_SVGA3dCmdDefineContext(const SVGA3dCmdDefineContext *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); } static void dump_SVGA3dRect(const SVGA3dRect *cmd) { - debug_printf("\t\t.x = %u\n", (*cmd).x); - debug_printf("\t\t.y = %u\n", (*cmd).y); - debug_printf("\t\t.w = %u\n", (*cmd).w); - debug_printf("\t\t.h = %u\n", (*cmd).h); + _debug_printf("\t\t.x = %u\n", (*cmd).x); + _debug_printf("\t\t.y = %u\n", (*cmd).y); + _debug_printf("\t\t.w = %u\n", (*cmd).w); + _debug_printf("\t\t.h = %u\n", (*cmd).h); } static void dump_SVGA3dCmdBeginQuery(const SVGA3dCmdBeginQuery *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_QUERYTYPE_OCCLUSION: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_OCCLUSION\n"); break; case SVGA3D_QUERYTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_QUERYTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } } @@ -599,336 +599,336 @@ dump_SVGA3dRenderState(const SVGA3dRenderState *cmd) { switch((*cmd).state) { case SVGA3D_RS_INVALID: - debug_printf("\t\t.state = SVGA3D_RS_INVALID\n"); + _debug_printf("\t\t.state = SVGA3D_RS_INVALID\n"); break; case SVGA3D_RS_ZENABLE: - debug_printf("\t\t.state = SVGA3D_RS_ZENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ZENABLE\n"); break; case SVGA3D_RS_ZWRITEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_ZWRITEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ZWRITEENABLE\n"); break; case SVGA3D_RS_ALPHATESTENABLE: - debug_printf("\t\t.state = SVGA3D_RS_ALPHATESTENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ALPHATESTENABLE\n"); break; case SVGA3D_RS_DITHERENABLE: - debug_printf("\t\t.state = SVGA3D_RS_DITHERENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_DITHERENABLE\n"); break; case SVGA3D_RS_BLENDENABLE: - debug_printf("\t\t.state = SVGA3D_RS_BLENDENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_BLENDENABLE\n"); break; case SVGA3D_RS_FOGENABLE: - debug_printf("\t\t.state = SVGA3D_RS_FOGENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGENABLE\n"); break; case SVGA3D_RS_SPECULARENABLE: - debug_printf("\t\t.state = SVGA3D_RS_SPECULARENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SPECULARENABLE\n"); break; case SVGA3D_RS_STENCILENABLE: - debug_printf("\t\t.state = SVGA3D_RS_STENCILENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILENABLE\n"); break; case SVGA3D_RS_LIGHTINGENABLE: - debug_printf("\t\t.state = SVGA3D_RS_LIGHTINGENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_LIGHTINGENABLE\n"); break; case SVGA3D_RS_NORMALIZENORMALS: - debug_printf("\t\t.state = SVGA3D_RS_NORMALIZENORMALS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_NORMALIZENORMALS\n"); break; case SVGA3D_RS_POINTSPRITEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_POINTSPRITEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSPRITEENABLE\n"); break; case SVGA3D_RS_POINTSCALEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_POINTSCALEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSCALEENABLE\n"); break; case SVGA3D_RS_STENCILREF: - debug_printf("\t\t.state = SVGA3D_RS_STENCILREF\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILREF\n"); break; case SVGA3D_RS_STENCILMASK: - debug_printf("\t\t.state = SVGA3D_RS_STENCILMASK\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILMASK\n"); break; case SVGA3D_RS_STENCILWRITEMASK: - debug_printf("\t\t.state = SVGA3D_RS_STENCILWRITEMASK\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILWRITEMASK\n"); break; case SVGA3D_RS_FOGSTART: - debug_printf("\t\t.state = SVGA3D_RS_FOGSTART\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGSTART\n"); break; case SVGA3D_RS_FOGEND: - debug_printf("\t\t.state = SVGA3D_RS_FOGEND\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGEND\n"); break; case SVGA3D_RS_FOGDENSITY: - debug_printf("\t\t.state = SVGA3D_RS_FOGDENSITY\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGDENSITY\n"); break; case SVGA3D_RS_POINTSIZE: - debug_printf("\t\t.state = SVGA3D_RS_POINTSIZE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSIZE\n"); break; case SVGA3D_RS_POINTSIZEMIN: - debug_printf("\t\t.state = SVGA3D_RS_POINTSIZEMIN\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSIZEMIN\n"); break; case SVGA3D_RS_POINTSIZEMAX: - debug_printf("\t\t.state = SVGA3D_RS_POINTSIZEMAX\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSIZEMAX\n"); break; case SVGA3D_RS_POINTSCALE_A: - debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_A\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_A\n"); break; case SVGA3D_RS_POINTSCALE_B: - debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_B\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_B\n"); break; case SVGA3D_RS_POINTSCALE_C: - debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_C\n"); + _debug_printf("\t\t.state = SVGA3D_RS_POINTSCALE_C\n"); break; case SVGA3D_RS_FOGCOLOR: - debug_printf("\t\t.state = SVGA3D_RS_FOGCOLOR\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGCOLOR\n"); break; case SVGA3D_RS_AMBIENT: - debug_printf("\t\t.state = SVGA3D_RS_AMBIENT\n"); + _debug_printf("\t\t.state = SVGA3D_RS_AMBIENT\n"); break; case SVGA3D_RS_CLIPPLANEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_CLIPPLANEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CLIPPLANEENABLE\n"); break; case SVGA3D_RS_FOGMODE: - debug_printf("\t\t.state = SVGA3D_RS_FOGMODE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FOGMODE\n"); break; case SVGA3D_RS_FILLMODE: - debug_printf("\t\t.state = SVGA3D_RS_FILLMODE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FILLMODE\n"); break; case SVGA3D_RS_SHADEMODE: - debug_printf("\t\t.state = SVGA3D_RS_SHADEMODE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SHADEMODE\n"); break; case SVGA3D_RS_LINEPATTERN: - debug_printf("\t\t.state = SVGA3D_RS_LINEPATTERN\n"); + _debug_printf("\t\t.state = SVGA3D_RS_LINEPATTERN\n"); break; case SVGA3D_RS_SRCBLEND: - debug_printf("\t\t.state = SVGA3D_RS_SRCBLEND\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SRCBLEND\n"); break; case SVGA3D_RS_DSTBLEND: - debug_printf("\t\t.state = SVGA3D_RS_DSTBLEND\n"); + _debug_printf("\t\t.state = SVGA3D_RS_DSTBLEND\n"); break; case SVGA3D_RS_BLENDEQUATION: - debug_printf("\t\t.state = SVGA3D_RS_BLENDEQUATION\n"); + _debug_printf("\t\t.state = SVGA3D_RS_BLENDEQUATION\n"); break; case SVGA3D_RS_CULLMODE: - debug_printf("\t\t.state = SVGA3D_RS_CULLMODE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CULLMODE\n"); break; case SVGA3D_RS_ZFUNC: - debug_printf("\t\t.state = SVGA3D_RS_ZFUNC\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ZFUNC\n"); break; case SVGA3D_RS_ALPHAFUNC: - debug_printf("\t\t.state = SVGA3D_RS_ALPHAFUNC\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ALPHAFUNC\n"); break; case SVGA3D_RS_STENCILFUNC: - debug_printf("\t\t.state = SVGA3D_RS_STENCILFUNC\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILFUNC\n"); break; case SVGA3D_RS_STENCILFAIL: - debug_printf("\t\t.state = SVGA3D_RS_STENCILFAIL\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILFAIL\n"); break; case SVGA3D_RS_STENCILZFAIL: - debug_printf("\t\t.state = SVGA3D_RS_STENCILZFAIL\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILZFAIL\n"); break; case SVGA3D_RS_STENCILPASS: - debug_printf("\t\t.state = SVGA3D_RS_STENCILPASS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILPASS\n"); break; case SVGA3D_RS_ALPHAREF: - debug_printf("\t\t.state = SVGA3D_RS_ALPHAREF\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ALPHAREF\n"); break; case SVGA3D_RS_FRONTWINDING: - debug_printf("\t\t.state = SVGA3D_RS_FRONTWINDING\n"); + _debug_printf("\t\t.state = SVGA3D_RS_FRONTWINDING\n"); break; case SVGA3D_RS_COORDINATETYPE: - debug_printf("\t\t.state = SVGA3D_RS_COORDINATETYPE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_COORDINATETYPE\n"); break; case SVGA3D_RS_ZBIAS: - debug_printf("\t\t.state = SVGA3D_RS_ZBIAS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ZBIAS\n"); break; case SVGA3D_RS_RANGEFOGENABLE: - debug_printf("\t\t.state = SVGA3D_RS_RANGEFOGENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_RANGEFOGENABLE\n"); break; case SVGA3D_RS_COLORWRITEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE\n"); break; case SVGA3D_RS_VERTEXMATERIALENABLE: - debug_printf("\t\t.state = SVGA3D_RS_VERTEXMATERIALENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_VERTEXMATERIALENABLE\n"); break; case SVGA3D_RS_DIFFUSEMATERIALSOURCE: - debug_printf("\t\t.state = SVGA3D_RS_DIFFUSEMATERIALSOURCE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_DIFFUSEMATERIALSOURCE\n"); break; case SVGA3D_RS_SPECULARMATERIALSOURCE: - debug_printf("\t\t.state = SVGA3D_RS_SPECULARMATERIALSOURCE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SPECULARMATERIALSOURCE\n"); break; case SVGA3D_RS_AMBIENTMATERIALSOURCE: - debug_printf("\t\t.state = SVGA3D_RS_AMBIENTMATERIALSOURCE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_AMBIENTMATERIALSOURCE\n"); break; case SVGA3D_RS_EMISSIVEMATERIALSOURCE: - debug_printf("\t\t.state = SVGA3D_RS_EMISSIVEMATERIALSOURCE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_EMISSIVEMATERIALSOURCE\n"); break; case SVGA3D_RS_TEXTUREFACTOR: - debug_printf("\t\t.state = SVGA3D_RS_TEXTUREFACTOR\n"); + _debug_printf("\t\t.state = SVGA3D_RS_TEXTUREFACTOR\n"); break; case SVGA3D_RS_LOCALVIEWER: - debug_printf("\t\t.state = SVGA3D_RS_LOCALVIEWER\n"); + _debug_printf("\t\t.state = SVGA3D_RS_LOCALVIEWER\n"); break; case SVGA3D_RS_SCISSORTESTENABLE: - debug_printf("\t\t.state = SVGA3D_RS_SCISSORTESTENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SCISSORTESTENABLE\n"); break; case SVGA3D_RS_BLENDCOLOR: - debug_printf("\t\t.state = SVGA3D_RS_BLENDCOLOR\n"); + _debug_printf("\t\t.state = SVGA3D_RS_BLENDCOLOR\n"); break; case SVGA3D_RS_STENCILENABLE2SIDED: - debug_printf("\t\t.state = SVGA3D_RS_STENCILENABLE2SIDED\n"); + _debug_printf("\t\t.state = SVGA3D_RS_STENCILENABLE2SIDED\n"); break; case SVGA3D_RS_CCWSTENCILFUNC: - debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILFUNC\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILFUNC\n"); break; case SVGA3D_RS_CCWSTENCILFAIL: - debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILFAIL\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILFAIL\n"); break; case SVGA3D_RS_CCWSTENCILZFAIL: - debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILZFAIL\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILZFAIL\n"); break; case SVGA3D_RS_CCWSTENCILPASS: - debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILPASS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CCWSTENCILPASS\n"); break; case SVGA3D_RS_VERTEXBLEND: - debug_printf("\t\t.state = SVGA3D_RS_VERTEXBLEND\n"); + _debug_printf("\t\t.state = SVGA3D_RS_VERTEXBLEND\n"); break; case SVGA3D_RS_SLOPESCALEDEPTHBIAS: - debug_printf("\t\t.state = SVGA3D_RS_SLOPESCALEDEPTHBIAS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SLOPESCALEDEPTHBIAS\n"); break; case SVGA3D_RS_DEPTHBIAS: - debug_printf("\t\t.state = SVGA3D_RS_DEPTHBIAS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_DEPTHBIAS\n"); break; case SVGA3D_RS_OUTPUTGAMMA: - debug_printf("\t\t.state = SVGA3D_RS_OUTPUTGAMMA\n"); + _debug_printf("\t\t.state = SVGA3D_RS_OUTPUTGAMMA\n"); break; case SVGA3D_RS_ZVISIBLE: - debug_printf("\t\t.state = SVGA3D_RS_ZVISIBLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ZVISIBLE\n"); break; case SVGA3D_RS_LASTPIXEL: - debug_printf("\t\t.state = SVGA3D_RS_LASTPIXEL\n"); + _debug_printf("\t\t.state = SVGA3D_RS_LASTPIXEL\n"); break; case SVGA3D_RS_CLIPPING: - debug_printf("\t\t.state = SVGA3D_RS_CLIPPING\n"); + _debug_printf("\t\t.state = SVGA3D_RS_CLIPPING\n"); break; case SVGA3D_RS_WRAP0: - debug_printf("\t\t.state = SVGA3D_RS_WRAP0\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP0\n"); break; case SVGA3D_RS_WRAP1: - debug_printf("\t\t.state = SVGA3D_RS_WRAP1\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP1\n"); break; case SVGA3D_RS_WRAP2: - debug_printf("\t\t.state = SVGA3D_RS_WRAP2\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP2\n"); break; case SVGA3D_RS_WRAP3: - debug_printf("\t\t.state = SVGA3D_RS_WRAP3\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP3\n"); break; case SVGA3D_RS_WRAP4: - debug_printf("\t\t.state = SVGA3D_RS_WRAP4\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP4\n"); break; case SVGA3D_RS_WRAP5: - debug_printf("\t\t.state = SVGA3D_RS_WRAP5\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP5\n"); break; case SVGA3D_RS_WRAP6: - debug_printf("\t\t.state = SVGA3D_RS_WRAP6\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP6\n"); break; case SVGA3D_RS_WRAP7: - debug_printf("\t\t.state = SVGA3D_RS_WRAP7\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP7\n"); break; case SVGA3D_RS_WRAP8: - debug_printf("\t\t.state = SVGA3D_RS_WRAP8\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP8\n"); break; case SVGA3D_RS_WRAP9: - debug_printf("\t\t.state = SVGA3D_RS_WRAP9\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP9\n"); break; case SVGA3D_RS_WRAP10: - debug_printf("\t\t.state = SVGA3D_RS_WRAP10\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP10\n"); break; case SVGA3D_RS_WRAP11: - debug_printf("\t\t.state = SVGA3D_RS_WRAP11\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP11\n"); break; case SVGA3D_RS_WRAP12: - debug_printf("\t\t.state = SVGA3D_RS_WRAP12\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP12\n"); break; case SVGA3D_RS_WRAP13: - debug_printf("\t\t.state = SVGA3D_RS_WRAP13\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP13\n"); break; case SVGA3D_RS_WRAP14: - debug_printf("\t\t.state = SVGA3D_RS_WRAP14\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP14\n"); break; case SVGA3D_RS_WRAP15: - debug_printf("\t\t.state = SVGA3D_RS_WRAP15\n"); + _debug_printf("\t\t.state = SVGA3D_RS_WRAP15\n"); break; case SVGA3D_RS_MULTISAMPLEANTIALIAS: - debug_printf("\t\t.state = SVGA3D_RS_MULTISAMPLEANTIALIAS\n"); + _debug_printf("\t\t.state = SVGA3D_RS_MULTISAMPLEANTIALIAS\n"); break; case SVGA3D_RS_MULTISAMPLEMASK: - debug_printf("\t\t.state = SVGA3D_RS_MULTISAMPLEMASK\n"); + _debug_printf("\t\t.state = SVGA3D_RS_MULTISAMPLEMASK\n"); break; case SVGA3D_RS_INDEXEDVERTEXBLENDENABLE: - debug_printf("\t\t.state = SVGA3D_RS_INDEXEDVERTEXBLENDENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_INDEXEDVERTEXBLENDENABLE\n"); break; case SVGA3D_RS_TWEENFACTOR: - debug_printf("\t\t.state = SVGA3D_RS_TWEENFACTOR\n"); + _debug_printf("\t\t.state = SVGA3D_RS_TWEENFACTOR\n"); break; case SVGA3D_RS_ANTIALIASEDLINEENABLE: - debug_printf("\t\t.state = SVGA3D_RS_ANTIALIASEDLINEENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_ANTIALIASEDLINEENABLE\n"); break; case SVGA3D_RS_COLORWRITEENABLE1: - debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE1\n"); + _debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE1\n"); break; case SVGA3D_RS_COLORWRITEENABLE2: - debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE2\n"); + _debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE2\n"); break; case SVGA3D_RS_COLORWRITEENABLE3: - debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE3\n"); + _debug_printf("\t\t.state = SVGA3D_RS_COLORWRITEENABLE3\n"); break; case SVGA3D_RS_SEPARATEALPHABLENDENABLE: - debug_printf("\t\t.state = SVGA3D_RS_SEPARATEALPHABLENDENABLE\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SEPARATEALPHABLENDENABLE\n"); break; case SVGA3D_RS_SRCBLENDALPHA: - debug_printf("\t\t.state = SVGA3D_RS_SRCBLENDALPHA\n"); + _debug_printf("\t\t.state = SVGA3D_RS_SRCBLENDALPHA\n"); break; case SVGA3D_RS_DSTBLENDALPHA: - debug_printf("\t\t.state = SVGA3D_RS_DSTBLENDALPHA\n"); + _debug_printf("\t\t.state = SVGA3D_RS_DSTBLENDALPHA\n"); break; case SVGA3D_RS_BLENDEQUATIONALPHA: - debug_printf("\t\t.state = SVGA3D_RS_BLENDEQUATIONALPHA\n"); + _debug_printf("\t\t.state = SVGA3D_RS_BLENDEQUATIONALPHA\n"); break; case SVGA3D_RS_MAX: - debug_printf("\t\t.state = SVGA3D_RS_MAX\n"); + _debug_printf("\t\t.state = SVGA3D_RS_MAX\n"); break; default: - debug_printf("\t\t.state = %i\n", (*cmd).state); + _debug_printf("\t\t.state = %i\n", (*cmd).state); break; } - debug_printf("\t\t.uintValue = %u\n", (*cmd).uintValue); - debug_printf("\t\t.floatValue = %f\n", (*cmd).floatValue); + _debug_printf("\t\t.uintValue = %u\n", (*cmd).uintValue); + _debug_printf("\t\t.floatValue = %f\n", (*cmd).floatValue); } static void dump_SVGA3dVertexDivisor(const SVGA3dVertexDivisor *cmd) { - debug_printf("\t\t.value = %u\n", (*cmd).value); - debug_printf("\t\t.count = %u\n", (*cmd).count); - debug_printf("\t\t.indexedData = %u\n", (*cmd).indexedData); - debug_printf("\t\t.instanceData = %u\n", (*cmd).instanceData); + _debug_printf("\t\t.value = %u\n", (*cmd).value); + _debug_printf("\t\t.count = %u\n", (*cmd).count); + _debug_printf("\t\t.indexedData = %u\n", (*cmd).indexedData); + _debug_printf("\t\t.instanceData = %u\n", (*cmd).instanceData); } static void dump_SVGA3dCmdDefineShader(const SVGA3dCmdDefineShader *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.shid = %u\n", (*cmd).shid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.shid = %u\n", (*cmd).shid); switch((*cmd).type) { case SVGA3D_SHADERTYPE_COMPILED_DX8: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); break; case SVGA3D_SHADERTYPE_VS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); break; case SVGA3D_SHADERTYPE_PS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); break; case SVGA3D_SHADERTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } } @@ -936,53 +936,53 @@ dump_SVGA3dCmdDefineShader(const SVGA3dCmdDefineShader *cmd) static void dump_SVGA3dCmdSetShaderConst(const SVGA3dCmdSetShaderConst *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.reg = %u\n", (*cmd).reg); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.reg = %u\n", (*cmd).reg); switch((*cmd).type) { case SVGA3D_SHADERTYPE_COMPILED_DX8: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); break; case SVGA3D_SHADERTYPE_VS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); break; case SVGA3D_SHADERTYPE_PS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); break; case SVGA3D_SHADERTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } switch((*cmd).ctype) { case SVGA3D_CONST_TYPE_FLOAT: - debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_FLOAT\n"); - debug_printf("\t\t.values[0] = %f\n", *(const float *)&(*cmd).values[0]); - debug_printf("\t\t.values[1] = %f\n", *(const float *)&(*cmd).values[1]); - debug_printf("\t\t.values[2] = %f\n", *(const float *)&(*cmd).values[2]); - debug_printf("\t\t.values[3] = %f\n", *(const float *)&(*cmd).values[3]); + _debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_FLOAT\n"); + _debug_printf("\t\t.values[0] = %f\n", *(const float *)&(*cmd).values[0]); + _debug_printf("\t\t.values[1] = %f\n", *(const float *)&(*cmd).values[1]); + _debug_printf("\t\t.values[2] = %f\n", *(const float *)&(*cmd).values[2]); + _debug_printf("\t\t.values[3] = %f\n", *(const float *)&(*cmd).values[3]); break; case SVGA3D_CONST_TYPE_INT: - debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_INT\n"); - debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); - debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); - debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); - debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); + _debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_INT\n"); + _debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); + _debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); + _debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); + _debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); break; case SVGA3D_CONST_TYPE_BOOL: - debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_BOOL\n"); - debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); - debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); - debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); - debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); + _debug_printf("\t\t.ctype = SVGA3D_CONST_TYPE_BOOL\n"); + _debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); + _debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); + _debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); + _debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); break; default: - debug_printf("\t\t.ctype = %i\n", (*cmd).ctype); - debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); - debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); - debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); - debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); + _debug_printf("\t\t.ctype = %i\n", (*cmd).ctype); + _debug_printf("\t\t.values[0] = %u\n", (*cmd).values[0]); + _debug_printf("\t\t.values[1] = %u\n", (*cmd).values[1]); + _debug_printf("\t\t.values[2] = %u\n", (*cmd).values[2]); + _debug_printf("\t\t.values[3] = %u\n", (*cmd).values[3]); break; } } @@ -990,25 +990,25 @@ dump_SVGA3dCmdSetShaderConst(const SVGA3dCmdSetShaderConst *cmd) static void dump_SVGA3dCmdSetZRange(const SVGA3dCmdSetZRange *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.zRange.min = %f\n", (*cmd).zRange.min); - debug_printf("\t\t.zRange.max = %f\n", (*cmd).zRange.max); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.zRange.min = %f\n", (*cmd).zRange.min); + _debug_printf("\t\t.zRange.max = %f\n", (*cmd).zRange.max); } static void dump_SVGA3dCmdDrawPrimitives(const SVGA3dCmdDrawPrimitives *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.numVertexDecls = %u\n", (*cmd).numVertexDecls); - debug_printf("\t\t.numRanges = %u\n", (*cmd).numRanges); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.numVertexDecls = %u\n", (*cmd).numVertexDecls); + _debug_printf("\t\t.numRanges = %u\n", (*cmd).numRanges); } static void dump_SVGA3dCmdSetLightEnabled(const SVGA3dCmdSetLightEnabled *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.index = %u\n", (*cmd).index); - debug_printf("\t\t.enabled = %u\n", (*cmd).enabled); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.index = %u\n", (*cmd).index); + _debug_printf("\t\t.enabled = %u\n", (*cmd).enabled); } static void @@ -1016,86 +1016,86 @@ dump_SVGA3dPrimitiveRange(const SVGA3dPrimitiveRange *cmd) { switch((*cmd).primType) { case SVGA3D_PRIMITIVE_INVALID: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_INVALID\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_INVALID\n"); break; case SVGA3D_PRIMITIVE_TRIANGLELIST: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLELIST\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLELIST\n"); break; case SVGA3D_PRIMITIVE_POINTLIST: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_POINTLIST\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_POINTLIST\n"); break; case SVGA3D_PRIMITIVE_LINELIST: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_LINELIST\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_LINELIST\n"); break; case SVGA3D_PRIMITIVE_LINESTRIP: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_LINESTRIP\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_LINESTRIP\n"); break; case SVGA3D_PRIMITIVE_TRIANGLESTRIP: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLESTRIP\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLESTRIP\n"); break; case SVGA3D_PRIMITIVE_TRIANGLEFAN: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLEFAN\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_TRIANGLEFAN\n"); break; case SVGA3D_PRIMITIVE_MAX: - debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_MAX\n"); + _debug_printf("\t\t.primType = SVGA3D_PRIMITIVE_MAX\n"); break; default: - debug_printf("\t\t.primType = %i\n", (*cmd).primType); + _debug_printf("\t\t.primType = %i\n", (*cmd).primType); break; } - debug_printf("\t\t.primitiveCount = %u\n", (*cmd).primitiveCount); - debug_printf("\t\t.indexArray.surfaceId = %u\n", (*cmd).indexArray.surfaceId); - debug_printf("\t\t.indexArray.offset = %u\n", (*cmd).indexArray.offset); - debug_printf("\t\t.indexArray.stride = %u\n", (*cmd).indexArray.stride); - debug_printf("\t\t.indexWidth = %u\n", (*cmd).indexWidth); - debug_printf("\t\t.indexBias = %i\n", (*cmd).indexBias); + _debug_printf("\t\t.primitiveCount = %u\n", (*cmd).primitiveCount); + _debug_printf("\t\t.indexArray.surfaceId = %u\n", (*cmd).indexArray.surfaceId); + _debug_printf("\t\t.indexArray.offset = %u\n", (*cmd).indexArray.offset); + _debug_printf("\t\t.indexArray.stride = %u\n", (*cmd).indexArray.stride); + _debug_printf("\t\t.indexWidth = %u\n", (*cmd).indexWidth); + _debug_printf("\t\t.indexBias = %i\n", (*cmd).indexBias); } static void dump_SVGA3dCmdPresent(const SVGA3dCmdPresent *cmd) { - debug_printf("\t\t.sid = %u\n", (*cmd).sid); + _debug_printf("\t\t.sid = %u\n", (*cmd).sid); } static void dump_SVGA3dCmdSetRenderState(const SVGA3dCmdSetRenderState *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); } static void dump_SVGA3dCmdSurfaceStretchBlt(const SVGA3dCmdSurfaceStretchBlt *cmd) { - debug_printf("\t\t.src.sid = %u\n", (*cmd).src.sid); - debug_printf("\t\t.src.face = %u\n", (*cmd).src.face); - debug_printf("\t\t.src.mipmap = %u\n", (*cmd).src.mipmap); - debug_printf("\t\t.dest.sid = %u\n", (*cmd).dest.sid); - debug_printf("\t\t.dest.face = %u\n", (*cmd).dest.face); - debug_printf("\t\t.dest.mipmap = %u\n", (*cmd).dest.mipmap); - debug_printf("\t\t.boxSrc.x = %u\n", (*cmd).boxSrc.x); - debug_printf("\t\t.boxSrc.y = %u\n", (*cmd).boxSrc.y); - debug_printf("\t\t.boxSrc.z = %u\n", (*cmd).boxSrc.z); - debug_printf("\t\t.boxSrc.w = %u\n", (*cmd).boxSrc.w); - debug_printf("\t\t.boxSrc.h = %u\n", (*cmd).boxSrc.h); - debug_printf("\t\t.boxSrc.d = %u\n", (*cmd).boxSrc.d); - debug_printf("\t\t.boxDest.x = %u\n", (*cmd).boxDest.x); - debug_printf("\t\t.boxDest.y = %u\n", (*cmd).boxDest.y); - debug_printf("\t\t.boxDest.z = %u\n", (*cmd).boxDest.z); - debug_printf("\t\t.boxDest.w = %u\n", (*cmd).boxDest.w); - debug_printf("\t\t.boxDest.h = %u\n", (*cmd).boxDest.h); - debug_printf("\t\t.boxDest.d = %u\n", (*cmd).boxDest.d); + _debug_printf("\t\t.src.sid = %u\n", (*cmd).src.sid); + _debug_printf("\t\t.src.face = %u\n", (*cmd).src.face); + _debug_printf("\t\t.src.mipmap = %u\n", (*cmd).src.mipmap); + _debug_printf("\t\t.dest.sid = %u\n", (*cmd).dest.sid); + _debug_printf("\t\t.dest.face = %u\n", (*cmd).dest.face); + _debug_printf("\t\t.dest.mipmap = %u\n", (*cmd).dest.mipmap); + _debug_printf("\t\t.boxSrc.x = %u\n", (*cmd).boxSrc.x); + _debug_printf("\t\t.boxSrc.y = %u\n", (*cmd).boxSrc.y); + _debug_printf("\t\t.boxSrc.z = %u\n", (*cmd).boxSrc.z); + _debug_printf("\t\t.boxSrc.w = %u\n", (*cmd).boxSrc.w); + _debug_printf("\t\t.boxSrc.h = %u\n", (*cmd).boxSrc.h); + _debug_printf("\t\t.boxSrc.d = %u\n", (*cmd).boxSrc.d); + _debug_printf("\t\t.boxDest.x = %u\n", (*cmd).boxDest.x); + _debug_printf("\t\t.boxDest.y = %u\n", (*cmd).boxDest.y); + _debug_printf("\t\t.boxDest.z = %u\n", (*cmd).boxDest.z); + _debug_printf("\t\t.boxDest.w = %u\n", (*cmd).boxDest.w); + _debug_printf("\t\t.boxDest.h = %u\n", (*cmd).boxDest.h); + _debug_printf("\t\t.boxDest.d = %u\n", (*cmd).boxDest.d); switch((*cmd).mode) { case SVGA3D_STRETCH_BLT_POINT: - debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_POINT\n"); + _debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_POINT\n"); break; case SVGA3D_STRETCH_BLT_LINEAR: - debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_LINEAR\n"); + _debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_LINEAR\n"); break; case SVGA3D_STRETCH_BLT_MAX: - debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_MAX\n"); + _debug_printf("\t\t.mode = SVGA3D_STRETCH_BLT_MAX\n"); break; default: - debug_printf("\t\t.mode = %i\n", (*cmd).mode); + _debug_printf("\t\t.mode = %i\n", (*cmd).mode); break; } } @@ -1103,21 +1103,21 @@ dump_SVGA3dCmdSurfaceStretchBlt(const SVGA3dCmdSurfaceStretchBlt *cmd) static void dump_SVGA3dCmdSurfaceDMA(const SVGA3dCmdSurfaceDMA *cmd) { - debug_printf("\t\t.guest.ptr.gmrId = %u\n", (*cmd).guest.ptr.gmrId); - debug_printf("\t\t.guest.ptr.offset = %u\n", (*cmd).guest.ptr.offset); - debug_printf("\t\t.guest.pitch = %u\n", (*cmd).guest.pitch); - debug_printf("\t\t.host.sid = %u\n", (*cmd).host.sid); - debug_printf("\t\t.host.face = %u\n", (*cmd).host.face); - debug_printf("\t\t.host.mipmap = %u\n", (*cmd).host.mipmap); + _debug_printf("\t\t.guest.ptr.gmrId = %u\n", (*cmd).guest.ptr.gmrId); + _debug_printf("\t\t.guest.ptr.offset = %u\n", (*cmd).guest.ptr.offset); + _debug_printf("\t\t.guest.pitch = %u\n", (*cmd).guest.pitch); + _debug_printf("\t\t.host.sid = %u\n", (*cmd).host.sid); + _debug_printf("\t\t.host.face = %u\n", (*cmd).host.face); + _debug_printf("\t\t.host.mipmap = %u\n", (*cmd).host.mipmap); switch((*cmd).transfer) { case SVGA3D_WRITE_HOST_VRAM: - debug_printf("\t\t.transfer = SVGA3D_WRITE_HOST_VRAM\n"); + _debug_printf("\t\t.transfer = SVGA3D_WRITE_HOST_VRAM\n"); break; case SVGA3D_READ_HOST_VRAM: - debug_printf("\t\t.transfer = SVGA3D_READ_HOST_VRAM\n"); + _debug_printf("\t\t.transfer = SVGA3D_READ_HOST_VRAM\n"); break; default: - debug_printf("\t\t.transfer = %i\n", (*cmd).transfer); + _debug_printf("\t\t.transfer = %i\n", (*cmd).transfer); break; } } @@ -1125,107 +1125,107 @@ dump_SVGA3dCmdSurfaceDMA(const SVGA3dCmdSurfaceDMA *cmd) static void dump_SVGA3dCmdSurfaceDMASuffix(const SVGA3dCmdSurfaceDMASuffix *cmd) { - debug_printf("\t\t.suffixSize = %u\n", (*cmd).suffixSize); - debug_printf("\t\t.maximumOffset = %u\n", (*cmd).maximumOffset); - debug_printf("\t\t.flags.discard = %u\n", (*cmd).flags.discard); - debug_printf("\t\t.flags.unsynchronized = %u\n", (*cmd).flags.unsynchronized); + _debug_printf("\t\t.suffixSize = %u\n", (*cmd).suffixSize); + _debug_printf("\t\t.maximumOffset = %u\n", (*cmd).maximumOffset); + _debug_printf("\t\t.flags.discard = %u\n", (*cmd).flags.discard); + _debug_printf("\t\t.flags.unsynchronized = %u\n", (*cmd).flags.unsynchronized); } static void dump_SVGA3dCmdSetTransform(const SVGA3dCmdSetTransform *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).type) { case SVGA3D_TRANSFORM_INVALID: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_INVALID\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_INVALID\n"); break; case SVGA3D_TRANSFORM_WORLD: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD\n"); break; case SVGA3D_TRANSFORM_VIEW: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_VIEW\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_VIEW\n"); break; case SVGA3D_TRANSFORM_PROJECTION: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_PROJECTION\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_PROJECTION\n"); break; case SVGA3D_TRANSFORM_TEXTURE0: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE0\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE0\n"); break; case SVGA3D_TRANSFORM_TEXTURE1: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE1\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE1\n"); break; case SVGA3D_TRANSFORM_TEXTURE2: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE2\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE2\n"); break; case SVGA3D_TRANSFORM_TEXTURE3: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE3\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE3\n"); break; case SVGA3D_TRANSFORM_TEXTURE4: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE4\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE4\n"); break; case SVGA3D_TRANSFORM_TEXTURE5: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE5\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE5\n"); break; case SVGA3D_TRANSFORM_TEXTURE6: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE6\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE6\n"); break; case SVGA3D_TRANSFORM_TEXTURE7: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE7\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_TEXTURE7\n"); break; case SVGA3D_TRANSFORM_WORLD1: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD1\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD1\n"); break; case SVGA3D_TRANSFORM_WORLD2: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD2\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD2\n"); break; case SVGA3D_TRANSFORM_WORLD3: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD3\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_WORLD3\n"); break; case SVGA3D_TRANSFORM_MAX: - debug_printf("\t\t.type = SVGA3D_TRANSFORM_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_TRANSFORM_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } - debug_printf("\t\t.matrix[0] = %f\n", (*cmd).matrix[0]); - debug_printf("\t\t.matrix[1] = %f\n", (*cmd).matrix[1]); - debug_printf("\t\t.matrix[2] = %f\n", (*cmd).matrix[2]); - debug_printf("\t\t.matrix[3] = %f\n", (*cmd).matrix[3]); - debug_printf("\t\t.matrix[4] = %f\n", (*cmd).matrix[4]); - debug_printf("\t\t.matrix[5] = %f\n", (*cmd).matrix[5]); - debug_printf("\t\t.matrix[6] = %f\n", (*cmd).matrix[6]); - debug_printf("\t\t.matrix[7] = %f\n", (*cmd).matrix[7]); - debug_printf("\t\t.matrix[8] = %f\n", (*cmd).matrix[8]); - debug_printf("\t\t.matrix[9] = %f\n", (*cmd).matrix[9]); - debug_printf("\t\t.matrix[10] = %f\n", (*cmd).matrix[10]); - debug_printf("\t\t.matrix[11] = %f\n", (*cmd).matrix[11]); - debug_printf("\t\t.matrix[12] = %f\n", (*cmd).matrix[12]); - debug_printf("\t\t.matrix[13] = %f\n", (*cmd).matrix[13]); - debug_printf("\t\t.matrix[14] = %f\n", (*cmd).matrix[14]); - debug_printf("\t\t.matrix[15] = %f\n", (*cmd).matrix[15]); + _debug_printf("\t\t.matrix[0] = %f\n", (*cmd).matrix[0]); + _debug_printf("\t\t.matrix[1] = %f\n", (*cmd).matrix[1]); + _debug_printf("\t\t.matrix[2] = %f\n", (*cmd).matrix[2]); + _debug_printf("\t\t.matrix[3] = %f\n", (*cmd).matrix[3]); + _debug_printf("\t\t.matrix[4] = %f\n", (*cmd).matrix[4]); + _debug_printf("\t\t.matrix[5] = %f\n", (*cmd).matrix[5]); + _debug_printf("\t\t.matrix[6] = %f\n", (*cmd).matrix[6]); + _debug_printf("\t\t.matrix[7] = %f\n", (*cmd).matrix[7]); + _debug_printf("\t\t.matrix[8] = %f\n", (*cmd).matrix[8]); + _debug_printf("\t\t.matrix[9] = %f\n", (*cmd).matrix[9]); + _debug_printf("\t\t.matrix[10] = %f\n", (*cmd).matrix[10]); + _debug_printf("\t\t.matrix[11] = %f\n", (*cmd).matrix[11]); + _debug_printf("\t\t.matrix[12] = %f\n", (*cmd).matrix[12]); + _debug_printf("\t\t.matrix[13] = %f\n", (*cmd).matrix[13]); + _debug_printf("\t\t.matrix[14] = %f\n", (*cmd).matrix[14]); + _debug_printf("\t\t.matrix[15] = %f\n", (*cmd).matrix[15]); } static void dump_SVGA3dCmdDestroyShader(const SVGA3dCmdDestroyShader *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); - debug_printf("\t\t.shid = %u\n", (*cmd).shid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.shid = %u\n", (*cmd).shid); switch((*cmd).type) { case SVGA3D_SHADERTYPE_COMPILED_DX8: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_COMPILED_DX8\n"); break; case SVGA3D_SHADERTYPE_VS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_VS\n"); break; case SVGA3D_SHADERTYPE_PS: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_PS\n"); break; case SVGA3D_SHADERTYPE_MAX: - debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); + _debug_printf("\t\t.type = SVGA3D_SHADERTYPE_MAX\n"); break; default: - debug_printf("\t\t.type = %i\n", (*cmd).type); + _debug_printf("\t\t.type = %i\n", (*cmd).type); break; } } @@ -1233,187 +1233,187 @@ dump_SVGA3dCmdDestroyShader(const SVGA3dCmdDestroyShader *cmd) static void dump_SVGA3dCmdDestroyContext(const SVGA3dCmdDestroyContext *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); } static void dump_SVGA3dCmdClear(const SVGA3dCmdClear *cmd) { - debug_printf("\t\t.cid = %u\n", (*cmd).cid); + _debug_printf("\t\t.cid = %u\n", (*cmd).cid); switch((*cmd).clearFlag) { case SVGA3D_CLEAR_COLOR: - debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_COLOR\n"); + _debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_COLOR\n"); break; case SVGA3D_CLEAR_DEPTH: - debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_DEPTH\n"); + _debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_DEPTH\n"); break; case SVGA3D_CLEAR_STENCIL: - debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_STENCIL\n"); + _debug_printf("\t\t.clearFlag = SVGA3D_CLEAR_STENCIL\n"); break; default: - debug_printf("\t\t.clearFlag = %i\n", (*cmd).clearFlag); + _debug_printf("\t\t.clearFlag = %i\n", (*cmd).clearFlag); break; } - debug_printf("\t\t.color = %u\n", (*cmd).color); - debug_printf("\t\t.depth = %f\n", (*cmd).depth); - debug_printf("\t\t.stencil = %u\n", (*cmd).stencil); + _debug_printf("\t\t.color = %u\n", (*cmd).color); + _debug_printf("\t\t.depth = %f\n", (*cmd).depth); + _debug_printf("\t\t.stencil = %u\n", (*cmd).stencil); } static void dump_SVGA3dCmdDefineSurface(const SVGA3dCmdDefineSurface *cmd) { - debug_printf("\t\t.sid = %u\n", (*cmd).sid); + _debug_printf("\t\t.sid = %u\n", (*cmd).sid); switch((*cmd).surfaceFlags) { case SVGA3D_SURFACE_CUBEMAP: - debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_CUBEMAP\n"); + _debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_CUBEMAP\n"); break; case SVGA3D_SURFACE_HINT_STATIC: - debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_STATIC\n"); + _debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_STATIC\n"); break; case SVGA3D_SURFACE_HINT_DYNAMIC: - debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_DYNAMIC\n"); + _debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_DYNAMIC\n"); break; case SVGA3D_SURFACE_HINT_INDEXBUFFER: - debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_INDEXBUFFER\n"); + _debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_INDEXBUFFER\n"); break; case SVGA3D_SURFACE_HINT_VERTEXBUFFER: - debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_VERTEXBUFFER\n"); + _debug_printf("\t\t.surfaceFlags = SVGA3D_SURFACE_HINT_VERTEXBUFFER\n"); break; default: - debug_printf("\t\t.surfaceFlags = %i\n", (*cmd).surfaceFlags); + _debug_printf("\t\t.surfaceFlags = %i\n", (*cmd).surfaceFlags); break; } switch((*cmd).format) { case SVGA3D_FORMAT_INVALID: - debug_printf("\t\t.format = SVGA3D_FORMAT_INVALID\n"); + _debug_printf("\t\t.format = SVGA3D_FORMAT_INVALID\n"); break; case SVGA3D_X8R8G8B8: - debug_printf("\t\t.format = SVGA3D_X8R8G8B8\n"); + _debug_printf("\t\t.format = SVGA3D_X8R8G8B8\n"); break; case SVGA3D_A8R8G8B8: - debug_printf("\t\t.format = SVGA3D_A8R8G8B8\n"); + _debug_printf("\t\t.format = SVGA3D_A8R8G8B8\n"); break; case SVGA3D_R5G6B5: - debug_printf("\t\t.format = SVGA3D_R5G6B5\n"); + _debug_printf("\t\t.format = SVGA3D_R5G6B5\n"); break; case SVGA3D_X1R5G5B5: - debug_printf("\t\t.format = SVGA3D_X1R5G5B5\n"); + _debug_printf("\t\t.format = SVGA3D_X1R5G5B5\n"); break; case SVGA3D_A1R5G5B5: - debug_printf("\t\t.format = SVGA3D_A1R5G5B5\n"); + _debug_printf("\t\t.format = SVGA3D_A1R5G5B5\n"); break; case SVGA3D_A4R4G4B4: - debug_printf("\t\t.format = SVGA3D_A4R4G4B4\n"); + _debug_printf("\t\t.format = SVGA3D_A4R4G4B4\n"); break; case SVGA3D_Z_D32: - debug_printf("\t\t.format = SVGA3D_Z_D32\n"); + _debug_printf("\t\t.format = SVGA3D_Z_D32\n"); break; case SVGA3D_Z_D16: - debug_printf("\t\t.format = SVGA3D_Z_D16\n"); + _debug_printf("\t\t.format = SVGA3D_Z_D16\n"); break; case SVGA3D_Z_D24S8: - debug_printf("\t\t.format = SVGA3D_Z_D24S8\n"); + _debug_printf("\t\t.format = SVGA3D_Z_D24S8\n"); break; case SVGA3D_Z_D15S1: - debug_printf("\t\t.format = SVGA3D_Z_D15S1\n"); + _debug_printf("\t\t.format = SVGA3D_Z_D15S1\n"); break; case SVGA3D_LUMINANCE8: - debug_printf("\t\t.format = SVGA3D_LUMINANCE8\n"); + _debug_printf("\t\t.format = SVGA3D_LUMINANCE8\n"); break; case SVGA3D_LUMINANCE4_ALPHA4: - debug_printf("\t\t.format = SVGA3D_LUMINANCE4_ALPHA4\n"); + _debug_printf("\t\t.format = SVGA3D_LUMINANCE4_ALPHA4\n"); break; case SVGA3D_LUMINANCE16: - debug_printf("\t\t.format = SVGA3D_LUMINANCE16\n"); + _debug_printf("\t\t.format = SVGA3D_LUMINANCE16\n"); break; case SVGA3D_LUMINANCE8_ALPHA8: - debug_printf("\t\t.format = SVGA3D_LUMINANCE8_ALPHA8\n"); + _debug_printf("\t\t.format = SVGA3D_LUMINANCE8_ALPHA8\n"); break; case SVGA3D_DXT1: - debug_printf("\t\t.format = SVGA3D_DXT1\n"); + _debug_printf("\t\t.format = SVGA3D_DXT1\n"); break; case SVGA3D_DXT2: - debug_printf("\t\t.format = SVGA3D_DXT2\n"); + _debug_printf("\t\t.format = SVGA3D_DXT2\n"); break; case SVGA3D_DXT3: - debug_printf("\t\t.format = SVGA3D_DXT3\n"); + _debug_printf("\t\t.format = SVGA3D_DXT3\n"); break; case SVGA3D_DXT4: - debug_printf("\t\t.format = SVGA3D_DXT4\n"); + _debug_printf("\t\t.format = SVGA3D_DXT4\n"); break; case SVGA3D_DXT5: - debug_printf("\t\t.format = SVGA3D_DXT5\n"); + _debug_printf("\t\t.format = SVGA3D_DXT5\n"); break; case SVGA3D_BUMPU8V8: - debug_printf("\t\t.format = SVGA3D_BUMPU8V8\n"); + _debug_printf("\t\t.format = SVGA3D_BUMPU8V8\n"); break; case SVGA3D_BUMPL6V5U5: - debug_printf("\t\t.format = SVGA3D_BUMPL6V5U5\n"); + _debug_printf("\t\t.format = SVGA3D_BUMPL6V5U5\n"); break; case SVGA3D_BUMPX8L8V8U8: - debug_printf("\t\t.format = SVGA3D_BUMPX8L8V8U8\n"); + _debug_printf("\t\t.format = SVGA3D_BUMPX8L8V8U8\n"); break; case SVGA3D_BUMPL8V8U8: - debug_printf("\t\t.format = SVGA3D_BUMPL8V8U8\n"); + _debug_printf("\t\t.format = SVGA3D_BUMPL8V8U8\n"); break; case SVGA3D_ARGB_S10E5: - debug_printf("\t\t.format = SVGA3D_ARGB_S10E5\n"); + _debug_printf("\t\t.format = SVGA3D_ARGB_S10E5\n"); break; case SVGA3D_ARGB_S23E8: - debug_printf("\t\t.format = SVGA3D_ARGB_S23E8\n"); + _debug_printf("\t\t.format = SVGA3D_ARGB_S23E8\n"); break; case SVGA3D_A2R10G10B10: - debug_printf("\t\t.format = SVGA3D_A2R10G10B10\n"); + _debug_printf("\t\t.format = SVGA3D_A2R10G10B10\n"); break; case SVGA3D_V8U8: - debug_printf("\t\t.format = SVGA3D_V8U8\n"); + _debug_printf("\t\t.format = SVGA3D_V8U8\n"); break; case SVGA3D_Q8W8V8U8: - debug_printf("\t\t.format = SVGA3D_Q8W8V8U8\n"); + _debug_printf("\t\t.format = SVGA3D_Q8W8V8U8\n"); break; case SVGA3D_CxV8U8: - debug_printf("\t\t.format = SVGA3D_CxV8U8\n"); + _debug_printf("\t\t.format = SVGA3D_CxV8U8\n"); break; case SVGA3D_X8L8V8U8: - debug_printf("\t\t.format = SVGA3D_X8L8V8U8\n"); + _debug_printf("\t\t.format = SVGA3D_X8L8V8U8\n"); break; case SVGA3D_A2W10V10U10: - debug_printf("\t\t.format = SVGA3D_A2W10V10U10\n"); + _debug_printf("\t\t.format = SVGA3D_A2W10V10U10\n"); break; case SVGA3D_ALPHA8: - debug_printf("\t\t.format = SVGA3D_ALPHA8\n"); + _debug_printf("\t\t.format = SVGA3D_ALPHA8\n"); break; case SVGA3D_R_S10E5: - debug_printf("\t\t.format = SVGA3D_R_S10E5\n"); + _debug_printf("\t\t.format = SVGA3D_R_S10E5\n"); break; case SVGA3D_R_S23E8: - debug_printf("\t\t.format = SVGA3D_R_S23E8\n"); + _debug_printf("\t\t.format = SVGA3D_R_S23E8\n"); break; case SVGA3D_RG_S10E5: - debug_printf("\t\t.format = SVGA3D_RG_S10E5\n"); + _debug_printf("\t\t.format = SVGA3D_RG_S10E5\n"); break; case SVGA3D_RG_S23E8: - debug_printf("\t\t.format = SVGA3D_RG_S23E8\n"); + _debug_printf("\t\t.format = SVGA3D_RG_S23E8\n"); break; case SVGA3D_BUFFER: - debug_printf("\t\t.format = SVGA3D_BUFFER\n"); + _debug_printf("\t\t.format = SVGA3D_BUFFER\n"); break; case SVGA3D_Z_D24X8: - debug_printf("\t\t.format = SVGA3D_Z_D24X8\n"); + _debug_printf("\t\t.format = SVGA3D_Z_D24X8\n"); break; case SVGA3D_FORMAT_MAX: - debug_printf("\t\t.format = SVGA3D_FORMAT_MAX\n"); + _debug_printf("\t\t.format = SVGA3D_FORMAT_MAX\n"); break; default: - debug_printf("\t\t.format = %i\n", (*cmd).format); + _debug_printf("\t\t.format = %i\n", (*cmd).format); break; } - debug_printf("\t\t.face[0].numMipLevels = %u\n", (*cmd).face[0].numMipLevels); - debug_printf("\t\t.face[1].numMipLevels = %u\n", (*cmd).face[1].numMipLevels); - debug_printf("\t\t.face[2].numMipLevels = %u\n", (*cmd).face[2].numMipLevels); - debug_printf("\t\t.face[3].numMipLevels = %u\n", (*cmd).face[3].numMipLevels); - debug_printf("\t\t.face[4].numMipLevels = %u\n", (*cmd).face[4].numMipLevels); - debug_printf("\t\t.face[5].numMipLevels = %u\n", (*cmd).face[5].numMipLevels); + _debug_printf("\t\t.face[0].numMipLevels = %u\n", (*cmd).face[0].numMipLevels); + _debug_printf("\t\t.face[1].numMipLevels = %u\n", (*cmd).face[1].numMipLevels); + _debug_printf("\t\t.face[2].numMipLevels = %u\n", (*cmd).face[2].numMipLevels); + _debug_printf("\t\t.face[3].numMipLevels = %u\n", (*cmd).face[3].numMipLevels); + _debug_printf("\t\t.face[4].numMipLevels = %u\n", (*cmd).face[4].numMipLevels); + _debug_printf("\t\t.face[5].numMipLevels = %u\n", (*cmd).face[5].numMipLevels); } @@ -1438,7 +1438,7 @@ svga_dump_commands(const void *commands, uint32_t size) switch(cmd_id) { case SVGA_3D_CMD_SURFACE_DEFINE: - debug_printf("\tSVGA_3D_CMD_SURFACE_DEFINE\n"); + _debug_printf("\tSVGA_3D_CMD_SURFACE_DEFINE\n"); { const SVGA3dCmdDefineSurface *cmd = (const SVGA3dCmdDefineSurface *)body; dump_SVGA3dCmdDefineSurface(cmd); @@ -1450,7 +1450,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SURFACE_DESTROY: - debug_printf("\tSVGA_3D_CMD_SURFACE_DESTROY\n"); + _debug_printf("\tSVGA_3D_CMD_SURFACE_DESTROY\n"); { const SVGA3dCmdDestroySurface *cmd = (const SVGA3dCmdDestroySurface *)body; dump_SVGA3dCmdDestroySurface(cmd); @@ -1458,7 +1458,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SURFACE_COPY: - debug_printf("\tSVGA_3D_CMD_SURFACE_COPY\n"); + _debug_printf("\tSVGA_3D_CMD_SURFACE_COPY\n"); { const SVGA3dCmdSurfaceCopy *cmd = (const SVGA3dCmdSurfaceCopy *)body; dump_SVGA3dCmdSurfaceCopy(cmd); @@ -1470,7 +1470,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SURFACE_STRETCHBLT: - debug_printf("\tSVGA_3D_CMD_SURFACE_STRETCHBLT\n"); + _debug_printf("\tSVGA_3D_CMD_SURFACE_STRETCHBLT\n"); { const SVGA3dCmdSurfaceStretchBlt *cmd = (const SVGA3dCmdSurfaceStretchBlt *)body; dump_SVGA3dCmdSurfaceStretchBlt(cmd); @@ -1478,7 +1478,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SURFACE_DMA: - debug_printf("\tSVGA_3D_CMD_SURFACE_DMA\n"); + _debug_printf("\tSVGA_3D_CMD_SURFACE_DMA\n"); { const SVGA3dCmdSurfaceDMA *cmd = (const SVGA3dCmdSurfaceDMA *)body; dump_SVGA3dCmdSurfaceDMA(cmd); @@ -1494,7 +1494,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_CONTEXT_DEFINE: - debug_printf("\tSVGA_3D_CMD_CONTEXT_DEFINE\n"); + _debug_printf("\tSVGA_3D_CMD_CONTEXT_DEFINE\n"); { const SVGA3dCmdDefineContext *cmd = (const SVGA3dCmdDefineContext *)body; dump_SVGA3dCmdDefineContext(cmd); @@ -1502,7 +1502,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_CONTEXT_DESTROY: - debug_printf("\tSVGA_3D_CMD_CONTEXT_DESTROY\n"); + _debug_printf("\tSVGA_3D_CMD_CONTEXT_DESTROY\n"); { const SVGA3dCmdDestroyContext *cmd = (const SVGA3dCmdDestroyContext *)body; dump_SVGA3dCmdDestroyContext(cmd); @@ -1510,7 +1510,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETTRANSFORM: - debug_printf("\tSVGA_3D_CMD_SETTRANSFORM\n"); + _debug_printf("\tSVGA_3D_CMD_SETTRANSFORM\n"); { const SVGA3dCmdSetTransform *cmd = (const SVGA3dCmdSetTransform *)body; dump_SVGA3dCmdSetTransform(cmd); @@ -1518,7 +1518,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETZRANGE: - debug_printf("\tSVGA_3D_CMD_SETZRANGE\n"); + _debug_printf("\tSVGA_3D_CMD_SETZRANGE\n"); { const SVGA3dCmdSetZRange *cmd = (const SVGA3dCmdSetZRange *)body; dump_SVGA3dCmdSetZRange(cmd); @@ -1526,7 +1526,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETRENDERSTATE: - debug_printf("\tSVGA_3D_CMD_SETRENDERSTATE\n"); + _debug_printf("\tSVGA_3D_CMD_SETRENDERSTATE\n"); { const SVGA3dCmdSetRenderState *cmd = (const SVGA3dCmdSetRenderState *)body; dump_SVGA3dCmdSetRenderState(cmd); @@ -1538,7 +1538,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETRENDERTARGET: - debug_printf("\tSVGA_3D_CMD_SETRENDERTARGET\n"); + _debug_printf("\tSVGA_3D_CMD_SETRENDERTARGET\n"); { const SVGA3dCmdSetRenderTarget *cmd = (const SVGA3dCmdSetRenderTarget *)body; dump_SVGA3dCmdSetRenderTarget(cmd); @@ -1546,7 +1546,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETTEXTURESTATE: - debug_printf("\tSVGA_3D_CMD_SETTEXTURESTATE\n"); + _debug_printf("\tSVGA_3D_CMD_SETTEXTURESTATE\n"); { const SVGA3dCmdSetTextureState *cmd = (const SVGA3dCmdSetTextureState *)body; dump_SVGA3dCmdSetTextureState(cmd); @@ -1558,7 +1558,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETMATERIAL: - debug_printf("\tSVGA_3D_CMD_SETMATERIAL\n"); + _debug_printf("\tSVGA_3D_CMD_SETMATERIAL\n"); { const SVGA3dCmdSetMaterial *cmd = (const SVGA3dCmdSetMaterial *)body; dump_SVGA3dCmdSetMaterial(cmd); @@ -1566,7 +1566,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETLIGHTDATA: - debug_printf("\tSVGA_3D_CMD_SETLIGHTDATA\n"); + _debug_printf("\tSVGA_3D_CMD_SETLIGHTDATA\n"); { const SVGA3dCmdSetLightData *cmd = (const SVGA3dCmdSetLightData *)body; dump_SVGA3dCmdSetLightData(cmd); @@ -1574,7 +1574,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETLIGHTENABLED: - debug_printf("\tSVGA_3D_CMD_SETLIGHTENABLED\n"); + _debug_printf("\tSVGA_3D_CMD_SETLIGHTENABLED\n"); { const SVGA3dCmdSetLightEnabled *cmd = (const SVGA3dCmdSetLightEnabled *)body; dump_SVGA3dCmdSetLightEnabled(cmd); @@ -1582,7 +1582,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETVIEWPORT: - debug_printf("\tSVGA_3D_CMD_SETVIEWPORT\n"); + _debug_printf("\tSVGA_3D_CMD_SETVIEWPORT\n"); { const SVGA3dCmdSetViewport *cmd = (const SVGA3dCmdSetViewport *)body; dump_SVGA3dCmdSetViewport(cmd); @@ -1590,7 +1590,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETCLIPPLANE: - debug_printf("\tSVGA_3D_CMD_SETCLIPPLANE\n"); + _debug_printf("\tSVGA_3D_CMD_SETCLIPPLANE\n"); { const SVGA3dCmdSetClipPlane *cmd = (const SVGA3dCmdSetClipPlane *)body; dump_SVGA3dCmdSetClipPlane(cmd); @@ -1598,7 +1598,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_CLEAR: - debug_printf("\tSVGA_3D_CMD_CLEAR\n"); + _debug_printf("\tSVGA_3D_CMD_CLEAR\n"); { const SVGA3dCmdClear *cmd = (const SVGA3dCmdClear *)body; dump_SVGA3dCmdClear(cmd); @@ -1610,7 +1610,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_PRESENT: - debug_printf("\tSVGA_3D_CMD_PRESENT\n"); + _debug_printf("\tSVGA_3D_CMD_PRESENT\n"); { const SVGA3dCmdPresent *cmd = (const SVGA3dCmdPresent *)body; dump_SVGA3dCmdPresent(cmd); @@ -1622,7 +1622,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SHADER_DEFINE: - debug_printf("\tSVGA_3D_CMD_SHADER_DEFINE\n"); + _debug_printf("\tSVGA_3D_CMD_SHADER_DEFINE\n"); { const SVGA3dCmdDefineShader *cmd = (const SVGA3dCmdDefineShader *)body; dump_SVGA3dCmdDefineShader(cmd); @@ -1634,7 +1634,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SHADER_DESTROY: - debug_printf("\tSVGA_3D_CMD_SHADER_DESTROY\n"); + _debug_printf("\tSVGA_3D_CMD_SHADER_DESTROY\n"); { const SVGA3dCmdDestroyShader *cmd = (const SVGA3dCmdDestroyShader *)body; dump_SVGA3dCmdDestroyShader(cmd); @@ -1642,7 +1642,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SET_SHADER: - debug_printf("\tSVGA_3D_CMD_SET_SHADER\n"); + _debug_printf("\tSVGA_3D_CMD_SET_SHADER\n"); { const SVGA3dCmdSetShader *cmd = (const SVGA3dCmdSetShader *)body; dump_SVGA3dCmdSetShader(cmd); @@ -1650,7 +1650,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SET_SHADER_CONST: - debug_printf("\tSVGA_3D_CMD_SET_SHADER_CONST\n"); + _debug_printf("\tSVGA_3D_CMD_SET_SHADER_CONST\n"); { const SVGA3dCmdSetShaderConst *cmd = (const SVGA3dCmdSetShaderConst *)body; dump_SVGA3dCmdSetShaderConst(cmd); @@ -1658,7 +1658,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_DRAW_PRIMITIVES: - debug_printf("\tSVGA_3D_CMD_DRAW_PRIMITIVES\n"); + _debug_printf("\tSVGA_3D_CMD_DRAW_PRIMITIVES\n"); { const SVGA3dCmdDrawPrimitives *cmd = (const SVGA3dCmdDrawPrimitives *)body; unsigned i, j; @@ -1679,7 +1679,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_SETSCISSORRECT: - debug_printf("\tSVGA_3D_CMD_SETSCISSORRECT\n"); + _debug_printf("\tSVGA_3D_CMD_SETSCISSORRECT\n"); { const SVGA3dCmdSetScissorRect *cmd = (const SVGA3dCmdSetScissorRect *)body; dump_SVGA3dCmdSetScissorRect(cmd); @@ -1687,7 +1687,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_BEGIN_QUERY: - debug_printf("\tSVGA_3D_CMD_BEGIN_QUERY\n"); + _debug_printf("\tSVGA_3D_CMD_BEGIN_QUERY\n"); { const SVGA3dCmdBeginQuery *cmd = (const SVGA3dCmdBeginQuery *)body; dump_SVGA3dCmdBeginQuery(cmd); @@ -1695,7 +1695,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_END_QUERY: - debug_printf("\tSVGA_3D_CMD_END_QUERY\n"); + _debug_printf("\tSVGA_3D_CMD_END_QUERY\n"); { const SVGA3dCmdEndQuery *cmd = (const SVGA3dCmdEndQuery *)body; dump_SVGA3dCmdEndQuery(cmd); @@ -1703,7 +1703,7 @@ svga_dump_commands(const void *commands, uint32_t size) } break; case SVGA_3D_CMD_WAIT_FOR_QUERY: - debug_printf("\tSVGA_3D_CMD_WAIT_FOR_QUERY\n"); + _debug_printf("\tSVGA_3D_CMD_WAIT_FOR_QUERY\n"); { const SVGA3dCmdWaitForQuery *cmd = (const SVGA3dCmdWaitForQuery *)body; dump_SVGA3dCmdWaitForQuery(cmd); @@ -1711,24 +1711,24 @@ svga_dump_commands(const void *commands, uint32_t size) } break; default: - debug_printf("\t0x%08x\n", cmd_id); + _debug_printf("\t0x%08x\n", cmd_id); break; } while(body + sizeof(uint32_t) <= next) { - debug_printf("\t\t0x%08x\n", *(const uint32_t *)body); + _debug_printf("\t\t0x%08x\n", *(const uint32_t *)body); body += sizeof(uint32_t); } while(body + sizeof(uint32_t) <= next) - debug_printf("\t\t0x%02x\n", *body++); + _debug_printf("\t\t0x%02x\n", *body++); } else if(cmd_id == SVGA_CMD_FENCE) { - debug_printf("\tSVGA_CMD_FENCE\n"); - debug_printf("\t\t0x%08x\n", ((const uint32_t *)next)[1]); + _debug_printf("\tSVGA_CMD_FENCE\n"); + _debug_printf("\t\t0x%08x\n", ((const uint32_t *)next)[1]); next += 2*sizeof(uint32_t); } else { - debug_printf("\t0x%08x\n", cmd_id); + _debug_printf("\t0x%08x\n", cmd_id); next += sizeof(uint32_t); } } diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.py b/src/gallium/drivers/svga/svgadump/svga_dump.py index 288e753296e..dc5f3267e2c 100755 --- a/src/gallium/drivers/svga/svgadump/svga_dump.py +++ b/src/gallium/drivers/svga/svgadump/svga_dump.py @@ -71,14 +71,14 @@ class decl_dumper_t(decl_visitor.decl_visitor_t): print ' switch(%s) {' % ("(*cmd)" + self._instance,) for name, value in self.decl.values: print ' case %s:' % (name,) - print ' debug_printf("\\t\\t%s = %s\\n");' % (self._instance, name) + print ' _debug_printf("\\t\\t%s = %s\\n");' % (self._instance, name) print ' break;' print ' default:' - print ' debug_printf("\\t\\t%s = %%i\\n", %s);' % (self._instance, "(*cmd)" + self._instance) + print ' _debug_printf("\\t\\t%s = %%i\\n", %s);' % (self._instance, "(*cmd)" + self._instance) print ' break;' print ' }' else: - print ' debug_printf("\\t\\t%s = %%i\\n", %s);' % (self._instance, "(*cmd)" + self._instance) + print ' _debug_printf("\\t\\t%s = %%i\\n", %s);' % (self._instance, "(*cmd)" + self._instance) def dump_decl(instance, decl): @@ -154,7 +154,7 @@ class type_dumper_t(type_visitor.type_visitor_t): dump_decl(self.instance, decl) def print_instance(self, format): - print ' debug_printf("\\t\\t%s = %s\\n", %s);' % (self.instance, format, "(*cmd)" + self.instance) + print ' _debug_printf("\\t\\t%s = %s\\n", %s);' % (self.instance, format, "(*cmd)" + self.instance) def dump_type(instance, type_): @@ -230,7 +230,7 @@ svga_dump_commands(const void *commands, uint32_t size) indexes = 'ijklmn' for id, header, body, footer in cmds: print ' case %s:' % id - print ' debug_printf("\\t%s\\n");' % id + print ' _debug_printf("\\t%s\\n");' % id print ' {' print ' const %s *cmd = (const %s *)body;' % (header, header) if len(body): @@ -255,25 +255,25 @@ svga_dump_commands(const void *commands, uint32_t size) print ' }' print ' break;' print ' default:' - print ' debug_printf("\\t0x%08x\\n", cmd_id);' + print ' _debug_printf("\\t0x%08x\\n", cmd_id);' print ' break;' print ' }' print r''' while(body + sizeof(uint32_t) <= next) { - debug_printf("\t\t0x%08x\n", *(const uint32_t *)body); + _debug_printf("\t\t0x%08x\n", *(const uint32_t *)body); body += sizeof(uint32_t); } while(body + sizeof(uint32_t) <= next) - debug_printf("\t\t0x%02x\n", *body++); + _debug_printf("\t\t0x%02x\n", *body++); } else if(cmd_id == SVGA_CMD_FENCE) { - debug_printf("\tSVGA_CMD_FENCE\n"); - debug_printf("\t\t0x%08x\n", ((const uint32_t *)next)[1]); + _debug_printf("\tSVGA_CMD_FENCE\n"); + _debug_printf("\t\t0x%08x\n", ((const uint32_t *)next)[1]); next += 2*sizeof(uint32_t); } else { - debug_printf("\t0x%08x\n", cmd_id); + _debug_printf("\t0x%08x\n", cmd_id); next += sizeof(uint32_t); } } diff --git a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c index b0e7fdf378a..70e27d86d30 100644 --- a/src/gallium/drivers/svga/svgadump/svga_shader_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_shader_dump.c @@ -50,16 +50,16 @@ static void dump_op( struct sh_op op, const char *mnemonic ) assert( op.is_reg == 0 ); if (op.coissue) - debug_printf( "+" ); - debug_printf( "%s", mnemonic ); + _debug_printf( "+" ); + _debug_printf( "%s", mnemonic ); switch (op.control) { case 0: break; case SVGA3DOPCONT_PROJECT: - debug_printf( "p" ); + _debug_printf( "p" ); break; case SVGA3DOPCONT_BIAS: - debug_printf( "b" ); + _debug_printf( "b" ); break; default: assert( 0 ); @@ -72,28 +72,28 @@ static void dump_comp_op( struct sh_op op, const char *mnemonic ) assert( op.is_reg == 0 ); if (op.coissue) - debug_printf( "+" ); - debug_printf( "%s", mnemonic ); + _debug_printf( "+" ); + _debug_printf( "%s", mnemonic ); switch (op.control) { case SVGA3DOPCOMP_RESERVED0: break; case SVGA3DOPCOMP_GT: - debug_printf("_gt"); + _debug_printf("_gt"); break; case SVGA3DOPCOMP_EQ: - debug_printf("_eq"); + _debug_printf("_eq"); break; case SVGA3DOPCOMP_GE: - debug_printf("_ge"); + _debug_printf("_ge"); break; case SVGA3DOPCOMP_LT: - debug_printf("_lt"); + _debug_printf("_lt"); break; case SVGA3DOPCOMPC_NE: - debug_printf("_ne"); + _debug_printf("_ne"); break; case SVGA3DOPCOMP_LE: - debug_printf("_le"); + _debug_printf("_le"); break; case SVGA3DOPCOMP_RESERVED1: default: @@ -109,93 +109,93 @@ static void dump_reg( struct sh_reg reg, struct sh_srcreg *indreg, const struct switch (sh_reg_type( reg )) { case SVGA3DREG_TEMP: - debug_printf( "r%u", reg.number ); + _debug_printf( "r%u", reg.number ); break; case SVGA3DREG_INPUT: - debug_printf( "v%u", reg.number ); + _debug_printf( "v%u", reg.number ); break; case SVGA3DREG_CONST: if (reg.relative) { if (sh_srcreg_type( *indreg ) == SVGA3DREG_LOOP) - debug_printf( "c[aL+%u]", reg.number ); + _debug_printf( "c[aL+%u]", reg.number ); else - debug_printf( "c[a%u.x+%u]", indreg->number, reg.number ); + _debug_printf( "c[a%u.x+%u]", indreg->number, reg.number ); } else - debug_printf( "c%u", reg.number ); + _debug_printf( "c%u", reg.number ); break; case SVGA3DREG_ADDR: /* VS */ /* SVGA3DREG_TEXTURE */ /* PS */ if (di->is_ps) - debug_printf( "t%u", reg.number ); + _debug_printf( "t%u", reg.number ); else - debug_printf( "a%u", reg.number ); + _debug_printf( "a%u", reg.number ); break; case SVGA3DREG_RASTOUT: switch (reg.number) { case 0 /*POSITION*/: - debug_printf( "oPos" ); + _debug_printf( "oPos" ); break; case 1 /*FOG*/: - debug_printf( "oFog" ); + _debug_printf( "oFog" ); break; case 2 /*POINT_SIZE*/: - debug_printf( "oPts" ); + _debug_printf( "oPts" ); break; default: assert( 0 ); - debug_printf( "???" ); + _debug_printf( "???" ); } break; case SVGA3DREG_ATTROUT: assert( reg.number < 2 ); - debug_printf( "oD%u", reg.number ); + _debug_printf( "oD%u", reg.number ); break; case SVGA3DREG_TEXCRDOUT: /* SVGA3DREG_OUTPUT */ - debug_printf( "oT%u", reg.number ); + _debug_printf( "oT%u", reg.number ); break; case SVGA3DREG_COLOROUT: - debug_printf( "oC%u", reg.number ); + _debug_printf( "oC%u", reg.number ); break; case SVGA3DREG_DEPTHOUT: - debug_printf( "oD%u", reg.number ); + _debug_printf( "oD%u", reg.number ); break; case SVGA3DREG_SAMPLER: - debug_printf( "s%u", reg.number ); + _debug_printf( "s%u", reg.number ); break; case SVGA3DREG_CONSTBOOL: assert( !reg.relative ); - debug_printf( "b%u", reg.number ); + _debug_printf( "b%u", reg.number ); break; case SVGA3DREG_CONSTINT: assert( !reg.relative ); - debug_printf( "i%u", reg.number ); + _debug_printf( "i%u", reg.number ); break; case SVGA3DREG_LOOP: assert( reg.number == 0 ); - debug_printf( "aL" ); + _debug_printf( "aL" ); break; case SVGA3DREG_MISCTYPE: switch (reg.number) { case SVGA3DMISCREG_POSITION: - debug_printf( "vPos" ); + _debug_printf( "vPos" ); break; case SVGA3DMISCREG_FACE: - debug_printf( "vFace" ); + _debug_printf( "vFace" ); break; default: assert(0); @@ -204,46 +204,46 @@ static void dump_reg( struct sh_reg reg, struct sh_srcreg *indreg, const struct break; case SVGA3DREG_LABEL: - debug_printf( "l%u", reg.number ); + _debug_printf( "l%u", reg.number ); break; case SVGA3DREG_PREDICATE: - debug_printf( "p%u", reg.number ); + _debug_printf( "p%u", reg.number ); break; default: assert( 0 ); - debug_printf( "???" ); + _debug_printf( "???" ); } } static void dump_cdata( struct sh_cdata cdata ) { - debug_printf( "%f, %f, %f, %f", cdata.xyzw[0], cdata.xyzw[1], cdata.xyzw[2], cdata.xyzw[3] ); + _debug_printf( "%f, %f, %f, %f", cdata.xyzw[0], cdata.xyzw[1], cdata.xyzw[2], cdata.xyzw[3] ); } static void dump_idata( struct sh_idata idata ) { - debug_printf( "%d, %d, %d, %d", idata.xyzw[0], idata.xyzw[1], idata.xyzw[2], idata.xyzw[3] ); + _debug_printf( "%d, %d, %d, %d", idata.xyzw[0], idata.xyzw[1], idata.xyzw[2], idata.xyzw[3] ); } static void dump_bdata( boolean bdata ) { - debug_printf( bdata ? "TRUE" : "FALSE" ); + _debug_printf( bdata ? "TRUE" : "FALSE" ); } static void dump_sampleinfo( struct ps_sampleinfo sampleinfo ) { switch (sampleinfo.texture_type) { case SVGA3DSAMP_2D: - debug_printf( "_2d" ); + _debug_printf( "_2d" ); break; case SVGA3DSAMP_CUBE: - debug_printf( "_cube" ); + _debug_printf( "_cube" ); break; case SVGA3DSAMP_VOLUME: - debug_printf( "_volume" ); + _debug_printf( "_volume" ); break; default: assert( 0 ); @@ -255,46 +255,46 @@ static void dump_usageinfo( struct vs_semantic semantic ) { switch (semantic.usage) { case SVGA3D_DECLUSAGE_POSITION: - debug_printf("_position" ); + _debug_printf("_position" ); break; case SVGA3D_DECLUSAGE_BLENDWEIGHT: - debug_printf("_blendweight" ); + _debug_printf("_blendweight" ); break; case SVGA3D_DECLUSAGE_BLENDINDICES: - debug_printf("_blendindices" ); + _debug_printf("_blendindices" ); break; case SVGA3D_DECLUSAGE_NORMAL: - debug_printf("_normal" ); + _debug_printf("_normal" ); break; case SVGA3D_DECLUSAGE_PSIZE: - debug_printf("_psize" ); + _debug_printf("_psize" ); break; case SVGA3D_DECLUSAGE_TEXCOORD: - debug_printf("_texcoord"); + _debug_printf("_texcoord"); break; case SVGA3D_DECLUSAGE_TANGENT: - debug_printf("_tangent" ); + _debug_printf("_tangent" ); break; case SVGA3D_DECLUSAGE_BINORMAL: - debug_printf("_binormal" ); + _debug_printf("_binormal" ); break; case SVGA3D_DECLUSAGE_TESSFACTOR: - debug_printf("_tessfactor" ); + _debug_printf("_tessfactor" ); break; case SVGA3D_DECLUSAGE_POSITIONT: - debug_printf("_positiont" ); + _debug_printf("_positiont" ); break; case SVGA3D_DECLUSAGE_COLOR: - debug_printf("_color" ); + _debug_printf("_color" ); break; case SVGA3D_DECLUSAGE_FOG: - debug_printf("_fog" ); + _debug_printf("_fog" ); break; case SVGA3D_DECLUSAGE_DEPTH: - debug_printf("_depth" ); + _debug_printf("_depth" ); break; case SVGA3D_DECLUSAGE_SAMPLE: - debug_printf("_sample"); + _debug_printf("_sample"); break; default: assert( 0 ); @@ -302,7 +302,7 @@ static void dump_usageinfo( struct vs_semantic semantic ) } if (semantic.usage_index != 0) { - debug_printf("%d", semantic.usage_index ); + _debug_printf("%d", semantic.usage_index ); } } @@ -316,47 +316,47 @@ static void dump_dstreg( struct sh_dstreg dstreg, const struct dump_info *di ) assert( (dstreg.modifier & (SVGA3DDSTMOD_SATURATE | SVGA3DDSTMOD_PARTIALPRECISION)) == dstreg.modifier ); if (dstreg.modifier & SVGA3DDSTMOD_SATURATE) - debug_printf( "_sat" ); + _debug_printf( "_sat" ); if (dstreg.modifier & SVGA3DDSTMOD_PARTIALPRECISION) - debug_printf( "_pp" ); + _debug_printf( "_pp" ); switch (dstreg.shift_scale) { case 0: break; case 1: - debug_printf( "_x2" ); + _debug_printf( "_x2" ); break; case 2: - debug_printf( "_x4" ); + _debug_printf( "_x4" ); break; case 3: - debug_printf( "_x8" ); + _debug_printf( "_x8" ); break; case 13: - debug_printf( "_d8" ); + _debug_printf( "_d8" ); break; case 14: - debug_printf( "_d4" ); + _debug_printf( "_d4" ); break; case 15: - debug_printf( "_d2" ); + _debug_printf( "_d2" ); break; default: assert( 0 ); } - debug_printf( " " ); + _debug_printf( " " ); u.dstreg = dstreg; dump_reg( u.reg, NULL, di ); if (dstreg.write_mask != SVGA3DWRITEMASK_ALL) { - debug_printf( "." ); + _debug_printf( "." ); if (dstreg.write_mask & SVGA3DWRITEMASK_0) - debug_printf( "x" ); + _debug_printf( "x" ); if (dstreg.write_mask & SVGA3DWRITEMASK_1) - debug_printf( "y" ); + _debug_printf( "y" ); if (dstreg.write_mask & SVGA3DWRITEMASK_2) - debug_printf( "z" ); + _debug_printf( "z" ); if (dstreg.write_mask & SVGA3DWRITEMASK_3) - debug_printf( "w" ); + _debug_printf( "w" ); } } @@ -372,19 +372,19 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons case SVGA3DSRCMOD_BIASNEG: case SVGA3DSRCMOD_SIGNNEG: case SVGA3DSRCMOD_X2NEG: - debug_printf( "-" ); + _debug_printf( "-" ); break; case SVGA3DSRCMOD_ABS: - debug_printf( "|" ); + _debug_printf( "|" ); break; case SVGA3DSRCMOD_ABSNEG: - debug_printf( "-|" ); + _debug_printf( "-|" ); break; case SVGA3DSRCMOD_COMP: - debug_printf( "1-" ); + _debug_printf( "1-" ); break; case SVGA3DSRCMOD_NOT: - debug_printf( "!" ); + _debug_printf( "!" ); } u.srcreg = srcreg; @@ -397,39 +397,39 @@ static void dump_srcreg( struct sh_srcreg srcreg, struct sh_srcreg *indreg, cons break; case SVGA3DSRCMOD_ABS: case SVGA3DSRCMOD_ABSNEG: - debug_printf( "|" ); + _debug_printf( "|" ); break; case SVGA3DSRCMOD_BIAS: case SVGA3DSRCMOD_BIASNEG: - debug_printf( "_bias" ); + _debug_printf( "_bias" ); break; case SVGA3DSRCMOD_SIGN: case SVGA3DSRCMOD_SIGNNEG: - debug_printf( "_bx2" ); + _debug_printf( "_bx2" ); break; case SVGA3DSRCMOD_X2: case SVGA3DSRCMOD_X2NEG: - debug_printf( "_x2" ); + _debug_printf( "_x2" ); break; case SVGA3DSRCMOD_DZ: - debug_printf( "_dz" ); + _debug_printf( "_dz" ); break; case SVGA3DSRCMOD_DW: - debug_printf( "_dw" ); + _debug_printf( "_dw" ); break; default: assert( 0 ); } if (srcreg.swizzle_x != 0 || srcreg.swizzle_y != 1 || srcreg.swizzle_z != 2 || srcreg.swizzle_w != 3) { - debug_printf( "." ); + _debug_printf( "." ); if (srcreg.swizzle_x == srcreg.swizzle_y && srcreg.swizzle_y == srcreg.swizzle_z && srcreg.swizzle_z == srcreg.swizzle_w) { - debug_printf( "%c", "xyzw"[srcreg.swizzle_x] ); + _debug_printf( "%c", "xyzw"[srcreg.swizzle_x] ); } else { - debug_printf( "%c", "xyzw"[srcreg.swizzle_x] ); - debug_printf( "%c", "xyzw"[srcreg.swizzle_y] ); - debug_printf( "%c", "xyzw"[srcreg.swizzle_z] ); - debug_printf( "%c", "xyzw"[srcreg.swizzle_w] ); + _debug_printf( "%c", "xyzw"[srcreg.swizzle_x] ); + _debug_printf( "%c", "xyzw"[srcreg.swizzle_y] ); + _debug_printf( "%c", "xyzw"[srcreg.swizzle_z] ); + _debug_printf( "%c", "xyzw"[srcreg.swizzle_w] ); } } } @@ -447,15 +447,15 @@ svga_shader_dump( if (do_binary) { for (i = 0; i < dwords; i++) - debug_printf(" 0x%08x,\n", assem[i]); + _debug_printf(" 0x%08x,\n", assem[i]); - debug_printf("\n\n"); + _debug_printf("\n\n"); } di.version.value = *assem++; di.is_ps = (di.version.type == SVGA3D_PS_TYPE); - debug_printf( + _debug_printf( "%s_%u_%u\n", di.is_ps ? "ps" : "vs", di.version.major, @@ -465,7 +465,7 @@ svga_shader_dump( struct sh_op op = *(struct sh_op *) assem; if (assem - start >= dwords) { - debug_printf("... ran off end of buffer\n"); + _debug_printf("... ran off end of buffer\n"); assert(0); return; } @@ -475,7 +475,7 @@ svga_shader_dump( { struct sh_dcl dcl = *(struct sh_dcl *) assem; - debug_printf( "dcl" ); + _debug_printf( "dcl" ); if (sh_dstreg_type( dcl.reg ) == SVGA3DREG_SAMPLER) dump_sampleinfo( dcl.u.ps.sampleinfo ); else if (di.is_ps) { @@ -486,7 +486,7 @@ svga_shader_dump( else dump_usageinfo( dcl.u.vs.semantic ); dump_dstreg( dcl.reg, &di ); - debug_printf( "\n" ); + _debug_printf( "\n" ); assem += sizeof( struct sh_dcl ) / sizeof( unsigned ); } break; @@ -495,11 +495,11 @@ svga_shader_dump( { struct sh_defb defb = *(struct sh_defb *) assem; - debug_printf( "defb " ); + _debug_printf( "defb " ); dump_reg( defb.reg, NULL, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_bdata( defb.data ); - debug_printf( "\n" ); + _debug_printf( "\n" ); assem += sizeof( struct sh_defb ) / sizeof( unsigned ); } break; @@ -508,11 +508,11 @@ svga_shader_dump( { struct sh_defi defi = *(struct sh_defi *) assem; - debug_printf( "defi " ); + _debug_printf( "defi " ); dump_reg( defi.reg, NULL, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_idata( defi.idata ); - debug_printf( "\n" ); + _debug_printf( "\n" ); assem += sizeof( struct sh_defi ) / sizeof( unsigned ); } break; @@ -528,11 +528,11 @@ svga_shader_dump( else { struct sh_unaryop unaryop = *(struct sh_unaryop *) assem; dump_dstreg( unaryop.dst, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_srcreg( unaryop.src, NULL, &di ); assem += sizeof( struct sh_unaryop ) / sizeof( unsigned ); } - debug_printf( "\n" ); + _debug_printf( "\n" ); break; case SVGA3DOP_TEX: @@ -549,7 +549,7 @@ svga_shader_dump( struct sh_unaryop unaryop = *(struct sh_unaryop *) assem; dump_dstreg( unaryop.dst, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_srcreg( unaryop.src, NULL, &di ); assem += sizeof( struct sh_unaryop ) / sizeof( unsigned ); } @@ -559,30 +559,30 @@ svga_shader_dump( dump_op( op, "texld" ); dump_dstreg( binaryop.dst, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_srcreg( binaryop.src0, NULL, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_srcreg( binaryop.src1, NULL, &di ); assem += sizeof( struct sh_binaryop ) / sizeof( unsigned ); } - debug_printf( "\n" ); + _debug_printf( "\n" ); break; case SVGA3DOP_DEF: { struct sh_def def = *(struct sh_def *) assem; - debug_printf( "def " ); + _debug_printf( "def " ); dump_reg( def.reg, NULL, &di ); - debug_printf( ", " ); + _debug_printf( ", " ); dump_cdata( def.cdata ); - debug_printf( "\n" ); + _debug_printf( "\n" ); assem += sizeof( struct sh_def ) / sizeof( unsigned ); } break; case SVGA3DOP_PHASE: - debug_printf( "phase\n" ); + _debug_printf( "phase\n" ); assem += sizeof( struct sh_op ) / sizeof( unsigned ); break; @@ -596,12 +596,12 @@ svga_shader_dump( break; case SVGA3DOP_RET: - debug_printf( "ret\n" ); + _debug_printf( "ret\n" ); assem += sizeof( struct sh_op ) / sizeof( unsigned ); break; case SVGA3DOP_END: - debug_printf( "end\n" ); + _debug_printf( "end\n" ); finished = TRUE; break; @@ -640,14 +640,14 @@ svga_shader_dump( } if (not_first_arg) - debug_printf( ", " ); + _debug_printf( ", " ); else - debug_printf( " " ); + _debug_printf( " " ); dump_srcreg( srcreg, &indreg, &di ); not_first_arg = TRUE; } - debug_printf( "\n" ); + _debug_printf( "\n" ); } } } -- cgit v1.2.3 From 5b1a7843f841b2bfdd54538a2eaad9dadae3e09d Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Sat, 5 Dec 2009 06:34:59 +0000 Subject: svga: Dump SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN commands. --- src/gallium/drivers/svga/svgadump/svga_dump.c | 38 ++++++++++++++++++++++++++ src/gallium/drivers/svga/svgadump/svga_dump.py | 9 +++--- 2 files changed, 43 insertions(+), 4 deletions(-) diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.c b/src/gallium/drivers/svga/svgadump/svga_dump.c index 18e0eb5139a..e6d4a74e868 100644 --- a/src/gallium/drivers/svga/svgadump/svga_dump.c +++ b/src/gallium/drivers/svga/svgadump/svga_dump.c @@ -1416,6 +1416,32 @@ dump_SVGA3dCmdDefineSurface(const SVGA3dCmdDefineSurface *cmd) _debug_printf("\t\t.face[5].numMipLevels = %u\n", (*cmd).face[5].numMipLevels); } +static void +dump_SVGASignedRect(const SVGASignedRect *cmd) +{ + _debug_printf("\t\t.left = %i\n", (*cmd).left); + _debug_printf("\t\t.top = %i\n", (*cmd).top); + _debug_printf("\t\t.right = %i\n", (*cmd).right); + _debug_printf("\t\t.bottom = %i\n", (*cmd).bottom); +} + +static void +dump_SVGA3dCmdBlitSurfaceToScreen(const SVGA3dCmdBlitSurfaceToScreen *cmd) +{ + _debug_printf("\t\t.srcImage.sid = %u\n", (*cmd).srcImage.sid); + _debug_printf("\t\t.srcImage.face = %u\n", (*cmd).srcImage.face); + _debug_printf("\t\t.srcImage.mipmap = %u\n", (*cmd).srcImage.mipmap); + _debug_printf("\t\t.srcRect.left = %i\n", (*cmd).srcRect.left); + _debug_printf("\t\t.srcRect.top = %i\n", (*cmd).srcRect.top); + _debug_printf("\t\t.srcRect.right = %i\n", (*cmd).srcRect.right); + _debug_printf("\t\t.srcRect.bottom = %i\n", (*cmd).srcRect.bottom); + _debug_printf("\t\t.destScreenId = %u\n", (*cmd).destScreenId); + _debug_printf("\t\t.destRect.left = %i\n", (*cmd).destRect.left); + _debug_printf("\t\t.destRect.top = %i\n", (*cmd).destRect.top); + _debug_printf("\t\t.destRect.right = %i\n", (*cmd).destRect.right); + _debug_printf("\t\t.destRect.bottom = %i\n", (*cmd).destRect.bottom); +} + void svga_dump_commands(const void *commands, uint32_t size) @@ -1710,6 +1736,18 @@ svga_dump_commands(const void *commands, uint32_t size) body = (const uint8_t *)&cmd[1]; } break; + case SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN: + _debug_printf("\tSVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN\n"); + { + const SVGA3dCmdBlitSurfaceToScreen *cmd = (const SVGA3dCmdBlitSurfaceToScreen *)body; + dump_SVGA3dCmdBlitSurfaceToScreen(cmd); + body = (const uint8_t *)&cmd[1]; + while(body + sizeof(SVGASignedRect) <= next) { + dump_SVGASignedRect((const SVGASignedRect *)body); + body += sizeof(SVGASignedRect); + } + } + break; default: _debug_printf("\t0x%08x\n", cmd_id); break; diff --git a/src/gallium/drivers/svga/svgadump/svga_dump.py b/src/gallium/drivers/svga/svgadump/svga_dump.py index dc5f3267e2c..a1ada29ef84 100755 --- a/src/gallium/drivers/svga/svgadump/svga_dump.py +++ b/src/gallium/drivers/svga/svgadump/svga_dump.py @@ -202,6 +202,7 @@ cmds = [ ('SVGA_3D_CMD_END_QUERY', 'SVGA3dCmdEndQuery', (), None), ('SVGA_3D_CMD_WAIT_FOR_QUERY', 'SVGA3dCmdWaitForQuery', (), None), #('SVGA_3D_CMD_PRESENT_READBACK', None, (), None), + ('SVGA_3D_CMD_BLIT_SURFACE_TO_SCREEN', 'SVGA3dCmdBlitSurfaceToScreen', (), 'SVGASignedRect'), ] def dump_cmds(): @@ -294,18 +295,18 @@ def main(): print '#include "svga_shader_dump.h"' print '#include "svga3d_reg.h"' print - print '#include "pipe/p_debug.h"' + print '#include "util/u_debug.h"' print '#include "svga_dump.h"' print config = parser.config_t( - include_paths = ['include'], + include_paths = ['../../../include', '../include'], compiler = 'gcc', ) headers = [ - 'include/svga_types.h', - 'include/svga3d_reg.h', + 'svga_types.h', + 'svga3d_reg.h', ] decls = parser.parse(headers, config, parser.COMPILATION_MODE.ALL_AT_ONCE) -- cgit v1.2.3 From 8d2f3434c5904e28b5e1bccceba7e89a94502ac1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 4 Dec 2009 23:31:39 -0800 Subject: progs/fp: Redraw upon keypress. --- progs/fp/tri-inv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/fp/tri-inv.c b/progs/fp/tri-inv.c index 7e8d8c5ce29..7e490fa61ca 100644 --- a/progs/fp/tri-inv.c +++ b/progs/fp/tri-inv.c @@ -56,7 +56,7 @@ static void Key(unsigned char key, int x, int y) case 27: exit(1); default: - return; + break; } glutPostRedisplay(); -- cgit v1.2.3 From d642edd2d10e93c32077a729b13a7c7b0d37d25b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Dec 2009 01:11:26 -0800 Subject: progs/vpglsl: Assign glGetUniformLocationARB return value to GLint. The return type of glGetUniformLocationARB is GLint, not GLuint. --- progs/vpglsl/vp-tris.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/progs/vpglsl/vp-tris.c b/progs/vpglsl/vp-tris.c index b2b05080910..6a1fa3d3bf0 100644 --- a/progs/vpglsl/vp-tris.c +++ b/progs/vpglsl/vp-tris.c @@ -84,9 +84,9 @@ static void check_link(GLuint prog) static void setup_uniforms() { { - GLuint loc1f = glGetUniformLocationARB(program, "Offset1f"); - GLuint loc2f = glGetUniformLocationARB(program, "Offset2f"); - GLuint loc4f = glGetUniformLocationARB(program, "Offset4f"); + GLint loc1f = glGetUniformLocationARB(program, "Offset1f"); + GLint loc2f = glGetUniformLocationARB(program, "Offset2f"); + GLint loc4f = glGetUniformLocationARB(program, "Offset4f"); GLfloat vecKer[] = { 1.0, 0.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, @@ -105,9 +105,9 @@ static void setup_uniforms() } { - GLuint loc1f = glGetUniformLocationARB(program, "KernelValue1f"); - GLuint loc2f = glGetUniformLocationARB(program, "KernelValue2f"); - GLuint loc4f = glGetUniformLocationARB(program, "KernelValue4f"); + GLint loc1f = glGetUniformLocationARB(program, "KernelValue1f"); + GLint loc2f = glGetUniformLocationARB(program, "KernelValue2f"); + GLint loc4f = glGetUniformLocationARB(program, "KernelValue4f"); GLfloat vecKer[] = { 1.0, 0.0, 0.0, 0.25, 0.0, 1.0, 0.0, 0.25, -- cgit v1.2.3 From 2cd2341ce88a3d485f81d920290a9c1d0ab988da Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Dec 2009 01:22:34 -0800 Subject: progs/tests: Removed unused variable from texdown.c. --- progs/tests/texdown.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/progs/tests/texdown.c b/progs/tests/texdown.c index e6881d39a0a..92df01b83d2 100644 --- a/progs/tests/texdown.c +++ b/progs/tests/texdown.c @@ -162,7 +162,7 @@ MeasureDownloadRate(void) const int image_bytes = align(w * h * BytesPerTexel(Format), ALIGN); const int bytes = image_bytes * NR_TEXOBJ; GLubyte *orig_texImage, *orig_getImage; - GLubyte *texImage, *getImage; + GLubyte *texImage; GLdouble t0, t1, time; int count; int i; @@ -184,7 +184,6 @@ MeasureDownloadRate(void) printf("alloc %p %p\n", orig_texImage, orig_getImage); texImage = (GLubyte *)align((unsigned long)orig_texImage, ALIGN); - getImage = (GLubyte *)align((unsigned long)orig_getImage, ALIGN); for (i = 1; !(((unsigned long)texImage) & i); i<<=1) ; -- cgit v1.2.3 From 6212c8103a5011e08003c8946732edad39fa74c3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Dec 2009 01:28:47 -0800 Subject: progs/samples: Add rgbtoppm to Makefile. --- progs/samples/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/progs/samples/Makefile b/progs/samples/Makefile index b300e38b9c2..64fa47addb5 100644 --- a/progs/samples/Makefile +++ b/progs/samples/Makefile @@ -10,7 +10,7 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) $(TOP)/$(LIB_DIR)/$(GLU_LIB_NAME) $(T LIBS = -L$(TOP)/$(LIB_DIR) -l$(GLUT_LIB) -l$(GLEW_LIB) -l$(GLU_LIB) -l$(GL_LIB) $(APP_LIB_DEPS) PROGS = accum bitmap1 bitmap2 blendeq blendxor copy cursor depth eval fog \ - font line logo nurb olympic overlay point prim quad select \ + font line logo nurb olympic overlay point prim rgbtoppm quad select \ shape sphere star stencil stretch texture tri wave -- cgit v1.2.3 From 412aeeed1c392ab5796c85287fc6ebdccd74880c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Dec 2009 01:38:14 -0800 Subject: progs/samples: Fix memory leak if fopen fails in rgbtoppm.c. --- progs/samples/rgbtoppm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 116d9a8cfa5..6652bb32ec1 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -86,7 +86,8 @@ static ImageRec *ImageOpen(char *fileName) exit(1); } if ((image->file = fopen(fileName, "rb")) == NULL) { - return NULL; + free(image); + return NULL; } fread(image, 1, 12, image->file); -- cgit v1.2.3 From 1446f30875bfb3b633942bc710b061019472f788 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 5 Dec 2009 01:43:29 -0800 Subject: progs/samples: Fix memory leak if malloc fails in rgbtoppm.c. --- progs/samples/rgbtoppm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 6652bb32ec1..56ca5b0efe9 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -225,6 +225,7 @@ read_rgb_texture(char *name, int *width, int *height) if (gbuf) free(gbuf); if (bbuf) free(bbuf); if (abuf) free(abuf); + ImageClose(image); return NULL; } ptr = base; -- cgit v1.2.3 From 433f0a82f5a4696e6b0c4061f645485ec8079bb4 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 5 Dec 2009 17:20:03 +0100 Subject: radeon: Only get DRI2 front buffer information for glXBindTexImageEXT. --- src/mesa/drivers/dri/r300/r300_texstate.c | 13 +---- src/mesa/drivers/dri/radeon/radeon_common.c | 8 +-- .../drivers/dri/radeon/radeon_common_context.c | 57 ++++++++++++---------- .../drivers/dri/radeon/radeon_common_context.h | 3 +- 4 files changed, 38 insertions(+), 43 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index e6f2c0c1a7b..9eaf390b460 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -409,18 +409,7 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ diff --git a/src/mesa/drivers/dri/radeon/radeon_common.c b/src/mesa/drivers/dri/radeon/radeon_common.c index 184287aa44c..c81e80e820e 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common.c +++ b/src/mesa/drivers/dri/radeon/radeon_common.c @@ -840,7 +840,7 @@ void radeonDrawBuffer( GLcontext *ctx, GLenum mode ) */ if (!was_front_buffer_rendering && radeon->is_front_buffer_rendering) { radeon_update_renderbuffers(radeon->dri.context, - radeon->dri.context->driDrawablePriv); + radeon->dri.context->driDrawablePriv, GL_FALSE); } } @@ -857,7 +857,7 @@ void radeonReadBuffer( GLcontext *ctx, GLenum mode ) if (!was_front_buffer_reading && rmesa->is_front_buffer_reading) { radeon_update_renderbuffers(rmesa->dri.context, - rmesa->dri.context->driReadablePriv); + rmesa->dri.context->driReadablePriv, GL_FALSE); } } /* nothing, until we implement h/w glRead/CopyPixels or CopyTexImage */ @@ -908,9 +908,9 @@ void radeon_viewport(GLcontext *ctx, GLint x, GLint y, GLsizei width, GLsizei he if (radeon->is_front_buffer_rendering) { ctx->Driver.Flush(ctx); } - radeon_update_renderbuffers(driContext, driContext->driDrawablePriv); + radeon_update_renderbuffers(driContext, driContext->driDrawablePriv, GL_FALSE); if (driContext->driDrawablePriv != driContext->driReadablePriv) - radeon_update_renderbuffers(driContext, driContext->driReadablePriv); + radeon_update_renderbuffers(driContext, driContext->driReadablePriv, GL_FALSE); } old_viewport = ctx->Driver.Viewport; diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c index 71f70d724b9..5c68bf5df6c 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c @@ -499,7 +499,8 @@ radeon_bits_per_pixel(const struct radeon_renderbuffer *rb) } void -radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) +radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, + GLboolean front_only) { unsigned int attachments[10]; __DRIbuffer *buffers = NULL; @@ -525,7 +526,7 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) struct radeon_renderbuffer *stencil_rb; i = 0; - if ((radeon->is_front_buffer_rendering || + if ((front_only || radeon->is_front_buffer_rendering || radeon->is_front_buffer_reading || !draw->color_rb[1]) && draw->color_rb[0]) { @@ -533,23 +534,25 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) attachments[i++] = radeon_bits_per_pixel(draw->color_rb[0]); } - if (draw->color_rb[1]) { - attachments[i++] = __DRI_BUFFER_BACK_LEFT; - attachments[i++] = radeon_bits_per_pixel(draw->color_rb[1]); - } + if (!front_only) { + if (draw->color_rb[1]) { + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + attachments[i++] = radeon_bits_per_pixel(draw->color_rb[1]); + } - depth_rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH); - stencil_rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL); - - if ((depth_rb != NULL) && (stencil_rb != NULL)) { - attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL; - attachments[i++] = radeon_bits_per_pixel(depth_rb); - } else if (depth_rb != NULL) { - attachments[i++] = __DRI_BUFFER_DEPTH; - attachments[i++] = radeon_bits_per_pixel(depth_rb); - } else if (stencil_rb != NULL) { - attachments[i++] = __DRI_BUFFER_STENCIL; - attachments[i++] = radeon_bits_per_pixel(stencil_rb); + depth_rb = radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH); + stencil_rb = radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL); + + if ((depth_rb != NULL) && (stencil_rb != NULL)) { + attachments[i++] = __DRI_BUFFER_DEPTH_STENCIL; + attachments[i++] = radeon_bits_per_pixel(depth_rb); + } else if (depth_rb != NULL) { + attachments[i++] = __DRI_BUFFER_DEPTH; + attachments[i++] = radeon_bits_per_pixel(depth_rb); + } else if (stencil_rb != NULL) { + attachments[i++] = __DRI_BUFFER_STENCIL; + attachments[i++] = radeon_bits_per_pixel(stencil_rb); + } } buffers = (*screen->dri2.loader->getBuffersWithFormat)(drawable, @@ -562,12 +565,14 @@ radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable) i = 0; if (draw->color_rb[0]) attachments[i++] = __DRI_BUFFER_FRONT_LEFT; - if (draw->color_rb[1]) - attachments[i++] = __DRI_BUFFER_BACK_LEFT; - if (radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH)) - attachments[i++] = __DRI_BUFFER_DEPTH; - if (radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL)) - attachments[i++] = __DRI_BUFFER_STENCIL; + if (!front_only) { + if (draw->color_rb[1]) + attachments[i++] = __DRI_BUFFER_BACK_LEFT; + if (radeon_get_renderbuffer(&draw->base, BUFFER_DEPTH)) + attachments[i++] = __DRI_BUFFER_DEPTH; + if (radeon_get_renderbuffer(&draw->base, BUFFER_STENCIL)) + attachments[i++] = __DRI_BUFFER_STENCIL; + } buffers = (*screen->dri2.loader->getBuffers)(drawable, &drawable->w, @@ -735,9 +740,9 @@ GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, readfb = driReadPriv->driverPrivate; if (driContextPriv->driScreenPriv->dri2.enabled) { - radeon_update_renderbuffers(driContextPriv, driDrawPriv); + radeon_update_renderbuffers(driContextPriv, driDrawPriv, GL_FALSE); if (driDrawPriv != driReadPriv) - radeon_update_renderbuffers(driContextPriv, driReadPriv); + radeon_update_renderbuffers(driContextPriv, driReadPriv, GL_FALSE); _mesa_reference_renderbuffer(&radeon->state.color.rb, &(radeon_get_renderbuffer(&drfb->base, BUFFER_BACK_LEFT)->base)); _mesa_reference_renderbuffer(&radeon->state.depth.rb, diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index ad953ddbb5a..49a9ec56106 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -589,7 +589,8 @@ GLboolean radeonInitContext(radeonContextPtr radeon, void radeonCleanupContext(radeonContextPtr radeon); GLboolean radeonUnbindContext(__DRIcontextPrivate * driContextPriv); -void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable); +void radeon_update_renderbuffers(__DRIcontext *context, __DRIdrawable *drawable, + GLboolean front_only); GLboolean radeonMakeCurrent(__DRIcontextPrivate * driContextPriv, __DRIdrawablePrivate * driDrawPriv, __DRIdrawablePrivate * driReadPriv); -- cgit v1.2.3 From d13c603e37bf7fb4c84b215775eb547761c1e2ec Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 5 Dec 2009 17:20:03 +0100 Subject: Add 'texture leak' test. --- progs/tests/Makefile | 1 + progs/tests/texleak.c | 140 ++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 141 insertions(+) create mode 100644 progs/tests/texleak.c diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 197e14d5b00..3e2541186b1 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -98,6 +98,7 @@ SOURCES = \ texdown \ texfilt.c \ texgenmix.c \ + texleak.c \ texline.c \ texobj.c \ texobjshare.c \ diff --git a/progs/tests/texleak.c b/progs/tests/texleak.c new file mode 100644 index 00000000000..5cf4ff32393 --- /dev/null +++ b/progs/tests/texleak.c @@ -0,0 +1,140 @@ +/* + * 'Texture leak' test + * + * Allocates and uses an additional texture of the maximum supported size for + * each frame. This tests the system's ability to cope with using increasing + * amounts of texture memory. + * + * Michel Dänzer July 2009 This program is in the public domain. + */ + + +#include +#include +#include +#include +#include +#include +#include +#include + + +GLint size; +GLvoid *image; +static GLuint numTexObj; +static GLuint *texObj; + + +static void Idle( void ) +{ + glutPostRedisplay(); +} + + +static void DrawObject(void) +{ + static const GLfloat tex_coords[] = { 0.0, 0.0, 1.0, 1.0, 0.0 }; + static const GLfloat vtx_coords[] = { -1.0, -1.0, 1.0, 1.0, -1.0 }; + GLint i, j; + + glEnable(GL_TEXTURE_2D); + + for (i = 0; i < numTexObj; i++) { + glBindTexture(GL_TEXTURE_2D, texObj[i]); + glBegin(GL_QUADS); + for (j = 0; j < 4; j++ ) { + glTexCoord2f(tex_coords[j], tex_coords[j+1]); + glVertex2f( vtx_coords[j], vtx_coords[j+1] ); + } + glEnd(); + } +} + + +static void Display( void ) +{ + struct timeval start, end; + + texObj = realloc(texObj, ++numTexObj * sizeof(*texObj)); + + /* allocate a texture object */ + glGenTextures(1, texObj + (numTexObj - 1)); + + glBindTexture(GL_TEXTURE_2D, texObj[numTexObj - 1]); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST); + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST); + memset(image, (16 * numTexObj) & 0xff, 4 * size * size); + glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, size, size, 0, + GL_RGBA, GL_UNSIGNED_BYTE, image); + + gettimeofday(&start, NULL); + + glClear( GL_COLOR_BUFFER_BIT ); + + glPushMatrix(); + glScalef(5.0, 5.0, 5.0); + DrawObject(); + glPopMatrix(); + + glutSwapBuffers(); + + glFinish(); + gettimeofday(&end, NULL); + printf("Rendering frame took %lu ms using %u MB of textures\n", + end.tv_sec * 1000 + end.tv_usec / 1000 - start.tv_sec * 1000 - + start.tv_usec / 1000, numTexObj * 4 * size / 1024 * size / 1024); + + sleep(1); +} + + +static void Reshape( int width, int height ) +{ + glViewport( 0, 0, width, height ); + glMatrixMode( GL_PROJECTION ); + glLoadIdentity(); + glOrtho( -6.0, 6.0, -6.0, 6.0, 10.0, 100.0 ); + glMatrixMode( GL_MODELVIEW ); + glLoadIdentity(); + glTranslatef( 0.0, 0.0, -70.0 ); +} + + +static void Init( int argc, char *argv[] ) +{ + glGetIntegerv(GL_MAX_TEXTURE_SIZE, &size); + printf("%d x %d max texture size\n", size, size); + + image = malloc(4 * size * size); + if (!image) { + fprintf(stderr, "Failed to allocate %u bytes of memory\n", 4 * size * size); + exit(1); + } + + glPixelStorei(GL_UNPACK_ALIGNMENT, 1); + + glShadeModel(GL_FLAT); + glClearColor(0.3, 0.3, 0.4, 1.0); + + Idle(); +} + + +int main( int argc, char *argv[] ) +{ + glutInit( &argc, argv ); + glutInitWindowSize( 300, 300 ); + glutInitWindowPosition( 0, 0 ); + glutInitDisplayMode( GLUT_RGB | GLUT_DOUBLE ); + glutCreateWindow(argv[0] ); + glewInit(); + + Init( argc, argv ); + + glutReshapeFunc( Reshape ); + glutDisplayFunc( Display ); + glutIdleFunc(Idle); + + glutMainLoop(); + return 0; +} -- cgit v1.2.3 From 01537a84dfe65cd1512d6fbf71e975fad5639432 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 5 Dec 2009 17:42:50 +0100 Subject: st/mesa: Prefer alpha-less formats for RGB textures. This can e.g. increase the chance of being able to accelerate glCopyTex(Sub)Image from an alpha-less renderbuffer. --- src/mesa/state_tracker/st_format.c | 36 ++++++++++++++++++++++++++++++++---- 1 file changed, 32 insertions(+), 4 deletions(-) diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c index 02f80057c29..93125afe9e1 100644 --- a/src/mesa/state_tracker/st_format.c +++ b/src/mesa/state_tracker/st_format.c @@ -388,6 +388,33 @@ default_rgba_format(struct pipe_screen *screen, return PIPE_FORMAT_NONE; } +/** + * Find an RGB format supported by the context/winsys. + */ +static enum pipe_format +default_rgb_format(struct pipe_screen *screen, + enum pipe_texture_target target, + unsigned tex_usage, + unsigned geom_flags) +{ + static const enum pipe_format colorFormats[] = { + PIPE_FORMAT_X8R8G8B8_UNORM, + PIPE_FORMAT_B8G8R8X8_UNORM, + PIPE_FORMAT_R8G8B8X8_UNORM, + PIPE_FORMAT_A8R8G8B8_UNORM, + PIPE_FORMAT_B8G8R8A8_UNORM, + PIPE_FORMAT_R8G8B8A8_UNORM, + PIPE_FORMAT_R5G6B5_UNORM + }; + uint i; + for (i = 0; i < Elements(colorFormats); i++) { + if (screen->is_format_supported( screen, colorFormats[i], target, tex_usage, geom_flags )) { + return colorFormats[i]; + } + } + return PIPE_FORMAT_NONE; +} + /** * Find an sRGBA format supported by the context/winsys. */ @@ -472,13 +499,14 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case 4: case GL_RGBA: case GL_COMPRESSED_RGBA: - case 3: - case GL_RGB: - case GL_COMPRESSED_RGB: case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: return default_rgba_format( screen, target, tex_usage, geom_flags ); + case 3: + case GL_RGB: + case GL_COMPRESSED_RGB: + return default_rgb_format( screen, target, tex_usage, geom_flags ); case GL_RGBA16: if (tex_usage & PIPE_TEXTURE_USAGE_RENDER_TARGET) return default_deep_rgba_format( screen, target, tex_usage, geom_flags ); @@ -500,7 +528,7 @@ st_choose_format(struct pipe_screen *screen, GLenum internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return default_rgba_format( screen, target, tex_usage, geom_flags ); + return default_rgb_format( screen, target, tex_usage, geom_flags ); case GL_RGB5: case GL_RGB4: -- cgit v1.2.3 From 56a4342a0493ad1d502d4791ab941ef171d36e60 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Sat, 5 Dec 2009 17:48:00 +0100 Subject: r300g: Need to emit a hardware scissor rectangle even if scissor is disabled. Just make it cover the whole framebuffer in that case. Otherwise the kernel CS checker may complain, e.g. running progs/demos/gearbox. That runs fast now here, but doesn't look right yet. --- src/gallium/drivers/r300/r300_context.h | 2 ++ src/gallium/drivers/r300/r300_emit.c | 9 +++++++-- src/gallium/drivers/r300/r300_state.c | 19 +++++++++++++++++++ 3 files changed, 28 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index dd3f6ac1432..11cd9f855f3 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -101,6 +101,8 @@ struct r300_sampler_state { struct r300_scissor_state { uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ + uint32_t no_scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ + uint32_t no_scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ }; struct r300_texture_state { diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 60be03f54fc..04dca292167 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -570,8 +570,13 @@ void r300_emit_scissor_state(struct r300_context* r300, BEGIN_CS(3); OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); - OUT_CS(scissor->scissor_top_left); - OUT_CS(scissor->scissor_bottom_right); + if (r300->rs_state->rs.scissor) { + OUT_CS(scissor->scissor_top_left); + OUT_CS(scissor->scissor_bottom_right); + } else { + OUT_CS(scissor->no_scissor_top_left); + OUT_CS(scissor->no_scissor_bottom_right); + } END_CS; } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 442af70e143..2bc2b79c021 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -302,6 +302,25 @@ static void r300->framebuffer_state = *state; r300->dirty_state |= R300_NEW_FRAMEBUFFERS; + + if (r300_screen(r300->context.screen)->caps->is_r500) { + r300->scissor_state->no_scissor_top_left = + (0 << R300_SCISSORS_X_SHIFT) | + (0 << R300_SCISSORS_Y_SHIFT); + r300->scissor_state->no_scissor_bottom_right = + ((state->width - 1) << R300_SCISSORS_X_SHIFT) | + ((state->height - 1) << R300_SCISSORS_Y_SHIFT); + } else { + /* Offset of 1440 in non-R500 chipsets. */ + r300->scissor_state->no_scissor_top_left = + ((0 + 1440) << R300_SCISSORS_X_SHIFT) | + ((0 + 1440) << R300_SCISSORS_Y_SHIFT); + r300->scissor_state->no_scissor_bottom_right = + (((state->width - 1) + 1440) << R300_SCISSORS_X_SHIFT) | + (((state->height - 1) + 1440) << R300_SCISSORS_Y_SHIFT); + } + + r300->dirty_state |= R300_NEW_SCISSOR; } /* Create fragment shader state. */ -- cgit v1.2.3 From cbb7226a4b457a3ebc94592660f22324c8e7cfcc Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Sat, 5 Dec 2009 13:19:54 -0500 Subject: st/xvmc: No more pf_get_block(). --- src/gallium/state_trackers/xorg/xvmc/surface.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xvmc/surface.c b/src/gallium/state_trackers/xorg/xvmc/surface.c index 8cb73f48970..0e39a390c69 100644 --- a/src/gallium/state_trackers/xorg/xvmc/surface.c +++ b/src/gallium/state_trackers/xorg/xvmc/surface.c @@ -1,8 +1,8 @@ /************************************************************************** - * + * * Copyright 2009 Younes Manton. * All Rights Reserved. - * + * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the * "Software"), to deal in the Software without restriction, including @@ -10,11 +10,11 @@ * distribute, sub license, and/or sell copies of the Software, and to * permit persons to whom the Software is furnished to do so, subject to * the following conditions: - * + * * The above copyright notice and this permission notice (including the * next paragraph) shall be included in all copies or substantial portions * of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. @@ -22,7 +22,7 @@ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * + * **************************************************************************/ #include @@ -106,7 +106,6 @@ CreateOrResizeBackBuffer(struct pipe_video_context *vpipe, unsigned int width, u template.width0 = width; template.height0 = height; template.depth0 = 1; - pf_get_block(template.format, &template.block); template.tex_usage = PIPE_TEXTURE_USAGE_DISPLAY_TARGET; tex = vpipe->screen->texture_create(vpipe->screen, &template); -- cgit v1.2.3 From 4071d065c2c32a872bb148d108252a2380c42da4 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 18:18:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameteri, which uses the params argument as an array. (cherry picked from commit a201dfb6bf28b89d6f511c2ec9ae0d81ef18511d) --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 9d1fdd05664..416792f0e99 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -544,8 +544,10 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) param; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) param; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; default: -- cgit v1.2.3 From ca8a2150c79899bad0f80e132656863822db045e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 21:17:44 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterf. _mesa_TexParameterf calls set_tex_parameterf, which uses the params argument as an array. (cherry picked from commit 270d36da146b899d39e08f830fe34b63833a3731) --- src/mesa/main/texparam.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 416792f0e99..4ce8c8593a9 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -551,8 +551,13 @@ _mesa_TexParameterf(GLenum target, GLenum pname, GLfloat param) } break; default: - /* this will generate an error if pname is illegal */ - need_update = set_tex_parameterf(ctx, texObj, pname, ¶m); + { + /* this will generate an error if pname is illegal */ + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, p); + } } if (ctx->Driver.TexParameter && need_update) { -- cgit v1.2.3 From d74cd04e6190ebb3a9c53d45cbb2452d92e24ad5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:47:23 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGeni. _mesa_TexGeni calls _mesa_TexGeniv, which uses the params argument as an array. (cherry picked from commit d55fb7c835b56951f05a058083e7eda264ba192e) --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index e3feb024c31..13b33745b86 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -213,7 +213,10 @@ _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) void GLAPIENTRY _mesa_TexGeni( GLenum coord, GLenum pname, GLint param ) { - _mesa_TexGeniv( coord, pname, ¶m ); + GLint p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0; + _mesa_TexGeniv( coord, pname, p ); } -- cgit v1.2.3 From b2953ee1a655a010f36b5fc1b47f8bd8b06ce368 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sun, 29 Nov 2009 00:50:48 -0500 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGenf. _mesa_TexGenf calls _mesa_TexGenfv, which uses the params argument as an array. (cherry picked from commit ca5a7aadb4361e7d053aea8687372cd44cbd8795) --- src/mesa/main/texgen.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index 13b33745b86..d3ea7b936b3 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -206,7 +206,10 @@ _mesa_TexGendv(GLenum coord, GLenum pname, const GLdouble *params ) void GLAPIENTRY _mesa_TexGenf( GLenum coord, GLenum pname, GLfloat param ) { - _mesa_TexGenfv(coord, pname, ¶m); + GLfloat p[4]; + p[0] = param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv(coord, pname, p); } -- cgit v1.2.3 From 3cd745515e72c42efcd0c9f7d30e58f46f821b98 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 16:03:48 -0800 Subject: draw: Initialize variable in draw_pt.c. (cherry picked from commit ea98e9820d7117f7a187f355445796b1ef5d9e0c) --- src/gallium/auxiliary/draw/draw_pt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/draw/draw_pt.c b/src/gallium/auxiliary/draw/draw_pt.c index dbb5ac71821..4865a2d8542 100644 --- a/src/gallium/auxiliary/draw/draw_pt.c +++ b/src/gallium/auxiliary/draw/draw_pt.c @@ -192,7 +192,8 @@ draw_print_arrays(struct draw_context *draw, uint prim, int start, uint count) prim, start, count); for (i = 0; i < count; i++) { - uint ii, j; + uint ii = 0; + uint j; if (draw->pt.user.elts) { /* indexed arrays */ -- cgit v1.2.3 From df02bc42b330fe20679dd3e5e83317df72ddd5ca Mon Sep 17 00:00:00 2001 From: Alex Deucher Date: Sat, 5 Dec 2009 18:24:41 -0500 Subject: radeon/r200/r600: fix drivers for changes in 433f0a82f5a4696e6b0c4061f645485ec8079bb4 --- src/mesa/drivers/dri/r200/r200_texstate.c | 15 ++------------- src/mesa/drivers/dri/r600/r600_texstate.c | 13 +------------ src/mesa/drivers/dri/radeon/radeon_texstate.c | 15 ++------------- 3 files changed, 5 insertions(+), 38 deletions(-) diff --git a/src/mesa/drivers/dri/r200/r200_texstate.c b/src/mesa/drivers/dri/r200/r200_texstate.c index 7782404a794..e2f9cf0ea86 100644 --- a/src/mesa/drivers/dri/r200/r200_texstate.c +++ b/src/mesa/drivers/dri/r200/r200_texstate.c @@ -797,24 +797,13 @@ void r200SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ return; } - + _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { radeon_bo_unref(t->bo); diff --git a/src/mesa/drivers/dri/r600/r600_texstate.c b/src/mesa/drivers/dri/r600/r600_texstate.c index 4ec315b78c7..2a4a6e6ee14 100644 --- a/src/mesa/drivers/dri/r600/r600_texstate.c +++ b/src/mesa/drivers/dri/r600/r600_texstate.c @@ -917,18 +917,7 @@ void r600SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ diff --git a/src/mesa/drivers/dri/radeon/radeon_texstate.c b/src/mesa/drivers/dri/radeon/radeon_texstate.c index 3cbe3b47254..84ddcfd4fd3 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texstate.c +++ b/src/mesa/drivers/dri/radeon/radeon_texstate.c @@ -672,24 +672,13 @@ void radeonSetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_ return; } - radeon_update_renderbuffers(pDRICtx, dPriv); - /* back & depth buffer are useless free them right away */ - rb = (void*)rfb->base.Attachment[BUFFER_DEPTH].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } - rb = (void*)rfb->base.Attachment[BUFFER_BACK_LEFT].Renderbuffer; - if (rb && rb->bo) { - radeon_bo_unref(rb->bo); - rb->bo = NULL; - } + radeon_update_renderbuffers(pDRICtx, dPriv, GL_TRUE); rb = rfb->color_rb[0]; if (rb->bo == NULL) { /* Failed to BO for the buffer */ return; } - + _mesa_lock_texture(radeon->glCtx, texObj); if (t->bo) { radeon_bo_unref(t->bo); -- cgit v1.2.3 From 978b80c8e35b465273921a28540ed15f07d1afbf Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 9 Oct 2009 07:24:04 -0600 Subject: progs/tests: Add tests to Makefile. (cherry picked from commit 76d2ec3a0a047a65ffca70f53848241a3225dad3) --- progs/tests/Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/progs/tests/Makefile b/progs/tests/Makefile index 8c310df0954..197e14d5b00 100644 --- a/progs/tests/Makefile +++ b/progs/tests/Makefile @@ -25,6 +25,7 @@ SOURCES = \ arbvptorus.c \ arbvpwarpmesh.c \ arraytexture.c \ + auxbuffer.c \ blendminmax.c \ blendsquare.c \ blendxor.c \ @@ -41,6 +42,7 @@ SOURCES = \ cva.c \ drawbuffers.c \ exactrast.c \ + ext422square.c \ floattex.c \ fbotest1.c \ fbotest2.c \ @@ -66,6 +68,8 @@ SOURCES = \ mipmap_limits.c \ mipmap_view.c \ multipal.c \ + multitexarray.c \ + multiwindow.c \ no_s3tc.c \ packedpixels.c \ pbo.c \ @@ -88,10 +92,12 @@ SOURCES = \ subtex \ subtexrate.c \ tex1d.c \ + texcmp.c \ texcompress2.c \ texcompsub.c \ texdown \ texfilt.c \ + texgenmix.c \ texline.c \ texobj.c \ texobjshare.c \ @@ -101,6 +107,7 @@ SOURCES = \ vao-01.c \ vao-02.c \ vparray.c \ + vpeval.c \ vptest1.c \ vptest2.c \ vptest3.c \ -- cgit v1.2.3 From 76b3523d752968bc552d4350a39b9b9b1a023cf0 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 23 Nov 2009 01:30:32 -0500 Subject: glx: Prevent potential null pointer deference in driCreateContext. (cherry picked from commit 4b0b250aae6ae7d48cd24f9d91d05ab58086c4b2) --- src/glx/x11/drisw_glx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/glx/x11/drisw_glx.c b/src/glx/x11/drisw_glx.c index 15e15866582..1866b2cc870 100644 --- a/src/glx/x11/drisw_glx.c +++ b/src/glx/x11/drisw_glx.c @@ -250,12 +250,14 @@ driCreateContext(__GLXscreenConfigs * psc, { __GLXDRIcontextPrivate *pcp, *pcp_shared; __GLXDRIconfigPrivate *config = (__GLXDRIconfigPrivate *) mode; - const __DRIcoreExtension *core = psc->core; + const __DRIcoreExtension *core; __DRIcontext *shared = NULL; if (!psc || !psc->driScreen) return NULL; + core = psc->core; + if (shareList) { pcp_shared = (__GLXDRIcontextPrivate *) shareList->driContext; shared = pcp_shared->driContext; -- cgit v1.2.3 From f622b649fb0c55b1640997f9d32ea327743519a1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 24 Nov 2009 00:57:55 -0500 Subject: dri: Fix potential null pointer deference in dri_put_drawable. (cherry picked from commit 364070b1f2b08d43fb205ec198894a35bec6b2f3) --- src/mesa/drivers/dri/common/dri_util.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index e48e10d7c06..439f66a7b88 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -498,11 +498,11 @@ static void dri_put_drawable(__DRIdrawable *pdp) { __DRIscreenPrivate *psp; - pdp->refcount--; - if (pdp->refcount) - return; - if (pdp) { + pdp->refcount--; + if (pdp->refcount) + return; + psp = pdp->driScreenPriv; (*psp->DriverAPI.DestroyBuffer)(pdp); if (pdp->pClipRects) { -- cgit v1.2.3 From c994f08eb1ec2a4bbaa44fbd6d35e7ff033d5c3c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Sat, 28 Nov 2009 23:22:31 -0500 Subject: dri: Fix potential null pointer dereference in driBindContext. (cherry picked from commit 919898e92fa23ff71a59d86a46ff0886a6f34e4d) --- src/mesa/drivers/dri/common/dri_util.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c index 439f66a7b88..da81ec9de51 100644 --- a/src/mesa/drivers/dri/common/dri_util.c +++ b/src/mesa/drivers/dri/common/dri_util.c @@ -167,11 +167,12 @@ static int driBindContext(__DRIcontext *pcp, __DRIdrawable *pdp, __DRIdrawable *prp) { - __DRIscreenPrivate *psp = pcp->driScreenPriv; + __DRIscreenPrivate *psp; /* Bind the drawable to the context */ if (pcp) { + psp = pcp->driScreenPriv; pcp->driDrawablePriv = pdp; pcp->driReadablePriv = prp; if (pdp) { -- cgit v1.2.3 From e1380cae885df37d4a211d0271f59487d9f2db78 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 5 Dec 2009 19:17:20 +0100 Subject: r300g: remove redundant code and clean up --- src/gallium/drivers/r300/r300_context.h | 11 +++-- src/gallium/drivers/r300/r300_emit.c | 19 +++++---- src/gallium/drivers/r300/r300_state.c | 73 +++++++++++++++++---------------- 3 files changed, 57 insertions(+), 46 deletions(-) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 11cd9f855f3..23ea32c57ed 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -98,11 +98,14 @@ struct r300_sampler_state { unsigned min_lod, max_lod; }; +struct r300_scissor_regs { + uint32_t top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ + uint32_t bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ +}; + struct r300_scissor_state { - uint32_t scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ - uint32_t scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ - uint32_t no_scissor_top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ - uint32_t no_scissor_bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ + struct r300_scissor_regs framebuffer; + struct r300_scissor_regs scissor; }; struct r300_texture_state { diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 04dca292167..dbf316a9b57 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -563,21 +563,26 @@ void r300_emit_rs_block_state(struct r300_context* r300, END_CS; } -void r300_emit_scissor_state(struct r300_context* r300, - struct r300_scissor_state* scissor) +static void r300_emit_scissor_regs(struct r300_context* r300, + struct r300_scissor_regs* scissor) { CS_LOCALS(r300); BEGIN_CS(3); OUT_CS_REG_SEQ(R300_SC_SCISSORS_TL, 2); + OUT_CS(scissor->top_left); + OUT_CS(scissor->bottom_right); + END_CS; +} + +void r300_emit_scissor_state(struct r300_context* r300, + struct r300_scissor_state* scissor) +{ if (r300->rs_state->rs.scissor) { - OUT_CS(scissor->scissor_top_left); - OUT_CS(scissor->scissor_bottom_right); + r300_emit_scissor_regs(r300, &scissor->scissor); } else { - OUT_CS(scissor->no_scissor_top_left); - OUT_CS(scissor->no_scissor_bottom_right); + r300_emit_scissor_regs(r300, &scissor->framebuffer); } - END_CS; } void r300_emit_texture(struct r300_context* r300, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 2bc2b79c021..d3233557cea 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -289,11 +289,34 @@ static void r300_set_edgeflags(struct pipe_context* pipe, /* XXX and even worse, I have no idea WTF the bitfield is */ } +static void r300_set_scissor_regs(const struct pipe_scissor_state* state, + struct r300_scissor_regs *scissor, + boolean is_r500) +{ + if (is_r500) { + scissor->top_left = + (state->minx << R300_SCISSORS_X_SHIFT) | + (state->miny << R300_SCISSORS_Y_SHIFT); + scissor->bottom_right = + ((state->maxx - 1) << R300_SCISSORS_X_SHIFT) | + ((state->maxy - 1) << R300_SCISSORS_Y_SHIFT); + } else { + /* Offset of 1440 in non-R500 chipsets. */ + scissor->top_left = + ((state->minx + 1440) << R300_SCISSORS_X_SHIFT) | + ((state->miny + 1440) << R300_SCISSORS_Y_SHIFT); + scissor->bottom_right = + (((state->maxx - 1) + 1440) << R300_SCISSORS_X_SHIFT) | + (((state->maxy - 1) + 1440) << R300_SCISSORS_Y_SHIFT); + } +} + static void r300_set_framebuffer_state(struct pipe_context* pipe, const struct pipe_framebuffer_state* state) { struct r300_context* r300 = r300_context(pipe); + struct pipe_scissor_state scissor; if (r300->draw) { draw_flush(r300->draw); @@ -301,26 +324,17 @@ static void r300->framebuffer_state = *state; - r300->dirty_state |= R300_NEW_FRAMEBUFFERS; + scissor.minx = scissor.miny = 0; + scissor.maxx = state->width; + scissor.maxy = state->height; + r300_set_scissor_regs(&scissor, &r300->scissor_state->framebuffer, + r300_screen(r300->context.screen)->caps->is_r500); - if (r300_screen(r300->context.screen)->caps->is_r500) { - r300->scissor_state->no_scissor_top_left = - (0 << R300_SCISSORS_X_SHIFT) | - (0 << R300_SCISSORS_Y_SHIFT); - r300->scissor_state->no_scissor_bottom_right = - ((state->width - 1) << R300_SCISSORS_X_SHIFT) | - ((state->height - 1) << R300_SCISSORS_Y_SHIFT); - } else { - /* Offset of 1440 in non-R500 chipsets. */ - r300->scissor_state->no_scissor_top_left = - ((0 + 1440) << R300_SCISSORS_X_SHIFT) | - ((0 + 1440) << R300_SCISSORS_Y_SHIFT); - r300->scissor_state->no_scissor_bottom_right = - (((state->width - 1) + 1440) << R300_SCISSORS_X_SHIFT) | - (((state->height - 1) + 1440) << R300_SCISSORS_Y_SHIFT); + /* Don't rely on the order of states being set for the first time. */ + if (!r300->rs_state || !r300->rs_state->rs.scissor) { + r300->dirty_state |= R300_NEW_SCISSOR; } - - r300->dirty_state |= R300_NEW_SCISSOR; + r300->dirty_state |= R300_NEW_FRAMEBUFFERS; } /* Create fragment shader state. */ @@ -642,24 +656,13 @@ static void r300_set_scissor_state(struct pipe_context* pipe, { struct r300_context* r300 = r300_context(pipe); - if (r300_screen(r300->context.screen)->caps->is_r500) { - r300->scissor_state->scissor_top_left = - (state->minx << R300_SCISSORS_X_SHIFT) | - (state->miny << R300_SCISSORS_Y_SHIFT); - r300->scissor_state->scissor_bottom_right = - ((state->maxx - 1) << R300_SCISSORS_X_SHIFT) | - ((state->maxy - 1) << R300_SCISSORS_Y_SHIFT); - } else { - /* Offset of 1440 in non-R500 chipsets. */ - r300->scissor_state->scissor_top_left = - ((state->minx + 1440) << R300_SCISSORS_X_SHIFT) | - ((state->miny + 1440) << R300_SCISSORS_Y_SHIFT); - r300->scissor_state->scissor_bottom_right = - (((state->maxx - 1) + 1440) << R300_SCISSORS_X_SHIFT) | - (((state->maxy - 1) + 1440) << R300_SCISSORS_Y_SHIFT); - } + r300_set_scissor_regs(state, &r300->scissor_state->scissor, + r300_screen(r300->context.screen)->caps->is_r500); - r300->dirty_state |= R300_NEW_SCISSOR; + /* Don't rely on the order of states being set for the first time. */ + if (!r300->rs_state || r300->rs_state->rs.scissor) { + r300->dirty_state |= R300_NEW_SCISSOR; + } } static void r300_set_viewport_state(struct pipe_context* pipe, -- cgit v1.2.3 From 07487643515edb731c6abc3e931c329a89dd9293 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 5 Dec 2009 20:39:11 +0100 Subject: r300g: don't render if everything is culled by scissoring Otherwise a CS is refused by kernel 2.6.31 (and maybe all later versions, not sure). --- src/gallium/drivers/r300/r300_context.h | 3 +++ src/gallium/drivers/r300/r300_render.c | 23 +++++++++++++++++++++++ src/gallium/drivers/r300/r300_state.c | 3 +++ 3 files changed, 29 insertions(+) diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 23ea32c57ed..0be190392a5 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -101,6 +101,9 @@ struct r300_sampler_state { struct r300_scissor_regs { uint32_t top_left; /* R300_SC_SCISSORS_TL: 0x43e0 */ uint32_t bottom_right; /* R300_SC_SCISSORS_BR: 0x43e4 */ + + /* Whether everything is culled by scissoring. */ + boolean empty_area; }; struct r300_scissor_state { diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 4c5fb405c6a..35b335df6a1 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -70,6 +70,12 @@ uint32_t r300_translate_primitive(unsigned prim) } } +static boolean r300_nothing_to_draw(struct r300_context *r300) +{ + return r300->rs_state->rs.scissor && + r300->scissor_state->scissor.empty_area; +} + static void r300_emit_draw_arrays(struct r300_context *r300, unsigned mode, unsigned count) @@ -173,10 +179,15 @@ boolean r300_draw_range_elements(struct pipe_context* pipe, return FALSE; } + if (count > 65535) { return FALSE; } + if (r300_nothing_to_draw(r300)) { + return TRUE; + } + r300_update_derived_state(r300); if (!r300_setup_vertex_buffers(r300)) { @@ -218,6 +229,10 @@ boolean r300_draw_arrays(struct pipe_context* pipe, unsigned mode, return FALSE; } + if (r300_nothing_to_draw(r300)) { + return TRUE; + } + r300_update_derived_state(r300); if (!r300_setup_vertex_buffers(r300)) { @@ -251,6 +266,10 @@ boolean r300_swtcl_draw_arrays(struct pipe_context* pipe, return FALSE; } + if (r300_nothing_to_draw(r300)) { + return TRUE; + } + for (i = 0; i < r300->vertex_buffer_count; i++) { void* buf = pipe_buffer_map(pipe->screen, r300->vertex_buffer[i].buffer, @@ -292,6 +311,10 @@ boolean r300_swtcl_draw_range_elements(struct pipe_context* pipe, return FALSE; } + if (r300_nothing_to_draw(r300)) { + return TRUE; + } + for (i = 0; i < r300->vertex_buffer_count; i++) { void* buf = pipe_buffer_map(pipe->screen, r300->vertex_buffer[i].buffer, diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index d3233557cea..8ef0b3b268a 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -309,6 +309,9 @@ static void r300_set_scissor_regs(const struct pipe_scissor_state* state, (((state->maxx - 1) + 1440) << R300_SCISSORS_X_SHIFT) | (((state->maxy - 1) + 1440) << R300_SCISSORS_Y_SHIFT); } + + scissor->empty_area = state->minx >= state->maxx || + state->miny >= state->maxy; } static void -- cgit v1.2.3 From 7005f7cd1a9947e75bf772897d9055e3fe467c3d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Fri, 20 Nov 2009 16:33:25 -0800 Subject: st/egl: Fix memory leak in egl_tracker.c. (cherry picked from commit 052b127842af3372fd768eae8e29b240a696a12a) --- src/gallium/state_trackers/egl/egl_tracker.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/egl/egl_tracker.c b/src/gallium/state_trackers/egl/egl_tracker.c index 5140755001c..4548b4fd27c 100644 --- a/src/gallium/state_trackers/egl/egl_tracker.c +++ b/src/gallium/state_trackers/egl/egl_tracker.c @@ -85,11 +85,11 @@ drm_get_device_id(struct drm_device *device) } ret = fgets(path, sizeof( path ), file); + fclose(file); if (!ret) return; sscanf(path, "%x", &device->deviceID); - fclose(file); } static void -- cgit v1.2.3 From c574f515f0aa20ccc3841cf61a6124bc5996e7b2 Mon Sep 17 00:00:00 2001 From: Younes Manton Date: Sun, 6 Dec 2009 12:26:55 -0500 Subject: nouveau: Work around nv04-nv40 miptrees not matching nouveau_miptree. Thanks to Bob Gleitsmann for the patch. I'll clean this up in a better way later if noone else beats me to it. --- src/gallium/drivers/nv04/nv04_miptree.c | 3 ++- src/gallium/drivers/nv04/nv04_state.h | 1 + src/gallium/drivers/nv10/nv10_miptree.c | 2 ++ src/gallium/drivers/nv10/nv10_state.h | 1 + src/gallium/drivers/nv20/nv20_miptree.c | 2 ++ src/gallium/drivers/nv20/nv20_state.h | 1 + src/gallium/drivers/nv30/nv30_miptree.c | 2 ++ src/gallium/drivers/nv30/nv30_state.h | 1 + src/gallium/drivers/nv40/nv40_miptree.c | 5 ++++- src/gallium/drivers/nv40/nv40_state.h | 1 + 10 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nv04/nv04_miptree.c b/src/gallium/drivers/nv04/nv04_miptree.c index eeab6dfa303..e0a6948aeb4 100644 --- a/src/gallium/drivers/nv04/nv04_miptree.c +++ b/src/gallium/drivers/nv04/nv04_miptree.c @@ -55,7 +55,7 @@ nv04_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) FREE(mt); return NULL; } - + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } @@ -81,6 +81,7 @@ nv04_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(&mt->buffer, pb); + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } diff --git a/src/gallium/drivers/nv04/nv04_state.h b/src/gallium/drivers/nv04/nv04_state.h index 399f750dbe7..81d1d2ebaa9 100644 --- a/src/gallium/drivers/nv04/nv04_state.h +++ b/src/gallium/drivers/nv04/nv04_state.h @@ -31,6 +31,7 @@ struct nv04_rasterizer_state { struct nv04_miptree { struct pipe_texture base; + struct nouveau_bo *bo; struct pipe_buffer *buffer; uint total_size; diff --git a/src/gallium/drivers/nv10/nv10_miptree.c b/src/gallium/drivers/nv10/nv10_miptree.c index 439beeccc32..6a52b6af362 100644 --- a/src/gallium/drivers/nv10/nv10_miptree.c +++ b/src/gallium/drivers/nv10/nv10_miptree.c @@ -67,6 +67,7 @@ nv10_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(&mt->buffer, pb); + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } @@ -90,6 +91,7 @@ nv10_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) FREE(mt); return NULL; } + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } diff --git a/src/gallium/drivers/nv10/nv10_state.h b/src/gallium/drivers/nv10/nv10_state.h index 3a3fd0d4f4f..2524ac02e29 100644 --- a/src/gallium/drivers/nv10/nv10_state.h +++ b/src/gallium/drivers/nv10/nv10_state.h @@ -126,6 +126,7 @@ struct nv10_depth_stencil_alpha_state { struct nv10_miptree { struct pipe_texture base; + struct nouveau_bo *bo; struct pipe_buffer *buffer; uint total_size; diff --git a/src/gallium/drivers/nv20/nv20_miptree.c b/src/gallium/drivers/nv20/nv20_miptree.c index 2bde9fb75bc..e2e01bd849b 100644 --- a/src/gallium/drivers/nv20/nv20_miptree.c +++ b/src/gallium/drivers/nv20/nv20_miptree.c @@ -77,6 +77,7 @@ nv20_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->level[0].image_offset = CALLOC(1, sizeof(unsigned)); pipe_buffer_reference(&mt->buffer, pb); + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } @@ -132,6 +133,7 @@ nv20_miptree_create(struct pipe_screen *screen, const struct pipe_texture *pt) FREE(mt); return NULL; } + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } diff --git a/src/gallium/drivers/nv20/nv20_state.h b/src/gallium/drivers/nv20/nv20_state.h index 34f402fdcbf..dde41065685 100644 --- a/src/gallium/drivers/nv20/nv20_state.h +++ b/src/gallium/drivers/nv20/nv20_state.h @@ -126,6 +126,7 @@ struct nv20_depth_stencil_alpha_state { struct nv20_miptree { struct pipe_texture base; + struct nouveau_bo *bo; struct pipe_buffer *buffer; uint total_size; diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 9e50a7cf6bf..920fe64c32f 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -115,6 +115,7 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) FREE(mt); return NULL; } + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } @@ -144,6 +145,7 @@ nv30_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; pipe_buffer_reference(&mt->buffer, pb); + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } diff --git a/src/gallium/drivers/nv30/nv30_state.h b/src/gallium/drivers/nv30/nv30_state.h index e6f23bf1667..e42e872de75 100644 --- a/src/gallium/drivers/nv30/nv30_state.h +++ b/src/gallium/drivers/nv30/nv30_state.h @@ -72,6 +72,7 @@ struct nv30_fragment_program { struct nv30_miptree { struct pipe_texture base; + struct nouveau_bo *bo; struct pipe_buffer *buffer; uint total_size; diff --git a/src/gallium/drivers/nv40/nv40_miptree.c b/src/gallium/drivers/nv40/nv40_miptree.c index 8779c5572b9..89ddf373e9e 100644 --- a/src/gallium/drivers/nv40/nv40_miptree.c +++ b/src/gallium/drivers/nv40/nv40_miptree.c @@ -5,6 +5,8 @@ #include "nv40_context.h" + + static void nv40_miptree_layout(struct nv40_miptree *mt) { @@ -109,7 +111,7 @@ nv40_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) FREE(mt); return NULL; } - + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } @@ -138,6 +140,7 @@ nv40_miptree_blanket(struct pipe_screen *pscreen, const struct pipe_texture *pt, mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; pipe_buffer_reference(&mt->buffer, pb); + mt->bo = nouveau_bo(mt->buffer); return &mt->base; } diff --git a/src/gallium/drivers/nv40/nv40_state.h b/src/gallium/drivers/nv40/nv40_state.h index 8a9d8c8fdf6..192074e7471 100644 --- a/src/gallium/drivers/nv40/nv40_state.h +++ b/src/gallium/drivers/nv40/nv40_state.h @@ -75,6 +75,7 @@ struct nv40_fragment_program { struct nv40_miptree { struct pipe_texture base; + struct nouveau_bo *bo; struct pipe_buffer *buffer; uint total_size; -- cgit v1.2.3 From 7091afed789dbba8364deaea0b7a5a99a12ff25e Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 5 Dec 2009 01:27:59 +0100 Subject: r300g: enhance ZTOP conditions --- src/gallium/drivers/r300/r300_state_derived.c | 37 ++++++++++++++++++++++----- 1 file changed, 31 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index cd969d633bc..d448866ef0d 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -462,6 +462,31 @@ static void r300_update_derived_shader_state(struct r300_context* r300) r300->dirty_state |= R300_NEW_RS_BLOCK; } +static boolean r300_dsa_writes_depth_stencil(struct r300_dsa_state* dsa) +{ + /* We are interested only in the cases when a new depth or stencil value + * can be written and changed. */ + + /* We might optionally check for [Z func: never] and inspect the stencil + * state in a similar fashion, but it's not terribly important. */ + return (dsa->z_buffer_control & R300_Z_WRITE_ENABLE) + || + (dsa->stencil_ref_mask & R300_STENCILWRITEMASK_MASK) + || + ((dsa->z_buffer_control & R500_STENCIL_REFMASK_FRONT_BACK) && + (dsa->stencil_ref_bf & R300_STENCILWRITEMASK_MASK)); +} + +static boolean r300_dsa_alpha_test_enabled(struct r300_dsa_state* dsa) +{ + /* We are interested only in the cases when alpha testing can kill + * a fragment. */ + uint32_t af = dsa->alpha_function; + + return (af & R300_FG_ALPHA_FUNC_ENABLE) && + (af & R300_FG_ALPHA_FUNC_ALWAYS) != R300_FG_ALPHA_FUNC_ALWAYS; +} + static void r300_update_ztop(struct r300_context* r300) { r300->ztop_state.z_buffer_top = R300_ZTOP_ENABLE; @@ -484,13 +509,13 @@ static void r300_update_ztop(struct r300_context* r300) * * ~C. */ - if (r300->dsa_state->alpha_function) { - r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; - } else if (r300->fs->info.uses_kill) { - r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; - } else if (r300_fragment_shader_writes_depth(r300->fs)) { + + if (r300->query_current || + r300_fragment_shader_writes_depth(r300->fs)) { r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; - } else if (r300->query_current) { + } else if (r300_dsa_writes_depth_stencil(r300->dsa_state) && + (r300->fs->info.uses_kill || + r300_dsa_alpha_test_enabled(r300->dsa_state))) { r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; } } -- cgit v1.2.3 From c99fb991a3b46c5978248b00eef0efd742127a44 Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 6 Dec 2009 23:33:41 -0800 Subject: r300g: Clean up previous commit. If *I* can't read it, there's a strong possibility others can't, either. --- src/gallium/drivers/r300/r300_state_derived.c | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index d448866ef0d..6af49888b9e 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -469,10 +469,8 @@ static boolean r300_dsa_writes_depth_stencil(struct r300_dsa_state* dsa) /* We might optionally check for [Z func: never] and inspect the stencil * state in a similar fashion, but it's not terribly important. */ - return (dsa->z_buffer_control & R300_Z_WRITE_ENABLE) - || - (dsa->stencil_ref_mask & R300_STENCILWRITEMASK_MASK) - || + return (dsa->z_buffer_control & R300_Z_WRITE_ENABLE) || + (dsa->stencil_ref_mask & R300_STENCILWRITEMASK_MASK) || ((dsa->z_buffer_control & R500_STENCIL_REFMASK_FRONT_BACK) && (dsa->stencil_ref_bf & R300_STENCILWRITEMASK_MASK)); } @@ -503,19 +501,25 @@ static void r300_update_ztop(struct r300_context* r300) * The docs claim that for the first three cases, if no ZS writes happen, * then ZTOP can be used. * + * (3) will never apply since we do not support chroma-keyed operations. + * (4) will need to be re-examined (and this comment updated) if/when + * Hyper-Z becomes supported. + * * Additionally, the following conditions require disabled ZTOP: - * ~) Depth writes in fragment shader - * ~) Outstanding occlusion queries + * 5) Depth writes in fragment shader + * 6) Outstanding occlusion queries * * ~C. */ - if (r300->query_current || - r300_fragment_shader_writes_depth(r300->fs)) { + /* ZS writes */ + if (r300_dsa_writes_depth_stencil(r300->dsa_state) && + (r300_dsa_alpha_test_enabled(r300->dsa_state) || /* (1) */ + r300->fs->info.uses_kill)) { /* (2) */ + r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; + } else if (r300_fragment_shader_writes_depth(r300->fs)) { /* (5) */ r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; - } else if (r300_dsa_writes_depth_stencil(r300->dsa_state) && - (r300->fs->info.uses_kill || - r300_dsa_alpha_test_enabled(r300->dsa_state))) { + } else if (r300->query_current) { /* (6) */ r300->ztop_state.z_buffer_top = R300_ZTOP_DISABLE; } } -- cgit v1.2.3 From d8d8b0d244d9abfd16f99de7f2f30c635033f66f Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 6 Dec 2009 23:49:02 -0800 Subject: softpipe: sp_winsys.h should define/include what it needs. --- src/gallium/drivers/softpipe/sp_winsys.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/softpipe/sp_winsys.h b/src/gallium/drivers/softpipe/sp_winsys.h index 9e571862b75..f203ded29ee 100644 --- a/src/gallium/drivers/softpipe/sp_winsys.h +++ b/src/gallium/drivers/softpipe/sp_winsys.h @@ -34,15 +34,17 @@ #ifndef SP_WINSYS_H #define SP_WINSYS_H - #ifdef __cplusplus extern "C" { #endif +#include "pipe/p_defines.h" struct pipe_screen; struct pipe_winsys; struct pipe_context; +struct pipe_texture; +struct pipe_buffer; struct pipe_context *softpipe_create( struct pipe_screen * ); -- cgit v1.2.3 From e3a3ca097c1859c59daf99b722a788cd432b40dc Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 6 Dec 2009 23:50:31 -0800 Subject: radeong: Call softpipe_create directly. Allows us to finally remove radeon_winsys_softpipe. --- src/gallium/winsys/drm/radeon/core/Makefile | 3 +- src/gallium/winsys/drm/radeon/core/SConscript | 1 - src/gallium/winsys/drm/radeon/core/radeon_drm.c | 4 +- src/gallium/winsys/drm/radeon/core/radeon_drm.h | 1 - .../drm/radeon/core/radeon_winsys_softpipe.c | 41 -------------------- .../drm/radeon/core/radeon_winsys_softpipe.h | 44 ---------------------- 6 files changed, 4 insertions(+), 90 deletions(-) delete mode 100644 src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.c delete mode 100644 src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.h diff --git a/src/gallium/winsys/drm/radeon/core/Makefile b/src/gallium/winsys/drm/radeon/core/Makefile index 42a6f4abc21..860cbb6dbf8 100644 --- a/src/gallium/winsys/drm/radeon/core/Makefile +++ b/src/gallium/winsys/drm/radeon/core/Makefile @@ -7,8 +7,7 @@ LIBNAME = radeonwinsys C_SOURCES = \ radeon_buffer.c \ radeon_drm.c \ - radeon_r300.c \ - radeon_winsys_softpipe.c + radeon_r300.c LIBRARY_INCLUDES = -I$(TOP)/src/gallium/drivers/r300 \ $(shell pkg-config libdrm --cflags-only-I) diff --git a/src/gallium/winsys/drm/radeon/core/SConscript b/src/gallium/winsys/drm/radeon/core/SConscript index 2ad68e403fe..f4e9c397bdf 100644 --- a/src/gallium/winsys/drm/radeon/core/SConscript +++ b/src/gallium/winsys/drm/radeon/core/SConscript @@ -6,7 +6,6 @@ radeon_sources = [ 'radeon_buffer.c', 'radeon_drm.c', 'radeon_r300.c', - 'radeon_winsys_softpipe.c', ] env.Append(CPPPATH = '#/src/gallium/drivers/r300') diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index 52419725337..bc66b42fa75 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -29,6 +29,8 @@ * Joakim Sindholt */ +#include "softpipe/sp_winsys.h" + #include "radeon_drm.h" /* Helper function to do the ioctls needed for setup and init. */ @@ -123,7 +125,7 @@ struct pipe_context* radeon_create_context(struct drm_api* api, struct pipe_screen* screen) { if (debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) { - return radeon_create_softpipe(screen->winsys); + return softpipe_create(screen); } else { return r300_create_context(screen, (struct radeon_winsys*)screen->winsys); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.h b/src/gallium/winsys/drm/radeon/core/radeon_drm.h index 9a789ec1a45..bf0e78138d7 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.h @@ -44,7 +44,6 @@ #include "radeon_buffer.h" #include "radeon_r300.h" -#include "radeon_winsys_softpipe.h" /* XXX */ #include "r300_screen.h" diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.c b/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.c deleted file mode 100644 index f038bfa40ef..00000000000 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.c +++ /dev/null @@ -1,41 +0,0 @@ -/************************************************************************** - * - * Copyright 2006 Tungsten Graphics, Inc., Bismarck, ND., USA - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * - **************************************************************************/ -/* - * Authors: Keith Whitwell - */ - -#include "radeon_winsys_softpipe.h" - -struct pipe_context *radeon_create_softpipe(struct pipe_winsys* winsys) -{ - struct pipe_screen *pipe_screen; - - pipe_screen = softpipe_create_screen(winsys); - - return softpipe_create(pipe_screen); -} diff --git a/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.h b/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.h deleted file mode 100644 index 04740e41a51..00000000000 --- a/src/gallium/winsys/drm/radeon/core/radeon_winsys_softpipe.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright © 2008 Jérôme Glisse - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining - * a copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES - * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - * NON-INFRINGEMENT. IN NO EVENT SHALL THE COPYRIGHT HOLDERS, AUTHORS - * AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, - * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - */ -/* - * Authors: - * Jérôme Glisse - */ -#ifndef RADEON_WINSYS_SOFTPIPE_H -#define RADEON_WINSYS_SOFTPIPE_H - -#include - -#include "pipe/p_defines.h" -#include "pipe/p_format.h" - -#include "softpipe/sp_winsys.h" - -#include "util/u_memory.h" - -struct pipe_context *radeon_create_softpipe(struct pipe_winsys* winsys); - -#endif -- cgit v1.2.3 From 12981589b729de0242d6ea74d8e4e9889793088c Mon Sep 17 00:00:00 2001 From: Corbin Simpson Date: Sun, 6 Dec 2009 23:55:58 -0800 Subject: radeong: Automatically softpipe for non-r3xx. Well, technically non-r[345]xx. At any rate... $ glxgears libGL: OpenDriver: trying /home/simpson/mesa/lib/gallium/r600_dri.so 131 frames in 5.0 seconds = 26.107 FPS I'm sure you can see where this is going. :3 --- src/gallium/winsys/drm/radeon/core/radeon_drm.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index bc66b42fa75..dec7c065036 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -109,14 +109,15 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, int drmFB, struct drm_create_screen_arg *arg) { - struct radeon_winsys* winsys = radeon_pipe_winsys(drmFB); - do_ioctls(drmFB, winsys); + struct radeon_winsys* rwinsys = radeon_pipe_winsys(drmFB); + do_ioctls(drmFB, rwinsys); - if (debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) { - return softpipe_create_screen((struct pipe_winsys*)winsys); + if (!is_r3xx(rwinsys->pci_id) || + debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) { + return softpipe_create_screen((struct pipe_winsys*)rwinsys); } else { - radeon_setup_winsys(drmFB, winsys); - return r300_create_screen(winsys); + radeon_setup_winsys(drmFB, rwinsys); + return r300_create_screen(rwinsys); } } @@ -124,11 +125,13 @@ struct pipe_screen* radeon_create_screen(struct drm_api* api, struct pipe_context* radeon_create_context(struct drm_api* api, struct pipe_screen* screen) { - if (debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) { + struct radeon_winsys* rwinsys = (struct radeon_winsys*)screen->winsys; + + if (!is_r3xx(rwinsys->pci_id) || + debug_get_bool_option("RADEON_SOFTPIPE", FALSE)) { return softpipe_create(screen); } else { - return r300_create_context(screen, - (struct radeon_winsys*)screen->winsys); + return r300_create_context(screen, rwinsys); } } -- cgit v1.2.3 From 8796dbf5196bcc75d39372570fa6347cd018354d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Dec 2009 09:49:27 -0700 Subject: progs/glsl: added texture mapping to bump demo Press 't' to toggle texture map. --- progs/glsl/CH11-bumpmaptex.frag | 47 +++++++++++++++++++++++++++++++++++ progs/glsl/bump.c | 55 +++++++++++++++++++++++++++++++++++++++-- 2 files changed, 100 insertions(+), 2 deletions(-) create mode 100644 progs/glsl/CH11-bumpmaptex.frag diff --git a/progs/glsl/CH11-bumpmaptex.frag b/progs/glsl/CH11-bumpmaptex.frag new file mode 100644 index 00000000000..b1f93b784d9 --- /dev/null +++ b/progs/glsl/CH11-bumpmaptex.frag @@ -0,0 +1,47 @@ +// +// Fragment shader for procedural bumps +// +// Authors: John Kessenich, Randi Rost +// +// Copyright (c) 2002-2006 3Dlabs Inc. Ltd. +// +// See 3Dlabs-License.txt for license information +// +// Texture mapping/modulation added by Brian Paul +// + +varying vec3 LightDir; +varying vec3 EyeDir; + +uniform float BumpDensity; // = 16.0 +uniform float BumpSize; // = 0.15 +uniform float SpecularFactor; // = 0.5 + +sampler2D Tex; + +void main() +{ + vec3 ambient = vec3(0.25); + vec3 litColor; + vec2 c = BumpDensity * gl_TexCoord[0].st; + vec2 p = fract(c) - vec2(0.5); + + float d, f; + d = p.x * p.x + p.y * p.y; + f = inversesqrt(d + 1.0); + + if (d >= BumpSize) + { p = vec2(0.0); f = 1.0; } + + vec3 SurfaceColor = texture2D(Tex, gl_TexCoord[0].st).xyz; + + vec3 normDelta = vec3(p.x, p.y, 1.0) * f; + litColor = SurfaceColor * (ambient + max(dot(normDelta, LightDir), 0.0)); + vec3 reflectDir = reflect(LightDir, normDelta); + + float spec = max(dot(EyeDir, reflectDir), 0.0); + spec *= SpecularFactor; + litColor = min(litColor + spec, vec3(1.0)); + + gl_FragColor = vec4(litColor, 1.0); +} diff --git a/progs/glsl/bump.c b/progs/glsl/bump.c index 50a0900f1c7..e31afab9392 100644 --- a/progs/glsl/bump.c +++ b/progs/glsl/bump.c @@ -12,15 +12,20 @@ #include #include #include "shaderutil.h" +#include "readtex.h" static char *FragProgFile = "CH11-bumpmap.frag"; +static char *FragTexProgFile = "CH11-bumpmaptex.frag"; static char *VertProgFile = "CH11-bumpmap.vert"; +static char *TextureFile = "../images/tile.rgb"; /* program/shader objects */ static GLuint fragShader; +static GLuint fragTexShader; static GLuint vertShader; static GLuint program; +static GLuint texProgram; static struct uniform_info Uniforms[] = { @@ -32,13 +37,26 @@ static struct uniform_info Uniforms[] = { END_OF_UNIFORMS }; +static struct uniform_info TexUniforms[] = { + { "LightPosition", 1, GL_FLOAT_VEC3, { 0.57737, 0.57735, 0.57735, 0.0 }, -1 }, + { "Tex", 1, GL_INT, { 0, 0, 0, 0 }, -1 }, + { "BumpDensity", 1, GL_FLOAT, { 10.0, 0, 0, 0 }, -1 }, + { "BumpSize", 1, GL_FLOAT, { 0.125, 0, 0, 0 }, -1 }, + { "SpecularFactor", 1, GL_FLOAT, { 0.5, 0, 0, 0 }, -1 }, + END_OF_UNIFORMS +}; + static GLint win = 0; static GLfloat xRot = 20.0f, yRot = 0.0f, zRot = 0.0f; static GLint tangentAttrib; +static GLint tangentAttribTex; + +static GLuint Texture; static GLboolean Anim = GL_FALSE; +static GLboolean Textured = GL_FALSE; static void @@ -135,6 +153,11 @@ Redisplay(void) glRotatef(yRot, 0.0f, 1.0f, 0.0f); glRotatef(zRot, 0.0f, 0.0f, 1.0f); + if (Textured) + glUseProgram(texProgram); + else + glUseProgram(program); + Cube(1.5); glPopMatrix(); @@ -163,8 +186,10 @@ static void CleanUp(void) { glDeleteShader(fragShader); + glDeleteShader(fragTexShader); glDeleteShader(vertShader); glDeleteProgram(program); + glDeleteProgram(texProgram); glutDestroyWindow(win); } @@ -181,6 +206,9 @@ Key(unsigned char key, int x, int y) Anim = !Anim; glutIdleFunc(Anim ? Idle : NULL); break; + case 't': + Textured = !Textured; + break; case 'z': zRot += step; break; @@ -254,6 +282,26 @@ Init(void) CheckError(__LINE__); + + /* + * As above, but fragment shader also uses a texture map. + */ + fragTexShader = CompileShaderFile(GL_FRAGMENT_SHADER, FragTexProgFile); + texProgram = LinkShaders(vertShader, fragTexShader); + glUseProgram(texProgram); + assert(glIsProgram(texProgram)); + assert(glIsShader(fragTexShader)); + SetUniformValues(texProgram, TexUniforms); + PrintUniforms(TexUniforms); + + /* + * Load tex image. + */ + glGenTextures(1, &Texture); + glBindTexture(GL_TEXTURE_2D, Texture); + LoadRGBMipmaps(TextureFile, GL_RGB); + + glClearColor(0.4f, 0.4f, 0.8f, 0.0f); glEnable(GL_DEPTH_TEST); @@ -268,10 +316,13 @@ ParseOptions(int argc, char *argv[]) int i; for (i = 1; i < argc; i++) { if (strcmp(argv[i], "-fs") == 0) { - FragProgFile = argv[i+1]; + FragProgFile = argv[++i]; } else if (strcmp(argv[i], "-vs") == 0) { - VertProgFile = argv[i+1]; + VertProgFile = argv[++i]; + } + else if (strcmp(argv[i], "-t") == 0) { + TextureFile = argv[++i]; } } } -- cgit v1.2.3 From 8468234bfa98be77cbceecc8e91325c00e4e424b Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 08:59:38 -0700 Subject: st/mesa: fix up comment --- src/mesa/state_tracker/st_program.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/mesa/state_tracker/st_program.c b/src/mesa/state_tracker/st_program.c index d66f45d13ea..5c81a033f9c 100644 --- a/src/mesa/state_tracker/st_program.c +++ b/src/mesa/state_tracker/st_program.c @@ -49,8 +49,11 @@ #include "st_mesa_to_tgsi.h" #include "cso_cache/cso_context.h" - /* Clean out any old compilations: - */ + + +/** + * Clean out any old compilations: + */ void st_vp_release_varients( struct st_context *st, struct st_vertex_program *stvp ) -- cgit v1.2.3 From 8ce17134431ec27666e8fba2fa4bd22ba3f3ed18 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 09:00:57 -0700 Subject: st/mesa: negate DDY to match GL semantics This fixes the regression from commit 884007546c98b1779bf266ec5111b1e7e2b68b2e Fixes bug 25456 (piglit derivs regression). --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index 5e76f4db4eb..bf80274c444 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -396,6 +396,23 @@ static void emit_swz( struct st_translate *t, } +/** + * Negate the value of DDY to match GL semantics where (0,0) is the + * lower-left corner of the window. + * Note that the GL_ARB_fragment_coord_conventions extension will + * effect this someday. + */ +static void emit_ddy( struct st_translate *t, + struct ureg_dst dst, + const struct prog_src_register *SrcReg ) +{ + struct ureg_program *ureg = t->ureg; + struct ureg_src src = translate_src( t, SrcReg ); + if(1) src = ureg_negate( src ); + ureg_DDY( ureg, dst, src ); +} + + static unsigned translate_opcode( unsigned op ) @@ -619,7 +636,9 @@ compile_instruction( ureg_MOV( ureg, dst[0], ureg_imm1f(ureg, 0.5) ); break; - + case OPCODE_DDY: + emit_ddy( t, dst[0], &inst->SrcReg[0] ); + break; default: ureg_insn( ureg, -- cgit v1.2.3 From 0311d9ccf4b717300a99355a02eff23935b4c08a Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 09:03:39 -0700 Subject: progs/glsl: updates to deriv.c test Pass window size into the shader so scaling the window doesn't effect the colors. --- progs/glsl/deriv.c | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/progs/glsl/deriv.c b/progs/glsl/deriv.c index 30f2b75fef7..588246b71ac 100644 --- a/progs/glsl/deriv.c +++ b/progs/glsl/deriv.c @@ -27,11 +27,15 @@ static GLuint SphereList, RectList, CurList; static GLint win = 0; static GLboolean anim = GL_TRUE; static GLfloat xRot = 0.0f, yRot = 0.0f; +static GLint WinSize[2]; +static GLint WinSizeUniform = -1; static void Redisplay(void) { + glUniform2iv(WinSizeUniform, 1, WinSize); + glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); glPushMatrix(); @@ -55,6 +59,8 @@ Idle(void) static void Reshape(int width, int height) { + WinSize[0] = width; + WinSize[1] = height; glViewport(0, 0, width, height); glMatrixMode(GL_PROJECTION); glLoadIdentity(); @@ -163,8 +169,10 @@ static void Init(void) { static const char *fragShaderText = + "uniform ivec2 WinSize; \n" "void main() {\n" - " gl_FragColor = abs(dFdy(gl_TexCoord[0])) * 50.0;\n" + " vec2 d = dFdy(gl_TexCoord[0].xy) * vec2(WinSize); \n" + " gl_FragColor = vec4(d.x, d.y, 0.0, 1.0);\n" " // gl_FragColor = gl_TexCoord[0];\n" "}\n"; static const char *vertShaderText = @@ -181,6 +189,7 @@ Init(void) program = LinkShaders(vertShader, fragShader); glUseProgram(program); + WinSizeUniform = glGetUniformLocation(program, "WinSize"); /*assert(glGetError() == 0);*/ @@ -220,8 +229,10 @@ ParseOptions(int argc, char *argv[]) int main(int argc, char *argv[]) { + WinSize[0] = WinSize[1] = 200; + glutInit(&argc, argv); - glutInitWindowSize(200, 200); + glutInitWindowSize(WinSize[0], WinSize[1]); glutInitDisplayMode(GLUT_RGB | GLUT_DOUBLE | GLUT_DEPTH); win = glutCreateWindow(argv[0]); glewInit(); -- cgit v1.2.3 From c90baf444ca91d06ae5be392a04c0c8119cb08dd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 09:05:40 -0700 Subject: st/mesa: remove debug code --- src/mesa/state_tracker/st_mesa_to_tgsi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/state_tracker/st_mesa_to_tgsi.c b/src/mesa/state_tracker/st_mesa_to_tgsi.c index bf80274c444..1611d53e2fe 100644 --- a/src/mesa/state_tracker/st_mesa_to_tgsi.c +++ b/src/mesa/state_tracker/st_mesa_to_tgsi.c @@ -408,7 +408,7 @@ static void emit_ddy( struct st_translate *t, { struct ureg_program *ureg = t->ureg; struct ureg_src src = translate_src( t, SrcReg ); - if(1) src = ureg_negate( src ); + src = ureg_negate( src ); ureg_DDY( ureg, dst, src ); } -- cgit v1.2.3 From ac66598ed8bc218720cf2a1a7493b7e25ca9d962 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 7 Dec 2009 18:12:05 +0100 Subject: util/tile: Support R8G8B8A8_UNORM format. --- src/gallium/auxiliary/util/u_tile.c | 56 +++++++++++++++++++++++++++++++++++-- 1 file changed, 53 insertions(+), 3 deletions(-) diff --git a/src/gallium/auxiliary/util/u_tile.c b/src/gallium/auxiliary/util/u_tile.c index 4f34f8a1a6b..88c9a1f0977 100644 --- a/src/gallium/auxiliary/util/u_tile.c +++ b/src/gallium/auxiliary/util/u_tile.c @@ -247,6 +247,53 @@ b8g8r8a8_put_tile_rgba(unsigned *dst, } +/*** PIPE_FORMAT_R8G8B8A8_UNORM ***/ + +static void +r8g8b8a8_get_tile_rgba(const unsigned *src, + unsigned w, unsigned h, + float *p, + unsigned dst_stride) +{ + unsigned i, j; + + for (i = 0; i < h; i++) { + float *pRow = p; + for (j = 0; j < w; j++, pRow += 4) { + const unsigned pixel = *src++; + pRow[0] = ubyte_to_float((pixel >> 24) & 0xff); + pRow[1] = ubyte_to_float((pixel >> 16) & 0xff); + pRow[2] = ubyte_to_float((pixel >> 8) & 0xff); + pRow[3] = ubyte_to_float((pixel >> 0) & 0xff); + } + p += dst_stride; + } +} + + +static void +r8g8b8a8_put_tile_rgba(unsigned *dst, + unsigned w, unsigned h, + const float *p, + unsigned src_stride) +{ + unsigned i, j; + + for (i = 0; i < h; i++) { + const float *pRow = p; + for (j = 0; j < w; j++, pRow += 4) { + unsigned r, g, b, a; + r = float_to_ubyte(pRow[0]); + g = float_to_ubyte(pRow[1]); + b = float_to_ubyte(pRow[2]); + a = float_to_ubyte(pRow[3]); + *dst++ = (r << 24) | (g << 16) | (b << 8) | a; + } + p += src_stride; + } +} + + /*** PIPE_FORMAT_A1R5G5B5_UNORM ***/ static void @@ -1144,6 +1191,9 @@ pipe_tile_raw_to_rgba(enum pipe_format format, case PIPE_FORMAT_B8G8R8A8_UNORM: b8g8r8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); break; + case PIPE_FORMAT_R8G8B8A8_UNORM: + r8g8b8a8_get_tile_rgba((unsigned *) src, w, h, dst, dst_stride); + break; case PIPE_FORMAT_A1R5G5B5_UNORM: a1r5g5b5_get_tile_rgba((ushort *) src, w, h, dst, dst_stride); break; @@ -1268,6 +1318,9 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_B8G8R8A8_UNORM: b8g8r8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); break; + case PIPE_FORMAT_R8G8B8A8_UNORM: + r8g8b8a8_put_tile_rgba((unsigned *) packed, w, h, p, src_stride); + break; case PIPE_FORMAT_A1R5G5B5_UNORM: a1r5g5b5_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; @@ -1277,9 +1330,6 @@ pipe_put_tile_rgba(struct pipe_transfer *pt, case PIPE_FORMAT_R8G8B8_UNORM: r8g8b8_put_tile_rgba((ubyte *) packed, w, h, p, src_stride); break; - case PIPE_FORMAT_R8G8B8A8_UNORM: - assert(0); - break; case PIPE_FORMAT_A4R4G4B4_UNORM: a4r4g4b4_put_tile_rgba((ushort *) packed, w, h, p, src_stride); break; -- cgit v1.2.3 From c36d1aacf4c70d76165c91cd7048c0f9f43b8571 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 20:11:46 +0100 Subject: mesa: fix strict aliasing issues in half-to-float/float-to-half conversions use union instead of casts --- src/mesa/main/imports.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/src/mesa/main/imports.c b/src/mesa/main/imports.c index c9e00cf7528..f2ef84f35c1 100644 --- a/src/mesa/main/imports.c +++ b/src/mesa/main/imports.c @@ -460,7 +460,7 @@ _mesa_inv_sqrtf(float n) #if 0 /* not used, see below -BP */ float r3, x3, y3; #endif - union { float f; unsigned int i; } u; + fi_type u; unsigned int magic; /* @@ -649,10 +649,10 @@ _mesa_bitcount(unsigned int n) GLhalfARB _mesa_float_to_half(float val) { - const int flt = *((int *) (void *) &val); - const int flt_m = flt & 0x7fffff; - const int flt_e = (flt >> 23) & 0xff; - const int flt_s = (flt >> 31) & 0x1; + const fi_type fi = {val}; + const int flt_m = fi.i & 0x7fffff; + const int flt_e = (fi.i >> 23) & 0xff; + const int flt_s = (fi.i >> 31) & 0x1; int s, e, m = 0; GLhalfARB result; @@ -739,7 +739,8 @@ _mesa_half_to_float(GLhalfARB val) const int m = val & 0x3ff; const int e = (val >> 10) & 0x1f; const int s = (val >> 15) & 0x1; - int flt_m, flt_e, flt_s, flt; + int flt_m, flt_e, flt_s; + fi_type fi; float result; /* sign bit */ @@ -774,8 +775,8 @@ _mesa_half_to_float(GLhalfARB val) flt_m = m << 13; } - flt = (flt_s << 31) | (flt_e << 23) | flt_m; - result = *((float *) (void *) &flt); + fi.i = (flt_s << 31) | (flt_e << 23) | flt_m; + result = fi.f; return result; } -- cgit v1.2.3 From 3456f9149b3009fcfce80054759d05883d3c4ee5 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 20:35:42 +0100 Subject: gallium/util: fix util_color_[un]pack[-ub] to be strict aliasing safe use pointer to union instead of void pointer. gcc complained a lot, depending what the pointer originally actually was. Looks like it's in fact maybe legal to cast for instance uint pointers to union pointers as long as union contains a uint type, hence use this with some callers, other just use union util_color in the first place. --- src/gallium/auxiliary/util/u_clear.h | 8 +- src/gallium/auxiliary/util/u_pack_color.h | 147 +++++++++++-------------- src/gallium/drivers/cell/ppu/cell_clear.c | 6 +- src/gallium/drivers/llvmpipe/lp_clear.c | 5 +- src/gallium/drivers/r300/r300_state.c | 4 +- src/gallium/drivers/softpipe/sp_clear.c | 7 +- src/gallium/drivers/svga/svga_pipe_clear.c | 6 +- src/gallium/drivers/svga/svga_pipe_sampler.c | 2 +- src/gallium/state_trackers/vega/vg_translate.c | 54 ++++----- src/mesa/state_tracker/st_atom_pixeltransfer.c | 2 +- 10 files changed, 113 insertions(+), 128 deletions(-) diff --git a/src/gallium/auxiliary/util/u_clear.h b/src/gallium/auxiliary/util/u_clear.h index 1e65a035aed..2c32db61756 100644 --- a/src/gallium/auxiliary/util/u_clear.h +++ b/src/gallium/auxiliary/util/u_clear.h @@ -46,13 +46,13 @@ util_clear(struct pipe_context *pipe, { if (buffers & PIPE_CLEAR_COLOR) { struct pipe_surface *ps = framebuffer->cbufs[0]; - unsigned color; + union util_color uc; - util_pack_color(rgba, ps->format, &color); + util_pack_color(rgba, ps->format, &uc); if (pipe->surface_fill) { - pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color); + pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui); } else { - util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height, color); + util_surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui); } } diff --git a/src/gallium/auxiliary/util/u_pack_color.h b/src/gallium/auxiliary/util/u_pack_color.h index 9dacc6d83db..a2e0f266864 100644 --- a/src/gallium/auxiliary/util/u_pack_color.h +++ b/src/gallium/auxiliary/util/u_pack_color.h @@ -40,101 +40,97 @@ #include "util/u_math.h" + +union util_color { + ubyte ub; + ushort us; + uint ui; + float f[4]; +}; + /** * Pack ubyte R,G,B,A into dest pixel. */ static INLINE void util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, - enum pipe_format format, void *dest) + enum pipe_format format, union util_color *uc) { switch (format) { case PIPE_FORMAT_R8G8B8A8_UNORM: { - uint *d = (uint *) dest; - *d = (r << 24) | (g << 16) | (b << 8) | a; + uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } return; case PIPE_FORMAT_R8G8B8X8_UNORM: { - uint *d = (uint *) dest; - *d = (r << 24) | (g << 16) | (b << 8) | 0xff; + uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff; } return; case PIPE_FORMAT_A8R8G8B8_UNORM: { - uint *d = (uint *) dest; - *d = (a << 24) | (r << 16) | (g << 8) | b; + uc->ui = (a << 24) | (r << 16) | (g << 8) | b; } return; case PIPE_FORMAT_X8R8G8B8_UNORM: { - uint *d = (uint *) dest; - *d = (0xff << 24) | (r << 16) | (g << 8) | b; + uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b; } return; case PIPE_FORMAT_B8G8R8A8_UNORM: { - uint *d = (uint *) dest; - *d = (b << 24) | (g << 16) | (r << 8) | a; + uc->ui = (b << 24) | (g << 16) | (r << 8) | a; } return; case PIPE_FORMAT_B8G8R8X8_UNORM: { - uint *d = (uint *) dest; - *d = (b << 24) | (g << 16) | (r << 8) | 0xff; + uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff; } return; case PIPE_FORMAT_R5G6B5_UNORM: { - ushort *d = (ushort *) dest; - *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); + uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; case PIPE_FORMAT_A1R5G5B5_UNORM: { - ushort *d = (ushort *) dest; - *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); + uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); } return; case PIPE_FORMAT_A4R4G4B4_UNORM: { - ushort *d = (ushort *) dest; - *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); + uc->us = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); } return; case PIPE_FORMAT_A8_UNORM: { - ubyte *d = (ubyte *) dest; - *d = a; + uc->ub = a; } return; case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_I8_UNORM: { - ubyte *d = (ubyte *) dest; - *d = r; + uc->ub = a; } return; case PIPE_FORMAT_R32G32B32A32_FLOAT: { - float *d = (float *) dest; - d[0] = (float)r / 255.0f; - d[1] = (float)g / 255.0f; - d[2] = (float)b / 255.0f; - d[3] = (float)a / 255.0f; + uc->f[0] = (float)r / 255.0f; + uc->f[1] = (float)g / 255.0f; + uc->f[2] = (float)b / 255.0f; + uc->f[3] = (float)a / 255.0f; } return; case PIPE_FORMAT_R32G32B32_FLOAT: { - float *d = (float *) dest; - d[0] = (float)r / 255.0f; - d[1] = (float)g / 255.0f; - d[2] = (float)b / 255.0f; + uc->f[0] = (float)r / 255.0f; + uc->f[1] = (float)g / 255.0f; + uc->f[2] = (float)b / 255.0f; } return; /* XXX lots more cases to add */ default: + uc->ui = 0; /* keep compiler happy */ debug_print_format("gallium: unhandled format in util_pack_color_ub()", format); assert(0); } @@ -145,13 +141,13 @@ util_pack_color_ub(ubyte r, ubyte g, ubyte b, ubyte a, * Unpack RGBA from a packed pixel, returning values as ubytes in [0,255]. */ static INLINE void -util_unpack_color_ub(enum pipe_format format, const void *src, +util_unpack_color_ub(enum pipe_format format, union util_color *uc, ubyte *r, ubyte *g, ubyte *b, ubyte *a) { switch (format) { case PIPE_FORMAT_R8G8B8A8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 24) & 0xff); *g = (ubyte) ((p >> 16) & 0xff); *b = (ubyte) ((p >> 8) & 0xff); @@ -160,7 +156,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_R8G8B8X8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 24) & 0xff); *g = (ubyte) ((p >> 16) & 0xff); *b = (ubyte) ((p >> 8) & 0xff); @@ -169,7 +165,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_A8R8G8B8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 16) & 0xff); *g = (ubyte) ((p >> 8) & 0xff); *b = (ubyte) ((p >> 0) & 0xff); @@ -178,7 +174,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_X8R8G8B8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 16) & 0xff); *g = (ubyte) ((p >> 8) & 0xff); *b = (ubyte) ((p >> 0) & 0xff); @@ -187,7 +183,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_B8G8R8A8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 8) & 0xff); *g = (ubyte) ((p >> 16) & 0xff); *b = (ubyte) ((p >> 24) & 0xff); @@ -196,7 +192,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_B8G8R8X8_UNORM: { - uint p = ((const uint *) src)[0]; + uint p = uc->ui; *r = (ubyte) ((p >> 8) & 0xff); *g = (ubyte) ((p >> 16) & 0xff); *b = (ubyte) ((p >> 24) & 0xff); @@ -205,7 +201,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_R5G6B5_UNORM: { - ushort p = ((const ushort *) src)[0]; + ushort p = uc->us; *r = (ubyte) (((p >> 8) & 0xf8) | ((p >> 13) & 0x7)); *g = (ubyte) (((p >> 3) & 0xfc) | ((p >> 9) & 0x3)); *b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); @@ -214,7 +210,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_A1R5G5B5_UNORM: { - ushort p = ((const ushort *) src)[0]; + ushort p = uc->us; *r = (ubyte) (((p >> 7) & 0xf8) | ((p >> 12) & 0x7)); *g = (ubyte) (((p >> 2) & 0xf8) | ((p >> 7) & 0x7)); *b = (ubyte) (((p << 3) & 0xf8) | ((p >> 2) & 0x7)); @@ -223,7 +219,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_A4R4G4B4_UNORM: { - ushort p = ((const ushort *) src)[0]; + ushort p = uc->us; *r = (ubyte) (((p >> 4) & 0xf0) | ((p >> 8) & 0xf)); *g = (ubyte) (((p >> 0) & 0xf0) | ((p >> 4) & 0xf)); *b = (ubyte) (((p << 4) & 0xf0) | ((p >> 0) & 0xf)); @@ -232,27 +228,27 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_A8_UNORM: { - ubyte p = ((const ubyte *) src)[0]; + ubyte p = uc->ub; *r = *g = *b = (ubyte) 0xff; *a = p; } return; case PIPE_FORMAT_L8_UNORM: { - ubyte p = ((const ubyte *) src)[0]; + ubyte p = uc->ub; *r = *g = *b = p; *a = (ubyte) 0xff; } return; case PIPE_FORMAT_I8_UNORM: { - ubyte p = ((const ubyte *) src)[0]; + ubyte p = uc->ub; *r = *g = *b = *a = p; } return; case PIPE_FORMAT_R32G32B32A32_FLOAT: { - const float *p = (const float *) src; + const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); *g = float_to_ubyte(p[1]); *b = float_to_ubyte(p[2]); @@ -261,7 +257,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, return; case PIPE_FORMAT_R32G32B32_FLOAT: { - const float *p = (const float *) src; + const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); *g = float_to_ubyte(p[1]); *b = float_to_ubyte(p[2]); @@ -271,7 +267,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, case PIPE_FORMAT_R32G32_FLOAT: { - const float *p = (const float *) src; + const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); *g = float_to_ubyte(p[1]); *b = *a = (ubyte) 0xff; @@ -280,7 +276,7 @@ util_unpack_color_ub(enum pipe_format format, const void *src, case PIPE_FORMAT_R32_FLOAT: { - const float *p = (const float *) src; + const float *p = &uc->f[0]; *r = float_to_ubyte(p[0]); *g = *b = *a = (ubyte) 0xff; } @@ -293,14 +289,13 @@ util_unpack_color_ub(enum pipe_format format, const void *src, assert(0); } } - /** * Note rgba outside [0,1] will be clamped for int pixel formats. */ static INLINE void -util_pack_color(const float rgba[4], enum pipe_format format, void *dest) +util_pack_color(const float rgba[4], enum pipe_format format, union util_color *uc) { ubyte r = 0; ubyte g = 0; @@ -318,90 +313,78 @@ util_pack_color(const float rgba[4], enum pipe_format format, void *dest) switch (format) { case PIPE_FORMAT_R8G8B8A8_UNORM: { - uint *d = (uint *) dest; - *d = (r << 24) | (g << 16) | (b << 8) | a; + uc->ui = (r << 24) | (g << 16) | (b << 8) | a; } return; case PIPE_FORMAT_R8G8B8X8_UNORM: { - uint *d = (uint *) dest; - *d = (r << 24) | (g << 16) | (b << 8) | 0xff; + uc->ui = (r << 24) | (g << 16) | (b << 8) | 0xff; } return; case PIPE_FORMAT_A8R8G8B8_UNORM: { - uint *d = (uint *) dest; - *d = (a << 24) | (r << 16) | (g << 8) | b; + uc->ui = (a << 24) | (r << 16) | (g << 8) | b; } return; case PIPE_FORMAT_X8R8G8B8_UNORM: { - uint *d = (uint *) dest; - *d = (0xff << 24) | (r << 16) | (g << 8) | b; + uc->ui = (0xff << 24) | (r << 16) | (g << 8) | b; } return; case PIPE_FORMAT_B8G8R8A8_UNORM: { - uint *d = (uint *) dest; - *d = (b << 24) | (g << 16) | (r << 8) | a; + uc->ui = (b << 24) | (g << 16) | (r << 8) | a; } return; case PIPE_FORMAT_B8G8R8X8_UNORM: { - uint *d = (uint *) dest; - *d = (b << 24) | (g << 16) | (r << 8) | 0xff; + uc->ui = (b << 24) | (g << 16) | (r << 8) | 0xff; } return; case PIPE_FORMAT_R5G6B5_UNORM: { - ushort *d = (ushort *) dest; - *d = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); + uc->us = ((r & 0xf8) << 8) | ((g & 0xfc) << 3) | (b >> 3); } return; case PIPE_FORMAT_A1R5G5B5_UNORM: { - ushort *d = (ushort *) dest; - *d = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); + uc->us = ((a & 0x80) << 8) | ((r & 0xf8) << 7) | ((g & 0xf8) << 2) | (b >> 3); } return; case PIPE_FORMAT_A4R4G4B4_UNORM: { - ushort *d = (ushort *) dest; - *d = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); + uc->ub = ((a & 0xf0) << 8) | ((r & 0xf0) << 4) | ((g & 0xf0) << 0) | (b >> 4); } return; case PIPE_FORMAT_A8_UNORM: { - ubyte *d = (ubyte *) dest; - *d = a; + uc->ub = a; } return; case PIPE_FORMAT_L8_UNORM: case PIPE_FORMAT_I8_UNORM: { - ubyte *d = (ubyte *) dest; - *d = r; + uc->ub = r; } return; case PIPE_FORMAT_R32G32B32A32_FLOAT: { - float *d = (float *) dest; - d[0] = rgba[0]; - d[1] = rgba[1]; - d[2] = rgba[2]; - d[3] = rgba[3]; + uc->f[0] = rgba[0]; + uc->f[1] = rgba[1]; + uc->f[2] = rgba[2]; + uc->f[3] = rgba[3]; } return; case PIPE_FORMAT_R32G32B32_FLOAT: { - float *d = (float *) dest; - d[0] = rgba[0]; - d[1] = rgba[1]; - d[2] = rgba[2]; + uc->f[0] = rgba[0]; + uc->f[1] = rgba[1]; + uc->f[2] = rgba[2]; } return; /* XXX lots more cases to add */ default: + uc->ui = 0; /* keep compiler happy */ debug_print_format("gallium: unhandled format in util_pack_color()", format); assert(0); } diff --git a/src/gallium/drivers/cell/ppu/cell_clear.c b/src/gallium/drivers/cell/ppu/cell_clear.c index 79ad687ea94..3a3f968a492 100644 --- a/src/gallium/drivers/cell/ppu/cell_clear.c +++ b/src/gallium/drivers/cell/ppu/cell_clear.c @@ -59,9 +59,9 @@ cell_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, if (buffers & PIPE_CLEAR_COLOR) { uint surfIndex = 0; - uint clearValue; + union util_color uc; - util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &clearValue); + util_pack_color(rgba, cell->framebuffer.cbufs[0]->format, &uc); /* Build a CLEAR command and place it in the current batch buffer */ STATIC_ASSERT(sizeof(struct cell_command_clear_surface) % 16 == 0); @@ -70,7 +70,7 @@ cell_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, cell_batch_alloc16(cell, sizeof(*clr)); clr->opcode[0] = CELL_CMD_CLEAR_SURFACE; clr->surface = surfIndex; - clr->value = clearValue; + clr->value = uc.ui; } if (buffers & PIPE_CLEAR_DEPTHSTENCIL) { diff --git a/src/gallium/drivers/llvmpipe/lp_clear.c b/src/gallium/drivers/llvmpipe/lp_clear.c index bdcff94b9bf..08d9f2e2735 100644 --- a/src/gallium/drivers/llvmpipe/lp_clear.c +++ b/src/gallium/drivers/llvmpipe/lp_clear.c @@ -50,6 +50,7 @@ llvmpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, unsigned stencil) { struct llvmpipe_context *llvmpipe = llvmpipe_context(pipe); + union util_color uc; unsigned cv; uint i; @@ -64,8 +65,8 @@ llvmpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, for (i = 0; i < llvmpipe->framebuffer.nr_cbufs; i++) { struct pipe_surface *ps = llvmpipe->framebuffer.cbufs[i]; - util_pack_color(rgba, ps->format, &cv); - lp_tile_cache_clear(llvmpipe->cbuf_cache[i], rgba, cv); + util_pack_color(rgba, ps->format, &uc); + lp_tile_cache_clear(llvmpipe->cbuf_cache[i], rgba, uc.ui); } llvmpipe->dirty_render_cache = TRUE; } diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 442af70e143..4ddbb357b6e 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -153,7 +153,7 @@ static void r300_set_blend_color(struct pipe_context* pipe, struct r300_context* r300 = r300_context(pipe); util_pack_color(color->color, PIPE_FORMAT_A8R8G8B8_UNORM, - &r300->blend_color_state->blend_color); + (union util_color *)&r300->blend_color_state->blend_color); /* XXX if FP16 blending is enabled, we should use the FP16 format */ r300->blend_color_state->blend_color_red_alpha = @@ -535,7 +535,7 @@ static void* sampler->filter1 |= r300_anisotropy(state->max_anisotropy); util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM, - &sampler->border_color); + (union util_color *)&sampler->border_color); /* R500-specific fixups and optimizations */ if (r300_screen(r300->context.screen)->caps->is_r500) { diff --git a/src/gallium/drivers/softpipe/sp_clear.c b/src/gallium/drivers/softpipe/sp_clear.c index 8fac8e6e05f..f98087deb8c 100644 --- a/src/gallium/drivers/softpipe/sp_clear.c +++ b/src/gallium/drivers/softpipe/sp_clear.c @@ -48,6 +48,7 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, double depth, unsigned stencil) { struct softpipe_context *softpipe = softpipe_context(pipe); + union util_color uc; unsigned cv; uint i; @@ -62,12 +63,12 @@ softpipe_clear(struct pipe_context *pipe, unsigned buffers, const float *rgba, for (i = 0; i < softpipe->framebuffer.nr_cbufs; i++) { struct pipe_surface *ps = softpipe->framebuffer.cbufs[i]; - util_pack_color(rgba, ps->format, &cv); - sp_tile_cache_clear(softpipe->cbuf_cache[i], rgba, cv); + util_pack_color(rgba, ps->format, &uc); + sp_tile_cache_clear(softpipe->cbuf_cache[i], rgba, uc.ui); #if !TILE_CLEAR_OPTIMIZATION /* non-cached surface */ - pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, cv); + pipe->surface_fill(pipe, ps, 0, 0, ps->width, ps->height, uc.ui); #endif } } diff --git a/src/gallium/drivers/svga/svga_pipe_clear.c b/src/gallium/drivers/svga/svga_pipe_clear.c index 6195c3897ed..409b3b41cbc 100644 --- a/src/gallium/drivers/svga/svga_pipe_clear.c +++ b/src/gallium/drivers/svga/svga_pipe_clear.c @@ -46,7 +46,7 @@ try_clear(struct svga_context *svga, boolean restore_viewport = FALSE; SVGA3dClearFlag flags = 0; struct pipe_framebuffer_state *fb = &svga->curr.framebuffer; - unsigned color = 0; + union util_color uc; ret = svga_update_state(svga, SVGA_STATE_HW_CLEAR); if (ret) @@ -54,7 +54,7 @@ try_clear(struct svga_context *svga, if ((buffers & PIPE_CLEAR_COLOR) && fb->cbufs[0]) { flags |= SVGA3D_CLEAR_COLOR; - util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &color); + util_pack_color(rgba, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); rect.w = fb->cbufs[0]->width; rect.h = fb->cbufs[0]->height; @@ -77,7 +77,7 @@ try_clear(struct svga_context *svga, return ret; } - ret = SVGA3D_ClearRect(svga->swc, flags, color, depth, stencil, + ret = SVGA3D_ClearRect(svga->swc, flags, uc.ui, depth, stencil, rect.x, rect.y, rect.w, rect.h); if (ret != PIPE_OK) return ret; diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index b4e57c5d15b..7f530083d6b 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -122,7 +122,7 @@ svga_create_sampler_state(struct pipe_context *pipe, util_pack_color_ub( r, g, b, a, PIPE_FORMAT_B8G8R8A8_UNORM, - &cso->bordercolor ); + (union util_color *)&cso->bordercolor ); } /* No SVGA3D support for: diff --git a/src/gallium/state_trackers/vega/vg_translate.c b/src/gallium/state_trackers/vega/vg_translate.c index 00e07647062..5051d83831d 100644 --- a/src/gallium/state_trackers/vega/vg_translate.c +++ b/src/gallium/state_trackers/vega/vg_translate.c @@ -487,7 +487,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -503,7 +503,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -520,7 +520,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -537,7 +537,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = 1.f; util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -553,7 +553,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = ((*src >> 0) & 1)/1.; util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -569,7 +569,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = ((*src >> 0) & 15)/15.; util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -579,7 +579,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, src += offset; for (i = 0; i < n; ++i) { util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -595,7 +595,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -611,7 +611,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -628,7 +628,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -639,7 +639,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, src += offset; for (i = 0; i < n; ++i) { util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -649,7 +649,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, src += offset; for (i = 0; i < n; ++i) { util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } } @@ -668,7 +668,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = 1.f; util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i+j]); + (union util_color *)rgba[i+j]); } ++src; } @@ -689,7 +689,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = (((*src) & (1<> shift); util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i+j]); + (union util_color *)rgba[i+j]); } ++src; } @@ -716,7 +716,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[3] = ((*src) & (bitter)) >> shift; util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i +j]); + (union util_color *)rgba[i +j]); } ++src; } @@ -736,7 +736,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -753,7 +753,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -776,7 +776,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -793,7 +793,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -812,7 +812,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -829,7 +829,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -854,7 +854,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -871,7 +871,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, a = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -890,7 +890,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -907,7 +907,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -930,7 +930,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; @@ -947,7 +947,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 0) & 0xff; util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - rgba[i]); + (union util_color *)rgba[i]); ++src; } return; diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 4b35f59cc2f..5e2ae1bb36f 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -167,7 +167,7 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize]; ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize]; ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize]; - util_pack_color_ub(r, g, b, a, pt->format, dest + k); + util_pack_color_ub(r, g, b, a, pt->format, (union util_color *)(dest + k)); } } -- cgit v1.2.3 From 7d84169865f5907a02ff2283ca7bd45a3bb2f3c9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 7 Dec 2009 12:31:08 -0800 Subject: progs/demos: Fix memory leak in projtex.c. --- progs/demos/projtex.c | 1 + 1 file changed, 1 insertion(+) diff --git a/progs/demos/projtex.c b/progs/demos/projtex.c index ad205c74137..503cf5de088 100644 --- a/progs/demos/projtex.c +++ b/progs/demos/projtex.c @@ -248,6 +248,7 @@ loadImageTextures(void) free(texData3); free(texData4); + free(image); } } -- cgit v1.2.3 From 72362a5cd41d97b770980c28fe6719c556f12ab7 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Mon, 7 Dec 2009 21:47:49 +0100 Subject: mesa: fix shader prog_execute strict aliasing violations use unions instead of pointer casts. --- src/mesa/shader/prog_execute.c | 50 +++++++++++++++++++++++++++--------------- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/src/mesa/shader/prog_execute.c b/src/mesa/shader/prog_execute.c index 192d39aed1e..038ce0b4f00 100644 --- a/src/mesa/shader/prog_execute.c +++ b/src/mesa/shader/prog_execute.c @@ -54,8 +54,18 @@ * Set x to positive or negative infinity. */ #if defined(USE_IEEE) || defined(_WIN32) -#define SET_POS_INFINITY(x) ( *((GLuint *) (void *)&x) = 0x7F800000 ) -#define SET_NEG_INFINITY(x) ( *((GLuint *) (void *)&x) = 0xFF800000 ) +#define SET_POS_INFINITY(x) \ + do { \ + fi_type fi; \ + fi.i = 0x7F800000; \ + x = fi.f; \ + } while (0) +#define SET_NEG_INFINITY(x) \ + do { \ + fi_type fi; \ + fi.i = 0xFF800000; \ + x = fi.f; \ + } while (0) #elif defined(VMS) #define SET_POS_INFINITY(x) x = __MAXFLOAT #define SET_NEG_INFINITY(x) x = -__MAXFLOAT @@ -1635,11 +1645,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP2H: /* unpack two 16-bit floats */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; GLhalfNV hx, hy; fetch_vector1(&inst->SrcReg[0], machine, a); - hx = rawBits[0] & 0xffff; - hy = rawBits[0] >> 16; + fi.f = a[0]; + hx = fi.i & 0xffff; + hy = fi.i >> 16; result[0] = result[2] = _mesa_half_to_float(hx); result[1] = result[3] = _mesa_half_to_float(hy); store_vector4(inst, machine, result); @@ -1648,11 +1659,12 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP2US: /* unpack two GLushorts */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; GLushort usx, usy; fetch_vector1(&inst->SrcReg[0], machine, a); - usx = rawBits[0] & 0xffff; - usy = rawBits[0] >> 16; + fi.f = a[0]; + usx = fi.i & 0xffff; + usy = fi.i >> 16; result[0] = result[2] = usx * (1.0f / 65535.0f); result[1] = result[3] = usy * (1.0f / 65535.0f); store_vector4(inst, machine, result); @@ -1661,24 +1673,26 @@ _mesa_execute_program(GLcontext * ctx, case OPCODE_UP4B: /* unpack four GLbytes */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = (((rawBits[0] >> 0) & 0xff) - 128) / 127.0F; - result[1] = (((rawBits[0] >> 8) & 0xff) - 128) / 127.0F; - result[2] = (((rawBits[0] >> 16) & 0xff) - 128) / 127.0F; - result[3] = (((rawBits[0] >> 24) & 0xff) - 128) / 127.0F; + fi.f = a[0]; + result[0] = (((fi.i >> 0) & 0xff) - 128) / 127.0F; + result[1] = (((fi.i >> 8) & 0xff) - 128) / 127.0F; + result[2] = (((fi.i >> 16) & 0xff) - 128) / 127.0F; + result[3] = (((fi.i >> 24) & 0xff) - 128) / 127.0F; store_vector4(inst, machine, result); } break; case OPCODE_UP4UB: /* unpack four GLubytes */ { GLfloat a[4], result[4]; - const GLuint *rawBits = (const GLuint *) a; + fi_type fi; fetch_vector1(&inst->SrcReg[0], machine, a); - result[0] = ((rawBits[0] >> 0) & 0xff) / 255.0F; - result[1] = ((rawBits[0] >> 8) & 0xff) / 255.0F; - result[2] = ((rawBits[0] >> 16) & 0xff) / 255.0F; - result[3] = ((rawBits[0] >> 24) & 0xff) / 255.0F; + fi.f = a[0]; + result[0] = ((fi.i >> 0) & 0xff) / 255.0F; + result[1] = ((fi.i >> 8) & 0xff) / 255.0F; + result[2] = ((fi.i >> 16) & 0xff) / 255.0F; + result[3] = ((fi.i >> 24) & 0xff) / 255.0F; store_vector4(inst, machine, result); } break; -- cgit v1.2.3 From 013cf1d63deb9c33089777afbdea85013fd46b49 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 7 Dec 2009 22:22:57 +0100 Subject: radeon: fix image migration for small compressed textures memcpy would give incorrect results if src rowstride != dst rowstride --- src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c index 0415a50d0b3..91f0db958b9 100644 --- a/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c +++ b/src/mesa/drivers/dri/radeon/radeon_mipmap_tree.c @@ -437,23 +437,18 @@ static void migrate_image_to_miptree(radeon_mipmap_tree *mt, radeon_miptree_unreference(&image->mt); } else { - /* need to confirm this value is correct */ - if (_mesa_is_format_compressed(image->base.TexFormat)) { - unsigned size = _mesa_format_image_size(image->base.TexFormat, - image->base.Width, - image->base.Height, - image->base.Depth); - memcpy(dest, image->base.Data, size); - } else { - uint32_t srcrowstride; - uint32_t height; + const uint32_t srcrowstride = _mesa_format_row_stride(image->base.TexFormat, image->base.Width); + uint32_t rows = image->base.Height * image->base.Depth; - height = image->base.Height * image->base.Depth; - srcrowstride = image->base.Width * _mesa_get_format_bytes(image->base.TexFormat); - copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, - height, srcrowstride); + if (_mesa_is_format_compressed(image->base.TexFormat)) { + uint32_t blockWidth, blockHeight; + _mesa_get_format_block_size(image->base.TexFormat, &blockWidth, &blockHeight); + rows = (rows + blockHeight - 1) / blockHeight; } + copy_rows(dest, dstlvl->rowstride, image->base.Data, srcrowstride, + rows, srcrowstride); + _mesa_free_texmemory(image->base.Data); image->base.Data = 0; } -- cgit v1.2.3 From 9921b3048e611398460ef774355b7515bc901240 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 7 Dec 2009 22:24:41 +0100 Subject: radeon: fix cases when only first image where put directly into miptree. Make sure that minimal width, height and depth of texture image is 1. --- src/mesa/drivers/dri/radeon/radeon_texture.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_texture.c b/src/mesa/drivers/dri/radeon/radeon_texture.c index 00e0658dc54..28690325d12 100644 --- a/src/mesa/drivers/dri/radeon/radeon_texture.c +++ b/src/mesa/drivers/dri/radeon/radeon_texture.c @@ -524,9 +524,9 @@ static int image_matches_texture_obj(struct gl_texture_object *texObj, return 0; const unsigned levelDiff = level - texObj->BaseLevel; - const unsigned refWidth = baseImage->Width >> levelDiff; - const unsigned refHeight = baseImage->Height >> levelDiff; - const unsigned refDepth = baseImage->Depth >> levelDiff; + const unsigned refWidth = MAX2(baseImage->Width >> levelDiff, 1); + const unsigned refHeight = MAX2(baseImage->Height >> levelDiff, 1); + const unsigned refDepth = MAX2(baseImage->Depth >> levelDiff, 1); return (texImage->Width == refWidth && texImage->Height == refHeight && -- cgit v1.2.3 From 9dbd47fc6b1cf9ddfb318f2e05df0886cd5fe0df Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 16:59:59 -0800 Subject: mesa: set version string to 7.6.1-rc3 --- src/mesa/main/version.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index e2fed570809..8a2013229a1 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 6 #define MESA_PATCH 1 -#define MESA_VERSION_STRING "7.6.1-rc2" +#define MESA_VERSION_STRING "7.6.1-rc3" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From bb64c9bcdf9962c4f74d71f49307de1da4c3392b Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 17:06:07 -0800 Subject: Revert "intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers." This reverts commit 4598942b1b88a2a7d5af7febae7e79eedf00e385. XRGB8888 doesn't work as intended. Revert this for now, and we'll revisit it for 7.8 or something. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index b6e0d823ed2..5615040946f 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -126,7 +126,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_XRGB8888; + irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; case GL_RGBA: @@ -314,6 +314,10 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: + /* XXX this is a hack since XRGB surfaces don't seem to work + * properly yet. Reading the alpha channel returns 0 instead of 1. + */ + format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From ba167f812c44c4bb8c8f844c3d5fbff60bfc93eb Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Mon, 7 Dec 2009 17:18:56 -0800 Subject: mesa: set version string to 7.7-rc1 Also modify the Makefile to use the correct version for the tarballs. --- Makefile | 2 +- src/mesa/main/version.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index bd793e7a06a..fbe98906861 100644 --- a/Makefile +++ b/Makefile @@ -182,7 +182,7 @@ ultrix-gcc: # Rules for making release tarballs -VERSION=7.7-devel +VERSION=7.7-rc2 DIRECTORY = Mesa-$(VERSION) LIB_NAME = MesaLib-$(VERSION) DEMO_NAME = MesaDemos-$(VERSION) diff --git a/src/mesa/main/version.h b/src/mesa/main/version.h index fddb9a851f4..fa233b9f308 100644 --- a/src/mesa/main/version.h +++ b/src/mesa/main/version.h @@ -32,7 +32,7 @@ #define MESA_MAJOR 7 #define MESA_MINOR 7 #define MESA_PATCH 0 -#define MESA_VERSION_STRING "7.7-rc1" +#define MESA_VERSION_STRING "7.7-rc2" /* To make version comparison easy */ #define MESA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c)) -- cgit v1.2.3 From 3e8b2fda215689b9a77c73020a1efc523995931e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 7 Dec 2009 18:40:37 -0800 Subject: progs/test: Initialize variable in prog_parameter. Silences uninitialized variable compiler warning. --- progs/tests/prog_parameter.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/progs/tests/prog_parameter.c b/progs/tests/prog_parameter.c index 0241f3a2496..2de7e2994af 100644 --- a/progs/tests/prog_parameter.c +++ b/progs/tests/prog_parameter.c @@ -192,6 +192,7 @@ static void Init( void ) GLfloat * params; GLint max_program_env_parameters; GLint max_program_local_parameters; + int i; printf("GL_RENDERER = %s\n", (char *) glGetString(GL_RENDERER)); @@ -238,6 +239,10 @@ static void Init( void ) params = malloc(max_program_env_parameters * 4 * sizeof(GLfloat)); + for (i = 0; i < max_program_env_parameters * 4; i++) { + params[i] = 0.0F; + } + pass &= set_parameter_batch(max_program_env_parameters, params, "Env", program_env_parameter4fv, program_env_parameters4fv, -- cgit v1.2.3 From add6dfbba64260c9b314b4a95c8def084e05bd3b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Mon, 7 Dec 2009 19:04:07 -0800 Subject: llvmpipe: Initialize variables in emit_instruction. --- src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index d4d18febec7..f588bde9831 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -496,9 +496,9 @@ emit_instruction( if (IS_DST0_CHANNEL_ENABLED( inst, CHAN_X ) || IS_DST0_CHANNEL_ENABLED( inst, CHAN_Y ) || IS_DST0_CHANNEL_ENABLED( inst, CHAN_Z )) { - LLVMValueRef *p_floor_log2; - LLVMValueRef *p_exp; - LLVMValueRef *p_log2; + LLVMValueRef *p_floor_log2 = NULL; + LLVMValueRef *p_exp = NULL; + LLVMValueRef *p_log2 = NULL; src0 = emit_fetch( bld, inst, 0, CHAN_X ); src0 = lp_build_abs( &bld->base, src0 ); -- cgit v1.2.3 From dc0777d3e3b760d7faa5fb99a189919bde07ca0b Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 4 Nov 2009 10:00:47 +0200 Subject: r600: reorder state for render_target and blend First time around render targets are not enabled yet (done in r700SendRenderTargetState) so blend state is not emitted for any targets. Affects first glClear in some mesa tests. As a quick fix reorder state emit so that target is set first --- src/mesa/drivers/dri/r600/r700_chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 8707a764ac6..d8661b44397 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1250,9 +1250,9 @@ void r600InitAtoms(context_t *context) ALLOC_STATE(poly, always, 10, r700SendPolyState); ALLOC_STATE(cb, cb, 18, r700SendCBState); ALLOC_STATE(clrcmp, always, 6, r700SendCBCLRCMPState); + ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(blnd, blnd, (6 + (R700_MAX_RENDER_TARGETS * 3)), r700SendCBBlendState); ALLOC_STATE(blnd_clr, always, 6, r700SendCBBlendColorState); - ALLOC_STATE(cb_target, always, 25, r700SendRenderTargetState); ALLOC_STATE(sx, always, 9, r700SendSXState); ALLOC_STATE(vgt, always, 41, r700SendVGTState); ALLOC_STATE(spi, always, (59 + R700_MAX_SHADER_EXPORTS), r700SendSPIState); -- cgit v1.2.3 From 369669ff9a7ff7636cadef8e2b13f2f28face98f Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Thu, 3 Dec 2009 12:26:44 +0200 Subject: r600: add support for TXB instruction makes testing other things easier - does not hang the card TODO: enable TEX dependency tracking in vertex programs --- src/mesa/drivers/dri/r600/r700_assembler.c | 26 +++++++++----------------- 1 file changed, 9 insertions(+), 17 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 6ff08e1cfb7..be875ae6b80 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3450,22 +3450,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) need_barrier = GL_TRUE; } - switch (pAsm->pILInst[pAsm->uiCurInst].Opcode) - { - case OPCODE_TEX: - break; - case OPCODE_TXB: - radeon_error("do not support TXB yet\n"); - return GL_FALSE; - break; - case OPCODE_TXP: - break; - default: - radeon_error("Internal error: bad texture op (not TEX)\n"); - return GL_FALSE; - break; - } - if (pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXP) { GLuint tmp = gethelpr(pAsm); @@ -3644,7 +3628,15 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXB) + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; + } + else + { + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + } + pAsm->is_tex = GL_TRUE; if ( GL_TRUE == need_barrier ) { -- cgit v1.2.3 From 7f8e22aa29b7340d51b1f2e16d55a035c0f9b851 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 00:26:37 -0800 Subject: rbug: Initialize variable in rbug_get_message. Silences uninitialized variable warning. --- src/gallium/auxiliary/rbug/rbug_connection.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/auxiliary/rbug/rbug_connection.c b/src/gallium/auxiliary/rbug/rbug_connection.c index 52acb700af9..ae4e27f9f6b 100644 --- a/src/gallium/auxiliary/rbug/rbug_connection.c +++ b/src/gallium/auxiliary/rbug/rbug_connection.c @@ -87,6 +87,7 @@ rbug_get_message(struct rbug_connection *c, uint32_t *serial) if (!data) { return NULL; } + data->opcode = 0; do { uint8_t *ptr = ((uint8_t*)data) + read; -- cgit v1.2.3 From 7e93e06781d2f3e0c737c7654c3fb0d83e31e45a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 00:37:35 -0800 Subject: i915g: Add missing break statement in i915_debug_packet. --- src/gallium/drivers/i915simple/i915_debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/i915simple/i915_debug.c b/src/gallium/drivers/i915simple/i915_debug.c index ce92d1af9a7..521b5164702 100644 --- a/src/gallium/drivers/i915simple/i915_debug.c +++ b/src/gallium/drivers/i915simple/i915_debug.c @@ -851,6 +851,7 @@ static boolean i915_debug_packet( struct debug_stream *stream ) default: return debug(stream, "", 0); } + break; default: assert(0); return 0; -- cgit v1.2.3 From 1de1deffce9c7120a167af8553b606eec82e60a3 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 00:43:38 -0800 Subject: i915g: Fix memory leak when pci id is unknown. --- src/gallium/drivers/i915simple/i915_screen.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/drivers/i915simple/i915_screen.c b/src/gallium/drivers/i915simple/i915_screen.c index 9f017a14cca..9557c80ce12 100644 --- a/src/gallium/drivers/i915simple/i915_screen.c +++ b/src/gallium/drivers/i915simple/i915_screen.c @@ -273,6 +273,7 @@ i915_create_screen(struct intel_winsys *iws, uint pci_id) default: debug_printf("%s: unknown pci id 0x%x, cannot create screen\n", __FUNCTION__, pci_id); + FREE(is); return NULL; } -- cgit v1.2.3 From 9e42683fb3ecd453267a5885a138b425a2b79236 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 8 Dec 2009 11:43:22 +0100 Subject: vmware/xorg: Avoid warning about HAVE_STDINT_H being redefined. --- src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c index ad6993840d2..c84368bab7f 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -31,7 +31,9 @@ * @author Jakob Bornecrantz */ -#define HAVE_STDINT_H +#ifndef HAVE_STDINT_H +#define HAVE_STDINT_H 1 +#endif #define _FILE_OFFSET_BITS 64 #include -- cgit v1.2.3 From 32ccc9b0bbfad46d2f4ce3b9ac4cdd182d7b64e4 Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Tue, 8 Dec 2009 11:45:19 +0100 Subject: vmware/xorg: Fix SCons build. Not sure how vmw_screen.c could build at all though... --- src/gallium/winsys/drm/vmware/xorg/SConscript | 2 ++ src/gallium/winsys/drm/vmware/xorg/vmw_screen.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/src/gallium/winsys/drm/vmware/xorg/SConscript b/src/gallium/winsys/drm/vmware/xorg/SConscript index ff7b2ed34ed..b8968e7137b 100644 --- a/src/gallium/winsys/drm/vmware/xorg/SConscript +++ b/src/gallium/winsys/drm/vmware/xorg/SConscript @@ -42,6 +42,8 @@ if env['platform'] == 'linux': ]) sources = [ + 'vmw_ioctl.c', + 'vmw_screen.c', 'vmw_xorg.c', ] diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c index 421906da996..18cb509189a 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_screen.c @@ -33,6 +33,8 @@ #include "vmw_hook.h" #include "vmw_driver.h" +#include "cursorstr.h" + /* modified version of crtc functions */ xf86CrtcFuncsRec vmw_screen_crtc_funcs; -- cgit v1.2.3 From 2aebc5e01fbab6046f80c881d30717f788a390bc Mon Sep 17 00:00:00 2001 From: Alan Hourihane Date: Tue, 8 Dec 2009 13:11:09 +0000 Subject: move assert to avoid crash in debug build. --- src/gallium/drivers/llvmpipe/lp_tile_cache.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_tile_cache.c b/src/gallium/drivers/llvmpipe/lp_tile_cache.c index e83210f93bc..7a1ecf5107b 100644 --- a/src/gallium/drivers/llvmpipe/lp_tile_cache.c +++ b/src/gallium/drivers/llvmpipe/lp_tile_cache.c @@ -290,11 +290,12 @@ lp_get_cached_tile(struct llvmpipe_tile_cache *tc, assert(tc->surface); assert(tc->transfer); - assert(tc->transfer_map); if(!tc->transfer_map) lp_tile_cache_map_transfers(tc); + assert(tc->transfer_map); + switch(tile->status) { case LP_TILE_STATUS_CLEAR: /* don't get tile from framebuffer, just clear it */ -- cgit v1.2.3 From 94c6ec5809b08676f12628b49dd88ec694d07a48 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Thu, 3 Dec 2009 18:12:45 +0200 Subject: r600: execute SET funtions on all channels seems assemble_LOGIC was meant for non-condition-code instructions so execute in for all components as previously --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index cf64d170ed6..fe006ef19c4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4467,7 +4467,7 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) } pAsm->D.dst.opcode = opcode; - pAsm->D.dst.math = 1; + //pAsm->D.dst.math = 1; if( GL_FALSE == assemble_dst(pAsm) ) { -- cgit v1.2.3 From c1d79a4235fa2edb05e92f9b93a105ff356a4a18 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 11:37:15 +0200 Subject: r600: wip glsl - refactor conditional instructions a bit remember the dst register which is used for cond updates when it's time to use the cond codes issue a separate PRED instruction --- src/mesa/drivers/dri/r600/r700_assembler.c | 379 ++++++----------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + 2 files changed, 70 insertions(+), 310 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index fe006ef19c4..87c1638de48 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3557,7 +3557,7 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) checkop2(pAsm); pAsm->D.dst.opcode = opcode; - pAsm->D.dst.math = 1; + //pAsm->D.dst.math = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; @@ -3567,17 +3567,23 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = 0; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); + noneg_PVSSRC(&(pAsm->S[0].src)); + + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) { return GL_FALSE; } - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + /*if( GL_FALSE == assemble_src(pAsm, 1, -1) ) { return GL_FALSE; } - - if ( GL_FALSE == next_ins2(pAsm) ) + */ + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -4494,30 +4500,32 @@ GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode) GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) { - if( GL_FALSE == checkop2(pAsm) ) - { - return GL_FALSE; - } + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); pAsm->D.dst.opcode = opcode; pAsm->D.dst.math = 1; pAsm->D.dst.predicated = 1; - pAsm->D2.dst2.SaturateMode = pAsm->pILInst[pAsm->uiCurInst].SaturateMode; - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = pAsm->uHelpReg; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = pAsm->D.dst.writez = pAsm->D.dst.writew = 0; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pAsm->last_cond_register + pAsm->starting_temp_register_number; + pAsm->S[0].src.swizzlex = pILInst->DstReg.CondSwizzle & 0x7; + noneg_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == assemble_src(pAsm, 1, -1) ) - { - return GL_FALSE; - } + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = pAsm->uHelpReg; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + noneg_PVSSRC(&(pAsm->S[1].src)); + pAsm->S[1].src.swizzlex = SQ_SEL_0; + pAsm->S[1].src.swizzley = SQ_SEL_0; + pAsm->S[1].src.swizzlez = SQ_SEL_0; + pAsm->S[1].src.swizzlew = SQ_SEL_0; if( GL_FALSE == next_ins2(pAsm) ) { @@ -5098,6 +5106,11 @@ GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops) GLboolean assemble_IF(r700_AssemblerBase *pAsm, GLboolean bHasElse) { + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + + if(GL_FALSE == add_cf_instruction(pAsm) ) { return GL_FALSE; @@ -5242,6 +5255,11 @@ GLboolean assemble_BGNLOOP(r700_AssemblerBase *pAsm) GLboolean assemble_BRK(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_CONTINUE_BREAK + + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + unsigned int unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) { @@ -5308,6 +5326,10 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm) GLboolean assemble_CONT(r700_AssemblerBase *pAsm) { #ifdef USE_CF_FOR_CONTINUE_BREAK + pAsm->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; + + assemble_LOGIC_PRED(pAsm, SQ_OP2_INST_PRED_SETNE); + unsigned int unFCSP; for(unFCSP=pAsm->FCSP; unFCSP>0; unFCSP--) { @@ -5848,6 +5870,12 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } } #endif + if(pILInst[i].CondUpdate == 1) + { + /* remember dest register used for cond evaluation */ + /* XXX also handle PROGRAM_OUTPUT registers here? */ + pR700AsmCode->last_cond_register = pILInst[i].DstReg.Index; + } switch (pILInst[i].Opcode) { @@ -5918,9 +5946,8 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_KIL: case OPCODE_KIL_NV: - /* done at OPCODE_SE/SGT...etc. */ - /* if ( GL_FALSE == assemble_KIL(pR700AsmCode) ) - return GL_FALSE; */ + if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) + return GL_FALSE; break; case OPCODE_LG2: if ( GL_FALSE == assemble_LG2(pR700AsmCode) ) @@ -5983,151 +6010,23 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_SEQ: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETE) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; case OPCODE_SGT: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; case OPCODE_SGE: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) - { - return GL_FALSE; - } + if ( GL_FALSE == assemble_SGE(pR700AsmCode) ) + { + return GL_FALSE; } break; @@ -6139,61 +6038,12 @@ GLboolean AssembleInstr(GLuint uiFirstInst, SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGT) ) - { - return GL_FALSE; - } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGT) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; } @@ -6206,60 +6056,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, SrcRegSave[1] = pILInst[i].SrcReg[1]; pILInst[i].SrcReg[0] = SrcRegSave[1]; pILInst[i].SrcReg[1] = SrcRegSave[0]; - if(OPCODE_IF == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLGE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETGE) ) - { - pILInst[i].SrcReg[0] = SrcRegSave[0]; - pILInst[i].SrcReg[1] = SrcRegSave[1]; - return GL_FALSE; - } + pILInst[i].SrcReg[0] = SrcRegSave[0]; + pILInst[i].SrcReg[1] = SrcRegSave[1]; + return GL_FALSE; } pILInst[i].SrcReg[0] = SrcRegSave[0]; pILInst[i].SrcReg[1] = SrcRegSave[1]; @@ -6267,51 +6068,9 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_SNE: - if(OPCODE_IF == pILInst[i+1].Opcode) - { - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_BRK == pILInst[i+1].Opcode) + if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_BREAK; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if(OPCODE_CONT == pILInst[i+1].Opcode) - { -#ifdef USE_CF_FOR_CONTINUE_BREAK - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_PUSH_BEFORE; -#else - pR700AsmCode->alu_x_opcode = SQ_CF_INST_ALU_CONTINUE; -#endif - if ( GL_FALSE == assemble_LOGIC_PRED(pR700AsmCode, SQ_OP2_INST_PRED_SETNE) ) - { - return GL_FALSE; - } - } - else if((OPCODE_KIL == pILInst[i+1].Opcode)||(OPCODE_KIL_NV == pILInst[i+1].Opcode)) - { - if ( GL_FALSE == assemble_KIL(pR700AsmCode, SQ_OP2_INST_KILLNE) ) - { - return GL_FALSE; - } - } - else - { - if ( GL_FALSE == assemble_LOGIC(pR700AsmCode, SQ_OP2_INST_SETNE) ) - { - return GL_FALSE; - } + return GL_FALSE; } break; diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 130fc89dae1..ef1f924add9 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -345,6 +345,7 @@ typedef struct r700_AssemblerBase PVSDWORD S[3]; unsigned int uLastPosUpdate; + unsigned int last_cond_register; OUT_FRAGMENT_FMT_0 fp_stOutFmt0; -- cgit v1.2.3 From 323d1fb3910d7e53cb5200ee90849b2231fd96fb Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 12:58:36 +0200 Subject: r600: quick hack to get KIL_NV working - does condition TR only for now --- src/mesa/drivers/dri/r600/r700_assembler.c | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 87c1638de48..3738edbc2f9 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3554,7 +3554,10 @@ GLboolean assemble_FRC(r700_AssemblerBase *pAsm) GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) { - checkop2(pAsm); + struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); + + if(pILInst->Opcode == OPCODE_KIL) + checkop1(pAsm); pAsm->D.dst.opcode = opcode; //pAsm->D.dst.math = 1; @@ -3573,16 +3576,23 @@ GLboolean assemble_KIL(r700_AssemblerBase *pAsm, GLuint opcode) setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_0); noneg_PVSSRC(&(pAsm->S[0].src)); - if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + if(pILInst->Opcode == OPCODE_KIL_NV) { - return GL_FALSE; + setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); + pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[1].src.reg = 0; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_1); + neg_PVSSRC(&(pAsm->S[1].src)); } - - /*if( GL_FALSE == assemble_src(pAsm, 1, -1) ) + else { - return GL_FALSE; + if( GL_FALSE == assemble_src(pAsm, 0, 1) ) + { + return GL_FALSE; + } + } - */ + if ( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; -- cgit v1.2.3 From 94723b60cf3dd838dfaf505450db8ef2e089399c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Fri, 4 Dec 2009 13:53:44 +0200 Subject: r600: implement FRAG_ATTRIB_FACE, glsl/twoside works --- src/mesa/drivers/dri/r600/r700_fragprog.c | 34 ++++++++++++++++++++++++++++++- 1 file changed, 33 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index e9ef6c86953..0cb9707ee6f 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -93,7 +93,7 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_TEX0 + i] = pAsm->number_used_registers++; } } - + /* order has been taken care of */ #if 1 for(i=VERT_RESULT_VAR0; inumber_used_registers += unMaxVarying + 1; } #endif + unBit = 1 << FRAG_ATTRIB_FACE; + if(mesa_fp->Base.InputsRead & unBit) + { + pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE] = pAsm->number_used_registers++; + } /* Map temporary registers (GPRs) */ pAsm->starting_temp_register_number = pAsm->number_used_registers; @@ -451,6 +456,20 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) CLEARbit(r700->SPI_INPUT_Z.u32All, PROVIDE_Z_TO_SPI_bit); } + if (mesa_fp->Base.InputsRead & (1 << FRAG_ATTRIB_FACE)) + { + ui += 1; + SETfield(r700->SPI_PS_IN_CONTROL_0.u32All, ui, NUM_INTERP_shift, NUM_INTERP_mask); + SETbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ENA_bit); + SETbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ALL_BITS_bit); + SETfield(r700->SPI_PS_IN_CONTROL_1.u32All, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE], FRONT_FACE_ADDR_shift, FRONT_FACE_ADDR_mask); + } + else + { + CLEARbit(r700->SPI_PS_IN_CONTROL_1.u32All, FRONT_FACE_ENA_bit); + } + + ui = (unNumOfReg < ui) ? ui : unNumOfReg; SETfield(r700->ps.SQ_PGM_RESOURCES_PS.u32All, ui, NUM_GPRS_shift, NUM_GPRS_mask); @@ -535,6 +554,19 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } } + unBit = 1 << FRAG_ATTRIB_FACE; + if(mesa_fp->Base.InputsRead & unBit) + { + ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE]; + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); + SETfield(r700->SPI_PS_INPUT_CNTL[ui].u32All, ui, + SEMANTIC_shift, SEMANTIC_mask); + if (r700->SPI_INTERP_CONTROL_0.u32All & FLAT_SHADE_ENA_bit) + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + else + CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + } + for(i=VERT_RESULT_VAR0; i Date: Fri, 4 Dec 2009 16:36:41 +0200 Subject: r600: glsl - allow specifying texture sampler via uniforms looks kinda hackish, should rethink later --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- src/mesa/drivers/dri/r600/r700_assembler.h | 1 + src/mesa/drivers/dri/r600/r700_fragprog.c | 5 +++++ src/mesa/drivers/dri/r600/r700_vertprog.c | 4 ++++ 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 3738edbc2f9..158c5fa5491 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -4840,7 +4840,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->need_tex_barrier = GL_TRUE; } // Set src1 to tex unit id - pAsm->S[1].src.reg = pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit; + pAsm->S[1].src.reg = pAsm->SamplerUnits[pAsm->pILInst[pAsm->uiCurInst].TexSrcUnit]; pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; //No sw info from mesa compiler, so hard code here. diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index ef1f924add9..48ffef501f4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -416,6 +416,7 @@ typedef struct r700_AssemblerBase SHADER_PIPE_TYPE currentShaderType; struct prog_instruction * pILInst; GLuint uiCurInst; + GLubyte SamplerUnits[MAX_SAMPLERS]; GLboolean bR6xx; /* helper to decide which type of instruction to assemble */ GLboolean is_tex; diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 0cb9707ee6f..8eb439a9519 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -308,6 +308,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, GLuint number_of_colors_exported; GLboolean z_enabled = GL_FALSE; GLuint unBit; + int i; //Init_Program Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) ); @@ -320,6 +321,10 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, InitShaderProgram(&(fp->r700AsmCode)); + for(i=0; i < MAX_SAMPLERS; i++) + { + fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; + } if( GL_FALSE == AssembleInstr(0, mesa_fp->Base.NumInstructions, &(mesa_fp->Base.Instructions[0]), diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index d3d1da79592..759b74dc7e9 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -337,6 +337,10 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, InitShaderProgram(&(vp->r700AsmCode)); + for(i=0; i < MAX_SAMPLERS; i++) + { + vp->r700AsmCode.SamplerUnits[i] = vp->mesa_program->Base.SamplerUnits[i]; + } if(GL_FALSE == AssembleInstr(0, vp->mesa_program->Base.NumInstructions, &(vp->mesa_program->Base.Instructions[0]), -- cgit v1.2.3 From 17e212e2631cd652c28378399806c3b3bd293e9a Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 11:51:36 +0200 Subject: r600: add ABS support for source regs to assembler use it in tex cube instruction sequence --- src/mesa/drivers/dri/r600/r700_assembler.c | 27 +++++---------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 7 ++++--- 2 files changed, 9 insertions(+), 25 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 158c5fa5491..2f8038adb39 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2350,8 +2350,8 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = pAsm->S[0].src.abs; + alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = pAsm->S[1].src.abs; //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; @@ -2379,8 +2379,8 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.src0_abs = pAsm->S[0].src.abs; + alu_instruction_ptr->m_Word1_OP2.f.src1_abs = pAsm->S[1].src.abs; //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; @@ -4721,24 +4721,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) return GL_FALSE; } - /* tmp1.z = ABS(tmp1.z) dont have abs support in assembler currently - * have to do explicit instruction - */ - pAsm->D.dst.opcode = SQ_OP2_INST_MAX; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp1; - pAsm->D.dst.writez = 1; - - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp1; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[1].bits = pAsm->S[0].bits; - flipneg_PVSSRC(&(pAsm->S[1].src)); - - next_ins(pAsm); - /* tmp1.z = RCP_e(|tmp1.z|) */ pAsm->D.dst.opcode = SQ_OP2_INST_RECIP_IEEE; pAsm->D.dst.math = 1; @@ -4751,6 +4733,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; pAsm->S[0].src.reg = tmp1; pAsm->S[0].src.swizzlex = SQ_SEL_Z; + pAsm->S[0].src.abs = 1; next_ins(pAsm); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 48ffef501f4..cfa2610a55c 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -120,14 +120,15 @@ typedef struct PVSINSTtag typedef struct PVSSRCtag { - BITS rtype:4; + BITS rtype:3; BITS addrmode0:1; - BITS reg:10; //15 (8) + BITS reg:10; //14 (8) BITS swizzlex:3; BITS swizzley:3; BITS swizzlez:3; - BITS swizzlew:3; //27 + BITS swizzlew:3; //26 + BITS abs:1; BITS negx:1; BITS negy:1; BITS negz:1; -- cgit v1.2.3 From 602ba357edd640e0db17911b39d3ecfbf5675230 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 13:04:32 +0200 Subject: r600: merge alu_instruction/alu_instruction2 --- src/mesa/drivers/dri/r600/r700_assembler.c | 320 +++-------------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 6 +- 2 files changed, 29 insertions(+), 297 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 2f8038adb39..8155d53eebc 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1292,6 +1292,15 @@ GLboolean assemble_dst(r700_AssemblerBase *pAsm) pAsm->D.dst.writez = (pILInst->DstReg.WriteMask >> 2) & 0x1; pAsm->D.dst.writew = (pILInst->DstReg.WriteMask >> 3) & 0x1; + if(pILInst->SaturateMode == SATURATE_ZERO_ONE) + { + pAsm->D2.dst2.SaturateMode = 1; + } + else + { + pAsm->D2.dst2.SaturateMode = 0; + } + return GL_TRUE; } @@ -2270,7 +2279,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_AR_X; + alu_instruction_ptr->m_Word0.f.index_mode = pAsm->D2.dst2.index_mode; if( (is_single_scalar_operation == GL_TRUE) || (GL_TRUE == bSplitInst) ) @@ -2282,9 +2291,17 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; } - alu_instruction_ptr->m_Word0.f.pred_sel = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + alu_instruction_ptr->m_Word0.f.pred_sel = (pAsm->D.dst.pred_inv > 0) ? 1 : 0; + if(1 == pAsm->D.dst.predicated) + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; + } + else + { + alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; + alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; + } // dst if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || @@ -2323,7 +2340,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - alu_instruction_ptr->m_Word1.f.clamp = pAsm->pILInst[pAsm->uiCurInst].SaturateMode; + alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; if (pAsm->D.dst.op3) { @@ -2436,253 +2453,6 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm) -{ - GLuint number_of_scalar_operations; - GLboolean is_single_scalar_operation; - GLuint scalar_channel_index; - - PVSSRC * pcurrent_source; - int current_source_index; - GLuint contiguous_slots_needed; - - GLuint uNumSrc = r700GetNumOperands(pAsm); - - GLboolean bSplitInst = GL_FALSE; - - if (1 == pAsm->D.dst.math) - { - is_single_scalar_operation = GL_TRUE; - number_of_scalar_operations = 1; - } - else - { - is_single_scalar_operation = GL_FALSE; - number_of_scalar_operations = 4; - } - - contiguous_slots_needed = 0; - - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) - { - contiguous_slots_needed = 4; - } - - initialize(pAsm); - - for (scalar_channel_index=0; - scalar_channel_index < number_of_scalar_operations; - scalar_channel_index++) - { - R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - - //src 0 - current_source_index = 0; - pcurrent_source = &(pAsm->S[0].src); - - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - - if (uNumSrc > 1) - { - // Process source 1 - current_source_index = 1; - pcurrent_source = &(pAsm->S[current_source_index].src); - - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - } - - //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; - - if( (is_single_scalar_operation == GL_TRUE) - || (GL_TRUE == bSplitInst) ) - { - alu_instruction_ptr->m_Word0.f.last = 1; - } - else - { - alu_instruction_ptr->m_Word0.f.last = (scalar_channel_index == 3) ? 1 : 0; - } - - alu_instruction_ptr->m_Word0.f.pred_sel = (pAsm->D.dst.pred_inv > 0) ? 1 : 0; - if(1 == pAsm->D.dst.predicated) - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; - } - - // dst - if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) - { - alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; - } - else - { - radeon_error("Only temp destination registers supported for ALU dest regs.\n"); - return GL_FALSE; - } - - alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype - - if ( is_single_scalar_operation == GL_TRUE ) - { - // Override scalar_channel_index since only one scalar value will be written - if(pAsm->D.dst.writex) - { - scalar_channel_index = 0; - } - else if(pAsm->D.dst.writey) - { - scalar_channel_index = 1; - } - else if(pAsm->D.dst.writez) - { - scalar_channel_index = 2; - } - else if(pAsm->D.dst.writew) - { - scalar_channel_index = 3; - } - } - - alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - - alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - - if (pAsm->D.dst.op3) - { - //op3 - - alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; - - //There's 3rd src for op3 - current_source_index = 2; - pcurrent_source = &(pAsm->S[current_source_index].src); - - if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, - current_source_index, - pcurrent_source, - scalar_channel_index) ) - { - return GL_FALSE; - } - } - else - { - //op2 - if (pAsm->bR6xx) - { - alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; - - //alu_instruction_ptr->m_Word1_OP2.f6.update_execute_mask = 0x0; - //alu_instruction_ptr->m_Word1_OP2.f6.update_pred = 0x0; - switch (scalar_channel_index) - { - case 0: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writex; - break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writey; - break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writez; - break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = pAsm->D.dst.writew; - break; - default: - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; //SQ_SEL_MASK; - break; - } - alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; - - //alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x0; - //alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x0; - switch (scalar_channel_index) - { - case 0: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writex; - break; - case 1: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writey; - break; - case 2: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writez; - break; - case 3: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = pAsm->D.dst.writew; - break; - default: - alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; //SQ_SEL_MASK; - break; - } - alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; - } - } - - if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { - return GL_FALSE; - } - - /* - * Judge the type of current instruction, is it vector or scalar - * instruction. - */ - if (is_single_scalar_operation) - { - if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - else - { - if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - - contiguous_slots_needed = 0; - } - - return GL_TRUE; -} - GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { R700ALUInstruction * alu_instruction_ptr; @@ -2987,44 +2757,6 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->S[2].bits = 0; pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; - - return GL_TRUE; -} - -GLboolean next_ins2(r700_AssemblerBase *pAsm) -{ - struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - - //ALU - if( GL_FALSE == assemble_alu_instruction2(pAsm) ) - { - radeon_error("Error assembling ALU instruction\n"); - return GL_FALSE; - } - - if(pAsm->D.dst.rtype == DST_REG_OUT) - { - if(pAsm->D.dst.op3) - { - // There is no mask for OP3 instructions, so all channels are written - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] = 0xF; - } - else - { - pAsm->pucOutMask[pAsm->D.dst.reg - pAsm->starting_export_register_number] - |= (unsigned char)pAsm->pILInst[pAsm->uiCurInst].DstReg.WriteMask; - } - } - - //reset for next inst. - pAsm->D.bits = 0; - pAsm->D2.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; - pAsm->D2.bits = 0; return GL_TRUE; @@ -4537,7 +4269,7 @@ GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode) pAsm->S[1].src.swizzlez = SQ_SEL_0; pAsm->S[1].src.swizzlew = SQ_SEL_0; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -5683,6 +5415,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->D.dst.predicated = 0; /* in reloc where dislink flag init inst, only one slot alu inst is handled. */ pAsm->D.dst.math = 1; /* TODO : not math really, but one channel op, more generic alu assembler needed */ + pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ #if 0 pAsm->S[0].src.rtype = SRC_REC_LITERAL; //pAsm->S[0].src.reg = 0; @@ -5707,7 +5440,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->S[0].src.swizzlez = flagValue; pAsm->S[0].src.swizzlew = flagValue; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } @@ -5735,6 +5468,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->D2.dst2.literal = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 1; + pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ pAsm->S[0].src.rtype = DST_REG_TEMPORARY; pAsm->S[0].src.reg = pAsm->flag_reg_index; @@ -5768,7 +5502,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->S[1].src.swizzlez = SQ_SEL_1; pAsm->S[1].src.swizzlew = SQ_SEL_1; - if( GL_FALSE == next_ins2(pAsm) ) + if( GL_FALSE == next_ins(pAsm) ) { return GL_FALSE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index cfa2610a55c..cb7685464d6 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -116,6 +116,7 @@ typedef struct PVSINSTtag { BITS literal :2; BITS SaturateMode :2; + BITS index_mode :3; } PVSINST; typedef struct PVSSRCtag @@ -529,10 +530,7 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm); GLboolean next_ins(r700_AssemblerBase *pAsm); -GLboolean next_ins2(r700_AssemblerBase *pAsm); -GLboolean assemble_alu_instruction2(r700_AssemblerBase *pAsm); - -/* TODO : merge next_ins/2/literal, assemble_alu_instruction/2/literal */ +/* TODO : merge next_ins/literal, assemble_alu_instruction/literal */ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); -- cgit v1.2.3 From 4e86cedf5b7ab98dbe59115fc325f9b3172d58be Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 15:23:40 +0200 Subject: r600: add assembler support for literal(inline) constants and use it in cubemap instruction sequence for testing --- src/mesa/drivers/dri/r600/r700_assembler.c | 67 +++++++++++++++++++++--------- src/mesa/drivers/dri/r600/r700_assembler.h | 3 +- 2 files changed, 49 insertions(+), 21 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 8155d53eebc..c1e3377af64 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1733,7 +1733,7 @@ GLboolean add_alu_instruction(r700_AssemblerBase* pAsm, } else { - pAsm->cf_current_alu_clause_ptr->m_Word1.f.count++; + pAsm->cf_current_alu_clause_ptr->m_Word1.f.count += (GetInstructionSize(alu_instruction_ptr->m_ShaderInstType) / 2); } // If this clause constains any instruction that is forward dependent on a TEX instruction, @@ -2168,6 +2168,10 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) { + R700ALUInstruction * alu_instruction_ptr; + R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; + R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; + GLuint number_of_scalar_operations; GLboolean is_single_scalar_operation; GLuint scalar_channel_index; @@ -2238,18 +2242,39 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) contiguous_slots_needed = 4; } + contiguous_slots_needed += pAsm->D2.dst2.literal_slots; + initialize(pAsm); for (scalar_channel_index=0; scalar_channel_index < number_of_scalar_operations; scalar_channel_index++) { - R700ALUInstruction* alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); + if(scalar_channel_index == (number_of_scalar_operations-1)) + { + switch(pAsm->D2.dst2.literal_slots) + { + case 0: + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + Init_R700ALUInstruction(alu_instruction_ptr); + break; + case 1: + alu_instruction_ptr_hl = (R700ALUInstructionHalfLiteral*) CALLOC_STRUCT(R700ALUInstructionHalfLiteral); + Init_R700ALUInstructionHalfLiteral(alu_instruction_ptr_hl, pAsm->C[0].f, pAsm->C[1].f); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_hl; + break; + case 2: + alu_instruction_ptr_fl = (R700ALUInstructionFullLiteral*) CALLOC_STRUCT(R700ALUInstructionFullLiteral); + Init_R700ALUInstructionFullLiteral(alu_instruction_ptr_fl,pAsm->C[0].f, pAsm->C[1].f, pAsm->C[2].f, pAsm->C[3].f); + alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_fl; + break; + }; + } + else + { + alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); + Init_R700ALUInstruction(alu_instruction_ptr); + } //src 0 current_source_index = 0; @@ -2447,12 +2472,12 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) } } - contiguous_slots_needed = 0; + contiguous_slots_needed -= 1; } return GL_TRUE; } - +#if 0 GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { R700ALUInstruction * alu_instruction_ptr; @@ -2705,7 +2730,7 @@ GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * p return GL_TRUE; } - +#endif GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2758,11 +2783,11 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) pAsm->is_tex = GL_FALSE; pAsm->need_tex_barrier = GL_FALSE; pAsm->D2.bits = 0; - + pAsm->C[0].bits = pAsm->C[1].bits = pAsm->C[2].bits = pAsm->C[3].bits = 0; return GL_TRUE; } -/* not work yet */ +#if 0/* not work yet */ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2784,7 +2809,7 @@ GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) pAsm->need_tex_barrier = GL_FALSE; return GL_TRUE; } - +#endif GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) { BITS tmp; @@ -4472,13 +4497,14 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) /* MULADD R0.x, R0.x, PS1, (0x3FC00000, 1.5f).x * MULADD R0.y, R0.y, PS1, (0x3FC00000, 1.5f).x * muladd has no writemask, have to use another temp - * also no support for imm constants, so add 1 here */ pAsm->D.dst.opcode = SQ_OP3_INST_MULADD; pAsm->D.dst.op3 = 1; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp2; + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1.5F; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; @@ -4489,12 +4515,13 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) pAsm->S[1].src.reg = tmp1; setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); - pAsm->S[2].src.rtype = SRC_REG_TEMPORARY; + /* immediate c 1.5 */ + pAsm->S[2].src.rtype = SRC_REC_LITERAL; pAsm->S[2].src.reg = tmp1; - setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_1); + setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X); next_ins(pAsm); - +#if 0 /* ADD the remaining .5 */ pAsm->D.dst.opcode = SQ_OP2_INST_ADD; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -4515,7 +4542,7 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) noswizzle_PVSSRC(&(pAsm->S[1].src)); next_ins(pAsm); - +#endif /* tmp1.xy = temp2.xy */ pAsm->D.dst.opcode = SQ_OP2_INST_MOV; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); @@ -5410,7 +5437,7 @@ GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue) pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.literal_slots = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 0; /* in reloc where dislink flag init inst, only one slot alu inst is handled. */ @@ -5465,7 +5492,7 @@ GLboolean testFlag(r700_AssemblerBase *pAsm) pAsm->D.dst.writey = 0; pAsm->D.dst.writez = 0; pAsm->D.dst.writew = 0; - pAsm->D2.dst2.literal = 1; + pAsm->D2.dst2.literal_slots = 1; pAsm->D2.dst2.SaturateMode = SATURATE_OFF; pAsm->D.dst.predicated = 1; pAsm->D2.dst2.index_mode = SQ_INDEX_LOOP; /* Check this ! */ diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index cb7685464d6..3fe65654ca0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -114,7 +114,7 @@ typedef struct PVSDSTtag typedef struct PVSINSTtag { - BITS literal :2; + BITS literal_slots :2; BITS SaturateMode :2; BITS index_mode :3; } PVSINST; @@ -345,6 +345,7 @@ typedef struct r700_AssemblerBase PVSDWORD D; PVSDWORD D2; PVSDWORD S[3]; + PVSDWORD C[4]; unsigned int uLastPosUpdate; unsigned int last_cond_register; -- cgit v1.2.3 From 2b8b16f6a6ce6091d4939cfb567a65a52757dff0 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:09:10 +0200 Subject: r600: use the new inline constants feature to fix COS --- src/mesa/drivers/dri/r600/r700_assembler.c | 37 +++++++++++++++++++++++++++++- 1 file changed, 36 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index c1e3377af64..660410f1adb 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3041,7 +3041,42 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) GLboolean assemble_COS(r700_AssemblerBase *pAsm) { - return assemble_math_function(pAsm, SQ_OP2_INST_COS); + int tmp; + //return assemble_math_function(pAsm, SQ_OP2_INST_COS); + checkop1(pAsm); + + tmp = gethelpr(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; + + assemble_src(pAsm, 0, -1); + + pAsm->S[1].src.rtype = SRC_REC_LITERAL; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1/(3.1415926535 * 2); + pAsm->C[1].f = 0.0F; + next_ins(pAsm); + + pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.math = 1; + + assemble_dst(pAsm); + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); + + next_ins(pAsm); + + return GL_TRUE; + } GLboolean assemble_DOT(r700_AssemblerBase *pAsm) -- cgit v1.2.3 From fbe06a9c2999a802333f8310156d58045d723799 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:23:07 +0200 Subject: r600: fix SIN also --- src/mesa/drivers/dri/r600/r700_assembler.c | 15 +++++---------- src/mesa/drivers/dri/r600/r700_assembler.h | 3 +-- 2 files changed, 6 insertions(+), 12 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 660410f1adb..caccedabdf4 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -3039,10 +3039,9 @@ GLboolean assemble_CMP(r700_AssemblerBase *pAsm) return GL_TRUE; } -GLboolean assemble_COS(r700_AssemblerBase *pAsm) +GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode) { int tmp; - //return assemble_math_function(pAsm, SQ_OP2_INST_COS); checkop1(pAsm); tmp = gethelpr(pAsm); @@ -3062,7 +3061,7 @@ GLboolean assemble_COS(r700_AssemblerBase *pAsm) pAsm->C[1].f = 0.0F; next_ins(pAsm); - pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.opcode = opcode; pAsm->D.dst.math = 1; assemble_dst(pAsm); @@ -3075,6 +3074,7 @@ GLboolean assemble_COS(r700_AssemblerBase *pAsm) next_ins(pAsm); + //TODO - replicate if more channels set in WriteMask return GL_TRUE; } @@ -4192,11 +4192,6 @@ GLboolean assemble_RSQ(r700_AssemblerBase *pAsm) return assemble_math_function(pAsm, SQ_OP2_INST_RECIPSQRT_IEEE); } -GLboolean assemble_SIN(r700_AssemblerBase *pAsm) -{ - return assemble_math_function(pAsm, SQ_OP2_INST_SIN); -} - GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { BITS tmp; @@ -5693,7 +5688,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; case OPCODE_COS: - if ( GL_FALSE == assemble_COS(pR700AsmCode) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_COS) ) return GL_FALSE; break; @@ -5790,7 +5785,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, return GL_FALSE; break; case OPCODE_SIN: - if ( GL_FALSE == assemble_SIN(pR700AsmCode) ) + if ( GL_FALSE == assemble_TRIG(pR700AsmCode, SQ_OP2_INST_SIN) ) return GL_FALSE; break; case OPCODE_SCS: diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 3fe65654ca0..f83206b726f 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -548,7 +548,6 @@ GLboolean assemble_ADD(r700_AssemblerBase *pAsm); GLboolean assemble_ARL(r700_AssemblerBase *pAsm); GLboolean assemble_BAD(char *opcode_str); GLboolean assemble_CMP(r700_AssemblerBase *pAsm); -GLboolean assemble_COS(r700_AssemblerBase *pAsm); GLboolean assemble_DOT(r700_AssemblerBase *pAsm); GLboolean assemble_DST(r700_AssemblerBase *pAsm); GLboolean assemble_EX2(r700_AssemblerBase *pAsm); @@ -569,12 +568,12 @@ GLboolean assemble_MUL(r700_AssemblerBase *pAsm); GLboolean assemble_POW(r700_AssemblerBase *pAsm); GLboolean assemble_RCP(r700_AssemblerBase *pAsm); GLboolean assemble_RSQ(r700_AssemblerBase *pAsm); -GLboolean assemble_SIN(r700_AssemblerBase *pAsm); GLboolean assemble_SCS(r700_AssemblerBase *pAsm); GLboolean assemble_SGE(r700_AssemblerBase *pAsm); GLboolean assemble_LOGIC(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_LOGIC_PRED(r700_AssemblerBase *pAsm, BITS opcode); +GLboolean assemble_TRIG(r700_AssemblerBase *pAsm, BITS opcode); GLboolean assemble_SLT(r700_AssemblerBase *pAsm); GLboolean assemble_STP(r700_AssemblerBase *pAsm); -- cgit v1.2.3 From 0f854105f5a430ab36281c9bed530eccb8b8f44c Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 16:27:05 +0200 Subject: r600: remove (now) dead code --- src/mesa/drivers/dri/r600/r700_assembler.c | 301 +---------------------------- src/mesa/drivers/dri/r600/r700_assembler.h | 4 - 2 files changed, 2 insertions(+), 303 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index caccedabdf4..dd1199756de 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2477,260 +2477,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) return GL_TRUE; } -#if 0 -GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) -{ - R700ALUInstruction * alu_instruction_ptr; - R700ALUInstructionHalfLiteral * alu_instruction_ptr_hl; - R700ALUInstructionFullLiteral * alu_instruction_ptr_fl; - - GLuint number_of_scalar_operations; - GLboolean is_single_scalar_operation; - GLuint scalar_channel_index; - - GLuint contiguous_slots_needed; - GLuint lastInstruction; - GLuint not_masked[4]; - - GLuint uNumSrc = r700GetNumOperands(pAsm); - - GLboolean bSplitInst = GL_FALSE; - - number_of_scalar_operations = 0; - contiguous_slots_needed = 0; - - if(1 == pAsm->D.dst.writew) - { - lastInstruction = 3; - number_of_scalar_operations++; - not_masked[3] = 1; - } - else - { - not_masked[3] = 0; - } - if(1 == pAsm->D.dst.writez) - { - lastInstruction = 2; - number_of_scalar_operations++; - not_masked[2] = 1; - } - else - { - not_masked[2] = 0; - } - if(1 == pAsm->D.dst.writey) - { - lastInstruction = 1; - number_of_scalar_operations++; - not_masked[1] = 1; - } - else - { - not_masked[1] = 0; - } - if(1 == pAsm->D.dst.writex) - { - lastInstruction = 0; - number_of_scalar_operations++; - not_masked[0] = 1; - } - else - { - not_masked[0] = 0; - } - - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) - { - contiguous_slots_needed = 4; - } - else - { - contiguous_slots_needed = number_of_scalar_operations; - } - - if(1 == pAsm->D2.dst2.literal) - { - contiguous_slots_needed += 1; - } - else if(2 == pAsm->D2.dst2.literal) - { - contiguous_slots_needed += 2; - } - - initialize(pAsm); - - for (scalar_channel_index=0; scalar_channel_index < 4; scalar_channel_index++) - { - if(0 == not_masked[scalar_channel_index]) - { - continue; - } - - if(scalar_channel_index == lastInstruction) - { - switch (pAsm->D2.dst2.literal) - { - case 0: - alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - break; - case 1: - alu_instruction_ptr_hl = (R700ALUInstructionHalfLiteral*) CALLOC_STRUCT(R700ALUInstructionHalfLiteral); - if (alu_instruction_ptr_hl == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstructionHalfLiteral(alu_instruction_ptr_hl, pLiteral[0], pLiteral[1]); - alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_hl; - break; - case 2: - alu_instruction_ptr_fl = (R700ALUInstructionFullLiteral*) CALLOC_STRUCT(R700ALUInstructionFullLiteral); - if (alu_instruction_ptr_fl == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstructionFullLiteral(alu_instruction_ptr_fl, pLiteral[0], pLiteral[1], pLiteral[2], pLiteral[3]); - alu_instruction_ptr = (R700ALUInstruction*)alu_instruction_ptr_fl; - break; - default: - break; - }; - } - else - { - alu_instruction_ptr = (R700ALUInstruction*) CALLOC_STRUCT(R700ALUInstruction); - if (alu_instruction_ptr == NULL) - { - return GL_FALSE; - } - Init_R700ALUInstruction(alu_instruction_ptr); - } - - //src 0 - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 0, - &(pAsm->S[0].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - - if (uNumSrc > 1) - { - // Process source 1 - if (GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 1, - &(pAsm->S[1].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - } - - //other bits - alu_instruction_ptr->m_Word0.f.index_mode = SQ_INDEX_LOOP; - - if(scalar_channel_index == lastInstruction) - { - alu_instruction_ptr->m_Word0.f.last = 1; - } - - alu_instruction_ptr->m_Word0.f.pred_sel = 0x0; - if(1 == pAsm->D.dst.predicated) - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0x1; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0x1; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.update_pred = 0; - alu_instruction_ptr->m_Word1_OP2.f.update_execute_mask = 0; - } - - // dst - if( (pAsm->D.dst.rtype == DST_REG_TEMPORARY) || - (pAsm->D.dst.rtype == DST_REG_OUT) ) - { - alu_instruction_ptr->m_Word1.f.dst_gpr = pAsm->D.dst.reg; - } - else - { - radeon_error("Only temp destination registers supported for ALU dest regs.\n"); - return GL_FALSE; - } - - alu_instruction_ptr->m_Word1.f.dst_rel = SQ_ABSOLUTE; //D.rtype - - alu_instruction_ptr->m_Word1.f.dst_chan = scalar_channel_index; - - alu_instruction_ptr->m_Word1.f.clamp = pAsm->D2.dst2.SaturateMode; - - if (pAsm->D.dst.op3) - { - //op3 - alu_instruction_ptr->m_Word1_OP3.f.alu_inst = pAsm->D.dst.opcode; - - //There's 3rd src for op3 - if ( GL_FALSE == assemble_alu_src(alu_instruction_ptr, - 2, - &(pAsm->S[2].src), - scalar_channel_index) ) - { - return GL_FALSE; - } - } - else - { - //op2 - if (pAsm->bR6xx) - { - alu_instruction_ptr->m_Word1_OP2.f6.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f6.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.src1_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f6.write_mask = 1; - alu_instruction_ptr->m_Word1_OP2.f6.omod = SQ_ALU_OMOD_OFF; - } - else - { - alu_instruction_ptr->m_Word1_OP2.f.alu_inst = pAsm->D.dst.opcode; - alu_instruction_ptr->m_Word1_OP2.f.src0_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.src1_abs = 0x0; - alu_instruction_ptr->m_Word1_OP2.f.write_mask = 1; - alu_instruction_ptr->m_Word1_OP2.f.omod = SQ_ALU_OMOD_OFF; - } - } - - if(GL_FALSE == add_alu_instruction(pAsm, alu_instruction_ptr, contiguous_slots_needed) ) - { - return GL_FALSE; - } - - if (1 == number_of_scalar_operations) - { - if(GL_FALSE == check_scalar(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - else - { - if(GL_FALSE == check_vector(pAsm, alu_instruction_ptr) ) - { - return GL_FALSE; - } - } - contiguous_slots_needed -= 2; - } - - return GL_TRUE; -} -#endif GLboolean next_ins(r700_AssemblerBase *pAsm) { struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); @@ -2787,29 +2534,6 @@ GLboolean next_ins(r700_AssemblerBase *pAsm) return GL_TRUE; } -#if 0/* not work yet */ -GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral) -{ - struct prog_instruction *pILInst = &(pAsm->pILInst[pAsm->uiCurInst]); - - //ALU - if( GL_FALSE == assemble_alu_instruction_literal(pAsm, pLiteral) ) - { - radeon_error("Error assembling ALU instruction\n"); - return GL_FALSE; - } - - //reset for next inst. - pAsm->D.bits = 0; - pAsm->D2.bits = 0; - pAsm->S[0].bits = 0; - pAsm->S[1].bits = 0; - pAsm->S[2].bits = 0; - pAsm->is_tex = GL_FALSE; - pAsm->need_tex_barrier = GL_FALSE; - return GL_TRUE; -} -#endif GLboolean assemble_math_function(r700_AssemblerBase* pAsm, BITS opcode) { BITS tmp; @@ -4533,8 +4257,6 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); pAsm->D.dst.rtype = DST_REG_TEMPORARY; pAsm->D.dst.reg = tmp2; - pAsm->D2.dst2.literal_slots = 1; - pAsm->C[0].f = 1.5F; setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; @@ -4546,33 +4268,14 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_Z); setaddrmode_PVSSRC(&(pAsm->S[2].src), ADDR_ABSOLUTE); /* immediate c 1.5 */ + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1.5F; pAsm->S[2].src.rtype = SRC_REC_LITERAL; pAsm->S[2].src.reg = tmp1; setswizzle_PVSSRC(&(pAsm->S[2].src), SQ_SEL_X); next_ins(pAsm); -#if 0 - /* ADD the remaining .5 */ - pAsm->D.dst.opcode = SQ_OP2_INST_ADD; - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp2; - pAsm->D.dst.writex = 1; - pAsm->D.dst.writey = 1; - pAsm->D.dst.writez = 0; - pAsm->D.dst.writew = 0; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp2; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - setaddrmode_PVSSRC(&(pAsm->S[1].src), ADDR_ABSOLUTE); - pAsm->S[1].src.rtype = SRC_REG_TEMPORARY; - pAsm->S[1].src.reg = 252; // SQ_ALU_SRC_0_5 - noswizzle_PVSSRC(&(pAsm->S[1].src)); - - next_ins(pAsm); -#endif /* tmp1.xy = temp2.xy */ pAsm->D.dst.opcode = SQ_OP2_INST_MOV; setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index f83206b726f..6dc44017eb1 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -531,10 +531,6 @@ GLboolean check_vector(r700_AssemblerBase* pAsm, GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm); GLboolean next_ins(r700_AssemblerBase *pAsm); -/* TODO : merge next_ins/literal, assemble_alu_instruction/literal */ -GLboolean next_ins_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); -GLboolean assemble_alu_instruction_literal(r700_AssemblerBase *pAsm, GLfloat * pLiteral); - GLboolean pops(r700_AssemblerBase *pAsm, GLuint pops); GLboolean jumpToOffest(r700_AssemblerBase *pAsm, GLuint pops, GLint offset); GLboolean setRetInLoopFlag(r700_AssemblerBase *pAsm, GLuint flagValue); -- cgit v1.2.3 From 629a648b059d8a2653b6a9cdf7f460533de0e1da Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 7 Dec 2009 17:22:03 +0200 Subject: r600: and finally fix SCS --- src/mesa/drivers/dri/r600/r700_assembler.c | 97 ++++++++++++++---------------- 1 file changed, 46 insertions(+), 51 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index dd1199756de..aed84fc3bd3 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -2237,7 +2237,7 @@ GLboolean assemble_alu_instruction(r700_AssemblerBase *pAsm) contiguous_slots_needed = 0; - if(GL_TRUE == is_reduction_opcode(&(pAsm->D)) ) + if(!is_single_scalar_operation) { contiguous_slots_needed = 4; } @@ -3920,68 +3920,63 @@ GLboolean assemble_SCS(r700_AssemblerBase *pAsm) { BITS tmp; - checkop1(pAsm); - - tmp = gethelpr(pAsm); - - // COS tmp.x, a.x - pAsm->D.dst.opcode = SQ_OP2_INST_COS; - pAsm->D.dst.math = 1; + checkop1(pAsm); - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - pAsm->D.dst.writex = 1; + tmp = gethelpr(pAsm); + /* tmp.x = src /2*PI */ + pAsm->D.dst.opcode = SQ_OP2_INST_MUL; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = tmp; + pAsm->D.dst.writex = 1; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + assemble_src(pAsm, 0, -1); - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + pAsm->S[1].src.rtype = SRC_REC_LITERAL; + setswizzle_PVSSRC(&(pAsm->S[1].src), SQ_SEL_X); + pAsm->D2.dst2.literal_slots = 1; + pAsm->C[0].f = 1/(3.1415926535 * 2); + pAsm->C[1].f = 0.0F; - // SIN tmp.y, a.x - pAsm->D.dst.opcode = SQ_OP2_INST_SIN; - pAsm->D.dst.math = 1; + next_ins(pAsm); - setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); - pAsm->D.dst.rtype = DST_REG_TEMPORARY; - pAsm->D.dst.reg = tmp; - pAsm->D.dst.writey = 1; + // COS dst.x, a.x + pAsm->D.dst.opcode = SQ_OP2_INST_COS; + pAsm->D.dst.math = 1; - if( GL_FALSE == assemble_src(pAsm, 0, -1) ) - { - return GL_FALSE; - } + assemble_dst(pAsm); + /* mask y */ + pAsm->D.dst.writey = 0; - if( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); - // MOV dst.mask, tmp - pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + if ( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } - if( GL_FALSE == assemble_dst(pAsm) ) - { - return GL_FALSE; - } + // SIN dst.y, a.x + pAsm->D.dst.opcode = SQ_OP2_INST_SIN; + pAsm->D.dst.math = 1; - setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); - pAsm->S[0].src.rtype = DST_REG_TEMPORARY; - pAsm->S[0].src.reg = tmp; + assemble_dst(pAsm); + /* mask x */ + pAsm->D.dst.writex = 0; - noswizzle_PVSSRC(&(pAsm->S[0].src)); - pAsm->S[0].src.swizzlez = SQ_SEL_0; - pAsm->S[0].src.swizzlew = SQ_SEL_0; + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = tmp; + setswizzle_PVSSRC(&(pAsm->S[0].src), SQ_SEL_X); + noneg_PVSSRC(&(pAsm->S[0].src)); - if ( GL_FALSE == next_ins(pAsm) ) - { - return GL_FALSE; - } + if( GL_FALSE == next_ins(pAsm) ) + { + return GL_FALSE; + } return GL_TRUE; } -- cgit v1.2.3 From bc7567d9665924650c43c661d07ae9a922554bee Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 7 Dec 2009 14:12:28 -0700 Subject: tgsi: fix some off-by-one errors in shader length, instruction length The ureg and/or tgsi-simplification work introduced some inconsistencies between the ureg and traditional TGSI construction code. Now the tgsi_instruction::NrTokens field is consistant and the tgsi_header::BodySize field isn't off by one. Fixes bug 25455. --- src/gallium/auxiliary/tgsi/tgsi_build.c | 2 +- src/gallium/auxiliary/tgsi/tgsi_parse.c | 5 ++--- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 2 +- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index d75ab1b3ff9..4092f78f4a2 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -399,7 +399,7 @@ tgsi_default_instruction( void ) struct tgsi_instruction instruction; instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION; - instruction.NrTokens = 1; + instruction.NrTokens = 0; instruction.Opcode = TGSI_OPCODE_MOV; instruction.Saturate = TGSI_SAT_NONE; instruction.Predicate = 0; diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c index 356b4473d96..8f2b6a307d3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.c +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c @@ -60,7 +60,7 @@ tgsi_parse_end_of_tokens( struct tgsi_parse_context *ctx ) { return ctx->Position >= - 1 + ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize; + ctx->FullHeader.Header.HeaderSize + ctx->FullHeader.Header.BodySize; } @@ -232,8 +232,7 @@ tgsi_num_tokens(const struct tgsi_token *tokens) struct tgsi_parse_context ctx; if (tgsi_parse_init(&ctx, tokens) == TGSI_PARSE_OK) { unsigned len = (ctx.FullHeader.Header.HeaderSize + - ctx.FullHeader.Header.BodySize + - 1); + ctx.FullHeader.Header.BodySize); return len; } return 0; diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 8f0b9842ff1..3f943845f5b 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -1053,7 +1053,7 @@ fixup_header_size(struct ureg_program *ureg) { union tgsi_any_token *out = retrieve_token( ureg, DOMAIN_DECL, 0 ); - out->header.BodySize = ureg->domain[DOMAIN_DECL].count - 3; + out->header.BodySize = ureg->domain[DOMAIN_DECL].count - 2; } -- cgit v1.2.3 From ee1720b99dfb5964962f2346406a4e3e88374a68 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Dec 2009 19:13:48 +0100 Subject: gallium: fix more potential strict aliasing issues In particular, gcc man page warns that union a_union { int i; double d; }; int f() { double d = 3.0; return ((union a_union *) &d)->i; } "might" not be ok (why not?), even though it doesn't seem to generate any warnings. Hence don't use this and do the extra step to actually use assignment to get the values in/out of the union. This changes parts of 3456f9149b3009fcfce80054759d05883d3c4ee5. --- src/gallium/drivers/r300/r300_state.c | 10 +- src/gallium/drivers/svga/svga_pipe_sampler.c | 5 +- src/gallium/state_trackers/vega/vg_translate.c | 190 ++++++++++++++++++------- src/mesa/state_tracker/st_atom_pixeltransfer.c | 4 +- 4 files changed, 148 insertions(+), 61 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 4ddbb357b6e..a83075df92f 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -151,9 +151,10 @@ static void r300_set_blend_color(struct pipe_context* pipe, const struct pipe_blend_color* color) { struct r300_context* r300 = r300_context(pipe); + union util_color uc; - util_pack_color(color->color, PIPE_FORMAT_A8R8G8B8_UNORM, - (union util_color *)&r300->blend_color_state->blend_color); + util_pack_color(color->color, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); + r300->blend_color_state->blend_color = uc.ui; /* XXX if FP16 blending is enabled, we should use the FP16 format */ r300->blend_color_state->blend_color_red_alpha = @@ -513,6 +514,7 @@ static void* struct r300_context* r300 = r300_context(pipe); struct r300_sampler_state* sampler = CALLOC_STRUCT(r300_sampler_state); int lod_bias; + union util_color uc; sampler->filter0 |= (r300_translate_wrap(state->wrap_s) << R300_TX_WRAP_S_SHIFT) | @@ -534,8 +536,8 @@ static void* sampler->filter1 |= r300_anisotropy(state->max_anisotropy); - util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM, - (union util_color *)&sampler->border_color); + util_pack_color(state->border_color, PIPE_FORMAT_A8R8G8B8_UNORM, &uc); + sampler->border_color = uc.ui; /* R500-specific fixups and optimizations */ if (r300_screen(r300->context.screen)->caps->is_r500) { diff --git a/src/gallium/drivers/svga/svga_pipe_sampler.c b/src/gallium/drivers/svga/svga_pipe_sampler.c index 7f530083d6b..78053e755e2 100644 --- a/src/gallium/drivers/svga/svga_pipe_sampler.c +++ b/src/gallium/drivers/svga/svga_pipe_sampler.c @@ -101,6 +101,7 @@ svga_create_sampler_state(struct pipe_context *pipe, { struct svga_context *svga = svga_context(pipe); struct svga_sampler_state *cso = CALLOC_STRUCT( svga_sampler_state ); + union util_color uc; cso->mipfilter = translate_mip_filter(sampler->min_mip_filter); cso->magfilter = translate_img_filter( sampler->mag_img_filter ); @@ -121,8 +122,8 @@ svga_create_sampler_state(struct pipe_context *pipe, ubyte a = float_to_ubyte(sampler->border_color[3]); util_pack_color_ub( r, g, b, a, - PIPE_FORMAT_B8G8R8A8_UNORM, - (union util_color *)&cso->bordercolor ); + PIPE_FORMAT_B8G8R8A8_UNORM, &uc); + cso->bordercolor = uc.ui; } /* No SVGA3D support for: diff --git a/src/gallium/state_trackers/vega/vg_translate.c b/src/gallium/state_trackers/vega/vg_translate.c index 5051d83831d..03575ca3ddd 100644 --- a/src/gallium/state_trackers/vega/vg_translate.c +++ b/src/gallium/state_trackers/vega/vg_translate.c @@ -474,6 +474,7 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, VGfloat rgba[][4]) { VGint i; + union util_color uc; switch (dataFormat) { case VG_sRGBX_8888: { @@ -486,8 +487,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -502,8 +506,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -519,8 +526,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -536,8 +546,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = ((*src >> 0) & 31)/31.; clr[3] = 1.f; - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -552,8 +565,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = ((*src >> 1) & 31)/31.; clr[3] = ((*src >> 0) & 1)/1.; - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -568,8 +584,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = ((*src >> 4) & 15)/15.; clr[3] = ((*src >> 0) & 15)/15.; - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -578,8 +597,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, VGubyte *src = (VGubyte *)data; src += offset; for (i = 0; i < n; ++i) { - util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -594,8 +616,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -610,8 +635,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -627,8 +655,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, b = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -638,8 +669,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, VGubyte *src = (VGubyte *)data; src += offset; for (i = 0; i < n; ++i) { - util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -648,8 +682,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, VGubyte *src = (VGubyte *)data; src += offset; for (i = 0; i < n; ++i) { - util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(0xff, 0xff, 0xff, *src, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } } @@ -667,8 +704,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = clr[0]; clr[3] = 1.f; - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i+j]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i+j][0] = uc.f[0]; + rgba[i+j][1] = uc.f[1]; + rgba[i+j][2] = uc.f[2]; + rgba[i+j][3] = uc.f[3]; } ++src; } @@ -688,8 +728,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = 0.f; clr[3] = (((*src) & (1<> shift); - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i+j]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i+j][0] = uc.f[0]; + rgba[i+j][1] = uc.f[1]; + rgba[i+j][2] = uc.f[2]; + rgba[i+j][3] = uc.f[3]; } ++src; } @@ -715,8 +758,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, clr[2] = 0.f; clr[3] = ((*src) & (bitter)) >> shift; - util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i +j]); + util_pack_color(clr, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i+j][0] = uc.f[0]; + rgba[i+j][1] = uc.f[1]; + rgba[i+j][2] = uc.f[2]; + rgba[i+j][3] = uc.f[3]; } ++src; } @@ -735,8 +781,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; b = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -752,8 +801,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; b = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -775,8 +827,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; b = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -792,8 +847,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; b = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -811,8 +869,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -828,8 +889,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -853,8 +917,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -870,8 +937,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, r = (*src >> 8) & 0xff; a = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -889,8 +959,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; r = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -906,8 +979,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; r = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -929,8 +1005,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; r = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; @@ -946,8 +1025,11 @@ void _vega_unpack_float_span_rgba(struct vg_context *ctx, g = (*src >> 8) & 0xff; r = (*src >> 0) & 0xff; - util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, - (union util_color *)rgba[i]); + util_pack_color_ub(r, g, b, a, PIPE_FORMAT_R32G32B32A32_FLOAT, &uc); + rgba[i][0] = uc.f[0]; + rgba[i][1] = uc.f[1]; + rgba[i][2] = uc.f[2]; + rgba[i][3] = uc.f[3]; ++src; } return; diff --git a/src/mesa/state_tracker/st_atom_pixeltransfer.c b/src/mesa/state_tracker/st_atom_pixeltransfer.c index 5e2ae1bb36f..6a5854e9ba5 100644 --- a/src/mesa/state_tracker/st_atom_pixeltransfer.c +++ b/src/mesa/state_tracker/st_atom_pixeltransfer.c @@ -162,12 +162,14 @@ load_color_map_texture(GLcontext *ctx, struct pipe_texture *pt) */ for (i = 0; i < texSize; i++) { for (j = 0; j < texSize; j++) { + union util_color uc; int k = (i * texSize + j); ubyte r = ctx->PixelMaps.RtoR.Map8[j * rSize / texSize]; ubyte g = ctx->PixelMaps.GtoG.Map8[i * gSize / texSize]; ubyte b = ctx->PixelMaps.BtoB.Map8[j * bSize / texSize]; ubyte a = ctx->PixelMaps.AtoA.Map8[i * aSize / texSize]; - util_pack_color_ub(r, g, b, a, pt->format, (union util_color *)(dest + k)); + util_pack_color_ub(r, g, b, a, pt->format, &uc); + *(dest + k) = uc.ui; } } -- cgit v1.2.3 From fd7a9ec7f97d540d22f546d96c3d1c808f163bba Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Dec 2009 17:42:49 +0100 Subject: gallium: use boolean instead of bool in p_refcnt.h all code in gallium should use boolean not bool --- src/gallium/include/pipe/p_refcnt.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h index f1875b6b822..e252f559006 100644 --- a/src/gallium/include/pipe/p_refcnt.h +++ b/src/gallium/include/pipe/p_refcnt.h @@ -51,7 +51,7 @@ pipe_reference_init(struct pipe_reference *reference, unsigned count) } -static INLINE bool +static INLINE boolean pipe_is_referenced(struct pipe_reference *reference) { return p_atomic_read(&reference->count) != 0; @@ -63,10 +63,10 @@ pipe_is_referenced(struct pipe_reference *reference) * The old thing pointed to, if any, will be unreferenced. * Both 'ptr' and 'reference' may be NULL. */ -static INLINE bool +static INLINE boolean pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) { - bool destroy = FALSE; + boolean destroy = FALSE; if(ptr != reference) { /* bump the reference.count first */ -- cgit v1.2.3 From 849a0644ada6ed7c3576babc3b348bee227118ff Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Dec 2009 17:44:51 +0100 Subject: cell: use boolean instead of bool --- src/gallium/drivers/cell/ppu/cell_gen_fp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/cell/ppu/cell_gen_fp.c b/src/gallium/drivers/cell/ppu/cell_gen_fp.c index 1895a7940c4..1d8a11a4ac9 100644 --- a/src/gallium/drivers/cell/ppu/cell_gen_fp.c +++ b/src/gallium/drivers/cell/ppu/cell_gen_fp.c @@ -995,7 +995,7 @@ static boolean emit_inequality(struct codegen *gen, const struct tgsi_full_instruction *inst) { int ch, s1_reg[4], s2_reg[4], d_reg[4], one_reg; - bool complement = FALSE; + boolean complement = FALSE; one_reg = get_const_one_reg(gen); -- cgit v1.2.3 From 47c780180b888e115b630cd940fe9c29dd53b4c5 Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Tue, 8 Dec 2009 17:51:19 +0100 Subject: nouveau: use boolean instead of bool --- src/gallium/drivers/nv04/nv04_transfer.c | 2 +- src/gallium/drivers/nv10/nv10_transfer.c | 2 +- src/gallium/drivers/nv20/nv20_transfer.c | 2 +- src/gallium/drivers/nv30/nv30_transfer.c | 2 +- src/gallium/drivers/nv40/nv40_transfer.c | 2 +- src/gallium/drivers/nv50/nv50_context.h | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/gallium/drivers/nv04/nv04_transfer.c b/src/gallium/drivers/nv04/nv04_transfer.c index e8ff686b4ab..d66d6c6346c 100644 --- a/src/gallium/drivers/nv04/nv04_transfer.c +++ b/src/gallium/drivers/nv04/nv04_transfer.c @@ -11,7 +11,7 @@ struct nv04_transfer { struct pipe_transfer base; struct pipe_surface *surface; - bool direct; + boolean direct; }; static void diff --git a/src/gallium/drivers/nv10/nv10_transfer.c b/src/gallium/drivers/nv10/nv10_transfer.c index 9e44d37367f..06bb5134173 100644 --- a/src/gallium/drivers/nv10/nv10_transfer.c +++ b/src/gallium/drivers/nv10/nv10_transfer.c @@ -11,7 +11,7 @@ struct nv10_transfer { struct pipe_transfer base; struct pipe_surface *surface; - bool direct; + boolean direct; }; static void diff --git a/src/gallium/drivers/nv20/nv20_transfer.c b/src/gallium/drivers/nv20/nv20_transfer.c index f2e0a34db9f..26a73c5143a 100644 --- a/src/gallium/drivers/nv20/nv20_transfer.c +++ b/src/gallium/drivers/nv20/nv20_transfer.c @@ -11,7 +11,7 @@ struct nv20_transfer { struct pipe_transfer base; struct pipe_surface *surface; - bool direct; + boolean direct; }; static void diff --git a/src/gallium/drivers/nv30/nv30_transfer.c b/src/gallium/drivers/nv30/nv30_transfer.c index c8c3bd1f177..e29bfbd3efd 100644 --- a/src/gallium/drivers/nv30/nv30_transfer.c +++ b/src/gallium/drivers/nv30/nv30_transfer.c @@ -11,7 +11,7 @@ struct nv30_transfer { struct pipe_transfer base; struct pipe_surface *surface; - bool direct; + boolean direct; }; static void diff --git a/src/gallium/drivers/nv40/nv40_transfer.c b/src/gallium/drivers/nv40/nv40_transfer.c index 1ee5cf39e01..ed5be1cf879 100644 --- a/src/gallium/drivers/nv40/nv40_transfer.c +++ b/src/gallium/drivers/nv40/nv40_transfer.c @@ -11,7 +11,7 @@ struct nv40_transfer { struct pipe_transfer base; struct pipe_surface *surface; - bool direct; + boolean direct; }; static void diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 4b0f0622953..79135f2f362 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -65,7 +65,7 @@ struct nv50_rasterizer_stateobj { }; struct nv50_sampler_stateobj { - bool normalized; + boolean normalized; unsigned tsc[8]; }; -- cgit v1.2.3 From 54b0ed8360019fc6e0234c2c3413be40fe4d3b59 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Tue, 8 Dec 2009 15:03:15 -0700 Subject: vbo: fix array index out of bounds error, and fix evaluator priorities Fixes bug 25525. Plus, the GL_NV_vertex_program evaluators alias and override the convential evaluator maps, so set their state after the conventional maps. --- src/mesa/vbo/vbo_exec_eval.c | 33 +++++++++++++++++++++------------ 1 file changed, 21 insertions(+), 12 deletions(-) diff --git a/src/mesa/vbo/vbo_exec_eval.c b/src/mesa/vbo/vbo_exec_eval.c index 0c691b3a5cd..a7846213d0c 100644 --- a/src/mesa/vbo/vbo_exec_eval.c +++ b/src/mesa/vbo/vbo_exec_eval.c @@ -35,17 +35,20 @@ static void clear_active_eval1( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map1)); exec->eval.map1[attr].map = NULL; } static void clear_active_eval2( struct vbo_exec_context *exec, GLuint attr ) { + assert(attr < Elements(exec->eval.map2)); exec->eval.map2[attr].map = NULL; } static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_1d_map *map ) { + assert(attr < Elements(exec->eval.map1)); if (!exec->eval.map1[attr].map) { exec->eval.map1[attr].map = map; exec->eval.map1[attr].sz = dim; @@ -55,6 +58,7 @@ static void set_active_eval1( struct vbo_exec_context *exec, GLuint attr, GLuint static void set_active_eval2( struct vbo_exec_context *exec, GLuint attr, GLuint dim, struct gl_2d_map *map ) { + assert(attr < Elements(exec->eval.map2)); if (!exec->eval.map2[attr].map) { exec->eval.map2[attr].map = map; exec->eval.map2[attr].sz = dim; @@ -73,18 +77,6 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) clear_active_eval2( exec, attr ); } - /* _NEW_PROGRAM */ - if (ctx->VertexProgram._Enabled) { - for (attr = 0; attr < VBO_ATTRIB_FIRST_MATERIAL; attr++) { - /* _NEW_EVAL */ - if (ctx->Eval.Map1Attrib[attr]) - set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); - - if (ctx->Eval.Map2Attrib[attr]) - set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); - } - } - if (ctx->Eval.Map1Color4) set_active_eval1( exec, VBO_ATTRIB_COLOR0, 4, &ctx->EvalMap.Map1Color4 ); @@ -125,6 +117,23 @@ void vbo_exec_eval_update( struct vbo_exec_context *exec ) else if (ctx->Eval.Map2Vertex3) set_active_eval2( exec, VBO_ATTRIB_POS, 3, &ctx->EvalMap.Map2Vertex3 ); + /* _NEW_PROGRAM */ + if (ctx->VertexProgram._Enabled) { + /* These are the 16 evaluators which GL_NV_vertex_program defines. + * They alias and override the conventional vertex attributs. + */ + for (attr = 0; attr < 16; attr++) { + /* _NEW_EVAL */ + assert(attr < Elements(ctx->Eval.Map1Attrib)); + if (ctx->Eval.Map1Attrib[attr]) + set_active_eval1( exec, attr, 4, &ctx->EvalMap.Map1Attrib[attr] ); + + assert(attr < Elements(ctx->Eval.Map2Attrib)); + if (ctx->Eval.Map2Attrib[attr]) + set_active_eval2( exec, attr, 4, &ctx->EvalMap.Map2Attrib[attr] ); + } + } + exec->eval.recalculate_maps = 0; } -- cgit v1.2.3 From d88f3b946804f9a3e8cad4f8896e6be488fec2b5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 14:31:38 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameterfv. _mesa_TexParameterfv calls set_tex_parameteri, which uses the params argument as an array. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4ce8c8593a9..4c1f690ff1c 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -592,8 +592,10 @@ _mesa_TexParameterfv(GLenum target, GLenum pname, const GLfloat *params) case GL_DEPTH_TEXTURE_MODE_ARB: { /* convert float param to int */ - GLint p = (GLint) params[0]; - need_update = set_tex_parameteri(ctx, texObj, pname, &p); + GLint p[4]; + p[0] = (GLint) params[0]; + p[1] = p[2] = p[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, p); } break; -- cgit v1.2.3 From a1d46fbea0b40d7edc668ea5993ea4318f37c9f9 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 15:42:13 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameterf, which uses the params argument as an array. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 4c1f690ff1c..59c518c7d25 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -644,9 +644,11 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) case GL_TEXTURE_LOD_BIAS: case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { - GLfloat fparam = (GLfloat) param; + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; /* convert int param to float */ - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + need_update = set_tex_parameterf(ctx, texObj, pname, fparam); } break; default: -- cgit v1.2.3 From 7f146b38240e1c4efa6d8d0a4e5a0c8346706de5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 16:04:33 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Fogi. _mesa_Fogi calls _mesa_Fogfv, which uses the params argument as an array. --- src/mesa/main/fog.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 4323d3db820..99eb141812e 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -41,8 +41,10 @@ _mesa_Fogf(GLenum pname, GLfloat param) void GLAPIENTRY _mesa_Fogi(GLenum pname, GLint param ) { - GLfloat fparam = (GLfloat) param; - _mesa_Fogfv(pname, &fparam); + GLfloat fparam[4]; + fparam[0] = (GLfloat) param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } -- cgit v1.2.3 From dd9eb8774ad7918187afebf8cd3be6f4b80f0f3b Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Tue, 8 Dec 2009 16:15:07 -0800 Subject: i965: Enable the accelerated ReadPixels path on gen4 along with pre-gen4. Passes piglit pbo-read-argb8888, and doesn't otherwise regress quick.tests. --- src/mesa/drivers/dri/intel/intel_pixel_read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_pixel_read.c b/src/mesa/drivers/dri/intel/intel_pixel_read.c index 47075001801..20424e2e589 100644 --- a/src/mesa/drivers/dri/intel/intel_pixel_read.c +++ b/src/mesa/drivers/dri/intel/intel_pixel_read.c @@ -285,11 +285,11 @@ intelReadPixels(GLcontext * ctx, intelFlush(ctx); -#ifdef I915 if (do_blit_readpixels (ctx, x, y, width, height, format, type, pack, pixels)) return; +#ifdef I915 if (do_texture_readpixels (ctx, x, y, width, height, format, type, pack, pixels)) return; -- cgit v1.2.3 From 3f7c2ac2798b385bed97b6931a1568a7e0223a0a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 17:25:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteri. _mesa_TexParameteri calls set_tex_parameteri, which uses the params argument as an array. --- src/mesa/main/texparam.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 59c518c7d25..1cec4b82fea 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -653,7 +653,12 @@ _mesa_TexParameteri(GLenum target, GLenum pname, GLint param) break; default: /* this will generate an error if pname is illegal */ - need_update = set_tex_parameteri(ctx, texObj, pname, ¶m); + { + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + need_update = set_tex_parameteri(ctx, texObj, pname, iparam); + } } if (ctx->Driver.TexParameter && need_update) { -- cgit v1.2.3 From d33bf38d63d233f6a09115acfff230c464d3ee29 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 17:51:07 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Fogf. _mesa_Fogf calls _mesa_Fogfv, which uses the params argument as an array. --- src/mesa/main/fog.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/fog.c b/src/mesa/main/fog.c index 99eb141812e..269ff3f8b99 100644 --- a/src/mesa/main/fog.c +++ b/src/mesa/main/fog.c @@ -34,7 +34,10 @@ void GLAPIENTRY _mesa_Fogf(GLenum pname, GLfloat param) { - _mesa_Fogfv(pname, ¶m); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Fogfv(pname, fparam); } -- cgit v1.2.3 From af16c822a5af8ce0aa7582e8ea44315b62b7356b Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Tue, 8 Dec 2009 18:26:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_LightModeli. _mesa_LightModeli calls _mesa_LightModeliv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 10c89f43688..5a8f9160f62 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -537,7 +537,10 @@ _mesa_LightModeliv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_LightModeli( GLenum pname, GLint param ) { - _mesa_LightModeliv( pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_LightModeliv( pname, iparam ); } -- cgit v1.2.3 From cd6b8dd9e82fedc55d033131fbc0f8ee950567c8 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 9 Dec 2009 10:08:07 -0800 Subject: mesa: Move OES_read_format support from drivers into the core. The assertion is that the correct read type to be using is the native type of the underlying read renderbuffer. For some fallback paths, this may be worse than GL_RGBA/GL_UNSIGNED_BYTE for reads today, but it gets all drivers the expected GL_BGRA/GL_UNSIGNED_BYTE for ARGB8888 or GL_BGR//GL_UNSIGNED_SHORT_5_6_5_REV for rgb565 with no work. This fixes the intel (and other) DRI drivers to report read formats that should hit blit PBO readpixels paths. --- src/mesa/main/context.c | 4 -- src/mesa/main/framebuffer.c | 26 ++++++++++ src/mesa/main/framebuffer.h | 5 ++ src/mesa/main/get.c | 17 ++++--- src/mesa/main/get_gen.py | 5 +- src/mesa/main/mtypes.h | 3 -- src/mesa/sources.mak | 1 - src/mesa/state_tracker/st_cb_get.c | 97 ------------------------------------- src/mesa/state_tracker/st_cb_get.h | 37 -------------- src/mesa/state_tracker/st_context.c | 2 - 10 files changed, 43 insertions(+), 154 deletions(-) delete mode 100644 src/mesa/state_tracker/st_cb_get.c delete mode 100644 src/mesa/state_tracker/st_cb_get.h diff --git a/src/mesa/main/context.c b/src/mesa/main/context.c index b5bf46718f7..87eae966392 100644 --- a/src/mesa/main/context.c +++ b/src/mesa/main/context.c @@ -564,10 +564,6 @@ _mesa_init_constants(GLcontext *ctx) /* GL_ARB_draw_buffers */ ctx->Const.MaxDrawBuffers = MAX_DRAW_BUFFERS; - /* GL_OES_read_format */ - ctx->Const.ColorReadFormat = GL_RGBA; - ctx->Const.ColorReadType = GL_UNSIGNED_BYTE; - #if FEATURE_EXT_framebuffer_object ctx->Const.MaxColorAttachments = MAX_COLOR_ATTACHMENTS; ctx->Const.MaxRenderbufferSize = MAX_WIDTH; diff --git a/src/mesa/main/framebuffer.c b/src/mesa/main/framebuffer.c index 154dedacd50..d958dbf7d48 100644 --- a/src/mesa/main/framebuffer.c +++ b/src/mesa/main/framebuffer.c @@ -969,3 +969,29 @@ _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format) /* OK */ return GL_TRUE; } + +GLenum +_mesa_get_color_read_format(GLcontext *ctx) +{ + switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { + case MESA_FORMAT_ARGB8888: + return GL_BGRA; + case MESA_FORMAT_RGB565: + return GL_BGR; + default: + return GL_RGBA; + } +} + +GLenum +_mesa_get_color_read_type(GLcontext *ctx) +{ + switch (ctx->ReadBuffer->_ColorReadBuffer->Format) { + case MESA_FORMAT_ARGB8888: + return GL_UNSIGNED_BYTE; + case MESA_FORMAT_RGB565: + return GL_UNSIGNED_SHORT_5_6_5_REV; + default: + return GL_UNSIGNED_BYTE; + } +} diff --git a/src/mesa/main/framebuffer.h b/src/mesa/main/framebuffer.h index 45a4703ba99..ef21dd98e83 100644 --- a/src/mesa/main/framebuffer.h +++ b/src/mesa/main/framebuffer.h @@ -81,5 +81,10 @@ _mesa_source_buffer_exists(GLcontext *ctx, GLenum format); extern GLboolean _mesa_dest_buffer_exists(GLcontext *ctx, GLenum format); +extern GLenum +_mesa_get_color_read_type(GLcontext *ctx); + +extern GLenum +_mesa_get_color_read_format(GLcontext *ctx); #endif /* FRAMEBUFFER_H */ diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c index 6c5ce029135..3f6b03c88ae 100644 --- a/src/mesa/main/get.c +++ b/src/mesa/main/get.c @@ -13,6 +13,7 @@ #include "mtypes.h" #include "state.h" #include "texcompress.h" +#include "framebuffer.h" #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) @@ -1767,11 +1768,11 @@ _mesa_GetBooleanv( GLenum pname, GLboolean *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadType); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetBooleanv"); - params[0] = INT_TO_BOOLEAN(ctx->Const.ColorReadFormat); + params[0] = INT_TO_BOOLEAN(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetBooleanv"); @@ -3602,11 +3603,11 @@ _mesa_GetFloatv( GLenum pname, GLfloat *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadType); + params[0] = (GLfloat)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetFloatv"); - params[0] = (GLfloat)(ctx->Const.ColorReadFormat); + params[0] = (GLfloat)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetFloatv"); @@ -5437,11 +5438,11 @@ _mesa_GetIntegerv( GLenum pname, GLint *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadType; + params[0] = _mesa_get_color_read_type(ctx); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetIntegerv"); - params[0] = ctx->Const.ColorReadFormat; + params[0] = _mesa_get_color_read_format(ctx); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetIntegerv"); @@ -7273,11 +7274,11 @@ _mesa_GetInteger64v( GLenum pname, GLint64 *params ) break; case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadType); + params[0] = (GLint64)(_mesa_get_color_read_type(ctx)); break; case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: CHECK_EXT1(OES_read_format, "GetInteger64v"); - params[0] = (GLint64)(ctx->Const.ColorReadFormat); + params[0] = (GLint64)(_mesa_get_color_read_format(ctx)); break; case GL_NUM_FRAGMENT_REGISTERS_ATI: CHECK_EXT1(ATI_fragment_shader, "GetInteger64v"); diff --git a/src/mesa/main/get_gen.py b/src/mesa/main/get_gen.py index 930c3362fae..697c4cfd92e 100644 --- a/src/mesa/main/get_gen.py +++ b/src/mesa/main/get_gen.py @@ -942,9 +942,9 @@ StateVars = [ # GL_OES_read_format ( "GL_IMPLEMENTATION_COLOR_READ_TYPE_OES", GLint, - ["ctx->Const.ColorReadType"], "", ["OES_read_format"] ), + ["_mesa_get_color_read_type(ctx)"], "", ["OES_read_format"] ), ( "GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES", GLint, - ["ctx->Const.ColorReadFormat"], "", ["OES_read_format"] ), + ["_mesa_get_color_read_format(ctx)"], "", ["OES_read_format"] ), # GL_ATI_fragment_shader ( "GL_NUM_FRAGMENT_REGISTERS_ATI", GLint, ["6"], "", ["ATI_fragment_shader"] ), @@ -1159,6 +1159,7 @@ def EmitHeader(): #include "mtypes.h" #include "state.h" #include "texcompress.h" +#include "framebuffer.h" #define FLOAT_TO_BOOLEAN(X) ( (X) ? GL_TRUE : GL_FALSE ) diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h index 881d233ca3d..cde2f5fe061 100644 --- a/src/mesa/main/mtypes.h +++ b/src/mesa/main/mtypes.h @@ -2355,9 +2355,6 @@ struct gl_constants GLuint MaxDrawBuffers; /**< GL_ARB_draw_buffers */ - GLenum ColorReadFormat; /**< GL_OES_read_format */ - GLenum ColorReadType; /**< GL_OES_read_format */ - GLuint MaxColorAttachments; /**< GL_EXT_framebuffer_object */ GLuint MaxRenderbufferSize; /**< GL_EXT_framebuffer_object */ GLuint MaxSamples; /**< GL_ARB_framebuffer_object */ diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 615a5588eae..a0d7dbbace9 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -191,7 +191,6 @@ STATETRACKER_SOURCES = \ state_tracker/st_cb_bufferobjects.c \ state_tracker/st_cb_clear.c \ state_tracker/st_cb_flush.c \ - state_tracker/st_cb_get.c \ state_tracker/st_cb_drawpixels.c \ state_tracker/st_cb_fbo.c \ state_tracker/st_cb_feedback.c \ diff --git a/src/mesa/state_tracker/st_cb_get.c b/src/mesa/state_tracker/st_cb_get.c deleted file mode 100644 index e7d7f03bc9b..00000000000 --- a/src/mesa/state_tracker/st_cb_get.c +++ /dev/null @@ -1,97 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -/** - * glGet functions - * - * \author Brian Paul - */ - -#include "main/imports.h" -#include "main/context.h" - -#include "pipe/p_defines.h" - -#include "st_cb_fbo.h" -#include "st_cb_get.h" - - - -/** - * Examine the current color read buffer format to determine - * which GL pixel format/type combo is the best match. - */ -static void -get_preferred_read_format_type(GLcontext *ctx, GLint *format, GLint *type) -{ - struct gl_framebuffer *fb = ctx->ReadBuffer; - struct st_renderbuffer *strb = st_renderbuffer(fb->_ColorReadBuffer); - - /* defaults */ - *format = ctx->Const.ColorReadFormat; - *type = ctx->Const.ColorReadType; - - if (strb) { - /* XXX could add more cases here... */ - if (strb->format == PIPE_FORMAT_A8R8G8B8_UNORM) { - *format = GL_BGRA; - if (_mesa_little_endian()) - *type = GL_UNSIGNED_INT_8_8_8_8_REV; - else - *type = GL_UNSIGNED_INT_8_8_8_8; - } - } -} - - -/** - * We only intercept the OES preferred ReadPixels format/type. - * Everything else goes to the default _mesa_GetIntegerv. - */ -static GLboolean -st_GetIntegerv(GLcontext *ctx, GLenum pname, GLint *params) -{ - GLint dummy; - - switch (pname) { - case GL_IMPLEMENTATION_COLOR_READ_TYPE_OES: - get_preferred_read_format_type(ctx, &dummy, params); - return GL_TRUE; - case GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES: - get_preferred_read_format_type(ctx, params, &dummy); - return GL_TRUE; - default: - return GL_FALSE; - } -} - - -void st_init_get_functions(struct dd_function_table *functions) -{ - functions->GetIntegerv = st_GetIntegerv; -} diff --git a/src/mesa/state_tracker/st_cb_get.h b/src/mesa/state_tracker/st_cb_get.h deleted file mode 100644 index 8e9f3e93060..00000000000 --- a/src/mesa/state_tracker/st_cb_get.h +++ /dev/null @@ -1,37 +0,0 @@ -/************************************************************************** - * - * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. - * All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the - * "Software"), to deal in the Software without restriction, including - * without limitation the rights to use, copy, modify, merge, publish, - * distribute, sub license, and/or sell copies of the Software, and to - * permit persons to whom the Software is furnished to do so, subject to - * the following conditions: - * - * The above copyright notice and this permission notice (including the - * next paragraph) shall be included in all copies or substantial portions - * of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. - * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR - * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, - * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE - * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - * - **************************************************************************/ - - -#ifndef ST_CB_GET_H -#define ST_CB_GET_H - - -extern void -st_init_get_functions(struct dd_function_table *functions); - - -#endif diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index f0eddafd331..d18a25ab514 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -51,7 +51,6 @@ #include "st_cb_drawtex.h" #endif #include "st_cb_fbo.h" -#include "st_cb_get.h" #if FEATURE_feedback #include "st_cb_feedback.h" #endif @@ -331,7 +330,6 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_rasterpos_functions(functions); #endif st_init_fbo_functions(functions); - st_init_get_functions(functions); #if FEATURE_feedback st_init_feedback_functions(functions); #endif -- cgit v1.2.3 From e3fa700c178e11e6735430119232919176ab7b42 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Wed, 9 Dec 2009 11:03:49 -0800 Subject: meta: Bind texture to unit 0 for mipmap generation If the active texture unit on entry to mipmap generation is not zero, bind the texture to unit zero. Fixes bug #24219. --- src/mesa/drivers/common/meta.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/mesa/drivers/common/meta.c b/src/mesa/drivers/common/meta.c index a4315191434..39b0ab13c6b 100644 --- a/src/mesa/drivers/common/meta.c +++ b/src/mesa/drivers/common/meta.c @@ -2149,6 +2149,7 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, const GLenum wrapTSave = texObj->WrapT; const GLenum wrapRSave = texObj->WrapR; const GLuint fboSave = ctx->DrawBuffer->Name; + const GLuint original_active_unit = ctx->Texture.CurrentUnit; GLenum faceTarget; GLuint dstLevel; GLuint border = 0; @@ -2288,6 +2289,9 @@ _mesa_meta_GenerateMipmap(GLcontext *ctx, GLenum target, /* texture is already locked, unlock now */ _mesa_unlock_texture(ctx, texObj); + if (original_active_unit != 0) + _mesa_BindTexture(target, texObj->Name); + for (dstLevel = baseLevel + 1; dstLevel <= maxLevel; dstLevel++) { const struct gl_texture_image *srcImage; const GLuint srcLevel = dstLevel - 1; -- cgit v1.2.3 From b7cf8a1f93ef3a81f2e8c44adca9a3990da4466d Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 8 Dec 2009 21:03:29 +0100 Subject: vmware/core: Update vmwgfx_drm.h --- src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h index 56070a1ba10..89bbf17ce99 100644 --- a/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h +++ b/src/gallium/winsys/drm/vmware/core/vmwgfx_drm.h @@ -52,14 +52,16 @@ /** * DRM_VMW_GET_PARAM - get device information. * - * Currently we support only one parameter: - * * DRM_VMW_PARAM_FIFO_OFFSET: * Offset to use to map the first page of the FIFO read-only. * The fifo is mapped using the mmap() system call on the drm device. + * + * DRM_VMW_PARAM_OVERLAY_IOCTL: + * Does the driver support the overlay ioctl. */ #define DRM_VMW_PARAM_FIFO_OFFSET 0 +#define DRM_VMW_PARAM_OVERLAY_IOCTL 1 /** * struct drm_vmw_getparam_arg -- cgit v1.2.3 From 5e2a86cb1be935f1c54efcf5b4e6a1b7371ff5e7 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Tue, 8 Dec 2009 21:05:30 +0100 Subject: vmware/xorg: Properly detect overlay support --- src/gallium/winsys/drm/vmware/xorg/vmw_driver.h | 2 ++ src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c | 31 +++++++++++++++++++++++++ src/gallium/winsys/drm/vmware/xorg/vmw_video.c | 5 ++++ 3 files changed, 38 insertions(+) diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h index 85c21ca60e3..7265f767a53 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_driver.h @@ -73,6 +73,8 @@ void vmw_video_stop_all(ScrnInfoPtr pScrn, struct vmw_driver *vmw); * vmw_ioctl.c */ +int vmw_ioctl_supports_overlay(struct vmw_driver *vmw); + int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot); struct vmw_dma_buffer * vmw_ioctl_buffer_create(struct vmw_driver *vmw, diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c index c84368bab7f..0d1a0fcee63 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_ioctl.c @@ -56,6 +56,37 @@ struct vmw_dma_buffer uint32_t size; }; +static int +vmw_ioctl_get_param(struct vmw_driver *vmw, uint32_t param, uint64_t *out) +{ + struct drm_vmw_getparam_arg gp_arg; + int ret; + + memset(&gp_arg, 0, sizeof(gp_arg)); + gp_arg.param = param; + ret = drmCommandWriteRead(vmw->fd, DRM_VMW_GET_PARAM, + &gp_arg, sizeof(gp_arg)); + + if (ret == 0) { + *out = gp_arg.value; + } + + return ret; +} + +int +vmw_ioctl_supports_overlay(struct vmw_driver *vmw) +{ + uint64_t value; + int ret; + + ret = vmw_ioctl_get_param(vmw, DRM_VMW_PARAM_OVERLAY_IOCTL, &value); + if (ret) + return ret; + + return value ? 0 : -ENOSYS; +} + int vmw_ioctl_cursor_bypass(struct vmw_driver *vmw, int xhot, int yhot) { diff --git a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c index b99bb2f7e34..5674e4f3529 100644 --- a/src/gallium/winsys/drm/vmware/xorg/vmw_video.c +++ b/src/gallium/winsys/drm/vmware/xorg/vmw_video.c @@ -276,6 +276,11 @@ vmw_video_init(ScrnInfoPtr pScrn, struct vmw_driver *vmw) debug_printf("%s: enter\n", __func__); + if (vmw_ioctl_supports_overlay(vmw) != 0) { + debug_printf("No overlay ioctl support\n"); + return FALSE; + } + numAdaptors = xf86XVListGenericAdaptors(pScrn, &overlayAdaptors); newAdaptor = vmw_video_init_adaptor(pScrn, vmw); -- cgit v1.2.3 From 33a120e4761a661736ea64a3efc2e3831ac5600a Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Wed, 9 Dec 2009 10:51:52 +0200 Subject: r600: fix state size prediction after dc0777d3 --- src/mesa/drivers/dri/r600/r700_chip.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index d8661b44397..dacc2ccc4c1 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -1134,7 +1134,11 @@ static int check_blnd(GLcontext *ctx, struct radeon_state_atom *atom) count += 3; if (context->radeon.radeonScreen->chip_family > CHIP_FAMILY_R600) { - for (ui = 0; ui < R700_MAX_RENDER_TARGETS; ui++) { + /* targets are enabled in r700SetRenderTarget but state + size is calculated before that. Until MRT's are done + hardcode target0 as enabled. */ + count += 3; + for (ui = 1; ui < R700_MAX_RENDER_TARGETS; ui++) { if (r700->render_target[ui].enabled) count += 3; } -- cgit v1.2.3 From 59f6af51b858340139fe2139e2698fef8a5ad62f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 9 Dec 2009 10:59:38 +0000 Subject: util: Document the meaning of util_format_layout. The util_format_layout name was unfortunate and there are as been a lot of confusion due to this. Hopefully this will shed some light on what it was meant for. Bottom line is: do not rely on these values unless you're automatically code generating pixel packing/unpacking routines. Suggestions for better names than util_format_layout are welcome! --- src/gallium/auxiliary/util/u_format.h | 36 +++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/src/gallium/auxiliary/util/u_format.h b/src/gallium/auxiliary/util/u_format.h index 6740683a618..19b902db983 100644 --- a/src/gallium/auxiliary/util/u_format.h +++ b/src/gallium/auxiliary/util/u_format.h @@ -33,10 +33,46 @@ #include "pipe/p_format.h" +/** + * Describe how to best pack/unpack pixels into/from the prescribed format. + * + * These are used for automatic code generation of pixel packing and unpacking + * routines (in compile time, e.g., u_format_access.py, or in runtime, like + * llvmpipe does). + * + * Thumb rule is: if you're not code generating pixel packing/unpacking then + * these are irrelevant for you. + * + * Note that this can be deduced from other values in util_format_description + * structure. This is by design, to make code generation of pixel + * packing/unpacking/sampling routines simple and efficient. + * + * XXX: This should be renamed to something like util_format_pack. + */ enum util_format_layout { + /** + * Single scalar component. + */ UTIL_FORMAT_LAYOUT_SCALAR = 0, + + /** + * One or more components of mixed integer formats, arithmetically encoded + * in a word up to 32bits. + */ UTIL_FORMAT_LAYOUT_ARITH = 1, + + /** + * One or more components, no mixed formats, each with equal power of two + * number of bytes. + */ UTIL_FORMAT_LAYOUT_ARRAY = 2, + + /** + * XXX: Not used yet. These might go away and be replaced by a single entry, + * for formats where multiple pixels have to be + * read in order to determine a single pixel value (i.e., block.width > 1 + * || block.height > 1) + */ UTIL_FORMAT_LAYOUT_YUV = 3, UTIL_FORMAT_LAYOUT_DXT = 4 }; -- cgit v1.2.3 From 3de8fff45d04fd7e702cd656ba97cafd348c3981 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Wed, 9 Dec 2009 08:30:01 -0700 Subject: mesa: fix baseLevel >= MAX_TEXTURE_LEVELS test This fixes invalid array indexing when baseLevel == MAX_TEXTURE_LEVELS. See bug 25528. --- src/mesa/main/texobj.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/texobj.c b/src/mesa/main/texobj.c index da55ac8697d..85f5f78e509 100644 --- a/src/mesa/main/texobj.c +++ b/src/mesa/main/texobj.c @@ -418,7 +418,7 @@ _mesa_test_texobj_completeness( const GLcontext *ctx, /* Detect cases where the application set the base level to an invalid * value. */ - if ((baseLevel < 0) || (baseLevel > MAX_TEXTURE_LEVELS)) { + if ((baseLevel < 0) || (baseLevel >= MAX_TEXTURE_LEVELS)) { char s[100]; _mesa_sprintf(s, "base level = %d is invalid", baseLevel); incomplete(t, s); -- cgit v1.2.3 From a082d965de228d5035e59245df528af62761652a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 11:26:24 -0800 Subject: glsl: Remove unused member x from struct slang_operation. --- src/mesa/shader/slang/slang_compile_operation.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_compile_operation.h b/src/mesa/shader/slang/slang_compile_operation.h index 58f1edeed85..1f15c198963 100644 --- a/src/mesa/shader/slang/slang_compile_operation.h +++ b/src/mesa/shader/slang/slang_compile_operation.h @@ -127,7 +127,6 @@ typedef struct slang_operation_ * indicate such. num_children indicates number of elements. */ GLboolean array_constructor; - double x; } slang_operation; -- cgit v1.2.3 From 8927b72118f9433aafd0e811cfc1981215eb3c5f Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 9 Dec 2009 15:39:16 -0500 Subject: r600 : add pre-compile mesa shader calling interface, in order to handle complex built-in shader instructions. --- src/mesa/drivers/dri/r600/r700_assembler.c | 407 +++++++++++++++++++++++++++-- src/mesa/drivers/dri/r600/r700_assembler.h | 65 ++++- src/mesa/drivers/dri/r600/r700_fragprog.c | 25 +- src/mesa/drivers/dri/r600/r700_vertprog.c | 25 +- 4 files changed, 498 insertions(+), 24 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index aed84fc3bd3..e84f5245253 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -32,6 +32,7 @@ #include "main/mtypes.h" #include "main/imports.h" +#include "shader/prog_parameter.h" #include "radeon_debug.h" #include "r600_context.h" @@ -41,6 +42,39 @@ #define USE_CF_FOR_CONTINUE_BREAK 1 #define USE_CF_FOR_POP_AFTER 1 +struct prog_instruction noise1_insts[12] = { + {OPCODE_BGNSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 2, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 0, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 4, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{8, 0, 585, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 8, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_SGT , {{0, 0, 585, 0, 0, 0}, {8, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 1, 1, 0, 8, 1672, 0}, 1, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_IF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 7, 0, 0}, 0, 0, 0, 1, 0, 0, 0, 15, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1755, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_ENDIF , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_MOV , {{0, 0, 1170, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {0, 0, 1, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_RET , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0}, + {OPCODE_ENDSUB , {{13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}, {13, 0, 1672, 0, 0, 0}}, {13, 0, 15, 0, 8, 1672, 0}, 0, 0, 0, 1, 0, 0, 0, -1, 0, 0, 0} +}; +float noise1_const[2][4] = { + {0.300000f, 0.900000f, 0.500000f, 0.300000f} +}; + +COMPILED_SUB noise1_presub = { + &(noise1_insts[0]), + 12, + 2, + 1, + 0, + &(noise1_const[0]), + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, + SWIZZLE_X, + {0,0,0}, + 0 +}; + BITS addrmode_PVSDST(PVSDST * pPVSDST) { return pPVSDST->addrmode0 | ((BITS)pPVSDST->addrmode1 << 1); @@ -330,14 +364,14 @@ GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size) return(format); } -unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) +unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3) { - if(pAsm->D.dst.op3) + if(nIsOp3 > 0) { return 3; } - switch (pAsm->D.dst.opcode) + switch (opcode) { case SQ_OP2_INST_ADD: case SQ_OP2_INST_KILLE: @@ -378,7 +412,7 @@ unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm) return 1; default: radeon_error( - "Need instruction operand number for %x.\n", pAsm->D.dst.opcode); + "Need instruction operand number for %x.\n", opcode); }; return 3; @@ -500,6 +534,11 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->unCFflags = 0; + pAsm->presubs = NULL; + pAsm->unPresubArraySize = 0; + pAsm->unNumPresub = 0; + pAsm->unCurNumILInsts = 0; + return 0; } @@ -2010,7 +2049,7 @@ GLboolean check_scalar(r700_AssemblerBase* pAsm, GLuint swizzle_key; - GLuint number_of_operands = r700GetNumOperands(pAsm); + GLuint number_of_operands = r700GetNumOperands(pAsm->D.dst.opcode, pAsm->D.dst.op3); for (src=0; srcD.dst.opcode, pAsm->D.dst.op3); for (src=0; srcD.dst.opcode, pAsm->D.dst.op3); //GLuint channel_swizzle, j; //GLuint chan_counter[4] = {0, 0, 0, 0}; //PVSSRC * pSource[3]; @@ -4968,7 +5007,7 @@ void add_return_inst(r700_AssemblerBase *pAsm) pAsm->cf_current_cf_clause_ptr->m_Word1.f.barrier = 0x1; } -GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift) { /* Put in sub */ if( (pAsm->unSubArrayPointer + 1) > pAsm->unSubArraySize ) @@ -4983,7 +5022,7 @@ GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex) pAsm->unSubArraySize += 10; } - pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex; + pAsm->subs[pAsm->unSubArrayPointer].subIL_Offset = nILindex + uiIL_Shift; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pHead=NULL; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.pTail=NULL; pAsm->subs[pAsm->unSubArrayPointer].lstCFInstructions_local.uNumOfNode=0; @@ -5074,9 +5113,13 @@ GLboolean assemble_RET(r700_AssemblerBase *pAsm) GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, + GLuint uiIL_Shift, GLuint uiNumberInsts, - struct prog_instruction *pILInst) + struct prog_instruction *pILInst, + PRESUB_DESC * pPresubDesc) { + GLint uiIL_Offset; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; if(GL_FALSE == add_cf_instruction(pAsm) ) @@ -5109,8 +5152,12 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, pAsm->unCallerArraySize += 10; } - pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = nILindex; - pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; + uiIL_Offset = nILindex + uiIL_Shift; + pAsm->callers[pAsm->unCallerArrayPointer].subIL_Offset = uiIL_Offset; + pAsm->callers[pAsm->unCallerArrayPointer].cf_ptr = pAsm->cf_current_cf_clause_ptr; + + pAsm->callers[pAsm->unCallerArrayPointer].finale_cf_ptr = NULL; + pAsm->callers[pAsm->unCallerArrayPointer].prelude_cf_ptr = NULL; pAsm->unCallerArrayPointer++; @@ -5120,7 +5167,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLboolean bRet; for(j=0; junSubArrayPointer; j++) { - if(nILindex == pAsm->subs[j].subIL_Offset) + if(uiIL_Offset == pAsm->subs[j].subIL_Offset) { /* compiled before */ max = pAsm->subs[j].unStackDepthMax @@ -5138,7 +5185,7 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, pAsm->callers[pAsm->unCallerArrayPointer - 1].subDescIndex = pAsm->unSubArrayPointer; unSubID = pAsm->unSubArrayPointer; - bRet = AssembleInstr(nILindex, uiNumberInsts, pILInst, pAsm); + bRet = AssembleInstr(nILindex, uiIL_Shift, uiNumberInsts, pILInst, pAsm); if(GL_TRUE == bRet) { @@ -5148,6 +5195,8 @@ GLboolean assemble_CAL(r700_AssemblerBase *pAsm, { pAsm->CALLSTACK[pAsm->CALLSP].max = max; } + + pAsm->subs[unSubID].pPresubDesc = pPresubDesc; } return bRet; @@ -5313,6 +5362,7 @@ GLboolean breakLoopOnFlag(r700_AssemblerBase *pAsm, GLuint unFCSP) } GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiIL_Shift, GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode) @@ -5468,6 +5518,26 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_MUL: if ( GL_FALSE == assemble_MUL(pR700AsmCode) ) return GL_FALSE; + break; + + case OPCODE_NOISE1: + { + callPreSub(pR700AsmCode, + GLSL_NOISE1, + &noise1_presub, + pILInst->DstReg.Index + pR700AsmCode->starting_temp_register_number, + 1); + radeon_error("noise1: not yet supported shader instruction\n"); + }; + break; + case OPCODE_NOISE2: + radeon_error("noise2: not yet supported shader instruction\n"); + break; + case OPCODE_NOISE3: + radeon_error("noise3: not yet supported shader instruction\n"); + break; + case OPCODE_NOISE4: + radeon_error("noise4: not yet supported shader instruction\n"); break; case OPCODE_POW: @@ -5653,7 +5723,7 @@ GLboolean AssembleInstr(GLuint uiFirstInst, break; case OPCODE_BGNSUB: - if( GL_FALSE == assemble_BGNSUB(pR700AsmCode, i) ) + if( GL_FALSE == assemble_BGNSUB(pR700AsmCode, i, uiIL_Shift) ) { return GL_FALSE; } @@ -5668,9 +5738,11 @@ GLboolean AssembleInstr(GLuint uiFirstInst, case OPCODE_CAL: if( GL_FALSE == assemble_CAL(pR700AsmCode, - pILInst[i].BranchTarget, + pILInst[i].BranchTarget, + uiIL_Shift, uiNumberInsts, - pILInst) ) + pILInst, + NULL) ) { return GL_FALSE; } @@ -5707,7 +5779,7 @@ GLboolean InitShaderProgram(r700_AssemblerBase * pAsm) return GL_TRUE; } -GLboolean RelocProgram(r700_AssemblerBase * pAsm) +GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg) { GLuint i; GLuint unCFoffset; @@ -5717,6 +5789,12 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) R700ShaderInstruction * pInst; R700ControlFlowGenericClause * pCFInst; + R700ControlFlowALUClause * pCF_ALU; + R700ALUInstruction * pALU; + GLuint unConstOffset = 0; + GLuint unRegOffset; + GLuint unMinRegIndex; + plstCFmain = pAsm->CALLSTACK[0].plstCFInstructions_local; /* remove flags init if they are not used */ @@ -5762,6 +5840,11 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) unCFoffset = plstCFmain->uNumOfNode; + if(NULL != pILProg->Parameters) + { + unConstOffset = pILProg->Parameters->NumParameters; + } + /* Reloc subs */ for(i=0; iunSubArrayPointer; i++) { @@ -5799,6 +5882,84 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) pInst = pInst->pNextInst; }; + if(NULL != pAsm->subs[i].pPresubDesc) + { + GLuint uNumSrc; + + unMinRegIndex = pAsm->subs[i].pPresubDesc->pCompiledSub->MinRegIndex; + unRegOffset = pAsm->subs[i].pPresubDesc->maxStartReg; + unConstOffset += pAsm->subs[i].pPresubDesc->unConstantsStart; + + pInst = plstCFsub->pHead; + while(pInst) + { + if(SIT_CF_ALU == pInst->m_ShaderInstType) + { + pCF_ALU = (R700ControlFlowALUClause *)pInst; + + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word1.f.dst_gpr = pALU->m_Word1.f.dst_gpr + unRegOffset - unMinRegIndex; + + if(pALU->m_Word0.f.src0_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src0_sel = pALU->m_Word0.f.src0_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src0_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src0_sel += unConstOffset; + } + + if( ((pALU->m_Word1.val >> SQ_ALU_WORD1_OP3_ALU_INST_SHIFT) & 0x0000001F) + >= SQ_OP3_INST_MUL_LIT ) + { /* op3 : 3 srcs */ + if(pALU->m_Word1_OP3.f.src2_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word1_OP3.f.src2_sel = pALU->m_Word1_OP3.f.src2_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word1_OP3.f.src2_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word1_OP3.f.src2_sel += unConstOffset; + } + if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src1_sel += unConstOffset; + } + } + else + { + if(pAsm->bR6xx) + { + uNumSrc = r700GetNumOperands(pALU->m_Word1_OP2.f6.alu_inst, 0); + } + else + { + uNumSrc = r700GetNumOperands(pALU->m_Word1_OP2.f.alu_inst, 0); + } + if(2 == uNumSrc) + { /* 2 srcs */ + if(pALU->m_Word0.f.src1_sel < SQ_ALU_SRC_GPR_SIZE) + { + pALU->m_Word0.f.src1_sel = pALU->m_Word0.f.src1_sel + unRegOffset - unMinRegIndex; + } + else if(pALU->m_Word0.f.src1_sel >= SQ_ALU_SRC_CFILE_BASE) + { + pALU->m_Word0.f.src1_sel += unConstOffset; + } + } + } + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + pInst = pInst->pNextInst; + }; + } + /* Put sub into main */ plstCFmain->pTail->pNextInst = plstCFsub->pHead; plstCFmain->pTail = plstCFsub->pTail; @@ -5812,11 +5973,216 @@ GLboolean RelocProgram(r700_AssemblerBase * pAsm) { pAsm->callers[i].cf_ptr->m_Word0.f.addr = pAsm->subs[pAsm->callers[i].subDescIndex].unCFoffset; + + if(NULL != pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc) + { + unMinRegIndex = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->pCompiledSub->MinRegIndex; + unRegOffset = pAsm->subs[pAsm->callers[i].subDescIndex].pPresubDesc->maxStartReg; + + if(NULL != pAsm->callers[i].prelude_cf_ptr) + { + pCF_ALU = (R700ControlFlowALUClause * )(pAsm->callers[i].prelude_cf_ptr); + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word1.f.dst_gpr = pALU->m_Word1.f.dst_gpr + unRegOffset - unMinRegIndex; + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + if(NULL != pAsm->callers[i].finale_cf_ptr) + { + pCF_ALU = (R700ControlFlowALUClause * )(pAsm->callers[i].finale_cf_ptr); + pALU = pCF_ALU->m_pLinkedALUInstruction; + for(int j=0; j<=pCF_ALU->m_Word1.f.count; j++) + { + pALU->m_Word0.f.src0_sel = pALU->m_Word0.f.src0_sel + unRegOffset - unMinRegIndex; + pALU = (R700ALUInstruction*)(pALU->pNextInst); + } + } + } } return GL_TRUE; } +GLboolean callPreSub(r700_AssemblerBase* pAsm, + LOADABLE_SCRIPT_SIGNITURE scriptSigniture, + COMPILED_SUB * pCompiledSub, + GLshort uOutReg, + GLshort uNumValidSrc) +{ + /* save assemble context */ + GLuint starting_temp_register_number_save; + GLuint number_used_registers_save; + GLuint uFirstHelpReg_save; + GLuint uHelpReg_save; + GLuint uiCurInst_save; + struct prog_instruction *pILInst_save; + PRESUB_DESC * pPresubDesc; + GLboolean bRet; + int i; + + R700ControlFlowGenericClause* prelude_cf_ptr = NULL; + + /* copy srcs to presub inputs */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + for(i=0; iD.dst.opcode = SQ_OP2_INST_MOV; + setaddrmode_PVSDST(&(pAsm->D.dst), ADDR_ABSOLUTE); + pAsm->D.dst.rtype = DST_REG_TEMPORARY; + pAsm->D.dst.reg = pCompiledSub->srcRegIndex[i]; + pAsm->D.dst.writex = 1; + pAsm->D.dst.writey = 1; + pAsm->D.dst.writez = 1; + pAsm->D.dst.writew = 1; + + if( GL_FALSE == assemble_src(pAsm, i, 0) ) + { + return GL_FALSE; + } + + next_ins(pAsm); + } + if(uNumValidSrc > 0) + { + prelude_cf_ptr = pAsm->cf_current_alu_clause_ptr; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + } + + /* browse thro existing presubs. */ + for(i=0; iunNumPresub; i++) + { + if(pAsm->presubs[i].sptSigniture == scriptSigniture) + { + break; + } + } + + if(i == pAsm->unNumPresub) + { /* not loaded yet */ + /* save assemble context */ + number_used_registers_save = pAsm->number_used_registers; + uFirstHelpReg_save = pAsm->uFirstHelpReg; + uHelpReg_save = pAsm->uHelpReg; + starting_temp_register_number_save = pAsm->starting_temp_register_number; + pILInst_save = pAsm->pILInst; + uiCurInst_save = pAsm->uiCurInst; + + /* alloc in presub */ + if( (pAsm->unNumPresub + 1) > pAsm->unPresubArraySize ) + { + pAsm->presubs = (PRESUB_DESC*)_mesa_realloc( (void *)pAsm->presubs, + sizeof(PRESUB_DESC) * pAsm->unPresubArraySize, + sizeof(PRESUB_DESC) * (pAsm->unPresubArraySize + 4) ); + if(NULL == pAsm->presubs) + { + radeon_error("No memeory to allocate built in shader function description structures. \n"); + return GL_FALSE; + } + pAsm->unPresubArraySize += 4; + } + + pPresubDesc = &(pAsm->presubs[i]); + pPresubDesc->sptSigniture = scriptSigniture; + + /* constants offsets need to be final resolved at reloc. */ + if(0 == pAsm->unNumPresub) + { + pPresubDesc->unConstantsStart = 0; + } + else + { + pPresubDesc->unConstantsStart = pAsm->presubs[i-1].unConstantsStart + + pAsm->presubs[i-1].pCompiledSub->NumParameters; + } + + pPresubDesc->pCompiledSub = pCompiledSub; + + pPresubDesc->subIL_Shift = pAsm->unCurNumILInsts; + pPresubDesc->maxStartReg = uFirstHelpReg_save; + pAsm->unCurNumILInsts += pCompiledSub->NumInstructions; + + pAsm->unNumPresub++; + + /* setup new assemble context */ + pAsm->starting_temp_register_number = 0; + pAsm->number_used_registers = pCompiledSub->NumTemporaries; + pAsm->uFirstHelpReg = pAsm->number_used_registers; + pAsm->uHelpReg = pAsm->uFirstHelpReg; + + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, + pCompiledSub->NumInstructions, + pCompiledSub->Instructions, + pPresubDesc); + + + pPresubDesc->number_used_registers = pAsm->number_used_registers; + + /* restore assemble context */ + pAsm->number_used_registers = number_used_registers_save; + pAsm->uFirstHelpReg = uFirstHelpReg_save; + pAsm->uHelpReg = uHelpReg_save; + pAsm->starting_temp_register_number = starting_temp_register_number_save; + pAsm->pILInst = pILInst_save; + pAsm->uiCurInst = uiCurInst_save; + } + else + { /* was loaded */ + pPresubDesc = &(pAsm->presubs[i]); + + bRet = assemble_CAL(pAsm, + 0, + pPresubDesc->subIL_Shift, + pCompiledSub->NumInstructions, + pCompiledSub->Instructions, + pPresubDesc); + } + + if(GL_FALSE == bRet) + { + radeon_error("Shader presub assemble failed. \n"); + } + else + { + /* copy presub output to real dst */ + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + pAsm->D.dst.opcode = SQ_OP2_INST_MOV; + + if( GL_FALSE == assemble_dst(pAsm) ) + { + return GL_FALSE; + } + + setaddrmode_PVSSRC(&(pAsm->S[0].src), ADDR_ABSOLUTE); + pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; + pAsm->S[0].src.reg = pCompiledSub->dstRegIndex; + pAsm->S[0].src.swizzlex = pCompiledSub->outputSwizzleX; + pAsm->S[0].src.swizzley = pCompiledSub->outputSwizzleY; + pAsm->S[0].src.swizzlez = pCompiledSub->outputSwizzleZ; + pAsm->S[0].src.swizzlew = pCompiledSub->outputSwizzleW; + + next_ins(pAsm); + + pAsm->callers[pAsm->unCallerArrayPointer - 1].finale_cf_ptr = pAsm->cf_current_alu_clause_ptr; + pAsm->callers[pAsm->unCallerArrayPointer - 1].prelude_cf_ptr = prelude_cf_ptr; + pAsm->alu_x_opcode = SQ_CF_INST_ALU; + } + + if( (pPresubDesc->number_used_registers + pAsm->uFirstHelpReg) > pAsm->number_used_registers ) + { + pAsm->number_used_registers = pPresubDesc->number_used_registers + pAsm->uFirstHelpReg; + } + if(pAsm->uFirstHelpReg > pPresubDesc->maxStartReg) + { + pPresubDesc->maxStartReg = pAsm->uFirstHelpReg; + } + + return bRet; +} + GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, GLuint export_starting_index, @@ -6174,6 +6540,11 @@ GLboolean Clean_Up_Assembler(r700_AssemblerBase *pR700AsmCode) FREE(pR700AsmCode->callers); } + if(NULL != pR700AsmCode->presubs) + { + FREE(pR700AsmCode->presubs); + } + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 6dc44017eb1..6ef945dfda3 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -34,6 +34,45 @@ #include "r700_shaderinst.h" #include "r700_shader.h" +typedef enum LOADABLE_SCRIPT_SIGNITURE +{ + GLSL_NOISE1 = 0x10000001, + GLSL_NOISE2 = 0x10000002, + GLSL_NOISE3 = 0x10000003, + GLSL_NOISE4 = 0x10000004 +}LOADABLE_SCRIPT_SIGNITURE; + +typedef struct COMPILED_SUB +{ + struct prog_instruction *Instructions; + GLuint NumInstructions; + GLuint NumTemporaries; + GLuint NumParameters; + GLuint MinRegIndex; + GLfloat (*ParameterValues)[4]; + GLbyte outputSwizzleX; + GLbyte outputSwizzleY; + GLbyte outputSwizzleZ; + GLbyte outputSwizzleW; + GLshort srcRegIndex[3]; + GLushort dstRegIndex; +}COMPILED_SUB; + +typedef struct PRESUB_DESCtag +{ + LOADABLE_SCRIPT_SIGNITURE sptSigniture; + GLint subIL_Shift; + struct prog_src_register InReg[3]; + struct prog_dst_register OutReg; + + GLushort maxStartReg; + GLushort number_used_registers; + + GLuint unConstantsStart; + + COMPILED_SUB * pCompiledSub; +} PRESUB_DESC; + typedef enum SHADER_PIPE_TYPE { SPT_VP = 0, @@ -296,6 +335,7 @@ typedef struct SUB_OFFSET GLint subIL_Offset; GLuint unCFoffset; GLuint unStackDepthMax; + PRESUB_DESC * pPresubDesc; TypedShaderList lstCFInstructions_local; } SUB_OFFSET; @@ -304,6 +344,9 @@ typedef struct CALLER_POINTER GLint subIL_Offset; GLint subDescIndex; R700ControlFlowGenericClause* cf_ptr; + + R700ControlFlowGenericClause* prelude_cf_ptr; + R700ControlFlowGenericClause* finale_cf_ptr; } CALLER_POINTER; #define SQ_MAX_CALL_DEPTH 0x00000020 @@ -437,6 +480,11 @@ typedef struct r700_AssemblerBase GLuint unCFflags; + PRESUB_DESC * presubs; + GLuint unPresubArraySize; + GLuint unNumPresub; + GLuint unCurNumILInsts; + } r700_AssemblerBase; //Internal use @@ -458,7 +506,7 @@ BITS is_depth_component_exported(OUT_FRAGMENT_FMT_0* pFPOutFmt) ; GLboolean is_reduction_opcode(PVSDWORD * dest); GLuint GetSurfaceFormat(GLenum eType, GLuint nChannels, GLuint * pClient_size); -unsigned int r700GetNumOperands(r700_AssemblerBase* pAsm); +unsigned int r700GetNumOperands(GLuint opcode, GLuint nIsOp3); GLboolean IsTex(gl_inst_opcode Opcode); GLboolean IsAlu(gl_inst_opcode Opcode); @@ -585,13 +633,15 @@ GLboolean assemble_BRK(r700_AssemblerBase *pAsm); GLboolean assemble_COND(r700_AssemblerBase *pAsm); GLboolean assemble_ENDLOOP(r700_AssemblerBase *pAsm); -GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex); +GLboolean assemble_BGNSUB(r700_AssemblerBase *pAsm, GLint nILindex, GLuint uiIL_Shift); GLboolean assemble_ENDSUB(r700_AssemblerBase *pAsm); GLboolean assemble_RET(r700_AssemblerBase *pAsm); GLboolean assemble_CAL(r700_AssemblerBase *pAsm, GLint nILindex, + GLuint uiIL_Offest, GLuint uiNumberInsts, - struct prog_instruction *pILInst); + struct prog_instruction *pILInst, + PRESUB_DESC * pPresubDesc); GLboolean Process_Export(r700_AssemblerBase* pAsm, GLuint type, @@ -602,16 +652,23 @@ GLboolean Process_Export(r700_AssemblerBase* pAsm, GLboolean Move_Depth_Exports_To_Correct_Channels(r700_AssemblerBase *pAsm, BITS depth_channel_select); +GLboolean callPreSub(r700_AssemblerBase* pAsm, + LOADABLE_SCRIPT_SIGNITURE scriptSigniture, + /* struct prog_instruction ** pILInstParent, */ + COMPILED_SUB * pCompiledSub, + GLshort uOutReg, + GLshort uNumValidSrc); //Interface GLboolean AssembleInstr(GLuint uiFirstInst, + GLuint uiIL_Shift, GLuint uiNumberInsts, struct prog_instruction *pILInst, r700_AssemblerBase *pR700AsmCode); GLboolean Process_Fragment_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); GLboolean Process_Vertex_Exports(r700_AssemblerBase *pR700AsmCode, GLbitfield OutputsWritten); -GLboolean RelocProgram(r700_AssemblerBase * pAsm); +GLboolean RelocProgram(r700_AssemblerBase * pAsm, struct gl_program * pILProg); GLboolean InitShaderProgram(r700_AssemblerBase * pAsm); int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700_Shader* pShader); diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 8eb439a9519..d15f0137107 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -325,7 +325,11 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, { fp->r700AsmCode.SamplerUnits[i] = fp->mesa_program.Base.SamplerUnits[i]; } + + fp->r700AsmCode.unCurNumILInsts = mesa_fp->Base.NumInstructions; + if( GL_FALSE == AssembleInstr(0, + 0, mesa_fp->Base.NumInstructions, &(mesa_fp->Base.Instructions[0]), &(fp->r700AsmCode)) ) @@ -338,7 +342,7 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, return GL_FALSE; } - if( GL_FALSE == RelocProgram(&(fp->r700AsmCode)) ) + if( GL_FALSE == RelocProgram(&(fp->r700AsmCode), &(mesa_fp->Base)) ) { return GL_FALSE; } @@ -620,6 +624,25 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } else r700->ps.num_consts = 0; + COMPILED_SUB * pCompiledSub; + GLuint uj; + GLuint unConstOffset = r700->ps.num_consts; + for(ui=0; uiunNumPresub; ui++) + { + pCompiledSub = pAsm->presubs[ui].pCompiledSub; + + r700->ps.num_consts += pCompiledSub->NumParameters; + + for(uj=0; ujNumParameters; uj++) + { + r700->ps.consts[uj + unConstOffset][0].f32All = pCompiledSub->ParameterValues[uj][0]; + r700->ps.consts[uj + unConstOffset][1].f32All = pCompiledSub->ParameterValues[uj][1]; + r700->ps.consts[uj + unConstOffset][2].f32All = pCompiledSub->ParameterValues[uj][2]; + r700->ps.consts[uj + unConstOffset][3].f32All = pCompiledSub->ParameterValues[uj][3]; + } + unConstOffset += pCompiledSub->NumParameters; + } + return GL_TRUE; } diff --git a/src/mesa/drivers/dri/r600/r700_vertprog.c b/src/mesa/drivers/dri/r600/r700_vertprog.c index 759b74dc7e9..90fac078ff0 100644 --- a/src/mesa/drivers/dri/r600/r700_vertprog.c +++ b/src/mesa/drivers/dri/r600/r700_vertprog.c @@ -341,7 +341,11 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, { vp->r700AsmCode.SamplerUnits[i] = vp->mesa_program->Base.SamplerUnits[i]; } + + vp->r700AsmCode.unCurNumILInsts = vp->mesa_program->Base.NumInstructions; + if(GL_FALSE == AssembleInstr(0, + 0, vp->mesa_program->Base.NumInstructions, &(vp->mesa_program->Base.Instructions[0]), &(vp->r700AsmCode)) ) @@ -354,7 +358,7 @@ struct r700_vertex_program* r700TranslateVertexShader(GLcontext *ctx, return NULL; } - if( GL_FALSE == RelocProgram(&(vp->r700AsmCode)) ) + if( GL_FALSE == RelocProgram(&(vp->r700AsmCode), &(vp->mesa_program->Base)) ) { return GL_FALSE; } @@ -671,5 +675,24 @@ GLboolean r700SetupVertexProgram(GLcontext * ctx) } else r700->vs.num_consts = 0; + COMPILED_SUB * pCompiledSub; + GLuint uj; + GLuint unConstOffset = r700->vs.num_consts; + for(ui=0; uir700AsmCode.unNumPresub; ui++) + { + pCompiledSub = vp->r700AsmCode.presubs[ui].pCompiledSub; + + r700->vs.num_consts += pCompiledSub->NumParameters; + + for(uj=0; ujNumParameters; uj++) + { + r700->vs.consts[uj + unConstOffset][0].f32All = pCompiledSub->ParameterValues[uj][0]; + r700->vs.consts[uj + unConstOffset][1].f32All = pCompiledSub->ParameterValues[uj][1]; + r700->vs.consts[uj + unConstOffset][2].f32All = pCompiledSub->ParameterValues[uj][2]; + r700->vs.consts[uj + unConstOffset][3].f32All = pCompiledSub->ParameterValues[uj][3]; + } + unConstOffset += pCompiledSub->NumParameters; + } + return GL_TRUE; } -- cgit v1.2.3 From 637970aefdcdd1ee50e3759de384b82e6109a45c Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 12:43:28 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_LightModelf. _mesa_LightModelf calls _mesa_LightModelfv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index 5a8f9160f62..c1d47de3305 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -547,7 +547,10 @@ _mesa_LightModeli( GLenum pname, GLint param ) void GLAPIENTRY _mesa_LightModelf( GLenum pname, GLfloat param ) { - _mesa_LightModelfv( pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_LightModelfv( pname, fparam ); } -- cgit v1.2.3 From 6f2d51b81ff907af9727e90153a46e79e246fc66 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 13:00:22 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_PointParameterf. _mesa_PointParameterf calls _mesa_PointParameterfv, which uses the params argument as an array. --- src/mesa/main/points.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index b3305448904..9ec21c9b767 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -90,7 +90,10 @@ _mesa_PointParameteriv( GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_PointParameterf( GLenum pname, GLfloat param) { - _mesa_PointParameterfv(pname, ¶m); + GLfloat p[3]; + p[0] = param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } -- cgit v1.2.3 From 348883076bd213ec733a1ba2a4768788e4669c97 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 13:15:05 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_PointParameteri. _mesa_PointParameteri calls _mesa_PointParameterfv, which uses the params argument as an array. --- src/mesa/main/points.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/points.c b/src/mesa/main/points.c index 9ec21c9b767..dcaeccd90d4 100644 --- a/src/mesa/main/points.c +++ b/src/mesa/main/points.c @@ -69,8 +69,10 @@ _mesa_PointSize( GLfloat size ) void GLAPIENTRY _mesa_PointParameteri( GLenum pname, GLint param ) { - const GLfloat value = (GLfloat) param; - _mesa_PointParameterfv(pname, &value); + GLfloat p[3]; + p[0] = (GLfloat) param; + p[1] = p[2] = 0.0F; + _mesa_PointParameterfv(pname, p); } -- cgit v1.2.3 From 8cc570a48c2e8e18622027cbd76f16a746b430bc Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 9 Dec 2009 00:55:51 +0100 Subject: r300g: clean up r300_emit_aos --- src/gallium/drivers/r300/r300_cs.h | 9 +++++ src/gallium/drivers/r300/r300_emit.c | 71 +++++++++++++++++++++++------------- src/gallium/drivers/r300/r300_reg.h | 5 +++ 3 files changed, 59 insertions(+), 26 deletions(-) diff --git a/src/gallium/drivers/r300/r300_cs.h b/src/gallium/drivers/r300/r300_cs.h index 9fcf3ab538c..d142fee0502 100644 --- a/src/gallium/drivers/r300/r300_cs.h +++ b/src/gallium/drivers/r300/r300_cs.h @@ -115,6 +115,15 @@ cs_count -= 3; \ } while (0) +#define OUT_CS_RELOC_NO_OFFSET(bo, rd, wd, flags) do { \ + DBG(cs_context_copy, DBG_CS, "r300: writing relocation for buffer %p, " \ + "domains (%d, %d, %d)\n", \ + bo, rd, wd, flags); \ + assert(bo); \ + cs_winsys->write_cs_reloc(cs_winsys, bo, rd, wd, flags); \ + cs_count -= 2; \ +} while (0) + #define END_CS do { \ if (VERY_VERBOSE_CS) { \ DBG(cs_context_copy, DBG_CS, "r300: END_CS in %s (%s:%d)\n", __FUNCTION__, \ diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index dbf316a9b57..7620c73cac5 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -1,5 +1,6 @@ /* * Copyright 2008 Corbin Simpson + * Copyright 2009 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -623,50 +624,68 @@ void r300_emit_texture(struct r300_context* r300, END_CS; } -/* XXX I can't read this and that's not good */ -void r300_emit_aos(struct r300_context* r300, unsigned offset) +static boolean r300_validate_aos(struct r300_context *r300) { struct pipe_vertex_buffer *vbuf = r300->vertex_buffer; struct pipe_vertex_element *velem = r300->vertex_element; - CS_LOCALS(r300); int i; - unsigned aos_count = r300->vertex_element_count; + /* Check if formats and strides are aligned to the size of DWORD. */ + for (i = 0; i < r300->vertex_element_count; i++) { + if (vbuf[velem[i].vertex_buffer_index].stride % 4 != 0 || + pf_get_blocksize(velem[i].src_format) % 4 != 0) { + return FALSE; + } + } + return TRUE; +} + +void r300_emit_aos(struct r300_context* r300, unsigned offset) +{ + struct pipe_vertex_buffer *vb1, *vb2, *vbuf = r300->vertex_buffer; + struct pipe_vertex_element *velem = r300->vertex_element; + int i; + unsigned size1, size2, aos_count = r300->vertex_element_count; unsigned packet_size = (aos_count * 3 + 1) / 2; + CS_LOCALS(r300); + + /* XXX Move this checking to a more approriate place. */ + if (!r300_validate_aos(r300)) { + /* XXX We should fallback using Draw. */ + assert(0); + } + BEGIN_CS(2 + packet_size + aos_count * 2); OUT_CS_PKT3(R300_PACKET3_3D_LOAD_VBPNTR, packet_size); OUT_CS(aos_count); + for (i = 0; i < aos_count - 1; i += 2) { - int buf_num1 = velem[i].vertex_buffer_index; - int buf_num2 = velem[i+1].vertex_buffer_index; - assert(vbuf[buf_num1].stride % 4 == 0 && pf_get_blocksize(velem[i].src_format) % 4 == 0); - assert(vbuf[buf_num2].stride % 4 == 0 && pf_get_blocksize(velem[i+1].src_format) % 4 == 0); - OUT_CS((pf_get_blocksize(velem[i].src_format) >> 2) | (vbuf[buf_num1].stride << 6) | - (pf_get_blocksize(velem[i+1].src_format) << 14) | (vbuf[buf_num2].stride << 22)); - OUT_CS(vbuf[buf_num1].buffer_offset + velem[i].src_offset + - offset * vbuf[buf_num1].stride); - OUT_CS(vbuf[buf_num2].buffer_offset + velem[i+1].src_offset + - offset * vbuf[buf_num2].stride); + vb1 = &vbuf[velem[i].vertex_buffer_index]; + vb2 = &vbuf[velem[i+1].vertex_buffer_index]; + size1 = pf_get_blocksize(velem[i].src_format); + size2 = pf_get_blocksize(velem[i+1].src_format); + + OUT_CS(R300_VBPNTR_SIZE0(size1) | R300_VBPNTR_STRIDE0(vb1->stride) | + R300_VBPNTR_SIZE1(size2) | R300_VBPNTR_STRIDE1(vb2->stride)); + OUT_CS(vb1->buffer_offset + velem[i].src_offset + offset * vb1->stride); + OUT_CS(vb2->buffer_offset + velem[i+1].src_offset + offset * vb2->stride); } + if (aos_count & 1) { - int buf_num = velem[i].vertex_buffer_index; - assert(vbuf[buf_num].stride % 4 == 0 && pf_get_blocksize(velem[i].src_format) % 4 == 0); - OUT_CS((pf_get_blocksize(velem[i].src_format) >> 2) | (vbuf[buf_num].stride << 6)); - OUT_CS(vbuf[buf_num].buffer_offset + velem[i].src_offset + - offset * vbuf[buf_num].stride); + vb1 = &vbuf[velem[i].vertex_buffer_index]; + size1 = pf_get_blocksize(velem[i].src_format); + + OUT_CS(R300_VBPNTR_SIZE0(size1) | R300_VBPNTR_STRIDE0(vb1->stride)); + OUT_CS(vb1->buffer_offset + velem[i].src_offset + offset * vb1->stride); } - /* XXX bare CS reloc */ for (i = 0; i < aos_count; i++) { - cs_winsys->write_cs_reloc(cs_winsys, - vbuf[velem[i].vertex_buffer_index].buffer, - RADEON_GEM_DOMAIN_GTT, - 0, - 0); - cs_count -= 2; + OUT_CS_RELOC_NO_OFFSET(vbuf[velem[i].vertex_buffer_index].buffer, + RADEON_GEM_DOMAIN_GTT, 0, 0); } END_CS; } + #if 0 void r300_emit_draw_packet(struct r300_context* r300) { diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index 85b1ea568a3..c1ea87d11e9 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -3293,6 +3293,11 @@ enum { */ #define R300_PACKET3_3D_LOAD_VBPNTR 0x00002F00 +# define R300_VBPNTR_SIZE0(x) ((x) >> 2) +# define R300_VBPNTR_STRIDE0(x) (((x) >> 2) << 8) +# define R300_VBPNTR_SIZE1(x) (((x) >> 2) << 16) +# define R300_VBPNTR_STRIDE1(x) (((x) >> 2) << 24) + #define R300_PACKET3_INDX_BUFFER 0x00003300 # define R300_INDX_BUFFER_DST_SHIFT 0 # define R300_INDX_BUFFER_SKIP_SHIFT 16 -- cgit v1.2.3 From 87b822e024797ef2fdb51ec9364f21eeb4d07161 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 8 Dec 2009 04:55:32 +0100 Subject: r300g: make pow(0,0) return 1 instead of NaN in the R500 fragment shader Unfortunately we can't fix this easily in the R300 fragment shader, and it's probably not worth the effort. --- src/gallium/drivers/r300/r300_emit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 7620c73cac5..55bc2b3528a 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -277,7 +277,7 @@ void r500_emit_fragment_program_code(struct r300_context* r300, BEGIN_CS(13 + ((code->inst_end + 1) * 6)); - OUT_CS_REG(R500_US_CONFIG, 0); + OUT_CS_REG(R500_US_CONFIG, R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); OUT_CS_REG(R500_US_PIXSIZE, code->max_temp_idx); OUT_CS_REG(R500_US_CODE_RANGE, R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(code->inst_end)); -- cgit v1.2.3 From 6de7ac73bf027b9ace6f5f0c8063cbf724d95cee Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 8 Dec 2009 21:53:19 +0100 Subject: r300g: always disable unused colorbuffers --- src/gallium/drivers/r300/r300_emit.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 55bc2b3528a..f784e1fa8e5 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -331,7 +331,13 @@ void r300_emit_fb_state(struct r300_context* r300, int i; CS_LOCALS(r300); - BEGIN_CS((10 * fb->nr_cbufs) + (fb->zsbuf ? 10 : 0) + 4); + /* Shouldn't fail unless there is a bug in the state tracker. */ + assert(fb->nr_cbufs <= 4); + + BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) + + (fb->zsbuf ? 10 : 0) + 4); + + /* Flush and free renderbuffer caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, R300_RB3D_DSTCACHE_CTLSTAT_DC_FREE_FREE_3D_TAGS | R300_RB3D_DSTCACHE_CTLSTAT_DC_FLUSH_FLUSH_DIRTY_3D); @@ -339,6 +345,7 @@ void r300_emit_fb_state(struct r300_context* r300, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); + /* Set up colorbuffers. */ for (i = 0; i < fb->nr_cbufs; i++) { surf = fb->cbufs[i]; tex = (struct r300_texture*)surf->texture; @@ -356,6 +363,12 @@ void r300_emit_fb_state(struct r300_context* r300, r300_translate_out_fmt(surf->format)); } + /* Disable unused colorbuffers. */ + for (; i < 4; i++) { + OUT_CS_REG(R300_US_OUT_FMT_0 + (4 * i), R300_US_OUT_FMT_UNUSED); + } + + /* Set up a zbuffer. */ if (fb->zsbuf) { surf = fb->zsbuf; tex = (struct r300_texture*)surf->texture; -- cgit v1.2.3 From c6b450033d7ec2a415b1d761da1d94588358c94b Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Wed, 9 Dec 2009 00:45:18 +0100 Subject: r300g: fix routing of vertex streams if TCL is bypassed Generating mipmaps finally works, among other things. Yay! --- src/gallium/drivers/r300/r300_state.c | 2 -- src/gallium/drivers/r300/r300_state_derived.c | 17 +++++++++++---- src/gallium/drivers/r300/r300_vs.c | 31 +++++++++++---------------- src/gallium/drivers/r300/r300_vs.h | 4 +++- 4 files changed, 29 insertions(+), 25 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 68c5408a647..edf7114bbb5 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -419,8 +419,6 @@ static void* r300_create_rs_state(struct pipe_context* pipe, if (state->bypass_vs_clip_and_viewport || !r300_screen(pipe->screen)->caps->has_tcl) { rs->vap_control_status |= R300_VAP_TCL_BYPASS; - } else { - rs->rs.bypass_vs_clip_and_viewport = TRUE; } rs->point_size = pack_float_16_6x(state->point_size) | diff --git a/src/gallium/drivers/r300/r300_state_derived.c b/src/gallium/drivers/r300/r300_state_derived.c index 6af49888b9e..29bc701a86e 100644 --- a/src/gallium/drivers/r300/r300_state_derived.c +++ b/src/gallium/drivers/r300/r300_state_derived.c @@ -134,6 +134,16 @@ static void r300_vertex_psc(struct r300_context* r300) uint16_t type, swizzle; enum pipe_format format; unsigned i; + int identity[16] = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15}; + int* stream_tab; + + /* If TCL is bypassed, map vertex streams to equivalent VS output + * locations. */ + if (r300->rs_state->enable_vte) { + stream_tab = identity; + } else { + stream_tab = r300->vs->stream_loc_notcl; + } /* Vertex shaders have no semantics on their inputs, * so PSC should just route stuff based on the vertex elements, @@ -147,10 +157,10 @@ static void r300_vertex_psc(struct r300_context* r300) format = r300->vertex_element[i].src_format; type = r300_translate_vertex_data_type(format) | - (i << R300_DST_VEC_LOC_SHIFT); + (stream_tab[i] << R300_DST_VEC_LOC_SHIFT); swizzle = r300_translate_vertex_data_swizzle(format); - if (i % 2) { + if (i & 1) { vformat->vap_prog_stream_cntl[i >> 1] |= type << 16; vformat->vap_prog_stream_cntl_ext[i >> 1] |= swizzle << 16; } else { @@ -159,7 +169,6 @@ static void r300_vertex_psc(struct r300_context* r300) } } - assert(i <= 15); /* Set the last vector in the PSC. */ @@ -178,7 +187,7 @@ static void r300_swtcl_vertex_psc(struct r300_context* r300) uint16_t type, swizzle; enum pipe_format format; unsigned i, attrib_count; - int* vs_output_tab = r300->vs->output_stream_loc_swtcl; + int* vs_output_tab = r300->vs->stream_loc_notcl; /* For each Draw attribute, route it to the fragment shader according * to the vs_output_tab. */ diff --git a/src/gallium/drivers/r300/r300_vs.c b/src/gallium/drivers/r300/r300_vs.c index 31248346bc6..fa207c939ca 100644 --- a/src/gallium/drivers/r300/r300_vs.c +++ b/src/gallium/drivers/r300/r300_vs.c @@ -143,35 +143,33 @@ static void r300_shader_vap_output_fmt( assert(gen_count <= 8); } -/* Set VS output stream locations for SWTCL. */ -static void r300_stream_locations_swtcl( +/* Sets up stream mapping to equivalent VS outputs if TCL is bypassed + * or isn't present. */ +static void r300_stream_locations_notcl( struct r300_shader_semantics* vs_outputs, - int* output_stream_loc) + int* stream_loc) { int i, tabi = 0, gen_count; - /* XXX Check whether the numbers (0, 1, 2+i, etc.) are correct. - * These should go to VAP_PROG_STREAM_CNTL/DST_VEC_LOC. */ - /* Position. */ - output_stream_loc[tabi++] = 0; + stream_loc[tabi++] = 0; /* Point size. */ if (vs_outputs->psize != ATTR_UNUSED) { - output_stream_loc[tabi++] = 1; + stream_loc[tabi++] = 1; } /* Colors. */ for (i = 0; i < ATTR_COLOR_COUNT; i++) { if (vs_outputs->color[i] != ATTR_UNUSED) { - output_stream_loc[tabi++] = 2 + i; + stream_loc[tabi++] = 2 + i; } } /* Back-face colors. */ for (i = 0; i < ATTR_COLOR_COUNT; i++) { if (vs_outputs->bcolor[i] != ATTR_UNUSED) { - output_stream_loc[tabi++] = 4 + i; + stream_loc[tabi++] = 4 + i; } } @@ -180,7 +178,7 @@ static void r300_stream_locations_swtcl( for (i = 0; i < ATTR_GENERIC_COUNT; i++) { if (vs_outputs->bcolor[i] != ATTR_UNUSED) { assert(tabi < 16); - output_stream_loc[tabi++] = 6 + gen_count; + stream_loc[tabi++] = 6 + gen_count; gen_count++; } } @@ -188,7 +186,7 @@ static void r300_stream_locations_swtcl( /* Fog coordinates. */ if (vs_outputs->fog != ATTR_UNUSED) { assert(tabi < 16); - output_stream_loc[tabi++] = 6 + gen_count; + stream_loc[tabi++] = 6 + gen_count; gen_count++; } @@ -196,7 +194,7 @@ static void r300_stream_locations_swtcl( assert(gen_count <= 8); for (; tabi < 16;) { - output_stream_loc[tabi++] = -1; + stream_loc[tabi++] = -1; } } @@ -254,10 +252,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, /* Initialize. */ r300_shader_read_vs_outputs(&vs->info, &vs->outputs); r300_shader_vap_output_fmt(&vs->outputs, vs->hwfmt); - - if (!r300_screen(r300->context.screen)->caps->has_tcl) { - r300_stream_locations_swtcl(&vs->outputs, vs->output_stream_loc_swtcl); - } + r300_stream_locations_notcl(&vs->outputs, vs->stream_loc_notcl); /* Setup the compiler */ rc_init(&compiler.Base); @@ -283,7 +278,7 @@ void r300_translate_vertex_shader(struct r300_context* r300, /* Invoke the compiler */ r3xx_compile_vertex_program(&compiler); if (compiler.Base.Error) { - /* XXX Fail gracefully */ + /* XXX We should fallback using Draw. */ fprintf(stderr, "r300 VP: Compiler error\n"); abort(); } diff --git a/src/gallium/drivers/r300/r300_vs.h b/src/gallium/drivers/r300/r300_vs.h index 283dd5a9e83..67e9db5366f 100644 --- a/src/gallium/drivers/r300/r300_vs.h +++ b/src/gallium/drivers/r300/r300_vs.h @@ -38,9 +38,11 @@ struct r300_vertex_shader { struct tgsi_shader_info info; struct r300_shader_semantics outputs; - int output_stream_loc_swtcl[16]; uint hwfmt[4]; + /* Stream locations for SWTCL or if TCL is bypassed. */ + int stream_loc_notcl[16]; + /* Has this shader been translated yet? */ boolean translated; -- cgit v1.2.3 From 068596c9a7e8d330ffdff8ad8700bd6093b5bdea Mon Sep 17 00:00:00 2001 From: michal Date: Thu, 10 Dec 2009 01:03:15 +0100 Subject: Build mesa glsl with make. Still don't know how to add glsl to mesa dependencies. --- Makefile | 4 +++ configs/default | 2 +- src/glsl/Makefile | 15 ++++++++++ src/glsl/Makefile.template | 50 +++++++++++++++++++++++++++++++ src/glsl/apps/Makefile | 42 ++++++++++++++++++++++++++ src/glsl/cl/Makefile | 13 ++++++++ src/glsl/pp/Makefile | 26 ++++++++++++++++ src/mesa/Makefile | 15 +++++++--- src/mesa/shader/slang/library/Makefile | 55 +++++++++++----------------------- 9 files changed, 179 insertions(+), 43 deletions(-) create mode 100644 src/glsl/Makefile create mode 100644 src/glsl/Makefile.template create mode 100644 src/glsl/apps/Makefile create mode 100644 src/glsl/cl/Makefile create mode 100644 src/glsl/pp/Makefile diff --git a/Makefile b/Makefile index ea00e811b77..0f759d86dfe 100644 --- a/Makefile +++ b/Makefile @@ -225,6 +225,10 @@ MAIN_FILES = \ $(DIRECTORY)/include/GL/vms_x_fix.h \ $(DIRECTORY)/include/GL/wglext.h \ $(DIRECTORY)/include/GL/wmesa.h \ + $(DIRECTORY)/src/glsl/Makefile \ + $(DIRECTORY)/src/glsl/*/Makefile \ + $(DIRECTORY)/src/glsl/*/SConscript \ + $(DIRECTORY)/src/glsl/*/*.[ch] \ $(DIRECTORY)/src/Makefile \ $(DIRECTORY)/src/mesa/Makefile* \ $(DIRECTORY)/src/mesa/sources.mak \ diff --git a/configs/default b/configs/default index cb3ca1046f4..f3659312040 100644 --- a/configs/default +++ b/configs/default @@ -83,7 +83,7 @@ MOTIF_CFLAGS = -I/usr/include/Motif1.2 # Directories to build LIB_DIR = lib -SRC_DIRS = mesa gallium egl gallium/winsys glu glut/glx glew glw +SRC_DIRS = glsl mesa gallium egl gallium/winsys glu glut/glx glew glw GLU_DIRS = sgi DRIVER_DIRS = x11 osmesa # Which subdirs under $(TOP)/progs/ to enter: diff --git a/src/glsl/Makefile b/src/glsl/Makefile new file mode 100644 index 00000000000..ca7f2d2ac7d --- /dev/null +++ b/src/glsl/Makefile @@ -0,0 +1,15 @@ +# src/glsl/Makefile + +TOP = ../.. + +include $(TOP)/configs/current + +SUBDIRS = pp cl apps + +default install clean: + @for dir in $(SUBDIRS) ; do \ + if [ -d $$dir ] ; then \ + (cd $$dir && $(MAKE) $@) || exit 1; \ + fi \ + done + diff --git a/src/glsl/Makefile.template b/src/glsl/Makefile.template new file mode 100644 index 00000000000..974987a0a04 --- /dev/null +++ b/src/glsl/Makefile.template @@ -0,0 +1,50 @@ +# src/glsl/Makefile.template + +# Template makefile for glsl libraries. +# +# Usage: +# The minimum that the including makefile needs to define +# is TOP, LIBNAME and one of of the *_SOURCES. +# +# Optional defines: +# LIBRARY_INCLUDES are appended to the list of includes directories. +# LIBRARY_DEFINES is not used for makedepend, but for compilation. + + +### Basic defines ### + +OBJECTS = $(C_SOURCES:.c=.o) + +INCLUDES = \ + -I. \ + $(LIBRARY_INCLUDES) + + +##### TARGETS ##### + +default: depend lib$(LIBNAME).a + +lib$(LIBNAME).a: $(OBJECTS) Makefile $(TOP)/src/glsl/Makefile.template + $(MKLIB) -o $(LIBNAME) -static $(OBJECTS) + +depend: $(C_SOURCES) + rm -f depend + touch depend + $(MKDEP) $(MKDEP_OPTIONS) $(INCLUDES) $(C_SOURCES) 2> /dev/null + +# Remove .o and backup files +clean: + rm -f $(OBJECTS) lib$(LIBNAME).a depend depend.bak + +# Dummy target +install: + @echo -n "" + + +##### RULES ##### + +.c.o: + $(CC) -c $(INCLUDES) $(CFLAGS) $(LIBRARY_DEFINES) $< -o $@ + +-include depend + diff --git a/src/glsl/apps/Makefile b/src/glsl/apps/Makefile new file mode 100644 index 00000000000..c80fcb9d974 --- /dev/null +++ b/src/glsl/apps/Makefile @@ -0,0 +1,42 @@ +# src/glsl/apps/Makefile + +TOP = ../../.. + +include $(TOP)/configs/current + +LIBS = \ + $(TOP)/src/glsl/pp/libglslpp.a \ + $(TOP)/src/glsl/cl/libglslcl.a + +SOURCES = \ + compile.c \ + process.c \ + purify.c \ + tokenise.c \ + version.c + +APPS = $(SOURCES:%.c=%) + +INCLUDES = -I. + + +##### RULES ##### + +.SUFFIXES: +.SUFFIXES: .c + +.c: + $(APP_CC) $(INCLUDES) $(CFLAGS) $(LDFLAGS) $< $(LIBS) -o $@ + +.c.o: + $(APP_CC) -c $(INCLUDES) $(CFLAGS) $(DEFINES) $< -o $@ + + +##### TARGETS ##### + +default: $(APPS) + +clean: + -rm -f $(APPS) + -rm -f *.o + diff --git a/src/glsl/cl/Makefile b/src/glsl/cl/Makefile new file mode 100644 index 00000000000..04a52df8c33 --- /dev/null +++ b/src/glsl/cl/Makefile @@ -0,0 +1,13 @@ +#src/glsl/cl/Makefile + +TOP = ../../.. + +include $(TOP)/configs/current + +LIBNAME = glslcl + +C_SOURCES = \ + sl_cl_parse.c + +include ../Makefile.template + diff --git a/src/glsl/pp/Makefile b/src/glsl/pp/Makefile new file mode 100644 index 00000000000..819079f6258 --- /dev/null +++ b/src/glsl/pp/Makefile @@ -0,0 +1,26 @@ +#src/glsl/pp/Makefile + +TOP = ../../.. + +include $(TOP)/configs/current + +LIBNAME = glslpp + +C_SOURCES = \ + sl_pp_context.c \ + sl_pp_define.c \ + sl_pp_dict.c \ + sl_pp_error.c \ + sl_pp_expression.c \ + sl_pp_extension.c \ + sl_pp_if.c \ + sl_pp_line.c \ + sl_pp_macro.c \ + sl_pp_pragma.c \ + sl_pp_process.c \ + sl_pp_purify.c \ + sl_pp_token.c \ + sl_pp_version.c + +include ../Makefile.template + diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 8300b301441..67cac2d2480 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -19,10 +19,10 @@ include sources.mak -# Default: build dependencies, then asm_subdirs, then convenience -# libs (.a) and finally the device drivers: -default: depend asm_subdirs libmesa.a libmesagallium.a libglapi.a \ - driver_subdirs +# Default: build dependencies, then asm_subdirs, GLSL built-in lib, +# then convenience libs (.a) and finally the device drivers: +default: depend asm_subdirs glsl_builtin libmesa.a libmesagallium.a \ + libglapi.a driver_subdirs @@ -63,6 +63,12 @@ asm_subdirs: fi +###################################################################### +# GLSL built-in library +glsl_builtin: + (cd shader/slang/library && $(MAKE)) || exit 1 ; + + ###################################################################### # Dependency generation @@ -156,6 +162,7 @@ clean: -rm -f depend depend.bak libmesa.a libglapi.a -rm -f drivers/*/*.o -rm -f *.pc + -rm -f shader/slang/library/*_gc.h -@cd drivers/dri && $(MAKE) clean -@cd drivers/x11 && $(MAKE) clean -@cd drivers/osmesa && $(MAKE) clean diff --git a/src/mesa/shader/slang/library/Makefile b/src/mesa/shader/slang/library/Makefile index 5033d887c5b..c6964512bfe 100644 --- a/src/mesa/shader/slang/library/Makefile +++ b/src/mesa/shader/slang/library/Makefile @@ -4,9 +4,7 @@ TOP = ../../../../.. include $(TOP)/configs/current -INCDIR = $(TOP)/include - -LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) +GLSL_CL = $(TOP)/src/glsl/apps/compile # # targets @@ -14,32 +12,13 @@ LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME) .PHONY: default clean -default: syntax builtin +default: builtin clean: - -rm -f syn_to_c gc_to_bin *_syn.h *_gc.h - -syntax: slang_shader_syn.h + -rm -f *_gc.h builtin: builtin_110 builtin_120 -# -# executables -# - -syn_to_c: syn_to_c.c - $(CC) syn_to_c.c -o syn_to_c - -gc_to_bin: gc_to_bin.c slang_shader_syn.h - $(CC) gc_to_bin.c -o gc_to_bin - -# -# syntax scripts -# - -slang_shader_syn.h: syn_to_c slang_shader.syn - ./syn_to_c slang_shader.syn > slang_shader_syn.h - # # builtin library sources # @@ -49,24 +28,24 @@ builtin_110: slang_common_builtin_gc.h slang_core_gc.h slang_fragment_builtin_gc builtin_120: slang_120_core_gc.h slang_builtin_120_common_gc.h slang_builtin_120_fragment_gc.h -slang_120_core_gc.h: gc_to_bin slang_120_core.gc - ./gc_to_bin 1 slang_120_core.gc slang_120_core_gc.h +slang_120_core_gc.h: slang_120_core.gc + $(GLSL_CL) fragment slang_120_core.gc slang_120_core_gc.h -slang_builtin_120_common_gc.h: gc_to_bin slang_builtin_120_common.gc - ./gc_to_bin 1 slang_builtin_120_common.gc slang_builtin_120_common_gc.h +slang_builtin_120_common_gc.h: slang_builtin_120_common.gc + $(GLSL_CL) fragment slang_builtin_120_common.gc slang_builtin_120_common_gc.h -slang_builtin_120_fragment_gc.h: gc_to_bin slang_builtin_120_fragment.gc - ./gc_to_bin 1 slang_builtin_120_fragment.gc slang_builtin_120_fragment_gc.h +slang_builtin_120_fragment_gc.h: slang_builtin_120_fragment.gc + $(GLSL_CL) fragment slang_builtin_120_fragment.gc slang_builtin_120_fragment_gc.h -slang_common_builtin_gc.h: gc_to_bin slang_common_builtin.gc - ./gc_to_bin 1 slang_common_builtin.gc slang_common_builtin_gc.h +slang_common_builtin_gc.h: slang_common_builtin.gc + $(GLSL_CL) fragment slang_common_builtin.gc slang_common_builtin_gc.h -slang_core_gc.h: gc_to_bin slang_core.gc - ./gc_to_bin 1 slang_core.gc slang_core_gc.h +slang_core_gc.h: slang_core.gc + $(GLSL_CL) fragment slang_core.gc slang_core_gc.h -slang_fragment_builtin_gc.h: gc_to_bin slang_fragment_builtin.gc - ./gc_to_bin 1 slang_fragment_builtin.gc slang_fragment_builtin_gc.h +slang_fragment_builtin_gc.h: slang_fragment_builtin.gc + $(GLSL_CL) fragment slang_fragment_builtin.gc slang_fragment_builtin_gc.h -slang_vertex_builtin_gc.h: gc_to_bin slang_vertex_builtin.gc - ./gc_to_bin 2 slang_vertex_builtin.gc slang_vertex_builtin_gc.h +slang_vertex_builtin_gc.h: slang_vertex_builtin.gc + $(GLSL_CL) vertex slang_vertex_builtin.gc slang_vertex_builtin_gc.h -- cgit v1.2.3 From 34528a34c446afea4442f479713e7f926220f128 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:11:30 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Lightf. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index c1d47de3305..d4f3bb90265 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -206,7 +206,10 @@ _mesa_light(GLcontext *ctx, GLuint lnum, GLenum pname, const GLfloat *params) void GLAPIENTRY _mesa_Lightf( GLenum light, GLenum pname, GLfloat param ) { - _mesa_Lightfv( light, pname, ¶m ); + GLfloat fparam[4]; + fparam[0] = param; + fparam[1] = fparam[2] = fparam[3] = 0.0F; + _mesa_Lightfv( light, pname, fparam ); } -- cgit v1.2.3 From 444d1f39108ab4419843f19f76c968cef3398bab Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:34:50 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_Lighti. _mesa_Lighti calls _mesa_Lightiv, which uses the params argument as an array. --- src/mesa/main/light.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/light.c b/src/mesa/main/light.c index d4f3bb90265..5150926159e 100644 --- a/src/mesa/main/light.c +++ b/src/mesa/main/light.c @@ -288,7 +288,10 @@ _mesa_Lightfv( GLenum light, GLenum pname, const GLfloat *params ) void GLAPIENTRY _mesa_Lighti( GLenum light, GLenum pname, GLint param ) { - _mesa_Lightiv( light, pname, ¶m ); + GLint iparam[4]; + iparam[0] = param; + iparam[1] = iparam[2] = iparam[3] = 0; + _mesa_Lightiv( light, pname, iparam ); } -- cgit v1.2.3 From b82757880545f8bce471ba8f13c16998888cd4b5 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 17:59:23 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexGend. _mesa_TexGend calls _mesa_TexGenfv, which uses the params argument as an array. --- src/mesa/main/texgen.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texgen.c b/src/mesa/main/texgen.c index d3ea7b936b3..f9d38215d60 100644 --- a/src/mesa/main/texgen.c +++ b/src/mesa/main/texgen.c @@ -181,8 +181,10 @@ _mesa_TexGeniv(GLenum coord, GLenum pname, const GLint *params ) void GLAPIENTRY _mesa_TexGend(GLenum coord, GLenum pname, GLdouble param ) { - GLfloat p = (GLfloat) param; - _mesa_TexGenfv( coord, pname, &p ); + GLfloat p[4]; + p[0] = (GLfloat) param; + p[1] = p[2] = p[3] = 0.0F; + _mesa_TexGenfv( coord, pname, p ); } -- cgit v1.2.3 From 71f4267ac23f52dcc94590cb94c3e0ce451662aa Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Thu, 10 Dec 2009 03:51:35 +0100 Subject: winsys/intel: fix dereferencing of opaque type due to pipe_reference changes --- src/gallium/winsys/drm/intel/gem/intel_drm_fence.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c index b6248a3bcf7..e8b58742ab7 100644 --- a/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c +++ b/src/gallium/winsys/drm/intel/gem/intel_drm_fence.c @@ -39,7 +39,7 @@ intel_drm_fence_reference(struct intel_winsys *iws, struct intel_drm_fence *old = (struct intel_drm_fence *)*ptr; struct intel_drm_fence *f = (struct intel_drm_fence *)fence; - if (pipe_reference(&(*ptr)->reference, &f->reference)) { + if (pipe_reference(&((struct intel_drm_fence *)(*ptr))->reference, &f->reference)) { if (old->bo) drm_intel_bo_unreference(old->bo); FREE(old); -- cgit v1.2.3 From 05b62960929b78a53465ffcb0739454519ed157a Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Wed, 9 Dec 2009 22:34:07 -0800 Subject: mesa: Fix SCons build. Commit cd6b8dd9e82fedc55d033131fbc0f8ee950567c8 deleted src/mesa/state_tracker/st_cb_get.c. --- src/mesa/SConscript | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 309e0e54d07..ca4a9afce5c 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -164,7 +164,6 @@ if env['platform'] != 'winddk': 'state_tracker/st_cb_flush.c', 'state_tracker/st_cb_drawpixels.c', 'state_tracker/st_cb_fbo.c', - 'state_tracker/st_cb_get.c', 'state_tracker/st_cb_feedback.c', 'state_tracker/st_cb_program.c', 'state_tracker/st_cb_queryobj.c', -- cgit v1.2.3 From 91e164b3d0b1d36bfdf369266ae7e1ab396f1ba2 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:38:22 +0100 Subject: glsl/pp: Add sl_pp_context_add_extension(). This way third parties are able to add supported extension strings. --- src/glsl/pp/sl_pp_context.h | 10 +++++++++ src/glsl/pp/sl_pp_dict.c | 2 -- src/glsl/pp/sl_pp_dict.h | 2 -- src/glsl/pp/sl_pp_extension.c | 49 ++++++++++++++++++++++++++++++++----------- src/glsl/pp/sl_pp_macro.c | 12 +++++++++++ src/glsl/pp/sl_pp_public.h | 5 +++++ 6 files changed, 64 insertions(+), 16 deletions(-) diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 569a2d735b9..5e3ae72fdfa 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -37,6 +37,13 @@ #define SL_PP_MAX_ERROR_MSG 1024 +#define SL_PP_MAX_EXTENSIONS 16 + +struct sl_pp_extension { + int name; /*< VENDOR_extension_name */ + int name_string; /*< GL_VENDOR_extension_name */ +}; + struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; @@ -46,6 +53,9 @@ struct sl_pp_context { struct sl_pp_macro *macro; struct sl_pp_macro **macro_tail; + struct sl_pp_extension extensions[SL_PP_MAX_EXTENSIONS]; + unsigned int num_extensions; + unsigned int if_stack[SL_PP_MAX_IF_NESTING]; unsigned int if_ptr; unsigned int if_value; diff --git a/src/glsl/pp/sl_pp_dict.c b/src/glsl/pp/sl_pp_dict.c index 2dd77a69e90..062139e6ac0 100644 --- a/src/glsl/pp/sl_pp_dict.c +++ b/src/glsl/pp/sl_pp_dict.c @@ -45,8 +45,6 @@ int sl_pp_dict_init(struct sl_pp_context *context) { ADD_NAME(context, all); - ADD_NAME_STR(context, _GL_ARB_draw_buffers, "GL_ARB_draw_buffers"); - ADD_NAME_STR(context, _GL_ARB_texture_rectangle, "GL_ARB_texture_rectangle"); ADD_NAME(context, require); ADD_NAME(context, enable); diff --git a/src/glsl/pp/sl_pp_dict.h b/src/glsl/pp/sl_pp_dict.h index 49f0e0bf9fa..875217bd309 100644 --- a/src/glsl/pp/sl_pp_dict.h +++ b/src/glsl/pp/sl_pp_dict.h @@ -33,8 +33,6 @@ struct sl_pp_context; struct sl_pp_dict { int all; - int _GL_ARB_draw_buffers; - int _GL_ARB_texture_rectangle; int require; int enable; diff --git a/src/glsl/pp/sl_pp_extension.c b/src/glsl/pp/sl_pp_extension.c index 4148fd9a5a3..67b24404d4d 100644 --- a/src/glsl/pp/sl_pp_extension.c +++ b/src/glsl/pp/sl_pp_extension.c @@ -28,8 +28,34 @@ #include #include #include "sl_pp_process.h" +#include "sl_pp_public.h" +int +sl_pp_context_add_extension(struct sl_pp_context *context, + const char *name, + const char *name_string) +{ + struct sl_pp_extension ext; + + if (context->num_extensions == SL_PP_MAX_EXTENSIONS) { + return -1; + } + + ext.name = sl_pp_context_add_unique_str(context, name); + if (ext.name == -1) { + return -1; + } + + ext.name_string = sl_pp_context_add_unique_str(context, name_string); + if (ext.name_string == -1) { + return -1; + } + + context->extensions[context->num_extensions++] = ext; + return 0; +} + int sl_pp_process_extension(struct sl_pp_context *context, const struct sl_pp_token_info *input, @@ -37,14 +63,7 @@ sl_pp_process_extension(struct sl_pp_context *context, unsigned int last, struct sl_pp_process_state *state) { - int extensions[] = { - context->dict.all, - context->dict._GL_ARB_draw_buffers, - context->dict._GL_ARB_texture_rectangle, - -1 - }; int extension_name = -1; - int *ext; int behavior = -1; struct sl_pp_token_info out; @@ -59,11 +78,17 @@ sl_pp_process_extension(struct sl_pp_context *context, } /* Make sure the extension is supported. */ - out.data.extension = -1; - for (ext = extensions; *ext != -1; ext++) { - if (extension_name == *ext) { - out.data.extension = extension_name; - break; + if (extension_name == context->dict.all) { + out.data.extension = extension_name; + } else { + unsigned int i; + + out.data.extension = -1; + for (i = 0; i < context->num_extensions; i++) { + if (extension_name == context->extensions[i].name_string) { + out.data.extension = extension_name; + break; + } } } diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 29f1229dd7d..05466c9a7c3 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -163,6 +163,18 @@ sl_pp_macro_expand(struct sl_pp_context *context, return 0; } + /* Replace extension names with 1. + */ + for (j = 0; j < context->num_extensions; j++) { + if (macro_name == context->extensions[j].name) { + if (!mute && _out_number(context, state, 1)) { + return -1; + } + (*pi)++; + return 0; + } + } + /* TODO: For FEATURE_es2_glsl, expand to 1 the following symbols. * GL_ES * GL_FRAGMENT_PRECISION_HIGH diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h index 8317c7e378a..20f208975e4 100644 --- a/src/glsl/pp/sl_pp_public.h +++ b/src/glsl/pp/sl_pp_public.h @@ -45,6 +45,11 @@ sl_pp_context_destroy(struct sl_pp_context *context); const char * sl_pp_context_error_message(const struct sl_pp_context *context); +int +sl_pp_context_add_extension(struct sl_pp_context *context, + const char *name, + const char *name_string); + int sl_pp_context_add_unique_str(struct sl_pp_context *context, const char *str); -- cgit v1.2.3 From 48c60b0ecbc7d2f2b153d218a46c61928daddb8e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:39:10 +0100 Subject: slang: Explicitly enable ARB_draw_buffers and ARB_texture_rectangle. They are no longer built into the glsl preprocessor. --- src/mesa/shader/slang/slang_compile.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index a194f2fc9e6..00db299a271 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2603,6 +2603,13 @@ compile_with_grammar(const char *source, return GL_FALSE; } + if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") || + sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + return GL_FALSE; + } + memset(&options, 0, sizeof(options)); if (sl_pp_tokenise(context, source, &options, &intokens)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); -- cgit v1.2.3 From d1a09a9ba4a56067cc41e87d00fd7c395f0e7345 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:39:37 +0100 Subject: glsl/apps: Explicitly add ARB_draw_buffers and ARB_texture_rectangle. --- src/glsl/apps/compile.c | 11 +++++++++++ src/glsl/apps/process.c | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index 03e6e58d604..63c2099e874 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -151,6 +151,17 @@ main(int argc, return 0; } + if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") || + sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + printf("Error: %s\n", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + free(tokens); + fclose(out); + return 0; + } + if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 2cec9a99719..6c5c7bc420f 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -121,6 +121,17 @@ main(int argc, return -1; } + if (sl_pp_context_add_extension(context, "ARB_draw_buffers", "GL_ARB_draw_buffers") || + sl_pp_context_add_extension(context, "ARB_texture_rectangle", "GL_ARB_texture_rectangle")) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + printf("Error: %s\n", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + free(tokens); + fclose(out); + return 0; + } + if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); -- cgit v1.2.3 From 22200bcafcc77ecdca0127ac72d68e75e2ad7aee Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:58:21 +0100 Subject: glsl/pp: Add support for user-defined macros. --- src/glsl/pp/sl_pp_context.c | 25 +++++++++++++++++++++++++ src/glsl/pp/sl_pp_context.h | 10 ++++++++++ src/glsl/pp/sl_pp_macro.c | 17 +++++++++++++++++ src/glsl/pp/sl_pp_public.h | 5 +++++ 4 files changed, 57 insertions(+) diff --git a/src/glsl/pp/sl_pp_context.c b/src/glsl/pp/sl_pp_context.c index 134588d9066..afc1b84d16a 100644 --- a/src/glsl/pp/sl_pp_context.c +++ b/src/glsl/pp/sl_pp_context.c @@ -79,6 +79,31 @@ sl_pp_context_error_message(const struct sl_pp_context *context) return context->error_msg; } +int +sl_pp_context_add_predefined(struct sl_pp_context *context, + const char *name, + const char *value) +{ + struct sl_pp_predefined pre; + + if (context->num_predefined == SL_PP_MAX_PREDEFINED) { + return -1; + } + + pre.name = sl_pp_context_add_unique_str(context, name); + if (pre.name == -1) { + return -1; + } + + pre.value = sl_pp_context_add_unique_str(context, value); + if (pre.value == -1) { + return -1; + } + + context->predefined[context->num_predefined++] = pre; + return 0; +} + int sl_pp_context_add_unique_str(struct sl_pp_context *context, const char *str) diff --git a/src/glsl/pp/sl_pp_context.h b/src/glsl/pp/sl_pp_context.h index 5e3ae72fdfa..d95d29e275c 100644 --- a/src/glsl/pp/sl_pp_context.h +++ b/src/glsl/pp/sl_pp_context.h @@ -39,11 +39,18 @@ #define SL_PP_MAX_EXTENSIONS 16 +#define SL_PP_MAX_PREDEFINED 16 + struct sl_pp_extension { int name; /*< VENDOR_extension_name */ int name_string; /*< GL_VENDOR_extension_name */ }; +struct sl_pp_predefined { + int name; + int value; +}; + struct sl_pp_context { char *cstr_pool; unsigned int cstr_pool_max; @@ -56,6 +63,9 @@ struct sl_pp_context { struct sl_pp_extension extensions[SL_PP_MAX_EXTENSIONS]; unsigned int num_extensions; + struct sl_pp_predefined predefined[SL_PP_MAX_PREDEFINED]; + unsigned int num_predefined; + unsigned int if_stack[SL_PP_MAX_IF_NESTING]; unsigned int if_ptr; unsigned int if_value; diff --git a/src/glsl/pp/sl_pp_macro.c b/src/glsl/pp/sl_pp_macro.c index 05466c9a7c3..08b44c7cbe4 100644 --- a/src/glsl/pp/sl_pp_macro.c +++ b/src/glsl/pp/sl_pp_macro.c @@ -163,6 +163,23 @@ sl_pp_macro_expand(struct sl_pp_context *context, return 0; } + for (j = 0; j < context->num_predefined; j++) { + if (macro_name == context->predefined[j].name) { + if (!mute) { + struct sl_pp_token_info ti; + + ti.token = SL_PP_UINT; + ti.data._uint = context->predefined[j].value; + if (sl_pp_process_out(state, &ti)) { + strcpy(context->error_msg, "out of memory"); + return -1; + } + } + (*pi)++; + return 0; + } + } + /* Replace extension names with 1. */ for (j = 0; j < context->num_extensions; j++) { diff --git a/src/glsl/pp/sl_pp_public.h b/src/glsl/pp/sl_pp_public.h index 20f208975e4..076903649cd 100644 --- a/src/glsl/pp/sl_pp_public.h +++ b/src/glsl/pp/sl_pp_public.h @@ -50,6 +50,11 @@ sl_pp_context_add_extension(struct sl_pp_context *context, const char *name, const char *name_string); +int +sl_pp_context_add_predefined(struct sl_pp_context *context, + const char *name, + const char *value); + int sl_pp_context_add_unique_str(struct sl_pp_context *context, const char *str); -- cgit v1.2.3 From 417f36ccb062bee01aff92d6fcdf47af3ece3cb4 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:58:44 +0100 Subject: glsl/apps: Predefine __GLSL_PP_PREDEFINED_MACRO_TEST for testing. --- src/glsl/apps/process.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index 6c5c7bc420f..b793cc086d8 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -132,6 +132,16 @@ main(int argc, return 0; } + if (sl_pp_context_add_predefined(context, "__GLSL_PP_PREDEFINED_MACRO_TEST", "1")) { + fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); + + printf("Error: %s\n", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + free(tokens); + fclose(out); + return 0; + } + if (sl_pp_process(context, &tokens[tokens_eaten], &outtokens)) { fprintf(out, "$ERROR: `%s'\n", sl_pp_context_error_message(context)); -- cgit v1.2.3 From f00805a11756fa9d2bdfce15f51ae4798d72b5fb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Thu, 10 Dec 2009 12:59:23 +0100 Subject: slang: Predefine ES symbols for FEATURE_es2_glsl. --- src/mesa/shader/slang/slang_compile.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/mesa/shader/slang/slang_compile.c b/src/mesa/shader/slang/slang_compile.c index 00db299a271..478acb89d33 100644 --- a/src/mesa/shader/slang/slang_compile.c +++ b/src/mesa/shader/slang/slang_compile.c @@ -2610,6 +2610,15 @@ compile_with_grammar(const char *source, return GL_FALSE; } +#if FEATURE_es2_glsl + if (sl_pp_context_add_predefined(context, "GL_ES", "1") || + sl_pp_context_add_predefined(context, "GL_FRAGMENT_PRECISION_HIGH", "1")) { + slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); + sl_pp_context_destroy(context); + return GL_FALSE; + } +#endif + memset(&options, 0, sizeof(options)); if (sl_pp_tokenise(context, source, &options, &intokens)) { slang_info_log_error(infolog, "%s", sl_pp_context_error_message(context)); -- cgit v1.2.3 From 7502b6affa72915cadeb0837028e7655e459da69 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 08:24:45 -0700 Subject: glsl/cl: silence unused var warning --- src/glsl/cl/sl_cl_parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 5919186c520..81e30a8c28c 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -1596,6 +1596,8 @@ _parse_parameter_declaration(struct parse_context *ctx, struct parse_state p = *ps; unsigned int e = _emit(ctx, &p.out, PARAMETER_NEXT); + (void) e; + if (_parse_type_qualifier(ctx, &p)) { _emit(ctx, &p.out, TYPE_QUALIFIER_NONE); } -- cgit v1.2.3 From 52271c5345fedcb5b30736d69e4944889dda234c Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 08:25:16 -0700 Subject: glsl/pp: declare sl_pp_purify_options to silence warning --- src/glsl/pp/sl_pp_token.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/pp/sl_pp_token.h b/src/glsl/pp/sl_pp_token.h index 7a8fa2f1b9d..ba9834a9f24 100644 --- a/src/glsl/pp/sl_pp_token.h +++ b/src/glsl/pp/sl_pp_token.h @@ -120,6 +120,8 @@ struct sl_pp_token_info { union sl_pp_token_data data; }; +struct sl_pp_purify_options; + int sl_pp_tokenise(struct sl_pp_context *context, const char *input, -- cgit v1.2.3 From 0d654a7f2cf173723eee930d2e5b9a1dd0140aaf Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 08:25:35 -0700 Subject: glsl/pp: make some functions static --- src/glsl/pp/sl_pp_token.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/glsl/pp/sl_pp_token.c b/src/glsl/pp/sl_pp_token.c index 03f2f09cfd6..e9a60b6c508 100644 --- a/src/glsl/pp/sl_pp_token.c +++ b/src/glsl/pp/sl_pp_token.c @@ -35,7 +35,7 @@ #define PURE_ERROR 256 -int +static int _pure_getc(struct sl_pp_context *context) { char c; @@ -52,7 +52,7 @@ _pure_getc(struct sl_pp_context *context) } -void +static void _pure_ungetc(struct sl_pp_context *context, int c) { @@ -508,7 +508,7 @@ _tokenise_number(struct sl_pp_context *context, } -int +static int sl_pp_token_get(struct sl_pp_context *context, struct sl_pp_token_info *out) { -- cgit v1.2.3 From 05eccfe79ec74a04630bcebff4c76accf4f85e0d Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 08:25:47 -0700 Subject: glsl/apps: remove unused vars --- src/glsl/apps/compile.c | 1 - src/glsl/apps/process.c | 2 -- src/glsl/apps/tokenise.c | 2 -- src/glsl/apps/version.c | 2 -- 4 files changed, 7 deletions(-) diff --git a/src/glsl/apps/compile.c b/src/glsl/apps/compile.c index 63c2099e874..b1165420fb8 100644 --- a/src/glsl/apps/compile.c +++ b/src/glsl/apps/compile.c @@ -49,7 +49,6 @@ main(int argc, char *inbuf; struct sl_pp_purify_options options; char errmsg[100] = ""; - unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; diff --git a/src/glsl/apps/process.c b/src/glsl/apps/process.c index b793cc086d8..d7bc16577e0 100644 --- a/src/glsl/apps/process.c +++ b/src/glsl/apps/process.c @@ -40,8 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char errmsg[100] = ""; - unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; diff --git a/src/glsl/apps/tokenise.c b/src/glsl/apps/tokenise.c index eb86e3df69e..91368c32a45 100644 --- a/src/glsl/apps/tokenise.c +++ b/src/glsl/apps/tokenise.c @@ -40,8 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char errmsg[100] = ""; - unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; FILE *out; diff --git a/src/glsl/apps/version.c b/src/glsl/apps/version.c index b1d0d6ff282..6f77f230ca9 100644 --- a/src/glsl/apps/version.c +++ b/src/glsl/apps/version.c @@ -40,8 +40,6 @@ main(int argc, long size; char *inbuf; struct sl_pp_purify_options options; - char errmsg[100] = ""; - unsigned int errline = 0; struct sl_pp_context *context; struct sl_pp_token_info *tokens; unsigned int version; -- cgit v1.2.3 From cc020425e929110613ddb405d3e82313d27a35ed Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 08:33:01 -0700 Subject: mesa: added new libglslpp.a and libglslcl.a to libGL build --- src/mesa/Makefile | 9 ++++----- src/mesa/sources.mak | 6 ++++++ 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mesa/Makefile b/src/mesa/Makefile index 67cac2d2480..56e40596c16 100644 --- a/src/mesa/Makefile +++ b/src/mesa/Makefile @@ -18,7 +18,6 @@ include sources.mak - # Default: build dependencies, then asm_subdirs, GLSL built-in lib, # then convenience libs (.a) and finally the device drivers: default: depend asm_subdirs glsl_builtin libmesa.a libmesagallium.a \ @@ -30,12 +29,12 @@ default: depend asm_subdirs glsl_builtin libmesa.a libmesagallium.a \ # Helper libraries used by many drivers: # Make archive of core mesa object files -libmesa.a: $(MESA_OBJECTS) - @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) +libmesa.a: $(MESA_OBJECTS) $(GLSL_LIBS) + @ $(MKLIB) -o mesa -static $(MESA_OBJECTS) $(GLSL_LIBS) # Make archive of subset of core mesa object files for gallium -libmesagallium.a: $(MESA_GALLIUM_OBJECTS) - @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) +libmesagallium.a: $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) + @ $(MKLIB) -o mesagallium -static $(MESA_GALLIUM_OBJECTS) $(GLSL_LIBS) # Make archive of gl* API dispatcher functions only libglapi.a: $(GLAPI_OBJECTS) diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 0c78733ea78..ea20f99edee 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -364,6 +364,12 @@ GLAPI_OBJECTS = \ COMMON_DRIVER_OBJECTS = $(COMMON_DRIVER_SOURCES:.c=.o) +### Other archives/libraries + +GLSL_LIBS = \ + $(TOP)/src/glsl/pp/libglslpp.a \ + $(TOP)/src/glsl/cl/libglslcl.a + ### Include directories -- cgit v1.2.3 From 289eab5389c0f0f3f85f872b2ba440f5e8416a50 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 10 Dec 2009 09:16:20 -0700 Subject: glsl/sl: fix _parse_boolconstant() Need to emit the radix before the digits. This fixes several glean/glgl1 regressions. --- src/glsl/cl/sl_cl_parse.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/glsl/cl/sl_cl_parse.c b/src/glsl/cl/sl_cl_parse.c index 81e30a8c28c..a9db65c7ad7 100644 --- a/src/glsl/cl/sl_cl_parse.c +++ b/src/glsl/cl/sl_cl_parse.c @@ -1821,6 +1821,7 @@ _parse_boolconstant(struct parse_context *ctx, { if (_parse_id(ctx, ctx->dict._false, ps) == 0) { _emit(ctx, &ps->out, OP_PUSH_BOOL); + _emit(ctx, &ps->out, 2); /* radix */ _emit(ctx, &ps->out, '0'); _emit(ctx, &ps->out, '\0'); return 0; @@ -1828,6 +1829,7 @@ _parse_boolconstant(struct parse_context *ctx, if (_parse_id(ctx, ctx->dict._true, ps) == 0) { _emit(ctx, &ps->out, OP_PUSH_BOOL); + _emit(ctx, &ps->out, 2); /* radix */ _emit(ctx, &ps->out, '1'); _emit(ctx, &ps->out, '\0'); return 0; -- cgit v1.2.3 From 491f384c3958067e6c4c994041f5d8d413b806bc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Thu, 10 Dec 2009 16:29:04 +0000 Subject: scons: Get GLSL code building correctly when cross compiling. This is quite messy. GLSL code has to be built twice: one for the host OS, another for the target OS. --- SConstruct | 19 +++++++++ src/SConscript | 4 +- src/gallium/winsys/gdi/SConscript | 2 +- src/glsl/SConscript | 68 ++++++++++++++++++++++++++++++++ src/glsl/apps/SConscript | 36 ----------------- src/glsl/cl/SConscript | 11 ------ src/glsl/pp/SConscript | 24 ----------- src/mesa/shader/slang/library/SConscript | 8 ++++ 8 files changed, 97 insertions(+), 75 deletions(-) create mode 100644 src/glsl/SConscript delete mode 100644 src/glsl/apps/SConscript delete mode 100644 src/glsl/cl/SConscript delete mode 100644 src/glsl/pp/SConscript diff --git a/SConstruct b/SConstruct index e9baab0947b..e71fcd673a0 100644 --- a/SConstruct +++ b/SConstruct @@ -160,6 +160,25 @@ Export('env') # TODO: Build several variants at the same time? # http://www.scons.org/wiki/SimultaneousVariantBuilds +if env['platform'] != common.default_platform: + # GLSL code has to be built twice -- one for the host OS, another for the target OS... + + host_env = Environment( + # options are ignored + # default tool is used + toolpath = ['#scons'], + ENV = os.environ, + ) + + host_env['platform'] = common.default_platform + + SConscript( + 'src/glsl/SConscript', + variant_dir = env['build'] + '/host', + duplicate = 0, # http://www.scons.org/doc/0.97/HTML/scons-user/x2261.html + exports={'env':host_env}, + ) + SConscript( 'src/SConscript', variant_dir = env['build'], diff --git a/src/SConscript b/src/SConscript index f7fac33790b..6083fcbec98 100644 --- a/src/SConscript +++ b/src/SConscript @@ -1,8 +1,6 @@ Import('*') -SConscript('glsl/pp/SConscript') -SConscript('glsl/cl/SConscript') -SConscript('glsl/apps/SConscript') +SConscript('glsl/SConscript') SConscript('gallium/SConscript') if 'mesa' in env['statetrackers']: diff --git a/src/gallium/winsys/gdi/SConscript b/src/gallium/winsys/gdi/SConscript index 5b6364a01df..9fbe9e800c3 100644 --- a/src/gallium/winsys/gdi/SConscript +++ b/src/gallium/winsys/gdi/SConscript @@ -39,5 +39,5 @@ if env['platform'] == 'windows': env.SharedLibrary( target ='opengl32', source = sources, - LIBS = wgl + glapi + mesa + drivers + auxiliaries + glsl + glslcl + env['LIBS'], + LIBS = wgl + glapi + mesa + drivers + auxiliaries + glsl + env['LIBS'], ) diff --git a/src/glsl/SConscript b/src/glsl/SConscript new file mode 100644 index 00000000000..6f1f81b199a --- /dev/null +++ b/src/glsl/SConscript @@ -0,0 +1,68 @@ +import common + +Import('*') + +env = env.Clone() + +sources = [ + 'pp/sl_pp_context.c', + 'pp/sl_pp_define.c', + 'pp/sl_pp_dict.c', + 'pp/sl_pp_error.c', + 'pp/sl_pp_expression.c', + 'pp/sl_pp_extension.c', + 'pp/sl_pp_if.c', + 'pp/sl_pp_line.c', + 'pp/sl_pp_macro.c', + 'pp/sl_pp_pragma.c', + 'pp/sl_pp_process.c', + 'pp/sl_pp_purify.c', + 'pp/sl_pp_token.c', + 'pp/sl_pp_version.c', + 'cl/sl_cl_parse.c', +] + +glsl = env.StaticLibrary( + target = 'glsl', + source = sources, +) + +Export('glsl') + +env = env.Clone() + +if env['platform'] == 'windows': + env.PrependUnique(LIBS = [ + 'user32', + ]) + +env.Prepend(LIBS = [glsl]) + +env.Program( + target = 'purify', + source = ['apps/purify.c'], +) + +env.Program( + target = 'tokenise', + source = ['apps/tokenise.c'], +) + +env.Program( + target = 'version', + source = ['apps/version.c'], +) + +env.Program( + target = 'process', + source = ['apps/process.c'], +) + +glsl_compile = env.Program( + target = 'compile', + source = ['apps/compile.c'], +) + +if env['platform'] == common.default_platform: + # Only export the GLSL compiler when building for the host platform + Export('glsl_compile') diff --git a/src/glsl/apps/SConscript b/src/glsl/apps/SConscript deleted file mode 100644 index 4c81b3be956..00000000000 --- a/src/glsl/apps/SConscript +++ /dev/null @@ -1,36 +0,0 @@ -Import('*') - -env = env.Clone() - -if env['platform'] == 'windows': - env.PrependUnique(LIBS = [ - 'user32', - ]) - -env.Prepend(LIBS = [glsl, glslcl]) - -env.Program( - target = 'purify', - source = ['purify.c'], -) - -env.Program( - target = 'tokenise', - source = ['tokenise.c'], -) - -env.Program( - target = 'version', - source = ['version.c'], -) - -env.Program( - target = 'process', - source = ['process.c'], -) - -glsl_compile = env.Program( - target = 'compile', - source = ['compile.c'], -) -Export('glsl_compile') diff --git a/src/glsl/cl/SConscript b/src/glsl/cl/SConscript deleted file mode 100644 index 9a4e4c15b6d..00000000000 --- a/src/glsl/cl/SConscript +++ /dev/null @@ -1,11 +0,0 @@ -Import('*') - -env = env.Clone() - -glslcl = env.StaticLibrary( - target = 'glslcl', - source = [ - 'sl_cl_parse.c', - ], -) -Export('glslcl') diff --git a/src/glsl/pp/SConscript b/src/glsl/pp/SConscript deleted file mode 100644 index 5bd615c8d7f..00000000000 --- a/src/glsl/pp/SConscript +++ /dev/null @@ -1,24 +0,0 @@ -Import('*') - -env = env.Clone() - -glsl = env.StaticLibrary( - target = 'glsl', - source = [ - 'sl_pp_context.c', - 'sl_pp_define.c', - 'sl_pp_dict.c', - 'sl_pp_error.c', - 'sl_pp_expression.c', - 'sl_pp_extension.c', - 'sl_pp_if.c', - 'sl_pp_line.c', - 'sl_pp_macro.c', - 'sl_pp_pragma.c', - 'sl_pp_process.c', - 'sl_pp_purify.c', - 'sl_pp_token.c', - 'sl_pp_version.c', - ], -) -Export('glsl') diff --git a/src/mesa/shader/slang/library/SConscript b/src/mesa/shader/slang/library/SConscript index 8b3fd03b6bc..ef131146be5 100644 --- a/src/mesa/shader/slang/library/SConscript +++ b/src/mesa/shader/slang/library/SConscript @@ -5,13 +5,21 @@ Import('*') env = env.Clone() +# See also http://www.scons.org/wiki/UsingCodeGenerators + +def glsl_compile_emitter(target, source, env): + env.Depends(target, glsl_compile) + return (target, source) + bld_frag = Builder( action = glsl_compile[0].abspath + ' fragment $SOURCE $TARGET', + emitter = glsl_compile_emitter, suffix = '.gc', src_suffix = '_gc.h') bld_vert = Builder( action = glsl_compile[0].abspath + ' vertex $SOURCE $TARGET', + emitter = glsl_compile_emitter, suffix = '.gc', src_suffix = '_gc.h') -- cgit v1.2.3 From 51e945ec9c0b803f5e998f87449fb02a7c39ae65 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 Dec 2009 09:16:37 -0800 Subject: intel: Attempt to fix up after "Update vertex texture code." The MaxCombinedTextureImageUnits is the total number of samplers that can be bound between vertex, geometry, and fragment, not 0. This should report the correct value on 965 now. Other DRI drivers may also need updating if their MaxVertexTextureImageUnits != 0 (for example, if using the sw vertex pipeline). It's not clear to me if there's going to be a valid value for this limit other than MaxTextureImageUnits + MaxVertexTextureImageUnits (+ MaxGeometryTextureImageUnits eventually). If not, then we should probably just move this into the core at Get time. Bug #25518 (wine regression). Fixes piglit vp-combined-image-units. --- src/mesa/drivers/dri/i915/i915_context.c | 3 +++ src/mesa/drivers/dri/i965/brw_context.c | 4 +++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i915/i915_context.c b/src/mesa/drivers/dri/i915/i915_context.c index 7d4c7cfbabb..0485be2cc1f 100644 --- a/src/mesa/drivers/dri/i915/i915_context.c +++ b/src/mesa/drivers/dri/i915/i915_context.c @@ -143,6 +143,9 @@ i915CreateContext(const __GLcontextModes * mesaVis, ctx->Const.MaxTextureImageUnits = I915_TEX_UNITS; ctx->Const.MaxTextureCoordUnits = I915_TEX_UNITS; ctx->Const.MaxVarying = I915_TEX_UNITS; + ctx->Const.MaxCombinedTextureImageUnits = + ctx->Const.MaxVertexTextureImageUnits + + ctx->Const.MaxTextureImageUnits; /* Advertise the full hardware capabilities. The new memory * manager should cope much better with overload situations: diff --git a/src/mesa/drivers/dri/i965/brw_context.c b/src/mesa/drivers/dri/i965/brw_context.c index 8bdda60697b..78bea829493 100644 --- a/src/mesa/drivers/dri/i965/brw_context.c +++ b/src/mesa/drivers/dri/i965/brw_context.c @@ -111,7 +111,9 @@ GLboolean brwCreateContext( const __GLcontextModes *mesaVis, ctx->Const.MaxTextureUnits = MIN2(ctx->Const.MaxTextureCoordUnits, ctx->Const.MaxTextureImageUnits); ctx->Const.MaxVertexTextureImageUnits = 0; /* no vertex shader textures */ - ctx->Const.MaxCombinedTextureImageUnits = 0; + ctx->Const.MaxCombinedTextureImageUnits = + ctx->Const.MaxVertexTextureImageUnits + + ctx->Const.MaxTextureImageUnits; /* Mesa limits textures to 4kx4k; it would be nice to fix that someday */ -- cgit v1.2.3 From 690d888416909f0449e6ebbfa46f18079b68b1bd Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Wed, 18 Nov 2009 12:06:32 -0500 Subject: st/xorg: enable yv12 for xv --- src/gallium/state_trackers/xorg/xorg_xv.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index b3315dccad8..fdc1cdb82ee 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -73,10 +73,11 @@ static XF86VideoEncodingRec DummyEncoding[1] = { } }; -#define NUM_IMAGES 2 +#define NUM_IMAGES 3 static XF86ImageRec Images[NUM_IMAGES] = { XVIMAGE_UYVY, XVIMAGE_YUY2, + XVIMAGE_YV12, }; struct xorg_xv_port_priv { @@ -532,6 +533,7 @@ put_image(ScrnInfoPtr pScrn, switch (id) { case FOURCC_UYVY: case FOURCC_YUY2: + case FOURCC_YV12: default: srcPitch = width << 1; break; @@ -580,6 +582,7 @@ query_image_attributes(ScrnInfoPtr pScrn, switch (id) { case FOURCC_UYVY: case FOURCC_YUY2: + case FOURCC_YV12: default: size = *w << 1; if (pitches) -- cgit v1.2.3 From 967e6e20099ebd3a7f68f49233e6cf3c99ce3317 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Thu, 10 Dec 2009 13:01:53 -0500 Subject: st/xorg: fix yv12 plus some cleanups in the upload code --- src/gallium/state_trackers/xorg/xorg_xv.c | 127 ++++++++++++++++-------------- 1 file changed, 70 insertions(+), 57 deletions(-) diff --git a/src/gallium/state_trackers/xorg/xorg_xv.c b/src/gallium/state_trackers/xorg/xorg_xv.c index fdc1cdb82ee..19c50051a85 100644 --- a/src/gallium/state_trackers/xorg/xorg_xv.c +++ b/src/gallium/state_trackers/xorg/xorg_xv.c @@ -213,17 +213,67 @@ check_yuv_textures(struct xorg_xv_port_priv *priv, int width, int height) return Success; } +static int +query_image_attributes(ScrnInfoPtr pScrn, + int id, + unsigned short *w, unsigned short *h, + int *pitches, int *offsets) +{ + int size, tmp; + + if (*w > IMAGE_MAX_WIDTH) + *w = IMAGE_MAX_WIDTH; + if (*h > IMAGE_MAX_HEIGHT) + *h = IMAGE_MAX_HEIGHT; + + *w = (*w + 1) & ~1; + if (offsets) + offsets[0] = 0; + + switch (id) { + case FOURCC_YV12: + *h = (*h + 1) & ~1; + size = (*w + 3) & ~3; + if (pitches) { + pitches[0] = size; + } + size *= *h; + if (offsets) { + offsets[1] = size; + } + tmp = ((*w >> 1) + 3) & ~3; + if (pitches) { + pitches[1] = pitches[2] = tmp; + } + tmp *= (*h >> 1); + size += tmp; + if (offsets) { + offsets[2] = size; + } + size += tmp; + break; + case FOURCC_UYVY: + case FOURCC_YUY2: + default: + size = *w << 1; + if (pitches) + pitches[0] = size; + size *= *h; + break; + } + + return size; +} + static void copy_packed_data(ScrnInfoPtr pScrn, struct xorg_xv_port_priv *port, int id, unsigned char *buf, - int srcPitch, int left, int top, - int w, int h) + unsigned short w, unsigned short h) { - unsigned char *src; int i, j; struct pipe_texture **dst = port->yuv[port->current_set]; struct pipe_transfer *ytrans, *utrans, *vtrans; @@ -233,8 +283,6 @@ copy_packed_data(ScrnInfoPtr pScrn, int yidx, uidx, vidx; int y_array_size = w * h; - src = buf + (top * srcPitch) + (left << 1); - ytrans = screen->get_tex_transfer(screen, dst[0], 0, 0, 0, PIPE_TRANSFER_WRITE, @@ -256,15 +304,22 @@ copy_packed_data(ScrnInfoPtr pScrn, switch (id) { case FOURCC_YV12: { - for (i = 0; i < w; ++i) { - for (j = 0; j < h; ++j) { - /*XXX use src? */ - y1 = buf[j*w + i]; - u = buf[(j/2) * (w/2) + i/2 + y_array_size]; - v = buf[(j/2) * (w/2) + i/2 + y_array_size + y_array_size/4]; - ymap[yidx++] = y1; - umap[uidx++] = u; - vmap[vidx++] = v; + int pitches[3], offsets[3]; + unsigned char *y, *u, *v; + query_image_attributes(pScrn, FOURCC_YV12, + &w, &h, pitches, offsets); + + y = buf + offsets[0]; + v = buf + offsets[1]; + u = buf + offsets[2]; + for (i = 0; i < h; ++i) { + for (j = 0; j < w; ++j) { + int yoffset = (w*i+j); + int ii = (i|1), jj = (j|1); + int vuoffset = (w/2)*(ii/2) + (jj/2); + ymap[yidx++] = y[yoffset]; + umap[uidx++] = u[vuoffset]; + vmap[vidx++] = v[vuoffset]; } } } @@ -511,7 +566,6 @@ put_image(ScrnInfoPtr pScrn, ScreenPtr pScreen = screenInfo.screens[pScrn->scrnIndex]; PixmapPtr pPixmap; INT32 x1, x2, y1, y2; - int srcPitch; BoxRec dstBox; int ret; @@ -530,21 +584,12 @@ put_image(ScrnInfoPtr pScrn, width, height)) return Success; - switch (id) { - case FOURCC_UYVY: - case FOURCC_YUY2: - case FOURCC_YV12: - default: - srcPitch = width << 1; - break; - } - ret = check_yuv_textures(pPriv, width, height); if (ret) return ret; - copy_packed_data(pScrn, pPriv, id, buf, srcPitch, + copy_packed_data(pScrn, pPriv, id, buf, src_x, src_y, width, height); if (pDraw->type == DRAWABLE_WINDOW) { @@ -562,38 +607,6 @@ put_image(ScrnInfoPtr pScrn, return Success; } -static int -query_image_attributes(ScrnInfoPtr pScrn, - int id, - unsigned short *w, unsigned short *h, - int *pitches, int *offsets) -{ - int size; - - if (*w > IMAGE_MAX_WIDTH) - *w = IMAGE_MAX_WIDTH; - if (*h > IMAGE_MAX_HEIGHT) - *h = IMAGE_MAX_HEIGHT; - - *w = (*w + 1) & ~1; - if (offsets) - offsets[0] = 0; - - switch (id) { - case FOURCC_UYVY: - case FOURCC_YUY2: - case FOURCC_YV12: - default: - size = *w << 1; - if (pitches) - pitches[0] = size; - size *= *h; - break; - } - - return size; -} - static struct xorg_xv_port_priv * port_priv_create(struct xorg_renderer *r) { -- cgit v1.2.3 From cb640c8d40c4ee34160a14d646c244f44a5013f6 Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Thu, 10 Dec 2009 10:03:16 -0800 Subject: mesa: Fix default (swrast) GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS. The swrast pipeline shouldn't have any problem with all the frag and vert textures being bound at the same time. Note that this may result in DRI drivers that don't set this limit having an improbable return (fragment + vertex < combined), but it seems like it shouldn't cause problems for apps. --- src/mesa/main/config.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/main/config.h b/src/mesa/main/config.h index c5048970cca..2eac1cc2ed9 100644 --- a/src/mesa/main/config.h +++ b/src/mesa/main/config.h @@ -243,7 +243,8 @@ /*@{*/ #define MAX_VERTEX_GENERIC_ATTRIBS 16 #define MAX_VERTEX_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS -#define MAX_COMBINED_TEXTURE_IMAGE_UNITS MAX_TEXTURE_IMAGE_UNITS +#define MAX_COMBINED_TEXTURE_IMAGE_UNITS (MAX_VERTEX_TEXTURE_IMAGE_UNITS + \ + MAX_TEXTURE_IMAGE_UNITS) /*@}*/ -- cgit v1.2.3 From dcb4a37fc89924192d923ed6906d2922371b8cb1 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 12:11:09 -0800 Subject: mesa: Fix array out-of-bounds access by _mesa_TexParameteriv. --- src/mesa/main/texparam.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c index 1cec4b82fea..0f83d226f28 100644 --- a/src/mesa/main/texparam.c +++ b/src/mesa/main/texparam.c @@ -700,8 +700,10 @@ _mesa_TexParameteriv(GLenum target, GLenum pname, const GLint *params) case GL_TEXTURE_COMPARE_FAIL_VALUE_ARB: { /* convert int param to float */ - GLfloat fparam = (GLfloat) params[0]; - need_update = set_tex_parameterf(ctx, texObj, pname, &fparam); + GLfloat fparams[4]; + fparams[0] = (GLfloat) params[0]; + fparams[1] = fparams[2] = fparams[3] = 0.0F; + need_update = set_tex_parameterf(ctx, texObj, pname, fparams); } break; default: -- cgit v1.2.3 From 51f52edaf186a927a2c8c29ba9dba56d18928a7e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 12:37:10 -0800 Subject: glsl: Fix array out-of-bounds access by _slang_lookup_constant. --- src/mesa/shader/slang/slang_simplify.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index b8a21f642cb..539c6ff0d14 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,10 +84,11 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint value = -1; - _mesa_GetIntegerv(info[i].Token, &value); - ASSERT(value >= 0); /* sanity check that glGetFloatv worked */ - return value; + GLint values[4]; + values[0] = -1; + _mesa_GetIntegerv(info[i].Token, values); + ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ + return values[0]; } } return -1; -- cgit v1.2.3 From bc0509bba8cc962a4ee2dafd684e153b3060262d Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 13:24:15 -0800 Subject: progs/util: Byte swap individual members of struct _rawImageRec. --- progs/util/readtex.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/progs/util/readtex.c b/progs/util/readtex.c index 81cb626e911..d1c50a494aa 100644 --- a/progs/util/readtex.c +++ b/progs/util/readtex.c @@ -117,7 +117,12 @@ static rawImageRec *RawImageOpen(const char *fileName) fread(raw, 1, 12, raw->file); if (swapFlag) { - ConvertShort(&raw->imagic, 6); + ConvertShort(&raw->imagic, 1); + ConvertShort(&raw->type, 1); + ConvertShort(&raw->dim, 1); + ConvertShort(&raw->sizeX, 1); + ConvertShort(&raw->sizeY, 1); + ConvertShort(&raw->sizeZ, 1); } raw->tmp = (unsigned char *)malloc(raw->sizeX*256); -- cgit v1.2.3 From 539a14a1dd5a0d277b193d9cd2d06423ed98dc8a Mon Sep 17 00:00:00 2001 From: Eric Anholt Date: Wed, 9 Dec 2009 11:36:45 -0800 Subject: intel: Flush the render/texture cache when finishing render to texture. Back when we were flushing the entire batch at BindFramebuffer, the kernel would notice the domain transition when someone went to texture from it and flush for us. We no longer do the batch flushing every time, so we get to do aggressive flushing until we move batchbuffer handling to libdrm. Fixes piglit fbo-flushing. Bug #25377. No noticeable performance loss on cairo-gl (so this is better than batch flushing). --- src/mesa/drivers/dri/intel/intel_fbo.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5615040946f..679fa2f82a2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -37,6 +37,7 @@ #include "drivers/common/meta.h" #include "intel_context.h" +#include "intel_batchbuffer.h" #include "intel_buffers.h" #include "intel_fbo.h" #include "intel_mipmap_tree.h" @@ -591,6 +592,7 @@ static void intel_finish_render_texture(GLcontext * ctx, struct gl_renderbuffer_attachment *att) { + struct intel_context *intel = intel_context(ctx); struct gl_texture_object *tex_obj = att->Texture; struct gl_texture_image *image = tex_obj->Image[att->CubeMapFace][att->TextureLevel]; @@ -598,8 +600,14 @@ intel_finish_render_texture(GLcontext * ctx, /* Flag that this image may now be validated into the object's miptree. */ intel_image->used_as_render_target = GL_FALSE; -} + /* Since we've (probably) rendered to the texture and will (likely) use + * it in the texture domain later on in this batchbuffer, flush the + * batch. Once again, we wish for a domain tracker in libdrm to cover + * usage inside of a batchbuffer like GEM does in the kernel. + */ + intel_batchbuffer_emit_mi_flush(intel->batch); +} /** * Do additional "completeness" testing of a framebuffer object. -- cgit v1.2.3 From 3078bd136d6ee1d9ad16b4c834cad23b005304a4 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 09:57:27 -0800 Subject: intel: Axe intel_renderbuffer::texformat Since the texformat branch merge, the value of intel_renderbuffer::texformat is just a copy of gl_renderbuffer::Format. --- src/mesa/drivers/dri/i915/i830_vtbl.c | 4 ++-- src/mesa/drivers/dri/i915/i915_vtbl.c | 4 ++-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 4 ++-- src/mesa/drivers/dri/intel/intel_blit.c | 4 ++-- src/mesa/drivers/dri/intel/intel_fbo.c | 13 ++----------- src/mesa/drivers/dri/intel/intel_fbo.h | 2 -- src/mesa/drivers/dri/intel/intel_span.c | 6 +++--- 7 files changed, 13 insertions(+), 24 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i830_vtbl.c b/src/mesa/drivers/dri/i915/i830_vtbl.c index a6f554701e6..e8c8d5a0486 100644 --- a/src/mesa/drivers/dri/i915/i830_vtbl.c +++ b/src/mesa/drivers/dri/i915/i830_vtbl.c @@ -645,7 +645,7 @@ i830_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | DEPTH_IS_Z); /* .5 */ if (irb != NULL) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; @@ -661,7 +661,7 @@ i830_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); } } diff --git a/src/mesa/drivers/dri/i915/i915_vtbl.c b/src/mesa/drivers/dri/i915/i915_vtbl.c index 77ba8d55819..ff97e5a944f 100644 --- a/src/mesa/drivers/dri/i915/i915_vtbl.c +++ b/src/mesa/drivers/dri/i915/i915_vtbl.c @@ -587,7 +587,7 @@ i915_state_draw_region(struct intel_context *intel, DSTORG_VERT_BIAS(0x8) | /* .5 */ LOD_PRECLAMP_OGL | TEX_DEFAULT_COLOR_OGL); if (irb != NULL) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: value |= DV_PF_8888; @@ -603,7 +603,7 @@ i915_state_draw_region(struct intel_context *intel, break; default: _mesa_problem(ctx, "Bad renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); } } diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 47035cc6fc1..b7b6eaec2bb 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -537,7 +537,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, region_bo = region->buffer; key.surface_type = BRW_SURFACE_2D; - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; @@ -554,7 +554,7 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.surface_format = BRW_SURFACEFORMAT_B4G4R4A4_UNORM; break; default: - _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->texformat); + _mesa_problem(ctx, "Bad renderbuffer format: %d\n", irb->Base.Format); } key.tiling = region->tiling; if (brw->intel.intelScreen->driScrnPriv->dri2.enabled) { diff --git a/src/mesa/drivers/dri/intel/intel_blit.c b/src/mesa/drivers/dri/intel/intel_blit.c index 817223da41d..9f638b0ef98 100644 --- a/src/mesa/drivers/dri/intel/intel_blit.c +++ b/src/mesa/drivers/dri/intel/intel_blit.c @@ -496,7 +496,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) CLAMPED_FLOAT_TO_UBYTE(clear[2], color[2]); CLAMPED_FLOAT_TO_UBYTE(clear[3], color[3]); - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: clearVal = intel->ClearColor8888; @@ -514,7 +514,7 @@ intelClearWithBlit(GLcontext *ctx, GLbitfield mask) break; default: _mesa_problem(ctx, "Unexpected renderbuffer format: %d\n", - irb->texformat); + irb->Base.Format); clearVal = 0; } } diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 679fa2f82a2..649fd1a78f4 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -117,7 +117,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB5: rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_RGB565; cpp = 2; break; case GL_RGB: @@ -125,9 +124,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->Format = MESA_FORMAT_ARGB8888; + rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ cpp = 4; break; case GL_RGBA: @@ -140,7 +138,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGBA16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - irb->texformat = MESA_FORMAT_ARGB8888; cpp = 4; break; case GL_STENCIL_INDEX: @@ -152,13 +149,11 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_COMPONENT16: rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; cpp = 2; - irb->texformat = MESA_FORMAT_Z16; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: @@ -166,14 +161,12 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; cpp = 4; - irb->texformat = MESA_FORMAT_S8_Z24; break; default: _mesa_problem(ctx, @@ -347,7 +340,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.Format = format; irb->Base.InternalFormat = irb->Base._BaseFormat; - irb->texformat = format; /* intel-specific methods */ irb->Base.Delete = intel_delete_renderbuffer; @@ -424,7 +416,6 @@ static GLboolean intel_update_wrapper(GLcontext *ctx, struct intel_renderbuffer *irb, struct gl_texture_image *texImage) { - irb->texformat = texImage->TexFormat; gl_format texFormat; if (texImage->TexFormat == MESA_FORMAT_ARGB8888) { @@ -640,7 +631,7 @@ intel_validate_framebuffer(GLcontext *ctx, struct gl_framebuffer *fb) continue; } - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_ARGB8888: case MESA_FORMAT_XRGB8888: case MESA_FORMAT_RGB565: diff --git a/src/mesa/drivers/dri/intel/intel_fbo.h b/src/mesa/drivers/dri/intel/intel_fbo.h index 50a8a959858..fa43077d6a7 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.h +++ b/src/mesa/drivers/dri/intel/intel_fbo.h @@ -62,8 +62,6 @@ struct intel_renderbuffer struct gl_renderbuffer Base; struct intel_region *region; - gl_format texformat; - GLuint vbl_pending; /**< vblank sequence number of pending flip */ uint8_t *span_cache; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 3607c7ddedd..f02fbe9875c 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -624,7 +624,7 @@ intel_set_span_functions(struct intel_context *intel, tiling = I915_TILING_NONE; if (intel->intelScreen->kernel_exec_fencing) { - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_RGB565: intel_gttmap_InitPointers_RGB565(rb); break; @@ -667,13 +667,13 @@ intel_set_span_functions(struct intel_context *intel, default: _mesa_problem(NULL, "Unexpected MesaFormat %d in intelSetSpanFunctions", - irb->texformat); + irb->Base.Format); break; } return; } - switch (irb->texformat) { + switch (irb->Base.Format) { case MESA_FORMAT_RGB565: switch (tiling) { case I915_TILING_NONE: -- cgit v1.2.3 From 4eee46efcb7e1f737b7115caf48ddb3b77408626 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 15:51:18 -0800 Subject: intel: softwareBuffer in intel_alloc_renderbuffer_storage was always false, remove --- src/mesa/drivers/dri/intel/intel_fbo.c | 37 ++++++++++++++-------------------- 1 file changed, 15 insertions(+), 22 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 649fd1a78f4..9a304b0351a 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -106,8 +106,8 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, { struct intel_context *intel = intel_context(ctx); struct intel_renderbuffer *irb = intel_renderbuffer(rb); - GLboolean softwareBuffer = GL_FALSE; int cpp; + GLuint pitch; ASSERT(rb->Name != 0); @@ -184,32 +184,25 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } /* allocate new memory region/renderbuffer */ - if (softwareBuffer) { - return _mesa_soft_renderbuffer_storage(ctx, rb, internalFormat, - width, height); - } - else { - /* Choose a pitch to match hardware requirements: - */ - GLuint pitch = ((cpp * width + 63) & ~63) / cpp; - /* alloc hardware renderbuffer */ - DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, - height, pitch); + /* Choose a pitch to match hardware requirements: + */ + pitch = ((cpp * width + 63) & ~63) / cpp; - irb->region = intel_region_alloc(intel, I915_TILING_NONE, - cpp, width, height, pitch, - GL_TRUE); - if (!irb->region) - return GL_FALSE; /* out of memory? */ + /* alloc hardware renderbuffer */ + DBG("Allocating %d x %d Intel RBO (pitch %d)\n", width, height, pitch); - ASSERT(irb->region->buffer); + irb->region = intel_region_alloc(intel, I915_TILING_NONE, cpp, + width, height, pitch, GL_TRUE); + if (!irb->region) + return GL_FALSE; /* out of memory? */ - rb->Width = width; - rb->Height = height; + ASSERT(irb->region->buffer); - return GL_TRUE; - } + rb->Width = width; + rb->Height = height; + + return GL_TRUE; } -- cgit v1.2.3 From 0f01674a584ea6df96acf91d7cd3b8a9b48ee65e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 16:06:13 -0800 Subject: intel: Use texformat accessor to get bytes-per-pixel --- src/mesa/drivers/dri/intel/intel_fbo.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 9a304b0351a..5a67cb13886 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -117,7 +117,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB5: rb->Format = MESA_FORMAT_RGB565; rb->DataType = GL_UNSIGNED_BYTE; - cpp = 2; break; case GL_RGB: case GL_RGB8: @@ -126,7 +125,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB16: rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ rb->DataType = GL_UNSIGNED_BYTE; - cpp = 4; break; case GL_RGBA: case GL_RGBA2: @@ -138,7 +136,6 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGBA16: rb->Format = MESA_FORMAT_ARGB8888; rb->DataType = GL_UNSIGNED_BYTE; - cpp = 4; break; case GL_STENCIL_INDEX: case GL_STENCIL_INDEX1_EXT: @@ -148,25 +145,21 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, /* alloc a depth+stencil buffer */ rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; case GL_DEPTH_COMPONENT16: rb->Format = MESA_FORMAT_Z16; rb->DataType = GL_UNSIGNED_SHORT; - cpp = 2; break; case GL_DEPTH_COMPONENT: case GL_DEPTH_COMPONENT24: case GL_DEPTH_COMPONENT32: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; case GL_DEPTH_STENCIL_EXT: case GL_DEPTH24_STENCIL8_EXT: rb->Format = MESA_FORMAT_S8_Z24; rb->DataType = GL_UNSIGNED_INT_24_8_EXT; - cpp = 4; break; default: _mesa_problem(ctx, @@ -175,6 +168,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, } rb->_BaseFormat = _mesa_base_fbo_format(ctx, internalFormat); + cpp = _mesa_get_format_bytes(rb->Format); intelFlush(ctx); -- cgit v1.2.3 From 430876cd3a70d3b701d136b825518140888f96c8 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 17:03:20 -0800 Subject: intel: name in intel_create_renderbuffer was always 0, remove --- src/mesa/drivers/dri/intel/intel_fbo.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 5a67cb13886..970ffb2e4d2 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -278,7 +278,6 @@ intel_create_renderbuffer(gl_format format) GET_CURRENT_CONTEXT(ctx); struct intel_renderbuffer *irb; - const GLuint name = 0; irb = CALLOC_STRUCT(intel_renderbuffer); if (!irb) { @@ -286,7 +285,7 @@ intel_create_renderbuffer(gl_format format) return NULL; } - _mesa_init_renderbuffer(&irb->Base, name); + _mesa_init_renderbuffer(&irb->Base, 0); irb->Base.ClassID = INTEL_RB_CLASS; switch (format) { -- cgit v1.2.3 From ffc1f299e9eaa6eaa4b5586b9fb13132564bd3ae Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:10:45 -0800 Subject: spantmp2: Add support for GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV This is really for MESA_FORMAT_XRGB8888. Clearly spantmp2.h needs some re-work. Any volunteers? --- src/mesa/drivers/dri/common/spantmp2.h | 57 ++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/src/mesa/drivers/dri/common/spantmp2.h b/src/mesa/drivers/dri/common/spantmp2.h index 95f97414a98..447f3d15b95 100644 --- a/src/mesa/drivers/dri/common/spantmp2.h +++ b/src/mesa/drivers/dri/common/spantmp2.h @@ -356,6 +356,63 @@ } while (0) # endif +#elif (SPANTMP_PIXEL_FMT == GL_BGR) && (SPANTMP_PIXEL_TYPE == GL_UNSIGNED_INT_8_8_8_8_REV) + +/** + ** GL_BGR, GL_UNSIGNED_INT_8_8_8_8_REV + ** + ** This is really for MESA_FORMAT_XRGB8888. The spantmp code needs to be + ** kicked to the curb, and we need to just code-gen this. + **/ + +#ifndef GET_VALUE +#ifndef GET_PTR +#define GET_PTR(_x, _y) ( buf + (_x) * 4 + (_y) * pitch) +#endif + +#define GET_VALUE(_x, _y) *(volatile GLuint *)(GET_PTR(_x, _y)) +#define PUT_VALUE(_x, _y, _v) *(volatile GLuint *)(GET_PTR(_x, _y)) = (_v) +#endif /* GET_VALUE */ + +# define INIT_MONO_PIXEL(p, color) \ + p = PACK_COLOR_8888(0xff, color[0], color[1], color[2]) + +# define WRITE_RGBA(_x, _y, r, g, b, a) \ + PUT_VALUE(_x, _y, ((r << 16) | \ + (g << 8) | \ + (b << 0) | \ + (0xff << 24))) + +#define WRITE_PIXEL(_x, _y, p) PUT_VALUE(_x, _y, p) + +# if defined( USE_X86_ASM ) +# define READ_RGBA(rgba, _x, _y) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + __asm__ __volatile__( "bswap %0; rorl $8, %0" \ + : "=r" (p) : "0" (p) ); \ + ((GLuint *)rgba)[0] = p | 0xff000000; \ + } while (0) +# elif defined( MESA_BIG_ENDIAN ) + /* On PowerPC with GCC 3.4.2 the shift madness below becomes a single + * rotlwi instruction. It also produces good code on SPARC. + */ +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + *((uint32_t *) rgba) = (t << 8) | 0xff; \ + } while (0) +# else +# define READ_RGBA( rgba, _x, _y ) \ + do { \ + GLuint p = GET_VALUE(_x, _y); \ + rgba[0] = (p >> 16) & 0xff; \ + rgba[1] = (p >> 8) & 0xff; \ + rgba[2] = (p >> 0) & 0xff; \ + rgba[3] = 0xff; \ + } while (0) +# endif + #else #error SPANTMP_PIXEL_FMT must be set to a valid value! #endif -- cgit v1.2.3 From 4f2b2032f46939b6056f837a086e73f0417183fc Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:12:18 -0800 Subject: intel: Use spantmp2 GL_BGR / GL_UNSIGNED_INT_8_8_8_8_REV for XRGB8888 --- src/mesa/drivers/dri/intel/intel_span.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index f02fbe9875c..725ba5c97d6 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -334,7 +334,7 @@ static uint32_t y_tile_swizzle(struct intel_renderbuffer *irb, #include "intel_spantmp.h" /* x8r8g8b8 color span and pixel functions */ -#define INTEL_PIXEL_FMT GL_BGRA +#define INTEL_PIXEL_FMT GL_BGR #define INTEL_PIXEL_TYPE GL_UNSIGNED_INT_8_8_8_8_REV #define INTEL_READ_VALUE(offset) pread_xrgb8888(irb, offset) #define INTEL_WRITE_VALUE(offset, v) pwrite_xrgb8888(irb, offset, v) -- cgit v1.2.3 From eadd9b8e16e3b1ad35fec54f780a0f94ac43988f Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:13:05 -0800 Subject: i965: Fix handling of drawing to MESA_FORMAT_XRGB8888 It turns out that 965 and friends cannot actually render to an xRGB surfaces. Instead, the surface has to be RGBA with writes to alpha disabled and the blend function modified to always use 1.0 for destination alpha. --- src/mesa/drivers/dri/i965/brw_cc.c | 34 ++++++++++++++++++++++++ src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 17 +++++++++--- 2 files changed, 48 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i965/brw_cc.c b/src/mesa/drivers/dri/i965/brw_cc.c index d4ccd28c9e8..ab301b9a3a0 100644 --- a/src/mesa/drivers/dri/i965/brw_cc.c +++ b/src/mesa/drivers/dri/i965/brw_cc.c @@ -34,6 +34,7 @@ #include "brw_state.h" #include "brw_defines.h" #include "brw_util.h" +#include "intel_fbo.h" #include "main/macros.h" #include "main/enums.h" @@ -89,6 +90,28 @@ struct brw_cc_unit_key { GLenum depth_func; }; +/** + * Modify blend function to force destination alpha to 1.0 + * + * If \c function specifies a blend function that uses destination alpha, + * replace it with a function that hard-wires destination alpha to 1.0. This + * is used when rendering to xRGB targets. + */ +static GLenum +fix_xRGB_alpha(GLenum function) +{ + switch (function) { + case GL_DST_ALPHA: + return GL_ONE; + + case GL_ONE_MINUS_DST_ALPHA: + case GL_SRC_ALPHA_SATURATE: + return GL_ZERO; + } + + return function; +} + static void cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) { @@ -132,6 +155,17 @@ cc_unit_populate_key(struct brw_context *brw, struct brw_cc_unit_key *key) key->blend_dst_rgb = ctx->Color.BlendDstRGB; key->blend_src_a = ctx->Color.BlendSrcA; key->blend_dst_a = ctx->Color.BlendDstA; + + /* If the renderbuffer is XRGB, we have to frob the blend function to + * force the destination alpha to 1.0. This means replacing GL_DST_ALPHA + * with GL_ONE and GL_ONE_MINUS_DST_ALPAH with GL_ZERO. + */ + if (ctx->Visual.alphaBits == 0) { + key->blend_src_rgb = fix_xRGB_alpha(key->blend_src_rgb); + key->blend_src_a = fix_xRGB_alpha(key->blend_src_a); + key->blend_dst_rgb = fix_xRGB_alpha(key->blend_dst_rgb); + key->blend_dst_a = fix_xRGB_alpha(key->blend_dst_a); + } } key->alpha_enabled = ctx->Color.AlphaEnabled; diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index b7b6eaec2bb..74cf66f9f8b 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -538,11 +538,15 @@ brw_update_renderbuffer_surface(struct brw_context *brw, key.surface_type = BRW_SURFACE_2D; switch (irb->Base.Format) { + /* XRGB and ARGB are treated the same here because the chips in this + * family cannot render to XRGB targets. This means that we have to + * mask writes to alpha (ala glColorMask) and reconfigure the alpha + * blending hardware to use GL_ONE (or GL_ZERO) for cases where + * GL_DST_ALPHA (or GL_ONE_MINUS_DST_ALPHA) is used. + */ case MESA_FORMAT_ARGB8888: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; - break; case MESA_FORMAT_XRGB8888: - key.surface_format = BRW_SURFACEFORMAT_B8G8R8X8_UNORM; + key.surface_format = BRW_SURFACEFORMAT_B8G8R8A8_UNORM; break; case MESA_FORMAT_RGB565: key.surface_format = BRW_SURFACEFORMAT_B5G6R5_UNORM; @@ -579,6 +583,13 @@ brw_update_renderbuffer_surface(struct brw_context *brw, /* _NEW_COLOR */ memcpy(key.color_mask, ctx->Color.ColorMask, sizeof(key.color_mask)); + + /* As mentioned above, disable writes to the alpha component when the + * renderbuffer is XRGB. + */ + if (ctx->Visual.alphaBits == 0) + key.color_mask[3] = GL_FALSE; + key.color_blend = (!ctx->Color._LogicOpEnabled && ctx->Color.BlendEnabled); -- cgit v1.2.3 From cbdeb33209e782f011984a4b93cc0d36f567462e Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 21:15:36 -0800 Subject: intel: Make RGB renderbuffers use XRGB8888 like we do for RGB system buffers. --- src/mesa/drivers/dri/intel/intel_fbo.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_fbo.c b/src/mesa/drivers/dri/intel/intel_fbo.c index 970ffb2e4d2..608f75b8240 100644 --- a/src/mesa/drivers/dri/intel/intel_fbo.c +++ b/src/mesa/drivers/dri/intel/intel_fbo.c @@ -123,7 +123,7 @@ intel_alloc_renderbuffer_storage(GLcontext * ctx, struct gl_renderbuffer *rb, case GL_RGB10: case GL_RGB12: case GL_RGB16: - rb->Format = MESA_FORMAT_ARGB8888; /* XXX: Need xrgb8888 */ + rb->Format = MESA_FORMAT_XRGB8888; rb->DataType = GL_UNSIGNED_BYTE; break; case GL_RGBA: @@ -294,10 +294,6 @@ intel_create_renderbuffer(gl_format format) irb->Base.DataType = GL_UNSIGNED_BYTE; break; case MESA_FORMAT_XRGB8888: - /* XXX this is a hack since XRGB surfaces don't seem to work - * properly yet. Reading the alpha channel returns 0 instead of 1. - */ - format = MESA_FORMAT_ARGB8888; irb->Base._BaseFormat = GL_RGB; irb->Base.DataType = GL_UNSIGNED_BYTE; break; -- cgit v1.2.3 From b4a6169412819cc3a027c6a118f0537911145a30 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 23:24:58 -0800 Subject: intel: Make RGB textures use XRGB8888 --- src/mesa/drivers/dri/intel/intel_tex_format.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/intel/intel_tex_format.c b/src/mesa/drivers/dri/intel/intel_tex_format.c index bfa3dba1f5c..87efb72cc51 100644 --- a/src/mesa/drivers/dri/intel/intel_tex_format.c +++ b/src/mesa/drivers/dri/intel/intel_tex_format.c @@ -50,8 +50,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, if (format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5) { return MESA_FORMAT_RGB565; } - /* XXX use MESA_FORMAT_XRGB8888 someday */ - return do32bpt ? MESA_FORMAT_ARGB8888 : MESA_FORMAT_RGB565; + return do32bpt ? MESA_FORMAT_XRGB8888 : MESA_FORMAT_RGB565; case GL_RGBA8: case GL_RGB10_A2: @@ -70,8 +69,7 @@ intelChooseTextureFormat(GLcontext * ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - /* XXX use MESA_FORMAT_XRGB8888 someday */ - return MESA_FORMAT_ARGB8888; + return MESA_FORMAT_XRGB8888; case GL_RGB5: case GL_RGB4: -- cgit v1.2.3 From e624b77eb2d594cde053c73a530836e05227126a Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 8 Dec 2009 23:25:26 -0800 Subject: intel: Remove ARGB internal_format == GL_RGB hacks Now that XRGB is supported, we don't need to hack around cases of an RGBA format buffer with an internal format of GL_RGB. --- src/mesa/drivers/dri/i915/i830_texstate.c | 5 +-- src/mesa/drivers/dri/i915/i915_texstate.c | 5 +-- src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 10 +---- src/mesa/drivers/dri/intel/intel_span.c | 49 +++++++----------------- 4 files changed, 17 insertions(+), 52 deletions(-) diff --git a/src/mesa/drivers/dri/i915/i830_texstate.c b/src/mesa/drivers/dri/i915/i830_texstate.c index f4bbb53b863..ce409b3a60c 100644 --- a/src/mesa/drivers/dri/i915/i830_texstate.c +++ b/src/mesa/drivers/dri/i915/i830_texstate.c @@ -55,10 +55,7 @@ translate_texture_format(GLuint mesa_format, GLuint internal_format) case MESA_FORMAT_ARGB4444: return MAPSURF_16BIT | MT_16BIT_ARGB4444; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return MAPSURF_32BIT | MT_32BIT_XRGB8888; - else - return MAPSURF_32BIT | MT_32BIT_ARGB8888; + return MAPSURF_32BIT | MT_32BIT_ARGB8888; case MESA_FORMAT_XRGB8888: return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: diff --git a/src/mesa/drivers/dri/i915/i915_texstate.c b/src/mesa/drivers/dri/i915/i915_texstate.c index d6689af53f6..f52ff2bcc4a 100644 --- a/src/mesa/drivers/dri/i915/i915_texstate.c +++ b/src/mesa/drivers/dri/i915/i915_texstate.c @@ -56,10 +56,7 @@ translate_texture_format(gl_format mesa_format, GLuint internal_format, case MESA_FORMAT_ARGB4444: return MAPSURF_16BIT | MT_16BIT_ARGB4444; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return MAPSURF_32BIT | MT_32BIT_XRGB8888; - else - return MAPSURF_32BIT | MT_32BIT_ARGB8888; + return MAPSURF_32BIT | MT_32BIT_ARGB8888; case MESA_FORMAT_XRGB8888: return MAPSURF_32BIT | MT_32BIT_XRGB8888; case MESA_FORMAT_YCBCR_REV: diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c index 74cf66f9f8b..3f9b1fbfdc6 100644 --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c @@ -94,20 +94,14 @@ static GLuint translate_tex_format( gl_format mesa_format, return BRW_SURFACEFORMAT_R8G8B8_UNORM; case MESA_FORMAT_ARGB8888: - if (internal_format == GL_RGB) - return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; - else - return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; + return BRW_SURFACEFORMAT_B8G8R8A8_UNORM; case MESA_FORMAT_XRGB8888: return BRW_SURFACEFORMAT_B8G8R8X8_UNORM; case MESA_FORMAT_RGBA8888_REV: _mesa_problem(NULL, "unexpected format in i965:translate_tex_format()"); - if (internal_format == GL_RGB) - return BRW_SURFACEFORMAT_R8G8B8X8_UNORM; - else - return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; + return BRW_SURFACEFORMAT_R8G8B8A8_UNORM; case MESA_FORMAT_RGB565: return BRW_SURFACEFORMAT_B5G6R5_UNORM; diff --git a/src/mesa/drivers/dri/intel/intel_span.c b/src/mesa/drivers/dri/intel/intel_span.c index 725ba5c97d6..34c3d9df74c 100644 --- a/src/mesa/drivers/dri/intel/intel_span.c +++ b/src/mesa/drivers/dri/intel/intel_span.c @@ -638,13 +638,7 @@ intel_set_span_functions(struct intel_context *intel, intel_gttmap_InitPointers_xRGB8888(rb); break; case MESA_FORMAT_ARGB8888: - if (rb->_BaseFormat == GL_RGB) { - /* XXX remove this code someday when we enable XRGB surfaces */ - /* 8888 RGBx */ - intel_gttmap_InitPointers_xRGB8888(rb); - } else { - intel_gttmap_InitPointers_ARGB8888(rb); - } + intel_gttmap_InitPointers_ARGB8888(rb); break; case MESA_FORMAT_Z16: intel_gttmap_InitDepthPointers_z16(rb); @@ -731,35 +725,18 @@ intel_set_span_functions(struct intel_context *intel, } break; case MESA_FORMAT_ARGB8888: - if (rb->_BaseFormat == GL_RGB) { - /* XXX remove this code someday when we enable XRGB surfaces */ - /* 8888 RGBx */ - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_xRGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_xRGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_xRGB8888(rb); - break; - } - } else { - /* 8888 RGBA */ - switch (tiling) { - case I915_TILING_NONE: - default: - intelInitPointers_ARGB8888(rb); - break; - case I915_TILING_X: - intel_XTile_InitPointers_ARGB8888(rb); - break; - case I915_TILING_Y: - intel_YTile_InitPointers_ARGB8888(rb); - break; - } + /* 8888 RGBA */ + switch (tiling) { + case I915_TILING_NONE: + default: + intelInitPointers_ARGB8888(rb); + break; + case I915_TILING_X: + intel_XTile_InitPointers_ARGB8888(rb); + break; + case I915_TILING_Y: + intel_YTile_InitPointers_ARGB8888(rb); + break; } break; case MESA_FORMAT_Z16: -- cgit v1.2.3 From 1cf60c981091d7a46cb404fd607f85553c427761 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 15:41:13 -0800 Subject: progs/samples: Byte swap individual members of struct _rawImageRec. --- progs/samples/rgbtoppm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/progs/samples/rgbtoppm.c b/progs/samples/rgbtoppm.c index 56ca5b0efe9..dcb74228dff 100644 --- a/progs/samples/rgbtoppm.c +++ b/progs/samples/rgbtoppm.c @@ -93,7 +93,12 @@ static ImageRec *ImageOpen(char *fileName) fread(image, 1, 12, image->file); if (swapFlag) { - ConvertShort(&image->imagic, 6); + ConvertShort(&image->imagic, 1); + ConvertShort(&image->type, 1); + ConvertShort(&image->dim, 1); + ConvertShort(&image->xsize, 1); + ConvertShort(&image->ysize, 1); + ConvertShort(&image->zsize, 1); } image->tmp = (unsigned char *)malloc(image->xsize*256); -- cgit v1.2.3 From d38ffed5236adf3ee83c0bc5bdee0233ce566e01 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 17:50:35 -0800 Subject: glsl: Increase size of array in_slang_lookup_constant from 4 to 16. For some cases, _mesa_GetIntegerv reads up to params[15]. --- src/mesa/shader/slang/slang_simplify.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/slang/slang_simplify.c b/src/mesa/shader/slang/slang_simplify.c index 539c6ff0d14..13b9ca3c877 100644 --- a/src/mesa/shader/slang/slang_simplify.c +++ b/src/mesa/shader/slang/slang_simplify.c @@ -84,7 +84,7 @@ _slang_lookup_constant(const char *name) for (i = 0; info[i].Name; i++) { if (strcmp(info[i].Name, name) == 0) { /* found */ - GLint values[4]; + GLint values[16]; values[0] = -1; _mesa_GetIntegerv(info[i].Token, values); ASSERT(values[0] >= 0); /* sanity check that glGetFloatv worked */ -- cgit v1.2.3 From cb1dcb55f9884431a5e2b90e9208b42558a95611 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:21:59 -0800 Subject: i915: Add missing break statement in i915_debug_packet. --- src/mesa/drivers/dri/i915/i915_debug.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/mesa/drivers/dri/i915/i915_debug.c b/src/mesa/drivers/dri/i915/i915_debug.c index f7bb7ea44c9..fecfac30339 100644 --- a/src/mesa/drivers/dri/i915/i915_debug.c +++ b/src/mesa/drivers/dri/i915/i915_debug.c @@ -806,6 +806,7 @@ static GLboolean i915_debug_packet( struct debug_stream *stream ) default: return debug(stream, "", 0); } + break; default: assert(0); return 0; -- cgit v1.2.3 From e31df54754e2305b7cc7072053bf5a4e0b477fd6 Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:32:33 -0800 Subject: mesa: Assign _mesa_lookup_parameter_index return value to GLint. --- src/mesa/shader/prog_parameter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/shader/prog_parameter.c b/src/mesa/shader/prog_parameter.c index 2f029b02e50..f22492e029e 100644 --- a/src/mesa/shader/prog_parameter.c +++ b/src/mesa/shader/prog_parameter.c @@ -500,7 +500,7 @@ GLfloat * _mesa_lookup_parameter_value(const struct gl_program_parameter_list *paramList, GLsizei nameLen, const char *name) { - GLuint i = _mesa_lookup_parameter_index(paramList, nameLen, name); + GLint i = _mesa_lookup_parameter_index(paramList, nameLen, name); if (i < 0) return NULL; else -- cgit v1.2.3 From 94fba49be97008565c0225bc46894bfd9453bb5e Mon Sep 17 00:00:00 2001 From: Vinson Lee Date: Thu, 10 Dec 2009 18:51:51 -0800 Subject: mesa: Initialize variable in MatchInstruction. --- src/mesa/shader/nvfragparse.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesa/shader/nvfragparse.c b/src/mesa/shader/nvfragparse.c index 0fd55524abf..b739a6aa07c 100644 --- a/src/mesa/shader/nvfragparse.c +++ b/src/mesa/shader/nvfragparse.c @@ -217,6 +217,12 @@ MatchInstruction(const GLubyte *token) const struct instruction_pattern *inst; struct instruction_pattern result; + result.name = NULL; + result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + result.inputs = 0; + result.outputs = 0; + result.suffixes = 0; + for (inst = Instructions; inst->name; inst++) { if (_mesa_strncmp((const char *) token, inst->name, 3) == 0) { /* matched! */ @@ -247,7 +253,7 @@ MatchInstruction(const GLubyte *token) return result; } } - result.opcode = MAX_OPCODE; /* i.e. invalid instruction */ + return result; } -- cgit v1.2.3 From 8c981b94dc0ff30fe2b2786b1d5671be7d1610b7 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 25 Nov 2009 18:06:12 +0000 Subject: scons: Make it work with MinGW build of LLVM 2.6. LLVM 2.5 is no longer supported on windows. --- scons/llvm.py | 52 +++++++++++++++++++++++++++------------------------- 1 file changed, 27 insertions(+), 25 deletions(-) diff --git a/scons/llvm.py b/scons/llvm.py index 73e9310f71b..7b266502907 100644 --- a/scons/llvm.py +++ b/scons/llvm.py @@ -58,45 +58,47 @@ def generate(env): env.PrependENVPath('PATH', llvm_bin_dir) - if env['msvc']: + if env['platform'] == 'windows': # XXX: There is no llvm-config on Windows, so assume a standard layout if llvm_dir is not None: env.Prepend(CPPPATH = [os.path.join(llvm_dir, 'include')]) + env.AppendUnique(CPPDEFINES = [ + '__STDC_LIMIT_MACROS', + '__STDC_CONSTANT_MACROS', + ]) env.Prepend(LIBPATH = [os.path.join(llvm_dir, 'lib')]) env.Prepend(LIBS = [ + 'LLVMX86AsmParser', + 'LLVMX86AsmPrinter', + 'LLVMX86CodeGen', + 'LLVMX86Info', + 'LLVMLinker', + 'LLVMipo', + 'LLVMInterpreter', + 'LLVMInstrumentation', + 'LLVMJIT', + 'LLVMExecutionEngine', + 'LLVMDebugger', 'LLVMBitWriter', - 'LLVMCore', - 'LLVMSupport', - 'LLVMSystem', - 'LLVMSupport', - 'LLVMSystem', - 'LLVMCore', - 'LLVMCodeGen', + 'LLVMAsmParser', + 'LLVMArchive', + 'LLVMBitReader', 'LLVMSelectionDAG', 'LLVMAsmPrinter', - 'LLVMBitReader', - 'LLVMBitWriter', - 'LLVMTransformUtils', - 'LLVMInstrumentation', + 'LLVMCodeGen', 'LLVMScalarOpts', - 'LLVMipo', - 'LLVMHello', - 'LLVMLinker', - 'LLVMAnalysis', + 'LLVMTransformUtils', 'LLVMipa', - 'LLVMX86CodeGen', - 'LLVMX86AsmPrinter', - 'LLVMExecutionEngine', - 'LLVMInterpreter', - 'LLVMJIT', + 'LLVMAnalysis', 'LLVMTarget', - 'LLVMAsmParser', - 'LLVMDebugger', - 'LLVMArchive', + 'LLVMMC', + 'LLVMCore', + 'LLVMSupport', + 'LLVMSystem', 'imagehlp', 'psapi', ]) - env['LLVM_VERSION'] = '2.5' + env['LLVM_VERSION'] = '2.6' return elif env.Detect('llvm-config'): version = env.backtick('llvm-config --version').rstrip() -- cgit v1.2.3 From a2937a2f4ecf22a5a4242cd0a350f20228f50232 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 12:08:32 +0000 Subject: scons: Pass -fno-strict-aliasing to gcc. Strict aliasing tule violations were fixed on master, but they're still causing problem in this branch, so disable this assumptions. Do not apply this fix to master (revert when you merge). --- scons/gallium.py | 1 + 1 file changed, 1 insertion(+) diff --git a/scons/gallium.py b/scons/gallium.py index ca1ca5153e7..0e5de0d0f8e 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -370,6 +370,7 @@ def generate(env): '-Wno-long-long', '-ffast-math', '-fmessage-length=0', # be nice to Eclipse + '-fno-strict-aliasing', # we violate strict pointer aliasing rules ] cflags += [ '-Werror=declaration-after-statement', -- cgit v1.2.3 From 770323e33e62169827454af74e9f90f09997f962 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 12:09:02 +0000 Subject: svga: Fix mixed signed comparisons. --- src/gallium/drivers/svga/svga_screen_texture.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index e7301aba841..ed83ba48f09 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -528,7 +528,7 @@ svga_texture_view_surface(struct pipe_context *pipe, { struct svga_screen *ss = svga_screen(tex->base.screen); struct svga_winsys_surface *handle; - int i, j; + uint32_t i, j; unsigned z_offset = 0; SVGA_DBG(DEBUG_PERF, -- cgit v1.2.3 From 16876b8328059446b6fa0951f7848e5d500244ab Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 12:29:02 +0000 Subject: svga: Keep tight control of texture handle ownership. The texture owns the surface handle. All derivatives need to keep a reference to texture. This fixes several assertions failures starting up Jedi Knight 2. Should cause no change for DRM surface sharing -- reference count still done as before there. --- src/gallium/drivers/svga/svga_screen_texture.c | 35 ++++++++++++++------------ src/gallium/drivers/svga/svga_screen_texture.h | 9 ++++++- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/svga/svga_screen_texture.c b/src/gallium/drivers/svga/svga_screen_texture.c index ed83ba48f09..1eb03db2806 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.c +++ b/src/gallium/drivers/svga/svga_screen_texture.c @@ -657,13 +657,11 @@ svga_get_tex_surface(struct pipe_screen *screen, s->real_level = 0; s->real_zslice = 0; } else { - struct svga_winsys_screen *sws = svga_winsys_screen(screen); - SVGA_DBG(DEBUG_VIEWS, "svga: Surface view: no %p, level %u, face %u, z %u, %p\n", pt, level, face, zslice, s); memset(&s->key, 0, sizeof s->key); - sws->surface_reference(sws, &s->handle, tex->handle); + s->handle = tex->handle; s->real_face = face; s->real_level = level; s->real_zslice = zslice; @@ -677,11 +675,14 @@ static void svga_tex_surface_destroy(struct pipe_surface *surf) { struct svga_surface *s = svga_surface(surf); + struct svga_texture *t = svga_texture(surf->texture); struct svga_screen *ss = svga_screen(surf->texture->screen); - SVGA_DBG(DEBUG_DMA, "unref sid %p (tex surface)\n", s->handle); - assert(s->key.cachable == 0); - svga_screen_surface_destroy(ss, &s->key, &s->handle); + if(s->handle != t->handle) { + SVGA_DBG(DEBUG_DMA, "unref sid %p (tex surface)\n", s->handle); + svga_screen_surface_destroy(ss, &s->key, &s->handle); + } + pipe_texture_reference(&surf->texture, NULL); FREE(surf); } @@ -910,7 +911,6 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt, unsigned min_lod, unsigned max_lod) { struct svga_screen *ss = svga_screen(pt->screen); - struct svga_winsys_screen *sws = ss->sws; struct svga_texture *tex = svga_texture(pt); struct svga_sampler_view *sv = NULL; SVGA3dSurfaceFormat format = svga_translate_format(pt->format); @@ -961,7 +961,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt, sv = CALLOC_STRUCT(svga_sampler_view); pipe_reference_init(&sv->reference, 1); - sv->texture = tex; + pipe_texture_reference(&sv->texture, pt); sv->min_lod = min_lod; sv->max_lod = max_lod; @@ -976,7 +976,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt, pt->depth[0], pt->last_level); sv->key.cachable = 0; - sws->surface_reference(sws, &sv->handle, tex->handle); + sv->handle = tex->handle; return sv; } @@ -999,7 +999,7 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt, if (!sv->handle) { assert(0); sv->key.cachable = 0; - sws->surface_reference(sws, &sv->handle, tex->handle); + sv->handle = tex->handle; return sv; } @@ -1013,14 +1013,14 @@ svga_get_tex_sampler_view(struct pipe_context *pipe, struct pipe_texture *pt, void svga_validate_sampler_view(struct svga_context *svga, struct svga_sampler_view *v) { - struct svga_texture *tex = v->texture; + struct svga_texture *tex = svga_texture(v->texture); unsigned numFaces; unsigned age = 0; int i, k; assert(svga); - if (v->handle == v->texture->handle) + if (v->handle == tex->handle) return; age = tex->age; @@ -1048,11 +1048,14 @@ svga_validate_sampler_view(struct svga_context *svga, struct svga_sampler_view * void svga_destroy_sampler_view_priv(struct svga_sampler_view *v) { - struct svga_screen *ss = svga_screen(v->texture->base.screen); - - SVGA_DBG(DEBUG_DMA, "unref sid %p (sampler view)\n", v->handle); - svga_screen_surface_destroy(ss, &v->key, &v->handle); + struct svga_texture *tex = svga_texture(v->texture); + if(v->handle != tex->handle) { + struct svga_screen *ss = svga_screen(v->texture->screen); + SVGA_DBG(DEBUG_DMA, "unref sid %p (sampler view)\n", v->handle); + svga_screen_surface_destroy(ss, &v->key, &v->handle); + } + pipe_texture_reference(&v->texture, NULL); FREE(v); } diff --git a/src/gallium/drivers/svga/svga_screen_texture.h b/src/gallium/drivers/svga/svga_screen_texture.h index 1cc4063e653..8cfdfea6937 100644 --- a/src/gallium/drivers/svga/svga_screen_texture.h +++ b/src/gallium/drivers/svga/svga_screen_texture.h @@ -61,7 +61,7 @@ struct svga_sampler_view { struct pipe_reference reference; - struct svga_texture *texture; + struct pipe_texture *texture; int min_lod; int max_lod; @@ -94,6 +94,13 @@ struct svga_texture * operation. */ struct svga_host_surface_cache_key key; + + /** + * Handle for the host side surface. + * + * This handle is owned by this texture. Views should hold on to a reference + * to this texture and never destroy this handle directly. + */ struct svga_winsys_surface *handle; }; -- cgit v1.2.3 From 8469baf41bd4775eab2403ecf08ed013343943a5 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 13:15:12 +0000 Subject: svga: Always pass SVGA3D_SURFACE_HINT_DYNAMIC. Since we're reusing buffers we're effectively transforming all of them into dynamic buffers. It would be nice to not cache long lived static buffers. But there is no way to detect the long lived from short lived ones yet. A good heuristic would be buffer size. --- src/gallium/drivers/svga/svga_screen_cache.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/gallium/drivers/svga/svga_screen_cache.c b/src/gallium/drivers/svga/svga_screen_cache.c index 8a06383f61e..eff36e0bccb 100644 --- a/src/gallium/drivers/svga/svga_screen_cache.c +++ b/src/gallium/drivers/svga/svga_screen_cache.c @@ -277,6 +277,15 @@ svga_screen_surface_create(struct svga_screen *svgascreen, while(size < key->size.width) size <<= 1; key->size.width = size; + /* Since we're reusing buffers we're effectively transforming all + * of them into dynamic buffers. + * + * It would be nice to not cache long lived static buffers. But there + * is no way to detect the long lived from short lived ones yet. A + * good heuristic would be buffer size. + */ + key->flags &= ~SVGA3D_SURFACE_HINT_STATIC; + key->flags |= SVGA3D_SURFACE_HINT_DYNAMIC; } handle = svga_screen_cache_lookup(svgascreen, key); -- cgit v1.2.3 From ffae1f938d61165fce620bfd76ea7ae74dc63289 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 14:14:03 +0000 Subject: svga: Add a missing dependency from the prescale state. Thanks for Keith to finding this. Fixes Jedi Knight 2 menus. --- src/gallium/drivers/svga/svga_state_constants.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/svga/svga_state_constants.c b/src/gallium/drivers/svga/svga_state_constants.c index 18cce7dde1a..a5777d4fbdc 100644 --- a/src/gallium/drivers/svga/svga_state_constants.c +++ b/src/gallium/drivers/svga/svga_state_constants.c @@ -231,7 +231,8 @@ static int emit_vs_consts( struct svga_context *svga, struct svga_tracked_state svga_hw_vs_parameters = { "hw vs params", - (SVGA_NEW_VS_CONST_BUFFER | + (SVGA_NEW_PRESCALE | + SVGA_NEW_VS_CONST_BUFFER | SVGA_NEW_ZERO_STRIDE | SVGA_NEW_VS_RESULT), emit_vs_consts -- cgit v1.2.3 From da3bc492d2438ac915e720c17b54d0d12ffd8a97 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 15:16:22 +0000 Subject: scons: Tweak MSVC release options. Enable whole program optimizations and fast math. --- scons/gallium.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/scons/gallium.py b/scons/gallium.py index 0e5de0d0f8e..f4e82e8e0a5 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -391,15 +391,15 @@ def generate(env): else: ccflags += [ '/O2', # optimize for speed - #'/fp:fast', # fast floating point + '/GL', # enable whole program optimization ] ccflags += [ + '/fp:fast', # fast floating point '/W3', # warning level #'/Wp64', # enable 64 bit porting warnings ] if env['machine'] == 'x86': ccflags += [ - #'/QIfist', # Suppress _ftol #'/arch:SSE2', # use the SSE2 instructions ] if platform == 'windows': @@ -477,6 +477,11 @@ def generate(env): ] # Handle circular dependencies in the libraries env['_LIBFLAGS'] = '-Wl,--start-group ' + env['_LIBFLAGS'] + ' -Wl,--end-group' + if msvc: + if not env['debug']: + # enable Link-time Code Generation + linkflags += ['/LTCG'] + env.Append(ARFLAGS = ['/LTCG']) if platform == 'windows' and msvc: # See also: # - http://msdn2.microsoft.com/en-us/library/y0zzbyt4.aspx -- cgit v1.2.3 From f7f1211b9b0a8fa0e5f5427b74b4eee4dabf65af Mon Sep 17 00:00:00 2001 From: Aurelien Jarno Date: Fri, 11 Dec 2009 08:46:54 -0700 Subject: sparc: additional preprocessor test for SPARC 64-bit --- src/mesa/sparc/xform.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/sparc/xform.S b/src/mesa/sparc/xform.S index f2b9674bf2d..2a7cce41e5a 100644 --- a/src/mesa/sparc/xform.S +++ b/src/mesa/sparc/xform.S @@ -17,7 +17,7 @@ #include "sparc_matrix.h" -#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) +#if defined(SVR4) || defined(__SVR4) || defined(__svr4__) || defined(__arch64__) /* Solaris requires this for 64-bit. */ .register %g2, #scratch .register %g3, #scratch -- cgit v1.2.3 From 5076a4f53a2f34cc9116b45951037f639885c7a1 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 09:16:25 -0700 Subject: mesa: check dst reg in _mesa_find_free_register() If a register was only being used as a destination (as will happen when generated condition-codes) we missed its use. So we'd errantly return a register index that was really in-use, not free. Fixes bug 25579. --- src/mesa/shader/program.c | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/mesa/shader/program.c b/src/mesa/shader/program.c index 2cd6eb8a389..18d4ef97597 100644 --- a/src/mesa/shader/program.c +++ b/src/mesa/shader/program.c @@ -813,9 +813,17 @@ _mesa_find_free_register(const struct gl_program *prog, GLuint regFile) const struct prog_instruction *inst = prog->Instructions + i; const GLuint n = _mesa_num_inst_src_regs(inst->Opcode); - for (k = 0; k < n; k++) { - if (inst->SrcReg[k].File == regFile) { - used[inst->SrcReg[k].Index] = GL_TRUE; + /* check dst reg first */ + if (inst->DstReg.File == regFile) { + used[inst->DstReg.Index] = GL_TRUE; + } + else { + /* check src regs otherwise */ + for (k = 0; k < n; k++) { + if (inst->SrcReg[k].File == regFile) { + used[inst->SrcReg[k].Index] = GL_TRUE; + break; + } } } } -- cgit v1.2.3 From d8f8eca9efaf2f537cf9218e4dd1d742e19ffc76 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 09:40:33 -0700 Subject: mesa: remove unnecessary loop in _mesa_remove_output_reads() --- src/mesa/shader/programopt.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/src/mesa/shader/programopt.c b/src/mesa/shader/programopt.c index f70c75cec8e..c5b821d94f0 100644 --- a/src/mesa/shader/programopt.c +++ b/src/mesa/shader/programopt.c @@ -528,15 +528,11 @@ _mesa_remove_output_reads(struct gl_program *prog, gl_register_file type) /* look for instructions which write to the varying vars identified above */ for (i = 0; i < prog->NumInstructions; i++) { struct prog_instruction *inst = prog->Instructions + i; - const GLuint numSrc = _mesa_num_inst_src_regs(inst->Opcode); - GLuint j; - for (j = 0; j < numSrc; j++) { - if (inst->DstReg.File == type && - outputMap[inst->DstReg.Index] >= 0) { - /* change inst to write to the temp reg, instead of the varying */ - inst->DstReg.File = PROGRAM_TEMPORARY; - inst->DstReg.Index = outputMap[inst->DstReg.Index]; - } + if (inst->DstReg.File == type && + outputMap[inst->DstReg.Index] >= 0) { + /* change inst to write to the temp reg, instead of the varying */ + inst->DstReg.File = PROGRAM_TEMPORARY; + inst->DstReg.Index = outputMap[inst->DstReg.Index]; } } -- cgit v1.2.3 From 7d41b4248bee1d926646ef5fdff07da4f9026589 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 09:41:34 -0700 Subject: docs: updated 7.6.1 relnotes with GLSL fixes --- docs/relnotes-7.6.1.html | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/relnotes-7.6.1.html b/docs/relnotes-7.6.1.html index 752f9cac643..7160168d989 100644 --- a/docs/relnotes-7.6.1.html +++ b/docs/relnotes-7.6.1.html @@ -58,6 +58,7 @@ tbd
  • Endianness fixes for the DRI swrast driver (bug 22767).
  • Point sprite fixes for i915/945 driver.
  • Fixed assorted memory leaks (usually on error paths) +
  • Fixed some GLSL compiler bugs (ex: 25579)

    Changes

    -- cgit v1.2.3 From 09aa9844947771cb75cf6cbd1c40e0b573d8dafd Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 10:11:45 -0700 Subject: Revert "scons: Pass -fno-strict-aliasing to gcc." This reverts commit a2937a2f4ecf22a5a4242cd0a350f20228f50232. Per Jose's comment, We don't want this on master. --- scons/gallium.py | 1 - 1 file changed, 1 deletion(-) diff --git a/scons/gallium.py b/scons/gallium.py index f4e82e8e0a5..5f149f95284 100644 --- a/scons/gallium.py +++ b/scons/gallium.py @@ -370,7 +370,6 @@ def generate(env): '-Wno-long-long', '-ffast-math', '-fmessage-length=0', # be nice to Eclipse - '-fno-strict-aliasing', # we violate strict pointer aliasing rules ] cflags += [ '-Werror=declaration-after-statement', -- cgit v1.2.3 From e24a8de8ba3b0765852dbcc170f770572bd042ac Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:43:32 -0700 Subject: mesa: updated comment --- src/mesa/main/dd.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 27ed921761c..fdcaf05bac5 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -182,7 +182,7 @@ struct dd_function_table { * * This is called by the \c _mesa_store_tex[sub]image[123]d() fallback * functions. The driver should examine \p internalFormat and return a - * pointer to an appropriate gl_texture_format. + * gl_format value. */ GLuint (*ChooseTextureFormat)( GLcontext *ctx, GLint internalFormat, GLenum srcFormat, GLenum srcType ); -- cgit v1.2.3 From 56dce15dcc7b0a869813ef97a0e68b166bac244f Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:50:54 -0700 Subject: mesa: remove unused ctx->Driver.ActiveTexture() hook --- src/mesa/drivers/common/driverfuncs.c | 1 - src/mesa/drivers/dri/mach64/mach64_tex.c | 1 - src/mesa/main/dd.h | 5 ----- 3 files changed, 7 deletions(-) diff --git a/src/mesa/drivers/common/driverfuncs.c b/src/mesa/drivers/common/driverfuncs.c index 4ca0e7bcc37..9b271f85e92 100644 --- a/src/mesa/drivers/common/driverfuncs.c +++ b/src/mesa/drivers/common/driverfuncs.c @@ -124,7 +124,6 @@ _mesa_init_driver_functions(struct dd_function_table *driver) driver->UnmapTexture = NULL; driver->TextureMemCpy = _mesa_memcpy; driver->IsTextureResident = NULL; - driver->ActiveTexture = NULL; driver->UpdateTexturePalette = NULL; /* imaging */ diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c index a757362b11d..72917ee13bf 100644 --- a/src/mesa/drivers/dri/mach64/mach64_tex.c +++ b/src/mesa/drivers/dri/mach64/mach64_tex.c @@ -565,7 +565,6 @@ void mach64InitTextureFuncs( struct dd_function_table *functions ) functions->IsTextureResident = driIsTextureResident; functions->UpdateTexturePalette = NULL; - functions->ActiveTexture = NULL; driInitTextureFormats(); } diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index fdcaf05bac5..9a5145cd464 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -537,11 +537,6 @@ struct dd_function_table { GLboolean (*IsTextureResident)( GLcontext *ctx, struct gl_texture_object *t ); - /** - * Called by glActiveTextureARB() to set current texture unit. - */ - void (*ActiveTexture)( GLcontext *ctx, GLuint texUnitNumber ); - /** * Called when the texture's color lookup table is changed. * -- cgit v1.2.3 From 9c01cf425fac3853c65bd732270a015106766865 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 16 Nov 2009 12:54:39 -0700 Subject: mesa: minor reformatting/rewrapping in dd.h --- src/mesa/main/dd.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesa/main/dd.h b/src/mesa/main/dd.h index 9a5145cd464..6dadf5c079b 100644 --- a/src/mesa/main/dd.h +++ b/src/mesa/main/dd.h @@ -761,13 +761,13 @@ struct dd_function_table { /* May return NULL if MESA_MAP_NOWAIT_BIT is set in access: */ - void * (*MapBufferRange)( GLcontext *ctx, GLenum target, - GLintptr offset, GLsizeiptr length, GLbitfield access, + void * (*MapBufferRange)( GLcontext *ctx, GLenum target, GLintptr offset, + GLsizeiptr length, GLbitfield access, struct gl_buffer_object *obj); - void (*FlushMappedBufferRange) (GLcontext *ctx, GLenum target, - GLintptr offset, GLsizeiptr length, - struct gl_buffer_object *obj); + void (*FlushMappedBufferRange)(GLcontext *ctx, GLenum target, + GLintptr offset, GLsizeiptr length, + struct gl_buffer_object *obj); GLboolean (*UnmapBuffer)( GLcontext *ctx, GLenum target, struct gl_buffer_object *obj ); @@ -782,7 +782,8 @@ struct dd_function_table { struct gl_framebuffer * (*NewFramebuffer)(GLcontext *ctx, GLuint name); struct gl_renderbuffer * (*NewRenderbuffer)(GLcontext *ctx, GLuint name); void (*BindFramebuffer)(GLcontext *ctx, GLenum target, - struct gl_framebuffer *fb, struct gl_framebuffer *fbread); + struct gl_framebuffer *drawFb, + struct gl_framebuffer *readFb); void (*FramebufferRenderbuffer)(GLcontext *ctx, struct gl_framebuffer *fb, GLenum attachment, -- cgit v1.2.3 From 4430a05a3a65c411996a923d1051bb7879204a53 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Fri, 11 Dec 2009 16:50:25 -0700 Subject: gallium: added comment for pipe_reference() return value --- src/gallium/include/pipe/p_refcnt.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gallium/include/pipe/p_refcnt.h b/src/gallium/include/pipe/p_refcnt.h index e252f559006..c1c7415e023 100644 --- a/src/gallium/include/pipe/p_refcnt.h +++ b/src/gallium/include/pipe/p_refcnt.h @@ -62,6 +62,7 @@ pipe_is_referenced(struct pipe_reference *reference) * Update reference counting. * The old thing pointed to, if any, will be unreferenced. * Both 'ptr' and 'reference' may be NULL. + * \return TRUE if the object's refcount hits zero and should be destroyed. */ static INLINE boolean pipe_reference(struct pipe_reference *ptr, struct pipe_reference *reference) -- cgit v1.2.3 From da73c1ed41c6d2867cca34ca1d481537ec3cb077 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 12 Dec 2009 00:00:34 +0100 Subject: r300: minor texture code refactoring --- src/mesa/drivers/dri/r300/r300_texstate.c | 191 ++++++++++++++++++------------ 1 file changed, 112 insertions(+), 79 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 9eaf390b460..d80284e1b9e 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -51,14 +51,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_tex.h" #include "r300_reg.h" -#define VALID_FORMAT(f) ( ((f) <= MESA_FORMAT_RGBA_DXT5 \ - || ((f) >= MESA_FORMAT_RGBA_FLOAT32 && \ - (f) <= MESA_FORMAT_INTENSITY_FLOAT16)) \ - && tx_table[f].flag ) - -#define _ASSIGN(entry, format) \ - [ MESA_FORMAT_ ## entry ] = { format, 0, 1} - /* * Note that the _REV formats are the same as the non-REV formats. This is * because the REV and non-REV formats are identical as a byte string, but @@ -68,67 +60,121 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -static const struct tx_table { - GLuint format, filter, flag; -} tx_table[] = { - /* *INDENT-OFF* */ +static uint32_t translateTexFormat(gl_format mesaFormat) +{ + switch (mesaFormat) + { #ifdef MESA_LITTLE_ENDIAN - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), - _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), + case MESA_FORMAT_RGBA8888: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8); + case MESA_FORMAT_RGBA8888_REV: + return R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888_REV: + return R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8); #else - _ASSIGN(RGBA8888, R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8)), - _ASSIGN(RGBA8888_REV, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888, R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8)), - _ASSIGN(ARGB8888_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8)), + case MESA_FORMAT_RGBA8888: + return R300_EASY_TX_FORMAT(Z, Y, X, W, W8Z8Y8X8); + case MESA_FORMAT_RGBA8888_REV: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888: + return R300_EASY_TX_FORMAT(W, Z, Y, X, W8Z8Y8X8); + case MESA_FORMAT_ARGB8888_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); #endif - _ASSIGN(XRGB8888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), - _ASSIGN(RGB888, R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8)), - _ASSIGN(RGB565, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(RGB565_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5)), - _ASSIGN(ARGB4444, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB4444_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4)), - _ASSIGN(ARGB1555, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(ARGB1555_REV, R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5)), - _ASSIGN(AL88, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(AL88_REV, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8)), - _ASSIGN(RGB332, R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2)), - _ASSIGN(A8, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8)), - _ASSIGN(L8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8)), - _ASSIGN(I8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(CI8, R300_EASY_TX_FORMAT(X, X, X, X, X8)), - _ASSIGN(YCBCR, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), - _ASSIGN(YCBCR_REV, R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE), - _ASSIGN(RGB_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1)), - _ASSIGN(RGBA_DXT1, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1)), - _ASSIGN(RGBA_DXT3, R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3)), - _ASSIGN(RGBA_DXT5, R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5)), - _ASSIGN(RGBA_FLOAT32, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32)), - _ASSIGN(RGBA_FLOAT16, R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16)), - _ASSIGN(RGB_FLOAT32, 0xffffffff), - _ASSIGN(RGB_FLOAT16, 0xffffffff), - _ASSIGN(ALPHA_FLOAT32, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32)), - _ASSIGN(ALPHA_FLOAT16, R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16)), - _ASSIGN(LUMINANCE_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32)), - _ASSIGN(LUMINANCE_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32)), - _ASSIGN(LUMINANCE_ALPHA_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16)), - _ASSIGN(INTENSITY_FLOAT32, R300_EASY_TX_FORMAT(X, X, X, X, FL_I32)), - _ASSIGN(INTENSITY_FLOAT16, R300_EASY_TX_FORMAT(X, X, X, X, FL_I16)), - _ASSIGN(Z16, R300_EASY_TX_FORMAT(X, X, X, X, X16)), - _ASSIGN(Z24_S8, R300_EASY_TX_FORMAT(X, X, X, X, X24_Y8)), - _ASSIGN(S8_Z24, R300_EASY_TX_FORMAT(Y, Y, Y, Y, X24_Y8)), - _ASSIGN(Z32, R300_EASY_TX_FORMAT(X, X, X, X, X32)), - /* EXT_texture_sRGB */ - _ASSIGN(SRGBA8, R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8) | R300_TX_FORMAT_GAMMA), - _ASSIGN(SLA8, R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8) | R300_TX_FORMAT_GAMMA), - _ASSIGN(SL8, R300_EASY_TX_FORMAT(X, X, X, ONE, X8) | R300_TX_FORMAT_GAMMA), - /* *INDENT-ON* */ + case MESA_FORMAT_XRGB8888: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); + case MESA_FORMAT_RGB888: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); + case MESA_FORMAT_RGB565: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); + case MESA_FORMAT_RGB565_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); + case MESA_FORMAT_ARGB4444: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4); + case MESA_FORMAT_ARGB4444_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W4Z4Y4X4); + case MESA_FORMAT_ARGB1555: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5); + case MESA_FORMAT_ARGB1555_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, W, W1Z5Y5X5); + case MESA_FORMAT_AL88: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8); + case MESA_FORMAT_AL88_REV: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8); + case MESA_FORMAT_RGB332: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z3Y3X2); + case MESA_FORMAT_A8: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, X8); + case MESA_FORMAT_L8: + return R300_EASY_TX_FORMAT(X, X, X, ONE, X8); + case MESA_FORMAT_I8: + return R300_EASY_TX_FORMAT(X, X, X, X, X8); + case MESA_FORMAT_CI8: + return R300_EASY_TX_FORMAT(X, X, X, X, X8); + case MESA_FORMAT_YCBCR: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE; + case MESA_FORMAT_YCBCR_REV: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, G8R8_G8B8) | R300_TX_FORMAT_YUV_MODE; + case MESA_FORMAT_RGB_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1); + case MESA_FORMAT_RGBA_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1); + case MESA_FORMAT_RGBA_DXT3: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3); + case MESA_FORMAT_RGBA_DXT5: + return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5); + case MESA_FORMAT_RGBA_FLOAT32: + return R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R32G32B32A32); + case MESA_FORMAT_RGBA_FLOAT16: + return R300_EASY_TX_FORMAT(Z, Y, X, W, FL_R16G16B16A16); + case MESA_FORMAT_ALPHA_FLOAT32: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I32); + case MESA_FORMAT_ALPHA_FLOAT16: + return R300_EASY_TX_FORMAT(ZERO, ZERO, ZERO, X, FL_I16); + case MESA_FORMAT_LUMINANCE_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I32); + case MESA_FORMAT_LUMINANCE_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, ONE, FL_I16); + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, Y, FL_I32A32); + case MESA_FORMAT_LUMINANCE_ALPHA_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, Y, FL_I16A16); + case MESA_FORMAT_INTENSITY_FLOAT32: + return R300_EASY_TX_FORMAT(X, X, X, X, FL_I32); + case MESA_FORMAT_INTENSITY_FLOAT16: + return R300_EASY_TX_FORMAT(X, X, X, X, FL_I16); + case MESA_FORMAT_Z16: + return R300_EASY_TX_FORMAT(X, X, X, X, X16); + case MESA_FORMAT_Z24_S8: + return R300_EASY_TX_FORMAT(X, X, X, X, X24_Y8); + case MESA_FORMAT_S8_Z24: + return R300_EASY_TX_FORMAT(Y, Y, Y, Y, X24_Y8); + case MESA_FORMAT_Z32: + return R300_EASY_TX_FORMAT(X, X, X, X, X32); + /* EXT_texture_sRGB */ + case MESA_FORMAT_SRGBA8: + return R300_EASY_TX_FORMAT(Y, Z, W, X, W8Z8Y8X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SLA8: + return R300_EASY_TX_FORMAT(X, X, X, Y, Y8X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SL8: + return R300_EASY_TX_FORMAT(X, X, X, ONE, X8) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGB_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, ONE, DXT1) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT1: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT1) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT3: + return R300_EASY_TX_FORMAT(X, Y, Z, W, DXT3) | R300_TX_FORMAT_GAMMA; + case MESA_FORMAT_SRGBA_DXT5: + return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5) | R300_TX_FORMAT_GAMMA; + default: + fprintf(stderr, "%s: Invalid format %s", __FUNCTION__, _mesa_get_format_name(mesaFormat)); + assert(0); + return 0; + } }; -#undef _ASSIGN - void r300SetDepthTexMode(struct gl_texture_object *tObj) { static const GLuint formats[3][3] = { @@ -205,19 +251,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) const struct gl_texture_image *firstImage; firstImage = t->base.Image[0][t->minLod]; - if (!t->image_override - && VALID_FORMAT(firstImage->TexFormat)) { + if (!t->image_override) { if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = tx_table[firstImage->TexFormat].format; + t->pp_txformat = translateTexFormat(firstImage->TexFormat); } - - t->pp_txfilter |= tx_table[firstImage->TexFormat].filter; - } else if (!t->image_override) { - _mesa_problem(NULL, "unexpected texture format in %s", - __FUNCTION__); - return; } if (t->image_override && t->bo) @@ -357,18 +396,15 @@ void r300SetTexOffset(__DRIcontext * pDRICtx, GLint texname, switch (depth) { case 32: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); - t->pp_txfilter |= tx_table[2].filter; pitch_val /= 4; break; case 24: default: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); - t->pp_txfilter |= tx_table[4].filter; pitch_val /= 4; break; case 16: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); - t->pp_txfilter |= tx_table[5].filter; pitch_val /= 2; break; } @@ -447,18 +483,15 @@ void r300SetTexBuffer2(__DRIcontext *pDRICtx, GLint target, GLint glx_texture_fo t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); else t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, W, W8Z8Y8X8); - t->pp_txfilter |= tx_table[2].filter; pitch_val /= 4; break; case 3: default: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, W8Z8Y8X8); - t->pp_txfilter |= tx_table[4].filter; pitch_val /= 4; break; case 2: t->pp_txformat = R300_EASY_TX_FORMAT(X, Y, Z, ONE, Z5Y6X5); - t->pp_txfilter |= tx_table[5].filter; pitch_val /= 2; break; } -- cgit v1.2.3 From 5ee270820ba8dc7bfc6be5812f02c66f4a76f705 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 20:03:57 +0100 Subject: r300: use _mesa_meta_Clear for buffer clears --- src/mesa/drivers/dri/r300/Makefile | 1 - src/mesa/drivers/dri/r300/r300_cmdbuf.c | 1 - src/mesa/drivers/dri/r300/r300_context.c | 9 +- src/mesa/drivers/dri/r300/r300_emit.c | 1 - src/mesa/drivers/dri/r300/r300_ioctl.c | 782 ------------------------------ src/mesa/drivers/dri/r300/r300_ioctl.h | 44 -- src/mesa/drivers/dri/r300/r300_render.c | 1 - src/mesa/drivers/dri/r300/r300_state.c | 1 - src/mesa/drivers/dri/r300/r300_tex.c | 1 - src/mesa/drivers/dri/r300/r300_texstate.c | 1 - 10 files changed, 8 insertions(+), 834 deletions(-) delete mode 100644 src/mesa/drivers/dri/r300/r300_ioctl.c delete mode 100644 src/mesa/drivers/dri/r300/r300_ioctl.h diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index cb0f715fa07..9fd0133fda3 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -45,7 +45,6 @@ DRIVER_SOURCES = \ radeon_screen.c \ r300_context.c \ r300_draw.c \ - r300_ioctl.c \ r300_cmdbuf.c \ r300_state.c \ r300_render.c \ diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index ad8db6e68e0..efeeb0646d0 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -45,7 +45,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_drm.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_reg.h" #include "r300_cmdbuf.h" #include "r300_emit.h" diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 5f07b956349..67183c3c2aa 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -55,13 +55,13 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vp_build.h" #include "drivers/common/driverfuncs.h" +#include "drivers/common/meta.h" #include "r300_context.h" #include "radeon_context.h" #include "radeon_span.h" #include "r300_cmdbuf.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "r300_tex.h" #include "r300_emit.h" #include "r300_swtcl.h" @@ -451,6 +451,13 @@ static void r300InitGLExtensions(GLcontext *ctx) } } +static void r300InitIoctlFuncs(struct dd_function_table *functions) +{ + functions->Clear = _mesa_meta_Clear; + functions->Finish = radeonFinish; + functions->Flush = radeonFlush; +} + /* Create the device specific rendering context. */ GLboolean r300CreateContext(const __GLcontextModes * glVisual, diff --git a/src/mesa/drivers/dri/r300/r300_emit.c b/src/mesa/drivers/dri/r300/r300_emit.c index 07e62230874..3759ca2bea7 100644 --- a/src/mesa/drivers/dri/r300/r300_emit.c +++ b/src/mesa/drivers/dri/r300/r300_emit.c @@ -49,7 +49,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" #include "r300_emit.h" -#include "r300_ioctl.h" #include "r300_render.h" #include "r300_swtcl.h" diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.c b/src/mesa/drivers/dri/r300/r300_ioctl.c deleted file mode 100644 index 5cb04e2bb6d..00000000000 --- a/src/mesa/drivers/dri/r300/r300_ioctl.c +++ /dev/null @@ -1,782 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. -Copyright (C) 2004 Nicolai Haehnle. -All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/** - * \file - * - * \author Keith Whitwell - * - * \author Nicolai Haehnle - */ - -#include -#include - -#include "main/glheader.h" -#include "main/imports.h" -#include "main/macros.h" -#include "main/context.h" -#include "main/simple_list.h" -#include "swrast/swrast.h" - -#include "radeon_common.h" -#include "radeon_lock.h" -#include "r300_context.h" -#include "r300_ioctl.h" -#include "r300_cmdbuf.h" -#include "r300_state.h" -#include "r300_vertprog.h" -#include "radeon_reg.h" -#include "r300_emit.h" -#include "r300_context.h" - -#include "vblank.h" - -#define R200_3D_DRAW_IMMD_2 0xC0003500 - -#define CLEARBUFFER_COLOR 0x1 -#define CLEARBUFFER_DEPTH 0x2 -#define CLEARBUFFER_STENCIL 0x4 - -#if 1 - -/** - * Fragment program helper macros - */ - -/* Produce unshifted source selectors */ -#define FP_TMP(idx) (idx) -#define FP_CONST(idx) ((idx) | (1 << 5)) - -/* Produce source/dest selector dword */ -#define FP_SELC_MASK_NO 0 -#define FP_SELC_MASK_X 1 -#define FP_SELC_MASK_Y 2 -#define FP_SELC_MASK_XY 3 -#define FP_SELC_MASK_Z 4 -#define FP_SELC_MASK_XZ 5 -#define FP_SELC_MASK_YZ 6 -#define FP_SELC_MASK_XYZ 7 - -#define FP_SELC(destidx,regmask,outmask,src0,src1,src2) \ - (((destidx) << R300_ALU_DSTC_SHIFT) | \ - (FP_SELC_MASK_##regmask << 23) | \ - (FP_SELC_MASK_##outmask << 26) | \ - ((src0) << R300_ALU_SRC0C_SHIFT) | \ - ((src1) << R300_ALU_SRC1C_SHIFT) | \ - ((src2) << R300_ALU_SRC2C_SHIFT)) - -#define FP_SELA_MASK_NO 0 -#define FP_SELA_MASK_W 1 - -#define FP_SELA(destidx,regmask,outmask,src0,src1,src2) \ - (((destidx) << R300_ALU_DSTA_SHIFT) | \ - (FP_SELA_MASK_##regmask << 23) | \ - (FP_SELA_MASK_##outmask << 24) | \ - ((src0) << R300_ALU_SRC0A_SHIFT) | \ - ((src1) << R300_ALU_SRC1A_SHIFT) | \ - ((src2) << R300_ALU_SRC2A_SHIFT)) - -/* Produce unshifted argument selectors */ -#define FP_ARGC(source) R300_ALU_ARGC_##source -#define FP_ARGA(source) R300_ALU_ARGA_##source -#define FP_ABS(arg) ((arg) | (1 << 6)) -#define FP_NEG(arg) ((arg) ^ (1 << 5)) - -/* Produce instruction dword */ -#define FP_INSTRC(opcode,arg0,arg1,arg2) \ - (R300_ALU_OUTC_##opcode | \ - ((arg0) << R300_ALU_ARG0C_SHIFT) | \ - ((arg1) << R300_ALU_ARG1C_SHIFT) | \ - ((arg2) << R300_ALU_ARG2C_SHIFT)) - -#define FP_INSTRA(opcode,arg0,arg1,arg2) \ - (R300_ALU_OUTA_##opcode | \ - ((arg0) << R300_ALU_ARG0A_SHIFT) | \ - ((arg1) << R300_ALU_ARG1A_SHIFT) | \ - ((arg2) << R300_ALU_ARG2A_SHIFT)) - -#endif - -static void r300EmitClearState(GLcontext * ctx); - -static void r300ClearBuffer(r300ContextPtr r300, int flags, - struct radeon_renderbuffer *rrb, - struct radeon_renderbuffer *rrbd) -{ - BATCH_LOCALS(&r300->radeon); - GLcontext *ctx = r300->radeon.glCtx; - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - GLuint cbpitch = 0; - r300ContextPtr rmesa = r300; - - if (RADEON_DEBUG & RADEON_IOCTL) - fprintf(stderr, "%s: buffer %p (%i,%i %ix%i)\n", - __FUNCTION__, rrb, dPriv->x, dPriv->y, - dPriv->w, dPriv->h); - - if (rrb) { - cbpitch = (rrb->pitch / rrb->cpp); - if (rrb->cpp == 4) - cbpitch |= R300_COLOR_FORMAT_ARGB8888; - else - cbpitch |= R300_COLOR_FORMAT_RGB565; - - if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ - cbpitch |= R300_COLOR_TILE_ENABLE; - } - } - - /* TODO in bufmgr */ - cp_wait(&r300->radeon, R300_WAIT_3D | R300_WAIT_3D_CLEAN); - end_3d(&rmesa->radeon); - - if (flags & CLEARBUFFER_COLOR) { - assert(rrb != 0); - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_BATCH_RELOC(0, rrb->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGVAL(R300_RB3D_COLORPITCH0, cbpitch); - END_BATCH(); - } -#if 1 - if (flags & (CLEARBUFFER_DEPTH | CLEARBUFFER_STENCIL)) { - uint32_t zbpitch = (rrbd->pitch / rrbd->cpp); - if (rrbd->bo->flags & RADEON_BO_FLAGS_MACRO_TILE){ - zbpitch |= R300_DEPTHMACROTILE_ENABLE; - } - if (rrbd->bo->flags & RADEON_BO_FLAGS_MICRO_TILE){ - zbpitch |= R300_DEPTHMICROTILE_TILED; - } - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(R300_ZB_DEPTHOFFSET, 1); - OUT_BATCH_RELOC(0, rrbd->bo, 0, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGSEQ(R300_ZB_DEPTHPITCH, 1); - if (!r300->radeon.radeonScreen->kernel_mm) - OUT_BATCH(zbpitch); - else - OUT_BATCH_RELOC(zbpitch, rrbd->bo, zbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); - } -#endif - BEGIN_BATCH_NO_AUTOSTATE(6); - OUT_BATCH_REGSEQ(RB3D_COLOR_CHANNEL_MASK, 1); - if (flags & CLEARBUFFER_COLOR) { - OUT_BATCH((ctx->Color.ColorMask[BCOMP] ? RB3D_COLOR_CHANNEL_MASK_BLUE_MASK0 : 0) | - (ctx->Color.ColorMask[GCOMP] ? RB3D_COLOR_CHANNEL_MASK_GREEN_MASK0 : 0) | - (ctx->Color.ColorMask[RCOMP] ? RB3D_COLOR_CHANNEL_MASK_RED_MASK0 : 0) | - (ctx->Color.ColorMask[ACOMP] ? RB3D_COLOR_CHANNEL_MASK_ALPHA_MASK0 : 0)); - } else { - OUT_BATCH(0); - } - - - { - uint32_t t1, t2; - - t1 = 0x0; - t2 = 0x0; - - if (flags & CLEARBUFFER_DEPTH) { - t1 |= R300_Z_ENABLE | R300_Z_WRITE_ENABLE; - t2 |= - (R300_ZS_ALWAYS << R300_Z_FUNC_SHIFT); - } - - if (flags & CLEARBUFFER_STENCIL) { - t1 |= R300_STENCIL_ENABLE; - t2 |= - (R300_ZS_ALWAYS << - R300_S_FRONT_FUNC_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_SFAIL_OP_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_ZPASS_OP_SHIFT) | - (R300_ZS_REPLACE << - R300_S_FRONT_ZFAIL_OP_SHIFT); - } - - OUT_BATCH_REGSEQ(R300_ZB_CNTL, 3); - OUT_BATCH(t1); - OUT_BATCH(t2); - OUT_BATCH(((ctx->Stencil.WriteMask[0] & R300_STENCILREF_MASK) << - R300_STENCILWRITEMASK_SHIFT) | - (ctx->Stencil.Clear & R300_STENCILREF_MASK)); - END_BATCH(); - } - - if (!rmesa->radeon.radeonScreen->kernel_mm) { - BEGIN_BATCH_NO_AUTOSTATE(9); - OUT_BATCH(cmdpacket3(r300->radeon.radeonScreen, R300_CMD_PACKET3_CLEAR)); - OUT_BATCH_FLOAT32(dPriv->w / 2.0); - OUT_BATCH_FLOAT32(dPriv->h / 2.0); - OUT_BATCH_FLOAT32(ctx->Depth.Clear); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[0]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[1]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[2]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[3]); - END_BATCH(); - } else { - OUT_BATCH(CP_PACKET3(R200_3D_DRAW_IMMD_2, 8)); - OUT_BATCH(R300_PRIM_TYPE_POINT | R300_PRIM_WALK_RING | - (1 << R300_PRIM_NUM_VERTICES_SHIFT)); - OUT_BATCH_FLOAT32(dPriv->w / 2.0); - OUT_BATCH_FLOAT32(dPriv->h / 2.0); - OUT_BATCH_FLOAT32(ctx->Depth.Clear); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[0]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[1]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[2]); - OUT_BATCH_FLOAT32(ctx->Color.ClearColor[3]); - } - - r300EmitCacheFlush(rmesa); - cp_wait(&r300->radeon, R300_WAIT_3D | R300_WAIT_3D_CLEAN); - - R300_STATECHANGE(r300, cb); - R300_STATECHANGE(r300, cmk); - R300_STATECHANGE(r300, zs); -} - -static void r300EmitClearState(GLcontext * ctx) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - int i; - int has_tcl; - int is_r500 = 0; - GLuint vap_cntl; - - has_tcl = r300->options.hw_tcl_enabled; - - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) - is_r500 = 1; - - /* State atom dirty tracking is a little subtle here. - * - * On the one hand, we need to make sure base state is emitted - * here if we start with an empty batch buffer, otherwise clear - * works incorrectly with multiple processes. Therefore, the first - * BEGIN_BATCH cannot be a BEGIN_BATCH_NO_AUTOSTATE. - * - * On the other hand, implicit state emission clears the state atom - * dirty bits, so we have to call R300_STATECHANGE later than the - * first BEGIN_BATCH. - * - * The final trickiness is that, because we change state, we need - * to ensure that any stored swtcl primitives are flushed properly - * before we start changing state. See the R300_NEWPRIM in r300Clear - * for this. - */ - BEGIN_BATCH(31); - OUT_BATCH_REGSEQ(R300_VAP_PROG_STREAM_CNTL_0, 1); - if (!has_tcl) - OUT_BATCH(((((0 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_0_SHIFT) | - ((R300_LAST_VEC | (2 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT))); - else - OUT_BATCH(((((0 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_0_SHIFT) | - ((R300_LAST_VEC | (1 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_4) << R300_DATA_TYPE_1_SHIFT))); - - OUT_BATCH_REGVAL(R300_FG_FOG_BLEND, 0); - OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_EXT_0, - ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | - (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | - (R300_SWIZZLE_SELECT_Z << R300_SWIZZLE_SELECT_Z_SHIFT) | - (R300_SWIZZLE_SELECT_W << R300_SWIZZLE_SELECT_W_SHIFT) | - ((R300_WRITE_ENA_X | R300_WRITE_ENA_Y | R300_WRITE_ENA_Z | R300_WRITE_ENA_W) << R300_WRITE_ENA_SHIFT)) - << R300_SWIZZLE0_SHIFT) | - (((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | - (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | - (R300_SWIZZLE_SELECT_Z << R300_SWIZZLE_SELECT_Z_SHIFT) | - (R300_SWIZZLE_SELECT_W << R300_SWIZZLE_SELECT_W_SHIFT) | - ((R300_WRITE_ENA_X | R300_WRITE_ENA_Y | R300_WRITE_ENA_Z | R300_WRITE_ENA_W) << R300_WRITE_ENA_SHIFT)) - << R300_SWIZZLE1_SHIFT))); - - /* R300_VAP_INPUT_CNTL_0, R300_VAP_INPUT_CNTL_1 */ - OUT_BATCH_REGSEQ(R300_VAP_VTX_STATE_CNTL, 2); - OUT_BATCH((R300_SEL_USER_COLOR_0 << R300_COLOR_0_ASSEMBLY_SHIFT)); - OUT_BATCH(R300_INPUT_CNTL_POS | R300_INPUT_CNTL_COLOR | R300_INPUT_CNTL_TC0); - - /* comes from fglrx startup of clear */ - OUT_BATCH_REGSEQ(R300_SE_VTE_CNTL, 2); - OUT_BATCH(R300_VTX_W0_FMT | R300_VPORT_X_SCALE_ENA | - R300_VPORT_X_OFFSET_ENA | R300_VPORT_Y_SCALE_ENA | - R300_VPORT_Y_OFFSET_ENA | R300_VPORT_Z_SCALE_ENA | - R300_VPORT_Z_OFFSET_ENA); - OUT_BATCH(0x8); - - OUT_BATCH_REGVAL(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); - - OUT_BATCH_REGSEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); - OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT | - R300_VAP_OUTPUT_VTX_FMT_0__COLOR_0_PRESENT); - OUT_BATCH(0); /* no textures */ - - OUT_BATCH_REGVAL(R300_TX_ENABLE, 0); - - OUT_BATCH_REGSEQ(R300_SE_VPORT_XSCALE, 6); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(dPriv->x); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(dPriv->y); - OUT_BATCH_FLOAT32(1.0); - OUT_BATCH_FLOAT32(0.0); - - OUT_BATCH_REGVAL(R300_FG_ALPHA_FUNC, 0); - - OUT_BATCH_REGSEQ(R300_RB3D_CBLEND, 2); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - END_BATCH(); - - R300_STATECHANGE(r300, vir[0]); - R300_STATECHANGE(r300, fogs); - R300_STATECHANGE(r300, vir[1]); - R300_STATECHANGE(r300, vic); - R300_STATECHANGE(r300, vte); - R300_STATECHANGE(r300, vof); - R300_STATECHANGE(r300, txe); - R300_STATECHANGE(r300, vpt); - R300_STATECHANGE(r300, at); - R300_STATECHANGE(r300, bld); - R300_STATECHANGE(r300, ps); - - if (has_tcl) { - R300_STATECHANGE(r300, vap_clip_cntl); - - BEGIN_BATCH_NO_AUTOSTATE(2); - OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_PS_UCP_MODE_CLIP_AS_TRIFAN | R300_CLIP_DISABLE); - END_BATCH(); - } - - BEGIN_BATCH_NO_AUTOSTATE(2); - OUT_BATCH_REGVAL(R300_GA_POINT_SIZE, - ((dPriv->w * 6) << R300_POINTSIZE_X_SHIFT) | - ((dPriv->h * 6) << R300_POINTSIZE_Y_SHIFT)); - END_BATCH(); - - if (!is_r500) { - R300_STATECHANGE(r300, ri); - R300_STATECHANGE(r300, rc); - R300_STATECHANGE(r300, rr); - - BEGIN_BATCH(14); - OUT_BATCH_REGSEQ(R300_RS_IP_0, 8); - for (i = 0; i < 8; ++i) - OUT_BATCH(R300_RS_SEL_T(1) | R300_RS_SEL_R(2) | R300_RS_SEL_Q(3)); - - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0x0); - - OUT_BATCH_REGVAL(R300_RS_INST_0, R300_RS_INST_COL_CN_WRITE); - END_BATCH(); - } else { - R300_STATECHANGE(r300, ri); - R300_STATECHANGE(r300, rc); - R300_STATECHANGE(r300, rr); - - BEGIN_BATCH(14); - OUT_BATCH_REGSEQ(R500_RS_IP_0, 8); - for (i = 0; i < 8; ++i) { - OUT_BATCH((R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_S_SHIFT) | - (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_T_SHIFT) | - (R500_RS_IP_PTR_K0 << R500_RS_IP_TEX_PTR_R_SHIFT) | - (R500_RS_IP_PTR_K1 << R500_RS_IP_TEX_PTR_Q_SHIFT)); - } - - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((1 << R300_IC_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0x0); - - OUT_BATCH_REGVAL(R500_RS_INST_0, R500_RS_INST_COL_CN_WRITE); - END_BATCH(); - } - - if (!is_r500) { - R300_STATECHANGE(r300, fp); - R300_STATECHANGE(r300, fpi[0]); - R300_STATECHANGE(r300, fpi[1]); - R300_STATECHANGE(r300, fpi[2]); - R300_STATECHANGE(r300, fpi[3]); - - BEGIN_BATCH(17); - OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(0x0); - OUT_BATCH(R300_RGBA_OUT); - - OUT_BATCH_REGVAL(R300_US_ALU_RGB_INST_0, - FP_INSTRC(MAD, FP_ARGC(SRC0C_XYZ), FP_ARGC(ONE), FP_ARGC(ZERO))); - OUT_BATCH_REGVAL(R300_US_ALU_RGB_ADDR_0, - FP_SELC(0, NO, XYZ, FP_TMP(0), 0, 0)); - OUT_BATCH_REGVAL(R300_US_ALU_ALPHA_INST_0, - FP_INSTRA(MAD, FP_ARGA(SRC0A), FP_ARGA(ONE), FP_ARGA(ZERO))); - OUT_BATCH_REGVAL(R300_US_ALU_ALPHA_ADDR_0, - FP_SELA(0, NO, W, FP_TMP(0), 0, 0)); - END_BATCH(); - } else { - struct radeon_state_atom r500fp; - uint32_t _cmd[10]; - - R300_STATECHANGE(r300, fp); - R300_STATECHANGE(r300, r500fp); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R500_US_CONFIG, 2); - OUT_BATCH(R500_ZERO_TIMES_ANYTHING_EQUALS_ZERO); - OUT_BATCH(0x0); - OUT_BATCH_REGSEQ(R500_US_CODE_ADDR, 3); - OUT_BATCH(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(1)); - OUT_BATCH(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(1)); - OUT_BATCH(R500_US_CODE_OFFSET_ADDR(0)); - END_BATCH(); - - r500fp.check = check_r500fp; - r500fp.cmd = _cmd; - r500fp.cmd[0] = cmdr500fp(r300->radeon.radeonScreen, 0, 1, 0, 0); - r500fp.cmd[1] = R500_INST_TYPE_OUT | - R500_INST_TEX_SEM_WAIT | - R500_INST_LAST | - R500_INST_RGB_OMASK_R | - R500_INST_RGB_OMASK_G | - R500_INST_RGB_OMASK_B | - R500_INST_ALPHA_OMASK | - R500_INST_RGB_CLAMP | - R500_INST_ALPHA_CLAMP; - r500fp.cmd[2] = R500_RGB_ADDR0(0) | - R500_RGB_ADDR1(0) | - R500_RGB_ADDR1_CONST | - R500_RGB_ADDR2(0) | - R500_RGB_ADDR2_CONST; - r500fp.cmd[3] = R500_ALPHA_ADDR0(0) | - R500_ALPHA_ADDR1(0) | - R500_ALPHA_ADDR1_CONST | - R500_ALPHA_ADDR2(0) | - R500_ALPHA_ADDR2_CONST; - r500fp.cmd[4] = R500_ALU_RGB_SEL_A_SRC0 | - R500_ALU_RGB_R_SWIZ_A_R | - R500_ALU_RGB_G_SWIZ_A_G | - R500_ALU_RGB_B_SWIZ_A_B | - R500_ALU_RGB_SEL_B_SRC0 | - R500_ALU_RGB_R_SWIZ_B_R | - R500_ALU_RGB_B_SWIZ_B_G | - R500_ALU_RGB_G_SWIZ_B_B; - r500fp.cmd[5] = R500_ALPHA_OP_CMP | - R500_ALPHA_SWIZ_A_A | - R500_ALPHA_SWIZ_B_A; - r500fp.cmd[6] = R500_ALU_RGBA_OP_CMP | - R500_ALU_RGBA_R_SWIZ_0 | - R500_ALU_RGBA_G_SWIZ_0 | - R500_ALU_RGBA_B_SWIZ_0 | - R500_ALU_RGBA_A_SWIZ_0; - - r500fp.cmd[7] = 0; - if (r300->radeon.radeonScreen->kernel_mm) { - emit_r500fp(ctx, &r500fp); - } else { - int dwords = r500fp.check(ctx,&r500fp); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(r500fp.cmd, dwords); - END_BATCH(); - } - - } - - BEGIN_BATCH(2); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); - END_BATCH(); - - if (has_tcl) { - vap_cntl = ((10 << R300_PVS_NUM_SLOTS_SHIFT) | - (5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (12 << R300_VF_MAX_VTX_NUM_SHIFT)); - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) - vap_cntl |= R500_TCL_STATE_OPTIMIZATION; - } else { - vap_cntl = ((10 << R300_PVS_NUM_SLOTS_SHIFT) | - (5 << R300_PVS_NUM_CNTLRS_SHIFT) | - (5 << R300_VF_MAX_VTX_NUM_SHIFT)); - } - - if (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV515) - vap_cntl |= (2 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV530) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV560) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV570)) - vap_cntl |= (5 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_RV410) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R420)) - vap_cntl |= (6 << R300_PVS_NUM_FPUS_SHIFT); - else if ((r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R520) || - (r300->radeon.radeonScreen->chip_family == CHIP_FAMILY_R580)) - vap_cntl |= (8 << R300_PVS_NUM_FPUS_SHIFT); - else - vap_cntl |= (4 << R300_PVS_NUM_FPUS_SHIFT); - - R300_STATECHANGE(r300, vap_cntl); - - BEGIN_BATCH(2); - OUT_BATCH_REGVAL(R300_VAP_CNTL, vap_cntl); - END_BATCH(); - - if (has_tcl) { - struct radeon_state_atom vpu; - uint32_t _cmd[10]; - R300_STATECHANGE(r300, pvs); - R300_STATECHANGE(r300, vap_flush); - R300_STATECHANGE(r300, vpi); - - BEGIN_BATCH(4); - OUT_BATCH_REGSEQ(R300_VAP_PVS_CODE_CNTL_0, 3); - OUT_BATCH((0 << R300_PVS_FIRST_INST_SHIFT) | - (0 << R300_PVS_XYZW_VALID_INST_SHIFT) | - (1 << R300_PVS_LAST_INST_SHIFT)); - OUT_BATCH((0 << R300_PVS_CONST_BASE_OFFSET_SHIFT) | - (0 << R300_PVS_MAX_CONST_ADDR_SHIFT)); - OUT_BATCH(1 << R300_PVS_LAST_VTX_SRC_INST_SHIFT); - END_BATCH(); - - vpu.check = check_vpu; - vpu.cmd = _cmd; - vpu.cmd[0] = cmdvpu(r300->radeon.radeonScreen, 0, 2); - - vpu.cmd[1] = PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, - 0, 0xf, PVS_DST_REG_OUT); - vpu.cmd[2] = PVS_SRC_OPERAND(0, PVS_SRC_SELECT_X, PVS_SRC_SELECT_Y, - PVS_SRC_SELECT_Z, PVS_SRC_SELECT_W, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[3] = PVS_SRC_OPERAND(0, PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[4] = 0x0; - - vpu.cmd[5] = PVS_OP_DST_OPERAND(VE_ADD, GL_FALSE, GL_FALSE, 1, 0xf, - PVS_DST_REG_OUT); - vpu.cmd[6] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_X, - PVS_SRC_SELECT_Y, PVS_SRC_SELECT_Z, - PVS_SRC_SELECT_W, PVS_SRC_REG_INPUT, - NEGATE_NONE); - vpu.cmd[7] = PVS_SRC_OPERAND(1, PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_SELECT_FORCE_0, - PVS_SRC_REG_INPUT, NEGATE_NONE); - vpu.cmd[8] = 0x0; - - if (r300->radeon.radeonScreen->kernel_mm) { - int dwords = r300->hw.vap_flush.check(ctx,&r300->hw.vap_flush); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(r300->hw.vap_flush.cmd, dwords); - END_BATCH(); - emit_vpu(ctx, &vpu); - } else { - int dwords = vpu.check(ctx,&vpu); - BEGIN_BATCH_NO_AUTOSTATE(dwords); - OUT_BATCH_TABLE(vpu.cmd, dwords); - END_BATCH(); - } - - } -} - -static int r300KernelClear(GLcontext *ctx, GLuint flags) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - struct radeon_framebuffer *rfb = dPriv->driverPrivate; - struct radeon_renderbuffer *rrb; - struct radeon_renderbuffer *rrbd; - int bits = 0, ret; - - /* Make sure it fits there. */ - radeon_cs_space_reset_bos(r300->radeon.cmdbuf.cs); - - if (flags & BUFFER_BIT_COLOR0) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_COLOR0); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - if (flags & BUFFER_BIT_FRONT_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - if (flags & BUFFER_BIT_BACK_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_BACK_LEFT); - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrb->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - rrbd = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rrbd) { - radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, - rrbd->bo, 0, RADEON_GEM_DOMAIN_VRAM); - } - - ret = radeon_cs_space_check(r300->radeon.cmdbuf.cs); - if (ret) - return -1; - - rcommonEnsureCmdBufSpace(&r300->radeon, 421 * 3, __FUNCTION__); - if (flags || bits) - r300EmitClearState(ctx); - - rrbd = radeon_get_renderbuffer(&rfb->base, BUFFER_DEPTH); - if (rrbd && (flags & BUFFER_BIT_DEPTH)) - bits |= CLEARBUFFER_DEPTH; - - if (rrbd && (flags & BUFFER_BIT_STENCIL)) - bits |= CLEARBUFFER_STENCIL; - - if (flags & BUFFER_BIT_COLOR0) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_COLOR0); - r300ClearBuffer(r300, CLEARBUFFER_COLOR, rrb, NULL); - bits = 0; - } - - if (flags & BUFFER_BIT_FRONT_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_FRONT_LEFT); - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, rrb, rrbd); - bits = 0; - } - - if (flags & BUFFER_BIT_BACK_LEFT) { - rrb = radeon_get_renderbuffer(&rfb->base, BUFFER_BACK_LEFT); - r300ClearBuffer(r300, bits | CLEARBUFFER_COLOR, rrb, rrbd); - bits = 0; - } - - if (bits) - r300ClearBuffer(r300, bits, NULL, rrbd); - - COMMIT_BATCH(); - return 0; -} - -/** - * Buffer clear - */ -static void r300Clear(GLcontext * ctx, GLbitfield mask) -{ - r300ContextPtr r300 = R300_CONTEXT(ctx); - __DRIdrawablePrivate *dPriv = radeon_get_drawable(&r300->radeon); - const GLuint colorMask = *((GLuint *) & ctx->Color.ColorMask); - GLbitfield swrast_mask = 0, tri_mask = 0; - int i, ret; - struct gl_framebuffer *fb = ctx->DrawBuffer; - - if (RADEON_DEBUG & RADEON_IOCTL) - fprintf(stderr, "r300Clear\n"); - - if (!r300->radeon.radeonScreen->driScreen->dri2.enabled) { - LOCK_HARDWARE(&r300->radeon); - UNLOCK_HARDWARE(&r300->radeon); - if (dPriv->numClipRects == 0) - return; - } - - /* Flush swtcl vertices if necessary, because we will change hardware - * state during clear. See also the state-related comment in - * r300EmitClearState. - */ - R300_NEWPRIM(r300); - - if (colorMask == ~0) - tri_mask |= (mask & BUFFER_BITS_COLOR); - else - tri_mask |= (mask & (BUFFER_BIT_FRONT_LEFT | BUFFER_BIT_BACK_LEFT)); - - - /* HW stencil */ - if (mask & BUFFER_BIT_STENCIL) { - tri_mask |= BUFFER_BIT_STENCIL; - } - - /* HW depth */ - if (mask & BUFFER_BIT_DEPTH) { - tri_mask |= BUFFER_BIT_DEPTH; - } - - /* If we're doing a tri pass for depth/stencil, include a likely color - * buffer with it. - */ - - for (i = 0; i < BUFFER_COUNT; i++) { - GLuint bufBit = 1 << i; - if ((tri_mask) & bufBit) { - if (!fb->Attachment[i].Renderbuffer->ClassID) { - tri_mask &= ~bufBit; - swrast_mask |= bufBit; - } - } - } - - /* SW fallback clearing */ - swrast_mask = mask & ~tri_mask; - - ret = 0; - if (tri_mask) { - if (r300->radeon.radeonScreen->kernel_mm) - radeonUserClear(ctx, tri_mask); - else { - /* if kernel clear fails due to size restraints fallback */ - ret = r300KernelClear(ctx, tri_mask); - if (ret < 0) - swrast_mask |= tri_mask; - } - } - - if (swrast_mask) { - if (RADEON_DEBUG & RADEON_FALLBACKS) - fprintf(stderr, "%s: swrast clear, mask: %x\n", - __FUNCTION__, swrast_mask); - _swrast_Clear(ctx, swrast_mask); - } -} - -void r300InitIoctlFuncs(struct dd_function_table *functions) -{ - functions->Clear = r300Clear; - functions->Finish = radeonFinish; - functions->Flush = radeonFlush; -} diff --git a/src/mesa/drivers/dri/r300/r300_ioctl.h b/src/mesa/drivers/dri/r300/r300_ioctl.h deleted file mode 100644 index 3abfa71a6e8..00000000000 --- a/src/mesa/drivers/dri/r300/r300_ioctl.h +++ /dev/null @@ -1,44 +0,0 @@ -/* -Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved. - -The Weather Channel (TM) funded Tungsten Graphics to develop the -initial release of the Radeon 8500 driver under the XFree86 license. -This notice must be preserved. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice (including the -next paragraph) shall be included in all copies or substantial -portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE -LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION -OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION -WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -**************************************************************************/ - -/* - * Authors: - * Keith Whitwell - * Nicolai Haehnle - */ - -#ifndef __R300_IOCTL_H__ -#define __R300_IOCTL_H__ - -#include "r300_context.h" -#include "radeon_drm.h" - -extern void r300InitIoctlFuncs(struct dd_function_table *functions); - -#endif /* __R300_IOCTL_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_render.c b/src/mesa/drivers/dri/r300/r300_render.c index 4ae593cbe79..02c94250a8f 100644 --- a/src/mesa/drivers/dri/r300/r300_render.c +++ b/src/mesa/drivers/dri/r300/r300_render.c @@ -68,7 +68,6 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/tnl.h" #include "tnl/t_vp_build.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" #include "r300_tex.h" diff --git a/src/mesa/drivers/dri/r300/r300_state.c b/src/mesa/drivers/dri/r300/r300_state.c index ac20c08e201..da0a9dfb4cf 100644 --- a/src/mesa/drivers/dri/r300/r300_state.c +++ b/src/mesa/drivers/dri/r300/r300_state.c @@ -55,7 +55,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "tnl/t_vp_build.h" #include "r300_context.h" -#include "r300_ioctl.h" #include "r300_state.h" #include "r300_reg.h" #include "r300_emit.h" diff --git a/src/mesa/drivers/dri/r300/r300_tex.c b/src/mesa/drivers/dri/r300/r300_tex.c index 726b3ff98e1..ac3d5b1bec3 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.c +++ b/src/mesa/drivers/dri/r300/r300_tex.c @@ -48,7 +48,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index d80284e1b9e..68b90d31063 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -46,7 +46,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "r300_state.h" -#include "r300_ioctl.h" #include "radeon_mipmap_tree.h" #include "r300_tex.h" #include "r300_reg.h" -- cgit v1.2.3 From 05fae9fbf6d4409a8718813d9a607afc3c162050 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 21:18:08 +0100 Subject: r300: refactor color buffer setup --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 216 ++++++++++++++++++-------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 9 +- 2 files changed, 129 insertions(+), 96 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index efeeb0646d0..57641998a42 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -255,110 +255,136 @@ static int check_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) return dw; } -static void emit_cb_offset(GLcontext *ctx, struct radeon_state_atom * atom) +static void emit_scissor(struct r300_context *r300, + unsigned width, + unsigned height) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - struct radeon_renderbuffer *rrb; - uint32_t cbpitch; - uint32_t offset = r300->radeon.state.color.draw_offset; - uint32_t dw = 6; - int i; + int i; + BATCH_LOCALS(&r300->radeon); + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH(0); + OUT_BATCH(((width - 1) << R300_SCISSORS_X_SHIFT) | + ((height - 1) << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(16); + for (i = 0; i < 4; i++) { + OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); + OUT_BATCH((0 << R300_CLIPRECT_X_SHIFT) | (0 << R300_CLIPRECT_Y_SHIFT)); + OUT_BATCH(((width - 1) << R300_CLIPRECT_X_SHIFT) | ((height - 1) << R300_CLIPRECT_Y_SHIFT)); + } + OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); + OUT_BATCH(0xAAAA); + OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); + OUT_BATCH(0xffffff); + END_BATCH(); + } else { + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH((R300_SCISSORS_OFFSET << R300_SCISSORS_X_SHIFT) | + (R300_SCISSORS_OFFSET << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH(((width + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_X_SHIFT) | + ((height + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); + BEGIN_BATCH_NO_AUTOSTATE(16); + for (i = 0; i < 4; i++) { + OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); + OUT_BATCH((R300_SCISSORS_OFFSET << R300_CLIPRECT_X_SHIFT) | (R300_SCISSORS_OFFSET << R300_CLIPRECT_Y_SHIFT)); + OUT_BATCH(((R300_SCISSORS_OFFSET + width - 1) << R300_CLIPRECT_X_SHIFT) | + ((R300_SCISSORS_OFFSET + height - 1) << R300_CLIPRECT_Y_SHIFT)); + } + OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); + OUT_BATCH(0xAAAA); + OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); + OUT_BATCH(0xffffff); + END_BATCH(); + } +} - rrb = radeon_get_colorbuffer(&r300->radeon); - if (!rrb || !rrb->bo) { - fprintf(stderr, "no rrb\n"); - return; - } +void r300_emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + uint32_t offset, + GLuint format, + unsigned cpp, + unsigned pitch) +{ + BATCH_LOCALS(&r300->radeon); + uint32_t cbpitch = pitch / cpp; + uint32_t dw = 6; - if (RADEON_DEBUG & RADEON_STATE) - fprintf(stderr,"rrb is %p %d %dx%d\n", rrb, offset, rrb->base.Width, rrb->base.Height); - cbpitch = (rrb->pitch / rrb->cpp); - if (rrb->cpp == 4) - cbpitch |= R300_COLOR_FORMAT_ARGB8888; - else switch (rrb->base.Format) { + assert(offset % 256 == 0); + + switch (format) { case MESA_FORMAT_RGB565: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_RGB565; - break; + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_RGB565; + break; case MESA_FORMAT_RGB565_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_RGB565; - break; + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_RGB565; + break; case MESA_FORMAT_ARGB4444: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB4444; - break; + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB4444; + break; case MESA_FORMAT_ARGB4444_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB4444; - break; - case MESA_FORMAT_ARGB1555: - assert(_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB1555; - break; - case MESA_FORMAT_ARGB1555_REV: - assert(!_mesa_little_endian()); - cbpitch |= R300_COLOR_FORMAT_ARGB1555; - break; - default: - _mesa_problem(ctx, "unexpected format in emit_cb_offset()"); - } + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB4444; + break; + case MESA_FORMAT_ARGB1555: + assert(_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB1555; + break; + case MESA_FORMAT_ARGB1555_REV: + assert(!_mesa_little_endian()); + cbpitch |= R300_COLOR_FORMAT_ARGB1555; + break; + default: + if (cpp == 4) { + cbpitch |= R300_COLOR_FORMAT_ARGB8888; + } else { + _mesa_problem(r300->radeon.glCtx, "unexpected format in emit_cb_offset()");; + } + break; + } - if (rrb->bo->flags & RADEON_BO_FLAGS_MACRO_TILE) - cbpitch |= R300_COLOR_TILE_ENABLE; + if (bo->flags & RADEON_BO_FLAGS_MACRO_TILE) + cbpitch |= R300_COLOR_TILE_ENABLE; + + if (r300->radeon.radeonScreen->kernel_mm) + dw += 2; + + BEGIN_BATCH_NO_AUTOSTATE(dw); + OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); + OUT_BATCH_RELOC(offset, bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); + OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1); + if (!r300->radeon.radeonScreen->kernel_mm) + OUT_BATCH(cbpitch); + else + OUT_BATCH_RELOC(cbpitch, bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); + END_BATCH(); +} + +static void emit_cb_offset_atom(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + struct radeon_renderbuffer *rrb; + uint32_t offset = r300->radeon.state.color.draw_offset; + + rrb = radeon_get_colorbuffer(&r300->radeon); + if (!rrb || !rrb->bo) { + fprintf(stderr, "no rrb\n"); + return; + } + + if (RADEON_DEBUG & RADEON_STATE) + fprintf(stderr,"rrb is %p %d %dx%d\n", rrb, offset, rrb->base.Width, rrb->base.Height); + + r300_emit_cb_setup(r300, rrb->bo, offset, rrb->base.Format, rrb->cpp, rrb->pitch); - if (r300->radeon.radeonScreen->kernel_mm) - dw += 2; - BEGIN_BATCH_NO_AUTOSTATE(dw); - OUT_BATCH_REGSEQ(R300_RB3D_COLOROFFSET0, 1); - OUT_BATCH_RELOC(offset, rrb->bo, offset, 0, RADEON_GEM_DOMAIN_VRAM, 0); - OUT_BATCH_REGSEQ(R300_RB3D_COLORPITCH0, 1); - if (!r300->radeon.radeonScreen->kernel_mm) - OUT_BATCH(cbpitch); - else - OUT_BATCH_RELOC(cbpitch, rrb->bo, cbpitch, 0, RADEON_GEM_DOMAIN_VRAM, 0); - END_BATCH(); if (r300->radeon.radeonScreen->driScreen->dri2.enabled) { - if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { - BEGIN_BATCH_NO_AUTOSTATE(3); - OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); - OUT_BATCH(0); - OUT_BATCH(((rrb->base.Width - 1) << R300_SCISSORS_X_SHIFT) | - ((rrb->base.Height - 1) << R300_SCISSORS_Y_SHIFT)); - END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(16); - for (i = 0; i < 4; i++) { - OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); - OUT_BATCH((0 << R300_CLIPRECT_X_SHIFT) | (0 << R300_CLIPRECT_Y_SHIFT)); - OUT_BATCH(((rrb->base.Width - 1) << R300_CLIPRECT_X_SHIFT) | ((rrb->base.Height - 1) << R300_CLIPRECT_Y_SHIFT)); - } - OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); - OUT_BATCH(0xAAAA); - OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); - OUT_BATCH(0xffffff); - END_BATCH(); - } else { - BEGIN_BATCH_NO_AUTOSTATE(3); - OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); - OUT_BATCH((R300_SCISSORS_OFFSET << R300_SCISSORS_X_SHIFT) | - (R300_SCISSORS_OFFSET << R300_SCISSORS_Y_SHIFT)); - OUT_BATCH(((rrb->base.Width + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_X_SHIFT) | - ((rrb->base.Height + R300_SCISSORS_OFFSET - 1) << R300_SCISSORS_Y_SHIFT)); - END_BATCH(); - BEGIN_BATCH_NO_AUTOSTATE(16); - for (i = 0; i < 4; i++) { - OUT_BATCH_REGSEQ(R300_SC_CLIPRECT_TL_0 + (i * 8), 2); - OUT_BATCH((R300_SCISSORS_OFFSET << R300_CLIPRECT_X_SHIFT) | (R300_SCISSORS_OFFSET << R300_CLIPRECT_Y_SHIFT)); - OUT_BATCH(((R300_SCISSORS_OFFSET + rrb->base.Width - 1) << R300_CLIPRECT_X_SHIFT) | - ((R300_SCISSORS_OFFSET + rrb->base.Height - 1) << R300_CLIPRECT_Y_SHIFT)); - } - OUT_BATCH_REGSEQ(R300_SC_CLIP_RULE, 1); - OUT_BATCH(0xAAAA); - OUT_BATCH_REGSEQ(R300_SC_SCREENDOOR, 1); - OUT_BATCH(0xffffff); - END_BATCH(); - } + emit_scissor(r300, rrb->base.Width, rrb->base.Height); } } @@ -693,7 +719,7 @@ void r300InitCmdBuf(r300ContextPtr r300) ALLOC_STATE(rop, always, 2, 0); r300->hw.rop.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_ROPCNTL, 1); ALLOC_STATE(cb, cb_offset, R300_CB_CMDSIZE, 0); - r300->hw.cb.emit = &emit_cb_offset; + r300->hw.cb.emit = &emit_cb_offset_atom; ALLOC_STATE(rb3d_dither_ctl, always, 10, 0); r300->hw.rb3d_dither_ctl.cmd[0] = cmdpacket0(r300->radeon.radeonScreen, R300_RB3D_DITHER_CTL, 9); ALLOC_STATE(rb3d_aaresolve_ctl, always, 2, 0); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 1b703e518a0..4cde1e2dcf7 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -54,4 +54,11 @@ void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom); int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom); int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom); -#endif /* __R300_CMDBUF_H__ */ +void r300_emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + uint32_t offset, + GLuint format, + unsigned cpp, + unsigned pitch); + +#endif /* __R300_CMDBUF_H__ */ -- cgit v1.2.3 From 545a2f4f2d94b663e67cf1e682b49d088dd7ee90 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 19:51:44 +0100 Subject: r300: refactor R500 fragment program emission --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 63 ++++++++++++++++++++------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 11 +++--- 2 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 57641998a42..09a6a033d17 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -107,32 +107,45 @@ void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom) END_BATCH(); } -void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom) +void r500_emit_fp(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr, + unsigned type, + unsigned clamp) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - drm_r300_cmd_header_t cmd; - uint32_t addr, ndw, sz; - int type, clamp; + BATCH_LOCALS(&r300->radeon); - ndw = atom->check(ctx, atom); + addr |= (type << 16); + addr |= (clamp << 17); - cmd.u = atom->cmd[0]; - sz = cmd.r500fp.count; - addr = ((cmd.r500fp.adrhi_flags & 1) << 8) | cmd.r500fp.adrlo; - type = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_TYPE); - clamp = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_CLAMP); + BEGIN_BATCH_NO_AUTOSTATE(len + 3); + OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_INDEX, 0)); + OUT_BATCH(addr); + OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_DATA, len-1) | RADEON_ONE_REG_WR); + OUT_BATCH_TABLE(data, len); + END_BATCH(); +} - addr |= (type << 16); - addr |= (clamp << 17); +static void emit_r500fp_atom(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + drm_r300_cmd_header_t cmd; + uint32_t addr, count; + int type, clamp; - BEGIN_BATCH_NO_AUTOSTATE(ndw); - OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_INDEX, 0)); - OUT_BATCH(addr); - ndw-=3; - OUT_BATCH(CP_PACKET0(R500_GA_US_VECTOR_DATA, ndw-1) | RADEON_ONE_REG_WR); - OUT_BATCH_TABLE(&atom->cmd[1], ndw); - END_BATCH(); + cmd.u = atom->cmd[0]; + addr = ((cmd.r500fp.adrhi_flags & 1) << 8) | cmd.r500fp.adrlo; + type = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_TYPE); + clamp = !!(cmd.r500fp.adrhi_flags & R500FP_CONSTANT_CLAMP); + + if (type) { + count = r500fp_count(atom->cmd) * 4; + } else { + count = r500fp_count(atom->cmd) * 6; + } + + r500_emit_fp(r300, &atom->cmd[1], count, addr, type, clamp); } static int check_tex_offsets(GLcontext *ctx, struct radeon_state_atom * atom) @@ -480,7 +493,7 @@ static int check_variable(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? cnt + 1 : 0; } -int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) { int cnt; r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -492,7 +505,7 @@ int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? (cnt * 6) + extra : 0; } -int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom) { int cnt; r300ContextPtr r300 = R300_CONTEXT(ctx); @@ -669,13 +682,13 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(r300->radeon.radeonScreen, 0, 0, 0, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.r500fp.emit = emit_r500fp; + r300->hw.r500fp.emit = emit_r500fp_atom; ALLOC_STATE(r500fp_const, r500fp_const, R500_FPP_CMDSIZE, 0); r300->hw.r500fp_const.cmd[R300_FPI_CMD_0] = cmdr500fp(r300->radeon.radeonScreen, 0, 0, 1, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.r500fp_const.emit = emit_r500fp; + r300->hw.r500fp_const.emit = emit_r500fp_atom; } else { ALLOC_STATE(fp, always, R300_FP_CMDSIZE, 0); r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(r300->radeon.radeonScreen, R300_US_CONFIG, 3); diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index 4cde1e2dcf7..ee2db6e21d8 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -44,15 +44,18 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define FIREAOS_BUFSZ (3) #define SCISSORS_BUFSZ (3) -extern void r300InitCmdBuf(r300ContextPtr r300); +void r300InitCmdBuf(r300ContextPtr r300); void r300_emit_scissor(GLcontext *ctx); void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom); int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom); -void emit_r500fp(GLcontext *ctx, struct radeon_state_atom * atom); -int check_r500fp(GLcontext *ctx, struct radeon_state_atom *atom); -int check_r500fp_const(GLcontext *ctx, struct radeon_state_atom *atom); +void r500_emit_fp(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr, + unsigned type, + unsigned clamp); void r300_emit_cb_setup(struct r300_context *r300, struct radeon_bo *bo, -- cgit v1.2.3 From 9975c484ad828c80089c718dcdbdb2040f45b67b Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 21:13:55 +0100 Subject: r300: refactor PVS code and constants emission --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 54 ++++++++++++++++++--------------- src/mesa/drivers/dri/r300/r300_cmdbuf.h | 6 ++-- 2 files changed, 34 insertions(+), 26 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 09a6a033d17..4b0005e155f 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -71,7 +71,7 @@ static unsigned packet0_count(r300ContextPtr r300, uint32_t *pkt) #define vpu_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->vpu.count) #define r500fp_count(ptr) (((drm_r300_cmd_header_t*)(ptr))->r500fp.count) -int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) +static int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) { r300ContextPtr r300 = R300_CONTEXT(ctx); int cnt; @@ -85,26 +85,32 @@ int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom) return cnt ? (cnt * 4) + extra : 0; } - -void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom) +void r300_emit_vpu(struct r300_context *r300, + uint32_t *data, + unsigned len, + uint32_t addr) { - r300ContextPtr r300 = R300_CONTEXT(ctx); - BATCH_LOCALS(&r300->radeon); - drm_r300_cmd_header_t cmd; - uint32_t addr, ndw; + BATCH_LOCALS(&r300->radeon); - cmd.u = atom->cmd[0]; - addr = (cmd.vpu.adrhi << 8) | cmd.vpu.adrlo; - ndw = atom->check(ctx, atom); + BEGIN_BATCH_NO_AUTOSTATE(5 + len); + OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); + OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); + OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, len-1) | RADEON_ONE_REG_WR); + OUT_BATCH_TABLE(data, len); + END_BATCH(); +} - BEGIN_BATCH_NO_AUTOSTATE(ndw); +static void emit_vpu_state(GLcontext *ctx, struct radeon_state_atom * atom) +{ + r300ContextPtr r300 = R300_CONTEXT(ctx); + drm_r300_cmd_header_t cmd; + uint32_t addr, ndw; - ndw -= 5; - OUT_BATCH_REGVAL(R300_VAP_PVS_VECTOR_INDX_REG, addr); - OUT_BATCH(CP_PACKET0(R300_VAP_PVS_UPLOAD_DATA, ndw-1) | RADEON_ONE_REG_WR); - OUT_BATCH_TABLE(&atom->cmd[1], ndw); - OUT_BATCH_REGVAL(R300_VAP_PVS_STATE_FLUSH_REG, 0); - END_BATCH(); + cmd.u = atom->cmd[0]; + addr = (cmd.vpu.adrhi << 8) | cmd.vpu.adrlo; + ndw = atom->check(ctx, atom); + + r300_emit_vpu(r300, &atom->cmd[1], vpu_count(atom->cmd) * 4, addr); } void r500_emit_fp(struct r300_context *r300, @@ -796,20 +802,20 @@ void r300InitCmdBuf(r300ContextPtr r300) r300->hw.vpi.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CODE_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpi.emit = emit_vpu; + r300->hw.vpi.emit = emit_vpu_state; if (is_r500) { ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0); r300->hw.vpp.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R500_PVS_CONST_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpp.emit = emit_vpu; + r300->hw.vpp.emit = emit_vpu_state; ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0); r300->hw.vps.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R500_POINT_VPORT_SCALE_OFFSET, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vps.emit = emit_vpu; + r300->hw.vps.emit = emit_vpu_state; for (i = 0; i < 6; i++) { ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0); @@ -817,20 +823,20 @@ void r300InitCmdBuf(r300ContextPtr r300) cmdvpu(r300->radeon.radeonScreen, R500_PVS_UCP_START + i, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpucp[i].emit = emit_vpu; + r300->hw.vpucp[i].emit = emit_vpu_state; } } else { ALLOC_STATE(vpp, vpu, R300_VPP_CMDSIZE, 0); r300->hw.vpp.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_PVS_CONST_START, 0); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpp.emit = emit_vpu; + r300->hw.vpp.emit = emit_vpu_state; ALLOC_STATE(vps, vpu, R300_VPS_CMDSIZE, 0); r300->hw.vps.cmd[0] = cmdvpu(r300->radeon.radeonScreen, R300_POINT_VPORT_SCALE_OFFSET, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vps.emit = emit_vpu; + r300->hw.vps.emit = emit_vpu_state; for (i = 0; i < 6; i++) { ALLOC_STATE(vpucp[i], vpu, R300_VPUCP_CMDSIZE, 0); @@ -838,7 +844,7 @@ void r300InitCmdBuf(r300ContextPtr r300) cmdvpu(r300->radeon.radeonScreen, R300_PVS_UCP_START + i, 1); if (r300->radeon.radeonScreen->kernel_mm) - r300->hw.vpucp[i].emit = emit_vpu; + r300->hw.vpucp[i].emit = emit_vpu_state; } } } diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.h b/src/mesa/drivers/dri/r300/r300_cmdbuf.h index ee2db6e21d8..0e68da928ed 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.h +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.h @@ -47,8 +47,10 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. void r300InitCmdBuf(r300ContextPtr r300); void r300_emit_scissor(GLcontext *ctx); -void emit_vpu(GLcontext *ctx, struct radeon_state_atom * atom); -int check_vpu(GLcontext *ctx, struct radeon_state_atom *atom); +void r300_emit_vpu(struct r300_context *ctx, + uint32_t *data, + unsigned len, + uint32_t addr); void r500_emit_fp(struct r300_context *r300, uint32_t *data, -- cgit v1.2.3 From bd58253f675cb37b7521f082f80a3fd9cab6eff1 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 7 Nov 2009 22:48:23 +0100 Subject: r300: export translateTexFormat function --- src/mesa/drivers/dri/r300/r300_tex.h | 2 ++ src/mesa/drivers/dri/r300/r300_texstate.c | 11 +++++++---- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index 8a653ea2d11..beb10072e9c 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -51,4 +51,6 @@ extern GLboolean r300ValidateBuffers(GLcontext * ctx); extern void r300InitTextureFuncs(struct dd_function_table *functions); +uint32_t r300TranslateTexFormat(gl_format mesaFormat); + #endif /* __r300_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 68b90d31063..6db56ba618f 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -59,7 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -static uint32_t translateTexFormat(gl_format mesaFormat) +uint32_t r300TranslateTexFormat(gl_format mesaFormat) { switch (mesaFormat) { @@ -168,8 +168,6 @@ static uint32_t translateTexFormat(gl_format mesaFormat) case MESA_FORMAT_SRGBA_DXT5: return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5) | R300_TX_FORMAT_GAMMA; default: - fprintf(stderr, "%s: Invalid format %s", __FUNCTION__, _mesa_get_format_name(mesaFormat)); - assert(0); return 0; } }; @@ -254,7 +252,12 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = translateTexFormat(firstImage->TexFormat); + t->pp_txformat = r300TranslateTexFormat(firstImage->TexFormat); + if (t->pp_txformat == 0) { + _mesa_problem(rmesa->radeon.glCtx, "%s: Invalid format %s", + __FUNCTION__, _mesa_get_format_name(firstImage->TexFormat)); + _mesa_exit(1); + } } } -- cgit v1.2.3 From 0a0d410bdbbc9ea9b56fca51e077de32d629d20d Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 21:44:24 +0100 Subject: r300: fix wrong assertion --- src/mesa/drivers/dri/r300/r300_cmdbuf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_cmdbuf.c b/src/mesa/drivers/dri/r300/r300_cmdbuf.c index 4b0005e155f..e1c33bbb2cf 100644 --- a/src/mesa/drivers/dri/r300/r300_cmdbuf.c +++ b/src/mesa/drivers/dri/r300/r300_cmdbuf.c @@ -332,7 +332,7 @@ void r300_emit_cb_setup(struct r300_context *r300, uint32_t cbpitch = pitch / cpp; uint32_t dw = 6; - assert(offset % 256 == 0); + assert(offset % 32 == 0); switch (format) { case MESA_FORMAT_RGB565: -- cgit v1.2.3 From a4df3f9227f1e068792454920d9ec782326da88f Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 22:01:12 +0100 Subject: r300: accelerated blit support --- src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/r300_blit.c | 468 +++++++++++++++++++++++++++++++ src/mesa/drivers/dri/r300/r300_blit.h | 46 +++ src/mesa/drivers/dri/r300/r300_context.c | 2 + src/mesa/drivers/dri/r300/r300_context.h | 5 + 5 files changed, 522 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_blit.c create mode 100644 src/mesa/drivers/dri/r300/r300_blit.h diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index 9fd0133fda3..b5145d98380 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -43,6 +43,7 @@ RADEON_COMMON_SOURCES = \ DRIVER_SOURCES = \ radeon_screen.c \ + r300_blit.c \ r300_context.c \ r300_draw.c \ r300_cmdbuf.c \ diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c new file mode 100644 index 00000000000..7cb6f36c020 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -0,0 +1,468 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "radeon_common.h" +#include "r300_context.h" + +#include "r300_blit.h" +#include "r300_cmdbuf.h" +#include "r300_emit.h" +#include "r300_tex.h" +#include "compiler/radeon_compiler.h" +#include "compiler/radeon_opcodes.h" + +/** + * TODO: + * - handle depth buffer + * - r300 fp and rs setup + */ + +static void vp_ins_outs(struct r300_vertex_program_compiler *c) +{ + c->code->inputs[VERT_ATTRIB_POS] = 0; + c->code->inputs[VERT_ATTRIB_TEX0] = 1; + c->code->outputs[VERT_RESULT_HPOS] = 0; + c->code->outputs[VERT_RESULT_TEX0] = 1; +} + +static void fp_allocate_hw_inputs( + struct r300_fragment_program_compiler * c, + void (*allocate)(void * data, unsigned input, unsigned hwreg), + void * mydata) +{ + allocate(mydata, FRAG_ATTRIB_TEX0, 0); +} + +static void create_vertex_program(struct r300_context *r300) +{ + struct r300_vertex_program_compiler compiler; + struct rc_instruction *inst; + + rc_init(&compiler.Base); + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = VERT_RESULT_HPOS; + inst->U.I.DstReg.RelAddr = 0; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = VERT_ATTRIB_POS; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_MOV; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = VERT_RESULT_TEX0; + inst->U.I.DstReg.RelAddr = 0; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = VERT_ATTRIB_TEX0; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + compiler.Base.Program.InputsRead = (1 << VERT_ATTRIB_POS) | (1 << VERT_ATTRIB_TEX0); + compiler.RequiredOutputs = compiler.Base.Program.OutputsWritten = (1 << VERT_RESULT_HPOS) | (1 << VERT_RESULT_TEX0); + compiler.SetHwInputOutput = vp_ins_outs; + compiler.code = &r300->blit.vp_code; + + r3xx_compile_vertex_program(&compiler); +} + +static void create_fragment_program(struct r300_context *r300) +{ + struct r300_fragment_program_compiler compiler; + struct rc_instruction *inst; + + rc_init(&compiler.Base); + + inst = rc_insert_new_instruction(&compiler.Base, compiler.Base.Program.Instructions.Prev); + inst->U.I.Opcode = RC_OPCODE_TEX; + inst->U.I.TexSrcTarget = RC_TEXTURE_2D; + inst->U.I.TexSrcUnit = 0; + inst->U.I.DstReg.File = RC_FILE_OUTPUT; + inst->U.I.DstReg.Index = FRAG_RESULT_COLOR; + inst->U.I.DstReg.WriteMask = RC_MASK_XYZW; + inst->U.I.SrcReg[0].Abs = 0; + inst->U.I.SrcReg[0].File = RC_FILE_INPUT; + inst->U.I.SrcReg[0].Index = FRAG_ATTRIB_TEX0; + inst->U.I.SrcReg[0].Negate = 0; + inst->U.I.SrcReg[0].RelAddr = 0; + inst->U.I.SrcReg[0].Swizzle = RC_SWIZZLE_XYZW; + + compiler.Base.Program.InputsRead = (1 << FRAG_ATTRIB_TEX0); + compiler.OutputColor = FRAG_RESULT_COLOR; + compiler.OutputDepth = FRAG_RESULT_DEPTH; + compiler.is_r500 = (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515); + compiler.code = &r300->blit.fp_code; + compiler.AllocateHwInputs = fp_allocate_hw_inputs; + + r3xx_compile_fragment_program(&compiler); +} + +void r300_blit_init(struct r300_context *r300) +{ + create_vertex_program(r300); + create_fragment_program(r300); +} + +static void r500_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_RS_INST_0, + (0 << R500_RS_INST_TEX_ID_SHIFT) | + (0 << R500_RS_INST_TEX_ADDR_SHIFT) | + R500_RS_INST_TEX_CN_WRITE | + R500_RS_INST_COL_CN_NO_WRITE); + OUT_BATCH_REGVAL(R500_RS_IP_0, + (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | + (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | + (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | + (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); + END_BATCH(); +} + +static void r300_emit_fp_setup(struct r300_context *r300) +{ + assert(0); +} + +static void r300_emit_rs_setup(struct r300_context *r300) +{ + assert(0); +} + +static void r300_emit_tx_setup(struct r300_context *r300, + gl_format mesa_format, + struct radeon_bo *bo, + intptr_t offset, + unsigned width, + unsigned height, + unsigned pitch) +{ + BATCH_LOCALS(&r300->radeon); + + assert(width <= 2048); + assert(height <= 2048); + assert(r300TranslateTexFormat(mesa_format) != 0); + assert(offset % 32 == 0); + + BEGIN_BATCH(17); + OUT_BATCH_REGVAL(R300_TX_FILTER0_0, + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_S_SHIFT) | + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_T_SHIFT) | + (R300_TX_CLAMP_TO_EDGE << R300_TX_WRAP_R_SHIFT) | + R300_TX_MIN_FILTER_MIP_NONE | + R300_TX_MIN_FILTER_LINEAR | + R300_TX_MAG_FILTER_LINEAR | + (0 << 28)); + OUT_BATCH_REGVAL(R300_TX_FILTER1_0, 0); + OUT_BATCH_REGVAL(R300_TX_SIZE_0, + ((width-1) << R300_TX_WIDTHMASK_SHIFT) | + ((height-1) << R300_TX_HEIGHTMASK_SHIFT) | + (0 << R300_TX_DEPTHMASK_SHIFT) | + (0 << R300_TX_MAX_MIP_LEVEL_SHIFT) | + R300_TX_SIZE_TXPITCH_EN); + + OUT_BATCH_REGVAL(R300_TX_FORMAT_0, r300TranslateTexFormat(mesa_format)); + OUT_BATCH_REGVAL(R300_TX_FORMAT2_0, pitch/_mesa_get_format_bytes(mesa_format) - 1); + OUT_BATCH_REGSEQ(R300_TX_OFFSET_0, 1); + OUT_BATCH_RELOC(0, bo, offset, RADEON_GEM_DOMAIN_GTT|RADEON_GEM_DOMAIN_VRAM, 0, 0); + + OUT_BATCH_REGSEQ(R300_TX_INVALTAGS, 2); + OUT_BATCH(0); + OUT_BATCH(1); + + END_BATCH(); +} + +#define EASY_US_FORMAT(FMT, C0, C1, C2, C3, SIGN) \ + (FMT | R500_C0_SEL_##C0 | R500_C1_SEL_##C1 | \ + R500_C2_SEL_##C2 | R500_C3_SEL_##C3 | R500_OUT_SIGN(SIGN)) + +static uint32_t mesa_format_to_us_format(gl_format mesa_format) +{ + switch(mesa_format) + { + case MESA_FORMAT_RGBA8888: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0); + case MESA_FORMAT_RGB565: // x + case MESA_FORMAT_ARGB1555: // x + case MESA_FORMAT_RGBA8888_REV: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, R, G, B, A, 0); + case MESA_FORMAT_ARGB8888: // x + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, B, G, R, A, 0); + case MESA_FORMAT_ARGB8888_REV: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, R, G, B, 0); + case MESA_FORMAT_XRGB8888: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, R, G, B, 0); + + case MESA_FORMAT_RGB332: + return EASY_US_FORMAT(R500_OUT_FMT_C_3_3_2, A, R, G, B, 0); + + case MESA_FORMAT_RGBA_FLOAT32: + return EASY_US_FORMAT(R500_OUT_FMT_C4_32_FP, R, G, B, A, 0); + case MESA_FORMAT_RGBA_FLOAT16: + return EASY_US_FORMAT(R500_OUT_FMT_C4_16_FP, R, G, B, A, 0); + case MESA_FORMAT_ALPHA_FLOAT32: + return EASY_US_FORMAT(R500_OUT_FMT_C_32_FP, A, A, A, A, 0); + case MESA_FORMAT_ALPHA_FLOAT16: + return EASY_US_FORMAT(R500_OUT_FMT_C_16_FP, A, A, A, A, 0); + + case MESA_FORMAT_SIGNED_RGBA8888: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, R, G, B, A, 0xf); + case MESA_FORMAT_SIGNED_RGBA8888_REV: + return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0xf); + case MESA_FORMAT_SIGNED_RGBA_16: + return EASY_US_FORMAT(R500_OUT_FMT_C4_16, R, G, B, A, 0xf); + + default: + assert(!"Invalid format for US output\n"); + return 0; + } +} +#undef EASY_US_FORMAT + +static void r500_emit_fp_setup(struct r300_context *r300, + struct r500_fragment_program_code *fp, + gl_format dst_format) +{ + r500_emit_fp(r300, (uint32_t *)fp->inst, (fp->inst_end + 1) * 6, 0, 0, 0); + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(10); + OUT_BATCH_REGSEQ(R500_US_CODE_ADDR, 3); + OUT_BATCH(R500_US_CODE_START_ADDR(0) | R500_US_CODE_END_ADDR(fp->inst_end)); + OUT_BATCH(R500_US_CODE_RANGE_ADDR(0) | R500_US_CODE_RANGE_SIZE(fp->inst_end)); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_US_CONFIG, 0); + OUT_BATCH_REGVAL(R500_US_OUT_FMT_0, mesa_format_to_us_format(dst_format)); + OUT_BATCH_REGVAL(R500_US_PIXSIZE, fp->max_temp_idx); + END_BATCH(); +} + +static void emit_pvs_setup(struct r300_context *r300, + uint32_t *vp_code, + unsigned vp_len) +{ + BATCH_LOCALS(&r300->radeon); + + r300_emit_vpu(r300, vp_code, vp_len * 4, R300_PVS_CODE_START); + + BEGIN_BATCH(4); + OUT_BATCH_REGSEQ(R300_VAP_PVS_CODE_CNTL_0, 3); + OUT_BATCH((0 << R300_PVS_FIRST_INST_SHIFT) | + ((vp_len - 1) << R300_PVS_XYZW_VALID_INST_SHIFT) | + ((vp_len - 1)<< R300_PVS_LAST_INST_SHIFT)); + OUT_BATCH(0); + OUT_BATCH((vp_len - 1) << R300_PVS_LAST_VTX_SRC_INST_SHIFT); + END_BATCH(); +} + +static void emit_vap_setup(struct r300_context *r300, unsigned width, unsigned height) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(12); + OUT_BATCH_REGSEQ(R300_SE_VTE_CNTL, 2); + OUT_BATCH(R300_VTX_XY_FMT | R300_VTX_Z_FMT); + OUT_BATCH(4); + + OUT_BATCH_REGVAL(R300_VAP_PSC_SGN_NORM_CNTL, 0xaaaaaaaa); + OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_0, + ((R300_DATA_TYPE_FLOAT_2 | (0 << R300_DST_VEC_LOC_SHIFT)) << 0) | + (((1 << R300_DST_VEC_LOC_SHIFT) | R300_DATA_TYPE_FLOAT_2 | R300_LAST_VEC) << 16)); + OUT_BATCH_REGVAL(R300_VAP_PROG_STREAM_CNTL_EXT_0, + ((((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | + (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | + (0xf << R300_WRITE_ENA_SHIFT) ) << 0) | + (((R300_SWIZZLE_SELECT_X << R300_SWIZZLE_SELECT_X_SHIFT) | + (R300_SWIZZLE_SELECT_Y << R300_SWIZZLE_SELECT_Y_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ZERO << R300_SWIZZLE_SELECT_Z_SHIFT) | + (R300_SWIZZLE_SELECT_FP_ONE << R300_SWIZZLE_SELECT_W_SHIFT) | + (0xf << R300_WRITE_ENA_SHIFT) ) << 16) ) ); + OUT_BATCH_REGSEQ(R300_VAP_OUTPUT_VTX_FMT_0, 2); + OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_0__POS_PRESENT); + OUT_BATCH(R300_VAP_OUTPUT_VTX_FMT_1__4_COMPONENTS); + END_BATCH(); +} + +static GLboolean validate_buffers(struct r300_context *r300, + struct radeon_bo *src_bo, + struct radeon_bo *dst_bo) +{ + int ret; + radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, + src_bo, RADEON_GEM_DOMAIN_VRAM, 0); + + radeon_cs_space_add_persistent_bo(r300->radeon.cmdbuf.cs, + dst_bo, 0, RADEON_GEM_DOMAIN_VRAM); + + ret = radeon_cs_space_check_with_bo(r300->radeon.cmdbuf.cs, + first_elem(&r300->radeon.dma.reserved)->bo, + RADEON_GEM_DOMAIN_GTT, 0); + if (ret) + return GL_FALSE; + + return GL_TRUE; +} + +static void emit_draw_packet(struct r300_context *r300, float width, float height) +{ + float verts[] = { 0.0, 0.0, 0.0, 1.0, + 0.0, height, 0.0, 0.0, + width, height, 1.0, 0.0, + width, 0.0, 1.0, 1.0 }; + + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(19); + OUT_BATCH_PACKET3(R300_PACKET3_3D_DRAW_IMMD_2, 16); + OUT_BATCH(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_EMBEDDED | + (4 << 16) | R300_VAP_VF_CNTL__PRIM_QUADS); + OUT_BATCH_TABLE(verts, 16); + END_BATCH(); +} + +static void other_stuff(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(15); + OUT_BATCH_REGVAL(R300_GA_POLY_MODE, + R300_GA_POLY_MODE_FRONT_PTYPE_TRI | R300_GA_POLY_MODE_BACK_PTYPE_TRI); + OUT_BATCH_REGVAL(R300_SU_CULL_MODE, R300_FRONT_FACE_CCW); + OUT_BATCH_REGVAL(R300_FG_FOG_BLEND, 0); + OUT_BATCH_REGVAL(R300_FG_ALPHA_FUNC, 0); + OUT_BATCH_REGSEQ(R300_RB3D_CBLEND, 2); + OUT_BATCH(0x0); + OUT_BATCH(0x0); + OUT_BATCH_REGVAL(R300_VAP_CLIP_CNTL, R300_CLIP_DISABLE); + OUT_BATCH_REGVAL(R300_ZB_CNTL, 0); + END_BATCH(); +} + +static void emit_cb_setup(struct r300_context *r300, + struct radeon_bo *bo, + intptr_t offset, + gl_format mesa_format, + unsigned width, + unsigned height) +{ + BATCH_LOCALS(&r300->radeon); + + unsigned x1, y1, x2, y2; + x1 = 0; + y1 = 0; + x2 = width - 1; + y2 = height - 1; + + if (r300->radeon.radeonScreen->chip_family < CHIP_FAMILY_RV515) { + x1 += R300_SCISSORS_OFFSET; + y1 += R300_SCISSORS_OFFSET; + x2 += R300_SCISSORS_OFFSET; + y2 += R300_SCISSORS_OFFSET; + } + + r300_emit_cb_setup(r300, bo, offset, mesa_format, + _mesa_get_format_bytes(mesa_format), + _mesa_format_row_stride(mesa_format, width)); + + BEGIN_BATCH_NO_AUTOSTATE(3); + OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); + OUT_BATCH((x1 << R300_SCISSORS_X_SHIFT)|(y1 << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH((x2 << R300_SCISSORS_X_SHIFT)|(y2 << R300_SCISSORS_Y_SHIFT)); + END_BATCH(); +} + +GLboolean r300_blit(struct r300_context *r300, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_width, + unsigned dst_height) +{ + assert(src_width == dst_width); + assert(src_height == dst_height); + + if (0) { + fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", + src_width, src_height, src_pitch, + _mesa_format_row_stride(src_mesaformat, src_width), + _mesa_get_format_name(src_mesaformat)); + fprintf(stderr, "dst: width %d, height %d, pitch %d, format %s\n", + dst_width, dst_height, + _mesa_format_row_stride(dst_mesaformat, dst_width), + _mesa_get_format_name(dst_mesaformat)); + } + + if (!validate_buffers(r300, src_bo, dst_bo)) + return GL_FALSE; + + other_stuff(r300); + + r300_emit_tx_setup(r300, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); + + if (r300->radeon.radeonScreen->chip_family >= CHIP_FAMILY_RV515) { + r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); + r500_emit_rs_setup(r300); + } else { + r300_emit_fp_setup(r300); + r300_emit_rs_setup(r300); + } + + emit_pvs_setup(r300, r300->blit.vp_code.body.d, 2); + emit_vap_setup(r300, dst_width, dst_height); + + emit_cb_setup(r300, dst_bo, dst_offset, dst_mesaformat, dst_width, dst_height); + + emit_draw_packet(r300, dst_width, dst_height); + + r300EmitCacheFlush(r300); + + radeonFlush(r300->radeon.glCtx); + + return GL_TRUE; +} \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_blit.h b/src/mesa/drivers/dri/r300/r300_blit.h new file mode 100644 index 00000000000..29c5aa95149 --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_blit.h @@ -0,0 +1,46 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#ifndef R300_BLIT_H +#define R300_BLIT_H + +void r300_blit_init(struct r300_context *r300); + +GLboolean r300_blit(struct r300_context *r300, + struct radeon_bo *src_bo, + intptr_t src_offset, + gl_format src_mesaformat, + unsigned src_pitch, + unsigned src_width, + unsigned src_height, + struct radeon_bo *dst_bo, + intptr_t dst_offset, + gl_format dst_mesaformat, + unsigned dst_width, + unsigned dst_height); + +#endif // R300_BLIT_H \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 67183c3c2aa..6995637288a 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -60,6 +60,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r300_context.h" #include "radeon_context.h" #include "radeon_span.h" +#include "r300_blit.h" #include "r300_cmdbuf.h" #include "r300_state.h" #include "r300_tex.h" @@ -537,6 +538,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300InitSwtcl(ctx); } + r300_blit_init(r300); radeon_fbo_init(&r300->radeon); radeonInitSpanFuncs( ctx ); r300InitCmdBuf(r300); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 518d5cdbf4f..198414a6f89 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -533,6 +533,11 @@ struct r300_context { uint32_t fallback; + struct { + struct r300_vertex_program_code vp_code; + struct rX00_fragment_program_code fp_code; + } blit; + DECLARE_RENDERINPUTS(render_inputs_bitset); }; -- cgit v1.2.3 From 7255a5486dcb3acd5d7d267b9f546aff38685555 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 8 Nov 2009 22:01:17 +0100 Subject: r300: use accelerated emit for CopyTex[Sub]Image functions --- src/mesa/drivers/dri/r300/Makefile | 1 + src/mesa/drivers/dri/r300/r300_context.c | 2 + src/mesa/drivers/dri/r300/r300_context.h | 2 + src/mesa/drivers/dri/r300/r300_texcopy.c | 162 +++++++++++++++++++++++++++++++ 4 files changed, 167 insertions(+) create mode 100644 src/mesa/drivers/dri/r300/r300_texcopy.c diff --git a/src/mesa/drivers/dri/r300/Makefile b/src/mesa/drivers/dri/r300/Makefile index b5145d98380..409d126ab2b 100644 --- a/src/mesa/drivers/dri/r300/Makefile +++ b/src/mesa/drivers/dri/r300/Makefile @@ -50,6 +50,7 @@ DRIVER_SOURCES = \ r300_state.c \ r300_render.c \ r300_tex.c \ + r300_texcopy.c \ r300_texstate.c \ r300_vertprog.c \ r300_fragprog_common.c \ diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 6995637288a..05005f61c30 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -93,6 +93,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "main/remap_helper.h" +void r300_init_texcopy_functions(struct dd_function_table *table); static const struct dri_extension card_extensions[] = { /* *INDENT-OFF* */ @@ -485,6 +486,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300_init_vtbl(&r300->radeon); _mesa_init_driver_functions(&functions); + r300_init_texcopy_functions(&functions); r300InitIoctlFuncs(&functions); r300InitStateFuncs(&functions); r300InitTextureFuncs(&functions); diff --git a/src/mesa/drivers/dri/r300/r300_context.h b/src/mesa/drivers/dri/r300/r300_context.h index 198414a6f89..54a92a2e447 100644 --- a/src/mesa/drivers/dri/r300/r300_context.h +++ b/src/mesa/drivers/dri/r300/r300_context.h @@ -554,6 +554,8 @@ extern void r300InitShaderFunctions(r300ContextPtr r300); extern void r300InitDraw(GLcontext *ctx); +extern void r300_init_texcopy_functions(struct dd_function_table *table); + #define r300PackFloat32 radeonPackFloat32 #define r300PackFloat24 radeonPackFloat24 diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c new file mode 100644 index 00000000000..efbe7538b8c --- /dev/null +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -0,0 +1,162 @@ +/* + * Copyright (C) 2009 Maciej Cencora + * + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial + * portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. + * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + */ + +#include "radeon_common.h" +#include "r300_context.h" + +#include "main/image.h" +#include "main/teximage.h" +#include "main/texstate.h" +#include "drivers/common/meta.h" + +#include "radeon_mipmap_tree.h" +#include "r300_blit.h" +#include
    + +static GLboolean +do_copy_texsubimage(GLcontext *ctx, + GLenum target, GLint level, + struct radeon_tex_obj *tobj, + radeon_texture_image *timg, + GLint dstx, GLint dsty, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct r300_context *r300 = R300_CONTEXT(ctx); + struct radeon_renderbuffer *rrb; + + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) || + _mesa_get_format_bits(timg->base.TexFormat, GL_STENCIL_BITS)) { + rrb = radeon_get_depthbuffer(&r300->radeon); + return GL_FALSE; + } else { + rrb = radeon_get_colorbuffer(&r300->radeon); + } + + assert(rrb && rrb->bo); + assert(timg->mt && timg->mt->bo); + assert(timg->base.Width >= dstx + width); + assert(timg->base.Height >= dsty + height); + assert(tobj->mt == timg->mt); + + intptr_t src_offset = rrb->draw_offset + x * rrb->cpp + y * rrb->pitch; + intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); + dst_offset += dstx * _mesa_get_format_bytes(timg->base.TexFormat) + + dsty * _mesa_format_row_stride(timg->base.TexFormat, timg->base.Width); + + if (0) { + fprintf(stderr, "%s: copying to face %d, level %d\n", + __FUNCTION__, _mesa_tex_target_to_face(target), level); + fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); + fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d, width %d\n", + x, y, width, height, (uint32_t) src_offset, rrb->pitch, rrb->pitch/rrb->cpp); + + } + + /* blit from src buffer to texture */ + return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, + width, height, timg->mt->bo, dst_offset, + timg->base.TexFormat, width, height); +} + +static void +r300CopyTexImage2D(GLcontext *ctx, GLenum target, GLint level, + GLenum internalFormat, + GLint x, GLint y, GLsizei width, GLsizei height, + GLint border) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + struct gl_texture_object *texObj = + _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = + _mesa_select_tex_image(ctx, texObj, target, level); + int srcx, srcy, dstx, dsty; + + if (border) + goto fail; + + /* Setup or redefine the texture object, mipmap tree and texture + * image. Don't populate yet. + */ + ctx->Driver.TexImage2D(ctx, target, level, internalFormat, + width, height, border, + GL_RGBA, GL_UNSIGNED_BYTE, NULL, + &ctx->DefaultPacking, texObj, texImage); + + srcx = x; + srcy = y; + dstx = 0; + dsty = 0; + if (!_mesa_clip_copytexsubimage(ctx, + &dstx, &dsty, + &srcx, &srcy, + &width, &height)) { + return; + } + + if (!do_copy_texsubimage(ctx, target, level, + radeon_tex_obj(texObj), (radeon_texture_image *)texImage, + 0, 0, x, y, width, height)) { + goto fail; + } + + return; + +fail: + _mesa_meta_CopyTexImage2D(ctx, target, level, internalFormat, x, y, + width, height, border); +} + +static void +r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, + GLint xoffset, GLint yoffset, + GLint x, GLint y, + GLsizei width, GLsizei height) +{ + struct gl_texture_unit *texUnit = _mesa_get_current_tex_unit(ctx); + struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); + struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); + + assert(target == GL_TEXTURE_2D); + + if (!do_copy_texsubimage(ctx, target, level, + radeon_tex_obj(texObj), (radeon_texture_image *)texImage, + xoffset, yoffset, x, y, width, height)) { + + //DEBUG_FALLBACKS + + _mesa_meta_CopyTexSubImage2D(ctx, target, level, + xoffset, yoffset, x, y, width, height); + } +} + + +void r300_init_texcopy_functions(struct dd_function_table *table) +{ + table->CopyTexImage2D = r300CopyTexImage2D; + table->CopyTexSubImage2D = r300CopyTexSubImage2D; +} \ No newline at end of file -- cgit v1.2.3 From cd5f167353f16fb4f5b349002625b704f3e23778 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Mon, 9 Nov 2009 23:01:35 +0100 Subject: blit WIP --- src/mesa/drivers/dri/r300/r300_blit.c | 15 ++++++++++++--- src/mesa/drivers/dri/r300/r300_texcopy.c | 19 +++++++++++++------ 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 7cb6f36c020..515a85caa29 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -424,10 +424,16 @@ GLboolean r300_blit(struct r300_context *r300, unsigned dst_width, unsigned dst_height) { - assert(src_width == dst_width); - assert(src_height == dst_height); + //assert(src_width == dst_width); + //assert(src_height == dst_height); - if (0) { + if (src_bo == dst_bo) { + return GL_FALSE; + } + + //return GL_FALSE; + + if (1) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, _mesa_format_row_stride(src_mesaformat, src_width), @@ -441,6 +447,8 @@ GLboolean r300_blit(struct r300_context *r300, if (!validate_buffers(r300, src_bo, dst_bo)) return GL_FALSE; + rcommonEnsureCmdBufSpace(&r300->radeon, 200, __FUNCTION__); + other_stuff(r300); r300_emit_tx_setup(r300, src_mesaformat, src_bo, src_offset, src_width, src_height, src_pitch); @@ -463,6 +471,7 @@ GLboolean r300_blit(struct r300_context *r300, r300EmitCacheFlush(r300); radeonFlush(r300->radeon.glCtx); + //r300ResetHwState(r300); return GL_TRUE; } \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index efbe7538b8c..039276eaccd 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -57,29 +57,38 @@ do_copy_texsubimage(GLcontext *ctx, rrb = radeon_get_colorbuffer(&r300->radeon); } + if (!timg->mt) { + radeon_validate_texture_miptree(ctx, &tobj->base); + } + assert(rrb && rrb->bo); - assert(timg->mt && timg->mt->bo); + assert(timg->mt->bo); assert(timg->base.Width >= dstx + width); assert(timg->base.Height >= dsty + height); - assert(tobj->mt == timg->mt); + //assert(tobj->mt == timg->mt); intptr_t src_offset = rrb->draw_offset + x * rrb->cpp + y * rrb->pitch; intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); dst_offset += dstx * _mesa_get_format_bytes(timg->base.TexFormat) + dsty * _mesa_format_row_stride(timg->base.TexFormat, timg->base.Width); - if (0) { + if (src_offset % 32 || dst_offset % 32) { + return GL_FALSE; + } + + if (1) { fprintf(stderr, "%s: copying to face %d, level %d\n", __FUNCTION__, _mesa_tex_target_to_face(target), level); fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); fprintf(stderr, "from (%dx%d) width %d, height %d, offset %d, pitch %d, width %d\n", x, y, width, height, (uint32_t) src_offset, rrb->pitch, rrb->pitch/rrb->cpp); + fprintf(stderr, "src size %d, dst size %d\n", rrb->bo->size, timg->mt->bo->size); } /* blit from src buffer to texture */ return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, - width, height, timg->mt->bo, dst_offset, + rrb->base.Width, rrb->base.Height, timg->mt->bo ? timg->mt->bo : timg->bo, dst_offset, timg->base.TexFormat, width, height); } @@ -141,8 +150,6 @@ r300CopyTexSubImage2D(GLcontext *ctx, GLenum target, GLint level, struct gl_texture_object *texObj = _mesa_select_tex_object(ctx, texUnit, target); struct gl_texture_image *texImage = _mesa_select_tex_image(ctx, texObj, target, level); - assert(target == GL_TEXTURE_2D); - if (!do_copy_texsubimage(ctx, target, level, radeon_tex_obj(texObj), (radeon_texture_image *)texImage, xoffset, yoffset, x, y, width, height)) { -- cgit v1.2.3 From c1a7cc1e44e2c318eaa1de67893d20774f6fec5f Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Tue, 10 Nov 2009 19:47:04 +0100 Subject: more blit fixes --- src/mesa/drivers/dri/r300/r300_blit.c | 2 ++ src/mesa/drivers/dri/r300/r300_texcopy.c | 4 +--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 515a85caa29..b4c4b9c9cc2 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -218,6 +218,8 @@ static uint32_t mesa_format_to_us_format(gl_format mesa_format) { switch(mesa_format) { + case MESA_FORMAT_S8_Z24: + case MESA_FORMAT_X8_Z24: case MESA_FORMAT_RGBA8888: // x return EASY_US_FORMAT(R500_OUT_FMT_C4_8, A, B, G, R, 0); case MESA_FORMAT_RGB565: // x diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index 039276eaccd..1e10c7326cb 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -49,10 +49,8 @@ do_copy_texsubimage(GLcontext *ctx, struct r300_context *r300 = R300_CONTEXT(ctx); struct radeon_renderbuffer *rrb; - if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) || - _mesa_get_format_bits(timg->base.TexFormat, GL_STENCIL_BITS)) { + if (_mesa_get_format_bits(timg->base.TexFormat, GL_DEPTH_BITS) > 0) { rrb = radeon_get_depthbuffer(&r300->radeon); - return GL_FALSE; } else { rrb = radeon_get_colorbuffer(&r300->radeon); } -- cgit v1.2.3 From 353966b2da7de6d694285617ee5522ee4f3863ac Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 18:16:29 +0100 Subject: r300: finish blit support for r300 --- src/mesa/drivers/dri/r300/r300_blit.c | 56 ++++++++++++++++++++++++++++++++--- 1 file changed, 52 insertions(+), 4 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index b4c4b9c9cc2..7b256dac78a 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -156,14 +156,62 @@ static void r500_emit_rs_setup(struct r300_context *r300) END_BATCH(); } -static void r300_emit_fp_setup(struct r300_context *r300) +static void r300_emit_fp_setup(struct r300_context *r300, + struct r300_fragment_program_code *code) { - assert(0); + unsigned i; + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 9); + + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_addr); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_addr); + } + + OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); + OUT_BATCH_TABLE(code->tex.inst, code->tex.length); + + OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); + OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); + OUT_BATCH(code->pixsize); + OUT_BATCH(code->code_offset); + OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); + OUT_BATCH_TABLE(code->code_addr, 4); + END_BATCH(); } static void r300_emit_rs_setup(struct r300_context *r300) { - assert(0); + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R300_RS_INST_0, + R300_RS_INST_TEX_ID(0) | + R300_RS_INST_TEX_ADDR(0) | + R300_RS_INST_TEX_CN_WRITE); + OUT_BATCH_REGVAL(R300_RS_IP_0, + R300_RS_TEX_PTR(0) | + R300_RS_SEL_S(R300_RS_SEL_C0) | + R300_RS_SEL_R(R300_RS_SEL_C1) | + R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_Q(R300_RS_SEL_K1)); + END_BATCH(); } static void r300_emit_tx_setup(struct r300_context *r300, @@ -459,7 +507,7 @@ GLboolean r300_blit(struct r300_context *r300, r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); r500_emit_rs_setup(r300); } else { - r300_emit_fp_setup(r300); + r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300); r300_emit_rs_setup(r300); } -- cgit v1.2.3 From dbd53f8f55cd4201ee230fec44f35e7dd2eea17d Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 21 Nov 2009 21:18:41 +0100 Subject: r300: setup render target format for r300/r400 cards too --- src/mesa/drivers/dri/r300/r300_blit.c | 168 +++++++++++++++++----------------- 1 file changed, 82 insertions(+), 86 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 7b256dac78a..6eb1108f0d8 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -35,12 +35,6 @@ #include "compiler/radeon_compiler.h" #include "compiler/radeon_opcodes.h" -/** - * TODO: - * - handle depth buffer - * - r300 fp and rs setup - */ - static void vp_ins_outs(struct r300_vertex_program_compiler *c) { c->code->inputs[VERT_ATTRIB_POS] = 0; @@ -135,85 +129,6 @@ void r300_blit_init(struct r300_context *r300) create_fragment_program(r300); } -static void r500_emit_rs_setup(struct r300_context *r300) -{ - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0); - OUT_BATCH_REGVAL(R500_RS_INST_0, - (0 << R500_RS_INST_TEX_ID_SHIFT) | - (0 << R500_RS_INST_TEX_ADDR_SHIFT) | - R500_RS_INST_TEX_CN_WRITE | - R500_RS_INST_COL_CN_NO_WRITE); - OUT_BATCH_REGVAL(R500_RS_IP_0, - (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | - (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | - (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | - (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); - END_BATCH(); -} - -static void r300_emit_fp_setup(struct r300_context *r300, - struct r300_fragment_program_code *code) -{ - unsigned i; - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 9); - - OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].rgb_inst); - } - OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].rgb_addr); - } - OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].alpha_inst); - } - OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); - for (i = 0; i < code->alu.length; i++) { - OUT_BATCH(code->alu.inst[i].alpha_addr); - } - - OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); - OUT_BATCH_TABLE(code->tex.inst, code->tex.length); - - OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); - OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); - OUT_BATCH(code->pixsize); - OUT_BATCH(code->code_offset); - OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); - OUT_BATCH_TABLE(code->code_addr, 4); - END_BATCH(); -} - -static void r300_emit_rs_setup(struct r300_context *r300) -{ - BATCH_LOCALS(&r300->radeon); - - BEGIN_BATCH(7); - OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); - OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); - OUT_BATCH(0); - OUT_BATCH_REGVAL(R300_RS_INST_0, - R300_RS_INST_TEX_ID(0) | - R300_RS_INST_TEX_ADDR(0) | - R300_RS_INST_TEX_CN_WRITE); - OUT_BATCH_REGVAL(R300_RS_IP_0, - R300_RS_TEX_PTR(0) | - R300_RS_SEL_S(R300_RS_SEL_C0) | - R300_RS_SEL_R(R300_RS_SEL_C1) | - R300_RS_SEL_T(R300_RS_SEL_K0) | - R300_RS_SEL_Q(R300_RS_SEL_K1)); - END_BATCH(); -} - static void r300_emit_tx_setup(struct r300_context *r300, gl_format mesa_format, struct radeon_bo *bo, @@ -325,6 +240,87 @@ static void r500_emit_fp_setup(struct r300_context *r300, END_BATCH(); } +static void r500_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R500_RS_INST_0, + (0 << R500_RS_INST_TEX_ID_SHIFT) | + (0 << R500_RS_INST_TEX_ADDR_SHIFT) | + R500_RS_INST_TEX_CN_WRITE | + R500_RS_INST_COL_CN_NO_WRITE); + OUT_BATCH_REGVAL(R500_RS_IP_0, + (0 << R500_RS_IP_TEX_PTR_S_SHIFT) | + (1 << R500_RS_IP_TEX_PTR_T_SHIFT) | + (2 << R500_RS_IP_TEX_PTR_R_SHIFT) | + (3 << R500_RS_IP_TEX_PTR_Q_SHIFT)); + END_BATCH(); +} + +static void r300_emit_fp_setup(struct r300_context *r300, + struct r300_fragment_program_code *code, + gl_format dst_format) +{ + unsigned i; + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH((code->alu.length + 1) * 4 + code->tex.length + 1 + 11); + + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_RGB_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].rgb_addr); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_INST_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_inst); + } + OUT_BATCH_REGSEQ(R300_US_ALU_ALPHA_ADDR_0, code->alu.length); + for (i = 0; i < code->alu.length; i++) { + OUT_BATCH(code->alu.inst[i].alpha_addr); + } + + OUT_BATCH_REGSEQ(R300_US_TEX_INST_0, code->tex.length); + OUT_BATCH_TABLE(code->tex.inst, code->tex.length); + + OUT_BATCH_REGSEQ(R300_US_CONFIG, 3); + OUT_BATCH(R300_PFS_CNTL_FIRST_NODE_HAS_TEX); + OUT_BATCH(code->pixsize); + OUT_BATCH(code->code_offset); + OUT_BATCH_REGSEQ(R300_US_CODE_ADDR_0, 4); + OUT_BATCH_TABLE(code->code_addr, 4); + OUT_BATCH_REGVAL(R500_US_OUT_FMT_0, mesa_format_to_us_format(dst_format)); + END_BATCH(); +} + +static void r300_emit_rs_setup(struct r300_context *r300) +{ + BATCH_LOCALS(&r300->radeon); + + BEGIN_BATCH(7); + OUT_BATCH_REGSEQ(R300_RS_COUNT, 2); + OUT_BATCH((4 << R300_IT_COUNT_SHIFT) | R300_HIRES_EN); + OUT_BATCH(0); + OUT_BATCH_REGVAL(R300_RS_INST_0, + R300_RS_INST_TEX_ID(0) | + R300_RS_INST_TEX_ADDR(0) | + R300_RS_INST_TEX_CN_WRITE); + OUT_BATCH_REGVAL(R300_RS_IP_0, + R300_RS_TEX_PTR(0) | + R300_RS_SEL_S(R300_RS_SEL_C0) | + R300_RS_SEL_R(R300_RS_SEL_C1) | + R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_Q(R300_RS_SEL_K1)); + END_BATCH(); +} + static void emit_pvs_setup(struct r300_context *r300, uint32_t *vp_code, unsigned vp_len) @@ -507,7 +503,7 @@ GLboolean r300_blit(struct r300_context *r300, r500_emit_fp_setup(r300, &r300->blit.fp_code.code.r500, dst_mesaformat); r500_emit_rs_setup(r300); } else { - r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300); + r300_emit_fp_setup(r300, &r300->blit.fp_code.code.r300, dst_mesaformat); r300_emit_rs_setup(r300); } -- cgit v1.2.3 From 6b8315494ac84e6b59ae9113653224ed0a546014 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 22 Nov 2009 15:12:24 +0100 Subject: r300: emit number of used colorbuffers to pass radeon cs checker --- src/mesa/drivers/dri/r300/r300_blit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 6eb1108f0d8..4c3d3c80696 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -450,10 +450,11 @@ static void emit_cb_setup(struct r300_context *r300, _mesa_get_format_bytes(mesa_format), _mesa_format_row_stride(mesa_format, width)); - BEGIN_BATCH_NO_AUTOSTATE(3); + BEGIN_BATCH_NO_AUTOSTATE(5); OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); OUT_BATCH((x1 << R300_SCISSORS_X_SHIFT)|(y1 << R300_SCISSORS_Y_SHIFT)); OUT_BATCH((x2 << R300_SCISSORS_X_SHIFT)|(y2 << R300_SCISSORS_Y_SHIFT)); + OUT_BATCH_REGVAL(R300_RB3D_CCTL, 0); END_BATCH(); } -- cgit v1.2.3 From 784cca9fa527de771754d76545970f78094b9adf Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sat, 12 Dec 2009 00:50:26 +0100 Subject: r300: disable blit debugging info --- src/mesa/drivers/dri/r300/r300_blit.c | 2 +- src/mesa/drivers/dri/r300/r300_texcopy.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 4c3d3c80696..10e1b3c9124 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -480,7 +480,7 @@ GLboolean r300_blit(struct r300_context *r300, //return GL_FALSE; - if (1) { + if (0) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, _mesa_format_row_stride(src_mesaformat, src_width), diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index 1e10c7326cb..5e3a724d4e6 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -74,7 +74,7 @@ do_copy_texsubimage(GLcontext *ctx, return GL_FALSE; } - if (1) { + if (0) { fprintf(stderr, "%s: copying to face %d, level %d\n", __FUNCTION__, _mesa_tex_target_to_face(target), level); fprintf(stderr, "to: x %d, y %d, offset %d\n", dstx, dsty, (uint32_t) dst_offset); -- cgit v1.2.3 From 6a15ec9141b070b088d03d87673d0d2741b7db6b Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 10 Dec 2009 20:50:02 +0100 Subject: nv50: support vertex program textures --- src/gallium/drivers/nv50/nv50_context.h | 12 ++-- src/gallium/drivers/nv50/nv50_screen.c | 17 +++-- src/gallium/drivers/nv50/nv50_state.c | 59 ++++++++++++----- src/gallium/drivers/nv50/nv50_state_validate.c | 52 ++++++++++----- src/gallium/drivers/nv50/nv50_tex.c | 90 +++++++++++++++++--------- 5 files changed, 156 insertions(+), 74 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_context.h b/src/gallium/drivers/nv50/nv50_context.h index 79135f2f362..5578a5838fb 100644 --- a/src/gallium/drivers/nv50/nv50_context.h +++ b/src/gallium/drivers/nv50/nv50_context.h @@ -126,7 +126,7 @@ struct nv50_state { unsigned viewport_bypass; struct nouveau_stateobj *tsc_upload; struct nouveau_stateobj *tic_upload; - unsigned miptree_nr; + unsigned miptree_nr[PIPE_SHADER_TYPES]; struct nouveau_stateobj *vertprog; struct nouveau_stateobj *fragprog; struct nouveau_stateobj *programs; @@ -162,10 +162,10 @@ struct nv50_context { unsigned vtxbuf_nr; struct pipe_vertex_element vtxelt[PIPE_MAX_ATTRIBS]; unsigned vtxelt_nr; - struct nv50_sampler_stateobj *sampler[PIPE_MAX_SAMPLERS]; - unsigned sampler_nr; - struct nv50_miptree *miptree[PIPE_MAX_SAMPLERS]; - unsigned miptree_nr; + struct nv50_sampler_stateobj *sampler[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; + unsigned sampler_nr[PIPE_SHADER_TYPES]; + struct nv50_miptree *miptree[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS]; + unsigned miptree_nr[PIPE_SHADER_TYPES]; uint16_t vbo_fifo; }; @@ -218,7 +218,7 @@ extern void nv50_state_flush_notify(struct nouveau_channel *chan); extern void nv50_so_init_sifc(struct nv50_context *nv50, struct nouveau_stateobj *so, struct nouveau_bo *bo, unsigned reloc, - unsigned size); + unsigned offset, unsigned size); /* nv50_tex.c */ extern void nv50_tex_validate(struct nv50_context *); diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index e1b2f11239a..862be46a9ec 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -97,6 +97,10 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param) switch (param) { case PIPE_CAP_MAX_TEXTURE_IMAGE_UNITS: return 32; + case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: + return 32; + case PIPE_CAP_MAX_COMBINED_SAMPLERS: + return 64; case PIPE_CAP_NPOT_TEXTURES: return 1; case PIPE_CAP_TWO_SIDED_STENCIL: @@ -122,8 +126,6 @@ nv50_screen_get_param(struct pipe_screen *pscreen, int param) case PIPE_CAP_TEXTURE_MIRROR_CLAMP: case PIPE_CAP_TEXTURE_MIRROR_REPEAT: return 1; - case PIPE_CAP_MAX_VERTEX_TEXTURE_UNITS: - return 0; case PIPE_CAP_TGSI_CONT_SUPPORTED: return 0; case PIPE_CAP_BLEND_EQUATION_SEPARATE: @@ -315,6 +317,9 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) so_method(so, screen->tesla, 0x1400, 1); so_data (so, 0xf); + /* max TIC (bits 4:8) & TSC (ignored) bindings, per program type */ + so_method(so, screen->tesla, 0x13b4, 1); + so_data (so, 0x54); so_method(so, screen->tesla, 0x13bc, 1); so_data (so, 0x54); /* origin is top left (set to 1 for bottom left) */ @@ -387,7 +392,8 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) so_method(so, screen->tesla, NV50TCL_SET_PROGRAM_CB, 1); so_data (so, 0x00000131 | (NV50_CB_PFP << 12)); - ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, 64*8*4, &screen->tic); + ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, PIPE_SHADER_TYPES*32*32, + &screen->tic); if (ret) { nv50_screen_destroy(pscreen); return NULL; @@ -398,9 +404,10 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0); so_reloc (so, screen->tic, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_LOW, 0, 0); - so_data (so, 0x000007ff); + so_data (so, PIPE_SHADER_TYPES * 32 - 1); - ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, 64*8*4, &screen->tsc); + ret = nouveau_bo_new(dev, NOUVEAU_BO_VRAM, 0, PIPE_SHADER_TYPES*32*32, + &screen->tsc); if (ret) { nv50_screen_destroy(pscreen); return NULL; diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 07318f23947..9c8c0c261e5 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -215,41 +215,66 @@ nv50_sampler_state_create(struct pipe_context *pipe, return (void *)sso; } -static void -nv50_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **sampler) +static INLINE void +nv50_sampler_state_bind(struct pipe_context *pipe, unsigned type, + unsigned nr, void **sampler) { struct nv50_context *nv50 = nv50_context(pipe); - int i; - nv50->sampler_nr = nr; - for (i = 0; i < nv50->sampler_nr; i++) - nv50->sampler[i] = sampler[i]; + memcpy(nv50->sampler[type], sampler, nr * sizeof(void *)); + nv50->sampler_nr[type] = nr; nv50->dirty |= NV50_NEW_SAMPLER; } +static void +nv50_vp_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **s) +{ + nv50_sampler_state_bind(pipe, PIPE_SHADER_VERTEX, nr, s); +} + +static void +nv50_fp_sampler_state_bind(struct pipe_context *pipe, unsigned nr, void **s) +{ + nv50_sampler_state_bind(pipe, PIPE_SHADER_FRAGMENT, nr, s); +} + static void nv50_sampler_state_delete(struct pipe_context *pipe, void *hwcso) { FREE(hwcso); } -static void -nv50_set_sampler_texture(struct pipe_context *pipe, unsigned nr, - struct pipe_texture **pt) +static INLINE void +nv50_set_sampler_texture(struct pipe_context *pipe, unsigned type, + unsigned nr, struct pipe_texture **pt) { struct nv50_context *nv50 = nv50_context(pipe); - int i; + unsigned i; for (i = 0; i < nr; i++) - pipe_texture_reference((void *)&nv50->miptree[i], pt[i]); - for (i = nr; i < nv50->miptree_nr; i++) - pipe_texture_reference((void *)&nv50->miptree[i], NULL); + pipe_texture_reference((void *)&nv50->miptree[type][i], pt[i]); + for (i = nr; i < nv50->miptree_nr[type]; i++) + pipe_texture_reference((void *)&nv50->miptree[type][i], NULL); - nv50->miptree_nr = nr; + nv50->miptree_nr[type] = nr; nv50->dirty |= NV50_NEW_TEXTURE; } +static void +nv50_set_vp_sampler_textures(struct pipe_context *pipe, + unsigned nr, struct pipe_texture **pt) +{ + nv50_set_sampler_texture(pipe, PIPE_SHADER_VERTEX, nr, pt); +} + +static void +nv50_set_fp_sampler_textures(struct pipe_context *pipe, + unsigned nr, struct pipe_texture **pt) +{ + nv50_set_sampler_texture(pipe, PIPE_SHADER_FRAGMENT, nr, pt); +} + static void * nv50_rasterizer_state_create(struct pipe_context *pipe, const struct pipe_rasterizer_state *cso) @@ -648,9 +673,11 @@ nv50_init_state_functions(struct nv50_context *nv50) nv50->pipe.delete_blend_state = nv50_blend_state_delete; nv50->pipe.create_sampler_state = nv50_sampler_state_create; - nv50->pipe.bind_fragment_sampler_states = nv50_sampler_state_bind; nv50->pipe.delete_sampler_state = nv50_sampler_state_delete; - nv50->pipe.set_fragment_sampler_textures = nv50_set_sampler_texture; + nv50->pipe.bind_fragment_sampler_states = nv50_fp_sampler_state_bind; + nv50->pipe.bind_vertex_sampler_states = nv50_vp_sampler_state_bind; + nv50->pipe.set_fragment_sampler_textures = nv50_set_fp_sampler_textures; + nv50->pipe.set_vertex_sampler_textures = nv50_set_vp_sampler_textures; nv50->pipe.create_rasterizer_state = nv50_rasterizer_state_create; nv50->pipe.bind_rasterizer_state = nv50_rasterizer_state_bind; diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c index c871acaab8d..871e8097b65 100644 --- a/src/gallium/drivers/nv50/nv50_state_validate.c +++ b/src/gallium/drivers/nv50/nv50_state_validate.c @@ -155,6 +155,30 @@ nv50_state_validate_fb(struct nv50_context *nv50) so_ref(NULL, &so); } +static void +nv50_validate_samplers(struct nv50_context *nv50, struct nouveau_stateobj *so, + unsigned p) +{ + struct nouveau_grobj *eng2d = nv50->screen->eng2d; + unsigned i, j, dw = nv50->sampler_nr[p] * 8; + + if (!dw) + return; + nv50_so_init_sifc(nv50, so, nv50->screen->tsc, NOUVEAU_BO_VRAM, + p * (32 * 8 * 4), dw * 4); + + so_method(so, eng2d, NV50_2D_SIFC_DATA | (2 << 29), dw); + + for (i = 0; i < nv50->sampler_nr[p]; ++i) { + if (nv50->sampler[p][i]) + so_datap(so, nv50->sampler[p][i]->tsc, 8); + else { + for (j = 0; j < 8; ++j) /* you get punished */ + so_data(so, 0); /* ... for leaving holes */ + } + } +} + static void nv50_state_emit(struct nv50_context *nv50) { @@ -246,7 +270,6 @@ boolean nv50_state_validate(struct nv50_context *nv50) { struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_grobj *eng2d = nv50->screen->eng2d; struct nouveau_stateobj *so; unsigned i; @@ -369,22 +392,16 @@ scissor_uptodate: viewport_uptodate: if (nv50->dirty & NV50_NEW_SAMPLER) { - unsigned i; + unsigned nr = 0; - so = so_new(nv50->sampler_nr * 9 + 23 + 4, 2); + for (i = 0; i < PIPE_SHADER_TYPES; ++i) + nr += nv50->sampler_nr[i]; - nv50_so_init_sifc(nv50, so, nv50->screen->tsc, NOUVEAU_BO_VRAM, - nv50->sampler_nr * 8 * 4); + so = so_new(nr * 8 + 24 * PIPE_SHADER_TYPES + 2, 4); - for (i = 0; i < nv50->sampler_nr; i++) { - if (!nv50->sampler[i]) - continue; - so_method(so, eng2d, NV50_2D_SIFC_DATA | (2 << 29), 8); - so_datap (so, nv50->sampler[i]->tsc, 8); - } + nv50_validate_samplers(nv50, so, PIPE_SHADER_VERTEX); + nv50_validate_samplers(nv50, so, PIPE_SHADER_FRAGMENT); - so_method(so, tesla, 0x1440, 1); /* sync SIFC */ - so_data (so, 0); so_method(so, tesla, 0x1334, 1); /* flush TSC */ so_data (so, 0); @@ -407,10 +424,13 @@ viewport_uptodate: void nv50_so_init_sifc(struct nv50_context *nv50, struct nouveau_stateobj *so, - struct nouveau_bo *bo, unsigned reloc, unsigned size) + struct nouveau_bo *bo, unsigned reloc, + unsigned offset, unsigned size) { struct nouveau_grobj *eng2d = nv50->screen->eng2d; + reloc |= NOUVEAU_BO_WR; + so_method(so, eng2d, NV50_2D_DST_FORMAT, 2); so_data (so, NV50_2D_DST_FORMAT_R8_UNORM); so_data (so, 1); @@ -418,8 +438,8 @@ void nv50_so_init_sifc(struct nv50_context *nv50, so_data (so, 262144); so_data (so, 65536); so_data (so, 1); - so_reloc (so, bo, 0, reloc | NOUVEAU_BO_WR | NOUVEAU_BO_HIGH, 0, 0); - so_reloc (so, bo, 0, reloc | NOUVEAU_BO_WR | NOUVEAU_BO_LOW, 0, 0); + so_reloc (so, bo, offset, reloc | NOUVEAU_BO_HIGH, 0, 0); + so_reloc (so, bo, offset, reloc | NOUVEAU_BO_LOW, 0, 0); so_method(so, eng2d, NV50_2D_SIFC_UNK0800, 2); so_data (so, 0); so_data (so, NV50_2D_SIFC_FORMAT_R8_UNORM); diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 417d3679422..60b0ca71590 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -85,7 +85,7 @@ static const struct nv50_texture_format nv50_tex_format_list[] = static int nv50_tex_construct(struct nv50_context *nv50, struct nouveau_stateobj *so, - struct nv50_miptree *mt, int unit) + struct nv50_miptree *mt, int unit, unsigned p) { unsigned i; uint32_t mode; @@ -96,7 +96,7 @@ nv50_tex_construct(struct nv50_context *nv50, struct nouveau_stateobj *so, if (i == NV50_TEX_FORMAT_LIST_SIZE) return 1; - if (nv50->sampler[unit]->normalized) + if (nv50->sampler[p][unit]->normalized) mode = 0x50001000 | (1 << 31); else { mode = 0x50001000 | (7 << 14); @@ -140,48 +140,78 @@ nv50_tex_construct(struct nv50_context *nv50, struct nouveau_stateobj *so, return 0; } -void -nv50_tex_validate(struct nv50_context *nv50) +#ifndef NV50TCL_BIND_TIC +#define NV50TCL_BIND_TIC(n) (0x1448 + 8 * n) +#endif + +static boolean +nv50_validate_textures(struct nv50_context *nv50, struct nouveau_stateobj *so, + unsigned p) { + static const unsigned p_remap[PIPE_SHADER_TYPES] = { 0, 2 }; + struct nouveau_grobj *eng2d = nv50->screen->eng2d; struct nouveau_grobj *tesla = nv50->screen->tesla; - struct nouveau_stateobj *so; - unsigned i, unit, push; - - push = MAX2(nv50->miptree_nr, nv50->state.miptree_nr) * 2 + 23 + 6; - so = so_new(nv50->miptree_nr * 9 + push, nv50->miptree_nr * 2 + 2); + unsigned unit, j, p_hw = p_remap[p]; nv50_so_init_sifc(nv50, so, nv50->screen->tic, NOUVEAU_BO_VRAM, - nv50->miptree_nr * 8 * 4); + p * (32 * 8 * 4), nv50->miptree_nr[p] * 8 * 4); - for (i = 0, unit = 0; unit < nv50->miptree_nr; ++unit) { - struct nv50_miptree *mt = nv50->miptree[unit]; - - if (!mt) - continue; + for (unit = 0; unit < nv50->miptree_nr[p]; ++unit) { + struct nv50_miptree *mt = nv50->miptree[p][unit]; so_method(so, eng2d, NV50_2D_SIFC_DATA | (2 << 29), 8); - if (nv50_tex_construct(nv50, so, mt, unit)) { - NOUVEAU_ERR("failed tex validate\n"); - so_ref(NULL, &so); - return; + if (mt) { + if (nv50_tex_construct(nv50, so, mt, unit, p)) + return FALSE; + /* Set TEX insn $t src binding $unit in program type p + * to TIC, TSC entry (32 * p + unit), mark valid (1). + */ + so_method(so, tesla, NV50TCL_BIND_TIC(p_hw), 1); + so_data (so, ((32 * p + unit) << 9) | (unit << 1) | 1); + } else { + for (j = 0; j < 8; ++j) + so_data(so, 0); + so_method(so, tesla, NV50TCL_BIND_TIC(p_hw), 1); + so_data (so, (unit << 1) | 0); } + } + + for (; unit < nv50->state.miptree_nr[p]; unit++) { + /* Make other bindings invalid. */ + so_method(so, tesla, NV50TCL_BIND_TIC(p_hw), 1); + so_data (so, (unit << 1) | 0); + } + + nv50->state.miptree_nr[p] = nv50->miptree_nr[p]; + return TRUE; +} - so_method(so, tesla, NV50TCL_SET_SAMPLER_TEX, 1); - so_data (so, (i++ << NV50TCL_SET_SAMPLER_TEX_TIC_SHIFT) | - (unit << NV50TCL_SET_SAMPLER_TEX_SAMPLER_SHIFT) | - NV50TCL_SET_SAMPLER_TEX_VALID); +void +nv50_tex_validate(struct nv50_context *nv50) +{ + struct nouveau_stateobj *so; + struct nouveau_grobj *tesla = nv50->screen->tesla; + unsigned p, push, nrlc; + + for (nrlc = 0, push = 0, p = 0; p < PIPE_SHADER_TYPES; ++p) { + push += MAX2(nv50->miptree_nr[p], nv50->state.miptree_nr[p]); + nrlc += nv50->miptree_nr[p]; } + push = push * 11 + 23 * PIPE_SHADER_TYPES + 4; + nrlc = nrlc * 2 + 2 * PIPE_SHADER_TYPES; + + so = so_new(push, nrlc); + + if (nv50_validate_textures(nv50, so, PIPE_SHADER_VERTEX) == FALSE || + nv50_validate_textures(nv50, so, PIPE_SHADER_FRAGMENT) == FALSE) { + so_ref(NULL, &so); - for (; unit < nv50->state.miptree_nr; unit++) { - so_method(so, tesla, NV50TCL_SET_SAMPLER_TEX, 1); - so_data (so, - (unit << NV50TCL_SET_SAMPLER_TEX_SAMPLER_SHIFT) | 0); + NOUVEAU_ERR("failed tex validate\n"); + return; } /* not sure if the following really do what I think: */ - so_method(so, tesla, 0x1440, 1); /* sync SIFC */ - so_data (so, 0); so_method(so, tesla, 0x1330, 1); /* flush TIC */ so_data (so, 0); so_method(so, tesla, 0x1338, 1); /* flush texture caches */ @@ -189,6 +219,4 @@ nv50_tex_validate(struct nv50_context *nv50) so_ref(so, &nv50->state.tic_upload); so_ref(NULL, &so); - nv50->state.miptree_nr = nv50->miptree_nr; } - -- cgit v1.2.3 From f7a97344924461d64bfa5bd1b6a2c1151b70cc7c Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Wed, 2 Dec 2009 19:59:07 +0100 Subject: nv50: use copies of tgsi src nv50_regs So we can use the 'mod' member without concern if a source is used multiple times in 1 insn. --- src/gallium/drivers/nv50/nv50_program.c | 48 +++++++++++++++------------------ 1 file changed, 22 insertions(+), 26 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index f0fe7e61684..61160568570 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -131,6 +131,9 @@ struct nv50_pc { struct nv50_reg *r_brdc; struct nv50_reg *r_dst[4]; + struct nv50_reg reg_instances[16]; + unsigned reg_instance_nr; + unsigned interp_mode[32]; /* perspective interpolation registers */ struct nv50_reg *iv_p; @@ -150,6 +153,19 @@ struct nv50_pc { boolean allow32; }; +static INLINE struct nv50_reg * +reg_instance(struct nv50_pc *pc, struct nv50_reg *reg) +{ + struct nv50_reg *dup = NULL; + if (reg) { + assert(pc->reg_instance_nr < 16); + dup = &pc->reg_instances[pc->reg_instance_nr++]; + *dup = *reg; + reg->mod = 0; + } + return dup; +} + static INLINE void ctor_reg(struct nv50_reg *reg, unsigned type, int index, int hw) { @@ -898,7 +914,6 @@ static INLINE void emit_sub(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src0, struct nv50_reg *src1) { - assert(src0 != src1); src1->mod ^= NV50_MOD_NEG; emit_add(pc, dst, src0, src1); src1->mod ^= NV50_MOD_NEG; @@ -967,7 +982,6 @@ static INLINE void emit_msb(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src0, struct nv50_reg *src1, struct nv50_reg *src2) { - assert(src2 != src0 && src2 != src1); src2->mod ^= NV50_MOD_NEG; emit_mad(pc, dst, src0, src1, src2); src2->mod ^= NV50_MOD_NEG; @@ -1515,8 +1529,6 @@ convert_to_long(struct nv50_pc *pc, struct nv50_program_exec *e) static boolean negate_supported(const struct tgsi_full_instruction *insn, int i) { - int s; - switch (insn->Instruction.Opcode) { case TGSI_OPCODE_DDY: case TGSI_OPCODE_DP3: @@ -1526,29 +1538,14 @@ negate_supported(const struct tgsi_full_instruction *insn, int i) case TGSI_OPCODE_ADD: case TGSI_OPCODE_SUB: case TGSI_OPCODE_MAD: - break; + return TRUE; case TGSI_OPCODE_POW: if (i == 1) - break; + return TRUE; return FALSE; default: return FALSE; } - - /* Watch out for possible multiple uses of an nv50_reg, we - * can't use nv50_reg::neg in these cases. - */ - for (s = 0; s < insn->Instruction.NumSrcRegs; ++s) { - if (s == i) - continue; - if ((insn->Src[s].Register.Index == - insn->Src[i].Register.Index) && - (insn->Src[s].Register.File == - insn->Src[i].Register.File)) - return FALSE; - } - - return TRUE; } /* Return a read mask for source registers deduced from opcode & write mask. */ @@ -1882,7 +1879,8 @@ nv50_program_tx_insn(struct nv50_pc *pc, for (c = 0; c < 4; c++) if (src_mask & (1 << c)) - src[i][c] = tgsi_src(pc, c, fs, neg_supp); + src[i][c] = reg_instance(pc, + tgsi_src(pc, c, fs, neg_supp)); } brdc = temp = pc->r_brdc; @@ -2249,16 +2247,14 @@ nv50_program_tx_insn(struct nv50_pc *pc, for (c = 0; c < 4; c++) { if (!src[i][c]) continue; - src[i][c]->mod = 0; - if (src[i][c]->index == -1 && src[i][c]->type == P_IMMD) - FREE(src[i][c]); - else if (src[i][c]->acc < 0 && src[i][c]->type == P_CONST) FREE(src[i][c]); /* indirect constant */ } } kill_temp_temp(pc); + pc->reg_instance_nr = 0; + return TRUE; } -- cgit v1.2.3 From 9f3644c42350fec2cda17e66548c517d9d00e47f Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Fri, 4 Dec 2009 23:16:32 +0100 Subject: nv50: plug memory leak in miptree creation/destruction Keeping this dynamically allocated for texture arrays. Since we don't use it to store zslice offsets anymore it's either 1 or 6 integers (cube) ... --- src/gallium/drivers/nv50/nv50_miptree.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 40ee6659993..795db5872df 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -130,6 +130,8 @@ nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) mt->level[0].tile_mode, tile_flags, &mt->base.bo); if (ret) { + for (l = 0; l < pt->last_level; ++l) + FREE(mt->level[l].image_offset); FREE(mt); return NULL; } @@ -169,6 +171,10 @@ static void nv50_miptree_destroy(struct pipe_texture *pt) { struct nv50_miptree *mt = nv50_miptree(pt); + unsigned l; + + for (l = 0; l < pt->last_level; ++l) + FREE(mt->level[l].image_offset); nouveau_bo_ref(NULL, &mt->base.bo); FREE(mt); -- cgit v1.2.3 From 6a689783b9f61fc12e35f7e613697a3f4b07766b Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Mon, 7 Dec 2009 20:40:39 +0100 Subject: nv50: add src_mask case for IF opcode --- src/gallium/drivers/nv50/nv50_program.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 61160568570..8c826529136 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -1573,6 +1573,8 @@ nv50_tgsi_src_mask(const struct tgsi_full_instruction *insn, int c) case TGSI_OPCODE_RSQ: case TGSI_OPCODE_SCS: return 0x1; + case TGSI_OPCODE_IF: + return 0x1; case TGSI_OPCODE_LIT: return 0xb; case TGSI_OPCODE_TEX: -- cgit v1.2.3 From cc0ffaba7d1df234b3c62769ade9dee712117d2f Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 10 Dec 2009 20:54:18 +0100 Subject: nv50: fix depth comparison func TSC bits Unfortunately it seems that if depth comparison is active and we read a 2D texture, i.e. provide only 2 inputs, the second is used for comparison ... --- src/gallium/drivers/nv50/nv50_state.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_state.c b/src/gallium/drivers/nv50/nv50_state.c index 9c8c0c261e5..88aef52d08c 100644 --- a/src/gallium/drivers/nv50/nv50_state.c +++ b/src/gallium/drivers/nv50/nv50_state.c @@ -196,8 +196,9 @@ nv50_sampler_state_create(struct pipe_context *pipe, } if (cso->compare_mode == PIPE_TEX_COMPARE_R_TO_TEXTURE) { - tsc[0] |= (1 << 8); - tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7); + /* XXX: must be deactivated for non-shadow textures */ + tsc[0] |= (1 << 9); + tsc[0] |= (nvgl_comparison_op(cso->compare_func) & 0x7) << 10; } limit = CLAMP(cso->lod_bias, -16.0, 15.0); -- cgit v1.2.3 From b0036f391a1862c15c4e33d221314926dba3213b Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Wed, 9 Dec 2009 23:45:52 +0100 Subject: nv50: add S8Z24 depth texture format too --- src/gallium/drivers/nv50/nv50_screen.c | 1 + src/gallium/drivers/nv50/nv50_tex.c | 1 + src/gallium/drivers/nv50/nv50_texture.h | 1 + 3 files changed, 3 insertions(+) diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 862be46a9ec..9e057453499 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -76,6 +76,7 @@ nv50_screen_is_format_supported(struct pipe_screen *pscreen, case PIPE_FORMAT_DXT3_RGBA: case PIPE_FORMAT_DXT5_RGBA: case PIPE_FORMAT_Z24S8_UNORM: + case PIPE_FORMAT_S8Z24_UNORM: case PIPE_FORMAT_Z32_FLOAT: case PIPE_FORMAT_R16G16B16A16_SNORM: case PIPE_FORMAT_R16G16B16A16_UNORM: diff --git a/src/gallium/drivers/nv50/nv50_tex.c b/src/gallium/drivers/nv50/nv50_tex.c index 60b0ca71590..120aa6f362b 100644 --- a/src/gallium/drivers/nv50/nv50_tex.c +++ b/src/gallium/drivers/nv50/nv50_tex.c @@ -68,6 +68,7 @@ static const struct nv50_texture_format nv50_tex_format_list[] = _(DXT5_RGBA, UNORM, C0, C1, C2, C3, DXT5), _MIXED(Z24S8_UNORM, UINT, UNORM, UINT, UINT, C1, C1, C1, ONE, 24_8), + _MIXED(S8Z24_UNORM, UNORM, UINT, UINT, UINT, C0, C0, C0, ONE, 8_24), _(R16G16B16A16_SNORM, UNORM, C0, C1, C2, C3, 16_16_16_16), _(R16G16B16A16_UNORM, SNORM, C0, C1, C2, C3, 16_16_16_16), diff --git a/src/gallium/drivers/nv50/nv50_texture.h b/src/gallium/drivers/nv50/nv50_texture.h index d531e611327..b870302019a 100644 --- a/src/gallium/drivers/nv50/nv50_texture.h +++ b/src/gallium/drivers/nv50/nv50_texture.h @@ -82,6 +82,7 @@ #define NV50TIC_0_0_FMT_RGTC1 0x00000027 #define NV50TIC_0_0_FMT_RGTC2 0x00000028 #define NV50TIC_0_0_FMT_24_8 0x00000029 +#define NV50TIC_0_0_FMT_8_24 0x0000002a #define NV50TIC_0_0_FMT_32_DEPTH 0x0000002f #define NV50TIC_0_0_FMT_32_8 0x00000030 -- cgit v1.2.3 From d80778218d512f51e1b52e2fe652021ecefd724a Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Thu, 10 Dec 2009 00:36:03 +0100 Subject: nv50: support TXB and TXL ... and don't set the 'live' flag for TEX anymore, we'd have to know if results affect the inputs for another TEX, and I'm not going to do that kind of analysis now. --- src/gallium/drivers/nv50/nv50_program.c | 162 +++++++++++++++++++++----------- src/gallium/drivers/nv50/nv50_screen.c | 3 +- 2 files changed, 108 insertions(+), 57 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 8c826529136..ddb049f3910 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -1273,7 +1273,7 @@ emit_kil(struct nv50_pc *pc, struct nv50_reg *src) static void load_cube_tex_coords(struct nv50_pc *pc, struct nv50_reg *t[4], - struct nv50_reg **src, boolean proj) + struct nv50_reg **src, unsigned arg, boolean proj) { int mod[3] = { src[0]->mod, src[1]->mod, src[2]->mod }; @@ -1290,6 +1290,10 @@ load_cube_tex_coords(struct nv50_pc *pc, struct nv50_reg *t[4], if (proj && 0 /* looks more correct without this */) emit_mul(pc, t[2], t[2], src[3]); + else + if (arg == 4) /* there is no textureProj(samplerCubeShadow) */ + emit_mov(pc, t[3], src[3]); + emit_flop(pc, 0, t[2], t[2]); emit_mul(pc, t[0], src[0], t[2]); @@ -1298,85 +1302,115 @@ load_cube_tex_coords(struct nv50_pc *pc, struct nv50_reg *t[4], } static void -emit_tex(struct nv50_pc *pc, struct nv50_reg **dst, unsigned mask, - struct nv50_reg **src, unsigned unit, unsigned type, boolean proj) +load_proj_tex_coords(struct nv50_pc *pc, struct nv50_reg *t[4], + struct nv50_reg **src, unsigned dim, unsigned arg) { - struct nv50_reg *t[4]; - struct nv50_program_exec *e; + unsigned c, mode; + + if (src[0]->type == P_TEMP && src[0]->rhw != -1) { + mode = pc->interp_mode[src[0]->index] | INTERP_PERSPECTIVE; + + t[3]->rhw = src[3]->rhw; + emit_interp(pc, t[3], NULL, (mode & INTERP_CENTROID)); + emit_flop(pc, 0, t[3], t[3]); - unsigned c, mode, dim; + for (c = 0; c < dim; ++c) { + t[c]->rhw = src[c]->rhw; + emit_interp(pc, t[c], t[3], mode); + } + if (arg != dim) { /* depth reference value */ + t[dim]->rhw = src[2]->rhw; + emit_interp(pc, t[dim], t[3], mode); + } + } else { + /* XXX: for some reason the blob sometimes uses MAD + * (mad f32 $rX $rY $rZ neg $r63) + */ + emit_flop(pc, 0, t[3], src[3]); + for (c = 0; c < dim; ++c) + emit_mul(pc, t[c], src[c], t[3]); + if (arg != dim) /* depth reference value */ + emit_mul(pc, t[dim], src[2], t[3]); + } +} +static INLINE void +get_tex_dim(unsigned type, unsigned *dim, unsigned *arg) +{ switch (type) { case TGSI_TEXTURE_1D: - dim = 1; + *arg = *dim = 1; + break; + case TGSI_TEXTURE_SHADOW1D: + *dim = 1; + *arg = 2; break; case TGSI_TEXTURE_UNKNOWN: case TGSI_TEXTURE_2D: - case TGSI_TEXTURE_SHADOW1D: /* XXX: x, z */ case TGSI_TEXTURE_RECT: - dim = 2; + *arg = *dim = 2; + break; + case TGSI_TEXTURE_SHADOW2D: + case TGSI_TEXTURE_SHADOWRECT: + *dim = 2; + *arg = 3; break; case TGSI_TEXTURE_3D: case TGSI_TEXTURE_CUBE: - case TGSI_TEXTURE_SHADOW2D: - case TGSI_TEXTURE_SHADOWRECT: /* XXX */ - dim = 3; + *dim = *arg = 3; break; default: assert(0); break; } +} + +static void +emit_tex(struct nv50_pc *pc, struct nv50_reg **dst, unsigned mask, + struct nv50_reg **src, unsigned unit, unsigned type, + boolean proj, int bias_lod) +{ + struct nv50_reg *t[4]; + struct nv50_program_exec *e; + unsigned c, dim, arg; - /* some cards need t[0]'s hw index to be a multiple of 4 */ + /* t[i] must be within a single 128 bit super-reg */ alloc_temp4(pc, t, 0); + e = exec(pc); + e->inst[0] = 0xf0000000; + set_long(pc, e); + set_dst(pc, t[0], e); + + /* TIC and TSC binding indices (TSC is ignored as TSC_LINKED = TRUE): */ + e->inst[0] |= (unit << 9) /* | (unit << 17) */; + + /* live flag (don't set if TEX results affect input to another TEX): */ + /* e->inst[0] |= 0x00000004; */ + + get_tex_dim(type, &dim, &arg); + if (type == TGSI_TEXTURE_CUBE) { - load_cube_tex_coords(pc, t, src, proj); + e->inst[0] |= 0x08000000; + load_cube_tex_coords(pc, t, src, arg, proj); } else - if (proj) { - if (src[0]->type == P_TEMP && src[0]->rhw != -1) { - mode = pc->interp_mode[src[0]->index]; - - t[3]->rhw = src[3]->rhw; - emit_interp(pc, t[3], NULL, (mode & INTERP_CENTROID)); - emit_flop(pc, 0, t[3], t[3]); - - for (c = 0; c < dim; c++) { - t[c]->rhw = src[c]->rhw; - emit_interp(pc, t[c], t[3], - (mode | INTERP_PERSPECTIVE)); - } - } else { - emit_flop(pc, 0, t[3], src[3]); - for (c = 0; c < dim; c++) - emit_mul(pc, t[c], src[c], t[3]); - - /* XXX: for some reason the blob sometimes uses MAD: - * emit_mad(pc, t[c], src[0][c], t[3], t[3]) - * pc->p->exec_tail->inst[1] |= 0x080fc000; - */ - } - } else { + if (proj) + load_proj_tex_coords(pc, t, src, dim, arg); + else { for (c = 0; c < dim; c++) emit_mov(pc, t[c], src[c]); + if (arg != dim) /* depth reference value (always src.z here) */ + emit_mov(pc, t[dim], src[2]); } - e = exec(pc); - set_long(pc, e); - e->inst[0] |= 0xf0000000; - e->inst[1] |= 0x00000004; - set_dst(pc, t[0], e); - e->inst[0] |= (unit << 9); - - if (dim == 2) - e->inst[0] |= 0x00400000; - else - if (dim == 3) { - e->inst[0] |= 0x00800000; - if (type == TGSI_TEXTURE_CUBE) - e->inst[0] |= 0x08000000; + if (bias_lod) { + assert(arg < 4); + emit_mov(pc, t[arg++], src[3]); + e->inst[1] |= (bias_lod < 0) ? 0x20000000 : 0x40000000; } + e->inst[0] |= (arg - 1) << 22; + e->inst[0] |= (mask & 0x3) << 25; e->inst[1] |= (mask & 0xc) << 12; @@ -1578,6 +1612,8 @@ nv50_tgsi_src_mask(const struct tgsi_full_instruction *insn, int c) case TGSI_OPCODE_LIT: return 0xb; case TGSI_OPCODE_TEX: + case TGSI_OPCODE_TXB: + case TGSI_OPCODE_TXL: case TGSI_OPCODE_TXP: { const struct tgsi_instruction_texture *tex; @@ -1586,13 +1622,17 @@ nv50_tgsi_src_mask(const struct tgsi_full_instruction *insn, int c) tex = &insn->Texture; mask = 0x7; - if (insn->Instruction.Opcode == TGSI_OPCODE_TXP) - mask |= 0x8; + if (insn->Instruction.Opcode != TGSI_OPCODE_TEX && + insn->Instruction.Opcode != TGSI_OPCODE_TXD) + mask |= 0x8; /* bias, lod or proj */ switch (tex->Texture) { case TGSI_TEXTURE_1D: mask &= 0x9; break; + case TGSI_TEXTURE_SHADOW1D: + mask &= 0x5; + break; case TGSI_TEXTURE_2D: mask &= 0xb; break; @@ -1784,6 +1824,8 @@ nv50_tgsi_dst_revdep(unsigned op, int s, int c) case TGSI_OPCODE_LIT: case TGSI_OPCODE_SCS: case TGSI_OPCODE_TEX: + case TGSI_OPCODE_TXB: + case TGSI_OPCODE_TXL: case TGSI_OPCODE_TXP: /* these take care of dangerous swizzles themselves */ return 0x0; @@ -2187,11 +2229,19 @@ nv50_program_tx_insn(struct nv50_pc *pc, break; case TGSI_OPCODE_TEX: emit_tex(pc, dst, mask, src[0], unit, - inst->Texture.Texture, FALSE); + inst->Texture.Texture, FALSE, 0); + break; + case TGSI_OPCODE_TXB: + emit_tex(pc, dst, mask, src[0], unit, + inst->Texture.Texture, FALSE, -1); + break; + case TGSI_OPCODE_TXL: + emit_tex(pc, dst, mask, src[0], unit, + inst->Texture.Texture, FALSE, 1); break; case TGSI_OPCODE_TXP: emit_tex(pc, dst, mask, src[0], unit, - inst->Texture.Texture, TRUE); + inst->Texture.Texture, TRUE, 0); break; case TGSI_OPCODE_TRUNC: for (c = 0; c < 4; c++) { diff --git a/src/gallium/drivers/nv50/nv50_screen.c b/src/gallium/drivers/nv50/nv50_screen.c index 9e057453499..d443ca3ad06 100644 --- a/src/gallium/drivers/nv50/nv50_screen.c +++ b/src/gallium/drivers/nv50/nv50_screen.c @@ -419,7 +419,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) NOUVEAU_BO_RD | NOUVEAU_BO_HIGH, 0, 0); so_reloc (so, screen->tsc, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD | NOUVEAU_BO_LOW, 0, 0); - so_data (so, 0x00000000); + so_data (so, 0x00000000); /* ignored if TSC_LINKED (0x1234) = 1 */ /* Vertex array limits - max them out */ @@ -433,6 +433,7 @@ nv50_screen_create(struct pipe_winsys *ws, struct nouveau_device *dev) so_data (so, fui(0.0)); so_data (so, fui(1.0)); + /* no dynamic combination of TIC & TSC entries => only BIND_TIC used */ so_method(so, screen->tesla, 0x1234, 1); so_data (so, 1); -- cgit v1.2.3 From a3b32934c83f721102b9dd004227a528a174d7bb Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 12 Dec 2009 16:49:26 +0100 Subject: slang: Delete a file that is now autogenerated. This file has been modified in master and removed in feature branch. This gave a merge conflict I couldn't resolve by removing and git adding it to index. --- .../shader/slang/library/slang_common_builtin_gc.h | 880 --------------------- 1 file changed, 880 deletions(-) delete mode 100644 src/mesa/shader/slang/library/slang_common_builtin_gc.h diff --git a/src/mesa/shader/slang/library/slang_common_builtin_gc.h b/src/mesa/shader/slang/library/slang_common_builtin_gc.h deleted file mode 100644 index 3c3666e4ea2..00000000000 --- a/src/mesa/shader/slang/library/slang_common_builtin_gc.h +++ /dev/null @@ -1,880 +0,0 @@ - -/* DO NOT EDIT - THIS FILE IS AUTOMATICALLY GENERATED FROM THE FOLLOWING FILE: */ -/* slang_common_builtin.gc */ - -5,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,76,105,103,104,116,115,0,2,16,10,56,0,0,0,2,2,90,95,1,0, -5,0,1,103,108,95,77,97,120,67,108,105,112,80,108,97,110,101,115,0,2,16,10,54,0,0,0,2,2,90,95,1,0,5, -0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,85,110,105,116,115,0,2,16,10,56,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,2,16,10,56,0, -0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,65,116,116,114,105,98,115,0,2, -16,10,49,54,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,85,110,105,102, -111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,53,49,50,0,0,0,2,2,90,95,1,0,5,0,1, -103,108,95,77,97,120,86,97,114,121,105,110,103,70,108,111,97,116,115,0,2,16,10,51,50,0,0,0,2,2,90, -95,1,0,5,0,1,103,108,95,77,97,120,86,101,114,116,101,120,84,101,120,116,117,114,101,73,109,97,103, -101,85,110,105,116,115,0,2,16,8,48,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,67,111,109,98, -105,110,101,100,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105,116,115,0,2,16,10,50,0,0,0, -2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97,103,101,85,110,105, -116,115,0,2,16,10,50,0,0,0,2,2,90,95,1,0,5,0,1,103,108,95,77,97,120,70,114,97,103,109,101,110,116, -85,110,105,102,111,114,109,67,111,109,112,111,110,101,110,116,115,0,2,16,10,54,52,0,0,0,2,2,90,95, -1,0,5,0,1,103,108,95,77,97,120,68,114,97,119,66,117,102,102,101,114,115,0,2,16,10,49,0,0,0,2,2,90, -95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97, -116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105, -120,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95, -4,0,14,0,1,103,108,95,78,111,114,109,97,108,77,97,116,114,105,120,0,0,0,2,2,90,95,4,0,15,0,1,103, -108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2, -2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110, -118,101,114,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,80,114, -111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101,0,0,0,2,2,90,95,4, -0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120,73,110,118,101,114,115,101,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,15, -0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116,114,105,120,84,114,97,110,115,112,111, -115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114, -105,120,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108, -86,105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,84,114,97,110,115,112, -111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101,77,97,116,114,105,120, -84,114,97,110,115,112,111,115,101,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111, -111,114,100,115,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86,105,101,119,77,97,116, -114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0, -1,103,108,95,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115, -101,84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,77,111,100,101,108,86, -105,101,119,80,114,111,106,101,99,116,105,111,110,77,97,116,114,105,120,73,110,118,101,114,115,101, -84,114,97,110,115,112,111,115,101,0,0,0,2,2,90,95,4,0,15,0,1,103,108,95,84,101,120,116,117,114,101, -77,97,116,114,105,120,73,110,118,101,114,115,101,84,114,97,110,115,112,111,115,101,0,3,18,103,108, -95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,9,0,1,103,108, -95,78,111,114,109,97,108,83,99,97,108,101,0,0,0,2,2,90,95,0,0,24,103,108,95,68,101,112,116,104,82, -97,110,103,101,80,97,114,97,109,101,116,101,114,115,0,9,0,110,101,97,114,0,0,0,1,9,0,102,97,114,0, -0,0,1,9,0,100,105,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,68,101,112,116,104,82,97,110, -103,101,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,68,101,112,116,104,82,97,110,103,101, -0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,67,108,105,112,80,108,97,110,101,0,3,18,103,108,95,77,97,120, -67,108,105,112,80,108,97,110,101,115,0,0,0,2,2,90,95,0,0,24,103,108,95,80,111,105,110,116,80,97, -114,97,109,101,116,101,114,115,0,9,0,115,105,122,101,0,0,0,1,9,0,115,105,122,101,77,105,110,0,0,0, -1,9,0,115,105,122,101,77,97,120,0,0,0,1,9,0,102,97,100,101,84,104,114,101,115,104,111,108,100,83, -105,122,101,0,0,0,1,9,0,100,105,115,116,97,110,99,101,67,111,110,115,116,97,110,116,65,116,116,101, -110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,76,105,110,101,97,114,65,116, -116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,100,105,115,116,97,110,99,101,81,117,97,100,114,97, -116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,80, -111,105,110,116,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,80,111,105,110,116,0,0,0,2,2, -90,95,0,0,24,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,12,0, -101,109,105,115,115,105,111,110,0,0,0,1,12,0,97,109,98,105,101,110,116,0,0,0,1,12,0,100,105,102, -102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,9,0,115,104,105,110,105,110,101, -115,115,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109, -101,116,101,114,115,0,0,1,103,108,95,70,114,111,110,116,77,97,116,101,114,105,97,108,0,0,0,2,2,90, -95,4,0,25,103,108,95,77,97,116,101,114,105,97,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103, -108,95,66,97,99,107,77,97,116,101,114,105,97,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104, -116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,12,0,97,109,98,105,101,110,116,0, -0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0,0,0,1,12,0,112, -111,115,105,116,105,111,110,0,0,0,1,12,0,104,97,108,102,86,101,99,116,111,114,0,0,0,1,11,0,115,112, -111,116,68,105,114,101,99,116,105,111,110,0,0,0,1,9,0,115,112,111,116,67,111,115,67,117,116,111, -102,102,0,0,0,1,9,0,99,111,110,115,116,97,110,116,65,116,116,101,110,117,97,116,105,111,110,0,0,0, -1,9,0,108,105,110,101,97,114,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,113,117,97,100, -114,97,116,105,99,65,116,116,101,110,117,97,116,105,111,110,0,0,0,1,9,0,115,112,111,116,69,120,112, -111,110,101,110,116,0,0,0,1,9,0,115,112,111,116,67,117,116,111,102,102,0,0,0,0,0,0,0,2,2,90,95,4,0, -25,103,108,95,76,105,103,104,116,83,111,117,114,99,101,80,97,114,97,109,101,116,101,114,115,0,0,1, -103,108,95,76,105,103,104,116,83,111,117,114,99,101,0,3,18,103,108,95,77,97,120,76,105,103,104,116, -115,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108,80,97,114,97,109,101, -116,101,114,115,0,12,0,97,109,98,105,101,110,116,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105, -103,104,116,77,111,100,101,108,80,97,114,97,109,101,116,101,114,115,0,0,1,103,108,95,76,105,103, -104,116,77,111,100,101,108,0,0,0,2,2,90,95,0,0,24,103,108,95,76,105,103,104,116,77,111,100,101,108, -80,114,111,100,117,99,116,115,0,12,0,115,99,101,110,101,67,111,108,111,114,0,0,0,0,0,0,0,2,2,90,95, -4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,4,0,25,103,108,95,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,115,0,0, -1,103,108,95,66,97,99,107,76,105,103,104,116,77,111,100,101,108,80,114,111,100,117,99,116,0,0,0,2, -2,90,95,0,0,24,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,12,0,97,109,98,105, -101,110,116,0,0,0,1,12,0,100,105,102,102,117,115,101,0,0,0,1,12,0,115,112,101,99,117,108,97,114,0, -0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99,116,115,0,0,1,103, -108,95,70,114,111,110,116,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108,95,77,97,120, -76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,25,103,108,95,76,105,103,104,116,80,114,111,100,117,99, -116,115,0,0,1,103,108,95,66,97,99,107,76,105,103,104,116,80,114,111,100,117,99,116,0,3,18,103,108, -95,77,97,120,76,105,103,104,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,84,101,120,116,117,114, -101,69,110,118,67,111,108,111,114,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,73,109,97, -103,101,85,110,105,116,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,83,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,69,121,101,80,108,97,110,101,82,0, -3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12, -0,1,103,108,95,69,121,101,80,108,97,110,101,81,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114, -101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97, -110,101,83,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2, -90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,84,0,3,18,103,108,95,77,97,120, -84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106, -101,99,116,80,108,97,110,101,82,0,3,18,103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111, -114,100,115,0,0,0,2,2,90,95,4,0,12,0,1,103,108,95,79,98,106,101,99,116,80,108,97,110,101,81,0,3,18, -103,108,95,77,97,120,84,101,120,116,117,114,101,67,111,111,114,100,115,0,0,0,2,2,90,95,0,0,24,103, -108,95,70,111,103,80,97,114,97,109,101,116,101,114,115,0,12,0,99,111,108,111,114,0,0,0,1,9,0,100, -101,110,115,105,116,121,0,0,0,1,9,0,115,116,97,114,116,0,0,0,1,9,0,101,110,100,0,0,0,1,9,0,115,99, -97,108,101,0,0,0,0,0,0,0,2,2,90,95,4,0,25,103,108,95,70,111,103,80,97,114,97,109,101,116,101,114, -115,0,0,1,103,108,95,70,111,103,0,0,0,1,90,95,0,0,9,0,0,114,97,100,105,97,110,115,0,1,1,0,0,9,0, -100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,100,101,103,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,114,97,100,105,97,110,115,0,1,1,0,0,10,0,100, -101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0, -49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,0,0,18,100,101,103,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,114,97, -100,105,97,110,115,0,1,1,0,0,11,0,100,101,103,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49, -53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,100,101,103,0,59,120,121,122,0,0,18,99,0,59, -120,120,120,0,0,0,0,1,90,95,0,0,12,0,0,114,97,100,105,97,110,115,0,1,1,0,0,12,0,100,101,103,0,0,0, -1,3,2,90,95,1,0,9,0,1,99,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,49,56,48,0,48,0,0,49,0,0,4,118, -101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,100,101,103,0, -0,18,99,0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,100,101,103,114,101,101,115,0,1,1,0,0,9,0, -114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0, -0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0, -18,114,97,100,0,0,18,99,0,0,0,0,1,90,95,0,0,10,0,0,100,101,103,114,101,101,115,0,1,1,0,0,10,0,114, -97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49, -0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,114,97,100,0,59,120,121,0,0,18,99,0,59,120,120,0,0,0,0,1,90,95,0,0,11,0,0,100,101,103, -114,101,101,115,0,1,1,0,0,11,0,114,97,100,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0, -17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,114,97,100,0,59,120,121,122,0,0,18,99,0,59,120, -120,120,0,0,0,0,1,90,95,0,0,12,0,0,100,101,103,114,101,101,115,0,1,1,0,0,12,0,114,97,100,0,0,0,1,3, -2,90,95,1,0,9,0,1,99,0,2,17,49,56,48,0,48,0,0,17,51,0,49,52,49,53,57,50,54,0,0,49,0,0,4,118,101,99, -52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,0,0,18,99, -0,59,120,120,120,120,0,0,0,0,1,90,95,0,0,9,0,0,115,105,110,0,1,1,0,0,9,0,114,97,100,105,97,110,115, -0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100, -105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,115,105,110,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0, -0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114, -97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,115, -105,110,0,1,1,0,0,11,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108, -111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97, -110,115,0,59,121,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,115,105,110,0,1,1,0,0, -12,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,114, -97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,115,105,110,101,0,18,95,95,114,101, -116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,99,111, -115,0,1,1,0,0,9,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101, -0,18,95,95,114,101,116,86,97,108,0,0,18,114,97,100,105,97,110,115,0,0,0,0,1,90,95,0,0,10,0,0,99, -111,115,0,1,1,0,0,10,0,114,97,100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105, -110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0, -4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -114,97,100,105,97,110,115,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,99,111,115,0,1,1,0,0,11,0,114,97,100, -105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97, -108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111,115, -105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59,121,0, -0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0, -18,114,97,100,105,97,110,115,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,99,111,115,0,1,1,0,0,12,0,114,97, -100,105,97,110,115,0,0,0,1,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,114,97,100,105,97,110,115,0,59,120,0,0,0,4,102,108,111,97,116,95,99,111, -115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,114,97,100,105,97,110,115,0,59, -121,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0,18,95,95,114,101,116,86,97,108,0,59,122, -0,0,18,114,97,100,105,97,110,115,0,59,122,0,0,0,4,102,108,111,97,116,95,99,111,115,105,110,101,0, -18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,114,97,100,105,97,110,115,0,59,119,0,0,0,0,1,90,95, -0,0,9,0,0,116,97,110,0,1,1,0,0,9,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,115, -105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,9,0,1,99,0,2,58,99,111,115,0,0,18,97,110, -103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,10,0,0,116,97,110,0,1,1,0,0,10,0,97, -110,103,108,101,0,0,0,1,3,2,90,95,1,0,10,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0, -0,0,0,3,2,90,95,1,0,10,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18, -99,0,49,0,0,1,90,95,0,0,11,0,0,116,97,110,0,1,1,0,0,11,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0, -11,0,1,115,0,2,58,115,105,110,0,0,18,97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,11,0,1,99,0,2,58, -99,111,115,0,0,18,97,110,103,108,101,0,0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,12,0,0,116,97, -110,0,1,1,0,0,12,0,97,110,103,108,101,0,0,0,1,3,2,90,95,1,0,12,0,1,115,0,2,58,115,105,110,0,0,18, -97,110,103,108,101,0,0,0,0,0,3,2,90,95,1,0,12,0,1,99,0,2,58,99,111,115,0,0,18,97,110,103,108,101,0, -0,0,0,0,8,18,115,0,18,99,0,49,0,0,1,90,95,0,0,9,0,0,97,115,105,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2, -90,95,1,0,9,0,1,97,48,0,2,17,49,0,53,55,48,55,50,56,56,0,0,0,0,3,2,90,95,1,0,9,0,1,97,49,0,2,17,48, -0,50,49,50,49,49,52,52,0,0,54,0,0,3,2,90,95,1,0,9,0,1,97,50,0,2,17,48,0,48,55,52,50,54,49,48,0,0,0, -0,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0,53,0,0,48, -0,0,3,2,90,95,1,0,9,0,1,121,0,2,58,97,98,115,0,0,18,120,0,0,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,18,104,97,108,102,80,105,0,58,115,113,114,116,0,0,17,49,0,48,0,0,18,121,0,47,0,0,18,97,48,0,18, -121,0,18,97,49,0,18,97,50,0,18,121,0,48,46,48,46,48,47,58,115,105,103,110,0,0,18,120,0,0,0,48,20,0, -0,1,90,95,0,0,10,0,0,97,115,105,110,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,115,105,110,0,1,1,0, -0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59, -120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0, -0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0, -20,0,0,1,90,95,0,0,12,0,0,97,115,105,110,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,97,115,105,110,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,97,115,105,110,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -122,0,58,97,115,105,110,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0, -58,97,115,105,110,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,99,111,115,0,1,1,0,0,9,0, -120,0,0,0,1,3,2,90,95,1,0,9,0,1,104,97,108,102,80,105,0,2,17,51,0,49,52,49,53,57,50,54,0,0,17,48,0, -53,0,0,48,0,0,9,18,95,95,114,101,116,86,97,108,0,18,104,97,108,102,80,105,0,58,97,115,105,110,0,0, -18,120,0,0,0,47,20,0,0,1,90,95,0,0,10,0,0,97,99,111,115,0,1,1,0,0,10,0,118,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97, -99,111,115,0,1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,99,111,115, -0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,99,111,115,0,0,18, -118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,99,111,115,0,0,18,118,0, -59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,99,111,115,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,97,99,111,115,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,97,99,111,115,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,122,0,58,97,99,111,115,0,0,18,118,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59, -119,0,58,97,99,111,115,0,0,18,118,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0, -9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,58,97,115,105,110,0,0,18,120,0,58,105,110,118, -101,114,115,101,115,113,114,116,0,0,18,120,0,18,120,0,48,17,49,0,48,0,0,46,0,0,48,0,0,20,0,0,1,90, -95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,121,95,111,118,101,114, -95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,121,95,111,118, -101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0, -0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0, -58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97, -116,97,110,0,1,1,0,0,12,0,121,95,111,118,101,114,95,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0, -59,120,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95,120,0,59,121,0,0,0, -20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,121,95,111,118,101,114,95, -120,0,59,122,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,121,95, -111,118,101,114,95,120,0,59,119,0,0,0,20,0,0,1,90,95,0,0,9,0,0,97,116,97,110,0,1,1,0,0,9,0,121,0,0, -1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,10,58,97,98,115,0,0,18,120,0,0,0,17,49,0,48, -0,45,52,0,41,0,2,9,18,114,0,58,97,116,97,110,0,0,18,121,0,18,120,0,49,0,0,20,0,10,18,120,0,17,48,0, -48,0,0,40,0,2,9,18,114,0,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,51,0,49,52,49,53,57,51,0, -0,48,46,20,0,0,9,14,0,0,2,9,18,114,0,58,115,105,103,110,0,0,18,121,0,0,0,17,49,0,53,55,48,55,57,54, -53,0,0,48,20,0,0,8,18,114,0,0,0,1,90,95,0,0,10,0,0,97,116,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10, -0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0,59,120,0,0, -18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110,0,0,18,117, -0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,0,1,90,95,0,0,11,0,0,97,116,97,110,0,1,1,0,0,11,0,117,0,0, -1,1,0,0,11,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,97,116,97,110,0,0,18,117,0, -59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,97,116,97,110, -0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58, -97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,0,1,90,95,0,0,12,0,0,97,116,97, -110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -97,116,97,110,0,0,18,117,0,59,120,0,0,18,118,0,59,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108, -0,59,121,0,58,97,116,97,110,0,0,18,117,0,59,121,0,0,18,118,0,59,121,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,122,0,58,97,116,97,110,0,0,18,117,0,59,122,0,0,18,118,0,59,122,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,119,0,58,97,116,97,110,0,0,18,117,0,59,119,0,0,18,118,0,59,119,0, -0,0,20,0,0,1,90,95,0,0,9,0,0,112,111,119,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95, -0,0,10,0,0,112,111,119,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,102,108,111,97,116,95,112, -111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0, -0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -97,0,59,121,0,0,18,98,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,112,111,119,0,1,1,0,0,11,0,97,0,0,1,1,0, -0,11,0,98,0,0,0,1,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0, -59,120,0,0,18,97,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0, -18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111, -97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18, -98,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,112,111,119,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,97,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86, -97,108,0,59,121,0,0,18,97,0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,112,111,119, -101,114,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,18,98,0,59,122,0,0,0,4, -102,108,111,97,116,95,112,111,119,101,114,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,97,0,59, -119,0,0,18,98,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,101,120,112,0,1,1,0,0,9,0,97,0,0,0,1,3,2,90,95,0, -0,9,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120, -112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,116,0,0,0,0,1,90,95,0,0,10,0,0,101,120,112,0,1,1,0, -0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0, -4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59, -120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18, -116,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1, -116,0,2,18,97,0,17,49,0,52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50, -0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101, -120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97, -116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,0,1,90, -95,0,0,12,0,0,101,120,112,0,1,1,0,0,12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,18,97,0,17,49,0, -52,52,50,54,57,53,48,50,0,0,48,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,116,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,121,0,0,18,116,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18, -95,95,114,101,116,86,97,108,0,59,122,0,0,18,116,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112, -50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,116,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,108,111, -103,50,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86, -97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,108,111,103,50,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108, -111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4, -102,108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121, -0,0,0,0,1,90,95,0,0,11,0,0,108,111,103,50,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95,108, -111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, -116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0, -0,0,1,90,95,0,0,12,0,0,108,111,103,50,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108,111,97,116,95,108,111, -103,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, -108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108,111, -97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,4,102, -108,111,97,116,95,108,111,103,50,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118,0,59,119,0,0, -0,0,1,90,95,0,0,9,0,0,108,111,103,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54, -57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,120,0,0,0,18,99,0,48,0,0,1,90,95,0,0,10, -0,0,108,111,103,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49, -56,49,0,0,0,0,8,58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,11,0,0,108,111,103,0, -1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8, -58,108,111,103,50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,12,0,0,108,111,103,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,1,0,9,0,1,99,0,2,17,48,0,54,57,51,49,52,55,49,56,49,0,0,0,0,8,58,108,111,103, -50,0,0,18,118,0,0,0,18,99,0,48,0,0,1,90,95,0,0,9,0,0,101,120,112,50,0,1,1,0,0,9,0,97,0,0,0,1,4,102, -108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10, -0,0,101,120,112,50,0,1,1,0,0,10,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114, -101,116,86,97,108,0,59,120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95, -95,114,101,116,86,97,108,0,59,121,0,0,18,97,0,59,121,0,0,0,0,1,90,95,0,0,11,0,0,101,120,112,50,0,1, -1,0,0,11,0,97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97, -108,0,59,121,0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101, -116,86,97,108,0,59,122,0,0,18,97,0,59,122,0,0,0,0,1,90,95,0,0,12,0,0,101,120,112,50,0,1,1,0,0,12,0, -97,0,0,0,1,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18, -97,0,59,120,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0,59,121, -0,0,18,97,0,59,121,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86,97,108,0, -59,122,0,0,18,97,0,59,122,0,0,0,4,102,108,111,97,116,95,101,120,112,50,0,18,95,95,114,101,116,86, -97,108,0,59,119,0,0,18,97,0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,115,113,114,116,0,1,1,0,0,9,0,120,0,0, -0,1,3,2,90,95,1,0,9,0,1,110,120,0,2,18,120,0,54,0,0,3,2,90,95,0,0,9,0,1,114,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,114,0,0,18,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,0,18, -114,0,0,0,4,118,101,99,52,95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,10,0,0,115,113,114,116,0,1,1,0,0,10,0,120,0,0,0,1,3,2,90,95,1, -0,10,0,1,110,120,0,2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0, -0,0,3,2,90,95,0,0,10,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18, -120,0,59,120,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0,18,114,0,59,120,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0,0,4,118,101,99,52,95,99,109,112,0,18, -95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0, -11,0,0,115,113,114,116,0,1,1,0,0,11,0,120,0,0,0,1,3,2,90,95,1,0,11,0,1,110,120,0,2,18,120,0,54,0,1, -1,122,101,114,111,0,2,58,118,101,99,51,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0,11,0,1,114,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0, -18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,118,101,99,52, -95,99,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0, -0,0,0,1,90,95,0,0,12,0,0,115,113,114,116,0,1,1,0,0,12,0,120,0,0,0,1,3,2,90,95,1,0,12,0,1,110,120,0, -2,18,120,0,54,0,1,1,122,101,114,111,0,2,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,0,0,3,2,90,95,0,0, -12,0,1,114,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,59,120,0,0,18,120,0,59,120,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,114,0,59,121,0,0,18,120,0,59,121,0,0,0,4,102,108,111,97,116, -95,114,115,113,0,18,114,0,59,122,0,0,18,120,0,59,122,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,59,119,0,0,18,120,0,59,119,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,120,0,0, -18,114,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,121,0,0,18,114,0,59,121,0,0, -0,4,102,108,111,97,116,95,114,99,112,0,18,114,0,59,122,0,0,18,114,0,59,122,0,0,0,4,102,108,111,97, -116,95,114,99,112,0,18,114,0,59,119,0,0,18,114,0,59,119,0,0,0,4,118,101,99,52,95,99,109,112,0,18, -95,95,114,101,116,86,97,108,0,0,18,110,120,0,0,18,114,0,0,18,122,101,114,111,0,0,0,0,1,90,95,0,0,9, -0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,9,0,120,0,0,0,1,4,102,108,111,97,116,95, -114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,105, -110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,10,0,118,0,0,0,1,4,102,108,111,97,116,95,114,115, -113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97,116,95, -114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,0,1,90,95,0,0,11,0, -0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,11,0,118,0,0,0,1,4,102,108,111,97,116,95, -114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4,102,108,111,97, -116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0,0,0,4,102,108, -111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59,122,0,0,0,0,1, -90,95,0,0,12,0,0,105,110,118,101,114,115,101,115,113,114,116,0,1,1,0,0,12,0,118,0,0,0,1,4,102,108, -111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,118,0,59,120,0,0,0,4, -102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,121,0,0,18,118,0,59,121,0, -0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,122,0,0,18,118,0,59, -122,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,95,95,114,101,116,86,97,108,0,59,119,0,0,18,118, -0,59,119,0,0,0,0,1,90,95,0,0,9,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,9,0,120,0,0,0,1,9, -18,95,95,114,101,116,86,97,108,0,17,49,0,48,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,114,109,97,108, -105,122,101,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,1,0,9,0,1,115,0,2,58,105,110,118,101,114,115,101, -115,113,114,116,0,0,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,0,0,4,118,101,99,52,95,109,117, -108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,115,0,0,0, -0,1,90,95,0,0,11,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,9, -0,1,116,109,112,0,0,0,4,118,101,99,51,95,100,111,116,0,18,116,109,112,0,0,18,118,0,0,18,118,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0,4,118,101,99,52,95, -109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0, -18,116,109,112,0,0,0,0,1,90,95,0,0,12,0,0,110,111,114,109,97,108,105,122,101,0,1,1,0,0,12,0,118,0, -0,0,1,3,2,90,95,0,0,9,0,1,116,109,112,0,0,0,4,118,101,99,52,95,100,111,116,0,18,116,109,112,0,0,18, -118,0,0,18,118,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,116,109,112,0,0,18,116,109,112,0,0,0, -4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,118,0,0,18,116,109,112,0,0,0,0,1,90,95,0,0,9,0,0,97,98,115,0,1,1,0,0,9,0,97,0,0,0,1,4, -118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0, -97,98,115,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,97,98,115,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99, -52,95,97,98,115,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12, -0,0,97,98,115,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,97,98,115,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,115,105,103,110,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9, -0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,120,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,120,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90,95,0, -0,10,0,0,115,105,103,110,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,112,0,0,1,1,110,0,0,0,4, -118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,4,118,101,99, -52,95,115,103,116,0,18,110,0,59,120,121,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95,115, -117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,112,0,0,18,110,0,0,0, -0,1,90,95,0,0,11,0,0,115,105,103,110,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0,11,0,1,112,0,0,1,1, -110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,59,120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0, -0,4,118,101,99,52,95,115,103,116,0,18,110,0,59,120,121,122,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118, -101,99,52,95,115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -112,0,0,18,110,0,0,0,0,1,90,95,0,0,12,0,0,115,105,103,110,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0, -12,0,1,112,0,0,1,1,110,0,0,0,4,118,101,99,52,95,115,103,116,0,18,112,0,0,18,118,0,0,17,48,0,48,0,0, -0,0,4,118,101,99,52,95,115,103,116,0,18,110,0,0,17,48,0,48,0,0,0,18,118,0,0,0,4,118,101,99,52,95, -115,117,98,116,114,97,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,112,0,0,18,110,0,0,0,0,1,90, -95,0,0,9,0,0,102,108,111,111,114,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,108,111,111,114,0,1,1,0,0, -10,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,97,0,0,0,0,1,90,95,0,0,11,0,0,102,108,111,111,114,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,102,108,111,111,114,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1, -90,95,0,0,12,0,0,102,108,111,111,114,0,1,1,0,0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,108,111,111, -114,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,9,0,0,99,101,105,108,0,1,1,0,0, -9,0,97,0,0,0,1,3,2,90,95,0,0,9,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0, -18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,10,0,0,99, -101,105,108,0,1,1,0,0,10,0,97,0,0,0,1,3,2,90,95,0,0,10,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52, -95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,59,120,121,0,18, -98,0,54,20,0,0,1,90,95,0,0,11,0,0,99,101,105,108,0,1,1,0,0,11,0,97,0,0,0,1,3,2,90,95,0,0,11,0,1,98, -0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114,0,18,98,0,0,18,98,0,0,0,9,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,18,98,0,54,20,0,0,1,90,95,0,0,12,0,0,99,101,105,108,0,1,1,0,0, -12,0,97,0,0,0,1,3,2,90,95,0,0,12,0,1,98,0,2,18,97,0,54,0,0,4,118,101,99,52,95,102,108,111,111,114, -0,18,98,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,98,0,54,20,0,0,1,90,95,0,0,9,0,0,102, -114,97,99,116,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86, -97,108,0,0,18,97,0,0,0,0,1,90,95,0,0,10,0,0,102,114,97,99,116,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101, -99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,0,0,0,1,90,95,0,0, -11,0,0,102,114,97,99,116,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,0,0,0,1,90,95,0,0,12,0,0,102,114,97,99,116,0,1,1,0, -0,12,0,97,0,0,0,1,4,118,101,99,52,95,102,114,97,99,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0, -0,0,1,90,95,0,0,9,0,0,109,111,100,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1, -111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102,108,111,111,114,0, -0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,10,0,0,109,111,100,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0, -4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110, -101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1, -1,0,0,9,0,98,0,0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116, -95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,18,97,0,18,98,0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101, -114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12,0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,9,0,98,0, -0,0,1,3,2,90,95,0,0,9,0,1,111,110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,111,110,101,79,118,101,114,66,0,0,18,98,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,10,0,0,109,111,100,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,3,2,90,95,0,0,10,0,1,111, -110,101,79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114, -66,0,59,120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118, -101,114,66,0,59,121,0,0,18,98,0,59,121,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58, -102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0, -11,0,0,109,111,100,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,3,2,90,95,0,0,11,0,1,111,110,101, -79,118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98,0,58,102, -108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90,95,0,0,12, -0,0,109,111,100,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,3,2,90,95,0,0,12,0,1,111,110,101,79, -118,101,114,66,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66,0,59, -120,0,0,18,98,0,59,120,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101,114,66, -0,59,121,0,0,18,98,0,59,121,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79,118,101, -114,66,0,59,122,0,0,18,98,0,59,122,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,111,110,101,79, -118,101,114,66,0,59,119,0,0,18,98,0,59,119,0,0,0,9,18,95,95,114,101,116,86,97,108,0,18,97,0,18,98, -0,58,102,108,111,111,114,0,0,18,97,0,18,111,110,101,79,118,101,114,66,0,48,0,0,48,47,20,0,0,1,90, -95,0,0,9,0,0,109,105,110,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105, -110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109,105,110,0, -1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116, -86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0,1,90,95,0,0,11,0,0, -109,105,110,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59,120,121,122,0, -0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4,118,101,99,52, -95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,10,0,0,109, -105,110,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114, -101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,105,110,0,1,1,0, -0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97, -108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,105,110,0,1,1,0,0,12,0,97, -0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,105,110,0,18,95,95,114,101,116,86,97,108,0,0,18, -97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,109,97,120,0,1,1,0,0,9,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,10,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,97,0,59,120,121,0,0,18,98,0,59,120,121,0,0,0,0, -1,90,95,0,0,11,0,0,109,97,120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,11,0,98,0,0,0,1,4,118,101,99,52,95,109, -97,120,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,97,0,59,120,121,122,0,0,18,98,0,59, -120,121,122,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0,12,0,97,0,0,1,1,0,0,12,0,98,0,0,0,1,4, -118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0, -0,10,0,0,109,97,120,0,1,1,0,0,10,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0, -18,95,95,114,101,116,86,97,108,0,0,18,97,0,59,120,121,0,0,18,98,0,0,0,0,1,90,95,0,0,11,0,0,109,97, -120,0,1,1,0,0,11,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101, -116,86,97,108,0,0,18,97,0,59,120,121,122,0,0,18,98,0,0,0,0,1,90,95,0,0,12,0,0,109,97,120,0,1,1,0,0, -12,0,97,0,0,1,1,0,0,9,0,98,0,0,0,1,4,118,101,99,52,95,109,97,120,0,18,95,95,114,101,116,86,97,108, -0,0,18,97,0,0,18,98,0,0,0,0,1,90,95,0,0,9,0,0,99,108,97,109,112,0,1,1,0,0,9,0,118,97,108,0,0,1,1,0, -0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99,108, -97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0,18, -109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97,108,0,0,1, -1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95,99, -108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108,0,0, -18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0,118,97,108,0,0, -1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52,95, -99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97,108, -0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0,0,12,0,118,97,108, -0,0,1,1,0,0,9,0,109,105,110,86,97,108,0,0,1,1,0,0,9,0,109,97,120,86,97,108,0,0,0,1,4,118,101,99,52, -95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110,86,97, -108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,10,0,0,99,108,97,109,112,0,1,1,0,0,10,0,118,97, -108,0,0,1,1,0,0,10,0,109,105,110,86,97,108,0,0,1,1,0,0,10,0,109,97,120,86,97,108,0,0,0,1,4,118,101, -99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109,105,110, -86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,11,0,0,99,108,97,109,112,0,1,1,0,0,11,0, -118,97,108,0,0,1,1,0,0,11,0,109,105,110,86,97,108,0,0,1,1,0,0,11,0,109,97,120,86,97,108,0,0,0,1,4, -118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18,109, -105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,12,0,0,99,108,97,109,112,0,1,1,0, -0,12,0,118,97,108,0,0,1,1,0,0,12,0,109,105,110,86,97,108,0,0,1,1,0,0,12,0,109,97,120,86,97,108,0,0, -0,1,4,118,101,99,52,95,99,108,97,109,112,0,18,95,95,114,101,116,86,97,108,0,0,18,118,97,108,0,0,18, -109,105,110,86,97,108,0,0,18,109,97,120,86,97,108,0,0,0,0,1,90,95,0,0,9,0,0,109,105,120,0,1,1,0,0, -9,0,120,0,0,1,1,0,0,9,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18,95,95, -114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,109,105,120,0,1,1, -0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112,0,18, -95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,11,0,0,109,105,120, -0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108,114,112, -0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,12,0,0,109, -105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,9,0,97,0,0,0,1,4,118,101,99,52,95,108, -114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0, -0,109,105,120,0,1,1,0,0,10,0,120,0,0,1,1,0,0,10,0,121,0,0,1,1,0,0,10,0,97,0,0,0,1,4,118,101,99,52, -95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90,95,0, -0,11,0,0,109,105,120,0,1,1,0,0,11,0,120,0,0,1,1,0,0,11,0,121,0,0,1,1,0,0,11,0,97,0,0,0,1,4,118,101, -99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0,0,0,1,90, -95,0,0,12,0,0,109,105,120,0,1,1,0,0,12,0,120,0,0,1,1,0,0,12,0,121,0,0,1,1,0,0,12,0,97,0,0,0,1,4, -118,101,99,52,95,108,114,112,0,18,95,95,114,101,116,86,97,108,0,0,18,97,0,0,18,121,0,0,18,120,0,0, -0,0,1,90,95,0,0,9,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,9,0,120,0,0,0,1,4, -118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,18,101,100,103,101,0, -0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,10,0,101,100,103,101,0,0,1,1,0,0,10,0,120,0,0,0, -1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,120,0,0,18, -101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116,101,112,0,1,1,0,0,11,0,101,100,103,101,0,0,1,1, -0,0,11,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121, -122,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,12,0, -101,100,103,101,0,0,1,1,0,0,12,0,120,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,120,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,10,0,0,115,116,101,112,0,1,1,0,0,9, -0,101,100,103,101,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90,95,0,0,11,0,0,115,116, -101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101, -0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1,90, -95,0,0,12,0,0,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,18,101,100,103,101,0,0,0,0,1, -90,95,0,0,9,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0, -0,9,0,101,100,103,101,49,0,0,1,1,0,0,9,0,120,0,0,0,1,3,2,90,95,0,0,9,0,1,116,0,2,58,99,108,97,109, -112,0,0,18,120,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49, -0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18, -116,0,48,47,48,0,0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,10,0,101, -100,103,101,48,0,0,1,1,0,0,10,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0, -1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18, -101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51, -0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116, -101,112,0,1,1,0,0,11,0,101,100,103,101,48,0,0,1,1,0,0,11,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118, -0,0,0,1,3,2,90,95,0,0,11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47, -18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8, -18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115, -109,111,111,116,104,115,116,101,112,0,1,1,0,0,12,0,101,100,103,101,48,0,0,1,1,0,0,12,0,101,100,103, -101,49,0,0,1,1,0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0, -18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0, -0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0, -0,1,90,95,0,0,10,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0, -1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,10,0,1,116,0,2,58,99,108, -97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49,0,18,101,100,103,101,48,0, -47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0, -0,18,116,0,48,47,48,0,0,1,90,95,0,0,11,0,0,115,109,111,111,116,104,115,116,101,112,0,1,1,0,0,9,0, -101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90,95,0,0, -11,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0,47,18,101,100,103,101,49, -0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0,8,18,116,0,18,116,0,48, -17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,12,0,0,115,109,111,111,116,104,115, -116,101,112,0,1,1,0,0,9,0,101,100,103,101,48,0,0,1,1,0,0,9,0,101,100,103,101,49,0,0,1,1,0,0,12,0, -118,0,0,0,1,3,2,90,95,0,0,12,0,1,116,0,2,58,99,108,97,109,112,0,0,18,118,0,18,101,100,103,101,48,0, -47,18,101,100,103,101,49,0,18,101,100,103,101,48,0,47,49,0,17,48,0,48,0,0,0,17,49,0,48,0,0,0,0,0,0, -8,18,116,0,18,116,0,48,17,51,0,48,0,0,17,50,0,48,0,0,18,116,0,48,47,48,0,0,1,90,95,0,0,9,0,0,108, -101,110,103,116,104,0,1,1,0,0,9,0,120,0,0,0,1,8,58,97,98,115,0,0,18,120,0,0,0,0,0,1,90,95,0,0,9,0, -0,108,101,110,103,116,104,0,1,1,0,0,10,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9, -0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0, -18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,59, -120,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1,0,0,11,0,118,0,0,0,1,3,2,90, -95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0,18,118,0,0,18,118,0,0,0,0,0, -4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102,108,111,97,116,95,114,99,112,0, -18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0,108,101,110,103,116,104,0,1,1, -0,0,12,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,114,0,0,0,3,2,90,95,1,0,9,0,1,112,0,2,58,100,111,116,0,0, -18,118,0,0,18,118,0,0,0,0,0,4,102,108,111,97,116,95,114,115,113,0,18,114,0,0,18,112,0,0,0,4,102, -108,111,97,116,95,114,99,112,0,18,95,95,114,101,116,86,97,108,0,0,18,114,0,0,0,0,1,90,95,0,0,9,0,0, -100,105,115,116,97,110,99,101,0,1,1,0,0,9,0,120,0,0,1,1,0,0,9,0,121,0,0,0,1,3,2,90,95,1,0,9,0,1, -100,0,2,18,120,0,18,121,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0, -18,100,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,10,0,118,0,0,1,1,0,0, -10,0,117,0,0,0,1,3,2,90,95,1,0,10,0,1,100,50,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116, -86,97,108,0,58,108,101,110,103,116,104,0,0,18,100,50,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115, -116,97,110,99,101,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,3,2,90,95,1,0,11,0,1,100,51,0,2, -18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86,97,108,0,58,108,101,110,103,116,104,0,0,18,100, -51,0,0,0,20,0,0,1,90,95,0,0,9,0,0,100,105,115,116,97,110,99,101,0,1,1,0,0,12,0,118,0,0,1,1,0,0,12, -0,117,0,0,0,1,3,2,90,95,1,0,12,0,1,100,52,0,2,18,118,0,18,117,0,47,0,0,9,18,95,95,114,101,116,86, -97,108,0,58,108,101,110,103,116,104,0,0,18,100,52,0,0,0,20,0,0,1,90,95,0,0,11,0,0,99,114,111,115, -115,0,1,1,0,0,11,0,118,0,0,1,1,0,0,11,0,117,0,0,0,1,4,118,101,99,51,95,99,114,111,115,115,0,18,95, -95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,118,0,0,18,117,0,0,0,0,1,90,95,0,0,9,0,0,102,97, -99,101,102,111,114,119,97,114,100,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,114,101, -102,0,0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3, -2,90,95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0, -0,0,8,58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,10,0,0,102,97,99,101, -102,111,114,119,97,114,100,0,1,1,0,0,10,0,78,0,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,114,101,102,0, -0,0,1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8, -58,109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,11,0,0,102,97,99,101,102, -111,114,119,97,114,100,0,1,1,0,0,11,0,78,0,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,114,101,102,0,0,0, -1,3,2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0, -0,9,0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58, -109,105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,12,0,0,102,97,99,101,102,111, -114,119,97,114,100,0,1,1,0,0,12,0,78,0,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,114,101,102,0,0,0,1,3, -2,90,95,1,0,9,0,1,100,0,2,58,100,111,116,0,0,18,78,114,101,102,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9, -0,1,115,0,0,0,4,118,101,99,52,95,115,103,116,0,18,115,0,0,17,48,0,48,0,0,0,18,100,0,0,0,8,58,109, -105,120,0,0,18,78,0,54,0,18,78,0,0,18,115,0,0,0,0,0,1,90,95,0,0,9,0,0,114,101,102,108,101,99,116,0, -1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18, -73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,10,0,0,114,101,102,108,101,99,116,0,1,1,0,0,10,0,73,0,0, -1,1,0,0,10,0,78,0,0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78, -0,48,47,0,0,1,90,95,0,0,11,0,0,114,101,102,108,101,99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0, -0,0,1,8,18,73,0,17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90, -95,0,0,12,0,0,114,101,102,108,101,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0,78,0,0,0,1,8,18,73,0, -17,50,0,48,0,0,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,48,18,78,0,48,47,0,0,1,90,95,0,0,9,0,0,114, -101,102,114,97,99,116,0,1,1,0,0,9,0,73,0,0,1,1,0,0,9,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2, -90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90, -95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95, -100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,9,0,1,114,101, -116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,17,48,0,48,0,0, -20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111, -116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97, -108,0,0,0,1,90,95,0,0,10,0,0,114,101,102,114,97,99,116,0,1,1,0,0,10,0,73,0,0,1,1,0,0,10,0,78,0,0,1, -1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0, -18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97, -0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0, -3,2,90,95,0,0,10,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116, -118,97,108,0,58,118,101,99,50,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116, -97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0, -0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,11,0,0,114,101,102,114,97, -99,116,0,1,1,0,0,11,0,73,0,0,1,1,0,0,11,0,78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0, -1,110,95,100,111,116,95,105,0,2,58,100,111,116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1, -107,0,2,17,49,0,48,0,0,18,101,116,97,0,18,101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95, -105,0,18,110,95,100,111,116,95,105,0,48,47,48,47,0,0,3,2,90,95,0,0,11,0,1,114,101,116,118,97,108,0, -0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18,114,101,116,118,97,108,0,58,118,101,99,51,0,0,17,48,0,48, -0,0,0,0,20,0,9,18,114,101,116,118,97,108,0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95, -100,111,116,95,105,0,48,58,115,113,114,116,0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116, -118,97,108,0,0,0,1,90,95,0,0,12,0,0,114,101,102,114,97,99,116,0,1,1,0,0,12,0,73,0,0,1,1,0,0,12,0, -78,0,0,1,1,0,0,9,0,101,116,97,0,0,0,1,3,2,90,95,0,0,9,0,1,110,95,100,111,116,95,105,0,2,58,100,111, -116,0,0,18,78,0,0,18,73,0,0,0,0,0,3,2,90,95,0,0,9,0,1,107,0,2,17,49,0,48,0,0,18,101,116,97,0,18, -101,116,97,0,48,17,49,0,48,0,0,18,110,95,100,111,116,95,105,0,18,110,95,100,111,116,95,105,0,48,47, -48,47,0,0,3,2,90,95,0,0,12,0,1,114,101,116,118,97,108,0,0,0,10,18,107,0,17,48,0,48,0,0,40,0,9,18, -114,101,116,118,97,108,0,58,118,101,99,52,0,0,17,48,0,48,0,0,0,0,20,0,9,18,114,101,116,118,97,108, -0,18,101,116,97,0,18,73,0,48,18,101,116,97,0,18,110,95,100,111,116,95,105,0,48,58,115,113,114,116, -0,0,18,107,0,0,0,46,18,78,0,48,47,20,0,8,18,114,101,116,118,97,108,0,0,0,1,90,95,0,0,13,0,0,109,97, -116,114,105,120,67,111,109,112,77,117,108,116,0,1,0,0,0,13,0,109,0,0,1,0,0,0,13,0,110,0,0,0,1,8,58, -109,97,116,50,0,0,18,109,0,16,8,48,0,57,18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0, -16,10,49,0,57,48,0,0,0,0,1,90,95,0,0,14,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108,116,0, -1,0,0,0,14,0,109,0,0,1,0,0,0,14,0,110,0,0,0,1,8,58,109,97,116,51,0,0,18,109,0,16,8,48,0,57,18,110, -0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0,57,18, -110,0,16,10,50,0,57,48,0,0,0,0,1,90,95,0,0,15,0,0,109,97,116,114,105,120,67,111,109,112,77,117,108, -116,0,1,0,0,0,15,0,109,0,0,1,0,0,0,15,0,110,0,0,0,1,8,58,109,97,116,52,0,0,18,109,0,16,8,48,0,57, -18,110,0,16,8,48,0,57,48,0,18,109,0,16,10,49,0,57,18,110,0,16,10,49,0,57,48,0,18,109,0,16,10,50,0, -57,18,110,0,16,10,50,0,57,48,0,18,109,0,16,10,51,0,57,18,110,0,16,10,51,0,57,48,0,0,0,0,1,90,95,0, -0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99, -52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0, -0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4, -118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0, -1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0, -18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0, -118,0,0,0,1,4,118,101,99,52,95,115,108,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118, -0,0,0,0,1,90,95,0,0,2,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1, -1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120, -121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97, -108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114, -101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115, -84,104,97,110,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95, -115,108,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,108, -101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, -101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,108,101,115,115,84,104,97,110,69,113,117,97,108,0,1, -1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,108,101,0,18,95,95,114,101,116,86, -97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84,104,97,110,0, -1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101, -116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101, -114,84,104,97,110,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0, -18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0, -103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101, -99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2, -0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118, -101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,59,120,121,0,0, -18,118,0,59,120,121,0,0,0,0,1,90,95,0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,0,1,1,0,0,7, -0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104, -97,110,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,116,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101,114,84, -104,97,110,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0, -11,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122, -0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113, -117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95, -95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,103,114,101,97,116,101, -114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101,99,52, -95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95, -0,0,3,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0, -7,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0, -0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,103,114,101,97,116,101,114,84,104,97,110,69,113,117, -97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0,1,4,118,101,99,52,95,115,103,101,0,18,95,95,114, -101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,10, -0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108, -0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,11,0,117, -0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,12,0,117, -0,0,1,1,0,0,12,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0, -18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0, -118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18, -117,0,0,18,118,0,0,0,0,1,90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118, -0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,2,0,0,101,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101, -99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,101,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,4,0,0,101,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118,0,0,0,1,4,118,101,99,52, -95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0,0,2,0,0, -110,111,116,69,113,117,97,108,0,1,1,0,0,10,0,117,0,0,1,1,0,0,10,0,118,0,0,0,1,4,118,101,99,52,95, -115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1,90,95,0, -0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,11,0,117,0,0,1,1,0,0,11,0,118,0,0,0,1,4,118,101,99, -52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0,0,0,0, -1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,12,0,117,0,0,1,1,0,0,12,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1,90, -95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,6,0,117,0,0,1,1,0,0,6,0,118,0,0,0,1,4,118,101, -99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,7,0,117,0,0,1,1,0,0,7,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18,118,0, -0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,8,0,117,0,0,1,1,0,0,8,0,118,0,0,0, -1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,2,0,117,0,0,1,1,0,0,2,0,118,0,0,0,1,4,118, -101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,0,0,18,117,0,0,18,118,0,0,0, -0,1,90,95,0,0,3,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,3,0,117,0,0,1,1,0,0,3,0,118,0,0,0,1,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,121,122,0,0,18,117,0,0,18, -118,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,69,113,117,97,108,0,1,1,0,0,4,0,117,0,0,1,1,0,0,4,0,118, -0,0,0,1,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,117,0,0,18,118,0,0, -0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4, -118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0, -0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59, -120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110,121,0,1,1,0,0,3,0,118,0,0,0,1,3,2,90,95,0,0, -9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,118,0,59, -120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115, -117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,59,120,0,0,18,115,117,109,0,59,120,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,110, -121,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,115,117,109,0,0,0,4,118,101,99,52,95,97,100,100, -0,18,115,117,109,0,59,120,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,97,100, -100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,122,0,0,0,4,118,101,99, -52,95,97,100,100,0,18,115,117,109,0,59,120,0,0,18,115,117,109,0,59,120,0,0,18,118,0,59,119,0,0,0,4, -118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,59,120,0,0,18,115,117,109,0,59,120, -0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,2,0,118,0,0,0,1,3,2,90,95,0,0,9,0, -1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0, -0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116, -86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,3, -0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114,111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112, -108,121,0,18,112,114,111,100,0,0,18,118,0,59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109, -117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0, -4,118,101,99,52,95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0, -48,0,0,0,0,0,1,90,95,0,0,1,0,0,97,108,108,0,1,1,0,0,4,0,118,0,0,0,1,3,2,90,95,0,0,9,0,1,112,114, -111,100,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114,111,100,0,0,18,118,0, -59,120,0,0,18,118,0,59,121,0,0,0,4,118,101,99,52,95,109,117,108,116,105,112,108,121,0,18,112,114, -111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,122,0,0,0,4,118,101,99,52,95,109,117,108,116,105, -112,108,121,0,18,112,114,111,100,0,0,18,112,114,111,100,0,0,18,118,0,59,119,0,0,0,4,118,101,99,52, -95,115,110,101,0,18,95,95,114,101,116,86,97,108,0,0,18,112,114,111,100,0,0,17,48,0,48,0,0,0,0,0,1, -90,95,0,0,2,0,0,110,111,116,0,1,1,0,0,2,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95, -114,101,116,86,97,108,0,59,120,121,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,3,0,0,110,111, -116,0,1,1,0,0,3,0,118,0,0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,59, -120,121,122,0,0,18,118,0,0,17,48,0,48,0,0,0,0,0,1,90,95,0,0,4,0,0,110,111,116,0,1,1,0,0,4,0,118,0, -0,0,1,4,118,101,99,52,95,115,101,113,0,18,95,95,114,101,116,86,97,108,0,0,18,118,0,0,17,48,0,48,0, -0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,9,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114,111,106,0,1,1,0,0,16,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,49,100,95,112, -114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111, -114,100,0,59,120,121,121,121,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,49,68,80,114, -111,106,0,1,1,0,0,16,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4, -118,101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18, -115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116, -117,114,101,50,68,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0, -0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101, -50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100, -0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97, -108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0,0,0,1,90, -95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,80,114,111,106,0,1,1,0,0,17,0,115,97,109,112,108, -101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95, -112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111, -111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,0,1,1,0,0,18,0,115,97,109, -112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,51, -100,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0, -0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,51,68,80,114,111,106,0,1,1,0,0,18,0,115,97, -109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95, -51,100,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0, -18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,67,117,98,101,0,1,1,0, -0,19,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95, -116,101,120,95,99,117,98,101,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,0,1,1,0,0,20,0,115, -97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120, -95,49,100,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,49,68,80,114,111, -106,0,1,1,0,0,20,0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118, -101,99,52,95,116,101,120,95,49,100,95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,115,104,97,100,111,119,50,68,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111, -111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,115,104,97,100,111,119,0,18,95,95, -114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95, -0,0,12,0,0,115,104,97,100,111,119,50,68,80,114,111,106,0,1,1,0,0,21,0,115,97,109,112,108,101,114,0, -0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,50,100,95,112,114,111, -106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101,114,0, -0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116, -0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,10,0,99,111,111,114,100,0,0,0,1,4,118,101,99, -52,95,116,101,120,95,114,101,99,116,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109,112,108,101, -114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101, -99,116,80,114,111,106,0,1,1,0,0,22,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114, -100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,59,120,121,122,122,0,0, -0,0,1,90,95,0,0,12,0,0,116,101,120,116,117,114,101,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,22, -0,115,97,109,112,108,101,114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116, -101,120,95,114,101,99,116,95,112,114,111,106,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0,0,115,104,97,100,111,119,50, -68,82,101,99,116,0,1,1,0,0,23,0,115,97,109,112,108,101,114,0,0,1,1,0,0,11,0,99,111,111,114,100,0,0, -0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116,95,115,104,97,100,111,119,0,18,95,95,114,101, -116,86,97,108,0,0,18,115,97,109,112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,12,0, -0,115,104,97,100,111,119,50,68,82,101,99,116,80,114,111,106,0,1,1,0,0,23,0,115,97,109,112,108,101, -114,0,0,1,1,0,0,12,0,99,111,111,114,100,0,0,0,1,4,118,101,99,52,95,116,101,120,95,114,101,99,116, -95,112,114,111,106,95,115,104,97,100,111,119,0,18,95,95,114,101,116,86,97,108,0,0,18,115,97,109, -112,108,101,114,0,0,18,99,111,111,114,100,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0, -0,9,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,49,0,18,95,95,114,101,116,86,97,108, -0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,10,0,120,0,0,0,1,4,102,108, -111,97,116,95,110,111,105,115,101,50,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0, -0,9,0,0,110,111,105,115,101,49,0,1,1,0,0,11,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115, -101,51,0,18,95,95,114,101,116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,9,0,0,110,111,105,115,101, -49,0,1,1,0,0,12,0,120,0,0,0,1,4,102,108,111,97,116,95,110,111,105,115,101,52,0,18,95,95,114,101, -116,86,97,108,0,0,18,120,0,0,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,9,0,120,0,0,0, -1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18, -95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0, -46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114, -101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101, -116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51, -52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0, -11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120, -0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58, -118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,0,46,0,0,20,0,0,1, -90,95,0,0,10,0,0,110,111,105,115,101,50,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0,0,17,55, -0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111, -105,115,101,51,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110,111, -105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111,105, -115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122, -0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, -111,105,115,101,51,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0, -0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118, -101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110, -111,105,115,101,51,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58,110, -111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110,111, -105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51, -0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49, -0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0, -0,0,46,0,0,20,0,0,1,90,95,0,0,11,0,0,110,111,105,115,101,51,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95, -114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53, -0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,0, -1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,9,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97, -108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0, -59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,17,49,57,0,51,52,0,0,46,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,17,53,0,52,55,0,0,46,0,0,20,0, -9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,17,50,51,0,53, -52,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,10,0,120,0,0,0,1,9,18,95, -95,114,101,116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114, -101,116,86,97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,49,57, -0,51,52,0,0,0,17,55,0,54,54,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,50,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,0, -46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58, -118,101,99,50,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,0,46,0,0,20,0,0,1,90,95,0,0,12,0,0, -110,111,105,115,101,52,0,1,1,0,0,11,0,120,0,0,0,1,9,18,95,95,114,101,116,86,97,108,0,59,120,0,58, -110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,121,0,58,110, -111,105,115,101,49,0,0,18,120,0,58,118,101,99,51,0,0,17,49,57,0,51,52,0,0,0,17,55,0,54,54,0,0,0,17, -51,0,50,51,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,122,0,58,110,111,105,115,101, -49,0,0,18,120,0,58,118,101,99,51,0,0,17,53,0,52,55,0,0,0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0, -0,0,0,46,0,0,20,0,9,18,95,95,114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120, -0,58,118,101,99,51,0,0,17,50,51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,0,46,0, -0,20,0,0,1,90,95,0,0,12,0,0,110,111,105,115,101,52,0,1,1,0,0,12,0,120,0,0,0,1,9,18,95,95,114,101, -116,86,97,108,0,59,120,0,58,110,111,105,115,101,49,0,0,18,120,0,0,0,20,0,9,18,95,95,114,101,116,86, -97,108,0,59,121,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,49,57,0,51,52,0,0, -0,17,55,0,54,54,0,0,0,17,51,0,50,51,0,0,0,17,50,0,55,55,0,0,0,0,46,0,0,20,0,9,18,95,95,114,101,116, -86,97,108,0,59,122,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,53,0,52,55,0,0, -0,17,49,55,0,56,53,0,0,0,17,49,49,0,48,52,0,0,0,17,49,51,0,49,57,0,0,0,0,46,0,0,20,0,9,18,95,95, -114,101,116,86,97,108,0,59,119,0,58,110,111,105,115,101,49,0,0,18,120,0,58,118,101,99,52,0,0,17,50, -51,0,53,52,0,0,0,17,50,57,0,49,49,0,0,0,17,51,49,0,57,49,0,0,0,17,51,55,0,52,56,0,0,0,0,46,0,0,20, -0,0,0 -- cgit v1.2.3 From 75f371e973d19650a5c157a0844e43ffdea5e43e Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Sat, 12 Dec 2009 16:58:43 +0100 Subject: Remove grammar module -- no dependencies left. --- Makefile | 1 - src/mesa/Makefile.mgw | 1 - src/mesa/SConscript | 1 - src/mesa/shader/arbprogparse.c | 1 - src/mesa/shader/descrip.mms | 4 +- src/mesa/shader/grammar/grammar.c | 3229 -------------------------------- src/mesa/shader/grammar/grammar.h | 100 - src/mesa/shader/grammar/grammar.syn | 567 ------ src/mesa/shader/grammar/grammar_crt.c | 64 - src/mesa/shader/grammar/grammar_crt.h | 20 - src/mesa/shader/grammar/grammar_mesa.c | 87 - src/mesa/shader/grammar/grammar_mesa.h | 45 - src/mesa/shader/grammar/grammar_syn.h | 202 -- src/mesa/shader/slang/descrip.mms | 2 +- src/mesa/sources.mak | 1 - windows/VC7/mesa/mesa/mesa.vcproj | 43 +- windows/VC8/mesa/mesa/mesa.vcproj | 28 +- 17 files changed, 8 insertions(+), 4388 deletions(-) delete mode 100644 src/mesa/shader/grammar/grammar.c delete mode 100644 src/mesa/shader/grammar/grammar.h delete mode 100644 src/mesa/shader/grammar/grammar.syn delete mode 100644 src/mesa/shader/grammar/grammar_crt.c delete mode 100644 src/mesa/shader/grammar/grammar_crt.h delete mode 100644 src/mesa/shader/grammar/grammar_mesa.c delete mode 100644 src/mesa/shader/grammar/grammar_mesa.h delete mode 100644 src/mesa/shader/grammar/grammar_syn.h diff --git a/Makefile b/Makefile index b63d75a2fce..de303e02c21 100644 --- a/Makefile +++ b/Makefile @@ -244,7 +244,6 @@ MAIN_FILES = \ $(DIRECTORY)/src/mesa/shader/*.[chly] \ $(DIRECTORY)/src/mesa/shader/Makefile \ $(DIRECTORY)/src/mesa/shader/descrip.mms \ - $(DIRECTORY)/src/mesa/shader/grammar/*.[ch] \ $(DIRECTORY)/src/mesa/shader/slang/*.[ch] \ $(DIRECTORY)/src/mesa/shader/slang/descrip.mms \ $(DIRECTORY)/src/mesa/shader/slang/library/*.[ch] \ diff --git a/src/mesa/Makefile.mgw b/src/mesa/Makefile.mgw index 097c390a83e..e894c6277d1 100644 --- a/src/mesa/Makefile.mgw +++ b/src/mesa/Makefile.mgw @@ -218,7 +218,6 @@ clean: -$(call UNLINK,vbo/*.o) -$(call UNLINK,shader/*.o) -$(call UNLINK,shader/slang/*.o) - -$(call UNLINK,shader/grammar/*.o) -$(call UNLINK,sparc/*.o) -$(call UNLINK,ppc/*.o) -$(call UNLINK,swrast/*.o) diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 1f16a01e1a9..f4e0b98570d 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -189,7 +189,6 @@ if env['platform'] != 'winddk': 'shader/arbprogparse.c', 'shader/arbprogram.c', 'shader/atifragshader.c', - 'shader/grammar/grammar_mesa.c', 'shader/hash_table.c', 'shader/lex.yy.c', 'shader/nvfragparse.c', diff --git a/src/mesa/shader/arbprogparse.c b/src/mesa/shader/arbprogparse.c index dd732b6666b..a09be71020e 100644 --- a/src/mesa/shader/arbprogparse.c +++ b/src/mesa/shader/arbprogparse.c @@ -56,7 +56,6 @@ having three separate program parameter arrays. #include "main/context.h" #include "main/macros.h" #include "main/mtypes.h" -#include "shader/grammar/grammar_mesa.h" #include "arbprogparse.h" #include "program.h" #include "programopt.h" diff --git a/src/mesa/shader/descrip.mms b/src/mesa/shader/descrip.mms index 19bafd48302..59730020d0c 100644 --- a/src/mesa/shader/descrip.mms +++ b/src/mesa/shader/descrip.mms @@ -16,7 +16,7 @@ VPATH = RCS -INCDIR = [---.include],[.grammar],[-.main],[-.glapi],[.slang] +INCDIR = [---.include],[-.main],[-.glapi],[.slang] LIBDIR = [---.lib] CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1,"__extension__=")/name=(as_is,short)/float=ieee/ieee=denorm @@ -64,8 +64,6 @@ all : $(MMS)$(MMSQUALIFIERS) $(LIBDIR)$(GL_LIB) set def [.slang] $(MMS)$(MMSQUALIFIERS) - set def [-.grammar] - $(MMS)$(MMSQUALIFIERS) set def [-] # Make the library diff --git a/src/mesa/shader/grammar/grammar.c b/src/mesa/shader/grammar/grammar.c deleted file mode 100644 index b83920a089b..00000000000 --- a/src/mesa/shader/grammar/grammar.c +++ /dev/null @@ -1,3229 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.6 - * - * Copyright (C) 1999-2006 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file grammar.c - * syntax parsing engine - * \author Michal Krol - */ - -#ifndef GRAMMAR_PORT_BUILD -#error Do not build this file directly, build your grammar_XXX.c instead, which includes this file -#endif - -/* -*/ - -/* - INTRODUCTION - ------------ - - The task is to check the syntax of an input string. Input string is a stream of ASCII - characters terminated with a null-character ('\0'). Checking it using C language is - difficult and hard to implement without bugs. It is hard to maintain and make changes when - the syntax changes. - - This is because of a high redundancy of the C code. Large blocks of code are duplicated with - only small changes. Even use of macros does not solve the problem because macros cannot - erase the complexity of the problem. - - The resolution is to create a new language that will be highly oriented to our task. Once - we describe a particular syntax, we are done. We can then focus on the code that implements - the language. The size and complexity of it is relatively small than the code that directly - checks the syntax. - - First, we must implement our new language. Here, the language is implemented in C, but it - could also be implemented in any other language. The code is listed below. We must take - a good care that it is bug free. This is simple because the code is simple and clean. - - Next, we must describe the syntax of our new language in itself. Once created and checked - manually that it is correct, we can use it to check another scripts. - - Note that our new language loading code does not have to check the syntax. It is because we - assume that the script describing itself is correct, and other scripts can be syntactically - checked by the former script. The loading code must only do semantic checking which leads us to - simple resolving references. - - THE LANGUAGE - ------------ - - Here I will describe the syntax of the new language (further called "Synek"). It is mainly a - sequence of declarations terminated by a semicolon. The declaration consists of a symbol, - which is an identifier, and its definition. A definition is in turn a sequence of specifiers - connected with ".and" or ".or" operator. These operators cannot be mixed together in a one - definition. Specifier can be a symbol, string, character, character range or a special - keyword ".true" or ".false". - - On the very beginning of the script there is a declaration of a root symbol and is in the form: - .syntax ; - The must be on of the symbols in declaration sequence. The syntax is correct if - the root symbol evaluates to true. A symbol evaluates to true if the definition associated with - the symbol evaluates to true. Definition evaluation depends on the operator used to connect - specifiers in the definition. If ".and" operator is used, definition evaluates to true if and - only if all the specifiers evaluate to true. If ".or" operator is used, definition evalutes to - true if any of the specifiers evaluates to true. If definition contains only one specifier, - it is evaluated as if it was connected with ".true" keyword by ".and" operator. - - If specifier is a ".true" keyword, it always evaluates to true. - - If specifier is a ".false" keyword, it always evaluates to false. Specifier evaluates to false - when it does not evaluate to true. - - Character range specifier is in the form: - '' - '' - If specifier is a character range, it evaluates to true if character in the stream is greater - or equal to and less or equal to . In that situation - the stream pointer is advanced to point to next character in the stream. All C-style escape - sequences are supported although trigraph sequences are not. The comparisions are performed - on 8-bit unsigned integers. - - Character specifier is in the form: - '' - It evaluates to true if the following character range specifier evaluates to true: - '' - '' - - String specifier is in the form: - "" - Let N be the number of characters in . Let [i] designate i-th character in - . Then the string specifier evaluates to true if and only if for i in the range [0, N) - the following character specifier evaluates to true: - '[i]' - If [i] is a quotation mark, '[i]' is replaced with '\[i]'. - - Symbol specifier can be optionally preceded by a ".loop" keyword in the form: - .loop (1) - where is defined as follows: - ; (2) - Construction (1) is replaced by the following code: - - and declaration (2) is replaced by the following: - .or .true; - .and ; - ; - - Synek supports also a register mechanizm. User can, in its SYN file, declare a number of - registers that can be accessed in the syn body. Each reg has its name and a default value. - The register is one byte wide. The C code can change the default value by calling - grammar_set_reg8() with grammar id, register name and a new value. As we know, each rule is - a sequence of specifiers joined with .and or .or operator. And now each specifier can be - prefixed with a condition expression in a form ".if ( )" - where can be == or !=. If the condition evaluates to false, the specifier - evaluates to .false. Otherwise it evalutes to the specifier. - - ESCAPE SEQUENCES - ---------------- - - Synek supports all escape sequences in character specifiers. The mapping table is listed below. - All occurences of the characters in the first column are replaced with the corresponding - character in the second column. - - Escape sequence Represents - ------------------------------------------------------------------------------------------------ - \a Bell (alert) - \b Backspace - \f Formfeed - \n New line - \r Carriage return - \t Horizontal tab - \v Vertical tab - \' Single quotation mark - \" Double quotation mark - \\ Backslash - \? Literal question mark - \ooo ASCII character in octal notation - \xhhh ASCII character in hexadecimal notation - ------------------------------------------------------------------------------------------------ - - RAISING ERRORS - -------------- - - Any specifier can be followed by a special construction that is executed when the specifier - evaluates to false. The construction is in the form: - .error - is an identifier declared earlier by error text declaration. The declaration is - in the form: - .errtext "" - When specifier evaluates to false and this construction is present, parsing is stopped - immediately and is returned as a result of parsing. The error position is also - returned and it is meant as an offset from the beggining of the stream to the character that - was valid so far. Example: - - (**** syntax script ****) - - .syntax program; - .errtext MISSING_SEMICOLON "missing ';'" - program declaration .and .loop space .and ';' .error MISSING_SEMICOLON .and - .loop space .and '\0'; - declaration "declare" .and .loop space .and identifier; - space ' '; - - (**** sample code ****) - - declare foo , - - In the example above checking the sample code will result in error message "missing ';'" and - error position 12. The sample code is not correct. Note the presence of '\0' specifier to - assure that there is no code after semicolon - only spaces. - can optionally contain identifier surrounded by dollar signs $. In such a case, - the identifier and dollar signs are replaced by a string retrieved by invoking symbol with - the identifier name. The starting position is the error position. The lenght of the resulting - string is the position after invoking the symbol. - - PRODUCTION - ---------- - - Synek not only checks the syntax but it can also produce (emit) bytes associated with specifiers - that evaluate to true. That is, every specifier and optional error construction can be followed - by a number of emit constructions that are in the form: - .emit - can be a HEX number, identifier, a star * or a dollar $. HEX number is preceded by - 0x or 0X. If is an identifier, it must be earlier declared by emit code declaration - in the form: - .emtcode - - When given specifier evaluates to true, all emits associated with the specifier are output - in order they were declared. A star means that last-read character should be output instead - of constant value. Example: - - (**** syntax script ****) - - .syntax foobar; - .emtcode WORD_FOO 0x01 - .emtcode WORD_BAR 0x02 - foobar FOO .emit WORD_FOO .or BAR .emit WORD_BAR .or .true .emit 0x00; - FOO "foo" .and SPACE; - BAR "bar" .and SPACE; - SPACE ' ' .or '\0'; - - (**** sample text 1 ****) - - foo - - (**** sample text 2 ****) - - foobar - - For both samples the result will be one-element array. For first sample text it will be - value 1, for second - 0. Note that every text will be accepted because of presence of - .true as an alternative. - - Another example: - - (**** syntax script ****) - - .syntax declaration; - .emtcode VARIABLE 0x01 - declaration "declare" .and .loop space .and - identifier .emit VARIABLE .and (1) - .true .emit 0x00 .and (2) - .loop space .and ';'; - space ' ' .or '\t'; - identifier .loop id_char .emit *; (3) - id_char 'a'-'z' .or 'A'-'Z' .or '_'; - - (**** sample code ****) - - declare fubar; - - In specifier (1) symbol is followed by .emit VARIABLE. If it evaluates to - true, VARIABLE constant and then production of the symbol is output. Specifier (2) is used - to terminate the string with null to signal when the string ends. Specifier (3) outputs - all characters that make declared identifier. The result of sample code will be the - following array: - { 1, 'f', 'u', 'b', 'a', 'r', 0 } - - If .emit is followed by dollar $, it means that current position should be output. Current - position is a 32-bit unsigned integer distance from the very beginning of the parsed string to - first character consumed by the specifier associated with the .emit instruction. Current - position is stored in the output buffer in Little-Endian convention (the lowest byte comes - first). -*/ - -#include - -static void mem_free (void **); - -/* - internal error messages -*/ -static const byte *OUT_OF_MEMORY = (byte *) "internal error 1001: out of physical memory"; -static const byte *UNRESOLVED_REFERENCE = (byte *) "internal error 1002: unresolved reference '$'"; -static const byte *INVALID_GRAMMAR_ID = (byte *) "internal error 1003: invalid grammar object"; -static const byte *INVALID_REGISTER_NAME = (byte *) "internal error 1004: invalid register name: '$'"; -/*static const byte *DUPLICATE_IDENTIFIER = (byte *) "internal error 1005: identifier '$' already defined";*/ -static const byte *UNREFERENCED_IDENTIFIER =(byte *) "internal error 1006: unreferenced identifier '$'"; - -static const byte *error_message = NULL; /* points to one of the error messages above */ -static byte *error_param = NULL; /* this is inserted into error_message in place of $ */ -static int error_position = -1; - -static byte *unknown = (byte *) "???"; - -static void clear_last_error (void) -{ - /* reset error message */ - error_message = NULL; - - /* free error parameter - if error_param is a "???" don't free it - it's static */ - if (error_param != unknown) - mem_free ((void **) (void *) &error_param); - else - error_param = NULL; - - /* reset error position */ - error_position = -1; -} - -static void set_last_error (const byte *msg, byte *param, int pos) -{ - /* error message can be set only once */ - if (error_message != NULL) - { - mem_free ((void **) (void *) ¶m); - return; - } - - error_message = msg; - - /* if param is NULL, set error_param to unknown ("???") */ - /* note: do not try to strdup the "???" - it may be that we are here because of */ - /* out of memory error so strdup can fail */ - if (param != NULL) - error_param = param; - else - error_param = unknown; - - error_position = pos; -} - -/* - memory management routines -*/ -static void *mem_alloc (size_t size) -{ - void *ptr = grammar_alloc_malloc (size); - if (ptr == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return ptr; -} - -static void *mem_copy (void *dst, const void *src, size_t size) -{ - return grammar_memory_copy (dst, src, size); -} - -static void mem_free (void **ptr) -{ - grammar_alloc_free (*ptr); - *ptr = NULL; -} - -static void *mem_realloc (void *ptr, size_t old_size, size_t new_size) -{ - void *ptr2 = grammar_alloc_realloc (ptr, old_size, new_size); - if (ptr2 == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return ptr2; -} - -static byte *str_copy_n (byte *dst, const byte *src, size_t max_len) -{ - return grammar_string_copy_n (dst, src, max_len); -} - -static byte *str_duplicate (const byte *str) -{ - byte *new_str = grammar_string_duplicate (str); - if (new_str == NULL) - set_last_error (OUT_OF_MEMORY, NULL, -1); - return new_str; -} - -static int str_equal (const byte *str1, const byte *str2) -{ - return grammar_string_compare (str1, str2) == 0; -} - -static int str_equal_n (const byte *str1, const byte *str2, unsigned int n) -{ - return grammar_string_compare_n (str1, str2, n) == 0; -} - -static int -str_length (const byte *str) -{ - return (int) (grammar_string_length (str)); -} - -/* - useful macros -*/ -#define GRAMMAR_IMPLEMENT_LIST_APPEND(_Ty)\ - static void _Ty##_append (_Ty **x, _Ty *nx) {\ - while (*x) x = &(**x).next;\ - *x = nx;\ - } - -/* - string to byte map typedef -*/ -typedef struct map_byte_ -{ - byte *key; - byte data; - struct map_byte_ *next; -} map_byte; - -static void map_byte_create (map_byte **ma) -{ - *ma = (map_byte *) mem_alloc (sizeof (map_byte)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = '\0'; - (**ma).next = NULL; - } -} - -static void map_byte_destroy (map_byte **ma) -{ - if (*ma) - { - map_byte_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_byte) - -/* - searches the map for the specified key, - returns pointer to the element with the specified key if it exists - returns NULL otherwise -*/ -static map_byte *map_byte_locate (map_byte **ma, const byte *key) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - return *ma; - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return NULL; -} - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the key is matched, - returns 1 otherwise -*/ -static int map_byte_find (map_byte **ma, const byte *key, byte *data) -{ - map_byte *found = map_byte_locate (ma, key); - if (found != NULL) - { - *data = found->data; - - return 0; - } - - return 1; -} - -/* - regbyte context typedef - - Each regbyte consists of its name and a default value. These are static and created at - grammar script compile-time, for example the following line: - .regbyte vertex_blend 0x00 - adds a new regbyte named "vertex_blend" to the static list and initializes it to 0. - When the script is executed, this regbyte can be accessed by name for read and write. When a - particular regbyte is written, a new regbyte_ctx entry is added to the top of the regbyte_ctx - stack. The new entry contains information abot which regbyte it references and its new value. - When a given regbyte is accessed for read, the stack is searched top-down to find an - entry that references the regbyte. The first matching entry is used to return the current - value it holds. If no entry is found, the default value is returned. -*/ -typedef struct regbyte_ctx_ -{ - map_byte *m_regbyte; - byte m_current_value; - struct regbyte_ctx_ *m_prev; -} regbyte_ctx; - -static void regbyte_ctx_create (regbyte_ctx **re) -{ - *re = (regbyte_ctx *) mem_alloc (sizeof (regbyte_ctx)); - if (*re) - { - (**re).m_regbyte = NULL; - (**re).m_prev = NULL; - } -} - -static void regbyte_ctx_destroy (regbyte_ctx **re) -{ - if (*re) - { - mem_free ((void **) re); - } -} - -static byte regbyte_ctx_extract (regbyte_ctx **re, map_byte *reg) -{ - /* first lookup in the register stack */ - while (*re != NULL) - { - if ((**re).m_regbyte == reg) - return (**re).m_current_value; - - re = &(**re).m_prev; - } - - /* if not found - return the default value */ - return reg->data; -} - -/* - emit type typedef -*/ -typedef enum emit_type_ -{ - et_byte, /* explicit number */ - et_stream, /* eaten character */ - et_position /* current position */ -} emit_type; - -/* - emit destination typedef -*/ -typedef enum emit_dest_ -{ - ed_output, /* write to the output buffer */ - ed_regbyte /* write a particular regbyte */ -} emit_dest; - -/* - emit typedef -*/ -typedef struct emit_ -{ - emit_dest m_emit_dest; - emit_type m_emit_type; /* ed_output */ - byte m_byte; /* et_byte */ - map_byte *m_regbyte; /* ed_regbyte */ - byte *m_regname; /* ed_regbyte - temporary */ - struct emit_ *m_next; -} emit; - -static void emit_create (emit **em) -{ - *em = (emit *) mem_alloc (sizeof (emit)); - if (*em) - { - (**em).m_emit_dest = ed_output; - (**em).m_emit_type = et_byte; - (**em).m_byte = '\0'; - (**em).m_regbyte = NULL; - (**em).m_regname = NULL; - (**em).m_next = NULL; - } -} - -static void emit_destroy (emit **em) -{ - if (*em) - { - emit_destroy (&(**em).m_next); - mem_free ((void **) &(**em).m_regname); - mem_free ((void **) em); - } -} - -static unsigned int emit_size (emit *_E, const char *str) -{ - unsigned int n = 0; - - while (_E != NULL) - { - if (_E->m_emit_dest == ed_output) - { - if (_E->m_emit_type == et_position) - n += 4; /* position is a 32-bit unsigned integer */ - else if (_E->m_emit_type == et_stream) { - n += strlen(str) + 1; - } else - n++; - } - _E = _E->m_next; - } - - return n; -} - -static int emit_push (emit *_E, byte *_P, const char *str, unsigned int _Pos, regbyte_ctx **_Ctx) -{ - while (_E != NULL) - { - if (_E->m_emit_dest == ed_output) - { - if (_E->m_emit_type == et_byte) - *_P++ = _E->m_byte; - else if (_E->m_emit_type == et_stream) { - strcpy(_P, str); - _P += strlen(str) + 1; - } else /* _Em->type == et_position */ - { - *_P++ = (byte) (_Pos); - *_P++ = (byte) (_Pos >> 8); - *_P++ = (byte) (_Pos >> 16); - *_P++ = (byte) (_Pos >> 24); - } - } - else - { - regbyte_ctx *new_rbc; - regbyte_ctx_create (&new_rbc); - if (new_rbc == NULL) - return 1; - - new_rbc->m_prev = *_Ctx; - new_rbc->m_regbyte = _E->m_regbyte; - *_Ctx = new_rbc; - - if (_E->m_emit_type == et_byte) - new_rbc->m_current_value = _E->m_byte; - else if (_E->m_emit_type == et_stream) - new_rbc->m_current_value = str[0]; - } - - _E = _E->m_next; - } - - return 0; -} - -/* - error typedef -*/ -typedef struct error_ -{ - byte *m_text; - byte *m_token_name; - struct rule_ *m_token; -} error; - -static void error_create (error **er) -{ - *er = (error *) mem_alloc (sizeof (error)); - if (*er) - { - (**er).m_text = NULL; - (**er).m_token_name = NULL; - (**er).m_token = NULL; - } -} - -static void error_destroy (error **er) -{ - if (*er) - { - mem_free ((void **) &(**er).m_text); - mem_free ((void **) &(**er).m_token_name); - mem_free ((void **) er); - } -} - -struct dict_; - -static byte * -error_get_token (error *, struct dict_ *, const byte *, int); - -/* - condition operand type typedef -*/ -typedef enum cond_oper_type_ -{ - cot_byte, /* constant 8-bit unsigned integer */ - cot_regbyte /* pointer to byte register containing the current value */ -} cond_oper_type; - -/* - condition operand typedef -*/ -typedef struct cond_oper_ -{ - cond_oper_type m_type; - byte m_byte; /* cot_byte */ - map_byte *m_regbyte; /* cot_regbyte */ - byte *m_regname; /* cot_regbyte - temporary */ -} cond_oper; - -/* - condition type typedef -*/ -typedef enum cond_type_ -{ - ct_equal, - ct_not_equal -} cond_type; - -/* - condition typedef -*/ -typedef struct cond_ -{ - cond_type m_type; - cond_oper m_operands[2]; -} cond; - -static void cond_create (cond **co) -{ - *co = (cond *) mem_alloc (sizeof (cond)); - if (*co) - { - (**co).m_operands[0].m_regname = NULL; - (**co).m_operands[1].m_regname = NULL; - } -} - -static void cond_destroy (cond **co) -{ - if (*co) - { - mem_free ((void **) &(**co).m_operands[0].m_regname); - mem_free ((void **) &(**co).m_operands[1].m_regname); - mem_free ((void **) co); - } -} - -/* - specifier type typedef -*/ -typedef enum spec_type_ -{ - st_false, - st_true, - st_token, - st_byte, - st_byte_range, - st_string, - st_identifier, - st_identifier_loop, - st_debug -} spec_type; - -/* - specifier typedef -*/ -typedef struct spec_ -{ - spec_type m_spec_type; - enum sl_pp_token m_token; /* st_token */ - byte m_byte[2]; /* st_byte, st_byte_range */ - byte *m_string; /* st_string */ - struct rule_ *m_rule; /* st_identifier, st_identifier_loop */ - emit *m_emits; - error *m_errtext; - cond *m_cond; - struct spec_ *next; -} spec; - -static void spec_create (spec **sp) -{ - *sp = (spec *) mem_alloc (sizeof (spec)); - if (*sp) - { - (**sp).m_spec_type = st_false; - (**sp).m_byte[0] = '\0'; - (**sp).m_byte[1] = '\0'; - (**sp).m_string = NULL; - (**sp).m_rule = NULL; - (**sp).m_emits = NULL; - (**sp).m_errtext = NULL; - (**sp).m_cond = NULL; - (**sp).next = NULL; - } -} - -static void spec_destroy (spec **sp) -{ - if (*sp) - { - spec_destroy (&(**sp).next); - emit_destroy (&(**sp).m_emits); - error_destroy (&(**sp).m_errtext); - mem_free ((void **) &(**sp).m_string); - cond_destroy (&(**sp).m_cond); - mem_free ((void **) sp); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(spec) - -/* - operator typedef -*/ -typedef enum oper_ -{ - op_none, - op_and, - op_or -} oper; - -/* - rule typedef -*/ -typedef struct rule_ -{ - oper m_oper; - spec *m_specs; - struct rule_ *next; - int m_referenced; -} rule; - -static void rule_create (rule **ru) -{ - *ru = (rule *) mem_alloc (sizeof (rule)); - if (*ru) - { - (**ru).m_oper = op_none; - (**ru).m_specs = NULL; - (**ru).next = NULL; - (**ru).m_referenced = 0; - } -} - -static void rule_destroy (rule **ru) -{ - if (*ru) - { - rule_destroy (&(**ru).next); - spec_destroy (&(**ru).m_specs); - mem_free ((void **) ru); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(rule) - -/* - returns unique grammar id -*/ -static grammar next_valid_grammar_id (void) -{ - static grammar id = 0; - - return ++id; -} - -/* - dictionary typedef -*/ -typedef struct dict_ -{ - rule *m_rulez; - rule *m_syntax; - rule *m_string; - map_byte *m_regbytes; - grammar m_id; - struct dict_ *next; -} dict; - -static void dict_create (dict **di) -{ - *di = (dict *) mem_alloc (sizeof (dict)); - if (*di) - { - (**di).m_rulez = NULL; - (**di).m_syntax = NULL; - (**di).m_string = NULL; - (**di).m_regbytes = NULL; - (**di).m_id = next_valid_grammar_id (); - (**di).next = NULL; - } -} - -static void dict_destroy (dict **di) -{ - if (*di) - { - rule_destroy (&(**di).m_rulez); - map_byte_destroy (&(**di).m_regbytes); - mem_free ((void **) di); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(dict) - -static void dict_find (dict **di, grammar key, dict **data) -{ - while (*di) - { - if ((**di).m_id == key) - { - *data = *di; - return; - } - - di = &(**di).next; - } - - *data = NULL; -} - -static dict *g_dicts = NULL; - -/* - byte array typedef -*/ -typedef struct barray_ -{ - byte *data; - unsigned int len; -} barray; - -static void barray_create (barray **ba) -{ - *ba = (barray *) mem_alloc (sizeof (barray)); - if (*ba) - { - (**ba).data = NULL; - (**ba).len = 0; - } -} - -static void barray_destroy (barray **ba) -{ - if (*ba) - { - mem_free ((void **) &(**ba).data); - mem_free ((void **) ba); - } -} - -/* - reallocates byte array to requested size, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_resize (barray **ba, unsigned int nlen) -{ - byte *new_pointer; - - if (nlen == 0) - { - mem_free ((void **) &(**ba).data); - (**ba).data = NULL; - (**ba).len = 0; - - return 0; - } - else - { - new_pointer = (byte *) mem_realloc ((**ba).data, (**ba).len * sizeof (byte), - nlen * sizeof (byte)); - if (new_pointer) - { - (**ba).data = new_pointer; - (**ba).len = nlen; - - return 0; - } - } - - return 1; -} - -/* - adds byte array pointed by *nb to the end of array pointed by *ba, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_append (barray **ba, barray **nb) -{ - const unsigned int len = (**ba).len; - - if (barray_resize (ba, (**ba).len + (**nb).len)) - return 1; - - mem_copy ((**ba).data + len, (**nb).data, (**nb).len); - - return 0; -} - -/* - adds emit chain pointed by em to the end of array pointed by *ba, - returns 0 on success, - returns 1 otherwise -*/ -static int barray_push (barray **ba, emit *em, byte c, unsigned int pos, regbyte_ctx **rbc) -{ - unsigned int count = emit_size(em, " "); - - if (barray_resize (ba, (**ba).len + count)) - return 1; - - return emit_push (em, (**ba).data + ((**ba).len - count), " ", pos, rbc); -} - -/* - byte pool typedef -*/ -typedef struct bytepool_ -{ - byte *_F; - unsigned int _Siz; -} bytepool; - -static void bytepool_destroy (bytepool **by) -{ - if (*by != NULL) - { - mem_free ((void **) &(**by)._F); - mem_free ((void **) by); - } -} - -static void bytepool_create (bytepool **by, int len) -{ - *by = (bytepool *) (mem_alloc (sizeof (bytepool))); - if (*by != NULL) - { - (**by)._F = (byte *) (mem_alloc (sizeof (byte) * len)); - (**by)._Siz = len; - - if ((**by)._F == NULL) - bytepool_destroy (by); - } -} - -static int bytepool_reserve (bytepool *by, unsigned int n) -{ - byte *_P; - - if (n <= by->_Siz) - return 0; - - /* byte pool can only grow and at least by doubling its size */ - n = n >= by->_Siz * 2 ? n : by->_Siz * 2; - - /* reallocate the memory and adjust pointers to the new memory location */ - _P = (byte *) (mem_realloc (by->_F, sizeof (byte) * by->_Siz, sizeof (byte) * n)); - if (_P != NULL) - { - by->_F = _P; - by->_Siz = n; - return 0; - } - - return 1; -} - -/* - string to string map typedef -*/ -typedef struct map_str_ -{ - byte *key; - byte *data; - struct map_str_ *next; -} map_str; - -static void map_str_create (map_str **ma) -{ - *ma = (map_str *) mem_alloc (sizeof (map_str)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = NULL; - (**ma).next = NULL; - } -} - -static void map_str_destroy (map_str **ma) -{ - if (*ma) - { - map_str_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) &(**ma).data); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_str) - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the key is matched, - returns 1 otherwise -*/ -static int map_str_find (map_str **ma, const byte *key, byte **data) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - { - *data = str_duplicate ((**ma).data); - if (*data == NULL) - return 1; - - return 0; - } - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return 1; -} - -/* - string to rule map typedef -*/ -typedef struct map_rule_ -{ - byte *key; - rule *data; - struct map_rule_ *next; -} map_rule; - -static void map_rule_create (map_rule **ma) -{ - *ma = (map_rule *) mem_alloc (sizeof (map_rule)); - if (*ma) - { - (**ma).key = NULL; - (**ma).data = NULL; - (**ma).next = NULL; - } -} - -static void map_rule_destroy (map_rule **ma) -{ - if (*ma) - { - map_rule_destroy (&(**ma).next); - mem_free ((void **) &(**ma).key); - mem_free ((void **) ma); - } -} - -GRAMMAR_IMPLEMENT_LIST_APPEND(map_rule) - -/* - searches the map for specified key, - if the key is matched, *data is filled with data associated with the key, - returns 0 if the is matched, - returns 1 otherwise -*/ -static int map_rule_find (map_rule **ma, const byte *key, rule **data) -{ - while (*ma) - { - if (str_equal ((**ma).key, key)) - { - *data = (**ma).data; - - return 0; - } - - ma = &(**ma).next; - } - - set_last_error (UNRESOLVED_REFERENCE, str_duplicate (key), -1); - return 1; -} - -/* - returns 1 if given character is a white space, - returns 0 otherwise -*/ -static int is_space (byte c) -{ - return c == ' ' || c == '\t' || c == '\n' || c == '\r'; -} - -/* - advances text pointer by 1 if character pointed by *text is a space, - returns 1 if a space has been eaten, - returns 0 otherwise -*/ -static int eat_space (const byte **text) -{ - if (is_space (**text)) - { - (*text)++; - - return 1; - } - - return 0; -} - -/* - returns 1 if text points to C-style comment start string, - returns 0 otherwise -*/ -static int is_comment_start (const byte *text) -{ - return text[0] == '/' && text[1] == '*'; -} - -/* - advances text pointer to first character after C-style comment block - if any, - returns 1 if C-style comment block has been encountered and eaten, - returns 0 otherwise -*/ -static int eat_comment (const byte **text) -{ - if (is_comment_start (*text)) - { - /* *text points to comment block - skip two characters to enter comment body */ - *text += 2; - /* skip any character except consecutive '*' and '/' */ - while (!((*text)[0] == '*' && (*text)[1] == '/')) - (*text)++; - /* skip those two terminating characters */ - *text += 2; - - return 1; - } - - return 0; -} - -/* - advances text pointer to first character that is neither space nor C-style comment block -*/ -static void eat_spaces (const byte **text) -{ - while (eat_space (text) || eat_comment (text)) - ; -} - -/* - resizes string pointed by *ptr to successfully add character c to the end of the string, - returns 0 on success, - returns 1 otherwise -*/ -static int string_grow (byte **ptr, unsigned int *len, byte c) -{ - /* reallocate the string in 16-byte increments */ - if ((*len & 0x0F) == 0x0F || *ptr == NULL) - { - byte *tmp = (byte *) mem_realloc (*ptr, ((*len + 1) & ~0x0F) * sizeof (byte), - ((*len + 1 + 0x10) & ~0x0F) * sizeof (byte)); - if (tmp == NULL) - return 1; - - *ptr = tmp; - } - - if (c) - { - /* append given character */ - (*ptr)[*len] = c; - (*len)++; - } - (*ptr)[*len] = '\0'; - - return 0; -} - -/* - returns 1 if given character is a valid identifier character a-z, A-Z, 0-9 or _ - returns 0 otherwise -*/ -static int is_identifier (byte c) -{ - return (c >= 'a' && c <= 'z') || (c >= 'A' && c <= 'Z') || (c >= '0' && c <= '9') || c == '_'; -} - -/* - copies characters from *text to *id until non-identifier character is encountered, - assumes that *id points to NULL object - caller is responsible for later freeing the string, - text pointer is advanced to point past the copied identifier, - returns 0 if identifier was successfully copied, - returns 1 otherwise -*/ -static int get_identifier (const byte **text, byte **id) -{ - const byte *t = *text; - byte *p = NULL; - unsigned int len = 0; - - if (string_grow (&p, &len, '\0')) - return 1; - - /* loop while next character in buffer is valid for identifiers */ - while (is_identifier (*t)) - { - if (string_grow (&p, &len, *t++)) - { - mem_free ((void **) (void *) &p); - return 1; - } - } - - *text = t; - *id = p; - - return 0; -} - -/* - converts sequence of DEC digits pointed by *text until non-DEC digit is encountered, - advances text pointer past the converted sequence, - returns the converted value -*/ -static unsigned int dec_convert (const byte **text) -{ - unsigned int value = 0; - - while (**text >= '0' && **text <= '9') - { - value = value * 10 + **text - '0'; - (*text)++; - } - - return value; -} - -/* - returns 1 if given character is HEX digit 0-9, A-F or a-f, - returns 0 otherwise -*/ -static int is_hex (byte c) -{ - return (c >= '0' && c <= '9') || (c >= 'A' && c <= 'F') || (c >= 'a' && c <= 'f'); -} - -/* - returns value of passed character as if it was HEX digit -*/ -static unsigned int hex2dec (byte c) -{ - if (c >= '0' && c <= '9') - return c - '0'; - if (c >= 'A' && c <= 'F') - return c - 'A' + 10; - return c - 'a' + 10; -} - -/* - converts sequence of HEX digits pointed by *text until non-HEX digit is encountered, - advances text pointer past the converted sequence, - returns the converted value -*/ -static unsigned int hex_convert (const byte **text) -{ - unsigned int value = 0; - - while (is_hex (**text)) - { - value = value * 0x10 + hex2dec (**text); - (*text)++; - } - - return value; -} - -/* - returns 1 if given character is OCT digit 0-7, - returns 0 otherwise -*/ -static int is_oct (byte c) -{ - return c >= '0' && c <= '7'; -} - -/* - returns value of passed character as if it was OCT digit -*/ -static int oct2dec (byte c) -{ - return c - '0'; -} - -static byte get_escape_sequence (const byte **text) -{ - int value = 0; - - /* skip '\' character */ - (*text)++; - - switch (*(*text)++) - { - case '\'': - return '\''; - case '"': - return '\"'; - case '?': - return '\?'; - case '\\': - return '\\'; - case 'a': - return '\a'; - case 'b': - return '\b'; - case 'f': - return '\f'; - case 'n': - return '\n'; - case 'r': - return '\r'; - case 't': - return '\t'; - case 'v': - return '\v'; - case 'x': - return (byte) hex_convert (text); - } - - (*text)--; - if (is_oct (**text)) - { - value = oct2dec (*(*text)++); - if (is_oct (**text)) - { - value = value * 010 + oct2dec (*(*text)++); - if (is_oct (**text)) - value = value * 010 + oct2dec (*(*text)++); - } - } - - return (byte) value; -} - -/* - copies characters from *text to *str until " or ' character is encountered, - assumes that *str points to NULL object - caller is responsible for later freeing the string, - assumes that *text points to " or ' character that starts the string, - text pointer is advanced to point past the " or ' character, - returns 0 if string was successfully copied, - returns 1 otherwise -*/ -static int get_string (const byte **text, byte **str) -{ - const byte *t = *text; - byte *p = NULL; - unsigned int len = 0; - byte term_char; - - if (string_grow (&p, &len, '\0')) - return 1; - - /* read " or ' character that starts the string */ - term_char = *t++; - /* while next character is not the terminating character */ - while (*t && *t != term_char) - { - byte c; - - if (*t == '\\') - c = get_escape_sequence (&t); - else - c = *t++; - - if (string_grow (&p, &len, c)) - { - mem_free ((void **) (void *) &p); - return 1; - } - } - /* skip " or ' character that ends the string */ - t++; - - *text = t; - *str = p; - return 0; -} - -/* - gets emit code, the syntax is: - ".emtcode" " " " " (("0x" | "0X") ) | | - assumes that *text already points to , - returns 0 if emit code is successfully read, - returns 1 otherwise -*/ -static int get_emtcode (const byte **text, map_byte **ma) -{ - const byte *t = *text; - map_byte *m = NULL; - - map_byte_create (&m); - if (m == NULL) - return 1; - - if (get_identifier (&t, &m->key)) - { - map_byte_destroy (&m); - return 1; - } - eat_spaces (&t); - - if (*t == '\'') - { - byte *c; - - if (get_string (&t, &c)) - { - map_byte_destroy (&m); - return 1; - } - - m->data = (byte) c[0]; - mem_free ((void **) (void *) &c); - } - else if (t[0] == '0' && (t[1] == 'x' || t[1] == 'X')) - { - /* skip HEX "0x" or "0X" prefix */ - t += 2; - m->data = (byte) hex_convert (&t); - } - else - { - m->data = (byte) dec_convert (&t); - } - - eat_spaces (&t); - - *text = t; - *ma = m; - return 0; -} - -/* - gets regbyte declaration, the syntax is: - ".regbyte" " " " " (("0x" | "0X") ) | | - assumes that *text already points to , - returns 0 if regbyte is successfully read, - returns 1 otherwise -*/ -static int get_regbyte (const byte **text, map_byte **ma) -{ - /* pass it to the emtcode parser as it has the same syntax starting at */ - return get_emtcode (text, ma); -} - -/* - returns 0 on success, - returns 1 otherwise -*/ -static int get_errtext (const byte **text, map_str **ma) -{ - const byte *t = *text; - map_str *m = NULL; - - map_str_create (&m); - if (m == NULL) - return 1; - - if (get_identifier (&t, &m->key)) - { - map_str_destroy (&m); - return 1; - } - eat_spaces (&t); - - if (get_string (&t, &m->data)) - { - map_str_destroy (&m); - return 1; - } - eat_spaces (&t); - - *text = t; - *ma = m; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_error (const byte **text, error **er, map_str *maps) -{ - const byte *t = *text; - byte *temp = NULL; - - if (*t != '.') - return 0; - - t++; - if (get_identifier (&t, &temp)) - return 1; - eat_spaces (&t); - - if (!str_equal ((byte *) "error", temp)) - { - mem_free ((void **) (void *) &temp); - return 0; - } - - mem_free ((void **) (void *) &temp); - - error_create (er); - if (*er == NULL) - return 1; - - if (*t == '\"') - { - if (get_string (&t, &(**er).m_text)) - { - error_destroy (er); - return 1; - } - eat_spaces (&t); - } - else - { - if (get_identifier (&t, &temp)) - { - error_destroy (er); - return 1; - } - eat_spaces (&t); - - if (map_str_find (&maps, temp, &(**er).m_text)) - { - mem_free ((void **) (void *) &temp); - error_destroy (er); - return 1; - } - - mem_free ((void **) (void *) &temp); - } - - /* try to extract "token" from "...$token$..." */ - { - byte *processed = NULL; - unsigned int len = 0; - int i = 0; - - if (string_grow (&processed, &len, '\0')) - { - error_destroy (er); - return 1; - } - - while (i < str_length ((**er).m_text)) - { - /* check if the dollar sign is repeated - if so skip it */ - if ((**er).m_text[i] == '$' && (**er).m_text[i + 1] == '$') - { - if (string_grow (&processed, &len, '$')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i += 2; - } - else if ((**er).m_text[i] != '$') - { - if (string_grow (&processed, &len, (**er).m_text[i])) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i++; - } - else - { - if (string_grow (&processed, &len, '$')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - { - /* length of token being extracted */ - unsigned int tlen = 0; - - if (string_grow (&(**er).m_token_name, &tlen, '\0')) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - /* skip the dollar sign */ - i++; - - while ((**er).m_text[i] != '$') - { - if (string_grow (&(**er).m_token_name, &tlen, (**er).m_text[i])) - { - mem_free ((void **) (void *) &processed); - error_destroy (er); - return 1; - } - - i++; - } - - /* skip the dollar sign */ - i++; - } - } - } - - mem_free ((void **) &(**er).m_text); - (**er).m_text = processed; - } - - *text = t; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_emits (const byte **text, emit **em, map_byte *mapb) -{ - const byte *t = *text; - byte *temp = NULL; - emit *e = NULL; - emit_dest dest; - - if (*t != '.') - return 0; - - t++; - if (get_identifier (&t, &temp)) - return 1; - eat_spaces (&t); - - /* .emit */ - if (str_equal ((byte *) "emit", temp)) - dest = ed_output; - /* .load */ - else if (str_equal ((byte *) "load", temp)) - dest = ed_regbyte; - else - { - mem_free ((void **) (void *) &temp); - return 0; - } - - mem_free ((void **) (void *) &temp); - - emit_create (&e); - if (e == NULL) - return 1; - - e->m_emit_dest = dest; - - if (dest == ed_regbyte) - { - if (get_identifier (&t, &e->m_regname)) - { - emit_destroy (&e); - return 1; - } - eat_spaces (&t); - } - - /* 0xNN */ - if (*t == '0' && (t[1] == 'x' || t[1] == 'X')) - { - t += 2; - e->m_byte = (byte) hex_convert (&t); - - e->m_emit_type = et_byte; - } - /* NNN */ - else if (*t >= '0' && *t <= '9') - { - e->m_byte = (byte) dec_convert (&t); - - e->m_emit_type = et_byte; - } - /* * */ - else if (*t == '*') - { - t++; - - e->m_emit_type = et_stream; - } - /* $ */ - else if (*t == '$') - { - t++; - - e->m_emit_type = et_position; - } - /* 'c' */ - else if (*t == '\'') - { - if (get_string (&t, &temp)) - { - emit_destroy (&e); - return 1; - } - e->m_byte = (byte) temp[0]; - - mem_free ((void **) (void *) &temp); - - e->m_emit_type = et_byte; - } - else - { - if (get_identifier (&t, &temp)) - { - emit_destroy (&e); - return 1; - } - - if (map_byte_find (&mapb, temp, &e->m_byte)) - { - mem_free ((void **) (void *) &temp); - emit_destroy (&e); - return 1; - } - - mem_free ((void **) (void *) &temp); - - e->m_emit_type = et_byte; - } - - eat_spaces (&t); - - if (get_emits (&t, &e->m_next, mapb)) - { - emit_destroy (&e); - return 1; - } - - *text = t; - *em = e; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_spec (const byte **text, spec **sp, map_str *maps, map_byte *mapb) -{ - const byte *t = *text; - spec *s = NULL; - - spec_create (&s); - if (s == NULL) - return 1; - - /* first - read optional .if statement */ - if (*t == '.') - { - const byte *u = t; - byte *keyword = NULL; - - /* skip the dot */ - u++; - - if (get_identifier (&u, &keyword)) - { - spec_destroy (&s); - return 1; - } - - /* .if */ - if (str_equal ((byte *) "if", keyword)) - { - cond_create (&s->m_cond); - if (s->m_cond == NULL) - { - spec_destroy (&s); - return 1; - } - - /* skip the left paren */ - eat_spaces (&u); - u++; - - /* get the left operand */ - eat_spaces (&u); - if (get_identifier (&u, &s->m_cond->m_operands[0].m_regname)) - { - spec_destroy (&s); - return 1; - } - s->m_cond->m_operands[0].m_type = cot_regbyte; - - /* get the operator (!= or ==) */ - eat_spaces (&u); - if (*u == '!') - s->m_cond->m_type = ct_not_equal; - else - s->m_cond->m_type = ct_equal; - u += 2; - eat_spaces (&u); - - if (u[0] == '0' && (u[1] == 'x' || u[1] == 'X')) - { - /* skip the 0x prefix */ - u += 2; - - /* get the right operand */ - s->m_cond->m_operands[1].m_byte = hex_convert (&u); - s->m_cond->m_operands[1].m_type = cot_byte; - } - else /*if (*u >= '0' && *u <= '9')*/ - { - /* get the right operand */ - s->m_cond->m_operands[1].m_byte = dec_convert (&u); - s->m_cond->m_operands[1].m_type = cot_byte; - } - - /* skip the right paren */ - eat_spaces (&u); - u++; - - eat_spaces (&u); - - t = u; - } - - mem_free ((void **) (void *) &keyword); - } - - if (*t == '\'') - { - byte *temp = NULL; - - if (get_string (&t, &temp)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - if (*t == '-') - { - byte *temp2 = NULL; - - /* skip the '-' character */ - t++; - eat_spaces (&t); - - if (get_string (&t, &temp2)) - { - mem_free ((void **) (void *) &temp); - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_byte_range; - s->m_byte[0] = *temp; - s->m_byte[1] = *temp2; - - mem_free ((void **) (void *) &temp2); - } - else - { - s->m_spec_type = st_byte; - *s->m_byte = *temp; - } - - mem_free ((void **) (void *) &temp); - } - else if (*t == '"') - { - if (get_string (&t, &s->m_string)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - /* Try to convert string to a token. */ - if (s->m_string[0] == '@') { - s->m_spec_type = st_token; - if (!strcmp(s->m_string, "@,")) { - s->m_token = SL_PP_COMMA; - } else if (!strcmp(s->m_string, "@;")) { - s->m_token = SL_PP_SEMICOLON; - } else if (!strcmp(s->m_string, "@{")) { - s->m_token = SL_PP_LBRACE; - } else if (!strcmp(s->m_string, "@}")) { - s->m_token = SL_PP_RBRACE; - } else if (!strcmp(s->m_string, "@(")) { - s->m_token = SL_PP_LPAREN; - } else if (!strcmp(s->m_string, "@)")) { - s->m_token = SL_PP_RPAREN; - } else if (!strcmp(s->m_string, "@[")) { - s->m_token = SL_PP_LBRACKET; - } else if (!strcmp(s->m_string, "@]")) { - s->m_token = SL_PP_RBRACKET; - } else if (!strcmp(s->m_string, "@.")) { - s->m_token = SL_PP_DOT; - } else if (!strcmp(s->m_string, "@++")) { - s->m_token = SL_PP_INCREMENT; - } else if (!strcmp(s->m_string, "@+=")) { - s->m_token = SL_PP_ADDASSIGN; - } else if (!strcmp(s->m_string, "@+")) { - s->m_token = SL_PP_PLUS; - } else if (!strcmp(s->m_string, "@--")) { - s->m_token = SL_PP_DECREMENT; - } else if (!strcmp(s->m_string, "@-=")) { - s->m_token = SL_PP_SUBASSIGN; - } else if (!strcmp(s->m_string, "@-")) { - s->m_token = SL_PP_MINUS; - } else if (!strcmp(s->m_string, "@~")) { - s->m_token = SL_PP_BITNOT; - } else if (!strcmp(s->m_string, "@!=")) { - s->m_token = SL_PP_NOTEQUAL; - } else if (!strcmp(s->m_string, "@!")) { - s->m_token = SL_PP_NOT; - } else if (!strcmp(s->m_string, "@*=")) { - s->m_token = SL_PP_MULASSIGN; - } else if (!strcmp(s->m_string, "@*")) { - s->m_token = SL_PP_STAR; - } else if (!strcmp(s->m_string, "@/=")) { - s->m_token = SL_PP_DIVASSIGN; - } else if (!strcmp(s->m_string, "@/")) { - s->m_token = SL_PP_SLASH; - } else if (!strcmp(s->m_string, "@%=")) { - s->m_token = SL_PP_MODASSIGN; - } else if (!strcmp(s->m_string, "@%")) { - s->m_token = SL_PP_MODULO; - } else if (!strcmp(s->m_string, "@<<=")) { - s->m_token = SL_PP_LSHIFTASSIGN; - } else if (!strcmp(s->m_string, "@<<")) { - s->m_token = SL_PP_LSHIFT; - } else if (!strcmp(s->m_string, "@<=")) { - s->m_token = SL_PP_LESSEQUAL; - } else if (!strcmp(s->m_string, "@<")) { - s->m_token = SL_PP_LESS; - } else if (!strcmp(s->m_string, "@>>=")) { - s->m_token = SL_PP_RSHIFTASSIGN; - } else if (!strcmp(s->m_string, "@>>")) { - s->m_token = SL_PP_RSHIFT; - } else if (!strcmp(s->m_string, "@>=")) { - s->m_token = SL_PP_GREATEREQUAL; - } else if (!strcmp(s->m_string, "@>")) { - s->m_token = SL_PP_GREATER; - } else if (!strcmp(s->m_string, "@==")) { - s->m_token = SL_PP_EQUAL; - } else if (!strcmp(s->m_string, "@=")) { - s->m_token = SL_PP_ASSIGN; - } else if (!strcmp(s->m_string, "@&&")) { - s->m_token = SL_PP_AND; - } else if (!strcmp(s->m_string, "@&=")) { - s->m_token = SL_PP_BITANDASSIGN; - } else if (!strcmp(s->m_string, "@&")) { - s->m_token = SL_PP_BITAND; - } else if (!strcmp(s->m_string, "@^^")) { - s->m_token = SL_PP_XOR; - } else if (!strcmp(s->m_string, "@^=")) { - s->m_token = SL_PP_BITXORASSIGN; - } else if (!strcmp(s->m_string, "@^")) { - s->m_token = SL_PP_BITXOR; - } else if (!strcmp(s->m_string, "@||")) { - s->m_token = SL_PP_OR; - } else if (!strcmp(s->m_string, "@|=")) { - s->m_token = SL_PP_BITORASSIGN; - } else if (!strcmp(s->m_string, "@|")) { - s->m_token = SL_PP_BITOR; - } else if (!strcmp(s->m_string, "@?")) { - s->m_token = SL_PP_QUESTION; - } else if (!strcmp(s->m_string, "@:")) { - s->m_token = SL_PP_COLON; - } else if (!strcmp(s->m_string, "@ID")) { - s->m_token = SL_PP_IDENTIFIER; - } else if (!strcmp(s->m_string, "@UINT")) { - s->m_token = SL_PP_UINT; - } else if (!strcmp(s->m_string, "@FLOAT")) { - s->m_token = SL_PP_FLOAT; - } else if (!strcmp(s->m_string, "@EOF")) { - s->m_token = SL_PP_EOF; - } else { - spec_destroy(&s); - return 1; - } - } else { - s->m_spec_type = st_string; - } - } - else if (*t == '.') - { - byte *keyword = NULL; - - /* skip the dot */ - t++; - - if (get_identifier (&t, &keyword)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - /* .true */ - if (str_equal ((byte *) "true", keyword)) - { - s->m_spec_type = st_true; - } - /* .false */ - else if (str_equal ((byte *) "false", keyword)) - { - s->m_spec_type = st_false; - } - /* .debug */ - else if (str_equal ((byte *) "debug", keyword)) - { - s->m_spec_type = st_debug; - } - /* .loop */ - else if (str_equal ((byte *) "loop", keyword)) - { - if (get_identifier (&t, &s->m_string)) - { - mem_free ((void **) (void *) &keyword); - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_identifier_loop; - } - mem_free ((void **) (void *) &keyword); - } - else - { - if (get_identifier (&t, &s->m_string)) - { - spec_destroy (&s); - return 1; - } - eat_spaces (&t); - - s->m_spec_type = st_identifier; - } - - if (get_error (&t, &s->m_errtext, maps)) - { - spec_destroy (&s); - return 1; - } - - if (get_emits (&t, &s->m_emits, mapb)) - { - spec_destroy (&s); - return 1; - } - - *text = t; - *sp = s; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int get_rule (const byte **text, rule **ru, map_str *maps, map_byte *mapb) -{ - const byte *t = *text; - rule *r = NULL; - - rule_create (&r); - if (r == NULL) - return 1; - - if (get_spec (&t, &r->m_specs, maps, mapb)) - { - rule_destroy (&r); - return 1; - } - - while (*t != ';') - { - byte *op = NULL; - spec *sp = NULL; - - /* skip the dot that precedes "and" or "or" */ - t++; - - /* read "and" or "or" keyword */ - if (get_identifier (&t, &op)) - { - rule_destroy (&r); - return 1; - } - eat_spaces (&t); - - if (r->m_oper == op_none) - { - /* .and */ - if (str_equal ((byte *) "and", op)) - r->m_oper = op_and; - /* .or */ - else - r->m_oper = op_or; - } - - mem_free ((void **) (void *) &op); - - if (get_spec (&t, &sp, maps, mapb)) - { - rule_destroy (&r); - return 1; - } - - spec_append (&r->m_specs, sp); - } - - /* skip the semicolon */ - t++; - eat_spaces (&t); - - *text = t; - *ru = r; - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int update_dependency (map_rule *mapr, byte *symbol, rule **ru) -{ - if (map_rule_find (&mapr, symbol, ru)) - return 1; - - (**ru).m_referenced = 1; - - return 0; -} - -/* - returns 0 on success, - returns 1 otherwise, -*/ -static int update_dependencies (dict *di, map_rule *mapr, byte **syntax_symbol, - byte **string_symbol, map_byte *regbytes) -{ - rule *rulez = di->m_rulez; - - /* update dependecies for the root and lexer symbols */ - if (update_dependency (mapr, *syntax_symbol, &di->m_syntax) || - (*string_symbol != NULL && update_dependency (mapr, *string_symbol, &di->m_string))) - return 1; - - mem_free ((void **) syntax_symbol); - mem_free ((void **) string_symbol); - - /* update dependecies for the rest of the rules */ - while (rulez) - { - spec *sp = rulez->m_specs; - - /* iterate through all the specifiers */ - while (sp) - { - /* update dependency for identifier */ - if (sp->m_spec_type == st_identifier || sp->m_spec_type == st_identifier_loop) - { - if (update_dependency (mapr, sp->m_string, &sp->m_rule)) - return 1; - - mem_free ((void **) &sp->m_string); - } - - /* some errtexts reference to a rule */ - if (sp->m_errtext && sp->m_errtext->m_token_name) - { - if (update_dependency (mapr, sp->m_errtext->m_token_name, &sp->m_errtext->m_token)) - return 1; - - mem_free ((void **) &sp->m_errtext->m_token_name); - } - - /* update dependency for condition */ - if (sp->m_cond) - { - int i; - for (i = 0; i < 2; i++) - if (sp->m_cond->m_operands[i].m_type == cot_regbyte) - { - sp->m_cond->m_operands[i].m_regbyte = map_byte_locate (®bytes, - sp->m_cond->m_operands[i].m_regname); - - if (sp->m_cond->m_operands[i].m_regbyte == NULL) - return 1; - - mem_free ((void **) &sp->m_cond->m_operands[i].m_regname); - } - } - - /* update dependency for all .load instructions */ - if (sp->m_emits) - { - emit *em = sp->m_emits; - while (em != NULL) - { - if (em->m_emit_dest == ed_regbyte) - { - em->m_regbyte = map_byte_locate (®bytes, em->m_regname); - - if (em->m_regbyte == NULL) - return 1; - - mem_free ((void **) &em->m_regname); - } - - em = em->m_next; - } - } - - sp = sp->next; - } - - rulez = rulez->next; - } - - /* check for unreferenced symbols */ - rulez = di->m_rulez; - while (rulez != NULL) - { - if (!rulez->m_referenced) - { - map_rule *ma = mapr; - while (ma) - { - if (ma->data == rulez) - { - set_last_error (UNREFERENCED_IDENTIFIER, str_duplicate (ma->key), -1); - return 1; - } - ma = ma->next; - } - } - rulez = rulez->next; - } - - return 0; -} - -static int satisfies_condition (cond *co, regbyte_ctx *ctx) -{ - byte values[2]; - int i; - - if (co == NULL) - return 1; - - for (i = 0; i < 2; i++) - switch (co->m_operands[i].m_type) - { - case cot_byte: - values[i] = co->m_operands[i].m_byte; - break; - case cot_regbyte: - values[i] = regbyte_ctx_extract (&ctx, co->m_operands[i].m_regbyte); - break; - } - - switch (co->m_type) - { - case ct_equal: - return values[0] == values[1]; - case ct_not_equal: - return values[0] != values[1]; - } - - return 0; -} - -static void free_regbyte_ctx_stack (regbyte_ctx *top, regbyte_ctx *limit) -{ - while (top != limit) - { - regbyte_ctx *rbc = top->m_prev; - regbyte_ctx_destroy (&top); - top = rbc; - } -} - -typedef enum match_result_ -{ - mr_not_matched, /* the examined string does not match */ - mr_matched, /* the examined string matches */ - mr_error_raised, /* mr_not_matched + error has been raised */ - mr_dont_emit, /* used by identifier loops only */ - mr_internal_error /* an internal error has occured such as out of memory */ -} match_result; - -/* - * This function does the main job. It parses the text and generates output data. - */ -static match_result -match (dict *di, const byte *text, int *index, rule *ru, barray **ba, int filtering_string, - regbyte_ctx **rbc) -{ - int ind = *index; - match_result status = mr_not_matched; - spec *sp = ru->m_specs; - regbyte_ctx *ctx = *rbc; - - /* for every specifier in the rule */ - while (sp) - { - int i, len, save_ind = ind; - barray *array = NULL; - - if (satisfies_condition (sp->m_cond, ctx)) - { - switch (sp->m_spec_type) - { - case st_identifier: - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - status = match (di, text, &ind, sp->m_rule, &array, filtering_string, &ctx); - - if (status == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - break; - case st_string: - len = str_length (sp->m_string); - - /* prefilter the stream */ - if (!filtering_string && di->m_string) - { - barray *ba; - int filter_index = 0; - match_result result; - regbyte_ctx *null_ctx = NULL; - - barray_create (&ba); - if (ba == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - result = match (di, text + ind, &filter_index, di->m_string, &ba, 1, &null_ctx); - - if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&ba); - return mr_internal_error; - } - - if (result != mr_matched) - { - barray_destroy (&ba); - status = mr_not_matched; - break; - } - - barray_destroy (&ba); - - if (filter_index != len || !str_equal_n (sp->m_string, text + ind, len)) - { - status = mr_not_matched; - break; - } - - status = mr_matched; - ind += len; - } - else - { - status = mr_matched; - for (i = 0; status == mr_matched && i < len; i++) - if (text[ind + i] != sp->m_string[i]) - status = mr_not_matched; - - if (status == mr_matched) - ind += len; - } - break; - case st_byte: - status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_byte_range: - status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? - mr_matched : mr_not_matched; - if (status == mr_matched) - ind++; - break; - case st_true: - status = mr_matched; - break; - case st_false: - status = mr_not_matched; - break; - case st_debug: - status = ru->m_oper == op_and ? mr_matched : mr_not_matched; - break; - case st_identifier_loop: - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - status = mr_dont_emit; - for (;;) - { - match_result result; - - save_ind = ind; - result = match (di, text, &ind, sp->m_rule, &array, filtering_string, &ctx); - - if (result == mr_error_raised) - { - status = result; - break; - } - else if (result == mr_matched) - { - if (barray_push (ba, sp->m_emits, text[ind - 1], save_ind, &ctx) || - barray_append (ba, &array)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - barray_destroy (&array); - barray_create (&array); - if (array == NULL) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - else if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - else - break; - } - break; - } - } - else - { - status = mr_not_matched; - } - - if (status == mr_error_raised) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - - return mr_error_raised; - } - - if (ru->m_oper == op_and && status != mr_matched && status != mr_dont_emit) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - - if (sp->m_errtext) - { - set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, - ind), ind); - - return mr_error_raised; - } - - return mr_not_matched; - } - - if (status == mr_matched) - { - if (sp->m_emits) - if (barray_push (ba, sp->m_emits, text[ind - 1], save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - - if (array) - if (barray_append (ba, &array)) - { - free_regbyte_ctx_stack (ctx, *rbc); - barray_destroy (&array); - return mr_internal_error; - } - } - - barray_destroy (&array); - - /* if the rule operator is a logical or, we pick up the first matching specifier */ - if (ru->m_oper == op_or && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - return mr_matched; - } - - sp = sp->next; - } - - /* everything went fine - all specifiers match up */ - if (ru->m_oper == op_and && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - return mr_matched; - } - - free_regbyte_ctx_stack (ctx, *rbc); - return mr_not_matched; -} - -static match_result -fast_match(dict *di, - const struct sl_pp_token_info *tokens, - int *index, - rule *ru, - int *_PP, - bytepool *_BP, - regbyte_ctx **rbc, - struct sl_pp_context *context) -{ - int ind = *index; - int _P = *_PP; - int _P2; - match_result status = mr_not_matched; - spec *sp = ru->m_specs; - regbyte_ctx *ctx = *rbc; - - /* for every specifier in the rule */ - while (sp) - { - int save_ind = ind; - - _P2 = _P + (sp->m_emits ? emit_size(sp->m_emits, sl_pp_context_cstr(context, tokens[ind].data.identifier)) : 0); - if (bytepool_reserve (_BP, _P2)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - if (satisfies_condition (sp->m_cond, ctx)) - { - switch (sp->m_spec_type) - { - case st_identifier: - status = fast_match(di, tokens, &ind, sp->m_rule, &_P2, _BP, &ctx, context); - - if (status == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - break; - - case st_token: - if (tokens[ind].token == sp->m_token) { - status = mr_matched; - ind++; - } else { - status = mr_not_matched; - } - break; - - case st_string: - if (tokens[ind].token != SL_PP_IDENTIFIER) { - status = mr_not_matched; - break; - } - - if (!strcmp(sl_pp_context_cstr(context, tokens[ind].data.identifier), sp->m_string)) { - status = mr_matched; - ind++; - } else { - status = mr_not_matched; - } - break; - - case st_byte: - /**status = text[ind] == *sp->m_byte ? mr_matched : mr_not_matched;**/ - if (status == mr_matched) - ind++; - break; - case st_byte_range: - /**status = (text[ind] >= sp->m_byte[0] && text[ind] <= sp->m_byte[1]) ? - mr_matched : mr_not_matched;**/ - if (status == mr_matched) - ind++; - break; - case st_true: - status = mr_matched; - break; - case st_false: - status = mr_not_matched; - break; - case st_debug: - status = ru->m_oper == op_and ? mr_matched : mr_not_matched; - break; - case st_identifier_loop: - status = mr_dont_emit; - for (;;) - { - match_result result; - - save_ind = ind; - result = fast_match(di, tokens, &ind, sp->m_rule, &_P2, _BP, &ctx, context); - - if (result == mr_error_raised) - { - status = result; - break; - } - else if (result == mr_matched) - { - if (sp->m_emits != NULL) - { - if (emit_push (sp->m_emits, _BP->_F + _P, sl_pp_context_cstr(context, tokens[ind - 1].data.identifier), save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - - _P = _P2; - _P2 += sp->m_emits ? emit_size(sp->m_emits, sl_pp_context_cstr(context, tokens[ind].data.identifier)) : 0; - if (bytepool_reserve (_BP, _P2)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - } - else if (result == mr_internal_error) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - else - break; - } - break; - } - } - else - { - status = mr_not_matched; - } - - if (status == mr_error_raised) - { - free_regbyte_ctx_stack (ctx, *rbc); - - return mr_error_raised; - } - - if (ru->m_oper == op_and && status != mr_matched && status != mr_dont_emit) - { - free_regbyte_ctx_stack (ctx, *rbc); - - if (sp->m_errtext) - { - /**set_last_error (sp->m_errtext->m_text, error_get_token (sp->m_errtext, di, text, - ind), ind);**/ - - return mr_error_raised; - } - - return mr_not_matched; - } - - if (status == mr_matched) - { - if (sp->m_emits != NULL) { - const char *str = (ind <= 0) ? "" : sl_pp_context_cstr(context, tokens[ind - 1].data.identifier); - if (emit_push (sp->m_emits, _BP->_F + _P, str, save_ind, &ctx)) - { - free_regbyte_ctx_stack (ctx, *rbc); - return mr_internal_error; - } - - } - _P = _P2; - } - - /* if the rule operator is a logical or, we pick up the first matching specifier */ - if (ru->m_oper == op_or && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - *_PP = _P; - return mr_matched; - } - - sp = sp->next; - } - - /* everything went fine - all specifiers match up */ - if (ru->m_oper == op_and && (status == mr_matched || status == mr_dont_emit)) - { - *index = ind; - *rbc = ctx; - *_PP = _P; - return mr_matched; - } - - free_regbyte_ctx_stack (ctx, *rbc); - return mr_not_matched; -} - -static byte * -error_get_token (error *er, dict *di, const byte *text, int ind) -{ - byte *str = NULL; - - if (er->m_token) - { - barray *ba; - int filter_index = 0; - regbyte_ctx *ctx = NULL; - - barray_create (&ba); - if (ba != NULL) - { - if (match (di, text + ind, &filter_index, er->m_token, &ba, 0, &ctx) == mr_matched && - filter_index) - { - str = (byte *) mem_alloc (filter_index + 1); - if (str != NULL) - { - str_copy_n (str, text + ind, filter_index); - str[filter_index] = '\0'; - } - } - barray_destroy (&ba); - } - } - - return str; -} - -typedef struct grammar_load_state_ -{ - dict *di; - byte *syntax_symbol; - byte *string_symbol; - map_str *maps; - map_byte *mapb; - map_rule *mapr; -} grammar_load_state; - -static void grammar_load_state_create (grammar_load_state **gr) -{ - *gr = (grammar_load_state *) mem_alloc (sizeof (grammar_load_state)); - if (*gr) - { - (**gr).di = NULL; - (**gr).syntax_symbol = NULL; - (**gr).string_symbol = NULL; - (**gr).maps = NULL; - (**gr).mapb = NULL; - (**gr).mapr = NULL; - } -} - -static void grammar_load_state_destroy (grammar_load_state **gr) -{ - if (*gr) - { - dict_destroy (&(**gr).di); - mem_free ((void **) &(**gr).syntax_symbol); - mem_free ((void **) &(**gr).string_symbol); - map_str_destroy (&(**gr).maps); - map_byte_destroy (&(**gr).mapb); - map_rule_destroy (&(**gr).mapr); - mem_free ((void **) gr); - } -} - - -static void error_msg(int line, const char *msg) -{ - fprintf(stderr, "Error in grammar_load_from_text() at line %d: %s\n", line, msg); -} - - -/* - the API -*/ -grammar grammar_load_from_text (const byte *text) -{ - grammar_load_state *g = NULL; - grammar id = 0; - - clear_last_error (); - - grammar_load_state_create (&g); - if (g == NULL) { - error_msg(__LINE__, ""); - return 0; - } - - dict_create (&g->di); - if (g->di == NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - eat_spaces (&text); - - /* skip ".syntax" keyword */ - text += 7; - eat_spaces (&text); - - /* retrieve root symbol */ - if (get_identifier (&text, &g->syntax_symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - eat_spaces (&text); - - /* skip semicolon */ - text++; - eat_spaces (&text); - - while (*text) - { - byte *symbol = NULL; - int is_dot = *text == '.'; - - if (is_dot) - text++; - - if (get_identifier (&text, &symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - eat_spaces (&text); - - /* .emtcode */ - if (is_dot && str_equal (symbol, (byte *) "emtcode")) - { - map_byte *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_emtcode (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_byte_append (&g->mapb, ma); - } - /* .regbyte */ - else if (is_dot && str_equal (symbol, (byte *) "regbyte")) - { - map_byte *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_regbyte (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_byte_append (&g->di->m_regbytes, ma); - } - /* .errtext */ - else if (is_dot && str_equal (symbol, (byte *) "errtext")) - { - map_str *ma = NULL; - - mem_free ((void **) (void *) &symbol); - - if (get_errtext (&text, &ma)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - map_str_append (&g->maps, ma); - } - /* .string */ - else if (is_dot && str_equal (symbol, (byte *) "string")) - { - mem_free ((void **) (void *) &symbol); - - if (g->di->m_string != NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - if (get_identifier (&text, &g->string_symbol)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - /* skip semicolon */ - eat_spaces (&text); - text++; - eat_spaces (&text); - } - else - { - rule *ru = NULL; - map_rule *ma = NULL; - - if (get_rule (&text, &ru, g->maps, g->mapb)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - rule_append (&g->di->m_rulez, ru); - - /* if a rule consist of only one specifier, give it an ".and" operator */ - if (ru->m_oper == op_none) - ru->m_oper = op_and; - - map_rule_create (&ma); - if (ma == NULL) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, ""); - return 0; - } - - ma->key = symbol; - ma->data = ru; - map_rule_append (&g->mapr, ma); - } - } - - if (update_dependencies (g->di, g->mapr, &g->syntax_symbol, &g->string_symbol, - g->di->m_regbytes)) - { - grammar_load_state_destroy (&g); - error_msg(__LINE__, "update_dependencies() failed"); - return 0; - } - - dict_append (&g_dicts, g->di); - id = g->di->m_id; - g->di = NULL; - - grammar_load_state_destroy (&g); - - return id; -} - -int grammar_set_reg8 (grammar id, const byte *name, byte value) -{ - dict *di = NULL; - map_byte *reg = NULL; - - clear_last_error (); - - dict_find (&g_dicts, id, &di); - if (di == NULL) - { - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; - } - - reg = map_byte_locate (&di->m_regbytes, name); - if (reg == NULL) - { - set_last_error (INVALID_REGISTER_NAME, str_duplicate (name), -1); - return 0; - } - - reg->data = value; - return 1; -} - -int -grammar_fast_check (grammar id, - struct sl_pp_context *context, - struct sl_pp_token_info *tokens, - byte **prod, - unsigned int *size, - unsigned int estimate_prod_size) -{ - dict *di = NULL; - int index = 0; - regbyte_ctx *rbc = NULL; - bytepool *bp = NULL; - int _P = 0; - - clear_last_error (); - - dict_find (&g_dicts, id, &di); - if (di == NULL) - { - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; - } - - *prod = NULL; - *size = 0; - - bytepool_create(&bp, estimate_prod_size); - if (bp == NULL) { - return 0; - } - - if (fast_match(di, tokens, &index, di->m_syntax, &_P, bp, &rbc, context) != mr_matched) { - bytepool_destroy (&bp); - free_regbyte_ctx_stack (rbc, NULL); - return 0; - } - - free_regbyte_ctx_stack(rbc, NULL); - - *prod = bp->_F; - *size = _P; - bp->_F = NULL; - bytepool_destroy(&bp); - - return 1; -} - -int grammar_destroy (grammar id) -{ - dict **di = &g_dicts; - - clear_last_error (); - - while (*di != NULL) - { - if ((**di).m_id == id) - { - dict *tmp = *di; - *di = (**di).next; - dict_destroy (&tmp); - return 1; - } - - di = &(**di).next; - } - - set_last_error (INVALID_GRAMMAR_ID, NULL, -1); - return 0; -} - -static void append_character (const char x, byte *text, int *dots_made, int *len, int size) -{ - if (*dots_made == 0) - { - if (*len < size - 1) - { - text[(*len)++] = x; - text[*len] = '\0'; - } - else - { - int i; - for (i = 0; i < 3; i++) - if (--(*len) >= 0) - text[*len] = '.'; - *dots_made = 1; - } - } -} - -void grammar_get_last_error (byte *text, unsigned int size, int *pos) -{ - int len = 0, dots_made = 0; - const byte *p = error_message; - - *text = '\0'; - - if (p) - { - while (*p) - { - if (*p == '$') - { - const byte *r = error_param; - - while (*r) - { - append_character (*r++, text, &dots_made, &len, (int) size); - } - - p++; - } - else - { - append_character (*p++, text, &dots_made, &len, size); - } - } - } - - *pos = error_position; -} diff --git a/src/mesa/shader/grammar/grammar.h b/src/mesa/shader/grammar/grammar.h deleted file mode 100644 index c3c21659d6c..00000000000 --- a/src/mesa/shader/grammar/grammar.h +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef GRAMMAR_H -#define GRAMMAR_H - - -#ifndef GRAMMAR_PORT_INCLUDE -#error Do not include this file directly, include your grammar_XXX.h instead -#endif - - -#ifdef __cplusplus -extern "C" { -#endif - -void grammar_alloc_free (void *); -void *grammar_alloc_malloc (size_t); -void *grammar_alloc_realloc (void *, size_t, size_t); -void *grammar_memory_copy (void *, const void *, size_t); -int grammar_string_compare (const byte *, const byte *); -int grammar_string_compare_n (const byte *, const byte *, size_t); -byte *grammar_string_copy (byte *, const byte *); -byte *grammar_string_copy_n (byte *, const byte *, size_t); -byte *grammar_string_duplicate (const byte *); -unsigned int grammar_string_length (const byte *); - -/* - loads grammar script from null-terminated ASCII - returns unique grammar id to grammar object - returns 0 if an error occurs (call grammar_get_last_error to retrieve the error text) -*/ -grammar grammar_load_from_text (const byte *text); - -/* - sets a new to a register for grammar - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success -*/ -int grammar_set_reg8 (grammar id, const byte *name, byte value); - -/* - checks if a null-terminated matches given grammar - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success, the points to newly allocated buffer with production and - is filled with the production size - call grammar_alloc_free to free the memory block pointed by - is a hint - the initial production buffer size will be of this size, - but if more room is needed it will be safely resized; set it to 0x1000 or so -*/ -int -grammar_fast_check (grammar id, - struct sl_pp_context *context, - struct sl_pp_token_info *tokens, - byte **prod, - unsigned int *size, - unsigned int estimate_prod_size); - -/* - destroys grammar object identified by - returns 0 on error (call grammar_get_last_error to retrieve the error text) - returns 1 on success -*/ -int grammar_destroy (grammar id); - -/* - retrieves last grammar error reported either by grammar_load_from_text, grammar_check - or grammar_destroy - the user allocated buffer receives error description, points to error position, - is the size of the text buffer to fill in - it must be at least 4 bytes long, -*/ -void grammar_get_last_error (byte *text, unsigned int size, int *pos); - -#ifdef __cplusplus -} -#endif - -#endif - diff --git a/src/mesa/shader/grammar/grammar.syn b/src/mesa/shader/grammar/grammar.syn deleted file mode 100644 index 5d99f65bfce..00000000000 --- a/src/mesa/shader/grammar/grammar.syn +++ /dev/null @@ -1,567 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.2 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - - /** - * \file grammar.syn - * syntax of .syn script - used to validate other syntax files - * \author Michal Krol - */ - -.syntax grammar; - -/* declaration */ -.emtcode DECLARATION_END 0 -.emtcode DECLARATION_EMITCODE 1 -.emtcode DECLARATION_ERRORTEXT 2 -.emtcode DECLARATION_REGBYTE 3 -.emtcode DECLARATION_LEXER 4 -.emtcode DECLARATION_RULE 5 - -/* specifier */ -.emtcode SPECIFIER_END 0 -.emtcode SPECIFIER_AND_TAG 1 -.emtcode SPECIFIER_OR_TAG 2 -.emtcode SPECIFIER_CHARACTER_RANGE 3 -.emtcode SPECIFIER_CHARACTER 4 -.emtcode SPECIFIER_STRING 5 -.emtcode SPECIFIER_IDENTIFIER 6 -.emtcode SPECIFIER_TRUE 7 -.emtcode SPECIFIER_FALSE 8 -.emtcode SPECIFIER_DEBUG 9 - -/* identifier */ -.emtcode IDENTIFIER_SIMPLE 0 -.emtcode IDENTIFIER_LOOP 1 - -/* error */ -.emtcode ERROR_NOT_PRESENT 0 -.emtcode ERROR_PRESENT 1 - -/* emit */ -.emtcode EMIT_NULL 0 -.emtcode EMIT_INTEGER 1 -.emtcode EMIT_IDENTIFIER 2 -.emtcode EMIT_CHARACTER 3 -.emtcode EMIT_LAST_CHARACTER 4 -.emtcode EMIT_CURRENT_POSITION 5 - -.errtext INVALID_GRAMMAR "internal error 2001: invalid grammar script" -.errtext SYNTAX_EXPECTED "internal error 2002: '.syntax' keyword expected" -.errtext IDENTIFIER_EXPECTED "internal error 2003: identifier expected" -.errtext MISSING_SEMICOLON "internal error 2004: missing ';'" -.errtext INTEGER_EXPECTED "internal error 2005: integer value expected" -.errtext STRING_EXPECTED "internal error 2006: string expected" - -/* - ::= ".syntax" ";" -*/ -grammar - grammar_1 .error INVALID_GRAMMAR; -grammar_1 - optional_space .and ".syntax" .error SYNTAX_EXPECTED .and space .and identifier .and - semicolon .and declaration_list .and optional_space .and '\0' .emit DECLARATION_END; - -/* - ::= - | "" -*/ -optional_space - space .or .true; - -/* - ::= * -*/ -space - single_space .and .loop single_space; - -/* - ::= - | -*/ -single_space - white_char .or comment_block; - -/* - ::= " " - | "\t" - | "\n" - | "\r" -*/ -white_char - ' ' .or '\t' .or '\n' .or '\r'; - -/* - ::= "/" "*" -*/ -comment_block - '/' .and '*' .and comment_rest; - -/* - ::= * - | * "*" -*/ -comment_rest - .loop comment_char_no_star .and comment_rest_1; -comment_rest_1 - comment_end .or comment_rest_2; -comment_rest_2 - '*' .and comment_rest; - -/* - ::= All ASCII characters except "*" and "\0" -*/ -comment_char_no_star - '\x2B'-'\xFF' .or '\x01'-'\x29'; - -/* - ::= "*" "/" -*/ -comment_end - '*' .and '/'; - -/* - ::= -*/ -identifier - identifier_ne .error IDENTIFIER_EXPECTED; - -/* - ::= * -*/ -identifier_ne - first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\0'; - -/* - ::= "a"-"z" - | "A"-"Z" - | "_" -*/ -first_idchar - 'a'-'z' .or 'A'-'Z' .or '_'; - -/* - ::= - | -*/ -follow_idchar - first_idchar .or digit_dec; - -/* - ::= "0"-"9" -*/ -digit_dec - '0'-'9'; - -/* - ::= ";" -*/ -semicolon - optional_space .and ';' .error MISSING_SEMICOLON .and optional_space; - -/* - ::= - | -*/ -declaration_list - declaration .and .loop declaration; - -/* - ::= - | - | - | -*/ -declaration - emitcode_definition .emit DECLARATION_EMITCODE .or - errortext_definition .emit DECLARATION_ERRORTEXT .or - regbyte_definition .emit DECLARATION_REGBYTE .or - lexer_definition .emit DECLARATION_LEXER .or - rule_definition .emit DECLARATION_RULE; - -/* - ::= ".emtcode" -*/ -emitcode_definition - ".emtcode" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= -*/ -integer - integer_ne .error INTEGER_EXPECTED; - -/* - ::= - | -*/ -integer_ne - hex_integer .emit 0x10 .or dec_integer .emit 10; - -/* - :: * -*/ -hex_integer - hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\0'; - -/* - ::= "0x" - | "0X" -*/ -hex_prefix - '0' .and hex_prefix_1; -hex_prefix_1 - 'x' .or 'X'; - -/* - ::= "0"-"9" - | "a"-"f" - | "A"-"F" -*/ -digit_hex - '0'-'9' .or 'a'-'f' .or 'A'-'F'; - -/* - :: * -*/ -dec_integer - digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\0'; - -/* - ::= - | "\0" -*/ -space_or_null - space .or '\0'; - -/* - ::= ".errtext" -*/ -errortext_definition - ".errtext" .and space .and identifier .and space .and string .and space_or_null; - -/* - ::= -*/ -string - string_ne .error STRING_EXPECTED; - -/* - ::= "\"" "\"" -*/ -string_ne - '"' .and .loop string_char_double_quotes .and '"' .emit '\0'; - -/* - ::= - | - | "\'" -*/ -string_char_double_quotes - escape_sequence .or string_char .emit * .or '\'' .emit *; - -/* - ::= All ASCII characters except "\'", "\"", "\n", "\r", - "\0" and "\\" -*/ -string_char - '\x5D'-'\xFF' .or '\x28'-'\x5B' .or '\x23'-'\x26' .or '\x0E'-'\x21' .or '\x0B'-'\x0C' .or - '\x01'-'\x09'; - -/* - ::= "\\" -*/ -escape_sequence - '\\' .emit * .and escape_code; - -/* - ::= - | - | -*/ -escape_code - simple_escape_code .emit * .or hex_escape_code .or oct_escape_code; - -/* - ::= "\'" - | "\"" - | "?" - | "\\" - | "a" - | "b" - | "f" - | "n" - | "r" - | "t" - | "v" -*/ -simple_escape_code - '\'' .or '"' .or '?' .or '\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v'; - -/* - ::= "x" * -*/ -hex_escape_code - 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *; - -/* - ::= -*/ -oct_escape_code - digit_oct .emit * .and optional_digit_oct .and optional_digit_oct; - -/* - ::= "0"-"7" -*/ -digit_oct - '0'-'7'; - -/* - ::= - | "" -*/ -optional_digit_oct - digit_oct .emit * .or .true; - -/* - ::= ".regbyte" -*/ -regbyte_definition - ".regbyte" .and space .and identifier .and space .and integer .and space_or_null; - -/* - ::= ".string" ";" -*/ -lexer_definition - ".string" .and space .and identifier .and semicolon; - -/* - ::= -*/ -rule_definition - identifier_ne .and space .and definition; - -/* - ::= ";" -*/ -definition - specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END; - -/* - ::= - | - | "" -*/ -optional_specifiers_and_or - and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true; - -/* - ::= -*/ -specifier - specifier_condition .and optional_space .and specifier_rule; - -/* - ::= ".if" "(" ")" -*/ -specifier_condition - specifier_condition_1 .or .true; -specifier_condition_1 - ".if" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and - right_operand .and optional_space .and ')'; - -/* - ::= -*/ -left_operand - identifier; - -/* - ::= "!=" - | "==" -*/ -operator - operator_1 .or operator_2; -operator_1 - optional_space .and '!' .and '=' .and optional_space; -operator_2 - optional_space .and '=' .and '=' .and optional_space; - -/* - ::= -*/ -right_operand - integer; - -/* - ::= * - | * - | * - | ".true" * - | ".false" * - | ".debug" * - | * -*/ -specifier_rule - specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL; -specifier_rule_1 - character_range .emit SPECIFIER_CHARACTER_RANGE .or - character .emit SPECIFIER_CHARACTER .or - string_ne .emit SPECIFIER_STRING .or - ".true" .emit SPECIFIER_TRUE .or - ".false" .emit SPECIFIER_FALSE .or - ".debug" .emit SPECIFIER_DEBUG .or - advanced_identifier .emit SPECIFIER_IDENTIFIER; - -/* - ::= "\'" ::= - | - | "\"" -*/ -string_char_single_quotes - escape_sequence .or string_char .emit * .or '"' .emit *; - -/* - ::= "-" -*/ -character_range - character .and optional_space .and '-' .and optional_space .and character; - -/* - ::= -*/ -advanced_identifier - optional_loop .and identifier; - -/* - ::= ".loop" - | "" -*/ -optional_loop - optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE; -optional_loop_1 - ".loop" .and space; - -/* - ::= - | "" -*/ -optional_error - error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT; - -/* - :: ".error" -*/ -error - space .and ".error" .and space .and identifier; - -/* - ::= - | -*/ -emit - emit_output .or emit_regbyte; - -/* - ::= ".emit" -*/ -emit_output - space .and ".emit" .and space .and emit_param; - -/* - ::= - | - | - | "*" - | "$" -*/ -emit_param - integer_ne .emit EMIT_INTEGER .or - identifier_ne .emit EMIT_IDENTIFIER .or - character .emit EMIT_CHARACTER .or - '*' .emit EMIT_LAST_CHARACTER .or - '$' .emit EMIT_CURRENT_POSITION; - -/* - ::= ".load" -*/ -emit_regbyte - space .and ".load" .and space .and identifier .and space .and emit_param; - -/* - ::= * -*/ -and_specifiers - and_specifier .and .loop and_specifier; - -/* - ::= * -*/ -or_specifiers - or_specifier .and .loop or_specifier; - -/* - ::= ".and" -*/ -and_specifier - space .and ".and" .and space .and specifier; - -/* - ::= ".or" -*/ -or_specifier - space .and ".or" .and space .and specifier; - - -.string __string_filter; - -/* - <__string_filter> ::= <__first_identifier_char> <__next_identifier_char>* -*/ -__string_filter - __first_identifier_char .and .loop __next_identifier_char; - -/* - <__first_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "." -*/ -__first_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '.'; - -/* - <__next_identifier_char> ::= "a"-"z" - | "A"-"Z" - | "_" - | "0"-"9" -*/ -__next_identifier_char - 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9'; - diff --git a/src/mesa/shader/grammar/grammar_crt.c b/src/mesa/shader/grammar/grammar_crt.c deleted file mode 100644 index d2c95d1c8e7..00000000000 --- a/src/mesa/shader/grammar/grammar_crt.c +++ /dev/null @@ -1,64 +0,0 @@ -#include "grammar_crt.h" - -#define GRAMMAR_PORT_BUILD 1 -#include "grammar.c" -#undef GRAMMAR_PORT_BUILD - - -void grammar_alloc_free (void *ptr) -{ - free (ptr); -} - -void *grammar_alloc_malloc (size_t size) -{ - return malloc (size); -} - -void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size) -{ - return realloc (ptr, size); -} - -void *grammar_memory_copy (void *dst, const void * src, size_t size) -{ - return memcpy (dst, src, size); -} - -int grammar_string_compare (const byte *str1, const byte *str2) -{ - return strcmp ((const char *) str1, (const char *) str2); -} - -int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n) -{ - return strncmp ((const char *) str1, (const char *) str2, n); -} - -byte *grammar_string_copy (byte *dst, const byte *src) -{ - return (byte *) strcpy ((char *) dst, (const char *) src); -} - -byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n) -{ - return (byte *) strncpy ((char *) dst, (const char *) src, n); -} - -unsigned int grammar_string_length (const byte *str) -{ - return strlen ((const char *) str); -} - -byte *grammar_string_duplicate (const byte *src) -{ - const unsigned int size = grammar_string_length (src); - byte *str = grammar_alloc_malloc (size + 1); - if (str != NULL) - { - grammar_memory_copy (str, src, size); - str[size] = '\0'; - } - return str; -} - diff --git a/src/mesa/shader/grammar/grammar_crt.h b/src/mesa/shader/grammar/grammar_crt.h deleted file mode 100644 index 492711e96ae..00000000000 --- a/src/mesa/shader/grammar/grammar_crt.h +++ /dev/null @@ -1,20 +0,0 @@ -#ifndef GRAMMAR_CRT_H -#define GRAMMAR_CRT_H - - -#include -#include -#include - - -typedef unsigned long grammar; -typedef unsigned char byte; - - -#define GRAMMAR_PORT_INCLUDE 1 -#include "grammar.h" -#undef GRAMMAR_PORT_INCLUDE - - -#endif - diff --git a/src/mesa/shader/grammar/grammar_mesa.c b/src/mesa/shader/grammar/grammar_mesa.c deleted file mode 100644 index eb962505bfe..00000000000 --- a/src/mesa/shader/grammar/grammar_mesa.c +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -/** - * \file grammar_mesa.c - * mesa3d port to syntax parsing engine - * \author Michal Krol - */ - -#include "grammar_mesa.h" - -#define GRAMMAR_PORT_BUILD 1 -#include "grammar.c" -#undef GRAMMAR_PORT_BUILD - - -void grammar_alloc_free (void *ptr) -{ - _mesa_free (ptr); -} - -void *grammar_alloc_malloc (size_t size) -{ - return _mesa_malloc (size); -} - -void *grammar_alloc_realloc (void *ptr, size_t old_size, size_t size) -{ - return _mesa_realloc (ptr, old_size, size); -} - -void *grammar_memory_copy (void *dst, const void * src, size_t size) -{ - return _mesa_memcpy (dst, src, size); -} - -int grammar_string_compare (const byte *str1, const byte *str2) -{ - return _mesa_strcmp ((const char *) str1, (const char *) str2); -} - -int grammar_string_compare_n (const byte *str1, const byte *str2, size_t n) -{ - return _mesa_strncmp ((const char *) str1, (const char *) str2, n); -} - -byte *grammar_string_copy (byte *dst, const byte *src) -{ - return (byte *) _mesa_strcpy ((char *) dst, (const char *) src); -} - -byte *grammar_string_copy_n (byte *dst, const byte *src, size_t n) -{ - return (byte *) _mesa_strncpy ((char *) dst, (const char *) src, n); -} - -byte *grammar_string_duplicate (const byte *src) -{ - return (byte *) _mesa_strdup ((const char *) src); -} - -unsigned int grammar_string_length (const byte *str) -{ - return (unsigned int)_mesa_strlen ((const char *) str); -} - diff --git a/src/mesa/shader/grammar/grammar_mesa.h b/src/mesa/shader/grammar/grammar_mesa.h deleted file mode 100644 index beabf1e4e17..00000000000 --- a/src/mesa/shader/grammar/grammar_mesa.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Mesa 3-D graphics library - * Version: 6.1 - * - * Copyright (C) 1999-2004 Brian Paul All Rights Reserved. - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * the rights to use, copy, modify, merge, publish, distribute, sublicense, - * and/or sell copies of the Software, and to permit persons to whom the - * Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included - * in all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS - * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL - * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN - * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN - * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - */ - -#ifndef GRAMMAR_MESA_H -#define GRAMMAR_MESA_H - - -#include "../../glsl/pp/sl_pp_public.h" - -#include "main/imports.h" -/* NOTE: include Mesa 3-D specific headers here */ - - -typedef GLuint grammar; -typedef GLubyte byte; - - -#define GRAMMAR_PORT_INCLUDE 1 -#include "grammar.h" -#undef GRAMMAR_PORT_INCLUDE - - -#endif - diff --git a/src/mesa/shader/grammar/grammar_syn.h b/src/mesa/shader/grammar/grammar_syn.h deleted file mode 100644 index 840a1ab62c2..00000000000 --- a/src/mesa/shader/grammar/grammar_syn.h +++ /dev/null @@ -1,202 +0,0 @@ -".syntax grammar;\n" -".emtcode DECLARATION_END 0\n" -".emtcode DECLARATION_EMITCODE 1\n" -".emtcode DECLARATION_ERRORTEXT 2\n" -".emtcode DECLARATION_REGBYTE 3\n" -".emtcode DECLARATION_LEXER 4\n" -".emtcode DECLARATION_RULE 5\n" -".emtcode SPECIFIER_END 0\n" -".emtcode SPECIFIER_AND_TAG 1\n" -".emtcode SPECIFIER_OR_TAG 2\n" -".emtcode SPECIFIER_CHARACTER_RANGE 3\n" -".emtcode SPECIFIER_CHARACTER 4\n" -".emtcode SPECIFIER_STRING 5\n" -".emtcode SPECIFIER_IDENTIFIER 6\n" -".emtcode SPECIFIER_TRUE 7\n" -".emtcode SPECIFIER_FALSE 8\n" -".emtcode SPECIFIER_DEBUG 9\n" -".emtcode IDENTIFIER_SIMPLE 0\n" -".emtcode IDENTIFIER_LOOP 1\n" -".emtcode ERROR_NOT_PRESENT 0\n" -".emtcode ERROR_PRESENT 1\n" -".emtcode EMIT_NULL 0\n" -".emtcode EMIT_INTEGER 1\n" -".emtcode EMIT_IDENTIFIER 2\n" -".emtcode EMIT_CHARACTER 3\n" -".emtcode EMIT_LAST_CHARACTER 4\n" -".emtcode EMIT_CURRENT_POSITION 5\n" -".errtext INVALID_GRAMMAR \"internal error 2001: invalid grammar script\"\n" -".errtext SYNTAX_EXPECTED \"internal error 2002: '.syntax' keyword expected\"\n" -".errtext IDENTIFIER_EXPECTED \"internal error 2003: identifier expected\"\n" -".errtext MISSING_SEMICOLON \"internal error 2004: missing ';'\"\n" -".errtext INTEGER_EXPECTED \"internal error 2005: integer value expected\"\n" -".errtext STRING_EXPECTED \"internal error 2006: string expected\"\n" -"grammar\n" -" grammar_1 .error INVALID_GRAMMAR;\n" -"grammar_1\n" -" optional_space .and \".syntax\" .error SYNTAX_EXPECTED .and space .and identifier .and\n" -" semicolon .and declaration_list .and optional_space .and '\\0' .emit DECLARATION_END;\n" -"optional_space\n" -" space .or .true;\n" -"space\n" -" single_space .and .loop single_space;\n" -"single_space\n" -" white_char .or comment_block;\n" -"white_char\n" -" ' ' .or '\\t' .or '\\n' .or '\\r';\n" -"comment_block\n" -" '/' .and '*' .and comment_rest;\n" -"comment_rest\n" -" .loop comment_char_no_star .and comment_rest_1;\n" -"comment_rest_1\n" -" comment_end .or comment_rest_2;\n" -"comment_rest_2\n" -" '*' .and comment_rest;\n" -"comment_char_no_star\n" -" '\\x2B'-'\\xFF' .or '\\x01'-'\\x29';\n" -"comment_end\n" -" '*' .and '/';\n" -"identifier\n" -" identifier_ne .error IDENTIFIER_EXPECTED;\n" -"identifier_ne\n" -" first_idchar .emit * .and .loop follow_idchar .emit * .and .true .emit '\\0';\n" -"first_idchar\n" -" 'a'-'z' .or 'A'-'Z' .or '_';\n" -"follow_idchar\n" -" first_idchar .or digit_dec;\n" -"digit_dec\n" -" '0'-'9';\n" -"semicolon\n" -" optional_space .and ';' .error MISSING_SEMICOLON .and optional_space;\n" -"declaration_list\n" -" declaration .and .loop declaration;\n" -"declaration\n" -" emitcode_definition .emit DECLARATION_EMITCODE .or\n" -" errortext_definition .emit DECLARATION_ERRORTEXT .or\n" -" regbyte_definition .emit DECLARATION_REGBYTE .or\n" -" lexer_definition .emit DECLARATION_LEXER .or\n" -" rule_definition .emit DECLARATION_RULE;\n" -"emitcode_definition\n" -" \".emtcode\" .and space .and identifier .and space .and integer .and space_or_null;\n" -"integer\n" -" integer_ne .error INTEGER_EXPECTED;\n" -"integer_ne\n" -" hex_integer .emit 0x10 .or dec_integer .emit 10;\n" -"hex_integer\n" -" hex_prefix .and digit_hex .emit * .and .loop digit_hex .emit * .and .true .emit '\\0';\n" -"hex_prefix\n" -" '0' .and hex_prefix_1;\n" -"hex_prefix_1\n" -" 'x' .or 'X';\n" -"digit_hex\n" -" '0'-'9' .or 'a'-'f' .or 'A'-'F';\n" -"dec_integer\n" -" digit_dec .emit * .and .loop digit_dec .emit * .and .true .emit '\\0';\n" -"space_or_null\n" -" space .or '\\0';\n" -"errortext_definition\n" -" \".errtext\" .and space .and identifier .and space .and string .and space_or_null;\n" -"string\n" -" string_ne .error STRING_EXPECTED;\n" -"string_ne\n" -" '\"' .and .loop string_char_double_quotes .and '\"' .emit '\\0';\n" -"string_char_double_quotes\n" -" escape_sequence .or string_char .emit * .or '\\'' .emit *;\n" -"string_char\n" -" '\\x5D'-'\\xFF' .or '\\x28'-'\\x5B' .or '\\x23'-'\\x26' .or '\\x0E'-'\\x21' .or '\\x0B'-'\\x0C' .or\n" -" '\\x01'-'\\x09';\n" -"escape_sequence\n" -" '\\\\' .emit * .and escape_code;\n" -"escape_code\n" -" simple_escape_code .emit * .or hex_escape_code .or oct_escape_code;\n" -"simple_escape_code\n" -" '\\'' .or '\"' .or '?' .or '\\\\' .or 'a' .or 'b' .or 'f' .or 'n' .or 'r' .or 't' .or 'v';\n" -"hex_escape_code\n" -" 'x' .emit * .and digit_hex .emit * .and .loop digit_hex .emit *;\n" -"oct_escape_code\n" -" digit_oct .emit * .and optional_digit_oct .and optional_digit_oct;\n" -"digit_oct\n" -" '0'-'7';\n" -"optional_digit_oct\n" -" digit_oct .emit * .or .true;\n" -"regbyte_definition\n" -" \".regbyte\" .and space .and identifier .and space .and integer .and space_or_null;\n" -"lexer_definition\n" -" \".string\" .and space .and identifier .and semicolon;\n" -"rule_definition\n" -" identifier_ne .and space .and definition;\n" -"definition\n" -" specifier .and optional_specifiers_and_or .and semicolon .emit SPECIFIER_END;\n" -"optional_specifiers_and_or\n" -" and_specifiers .emit SPECIFIER_AND_TAG .or or_specifiers .emit SPECIFIER_OR_TAG .or .true;\n" -"specifier\n" -" specifier_condition .and optional_space .and specifier_rule;\n" -"specifier_condition\n" -" specifier_condition_1 .or .true;\n" -"specifier_condition_1\n" -" \".if\" .and optional_space .and '(' .and optional_space .and left_operand .and operator .and\n" -" right_operand .and optional_space .and ')';\n" -"left_operand\n" -" identifier;\n" -"operator\n" -" operator_1 .or operator_2;\n" -"operator_1\n" -" optional_space .and '!' .and '=' .and optional_space;\n" -"operator_2\n" -" optional_space .and '=' .and '=' .and optional_space;\n" -"right_operand\n" -" integer;\n" -"specifier_rule\n" -" specifier_rule_1 .and optional_error .and .loop emit .and .true .emit EMIT_NULL;\n" -"specifier_rule_1\n" -" character_range .emit SPECIFIER_CHARACTER_RANGE .or\n" -" character .emit SPECIFIER_CHARACTER .or\n" -" string_ne .emit SPECIFIER_STRING .or\n" -" \".true\" .emit SPECIFIER_TRUE .or\n" -" \".false\" .emit SPECIFIER_FALSE .or\n" -" \".debug\" .emit SPECIFIER_DEBUG .or\n" -" advanced_identifier .emit SPECIFIER_IDENTIFIER;\n" -"character\n" -" '\\'' .and string_char_single_quotes .and '\\'' .emit '\\0';\n" -"string_char_single_quotes\n" -" escape_sequence .or string_char .emit * .or '\"' .emit *;\n" -"character_range\n" -" character .and optional_space .and '-' .and optional_space .and character;\n" -"advanced_identifier\n" -" optional_loop .and identifier;\n" -"optional_loop\n" -" optional_loop_1 .emit IDENTIFIER_LOOP .or .true .emit IDENTIFIER_SIMPLE;\n" -"optional_loop_1\n" -" \".loop\" .and space;\n" -"optional_error\n" -" error .emit ERROR_PRESENT .or .true .emit ERROR_NOT_PRESENT;\n" -"error\n" -" space .and \".error\" .and space .and identifier;\n" -"emit\n" -" emit_output .or emit_regbyte;\n" -"emit_output\n" -" space .and \".emit\" .and space .and emit_param;\n" -"emit_param\n" -" integer_ne .emit EMIT_INTEGER .or\n" -" identifier_ne .emit EMIT_IDENTIFIER .or\n" -" character .emit EMIT_CHARACTER .or\n" -" '*' .emit EMIT_LAST_CHARACTER .or\n" -" '$' .emit EMIT_CURRENT_POSITION;\n" -"emit_regbyte\n" -" space .and \".load\" .and space .and identifier .and space .and emit_param;\n" -"and_specifiers\n" -" and_specifier .and .loop and_specifier;\n" -"or_specifiers\n" -" or_specifier .and .loop or_specifier;\n" -"and_specifier\n" -" space .and \".and\" .and space .and specifier;\n" -"or_specifier\n" -" space .and \".or\" .and space .and specifier;\n" -".string __string_filter;\n" -"__string_filter\n" -" __first_identifier_char .and .loop __next_identifier_char;\n" -"__first_identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '.';\n" -"__next_identifier_char\n" -" 'a'-'z' .or 'A'-'Z' .or '_' .or '0'-'9';\n" -"" diff --git a/src/mesa/shader/slang/descrip.mms b/src/mesa/shader/slang/descrip.mms index 759a01cf040..674b786ac08 100644 --- a/src/mesa/shader/slang/descrip.mms +++ b/src/mesa/shader/slang/descrip.mms @@ -17,7 +17,7 @@ VPATH = RCS -INCDIR = [----.include],[--.main],[--.glapi],[-.slang],[-.grammar],[-] +INCDIR = [----.include],[--.main],[--.glapi],[-.slang],[-] LIBDIR = [----.lib] CFLAGS = /include=($(INCDIR),[])/define=(PTHREADS=1)/name=(as_is,short)/float=ieee/ieee=denorm diff --git a/src/mesa/sources.mak b/src/mesa/sources.mak index 3f1a5592e79..a7a3b9a7f97 100644 --- a/src/mesa/sources.mak +++ b/src/mesa/sources.mak @@ -218,7 +218,6 @@ SHADER_SOURCES = \ shader/arbprogparse.c \ shader/arbprogram.c \ shader/atifragshader.c \ - shader/grammar/grammar_mesa.c \ shader/hash_table.c \ shader/lex.yy.c \ shader/nvfragparse.c \ diff --git a/windows/VC7/mesa/mesa/mesa.vcproj b/windows/VC7/mesa/mesa/mesa.vcproj index 3a93544b03c..caee6c0ca6e 100644 --- a/windows/VC7/mesa/mesa/mesa.vcproj +++ b/windows/VC7/mesa/mesa/mesa.vcproj @@ -22,7 +22,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="NDEBUG,WIN32,_LIB,_DLL,BUILD_GL32,MESA_MINWARN" StringPooling="TRUE" RuntimeLibrary="4" @@ -74,7 +74,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " Optimization="0" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="_DEBUG,WIN32,_LIB,_DLL,BUILD_GL32,MESA_MINWARN" BasicRuntimeChecks="3" RuntimeLibrary="5" @@ -229,33 +229,6 @@ - - - - - - - - - - - - - - - @@ -809,18 +782,6 @@ - - - - - - - - diff --git a/windows/VC8/mesa/mesa/mesa.vcproj b/windows/VC8/mesa/mesa/mesa.vcproj index 993c28ddc17..05bf7d2ea0f 100644 --- a/windows/VC8/mesa/mesa/mesa.vcproj +++ b/windows/VC8/mesa/mesa/mesa.vcproj @@ -43,7 +43,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;_DLL;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="2" @@ -114,7 +114,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " Optimization="0" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="_DEBUG;WIN32;_LIB;_DLL;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE" BasicRuntimeChecks="3" RuntimeLibrary="3" @@ -185,7 +185,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " Optimization="0" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="_DEBUG;WIN32;_LIB;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE" BasicRuntimeChecks="3" RuntimeLibrary="1" @@ -256,7 +256,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/Zm1000 " InlineFunctionExpansion="1" - AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang,../../../../src/mesa/shader/grammar" + AdditionalIncludeDirectories="../../../../include,../../../../src/mesa,../../../../src/mesa/glapi,../../../../src/mesa/main,../../../../src/mesa/shader,../../../../src/mesa/shader/slang" PreprocessorDefinitions="NDEBUG;WIN32;_LIB;BUILD_GL32;MESA_MINWARN;_CRT_SECURE_NO_DEPRECATE" StringPooling="true" RuntimeLibrary="0" @@ -474,10 +474,6 @@ RelativePath="..\..\..\..\src\mesa\glapi\glthread.c" > - - @@ -1359,22 +1355,6 @@ RelativePath="..\..\..\..\src\mesa\glapi\glthread.h" > - - - - - - - - -- cgit v1.2.3 From ec7844537ecdb0b598447e37bf0b7120acd029f3 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sat, 12 Dec 2009 22:31:53 +0100 Subject: nouveau: nv30: Disable swizzled surface usage if any dimension is 1 (Warsow creates a 1x1 front buffer) --- src/gallium/drivers/nv30/nv30_miptree.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index 920fe64c32f..fd7c65f6b37 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -72,6 +72,9 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) mt->base.screen = pscreen; /* Swizzled textures must be POT */ + if ((pt->width0 == 1) || (pt->height0 == 1)) { + mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; + } else if (pt->width0 & (pt->width0 - 1) || pt->height0 & (pt->height0 - 1)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; -- cgit v1.2.3 From b91503f45740e6e2a5db92609aed887b6c7bd460 Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sat, 12 Dec 2009 23:15:08 +0100 Subject: Revert "nouveau: nv30: Disable swizzled surface usage if any dimension is 1 (Warsow creates a 1x1 front buffer)" This reverts commit ec7844537ecdb0b598447e37bf0b7120acd029f3. --- src/gallium/drivers/nv30/nv30_miptree.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/gallium/drivers/nv30/nv30_miptree.c b/src/gallium/drivers/nv30/nv30_miptree.c index fd7c65f6b37..920fe64c32f 100644 --- a/src/gallium/drivers/nv30/nv30_miptree.c +++ b/src/gallium/drivers/nv30/nv30_miptree.c @@ -72,9 +72,6 @@ nv30_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *pt) mt->base.screen = pscreen; /* Swizzled textures must be POT */ - if ((pt->width0 == 1) || (pt->height0 == 1)) { - mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; - } else if (pt->width0 & (pt->width0 - 1) || pt->height0 & (pt->height0 - 1)) mt->base.tex_usage |= NOUVEAU_TEXTURE_USAGE_LINEAR; -- cgit v1.2.3 From 44d8c9add2f095fc365ede751253d9fb7fc5c6e1 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 13 Dec 2009 13:44:49 +0100 Subject: nv50: add craziness for non-constant TXB and TXL If lod or bias can be non-constant across a quad of fragments, we need to execute TEX separately for each value. Don't ask why. --- src/gallium/drivers/nv50/nv50_program.c | 248 ++++++++++++++++++++++++++------ 1 file changed, 204 insertions(+), 44 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index ddb049f3910..2e4279ff83a 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -660,7 +660,7 @@ emit_mov(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src) if (src->type == P_IMMD || src->type == P_CONST) { set_long(pc, e); set_data(pc, src, 0x7f, 9, e); - e->inst[1] |= 0x20000000; /* src0 const? */ + e->inst[1] |= 0x20000000; /* mov from c[] */ } else { if (src->type == P_ATTR) { set_long(pc, e); @@ -675,9 +675,9 @@ emit_mov(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src) if (is_long(e) && !is_immd(e)) { e->inst[1] |= 0x04000000; /* 32-bit */ - e->inst[1] |= 0x0000c000; /* "subsubop" 0x3 */ + e->inst[1] |= 0x0000c000; /* 32-bit c[] load / lane mask 0:1 */ if (!(e->inst[1] & 0x20000000)) - e->inst[1] |= 0x00030000; /* "subsubop" 0xf */ + e->inst[1] |= 0x00030000; /* lane mask 2:3 */ } else e->inst[0] |= 0x00008000; @@ -692,6 +692,17 @@ emit_mov_immdval(struct nv50_pc *pc, struct nv50_reg *dst, float f) FREE(imm); } +static void +emit_nop(struct nv50_pc *pc) +{ + struct nv50_program_exec *e = exec(pc); + + e->inst[0] = 0xf0000000; + set_long(pc, e); + e->inst[1] = 0xe0000000; + emit(pc, e); +} + static boolean check_swap_src_0_1(struct nv50_pc *pc, struct nv50_reg **s0, struct nv50_reg **s1) @@ -810,6 +821,33 @@ set_src_2(struct nv50_pc *pc, struct nv50_reg *src, struct nv50_program_exec *e) e->inst[1] |= ((src->hw & 127) << 14); } +static void +emit_mov_from_pred(struct nv50_pc *pc, struct nv50_reg *dst, int pred) +{ + struct nv50_program_exec *e = exec(pc); + + assert(dst->type == P_TEMP); + e->inst[1] = 0x20000000 | (pred << 12); + set_long(pc, e); + set_dst(pc, dst, e); + + emit(pc, e); +} + +static void +emit_mov_to_pred(struct nv50_pc *pc, int pred, struct nv50_reg *src) +{ + struct nv50_program_exec *e = exec(pc); + + e->inst[0] = 0x000001fc; + e->inst[1] = 0xa0000008; + set_long(pc, e); + set_pred_wr(pc, 1, pred, e); + set_src_0_restricted(pc, src, e); + + emit(pc, e); +} + static void emit_mul(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src0, struct nv50_reg *src1) @@ -1271,6 +1309,65 @@ emit_kil(struct nv50_pc *pc, struct nv50_reg *src) emit(pc, e); } +static struct nv50_program_exec * +emit_branch(struct nv50_pc *pc, int pred, unsigned cc, + struct nv50_program_exec **join) +{ + struct nv50_program_exec *e = exec(pc); + + if (join) { + set_long(pc, e); + e->inst[0] |= 0xa0000002; + emit(pc, e); + *join = e; + e = exec(pc); + } + + set_long(pc, e); + e->inst[0] |= 0x10000002; + if (pred >= 0) + set_pred(pc, cc, pred, e); + emit(pc, e); + return pc->p->exec_tail; +} + +#define QOP_ADD 0 +#define QOP_SUBR 1 +#define QOP_SUB 2 +#define QOP_MOV_SRC1 3 + +/* For a quad of threads / top left, top right, bottom left, bottom right + * pixels, do a different operation, and take src0 from a specific thread. + */ +static void +emit_quadop(struct nv50_pc *pc, struct nv50_reg *dst, int wp, int lane_src0, + struct nv50_reg *src0, struct nv50_reg *src1, ubyte qop) +{ + struct nv50_program_exec *e = exec(pc); + + e->inst[0] = 0xc0000000; + e->inst[1] = 0x80000000; + set_long(pc, e); + e->inst[0] |= lane_src0 << 16; + set_src_0(pc, src0, e); + set_src_2(pc, src1, e); + + if (wp >= 0) + set_pred_wr(pc, 1, wp, e); + + if (dst) + set_dst(pc, dst, e); + else { + e->inst[0] |= 0x000001fc; + e->inst[1] |= 0x00000008; + } + + e->inst[0] |= (qop & 3) << 20; + e->inst[1] |= (qop >> 2) << 22; + + emit(pc, e); +} + static void load_cube_tex_coords(struct nv50_pc *pc, struct nv50_reg *t[4], struct nv50_reg **src, unsigned arg, boolean proj) @@ -1365,6 +1462,94 @@ get_tex_dim(unsigned type, unsigned *dim, unsigned *arg) } } +/* We shouldn't execute TEXLOD if any of the pixels in a quad have + * different LOD values, so branch off groups of equal LOD. + */ +static void +emit_texlod_sequence(struct nv50_pc *pc, struct nv50_reg *tlod, + struct nv50_reg *src, struct nv50_program_exec *tex) +{ + struct nv50_program_exec *join_at; + unsigned i, target = pc->p->exec_size + 7 * 2; + + /* Subtract lod of each pixel from lod of top left pixel, jump + * texlod insn if result is 0, then repeat for 2 other pixels. + */ + emit_quadop(pc, NULL, 0, 0, tlod, tlod, 0x55); + emit_branch(pc, 0, 2, &join_at)->param.index = target; + + for (i = 1; i < 4; ++i) { + emit_quadop(pc, NULL, 0, i, tlod, tlod, 0x55); + emit_branch(pc, 0, 2, NULL)->param.index = target; + } + + emit_mov(pc, tlod, src); /* target */ + emit(pc, tex); /* texlod */ + + join_at->param.index = target + 2 * 2; + emit_nop(pc); + pc->p->exec_tail->inst[1] |= 2; /* join _after_ tex */ +} + +static void +emit_texbias_sequence(struct nv50_pc *pc, struct nv50_reg *t[4], unsigned arg, + struct nv50_program_exec *tex) +{ + struct nv50_program_exec *e; + struct nv50_reg imm_1248, *t123[4][4], *r_bits = alloc_temp(pc, NULL); + int r_pred = 0; + unsigned n, c, i, cc[4] = { 0x0a, 0x13, 0x11, 0x10 }; + + pc->allow32 = FALSE; + ctor_reg(&imm_1248, P_IMMD, -1, ctor_immd_4u32(pc, 1, 2, 4, 8) * 4); + + /* Subtract bias value of thread i from bias values of each thread, + * store result in r_pred, and set bit i in r_bits if result was 0. + */ + assert(arg < 4); + for (i = 0; i < 4; ++i, ++imm_1248.hw) { + emit_quadop(pc, NULL, r_pred, i, t[arg], t[arg], 0x55); + emit_mov(pc, r_bits, &imm_1248); + set_pred(pc, 2, r_pred, pc->p->exec_tail); + } + emit_mov_to_pred(pc, r_pred, r_bits); + + /* The lanes of a quad are now grouped by the bit in r_pred they have + * set. Put the input values for TEX into a new register set for each + * group and execute TEX only for a specific group. + * We cannot use the same register set for each group because we need + * the derivatives, which are implicitly calculated, to be correct. + */ + for (i = 1; i < 4; ++i) { + alloc_temp4(pc, t123[i], 0); + + for (c = 0; c <= arg; ++c) + emit_mov(pc, t123[i][c], t[c]); + + *(e = exec(pc)) = *(tex); + e->inst[0] &= ~0x01fc; + set_dst(pc, t123[i][0], e); + set_pred(pc, cc[i], r_pred, e); + emit(pc, e); + } + /* finally TEX on the original regs (where we kept the input) */ + set_pred(pc, cc[0], r_pred, tex); + emit(pc, tex); + + /* put the 3 * n other results into regs for lane 0 */ + n = popcnt4(((e->inst[0] >> 25) & 0x3) | ((e->inst[1] >> 12) & 0xc)); + for (i = 1; i < 4; ++i) { + for (c = 0; c < n; ++c) { + emit_mov(pc, t[c], t123[i][c]); + set_pred(pc, cc[i], r_pred, pc->p->exec_tail); + } + free_temp4(pc, t123[i]); + } + + emit_nop(pc); + free_temp(pc, r_bits); +} + static void emit_tex(struct nv50_pc *pc, struct nv50_reg **dst, unsigned mask, struct nv50_reg **src, unsigned unit, unsigned type, @@ -1403,18 +1588,25 @@ emit_tex(struct nv50_pc *pc, struct nv50_reg **dst, unsigned mask, emit_mov(pc, t[dim], src[2]); } - if (bias_lod) { - assert(arg < 4); - emit_mov(pc, t[arg++], src[3]); - e->inst[1] |= (bias_lod < 0) ? 0x20000000 : 0x40000000; - } - - e->inst[0] |= (arg - 1) << 22; - e->inst[0] |= (mask & 0x3) << 25; e->inst[1] |= (mask & 0xc) << 12; - emit(pc, e); + if (!bias_lod) { + e->inst[0] |= (arg - 1) << 22; + emit(pc, e); + } else + if (bias_lod < 0) { + e->inst[0] |= arg << 22; + e->inst[1] |= 0x20000000; /* texbias */ + emit_mov(pc, t[arg], src[3]); + emit_texbias_sequence(pc, t, arg, e); + } else { + e->inst[0] |= arg << 22; + e->inst[1] |= 0x40000000; /* texlod */ + emit_mov(pc, t[arg], src[3]); + emit_texlod_sequence(pc, t[arg], src[3], e); + } + #if 1 c = 0; if (mask & 1) emit_mov(pc, dst[0], t[c++]); @@ -1436,38 +1628,6 @@ emit_tex(struct nv50_pc *pc, struct nv50_reg **dst, unsigned mask, #endif } -static void -emit_branch(struct nv50_pc *pc, int pred, unsigned cc, - struct nv50_program_exec **join) -{ - struct nv50_program_exec *e = exec(pc); - - if (join) { - set_long(pc, e); - e->inst[0] |= 0xa0000002; - emit(pc, e); - *join = e; - e = exec(pc); - } - - set_long(pc, e); - e->inst[0] |= 0x10000002; - if (pred >= 0) - set_pred(pc, cc, pred, e); - emit(pc, e); -} - -static void -emit_nop(struct nv50_pc *pc) -{ - struct nv50_program_exec *e = exec(pc); - - e->inst[0] = 0xf0000000; - set_long(pc, e); - e->inst[1] = 0xe0000000; - emit(pc, e); -} - static void emit_ddx(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_reg *src) { -- cgit v1.2.3 From 7b5a6fa0c87a821835161494987994a781401303 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 13 Dec 2009 14:14:41 +0100 Subject: nv50: use m2mf z pos instead of calculating offset manually --- src/gallium/drivers/nv50/nv50_transfer.c | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index 4705f96f572..6a98d806d00 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -16,6 +16,7 @@ struct nv50_transfer { int level_depth; int level_x; int level_y; + int level_z; unsigned nblocksx; unsigned nblocksy; }; @@ -24,10 +25,10 @@ static void nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, struct nouveau_bo *src_bo, unsigned src_offset, int src_pitch, unsigned src_tile_mode, - int sx, int sy, int sw, int sh, int sd, + int sx, int sy, int sz, int sw, int sh, int sd, struct nouveau_bo *dst_bo, unsigned dst_offset, int dst_pitch, unsigned dst_tile_mode, - int dx, int dy, int dw, int dh, int dd, + int dx, int dy, int dz, int dw, int dh, int dd, int cpp, int width, int height, unsigned src_reloc, unsigned dst_reloc) { @@ -56,7 +57,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, OUT_RING (chan, sw * cpp); OUT_RING (chan, sh); OUT_RING (chan, sd); - OUT_RING (chan, 0); + OUT_RING (chan, sz); /* copying only 1 zslice per call */ } if (!dst_bo->tile_flags) { @@ -75,7 +76,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, OUT_RING (chan, dw * cpp); OUT_RING (chan, dh); OUT_RING (chan, dd); - OUT_RING (chan, 0); + OUT_RING (chan, dz); /* copying only 1 zslice per call */ } while (height) { @@ -166,6 +167,7 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, tx->level_depth = u_minify(mt->base.base.depth0, level); tx->level_offset = lvl->image_offset[image]; tx->level_tiling = lvl->tile_mode; + tx->level_z = zslice; tx->level_x = pf_get_nblocksx(pt->format, x); tx->level_y = pf_get_nblocksy(pt->format, y); ret = nouveau_bo_new(dev, NOUVEAU_BO_GART | NOUVEAU_BO_MAP, 0, @@ -175,23 +177,18 @@ nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, return NULL; } - if (pt->target == PIPE_TEXTURE_3D) - tx->level_offset += get_zslice_offset(lvl->tile_mode, zslice, - lvl->pitch, - tx->nblocksy); - if (usage & PIPE_TRANSFER_READ) { nx = pf_get_nblocksx(pt->format, tx->base.width); ny = pf_get_nblocksy(pt->format, tx->base.height); nv50_transfer_rect_m2mf(pscreen, mt->base.bo, tx->level_offset, tx->level_pitch, tx->level_tiling, - x, y, + x, y, zslice, tx->nblocksx, tx->nblocksy, tx->level_depth, tx->bo, 0, tx->base.stride, tx->bo->tile_mode, - 0, 0, + 0, 0, 0, tx->nblocksx, tx->nblocksy, 1, pf_get_blocksize(pt->format), nx, ny, NOUVEAU_BO_VRAM | NOUVEAU_BO_GART, @@ -216,11 +213,11 @@ nv50_transfer_del(struct pipe_transfer *ptx) nv50_transfer_rect_m2mf(pscreen, tx->bo, 0, tx->base.stride, tx->bo->tile_mode, - 0, 0, + 0, 0, 0, tx->nblocksx, tx->nblocksy, 1, mt->base.bo, tx->level_offset, tx->level_pitch, tx->level_tiling, - tx->level_x, tx->level_y, + tx->level_x, tx->level_y, tx->level_z, tx->nblocksx, tx->nblocksy, tx->level_depth, pf_get_blocksize(pt->format), nx, ny, -- cgit v1.2.3 From 079b670111fe41cabf700d089f489d4b116af5eb Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Sun, 13 Dec 2009 14:36:54 +0100 Subject: nv50: add proper zslice offset in miptree_surface --- src/gallium/drivers/nv50/nv50_miptree.c | 27 +++++++++++++++++++++------ src/gallium/drivers/nv50/nv50_transfer.c | 14 -------------- 2 files changed, 21 insertions(+), 20 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_miptree.c b/src/gallium/drivers/nv50/nv50_miptree.c index 795db5872df..9e083b662dd 100644 --- a/src/gallium/drivers/nv50/nv50_miptree.c +++ b/src/gallium/drivers/nv50/nv50_miptree.c @@ -55,6 +55,20 @@ get_tile_mode(unsigned ny, unsigned d) return tile_mode | 0x10; } +static INLINE unsigned +get_zslice_offset(unsigned tile_mode, unsigned z, unsigned pitch, unsigned nb_h) +{ + unsigned tile_h = get_tile_height(tile_mode); + unsigned tile_d = get_tile_depth(tile_mode); + + /* pitch_2d == to next slice within this volume-tile */ + /* pitch_3d == size (in bytes) of a volume-tile */ + unsigned pitch_2d = tile_h * 64; + unsigned pitch_3d = tile_d * align(nb_h, tile_h) * pitch; + + return (z % tile_d) * pitch_2d + (z / tile_d) * pitch_3d; +} + static struct pipe_texture * nv50_miptree_create(struct pipe_screen *pscreen, const struct pipe_texture *tmp) { @@ -188,15 +202,10 @@ nv50_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt, struct nv50_miptree *mt = nv50_miptree(pt); struct nv50_miptree_level *lvl = &mt->level[level]; struct pipe_surface *ps; - int img; + unsigned img = 0; if (pt->target == PIPE_TEXTURE_CUBE) img = face; - else - if (pt->target == PIPE_TEXTURE_3D) - img = zslice; - else - img = 0; ps = CALLOC_STRUCT(pipe_surface); if (!ps) @@ -212,6 +221,12 @@ nv50_miptree_surface_new(struct pipe_screen *pscreen, struct pipe_texture *pt, ps->zslice = zslice; ps->offset = lvl->image_offset[img]; + if (pt->target == PIPE_TEXTURE_3D) { + unsigned nb_h = pf_get_nblocksy(pt->format, ps->height); + ps->offset += get_zslice_offset(lvl->tile_mode, zslice, + lvl->pitch, nb_h); + } + return ps; } diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index 6a98d806d00..104d29a003f 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -119,20 +119,6 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, } } -static INLINE unsigned -get_zslice_offset(unsigned tile_mode, unsigned z, unsigned pitch, unsigned ny) -{ - unsigned tile_h = get_tile_height(tile_mode); - unsigned tile_d = get_tile_depth(tile_mode); - - /* pitch_2d == to next slice within this volume-tile */ - /* pitch_3d == to next slice in next 2D array of blocks */ - unsigned pitch_2d = tile_h * 64; - unsigned pitch_3d = tile_d * align(ny, tile_h) * pitch; - - return (z % tile_d) * pitch_2d + (z / tile_d) * pitch_3d; -} - static struct pipe_transfer * nv50_transfer_new(struct pipe_screen *pscreen, struct pipe_texture *pt, unsigned face, unsigned level, unsigned zslice, -- cgit v1.2.3 From 9d8501bf2742519cc958c5f32122e196b64f8278 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 13 Dec 2009 16:12:11 +0100 Subject: r300: fix glCopyTexSubImage Need to properly setup colorbuffer when dst pitch != dst width. --- src/mesa/drivers/dri/r300/r300_blit.c | 12 ++++-------- src/mesa/drivers/dri/r300/r300_blit.h | 1 + src/mesa/drivers/dri/r300/r300_texcopy.c | 3 +-- 3 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 10e1b3c9124..ff678bac454 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -428,6 +428,7 @@ static void emit_cb_setup(struct r300_context *r300, struct radeon_bo *bo, intptr_t offset, gl_format mesa_format, + unsigned pitch, unsigned width, unsigned height) { @@ -448,7 +449,7 @@ static void emit_cb_setup(struct r300_context *r300, r300_emit_cb_setup(r300, bo, offset, mesa_format, _mesa_get_format_bytes(mesa_format), - _mesa_format_row_stride(mesa_format, width)); + _mesa_format_row_stride(mesa_format, pitch)); BEGIN_BATCH_NO_AUTOSTATE(5); OUT_BATCH_REGSEQ(R300_SC_SCISSORS_TL, 2); @@ -468,18 +469,14 @@ GLboolean r300_blit(struct r300_context *r300, struct radeon_bo *dst_bo, intptr_t dst_offset, gl_format dst_mesaformat, + unsigned dst_pitch, unsigned dst_width, unsigned dst_height) { - //assert(src_width == dst_width); - //assert(src_height == dst_height); - if (src_bo == dst_bo) { return GL_FALSE; } - //return GL_FALSE; - if (0) { fprintf(stderr, "src: width %d, height %d, pitch %d vs %d, format %s\n", src_width, src_height, src_pitch, @@ -511,14 +508,13 @@ GLboolean r300_blit(struct r300_context *r300, emit_pvs_setup(r300, r300->blit.vp_code.body.d, 2); emit_vap_setup(r300, dst_width, dst_height); - emit_cb_setup(r300, dst_bo, dst_offset, dst_mesaformat, dst_width, dst_height); + emit_cb_setup(r300, dst_bo, dst_offset, dst_mesaformat, dst_pitch, dst_width, dst_height); emit_draw_packet(r300, dst_width, dst_height); r300EmitCacheFlush(r300); radeonFlush(r300->radeon.glCtx); - //r300ResetHwState(r300); return GL_TRUE; } \ No newline at end of file diff --git a/src/mesa/drivers/dri/r300/r300_blit.h b/src/mesa/drivers/dri/r300/r300_blit.h index 29c5aa95149..28ffd4ea421 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.h +++ b/src/mesa/drivers/dri/r300/r300_blit.h @@ -40,6 +40,7 @@ GLboolean r300_blit(struct r300_context *r300, struct radeon_bo *dst_bo, intptr_t dst_offset, gl_format dst_mesaformat, + unsigned dst_pitch, unsigned dst_width, unsigned dst_height); diff --git a/src/mesa/drivers/dri/r300/r300_texcopy.c b/src/mesa/drivers/dri/r300/r300_texcopy.c index 5e3a724d4e6..7702a1d67df 100644 --- a/src/mesa/drivers/dri/r300/r300_texcopy.c +++ b/src/mesa/drivers/dri/r300/r300_texcopy.c @@ -63,7 +63,6 @@ do_copy_texsubimage(GLcontext *ctx, assert(timg->mt->bo); assert(timg->base.Width >= dstx + width); assert(timg->base.Height >= dsty + height); - //assert(tobj->mt == timg->mt); intptr_t src_offset = rrb->draw_offset + x * rrb->cpp + y * rrb->pitch; intptr_t dst_offset = radeon_miptree_image_offset(timg->mt, _mesa_tex_target_to_face(target), level); @@ -87,7 +86,7 @@ do_copy_texsubimage(GLcontext *ctx, /* blit from src buffer to texture */ return r300_blit(r300, rrb->bo, src_offset, rrb->base.Format, rrb->pitch, rrb->base.Width, rrb->base.Height, timg->mt->bo ? timg->mt->bo : timg->bo, dst_offset, - timg->base.TexFormat, width, height); + timg->base.TexFormat, timg->base.Width, width, height); } static void -- cgit v1.2.3 From 8403df33e070cf76af8ae96373d8090e8979c897 Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 13 Dec 2009 17:18:50 +0100 Subject: r300: fix regression introduced by da73c1ed The 0 value is correct for I8 format. --- src/mesa/drivers/dri/r300/r300_blit.c | 2 +- src/mesa/drivers/dri/r300/r300_tex.h | 2 +- src/mesa/drivers/dri/r300/r300_texstate.c | 9 +++++---- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index ff678bac454..3523c2792e5 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -141,7 +141,7 @@ static void r300_emit_tx_setup(struct r300_context *r300, assert(width <= 2048); assert(height <= 2048); - assert(r300TranslateTexFormat(mesa_format) != 0); + assert(r300TranslateTexFormat(mesa_format) >= 0); assert(offset % 32 == 0); BEGIN_BATCH(17); diff --git a/src/mesa/drivers/dri/r300/r300_tex.h b/src/mesa/drivers/dri/r300/r300_tex.h index beb10072e9c..6ede0fe25c9 100644 --- a/src/mesa/drivers/dri/r300/r300_tex.h +++ b/src/mesa/drivers/dri/r300/r300_tex.h @@ -51,6 +51,6 @@ extern GLboolean r300ValidateBuffers(GLcontext * ctx); extern void r300InitTextureFuncs(struct dd_function_table *functions); -uint32_t r300TranslateTexFormat(gl_format mesaFormat); +int32_t r300TranslateTexFormat(gl_format mesaFormat); #endif /* __r300_TEX_H__ */ diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c index 6db56ba618f..d4a728381e4 100644 --- a/src/mesa/drivers/dri/r300/r300_texstate.c +++ b/src/mesa/drivers/dri/r300/r300_texstate.c @@ -59,7 +59,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * identically. -- paulus */ -uint32_t r300TranslateTexFormat(gl_format mesaFormat) +int32_t r300TranslateTexFormat(gl_format mesaFormat) { switch (mesaFormat) { @@ -168,7 +168,7 @@ uint32_t r300TranslateTexFormat(gl_format mesaFormat) case MESA_FORMAT_SRGBA_DXT5: return R300_EASY_TX_FORMAT(Y, Z, W, X, DXT5) | R300_TX_FORMAT_GAMMA; default: - return 0; + return -1; } }; @@ -252,12 +252,13 @@ static void setup_hardware_state(r300ContextPtr rmesa, radeonTexObj *t) if (firstImage->_BaseFormat == GL_DEPTH_COMPONENT) { r300SetDepthTexMode(&t->base); } else { - t->pp_txformat = r300TranslateTexFormat(firstImage->TexFormat); - if (t->pp_txformat == 0) { + int32_t txformat = r300TranslateTexFormat(firstImage->TexFormat); + if (txformat < 0) { _mesa_problem(rmesa->radeon.glCtx, "%s: Invalid format %s", __FUNCTION__, _mesa_get_format_name(firstImage->TexFormat)); _mesa_exit(1); } + t->pp_txformat = (uint32_t) txformat; } } -- cgit v1.2.3 From e76bb2f337bc71929578f1a424c74232c48c2d9c Mon Sep 17 00:00:00 2001 From: Maciej Cencora Date: Sun, 13 Dec 2009 17:22:33 +0100 Subject: r300: enable accelerated support for glCopyTexImage only under KMS --- src/mesa/drivers/dri/r300/r300_context.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c index 05005f61c30..3c6ec2a34a8 100644 --- a/src/mesa/drivers/dri/r300/r300_context.c +++ b/src/mesa/drivers/dri/r300/r300_context.c @@ -486,7 +486,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, r300_init_vtbl(&r300->radeon); _mesa_init_driver_functions(&functions); - r300_init_texcopy_functions(&functions); r300InitIoctlFuncs(&functions); r300InitStateFuncs(&functions); r300InitTextureFuncs(&functions); @@ -494,6 +493,10 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual, radeonInitQueryObjFunctions(&functions); radeonInitBufferObjectFuncs(&functions); + if (r300->radeon.radeonScreen->kernel_mm) { + r300_init_texcopy_functions(&functions); + } + if (!radeonInitContext(&r300->radeon, &functions, glVisual, driContextPriv, sharedContextPrivate)) { -- cgit v1.2.3 From d4d880199ead954e79cad141f7a29f7dd17fe7fc Mon Sep 17 00:00:00 2001 From: Patrice Mandin Date: Sun, 13 Dec 2009 20:09:33 +0100 Subject: nouveau: nv50: Add missing ctor_immd_4u32 function --- src/gallium/drivers/nv50/nv50_program.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index 2e4279ff83a..feb3d422864 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -358,7 +358,7 @@ static void kill_temp_temp(struct nv50_pc *pc) { int i; - + for (i = 0; i < pc->temp_temp_nr; i++) free_temp(pc, pc->temp_temp[i]); pc->temp_temp_nr = 0; @@ -373,7 +373,20 @@ ctor_immd(struct nv50_pc *pc, float x, float y, float z, float w) pc->immd_buf[(pc->immd_nr * 4) + 1] = y; pc->immd_buf[(pc->immd_nr * 4) + 2] = z; pc->immd_buf[(pc->immd_nr * 4) + 3] = w; - + + return pc->immd_nr++; +} + +static int +ctor_immd_4u32(struct nv50_pc *pc, uint32_t x, uint32_t y, uint32_t z, uint32_t w) +{ + pc->immd_buf = REALLOC(pc->immd_buf, (pc->immd_nr * 4 * sizeof(uint32_t)), + (pc->immd_nr + 1) * 4 * sizeof(uint32_t)); + pc->immd_buf[(pc->immd_nr * 4) + 0] = x; + pc->immd_buf[(pc->immd_nr * 4) + 1] = y; + pc->immd_buf[(pc->immd_nr * 4) + 2] = z; + pc->immd_buf[(pc->immd_nr * 4) + 3] = w; + return pc->immd_nr++; } -- cgit v1.2.3 From 1778ddaf74aba72df167769bf42150810aac91a3 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Mon, 14 Dec 2009 11:10:16 +0100 Subject: nv50: store immediates as uint32 Sometimes we want non-float immediates, hacking them into floats isn't nice. Sorry, this should have already been committed before. --- src/gallium/drivers/nv50/nv50_program.c | 62 ++++++++++++++++----------------- src/gallium/drivers/nv50/nv50_program.h | 2 +- 2 files changed, 31 insertions(+), 33 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index feb3d422864..fe8ccd03494 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -119,7 +119,7 @@ struct nv50_pc { struct nv50_reg *param; int param_nr; struct nv50_reg *immd; - float *immd_buf; + uint32_t *immd_buf; int immd_nr; struct nv50_reg **addr; int addr_nr; @@ -365,10 +365,13 @@ kill_temp_temp(struct nv50_pc *pc) } static int -ctor_immd(struct nv50_pc *pc, float x, float y, float z, float w) +ctor_immd_4u32(struct nv50_pc *pc, + uint32_t x, uint32_t y, uint32_t z, uint32_t w) { - pc->immd_buf = REALLOC(pc->immd_buf, (pc->immd_nr * 4 * sizeof(float)), - (pc->immd_nr + 1) * 4 * sizeof(float)); + unsigned size = pc->immd_nr * 4 * sizeof(uint32_t); + + pc->immd_buf = REALLOC(pc->immd_buf, size, size + 4 * sizeof(uint32_t)); + pc->immd_buf[(pc->immd_nr * 4) + 0] = x; pc->immd_buf[(pc->immd_nr * 4) + 1] = y; pc->immd_buf[(pc->immd_nr * 4) + 2] = z; @@ -377,17 +380,10 @@ ctor_immd(struct nv50_pc *pc, float x, float y, float z, float w) return pc->immd_nr++; } -static int -ctor_immd_4u32(struct nv50_pc *pc, uint32_t x, uint32_t y, uint32_t z, uint32_t w) +static INLINE int +ctor_immd_4f32(struct nv50_pc *pc, float x, float y, float z, float w) { - pc->immd_buf = REALLOC(pc->immd_buf, (pc->immd_nr * 4 * sizeof(uint32_t)), - (pc->immd_nr + 1) * 4 * sizeof(uint32_t)); - pc->immd_buf[(pc->immd_nr * 4) + 0] = x; - pc->immd_buf[(pc->immd_nr * 4) + 1] = y; - pc->immd_buf[(pc->immd_nr * 4) + 2] = z; - pc->immd_buf[(pc->immd_nr * 4) + 3] = w; - - return pc->immd_nr++; + return ctor_immd_4u32(pc, fui(x), fui(y), fui(z), fui(w)); } static struct nv50_reg * @@ -397,11 +393,11 @@ alloc_immd(struct nv50_pc *pc, float f) unsigned hw; for (hw = 0; hw < pc->immd_nr * 4; hw++) - if (pc->immd_buf[hw] == f) + if (pc->immd_buf[hw] == fui(f)) break; if (hw == pc->immd_nr * 4) - hw = ctor_immd(pc, f, -f, 0.5 * f, 0) * 4; + hw = ctor_immd_4f32(pc, f, -f, 0.5 * f, 0) * 4; ctor_reg(r, P_IMMD, -1, hw); return r; @@ -493,22 +489,24 @@ set_dst(struct nv50_pc *pc, struct nv50_reg *dst, struct nv50_program_exec *e) static INLINE void set_immd(struct nv50_pc *pc, struct nv50_reg *imm, struct nv50_program_exec *e) { - unsigned val; - float f = pc->immd_buf[imm->hw]; + union { + float f; + uint32_t ui; + } u; + u.ui = pc->immd_buf[imm->hw]; - if (imm->mod & NV50_MOD_ABS) - f = fabsf(f); - val = fui((imm->mod & NV50_MOD_NEG) ? -f : f); + u.f = (imm->mod & NV50_MOD_ABS) ? fabsf(u.f) : u.f; + u.f = (imm->mod & NV50_MOD_NEG) ? -u.f : u.f; set_long(pc, e); - /*XXX: can't be predicated - bits overlap.. catch cases where both - * are required and avoid them. */ + /* XXX: can't be predicated - bits overlap; cases where both + * are required should be avoided by using pc->allow32 */ set_pred(pc, 0, 0, e); set_pred_wr(pc, 0, 0, e); e->inst[1] |= 0x00000002 | 0x00000001; - e->inst[0] |= (val & 0x3f) << 16; - e->inst[1] |= (val >> 6) << 2; + e->inst[0] |= (u.ui & 0x3f) << 16; + e->inst[1] |= (u.ui >> 6) << 2; } static INLINE void @@ -2762,10 +2760,10 @@ nv50_program_tx_prep(struct nv50_pc *pc) const struct tgsi_full_immediate *imm = &tp.FullToken.FullImmediate; - ctor_immd(pc, imm->u[0].Float, - imm->u[1].Float, - imm->u[2].Float, - imm->u[3].Float); + ctor_immd_4f32(pc, imm->u[0].Float, + imm->u[1].Float, + imm->u[2].Float, + imm->u[3].Float); } break; case TGSI_TOKEN_TYPE_DECLARATION: @@ -3245,7 +3243,7 @@ nv50_program_validate(struct nv50_context *nv50, struct nv50_program *p) } static void -nv50_program_upload_data(struct nv50_context *nv50, float *map, +nv50_program_upload_data(struct nv50_context *nv50, uint32_t *map, unsigned start, unsigned count, unsigned cbuf) { struct nouveau_channel *chan = nv50->screen->base.channel; @@ -3293,8 +3291,8 @@ nv50_program_validate_data(struct nv50_context *nv50, struct nv50_program *p) if (p->param_nr) { unsigned cb; - float *map = pipe_buffer_map(pscreen, nv50->constbuf[p->type], - PIPE_BUFFER_USAGE_CPU_READ); + uint32_t *map = pipe_buffer_map(pscreen, nv50->constbuf[p->type], + PIPE_BUFFER_USAGE_CPU_READ); if (p->type == PIPE_SHADER_VERTEX) cb = NV50_CB_PVP; diff --git a/src/gallium/drivers/nv50/nv50_program.h b/src/gallium/drivers/nv50/nv50_program.h index 255c7c737ef..4a90c372ce3 100644 --- a/src/gallium/drivers/nv50/nv50_program.h +++ b/src/gallium/drivers/nv50/nv50_program.h @@ -37,7 +37,7 @@ struct nv50_program { struct nouveau_bo *bo; - float *immd; + uint32_t *immd; unsigned immd_nr; unsigned param_nr; -- cgit v1.2.3 From c14be63c5647e4406a0a4d80570a4def593b551b Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Mon, 14 Dec 2009 17:23:22 +0100 Subject: tgsi/ureg: Add ureg_DECL_gs_input(). Allows one to declare GS input registers. --- src/gallium/auxiliary/tgsi/tgsi_ureg.c | 31 +++++++++++++++++++++++++++++-- src/gallium/auxiliary/tgsi/tgsi_ureg.h | 4 ++++ 2 files changed, 33 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.c b/src/gallium/auxiliary/tgsi/tgsi_ureg.c index 3f943845f5b..1e730e53427 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.c @@ -89,6 +89,11 @@ struct ureg_program unsigned vs_inputs[UREG_MAX_INPUT/32]; + struct { + unsigned index; + } gs_input[UREG_MAX_INPUT]; + unsigned nr_gs_inputs; + struct { unsigned semantic_name; unsigned semantic_index; @@ -278,6 +283,22 @@ ureg_DECL_vs_input( struct ureg_program *ureg, } +struct ureg_src +ureg_DECL_gs_input(struct ureg_program *ureg, + unsigned index) +{ + if (ureg->nr_gs_inputs < UREG_MAX_INPUT) { + ureg->gs_input[ureg->nr_gs_inputs].index = index; + ureg->nr_gs_inputs++; + } else { + set_bad(ureg); + } + + /* XXX: Add suport for true 2D input registers. */ + return ureg_src_register(TGSI_FILE_INPUT, index); +} + + struct ureg_dst ureg_DECL_output( struct ureg_program *ureg, unsigned name, @@ -964,8 +985,7 @@ static void emit_decls( struct ureg_program *ureg ) emit_decl_range( ureg, TGSI_FILE_INPUT, i, 1 ); } } - } - else { + } else if (ureg->processor == TGSI_PROCESSOR_FRAGMENT) { for (i = 0; i < ureg->nr_fs_inputs; i++) { emit_decl( ureg, TGSI_FILE_INPUT, @@ -974,6 +994,13 @@ static void emit_decls( struct ureg_program *ureg ) ureg->fs_input[i].semantic_index, ureg->fs_input[i].interp ); } + } else { + for (i = 0; i < ureg->nr_gs_inputs; i++) { + emit_decl_range(ureg, + TGSI_FILE_INPUT, + ureg->gs_input[i].index, + 1); + } } for (i = 0; i < ureg->nr_outputs; i++) { diff --git a/src/gallium/auxiliary/tgsi/tgsi_ureg.h b/src/gallium/auxiliary/tgsi/tgsi_ureg.h index 94cc70a2082..7e3e7bcf1d3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ureg.h +++ b/src/gallium/auxiliary/tgsi/tgsi_ureg.h @@ -133,6 +133,10 @@ struct ureg_src ureg_DECL_vs_input( struct ureg_program *, unsigned index ); +struct ureg_src +ureg_DECL_gs_input(struct ureg_program *, + unsigned index); + struct ureg_dst ureg_DECL_output( struct ureg_program *, unsigned semantic_name, -- cgit v1.2.3 From 2677f199a547f6e44d964b8c34dd7f60d9523ab2 Mon Sep 17 00:00:00 2001 From: Christoph Bumiller Date: Mon, 14 Dec 2009 18:39:13 +0100 Subject: nv50: be more cautious about using reg_instance Trying to free part of nv50_pc->reg_instances[] for an nv50_reg representing an indirect constant resulted in a segmentation fault. --- src/gallium/drivers/nv50/nv50_program.c | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/src/gallium/drivers/nv50/nv50_program.c b/src/gallium/drivers/nv50/nv50_program.c index fe8ccd03494..e496cf4cad8 100644 --- a/src/gallium/drivers/nv50/nv50_program.c +++ b/src/gallium/drivers/nv50/nv50_program.c @@ -156,14 +156,15 @@ struct nv50_pc { static INLINE struct nv50_reg * reg_instance(struct nv50_pc *pc, struct nv50_reg *reg) { - struct nv50_reg *dup = NULL; + struct nv50_reg *ri; + + assert(pc->reg_instance_nr < 16); + ri = &pc->reg_instances[pc->reg_instance_nr++]; if (reg) { - assert(pc->reg_instance_nr < 16); - dup = &pc->reg_instances[pc->reg_instance_nr++]; - *dup = *reg; + *ri = *reg; reg->mod = 0; } - return dup; + return ri; } static INLINE void @@ -1886,7 +1887,7 @@ tgsi_src(struct nv50_pc *pc, int chan, const struct tgsi_full_src_register *src, /* Indicate indirection by setting r->acc < 0 and * use the index field to select the address reg. */ - r = MALLOC_STRUCT(nv50_reg); + r = reg_instance(pc, NULL); swz = tgsi_util_get_src_register_swizzle( &src->Indirect, 0); ctor_reg(r, P_CONST, @@ -1940,6 +1941,8 @@ tgsi_src(struct nv50_pc *pc, int chan, const struct tgsi_full_src_register *src, break; } + if (r && r->acc >= 0 && r != temp) + return reg_instance(pc, r); return r; } @@ -2094,8 +2097,7 @@ nv50_program_tx_insn(struct nv50_pc *pc, for (c = 0; c < 4; c++) if (src_mask & (1 << c)) - src[i][c] = reg_instance(pc, - tgsi_src(pc, c, fs, neg_supp)); + src[i][c] = tgsi_src(pc, c, fs, neg_supp); } brdc = temp = pc->r_brdc; @@ -2466,15 +2468,6 @@ nv50_program_tx_insn(struct nv50_pc *pc, } } - for (i = 0; i < inst->Instruction.NumSrcRegs; i++) { - for (c = 0; c < 4; c++) { - if (!src[i][c]) - continue; - if (src[i][c]->acc < 0 && src[i][c]->type == P_CONST) - FREE(src[i][c]); /* indirect constant */ - } - } - kill_temp_temp(pc); pc->reg_instance_nr = 0; -- cgit v1.2.3 From 41b52aa3362665e08bdc2f75cc9bfdc4debc6eb0 Mon Sep 17 00:00:00 2001 From: Maarten Maathuis Date: Fri, 4 Dec 2009 22:58:22 +0100 Subject: nouveau: avoid running out of relocs - Added flush notify functions for NV30 and NV40. - Flushing mid frame will call flush notify, which will resubmit all relocs. - We don't try to recover from reloc failure yet. --- src/gallium/drivers/nouveau/nouveau_stateobj.h | 49 ++++++++++++++++++++------ src/gallium/drivers/nv04/nv04_surface_2d.c | 9 +++-- src/gallium/drivers/nv30/nv30_context.c | 3 ++ src/gallium/drivers/nv30/nv30_context.h | 1 + src/gallium/drivers/nv30/nv30_state_emit.c | 10 +++++- src/gallium/drivers/nv40/nv40_context.c | 3 ++ src/gallium/drivers/nv40/nv40_context.h | 1 + src/gallium/drivers/nv40/nv40_state_emit.c | 10 +++++- src/gallium/drivers/nv50/nv50_query.c | 2 +- src/gallium/drivers/nv50/nv50_surface.c | 2 ++ src/gallium/drivers/nv50/nv50_transfer.c | 4 +-- 11 files changed, 76 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/nouveau/nouveau_stateobj.h b/src/gallium/drivers/nouveau/nouveau_stateobj.h index 62990f9b6a6..9aee9e49566 100644 --- a/src/gallium/drivers/nouveau/nouveau_stateobj.h +++ b/src/gallium/drivers/nouveau/nouveau_stateobj.h @@ -112,20 +112,30 @@ so_emit(struct nouveau_channel *chan, struct nouveau_stateobj *so) { struct nouveau_pushbuf *pb = chan->pushbuf; unsigned nr, i; + int ret = 0; nr = so->cur - so->push; - if (pb->remaining < nr) - nouveau_pushbuf_flush(chan, nr); + /* This will flush if we need space. + * We don't actually need the marker. + */ + if ((ret = nouveau_pushbuf_marker_emit(chan, nr, so->cur_reloc))) { + debug_printf("so_emit failed marker emit with error %d\n", ret); + return; + } pb->remaining -= nr; memcpy(pb->cur, so->push, nr * 4); for (i = 0; i < so->cur_reloc; i++) { struct nouveau_stateobj_reloc *r = &so->reloc[i]; - nouveau_pushbuf_emit_reloc(chan, pb->cur + r->offset, + if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur + r->offset, r->bo, r->data, 0, r->flags, - r->vor, r->tor); + r->vor, r->tor))) { + debug_printf("so_emit failed reloc with error %d\n", ret); + goto out; + } } +out: pb->cur += nr; } @@ -134,26 +144,45 @@ so_emit_reloc_markers(struct nouveau_channel *chan, struct nouveau_stateobj *so) { struct nouveau_pushbuf *pb = chan->pushbuf; unsigned i; + int ret = 0; if (!so) return; i = so->cur_reloc << 1; - if (pb->remaining < i) - nouveau_pushbuf_flush(chan, i); + /* This will flush if we need space. + * We don't actually need the marker. + */ + if ((ret = nouveau_pushbuf_marker_emit(chan, i, i))) { + debug_printf("so_emit_reloc_markers failed marker emit with" \ + "error %d\n", ret); + return; + } pb->remaining -= i; for (i = 0; i < so->cur_reloc; i++) { struct nouveau_stateobj_reloc *r = &so->reloc[i]; - nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->packet, 0, + if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, + r->packet, 0, (r->flags & (NOUVEAU_BO_VRAM | NOUVEAU_BO_GART | NOUVEAU_BO_RDWR)) | - NOUVEAU_BO_DUMMY, 0, 0); - nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, r->data, 0, + NOUVEAU_BO_DUMMY, 0, 0))) { + debug_printf("so_emit_reloc_markers failed reloc" \ + "with error %d\n", ret); + pb->remaining += ((so->cur_reloc - i) << 1); + return; + } + if ((ret = nouveau_pushbuf_emit_reloc(chan, pb->cur++, r->bo, + r->data, 0, r->flags | NOUVEAU_BO_DUMMY, - r->vor, r->tor); + r->vor, r->tor))) { + debug_printf("so_emit_reloc_markers failed reloc" \ + "with error %d\n", ret); + pb->remaining += ((so->cur_reloc - i) << 1) - 1; + return; + } } } diff --git a/src/gallium/drivers/nv04/nv04_surface_2d.c b/src/gallium/drivers/nv04/nv04_surface_2d.c index 932893eef59..3020806c5d6 100644 --- a/src/gallium/drivers/nv04/nv04_surface_2d.c +++ b/src/gallium/drivers/nv04/nv04_surface_2d.c @@ -133,6 +133,9 @@ nv04_surface_copy_swizzle(struct nv04_surface_2d *ctx, assert(sub_w == w || util_is_pot(sub_w)); assert(sub_h == h || util_is_pot(sub_h)); + MARK_RING (chan, 8 + ((w+sub_w)/sub_w)*((h+sub_h)/sub_h)*17, 2 + + ((w+sub_w)/sub_w)*((h+sub_h)/sub_h)*2); + BEGIN_RING(chan, swzsurf, NV04_SWIZZLED_SURFACE_DMA_IMAGE, 1); OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); @@ -202,7 +205,7 @@ nv04_surface_copy_m2mf(struct nv04_surface_2d *ctx, unsigned src_offset = src->offset + sy * src_pitch + sx * pf_get_blocksize(src->texture->format); - WAIT_RING (chan, 3 + ((h / 2047) + 1) * 9); + MARK_RING (chan, 3 + ((h / 2047) + 1) * 9, 2 + ((h / 2047) + 1) * 2); BEGIN_RING(chan, m2mf, NV04_MEMORY_TO_MEMORY_FORMAT_DMA_BUFFER_IN, 2); OUT_RELOCo(chan, src_bo, NOUVEAU_BO_GART | NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); @@ -250,7 +253,7 @@ nv04_surface_copy_blit(struct nv04_surface_2d *ctx, struct pipe_surface *dst, if (format < 0) return 1; - WAIT_RING (chan, 12); + MARK_RING (chan, 12, 4); BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); OUT_RELOCo(chan, src_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_RD); OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); @@ -315,7 +318,7 @@ nv04_surface_fill(struct nv04_surface_2d *ctx, struct pipe_surface *dst, gdirect_format = nv04_rect_format(dst->format); assert(gdirect_format >= 0); - WAIT_RING (chan, 16); + MARK_RING (chan, 16, 4); BEGIN_RING(chan, surf2d, NV04_CONTEXT_SURFACES_2D_DMA_IMAGE_SOURCE, 2); OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); OUT_RELOCo(chan, dst_bo, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); diff --git a/src/gallium/drivers/nv30/nv30_context.c b/src/gallium/drivers/nv30/nv30_context.c index d8300fd69f6..46a821a48b1 100644 --- a/src/gallium/drivers/nv30/nv30_context.c +++ b/src/gallium/drivers/nv30/nv30_context.c @@ -58,6 +58,9 @@ nv30_create(struct pipe_screen *pscreen, unsigned pctx_id) nv30->pipe.is_texture_referenced = nouveau_is_texture_referenced; nv30->pipe.is_buffer_referenced = nouveau_is_buffer_referenced; + screen->base.channel->user_private = nv30; + screen->base.channel->flush_notify = nv30_state_flush_notify; + nv30_init_query_functions(nv30); nv30_init_surface_functions(nv30); nv30_init_state_functions(nv30); diff --git a/src/gallium/drivers/nv30/nv30_context.h b/src/gallium/drivers/nv30/nv30_context.h index 8d49366dfcb..6f44b1c7fe1 100644 --- a/src/gallium/drivers/nv30/nv30_context.h +++ b/src/gallium/drivers/nv30/nv30_context.h @@ -184,6 +184,7 @@ extern void nv30_fragtex_bind(struct nv30_context *); /* nv30_state.c and friends */ extern boolean nv30_state_validate(struct nv30_context *nv30); extern void nv30_state_emit(struct nv30_context *nv30); +extern void nv30_state_flush_notify(struct nouveau_channel *chan); extern struct nv30_state_entry nv30_state_rasterizer; extern struct nv30_state_entry nv30_state_scissor; extern struct nv30_state_entry nv30_state_stipple; diff --git a/src/gallium/drivers/nv30/nv30_state_emit.c b/src/gallium/drivers/nv30/nv30_state_emit.c index 621b8846c8e..ac52d946f02 100644 --- a/src/gallium/drivers/nv30/nv30_state_emit.c +++ b/src/gallium/drivers/nv30/nv30_state_emit.c @@ -41,7 +41,7 @@ nv30_state_emit(struct nv30_context *nv30) struct nouveau_channel *chan = nv30->screen->base.channel; struct nv30_state *state = &nv30->state; struct nv30_screen *screen = nv30->screen; - unsigned i, samplers; + unsigned i; uint64_t states; if (nv30->pctx_id != screen->cur_pctx) { @@ -63,6 +63,14 @@ nv30_state_emit(struct nv30_context *nv30) } state->dirty = 0; +} + +void +nv30_state_flush_notify(struct nouveau_channel *chan) +{ + struct nv30_context *nv30 = chan->user_private; + struct nv30_state *state = &nv30->state; + unsigned i, samplers; so_emit_reloc_markers(chan, state->hw[NV30_STATE_FB]); for (i = 0, samplers = state->fp_samplers; i < 16 && samplers; i++) { diff --git a/src/gallium/drivers/nv40/nv40_context.c b/src/gallium/drivers/nv40/nv40_context.c index 7f008274a4e..eb9cce4c786 100644 --- a/src/gallium/drivers/nv40/nv40_context.c +++ b/src/gallium/drivers/nv40/nv40_context.c @@ -58,6 +58,9 @@ nv40_create(struct pipe_screen *pscreen, unsigned pctx_id) nv40->pipe.is_texture_referenced = nouveau_is_texture_referenced; nv40->pipe.is_buffer_referenced = nouveau_is_buffer_referenced; + screen->base.channel->user_private = nv40; + screen->base.channel->flush_notify = nv40_state_flush_notify; + nv40_init_query_functions(nv40); nv40_init_surface_functions(nv40); nv40_init_state_functions(nv40); diff --git a/src/gallium/drivers/nv40/nv40_context.h b/src/gallium/drivers/nv40/nv40_context.h index a3d594167aa..cf33b64a86d 100644 --- a/src/gallium/drivers/nv40/nv40_context.h +++ b/src/gallium/drivers/nv40/nv40_context.h @@ -204,6 +204,7 @@ extern void nv40_fragtex_bind(struct nv40_context *); extern boolean nv40_state_validate(struct nv40_context *nv40); extern boolean nv40_state_validate_swtnl(struct nv40_context *nv40); extern void nv40_state_emit(struct nv40_context *nv40); +extern void nv40_state_flush_notify(struct nouveau_channel *chan); extern struct nv40_state_entry nv40_state_rasterizer; extern struct nv40_state_entry nv40_state_scissor; extern struct nv40_state_entry nv40_state_stipple; diff --git a/src/gallium/drivers/nv40/nv40_state_emit.c b/src/gallium/drivers/nv40/nv40_state_emit.c index 198692965dc..ba0fbcb26a9 100644 --- a/src/gallium/drivers/nv40/nv40_state_emit.c +++ b/src/gallium/drivers/nv40/nv40_state_emit.c @@ -57,7 +57,7 @@ nv40_state_emit(struct nv40_context *nv40) struct nouveau_channel *chan = nv40->screen->base.channel; struct nv40_state *state = &nv40->state; struct nv40_screen *screen = nv40->screen; - unsigned i, samplers; + unsigned i; uint64_t states; if (nv40->pctx_id != screen->cur_pctx) { @@ -87,6 +87,14 @@ nv40_state_emit(struct nv40_context *nv40) } state->dirty = 0; +} + +void +nv40_state_flush_notify(struct nouveau_channel *chan) +{ + struct nv40_context *nv40 = chan->user_private; + struct nv40_state *state = &nv40->state; + unsigned i, samplers; so_emit_reloc_markers(chan, state->hw[NV40_STATE_FB]); for (i = 0, samplers = state->fp_samplers; i < 16 && samplers; i++) { diff --git a/src/gallium/drivers/nv50/nv50_query.c b/src/gallium/drivers/nv50/nv50_query.c index 5305c93d59a..268c9823f7d 100644 --- a/src/gallium/drivers/nv50/nv50_query.c +++ b/src/gallium/drivers/nv50/nv50_query.c @@ -93,7 +93,7 @@ nv50_query_end(struct pipe_context *pipe, struct pipe_query *pq) struct nouveau_grobj *tesla = nv50->screen->tesla; struct nv50_query *q = nv50_query(pq); - WAIT_RING (chan, 5); + MARK_RING (chan, 5, 2); /* flush on lack of space or relocs */ BEGIN_RING(chan, tesla, NV50TCL_QUERY_ADDRESS_HIGH, 4); OUT_RELOCh(chan, q->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); OUT_RELOCl(chan, q->bo, 0, NOUVEAU_BO_VRAM | NOUVEAU_BO_WR); diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c index 6bf6f773b0c..79655fc08d5 100644 --- a/src/gallium/drivers/nv50/nv50_surface.c +++ b/src/gallium/drivers/nv50/nv50_surface.c @@ -62,6 +62,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) return 1; if (!bo->tile_flags) { + MARK_RING (chan, 9, 2); /* flush on lack of space or relocs */ BEGIN_RING(chan, eng2d, mthd, 2); OUT_RING (chan, format); OUT_RING (chan, 1); @@ -72,6 +73,7 @@ nv50_surface_set(struct nv50_screen *screen, struct pipe_surface *ps, int dst) OUT_RELOCh(chan, bo, ps->offset, flags); OUT_RELOCl(chan, bo, ps->offset, flags); } else { + MARK_RING (chan, 11, 2); /* flush on lack of space or relocs */ BEGIN_RING(chan, eng2d, mthd, 5); OUT_RING (chan, format); OUT_RING (chan, 0); diff --git a/src/gallium/drivers/nv50/nv50_transfer.c b/src/gallium/drivers/nv50/nv50_transfer.c index 104d29a003f..6240a0c757a 100644 --- a/src/gallium/drivers/nv50/nv50_transfer.c +++ b/src/gallium/drivers/nv50/nv50_transfer.c @@ -82,7 +82,7 @@ nv50_transfer_rect_m2mf(struct pipe_screen *pscreen, while (height) { int line_count = height > 2047 ? 2047 : height; - WAIT_RING (chan, 15); + MARK_RING (chan, 15, 4); /* flush on lack of space or relocs */ BEGIN_RING(chan, m2mf, NV50_MEMORY_TO_MEMORY_FORMAT_OFFSET_IN_HIGH, 2); OUT_RELOCh(chan, src_bo, src_offset, src_reloc); @@ -265,7 +265,7 @@ nv50_upload_sifc(struct nv50_context *nv50, reloc |= NOUVEAU_BO_WR; - WAIT_RING (chan, 32); + MARK_RING (chan, 32, 2); /* flush on lack of space or relocs */ if (bo->tile_flags) { BEGIN_RING(chan, eng2d, NV50_2D_DST_FORMAT, 5); -- cgit v1.2.3 From 3ff688ea299581e60caf5d6e1a464f68c717fe83 Mon Sep 17 00:00:00 2001 From: Zack Rusin Date: Mon, 14 Dec 2009 16:34:07 -0500 Subject: tgsi: add properties and system value register adds support for properties to all parts of the tgsi framework, plus introduces a new register which will be used for system generated values. --- src/gallium/auxiliary/tgsi/tgsi_build.c | 104 +++++++++++++++++++++++ src/gallium/auxiliary/tgsi/tgsi_build.h | 28 +++++++ src/gallium/auxiliary/tgsi/tgsi_dump.c | 70 +++++++++++++++- src/gallium/auxiliary/tgsi/tgsi_dump.h | 5 ++ src/gallium/auxiliary/tgsi/tgsi_exec.c | 8 +- src/gallium/auxiliary/tgsi/tgsi_iterate.c | 6 ++ src/gallium/auxiliary/tgsi/tgsi_iterate.h | 5 ++ src/gallium/auxiliary/tgsi/tgsi_parse.c | 16 ++++ src/gallium/auxiliary/tgsi/tgsi_parse.h | 7 ++ src/gallium/auxiliary/tgsi/tgsi_ppc.c | 7 +- src/gallium/auxiliary/tgsi/tgsi_sanity.c | 12 +++ src/gallium/auxiliary/tgsi/tgsi_scan.c | 21 ++++- src/gallium/auxiliary/tgsi/tgsi_scan.h | 8 +- src/gallium/auxiliary/tgsi/tgsi_sse2.c | 7 +- src/gallium/auxiliary/tgsi/tgsi_text.c | 125 +++++++++++++++++++++++++++- src/gallium/auxiliary/tgsi/tgsi_transform.c | 25 ++++++ src/gallium/auxiliary/tgsi/tgsi_transform.h | 4 + src/gallium/include/pipe/p_shader_tokens.h | 38 ++++++--- 18 files changed, 475 insertions(+), 21 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.c b/src/gallium/auxiliary/tgsi/tgsi_build.c index 4092f78f4a2..92903fe57f3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.c +++ b/src/gallium/auxiliary/tgsi/tgsi_build.c @@ -942,3 +942,107 @@ tgsi_default_full_dst_register( void ) return full_dst_register; } +struct tgsi_property +tgsi_default_property( void ) +{ + struct tgsi_property property; + + property.Type = TGSI_TOKEN_TYPE_PROPERTY; + property.NrTokens = 1; + property.PropertyName = TGSI_PROPERTY_GS_INPUT_PRIM; + property.Padding = 0; + + return property; +} + +struct tgsi_property +tgsi_build_property(unsigned property_name, + struct tgsi_header *header) +{ + struct tgsi_property property; + + property = tgsi_default_property(); + property.PropertyName = property_name; + + header_bodysize_grow( header ); + + return property; +} + + +struct tgsi_full_property +tgsi_default_full_property( void ) +{ + struct tgsi_full_property full_property; + + full_property.Property = tgsi_default_property(); + memset(full_property.u, 0, + sizeof(struct tgsi_property_data) * 8); + + return full_property; +} + +static void +property_grow( + struct tgsi_property *property, + struct tgsi_header *header ) +{ + assert( property->NrTokens < 0xFF ); + + property->NrTokens++; + + header_bodysize_grow( header ); +} + +struct tgsi_property_data +tgsi_build_property_data( + unsigned value, + struct tgsi_property *property, + struct tgsi_header *header ) +{ + struct tgsi_property_data property_data; + + property_data.Data = value; + + property_grow( property, header ); + + return property_data; +} + +unsigned +tgsi_build_full_property( + const struct tgsi_full_property *full_prop, + struct tgsi_token *tokens, + struct tgsi_header *header, + unsigned maxsize ) +{ + unsigned size = 0, i; + struct tgsi_property *property; + + if( maxsize <= size ) + return 0; + property = (struct tgsi_property *) &tokens[size]; + size++; + + *property = tgsi_build_property( + TGSI_PROPERTY_GS_INPUT_PRIM, + header ); + + assert( full_prop->Property.NrTokens <= 8 + 1 ); + + for( i = 0; i < full_prop->Property.NrTokens - 1; i++ ) { + struct tgsi_property_data *data; + + if( maxsize <= size ) + return 0; + data = (struct tgsi_property_data *) &tokens[size]; + size++; + + *data = tgsi_build_property_data( + full_prop->u[i].Data, + property, + header ); + } + + return size; +} diff --git a/src/gallium/auxiliary/tgsi/tgsi_build.h b/src/gallium/auxiliary/tgsi/tgsi_build.h index ffea786770c..9de2757fe40 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_build.h +++ b/src/gallium/auxiliary/tgsi/tgsi_build.h @@ -126,6 +126,34 @@ tgsi_build_full_immediate( struct tgsi_header *header, unsigned maxsize ); +/* + * properties + */ + +struct tgsi_property +tgsi_default_property( void ); + +struct tgsi_property +tgsi_build_property( + unsigned property_name, + struct tgsi_header *header ); + +struct tgsi_full_property +tgsi_default_full_property( void ); + +struct tgsi_property_data +tgsi_build_property_data( + unsigned value, + struct tgsi_property *property, + struct tgsi_header *header ); + +unsigned +tgsi_build_full_property( + const struct tgsi_full_property *full_prop, + struct tgsi_token *tokens, + struct tgsi_header *header, + unsigned maxsize ); + /* * instruction */ diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.c b/src/gallium/auxiliary/tgsi/tgsi_dump.c index d09ab925656..ba1357697d1 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.c +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.c @@ -101,7 +101,8 @@ static const char *file_names[TGSI_FILE_COUNT] = "ADDR", "IMM", "LOOP", - "PRED" + "PRED", + "SV" }; static const char *interpolate_names[] = @@ -149,6 +150,27 @@ static const char *texture_names[] = "SHADOWRECT" }; +static const char *property_names[] = +{ + "GS_INPUT_PRIMITIVE", + "GS_OUTPUT_PRIMITIVE", + "GS_MAX_OUTPUT_VERTICES" +}; + +static const char *primitive_names[] = +{ + "POINTS", + "LINES", + "LINE_LOOP", + "LINE_STRIP", + "TRIANGLES", + "TRIANGLE_STRIP", + "TRIANGLE_FAN", + "QUADS", + "QUAD_STRIP", + "POLYGON" +}; + static void _dump_register( @@ -272,6 +294,50 @@ tgsi_dump_declaration( iter_declaration( &ctx.iter, (struct tgsi_full_declaration *)decl ); } +static boolean +iter_property( + struct tgsi_iterate_context *iter, + struct tgsi_full_property *prop ) +{ + int i; + struct dump_ctx *ctx = (struct dump_ctx *)iter; + + assert(Elements(property_names) == TGSI_PROPERTY_COUNT); + + TXT( "PROPERTY " ); + ENM(prop->Property.PropertyName, property_names); + + if (prop->Property.NrTokens > 1) + TXT(" "); + + for (i = 0; i < prop->Property.NrTokens - 1; ++i) { + switch (prop->Property.PropertyName) { + case TGSI_PROPERTY_GS_INPUT_PRIM: + case TGSI_PROPERTY_GS_OUTPUT_PRIM: + ENM(prop->u[i].Data, primitive_names); + break; + default: + SID( prop->u[i].Data ); + break; + } + if (i < prop->Property.NrTokens - 2) + TXT( ", " ); + } + EOL(); + + return TRUE; +} + +void tgsi_dump_property( + const struct tgsi_full_property *prop ) +{ + struct dump_ctx ctx; + + ctx.printf = dump_ctx_printf; + + iter_property( &ctx.iter, (struct tgsi_full_property *)prop ); +} + static boolean iter_immediate( struct tgsi_iterate_context *iter, @@ -492,6 +558,7 @@ tgsi_dump( ctx.iter.iterate_instruction = iter_instruction; ctx.iter.iterate_declaration = iter_declaration; ctx.iter.iterate_immediate = iter_immediate; + ctx.iter.iterate_property = iter_property; ctx.iter.epilog = NULL; ctx.instno = 0; @@ -546,6 +613,7 @@ tgsi_dump_str( ctx.base.iter.iterate_instruction = iter_instruction; ctx.base.iter.iterate_declaration = iter_declaration; ctx.base.iter.iterate_immediate = iter_immediate; + ctx.base.iter.iterate_property = iter_property; ctx.base.iter.epilog = NULL; ctx.base.instno = 0; diff --git a/src/gallium/auxiliary/tgsi/tgsi_dump.h b/src/gallium/auxiliary/tgsi/tgsi_dump.h index ad1e647ec90..4cd27317b36 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_dump.h +++ b/src/gallium/auxiliary/tgsi/tgsi_dump.h @@ -49,6 +49,7 @@ tgsi_dump( struct tgsi_full_immediate; struct tgsi_full_instruction; struct tgsi_full_declaration; +struct tgsi_full_property; void tgsi_dump_immediate( @@ -63,6 +64,10 @@ void tgsi_dump_declaration( const struct tgsi_full_declaration *decl ); +void +tgsi_dump_property( + const struct tgsi_full_property *prop ); + #if defined __cplusplus } #endif diff --git a/src/gallium/auxiliary/tgsi/tgsi_exec.c b/src/gallium/auxiliary/tgsi/tgsi_exec.c index 22984c32320..717358620c5 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_exec.c +++ b/src/gallium/auxiliary/tgsi/tgsi_exec.c @@ -336,6 +336,9 @@ tgsi_exec_machine_bind_shader( numInstructions++; break; + case TGSI_TOKEN_TYPE_PROPERTY: + break; + default: assert( 0 ); } @@ -1158,6 +1161,7 @@ fetch_src_file_channel( break; case TGSI_FILE_INPUT: + case TGSI_FILE_SYSTEM_VALUE: chan->u[0] = mach->Inputs[index->i[0]].xyzw[swizzle].u[0]; chan->u[1] = mach->Inputs[index->i[1]].xyzw[swizzle].u[1]; chan->u[2] = mach->Inputs[index->i[2]].xyzw[swizzle].u[2]; @@ -1302,6 +1306,7 @@ fetch_source( */ switch (reg->Register.File) { case TGSI_FILE_INPUT: + case TGSI_FILE_SYSTEM_VALUE: index.i[0] *= TGSI_EXEC_MAX_INPUT_ATTRIBS; index.i[1] *= TGSI_EXEC_MAX_INPUT_ATTRIBS; index.i[2] *= TGSI_EXEC_MAX_INPUT_ATTRIBS; @@ -1892,7 +1897,8 @@ exec_declaration(struct tgsi_exec_machine *mach, const struct tgsi_full_declaration *decl) { if (mach->Processor == TGSI_PROCESSOR_FRAGMENT) { - if (decl->Declaration.File == TGSI_FILE_INPUT) { + if (decl->Declaration.File == TGSI_FILE_INPUT || + decl->Declaration.File == TGSI_FILE_SYSTEM_VALUE) { uint first, last, mask; first = decl->Range.First; diff --git a/src/gallium/auxiliary/tgsi/tgsi_iterate.c b/src/gallium/auxiliary/tgsi/tgsi_iterate.c index 7b384f5e12a..0ba5fe48419 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_iterate.c +++ b/src/gallium/auxiliary/tgsi/tgsi_iterate.c @@ -66,6 +66,12 @@ tgsi_iterate_shader( goto fail; break; + case TGSI_TOKEN_TYPE_PROPERTY: + if (ctx->iterate_property) + if (!ctx->iterate_property( ctx, &parse.FullToken.FullProperty )) + goto fail; + break; + default: assert( 0 ); } diff --git a/src/gallium/auxiliary/tgsi/tgsi_iterate.h b/src/gallium/auxiliary/tgsi/tgsi_iterate.h index ef5a33ebce9..8d67f22c429 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_iterate.h +++ b/src/gallium/auxiliary/tgsi/tgsi_iterate.h @@ -56,6 +56,11 @@ struct tgsi_iterate_context struct tgsi_iterate_context *ctx, struct tgsi_full_immediate *imm ); + boolean + (* iterate_property)( + struct tgsi_iterate_context *ctx, + struct tgsi_full_property *prop ); + boolean (* epilog)( struct tgsi_iterate_context *ctx ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.c b/src/gallium/auxiliary/tgsi/tgsi_parse.c index 8f2b6a307d3..fa65ecb9975 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.c +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.c @@ -220,6 +220,22 @@ tgsi_parse_token( break; } + case TGSI_TOKEN_TYPE_PROPERTY: + { + struct tgsi_full_property *prop = &ctx->FullToken.FullProperty; + uint prop_count; + + memset(prop, 0, sizeof *prop); + copy_token(&prop->Property, &token); + + prop_count = prop->Property.NrTokens - 1; + for (i = 0; i < prop_count; i++) { + next_token(ctx, &prop->u[i]); + } + + break; + } + default: assert( 0 ); } diff --git a/src/gallium/auxiliary/tgsi/tgsi_parse.h b/src/gallium/auxiliary/tgsi/tgsi_parse.h index 3aa1979a63a..439a57269b7 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_parse.h +++ b/src/gallium/auxiliary/tgsi/tgsi_parse.h @@ -67,6 +67,12 @@ struct tgsi_full_immediate union tgsi_immediate_data u[4]; }; +struct tgsi_full_property +{ + struct tgsi_property Property; + struct tgsi_property_data u[8]; +}; + #define TGSI_FULL_MAX_DST_REGISTERS 2 #define TGSI_FULL_MAX_SRC_REGISTERS 4 /* TXD has 4 */ @@ -86,6 +92,7 @@ union tgsi_full_token struct tgsi_full_declaration FullDeclaration; struct tgsi_full_immediate FullImmediate; struct tgsi_full_instruction FullInstruction; + struct tgsi_full_property FullProperty; }; struct tgsi_parse_context diff --git a/src/gallium/auxiliary/tgsi/tgsi_ppc.c b/src/gallium/auxiliary/tgsi/tgsi_ppc.c index da6ad6da04c..138d2d095bb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_ppc.c +++ b/src/gallium/auxiliary/tgsi/tgsi_ppc.c @@ -293,6 +293,7 @@ emit_fetch(struct gen_context *gen, case TGSI_SWIZZLE_W: switch (reg->Register.File) { case TGSI_FILE_INPUT: + case TGSI_FILE_SYSTEM_VALUE: { int offset = (reg->Register.Index * 4 + swizzle) * 16; int offset_reg = emit_li_offset(gen, offset); @@ -1173,7 +1174,8 @@ emit_declaration( struct ppc_function *func, struct tgsi_full_declaration *decl ) { - if( decl->Declaration.File == TGSI_FILE_INPUT ) { + if( decl->Declaration.File == TGSI_FILE_INPUT || + decl->Declaration.File == TGSI_FILE_SYSTEM_VALUE ) { #if 0 unsigned first, last, mask; unsigned i, j; @@ -1339,6 +1341,9 @@ tgsi_emit_ppc(const struct tgsi_token *tokens, } break; + case TGSI_TOKEN_TYPE_PROPERTY: + break; + default: ok = 0; assert( 0 ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_sanity.c b/src/gallium/auxiliary/tgsi/tgsi_sanity.c index b5d1faa897a..c27579e7942 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sanity.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sanity.c @@ -324,6 +324,17 @@ iter_immediate( return TRUE; } + +static boolean +iter_property( + struct tgsi_iterate_context *iter, + struct tgsi_full_property *prop ) +{ + /*struct sanity_check_ctx *ctx = (struct sanity_check_ctx *) iter;*/ + + return TRUE; +} + static boolean epilog( struct tgsi_iterate_context *iter ) @@ -367,6 +378,7 @@ tgsi_sanity_check( ctx.iter.iterate_instruction = iter_instruction; ctx.iter.iterate_declaration = iter_declaration; ctx.iter.iterate_immediate = iter_immediate; + ctx.iter.iterate_property = iter_property; ctx.iter.epilog = epilog; memset( ctx.regs_decl, 0, sizeof( ctx.regs_decl ) ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.c b/src/gallium/auxiliary/tgsi/tgsi_scan.c index a5d2db04ec1..5f5c95bfbdb 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.c +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.c @@ -97,7 +97,8 @@ tgsi_scan_shader(const struct tgsi_token *tokens, for (i = 0; i < fullinst->Instruction.NumSrcRegs; i++) { const struct tgsi_full_src_register *src = &fullinst->Src[i]; - if (src->Register.File == TGSI_FILE_INPUT) { + if (src->Register.File == TGSI_FILE_INPUT || + src->Register.File == TGSI_FILE_SYSTEM_VALUE) { const int ind = src->Register.Index; if (info->input_semantic_name[ind] == TGSI_SEMANTIC_FOG) { if (src->Register.SwizzleX == TGSI_SWIZZLE_X) { @@ -128,7 +129,7 @@ tgsi_scan_shader(const struct tgsi_token *tokens, info->file_count[file]++; info->file_max[file] = MAX2(info->file_max[file], (int)reg); - if (file == TGSI_FILE_INPUT) { + if (file == TGSI_FILE_INPUT || file == TGSI_FILE_SYSTEM_VALUE) { info->input_semantic_name[reg] = (ubyte)fulldecl->Semantic.Name; info->input_semantic_index[reg] = (ubyte)fulldecl->Semantic.Index; info->input_interpolate[reg] = (ubyte)fulldecl->Declaration.Interpolate; @@ -160,6 +161,19 @@ tgsi_scan_shader(const struct tgsi_token *tokens, info->file_max[file] = MAX2(info->file_max[file], (int)reg); } break; + case TGSI_TOKEN_TYPE_PROPERTY: + { + const struct tgsi_full_property *fullprop + = &parse.FullToken.FullProperty; + + info->properties[info->num_properties].name = + fullprop->Property.PropertyName; + memcpy(info->properties[info->num_properties].data, + fullprop->u, 8 * sizeof(unsigned));; + + ++info->num_properties; + } + break; default: assert( 0 ); @@ -212,6 +226,7 @@ tgsi_is_passthrough_shader(const struct tgsi_token *tokens) /* Do a whole bunch of checks for a simple move */ if (fullinst->Instruction.Opcode != TGSI_OPCODE_MOV || src->Register.File != TGSI_FILE_INPUT || + src->Register.File != TGSI_FILE_SYSTEM_VALUE || dst->Register.File != TGSI_FILE_OUTPUT || src->Register.Index != dst->Register.Index || @@ -235,6 +250,8 @@ tgsi_is_passthrough_shader(const struct tgsi_token *tokens) /* fall-through */ case TGSI_TOKEN_TYPE_IMMEDIATE: /* fall-through */ + case TGSI_TOKEN_TYPE_PROPERTY: + /* fall-through */ default: ; /* no-op */ } diff --git a/src/gallium/auxiliary/tgsi/tgsi_scan.h b/src/gallium/auxiliary/tgsi/tgsi_scan.h index 8a7ee0c7e4f..a1e8a4f6bb7 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_scan.h +++ b/src/gallium/auxiliary/tgsi/tgsi_scan.h @@ -33,7 +33,6 @@ #include "pipe/p_state.h" #include "pipe/p_shader_tokens.h" - /** * Shader summary info */ @@ -61,8 +60,13 @@ struct tgsi_shader_info boolean uses_kill; /**< KIL or KILP instruction used? */ boolean uses_fogcoord; /**< fragment shader uses fog coord? */ boolean uses_frontfacing; /**< fragment shader uses front/back-face flag? */ -}; + struct { + unsigned name; + unsigned data[8]; + } properties[TGSI_PROPERTY_COUNT]; + uint num_properties; +}; extern void tgsi_scan_shader(const struct tgsi_token *tokens, diff --git a/src/gallium/auxiliary/tgsi/tgsi_sse2.c b/src/gallium/auxiliary/tgsi/tgsi_sse2.c index 76051ea0d8e..d63c75dafb3 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_sse2.c +++ b/src/gallium/auxiliary/tgsi/tgsi_sse2.c @@ -1288,6 +1288,7 @@ emit_fetch( break; case TGSI_FILE_INPUT: + case TGSI_FILE_SYSTEM_VALUE: emit_inputf( func, xmm, @@ -2633,7 +2634,8 @@ emit_declaration( struct x86_function *func, struct tgsi_full_declaration *decl ) { - if( decl->Declaration.File == TGSI_FILE_INPUT ) { + if( decl->Declaration.File == TGSI_FILE_INPUT || + decl->Declaration.File == TGSI_FILE_SYSTEM_VALUE ) { unsigned first, last, mask; unsigned i, j; @@ -2952,6 +2954,9 @@ tgsi_emit_sse2( num_immediates++; } break; + case TGSI_TOKEN_TYPE_PROPERTY: + /* we just ignore them for now */ + break; default: ok = 0; diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index eb376fa9572..5a17b9d5d4e 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -27,6 +27,7 @@ #include "util/u_debug.h" #include "util/u_memory.h" +#include "pipe/p_defines.h" #include "tgsi_text.h" #include "tgsi_build.h" #include "tgsi_info.h" @@ -110,6 +111,20 @@ static boolean parse_uint( const char **pcur, uint *val ) return FALSE; } +static boolean parse_identifier( const char **pcur, char *ret ) +{ + const char *cur = *pcur; + int i = 0; + if (is_alpha_underscore( cur )) { + ret[i++] = *cur++; + while (is_alpha_underscore( cur )) + ret[i++] = *cur++; + *pcur = cur; + return TRUE; + } + return FALSE; +} + /* Parse floating point. */ static boolean parse_float( const char **pcur, float *val ) @@ -229,7 +244,8 @@ static const char *file_names[TGSI_FILE_COUNT] = "ADDR", "IMM", "LOOP", - "PRED" + "PRED", + "SV" }; static boolean @@ -939,6 +955,107 @@ static boolean parse_immediate( struct translate_ctx *ctx ) return TRUE; } +static const char *property_names[] = +{ + "GS_INPUT_PRIMITIVE", + "GS_OUTPUT_PRIMITIVE", + "GS_MAX_OUTPUT_VERTICES" +}; + +static const char *primitive_names[] = +{ + "POINTS", + "LINES", + "LINE_LOOP", + "LINE_STRIP", + "TRIANGLES", + "TRIANGLE_STRIP", + "TRIANGLE_FAN", + "QUADS", + "QUAD_STRIP", + "POLYGON" +}; + +static boolean +parse_primitive( const char **pcur, uint *primitive ) +{ + uint i; + + for (i = 0; i < PIPE_PRIM_MAX; i++) { + const char *cur = *pcur; + + if (str_match_no_case( &cur, primitive_names[i])) { + *primitive = i; + *pcur = cur; + return TRUE; + } + } + return FALSE; +} + + +static boolean parse_property( struct translate_ctx *ctx ) +{ + struct tgsi_full_property prop; + uint property_name; + uint values[8]; + uint advance; + char id[64]; + + if (!eat_white( &ctx->cur )) { + report_error( ctx, "Syntax error" ); + return FALSE; + } + if (!parse_identifier( &ctx->cur, id )) { + report_error( ctx, "Syntax error" ); + return FALSE; + } + for (property_name = 0; property_name < TGSI_PROPERTY_COUNT; + ++property_name) { + if (strncasecmp(id, property_names[property_name], + strlen(property_names[property_name]))) { + break; + } + } + if (property_name >= TGSI_PROPERTY_COUNT) { + debug_printf( "\nError: Unknown property : '%s'", id ); + return FALSE; + } + + eat_opt_white( &ctx->cur ); + switch(property_name) { + case TGSI_PROPERTY_GS_INPUT_PRIM: + case TGSI_PROPERTY_GS_OUTPUT_PRIM: + if (!parse_primitive(&ctx->cur, &values[0] )) { + report_error( ctx, "Unknown primitive name as property!" ); + return FALSE; + } + break; + default: + if (!parse_uint(&ctx->cur, &values[0] )) { + report_error( ctx, "Expected unsigned integer as property!" ); + return FALSE; + } + } + + prop = tgsi_default_full_property(); + prop.Property.PropertyName = property_name; + prop.Property.NrTokens += 1; + prop.u[0].Data = values[0]; + + advance = tgsi_build_full_property( + &prop, + ctx->tokens_cur, + ctx->header, + (uint) (ctx->tokens_end - ctx->tokens_cur) ); + if (advance == 0) + return FALSE; + ctx->tokens_cur += advance; + + return TRUE; +} + + static boolean translate( struct translate_ctx *ctx ) { eat_opt_white( &ctx->cur ); @@ -947,7 +1064,6 @@ static boolean translate( struct translate_ctx *ctx ) while (*ctx->cur != '\0') { uint label_val = 0; - if (!eat_white( &ctx->cur )) { report_error( ctx, "Syntax error" ); return FALSE; @@ -955,7 +1071,6 @@ static boolean translate( struct translate_ctx *ctx ) if (*ctx->cur == '\0') break; - if (parse_label( ctx, &label_val )) { if (!parse_instruction( ctx, TRUE )) return FALSE; @@ -968,6 +1083,10 @@ static boolean translate( struct translate_ctx *ctx ) if (!parse_immediate( ctx )) return FALSE; } + else if (str_match_no_case( &ctx->cur, "PROPERTY" )) { + if (!parse_property( ctx )) + return FALSE; + } else if (!parse_instruction( ctx, FALSE )) { return FALSE; } diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.c b/src/gallium/auxiliary/tgsi/tgsi_transform.c index 8b8f489b355..ae875f29abf 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.c +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.c @@ -79,6 +79,19 @@ emit_immediate(struct tgsi_transform_context *ctx, } +static void +emit_property(struct tgsi_transform_context *ctx, + const struct tgsi_full_property *prop) +{ + uint ti = ctx->ti; + + ti += tgsi_build_full_property(prop, + ctx->tokens_out + ti, + ctx->header, + ctx->max_tokens_out - ti); + ctx->ti = ti; +} + /** * Apply user-defined transformations to the input shader to produce @@ -110,6 +123,7 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, ctx->emit_instruction = emit_instruction; ctx->emit_declaration = emit_declaration; ctx->emit_immediate = emit_immediate; + ctx->emit_property = emit_property; ctx->tokens_out = tokens_out; ctx->max_tokens_out = max_tokens_out; @@ -182,6 +196,17 @@ tgsi_transform_shader(const struct tgsi_token *tokens_in, ctx->emit_immediate(ctx, fullimm); } break; + case TGSI_TOKEN_TYPE_PROPERTY: + { + struct tgsi_full_property *fullprop + = &parse.FullToken.FullProperty; + + if (ctx->transform_property) + ctx->transform_property(ctx, fullprop); + else + ctx->emit_property(ctx, fullprop); + } + break; default: assert( 0 ); diff --git a/src/gallium/auxiliary/tgsi/tgsi_transform.h b/src/gallium/auxiliary/tgsi/tgsi_transform.h index a121adbaef4..818478e277a 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_transform.h +++ b/src/gallium/auxiliary/tgsi/tgsi_transform.h @@ -53,6 +53,8 @@ struct tgsi_transform_context void (*transform_immediate)(struct tgsi_transform_context *ctx, struct tgsi_full_immediate *imm); + void (*transform_property)(struct tgsi_transform_context *ctx, + struct tgsi_full_property *prop); /** * Called at end of input program to allow caller to append extra @@ -73,6 +75,8 @@ struct tgsi_transform_context const struct tgsi_full_declaration *decl); void (*emit_immediate)(struct tgsi_transform_context *ctx, const struct tgsi_full_immediate *imm); + void (*emit_property)(struct tgsi_transform_context *ctx, + const struct tgsi_full_property *prop); struct tgsi_header *header; uint max_tokens_out; diff --git a/src/gallium/include/pipe/p_shader_tokens.h b/src/gallium/include/pipe/p_shader_tokens.h index 588ca5e026d..79f3d3f0566 100644 --- a/src/gallium/include/pipe/p_shader_tokens.h +++ b/src/gallium/include/pipe/p_shader_tokens.h @@ -55,6 +55,7 @@ struct tgsi_processor #define TGSI_TOKEN_TYPE_DECLARATION 0 #define TGSI_TOKEN_TYPE_IMMEDIATE 1 #define TGSI_TOKEN_TYPE_INSTRUCTION 2 +#define TGSI_TOKEN_TYPE_PROPERTY 3 struct tgsi_token { @@ -64,16 +65,17 @@ struct tgsi_token }; enum tgsi_file_type { - TGSI_FILE_NULL =0, - TGSI_FILE_CONSTANT =1, - TGSI_FILE_INPUT =2, - TGSI_FILE_OUTPUT =3, - TGSI_FILE_TEMPORARY =4, - TGSI_FILE_SAMPLER =5, - TGSI_FILE_ADDRESS =6, - TGSI_FILE_IMMEDIATE =7, - TGSI_FILE_LOOP =8, - TGSI_FILE_PREDICATE =9, + TGSI_FILE_NULL =0, + TGSI_FILE_CONSTANT =1, + TGSI_FILE_INPUT =2, + TGSI_FILE_OUTPUT =3, + TGSI_FILE_TEMPORARY =4, + TGSI_FILE_SAMPLER =5, + TGSI_FILE_ADDRESS =6, + TGSI_FILE_IMMEDIATE =7, + TGSI_FILE_LOOP =8, + TGSI_FILE_PREDICATE =9, + TGSI_FILE_SYSTEM_VALUE =10, TGSI_FILE_COUNT /**< how many TGSI_FILE_ types */ }; @@ -151,6 +153,22 @@ union tgsi_immediate_data float Float; }; +#define TGSI_PROPERTY_GS_INPUT_PRIM 0 +#define TGSI_PROPERTY_GS_OUTPUT_PRIM 1 +#define TGSI_PROPERTY_GS_MAX_VERTICES 2 +#define TGSI_PROPERTY_COUNT 3 + +struct tgsi_property { + unsigned Type : 4; /**< TGSI_TOKEN_TYPE_PROPERTY */ + unsigned NrTokens : 8; /**< UINT */ + unsigned PropertyName : 8; /**< one of TGSI_PROPERTY */ + unsigned Padding : 12; +}; + +struct tgsi_property_data { + unsigned Data; +}; + /* TGSI opcodes. * * For more information on semantics of opcodes and -- cgit v1.2.3 From 18ebcfe39360dc0ef1e175fe6c39cbb857432ab4 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Mon, 14 Dec 2009 18:02:05 -0500 Subject: r600 : add texture support for vertex shader. --- src/mesa/drivers/dri/r600/r700_assembler.c | 98 +++++++++++++++++++---------- src/mesa/drivers/dri/r600/r700_assembler.h | 2 + src/mesa/drivers/dri/r600/r700_chip.c | 34 ++++++++-- src/mesa/drivers/dri/r600/r700_shaderinst.h | 7 +++ 4 files changed, 104 insertions(+), 37 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index e84f5245253..d493d4e2b17 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -539,6 +539,8 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 pAsm->unNumPresub = 0; pAsm->unCurNumILInsts = 0; + pAsm->unVetTexBits = 0; + return 0; } @@ -1412,43 +1414,65 @@ GLboolean tex_src(r700_AssemblerBase *pAsm) pAsm->S[0].src.rtype = SRC_REG_TEMPORARY; break; case PROGRAM_INPUT: - switch (pILInst->SrcReg[0].Index) + if(SPT_VP == pAsm->currentShaderType) + { + switch (pILInst->SrcReg[0].Index) + { + case VERT_ATTRIB_TEX0: + case VERT_ATTRIB_TEX1: + case VERT_ATTRIB_TEX2: + case VERT_ATTRIB_TEX3: + case VERT_ATTRIB_TEX4: + case VERT_ATTRIB_TEX5: + case VERT_ATTRIB_TEX6: + case VERT_ATTRIB_TEX7: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->ucVP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + break; + } + } + else { - case FRAG_ATTRIB_WPOS: - case FRAG_ATTRIB_COL0: - case FRAG_ATTRIB_COL1: - case FRAG_ATTRIB_FOGC: - case FRAG_ATTRIB_TEX0: - case FRAG_ATTRIB_TEX1: - case FRAG_ATTRIB_TEX2: - case FRAG_ATTRIB_TEX3: - case FRAG_ATTRIB_TEX4: - case FRAG_ATTRIB_TEX5: - case FRAG_ATTRIB_TEX6: - case FRAG_ATTRIB_TEX7: - bValidTexCoord = GL_TRUE; + switch (pILInst->SrcReg[0].Index) + { + case FRAG_ATTRIB_WPOS: + case FRAG_ATTRIB_COL0: + case FRAG_ATTRIB_COL1: + case FRAG_ATTRIB_FOGC: + case FRAG_ATTRIB_TEX0: + case FRAG_ATTRIB_TEX1: + case FRAG_ATTRIB_TEX2: + case FRAG_ATTRIB_TEX3: + case FRAG_ATTRIB_TEX4: + case FRAG_ATTRIB_TEX5: + case FRAG_ATTRIB_TEX6: + case FRAG_ATTRIB_TEX7: + bValidTexCoord = GL_TRUE; + pAsm->S[0].src.reg = + pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; + pAsm->S[0].src.rtype = SRC_REG_INPUT; + break; + case FRAG_ATTRIB_FACE: + fprintf(stderr, "FRAG_ATTRIB_FACE unsupported\n"); + break; + case FRAG_ATTRIB_PNTC: + fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n"); + break; + } + + if( (pILInst->SrcReg[0].Index >= FRAG_ATTRIB_VAR0) || + (pILInst->SrcReg[0].Index < FRAG_ATTRIB_MAX) ) + { + bValidTexCoord = GL_TRUE; pAsm->S[0].src.reg = pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; pAsm->S[0].src.rtype = SRC_REG_INPUT; - break; - case FRAG_ATTRIB_FACE: - fprintf(stderr, "FRAG_ATTRIB_FACE unsupported\n"); - break; - case FRAG_ATTRIB_PNTC: - fprintf(stderr, "FRAG_ATTRIB_PNTC unsupported\n"); - break; - } - - if( (pILInst->SrcReg[0].Index >= FRAG_ATTRIB_VAR0) || - (pILInst->SrcReg[0].Index < FRAG_ATTRIB_MAX) ) - { - bValidTexCoord = GL_TRUE; - pAsm->S[0].src.reg = - pAsm->uiFP_AttributeMap[pILInst->SrcReg[0].Index]; - pAsm->S[0].src.rtype = SRC_REG_INPUT; + } } - break; + break; } } @@ -1493,8 +1517,17 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize tex_instruction_ptr->m_Word0.f.tex_inst = pAsm->D.dst.opcode; tex_instruction_ptr->m_Word0.f.bc_frac_mode = 0x0; tex_instruction_ptr->m_Word0.f.fetch_whole_quad = 0x0; + tex_instruction_ptr->m_Word0.f.alt_const = 0; - tex_instruction_ptr->m_Word0.f.resource_id = texture_unit_source->reg; + if(SPT_VP == pAsm->currentShaderType) + { + tex_instruction_ptr->m_Word0.f.resource_id = texture_unit_source->reg + VERT_ATTRIB_MAX; + pAsm->unVetTexBits |= 1 < texture_unit_source->reg; + } + else + { + tex_instruction_ptr->m_Word0.f.resource_id = texture_unit_source->reg; + } tex_instruction_ptr->m_Word1.f.lod_bias = 0x0; if (normalized) { @@ -1513,7 +1546,6 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize tex_instruction_ptr->m_Word2.f.offset_x = 0x0; tex_instruction_ptr->m_Word2.f.offset_y = 0x0; tex_instruction_ptr->m_Word2.f.offset_z = 0x0; - tex_instruction_ptr->m_Word2.f.sampler_id = texture_unit_source->reg; // dst diff --git a/src/mesa/drivers/dri/r600/r700_assembler.h b/src/mesa/drivers/dri/r600/r700_assembler.h index 6ef945dfda3..dbd9860f7d0 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.h +++ b/src/mesa/drivers/dri/r600/r700_assembler.h @@ -485,6 +485,8 @@ typedef struct r700_AssemblerBase GLuint unNumPresub; GLuint unCurNumILInsts; + GLuint unVetTexBits; + } r700_AssemblerBase; //Internal use diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index ee2a0a4c8a6..0b90079c182 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -45,6 +45,9 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); + + struct r700_vertex_program *vp = context->selected_vp; + struct radeon_bo *bo = NULL; unsigned int i; BATCH_LOCALS(&context->radeon); @@ -52,7 +55,7 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = r700->textures[i]; uint32_t offset; if (t) { @@ -71,7 +74,16 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) BEGIN_BATCH_NO_AUTOSTATE(9 + 4); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - R600_OUT_BATCH(i * 7); + + if( (1r700AsmCode.unVetTexBits ) + { /* vs texture */ + R600_OUT_BATCH((i + VERT_ATTRIB_MAX + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); + } + else + { + R600_OUT_BATCH(i * 7); + } + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE0); R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE1); R600_OUT_BATCH(r700->textures[i]->SQ_TEX_RESOURCE2); @@ -95,21 +107,35 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) } } +#define SAMPLER_STRIDE 3 + static void r700SendTexSamplerState(GLcontext *ctx, struct radeon_state_atom *atom) { context_t *context = R700_CONTEXT(ctx); R700_CHIP_CONTEXT *r700 = (R700_CHIP_CONTEXT*)(&context->hw); unsigned int i; + + struct r700_vertex_program *vp = context->selected_vp; + BATCH_LOCALS(&context->radeon); radeon_print(RADEON_STATE, RADEON_VERBOSE, "%s\n", __func__); for (i = 0; i < R700_TEXTURE_NUMBERUNITS; i++) { - if (ctx->Texture.Unit[i]._ReallyEnabled) { + if (ctx->Texture.Unit[i]._ReallyEnabled) { radeonTexObj *t = r700->textures[i]; if (t) { BEGIN_BATCH_NO_AUTOSTATE(5); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); - R600_OUT_BATCH(i * 3); + + if( (1r700AsmCode.unVetTexBits ) + { /* vs texture */ + R600_OUT_BATCH((i+SQ_TEX_SAMPLER_VS_OFFSET) * SAMPLER_STRIDE); //work 1 + } + else + { + R600_OUT_BATCH(i * 3); + } + R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER0); R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER1); R600_OUT_BATCH(r700->textures[i]->SQ_TEX_SAMPLER2); diff --git a/src/mesa/drivers/dri/r600/r700_shaderinst.h b/src/mesa/drivers/dri/r600/r700_shaderinst.h index 2829cca0a3c..cdb9a570f7c 100644 --- a/src/mesa/drivers/dri/r600/r700_shaderinst.h +++ b/src/mesa/drivers/dri/r600/r700_shaderinst.h @@ -42,6 +42,13 @@ #define SQ_FETCH_RESOURCE_VS_OFFSET 0x000000a0 #define SQ_FETCH_RESOURCE_VS_COUNT 0x000000b0 +//richard dec.10 glsl +#define SQ_TEX_SAMPLER_PS_OFFSET 0x00000000 +#define SQ_TEX_SAMPLER_PS_COUNT 0x00000012 +#define SQ_TEX_SAMPLER_VS_OFFSET 0x00000012 +#define SQ_TEX_SAMPLER_VS_COUNT 0x00000012 +//------------------- + #define SHADERINST_TYPEMASK_CF 0x10 #define SHADERINST_TYPEMASK_ALU 0x20 #define SHADERINST_TYPEMASK_TEX 0x40 -- cgit v1.2.3 From 0c046bec8f78f33e7530416e0faa4d127d08e641 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 14 Dec 2009 10:48:36 +0200 Subject: r600: add DDX DDY opcodes --- src/mesa/drivers/dri/r600/r700_assembler.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index d493d4e2b17..43dafd5b8ac 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -546,7 +546,8 @@ int Init_r700_AssemblerBase(SHADER_PIPE_TYPE spt, r700_AssemblerBase* pAsm, R700 GLboolean IsTex(gl_inst_opcode Opcode) { - if( (OPCODE_TEX==Opcode) || (OPCODE_TXP==Opcode) || (OPCODE_TXB==Opcode) ) + if( (OPCODE_TEX==Opcode) || (OPCODE_TXP==Opcode) || (OPCODE_TXB==Opcode) || + (OPCODE_DDX==Opcode) || (OPCODE_DDY==Opcode) ) { return GL_TRUE; } @@ -4363,13 +4364,20 @@ GLboolean assemble_TEX(r700_AssemblerBase *pAsm) } - if(pAsm->pILInst[pAsm->uiCurInst].Opcode == OPCODE_TXB) + switch(pAsm->pILInst[pAsm->uiCurInst].Opcode) { - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; - } - else - { - pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; + case OPCODE_DDX: + /* will these need WQM(1) on CF inst ? */ + pAsm->D.dst.opcode = SQ_TEX_INST_GET_GRADIENTS_H; + break; + case OPCODE_DDY: + pAsm->D.dst.opcode = SQ_TEX_INST_GET_GRADIENTS_V; + break; + case OPCODE_TXB: + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE_L; + break; + default: + pAsm->D.dst.opcode = SQ_TEX_INST_SAMPLE; } pAsm->is_tex = GL_TRUE; @@ -5682,7 +5690,8 @@ GLboolean AssembleInstr(GLuint uiFirstInst, } } break; - + case OPCODE_DDX: + case OPCODE_DDY: case OPCODE_TEX: case OPCODE_TXB: case OPCODE_TXP: -- cgit v1.2.3 From 10f5cff6ac1ce7c7cee1a11cf5d68cae728e8f8b Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Mon, 14 Dec 2009 11:59:41 +0200 Subject: r600: add support for FRAG_ATTRIB_PNTC --- src/mesa/drivers/dri/r600/r700_fragprog.c | 41 +++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index d15f0137107..3352e41ef3d 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -155,6 +155,12 @@ void Map_Fragment_Program(r700_AssemblerBase *pAsm, pAsm->uiFP_AttributeMap[FRAG_ATTRIB_FACE] = pAsm->number_used_registers++; } + unBit = 1 << FRAG_ATTRIB_PNTC; + if(mesa_fp->Base.InputsRead & unBit) + { + pAsm->uiFP_AttributeMap[FRAG_ATTRIB_PNTC] = pAsm->number_used_registers++; + } + /* Map temporary registers (GPRs) */ pAsm->starting_temp_register_number = pAsm->number_used_registers; @@ -479,6 +485,21 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) } + if (mesa_fp->Base.InputsRead & (1 << FRAG_ATTRIB_PNTC)) + { + ui++; + SETfield(r700->SPI_PS_IN_CONTROL_0.u32All, ui, NUM_INTERP_shift, NUM_INTERP_mask); + SETbit(r700->SPI_INTERP_CONTROL_0.u32All, PNT_SPRITE_ENA_bit); + SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_S, PNT_SPRITE_OVRD_X_shift, PNT_SPRITE_OVRD_X_mask); + SETfield(r700->SPI_INTERP_CONTROL_0.u32All, SPI_PNT_SPRITE_SEL_T, PNT_SPRITE_OVRD_Y_shift, PNT_SPRITE_OVRD_Y_mask); + //SETbit(r700->SPI_INTERP_CONTROL_0.u32All, PNT_SPRITE_TOP_1_bit); + } + else + { + CLEARbit(r700->SPI_INTERP_CONTROL_0.u32All, PNT_SPRITE_ENA_bit); + } + + ui = (unNumOfReg < ui) ? ui : unNumOfReg; SETfield(r700->ps.SQ_PGM_RESOURCES_PS.u32All, ui, NUM_GPRS_shift, NUM_GPRS_mask); @@ -498,6 +519,10 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) struct r700_vertex_program_cont *vpc = (struct r700_vertex_program_cont *)ctx->VertexProgram._Current; GLbitfield OutputsWritten = vpc->mesa_program.Base.OutputsWritten; + + for(ui = 0; ui < R700_MAX_SHADER_EXPORTS; ui++) + r700->SPI_PS_INPUT_CNTL[ui].u32All = 0; + unBit = 1 << FRAG_ATTRIB_WPOS; if(mesa_fp->Base.InputsRead & unBit) { @@ -575,6 +600,22 @@ GLboolean r700SetupFragmentProgram(GLcontext * ctx) else CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); } + unBit = 1 << FRAG_ATTRIB_PNTC; + if(mesa_fp->Base.InputsRead & unBit) + { + ui = pAsm->uiFP_AttributeMap[FRAG_ATTRIB_PNTC]; + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, SEL_CENTROID_bit); + SETfield(r700->SPI_PS_INPUT_CNTL[ui].u32All, ui, + SEMANTIC_shift, SEMANTIC_mask); + if (r700->SPI_INTERP_CONTROL_0.u32All & FLAT_SHADE_ENA_bit) + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + else + CLEARbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, FLAT_SHADE_bit); + SETbit(r700->SPI_PS_INPUT_CNTL[ui].u32All, PT_SPRITE_TEX_bit); + } + + + for(i=VERT_RESULT_VAR0; i Date: Mon, 14 Dec 2009 16:39:19 +0200 Subject: r600: fix fragment.position wpos.y seems inferted to what opengl expexts, so calculate correct value from window dimension and replace references in fragmentprog with calculated value --- src/mesa/drivers/dri/r600/r700_fragprog.c | 67 ++++++++++++++++++++++++++++++- src/mesa/drivers/dri/r600/r700_fragprog.h | 2 + 2 files changed, 68 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index 3352e41ef3d..bc2c5d53ce6 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -42,6 +42,65 @@ #include "r700_debug.h" +void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) +{ + static const gl_state_index winstate[STATE_LENGTH] + = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0}; + struct prog_instruction *newInst, *inst; + const GLuint origLen = fprog->Base.NumInstructions; + const GLuint newLen = origLen + 1; + GLint win_size; /* state reference */ + GLuint wpos_temp; /* temp register */ + int i, j; + + /* PARAM win_size = STATE_FB_SIZE */ + win_size = _mesa_add_state_reference(fprog->Base.Parameters, winstate); + + wpos_temp = fprog->Base.NumTemporaries++; + + /* Alloc storage for new instructions */ + newInst = _mesa_alloc_instructions(newLen); + + _mesa_init_instructions(newInst,1); + + /* invert wpos.y + * wpos_temp.xyzw = wpos.x-yzw + winsize.0y00 */ + newInst[0].Opcode = OPCODE_ADD; + newInst[0].DstReg.File = PROGRAM_TEMPORARY; + newInst[0].DstReg.Index = wpos_temp; + newInst[0].DstReg.WriteMask = WRITEMASK_XYZW; + + newInst[0].SrcReg[0].File = PROGRAM_INPUT; + newInst[0].SrcReg[0].Index = FRAG_ATTRIB_WPOS; + newInst[0].SrcReg[0].Swizzle = SWIZZLE_XYZW; + newInst[0].SrcReg[0].Negate = NEGATE_Y; + + newInst[0].SrcReg[1].File = PROGRAM_STATE_VAR; + newInst[0].SrcReg[1].Index = win_size; + newInst[0].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ZERO); + + /* scan program where WPOS is used and replace with wpos_temp */ + inst = fprog->Base.Instructions; + for (i = 0; i < fprog->Base.NumInstructions; i++) { + for (j=0; j < 3; j++) { + if(inst->SrcReg[j].File == PROGRAM_INPUT && + inst->SrcReg[j].Index == FRAG_ATTRIB_WPOS) { + inst->SrcReg[j].File = PROGRAM_TEMPORARY; + inst->SrcReg[j].Index = wpos_temp; + } + } + inst++; + } + /* Append original instructions after new instructions */ + _mesa_copy_instructions (newInst + 1, fprog->Base.Instructions, origLen); + /* free old instructions */ + _mesa_free_instructions(fprog->Base.Instructions, origLen); + /* install new instructions */ + fprog->Base.Instructions = newInst; + fprog->Base.NumInstructions = newLen; + +} + //TODO : Validate FP input with VP output. void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, @@ -318,7 +377,13 @@ GLboolean r700TranslateFragmentShader(struct r700_fragment_program *fp, //Init_Program Init_r700_AssemblerBase( SPT_FP, &(fp->r700AsmCode), &(fp->r700Shader) ); - Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); + + if(mesa_fp->Base.InputsRead & FRAG_BIT_WPOS) + { + insert_wpos_code(ctx, mesa_fp); + } + + Map_Fragment_Program(&(fp->r700AsmCode), mesa_fp, ctx); if( GL_FALSE == Find_Instruction_Dependencies_fp(fp, mesa_fp) ) { diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.h b/src/mesa/drivers/dri/r600/r700_fragprog.h index e562bfa4789..39c59c9201d 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.h +++ b/src/mesa/drivers/dri/r600/r700_fragprog.h @@ -48,6 +48,8 @@ struct r700_fragment_program }; /* Internal */ +void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog); + void Map_Fragment_Program(r700_AssemblerBase *pAsm, struct gl_fragment_program *mesa_fp, GLcontext *ctx); -- cgit v1.2.3 From dbc374cd3030d5db2c8f5d9b9405976d7efa458d Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 15 Dec 2009 10:22:34 +0200 Subject: r600: fix typos for vert-tex at least i think this is how it was meant to work --- src/mesa/drivers/dri/r600/r700_assembler.c | 2 +- src/mesa/drivers/dri/r600/r700_chip.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_assembler.c b/src/mesa/drivers/dri/r600/r700_assembler.c index 43dafd5b8ac..e10b23b97f1 100644 --- a/src/mesa/drivers/dri/r600/r700_assembler.c +++ b/src/mesa/drivers/dri/r600/r700_assembler.c @@ -1523,7 +1523,7 @@ GLboolean assemble_tex_instruction(r700_AssemblerBase *pAsm, GLboolean normalize if(SPT_VP == pAsm->currentShaderType) { tex_instruction_ptr->m_Word0.f.resource_id = texture_unit_source->reg + VERT_ATTRIB_MAX; - pAsm->unVetTexBits |= 1 < texture_unit_source->reg; + pAsm->unVetTexBits |= 1 << texture_unit_source->reg; } else { diff --git a/src/mesa/drivers/dri/r600/r700_chip.c b/src/mesa/drivers/dri/r600/r700_chip.c index 0b90079c182..c124e02184f 100644 --- a/src/mesa/drivers/dri/r600/r700_chip.c +++ b/src/mesa/drivers/dri/r600/r700_chip.c @@ -75,7 +75,7 @@ static void r700SendTexState(GLcontext *ctx, struct radeon_state_atom *atom) BEGIN_BATCH_NO_AUTOSTATE(9 + 4); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_RESOURCE, 7)); - if( (1r700AsmCode.unVetTexBits ) + if( (1<r700AsmCode.unVetTexBits ) { /* vs texture */ R600_OUT_BATCH((i + VERT_ATTRIB_MAX + SQ_FETCH_RESOURCE_VS_OFFSET) * FETCH_RESOURCE_STRIDE); } @@ -127,7 +127,7 @@ static void r700SendTexSamplerState(GLcontext *ctx, struct radeon_state_atom *at BEGIN_BATCH_NO_AUTOSTATE(5); R600_OUT_BATCH(CP_PACKET3(R600_IT_SET_SAMPLER, 3)); - if( (1r700AsmCode.unVetTexBits ) + if( (1<r700AsmCode.unVetTexBits ) { /* vs texture */ R600_OUT_BATCH((i+SQ_TEX_SAMPLER_VS_OFFSET) * SAMPLER_STRIDE); //work 1 } -- cgit v1.2.3 From f8135d545b5542ef33fabc92bcede2848e3e6b29 Mon Sep 17 00:00:00 2001 From: Andre Maasikas Date: Tue, 15 Dec 2009 12:03:26 +0200 Subject: r600: use _mesa_insert_instructions to fixup wpos instead of manual ins insert this keeps branch targets correct. glsl/trirast works correctly now afaics --- src/mesa/drivers/dri/r600/r700_fragprog.c | 40 ++++++++++++------------------- 1 file changed, 15 insertions(+), 25 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r700_fragprog.c b/src/mesa/drivers/dri/r600/r700_fragprog.c index bc2c5d53ce6..ca0710b6813 100644 --- a/src/mesa/drivers/dri/r600/r700_fragprog.c +++ b/src/mesa/drivers/dri/r600/r700_fragprog.c @@ -34,6 +34,7 @@ #include "main/imports.h" #include "shader/prog_parameter.h" #include "shader/prog_statevars.h" +#include "shader/program.h" #include "r600_context.h" #include "r600_cmdbuf.h" @@ -47,8 +48,6 @@ void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) static const gl_state_index winstate[STATE_LENGTH] = { STATE_INTERNAL, STATE_FB_SIZE, 0, 0, 0}; struct prog_instruction *newInst, *inst; - const GLuint origLen = fprog->Base.NumInstructions; - const GLuint newLen = origLen + 1; GLint win_size; /* state reference */ GLuint wpos_temp; /* temp register */ int i, j; @@ -58,11 +57,22 @@ void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) wpos_temp = fprog->Base.NumTemporaries++; - /* Alloc storage for new instructions */ - newInst = _mesa_alloc_instructions(newLen); + /* scan program where WPOS is used and replace with wpos_temp */ + inst = fprog->Base.Instructions; + for (i = 0; i < fprog->Base.NumInstructions; i++) { + for (j=0; j < 3; j++) { + if(inst->SrcReg[j].File == PROGRAM_INPUT && + inst->SrcReg[j].Index == FRAG_ATTRIB_WPOS) { + inst->SrcReg[j].File = PROGRAM_TEMPORARY; + inst->SrcReg[j].Index = wpos_temp; + } + } + inst++; + } - _mesa_init_instructions(newInst,1); + _mesa_insert_instructions(&(fprog->Base), 0, 1); + newInst = fprog->Base.Instructions; /* invert wpos.y * wpos_temp.xyzw = wpos.x-yzw + winsize.0y00 */ newInst[0].Opcode = OPCODE_ADD; @@ -79,26 +89,6 @@ void insert_wpos_code(GLcontext *ctx, struct gl_fragment_program *fprog) newInst[0].SrcReg[1].Index = win_size; newInst[0].SrcReg[1].Swizzle = MAKE_SWIZZLE4(SWIZZLE_ZERO, SWIZZLE_Y, SWIZZLE_ZERO, SWIZZLE_ZERO); - /* scan program where WPOS is used and replace with wpos_temp */ - inst = fprog->Base.Instructions; - for (i = 0; i < fprog->Base.NumInstructions; i++) { - for (j=0; j < 3; j++) { - if(inst->SrcReg[j].File == PROGRAM_INPUT && - inst->SrcReg[j].Index == FRAG_ATTRIB_WPOS) { - inst->SrcReg[j].File = PROGRAM_TEMPORARY; - inst->SrcReg[j].Index = wpos_temp; - } - } - inst++; - } - /* Append original instructions after new instructions */ - _mesa_copy_instructions (newInst + 1, fprog->Base.Instructions, origLen); - /* free old instructions */ - _mesa_free_instructions(fprog->Base.Instructions, origLen); - /* install new instructions */ - fprog->Base.Instructions = newInst; - fprog->Base.NumInstructions = newLen; - } //TODO : Validate FP input with VP output. -- cgit v1.2.3 From c1efa45e04124eff66c48493be50d2b66d248506 Mon Sep 17 00:00:00 2001 From: Michal Krol Date: Tue, 15 Dec 2009 13:54:05 +0100 Subject: tgsi/text: Don't use strncasecmp(), it breaks windows build. Also, break out of the for-loop when a matching property is found. --- src/gallium/auxiliary/tgsi/tgsi_text.c | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c index 5a17b9d5d4e..f000958bfc0 100644 --- a/src/gallium/auxiliary/tgsi/tgsi_text.c +++ b/src/gallium/auxiliary/tgsi/tgsi_text.c @@ -60,6 +60,21 @@ static boolean uprcase( char c ) return c; } +/* + * Ignore case of str1 and assume str2 is already uppercase. + * Return TRUE iff str1 and str2 are equal. + */ +static int +streq_nocase_uprcase(const char *str1, + const char *str2) +{ + while (*str1 && uprcase(*str1) == *str2) { + str1++; + str2++; + } + return *str1 == *str2; +} + static boolean str_match_no_case( const char **pcur, const char *str ) { const char *cur = *pcur; @@ -1012,8 +1027,7 @@ static boolean parse_property( struct translate_ctx *ctx ) } for (property_name = 0; property_name < TGSI_PROPERTY_COUNT; ++property_name) { - if (strncasecmp(id, property_names[property_name], - strlen(property_names[property_name]))) { + if (streq_nocase_uprcase(id, property_names[property_name])) { break; } } -- cgit v1.2.3 From d508bf862bdb2c706a6c8a3a0a7f99de77e5c8cc Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Fri, 11 Dec 2009 20:16:15 +0000 Subject: util: Add dl wrappers. Borrowed from Mesa, slightly changed for more type safety. --- src/gallium/auxiliary/util/Makefile | 1 + src/gallium/auxiliary/util/SConscript | 1 + src/gallium/auxiliary/util/u_dl.c | 79 +++++++++++++++++++++++++++++++++++ src/gallium/auxiliary/util/u_dl.h | 61 +++++++++++++++++++++++++++ 4 files changed, 142 insertions(+) create mode 100644 src/gallium/auxiliary/util/u_dl.c create mode 100644 src/gallium/auxiliary/util/u_dl.h diff --git a/src/gallium/auxiliary/util/Makefile b/src/gallium/auxiliary/util/Makefile index 1d8bb55bbd6..863ced5e938 100644 --- a/src/gallium/auxiliary/util/Makefile +++ b/src/gallium/auxiliary/util/Makefile @@ -11,6 +11,7 @@ C_SOURCES = \ u_blit.c \ u_cache.c \ u_cpu_detect.c \ + u_dl.c \ u_draw_quad.c \ u_format.c \ u_format_access.c \ diff --git a/src/gallium/auxiliary/util/SConscript b/src/gallium/auxiliary/util/SConscript index 8d99106d0b8..379f3da91e3 100644 --- a/src/gallium/auxiliary/util/SConscript +++ b/src/gallium/auxiliary/util/SConscript @@ -30,6 +30,7 @@ util = env.ConvenienceLibrary( 'u_debug_memory.c', 'u_debug_stack.c', 'u_debug_symbol.c', + 'u_dl.c', 'u_draw_quad.c', 'u_format.c', 'u_format_access.c', diff --git a/src/gallium/auxiliary/util/u_dl.c b/src/gallium/auxiliary/util/u_dl.c new file mode 100644 index 00000000000..b42b429d4d7 --- /dev/null +++ b/src/gallium/auxiliary/util/u_dl.c @@ -0,0 +1,79 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * Copyright 1999-2008 Brian Paul + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + + +#include "pipe/p_config.h" + +#if defined(PIPE_OS_UNIX) +#include +#endif +#if defined(PIPE_OS_WINDOWS) +#include +#endif + +#include "u_dl.h" + + +struct util_dl_library * +util_dl_open(const char *filename) +{ +#if defined(PIPE_OS_UNIX) + return (struct util_dl_library *)dlopen(filename, RTLD_LAZY | RTLD_GLOBAL); +#elif defined(PIPE_OS_WINDOWS) + return (struct util_dl_library *)LoadLibraryA(filename); +#else + return NULL; +#endif +} + + +util_dl_proc +util_dl_get_proc_address(struct util_dl_library *library, + const char *procname) +{ +#if defined(PIPE_OS_UNIX) + return (util_dl_proc)dlsym((void *)library, procname); +#elif defined(PIPE_OS_WINDOWS) + return (util_dl_proc)GetProcAddress((HMODULE)library, procname); +#else + return (util_dl_proc)NULL; +#endif +} + + +void +util_dl_close(struct util_dl_library *library) +{ +#if defined(PIPE_OS_UNIX) + dlclose((void *)library); +#elif defined(PIPE_OS_WINDOWS) + FreeLibrary((HMODULE)library); +#else + (void)library; +#endif +} diff --git a/src/gallium/auxiliary/util/u_dl.h b/src/gallium/auxiliary/util/u_dl.h new file mode 100644 index 00000000000..018b38543b0 --- /dev/null +++ b/src/gallium/auxiliary/util/u_dl.h @@ -0,0 +1,61 @@ +/************************************************************************** + * + * Copyright 2009 VMware, Inc. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + **************************************************************************/ + + +#ifndef U_DL_H_ +#define U_DL_H_ + + +struct util_dl_library; + + +typedef void (*util_dl_proc)(void); + + +/** + * Open a library dynamically. + */ +struct util_dl_library * +util_dl_open(const char *filename); + + +/** + * Lookup a function in a library. + */ +util_dl_proc +util_dl_get_proc_address(struct util_dl_library *library, + const char *procname); + + +/** + * Close a library. + */ +void +util_dl_close(struct util_dl_library *library); + + +#endif /* U_DL_H_ */ -- cgit v1.2.3 From 846e38f1c33c3b2e46227886da57beda27b82f0c Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 15 Dec 2009 12:13:43 +0000 Subject: llvmpipe: Fix bad SI -> FP conversion into lp_build_log2_approx. It should be a bitcast as the integer value is actually an encoded FP already. --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 9c59677a741..4fd459e593e 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -1285,7 +1285,7 @@ lp_build_log2_approx(struct lp_build_context *bld, /* mant = (float) mantissa(x) */ mant = LLVMBuildAnd(bld->builder, i, mantmask, ""); mant = LLVMBuildOr(bld->builder, mant, one, ""); - mant = LLVMBuildSIToFP(bld->builder, mant, vec_type, ""); + mant = LLVMBuildBitCast(bld->builder, mant, vec_type, ""); logmant = lp_build_polynomial(bld, mant, lp_build_log2_polynomial, Elements(lp_build_log2_polynomial)); -- cgit v1.2.3 From 079b1cf4cf32a2bdc5f13c2aa1e211c4c7dc6775 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 15 Dec 2009 13:40:13 +0000 Subject: util: Fix unity value for swizzle 1. It should be 255 for ubytes, and not 1. Thanks Michal for spotting this. --- src/gallium/auxiliary/util/u_format_access.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/auxiliary/util/u_format_access.py b/src/gallium/auxiliary/util/u_format_access.py index eeb1a9657fd..0b05ddb9312 100644 --- a/src/gallium/auxiliary/util/u_format_access.py +++ b/src/gallium/auxiliary/util/u_format_access.py @@ -325,14 +325,14 @@ def generate_format_read(format, dst_type, dst_native_type, dst_suffix): elif swizzle == SWIZZLE_0: value = '0' elif swizzle == SWIZZLE_1: - value = '1' + value = get_one(dst_type) else: assert False elif format.colorspace == 'zs': if i < 3: value = 'z' else: - value = '1' + value = get_one(dst_type) else: assert False print ' *dst_pixel++ = %s; /* %s */' % (value, 'rgba'[i]) -- cgit v1.2.3 From 72c98780697b40da5c34da0aec21d06e46a431d1 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 15 Dec 2009 13:58:53 +0000 Subject: llvmpipe: Fix typo in lp_build_log constant. --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 4fd459e593e..f0af3244045 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -1083,7 +1083,7 @@ lp_build_log(struct lp_build_context *bld, LLVMValueRef x) { /* log(2) */ - LLVMValueRef log2 = lp_build_const_scalar(bld->type, 1.4426950408889634); + LLVMValueRef log2 = lp_build_const_scalar(bld->type, 0.69314718055994529); return lp_build_mul(bld, log2, lp_build_exp2(bld, x)); } -- cgit v1.2.3 From 85c27c3ef7753ee8bae119dd982df09161b44d5f Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 15 Dec 2009 14:15:52 +0000 Subject: llvmpipe: Fix lp_build_polynomial comment. --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index f0af3244045..08c86a3b926 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -1095,7 +1095,7 @@ lp_build_log(struct lp_build_context *bld, /** * Generate polynomial. - * Ex: x^2 * coeffs[0] + x * coeffs[1] + coeffs[2]. + * Ex: coeffs[0] + x * coeffs[1] + x^2 * coeffs[2]. */ static LLVMValueRef lp_build_polynomial(struct lp_build_context *bld, -- cgit v1.2.3 From 3a15c48ecedb985e2cecaaa9061ff579092069f1 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Tue, 15 Dec 2009 14:46:43 +0000 Subject: llvmpipe: Fix yet another copynpaste typo in lp_build_log2_approx. Now fslight looks perfect. --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 08c86a3b926..847c2a34b1f 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -1291,7 +1291,7 @@ lp_build_log2_approx(struct lp_build_context *bld, Elements(lp_build_log2_polynomial)); /* This effectively increases the polynomial degree by one, but ensures that log2(1) == 0*/ - logmant = LLVMBuildMul(bld->builder, logmant, LLVMBuildMul(bld->builder, mant, bld->one, ""), ""); + logmant = LLVMBuildMul(bld->builder, logmant, LLVMBuildSub(bld->builder, mant, bld->one, ""), ""); res = LLVMBuildAdd(bld->builder, logmant, logexp, ""); } -- cgit v1.2.3 From dff4c9ed559ae025d1d8fe7b9d1cea5a973c2225 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 12 Dec 2009 06:34:29 +0100 Subject: util: add new fragment shaders to simple_shaders New shaders: * Fragment shader which writes depth sampled from a texture * Fragment shader which copies COLOR[0] to multiple render targets Additional improvements: * The fragment 'tex' shaders now take a sampler type (TGSI_TEXTURE_*) so that they can sample from any type of texture, not only from a 2D one. --- src/gallium/auxiliary/util/u_blit.c | 7 ++- src/gallium/auxiliary/util/u_gen_mipmap.c | 2 +- src/gallium/auxiliary/util/u_simple_shaders.c | 70 ++++++++++++++++++++++++--- src/gallium/auxiliary/util/u_simple_shaders.h | 13 ++++- 4 files changed, 80 insertions(+), 12 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blit.c b/src/gallium/auxiliary/util/u_blit.c index abe1de3302b..c9050ca864c 100644 --- a/src/gallium/auxiliary/util/u_blit.c +++ b/src/gallium/auxiliary/util/u_blit.c @@ -126,7 +126,8 @@ util_create_blit(struct pipe_context *pipe, struct cso_context *cso) } /* fragment shader */ - ctx->fs[TGSI_WRITEMASK_XYZW] = util_make_fragment_tex_shader(pipe); + ctx->fs[TGSI_WRITEMASK_XYZW] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D); ctx->vbuf = NULL; /* init vertex data that doesn't change */ @@ -420,7 +421,9 @@ util_blit_pixels_writemask(struct blit_state *ctx, cso_set_sampler_textures(ctx->cso, 1, &tex); if (ctx->fs[writemask] == NULL) - ctx->fs[writemask] = util_make_fragment_tex_shader_writemask(pipe, writemask); + ctx->fs[writemask] = + util_make_fragment_tex_shader_writemask(pipe, TGSI_TEXTURE_2D, + writemask); /* shaders */ cso_set_fragment_shader_handle(ctx->cso, ctx->fs[writemask]); diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 83263d9fe64..1728e661cdb 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -1317,7 +1317,7 @@ util_create_gen_mipmap(struct pipe_context *pipe, } /* fragment shader */ - ctx->fs = util_make_fragment_tex_shader(pipe); + ctx->fs = util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D); /* vertex data that doesn't change */ for (i = 0; i < 4; i++) { diff --git a/src/gallium/auxiliary/util/u_simple_shaders.c b/src/gallium/auxiliary/util/u_simple_shaders.c index 1c8b157d91f..8172ead0201 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.c +++ b/src/gallium/auxiliary/util/u_simple_shaders.c @@ -2,6 +2,7 @@ * * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. * All Rights Reserved. + * Copyright 2009 Marek Olšák * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the @@ -30,6 +31,7 @@ * Simple vertex/fragment shader generators. * * @author Brian Paul + Marek Olšák */ @@ -87,6 +89,7 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe, */ void * util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, + unsigned tex_target, unsigned writemask ) { struct ureg_program *ureg; @@ -116,30 +119,82 @@ util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, ureg_TEX( ureg, ureg_writemask(out, writemask), - TGSI_TEXTURE_2D, tex, sampler ); + tex_target, tex, sampler ); ureg_END( ureg ); return ureg_create_shader_and_destroy( ureg, pipe ); } void * -util_make_fragment_tex_shader(struct pipe_context *pipe ) +util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target ) { return util_make_fragment_tex_shader_writemask( pipe, + tex_target, TGSI_WRITEMASK_XYZW ); } +/** + * Make a simple fragment texture shader which reads an X component from + * a texture and writes it as depth. + */ +void * +util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe, + unsigned tex_target) +{ + struct ureg_program *ureg; + struct ureg_src sampler; + struct ureg_src tex; + struct ureg_dst out, depth; + struct ureg_src imm; + ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); + if (ureg == NULL) + return NULL; + + sampler = ureg_DECL_sampler( ureg, 0 ); + + tex = ureg_DECL_fs_input( ureg, + TGSI_SEMANTIC_GENERIC, 0, + TGSI_INTERPOLATE_PERSPECTIVE ); + + out = ureg_DECL_output( ureg, + TGSI_SEMANTIC_COLOR, + 0 ); + + depth = ureg_DECL_output( ureg, + TGSI_SEMANTIC_POSITION, + 0 ); + + imm = ureg_imm4f( ureg, 0, 0, 0, 1 ); + + ureg_MOV( ureg, out, imm ); + + ureg_TEX( ureg, + ureg_writemask(depth, TGSI_WRITEMASK_Z), + tex_target, tex, sampler ); + ureg_END( ureg ); + + return ureg_create_shader_and_destroy( ureg, pipe ); +} /** * Make simple fragment color pass-through shader. */ void * util_make_fragment_passthrough_shader(struct pipe_context *pipe) +{ + return util_make_fragment_clonecolor_shader(pipe, 1); +} + +void * +util_make_fragment_clonecolor_shader(struct pipe_context *pipe, int num_cbufs) { struct ureg_program *ureg; struct ureg_src src; - struct ureg_dst dst; + struct ureg_dst dst[8]; + int i; + + assert(num_cbufs <= 8); ureg = ureg_create( TGSI_PROCESSOR_FRAGMENT ); if (ureg == NULL) @@ -148,12 +203,13 @@ util_make_fragment_passthrough_shader(struct pipe_context *pipe) src = ureg_DECL_fs_input( ureg, TGSI_SEMANTIC_COLOR, 0, TGSI_INTERPOLATE_PERSPECTIVE ); - dst = ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, 0 ); + for (i = 0; i < num_cbufs; i++) + dst[i] = ureg_DECL_output( ureg, TGSI_SEMANTIC_COLOR, i ); + + for (i = 0; i < num_cbufs; i++) + ureg_MOV( ureg, dst[i], src ); - ureg_MOV( ureg, dst, src ); ureg_END( ureg ); return ureg_create_shader_and_destroy( ureg, pipe ); } - - diff --git a/src/gallium/auxiliary/util/u_simple_shaders.h b/src/gallium/auxiliary/util/u_simple_shaders.h index d2e80d6eb4d..6e760942e25 100644 --- a/src/gallium/auxiliary/util/u_simple_shaders.h +++ b/src/gallium/auxiliary/util/u_simple_shaders.h @@ -51,16 +51,25 @@ util_make_vertex_passthrough_shader(struct pipe_context *pipe, extern void * util_make_fragment_tex_shader_writemask(struct pipe_context *pipe, - unsigned writemask ); + unsigned tex_target, + unsigned writemask); extern void * -util_make_fragment_tex_shader(struct pipe_context *pipe); +util_make_fragment_tex_shader(struct pipe_context *pipe, unsigned tex_target); + + +extern void * +util_make_fragment_tex_shader_writedepth(struct pipe_context *pipe, + unsigned tex_target); extern void * util_make_fragment_passthrough_shader(struct pipe_context *pipe); +extern void * +util_make_fragment_clonecolor_shader(struct pipe_context *pipe, int num_cbufs); + #ifdef __cplusplus } #endif -- cgit v1.2.3 From 4c61022b4a19f020ef8f6c635ecffa54a914fd7a Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 12 Dec 2009 23:38:17 +0100 Subject: util: add a function which converts 2D coordinates to cubemap coordinates The code was taken over from u_gen_mipmap. --- src/gallium/auxiliary/util/Makefile | 1 + src/gallium/auxiliary/util/SConscript | 1 + src/gallium/auxiliary/util/u_gen_mipmap.c | 55 +--------------- src/gallium/auxiliary/util/u_texture.c | 102 ++++++++++++++++++++++++++++++ src/gallium/auxiliary/util/u_texture.h | 54 ++++++++++++++++ 5 files changed, 161 insertions(+), 52 deletions(-) create mode 100644 src/gallium/auxiliary/util/u_texture.c create mode 100644 src/gallium/auxiliary/util/u_texture.h diff --git a/src/gallium/auxiliary/util/Makefile b/src/gallium/auxiliary/util/Makefile index 863ced5e938..c36a87a8091 100644 --- a/src/gallium/auxiliary/util/Makefile +++ b/src/gallium/auxiliary/util/Makefile @@ -31,6 +31,7 @@ C_SOURCES = \ u_stream_stdc.c \ u_stream_wd.c \ u_surface.c \ + u_texture.c \ u_tile.c \ u_time.c \ u_timed_winsys.c \ diff --git a/src/gallium/auxiliary/util/SConscript b/src/gallium/auxiliary/util/SConscript index 379f3da91e3..6e34c3b7dd7 100644 --- a/src/gallium/auxiliary/util/SConscript +++ b/src/gallium/auxiliary/util/SConscript @@ -49,6 +49,7 @@ util = env.ConvenienceLibrary( 'u_stream_stdc.c', 'u_stream_wd.c', 'u_surface.c', + 'u_texture.c', 'u_tile.c', 'u_time.c', 'u_timed_winsys.c', diff --git a/src/gallium/auxiliary/util/u_gen_mipmap.c b/src/gallium/auxiliary/util/u_gen_mipmap.c index 1728e661cdb..69ff3b9dd9e 100644 --- a/src/gallium/auxiliary/util/u_gen_mipmap.c +++ b/src/gallium/auxiliary/util/u_gen_mipmap.c @@ -46,6 +46,7 @@ #include "util/u_gen_mipmap.h" #include "util/u_simple_shaders.h" #include "util/u_math.h" +#include "util/u_texture.h" #include "cso_cache/cso_context.h" @@ -1383,59 +1384,9 @@ set_vertex_data(struct gen_mipmap_state *ctx, static const float st[4][2] = { {0.0f, 0.0f}, {1.0f, 0.0f}, {1.0f, 1.0f}, {0.0f, 1.0f} }; - float rx, ry, rz; - uint i; - - /* loop over quad verts */ - for (i = 0; i < 4; i++) { - /* Compute sc = +/-scale and tc = +/-scale. - * Not +/-1 to avoid cube face selection ambiguity near the edges, - * though that can still sometimes happen with this scale factor... - */ - const float scale = 0.9999f; - const float sc = (2.0f * st[i][0] - 1.0f) * scale; - const float tc = (2.0f * st[i][1] - 1.0f) * scale; - - switch (face) { - case PIPE_TEX_FACE_POS_X: - rx = 1.0f; - ry = -tc; - rz = -sc; - break; - case PIPE_TEX_FACE_NEG_X: - rx = -1.0f; - ry = -tc; - rz = sc; - break; - case PIPE_TEX_FACE_POS_Y: - rx = sc; - ry = 1.0f; - rz = tc; - break; - case PIPE_TEX_FACE_NEG_Y: - rx = sc; - ry = -1.0f; - rz = -tc; - break; - case PIPE_TEX_FACE_POS_Z: - rx = sc; - ry = -tc; - rz = 1.0f; - break; - case PIPE_TEX_FACE_NEG_Z: - rx = -sc; - ry = -tc; - rz = -1.0f; - break; - default: - rx = ry = rz = 0.0f; - assert(0); - } - ctx->vertices[i][1][0] = rx; /*s*/ - ctx->vertices[i][1][1] = ry; /*t*/ - ctx->vertices[i][1][2] = rz; /*r*/ - } + util_map_texcoords2d_onto_cubemap(face, &st[0][0], 2, + &ctx->vertices[0][1][0], 8); } else { /* 1D/2D */ diff --git a/src/gallium/auxiliary/util/u_texture.c b/src/gallium/auxiliary/util/u_texture.c new file mode 100644 index 00000000000..cd477ab640f --- /dev/null +++ b/src/gallium/auxiliary/util/u_texture.c @@ -0,0 +1,102 @@ +/************************************************************************** + * + * Copyright 2008 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * Copyright 2008 VMware, Inc. All rights reserved. + * Copyright 2009 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/** + * @file + * Texture mapping utility functions. + * + * @author Brian Paul + * Marek Olšák + */ + +#include "pipe/p_defines.h" + +#include "util/u_texture.h" + +void util_map_texcoords2d_onto_cubemap(unsigned face, + const float *in_st, unsigned in_stride, + float *out_str, unsigned out_stride) +{ + int i; + float rx, ry, rz; + + /* loop over quad verts */ + for (i = 0; i < 4; i++) { + /* Compute sc = +/-scale and tc = +/-scale. + * Not +/-1 to avoid cube face selection ambiguity near the edges, + * though that can still sometimes happen with this scale factor... + */ + const float scale = 0.9999f; + const float sc = (2 * in_st[0] - 1) * scale; + const float tc = (2 * in_st[1] - 1) * scale; + + switch (face) { + case PIPE_TEX_FACE_POS_X: + rx = 1; + ry = -tc; + rz = -sc; + break; + case PIPE_TEX_FACE_NEG_X: + rx = -1; + ry = -tc; + rz = sc; + break; + case PIPE_TEX_FACE_POS_Y: + rx = sc; + ry = 1; + rz = tc; + break; + case PIPE_TEX_FACE_NEG_Y: + rx = sc; + ry = -1; + rz = -tc; + break; + case PIPE_TEX_FACE_POS_Z: + rx = sc; + ry = -tc; + rz = 1; + break; + case PIPE_TEX_FACE_NEG_Z: + rx = -sc; + ry = -tc; + rz = -1; + break; + default: + rx = ry = rz = 0; + assert(0); + } + + out_str[0] = rx; /*s*/ + out_str[1] = ry; /*t*/ + out_str[2] = rz; /*r*/ + + in_st += in_stride; + out_str += out_stride; + } +} diff --git a/src/gallium/auxiliary/util/u_texture.h b/src/gallium/auxiliary/util/u_texture.h new file mode 100644 index 00000000000..93b2f1e4c97 --- /dev/null +++ b/src/gallium/auxiliary/util/u_texture.h @@ -0,0 +1,54 @@ +/************************************************************************** + * + * Copyright 2009 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef U_TEXTURE_H +#define U_TEXTURE_H + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * Convert 2D texture coordinates of 4 vertices into cubemap coordinates + * in the given face. + * Coordinates must be in the range [0,1]. + * + * \param face Cubemap face. + * \param in_st 4 pairs of 2D texture coordinates to convert. + * \param in_stride Stride of in_st in floats. + * \param out_str STR cubemap texture coordinates to compute. + * \param out_stride Stride of out_str in floats. + */ +void util_map_texcoords2d_onto_cubemap(unsigned face, + const float *in_st, unsigned in_stride, + float *out_str, unsigned out_stride); + + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3 From 55753f59ae1754738bed4b0cb6546db65891f53f Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Thu, 10 Dec 2009 10:25:33 +0100 Subject: util: add blitter --- src/gallium/auxiliary/util/Makefile | 1 + src/gallium/auxiliary/util/SConscript | 1 + src/gallium/auxiliary/util/u_blitter.c | 605 +++++++++++++++++++++++++++++++++ src/gallium/auxiliary/util/u_blitter.h | 244 +++++++++++++ 4 files changed, 851 insertions(+) create mode 100644 src/gallium/auxiliary/util/u_blitter.c create mode 100644 src/gallium/auxiliary/util/u_blitter.h diff --git a/src/gallium/auxiliary/util/Makefile b/src/gallium/auxiliary/util/Makefile index c36a87a8091..3ed90fd1b70 100644 --- a/src/gallium/auxiliary/util/Makefile +++ b/src/gallium/auxiliary/util/Makefile @@ -9,6 +9,7 @@ C_SOURCES = \ u_debug_symbol.c \ u_debug_stack.c \ u_blit.c \ + u_blitter.c \ u_cache.c \ u_cpu_detect.c \ u_dl.c \ diff --git a/src/gallium/auxiliary/util/SConscript b/src/gallium/auxiliary/util/SConscript index 6e34c3b7dd7..2a546d19dc0 100644 --- a/src/gallium/auxiliary/util/SConscript +++ b/src/gallium/auxiliary/util/SConscript @@ -23,6 +23,7 @@ util = env.ConvenienceLibrary( source = [ 'u_bitmask.c', 'u_blit.c', + 'u_blitter.c', 'u_cache.c', 'u_cpu_detect.c', 'u_debug.c', diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c new file mode 100644 index 00000000000..e51a5dfc905 --- /dev/null +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -0,0 +1,605 @@ +/************************************************************************** + * + * Copyright 2009 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +/** + * @file + * Blitter utility to facilitate acceleration of the clear, surface_copy, + * and surface_fill functions. + * + * @author Marek Olšák + */ + +#include "pipe/p_context.h" +#include "pipe/p_defines.h" +#include "pipe/p_inlines.h" +#include "pipe/p_shader_tokens.h" +#include "pipe/p_state.h" + +#include "util/u_memory.h" +#include "util/u_math.h" +#include "util/u_blitter.h" +#include "util/u_draw_quad.h" +#include "util/u_pack_color.h" +#include "util/u_rect.h" +#include "util/u_simple_shaders.h" +#include "util/u_texture.h" + +struct blitter_context_priv +{ + struct blitter_context blitter; + + struct pipe_context *pipe; /**< pipe context */ + struct pipe_buffer *vbuf; /**< quad */ + + float vertices[4][2][4]; /**< {pos, color} or {pos, texcoord} */ + + /* Constant state objects. */ + /* Vertex shaders. */ + void *vs_col; /**< Vertex shader which passes {pos, color} to the output */ + void *vs_tex; /**pipe = pipe; + + /* init state objects for them to be considered invalid */ + ctx->blitter.saved_fb_state.nr_cbufs = ~0; + ctx->blitter.saved_num_textures = ~0; + ctx->blitter.saved_num_sampler_states = ~0; + + /* blend state objects */ + memset(&blend, 0, sizeof(blend)); + ctx->blend_keep_color = pipe->create_blend_state(pipe, &blend); + + blend.colormask = PIPE_MASK_RGBA; + ctx->blend_write_color = pipe->create_blend_state(pipe, &blend); + + /* depth stencil alpha state objects */ + memset(&dsa, 0, sizeof(dsa)); + ctx->dsa_keep_depth_stencil = + pipe->create_depth_stencil_alpha_state(pipe, &dsa); + + dsa.depth.enabled = 1; + dsa.depth.writemask = 1; + dsa.depth.func = PIPE_FUNC_ALWAYS; + ctx->dsa_write_depth_keep_stencil = + pipe->create_depth_stencil_alpha_state(pipe, &dsa); + + dsa.stencil[0].enabled = 1; + dsa.stencil[0].func = PIPE_FUNC_ALWAYS; + dsa.stencil[0].fail_op = PIPE_STENCIL_OP_REPLACE; + dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE; + dsa.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE; + dsa.stencil[0].valuemask = 0xff; + dsa.stencil[0].writemask = 0xff; + + /* create a depth stencil alpha state for each possible stencil clear + * value */ + for (i = 0; i < 0xff; i++) { + dsa.stencil[0].ref_value = i; + + ctx->dsa_write_depth_stencil[i] = + pipe->create_depth_stencil_alpha_state(pipe, &dsa); + } + + /* sampler state */ + memset(&sampler_state, 0, sizeof(sampler_state)); + sampler_state.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + sampler_state.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + + for (i = 0; i < 16; i++) { + sampler_state.lod_bias = i; + sampler_state.min_lod = i; + sampler_state.max_lod = i; + + ctx->sampler_state[i] = pipe->create_sampler_state(pipe, &sampler_state); + } + + /* rasterizer state */ + memset(&rs_state, 0, sizeof(rs_state)); + rs_state.front_winding = PIPE_WINDING_CW; + rs_state.cull_mode = PIPE_WINDING_NONE; + rs_state.bypass_vs_clip_and_viewport = 1; + rs_state.gl_rasterization_rules = 1; + ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state); + + /* vertex shaders */ + { + const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, + TGSI_SEMANTIC_COLOR }; + const uint semantic_indices[] = { 0, 0 }; + ctx->vs_col = + util_make_vertex_passthrough_shader(pipe, 2, semantic_names, + semantic_indices); + } + { + const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, + TGSI_SEMANTIC_GENERIC }; + const uint semantic_indices[] = { 0, 0 }; + ctx->vs_tex = + util_make_vertex_passthrough_shader(pipe, 2, semantic_names, + semantic_indices); + } + + /* fragment shaders */ + ctx->fs_texfetch_col[PIPE_TEXTURE_1D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_1D); + ctx->fs_texfetch_col[PIPE_TEXTURE_2D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D); + ctx->fs_texfetch_col[PIPE_TEXTURE_3D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_3D); + ctx->fs_texfetch_col[PIPE_TEXTURE_CUBE] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_CUBE); + + ctx->fs_texfetch_depth[PIPE_TEXTURE_1D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_1D); + ctx->fs_texfetch_depth[PIPE_TEXTURE_2D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_2D); + ctx->fs_texfetch_depth[PIPE_TEXTURE_3D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_3D); + ctx->fs_texfetch_depth[PIPE_TEXTURE_CUBE] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_CUBE); + + max_render_targets = pipe->screen->get_param(pipe->screen, + PIPE_CAP_MAX_RENDER_TARGETS); + assert(max_render_targets <= 8); + for (i = 0; i < max_render_targets; i++) + ctx->fs_col[i] = util_make_fragment_clonecolor_shader(pipe, 1+i); + + /* set invariant vertex coordinates */ + for (i = 0; i < 4; i++) + ctx->vertices[i][0][3] = 1; /*v.w*/ + + /* create the vertex buffer */ + ctx->vbuf = pipe_buffer_create(ctx->pipe->screen, + 32, + PIPE_BUFFER_USAGE_VERTEX, + sizeof(ctx->vertices)); + + return &ctx->blitter; +} + +void util_blitter_destroy(struct blitter_context *blitter) +{ + struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; + struct pipe_context *pipe = ctx->pipe; + int i; + + pipe->delete_blend_state(pipe, ctx->blend_write_color); + pipe->delete_blend_state(pipe, ctx->blend_keep_color); + pipe->delete_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); + pipe->delete_depth_stencil_alpha_state(pipe, + ctx->dsa_write_depth_keep_stencil); + + for (i = 0; i < 0xff; i++) + pipe->delete_depth_stencil_alpha_state(pipe, + ctx->dsa_write_depth_stencil[i]); + + pipe->delete_rasterizer_state(pipe, ctx->rs_state); + pipe->delete_vs_state(pipe, ctx->vs_col); + pipe->delete_vs_state(pipe, ctx->vs_tex); + + for (i = 0; i < 4; i++) { + pipe->delete_fs_state(pipe, ctx->fs_texfetch_col[i]); + pipe->delete_fs_state(pipe, ctx->fs_texfetch_depth[i]); + } + for (i = 0; i < 8 && ctx->fs_col[i]; i++) + pipe->delete_fs_state(pipe, ctx->fs_col[i]); + + pipe_buffer_reference(&ctx->vbuf, NULL); + FREE(ctx); +} + +static void blitter_check_saved_CSOs(struct blitter_context_priv *ctx) +{ + /* make sure these CSOs have been saved */ + assert(ctx->blitter.saved_blend_state && + ctx->blitter.saved_dsa_state && + ctx->blitter.saved_rs_state && + ctx->blitter.saved_fs && + ctx->blitter.saved_vs); +} + +static void blitter_restore_CSOs(struct blitter_context_priv *ctx) +{ + struct pipe_context *pipe = ctx->pipe; + + /* restore the state objects which are always required to be saved */ + pipe->bind_blend_state(pipe, ctx->blitter.saved_blend_state); + pipe->bind_depth_stencil_alpha_state(pipe, ctx->blitter.saved_dsa_state); + pipe->bind_rasterizer_state(pipe, ctx->blitter.saved_rs_state); + pipe->bind_fs_state(pipe, ctx->blitter.saved_fs); + pipe->bind_vs_state(pipe, ctx->blitter.saved_vs); + + ctx->blitter.saved_blend_state = 0; + ctx->blitter.saved_dsa_state = 0; + ctx->blitter.saved_rs_state = 0; + ctx->blitter.saved_fs = 0; + ctx->blitter.saved_vs = 0; + + /* restore the state objects which are required to be saved before copy/fill + */ + if (ctx->blitter.saved_fb_state.nr_cbufs != ~0) { + pipe->set_framebuffer_state(pipe, &ctx->blitter.saved_fb_state); + ctx->blitter.saved_fb_state.nr_cbufs = ~0; + } + + if (ctx->blitter.saved_num_sampler_states != ~0) { + pipe->bind_fragment_sampler_states(pipe, + ctx->blitter.saved_num_sampler_states, + ctx->blitter.saved_sampler_states); + ctx->blitter.saved_num_sampler_states = ~0; + } + + if (ctx->blitter.saved_num_textures != ~0) { + pipe->set_fragment_sampler_textures(pipe, + ctx->blitter.saved_num_textures, + ctx->blitter.saved_textures); + ctx->blitter.saved_num_textures = ~0; + } +} + +static void blitter_set_rectangle(struct blitter_context_priv *ctx, + unsigned x1, unsigned y1, + unsigned x2, unsigned y2, + float depth) +{ + int i; + + /* set vertex positions */ + ctx->vertices[0][0][0] = x1; /*v0.x*/ + ctx->vertices[0][0][1] = y1; /*v0.y*/ + + ctx->vertices[1][0][0] = x2; /*v1.x*/ + ctx->vertices[1][0][1] = y1; /*v1.y*/ + + ctx->vertices[2][0][0] = x2; /*v2.x*/ + ctx->vertices[2][0][1] = y2; /*v2.y*/ + + ctx->vertices[3][0][0] = x1; /*v3.x*/ + ctx->vertices[3][0][1] = y2; /*v3.y*/ + + for (i = 0; i < 4; i++) + ctx->vertices[i][0][2] = depth; /*z*/ +} + +static void blitter_set_clear_color(struct blitter_context_priv *ctx, + const float *rgba) +{ + int i; + + for (i = 0; i < 4; i++) { + ctx->vertices[i][1][0] = rgba[0]; + ctx->vertices[i][1][1] = rgba[1]; + ctx->vertices[i][1][2] = rgba[2]; + ctx->vertices[i][1][3] = rgba[3]; + } +} + +static void blitter_set_texcoords_2d(struct blitter_context_priv *ctx, + struct pipe_surface *surf, + unsigned x1, unsigned y1, + unsigned x2, unsigned y2) +{ + int i; + float s1 = x1 / (float)surf->width; + float t1 = y1 / (float)surf->height; + float s2 = x2 / (float)surf->width; + float t2 = y2 / (float)surf->height; + + ctx->vertices[0][1][0] = s1; /*t0.s*/ + ctx->vertices[0][1][1] = t1; /*t0.t*/ + + ctx->vertices[1][1][0] = s2; /*t1.s*/ + ctx->vertices[1][1][1] = t1; /*t1.t*/ + + ctx->vertices[2][1][0] = s2; /*t2.s*/ + ctx->vertices[2][1][1] = t2; /*t2.t*/ + + ctx->vertices[3][1][0] = s1; /*t3.s*/ + ctx->vertices[3][1][1] = t2; /*t3.t*/ + + for (i = 0; i < 4; i++) { + ctx->vertices[i][1][2] = 0; /*r*/ + ctx->vertices[i][1][3] = 1; /*q*/ + } +} + +static void blitter_set_texcoords_3d(struct blitter_context_priv *ctx, + struct pipe_surface *surf, + unsigned x1, unsigned y1, + unsigned x2, unsigned y2) +{ + int i; + float depth = u_minify(surf->texture->depth0, surf->level); + float r = surf->zslice / depth; + + blitter_set_texcoords_2d(ctx, surf, x1, y1, x2, y2); + + for (i = 0; i < 4; i++) + ctx->vertices[i][1][2] = r; /*r*/ +} + +static void blitter_set_texcoords_cube(struct blitter_context_priv *ctx, + struct pipe_surface *surf, + unsigned x1, unsigned y1, + unsigned x2, unsigned y2) +{ + int i; + float s1 = x1 / (float)surf->width; + float t1 = y1 / (float)surf->height; + float s2 = x2 / (float)surf->width; + float t2 = y2 / (float)surf->height; + const float st[4][2] = { + {s1, t1}, {s2, t1}, {s2, t2}, {s1, t2} + }; + + util_map_texcoords2d_onto_cubemap(surf->face, + /* pointer, stride in floats */ + &st[0][0], 2, + &ctx->vertices[0][1][0], 8); + + for (i = 0; i < 4; i++) + ctx->vertices[i][1][3] = 1; /*q*/ +} + +static void blitter_draw_quad(struct blitter_context_priv *ctx) +{ + struct blitter_context *blitter = &ctx->blitter; + struct pipe_context *pipe = ctx->pipe; + + if (blitter->draw_quad) { + blitter->draw_quad(pipe, &ctx->vertices[0][0][0]); + } else { + /* write vertices and draw them */ + pipe_buffer_write(pipe->screen, ctx->vbuf, + 0, sizeof(ctx->vertices), ctx->vertices); + + util_draw_vertex_buffer(ctx->pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, + 4, /* verts */ + 2); /* attribs/vert */ + } +} + +void util_blitter_clear(struct blitter_context *blitter, + unsigned width, unsigned height, + unsigned num_cbufs, + unsigned clear_buffers, + const float *rgba, + double depth, unsigned stencil) +{ + struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; + struct pipe_context *pipe = ctx->pipe; + + assert(num_cbufs <= 8); + + blitter_check_saved_CSOs(ctx); + + /* bind CSOs */ + if (clear_buffers & PIPE_CLEAR_COLOR) + pipe->bind_blend_state(pipe, ctx->blend_write_color); + else + pipe->bind_blend_state(pipe, ctx->blend_keep_color); + + if (clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) + pipe->bind_depth_stencil_alpha_state(pipe, + ctx->dsa_write_depth_stencil[stencil&0xff]); + else + pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); + + pipe->bind_rasterizer_state(pipe, ctx->rs_state); + pipe->bind_fs_state(pipe, ctx->fs_col[num_cbufs ? num_cbufs-1 : 0]); + pipe->bind_vs_state(pipe, ctx->vs_col); + + blitter_set_clear_color(ctx, rgba); + blitter_set_rectangle(ctx, 0, 0, width, height, depth); + blitter_draw_quad(ctx); + blitter_restore_CSOs(ctx); +} + +void util_blitter_copy(struct blitter_context *blitter, + struct pipe_surface *dst, + unsigned dstx, unsigned dsty, + struct pipe_surface *src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height, + boolean ignore_stencil) +{ + struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; + struct pipe_context *pipe = ctx->pipe; + struct pipe_screen *screen = pipe->screen; + struct pipe_framebuffer_state fb_state; + boolean is_stencil, is_depth; + unsigned dst_tex_usage; + + /* give up if textures are not set */ + assert(dst->texture && src->texture); + if (!dst->texture || !src->texture) + return; + + is_depth = pf_get_component_bits(src->format, PIPE_FORMAT_COMP_Z) != 0; + is_stencil = pf_get_component_bits(src->format, PIPE_FORMAT_COMP_S) != 0; + dst_tex_usage = is_depth || is_stencil ? PIPE_TEXTURE_USAGE_DEPTH_STENCIL : + PIPE_TEXTURE_USAGE_RENDER_TARGET; + + /* check if we can sample from and render to the surfaces */ + /* (assuming copying a stencil buffer is not possible) */ + if ((!ignore_stencil && is_stencil) || + !screen->is_format_supported(screen, dst->format, dst->texture->target, + dst_tex_usage, 0) || + !screen->is_format_supported(screen, src->format, src->texture->target, + PIPE_TEXTURE_USAGE_SAMPLER, 0)) { + util_surface_copy(pipe, FALSE, dst, dstx, dsty, src, srcx, srcy, + width, height); + return; + } + + /* check whether the states are properly saved */ + blitter_check_saved_CSOs(ctx); + assert(blitter->saved_fb_state.nr_cbufs != ~0); + assert(blitter->saved_num_textures != ~0); + assert(blitter->saved_num_sampler_states != ~0); + assert(src->texture->target < 4); + + /* bind CSOs */ + fb_state.width = dst->width; + fb_state.height = dst->height; + + if (is_depth) { + pipe->bind_blend_state(pipe, ctx->blend_keep_color); + pipe->bind_depth_stencil_alpha_state(pipe, + ctx->dsa_write_depth_keep_stencil); + pipe->bind_fs_state(pipe, ctx->fs_texfetch_depth[src->texture->target]); + + fb_state.nr_cbufs = 0; + fb_state.zsbuf = dst; + } else { + pipe->bind_blend_state(pipe, ctx->blend_write_color); + pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); + pipe->bind_fs_state(pipe, ctx->fs_texfetch_col[src->texture->target]); + + fb_state.nr_cbufs = 1; + fb_state.cbufs[0] = dst; + fb_state.zsbuf = 0; + } + pipe->bind_rasterizer_state(pipe, ctx->rs_state); + pipe->bind_vs_state(pipe, ctx->vs_tex); + pipe->bind_fragment_sampler_states(pipe, 1, &ctx->sampler_state[src->level]); + pipe->set_fragment_sampler_textures(pipe, 1, &src->texture); + pipe->set_framebuffer_state(pipe, &fb_state); + + /* set texture coordinates */ + switch (src->texture->target) { + case PIPE_TEXTURE_1D: + case PIPE_TEXTURE_2D: + blitter_set_texcoords_2d(ctx, src, srcx, srcy, + srcx+width, srcy+height); + break; + case PIPE_TEXTURE_3D: + blitter_set_texcoords_3d(ctx, src, srcx, srcy, + srcx+width, srcy+height); + break; + case PIPE_TEXTURE_CUBE: + blitter_set_texcoords_cube(ctx, src, srcx, srcy, + srcx+width, srcy+height); + break; + } + + blitter_set_rectangle(ctx, dstx, dsty, dstx+width, dsty+height, 0); + blitter_draw_quad(ctx); + blitter_restore_CSOs(ctx); +} + +void util_blitter_fill(struct blitter_context *blitter, + struct pipe_surface *dst, + unsigned dstx, unsigned dsty, + unsigned width, unsigned height, + unsigned value) +{ + struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; + struct pipe_context *pipe = ctx->pipe; + struct pipe_screen *screen = pipe->screen; + struct pipe_framebuffer_state fb_state; + float rgba[4]; + ubyte ub_rgba[4] = {0}; + union util_color color; + int i; + + assert(dst->texture); + if (!dst->texture) + return; + + /* check if we can render to the surface */ + if (pf_is_depth_or_stencil(dst->format) || /* unlikely, but you never know */ + !screen->is_format_supported(screen, dst->format, dst->texture->target, + PIPE_TEXTURE_USAGE_RENDER_TARGET, 0)) { + util_surface_fill(pipe, dst, dstx, dsty, width, height, value); + return; + } + + /* unpack the color */ + color.ui = value; + util_unpack_color_ub(dst->format, &color, + ub_rgba, ub_rgba+1, ub_rgba+2, ub_rgba+3); + for (i = 0; i < 4; i++) + rgba[i] = ubyte_to_float(ub_rgba[i]); + + /* check the saved state */ + blitter_check_saved_CSOs(ctx); + assert(blitter->saved_fb_state.nr_cbufs != ~0); + + /* bind CSOs */ + pipe->bind_blend_state(pipe, ctx->blend_write_color); + pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); + pipe->bind_rasterizer_state(pipe, ctx->rs_state); + pipe->bind_fs_state(pipe, ctx->fs_col[0]); + pipe->bind_vs_state(pipe, ctx->vs_col); + + /* set a framebuffer state */ + fb_state.width = dst->width; + fb_state.height = dst->height; + fb_state.nr_cbufs = 1; + fb_state.cbufs[0] = dst; + fb_state.zsbuf = 0; + pipe->set_framebuffer_state(pipe, &fb_state); + + blitter_set_clear_color(ctx, rgba); + blitter_set_rectangle(ctx, 0, 0, width, height, 0); + blitter_draw_quad(ctx); + blitter_restore_CSOs(ctx); +} diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h new file mode 100644 index 00000000000..e4cbb5c5afa --- /dev/null +++ b/src/gallium/auxiliary/util/u_blitter.h @@ -0,0 +1,244 @@ +/************************************************************************** + * + * Copyright 2009 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + +#ifndef U_BLITTER_H +#define U_BLITTER_H + +#include "util/u_memory.h" + +#include "pipe/p_state.h" + + +#ifdef __cplusplus +extern "C" { +#endif + +struct pipe_context; + +struct blitter_context +{ + /** + * Draw a quad. + * + * The pipe driver can set this to provide a more efficient way of drawing + * a quad. If it's NULL, the quad is drawn using a vertex buffer. + * + * There are always 4 vertices with interleaved vertex elements of type + * RGBA32F. See the vertex shader _output_ semantics to know what those are. + * The primitive type is always PIPE_PRIM_TRIANGLE_FAN and VS/clip/viewport + * is bypasssed. + */ + void (*draw_quad)(struct pipe_context *pipe, + const float *vertices); + + /* Private members, really. */ + void *saved_blend_state; /**< blend state */ + void *saved_dsa_state; /**< depth stencil alpha state */ + void *saved_rs_state; /**< rasterizer state */ + void *saved_fs, *saved_vs; /**< fragment shader, vertex shader */ + + struct pipe_framebuffer_state saved_fb_state; /**< framebuffer state */ + + int saved_num_sampler_states; + void *saved_sampler_states[32]; + + int saved_num_textures; + struct pipe_texture *saved_textures[32]; /* is 32 enough? */ +}; + +/** + * Create a blitter context. + */ +struct blitter_context *util_blitter_create(struct pipe_context *pipe); + +/** + * Destroy a blitter context. + */ +void util_blitter_destroy(struct blitter_context *blitter); + +/* + * These CSOs must be saved before any of the following functions is called: + * - blend state + * - depth stencil alpha state + * - rasterizer state + * - vertex shader + * - fragment shader + */ + +/** + * Clear a specified set of currently bound buffers to specified values. + */ +void util_blitter_clear(struct blitter_context *blitter, + unsigned width, unsigned height, + unsigned num_cbufs, + unsigned clear_buffers, + const float *rgba, + double depth, unsigned stencil); + +/** + * Copy a block of pixels from one surface to another. + * + * You can copy from any color format to any other color format provided + * the former can be sampled and the latter can be rendered to. Otherwise, + * a software fallback path is taken and both surfaces must be of the same + * format. + * + * The same holds for depth-stencil formats with the exception that stencil + * cannot be copied unless you set ignore_stencil to FALSE. In that case, + * a software fallback path is taken and both surfaces must be of the same + * format. + * + * Use pipe_screen->is_format_supported to know your options. + * + * These states must be saved in the blitter in addition to the state objects + * already required to be saved: + * - framebuffer state + * - fragment sampler states + * - fragment sampler textures + */ +void util_blitter_copy(struct blitter_context *blitter, + struct pipe_surface *dst, + unsigned dstx, unsigned dsty, + struct pipe_surface *src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height, + boolean ignore_stencil); + +/** + * Fill a region of a surface with a constant value. + * + * If the surface cannot be rendered to or it's a depth-stencil format, + * a software fallback path is taken. + * + * These states must be saved in the blitter in addition to the state objects + * already required to be saved: + * - framebuffer state + */ +void util_blitter_fill(struct blitter_context *blitter, + struct pipe_surface *dst, + unsigned dstx, unsigned dsty, + unsigned width, unsigned height, + unsigned value); + +/** + * Copy all pixels from one surface to another. + * + * The rules are the same as in util_blitter_copy with the addition that + * surfaces must have the same size. + */ +static INLINE +void util_blitter_copy_surface(struct blitter_context *blitter, + struct pipe_surface *dst, + struct pipe_surface *src, + boolean ignore_stencil) +{ + assert(dst->width == src->width && dst->height == src->height); + + util_blitter_copy(blitter, dst, 0, 0, src, 0, 0, src->width, src->height, + ignore_stencil); +} + + +/* The functions below should be used to save currently bound constant state + * objects inside a driver. The objects are automatically restored at the end + * of the util_blitter_{clear, fill, copy, copy_surface} functions and then + * forgotten. + * + * CSOs not listed here are not affected by util_blitter. */ + +static INLINE +void util_blitter_save_blend(struct blitter_context *blitter, + void *state) +{ + blitter->saved_blend_state = state; +} + +static INLINE +void util_blitter_save_depth_stencil_alpha(struct blitter_context *blitter, + void *state) +{ + blitter->saved_dsa_state = state; +} + +static INLINE +void util_blitter_save_rasterizer(struct blitter_context *blitter, + void *state) +{ + blitter->saved_rs_state = state; +} + +static INLINE +void util_blitter_save_fragment_shader(struct blitter_context *blitter, + void *fs) +{ + blitter->saved_fs = fs; +} + +static INLINE +void util_blitter_save_vertex_shader(struct blitter_context *blitter, + void *vs) +{ + blitter->saved_vs = vs; +} + +static INLINE +void util_blitter_save_framebuffer(struct blitter_context *blitter, + struct pipe_framebuffer_state *state) +{ + blitter->saved_fb_state = *state; +} + +static INLINE +void util_blitter_save_fragment_sampler_states( + struct blitter_context *blitter, + int num_sampler_states, + void **sampler_states) +{ + assert(num_sampler_states <= Elements(blitter->saved_sampler_states)); + + blitter->saved_num_sampler_states = num_sampler_states; + memcpy(blitter->saved_sampler_states, sampler_states, + num_sampler_states * sizeof(void *)); +} + +static INLINE +void util_blitter_save_fragment_sampler_textures( + struct blitter_context *blitter, + int num_textures, + struct pipe_texture **textures) +{ + assert(num_textures <= Elements(blitter->saved_textures)); + + blitter->saved_num_textures = num_textures; + memcpy(blitter->saved_textures, textures, + num_textures * sizeof(struct pipe_texture *)); +} + +#ifdef __cplusplus +} +#endif + +#endif -- cgit v1.2.3 From e1d0f4780861121e564c833d6061082491126154 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 19:05:15 +0100 Subject: pipe: add PIPE_MAX_TEXTURE_TYPES --- src/gallium/include/pipe/p_defines.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index 69a0970d5f8..fe1390d765f 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -140,7 +140,8 @@ enum pipe_texture_target { PIPE_TEXTURE_1D = 0, PIPE_TEXTURE_2D = 1, PIPE_TEXTURE_3D = 2, - PIPE_TEXTURE_CUBE = 3 + PIPE_TEXTURE_CUBE = 3, + PIPE_MAX_TEXTURE_TYPES }; #define PIPE_TEX_FACE_POS_X 0 -- cgit v1.2.3 From ab85ba30e2ed3c5e8bd289eab2f66b997e3489a9 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 19:14:49 +0100 Subject: util/blitter: use PIPE_MAX_* limits, and fix a memory leak --- src/gallium/auxiliary/util/u_blitter.c | 40 +++++++++++++++++++++++----------- 1 file changed, 27 insertions(+), 13 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index e51a5dfc905..f8f9e4a6140 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -62,10 +62,16 @@ struct blitter_context_priv void *vs_tex; /**screen->get_param(pipe->screen, PIPE_CAP_MAX_RENDER_TARGETS); - assert(max_render_targets <= 8); + assert(max_render_targets <= PIPE_MAX_COLOR_BUFS); for (i = 0; i < max_render_targets; i++) ctx->fs_col[i] = util_make_fragment_clonecolor_shader(pipe, 1+i); @@ -234,13 +242,17 @@ void util_blitter_destroy(struct blitter_context *blitter) pipe->delete_vs_state(pipe, ctx->vs_col); pipe->delete_vs_state(pipe, ctx->vs_tex); - for (i = 0; i < 4; i++) { + for (i = 0; i < PIPE_MAX_TEXTURE_TYPES; i++) { pipe->delete_fs_state(pipe, ctx->fs_texfetch_col[i]); pipe->delete_fs_state(pipe, ctx->fs_texfetch_depth[i]); } - for (i = 0; i < 8 && ctx->fs_col[i]; i++) + + for (i = 0; i < PIPE_MAX_COLOR_BUFS && ctx->fs_col[i]; i++) pipe->delete_fs_state(pipe, ctx->fs_col[i]); + for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++) + pipe->delete_sampler_state(pipe, ctx->sampler_state[i]); + pipe_buffer_reference(&ctx->vbuf, NULL); FREE(ctx); } @@ -426,7 +438,7 @@ void util_blitter_clear(struct blitter_context *blitter, struct blitter_context_priv *ctx = (struct blitter_context_priv*)blitter; struct pipe_context *pipe = ctx->pipe; - assert(num_cbufs <= 8); + assert(num_cbufs <= PIPE_MAX_COLOR_BUFS); blitter_check_saved_CSOs(ctx); @@ -494,7 +506,7 @@ void util_blitter_copy(struct blitter_context *blitter, assert(blitter->saved_fb_state.nr_cbufs != ~0); assert(blitter->saved_num_textures != ~0); assert(blitter->saved_num_sampler_states != ~0); - assert(src->texture->target < 4); + assert(src->texture->target < PIPE_MAX_TEXTURE_TYPES); /* bind CSOs */ fb_state.width = dst->width; @@ -538,6 +550,8 @@ void util_blitter_copy(struct blitter_context *blitter, blitter_set_texcoords_cube(ctx, src, srcx, srcy, srcx+width, srcy+height); break; + default: + assert(0); } blitter_set_rectangle(ctx, dstx, dsty, dstx+width, dsty+height, 0); -- cgit v1.2.3 From 85bf420a78483cf62ebab59af13a7c5a320a4703 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 15 Dec 2009 00:26:10 +0100 Subject: util/blitter: allocate most of the state objects on-demand --- src/gallium/auxiliary/util/u_blitter.c | 254 +++++++++++++++++++++++---------- 1 file changed, 179 insertions(+), 75 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index f8f9e4a6140..42efa86e198 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -56,6 +56,10 @@ struct blitter_context_priv float vertices[4][2][4]; /**< {pos, color} or {pos, texcoord} */ + /* Templates for various state objects. */ + struct pipe_depth_stencil_alpha_state template_dsa; + struct pipe_sampler_state template_sampler_state; + /* Constant state objects. */ /* Vertex shaders. */ void *vs_col; /**< Vertex shader which passes {pos, color} to the output */ @@ -93,10 +97,10 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) { struct blitter_context_priv *ctx; struct pipe_blend_state blend; - struct pipe_depth_stencil_alpha_state dsa; + struct pipe_depth_stencil_alpha_state *dsa; struct pipe_rasterizer_state rs_state; - struct pipe_sampler_state sampler_state; - unsigned i, max_render_targets; + struct pipe_sampler_state *sampler_state; + unsigned i; ctx = CALLOC_STRUCT(blitter_context_priv); if (!ctx) @@ -117,46 +121,33 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) ctx->blend_write_color = pipe->create_blend_state(pipe, &blend); /* depth stencil alpha state objects */ - memset(&dsa, 0, sizeof(dsa)); + dsa = &ctx->template_dsa; ctx->dsa_keep_depth_stencil = - pipe->create_depth_stencil_alpha_state(pipe, &dsa); + pipe->create_depth_stencil_alpha_state(pipe, dsa); - dsa.depth.enabled = 1; - dsa.depth.writemask = 1; - dsa.depth.func = PIPE_FUNC_ALWAYS; + dsa->depth.enabled = 1; + dsa->depth.writemask = 1; + dsa->depth.func = PIPE_FUNC_ALWAYS; ctx->dsa_write_depth_keep_stencil = - pipe->create_depth_stencil_alpha_state(pipe, &dsa); - - dsa.stencil[0].enabled = 1; - dsa.stencil[0].func = PIPE_FUNC_ALWAYS; - dsa.stencil[0].fail_op = PIPE_STENCIL_OP_REPLACE; - dsa.stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE; - dsa.stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE; - dsa.stencil[0].valuemask = 0xff; - dsa.stencil[0].writemask = 0xff; - - /* create a depth stencil alpha state for each possible stencil clear - * value */ - for (i = 0; i < 0xff; i++) { - dsa.stencil[0].ref_value = i; - - ctx->dsa_write_depth_stencil[i] = - pipe->create_depth_stencil_alpha_state(pipe, &dsa); - } + pipe->create_depth_stencil_alpha_state(pipe, dsa); + + dsa->stencil[0].enabled = 1; + dsa->stencil[0].func = PIPE_FUNC_ALWAYS; + dsa->stencil[0].fail_op = PIPE_STENCIL_OP_REPLACE; + dsa->stencil[0].zpass_op = PIPE_STENCIL_OP_REPLACE; + dsa->stencil[0].zfail_op = PIPE_STENCIL_OP_REPLACE; + dsa->stencil[0].valuemask = 0xff; + dsa->stencil[0].writemask = 0xff; + /* The DSA state objects which write depth and stencil are created + * on-demand. */ /* sampler state */ - memset(&sampler_state, 0, sizeof(sampler_state)); - sampler_state.wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; - sampler_state.wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; - sampler_state.wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; - - for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++) { - sampler_state.lod_bias = i; - sampler_state.min_lod = i; - sampler_state.max_lod = i; - - ctx->sampler_state[i] = pipe->create_sampler_state(pipe, &sampler_state); - } + sampler_state = &ctx->template_sampler_state; + sampler_state->wrap_s = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + sampler_state->wrap_t = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + sampler_state->wrap_r = PIPE_TEX_WRAP_CLAMP_TO_EDGE; + /* The sampler state objects which sample from a specified mipmap level + * are created on-demand. */ /* rasterizer state */ memset(&rs_state, 0, sizeof(rs_state)); @@ -166,6 +157,8 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) rs_state.gl_rasterization_rules = 1; ctx->rs_state = pipe->create_rasterizer_state(pipe, &rs_state); + /* fragment shaders are created on-demand */ + /* vertex shaders */ { const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, @@ -184,31 +177,6 @@ struct blitter_context *util_blitter_create(struct pipe_context *pipe) semantic_indices); } - /* fragment shaders */ - ctx->fs_texfetch_col[PIPE_TEXTURE_1D] = - util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_1D); - ctx->fs_texfetch_col[PIPE_TEXTURE_2D] = - util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D); - ctx->fs_texfetch_col[PIPE_TEXTURE_3D] = - util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_3D); - ctx->fs_texfetch_col[PIPE_TEXTURE_CUBE] = - util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_CUBE); - - ctx->fs_texfetch_depth[PIPE_TEXTURE_1D] = - util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_1D); - ctx->fs_texfetch_depth[PIPE_TEXTURE_2D] = - util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_2D); - ctx->fs_texfetch_depth[PIPE_TEXTURE_3D] = - util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_3D); - ctx->fs_texfetch_depth[PIPE_TEXTURE_CUBE] = - util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_CUBE); - - max_render_targets = pipe->screen->get_param(pipe->screen, - PIPE_CAP_MAX_RENDER_TARGETS); - assert(max_render_targets <= PIPE_MAX_COLOR_BUFS); - for (i = 0; i < max_render_targets; i++) - ctx->fs_col[i] = util_make_fragment_clonecolor_shader(pipe, 1+i); - /* set invariant vertex coordinates */ for (i = 0; i < 4; i++) ctx->vertices[i][0][3] = 1; /*v.w*/ @@ -235,23 +203,28 @@ void util_blitter_destroy(struct blitter_context *blitter) ctx->dsa_write_depth_keep_stencil); for (i = 0; i < 0xff; i++) - pipe->delete_depth_stencil_alpha_state(pipe, - ctx->dsa_write_depth_stencil[i]); + if (ctx->dsa_write_depth_stencil[i]) + pipe->delete_depth_stencil_alpha_state(pipe, + ctx->dsa_write_depth_stencil[i]); pipe->delete_rasterizer_state(pipe, ctx->rs_state); pipe->delete_vs_state(pipe, ctx->vs_col); pipe->delete_vs_state(pipe, ctx->vs_tex); for (i = 0; i < PIPE_MAX_TEXTURE_TYPES; i++) { - pipe->delete_fs_state(pipe, ctx->fs_texfetch_col[i]); - pipe->delete_fs_state(pipe, ctx->fs_texfetch_depth[i]); + if (ctx->fs_texfetch_col[i]) + pipe->delete_fs_state(pipe, ctx->fs_texfetch_col[i]); + if (ctx->fs_texfetch_depth[i]) + pipe->delete_fs_state(pipe, ctx->fs_texfetch_depth[i]); } for (i = 0; i < PIPE_MAX_COLOR_BUFS && ctx->fs_col[i]; i++) - pipe->delete_fs_state(pipe, ctx->fs_col[i]); + if (ctx->fs_col[i]) + pipe->delete_fs_state(pipe, ctx->fs_col[i]); for (i = 0; i < PIPE_MAX_TEXTURE_LEVELS; i++) - pipe->delete_sampler_state(pipe, ctx->sampler_state[i]); + if (ctx->sampler_state[i]) + pipe->delete_sampler_state(pipe, ctx->sampler_state[i]); pipe_buffer_reference(&ctx->vbuf, NULL); FREE(ctx); @@ -428,6 +401,133 @@ static void blitter_draw_quad(struct blitter_context_priv *ctx) } } +static INLINE +void *blitter_get_state_write_depth_stencil( + struct blitter_context_priv *ctx, + unsigned stencil) +{ + struct pipe_context *pipe = ctx->pipe; + + stencil &= 0xff; + + /* Create the DSA state on-demand. */ + if (!ctx->dsa_write_depth_stencil[stencil]) { + ctx->template_dsa.stencil[0].ref_value = stencil; + + ctx->dsa_write_depth_stencil[stencil] = + pipe->create_depth_stencil_alpha_state(pipe, &ctx->template_dsa); + } + + return ctx->dsa_write_depth_stencil[stencil]; +} + +static INLINE +void **blitter_get_sampler_state(struct blitter_context_priv *ctx, + int miplevel) +{ + struct pipe_context *pipe = ctx->pipe; + struct pipe_sampler_state *sampler_state = &ctx->template_sampler_state; + + assert(miplevel < PIPE_MAX_TEXTURE_LEVELS); + + /* Create the sampler state on-demand. */ + if (!ctx->sampler_state[miplevel]) { + sampler_state->lod_bias = miplevel; + sampler_state->min_lod = miplevel; + sampler_state->max_lod = miplevel; + + ctx->sampler_state[miplevel] = pipe->create_sampler_state(pipe, + sampler_state); + } + + /* Return void** so that it can be passed to bind_fragment_sampler_states + * directly. */ + return &ctx->sampler_state[miplevel]; +} + +static INLINE +void *blitter_get_fs_col(struct blitter_context_priv *ctx, unsigned num_cbufs) +{ + struct pipe_context *pipe = ctx->pipe; + unsigned index = num_cbufs ? num_cbufs - 1 : 0; + + assert(num_cbufs <= PIPE_MAX_COLOR_BUFS); + + if (!ctx->fs_col[index]) + ctx->fs_col[index] = + util_make_fragment_clonecolor_shader(pipe, num_cbufs); + + return ctx->fs_col[index]; +} + +static INLINE +void *blitter_get_fs_texfetch_col(struct blitter_context_priv *ctx, + unsigned tex_target) +{ + struct pipe_context *pipe = ctx->pipe; + + assert(tex_target < PIPE_MAX_TEXTURE_TYPES); + + /* Create the fragment shader on-demand. */ + if (!ctx->fs_texfetch_col[tex_target]) { + switch (tex_target) { + case PIPE_TEXTURE_1D: + ctx->fs_texfetch_col[PIPE_TEXTURE_1D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_1D); + break; + case PIPE_TEXTURE_2D: + ctx->fs_texfetch_col[PIPE_TEXTURE_2D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_2D); + break; + case PIPE_TEXTURE_3D: + ctx->fs_texfetch_col[PIPE_TEXTURE_3D] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_3D); + break; + case PIPE_TEXTURE_CUBE: + ctx->fs_texfetch_col[PIPE_TEXTURE_CUBE] = + util_make_fragment_tex_shader(pipe, TGSI_TEXTURE_CUBE); + break; + default:; + } + } + + return ctx->fs_texfetch_col[tex_target]; +} + +static INLINE +void *blitter_get_fs_texfetch_depth(struct blitter_context_priv *ctx, + unsigned tex_target) +{ + struct pipe_context *pipe = ctx->pipe; + + assert(tex_target < PIPE_MAX_TEXTURE_TYPES); + + /* Create the fragment shader on-demand. */ + if (!ctx->fs_texfetch_depth[tex_target]) { + switch (tex_target) { + case PIPE_TEXTURE_1D: + ctx->fs_texfetch_depth[PIPE_TEXTURE_1D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_1D); + break; + case PIPE_TEXTURE_2D: + ctx->fs_texfetch_depth[PIPE_TEXTURE_2D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_2D); + break; + case PIPE_TEXTURE_3D: + ctx->fs_texfetch_depth[PIPE_TEXTURE_3D] = + util_make_fragment_tex_shader_writedepth(pipe, TGSI_TEXTURE_3D); + break; + case PIPE_TEXTURE_CUBE: + ctx->fs_texfetch_depth[PIPE_TEXTURE_CUBE] = + util_make_fragment_tex_shader_writedepth(pipe,TGSI_TEXTURE_CUBE); + break; + default:; + } + } + + return ctx->fs_texfetch_depth[tex_target]; +} + void util_blitter_clear(struct blitter_context *blitter, unsigned width, unsigned height, unsigned num_cbufs, @@ -450,12 +550,12 @@ void util_blitter_clear(struct blitter_context *blitter, if (clear_buffers & PIPE_CLEAR_DEPTHSTENCIL) pipe->bind_depth_stencil_alpha_state(pipe, - ctx->dsa_write_depth_stencil[stencil&0xff]); + blitter_get_state_write_depth_stencil(ctx, stencil)); else pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); pipe->bind_rasterizer_state(pipe, ctx->rs_state); - pipe->bind_fs_state(pipe, ctx->fs_col[num_cbufs ? num_cbufs-1 : 0]); + pipe->bind_fs_state(pipe, blitter_get_fs_col(ctx, num_cbufs)); pipe->bind_vs_state(pipe, ctx->vs_col); blitter_set_clear_color(ctx, rgba); @@ -516,22 +616,26 @@ void util_blitter_copy(struct blitter_context *blitter, pipe->bind_blend_state(pipe, ctx->blend_keep_color); pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_write_depth_keep_stencil); - pipe->bind_fs_state(pipe, ctx->fs_texfetch_depth[src->texture->target]); + pipe->bind_fs_state(pipe, + blitter_get_fs_texfetch_depth(ctx, src->texture->target)); fb_state.nr_cbufs = 0; fb_state.zsbuf = dst; } else { pipe->bind_blend_state(pipe, ctx->blend_write_color); pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); - pipe->bind_fs_state(pipe, ctx->fs_texfetch_col[src->texture->target]); + pipe->bind_fs_state(pipe, + blitter_get_fs_texfetch_col(ctx, src->texture->target)); fb_state.nr_cbufs = 1; fb_state.cbufs[0] = dst; fb_state.zsbuf = 0; } + pipe->bind_rasterizer_state(pipe, ctx->rs_state); pipe->bind_vs_state(pipe, ctx->vs_tex); - pipe->bind_fragment_sampler_states(pipe, 1, &ctx->sampler_state[src->level]); + pipe->bind_fragment_sampler_states(pipe, 1, + blitter_get_sampler_state(ctx, src->level)); pipe->set_fragment_sampler_textures(pipe, 1, &src->texture); pipe->set_framebuffer_state(pipe, &fb_state); @@ -601,7 +705,7 @@ void util_blitter_fill(struct blitter_context *blitter, pipe->bind_blend_state(pipe, ctx->blend_write_color); pipe->bind_depth_stencil_alpha_state(pipe, ctx->dsa_keep_depth_stencil); pipe->bind_rasterizer_state(pipe, ctx->rs_state); - pipe->bind_fs_state(pipe, ctx->fs_col[0]); + pipe->bind_fs_state(pipe, blitter_get_fs_col(ctx, 1)); pipe->bind_vs_state(pipe, ctx->vs_col); /* set a framebuffer state */ -- cgit v1.2.3 From 80e815639459367313cb0c2e5e32d978ed9fcd08 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 15 Dec 2009 01:11:22 +0100 Subject: util/blitter: kill the draw_quad callback --- src/gallium/auxiliary/util/u_blitter.c | 17 ++++++----------- src/gallium/auxiliary/util/u_blitter.h | 14 -------------- 2 files changed, 6 insertions(+), 25 deletions(-) diff --git a/src/gallium/auxiliary/util/u_blitter.c b/src/gallium/auxiliary/util/u_blitter.c index 42efa86e198..895af2c8d00 100644 --- a/src/gallium/auxiliary/util/u_blitter.c +++ b/src/gallium/auxiliary/util/u_blitter.c @@ -385,20 +385,15 @@ static void blitter_set_texcoords_cube(struct blitter_context_priv *ctx, static void blitter_draw_quad(struct blitter_context_priv *ctx) { - struct blitter_context *blitter = &ctx->blitter; struct pipe_context *pipe = ctx->pipe; - if (blitter->draw_quad) { - blitter->draw_quad(pipe, &ctx->vertices[0][0][0]); - } else { - /* write vertices and draw them */ - pipe_buffer_write(pipe->screen, ctx->vbuf, - 0, sizeof(ctx->vertices), ctx->vertices); + /* write vertices and draw them */ + pipe_buffer_write(pipe->screen, ctx->vbuf, + 0, sizeof(ctx->vertices), ctx->vertices); - util_draw_vertex_buffer(ctx->pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, - 4, /* verts */ - 2); /* attribs/vert */ - } + util_draw_vertex_buffer(pipe, ctx->vbuf, 0, PIPE_PRIM_TRIANGLE_FAN, + 4, /* verts */ + 2); /* attribs/vert */ } static INLINE diff --git a/src/gallium/auxiliary/util/u_blitter.h b/src/gallium/auxiliary/util/u_blitter.h index e4cbb5c5afa..3da5a6ca525 100644 --- a/src/gallium/auxiliary/util/u_blitter.h +++ b/src/gallium/auxiliary/util/u_blitter.h @@ -40,20 +40,6 @@ struct pipe_context; struct blitter_context { - /** - * Draw a quad. - * - * The pipe driver can set this to provide a more efficient way of drawing - * a quad. If it's NULL, the quad is drawn using a vertex buffer. - * - * There are always 4 vertices with interleaved vertex elements of type - * RGBA32F. See the vertex shader _output_ semantics to know what those are. - * The primitive type is always PIPE_PRIM_TRIANGLE_FAN and VS/clip/viewport - * is bypasssed. - */ - void (*draw_quad)(struct pipe_context *pipe, - const float *vertices); - /* Private members, really. */ void *saved_blend_state; /**< blend state */ void *saved_dsa_state; /**< depth stencil alpha state */ -- cgit v1.2.3 From bc443d841c84977abd88d3be3d78287480fbe72d Mon Sep 17 00:00:00 2001 From: Michel Dänzer Date: Wed, 16 Dec 2009 00:37:40 +0100 Subject: r300: Fix typo on < R5xx RS setup for blits. --- src/mesa/drivers/dri/r300/r300_blit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/r300/r300_blit.c b/src/mesa/drivers/dri/r300/r300_blit.c index 3523c2792e5..ca6dd3bcf8e 100644 --- a/src/mesa/drivers/dri/r300/r300_blit.c +++ b/src/mesa/drivers/dri/r300/r300_blit.c @@ -315,8 +315,8 @@ static void r300_emit_rs_setup(struct r300_context *r300) OUT_BATCH_REGVAL(R300_RS_IP_0, R300_RS_TEX_PTR(0) | R300_RS_SEL_S(R300_RS_SEL_C0) | - R300_RS_SEL_R(R300_RS_SEL_C1) | - R300_RS_SEL_T(R300_RS_SEL_K0) | + R300_RS_SEL_T(R300_RS_SEL_C1) | + R300_RS_SEL_R(R300_RS_SEL_K0) | R300_RS_SEL_Q(R300_RS_SEL_K1)); END_BATCH(); } -- cgit v1.2.3 From 417ce06306962a9355cbb35cefcdea1951b0ce85 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 12 Dec 2009 23:44:02 +0100 Subject: r300g: flush CS if a buffer being deleted is referenced by it --- src/gallium/winsys/drm/radeon/core/radeon_buffer.c | 6 ++++++ src/gallium/winsys/drm/radeon/core/radeon_buffer.h | 1 + src/gallium/winsys/drm/radeon/core/radeon_drm.c | 1 + 3 files changed, 8 insertions(+) diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c index 2a8daed051d..76acc99ad73 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.c @@ -81,6 +81,7 @@ static struct pipe_buffer *radeon_buffer_create(struct pipe_winsys *ws, domain |= RADEON_GEM_DOMAIN_GTT; } + radeon_buffer->ws = radeon_ws; radeon_buffer->bo = radeon_bo_open(radeon_ws->priv->bom, 0, size, alignment, domain, 0); if (radeon_buffer->bo == NULL) { @@ -131,6 +132,11 @@ static void radeon_buffer_del(struct pipe_buffer *buffer) { struct radeon_pipe_buffer *radeon_buffer = (struct radeon_pipe_buffer*)buffer; + struct radeon_winsys_priv *priv = radeon_buffer->ws->priv; + + if (radeon_bo_is_referenced_by_cs(radeon_buffer->bo, priv->cs)) { + priv->cs->space_flush_fn(priv->cs->space_flush_data); + } radeon_bo_unref(radeon_buffer->bo); free(radeon_buffer); diff --git a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h index bfe2221d1ed..1e91e18927a 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_buffer.h +++ b/src/gallium/winsys/drm/radeon/core/radeon_buffer.h @@ -50,6 +50,7 @@ struct radeon_pipe_buffer { struct pipe_buffer base; struct radeon_bo *bo; + struct radeon_winsys *ws; boolean flinked; uint32_t flink; }; diff --git a/src/gallium/winsys/drm/radeon/core/radeon_drm.c b/src/gallium/winsys/drm/radeon/core/radeon_drm.c index dec7c065036..2f7fbc72423 100644 --- a/src/gallium/winsys/drm/radeon/core/radeon_drm.c +++ b/src/gallium/winsys/drm/radeon/core/radeon_drm.c @@ -171,6 +171,7 @@ struct pipe_buffer* radeon_buffer_from_handle(struct drm_api* api, radeon_buffer->base.screen = screen; radeon_buffer->base.usage = PIPE_BUFFER_USAGE_PIXEL; radeon_buffer->bo = bo; + radeon_buffer->ws = (struct radeon_winsys*)screen->winsys; return &radeon_buffer->base; } -- cgit v1.2.3 From 38a97148bf5df3c32087a5fdd799912d0275267d Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 13 Dec 2009 01:32:39 +0100 Subject: r300g: add acceleration of the clear, surface_copy, and surface_fill functions --- src/gallium/drivers/r300/Makefile | 2 +- src/gallium/drivers/r300/SConscript | 2 +- src/gallium/drivers/r300/r300_blit.c | 130 ++++++++++++++++++++++++++++++++ src/gallium/drivers/r300/r300_blit.h | 48 ++++++++++++ src/gallium/drivers/r300/r300_clear.c | 38 ---------- src/gallium/drivers/r300/r300_clear.h | 34 --------- src/gallium/drivers/r300/r300_context.c | 9 ++- src/gallium/drivers/r300/r300_context.h | 4 + 8 files changed, 192 insertions(+), 75 deletions(-) create mode 100644 src/gallium/drivers/r300/r300_blit.c create mode 100644 src/gallium/drivers/r300/r300_blit.h delete mode 100644 src/gallium/drivers/r300/r300_clear.c delete mode 100644 src/gallium/drivers/r300/r300_clear.h diff --git a/src/gallium/drivers/r300/Makefile b/src/gallium/drivers/r300/Makefile index 9c9fc6f64b3..8cfd4147c20 100644 --- a/src/gallium/drivers/r300/Makefile +++ b/src/gallium/drivers/r300/Makefile @@ -4,8 +4,8 @@ include $(TOP)/configs/current LIBNAME = r300 C_SOURCES = \ + r300_blit.c \ r300_chipset.c \ - r300_clear.c \ r300_context.c \ r300_debug.c \ r300_emit.c \ diff --git a/src/gallium/drivers/r300/SConscript b/src/gallium/drivers/r300/SConscript index 97989040d2e..0d2de17be93 100644 --- a/src/gallium/drivers/r300/SConscript +++ b/src/gallium/drivers/r300/SConscript @@ -9,8 +9,8 @@ env.Append(CPPPATH = ['#/src/mesa/drivers/dri/r300/compiler', '#/include', '#/sr r300 = env.ConvenienceLibrary( target = 'r300', source = [ + 'r300_blit.c', 'r300_chipset.c', - 'r300_clear.c', 'r300_context.c', 'r300_debug.c', 'r300_emit.c', diff --git a/src/gallium/drivers/r300/r300_blit.c b/src/gallium/drivers/r300/r300_blit.c new file mode 100644 index 00000000000..ffe066d5369 --- /dev/null +++ b/src/gallium/drivers/r300/r300_blit.c @@ -0,0 +1,130 @@ +/* + * Copyright 2009 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#include "r300_blit.h" +#include "r300_context.h" + +#include "util/u_rect.h" + +static void r300_blitter_save_states(struct r300_context* r300) +{ + util_blitter_save_blend(r300->blitter, r300->blend_state); + util_blitter_save_depth_stencil_alpha(r300->blitter, r300->dsa_state); + util_blitter_save_rasterizer(r300->blitter, r300->rs_state); + util_blitter_save_fragment_shader(r300->blitter, r300->fs); + util_blitter_save_vertex_shader(r300->blitter, r300->vs); +} + +/* Clear currently bound buffers. */ +void r300_clear(struct pipe_context* pipe, + unsigned buffers, + const float* rgba, + double depth, + unsigned stencil) +{ + /* XXX Implement fastfill. + * + * If fastfill is enabled, a few facts should be considered: + * + * 1) Zbuffer must be micro-tiled and whole microtiles must be + * written. + * + * 2) ZB_DEPTHCLEARVALUE is used to clear a zbuffer and Z Mask must be + * equal to 0. + * + * 3) RB3D_COLOR_CLEAR_VALUE is used to clear a colorbuffer and + * RB3D_COLOR_CHANNEL_MASK must be equal to 0. + * + * 4) ZB_CB_CLEAR can be used to make the ZB units help in clearing + * the colorbuffer. The color clear value is supplied through both + * RB3D_COLOR_CLEAR_VALUE and ZB_DEPTHCLEARVALUE, and the colorbuffer + * must be set in ZB_DEPTHOFFSET and ZB_DEPTHPITCH in addition to + * RB3D_COLOROFFSET and RB3D_COLORPITCH. It's obvious that the zbuffer + * will not be cleared and multiple render targets cannot be cleared + * this way either. + * + * 5) For 16-bit integer buffering, compression causes a hung with one or + * two samples and should not be used. + * + * 6) Fastfill must not be used if reading of compressed Z data is disabled + * and writing of compressed Z data is enabled (RD/WR_COMP_ENABLE), + * i.e. it cannot be used to compress the zbuffer. + * (what the hell does that mean and how does it fit in clearing + * the buffers?) + * + * - Marek + */ + + struct r300_context* r300 = r300_context(pipe); + + r300_blitter_save_states(r300); + + util_blitter_clear(r300->blitter, + r300->framebuffer_state.width, + r300->framebuffer_state.height, + r300->framebuffer_state.nr_cbufs, + buffers, rgba, depth, stencil); +} + +/* Copy a block of pixels from one surface to another. */ +void r300_surface_copy(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + struct pipe_surface* src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height) +{ + struct r300_context* r300 = r300_context(pipe); + + /* Yeah we have to save all those states to ensure this blitter operation + * is really transparent. The states will be restored by the blitter once + * copying is done. */ + r300_blitter_save_states(r300); + util_blitter_save_framebuffer(r300->blitter, &r300->framebuffer_state); + + util_blitter_save_fragment_sampler_states( + r300->blitter, r300->sampler_count, (void**)r300->sampler_states); + + util_blitter_save_fragment_sampler_textures( + r300->blitter, r300->texture_count, + (struct pipe_texture**)r300->textures); + + /* Do a copy */ + util_blitter_copy(r300->blitter, + dst, dstx, dsty, src, srcx, srcy, width, height, TRUE); +} + +/* Fill a region of a surface with a constant value. */ +void r300_surface_fill(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + unsigned width, unsigned height, + unsigned value) +{ + struct r300_context* r300 = r300_context(pipe); + + r300_blitter_save_states(r300); + util_blitter_save_framebuffer(r300->blitter, &r300->framebuffer_state); + + util_blitter_fill(r300->blitter, + dst, dstx, dsty, width, height, value); +} diff --git a/src/gallium/drivers/r300/r300_blit.h b/src/gallium/drivers/r300/r300_blit.h new file mode 100644 index 00000000000..029e4f98e7d --- /dev/null +++ b/src/gallium/drivers/r300/r300_blit.h @@ -0,0 +1,48 @@ +/* + * Copyright 2008 Marek Olšák + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * on the rights to use, copy, modify, merge, publish, distribute, sub + * license, and/or sell copies of the Software, and to permit persons to whom + * the Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL + * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + * USE OR OTHER DEALINGS IN THE SOFTWARE. */ + +#ifndef R300_BLIT_H +#define R300_BLIT_H + +struct pipe_context; +struct pipe_surface; + +void r300_clear(struct pipe_context* pipe, + unsigned buffers, + const float* rgba, + double depth, + unsigned stencil); + +void r300_surface_copy(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + struct pipe_surface* src, + unsigned srcx, unsigned srcy, + unsigned width, unsigned height); + +void r300_surface_fill(struct pipe_context* pipe, + struct pipe_surface* dst, + unsigned dstx, unsigned dsty, + unsigned width, unsigned height, + unsigned value); + +#endif /* R300_BLIT_H */ diff --git a/src/gallium/drivers/r300/r300_clear.c b/src/gallium/drivers/r300/r300_clear.c deleted file mode 100644 index 02d6d504fc0..00000000000 --- a/src/gallium/drivers/r300/r300_clear.c +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#include "r300_clear.h" -#include "r300_context.h" - -#include "util/u_clear.h" - -/* Clears currently bound buffers. */ -void r300_clear(struct pipe_context* pipe, - unsigned buffers, - const float* rgba, - double depth, - unsigned stencil) -{ - /* XXX we can and should do one clear if both color and zs are set */ - util_clear(pipe, &r300_context(pipe)->framebuffer_state, - buffers, rgba, depth, stencil); -} diff --git a/src/gallium/drivers/r300/r300_clear.h b/src/gallium/drivers/r300/r300_clear.h deleted file mode 100644 index b8fcdf273c7..00000000000 --- a/src/gallium/drivers/r300/r300_clear.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - * Copyright 2008 Corbin Simpson - * - * Permission is hereby granted, free of charge, to any person obtaining a - * copy of this software and associated documentation files (the "Software"), - * to deal in the Software without restriction, including without limitation - * on the rights to use, copy, modify, merge, publish, distribute, sub - * license, and/or sell copies of the Software, and to permit persons to whom - * the Software is furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice (including the next - * paragraph) shall be included in all copies or substantial portions of the - * Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL - * THE AUTHOR(S) AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, - * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR - * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE - * USE OR OTHER DEALINGS IN THE SOFTWARE. */ - -#ifndef R300_CLEAR_H -#define R300_CLEAR_H - -struct pipe_context; - -void r300_clear(struct pipe_context* pipe, - unsigned buffers, - const float* rgba, - double depth, - unsigned stencil); - -#endif /* R300_CLEAR_H */ diff --git a/src/gallium/drivers/r300/r300_context.c b/src/gallium/drivers/r300/r300_context.c index 5b337f03ac4..d5c2d63d393 100644 --- a/src/gallium/drivers/r300/r300_context.c +++ b/src/gallium/drivers/r300/r300_context.c @@ -28,7 +28,7 @@ #include "util/u_memory.h" #include "util/u_simple_list.h" -#include "r300_clear.h" +#include "r300_blit.h" #include "r300_context.h" #include "r300_flush.h" #include "r300_query.h" @@ -52,6 +52,8 @@ static void r300_destroy_context(struct pipe_context* context) struct r300_context* r300 = r300_context(context); struct r300_query* query, * temp; + util_blitter_destroy(r300->blitter); + util_hash_table_foreach(r300->shader_hash_table, r300_clear_hash_table, NULL); util_hash_table_destroy(r300->shader_hash_table); @@ -124,6 +126,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->context.destroy = r300_destroy_context; r300->context.clear = r300_clear; + r300->context.surface_copy = r300_surface_copy; + r300->context.surface_fill = r300_surface_fill; if (r300screen->caps->has_tcl) { r300->context.draw_arrays = r300_draw_arrays; @@ -175,5 +179,8 @@ struct pipe_context* r300_create_context(struct pipe_screen* screen, r300->winsys->set_flush_cb(r300->winsys, r300_flush_cb, r300); r300->dirty_state = R300_NEW_KITCHEN_SINK; r300->dirty_hw++; + + r300->blitter = util_blitter_create(&r300->context); + return &r300->context; } diff --git a/src/gallium/drivers/r300/r300_context.h b/src/gallium/drivers/r300/r300_context.h index 0be190392a5..6bd2766730f 100644 --- a/src/gallium/drivers/r300/r300_context.h +++ b/src/gallium/drivers/r300/r300_context.h @@ -25,6 +25,8 @@ #include "draw/draw_vertex.h" +#include "util/u_blitter.h" + #include "pipe/p_context.h" #include "pipe/p_inlines.h" @@ -248,6 +250,8 @@ struct r300_context { struct radeon_winsys* winsys; /* Draw module. Used mostly for SW TCL. */ struct draw_context* draw; + /* Accelerated blit support. */ + struct blitter_context* blitter; /* Vertex buffer for rendering. */ struct pipe_buffer* vbo; -- cgit v1.2.3 From c5e0b0bc37315cd29a84e71854dca951149b8bc8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sun, 13 Dec 2009 02:19:18 +0100 Subject: r300g: add Z24X8 to the list of unsupported sampler formats on R3xx-R4xx --- src/gallium/drivers/r300/r300_screen.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_screen.c b/src/gallium/drivers/r300/r300_screen.c index c0d9797020d..feb571a23dd 100644 --- a/src/gallium/drivers/r300/r300_screen.c +++ b/src/gallium/drivers/r300/r300_screen.c @@ -220,12 +220,18 @@ static boolean check_tex_format(enum pipe_format format, uint32_t usage, /* Z buffer or texture */ case PIPE_FORMAT_Z16_UNORM: + retval = usage & + (PIPE_TEXTURE_USAGE_DEPTH_STENCIL | + PIPE_TEXTURE_USAGE_SAMPLER); + break; + + /* 24bit Z buffer can only be used as a texture on R500. */ case PIPE_FORMAT_Z24X8_UNORM: /* Z buffer with stencil or texture */ case PIPE_FORMAT_Z24S8_UNORM: retval = usage & (PIPE_TEXTURE_USAGE_DEPTH_STENCIL | - PIPE_TEXTURE_USAGE_SAMPLER); + (is_r500 ? PIPE_TEXTURE_USAGE_SAMPLER : 0)); break; /* Definitely unsupported formats. */ -- cgit v1.2.3 From de0befc4b2e3061f865a5b39295d64a8f003e9e8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 05:22:36 +0100 Subject: r300g: remove unnecessary flush in set_sampler_textures --- src/gallium/drivers/r300/r300_state.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index edf7114bbb5..3cfa2e63f90 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -626,8 +626,6 @@ static void r300_set_sampler_textures(struct pipe_context* pipe, return; } - r300->context.flush(&r300->context, 0, NULL); - for (i = 0; i < count; i++) { if (r300->textures[i] != (struct r300_texture*)texture[i]) { pipe_texture_reference((struct pipe_texture**)&r300->textures[i], -- cgit v1.2.3 From cf85bf9cd0c168caed6210a896df285c3d86db03 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 05:47:54 +0100 Subject: r300g: set the number of colorbuffers in RB3D_CCTL --- src/gallium/drivers/r300/r300_emit.c | 5 ++++- src/gallium/drivers/r300/r300_reg.h | 1 + src/gallium/drivers/r300/r300_state_invariant.c | 3 +-- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index f784e1fa8e5..9644efb7174 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -335,7 +335,7 @@ void r300_emit_fb_state(struct r300_context* r300, assert(fb->nr_cbufs <= 4); BEGIN_CS((10 * fb->nr_cbufs) + (2 * (4 - fb->nr_cbufs)) + - (fb->zsbuf ? 10 : 0) + 4); + (fb->zsbuf ? 10 : 0) + 6); /* Flush and free renderbuffer caches. */ OUT_CS_REG(R300_RB3D_DSTCACHE_CTLSTAT, @@ -345,6 +345,9 @@ void r300_emit_fb_state(struct r300_context* r300, R300_ZB_ZCACHE_CTLSTAT_ZC_FLUSH_FLUSH_AND_FREE | R300_ZB_ZCACHE_CTLSTAT_ZC_FREE_FREE); + /* Set the number of colorbuffers. */ + OUT_CS_REG(R300_RB3D_CCTL, R300_RB3D_CCTL_NUM_MULTIWRITES(fb->nr_cbufs)); + /* Set up colorbuffers. */ for (i = 0; i < fb->nr_cbufs; i++) { surf = fb->cbufs[i]; diff --git a/src/gallium/drivers/r300/r300_reg.h b/src/gallium/drivers/r300/r300_reg.h index c1ea87d11e9..d8d08fbe264 100644 --- a/src/gallium/drivers/r300/r300_reg.h +++ b/src/gallium/drivers/r300/r300_reg.h @@ -2145,6 +2145,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. /* Unpipelined. */ #define R300_RB3D_CCTL 0x4e00 +# define R300_RB3D_CCTL_NUM_MULTIWRITES(x) (MAX2(((x)-1), 0) << 5) # define R300_RB3D_CCTL_NUM_MULTIWRITES_1_BUFFER (0 << 5) # define R300_RB3D_CCTL_NUM_MULTIWRITES_2_BUFFERS (1 << 5) # define R300_RB3D_CCTL_NUM_MULTIWRITES_3_BUFFERS (2 << 5) diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c index 46d1cb39b54..3320d43b275 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.c +++ b/src/gallium/drivers/r300/r300_state_invariant.c @@ -84,7 +84,7 @@ void r300_emit_invariant_state(struct r300_context* r300) END_CS; /* XXX unsorted stuff from surface_fill */ - BEGIN_CS(56 + (caps->has_tcl ? 5 : 0) + (caps->is_r500 ? 4 : 0)); + BEGIN_CS(54 + (caps->has_tcl ? 5 : 0) + (caps->is_r500 ? 4 : 0)); /* Flush PVS. */ OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); @@ -123,7 +123,6 @@ void r300_emit_invariant_state(struct r300_context* r300) OUT_CS_REG(R300_SU_DEPTH_OFFSET, 0x00000000); OUT_CS_REG(R300_SC_HYPERZ, 0x0000001C); OUT_CS_REG(R300_SC_EDGERULE, 0x2DA49525); - OUT_CS_REG(R300_RB3D_CCTL, 0x00000000); OUT_CS_REG(R300_RB3D_AARESOLVE_CTL, 0x00000000); if (caps->is_r500) { OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); -- cgit v1.2.3 From a6d701d1c6ed8e0a649d62104aeded8fb25c66d8 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 05:29:12 +0100 Subject: r300g: if no colorbuffers are set, disable blending and set the color mask to 0 This seems to be the only way to disable the first colorbuffer. --- src/gallium/drivers/r300/r300_emit.c | 13 ++++++++++--- src/gallium/drivers/r300/r300_state.c | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 9644efb7174..55e4f94afe2 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -41,9 +41,16 @@ void r300_emit_blend_state(struct r300_context* r300, CS_LOCALS(r300); BEGIN_CS(8); OUT_CS_REG_SEQ(R300_RB3D_CBLEND, 3); - OUT_CS(blend->blend_control); - OUT_CS(blend->alpha_blend_control); - OUT_CS(blend->color_channel_mask); + if (r300->framebuffer_state.nr_cbufs) { + OUT_CS(blend->blend_control); + OUT_CS(blend->alpha_blend_control); + OUT_CS(blend->color_channel_mask); + } else { + OUT_CS(0); + OUT_CS(0); + OUT_CS(0); + /* XXX also disable fastfill here once it's supported */ + } OUT_CS_REG(R300_RB3D_ROPCNTL, blend->rop); OUT_CS_REG(R300_RB3D_DITHER_CTL, blend->dither); END_CS; diff --git a/src/gallium/drivers/r300/r300_state.c b/src/gallium/drivers/r300/r300_state.c index 3cfa2e63f90..91cf972edee 100644 --- a/src/gallium/drivers/r300/r300_state.c +++ b/src/gallium/drivers/r300/r300_state.c @@ -339,6 +339,7 @@ static void r300->dirty_state |= R300_NEW_SCISSOR; } r300->dirty_state |= R300_NEW_FRAMEBUFFERS; + r300->dirty_state |= R300_NEW_BLEND; } /* Create fragment shader state. */ -- cgit v1.2.3 From acce4824ec284b2a9bfdc847d7d79b8064912db9 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 06:39:08 +0100 Subject: r300g: clamp vertex indices to [min,max] everywhere --- src/gallium/drivers/r300/r300_render.c | 8 +++++--- src/gallium/drivers/r300/r300_state_invariant.c | 5 +---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/src/gallium/drivers/r300/r300_render.c b/src/gallium/drivers/r300/r300_render.c index 35b335df6a1..4b210f72db2 100644 --- a/src/gallium/drivers/r300/r300_render.c +++ b/src/gallium/drivers/r300/r300_render.c @@ -82,8 +82,9 @@ static void r300_emit_draw_arrays(struct r300_context *r300, { CS_LOCALS(r300); - BEGIN_CS(4); - OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, count); + BEGIN_CS(6); + OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0); + OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, count - 1); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_VBUF_2, 0); OUT_CS(R300_VAP_VF_CNTL__PRIM_WALK_VERTEX_LIST | (count << 16) | r300_translate_primitive(mode)); @@ -108,7 +109,8 @@ static void r300_emit_draw_elements(struct r300_context *r300, assert((start * indexSize) % 4 == 0); assert(offset_dwords == 0); - BEGIN_CS(10); + BEGIN_CS(12); + OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, minIndex); OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, maxIndex); OUT_CS_PKT3(R300_PACKET3_3D_DRAW_INDX_2, 0); if (indexSize == 4) { diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c index 3320d43b275..d80e20a4935 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.c +++ b/src/gallium/drivers/r300/r300_state_invariant.c @@ -43,7 +43,7 @@ void r300_emit_invariant_state(struct r300_context* r300) struct r300_capabilities* caps = r300_screen(r300->context.screen)->caps; CS_LOCALS(r300); - BEGIN_CS(24 + (caps->has_tcl ? 2: 0)); + BEGIN_CS(20 + (caps->has_tcl ? 2: 0)); /*** Graphics Backend (GB) ***/ /* Various GB enables */ @@ -70,9 +70,6 @@ void r300_emit_invariant_state(struct r300_context* r300) OUT_CS_REG(R300_US_W_FMT, 0x0); /*** VAP ***/ - /* Max and min vertex index clamp. */ - OUT_CS_REG(R300_VAP_VF_MIN_VTX_INDX, 0x0); - OUT_CS_REG(R300_VAP_VF_MAX_VTX_INDX, 0xffffff); /* Sign/normalize control */ OUT_CS_REG(R300_VAP_PSC_SGN_NORM_CNTL, R300_SGN_NORM_NO_ZERO); /* TCL-only stuff */ -- cgit v1.2.3 From ded4ecde60e36bbf7204ebb3b43c6ec065ff1f06 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Mon, 14 Dec 2009 06:55:54 +0100 Subject: r300g: clean up the invariant state --- src/gallium/drivers/r300/r300_state_invariant.c | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/src/gallium/drivers/r300/r300_state_invariant.c b/src/gallium/drivers/r300/r300_state_invariant.c index d80e20a4935..bcd4c030f9c 100644 --- a/src/gallium/drivers/r300/r300_state_invariant.c +++ b/src/gallium/drivers/r300/r300_state_invariant.c @@ -81,15 +81,11 @@ void r300_emit_invariant_state(struct r300_context* r300) END_CS; /* XXX unsorted stuff from surface_fill */ - BEGIN_CS(54 + (caps->has_tcl ? 5 : 0) + (caps->is_r500 ? 4 : 0)); - /* Flush PVS. */ - OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0x0); + BEGIN_CS(44 + (caps->has_tcl ? 7 : 0) + (caps->is_r500 ? 4 : 0)); - OUT_CS_REG(R300_SE_VTE_CNTL, R300_VPORT_X_SCALE_ENA | - R300_VPORT_X_OFFSET_ENA | R300_VPORT_Y_SCALE_ENA | - R300_VPORT_Y_OFFSET_ENA | R300_VPORT_Z_SCALE_ENA | - R300_VPORT_Z_OFFSET_ENA | R300_VTX_W0_FMT); if (caps->has_tcl) { + /*Flushing PVS is required before the VAP_GB registers can be changed*/ + OUT_CS_REG(R300_VAP_PVS_STATE_FLUSH_REG, 0); OUT_CS_REG_SEQ(R300_VAP_GB_VERT_CLIP_ADJ, 4); OUT_CS_32F(1.0); OUT_CS_32F(1.0); @@ -125,13 +121,10 @@ void r300_emit_invariant_state(struct r300_context* r300) OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_LTE_THRESHOLD, 0x00000000); OUT_CS_REG(R500_RB3D_DISCARD_SRC_PIXEL_GTE_THRESHOLD, 0xFFFFFFFF); } - OUT_CS_REG(R300_ZB_FORMAT, 0x00000002); - OUT_CS_REG(R300_ZB_ZCACHE_CTLSTAT, 0x00000003); OUT_CS_REG(R300_ZB_BW_CNTL, 0x00000000); OUT_CS_REG(R300_ZB_DEPTHCLEARVALUE, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_OFFSET, 0x00000000); OUT_CS_REG(R300_ZB_HIZ_PITCH, 0x00000000); - OUT_CS_REG(R300_SE_VTE_CNTL, 0x0000043F); /* XXX */ OUT_CS_REG(R300_SC_CLIP_RULE, 0xaaaa); -- cgit v1.2.3 From 2ddee2cfbcef59128b2a251d5391ddc2b4aea4bb Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Tue, 15 Dec 2009 05:35:03 +0100 Subject: r300g: fix emission of which textures are enabled It fixes most of the "Bad CS" issues in piglit/texCombine and piglit/fbo. Some other issues of this kind will get fixed in the kernel soon (depth-only rendering, S3TC, and RGTC). --- src/gallium/drivers/r300/r300_emit.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/r300/r300_emit.c b/src/gallium/drivers/r300/r300_emit.c index 55e4f94afe2..55c8aa07bdf 100644 --- a/src/gallium/drivers/r300/r300_emit.c +++ b/src/gallium/drivers/r300/r300_emit.c @@ -883,10 +883,21 @@ void r300_emit_viewport_state(struct r300_context* r300, void r300_emit_texture_count(struct r300_context* r300) { + uint32_t tx_enable = 0; + int i; CS_LOCALS(r300); + /* Notice that texture_count and sampler_count are just sizes + * of the respective arrays. We still have to check for the individual + * elements. */ + for (i = 0; i < MIN2(r300->sampler_count, r300->texture_count); i++) { + if (r300->textures[i]) { + tx_enable |= 1 << i; + } + } + BEGIN_CS(2); - OUT_CS_REG(R300_TX_ENABLE, (1 << r300->texture_count) - 1); + OUT_CS_REG(R300_TX_ENABLE, tx_enable); END_CS; } -- cgit v1.2.3 From 43d6c81ae2b3cb263f803bb9881c0823c1ed7dda Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Dec 2009 15:24:31 -0700 Subject: llvmpipe: fix broken lp_build_abs() --- src/gallium/drivers/llvmpipe/lp_bld_arit.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_arit.c b/src/gallium/drivers/llvmpipe/lp_bld_arit.c index 847c2a34b1f..eea6b5d6a5c 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_arit.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_arit.c @@ -629,7 +629,8 @@ lp_build_abs(struct lp_build_context *bld, if(type.floating) { /* Mask out the sign bit */ LLVMTypeRef int_vec_type = lp_build_int_vec_type(type); - LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long)1 << type.width) - 1); + unsigned long absMask = ~(1 << (type.width - 1)); + LLVMValueRef mask = lp_build_int_const_scalar(type, ((unsigned long long) absMask)); a = LLVMBuildBitCast(bld->builder, a, int_vec_type, ""); a = LLVMBuildAnd(bld->builder, a, mask, ""); a = LLVMBuildBitCast(bld->builder, a, vec_type, ""); -- cgit v1.2.3 From f1f49bd465b899d1c85aa07650ca5b62a50303b0 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Mon, 14 Dec 2009 15:27:35 -0700 Subject: llvmpipe: fix broken TGSI_OPCODE_FRC codegen --- src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c index 3eb0e0c57cb..a67c70ff25a 100644 --- a/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c +++ b/src/gallium/drivers/llvmpipe/lp_bld_tgsi_soa.c @@ -763,7 +763,7 @@ emit_instruction( FOR_EACH_DST0_ENABLED_CHANNEL( inst, chan_index ) { src0 = emit_fetch( bld, inst, 0, chan_index ); tmp0 = lp_build_floor(&bld->base, src0); - tmp0 = lp_build_sub(&bld->base, tmp0, src0); + tmp0 = lp_build_sub(&bld->base, src0, tmp0); dst0[chan_index] = tmp0; } break; -- cgit v1.2.3 From 2584c5bd253e53ba052356360a33b5ec976e9716 Mon Sep 17 00:00:00 2001 From: José Fonseca Date: Wed, 16 Dec 2009 15:06:02 +0000 Subject: llvmpipe: add LP_DEBUG env var Cherry-picked from dec35d04aeb398eef159aaf8cde5e0d04622b811. --- src/gallium/drivers/llvmpipe/lp_debug.h | 71 +++++++++++++++++ src/gallium/drivers/llvmpipe/lp_screen.c | 22 ++++++ src/gallium/drivers/llvmpipe/lp_state_fs.c | 117 ++++++++++++++--------------- 3 files changed, 151 insertions(+), 59 deletions(-) create mode 100644 src/gallium/drivers/llvmpipe/lp_debug.h diff --git a/src/gallium/drivers/llvmpipe/lp_debug.h b/src/gallium/drivers/llvmpipe/lp_debug.h new file mode 100644 index 00000000000..74b27574942 --- /dev/null +++ b/src/gallium/drivers/llvmpipe/lp_debug.h @@ -0,0 +1,71 @@ +/************************************************************************** + * + * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas. + * All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sub license, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice (including the + * next paragraph) shall be included in all copies or substantial portions + * of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. + * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR + * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, + * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE + * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + * + **************************************************************************/ + + +#ifndef LP_DEBUG_H +#define LP_DEBUG_H + +#include "pipe/p_compiler.h" +#include "util/u_debug.h" + +extern void +st_print_current(void); + + +#define DEBUG_PIPE 0x1 +#define DEBUG_TGSI 0x2 +#define DEBUG_TEX 0x4 +#define DEBUG_ASM 0x8 +#define DEBUG_SETUP 0x10 +#define DEBUG_RAST 0x20 +#define DEBUG_QUERY 0x40 +#define DEBUG_SCREEN 0x80 +#define DEBUG_JIT 0x100 + +#ifdef DEBUG +extern int LP_DEBUG; +#else +#define LP_DEBUG 0 +#endif + +void st_debug_init( void ); + +static INLINE void +LP_DBG( unsigned flag, const char *fmt, ... ) +{ + if (LP_DEBUG & flag) + { + va_list args; + + va_start( args, fmt ); + debug_vprintf( fmt, args ); + va_end( args ); + } +} + + +#endif /* LP_DEBUG_H */ diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index 19fe2850fd1..9b47415f003 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -36,6 +36,24 @@ #include "lp_winsys.h" #include "lp_jit.h" #include "lp_screen.h" +#include "lp_debug.h" + +#ifdef DEBUG +int LP_DEBUG = 0; + +static const struct debug_named_value lp_debug_flags[] = { + { "pipe", DEBUG_PIPE }, + { "tgsi", DEBUG_TGSI }, + { "tex", DEBUG_TEX }, + { "asm", DEBUG_ASM }, + { "setup", DEBUG_SETUP }, + { "rast", DEBUG_RAST }, + { "query", DEBUG_QUERY }, + { "screen", DEBUG_SCREEN }, + { "jit", DEBUG_JIT }, + {NULL, 0} +}; +#endif static const char * @@ -259,6 +277,10 @@ llvmpipe_create_screen(struct llvmpipe_winsys *winsys) { struct llvmpipe_screen *screen = CALLOC_STRUCT(llvmpipe_screen); +#ifdef DEBUG + LP_DEBUG = debug_get_flags_option("LP_DEBUG", lp_debug_flags, 0 ); +#endif + if (!screen) return NULL; diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c index ee0f69b2af9..22683ff8b42 100644 --- a/src/gallium/drivers/llvmpipe/lp_state_fs.c +++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c @@ -87,6 +87,7 @@ #include "lp_state.h" #include "lp_quad.h" #include "lp_tex_sample.h" +#include "lp_debug.h" static const unsigned char quad_offset_x[4] = {0, 1, 0, 1}; @@ -408,59 +409,58 @@ generate_fragment(struct llvmpipe_context *lp, unsigned i; unsigned chan; -#ifdef DEBUG - tgsi_dump(shader->base.tokens, 0); - if(key->depth.enabled) { - debug_printf("depth.format = %s\n", pf_name(key->zsbuf_format)); - debug_printf("depth.func = %s\n", debug_dump_func(key->depth.func, TRUE)); - debug_printf("depth.writemask = %u\n", key->depth.writemask); - } - if(key->alpha.enabled) { - debug_printf("alpha.func = %s\n", debug_dump_func(key->alpha.func, TRUE)); - debug_printf("alpha.ref_value = %f\n", key->alpha.ref_value); - } - if(key->blend.logicop_enable) { - debug_printf("blend.logicop_func = %u\n", key->blend.logicop_func); - } - else if(key->blend.blend_enable) { - debug_printf("blend.rgb_func = %s\n", debug_dump_blend_func (key->blend.rgb_func, TRUE)); - debug_printf("rgb_src_factor = %s\n", debug_dump_blend_factor(key->blend.rgb_src_factor, TRUE)); - debug_printf("rgb_dst_factor = %s\n", debug_dump_blend_factor(key->blend.rgb_dst_factor, TRUE)); - debug_printf("alpha_func = %s\n", debug_dump_blend_func (key->blend.alpha_func, TRUE)); - debug_printf("alpha_src_factor = %s\n", debug_dump_blend_factor(key->blend.alpha_src_factor, TRUE)); - debug_printf("alpha_dst_factor = %s\n", debug_dump_blend_factor(key->blend.alpha_dst_factor, TRUE)); - } - debug_printf("blend.colormask = 0x%x\n", key->blend.colormask); - for(i = 0; i < PIPE_MAX_SAMPLERS; ++i) { - if(key->sampler[i].format) { - debug_printf("sampler[%u] = \n", i); - debug_printf(" .format = %s\n", - pf_name(key->sampler[i].format)); - debug_printf(" .target = %s\n", - debug_dump_tex_target(key->sampler[i].target, TRUE)); - debug_printf(" .pot = %u %u %u\n", - key->sampler[i].pot_width, - key->sampler[i].pot_height, - key->sampler[i].pot_depth); - debug_printf(" .wrap = %s %s %s\n", - debug_dump_tex_wrap(key->sampler[i].wrap_s, TRUE), - debug_dump_tex_wrap(key->sampler[i].wrap_t, TRUE), - debug_dump_tex_wrap(key->sampler[i].wrap_r, TRUE)); - debug_printf(" .min_img_filter = %s\n", - debug_dump_tex_filter(key->sampler[i].min_img_filter, TRUE)); - debug_printf(" .min_mip_filter = %s\n", - debug_dump_tex_mipfilter(key->sampler[i].min_mip_filter, TRUE)); - debug_printf(" .mag_img_filter = %s\n", - debug_dump_tex_filter(key->sampler[i].mag_img_filter, TRUE)); - if(key->sampler[i].compare_mode) - debug_printf(" .compare_mode = %s\n", debug_dump_func(key->sampler[i].compare_func, TRUE)); - debug_printf(" .normalized_coords = %u\n", key->sampler[i].normalized_coords); - debug_printf(" .prefilter = %u\n", key->sampler[i].prefilter); + if (LP_DEBUG & DEBUG_JIT) { + tgsi_dump(shader->base.tokens, 0); + if(key->depth.enabled) { + debug_printf("depth.format = %s\n", pf_name(key->zsbuf_format)); + debug_printf("depth.func = %s\n", debug_dump_func(key->depth.func, TRUE)); + debug_printf("depth.writemask = %u\n", key->depth.writemask); + } + if(key->alpha.enabled) { + debug_printf("alpha.func = %s\n", debug_dump_func(key->alpha.func, TRUE)); + debug_printf("alpha.ref_value = %f\n", key->alpha.ref_value); + } + if(key->blend.logicop_enable) { + debug_printf("blend.logicop_func = %u\n", key->blend.logicop_func); + } + else if(key->blend.blend_enable) { + debug_printf("blend.rgb_func = %s\n", debug_dump_blend_func (key->blend.rgb_func, TRUE)); + debug_printf("rgb_src_factor = %s\n", debug_dump_blend_factor(key->blend.rgb_src_factor, TRUE)); + debug_printf("rgb_dst_factor = %s\n", debug_dump_blend_factor(key->blend.rgb_dst_factor, TRUE)); + debug_printf("alpha_func = %s\n", debug_dump_blend_func (key->blend.alpha_func, TRUE)); + debug_printf("alpha_src_factor = %s\n", debug_dump_blend_factor(key->blend.alpha_src_factor, TRUE)); + debug_printf("alpha_dst_factor = %s\n", debug_dump_blend_factor(key->blend.alpha_dst_factor, TRUE)); + } + debug_printf("blend.colormask = 0x%x\n", key->blend.colormask); + for(i = 0; i < PIPE_MAX_SAMPLERS; ++i) { + if(key->sampler[i].format) { + debug_printf("sampler[%u] = \n", i); + debug_printf(" .format = %s\n", + pf_name(key->sampler[i].format)); + debug_printf(" .target = %s\n", + debug_dump_tex_target(key->sampler[i].target, TRUE)); + debug_printf(" .pot = %u %u %u\n", + key->sampler[i].pot_width, + key->sampler[i].pot_height, + key->sampler[i].pot_depth); + debug_printf(" .wrap = %s %s %s\n", + debug_dump_tex_wrap(key->sampler[i].wrap_s, TRUE), + debug_dump_tex_wrap(key->sampler[i].wrap_t, TRUE), + debug_dump_tex_wrap(key->sampler[i].wrap_r, TRUE)); + debug_printf(" .min_img_filter = %s\n", + debug_dump_tex_filter(key->sampler[i].min_img_filter, TRUE)); + debug_printf(" .min_mip_filter = %s\n", + debug_dump_tex_mipfilter(key->sampler[i].min_mip_filter, TRUE)); + debug_printf(" .mag_img_filter = %s\n", + debug_dump_tex_filter(key->sampler[i].mag_img_filter, TRUE)); + if(key->sampler[i].compare_mode) + debug_printf(" .compare_mode = %s\n", debug_dump_func(key->sampler[i].compare_func, TRUE)); + debug_printf(" .normalized_coords = %u\n", key->sampler[i].normalized_coords); + debug_printf(" .prefilter = %u\n", key->sampler[i].prefilter); + } } } -#endif - variant = CALLOC_STRUCT(lp_fragment_shader_variant); if(!variant) return NULL; @@ -599,8 +599,8 @@ generate_fragment(struct llvmpipe_context *lp, } lp_build_conv_mask(builder, fs_type, blend_type, - fs_mask, num_fs, - &blend_mask, 1); + fs_mask, num_fs, + &blend_mask, 1); /* * Blending. @@ -631,16 +631,15 @@ generate_fragment(struct llvmpipe_context *lp, LLVMRunFunctionPassManager(screen->pass, variant->function); -#ifdef DEBUG - LLVMDumpValue(variant->function); - debug_printf("\n"); -#endif + if (LP_DEBUG & DEBUG_JIT) { + LLVMDumpValue(variant->function); + debug_printf("\n"); + } variant->jit_function = (lp_jit_frag_func)LLVMGetPointerToGlobal(screen->engine, variant->function); -#ifdef DEBUG - lp_disassemble(variant->jit_function); -#endif + if (LP_DEBUG & DEBUG_ASM) + lp_disassemble(variant->jit_function); variant->next = shader->variants; shader->variants = variant; -- cgit v1.2.3 From 09cef45393c14d2b02529cb3cbea194bdfc06bf3 Mon Sep 17 00:00:00 2001 From: Richard Li Date: Wed, 16 Dec 2009 11:35:08 -0500 Subject: r600 : clean a bit to prepare to enable gl2. --- src/mesa/drivers/dri/r600/r600_context.c | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_context.c b/src/mesa/drivers/dri/r600/r600_context.c index 25314eff563..b66fe78ac3b 100644 --- a/src/mesa/drivers/dri/r600/r600_context.c +++ b/src/mesa/drivers/dri/r600/r600_context.c @@ -317,20 +317,8 @@ static void r600InitGLExtensions(GLcontext *ctx) #ifdef R600_ENABLE_GLSL_TEST driInitExtensions(ctx, gl_20_extension, GL_TRUE); - //_mesa_enable_2_0_extensions(ctx); - //1.5 - ctx->Extensions.ARB_occlusion_query = GL_TRUE; - ctx->Extensions.ARB_vertex_buffer_object = GL_TRUE; - ctx->Extensions.EXT_shadow_funcs = GL_TRUE; - //2.0 - ctx->Extensions.ARB_draw_buffers = GL_TRUE; - ctx->Extensions.ARB_point_sprite = GL_TRUE; - ctx->Extensions.ARB_shader_objects = GL_TRUE; - ctx->Extensions.ARB_vertex_shader = GL_TRUE; - ctx->Extensions.ARB_fragment_shader = GL_TRUE; - ctx->Extensions.EXT_blend_equation_separate = GL_TRUE; - ctx->Extensions.ATI_separate_stencil = GL_TRUE; - + _mesa_enable_2_0_extensions(ctx); + /* glsl compiler has problem if this is not GL_TRUE */ ctx->Shader.EmitCondCodes = GL_TRUE; #endif /* R600_ENABLE_GLSL_TEST */ -- cgit v1.2.3 From f24c29cc3902c87f7d62052dfa498237162e7157 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 17 Dec 2009 14:23:08 +1000 Subject: r600: move structs for legacy cmdbuf into cmdbuf C file. these really shouldn't be exposed here --- src/mesa/drivers/dri/r600/r600_cmdbuf.c | 15 +++++++++++++++ src/mesa/drivers/dri/r600/r600_cmdbuf.h | 16 ---------------- 2 files changed, 15 insertions(+), 16 deletions(-) diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.c b/src/mesa/drivers/dri/r600/r600_cmdbuf.c index d27a3245a39..5e1504872d6 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.c +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.c @@ -52,6 +52,21 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_mipmap_tree.h" #include "radeon_reg.h" +struct r600_cs_manager_legacy +{ + struct radeon_cs_manager base; + struct radeon_context *ctx; + /* hack for scratch stuff */ + uint32_t pending_age; + uint32_t pending_count; +}; + +struct r600_cs_reloc_legacy { + struct radeon_cs_reloc base; + uint32_t cindices; + uint32_t *indices; + uint32_t *reloc_indices; +}; static struct radeon_cs * r600_cs_create(struct radeon_cs_manager *csm, diff --git a/src/mesa/drivers/dri/r600/r600_cmdbuf.h b/src/mesa/drivers/dri/r600/r600_cmdbuf.h index eba43d37b6b..dff00096999 100644 --- a/src/mesa/drivers/dri/r600/r600_cmdbuf.h +++ b/src/mesa/drivers/dri/r600/r600_cmdbuf.h @@ -118,22 +118,6 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #define R600_IT_SET_CTL_CONST 0x00006F00 #define R600_IT_SURFACE_BASE_UPDATE 0x00007300 -struct r600_cs_manager_legacy -{ - struct radeon_cs_manager base; - struct radeon_context *ctx; - /* hack for scratch stuff */ - uint32_t pending_age; - uint32_t pending_count; -}; - -struct r600_cs_reloc_legacy { - struct radeon_cs_reloc base; - uint32_t cindices; - uint32_t *indices; - uint32_t *reloc_indices; -}; - struct radeon_cs_manager * r600_radeon_cs_manager_legacy_ctor(struct radeon_context *ctx); /** -- cgit v1.2.3 From 5484f9dfc6dbc534a5a2477aa46ebd28da1f72e8 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 17 Dec 2009 14:18:54 +1000 Subject: radeon: drop unused members of radeon_state. --- src/mesa/drivers/dri/radeon/radeon_common_context.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.h b/src/mesa/drivers/dri/radeon/radeon_common_context.h index 49a9ec56106..0739496e032 100644 --- a/src/mesa/drivers/dri/radeon/radeon_common_context.h +++ b/src/mesa/drivers/dri/radeon/radeon_common_context.h @@ -406,9 +406,6 @@ struct radeon_state { struct radeon_depthbuffer_state depth; struct radeon_scissor_state scissor; struct radeon_stencilbuffer_state stencil; - - struct radeon_cs_space_check bos[RADEON_MAX_BOS]; - int validated_bo_count; }; /** -- cgit v1.2.3 From 1c28073fdfb56a241424c739b57845f47fa05002 Mon Sep 17 00:00:00 2001 From: Dave Airlie Date: Thu, 17 Dec 2009 14:19:27 +1000 Subject: radeon: drop assert accessing cref which is meant to be hidden --- src/mesa/drivers/dri/radeon/radeon_dma.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/mesa/drivers/dri/radeon/radeon_dma.c b/src/mesa/drivers/dri/radeon/radeon_dma.c index b8c65f4ce62..d31e4e47ddb 100644 --- a/src/mesa/drivers/dri/radeon/radeon_dma.c +++ b/src/mesa/drivers/dri/radeon/radeon_dma.c @@ -205,7 +205,6 @@ again_alloc: counter on unused buffers for later freeing them from begin of list */ dma_bo = last_elem(&rmesa->dma.free); - assert(dma_bo->bo->cref == 1); remove_from_list(dma_bo); insert_at_head(&rmesa->dma.reserved, dma_bo); } -- cgit v1.2.3 From 2f127e5236ca3c53bfe25fc4ffcfe16ae55ed42b Mon Sep 17 00:00:00 2001 From: Sedat Dilek Date: Thu, 17 Dec 2009 19:14:53 +0100 Subject: configure.ac: Add glsl to SRC_DIRS Signed-off-by: Brian Paul --- configure.ac | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/configure.ac b/configure.ac index 25e4321510f..6fa0a605e07 100644 --- a/configure.ac +++ b/configure.ac @@ -413,7 +413,7 @@ esac dnl dnl Driver specific build directories dnl -SRC_DIRS="mesa glew" +SRC_DIRS="glsl mesa glew" GLU_DIRS="sgi" WINDOW_SYSTEM="" GALLIUM_DIRS="auxiliary drivers state_trackers" -- cgit v1.2.3 From 294bd53d4b6b15a6890599c46f14b205a3c738bf Mon Sep 17 00:00:00 2001 From: Sedat Dilek Date: Thu, 17 Dec 2009 19:17:23 +0100 Subject: glsl/apps: Add dummy install target to fix 'make install' Signed-off-by: Brian Paul --- src/glsl/apps/Makefile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/glsl/apps/Makefile b/src/glsl/apps/Makefile index c80fcb9d974..39a0df7fea5 100644 --- a/src/glsl/apps/Makefile +++ b/src/glsl/apps/Makefile @@ -36,7 +36,8 @@ INCLUDES = -I. default: $(APPS) +install: + clean: -rm -f $(APPS) -rm -f *.o - -- cgit v1.2.3