Line | Source Code | Coverage |
---|
1 | | - |
2 | | - |
3 | class QGLShaderPrivate : public QObjectPrivate | - |
4 | { | - |
5 | inline QGLShader* q_func() { return static_cast<QGLShader *>(q_ptr); } inline const QGLShader* q_func() const { return static_cast<const QGLShader *>(q_ptr); } friend class QGLShader; | - |
6 | public: | - |
7 | QGLShaderPrivate(const QGLContext *, QGLShader::ShaderType type) | - |
8 | : shaderGuard(0) | - |
9 | , shaderType(type) | - |
10 | , compiled(false) | - |
11 | { | - |
12 | } | 0 |
13 | ~QGLShaderPrivate(); | - |
14 | | - |
15 | QGLSharedResourceGuardBase *shaderGuard; | - |
16 | QGLShader::ShaderType shaderType; | - |
17 | bool compiled; | - |
18 | QString log; | - |
19 | | - |
20 | bool create(); | - |
21 | bool compile(QGLShader *q); | - |
22 | void deleteShader(); | - |
23 | }; | - |
24 | | - |
25 | namespace { | - |
26 | void freeShaderFunc(QGLContext *ctx, GLuint id) | - |
27 | { | - |
28 | (void)ctx;; | - |
29 | QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteShader(id); | - |
30 | } | 0 |
31 | } | - |
32 | | - |
33 | | - |
34 | | - |
35 | QGLShaderPrivate::~QGLShaderPrivate() | - |
36 | { | - |
37 | if (shaderGuard) never evaluated: shaderGuard | 0 |
38 | shaderGuard->free(); never executed: shaderGuard->free(); | 0 |
39 | } | 0 |
40 | | - |
41 | bool QGLShaderPrivate::create() | - |
42 | { | - |
43 | QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext()); | - |
44 | if (!context) never evaluated: !context | 0 |
45 | return false; never executed: return false; | 0 |
46 | if (qt_resolve_glsl_extensions(context)) { never evaluated: qt_resolve_glsl_extensions(context) | 0 |
47 | GLuint shader; | - |
48 | if (shaderType == QGLShader::Vertex) never evaluated: shaderType == QGLShader::Vertex | 0 |
49 | shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8B31); never executed: shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8B31); | 0 |
50 | | - |
51 | else if (shaderType == QGLShader::Geometry) never evaluated: shaderType == QGLShader::Geometry | 0 |
52 | shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8DD9); never executed: shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8DD9); | 0 |
53 | | - |
54 | else | - |
55 | shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8B30); never executed: shader = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateShader(0x8B30); | 0 |
56 | if (!shader) { | 0 |
57 | QMessageLogger("qglshaderprogram.cpp", 250, __PRETTY_FUNCTION__).warning("%s: Could not create shader of type %d.", | - |
58 | __PRETTY_FUNCTION__, int(shaderType)); | - |
59 | return false; never executed: return false; | 0 |
60 | } | - |
61 | shaderGuard = createSharedResourceGuard(context, shader, freeShaderFunc); | - |
62 | return true; never executed: return true; | 0 |
63 | } else { | - |
64 | return false; never executed: return false; | 0 |
65 | } | - |
66 | } | - |
67 | | - |
68 | bool QGLShaderPrivate::compile(QGLShader *q) | - |
69 | { | - |
70 | GLuint shader = shaderGuard ? shaderGuard->id() : 0; never evaluated: shaderGuard | 0 |
71 | if (!shader) | 0 |
72 | return false; never executed: return false; | 0 |
73 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCompileShader(shader); | - |
74 | GLint value = 0; | - |
75 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetShaderiv(shader, 0x8B81, &value); | - |
76 | compiled = (value != 0); | - |
77 | value = 0; | - |
78 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetShaderiv(shader, 0x8B84, &value); | - |
79 | if (!compiled && value > 1) { never evaluated: !compiled never evaluated: value > 1 | 0 |
80 | char *logbuf = new char [value]; | - |
81 | GLint len; | - |
82 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetShaderInfoLog(shader, value, &len, logbuf); | - |
83 | log = QString::fromLatin1(logbuf); | - |
84 | QString name = q->objectName(); | - |
85 | | - |
86 | const char *types[] = { | - |
87 | "Fragment", | - |
88 | "Vertex", | - |
89 | "Geometry", | - |
90 | "" | - |
91 | }; | - |
92 | | - |
93 | const char *type = types[3]; | - |
94 | if (shaderType == QGLShader::Fragment) never evaluated: shaderType == QGLShader::Fragment | 0 |
95 | type = types[0]; never executed: type = types[0]; | 0 |
96 | else if (shaderType == QGLShader::Vertex) never evaluated: shaderType == QGLShader::Vertex | 0 |
97 | type = types[1]; never executed: type = types[1]; | 0 |
98 | else if (shaderType == QGLShader::Geometry) never evaluated: shaderType == QGLShader::Geometry | 0 |
99 | type = types[2]; never executed: type = types[2]; | 0 |
100 | | - |
101 | if (name.isEmpty()) never evaluated: name.isEmpty() | 0 |
102 | QMessageLogger("qglshaderprogram.cpp", 295, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s): %s", type, QString(log).toLocal8Bit().constData()); never executed: QMessageLogger("qglshaderprogram.cpp", 295, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s): %s", type, QString(log).toLocal8Bit().constData()); | 0 |
103 | else | - |
104 | QMessageLogger("qglshaderprogram.cpp", 297, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s)[%s]: %s", type, QString(name).toLocal8Bit().constData(), QString(log).toLocal8Bit().constData()); never executed: QMessageLogger("qglshaderprogram.cpp", 297, __PRETTY_FUNCTION__).warning("QGLShader::compile(%s)[%s]: %s", type, QString(name).toLocal8Bit().constData(), QString(log).toLocal8Bit().constData()); | 0 |
105 | | - |
106 | delete [] logbuf; | - |
107 | } | 0 |
108 | return compiled; never executed: return compiled; | 0 |
109 | } | - |
110 | | - |
111 | void QGLShaderPrivate::deleteShader() | - |
112 | { | - |
113 | if (shaderGuard) { never evaluated: shaderGuard | 0 |
114 | shaderGuard->free(); | - |
115 | shaderGuard = 0; | - |
116 | } | 0 |
117 | } | 0 |
118 | QGLShader::QGLShader(QGLShader::ShaderType type, QObject *parent) | - |
119 | : QObject(*new QGLShaderPrivate(QGLContext::currentContext(), type), parent) | - |
120 | { | - |
121 | QGLShaderPrivate * const d = d_func(); | - |
122 | d->create(); | - |
123 | } | 0 |
124 | QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent) | - |
125 | : QObject(*new QGLShaderPrivate(context ? context : QGLContext::currentContext(), type), parent) | - |
126 | { | - |
127 | QGLShaderPrivate * const d = d_func(); | - |
128 | | - |
129 | | - |
130 | | - |
131 | | - |
132 | | - |
133 | | - |
134 | d->create(); | - |
135 | } | 0 |
136 | | - |
137 | | - |
138 | | - |
139 | | - |
140 | | - |
141 | | - |
142 | QGLShader::~QGLShader() | - |
143 | { | - |
144 | } | - |
145 | | - |
146 | | - |
147 | | - |
148 | | - |
149 | QGLShader::ShaderType QGLShader::shaderType() const | - |
150 | { | - |
151 | const QGLShaderPrivate * const d = d_func(); | - |
152 | return d->shaderType; never executed: return d->shaderType; | 0 |
153 | } | - |
154 | | - |
155 | | - |
156 | | - |
157 | | - |
158 | | - |
159 | | - |
160 | static const char qualifierDefines[] = | - |
161 | "#define lowp\n" | - |
162 | "#define mediump\n" | - |
163 | "#define highp\n"; | - |
164 | bool QGLShader::compileSourceCode(const char *source) | - |
165 | { | - |
166 | QGLShaderPrivate * const d = d_func(); | - |
167 | if (d->shaderGuard && d->shaderGuard->id()) { never evaluated: d->shaderGuard never evaluated: d->shaderGuard->id() | 0 |
168 | QVarLengthArray<const char *, 4> src; | - |
169 | QVarLengthArray<GLint, 4> srclen; | - |
170 | int headerLen = 0; | - |
171 | while (source && source[headerLen] == '#') { never evaluated: source[headerLen] == '#' | 0 |
172 | | - |
173 | | - |
174 | | - |
175 | if (qstrncmp(source + headerLen, "#version", 8) != 0 && never evaluated: qstrncmp(source + headerLen, "#version", 8) != 0 | 0 |
176 | qstrncmp(source + headerLen, "#extension", 10) != 0) { never evaluated: qstrncmp(source + headerLen, "#extension", 10) != 0 | 0 |
177 | break; | 0 |
178 | } | - |
179 | while (source[headerLen] != '\0' && source[headerLen] != '\n') never evaluated: source[headerLen] != '\0' never evaluated: source[headerLen] != '\n' | 0 |
180 | ++headerLen; never executed: ++headerLen; | 0 |
181 | if (source[headerLen] == '\n') never evaluated: source[headerLen] == '\n' | 0 |
182 | ++headerLen; never executed: ++headerLen; | 0 |
183 | } | 0 |
184 | if (headerLen > 0) { never evaluated: headerLen > 0 | 0 |
185 | src.append(source); | - |
186 | srclen.append(GLint(headerLen)); | - |
187 | } | 0 |
188 | | - |
189 | src.append(qualifierDefines); | - |
190 | srclen.append(GLint(sizeof(qualifierDefines) - 1)); | - |
191 | | - |
192 | | - |
193 | | - |
194 | | - |
195 | | - |
196 | | - |
197 | | - |
198 | src.append(source + headerLen); | - |
199 | srclen.append(GLint(qstrlen(source + headerLen))); | - |
200 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glShaderSource(d->shaderGuard->id(), src.size(), src.data(), srclen.data()); | - |
201 | return d->compile(this); never executed: return d->compile(this); | 0 |
202 | } else { | - |
203 | return false; never executed: return false; | 0 |
204 | } | - |
205 | } | - |
206 | bool QGLShader::compileSourceCode(const QByteArray& source) | - |
207 | { | - |
208 | return compileSourceCode(source.constData()); never executed: return compileSourceCode(source.constData()); | 0 |
209 | } | - |
210 | bool QGLShader::compileSourceCode(const QString& source) | - |
211 | { | - |
212 | return compileSourceCode(source.toLatin1().constData()); never executed: return compileSourceCode(source.toLatin1().constData()); | 0 |
213 | } | - |
214 | bool QGLShader::compileSourceFile(const QString& fileName) | - |
215 | { | - |
216 | QFile file(fileName); | - |
217 | if (!file.open(QFile::ReadOnly)) { never evaluated: !file.open(QFile::ReadOnly) | 0 |
218 | QMessageLogger("qglshaderprogram.cpp", 481, __PRETTY_FUNCTION__).warning() << "QGLShader: Unable to open file" << fileName; | - |
219 | return false; never executed: return false; | 0 |
220 | } | - |
221 | | - |
222 | QByteArray contents = file.readAll(); | - |
223 | return compileSourceCode(contents.constData()); never executed: return compileSourceCode(contents.constData()); | 0 |
224 | } | - |
225 | | - |
226 | | - |
227 | | - |
228 | | - |
229 | | - |
230 | | - |
231 | QByteArray QGLShader::sourceCode() const | - |
232 | { | - |
233 | const QGLShaderPrivate * const d = d_func(); | - |
234 | GLuint shader = d->shaderGuard ? d->shaderGuard->id() : 0; never evaluated: d->shaderGuard | 0 |
235 | if (!shader) | 0 |
236 | return QByteArray(); never executed: return QByteArray(); | 0 |
237 | GLint size = 0; | - |
238 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetShaderiv(shader, 0x8B88, &size); | - |
239 | if (size <= 0) never evaluated: size <= 0 | 0 |
240 | return QByteArray(); never executed: return QByteArray(); | 0 |
241 | GLint len = 0; | - |
242 | char *source = new char [size]; | - |
243 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetShaderSource(shader, size, &len, source); | - |
244 | QByteArray src(source); | - |
245 | delete [] source; | - |
246 | return src; never executed: return src; | 0 |
247 | } | - |
248 | | - |
249 | | - |
250 | | - |
251 | | - |
252 | | - |
253 | | - |
254 | bool QGLShader::isCompiled() const | - |
255 | { | - |
256 | const QGLShaderPrivate * const d = d_func(); | - |
257 | return d->compiled; never executed: return d->compiled; | 0 |
258 | } | - |
259 | | - |
260 | | - |
261 | | - |
262 | | - |
263 | | - |
264 | | - |
265 | QString QGLShader::log() const | - |
266 | { | - |
267 | const QGLShaderPrivate * const d = d_func(); | - |
268 | return d->log; never executed: return d->log; | 0 |
269 | } | - |
270 | | - |
271 | | - |
272 | | - |
273 | | - |
274 | | - |
275 | | - |
276 | GLuint QGLShader::shaderId() const | - |
277 | { | - |
278 | const QGLShaderPrivate * const d = d_func(); | - |
279 | return d->shaderGuard ? d->shaderGuard->id() : 0; never executed: return d->shaderGuard ? d->shaderGuard->id() : 0; | 0 |
280 | } | - |
281 | | - |
282 | | - |
283 | | - |
284 | class QGLShaderProgramPrivate : public QObjectPrivate | - |
285 | { | - |
286 | inline QGLShaderProgram* q_func() { return static_cast<QGLShaderProgram *>(q_ptr); } inline const QGLShaderProgram* q_func() const { return static_cast<const QGLShaderProgram *>(q_ptr); } friend class QGLShaderProgram; | - |
287 | public: | - |
288 | QGLShaderProgramPrivate(const QGLContext *) | - |
289 | : programGuard(0) | - |
290 | , linked(false) | - |
291 | , inited(false) | - |
292 | , removingShaders(false) | - |
293 | , geometryVertexCount(64) | - |
294 | , geometryInputType(0) | - |
295 | , geometryOutputType(0) | - |
296 | { | - |
297 | } | 0 |
298 | ~QGLShaderProgramPrivate(); | - |
299 | | - |
300 | QGLSharedResourceGuardBase *programGuard; | - |
301 | bool linked; | - |
302 | bool inited; | - |
303 | bool removingShaders; | - |
304 | | - |
305 | int geometryVertexCount; | - |
306 | GLenum geometryInputType; | - |
307 | GLenum geometryOutputType; | - |
308 | | - |
309 | QString log; | - |
310 | QList<QGLShader *> shaders; | - |
311 | QList<QGLShader *> anonShaders; | - |
312 | | - |
313 | bool hasShader(QGLShader::ShaderType type) const; | - |
314 | }; | - |
315 | | - |
316 | namespace { | - |
317 | void freeProgramFunc(QGLContext *ctx, GLuint id) | - |
318 | { | - |
319 | (void)ctx;; | - |
320 | QGLContextPrivate::extensionFuncs(ctx).qt_glDeleteProgram(id); | - |
321 | } | 0 |
322 | } | - |
323 | | - |
324 | | - |
325 | QGLShaderProgramPrivate::~QGLShaderProgramPrivate() | - |
326 | { | - |
327 | if (programGuard) never evaluated: programGuard | 0 |
328 | programGuard->free(); never executed: programGuard->free(); | 0 |
329 | } | 0 |
330 | | - |
331 | bool QGLShaderProgramPrivate::hasShader(QGLShader::ShaderType type) const | - |
332 | { | - |
333 | for (QForeachContainer<__typeof__(shaders)> _container_(shaders); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGLShader *shader = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
334 | if (shader->shaderType() == type) never evaluated: shader->shaderType() == type | 0 |
335 | return true; never executed: return true; | 0 |
336 | } | 0 |
337 | return false; never executed: return false; | 0 |
338 | } | - |
339 | QGLShaderProgram::QGLShaderProgram(QObject *parent) | - |
340 | : QObject(*new QGLShaderProgramPrivate(QGLContext::currentContext()), parent) | - |
341 | { | - |
342 | } | 0 |
343 | QGLShaderProgram::QGLShaderProgram(const QGLContext *context, QObject *parent) | - |
344 | : QObject(*new QGLShaderProgramPrivate(context), parent) | - |
345 | { | - |
346 | } | 0 |
347 | | - |
348 | | - |
349 | | - |
350 | | - |
351 | QGLShaderProgram::~QGLShaderProgram() | - |
352 | { | - |
353 | } | - |
354 | | - |
355 | bool QGLShaderProgram::init() | - |
356 | { | - |
357 | QGLShaderProgramPrivate * const d = d_func(); | - |
358 | if ((d->programGuard && d->programGuard->id()) || d->inited) never evaluated: d->programGuard never evaluated: d->programGuard->id() never evaluated: d->inited | 0 |
359 | return true; never executed: return true; | 0 |
360 | d->inited = true; | - |
361 | QGLContext *context = const_cast<QGLContext *>(QGLContext::currentContext()); | - |
362 | if (!context) never evaluated: !context | 0 |
363 | return false; never executed: return false; | 0 |
364 | if (qt_resolve_glsl_extensions(context)) { never evaluated: qt_resolve_glsl_extensions(context) | 0 |
365 | GLuint program = QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glCreateProgram(); | - |
366 | if (!program) { never evaluated: !program | 0 |
367 | QMessageLogger("qglshaderprogram.cpp", 650, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram: could not create shader program"; | - |
368 | return false; never executed: return false; | 0 |
369 | } | - |
370 | if (d->programGuard) never evaluated: d->programGuard | 0 |
371 | delete d->programGuard; never executed: delete d->programGuard; | 0 |
372 | d->programGuard = createSharedResourceGuard(context, program, freeProgramFunc); | - |
373 | return true; never executed: return true; | 0 |
374 | } else { | - |
375 | QMessageLogger("qglshaderprogram.cpp", 658, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram: shader programs are not supported"; | - |
376 | return false; never executed: return false; | 0 |
377 | } | - |
378 | } | - |
379 | bool QGLShaderProgram::addShader(QGLShader *shader) | - |
380 | { | - |
381 | QGLShaderProgramPrivate * const d = d_func(); | - |
382 | if (!init()) | 0 |
383 | return false; never executed: return false; | 0 |
384 | if (d->shaders.contains(shader)) never evaluated: d->shaders.contains(shader) | 0 |
385 | return true; never executed: return true; | 0 |
386 | if (d->programGuard && d->programGuard->id() && shader) { never evaluated: d->programGuard never evaluated: d->programGuard->id() | 0 |
387 | if (!shader->d_func()->shaderGuard || !shader->d_func()->shaderGuard->id()) never evaluated: !shader->d_func()->shaderGuard never evaluated: !shader->d_func()->shaderGuard->id() | 0 |
388 | return false; never executed: return false; | 0 |
389 | if (d->programGuard->group() != shader->d_func()->shaderGuard->group()) { never evaluated: d->programGuard->group() != shader->d_func()->shaderGuard->group() | 0 |
390 | QMessageLogger("qglshaderprogram.cpp", 686, __PRETTY_FUNCTION__).warning("QGLShaderProgram::addShader: Program and shader are not associated with same context."); | - |
391 | return false; never executed: return false; | 0 |
392 | } | - |
393 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glAttachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id()); | - |
394 | d->linked = false; | - |
395 | d->shaders.append(shader); | - |
396 | connect(shader, "2""destroyed()", this, "1""shaderDestroyed()"); | - |
397 | return true; never executed: return true; | 0 |
398 | } else { | - |
399 | return false; never executed: return false; | 0 |
400 | } | - |
401 | } | - |
402 | bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const char *source) | - |
403 | { | - |
404 | QGLShaderProgramPrivate * const d = d_func(); | - |
405 | if (!init()) | 0 |
406 | return false; never executed: return false; | 0 |
407 | QGLShader *shader = new QGLShader(type, this); | - |
408 | if (!shader->compileSourceCode(source)) { never evaluated: !shader->compileSourceCode(source) | 0 |
409 | d->log = shader->log(); | - |
410 | delete shader; | - |
411 | return false; never executed: return false; | 0 |
412 | } | - |
413 | d->anonShaders.append(shader); | - |
414 | return addShader(shader); never executed: return addShader(shader); | 0 |
415 | } | - |
416 | bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QByteArray& source) | - |
417 | { | - |
418 | return addShaderFromSourceCode(type, source.constData()); never executed: return addShaderFromSourceCode(type, source.constData()); | 0 |
419 | } | - |
420 | bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QString& source) | - |
421 | { | - |
422 | return addShaderFromSourceCode(type, source.toLatin1().constData()); never executed: return addShaderFromSourceCode(type, source.toLatin1().constData()); | 0 |
423 | } | - |
424 | bool QGLShaderProgram::addShaderFromSourceFile | - |
425 | (QGLShader::ShaderType type, const QString& fileName) | - |
426 | { | - |
427 | QGLShaderProgramPrivate * const d = d_func(); | - |
428 | if (!init()) | 0 |
429 | return false; never executed: return false; | 0 |
430 | QGLShader *shader = new QGLShader(type, this); | - |
431 | if (!shader->compileSourceFile(fileName)) { never evaluated: !shader->compileSourceFile(fileName) | 0 |
432 | d->log = shader->log(); | - |
433 | delete shader; | - |
434 | return false; never executed: return false; | 0 |
435 | } | - |
436 | d->anonShaders.append(shader); | - |
437 | return addShader(shader); never executed: return addShader(shader); | 0 |
438 | } | - |
439 | void QGLShaderProgram::removeShader(QGLShader *shader) | - |
440 | { | - |
441 | QGLShaderProgramPrivate * const d = d_func(); | - |
442 | if (d->programGuard && d->programGuard->id() never evaluated: d->programGuard never evaluated: d->programGuard->id() | 0 |
443 | && shader && shader->d_func()->shaderGuard) never evaluated: shader->d_func()->shaderGuard | 0 |
444 | { | - |
445 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glDetachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id()); | - |
446 | } | 0 |
447 | d->linked = false; | - |
448 | if (shader) { | 0 |
449 | d->shaders.removeAll(shader); | - |
450 | d->anonShaders.removeAll(shader); | - |
451 | disconnect(shader, "2""destroyed()", this, "1""shaderDestroyed()"); | - |
452 | } | 0 |
453 | } | 0 |
454 | | - |
455 | | - |
456 | | - |
457 | | - |
458 | | - |
459 | | - |
460 | | - |
461 | QList<QGLShader *> QGLShaderProgram::shaders() const | - |
462 | { | - |
463 | const QGLShaderProgramPrivate * const d = d_func(); | - |
464 | return d->shaders; never executed: return d->shaders; | 0 |
465 | } | - |
466 | void QGLShaderProgram::removeAllShaders() | - |
467 | { | - |
468 | QGLShaderProgramPrivate * const d = d_func(); | - |
469 | d->removingShaders = true; | - |
470 | for (QForeachContainer<__typeof__(d->shaders)> _container_(d->shaders); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGLShader *shader = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
471 | if (d->programGuard && d->programGuard->id() never evaluated: d->programGuard never evaluated: d->programGuard->id() | 0 |
472 | && shader && shader->d_func()->shaderGuard) never evaluated: shader->d_func()->shaderGuard | 0 |
473 | { | - |
474 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glDetachShader(d->programGuard->id(), shader->d_func()->shaderGuard->id()); | - |
475 | } | 0 |
476 | } | 0 |
477 | for (QForeachContainer<__typeof__(d->anonShaders)> _container_(d->anonShaders); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGLShader *shader = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
478 | | - |
479 | delete shader; | - |
480 | } | 0 |
481 | d->shaders.clear(); | - |
482 | d->anonShaders.clear(); | - |
483 | d->linked = false; | - |
484 | d->removingShaders = false; | - |
485 | } | 0 |
486 | bool QGLShaderProgram::link() | - |
487 | { | - |
488 | QGLShaderProgramPrivate * const d = d_func(); | - |
489 | GLuint program = d->programGuard ? d->programGuard->id() : 0; never evaluated: d->programGuard | 0 |
490 | if (!program) never evaluated: !program | 0 |
491 | return false; never executed: return false; | 0 |
492 | | - |
493 | GLint value; | - |
494 | if (d->shaders.isEmpty()) { never evaluated: d->shaders.isEmpty() | 0 |
495 | | - |
496 | | - |
497 | | - |
498 | | - |
499 | value = 0; | - |
500 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetProgramiv(program, 0x8B82, &value); | - |
501 | d->linked = (value != 0); | - |
502 | if (d->linked) never evaluated: d->linked | 0 |
503 | return true; never executed: return true; | 0 |
504 | } | 0 |
505 | | - |
506 | | - |
507 | | - |
508 | if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glProgramParameteriEXT) { never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glProgramParameteriEXT | 0 |
509 | for (QForeachContainer<__typeof__(d->shaders)> _container_(d->shaders); !_container_.brk && _container_.i != _container_.e; __extension__ ({ ++_container_.brk; ++_container_.i; })) for (QGLShader *shader = *_container_.i;; __extension__ ({--_container_.brk; break;})) { | - |
510 | if (shader->shaderType() & QGLShader::Geometry) { never evaluated: shader->shaderType() & QGLShader::Geometry | 0 |
511 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glProgramParameteriEXT(program, 0x8DDB, | - |
512 | d->geometryInputType); | - |
513 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glProgramParameteriEXT(program, 0x8DDC, | - |
514 | d->geometryOutputType); | - |
515 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glProgramParameteriEXT(program, 0x8DDA, | - |
516 | d->geometryVertexCount); | - |
517 | break; | 0 |
518 | } | - |
519 | } | 0 |
520 | } | 0 |
521 | | - |
522 | | - |
523 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glLinkProgram(program); | - |
524 | value = 0; | - |
525 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetProgramiv(program, 0x8B82, &value); | - |
526 | d->linked = (value != 0); | - |
527 | value = 0; | - |
528 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetProgramiv(program, 0x8B84, &value); | - |
529 | d->log = QString(); | - |
530 | if (value > 1) { never evaluated: value > 1 | 0 |
531 | char *logbuf = new char [value]; | - |
532 | GLint len; | - |
533 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetProgramInfoLog(program, value, &len, logbuf); | - |
534 | d->log = QString::fromLatin1(logbuf); | - |
535 | QString name = objectName(); | - |
536 | if (name.isEmpty()) never evaluated: name.isEmpty() | 0 |
537 | QMessageLogger("qglshaderprogram.cpp", 924, __PRETTY_FUNCTION__).warning() << "QGLShader::link:" << d->log; never executed: QMessageLogger("qglshaderprogram.cpp", 924, __PRETTY_FUNCTION__).warning() << "QGLShader::link:" << d->log; | 0 |
538 | else | - |
539 | QMessageLogger("qglshaderprogram.cpp", 926, __PRETTY_FUNCTION__).warning() << "QGLShader::link[" << name << "]:" << d->log; never executed: QMessageLogger("qglshaderprogram.cpp", 926, __PRETTY_FUNCTION__).warning() << "QGLShader::link[" << name << "]:" << d->log; | 0 |
540 | delete [] logbuf; | - |
541 | } | 0 |
542 | return d->linked; never executed: return d->linked; | 0 |
543 | } | - |
544 | | - |
545 | | - |
546 | | - |
547 | | - |
548 | | - |
549 | | - |
550 | bool QGLShaderProgram::isLinked() const | - |
551 | { | - |
552 | const QGLShaderProgramPrivate * const d = d_func(); | - |
553 | return d->linked; never executed: return d->linked; | 0 |
554 | } | - |
555 | | - |
556 | | - |
557 | | - |
558 | | - |
559 | | - |
560 | | - |
561 | | - |
562 | QString QGLShaderProgram::log() const | - |
563 | { | - |
564 | const QGLShaderProgramPrivate * const d = d_func(); | - |
565 | return d->log; never executed: return d->log; | 0 |
566 | } | - |
567 | bool QGLShaderProgram::bind() | - |
568 | { | - |
569 | QGLShaderProgramPrivate * const d = d_func(); | - |
570 | GLuint program = d->programGuard ? d->programGuard->id() : 0; never evaluated: d->programGuard | 0 |
571 | if (!program) never evaluated: !program | 0 |
572 | return false; never executed: return false; | 0 |
573 | if (!d->linked && !link()) never evaluated: !d->linked | 0 |
574 | return false; never executed: return false; | 0 |
575 | | - |
576 | | - |
577 | | - |
578 | | - |
579 | | - |
580 | | - |
581 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUseProgram(program); | - |
582 | return true; never executed: return true; | 0 |
583 | } | - |
584 | void QGLShaderProgram::release() | - |
585 | { | - |
586 | if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUseProgram) never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUseProgram | 0 |
587 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUseProgram(0); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUseProgram(0); | 0 |
588 | | - |
589 | } | 0 |
590 | | - |
591 | | - |
592 | | - |
593 | | - |
594 | | - |
595 | | - |
596 | GLuint QGLShaderProgram::programId() const | - |
597 | { | - |
598 | const QGLShaderProgramPrivate * const d = d_func(); | - |
599 | GLuint id = d->programGuard ? d->programGuard->id() : 0; never evaluated: d->programGuard | 0 |
600 | if (id) | 0 |
601 | return id; never executed: return id; | 0 |
602 | | - |
603 | | - |
604 | | - |
605 | | - |
606 | if (!const_cast<QGLShaderProgram *>(this)->init()) never evaluated: !const_cast<QGLShaderProgram *>(this)->init() | 0 |
607 | return 0; never executed: return 0; | 0 |
608 | return d->programGuard ? d->programGuard->id() : 0; never executed: return d->programGuard ? d->programGuard->id() : 0; | 0 |
609 | } | - |
610 | void QGLShaderProgram::bindAttributeLocation(const char *name, int location) | - |
611 | { | - |
612 | QGLShaderProgramPrivate * const d = d_func(); | - |
613 | if (!init() || !d->programGuard || !d->programGuard->id()) never evaluated: !d->programGuard never evaluated: !d->programGuard->id() | 0 |
614 | return; | 0 |
615 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glBindAttribLocation(d->programGuard->id(), location, name); | - |
616 | d->linked = false; | - |
617 | } | 0 |
618 | void QGLShaderProgram::bindAttributeLocation(const QByteArray& name, int location) | - |
619 | { | - |
620 | bindAttributeLocation(name.constData(), location); | - |
621 | } | 0 |
622 | void QGLShaderProgram::bindAttributeLocation(const QString& name, int location) | - |
623 | { | - |
624 | bindAttributeLocation(name.toLatin1().constData(), location); | - |
625 | } | 0 |
626 | int QGLShaderProgram::attributeLocation(const char *name) const | - |
627 | { | - |
628 | const QGLShaderProgramPrivate * const d = d_func(); | - |
629 | if (d->linked && d->programGuard && d->programGuard->id()) { never evaluated: d->linked never evaluated: d->programGuard never evaluated: d->programGuard->id() | 0 |
630 | return QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetAttribLocation(d->programGuard->id(), name); never executed: return QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetAttribLocation(d->programGuard->id(), name); | 0 |
631 | } else { | - |
632 | QMessageLogger("qglshaderprogram.cpp", 1096, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::attributeLocation(" << name | - |
633 | << "): shader program is not linked"; | - |
634 | return -1; never executed: return -1; | 0 |
635 | } | - |
636 | } | - |
637 | int QGLShaderProgram::attributeLocation(const QByteArray& name) const | - |
638 | { | - |
639 | return attributeLocation(name.constData()); never executed: return attributeLocation(name.constData()); | 0 |
640 | } | - |
641 | int QGLShaderProgram::attributeLocation(const QString& name) const | - |
642 | { | - |
643 | return attributeLocation(name.toLatin1().constData()); never executed: return attributeLocation(name.toLatin1().constData()); | 0 |
644 | } | - |
645 | | - |
646 | | - |
647 | | - |
648 | | - |
649 | | - |
650 | | - |
651 | void QGLShaderProgram::setAttributeValue(int location, GLfloat value) | - |
652 | { | - |
653 | QGLShaderProgramPrivate * const d = d_func(); | - |
654 | (void)d;; | - |
655 | if (location != -1) never evaluated: location != -1 | 0 |
656 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib1fv(location, &value); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib1fv(location, &value); | 0 |
657 | } | 0 |
658 | void QGLShaderProgram::setAttributeValue(const char *name, GLfloat value) | - |
659 | { | - |
660 | setAttributeValue(attributeLocation(name), value); | - |
661 | } | 0 |
662 | | - |
663 | | - |
664 | | - |
665 | | - |
666 | | - |
667 | | - |
668 | | - |
669 | void QGLShaderProgram::setAttributeValue(int location, GLfloat x, GLfloat y) | - |
670 | { | - |
671 | QGLShaderProgramPrivate * const d = d_func(); | - |
672 | (void)d;; | - |
673 | if (location != -1) { never evaluated: location != -1 | 0 |
674 | GLfloat values[2] = {x, y}; | - |
675 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib2fv(location, values); | - |
676 | } | 0 |
677 | } | 0 |
678 | void QGLShaderProgram::setAttributeValue(const char *name, GLfloat x, GLfloat y) | - |
679 | { | - |
680 | setAttributeValue(attributeLocation(name), x, y); | - |
681 | } | 0 |
682 | | - |
683 | | - |
684 | | - |
685 | | - |
686 | | - |
687 | | - |
688 | | - |
689 | void QGLShaderProgram::setAttributeValue | - |
690 | (int location, GLfloat x, GLfloat y, GLfloat z) | - |
691 | { | - |
692 | QGLShaderProgramPrivate * const d = d_func(); | - |
693 | (void)d;; | - |
694 | if (location != -1) { never evaluated: location != -1 | 0 |
695 | GLfloat values[3] = {x, y, z}; | - |
696 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib3fv(location, values); | - |
697 | } | 0 |
698 | } | 0 |
699 | void QGLShaderProgram::setAttributeValue | - |
700 | (const char *name, GLfloat x, GLfloat y, GLfloat z) | - |
701 | { | - |
702 | setAttributeValue(attributeLocation(name), x, y, z); | - |
703 | } | 0 |
704 | | - |
705 | | - |
706 | | - |
707 | | - |
708 | | - |
709 | | - |
710 | | - |
711 | void QGLShaderProgram::setAttributeValue | - |
712 | (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) | - |
713 | { | - |
714 | QGLShaderProgramPrivate * const d = d_func(); | - |
715 | (void)d;; | - |
716 | if (location != -1) { never evaluated: location != -1 | 0 |
717 | GLfloat values[4] = {x, y, z, w}; | - |
718 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, values); | - |
719 | } | 0 |
720 | } | 0 |
721 | void QGLShaderProgram::setAttributeValue | - |
722 | (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) | - |
723 | { | - |
724 | setAttributeValue(attributeLocation(name), x, y, z, w); | - |
725 | } | 0 |
726 | | - |
727 | | - |
728 | | - |
729 | | - |
730 | | - |
731 | | - |
732 | void QGLShaderProgram::setAttributeValue(int location, const QVector2D& value) | - |
733 | { | - |
734 | QGLShaderProgramPrivate * const d = d_func(); | - |
735 | (void)d;; | - |
736 | if (location != -1) never evaluated: location != -1 | 0 |
737 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib2fv(location, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib2fv(location, reinterpret_cast<const GLfloat *>(&value)); | 0 |
738 | } | 0 |
739 | void QGLShaderProgram::setAttributeValue(const char *name, const QVector2D& value) | - |
740 | { | - |
741 | setAttributeValue(attributeLocation(name), value); | - |
742 | } | 0 |
743 | | - |
744 | | - |
745 | | - |
746 | | - |
747 | | - |
748 | | - |
749 | void QGLShaderProgram::setAttributeValue(int location, const QVector3D& value) | - |
750 | { | - |
751 | QGLShaderProgramPrivate * const d = d_func(); | - |
752 | (void)d;; | - |
753 | if (location != -1) never evaluated: location != -1 | 0 |
754 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib3fv(location, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib3fv(location, reinterpret_cast<const GLfloat *>(&value)); | 0 |
755 | } | 0 |
756 | void QGLShaderProgram::setAttributeValue(const char *name, const QVector3D& value) | - |
757 | { | - |
758 | setAttributeValue(attributeLocation(name), value); | - |
759 | } | 0 |
760 | | - |
761 | | - |
762 | | - |
763 | | - |
764 | | - |
765 | | - |
766 | void QGLShaderProgram::setAttributeValue(int location, const QVector4D& value) | - |
767 | { | - |
768 | QGLShaderProgramPrivate * const d = d_func(); | - |
769 | (void)d;; | - |
770 | if (location != -1) never evaluated: location != -1 | 0 |
771 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, reinterpret_cast<const GLfloat *>(&value)); | 0 |
772 | } | 0 |
773 | void QGLShaderProgram::setAttributeValue(const char *name, const QVector4D& value) | - |
774 | { | - |
775 | setAttributeValue(attributeLocation(name), value); | - |
776 | } | 0 |
777 | | - |
778 | | - |
779 | | - |
780 | | - |
781 | | - |
782 | | - |
783 | void QGLShaderProgram::setAttributeValue(int location, const QColor& value) | - |
784 | { | - |
785 | QGLShaderProgramPrivate * const d = d_func(); | - |
786 | (void)d;; | - |
787 | if (location != -1) { never evaluated: location != -1 | 0 |
788 | GLfloat values[4] = {GLfloat(value.redF()), GLfloat(value.greenF()), | - |
789 | GLfloat(value.blueF()), GLfloat(value.alphaF())}; | - |
790 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, values); | - |
791 | } | 0 |
792 | } | 0 |
793 | void QGLShaderProgram::setAttributeValue(const char *name, const QColor& value) | - |
794 | { | - |
795 | setAttributeValue(attributeLocation(name), value); | - |
796 | } | 0 |
797 | void QGLShaderProgram::setAttributeValue | - |
798 | (int location, const GLfloat *values, int columns, int rows) | - |
799 | { | - |
800 | QGLShaderProgramPrivate * const d = d_func(); | - |
801 | (void)d;; | - |
802 | if (rows < 1 || rows > 4) { never evaluated: rows < 1 never evaluated: rows > 4 | 0 |
803 | QMessageLogger("qglshaderprogram.cpp", 1364, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setAttributeValue: rows" << rows << "not supported"; | - |
804 | return; | 0 |
805 | } | - |
806 | if (location != -1) { never evaluated: location != -1 | 0 |
807 | while (columns-- > 0) { never evaluated: columns-- > 0 | 0 |
808 | if (rows == 1) never evaluated: rows == 1 | 0 |
809 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib1fv(location, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib1fv(location, values); | 0 |
810 | else if (rows == 2) never evaluated: rows == 2 | 0 |
811 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib2fv(location, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib2fv(location, values); | 0 |
812 | else if (rows == 3) never evaluated: rows == 3 | 0 |
813 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib3fv(location, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib3fv(location, values); | 0 |
814 | else | - |
815 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttrib4fv(location, values); | 0 |
816 | values += rows; | - |
817 | ++location; | - |
818 | } | 0 |
819 | } | 0 |
820 | } | 0 |
821 | void QGLShaderProgram::setAttributeValue | - |
822 | (const char *name, const GLfloat *values, int columns, int rows) | - |
823 | { | - |
824 | setAttributeValue(attributeLocation(name), values, columns, rows); | - |
825 | } | 0 |
826 | void QGLShaderProgram::setAttributeArray | - |
827 | (int location, const GLfloat *values, int tupleSize, int stride) | - |
828 | { | - |
829 | QGLShaderProgramPrivate * const d = d_func(); | - |
830 | (void)d;; | - |
831 | if (location != -1) { never evaluated: location != -1 | 0 |
832 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, tupleSize, 0x1406, 0x0, | - |
833 | stride, values); | - |
834 | } | 0 |
835 | } | 0 |
836 | void QGLShaderProgram::setAttributeArray | - |
837 | (int location, const QVector2D *values, int stride) | - |
838 | { | - |
839 | QGLShaderProgramPrivate * const d = d_func(); | - |
840 | (void)d;; | - |
841 | if (location != -1) { never evaluated: location != -1 | 0 |
842 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, 2, 0x1406, 0x0, | - |
843 | stride, values); | - |
844 | } | 0 |
845 | } | 0 |
846 | void QGLShaderProgram::setAttributeArray | - |
847 | (int location, const QVector3D *values, int stride) | - |
848 | { | - |
849 | QGLShaderProgramPrivate * const d = d_func(); | - |
850 | (void)d;; | - |
851 | if (location != -1) { never evaluated: location != -1 | 0 |
852 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, 3, 0x1406, 0x0, | - |
853 | stride, values); | - |
854 | } | 0 |
855 | } | 0 |
856 | void QGLShaderProgram::setAttributeArray | - |
857 | (int location, const QVector4D *values, int stride) | - |
858 | { | - |
859 | QGLShaderProgramPrivate * const d = d_func(); | - |
860 | (void)d;; | - |
861 | if (location != -1) { never evaluated: location != -1 | 0 |
862 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, 4, 0x1406, 0x0, | - |
863 | stride, values); | - |
864 | } | 0 |
865 | } | 0 |
866 | void QGLShaderProgram::setAttributeArray | - |
867 | (int location, GLenum type, const void *values, int tupleSize, int stride) | - |
868 | { | - |
869 | QGLShaderProgramPrivate * const d = d_func(); | - |
870 | (void)d;; | - |
871 | if (location != -1) { never evaluated: location != -1 | 0 |
872 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, tupleSize, type, 0x1, | - |
873 | stride, values); | - |
874 | } | 0 |
875 | } | 0 |
876 | void QGLShaderProgram::setAttributeArray | - |
877 | (const char *name, const GLfloat *values, int tupleSize, int stride) | - |
878 | { | - |
879 | setAttributeArray(attributeLocation(name), values, tupleSize, stride); | - |
880 | } | 0 |
881 | void QGLShaderProgram::setAttributeArray | - |
882 | (const char *name, const QVector2D *values, int stride) | - |
883 | { | - |
884 | setAttributeArray(attributeLocation(name), values, stride); | - |
885 | } | 0 |
886 | void QGLShaderProgram::setAttributeArray | - |
887 | (const char *name, const QVector3D *values, int stride) | - |
888 | { | - |
889 | setAttributeArray(attributeLocation(name), values, stride); | - |
890 | } | 0 |
891 | void QGLShaderProgram::setAttributeArray | - |
892 | (const char *name, const QVector4D *values, int stride) | - |
893 | { | - |
894 | setAttributeArray(attributeLocation(name), values, stride); | - |
895 | } | 0 |
896 | void QGLShaderProgram::setAttributeArray | - |
897 | (const char *name, GLenum type, const void *values, int tupleSize, int stride) | - |
898 | { | - |
899 | setAttributeArray(attributeLocation(name), type, values, tupleSize, stride); | - |
900 | } | 0 |
901 | void QGLShaderProgram::setAttributeBuffer | - |
902 | (int location, GLenum type, int offset, int tupleSize, int stride) | - |
903 | { | - |
904 | QGLShaderProgramPrivate * const d = d_func(); | - |
905 | (void)d;; | - |
906 | if (location != -1) { never evaluated: location != -1 | 0 |
907 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glVertexAttribPointer(location, tupleSize, type, 0x1, stride, | - |
908 | reinterpret_cast<const void *>(offset)); | - |
909 | } | 0 |
910 | } | 0 |
911 | void QGLShaderProgram::setAttributeBuffer | - |
912 | (const char *name, GLenum type, int offset, int tupleSize, int stride) | - |
913 | { | - |
914 | setAttributeBuffer(attributeLocation(name), type, offset, tupleSize, stride); | - |
915 | } | 0 |
916 | void QGLShaderProgram::enableAttributeArray(int location) | - |
917 | { | - |
918 | QGLShaderProgramPrivate * const d = d_func(); | - |
919 | (void)d;; | - |
920 | if (location != -1) never evaluated: location != -1 | 0 |
921 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glEnableVertexAttribArray(location); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glEnableVertexAttribArray(location); | 0 |
922 | } | 0 |
923 | void QGLShaderProgram::enableAttributeArray(const char *name) | - |
924 | { | - |
925 | enableAttributeArray(attributeLocation(name)); | - |
926 | } | 0 |
927 | void QGLShaderProgram::disableAttributeArray(int location) | - |
928 | { | - |
929 | QGLShaderProgramPrivate * const d = d_func(); | - |
930 | (void)d;; | - |
931 | if (location != -1) never evaluated: location != -1 | 0 |
932 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glDisableVertexAttribArray(location); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glDisableVertexAttribArray(location); | 0 |
933 | } | 0 |
934 | void QGLShaderProgram::disableAttributeArray(const char *name) | - |
935 | { | - |
936 | disableAttributeArray(attributeLocation(name)); | - |
937 | } | 0 |
938 | int QGLShaderProgram::uniformLocation(const char *name) const | - |
939 | { | - |
940 | const QGLShaderProgramPrivate * const d = d_func(); | - |
941 | (void)d;; | - |
942 | if (d->linked && d->programGuard && d->programGuard->id()) { never evaluated: d->linked never evaluated: d->programGuard never evaluated: d->programGuard->id() | 0 |
943 | return QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetUniformLocation(d->programGuard->id(), name); never executed: return QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glGetUniformLocation(d->programGuard->id(), name); | 0 |
944 | } else { | - |
945 | QMessageLogger("qglshaderprogram.cpp", 1774, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::uniformLocation(" << name | - |
946 | << "): shader program is not linked"; | - |
947 | return -1; never executed: return -1; | 0 |
948 | } | - |
949 | } | - |
950 | int QGLShaderProgram::uniformLocation(const QByteArray& name) const | - |
951 | { | - |
952 | return uniformLocation(name.constData()); never executed: return uniformLocation(name.constData()); | 0 |
953 | } | - |
954 | int QGLShaderProgram::uniformLocation(const QString& name) const | - |
955 | { | - |
956 | return uniformLocation(name.toLatin1().constData()); never executed: return uniformLocation(name.toLatin1().constData()); | 0 |
957 | } | - |
958 | | - |
959 | | - |
960 | | - |
961 | | - |
962 | | - |
963 | | - |
964 | void QGLShaderProgram::setUniformValue(int location, GLfloat value) | - |
965 | { | - |
966 | QGLShaderProgramPrivate * const d = d_func(); | - |
967 | (void)d;; | - |
968 | if (location != -1) never evaluated: location != -1 | 0 |
969 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1fv(location, 1, &value); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1fv(location, 1, &value); | 0 |
970 | } | 0 |
971 | void QGLShaderProgram::setUniformValue(const char *name, GLfloat value) | - |
972 | { | - |
973 | setUniformValue(uniformLocation(name), value); | - |
974 | } | 0 |
975 | | - |
976 | | - |
977 | | - |
978 | | - |
979 | | - |
980 | | - |
981 | void QGLShaderProgram::setUniformValue(int location, GLint value) | - |
982 | { | - |
983 | QGLShaderProgramPrivate * const d = d_func(); | - |
984 | (void)d;; | - |
985 | if (location != -1) never evaluated: location != -1 | 0 |
986 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1i(location, value); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1i(location, value); | 0 |
987 | } | 0 |
988 | void QGLShaderProgram::setUniformValue(const char *name, GLint value) | - |
989 | { | - |
990 | setUniformValue(uniformLocation(name), value); | - |
991 | } | 0 |
992 | | - |
993 | | - |
994 | | - |
995 | | - |
996 | | - |
997 | | - |
998 | | - |
999 | void QGLShaderProgram::setUniformValue(int location, GLuint value) | - |
1000 | { | - |
1001 | QGLShaderProgramPrivate * const d = d_func(); | - |
1002 | (void)d;; | - |
1003 | if (location != -1) never evaluated: location != -1 | 0 |
1004 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1i(location, value); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1i(location, value); | 0 |
1005 | } | 0 |
1006 | void QGLShaderProgram::setUniformValue(const char *name, GLuint value) | - |
1007 | { | - |
1008 | setUniformValue(uniformLocation(name), value); | - |
1009 | } | 0 |
1010 | | - |
1011 | | - |
1012 | | - |
1013 | | - |
1014 | | - |
1015 | | - |
1016 | | - |
1017 | void QGLShaderProgram::setUniformValue(int location, GLfloat x, GLfloat y) | - |
1018 | { | - |
1019 | QGLShaderProgramPrivate * const d = d_func(); | - |
1020 | (void)d;; | - |
1021 | if (location != -1) { never evaluated: location != -1 | 0 |
1022 | GLfloat values[2] = {x, y}; | - |
1023 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, values); | - |
1024 | } | 0 |
1025 | } | 0 |
1026 | void QGLShaderProgram::setUniformValue(const char *name, GLfloat x, GLfloat y) | - |
1027 | { | - |
1028 | setUniformValue(uniformLocation(name), x, y); | - |
1029 | } | 0 |
1030 | | - |
1031 | | - |
1032 | | - |
1033 | | - |
1034 | | - |
1035 | | - |
1036 | | - |
1037 | void QGLShaderProgram::setUniformValue | - |
1038 | (int location, GLfloat x, GLfloat y, GLfloat z) | - |
1039 | { | - |
1040 | QGLShaderProgramPrivate * const d = d_func(); | - |
1041 | (void)d;; | - |
1042 | if (location != -1) { never evaluated: location != -1 | 0 |
1043 | GLfloat values[3] = {x, y, z}; | - |
1044 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, 1, values); | - |
1045 | } | 0 |
1046 | } | 0 |
1047 | void QGLShaderProgram::setUniformValue | - |
1048 | (const char *name, GLfloat x, GLfloat y, GLfloat z) | - |
1049 | { | - |
1050 | setUniformValue(uniformLocation(name), x, y, z); | - |
1051 | } | 0 |
1052 | | - |
1053 | | - |
1054 | | - |
1055 | | - |
1056 | | - |
1057 | | - |
1058 | | - |
1059 | void QGLShaderProgram::setUniformValue | - |
1060 | (int location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) | - |
1061 | { | - |
1062 | QGLShaderProgramPrivate * const d = d_func(); | - |
1063 | (void)d;; | - |
1064 | if (location != -1) { never evaluated: location != -1 | 0 |
1065 | GLfloat values[4] = {x, y, z, w}; | - |
1066 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 1, values); | - |
1067 | } | 0 |
1068 | } | 0 |
1069 | void QGLShaderProgram::setUniformValue | - |
1070 | (const char *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w) | - |
1071 | { | - |
1072 | setUniformValue(uniformLocation(name), x, y, z, w); | - |
1073 | } | 0 |
1074 | | - |
1075 | | - |
1076 | | - |
1077 | | - |
1078 | | - |
1079 | | - |
1080 | void QGLShaderProgram::setUniformValue(int location, const QVector2D& value) | - |
1081 | { | - |
1082 | QGLShaderProgramPrivate * const d = d_func(); | - |
1083 | (void)d;; | - |
1084 | if (location != -1) never evaluated: location != -1 | 0 |
1085 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); | 0 |
1086 | } | 0 |
1087 | void QGLShaderProgram::setUniformValue(const char *name, const QVector2D& value) | - |
1088 | { | - |
1089 | setUniformValue(uniformLocation(name), value); | - |
1090 | } | 0 |
1091 | | - |
1092 | | - |
1093 | | - |
1094 | | - |
1095 | | - |
1096 | | - |
1097 | void QGLShaderProgram::setUniformValue(int location, const QVector3D& value) | - |
1098 | { | - |
1099 | QGLShaderProgramPrivate * const d = d_func(); | - |
1100 | (void)d;; | - |
1101 | if (location != -1) never evaluated: location != -1 | 0 |
1102 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); | 0 |
1103 | } | 0 |
1104 | void QGLShaderProgram::setUniformValue(const char *name, const QVector3D& value) | - |
1105 | { | - |
1106 | setUniformValue(uniformLocation(name), value); | - |
1107 | } | 0 |
1108 | | - |
1109 | | - |
1110 | | - |
1111 | | - |
1112 | | - |
1113 | | - |
1114 | void QGLShaderProgram::setUniformValue(int location, const QVector4D& value) | - |
1115 | { | - |
1116 | QGLShaderProgramPrivate * const d = d_func(); | - |
1117 | (void)d;; | - |
1118 | if (location != -1) never evaluated: location != -1 | 0 |
1119 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 1, reinterpret_cast<const GLfloat *>(&value)); | 0 |
1120 | } | 0 |
1121 | void QGLShaderProgram::setUniformValue(const char *name, const QVector4D& value) | - |
1122 | { | - |
1123 | setUniformValue(uniformLocation(name), value); | - |
1124 | } | 0 |
1125 | | - |
1126 | | - |
1127 | | - |
1128 | | - |
1129 | | - |
1130 | | - |
1131 | | - |
1132 | void QGLShaderProgram::setUniformValue(int location, const QColor& color) | - |
1133 | { | - |
1134 | QGLShaderProgramPrivate * const d = d_func(); | - |
1135 | (void)d;; | - |
1136 | if (location != -1) { never evaluated: location != -1 | 0 |
1137 | GLfloat values[4] = {GLfloat(color.redF()), GLfloat(color.greenF()), | - |
1138 | GLfloat(color.blueF()), GLfloat(color.alphaF())}; | - |
1139 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 1, values); | - |
1140 | } | 0 |
1141 | } | 0 |
1142 | void QGLShaderProgram::setUniformValue(const char *name, const QColor& color) | - |
1143 | { | - |
1144 | setUniformValue(uniformLocation(name), color); | - |
1145 | } | 0 |
1146 | | - |
1147 | | - |
1148 | | - |
1149 | | - |
1150 | | - |
1151 | | - |
1152 | | - |
1153 | void QGLShaderProgram::setUniformValue(int location, const QPoint& point) | - |
1154 | { | - |
1155 | QGLShaderProgramPrivate * const d = d_func(); | - |
1156 | (void)d;; | - |
1157 | if (location != -1) { never evaluated: location != -1 | 0 |
1158 | GLfloat values[4] = {GLfloat(point.x()), GLfloat(point.y())}; | - |
1159 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, values); | - |
1160 | } | 0 |
1161 | } | 0 |
1162 | void QGLShaderProgram::setUniformValue(const char *name, const QPoint& point) | - |
1163 | { | - |
1164 | setUniformValue(uniformLocation(name), point); | - |
1165 | } | 0 |
1166 | | - |
1167 | | - |
1168 | | - |
1169 | | - |
1170 | | - |
1171 | | - |
1172 | | - |
1173 | void QGLShaderProgram::setUniformValue(int location, const QPointF& point) | - |
1174 | { | - |
1175 | QGLShaderProgramPrivate * const d = d_func(); | - |
1176 | (void)d;; | - |
1177 | if (location != -1) { never evaluated: location != -1 | 0 |
1178 | GLfloat values[4] = {GLfloat(point.x()), GLfloat(point.y())}; | - |
1179 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, values); | - |
1180 | } | 0 |
1181 | } | 0 |
1182 | void QGLShaderProgram::setUniformValue(const char *name, const QPointF& point) | - |
1183 | { | - |
1184 | setUniformValue(uniformLocation(name), point); | - |
1185 | } | 0 |
1186 | | - |
1187 | | - |
1188 | | - |
1189 | | - |
1190 | | - |
1191 | | - |
1192 | | - |
1193 | void QGLShaderProgram::setUniformValue(int location, const QSize& size) | - |
1194 | { | - |
1195 | QGLShaderProgramPrivate * const d = d_func(); | - |
1196 | (void)d;; | - |
1197 | if (location != -1) { never evaluated: location != -1 | 0 |
1198 | GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.height())}; | - |
1199 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, values); | - |
1200 | } | 0 |
1201 | } | 0 |
1202 | void QGLShaderProgram::setUniformValue(const char *name, const QSize& size) | - |
1203 | { | - |
1204 | setUniformValue(uniformLocation(name), size); | - |
1205 | } | 0 |
1206 | | - |
1207 | | - |
1208 | | - |
1209 | | - |
1210 | | - |
1211 | | - |
1212 | | - |
1213 | void QGLShaderProgram::setUniformValue(int location, const QSizeF& size) | - |
1214 | { | - |
1215 | QGLShaderProgramPrivate * const d = d_func(); | - |
1216 | (void)d;; | - |
1217 | if (location != -1) { never evaluated: location != -1 | 0 |
1218 | GLfloat values[4] = {GLfloat(size.width()), GLfloat(size.height())}; | - |
1219 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 1, values); | - |
1220 | } | 0 |
1221 | } | 0 |
1222 | void QGLShaderProgram::setUniformValue(const char *name, const QSizeF& size) | - |
1223 | { | - |
1224 | setUniformValue(uniformLocation(name), size); | - |
1225 | } | 0 |
1226 | | - |
1227 | | - |
1228 | | - |
1229 | | - |
1230 | | - |
1231 | | - |
1232 | | - |
1233 | void QGLShaderProgram::setUniformValue(int location, const QMatrix2x2& value) | - |
1234 | { | - |
1235 | QGLShaderProgramPrivate * const d = d_func(); | - |
1236 | (void)d;; | - |
1237 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2fv(location, 1, 0x0, value.constData()); | - |
1238 | } | 0 |
1239 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x2& value) | - |
1240 | { | - |
1241 | setUniformValue(uniformLocation(name), value); | - |
1242 | } | 0 |
1243 | | - |
1244 | | - |
1245 | | - |
1246 | | - |
1247 | | - |
1248 | | - |
1249 | | - |
1250 | void QGLShaderProgram::setUniformValue(int location, const QMatrix2x3& value) | - |
1251 | { | - |
1252 | QGLShaderProgramPrivate * const d = d_func(); | - |
1253 | (void)d;; | - |
1254 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, 2, value.constData()); | - |
1255 | } | 0 |
1256 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x3& value) | - |
1257 | { | - |
1258 | setUniformValue(uniformLocation(name), value); | - |
1259 | } | 0 |
1260 | | - |
1261 | | - |
1262 | | - |
1263 | | - |
1264 | | - |
1265 | | - |
1266 | | - |
1267 | void QGLShaderProgram::setUniformValue(int location, const QMatrix2x4& value) | - |
1268 | { | - |
1269 | QGLShaderProgramPrivate * const d = d_func(); | - |
1270 | (void)d;; | - |
1271 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 2, value.constData()); | - |
1272 | } | 0 |
1273 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix2x4& value) | - |
1274 | { | - |
1275 | setUniformValue(uniformLocation(name), value); | - |
1276 | } | 0 |
1277 | | - |
1278 | | - |
1279 | | - |
1280 | | - |
1281 | | - |
1282 | | - |
1283 | | - |
1284 | void QGLShaderProgram::setUniformValue(int location, const QMatrix3x2& value) | - |
1285 | { | - |
1286 | QGLShaderProgramPrivate * const d = d_func(); | - |
1287 | (void)d;; | - |
1288 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 3, value.constData()); | - |
1289 | } | 0 |
1290 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x2& value) | - |
1291 | { | - |
1292 | setUniformValue(uniformLocation(name), value); | - |
1293 | } | 0 |
1294 | | - |
1295 | | - |
1296 | | - |
1297 | | - |
1298 | | - |
1299 | | - |
1300 | | - |
1301 | void QGLShaderProgram::setUniformValue(int location, const QMatrix3x3& value) | - |
1302 | { | - |
1303 | QGLShaderProgramPrivate * const d = d_func(); | - |
1304 | (void)d;; | - |
1305 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, 1, 0x0, value.constData()); | - |
1306 | } | 0 |
1307 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x3& value) | - |
1308 | { | - |
1309 | setUniformValue(uniformLocation(name), value); | - |
1310 | } | 0 |
1311 | | - |
1312 | | - |
1313 | | - |
1314 | | - |
1315 | | - |
1316 | | - |
1317 | | - |
1318 | void QGLShaderProgram::setUniformValue(int location, const QMatrix3x4& value) | - |
1319 | { | - |
1320 | QGLShaderProgramPrivate * const d = d_func(); | - |
1321 | (void)d;; | - |
1322 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, 3, value.constData()); | - |
1323 | } | 0 |
1324 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix3x4& value) | - |
1325 | { | - |
1326 | setUniformValue(uniformLocation(name), value); | - |
1327 | } | 0 |
1328 | | - |
1329 | | - |
1330 | | - |
1331 | | - |
1332 | | - |
1333 | | - |
1334 | | - |
1335 | void QGLShaderProgram::setUniformValue(int location, const QMatrix4x2& value) | - |
1336 | { | - |
1337 | QGLShaderProgramPrivate * const d = d_func(); | - |
1338 | (void)d;; | - |
1339 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, 4, value.constData()); | - |
1340 | } | 0 |
1341 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x2& value) | - |
1342 | { | - |
1343 | setUniformValue(uniformLocation(name), value); | - |
1344 | } | 0 |
1345 | | - |
1346 | | - |
1347 | | - |
1348 | | - |
1349 | | - |
1350 | | - |
1351 | | - |
1352 | void QGLShaderProgram::setUniformValue(int location, const QMatrix4x3& value) | - |
1353 | { | - |
1354 | QGLShaderProgramPrivate * const d = d_func(); | - |
1355 | (void)d;; | - |
1356 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, 4, value.constData()); | - |
1357 | } | 0 |
1358 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x3& value) | - |
1359 | { | - |
1360 | setUniformValue(uniformLocation(name), value); | - |
1361 | } | 0 |
1362 | | - |
1363 | | - |
1364 | | - |
1365 | | - |
1366 | | - |
1367 | | - |
1368 | | - |
1369 | void QGLShaderProgram::setUniformValue(int location, const QMatrix4x4& value) | - |
1370 | { | - |
1371 | QGLShaderProgramPrivate * const d = d_func(); | - |
1372 | (void)d;; | - |
1373 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4fv(location, 1, 0x0, value.constData()); | - |
1374 | } | 0 |
1375 | void QGLShaderProgram::setUniformValue(const char *name, const QMatrix4x4& value) | - |
1376 | { | - |
1377 | setUniformValue(uniformLocation(name), value); | - |
1378 | } | 0 |
1379 | void QGLShaderProgram::setUniformValue(int location, const GLfloat value[2][2]) | - |
1380 | { | - |
1381 | QGLShaderProgramPrivate * const d = d_func(); | - |
1382 | (void)d;; | - |
1383 | if (location != -1) never evaluated: location != -1 | 0 |
1384 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2fv(location, 1, 0x0, value[0]); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2fv(location, 1, 0x0, value[0]); | 0 |
1385 | } | 0 |
1386 | void QGLShaderProgram::setUniformValue(int location, const GLfloat value[3][3]) | - |
1387 | { | - |
1388 | QGLShaderProgramPrivate * const d = d_func(); | - |
1389 | (void)d;; | - |
1390 | if (location != -1) never evaluated: location != -1 | 0 |
1391 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, 1, 0x0, value[0]); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, 1, 0x0, value[0]); | 0 |
1392 | } | 0 |
1393 | void QGLShaderProgram::setUniformValue(int location, const GLfloat value[4][4]) | - |
1394 | { | - |
1395 | QGLShaderProgramPrivate * const d = d_func(); | - |
1396 | (void)d;; | - |
1397 | if (location != -1) never evaluated: location != -1 | 0 |
1398 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4fv(location, 1, 0x0, value[0]); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4fv(location, 1, 0x0, value[0]); | 0 |
1399 | } | 0 |
1400 | void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[2][2]) | - |
1401 | { | - |
1402 | setUniformValue(uniformLocation(name), value); | - |
1403 | } | 0 |
1404 | void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[3][3]) | - |
1405 | { | - |
1406 | setUniformValue(uniformLocation(name), value); | - |
1407 | } | 0 |
1408 | void QGLShaderProgram::setUniformValue(const char *name, const GLfloat value[4][4]) | - |
1409 | { | - |
1410 | setUniformValue(uniformLocation(name), value); | - |
1411 | } | 0 |
1412 | void QGLShaderProgram::setUniformValue(int location, const QTransform& value) | - |
1413 | { | - |
1414 | QGLShaderProgramPrivate * const d = d_func(); | - |
1415 | (void)d;; | - |
1416 | if (location != -1) { never evaluated: location != -1 | 0 |
1417 | GLfloat mat[3][3] = { | - |
1418 | {GLfloat(value.m11()), GLfloat(value.m12()), GLfloat(value.m13())}, | - |
1419 | {GLfloat(value.m21()), GLfloat(value.m22()), GLfloat(value.m23())}, | - |
1420 | {GLfloat(value.m31()), GLfloat(value.m32()), GLfloat(value.m33())} | - |
1421 | }; | - |
1422 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, 1, 0x0, mat[0]); | - |
1423 | } | 0 |
1424 | } | 0 |
1425 | void QGLShaderProgram::setUniformValue | - |
1426 | (const char *name, const QTransform& value) | - |
1427 | { | - |
1428 | setUniformValue(uniformLocation(name), value); | - |
1429 | } | 0 |
1430 | | - |
1431 | | - |
1432 | | - |
1433 | | - |
1434 | | - |
1435 | | - |
1436 | | - |
1437 | void QGLShaderProgram::setUniformValueArray(int location, const GLint *values, int count) | - |
1438 | { | - |
1439 | QGLShaderProgramPrivate * const d = d_func(); | - |
1440 | (void)d;; | - |
1441 | if (location != -1) never evaluated: location != -1 | 0 |
1442 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1iv(location, count, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1iv(location, count, values); | 0 |
1443 | } | 0 |
1444 | void QGLShaderProgram::setUniformValueArray | - |
1445 | (const char *name, const GLint *values, int count) | - |
1446 | { | - |
1447 | setUniformValueArray(uniformLocation(name), values, count); | - |
1448 | } | 0 |
1449 | void QGLShaderProgram::setUniformValueArray(int location, const GLuint *values, int count) | - |
1450 | { | - |
1451 | QGLShaderProgramPrivate * const d = d_func(); | - |
1452 | (void)d;; | - |
1453 | if (location != -1) never evaluated: location != -1 | 0 |
1454 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1iv(location, count, reinterpret_cast<const GLint *>(values)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1iv(location, count, reinterpret_cast<const GLint *>(values)); | 0 |
1455 | } | 0 |
1456 | void QGLShaderProgram::setUniformValueArray | - |
1457 | (const char *name, const GLuint *values, int count) | - |
1458 | { | - |
1459 | setUniformValueArray(uniformLocation(name), values, count); | - |
1460 | } | 0 |
1461 | void QGLShaderProgram::setUniformValueArray(int location, const GLfloat *values, int count, int tupleSize) | - |
1462 | { | - |
1463 | QGLShaderProgramPrivate * const d = d_func(); | - |
1464 | (void)d;; | - |
1465 | if (location != -1) { never evaluated: location != -1 | 0 |
1466 | if (tupleSize == 1) never evaluated: tupleSize == 1 | 0 |
1467 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1fv(location, count, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform1fv(location, count, values); | 0 |
1468 | else if (tupleSize == 2) never evaluated: tupleSize == 2 | 0 |
1469 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count, values); | 0 |
1470 | else if (tupleSize == 3) never evaluated: tupleSize == 3 | 0 |
1471 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count, values); | 0 |
1472 | else if (tupleSize == 4) never evaluated: tupleSize == 4 | 0 |
1473 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count, values); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count, values); | 0 |
1474 | else | - |
1475 | QMessageLogger("qglshaderprogram.cpp", 2649, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setUniformValue: size" << tupleSize << "not supported"; never executed: QMessageLogger("qglshaderprogram.cpp", 2649, __PRETTY_FUNCTION__).warning() << "QGLShaderProgram::setUniformValue: size" << tupleSize << "not supported"; | 0 |
1476 | } | - |
1477 | } | 0 |
1478 | void QGLShaderProgram::setUniformValueArray | - |
1479 | (const char *name, const GLfloat *values, int count, int tupleSize) | - |
1480 | { | - |
1481 | setUniformValueArray(uniformLocation(name), values, count, tupleSize); | - |
1482 | } | 0 |
1483 | | - |
1484 | | - |
1485 | | - |
1486 | | - |
1487 | | - |
1488 | | - |
1489 | | - |
1490 | void QGLShaderProgram::setUniformValueArray(int location, const QVector2D *values, int count) | - |
1491 | { | - |
1492 | QGLShaderProgramPrivate * const d = d_func(); | - |
1493 | (void)d;; | - |
1494 | if (location != -1) never evaluated: location != -1 | 0 |
1495 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count, reinterpret_cast<const GLfloat *>(values)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count, reinterpret_cast<const GLfloat *>(values)); | 0 |
1496 | } | 0 |
1497 | void QGLShaderProgram::setUniformValueArray(const char *name, const QVector2D *values, int count) | - |
1498 | { | - |
1499 | setUniformValueArray(uniformLocation(name), values, count); | - |
1500 | } | 0 |
1501 | | - |
1502 | | - |
1503 | | - |
1504 | | - |
1505 | | - |
1506 | | - |
1507 | | - |
1508 | void QGLShaderProgram::setUniformValueArray(int location, const QVector3D *values, int count) | - |
1509 | { | - |
1510 | QGLShaderProgramPrivate * const d = d_func(); | - |
1511 | (void)d;; | - |
1512 | if (location != -1) never evaluated: location != -1 | 0 |
1513 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count, reinterpret_cast<const GLfloat *>(values)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count, reinterpret_cast<const GLfloat *>(values)); | 0 |
1514 | } | 0 |
1515 | void QGLShaderProgram::setUniformValueArray(const char *name, const QVector3D *values, int count) | - |
1516 | { | - |
1517 | setUniformValueArray(uniformLocation(name), values, count); | - |
1518 | } | 0 |
1519 | | - |
1520 | | - |
1521 | | - |
1522 | | - |
1523 | | - |
1524 | | - |
1525 | | - |
1526 | void QGLShaderProgram::setUniformValueArray(int location, const QVector4D *values, int count) | - |
1527 | { | - |
1528 | QGLShaderProgramPrivate * const d = d_func(); | - |
1529 | (void)d;; | - |
1530 | if (location != -1) never evaluated: location != -1 | 0 |
1531 | QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count, reinterpret_cast<const GLfloat *>(values)); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count, reinterpret_cast<const GLfloat *>(values)); | 0 |
1532 | } | 0 |
1533 | void QGLShaderProgram::setUniformValueArray(const char *name, const QVector4D *values, int count) | - |
1534 | { | - |
1535 | setUniformValueArray(uniformLocation(name), values, count); | - |
1536 | } | 0 |
1537 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x2 *values, int count) | - |
1538 | { | - |
1539 | QGLShaderProgramPrivate * const d = d_func(); | - |
1540 | (void)d;; | - |
1541 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix2x2) == sizeof(GLfloat) * 2 * 2) { QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2fv(location, count, 0x0, reinterpret_cast<const GLfloat *>(values[0].constData())); } else { QVarLengthArray<GLfloat> temp(2 * 2 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (2 * 2); ++index2) { temp.data()[2 * 2 * index + index2] = values[index].constData()[index2]; } } QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2fv(location, count, 0x0, temp.constData()); }; never evaluated: sizeof(QMatrix2x2) == sizeof(GLfloat) * 2 * 2 never evaluated: index < count never evaluated: index2 < (2 * 2) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1542 | | - |
1543 | } | - |
1544 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x2 *values, int count) | - |
1545 | { | - |
1546 | setUniformValueArray(uniformLocation(name), values, count); | - |
1547 | } | 0 |
1548 | | - |
1549 | | - |
1550 | | - |
1551 | | - |
1552 | | - |
1553 | | - |
1554 | | - |
1555 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x3 *values, int count) | - |
1556 | { | - |
1557 | QGLShaderProgramPrivate * const d = d_func(); | - |
1558 | (void)d;; | - |
1559 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix2x3) == sizeof(GLfloat) * 2 * 3) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 2, data); } else { QVarLengthArray<GLfloat> temp(2 * 3 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (2 * 3); ++index2) { temp.data()[2 * 3 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 2, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 2, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 2, temp.constData()); never evaluated: sizeof(QMatrix2x3) == sizeof(GLfloat) * 2 * 3 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x3fv never evaluated: index < count never evaluated: index2 < (2 * 3) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1560 | | - |
1561 | | - |
1562 | } | - |
1563 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x3 *values, int count) | - |
1564 | { | - |
1565 | setUniformValueArray(uniformLocation(name), values, count); | - |
1566 | } | 0 |
1567 | | - |
1568 | | - |
1569 | | - |
1570 | | - |
1571 | | - |
1572 | | - |
1573 | | - |
1574 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix2x4 *values, int count) | - |
1575 | { | - |
1576 | QGLShaderProgramPrivate * const d = d_func(); | - |
1577 | (void)d;; | - |
1578 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix2x4) == sizeof(GLfloat) * 2 * 4) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 2, data); } else { QVarLengthArray<GLfloat> temp(2 * 4 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (2 * 4); ++index2) { temp.data()[2 * 4 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 2, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 2, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 2, temp.constData()); never evaluated: sizeof(QMatrix2x4) == sizeof(GLfloat) * 2 * 4 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix2x4fv never evaluated: index < count never evaluated: index2 < (2 * 4) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1579 | | - |
1580 | | - |
1581 | } | - |
1582 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix2x4 *values, int count) | - |
1583 | { | - |
1584 | setUniformValueArray(uniformLocation(name), values, count); | - |
1585 | } | 0 |
1586 | | - |
1587 | | - |
1588 | | - |
1589 | | - |
1590 | | - |
1591 | | - |
1592 | | - |
1593 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x2 *values, int count) | - |
1594 | { | - |
1595 | QGLShaderProgramPrivate * const d = d_func(); | - |
1596 | (void)d;; | - |
1597 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix3x2) == sizeof(GLfloat) * 3 * 2) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 3, data); } else { QVarLengthArray<GLfloat> temp(3 * 2 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (3 * 2); ++index2) { temp.data()[3 * 2 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 3, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 3, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 3, temp.constData()); never evaluated: sizeof(QMatrix3x2) == sizeof(GLfloat) * 3 * 2 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x2fv never evaluated: index < count never evaluated: index2 < (3 * 2) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1598 | | - |
1599 | | - |
1600 | } | - |
1601 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x2 *values, int count) | - |
1602 | { | - |
1603 | setUniformValueArray(uniformLocation(name), values, count); | - |
1604 | } | 0 |
1605 | | - |
1606 | | - |
1607 | | - |
1608 | | - |
1609 | | - |
1610 | | - |
1611 | | - |
1612 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x3 *values, int count) | - |
1613 | { | - |
1614 | QGLShaderProgramPrivate * const d = d_func(); | - |
1615 | (void)d;; | - |
1616 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix3x3) == sizeof(GLfloat) * 3 * 3) { QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, count, 0x0, reinterpret_cast<const GLfloat *>(values[0].constData())); } else { QVarLengthArray<GLfloat> temp(3 * 3 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (3 * 3); ++index2) { temp.data()[3 * 3 * index + index2] = values[index].constData()[index2]; } } QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3fv(location, count, 0x0, temp.constData()); }; never evaluated: sizeof(QMatrix3x3) == sizeof(GLfloat) * 3 * 3 never evaluated: index < count never evaluated: index2 < (3 * 3) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1617 | | - |
1618 | } | - |
1619 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x3 *values, int count) | - |
1620 | { | - |
1621 | setUniformValueArray(uniformLocation(name), values, count); | - |
1622 | } | 0 |
1623 | | - |
1624 | | - |
1625 | | - |
1626 | | - |
1627 | | - |
1628 | | - |
1629 | | - |
1630 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix3x4 *values, int count) | - |
1631 | { | - |
1632 | QGLShaderProgramPrivate * const d = d_func(); | - |
1633 | (void)d;; | - |
1634 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix3x4) == sizeof(GLfloat) * 3 * 4) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 3, data); } else { QVarLengthArray<GLfloat> temp(3 * 4 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (3 * 4); ++index2) { temp.data()[3 * 4 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 3, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 3, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform4fv(location, count * 3, temp.constData()); never evaluated: sizeof(QMatrix3x4) == sizeof(GLfloat) * 3 * 4 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix3x4fv never evaluated: index < count never evaluated: index2 < (3 * 4) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1635 | | - |
1636 | | - |
1637 | } | - |
1638 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix3x4 *values, int count) | - |
1639 | { | - |
1640 | setUniformValueArray(uniformLocation(name), values, count); | - |
1641 | } | 0 |
1642 | | - |
1643 | | - |
1644 | | - |
1645 | | - |
1646 | | - |
1647 | | - |
1648 | | - |
1649 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x2 *values, int count) | - |
1650 | { | - |
1651 | QGLShaderProgramPrivate * const d = d_func(); | - |
1652 | (void)d;; | - |
1653 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix4x2) == sizeof(GLfloat) * 4 * 2) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 4, data); } else { QVarLengthArray<GLfloat> temp(4 * 2 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (4 * 2); ++index2) { temp.data()[4 * 2 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 4, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 4, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform2fv(location, count * 4, temp.constData()); never evaluated: sizeof(QMatrix4x2) == sizeof(GLfloat) * 4 * 2 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x2fv never evaluated: index < count never evaluated: index2 < (4 * 2) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1654 | | - |
1655 | | - |
1656 | } | - |
1657 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x2 *values, int count) | - |
1658 | { | - |
1659 | setUniformValueArray(uniformLocation(name), values, count); | - |
1660 | } | 0 |
1661 | | - |
1662 | | - |
1663 | | - |
1664 | | - |
1665 | | - |
1666 | | - |
1667 | | - |
1668 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x3 *values, int count) | - |
1669 | { | - |
1670 | QGLShaderProgramPrivate * const d = d_func(); | - |
1671 | (void)d;; | - |
1672 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix4x3) == sizeof(GLfloat) * 4 * 3) { const GLfloat *data = reinterpret_cast<const GLfloat *> (values[0].constData()); if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv(location, count, 0x0, data); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 4, data); } else { QVarLengthArray<GLfloat> temp(4 * 3 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (4 * 3); ++index2) { temp.data()[4 * 3 * index + index2] = values[index].constData()[index2]; } } if (QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv) QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv(location, count, 0x0, temp.constData()); else QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 4, temp.constData()); }; never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv(location, count, 0x0, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 4, data); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv(location, count, 0x0, temp.constData()); never executed: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniform3fv(location, count * 4, temp.constData()); never evaluated: sizeof(QMatrix4x3) == sizeof(GLfloat) * 4 * 3 never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv never evaluated: QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4x3fv never evaluated: index < count never evaluated: index2 < (4 * 3) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1673 | | - |
1674 | | - |
1675 | } | - |
1676 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x3 *values, int count) | - |
1677 | { | - |
1678 | setUniformValueArray(uniformLocation(name), values, count); | - |
1679 | } | 0 |
1680 | | - |
1681 | | - |
1682 | | - |
1683 | | - |
1684 | | - |
1685 | | - |
1686 | | - |
1687 | void QGLShaderProgram::setUniformValueArray(int location, const QMatrix4x4 *values, int count) | - |
1688 | { | - |
1689 | QGLShaderProgramPrivate * const d = d_func(); | - |
1690 | (void)d;; | - |
1691 | if (location == -1 || count <= 0) return; if (sizeof(QMatrix4x4) == sizeof(GLfloat) * 4 * 4) { QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4fv(location, count, 0x0, reinterpret_cast<const GLfloat *>(values[0].constData())); } else { QVarLengthArray<GLfloat> temp(4 * 4 * count); for (int index = 0; index < count; ++index) { for (int index2 = 0; index2 < (4 * 4); ++index2) { temp.data()[4 * 4 * index + index2] = values[index].constData()[index2]; } } QGLContextPrivate::extensionFuncs(QGLContext::currentContext()).qt_glUniformMatrix4fv(location, count, 0x0, temp.constData()); }; never evaluated: sizeof(QMatrix4x4) == sizeof(GLfloat) * 4 * 4 never evaluated: index < count never evaluated: index2 < (4 * 4) never evaluated: location == -1 never evaluated: count <= 0 | 0 |
1692 | | - |
1693 | } | - |
1694 | void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x4 *values, int count) | - |
1695 | { | - |
1696 | setUniformValueArray(uniformLocation(name), values, count); | - |
1697 | } | 0 |
1698 | int QGLShaderProgram::maxGeometryOutputVertices() const | - |
1699 | { | - |
1700 | GLint n = 0; | - |
1701 | | - |
1702 | glGetIntegerv(0x8DE0, &n); | - |
1703 | | - |
1704 | return n; never executed: return n; | 0 |
1705 | } | - |
1706 | void QGLShaderProgram::setGeometryOutputVertexCount(int count) | - |
1707 | { | - |
1708 | | - |
1709 | | - |
1710 | | - |
1711 | | - |
1712 | | - |
1713 | | - |
1714 | | - |
1715 | d_func()->geometryVertexCount = count; | - |
1716 | } | 0 |
1717 | int QGLShaderProgram::geometryOutputVertexCount() const | - |
1718 | { | - |
1719 | return d_func()->geometryVertexCount; never executed: return d_func()->geometryVertexCount; | 0 |
1720 | } | - |
1721 | | - |
1722 | | - |
1723 | | - |
1724 | | - |
1725 | | - |
1726 | | - |
1727 | | - |
1728 | void QGLShaderProgram::setGeometryInputType(GLenum inputType) | - |
1729 | { | - |
1730 | d_func()->geometryInputType = inputType; | - |
1731 | } | 0 |
1732 | GLenum QGLShaderProgram::geometryInputType() const | - |
1733 | { | - |
1734 | return d_func()->geometryInputType; never executed: return d_func()->geometryInputType; | 0 |
1735 | } | - |
1736 | void QGLShaderProgram::setGeometryOutputType(GLenum outputType) | - |
1737 | { | - |
1738 | d_func()->geometryOutputType = outputType; | - |
1739 | } | 0 |
1740 | GLenum QGLShaderProgram::geometryOutputType() const | - |
1741 | { | - |
1742 | return d_func()->geometryOutputType; never executed: return d_func()->geometryOutputType; | 0 |
1743 | } | - |
1744 | bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context) | - |
1745 | { | - |
1746 | | - |
1747 | if (!context) never evaluated: !context | 0 |
1748 | context = QGLContext::currentContext(); never executed: context = QGLContext::currentContext(); | 0 |
1749 | if (!context) never evaluated: !context | 0 |
1750 | return false; never executed: return false; | 0 |
1751 | return qt_resolve_glsl_extensions(const_cast<QGLContext *>(context)); never executed: return qt_resolve_glsl_extensions(const_cast<QGLContext *>(context)); | 0 |
1752 | | - |
1753 | | - |
1754 | | - |
1755 | | - |
1756 | } | - |
1757 | | - |
1758 | | - |
1759 | | - |
1760 | | - |
1761 | void QGLShaderProgram::shaderDestroyed() | - |
1762 | { | - |
1763 | QGLShaderProgramPrivate * const d = d_func(); | - |
1764 | QGLShader *shader = qobject_cast<QGLShader *>(sender()); | - |
1765 | if (shader && !d->removingShaders) never evaluated: !d->removingShaders | 0 |
1766 | removeShader(shader); never executed: removeShader(shader); | 0 |
1767 | } | 0 |
1768 | bool QGLShader::hasOpenGLShaders(ShaderType type, const QGLContext *context) | - |
1769 | { | - |
1770 | if (!context) never evaluated: !context | 0 |
1771 | context = QGLContext::currentContext(); never executed: context = QGLContext::currentContext(); | 0 |
1772 | if (!context) never evaluated: !context | 0 |
1773 | return false; never executed: return false; | 0 |
1774 | | - |
1775 | if ((type & ~(Geometry | Vertex | Fragment)) || type == 0) never evaluated: (type & ~(Geometry | Vertex | Fragment)) never evaluated: type == 0 | 0 |
1776 | return false; never executed: return false; | 0 |
1777 | | - |
1778 | bool resolved = qt_resolve_glsl_extensions(const_cast<QGLContext *>(context)); | - |
1779 | if (!resolved) never evaluated: !resolved | 0 |
1780 | return false; never executed: return false; | 0 |
1781 | | - |
1782 | if ((type & Geometry) && !QByteArray((const char *) glGetString(0x1F03)).contains("GL_EXT_geometry_shader4")) never evaluated: (type & Geometry) never evaluated: !QByteArray((const char *) glGetString(0x1F03)).contains("GL_EXT_geometry_shader4") | 0 |
1783 | return false; never executed: return false; | 0 |
1784 | | - |
1785 | return true; never executed: return true; | 0 |
1786 | } | - |
1787 | | - |
1788 | | - |
1789 | | - |
| | |