aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/gpu/gl/GrGLGpu.cpp
diff options
context:
space:
mode:
authorGravatar cdalton <cdalton@nvidia.com>2016-02-05 16:26:32 -0800
committerGravatar Commit bot <commit-bot@chromium.org>2016-02-05 16:26:32 -0800
commit3a2caf8ecf38124f4ad21a0f6c4dabfcfa17911a (patch)
treeda0c7dc443575dd3888b4e18ec950bd15b5e9189 /src/gpu/gl/GrGLGpu.cpp
parent369e9375a3ab7bb56580fc6b22690a76ad759240 (diff)
Improve GLSL integer support
- Adds shader types for uint. - Adds a cap for integer support. - Uses glVertexAttribIPointer for integer attribs. BUG=skia: GOLD_TRYBOT_URL= https://gold.skia.org/search2?unt=true&query=source_type%3Dgm&master=false&issue=1669853002 Review URL: https://codereview.chromium.org/1669853002
Diffstat (limited to 'src/gpu/gl/GrGLGpu.cpp')
-rw-r--r--src/gpu/gl/GrGLGpu.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/gpu/gl/GrGLGpu.cpp b/src/gpu/gl/GrGLGpu.cpp
index ad85707b3b..e29a7f81f3 100644
--- a/src/gpu/gl/GrGLGpu.cpp
+++ b/src/gpu/gl/GrGLGpu.cpp
@@ -1807,9 +1807,7 @@ void GrGLGpu::setupGeometry(const GrPrimitiveProcessor& primProc,
attribState->set(this,
attribIndex,
vbuf->bufferID(),
- GrGLAttribTypeToLayout(attribType).fCount,
- GrGLAttribTypeToLayout(attribType).fType,
- GrGLAttribTypeToLayout(attribType).fNormalized,
+ attribType,
stride,
reinterpret_cast<GrGLvoid*>(vertexOffsetInBytes + offset));
offset += attrib.fOffset;
@@ -2588,7 +2586,7 @@ void GrGLGpu::stampRectUsingProgram(GrGLuint program, const SkRect& bounds, GrGL
GrGLAttribArrayState* attribs =
this->fHWGeometryState.bindArrayAndBufferToDraw(this, arrayBuffer);
- attribs->set(this, 0, arrayBuffer, 2, GR_GL_FLOAT, false, 2 * sizeof(GrGLfloat), 0);
+ attribs->set(this, 0, arrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat), 0);
attribs->disableUnusedArrays(this, 0x1);
GL_CALL(Uniform4f(posXformUniform, bounds.width(), bounds.height(), bounds.left(),
@@ -3529,7 +3527,8 @@ void GrGLGpu::drawDebugWireRect(GrRenderTarget* rt, const SkIRect& rect, GrColor
GrGLAttribArrayState* attribs =
fHWGeometryState.bindArrayAndBufferToDraw(this, fWireRectArrayBuffer);
- attribs->set(this, 0, fWireRectArrayBuffer, 2, GR_GL_FLOAT, false, 2 * sizeof(GrGLfloat), 0);
+ attribs->set(this, 0, fWireRectArrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat),
+ 0);
attribs->disableUnusedArrays(this, 0x1);
GL_CALL(Uniform4fv(fWireRectProgram.fRectUniform, 1, edges));
@@ -3574,7 +3573,8 @@ void GrGLGpu::copySurfaceAsDraw(GrSurface* dst,
GrGLAttribArrayState* attribs =
fHWGeometryState.bindArrayAndBufferToDraw(this, fCopyProgramArrayBuffer);
- attribs->set(this, 0, fCopyProgramArrayBuffer, 2, GR_GL_FLOAT, false, 2 * sizeof(GrGLfloat), 0);
+ attribs->set(this, 0, fCopyProgramArrayBuffer, kVec2f_GrVertexAttribType, 2 * sizeof(GrGLfloat),
+ 0);
attribs->disableUnusedArrays(this, 0x1);
// dst rect edges in NDC (-1 to 1)