~ubuntu-branches/ubuntu/natty/mesa/natty-proposed

« back to all changes in this revision

Viewing changes to src/glsl/pp/sl_pp_error.c

  • Committer: Bazaar Package Importer
  • Author(s): Robert Hooker, Robert Hooker, Christopher James Halse Rogers
  • Date: 2010-09-14 08:55:40 UTC
  • mfrom: (1.2.28 upstream)
  • Revision ID: james.westby@ubuntu.com-20100914085540-m4fpl0hdjlfd4jgz
Tags: 7.9~git20100909-0ubuntu1
[ Robert Hooker ]
* New upstream git snapshot up to commit 94118fe2d4b1e5 (LP: #631413)
* New features include ATI HD5xxx series support in r600, and a vastly
  improved glsl compiler.
* Remove pre-generated .pc's, use the ones generated at build time
  instead.
* Remove all references to mesa-utils now that its no longer shipped
  with the mesa source.
* Disable the experimental ARB_fragment_shader option by default on
  i915, it exposes incomplete functionality that breaks KDE compositing
  among other things. It can be enabled via driconf still. (LP: #628930).

[ Christopher James Halse Rogers ]
* debian/patches/04_osmesa_version.diff:
  - Refresh for new upstream
* Bugs fixed in this release:
  - Fixes severe rendering corruption in Unity on radeon (LP: #628727,
    LP: #596292, LP: #599741, LP: #630315, LP: #613694, LP: #599741).
  - Also fixes rendering in gnome-shell (LP: #578619).
  - Flickering in OpenGL apps on radeon (LP: #626943, LP: #610541).
  - Provides preliminary support for new intel chips (LP: #601052).
* debian/rules:
  - Update configure flags to match upstream reshuffling.
  - Explicitly remove gallium DRI drivers that we don't want to ship.
* Update debian/gbp.conf for this Maverick-specific packaging
* libegl1-mesa-dri-x11,kms: There are no longer separate kms or x11 drivers
  for EGL, libegl1-mesa-drivers now contains a single driver that provides
  both backends.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/**************************************************************************
2
 
 * 
3
 
 * Copyright 2009 VMware, Inc.
4
 
 * All Rights Reserved.
5
 
 * 
6
 
 * Permission is hereby granted, free of charge, to any person obtaining a
7
 
 * copy of this software and associated documentation files (the
8
 
 * "Software"), to deal in the Software without restriction, including
9
 
 * without limitation the rights to use, copy, modify, merge, publish,
10
 
 * distribute, sub license, and/or sell copies of the Software, and to
11
 
 * permit persons to whom the Software is furnished to do so, subject to
12
 
 * the following conditions:
13
 
 * 
14
 
 * The above copyright notice and this permission notice (including the
15
 
 * next paragraph) shall be included in all copies or substantial portions
16
 
 * of the Software.
17
 
 * 
18
 
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19
 
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20
 
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21
 
 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22
 
 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23
 
 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24
 
 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25
 
 * 
26
 
 **************************************************************************/
27
 
 
28
 
#include <stdlib.h>
29
 
#include <string.h>
30
 
#include "sl_pp_context.h"
31
 
#include "sl_pp_process.h"
32
 
#include "sl_pp_public.h"
33
 
 
34
 
 
35
 
void
36
 
sl_pp_process_error(struct sl_pp_context *context,
37
 
                    const struct sl_pp_token_info *input,
38
 
                    unsigned int first,
39
 
                    unsigned int last)
40
 
{
41
 
   unsigned int out_len = 0;
42
 
   unsigned int i;
43
 
 
44
 
   for (i = first; i < last; i++) {
45
 
      const char *s = NULL;
46
 
      char buf[2];
47
 
 
48
 
      switch (input[i].token) {
49
 
      case SL_PP_WHITESPACE:
50
 
         s = " ";
51
 
         break;
52
 
 
53
 
      case SL_PP_NEWLINE:
54
 
         s = "\n";
55
 
         break;
56
 
 
57
 
      case SL_PP_HASH:
58
 
         s = "#";
59
 
         break;
60
 
 
61
 
      case SL_PP_COMMA:
62
 
         s = ",";
63
 
         break;
64
 
 
65
 
      case SL_PP_SEMICOLON:
66
 
         s = ";";
67
 
         break;
68
 
 
69
 
      case SL_PP_LBRACE:
70
 
         s = "{";
71
 
         break;
72
 
 
73
 
      case SL_PP_RBRACE:
74
 
         s = "}";
75
 
         break;
76
 
 
77
 
      case SL_PP_LPAREN:
78
 
         s = "(";
79
 
         break;
80
 
 
81
 
      case SL_PP_RPAREN:
82
 
         s = ")";
83
 
         break;
84
 
 
85
 
      case SL_PP_LBRACKET:
86
 
         s = "[";
87
 
         break;
88
 
 
89
 
      case SL_PP_RBRACKET:
90
 
         s = "]";
91
 
         break;
92
 
 
93
 
      case SL_PP_DOT:
94
 
         s = ".";
95
 
         break;
96
 
 
97
 
      case SL_PP_INCREMENT:
98
 
         s = "++";
99
 
         break;
100
 
 
101
 
      case SL_PP_ADDASSIGN:
102
 
         s = "+=";
103
 
         break;
104
 
 
105
 
      case SL_PP_PLUS:
106
 
         s = "+";
107
 
         break;
108
 
 
109
 
      case SL_PP_DECREMENT:
110
 
         s = "--";
111
 
         break;
112
 
 
113
 
      case SL_PP_SUBASSIGN:
114
 
         s = "-=";
115
 
         break;
116
 
 
117
 
      case SL_PP_MINUS:
118
 
         s = "-";
119
 
         break;
120
 
 
121
 
      case SL_PP_BITNOT:
122
 
         s = "~";
123
 
         break;
124
 
 
125
 
      case SL_PP_NOTEQUAL:
126
 
         s = "!=";
127
 
         break;
128
 
 
129
 
      case SL_PP_NOT:
130
 
         s = "!";
131
 
         break;
132
 
 
133
 
      case SL_PP_MULASSIGN:
134
 
         s = "*=";
135
 
         break;
136
 
 
137
 
      case SL_PP_STAR:
138
 
         s = "*";
139
 
         break;
140
 
 
141
 
      case SL_PP_DIVASSIGN:
142
 
         s = "/=";
143
 
         break;
144
 
 
145
 
      case SL_PP_SLASH:
146
 
         s = "/";
147
 
         break;
148
 
 
149
 
      case SL_PP_MODASSIGN:
150
 
         s = "%=";
151
 
         break;
152
 
 
153
 
      case SL_PP_MODULO:
154
 
         s = "%";
155
 
         break;
156
 
 
157
 
      case SL_PP_LSHIFTASSIGN:
158
 
         s = "<<=";
159
 
         break;
160
 
 
161
 
      case SL_PP_LSHIFT:
162
 
         s = "<<";
163
 
         break;
164
 
 
165
 
      case SL_PP_LESSEQUAL:
166
 
         s = "<=";
167
 
         break;
168
 
 
169
 
      case SL_PP_LESS:
170
 
         s = "<";
171
 
         break;
172
 
 
173
 
      case SL_PP_RSHIFTASSIGN:
174
 
         s = ">>=";
175
 
         break;
176
 
 
177
 
      case SL_PP_RSHIFT:
178
 
         s = ">>";
179
 
         break;
180
 
 
181
 
      case SL_PP_GREATEREQUAL:
182
 
         s = ">=";
183
 
         break;
184
 
 
185
 
      case SL_PP_GREATER:
186
 
         s = ">";
187
 
         break;
188
 
 
189
 
      case SL_PP_EQUAL:
190
 
         s = "==";
191
 
         break;
192
 
 
193
 
      case SL_PP_ASSIGN:
194
 
         s = "=";
195
 
         break;
196
 
 
197
 
      case SL_PP_AND:
198
 
         s = "&&";
199
 
         break;
200
 
 
201
 
      case SL_PP_BITANDASSIGN:
202
 
         s = "&=";
203
 
         break;
204
 
 
205
 
      case SL_PP_BITAND:
206
 
         s = "&";
207
 
         break;
208
 
 
209
 
      case SL_PP_XOR:
210
 
         s = "^^";
211
 
         break;
212
 
 
213
 
      case SL_PP_BITXORASSIGN:
214
 
         s = "^=";
215
 
         break;
216
 
 
217
 
      case SL_PP_BITXOR:
218
 
         s = "^";
219
 
         break;
220
 
 
221
 
      case SL_PP_OR:
222
 
         s = "||";
223
 
         break;
224
 
 
225
 
      case SL_PP_BITORASSIGN:
226
 
         s = "|=";
227
 
         break;
228
 
 
229
 
      case SL_PP_BITOR:
230
 
         s = "|";
231
 
         break;
232
 
 
233
 
      case SL_PP_QUESTION:
234
 
         s = "?";
235
 
         break;
236
 
 
237
 
      case SL_PP_COLON:
238
 
         s = ":";
239
 
         break;
240
 
 
241
 
      case SL_PP_IDENTIFIER:
242
 
         s = sl_pp_context_cstr(context, input[i].data.identifier);
243
 
         break;
244
 
 
245
 
      case SL_PP_UINT:
246
 
         s = sl_pp_context_cstr(context, input[i].data._uint);
247
 
         break;
248
 
 
249
 
      case SL_PP_FLOAT:
250
 
         s = sl_pp_context_cstr(context, input[i].data._float);
251
 
         break;
252
 
 
253
 
      case SL_PP_OTHER:
254
 
         buf[0] = input[i].data.other;
255
 
         buf[1] = '\0';
256
 
         s = buf;
257
 
         break;
258
 
 
259
 
      default:
260
 
         strcpy(context->error_msg, "internal error");
261
 
         return;
262
 
      }
263
 
 
264
 
      while (*s != '\0' && out_len < sizeof(context->error_msg) - 1) {
265
 
         context->error_msg[out_len++] = *s++;
266
 
      }
267
 
   }
268
 
 
269
 
   context->error_msg[out_len] = '\0';
270
 
}