Commit a4aa05f3 authored by eric@webkit.org's avatar eric@webkit.org
Browse files

2010-04-03 Kenneth Russell <kbr@google.com>

        Reviewed by Darin Fisher.

        Inconsistent failure modes from uniform[Matrix]* with null WebGLUniformLocation
        https://bugs.webkit.org/show_bug.cgi?id=36574

        Fixed bugs in JavaScript bindings for uniform[Matrix]* entry
        points causing them to throw exceptions rather than synthesize GL
        errors. Fixed the implementations to synthesize INVALID_VALUE
        rather than INVALID_OPERATION to comply to the WebGL spec. Updated
        uniform-location-expected.txt to incorporate the correct error.
        Tested in Safari and Chromium.

        * fast/canvas/webgl/null-uniform-location-expected.txt: Added.
        * fast/canvas/webgl/null-uniform-location.html: Added.
        * fast/canvas/webgl/script-tests/null-uniform-location.js: Added.
        (callUniformFunction):
        * fast/canvas/webgl/uniform-location-expected.txt:
2010-04-03  Kenneth Russell  <kbr@google.com>

        Reviewed by Darin Fisher.

        Inconsistent failure modes from uniform[Matrix]* with null WebGLUniformLocation
        https://bugs.webkit.org/show_bug.cgi?id=36574

        Fixed bugs in JavaScript bindings for uniform[Matrix]* entry
        points causing them to throw exceptions rather than synthesize GL
        errors. Fixed the implementations to synthesize INVALID_VALUE
        rather than INVALID_OPERATION to comply to the WebGL spec. Updated
        uniform-location-expected.txt to incorporate the correct error.
        Tested in Safari and Chromium.

        Test: fast/canvas/webgl/null-uniform-location.html

        * bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
        (WebCore::V8WebGLRenderingContext::getUniformCallback):
        (WebCore::vertexAttribAndUniformHelperf):
        (WebCore::uniformHelperi):
        (WebCore::uniformMatrixHelper):
        * html/canvas/WebGLRenderingContext.cpp:
        (WebCore::WebGLRenderingContext::uniform1f):
        (WebCore::WebGLRenderingContext::uniform1fv):
        (WebCore::WebGLRenderingContext::uniform1i):
        (WebCore::WebGLRenderingContext::uniform1iv):
        (WebCore::WebGLRenderingContext::uniform2f):
        (WebCore::WebGLRenderingContext::uniform2fv):
        (WebCore::WebGLRenderingContext::uniform2i):
        (WebCore::WebGLRenderingContext::uniform2iv):
        (WebCore::WebGLRenderingContext::uniform3f):
        (WebCore::WebGLRenderingContext::uniform3fv):
        (WebCore::WebGLRenderingContext::uniform3i):
        (WebCore::WebGLRenderingContext::uniform3iv):
        (WebCore::WebGLRenderingContext::uniform4f):
        (WebCore::WebGLRenderingContext::uniform4fv):
        (WebCore::WebGLRenderingContext::uniform4i):
        (WebCore::WebGLRenderingContext::uniform4iv):
        (WebCore::WebGLRenderingContext::uniformMatrix2fv):
        (WebCore::WebGLRenderingContext::uniformMatrix3fv):
        (WebCore::WebGLRenderingContext::uniformMatrix4fv):

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@57049 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 39f7c329
2010-04-03 Kenneth Russell <kbr@google.com>
Reviewed by Darin Fisher.
Inconsistent failure modes from uniform[Matrix]* with null WebGLUniformLocation
https://bugs.webkit.org/show_bug.cgi?id=36574
Fixed bugs in JavaScript bindings for uniform[Matrix]* entry
points causing them to throw exceptions rather than synthesize GL
errors. Fixed the implementations to synthesize INVALID_VALUE
rather than INVALID_OPERATION to comply to the WebGL spec. Updated
uniform-location-expected.txt to incorporate the correct error.
Tested in Safari and Chromium.
* fast/canvas/webgl/null-uniform-location-expected.txt: Added.
* fast/canvas/webgl/null-uniform-location.html: Added.
* fast/canvas/webgl/script-tests/null-uniform-location.js: Added.
(callUniformFunction):
* fast/canvas/webgl/uniform-location-expected.txt:
2010-04-02 Andy Estes <aestes@apple.com>
 
Reviewed by Adam Barth.
......
Tests calling the various uniform[Matrix]* APIs with a null uniform location
On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
PASS gl.getError() is gl.NO_ERROR
PASS gl.useProgram(program) is undefined.
PASS callUniformFunction('uniform1f') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform1fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform1i') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform1iv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform2f') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform2fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform2i') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform2iv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform3f') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform3fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform3i') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform3iv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform4f') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform4fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform4i') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniform4iv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniformMatrix2fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniformMatrix3fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS callUniformFunction('uniformMatrix4fv') is undefined.
PASS gl.getError() is gl.INVALID_VALUE
PASS successfullyParsed is true
TEST COMPLETE
<html>
<head>
<link rel="stylesheet" href="../../js/resources/js-test-style.css"/>
<script src="../../js/resources/js-test-pre.js"></script>
<script src="resources/webgl-test.js"></script>
</head>
<body>
<div id="description"></div>
<div id="console"></div>
<script src="script-tests/null-uniform-location.js"></script>
<script src="../../js/resources/js-test-post.js"></script>
</body>
</html>
description("Tests calling the various uniform[Matrix]* APIs with a null uniform location");
var gl = create3DContext();
var program = loadStandardProgram(gl);
shouldBe("gl.getError()", "gl.NO_ERROR");
shouldBeUndefined("gl.useProgram(program)");
var floatArray = new WebGLFloatArray([1, 2, 3, 4]);
var intArray = new WebGLIntArray([1, 2, 3, 4]);
function callUniformFunction(name) {
var isArrayVariant = (name.charAt(name.length - 1) == 'v');
var isMatrix = (name.indexOf("Matrix") != -1);
var isFloat =
(name.charAt(name.length - 1) == 'f' ||
name.charAt(name.length - 2) == 'f');
var sizeIndex = (isArrayVariant ? name.length - 3 : name.length - 2);
var size = parseInt(name.substring(sizeIndex, sizeIndex + 1));
// Initialize argument list with null uniform location
var args = [ null ];
if (isArrayVariant) {
// Call variant which takes values as array
if (isMatrix) {
size = size * size;
args.push(false);
}
var array = (isFloat ? new WebGLFloatArray(size) : new WebGLIntArray(size));
for (var i = 0; i < size; i++) {
array[i] = i;
}
args.push(array);
} else {
// Call variant which takes values as parameters
for (var i = 0; i < size; i++) {
args.push(i);
}
}
var func = gl[name];
return func.apply(gl, args);
}
var funcs = [ "uniform1f", "uniform1fv", "uniform1i", "uniform1iv",
"uniform2f", "uniform2fv", "uniform2i", "uniform2iv",
"uniform3f", "uniform3fv", "uniform3i", "uniform3iv",
"uniform4f", "uniform4fv", "uniform4i", "uniform4iv",
"uniformMatrix2fv", "uniformMatrix3fv", "uniformMatrix4fv" ];
for (var i = 0; i < funcs.length; i++) {
callString = "callUniformFunction('" + funcs[i] + "')";
shouldBeUndefined(callString);
shouldBe("gl.getError()", "gl.INVALID_VALUE");
}
successfullyParsed = true;
......@@ -6,7 +6,7 @@ PASS contextA.useProgram(programA2) is undefined.
PASS contextA.uniformMatrix4fv(locationA, false, mat) threw exception GL error 1282 in uniformMatrix4fv.
PASS contextA.useProgram(programA1) is undefined.
PASS contextA.uniformMatrix4fv(locationA, false, mat) is undefined.
PASS contextA.uniformMatrix4fv(0, false, mat) threw exception GL error 1282 in uniformMatrix4fv.
PASS contextA.uniformMatrix4fv(0, false, mat) threw exception GL error 1281 in uniformMatrix4fv.
PASS contextA.useProgram(programS) is undefined.
PASS contextA.uniform1i(locationSx, 3) is undefined.
PASS contextA.uniform1f(locationArray0, 4.0) is undefined.
......
2010-04-03 Kenneth Russell <kbr@google.com>
Reviewed by Darin Fisher.
Inconsistent failure modes from uniform[Matrix]* with null WebGLUniformLocation
https://bugs.webkit.org/show_bug.cgi?id=36574
Fixed bugs in JavaScript bindings for uniform[Matrix]* entry
points causing them to throw exceptions rather than synthesize GL
errors. Fixed the implementations to synthesize INVALID_VALUE
rather than INVALID_OPERATION to comply to the WebGL spec. Updated
uniform-location-expected.txt to incorporate the correct error.
Tested in Safari and Chromium.
Test: fast/canvas/webgl/null-uniform-location.html
* bindings/v8/custom/V8WebGLRenderingContextCustom.cpp:
(WebCore::V8WebGLRenderingContext::getUniformCallback):
(WebCore::vertexAttribAndUniformHelperf):
(WebCore::uniformHelperi):
(WebCore::uniformMatrixHelper):
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::uniform1f):
(WebCore::WebGLRenderingContext::uniform1fv):
(WebCore::WebGLRenderingContext::uniform1i):
(WebCore::WebGLRenderingContext::uniform1iv):
(WebCore::WebGLRenderingContext::uniform2f):
(WebCore::WebGLRenderingContext::uniform2fv):
(WebCore::WebGLRenderingContext::uniform2i):
(WebCore::WebGLRenderingContext::uniform2iv):
(WebCore::WebGLRenderingContext::uniform3f):
(WebCore::WebGLRenderingContext::uniform3fv):
(WebCore::WebGLRenderingContext::uniform3i):
(WebCore::WebGLRenderingContext::uniform3iv):
(WebCore::WebGLRenderingContext::uniform4f):
(WebCore::WebGLRenderingContext::uniform4fv):
(WebCore::WebGLRenderingContext::uniform4i):
(WebCore::WebGLRenderingContext::uniform4iv):
(WebCore::WebGLRenderingContext::uniformMatrix2fv):
(WebCore::WebGLRenderingContext::uniformMatrix3fv):
(WebCore::WebGLRenderingContext::uniformMatrix4fv):
2010-04-02 Andy Estes <aestes@apple.com>
 
Reviewed by Adam Barth.
......@@ -429,10 +429,6 @@ v8::Handle<v8::Value> V8WebGLRenderingContext::getUniformCallback(const v8::Argu
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[1], ok);
if (!ok) {
V8Proxy::setDOMException(SYNTAX_ERR);
return notHandledByInterceptor();
}
WebGLGetInfo info = context->getUniform(program, location, ec);
if (ec) {
V8Proxy::setDOMException(ec);
......@@ -786,10 +782,6 @@ static v8::Handle<v8::Value> vertexAttribAndUniformHelperf(const v8::Arguments&
WebGLRenderingContext* context = V8WebGLRenderingContext::toNative(args.Holder());
if (!ok) {
V8Proxy::setDOMException(SYNTAX_ERR);
return notHandledByInterceptor();
}
if (V8WebGLFloatArray::HasInstance(args[1])) {
WebGLFloatArray* array = V8WebGLFloatArray::toNative(args[1]->ToObject());
ASSERT(array != NULL);
......@@ -862,10 +854,6 @@ static v8::Handle<v8::Value> uniformHelperi(const v8::Arguments& args,
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
if (!ok) {
V8Proxy::setDOMException(SYNTAX_ERR);
return notHandledByInterceptor();
}
if (V8WebGLIntArray::HasInstance(args[1])) {
WebGLIntArray* array = V8WebGLIntArray::toNative(args[1]->ToObject());
ASSERT(array != NULL);
......@@ -979,10 +967,6 @@ static v8::Handle<v8::Value> uniformMatrixHelper(const v8::Arguments& args,
bool ok = false;
WebGLUniformLocation* location = toWebGLUniformLocation(args[0], ok);
if (!ok) {
V8Proxy::setDOMException(SYNTAX_ERR);
return notHandledByInterceptor();
}
bool transpose = args[1]->BooleanValue();
if (V8WebGLFloatArray::HasInstance(args[2])) {
WebGLFloatArray* array = V8WebGLFloatArray::toNative(args[2]->ToObject());
......
......@@ -1843,7 +1843,12 @@ void WebGLRenderingContext::texSubImage2D(unsigned target, unsigned level, unsig
void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, float x, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1855,7 +1860,12 @@ void WebGLRenderingContext::uniform1f(const WebGLUniformLocation* location, floa
void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1871,7 +1881,12 @@ void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1887,7 +1902,12 @@ void WebGLRenderingContext::uniform1fv(const WebGLUniformLocation* location, flo
void WebGLRenderingContext::uniform1i(const WebGLUniformLocation* location, int x, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1899,7 +1919,12 @@ void WebGLRenderingContext::uniform1i(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1915,7 +1940,12 @@ void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1931,7 +1961,12 @@ void WebGLRenderingContext::uniform1iv(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform2f(const WebGLUniformLocation* location, float x, float y, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1943,7 +1978,12 @@ void WebGLRenderingContext::uniform2f(const WebGLUniformLocation* location, floa
void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1960,7 +2000,12 @@ void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1977,7 +2022,12 @@ void WebGLRenderingContext::uniform2fv(const WebGLUniformLocation* location, flo
void WebGLRenderingContext::uniform2i(const WebGLUniformLocation* location, int x, int y, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -1989,7 +2039,12 @@ void WebGLRenderingContext::uniform2i(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2006,7 +2061,12 @@ void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2023,7 +2083,12 @@ void WebGLRenderingContext::uniform2iv(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform3f(const WebGLUniformLocation* location, float x, float y, float z, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2035,7 +2100,12 @@ void WebGLRenderingContext::uniform3f(const WebGLUniformLocation* location, floa
void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2052,7 +2122,12 @@ void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2069,7 +2144,12 @@ void WebGLRenderingContext::uniform3fv(const WebGLUniformLocation* location, flo
void WebGLRenderingContext::uniform3i(const WebGLUniformLocation* location, int x, int y, int z, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2081,7 +2161,12 @@ void WebGLRenderingContext::uniform3i(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2098,7 +2183,12 @@ void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2115,7 +2205,12 @@ void WebGLRenderingContext::uniform3iv(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform4f(const WebGLUniformLocation* location, float x, float y, float z, float w, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2127,7 +2222,12 @@ void WebGLRenderingContext::uniform4f(const WebGLUniformLocation* location, floa
void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, WebGLFloatArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2144,7 +2244,12 @@ void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, float* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2161,7 +2266,12 @@ void WebGLRenderingContext::uniform4fv(const WebGLUniformLocation* location, flo
void WebGLRenderingContext::uniform4i(const WebGLUniformLocation* location, int x, int y, int z, int w, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2173,7 +2283,12 @@ void WebGLRenderingContext::uniform4i(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, WebGLIntArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2190,7 +2305,12 @@ void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, Web
void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, int* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2207,7 +2327,12 @@ void WebGLRenderingContext::uniform4iv(const WebGLUniformLocation* location, int
void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, bool transpose, WebGLFloatArray* v, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2224,7 +2349,12 @@ void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* locatio
void WebGLRenderingContext::uniformMatrix2fv(const WebGLUniformLocation* location, bool transpose, float* v, int size, ExceptionCode& ec)
{
UNUSED_PARAM(ec);
if (!location || location->program() != m_currentProgram) {
if (!location) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_VALUE);
return;
}
if (location->program() != m_currentProgram) {
m_context->synthesizeGLError(GraphicsContext3D::INVALID_OPERATION);
return;
}
......@@ -2241,7 +2371,12 @@ void