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