From 9ef45b3db010817988a83bb33be70a5308c6120a Mon Sep 17 00:00:00 2001 From: Heejin Chung Date: Thu, 9 May 2013 10:16:58 +0900 Subject: [PATCH] Generate error when uniform1iv is called with invalid texture units. [Title] Generate error when uniform1iv is called with invalid texture units [Issue#] TWEB-1129 [Problem] No error is returned when uniform1iv is called with invalid texture units [Cause] DDK doesn't generate error. [Solution] Synthesize INVALID_VALUE error when uniform1iv is called with invalud texture units Change-Id: Iba63a92bdd68619c44fb08b88dbb670b9bdf13a4 --- .../graphics/efl/tizen/GraphicsContext3DInternal.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DInternal.cpp b/Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DInternal.cpp index 0cdd8c4..d242512 100755 --- a/Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DInternal.cpp +++ b/Source/WebCore/platform/graphics/efl/tizen/GraphicsContext3DInternal.cpp @@ -957,6 +957,19 @@ void GraphicsContext3DInternal::uniform1i(GC3Dint location, GC3Dint x) void GraphicsContext3DInternal::uniform1iv(GC3Dint location, GC3Dsizei size, GC3Dint* v) { + /// This is a fix for WebGL conformance test (uniform-samplers-test.html) + // OpenGL spec doesn't define behavior for uniform() with v larger than max texture units. + // However, DDK returns INVALID_VALUE for uniform1i but not for uniform1iv, + // so added that part here. + static int maxTextureUnits = 0; + if (maxTextureUnits == 0) + getIntegerv(GraphicsContext3D::MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxTextureUnits); + + if (*v >= maxTextureUnits) { + synthesizeGLError(GraphicsContext3D::INVALID_VALUE); + return; + } + makeContextCurrent(); GL_CMD(glUniform1iv(location, size, v)); } -- 2.7.4