summaryrefslogtreecommitdiffstats
path: root/src/opengl
diff options
context:
space:
mode:
Diffstat (limited to 'src/opengl')
-rw-r--r--src/opengl/gl2paintengineex/qglengineshadermanager.cpp26
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp26
-rw-r--r--src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h1
-rw-r--r--src/opengl/gl2paintengineex/qtriangulatingstroker_p.h6
-rw-r--r--src/opengl/qglframebufferobject.cpp86
-rw-r--r--src/opengl/qglframebufferobject_p.h7
-rw-r--r--src/opengl/qglshaderprogram.cpp298
-rw-r--r--src/opengl/qglshaderprogram.h43
-rw-r--r--src/opengl/qwindowsurface_gl.cpp2
-rw-r--r--src/opengl/util/composition_mode_softlight.glsl24
-rw-r--r--src/opengl/util/fragmentprograms_p.h676
11 files changed, 614 insertions, 581 deletions
diff --git a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
index 40a6241..8a8f483 100644
--- a/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
+++ b/src/opengl/gl2paintengineex/qglengineshadermanager.cpp
@@ -169,14 +169,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
source.clear();
source.append(qShaderSnippets[MainVertexShader]);
source.append(qShaderSnippets[PositionOnlyVertexShader]);
- vertexShader = new QGLShader(QGLShader::VertexShader, context, this);
- vertexShader->compile(source);
+ vertexShader = new QGLShader(QGLShader::Vertex, context, this);
+ vertexShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[MainFragmentShader]);
source.append(qShaderSnippets[ShockingPinkSrcFragmentShader]);
- fragShader = new QGLShader(QGLShader::FragmentShader, context, this);
- fragShader->compile(source);
+ fragShader = new QGLShader(QGLShader::Fragment, context, this);
+ fragShader->compileSourceCode(source);
simpleShaderProg = new QGLShaderProgram(context, this);
simpleShaderProg->addShader(vertexShader);
@@ -192,14 +192,14 @@ QGLEngineSharedShaders::QGLEngineSharedShaders(const QGLContext* context)
source.clear();
source.append(qShaderSnippets[MainWithTexCoordsVertexShader]);
source.append(qShaderSnippets[UntransformedPositionVertexShader]);
- vertexShader = new QGLShader(QGLShader::VertexShader, context, this);
- vertexShader->compile(source);
+ vertexShader = new QGLShader(QGLShader::Vertex, context, this);
+ vertexShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[MainFragmentShader]);
source.append(qShaderSnippets[ImageSrcFragmentShader]);
- fragShader = new QGLShader(QGLShader::FragmentShader, context, this);
- fragShader->compile(source);
+ fragShader = new QGLShader(QGLShader::Fragment, context, this);
+ fragShader->compileSourceCode(source);
blitShaderProg = new QGLShaderProgram(context, this);
blitShaderProg->addShader(vertexShader);
@@ -243,14 +243,14 @@ QGLEngineShaderProg *QGLEngineSharedShaders::findProgramInCache(const QGLEngineS
source.append(qShaderSnippets[prog.compositionFragShader]);
if (prog.maskFragShader)
source.append(qShaderSnippets[prog.maskFragShader]);
- QGLShader* fragShader = new QGLShader(QGLShader::FragmentShader, ctxGuard.context(), this);
- fragShader->compile(source);
+ QGLShader* fragShader = new QGLShader(QGLShader::Fragment, ctxGuard.context(), this);
+ fragShader->compileSourceCode(source);
source.clear();
source.append(qShaderSnippets[prog.mainVertexShader]);
source.append(qShaderSnippets[prog.positionVertexShader]);
- QGLShader* vertexShader = new QGLShader(QGLShader::VertexShader, ctxGuard.context(), this);
- vertexShader->compile(source);
+ QGLShader* vertexShader = new QGLShader(QGLShader::Vertex, ctxGuard.context(), this);
+ vertexShader->compileSourceCode(source);
#if defined(QT_DEBUG)
// Name the shaders for easier debugging
@@ -673,7 +673,7 @@ bool QGLEngineShaderManager::useCorrectShaderProg()
currentShaderProg = sharedShaders->findProgramInCache(requiredProgram);
if (currentShaderProg) {
- currentShaderProg->program->enable();
+ currentShaderProg->program->bind();
if (useCustomSrc)
customSrcStage->setUniforms(currentShaderProg->program);
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
index a9744b3..8228c7e 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp
@@ -246,7 +246,7 @@ void QGLTextureGlyphCache::resizeTextureData(int width, int height)
glVertexAttribPointer(QT_VERTEX_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, vertexCoordinateArray);
glVertexAttribPointer(QT_TEXTURE_COORDS_ATTR, 2, GL_FLOAT, GL_FALSE, 0, textureCoordinateArray);
- pex->shaderManager->blitProgram()->enable();
+ pex->shaderManager->blitProgram()->bind();
pex->shaderManager->blitProgram()->setUniformValue("imageTexture", QT_IMAGE_TEXTURE_UNIT);
pex->shaderManager->setDirty();
@@ -395,7 +395,7 @@ void QGL2PaintEngineExPrivate::setBrush(const QBrush* brush)
void QGL2PaintEngineExPrivate::useSimpleShader()
{
- shaderManager->simpleProgram()->enable();
+ shaderManager->simpleProgram()->bind();
shaderManager->setDirty();
if (matrixDirty)
@@ -1203,7 +1203,9 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
ensureActive();
QOpenGL2PaintEngineState *s = state();
- bool doOffset = !(s->renderHints & QPainter::Antialiasing) && style == Qt::SolidPattern;
+ bool doOffset = !(s->renderHints & QPainter::Antialiasing) &&
+ (style == Qt::SolidPattern) &&
+ !d->multisamplingAlwaysEnabled;
if (doOffset) {
d->temporaryTransform = s->matrix;
@@ -1221,6 +1223,9 @@ void QGL2PaintEngineEx::fill(const QVectorPath &path, const QBrush &brush)
}
}
+extern bool qt_scaleForTransform(const QTransform &transform, qreal *scale); // qtransform.cpp
+
+
void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
{
Q_D(QGL2PaintEngineEx);
@@ -1231,10 +1236,15 @@ void QGL2PaintEngineEx::stroke(const QVectorPath &path, const QPen &pen)
return;
QOpenGL2PaintEngineState *s = state();
+ if (pen.isCosmetic() && !qt_scaleForTransform(s->transform(), 0)) {
+ // QTriangulatingStroker class is not meant to support cosmetically sheared strokes.
+ QPaintEngineEx::stroke(path, pen);
+ return;
+ }
ensureActive();
- bool doOffset = !(s->renderHints & QPainter::Antialiasing);
+ bool doOffset = !(s->renderHints & QPainter::Antialiasing) && !d->multisamplingAlwaysEnabled;
if (doOffset) {
d->temporaryTransform = s->matrix;
QTransform tx = QTransform::fromTranslate(0.49, .49);
@@ -1772,6 +1782,14 @@ bool QGL2PaintEngineEx::begin(QPaintDevice *pdev)
}
#endif
+#if defined(QT_OPENGL_ES_2)
+ // OpenGL ES can't switch MSAA off, so if the gl paint device is
+ // multisampled, it's always multisampled.
+ d->multisamplingAlwaysEnabled = d->device->format().sampleBuffers();
+#else
+ d->multisamplingAlwaysEnabled = false;
+#endif
+
return true;
}
diff --git a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
index 4cf2a83..9720723 100644
--- a/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
+++ b/src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h
@@ -277,6 +277,7 @@ public:
bool needsSync;
bool inRenderText;
+ bool multisamplingAlwaysEnabled;
GLfloat depthRange[2];
diff --git a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
index 97eabef..defa3f1 100644
--- a/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
+++ b/src/opengl/gl2paintengineex/qtriangulatingstroker_p.h
@@ -129,9 +129,9 @@ inline void QTriangulatingStroker::normalVector(float x1, float y1, float x2, fl
float pw;
if (dx == 0)
- pw = m_width / dy;
+ pw = m_width / qAbs(dy);
else if (dy == 0)
- pw = m_width / dx;
+ pw = m_width / qAbs(dx);
else
pw = m_width / sqrt(dx*dx + dy*dy);
@@ -259,8 +259,6 @@ void QTriangulatingStroker::lineTo(const qreal *pts)
-
-
void QTriangulatingStroker::join(const qreal *pts)
{
// Creates a join to the next segment (m_cx, m_cy) -> (pts[0], pts[1])
diff --git a/src/opengl/qglframebufferobject.cpp b/src/opengl/qglframebufferobject.cpp
index 7374594..d79283e 100644
--- a/src/opengl/qglframebufferobject.cpp
+++ b/src/opengl/qglframebufferobject.cpp
@@ -342,39 +342,6 @@ QGLContext *QGLFBOGLPaintDevice::context() const
return fboContext;
}
-void QGLFBOGLPaintDevice::ensureActiveTarget()
-{
- if (QGLContext::currentContext() != context())
- context()->makeCurrent();
-
- QGLContext* ctx = const_cast<QGLContext*>(QGLContext::currentContext());
- Q_ASSERT(ctx);
- const GLuint fboId = fbo->d_func()->fbo();
- if (ctx->d_func()->current_fbo != fboId) {
- ctx->d_func()->current_fbo = fboId;
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, fboId);
- }
-}
-
-void QGLFBOGLPaintDevice::beginPaint()
-{
- if (QGLContext::currentContext() != context())
- context()->makeCurrent();
-
- // We let QFBO track the previously bound FBO rather than doing it
- // ourselves here. This has the advantage that begin/release & bind/end
- // work as expected.
- wasBound = fbo->isBound();
- if (!wasBound)
- fbo->bind();
-}
-
-void QGLFBOGLPaintDevice::endPaint()
-{
- if (!wasBound)
- fbo->release();
-}
-
bool QGLFramebufferObjectPrivate::checkFramebufferStatus() const
{
QGL_FUNCP_CONTEXT;
@@ -879,13 +846,6 @@ bool QGLFramebufferObject::isValid() const
framebuffer to this framebuffer object.
Returns true upon success, false otherwise.
- Since 4.6: if another QGLFramebufferObject instance was already bound
- to the current context, then its handle() will be remembered and
- automatically restored when release() is called. This allows multiple
- framebuffer rendering targets to be stacked up. It is important that
- release() is called on the stacked framebuffer objects in the reverse
- order of the calls to bind().
-
\sa release()
*/
bool QGLFramebufferObject::bind()
@@ -896,17 +856,18 @@ bool QGLFramebufferObject::bind()
QGL_FUNC_CONTEXT;
if (!ctx)
return false; // Context no longer exists.
+ const QGLContext *current = QGLContext::currentContext();
+#ifdef QT_DEBUG
+ if (!current ||
+ QGLContextPrivate::contextGroup(current) != QGLContextPrivate::contextGroup(ctx))
+ {
+ qWarning("QGLFramebufferObject::bind() called from incompatible context");
+ }
+#endif
glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->fbo());
d->valid = d->checkFramebufferStatus();
- const QGLContext *context = QGLContext::currentContext();
- if (d->valid && context) {
- Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx));
- // Save the previous setting to automatically restore in release().
- if (context->d_ptr->current_fbo != d->fbo()) {
- d->previous_fbo = context->d_ptr->current_fbo;
- context->d_ptr->current_fbo = d->fbo();
- }
- }
+ if (d->valid && current)
+ current->d_ptr->current_fbo = d->fbo();
return d->valid;
}
@@ -917,30 +878,29 @@ bool QGLFramebufferObject::bind()
framebuffer.
Returns true upon success, false otherwise.
- Since 4.6: if another QGLFramebufferObject instance was already bound
- to the current context when bind() was called, then this function will
- automatically re-bind it to the current context.
-
\sa bind()
*/
bool QGLFramebufferObject::release()
{
if (!isValid())
return false;
- Q_D(QGLFramebufferObject);
QGL_FUNC_CONTEXT;
if (!ctx)
return false; // Context no longer exists.
- const QGLContext *context = QGLContext::currentContext();
- if (context) {
- Q_ASSERT(QGLContextPrivate::contextGroup(context) == QGLContextPrivate::contextGroup(ctx));
- // Restore the previous setting for stacked framebuffer objects.
- if (d->previous_fbo != context->d_ptr->current_fbo) {
- context->d_ptr->current_fbo = d->previous_fbo;
- glBindFramebuffer(GL_FRAMEBUFFER_EXT, d->previous_fbo);
- }
- d->previous_fbo = 0;
+ const QGLContext *current = QGLContext::currentContext();
+
+#ifdef QT_DEBUG
+ if (!current ||
+ QGLContextPrivate::contextGroup(current) != QGLContextPrivate::contextGroup(ctx))
+ {
+ qWarning("QGLFramebufferObject::release() called from incompatible context");
+ }
+#endif
+
+ if (current) {
+ current->d_ptr->current_fbo = 0;
+ glBindFramebuffer(GL_FRAMEBUFFER_EXT, 0);
}
return true;
diff --git a/src/opengl/qglframebufferobject_p.h b/src/opengl/qglframebufferobject_p.h
index 122c42e..800cb68 100644
--- a/src/opengl/qglframebufferobject_p.h
+++ b/src/opengl/qglframebufferobject_p.h
@@ -111,9 +111,6 @@ public:
virtual QSize size() const {return fbo->size();}
virtual QGLContext* context() const;
virtual QGLFormat format() const {return fboFormat;}
- virtual void ensureActiveTarget();
- virtual void beginPaint();
- virtual void endPaint();
void setFBO(QGLFramebufferObject* f,
QGLFramebufferObject::Attachment attachment);
@@ -127,7 +124,8 @@ private:
class QGLFramebufferObjectPrivate
{
public:
- QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_stencil_buffer(0), color_buffer(0), valid(false), previous_fbo(0), engine(0) {}
+ QGLFramebufferObjectPrivate() : fbo_guard(0), texture(0), depth_stencil_buffer(0)
+ , color_buffer(0), valid(false), engine(0) {}
~QGLFramebufferObjectPrivate() {}
void init(QGLFramebufferObject *q, const QSize& sz,
@@ -143,7 +141,6 @@ public:
QGLFramebufferObjectFormat format;
uint valid : 1;
QGLFramebufferObject::Attachment fbo_attachment;
- GLuint previous_fbo;
mutable QPaintEngine *engine;
QGLFBOGLPaintDevice glDevice;
diff --git a/src/opengl/qglshaderprogram.cpp b/src/opengl/qglshaderprogram.cpp
index e28c382..b4191dc 100644
--- a/src/opengl/qglshaderprogram.cpp
+++ b/src/opengl/qglshaderprogram.cpp
@@ -69,7 +69,7 @@ QT_BEGIN_NAMESPACE
The following example creates a vertex shader program using the
supplied source \c{code}. Once compiled and linked, the shader
program is activated in the current QGLContext by calling
- QGLShaderProgram::enable():
+ QGLShaderProgram::bind():
\snippet doc/src/snippets/code/src_opengl_qglshaderprogram.cpp 0
@@ -125,11 +125,11 @@ QT_BEGIN_NAMESPACE
*/
/*!
- \enum QGLShader::ShaderTypeBits
+ \enum QGLShader::ShaderTypeBit
This enum specifies the type of QGLShader that is being created.
- \value VertexShader Vertex shader written in the OpenGL Shading Language (GLSL).
- \value FragmentShader Fragment shader written in the OpenGL Shading Language (GLSL).
+ \value Vertex Vertex shader written in the OpenGL Shading Language (GLSL).
+ \value Fragment Fragment shader written in the OpenGL Shading Language (GLSL).
*/
#ifndef GL_FRAGMENT_SHADER
@@ -211,7 +211,7 @@ bool QGLShaderPrivate::create()
return false;
if (qt_resolve_glsl_extensions(const_cast<QGLContext *>(context))) {
GLuint shader;
- if (shaderType == QGLShader::VertexShader)
+ if (shaderType == QGLShader::Vertex)
shader = glCreateShader(GL_VERTEX_SHADER);
else
shader = glCreateShader(GL_FRAGMENT_SHADER);
@@ -266,14 +266,14 @@ void QGLShaderPrivate::deleteShader()
/*!
Constructs a new QGLShader object of the specified \a type
and attaches it to \a parent. If shader programs are not supported,
- QGLShaderProgram::hasShaderPrograms() will return false.
+ QGLShaderProgram::hasOpenGLShaderPrograms() will return false.
- This constructor is normally followed by a call to compile()
- or compileFile().
+ This constructor is normally followed by a call to compileSourceCode()
+ or compileSourceFile().
The shader will be associated with the current QGLContext.
- \sa compile(), compileFile()
+ \sa compileSourceCode(), compileSourceFile()
*/
QGLShader::QGLShader(QGLShader::ShaderType type, QObject *parent)
: QObject(*new QGLShaderPrivate(QGLContext::currentContext(), type), parent)
@@ -283,45 +283,19 @@ QGLShader::QGLShader(QGLShader::ShaderType type, QObject *parent)
}
/*!
- Constructs a new QGLShader object of the specified \a type from the
- source code in \a fileName and attaches it to \a parent.
- If the shader could not be loaded, then isCompiled() will return false.
-
- The shader will be associated with the current QGLContext.
-
- \sa isCompiled()
-*/
-QGLShader::QGLShader
- (const QString& fileName, QGLShader::ShaderType type, QObject *parent)
- : QObject(*new QGLShaderPrivate(QGLContext::currentContext(), type), parent)
-{
- Q_D(QGLShader);
- if (d->create() && !compileFile(fileName))
- d->deleteShader();
-}
-
-static inline const QGLContext *contextOrCurrent(const QGLContext *context)
-{
- if (context)
- return context;
- else
- return QGLContext::currentContext();
-}
-
-/*!
Constructs a new QGLShader object of the specified \a type
and attaches it to \a parent. If shader programs are not supported,
- then QGLShaderProgram::hasShaderPrograms() will return false.
+ then QGLShaderProgram::hasOpenGLShaderPrograms() will return false.
- This constructor is normally followed by a call to compile()
- or compileFile().
+ This constructor is normally followed by a call to compileSourceCode()
+ or compileSourceFile().
The shader will be associated with \a context.
- \sa compile(), compileFile()
+ \sa compileSourceCode(), compileSourceFile()
*/
QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent)
- : QObject(*new QGLShaderPrivate(contextOrCurrent(context), type), parent)
+ : QObject(*new QGLShaderPrivate(context ? context : QGLContext::currentContext(), type), parent)
{
Q_D(QGLShader);
#ifndef QT_NO_DEBUG
@@ -334,30 +308,6 @@ QGLShader::QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObj
}
/*!
- Constructs a new QGLShader object of the specified \a type from the
- source code in \a fileName and attaches it to \a parent.
- If the shader could not be loaded, then isCompiled() will return false.
-
- The shader will be associated with \a context.
-
- \sa isCompiled()
-*/
-QGLShader::QGLShader
- (const QString& fileName, QGLShader::ShaderType type, const QGLContext *context, QObject *parent)
- : QObject(*new QGLShaderPrivate(contextOrCurrent(context), type), parent)
-{
- Q_D(QGLShader);
-#ifndef QT_NO_DEBUG
- if (context && !QGLContext::areSharing(context, QGLContext::currentContext())) {
- qWarning("QGLShader::QGLShader: \'context\' must be current context or sharing with it.");
- return;
- }
-#endif
- if (d->create() && !compileFile(fileName))
- d->deleteShader();
-}
-
-/*!
Deletes this shader. If the shader has been attached to a
QGLShaderProgram object, then the actual shader will stay around
until the QGLShaderProgram is destroyed.
@@ -400,9 +350,9 @@ static const char redefineHighp[] =
Sets the \a source code for this shader and compiles it.
Returns true if the source was successfully compiled, false otherwise.
- \sa compileFile()
+ \sa compileSourceFile()
*/
-bool QGLShader::compile(const char *source)
+bool QGLShader::compileSourceCode(const char *source)
{
Q_D(QGLShader);
if (d->shaderGuard.id()) {
@@ -431,7 +381,7 @@ bool QGLShader::compile(const char *source)
srclen.append(GLint(sizeof(qualifierDefines) - 1));
#endif
#ifdef QGL_REDEFINE_HIGHP
- if (d->shaderType == FragmentShader) {
+ if (d->shaderType == Fragment) {
src.append(redefineHighp);
srclen.append(GLint(sizeof(redefineHighp) - 1));
}
@@ -451,11 +401,11 @@ bool QGLShader::compile(const char *source)
Sets the \a source code for this shader and compiles it.
Returns true if the source was successfully compiled, false otherwise.
- \sa compileFile()
+ \sa compileSourceFile()
*/
-bool QGLShader::compile(const QByteArray& source)
+bool QGLShader::compileSourceCode(const QByteArray& source)
{
- return compile(source.constData());
+ return compileSourceCode(source.constData());
}
/*!
@@ -464,11 +414,11 @@ bool QGLShader::compile(const QByteArray& source)
Sets the \a source code for this shader and compiles it.
Returns true if the source was successfully compiled, false otherwise.
- \sa compileFile()
+ \sa compileSourceFile()
*/
-bool QGLShader::compile(const QString& source)
+bool QGLShader::compileSourceCode(const QString& source)
{
- return compile(source.toLatin1().constData());
+ return compileSourceCode(source.toLatin1().constData());
}
/*!
@@ -476,9 +426,9 @@ bool QGLShader::compile(const QString& source)
and compiles it. Returns true if the file could be opened and the
source compiled, false otherwise.
- \sa compile()
+ \sa compileSourceCode()
*/
-bool QGLShader::compileFile(const QString& fileName)
+bool QGLShader::compileSourceFile(const QString& fileName)
{
QFile file(fileName);
if (!file.open(QFile::ReadOnly)) {
@@ -487,13 +437,13 @@ bool QGLShader::compileFile(const QString& fileName)
}
QByteArray contents = file.readAll();
- return compile(contents.constData());
+ return compileSourceCode(contents.constData());
}
/*!
Returns the source code for this shader.
- \sa compile()
+ \sa compileSourceCode()
*/
QByteArray QGLShader::sourceCode() const
{
@@ -516,7 +466,7 @@ QByteArray QGLShader::sourceCode() const
/*!
Returns true if this shader has been compiled; false otherwise.
- \sa compile()
+ \sa compileSourceCode(), compileSourceFile()
*/
bool QGLShader::isCompiled() const
{
@@ -527,7 +477,7 @@ bool QGLShader::isCompiled() const
/*!
Returns the errors and warnings that occurred during the last compile.
- \sa compile()
+ \sa compileSourceCode(), compileSourceFile()
*/
QString QGLShader::log() const
{
@@ -666,6 +616,7 @@ bool QGLShaderProgram::init()
is deleted. This allows the caller to add the same shader
to multiple shader programs.
+ \sa addShaderFromSourceCode(), addShaderFromSourceFile()
\sa removeShader(), link(), removeAllShaders()
*/
bool QGLShaderProgram::addShader(QGLShader *shader)
@@ -705,15 +656,16 @@ bool QGLShaderProgram::addShader(QGLShader *shader)
adding vertex and fragment shaders to a shader program without
creating an instance of QGLShader first.
+ \sa addShader(), addShaderFromSourceFile()
\sa removeShader(), link(), log(), removeAllShaders()
*/
-bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const char *source)
+bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const char *source)
{
Q_D(QGLShaderProgram);
if (!init())
return false;
QGLShader *shader = new QGLShader(type, this);
- if (!shader->compile(source)) {
+ if (!shader->compileSourceCode(source)) {
d->log = shader->log();
delete shader;
return false;
@@ -734,11 +686,12 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const char *source)
adding vertex and fragment shaders to a shader program without
creating an instance of QGLShader first.
+ \sa addShader(), addShaderFromSourceFile()
\sa removeShader(), link(), log(), removeAllShaders()
*/
-bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QByteArray& source)
+bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QByteArray& source)
{
- return addShader(type, source.constData());
+ return addShaderFromSourceCode(type, source.constData());
}
/*!
@@ -753,11 +706,12 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QByteArray& s
adding vertex and fragment shaders to a shader program without
creating an instance of QGLShader first.
+ \sa addShader(), addShaderFromSourceFile()
\sa removeShader(), link(), log(), removeAllShaders()
*/
-bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QString& source)
+bool QGLShaderProgram::addShaderFromSourceCode(QGLShader::ShaderType type, const QString& source)
{
- return addShader(type, source.toLatin1().constData());
+ return addShaderFromSourceCode(type, source.toLatin1().constData());
}
/*!
@@ -770,16 +724,16 @@ bool QGLShaderProgram::addShader(QGLShader::ShaderType type, const QString& sour
adding vertex and fragment shaders to a shader program without
creating an instance of QGLShader first.
- \sa addShader()
+ \sa addShader(), addShaderFromSourceCode()
*/
-bool QGLShaderProgram::addShaderFromFile
+bool QGLShaderProgram::addShaderFromSourceFile
(QGLShader::ShaderType type, const QString& fileName)
{
Q_D(QGLShaderProgram);
if (!init())
return false;
QGLShader *shader = new QGLShader(type, this);
- if (!shader->compileFile(fileName)) {
+ if (!shader->compileSourceFile(fileName)) {
d->log = shader->log();
delete shader;
return false;
@@ -912,14 +866,16 @@ QString QGLShaderProgram::log() const
}
/*!
- Enable use of this shader program in the currently active QGLContext.
- Returns true if the program was successfully enabled; false
- otherwise. If the shader program has not yet been linked,
+ Binds this shader program to the active QGLContext and makes
+ it the current shader program. Any previously bound shader program
+ is released. This is equivalent to calling \c{glUseProgram()} on
+ programId(). Returns true if the program was successfully bound;
+ false otherwise. If the shader program has not yet been linked,
or it needs to be re-linked, this function will call link().
- \sa link(), disable()
+ \sa link(), release()
*/
-bool QGLShaderProgram::enable()
+bool QGLShaderProgram::bind()
{
Q_D(QGLShaderProgram);
GLuint program = d->programGuard.id();
@@ -927,6 +883,12 @@ bool QGLShaderProgram::enable()
return false;
if (!d->linked && !link())
return false;
+#ifndef QT_NO_DEBUG
+ if (!QGLContext::areSharing(d->programGuard.context(), QGLContext::currentContext())) {
+ qWarning("QGLShaderProgram::bind: program is not valid in the current context.");
+ return false;
+ }
+#endif
glUseProgram(program);
return true;
}
@@ -935,13 +897,18 @@ bool QGLShaderProgram::enable()
#define ctx QGLContext::currentContext()
/*!
- Disables the active shader program in the current QGLContext.
+ Releases the active shader program from the current QGLContext.
This is equivalent to calling \c{glUseProgram(0)}.
- \sa enable()
+ \sa bind()
*/
-void QGLShaderProgram::disable()
+void QGLShaderProgram::release()
{
+#ifndef QT_NO_DEBUG
+ Q_D(QGLShaderProgram);
+ if (!QGLContext::areSharing(d->programGuard.context(), QGLContext::currentContext()))
+ qWarning("QGLShaderProgram::release: program is not valid in the current context.");
+#endif
#if defined(QT_OPENGL_ES_2)
glUseProgram(0);
#else
@@ -1331,22 +1298,26 @@ void QGLShaderProgram::setAttributeValue
/*!
Sets an array of vertex \a values on the attribute at \a location
- in this shader program. The \a size indicates the number of
+ in this shader program. The \a tupleSize indicates the number of
components per vertex (1, 2, 3, or 4), and the \a stride indicates
the number of bytes between vertices. A default \a stride value
of zero indicates that the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on the \a location. Otherwise the value specified with
+ setAttributeValue() for \a location will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
- (int location, const GLfloat *values, int size, int stride)
+ (int location, const GLfloat *values, int tupleSize, int stride)
{
Q_D(QGLShaderProgram);
Q_UNUSED(d);
if (location != -1) {
- glVertexAttribPointer(location, size, GL_FLOAT, GL_FALSE,
+ glVertexAttribPointer(location, tupleSize, GL_FLOAT, GL_FALSE,
stride, values);
- glEnableVertexAttribArray(location);
}
}
@@ -1356,7 +1327,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on the \a location. Otherwise the value specified with
+ setAttributeValue() for \a location will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(int location, const QVector2D *values, int stride)
@@ -1366,7 +1342,6 @@ void QGLShaderProgram::setAttributeArray
if (location != -1) {
glVertexAttribPointer(location, 2, GL_FLOAT, GL_FALSE,
stride, values);
- glEnableVertexAttribArray(location);
}
}
@@ -1376,7 +1351,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on the \a location. Otherwise the value specified with
+ setAttributeValue() for \a location will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(int location, const QVector3D *values, int stride)
@@ -1386,7 +1366,6 @@ void QGLShaderProgram::setAttributeArray
if (location != -1) {
glVertexAttribPointer(location, 3, GL_FLOAT, GL_FALSE,
stride, values);
- glEnableVertexAttribArray(location);
}
}
@@ -1396,7 +1375,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on the \a location. Otherwise the value specified with
+ setAttributeValue() for \a location will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(int location, const QVector4D *values, int stride)
@@ -1406,7 +1390,6 @@ void QGLShaderProgram::setAttributeArray
if (location != -1) {
glVertexAttribPointer(location, 4, GL_FLOAT, GL_FALSE,
stride, values);
- glEnableVertexAttribArray(location);
}
}
@@ -1414,17 +1397,22 @@ void QGLShaderProgram::setAttributeArray
\overload
Sets an array of vertex \a values on the attribute called \a name
- in this shader program. The \a size indicates the number of
+ in this shader program. The \a tupleSize indicates the number of
components per vertex (1, 2, 3, or 4), and the \a stride indicates
the number of bytes between vertices. A default \a stride value
of zero indicates that the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on \a name. Otherwise the value specified with setAttributeValue()
+ for \a name will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
- (const char *name, const GLfloat *values, int size, int stride)
+ (const char *name, const GLfloat *values, int tupleSize, int stride)
{
- setAttributeArray(attributeLocation(name), values, size, stride);
+ setAttributeArray(attributeLocation(name), values, tupleSize, stride);
}
/*!
@@ -1435,7 +1423,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on \a name. Otherwise the value specified with setAttributeValue()
+ for \a name will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(const char *name, const QVector2D *values, int stride)
@@ -1451,7 +1444,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on \a name. Otherwise the value specified with setAttributeValue()
+ for \a name will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(const char *name, const QVector3D *values, int stride)
@@ -1467,7 +1465,12 @@ void QGLShaderProgram::setAttributeArray
between vertices. A default \a stride value of zero indicates that
the vertices are densely packed in \a values.
- \sa setAttributeValue(), setUniformValue(), disableAttributeArray()
+ The array will become active when enableAttributeArray() is called
+ on \a name. Otherwise the value specified with setAttributeValue()
+ for \a name will be used.
+
+ \sa setAttributeValue(), setUniformValue(), enableAttributeArray()
+ \sa disableAttributeArray()
*/
void QGLShaderProgram::setAttributeArray
(const char *name, const QVector4D *values, int stride)
@@ -1476,10 +1479,42 @@ void QGLShaderProgram::setAttributeArray
}
/*!
+ Enables the vertex array at \a location in this shader program
+ so that the value set by setAttributeArray() on \a location
+ will be used by the shader program.
+
+ \sa disableAttributeArray(), setAttributeArray(), setAttributeValue()
+ \sa setUniformValue()
+*/
+void QGLShaderProgram::enableAttributeArray(int location)
+{
+ Q_D(QGLShaderProgram);
+ Q_UNUSED(d);
+ if (location != -1)
+ glEnableVertexAttribArray(location);
+}
+
+/*!
+ \overload
+
+ Enables the vertex array called \a name in this shader program
+ so that the value set by setAttributeArray() on \a name
+ will be used by the shader program.
+
+ \sa disableAttributeArray(), setAttributeArray(), setAttributeValue()
+ \sa setUniformValue()
+*/
+void QGLShaderProgram::enableAttributeArray(const char *name)
+{
+ enableAttributeArray(attributeLocation(name));
+}
+
+/*!
Disables the vertex array at \a location in this shader program
- that was enabled by a previous call to setAttributeArray().
+ that was enabled by a previous call to enableAttributeArray().
- \sa setAttributeArray(), setAttributeValue(), setUniformValue()
+ \sa enableAttributeArray(), setAttributeArray(), setAttributeValue()
+ \sa setUniformValue()
*/
void QGLShaderProgram::disableAttributeArray(int location)
{
@@ -1493,9 +1528,10 @@ void QGLShaderProgram::disableAttributeArray(int location)
\overload
Disables the vertex array called \a name in this shader program
- that was enabled by a previous call to setAttributeArray().
+ that was enabled by a previous call to enableAttributeArray().
- \sa setAttributeArray(), setAttributeValue(), setUniformValue()
+ \sa enableAttributeArray(), setAttributeArray(), setAttributeValue()
+ \sa setUniformValue()
*/
void QGLShaderProgram::disableAttributeArray(const char *name)
{
@@ -2363,25 +2399,25 @@ void QGLShaderProgram::setUniformValueArray
/*!
Sets the uniform variable array at \a location in the current
context to the \a count elements of \a values. Each element
- has \a size components. The \a size must be 1, 2, 3, or 4.
+ has \a tupleSize components. The \a tupleSize must be 1, 2, 3, or 4.
\sa setAttributeValue()
*/
-void QGLShaderProgram::setUniformValueArray(int location, const GLfloat *values, int count, int size)
+void QGLShaderProgram::setUniformValueArray(int location, const GLfloat *values, int count, int tupleSize)
{
Q_D(QGLShaderProgram);
Q_UNUSED(d);
if (location != -1) {
- if (size == 1)
+ if (tupleSize == 1)
glUniform1fv(location, count, values);
- else if (size == 2)
+ else if (tupleSize == 2)
glUniform2fv(location, count, values);
- else if (size == 3)
+ else if (tupleSize == 3)
glUniform3fv(location, count, values);
- else if (size == 4)
+ else if (tupleSize == 4)
glUniform4fv(location, count, values);
else
- qWarning() << "QGLShaderProgram::setUniformValue: size" << size << "not supported";
+ qWarning() << "QGLShaderProgram::setUniformValue: size" << tupleSize << "not supported";
}
}
@@ -2390,14 +2426,14 @@ void QGLShaderProgram::setUniformValueArray(int location, const GLfloat *values,
Sets the uniform variable array called \a name in the current
context to the \a count elements of \a values. Each element
- has \a size components. The \a size must be 1, 2, 3, or 4.
+ has \a tupleSize components. The \a tupleSize must be 1, 2, 3, or 4.
\sa setAttributeValue()
*/
void QGLShaderProgram::setUniformValueArray
- (const char *name, const GLfloat *values, int count, int size)
+ (const char *name, const GLfloat *values, int count, int tupleSize)
{
- setUniformValueArray(uniformLocation(name), values, count, size);
+ setUniformValueArray(uniformLocation(name), values, count, tupleSize);
}
/*!
@@ -2800,7 +2836,7 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMatrix4x4 *
The \a context is used to resolve the GLSL extensions.
If \a context is null, then QGLContext::currentContext() is used.
*/
-bool QGLShaderProgram::hasShaderPrograms(const QGLContext *context)
+bool QGLShaderProgram::hasOpenGLShaderPrograms(const QGLContext *context)
{
#if !defined(QT_OPENGL_ES_2)
if (!context)
@@ -2825,8 +2861,6 @@ void QGLShaderProgram::shaderDestroyed()
removeShader(shader);
}
-#endif
-
#ifdef Q_MAC_COMPAT_GL_FUNCTIONS
/*! \internal */
void QGLShaderProgram::setUniformValue(int location, QMacCompatGLint value)
@@ -2877,4 +2911,6 @@ void QGLShaderProgram::setUniformValueArray(const char *name, const QMacCompatGL
}
#endif
+#endif // !defined(QT_OPENGL_ES_1_CL) && !defined(QT_OPENGL_ES_1)
+
QT_END_NAMESPACE
diff --git a/src/opengl/qglshaderprogram.h b/src/opengl/qglshaderprogram.h
index 49c3364..deeaee2 100644
--- a/src/opengl/qglshaderprogram.h
+++ b/src/opengl/qglshaderprogram.h
@@ -63,25 +63,23 @@ class Q_OPENGL_EXPORT QGLShader : public QObject
{
Q_OBJECT
public:
- enum ShaderTypeBits
+ enum ShaderTypeBit
{
- VertexShader = 0x0001,
- FragmentShader = 0x0002
+ Vertex = 0x0001,
+ Fragment = 0x0002
};
- Q_DECLARE_FLAGS(ShaderType, ShaderTypeBits)
+ Q_DECLARE_FLAGS(ShaderType, ShaderTypeBit)
explicit QGLShader(QGLShader::ShaderType type, QObject *parent = 0);
- QGLShader(const QString& fileName, QGLShader::ShaderType type, QObject *parent = 0);
QGLShader(QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
- QGLShader(const QString& fileName, QGLShader::ShaderType type, const QGLContext *context, QObject *parent = 0);
virtual ~QGLShader();
QGLShader::ShaderType shaderType() const;
- bool compile(const char *source);
- bool compile(const QByteArray& source);
- bool compile(const QString& source);
- bool compileFile(const QString& fileName);
+ bool compileSourceCode(const char *source);
+ bool compileSourceCode(const QByteArray& source);
+ bool compileSourceCode(const QString& source);
+ bool compileSourceFile(const QString& fileName);
QByteArray sourceCode() const;
@@ -114,10 +112,10 @@ public:
void removeShader(QGLShader *shader);
QList<QGLShader *> shaders() const;
- bool addShader(QGLShader::ShaderType type, const char *source);
- bool addShader(QGLShader::ShaderType type, const QByteArray& source);
- bool addShader(QGLShader::ShaderType type, const QString& source);
- bool addShaderFromFile(QGLShader::ShaderType type, const QString& fileName);
+ bool addShaderFromSourceCode(QGLShader::ShaderType type, const char *source);
+ bool addShaderFromSourceCode(QGLShader::ShaderType type, const QByteArray& source);
+ bool addShaderFromSourceCode(QGLShader::ShaderType type, const QString& source);
+ bool addShaderFromSourceFile(QGLShader::ShaderType type, const QString& fileName);
void removeAllShaders();
@@ -125,8 +123,8 @@ public:
bool isLinked() const;
QString log() const;
- bool enable();
- static void disable();
+ bool bind();
+ void release();
GLuint programId() const;
@@ -159,7 +157,7 @@ public:
void setAttributeValue(const char *name, const GLfloat *values, int columns, int rows);
void setAttributeArray
- (int location, const GLfloat *values, int size, int stride = 0);
+ (int location, const GLfloat *values, int tupleSize, int stride = 0);
void setAttributeArray
(int location, const QVector2D *values, int stride = 0);
void setAttributeArray
@@ -167,13 +165,16 @@ public:
void setAttributeArray
(int location, const QVector4D *values, int stride = 0);
void setAttributeArray
- (const char *name, const GLfloat *values, int size, int stride = 0);
+ (const char *name, const GLfloat *values, int tupleSize, int stride = 0);
void setAttributeArray
(const char *name, const QVector2D *values, int stride = 0);
void setAttributeArray
(const char *name, const QVector3D *values, int stride = 0);
void setAttributeArray
(const char *name, const QVector4D *values, int stride = 0);
+
+ void enableAttributeArray(int location);
+ void enableAttributeArray(const char *name);
void disableAttributeArray(int location);
void disableAttributeArray(const char *name);
@@ -244,7 +245,7 @@ public:
void setUniformValue(const char *name, const GLfloat value[4][4]);
void setUniformValue(const char *name, const QTransform& value);
- void setUniformValueArray(int location, const GLfloat *values, int count, int size);
+ void setUniformValueArray(int location, const GLfloat *values, int count, int tupleSize);
void setUniformValueArray(int location, const GLint *values, int count);
void setUniformValueArray(int location, const GLuint *values, int count);
void setUniformValueArray(int location, const QVector2D *values, int count);
@@ -260,7 +261,7 @@ public:
void setUniformValueArray(int location, const QMatrix4x3 *values, int count);
void setUniformValueArray(int location, const QMatrix4x4 *values, int count);
- void setUniformValueArray(const char *name, const GLfloat *values, int count, int size);
+ void setUniformValueArray(const char *name, const GLfloat *values, int count, int tupleSize);
void setUniformValueArray(const char *name, const GLint *values, int count);
void setUniformValueArray(const char *name, const GLuint *values, int count);
void setUniformValueArray(const char *name, const QVector2D *values, int count);
@@ -276,7 +277,7 @@ public:
void setUniformValueArray(const char *name, const QMatrix4x3 *values, int count);
void setUniformValueArray(const char *name, const QMatrix4x4 *values, int count);
- static bool hasShaderPrograms(const QGLContext *context = 0);
+ static bool hasOpenGLShaderPrograms(const QGLContext *context = 0);
private Q_SLOTS:
void shaderDestroyed();
diff --git a/src/opengl/qwindowsurface_gl.cpp b/src/opengl/qwindowsurface_gl.cpp
index ebe101d..f1f5976 100644
--- a/src/opengl/qwindowsurface_gl.cpp
+++ b/src/opengl/qwindowsurface_gl.cpp
@@ -625,7 +625,7 @@ void QGLWindowSurface::flush(QWidget *widget, const QRegion &rgn, const QPoint &
QGLShaderProgram *blitProgram =
QGLEngineSharedShaders::shadersForContext(ctx)->blitProgram();
- blitProgram->enable();
+ blitProgram->bind();
blitProgram->setUniformValue("imageTexture", 0 /*QT_IMAGE_TEXTURE_UNIT*/);
// The shader manager's blit program does not multiply the
diff --git a/src/opengl/util/composition_mode_softlight.glsl b/src/opengl/util/composition_mode_softlight.glsl
index 4777b74..e4c1f89 100644
--- a/src/opengl/util/composition_mode_softlight.glsl
+++ b/src/opengl/util/composition_mode_softlight.glsl
@@ -1,18 +1,22 @@
-// Dca' = 2.Sca < Sa ?
-// Dca.(Sa - (1 - Dca/Da).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa) :
-// (8.Dca <= Da ?
-// Dca.(Sa - (1 - Dca/Da).(2.Sca - Sa).(3 - 8.Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa) :
-// (Dca.Sa + ((Dca/Da)^(0.5).Da - Dca).(2.Sca - Sa)) + Sca.(1 - Da) + Dca.(1 - Sa))
+// if 2.Sca <= Sa
+// Dca' = Dca.(Sa + (2.Sca - Sa).(1 - Dca/Da)) + Sca.(1 - Da) + Dca.(1 - Sa)
+// otherwise if 2.Sca > Sa and 4.Dca <= Da
+// Dca' = Dca.Sa + Da.(2.Sca - Sa).(4.Dca/Da.(4.Dca/Da + 1).(Dca/Da - 1) + 7.Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
+// otherwise if 2.Sca > Sa and 4.Dca > Da
+// Dca' = Dca.Sa + Da.(2.Sca - Sa).((Dca/Da)^0.5 - Dca/Da) + Sca.(1 - Da) + Dca.(1 - Sa)
// Da' = Sa + Da - Sa.Da
+
vec4 composite(vec4 src, vec4 dst)
{
vec4 result;
float da = max(dst.a, 0.00001);
- result.rgb = mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a)),
- mix(dst.rgb * (src.a - (1.0 - dst.rgb / da) * (2.0 * src.rgb - src.a) * (3.0 - 8.0 * dst.rgb / da)),
- (dst.rgb * src.a + (sqrt(dst.rgb / da) * dst.a - dst.rgb) * (2.0 * src.rgb - src.a)),
- step(dst.a, 8.0 * dst.rgb)),
- step(src.a, 2.0 * src.rgb)) + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
+ vec3 dst_np = dst.rgb / da;
+ result.rgb = mix(dst.rgb * (src.a + (2.0 * src.rgb - src.a) * (1.0 - dst_np)),
+ mix(dst.rgb * src.a + dst.a * (2.0 * src.rgb - src.a) * ((16.0 * dst_np - 12.0) * dst_np + 3.0) * dst_np,
+ dst.rgb * src.a + dst.a * (2.0 * src.rgb - src.a) * (sqrt(dst_np) - dst_np),
+ step(dst.a, 4.0 * dst.rgb)),
+ step(src.a, 2.0 * src.rgb))
+ + src.rgb * (1.0 - dst.a) + dst.rgb * (1.0 - src.a);
result.a = src.a + dst.a - src.a * dst.a;
return result;
}
diff --git a/src/opengl/util/fragmentprograms_p.h b/src/opengl/util/fragmentprograms_p.h
index 9154c6e..2241057 100644
--- a/src/opengl/util/fragmentprograms_p.h
+++ b/src/opengl/util/fragmentprograms_p.h
@@ -519,8 +519,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[6] = { program.local[0..3],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -530,30 +530,31 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MUL R0.xy, fragment.position, c[1];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MAX R1.x, R0.w, c[4].z;\n"
- "RCP R1.w, R1.x;\n"
- "MUL R1.xyz, R0, R1.w;\n"
- "MUL R4.xyz, -R1, c[4].w;\n"
- "RSQ R2.x, R1.x;\n"
- "RSQ R2.z, R1.z;\n"
- "RSQ R2.y, R1.y;\n"
- "MAD R1.xyz, -R0, R1.w, c[4].x;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R3.xyz, R0.w, R2, -R0;\n"
- "MAD R2.xyz, fragment.color.primary, c[4].y, -fragment.color.primary.w;\n"
- "MUL R3.xyz, R2, R3;\n"
- "ADD R5.xyz, R4, c[5].x;\n"
- "MUL R4.xyz, R1, R2;\n"
- "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R2.xyz, R0, R1.x;\n"
+ "MAD R1.xyz, R2, c[5].x, -c[5].y;\n"
+ "MAD R3.xyz, R2, R1, c[5].z;\n"
+ "MAD R1.xyz, fragment.color.primary, c[4].y, -fragment.color.primary.w;\n"
+ "MUL R4.xyz, R0.w, R1;\n"
+ "MUL R5.xyz, R4, R3;\n"
+ "RSQ R1.w, R2.x;\n"
+ "RSQ R2.w, R2.z;\n"
+ "RCP R3.x, R1.w;\n"
+ "RSQ R1.w, R2.y;\n"
+ "MUL R5.xyz, R2, R5;\n"
+ "RCP R3.z, R2.w;\n"
+ "RCP R3.y, R1.w;\n"
+ "ADD R3.xyz, -R2, R3;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, -R2, c[4].x;\n"
+ "MAD R1.xyz, R1, R2, fragment.color.primary.w;\n"
"MUL R2.xyz, fragment.color.primary, c[4].y;\n"
- "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n"
+ "MAD R4.xyz, fragment.color.primary.w, R0, R5;\n"
"MAD R3.xyz, fragment.color.primary.w, R0, R3;\n"
- "MAD R4.xyz, -R0, R5, R3;\n"
+ "ADD R5.xyz, R3, -R4;\n"
"MUL R3.xyz, R0, c[4].w;\n"
- "MUL R5.xyz, R0, R5;\n"
"SGE R3.xyz, R3, R0.w;\n"
- "MAD R3.xyz, R3, R4, R5;\n"
+ "MAD R3.xyz, R3, R5, R4;\n"
"MAD R3.xyz, -R0, R1, R3;\n"
"MUL R1.xyz, R0, R1;\n"
"SGE R2.xyz, R2, fragment.color.primary.w;\n"
@@ -861,8 +862,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[3] = { program.local[0],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -872,30 +873,31 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_SOLID_COMPOSITION_MODE
"MUL R0.xy, fragment.position, c[0];\n"
"TEX R0, R0, texture[0], 2D;\n"
"MAX R1.x, R0.w, c[1].z;\n"
- "RCP R1.w, R1.x;\n"
- "MUL R1.xyz, R0, R1.w;\n"
- "MUL R4.xyz, -R1, c[1].w;\n"
- "RSQ R2.x, R1.x;\n"
- "RSQ R2.z, R1.z;\n"
- "RSQ R2.y, R1.y;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R3.xyz, R0.w, R2, -R0;\n"
- "MAD R2.xyz, fragment.color.primary, c[1].y, -fragment.color.primary.w;\n"
- "MUL R3.xyz, R2, R3;\n"
+ "RCP R1.x, R1.x;\n"
+ "MUL R2.xyz, R0, R1.x;\n"
+ "MAD R1.xyz, R2, c[2].x, -c[2].y;\n"
+ "MAD R3.xyz, R2, R1, c[2].z;\n"
+ "MAD R1.xyz, fragment.color.primary, c[1].y, -fragment.color.primary.w;\n"
+ "MUL R4.xyz, R0.w, R1;\n"
+ "MUL R5.xyz, R4, R3;\n"
+ "RSQ R1.w, R2.x;\n"
+ "RCP R3.x, R1.w;\n"
+ "RSQ R2.w, R2.z;\n"
+ "RSQ R1.w, R2.y;\n"
+ "MUL R5.xyz, R2, R5;\n"
+ "RCP R3.z, R2.w;\n"
+ "RCP R3.y, R1.w;\n"
+ "ADD R3.xyz, -R2, R3;\n"
+ "MUL R3.xyz, R4, R3;\n"
+ "ADD R2.xyz, -R2, c[1].x;\n"
+ "MAD R1.xyz, R1, R2, fragment.color.primary.w;\n"
+ "MUL R2.xyz, fragment.color.primary, c[1].y;\n"
+ "MAD R4.xyz, fragment.color.primary.w, R0, R5;\n"
"MAD R3.xyz, fragment.color.primary.w, R0, R3;\n"
- "MAD R1.xyz, -R0, R1.w, c[1].x;\n"
- "ADD R5.xyz, R4, c[2].x;\n"
- "MUL R4.xyz, R1, R2;\n"
- "MAD R1.xyz, -R1, R2, fragment.color.primary.w;\n"
- "MAD R5.xyz, -R4, R5, fragment.color.primary.w;\n"
- "MAD R4.xyz, -R0, R5, R3;\n"
+ "ADD R5.xyz, R3, -R4;\n"
"MUL R3.xyz, R0, c[1].w;\n"
- "MUL R2.xyz, fragment.color.primary, c[1].y;\n"
- "MUL R5.xyz, R0, R5;\n"
"SGE R3.xyz, R3, R0.w;\n"
- "MAD R3.xyz, R3, R4, R5;\n"
+ "MAD R3.xyz, R3, R5, R4;\n"
"MAD R3.xyz, -R0, R1, R3;\n"
"MUL R1.xyz, R0, R1;\n"
"SGE R2.xyz, R2, fragment.color.primary.w;\n"
@@ -1457,7 +1459,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"!!ARBfp1.0\n"
"PARAM c[11] = { program.local[0..8],\n"
" { 2, 4, 1, 9.9999997e-006 },\n"
- " { 8, 3 } };\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -1469,53 +1471,55 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R0.xyz, fragment.position.x, c[2], R0;\n"
"ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
- "MUL R1.xy, fragment.position, c[6];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MAX R0.w, R1, c[9];\n"
- "RCP R2.w, R0.w;\n"
- "MUL R5.xyz, R1, R2.w;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"ADD R0.z, R0, R0.w;\n"
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.y, R0.x, c[9].x;\n"
- "MOV R0.x, c[9];\n"
- "RSQ R2.x, R5.x;\n"
- "RSQ R2.z, R5.z;\n"
- "RSQ R2.y, R5.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.z, R0, c[9].y;\n"
- "MAD R0.z, R0.y, R0.y, -R0;\n"
- "MUL R0.w, R0.x, c[1].x;\n"
- "RSQ R0.z, R0.z;\n"
- "RCP R0.x, R0.z;\n"
- "RCP R0.z, R0.w;\n"
- "ADD R0.x, -R0.y, R0;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0.z, c[9];\n"
+ "MUL R0.x, R0, c[9];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[6].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R0.y, -R0.x, R0;\n"
+ "MOV R0.x, c[9];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "MAX R0.z, R1.w, c[9].w;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R3.xyz, R1, R0.z;\n"
+ "MAD R4.xyz, R3, c[10].x, -c[10].y;\n"
+ "RCP R0.x, R0.x;\n"
+ "MUL R0.x, R0.y, R0;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MAD R3.xyz, R0, c[9].x, -R0.w;\n"
- "MAD R6.xyz, -R5, c[10].x, c[10].y;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R3, R2;\n"
- "MAD R4.xyz, R0.w, R1, R2;\n"
- "MAD R2.xyz, -R1, R2.w, c[9].z;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R2.xyz, R0, c[9].x, -R0.w;\n"
+ "MAD R4.xyz, R3, R4, c[10].z;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[9].z;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[9].x;\n"
- "MUL R4.xyz, R1, c[10].x;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "ADD R2.w, -R1, c[9].z;\n"
- "MUL R6.xyz, R1, R6;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
+ "MUL R4.xyz, R1, c[9].y;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
"MUL R2.xyz, R1, R2;\n"
+ "ADD R2.w, -R1, c[9].z;\n"
"MAD R2.xyz, R3, R4, R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"ADD R0.x, -R0.w, c[9].z;\n"
@@ -2060,7 +2064,7 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"!!ARBfp1.0\n"
"PARAM c[8] = { program.local[0..5],\n"
" { 2, 4, 1, 9.9999997e-006 },\n"
- " { 8, 3 } };\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2072,49 +2076,51 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_RADIAL_COMPOSITION_MOD
"MAD R0.xyz, fragment.position.x, c[2], R0;\n"
"ADD R0.xyz, R0, c[4];\n"
"RCP R0.z, R0.z;\n"
- "MUL R1.xy, fragment.position, c[5];\n"
- "TEX R1, R1, texture[0], 2D;\n"
- "MAX R0.w, R1, c[6];\n"
- "RCP R2.w, R0.w;\n"
- "MUL R5.xyz, R1, R2.w;\n"
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.zw, R0.xyxy, R0.xyxy;\n"
"ADD R0.z, R0, R0.w;\n"
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "MUL R0.y, R0.x, c[6].x;\n"
- "MOV R0.x, c[6];\n"
- "RSQ R2.x, R5.x;\n"
- "RSQ R2.z, R5.z;\n"
- "RSQ R2.y, R5.y;\n"
"MUL R0.z, -R0, c[1].x;\n"
- "MUL R0.z, R0, c[6].y;\n"
- "MAD R0.z, R0.y, R0.y, -R0;\n"
- "MUL R0.w, R0.x, c[1].x;\n"
- "RSQ R0.z, R0.z;\n"
- "RCP R0.x, R0.z;\n"
- "RCP R0.z, R0.w;\n"
- "ADD R0.x, -R0.y, R0;\n"
- "MUL R0.x, R0, R0.z;\n"
+ "MUL R0.y, R0.z, c[6];\n"
+ "MUL R0.x, R0, c[6];\n"
+ "MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
+ "TEX R1, R0.zwzw, texture[0], 2D;\n"
+ "MAD R0.y, R0.x, R0.x, -R0;\n"
+ "RSQ R0.y, R0.y;\n"
+ "RCP R0.y, R0.y;\n"
+ "ADD R0.y, -R0.x, R0;\n"
+ "MOV R0.x, c[6];\n"
+ "MUL R0.x, R0, c[1];\n"
+ "MAX R0.z, R1.w, c[6].w;\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R3.xyz, R1, R0.z;\n"
+ "MAD R4.xyz, R3, c[7].x, -c[7].y;\n"
+ "RCP R0.x, R0.x;\n"
+ "MUL R0.x, R0.y, R0;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R3.xyz, R0, c[6].x, -R0.w;\n"
- "MAD R6.xyz, -R5, c[7].x, c[7].y;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R3, R2;\n"
- "MAD R4.xyz, R0.w, R1, R2;\n"
- "MAD R2.xyz, -R1, R2.w, c[6].z;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "MAD R2.xyz, R0, c[6].x, -R0.w;\n"
+ "MAD R4.xyz, R3, R4, c[7].z;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[6].z;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[6].x;\n"
- "MUL R4.xyz, R1, c[7].x;\n"
- "MUL R6.xyz, R1, R6;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
+ "MUL R4.xyz, R1, c[6].y;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
"SGE R3.xyz, R3, R0.w;\n"
@@ -2899,11 +2905,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
- "PARAM c[12] = { program.local[0..7],\n"
+ "PARAM c[13] = { program.local[0..7],\n"
" { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
" { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
" { 3.141593, 0.15915494, 1, 2 },\n"
- " { 9.9999997e-006, 8, 3 } };\n"
+ " { 9.9999997e-006, 4, 16, 12 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -2940,41 +2947,43 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.w, -R0.z, c[10].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
"MUL R0.zw, fragment.position.xyxy, c[5].xyxy;\n"
- "CMP R0.x, -R0.y, -R0, R0;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MAX R0.y, R1.w, c[11].x;\n"
- "RCP R2.w, R0.y;\n"
- "MUL R5.xyz, R1, R2.w;\n"
- "RSQ R2.x, R5.x;\n"
- "RSQ R2.z, R5.z;\n"
- "RSQ R2.y, R5.y;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MAX R0.z, R1.w, c[11].x;\n"
+ "RCP R2.x, R0.z;\n"
+ "MUL R3.xyz, R1, R2.x;\n"
+ "MAD R4.xyz, R3, c[11].z, -c[11].w;\n"
"ADD R0.x, R0, c[0];\n"
"MUL R0.x, R0, c[10].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MAD R3.xyz, R0, c[10].w, -R0.w;\n"
- "MAD R6.xyz, -R5, c[11].y, c[11].z;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R3, R2;\n"
- "MAD R4.xyz, R0.w, R1, R2;\n"
- "MAD R2.xyz, -R1, R2.w, c[10].z;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R2.xyz, R0, c[10].w, -R0.w;\n"
+ "MAD R4.xyz, R3, R4, c[12].x;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[10].z;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[10].w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[11].y;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "ADD R2.w, -R1, c[10].z;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
"MUL R2.xyz, R1, R2;\n"
+ "ADD R2.w, -R1, c[10].z;\n"
"MAD R2.xyz, R3, R4, R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"ADD R0.x, -R0.w, c[10].z;\n"
@@ -3682,11 +3691,12 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
- "PARAM c[9] = { program.local[0..4],\n"
+ "PARAM c[10] = { program.local[0..4],\n"
" { 0.0020000001, -0.01348047, 0.05747731, 0.1212391 },\n"
" { 0.1956359, 0.33299461, 0.99999559, 1.570796 },\n"
" { 3.141593, 0.15915494, 1, 2 },\n"
- " { 9.9999997e-006, 8, 3 } };\n"
+ " { 9.9999997e-006, 4, 16, 12 },\n"
+ " { 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -3723,37 +3733,39 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_CONICAL_COMPOSITION_MO
"ADD R0.w, -R0.z, c[7].x;\n"
"CMP R0.x, R0, R0.w, R0.z;\n"
"MUL R0.zw, fragment.position.xyxy, c[4].xyxy;\n"
- "CMP R0.x, -R0.y, -R0, R0;\n"
"TEX R1, R0.zwzw, texture[0], 2D;\n"
- "MAX R0.y, R1.w, c[8].x;\n"
- "RCP R2.w, R0.y;\n"
- "MUL R5.xyz, R1, R2.w;\n"
- "RSQ R2.x, R5.x;\n"
- "RSQ R2.z, R5.z;\n"
- "RSQ R2.y, R5.y;\n"
+ "CMP R0.x, -R0.y, -R0, R0;\n"
+ "MAX R0.z, R1.w, c[8].x;\n"
+ "RCP R2.x, R0.z;\n"
+ "MUL R3.xyz, R1, R2.x;\n"
+ "MAD R4.xyz, R3, c[8].z, -c[8].w;\n"
"ADD R0.x, R0, c[0];\n"
"MUL R0.x, R0, c[7].y;\n"
"FLR R0.y, R0.x;\n"
"ADD R0.x, R0, -R0.y;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R3.xyz, R0, c[7].w, -R0.w;\n"
- "MAD R6.xyz, -R5, c[8].y, c[8].z;\n"
- "RCP R2.x, R2.x;\n"
- "RCP R2.z, R2.z;\n"
- "RCP R2.y, R2.y;\n"
- "MAD R2.xyz, R1.w, R2, -R1;\n"
- "MUL R2.xyz, R3, R2;\n"
- "MAD R4.xyz, R0.w, R1, R2;\n"
- "MAD R2.xyz, -R1, R2.w, c[7].z;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "MAD R2.xyz, R0, c[7].w, -R0.w;\n"
+ "MAD R4.xyz, R3, R4, c[9].x;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[7].z;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[7].w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
+ "MAD R4.xyz, R0.w, R1, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[8].y;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
"SGE R3.xyz, R3, R0.w;\n"
@@ -4356,8 +4368,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4365,13 +4377,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.w, R1, c[8].z;\n"
- "RCP R2.w, R0.w;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "RSQ R0.w, R2.x;\n"
- "MUL R5.xyz, -R2, c[8].w;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
@@ -4379,32 +4384,40 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "RSQ R0.z, R2.y;\n"
- "RSQ R0.y, R2.z;\n"
- "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
- "RCP R3.x, R0.w;\n"
- "RCP R3.y, R0.z;\n"
- "RCP R3.z, R0.y;\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.z, R1.w, c[8];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R3.xyz, R1, R0.z;\n"
+ "MAD R2.xyz, R3, c[9].x, -c[9].y;\n"
"MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[2], 1D;\n"
- "MAD R4.xyz, R1.w, R3, -R1;\n"
- "MAD R3.xyz, R0, c[8].y, -R0.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[9].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R4.xyz, R3, R2, c[9].z;\n"
+ "MAD R2.xyz, R0, c[8].y, -R0.w;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[8].x;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[8].y;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
"MAD R4.xyz, R0.w, R1, R4;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[8].w;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
"MUL R2.xyz, R1, R2;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
"MAD R2.xyz, R3, R4, R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"ADD R0.x, -R0.w, c[8];\n"
@@ -4815,8 +4828,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -4824,13 +4837,6 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.w, R1, c[5].z;\n"
- "RCP R2.w, R0.w;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "RSQ R0.w, R2.x;\n"
- "MUL R5.xyz, -R2, c[5].w;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
@@ -4838,28 +4844,36 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_LINEAR_COMPOSITION_MOD
"MUL R0.xy, R0, R0.z;\n"
"MUL R0.xy, R0, c[0];\n"
"ADD R0.x, R0, R0.y;\n"
- "RSQ R0.z, R2.y;\n"
- "RSQ R0.y, R2.z;\n"
- "MAD R2.xyz, -R1, R2.w, c[5].x;\n"
- "RCP R3.x, R0.w;\n"
- "RCP R3.y, R0.z;\n"
- "RCP R3.z, R0.y;\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
+ "MAX R0.z, R1.w, c[5];\n"
+ "RCP R0.z, R0.z;\n"
+ "MUL R3.xyz, R1, R0.z;\n"
+ "MAD R2.xyz, R3, c[6].x, -c[6].y;\n"
"MUL R0.x, R0, c[0].z;\n"
"TEX R0, R0, texture[1], 1D;\n"
- "MAD R4.xyz, R1.w, R3, -R1;\n"
- "MAD R3.xyz, R0, c[5].y, -R0.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[6].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R4.xyz, R3, R2, c[6].z;\n"
+ "MAD R2.xyz, R0, c[5].y, -R0.w;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[5].x;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[5].y;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
"MAD R4.xyz, R0.w, R1, R4;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[5].w;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
"SGE R3.xyz, R3, R0.w;\n"
@@ -5333,8 +5347,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5342,44 +5356,45 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.x, R1.w, c[8].z;\n"
- "RCP R2.w, R0.x;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "RSQ R0.w, R2.x;\n"
- "RCP R3.x, R0.w;\n"
- "RSQ R0.w, R2.y;\n"
- "MUL R5.xyz, -R2, c[8].w;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MUL R1.xy, fragment.position, c[5];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "RSQ R0.z, R2.z;\n"
- "MAD R2.xyz, -R1, R2.w, c[8].x;\n"
- "RCP R3.y, R0.w;\n"
- "RCP R3.z, R0.z;\n"
+ "MAX R0.w, R1, c[8].z;\n"
+ "RCP R0.w, R0.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAD R2.xyz, R3, c[9].x, -c[9].y;\n"
"MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[2], 2D;\n"
- "MAD R4.xyz, R1.w, R3, -R1;\n"
- "MAD R3.xyz, R0, c[8].y, -R0.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[9].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R4.xyz, R3, R2, c[9].z;\n"
+ "MAD R2.xyz, R0, c[8].y, -R0.w;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[8].x;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[8].y;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
"MAD R4.xyz, R0.w, R1, R4;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[8].w;\n"
- "SGE R3.xyz, R3, R0.w;\n"
- "ADD R2.w, -R1, c[8].x;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
+ "SGE R3.xyz, R3, R0.w;\n"
"MUL R2.xyz, R1, R2;\n"
+ "ADD R2.w, -R1, c[8].x;\n"
"MAD R2.xyz, R3, R4, R2;\n"
"MAD R2.xyz, R0, R2.w, R2;\n"
"ADD R0.x, -R0.w, c[8];\n"
@@ -5768,8 +5783,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -5777,40 +5792,41 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_TEXTURE_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R1, R0, texture[0], 2D;\n"
- "MAX R0.x, R1.w, c[5].z;\n"
- "RCP R2.w, R0.x;\n"
- "MUL R2.xyz, R1, R2.w;\n"
- "RSQ R0.w, R2.x;\n"
- "RCP R3.x, R0.w;\n"
- "RSQ R0.w, R2.y;\n"
- "MUL R5.xyz, -R2, c[5].w;\n"
"MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MUL R1.xy, fragment.position, c[4];\n"
+ "TEX R1, R1, texture[0], 2D;\n"
"MAD R0.xyz, fragment.position.x, c[1], R0;\n"
"ADD R0.xyz, R0, c[3];\n"
"RCP R0.z, R0.z;\n"
"MUL R0.xy, R0, R0.z;\n"
- "RSQ R0.z, R2.z;\n"
- "MAD R2.xyz, -R1, R2.w, c[5].x;\n"
- "RCP R3.y, R0.w;\n"
- "RCP R3.z, R0.z;\n"
+ "MAX R0.w, R1, c[5].z;\n"
+ "RCP R0.w, R0.w;\n"
+ "MUL R3.xyz, R1, R0.w;\n"
+ "MAD R2.xyz, R3, c[6].x, -c[6].y;\n"
"MUL R0.xy, R0, c[0];\n"
"TEX R0, R0, texture[1], 2D;\n"
- "MAD R4.xyz, R1.w, R3, -R1;\n"
- "MAD R3.xyz, R0, c[5].y, -R0.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[6].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R0.w;\n"
+ "MAD R4.xyz, R3, R2, c[6].z;\n"
+ "MAD R2.xyz, R0, c[5].y, -R0.w;\n"
+ "MUL R5.xyz, R1.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[5].x;\n"
+ "MAD R2.xyz, R2, R3, R0.w;\n"
"MUL R3.xyz, R0, c[5].y;\n"
- "MAD R6.xyz, -R5, R6, R0.w;\n"
+ "MAD R5.xyz, R0.w, R1, R6;\n"
"MAD R4.xyz, R0.w, R1, R4;\n"
- "MAD R5.xyz, -R1, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R1, c[5].w;\n"
- "MUL R6.xyz, R1, R6;\n"
"SGE R4.xyz, R4, R1.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R1, R2, R4;\n"
"MUL R2.xyz, R1, R2;\n"
"SGE R3.xyz, R3, R0.w;\n"
@@ -6295,8 +6311,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT =
"!!ARBfp1.0\n"
"PARAM c[10] = { program.local[0..7],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6304,46 +6320,47 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[5];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.w, R0, c[8].z;\n"
- "RCP R2.w, R1.w;\n"
- "MUL R2.xyz, R0, R2.w;\n"
- "RSQ R1.w, R2.x;\n"
- "MUL R5.xyz, -R2, c[8].w;\n"
- "MUL R1.xyz, fragment.position.y, c[2];\n"
- "MAD R1.xyz, fragment.position.x, c[1], R1;\n"
- "ADD R1.xyz, R1, c[3];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R1.z, R1.z;\n"
"MUL R1.xy, R1, R1.z;\n"
"MUL R1.xy, R1, c[0];\n"
"TEX R1.x, R1, texture[2], 2D;\n"
- "RSQ R1.z, R2.y;\n"
- "RSQ R1.y, R2.z;\n"
- "MAD R2.xyz, -R0, R2.w, c[8].x;\n"
- "RCP R3.x, R1.w;\n"
- "RCP R3.y, R1.z;\n"
- "RCP R3.z, R1.y;\n"
+ "MUL R0.xy, fragment.position, c[5];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.z, R0.w, c[8];\n"
+ "RCP R1.z, R1.z;\n"
+ "MUL R3.xyz, R0, R1.z;\n"
+ "MAD R2.xyz, R3, c[9].x, -c[9].y;\n"
"ADD R1.x, -R1, c[8];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R4.xyz, R0.w, R3, -R0;\n"
- "MAD R3.xyz, R1, c[8].y, -R1.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[9].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R1.w;\n"
+ "MAD R4.xyz, R3, R2, c[9].z;\n"
+ "MAD R2.xyz, R1, c[8].y, -R1.w;\n"
+ "MUL R5.xyz, R0.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[8].x;\n"
+ "MAD R2.xyz, R2, R3, R1.w;\n"
"MUL R3.xyz, R1, c[8].y;\n"
- "MAD R6.xyz, -R5, R6, R1.w;\n"
+ "MAD R5.xyz, R1.w, R0, R6;\n"
"MAD R4.xyz, R1.w, R0, R4;\n"
- "MAD R5.xyz, -R0, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R0, c[8].w;\n"
- "SGE R3.xyz, R3, R1.w;\n"
- "ADD R2.w, -R0, c[8].x;\n"
- "MUL R6.xyz, R0, R6;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R0, R2, R4;\n"
+ "SGE R3.xyz, R3, R1.w;\n"
"MUL R2.xyz, R0, R2;\n"
+ "ADD R2.w, -R0, c[8].x;\n"
"MAD R2.xyz, R3, R4, R2;\n"
"MAD R2.xyz, R1, R2.w, R2;\n"
"ADD R1.x, -R1.w, c[8];\n"
@@ -6755,8 +6772,8 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MODES_SOFTLIGHT_NOMASK =
"!!ARBfp1.0\n"
"PARAM c[7] = { program.local[0..4],\n"
- " { 1, 2, 9.9999997e-006, 8 },\n"
- " { 3 } };\n"
+ " { 1, 2, 9.9999997e-006, 4 },\n"
+ " { 16, 12, 3 } };\n"
"TEMP R0;\n"
"TEMP R1;\n"
"TEMP R2;\n"
@@ -6764,42 +6781,43 @@ static const char *FragmentProgram_FRAGMENT_PROGRAM_BRUSH_PATTERN_COMPOSITION_MO
"TEMP R4;\n"
"TEMP R5;\n"
"TEMP R6;\n"
- "MUL R0.xy, fragment.position, c[4];\n"
- "TEX R0, R0, texture[0], 2D;\n"
- "MAX R1.w, R0, c[5].z;\n"
- "RCP R2.w, R1.w;\n"
- "MUL R2.xyz, R0, R2.w;\n"
- "RSQ R1.w, R2.x;\n"
- "MUL R5.xyz, -R2, c[5].w;\n"
- "MUL R1.xyz, fragment.position.y, c[2];\n"
- "MAD R1.xyz, fragment.position.x, c[1], R1;\n"
- "ADD R1.xyz, R1, c[3];\n"
+ "MUL R0.xyz, fragment.position.y, c[2];\n"
+ "MAD R0.xyz, fragment.position.x, c[1], R0;\n"
+ "ADD R1.xyz, R0, c[3];\n"
"RCP R1.z, R1.z;\n"
"MUL R1.xy, R1, R1.z;\n"
"MUL R1.xy, R1, c[0];\n"
"TEX R1.x, R1, texture[1], 2D;\n"
- "RSQ R1.z, R2.y;\n"
- "RSQ R1.y, R2.z;\n"
- "MAD R2.xyz, -R0, R2.w, c[5].x;\n"
- "RCP R3.x, R1.w;\n"
- "RCP R3.y, R1.z;\n"
- "RCP R3.z, R1.y;\n"
+ "MUL R0.xy, fragment.position, c[4];\n"
+ "TEX R0, R0, texture[0], 2D;\n"
+ "MAX R1.z, R0.w, c[5];\n"
+ "RCP R1.z, R1.z;\n"
+ "MUL R3.xyz, R0, R1.z;\n"
+ "MAD R2.xyz, R3, c[6].x, -c[6].y;\n"
"ADD R1.x, -R1, c[5];\n"
"MUL R1, fragment.color.primary, R1.x;\n"
- "MAD R4.xyz, R0.w, R3, -R0;\n"
- "MAD R3.xyz, R1, c[5].y, -R1.w;\n"
- "MUL R4.xyz, R3, R4;\n"
- "ADD R6.xyz, R5, c[6].x;\n"
- "MUL R5.xyz, R2, R3;\n"
- "MAD R2.xyz, -R2, R3, R1.w;\n"
+ "MAD R4.xyz, R3, R2, c[6].z;\n"
+ "MAD R2.xyz, R1, c[5].y, -R1.w;\n"
+ "MUL R5.xyz, R0.w, R2;\n"
+ "MUL R6.xyz, R5, R4;\n"
+ "RSQ R2.w, R3.x;\n"
+ "RCP R4.x, R2.w;\n"
+ "RSQ R2.w, R3.y;\n"
+ "RSQ R3.w, R3.z;\n"
+ "RCP R4.y, R2.w;\n"
+ "RCP R4.z, R3.w;\n"
+ "ADD R4.xyz, -R3, R4;\n"
+ "MUL R6.xyz, R3, R6;\n"
+ "MUL R4.xyz, R5, R4;\n"
+ "ADD R3.xyz, -R3, c[5].x;\n"
+ "MAD R2.xyz, R2, R3, R1.w;\n"
"MUL R3.xyz, R1, c[5].y;\n"
- "MAD R6.xyz, -R5, R6, R1.w;\n"
+ "MAD R5.xyz, R1.w, R0, R6;\n"
"MAD R4.xyz, R1.w, R0, R4;\n"
- "MAD R5.xyz, -R0, R6, R4;\n"
+ "ADD R6.xyz, R4, -R5;\n"
"MUL R4.xyz, R0, c[5].w;\n"
- "MUL R6.xyz, R0, R6;\n"
"SGE R4.xyz, R4, R0.w;\n"
- "MAD R4.xyz, R4, R5, R6;\n"
+ "MAD R4.xyz, R4, R6, R5;\n"
"MAD R4.xyz, -R0, R2, R4;\n"
"MUL R2.xyz, R0, R2;\n"
"SGE R3.xyz, R3, R1.w;\n"