Changeset 264371 in webkit


Ignore:
Timestamp:
Jul 14, 2020 12:59:01 PM (4 years ago)
Author:
commit-queue@webkit.org
Message:

Implement uniform* and getUniform for WebGL 2 types
https://bugs.webkit.org/show_bug.cgi?id=214116

Patch by James Darpinian <James Darpinian> on 2020-07-14
Reviewed by Dean Jackson.

Passes all relevant WebGL conformance tests.

  • html/canvas/WebGL2RenderingContext.cpp:

(WebCore::WebGL2RenderingContext::getFragDataLocation):
(WebCore::WebGL2RenderingContext::uniform1ui):
(WebCore::WebGL2RenderingContext::uniform2ui):
(WebCore::WebGL2RenderingContext::uniform3ui):
(WebCore::WebGL2RenderingContext::uniform4ui):
(WebCore::WebGL2RenderingContext::uniform1uiv):
(WebCore::WebGL2RenderingContext::uniform2uiv):
(WebCore::WebGL2RenderingContext::uniform3uiv):
(WebCore::WebGL2RenderingContext::uniform4uiv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
(WebCore::WebGL2RenderingContext::uniform1fv):
(WebCore::WebGL2RenderingContext::uniform2fv):
(WebCore::WebGL2RenderingContext::uniform3fv):
(WebCore::WebGL2RenderingContext::uniform4fv):
(WebCore::WebGL2RenderingContext::uniform1iv):
(WebCore::WebGL2RenderingContext::uniform2iv):
(WebCore::WebGL2RenderingContext::uniform3iv):
(WebCore::WebGL2RenderingContext::uniform4iv):
(WebCore::WebGL2RenderingContext::uniformMatrix2fv):
(WebCore::WebGL2RenderingContext::uniformMatrix3fv):
(WebCore::WebGL2RenderingContext::uniformMatrix4fv):

  • html/canvas/WebGLRenderingContextBase.cpp:

(WebCore::WebGLRenderingContextBase::getUniform):
(WebCore::WebGLRenderingContextBase::uniform1fv):
(WebCore::WebGLRenderingContextBase::uniform2fv):
(WebCore::WebGLRenderingContextBase::uniform3fv):
(WebCore::WebGLRenderingContextBase::uniform4fv):
(WebCore::WebGLRenderingContextBase::uniform1iv):
(WebCore::WebGLRenderingContextBase::uniform2iv):
(WebCore::WebGLRenderingContextBase::uniform3iv):
(WebCore::WebGLRenderingContextBase::uniform4iv):
(WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
(WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
(WebCore::WebGLRenderingContextBase::validateUniformParameters):
(WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):

  • html/canvas/WebGLRenderingContextBase.h:
  • platform/graphics/GraphicsContextGL.h:
  • platform/graphics/angle/GraphicsContextGLANGLE.cpp:

(WebCore::GraphicsContextGLOpenGL::getUniformuiv):
(WebCore::GraphicsContextGLOpenGL::getFragDataLocation):
(WebCore::GraphicsContextGLOpenGL::uniform1ui):
(WebCore::GraphicsContextGLOpenGL::uniform2ui):
(WebCore::GraphicsContextGLOpenGL::uniform3ui):
(WebCore::GraphicsContextGLOpenGL::uniform4ui):
(WebCore::GraphicsContextGLOpenGL::uniform1uiv):
(WebCore::GraphicsContextGLOpenGL::uniform2uiv):
(WebCore::GraphicsContextGLOpenGL::uniform3uiv):
(WebCore::GraphicsContextGLOpenGL::uniform4uiv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv):
(WebCore::GraphicsContextGLOpenGL::uniform1fv):
(WebCore::GraphicsContextGLOpenGL::uniform2fv):
(WebCore::GraphicsContextGLOpenGL::uniform3fv):
(WebCore::GraphicsContextGLOpenGL::uniform4fv):
(WebCore::GraphicsContextGLOpenGL::uniform1iv):
(WebCore::GraphicsContextGLOpenGL::uniform2iv):
(WebCore::GraphicsContextGLOpenGL::uniform3iv):
(WebCore::GraphicsContextGLOpenGL::uniform4iv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv):
(WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv):

  • platform/graphics/opengl/GraphicsContextGLOpenGL.h:
  • platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:

(WebCore::GraphicsContextGLOpenGL::getUniformuiv):

Location:
trunk
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/webgl/2.0.0/conformance2/glsl3/unary-minus-operator-in-dynamic-loop-expected.txt

    r235913 r264371  
    22
    33Test: ../../resources/webgl_test_files/conformance2/glsl3/unary-minus-operator-in-dynamic-loop.html
    4 [ 1: PASS ] square should be green
    5 [ 2: FAIL ] square should be green at (138, 0) expected: 0,255,0,255 was 255,0,0,255
    6 [ 3: PASS ] square should be green
    7 [ 4: FAIL ] square should be green at (414, 0) expected: 0,255,0,255 was 255,0,0,255
    8 [ 5: PASS ] square should be green
    9 [ 6: FAIL ] square should be green at (690, 0) expected: 0,255,0,255 was 255,0,0,255
    10 [ 7: PASS ] successfullyParsed is true
    11 [ FAIL ] 3 failures reported
     4[ PASS ] All tests passed
    125
  • trunk/LayoutTests/webgl/2.0.0/conformance2/programs/gl-get-frag-data-location-expected.txt

    r236236 r264371  
    22
    33Test: ../../resources/webgl_test_files/conformance2/programs/gl-get-frag-data-location.html
    4 [ 1: PASS ] WebGL context exists
    5 [ 2: PASS ] getError was expected value: NO_ERROR : No GL error from set up
    6 [ 3: FAIL ] Fail to query scalar output variable locations, expected: fragColor0->2, fragColor1->0, got: fragColor0->0, fragColor1->0
    7 [ 4: FAIL ] Fail to query scalar output variable locations, expected: fragColor->0, fragColor[0]->0, fragColor[1]->1, got: fragColor->0, fragColor[0]->0, fragColor[1]->0
    8 [ 5: PASS ] getError was expected value: NO_ERROR : No GL error from testing
    9 [ 6: PASS ] successfullyParsed is true
    10 [ FAIL ] 2 failures reported
     4[ PASS ] All tests passed
    115
  • trunk/LayoutTests/webgl/2.0.0/conformance2/state/gl-object-get-calls-expected.txt

    r263999 r264371  
    244244[ 240: PASS ] gl.getProgramParameter(uintProgram, gl.LINK_STATUS) is true
    245245[ 241: PASS ] getError was expected value: NO_ERROR :
    246 [ 242: FAIL ] gl.getUniform(uintProgram, uvalLoc) should be 1 (of type number). Was null (of type object).
    247 [ 243: FAIL ] gl.getUniform(uintProgram, uval2Loc) should be 2,3. Was null.
    248 [ 244: FAIL ] gl.getUniform(uintProgram, uval3Loc) should be 4,5,6. Was null.
    249 [ 245: FAIL ] gl.getUniform(uintProgram, uval4Loc) should be 7,8,9,10. Was null.
    250 [ 246: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE :
     246[ 242: PASS ] gl.getUniform(uintProgram, uvalLoc) is 1
     247[ 243: PASS ] gl.getUniform(uintProgram, uval2Loc) is [2, 3]
     248[ 244: PASS ] gl.getUniform(uintProgram, uval3Loc) is [4, 5, 6]
     249[ 245: PASS ] gl.getUniform(uintProgram, uval4Loc) is [7, 8, 9, 10]
     250[ 246: PASS ] getError was expected value: NO_ERROR :
    251251[ 247: PASS ] getError was expected value: NO_ERROR :
    252252[ 248: PASS ] gl.getProgramParameter(matForWebGL2Program, gl.LINK_STATUS) is true
    253253[ 249: PASS ] getError was expected value: NO_ERROR :
    254 [ 250: FAIL ] gl.getUniform(matForWebGL2Program, mval2x3Loc) should be 1,2,3,4,5,6. Was null.
    255 [ 251: FAIL ] gl.getUniform(matForWebGL2Program, mval2x4Loc) should be 7,8,9,10,11,12,13,14. Was null.
    256 [ 252: FAIL ] gl.getUniform(matForWebGL2Program, mval3x2Loc) should be 15,16,17,18,19,20. Was null.
    257 [ 253: FAIL ] gl.getUniform(matForWebGL2Program, mval3x4Loc) should be 21,22,23,24,25,26,27,28,29,30,31,32. Was null.
    258 [ 254: FAIL ] gl.getUniform(matForWebGL2Program, mval4x2Loc) should be 33,34,35,36,37,38,39,40. Was null.
    259 [ 255: FAIL ] gl.getUniform(matForWebGL2Program, mval4x3Loc) should be 41,42,43,44,45,46,47,48,49,50,51,52. Was null.
    260 [ 256: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE :
     254[ 250: PASS ] gl.getUniform(matForWebGL2Program, mval2x3Loc) is [1, 2, 3, 4, 5, 6]
     255[ 251: PASS ] gl.getUniform(matForWebGL2Program, mval2x4Loc) is [7, 8, 9, 10, 11, 12, 13, 14]
     256[ 252: PASS ] gl.getUniform(matForWebGL2Program, mval3x2Loc) is [15, 16, 17, 18, 19, 20]
     257[ 253: PASS ] gl.getUniform(matForWebGL2Program, mval3x4Loc) is [21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32]
     258[ 254: PASS ] gl.getUniform(matForWebGL2Program, mval4x2Loc) is [33, 34, 35, 36, 37, 38, 39, 40]
     259[ 255: PASS ] gl.getUniform(matForWebGL2Program, mval4x3Loc) is [41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52]
     260[ 256: PASS ] getError was expected value: NO_ERROR :
    261261[ 257: PASS ] gl.getProgramParameter(samplerForWebGL2Program, gl.LINK_STATUS) is true
    262262[ 258: PASS ] getError was expected value: NO_ERROR :
    263 [ 259: FAIL ] gl.getUniform(samplerForWebGL2Program, s3DValLoc) should be 0 (of type number). Was null (of type object).
    264 [ 260: FAIL ] gl.getUniform(samplerForWebGL2Program, s2DArrayValLoc) should be 1 (of type number). Was null (of type object).
    265 [ 261: FAIL ] getError expected: NO_ERROR. Was INVALID_VALUE :
     263[ 259: PASS ] gl.getUniform(samplerForWebGL2Program, s3DValLoc) is 0
     264[ 260: PASS ] gl.getUniform(samplerForWebGL2Program, s2DArrayValLoc) is 1
     265[ 261: PASS ] getError was expected value: NO_ERROR :
    266266[ 262: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_BUFFER_BINDING) is buffer
    267267[ 263: PASS ] gl.getVertexAttrib(1, gl.VERTEX_ATTRIB_ARRAY_ENABLED) is true
     
    312312[ 308: FAIL ] gl.getSyncParameter(sync, gl.OBJECT_TYPE) should be 37142. Threw exception TypeError: Argument 1 ('sync') to WebGL2RenderingContext.getSyncParameter must be an instance of WebGLSync
    313313[ 309: FAIL ] successfullyParsed should be true (of type boolean). Was undefined (of type undefined).
    314 [ FAIL ] 54 failures reported
     314[ FAIL ] 39 failures reported
    315315
  • trunk/Source/WebCore/ChangeLog

    r264370 r264371  
     12020-07-14  James Darpinian  <jdarpinian@chromium.org>
     2
     3        Implement uniform* and getUniform for WebGL 2 types
     4        https://bugs.webkit.org/show_bug.cgi?id=214116
     5
     6        Reviewed by Dean Jackson.
     7
     8        Passes all relevant WebGL conformance tests.
     9
     10        * html/canvas/WebGL2RenderingContext.cpp:
     11        (WebCore::WebGL2RenderingContext::getFragDataLocation):
     12        (WebCore::WebGL2RenderingContext::uniform1ui):
     13        (WebCore::WebGL2RenderingContext::uniform2ui):
     14        (WebCore::WebGL2RenderingContext::uniform3ui):
     15        (WebCore::WebGL2RenderingContext::uniform4ui):
     16        (WebCore::WebGL2RenderingContext::uniform1uiv):
     17        (WebCore::WebGL2RenderingContext::uniform2uiv):
     18        (WebCore::WebGL2RenderingContext::uniform3uiv):
     19        (WebCore::WebGL2RenderingContext::uniform4uiv):
     20        (WebCore::WebGL2RenderingContext::uniformMatrix2x3fv):
     21        (WebCore::WebGL2RenderingContext::uniformMatrix3x2fv):
     22        (WebCore::WebGL2RenderingContext::uniformMatrix2x4fv):
     23        (WebCore::WebGL2RenderingContext::uniformMatrix4x2fv):
     24        (WebCore::WebGL2RenderingContext::uniformMatrix3x4fv):
     25        (WebCore::WebGL2RenderingContext::uniformMatrix4x3fv):
     26        (WebCore::WebGL2RenderingContext::uniform1fv):
     27        (WebCore::WebGL2RenderingContext::uniform2fv):
     28        (WebCore::WebGL2RenderingContext::uniform3fv):
     29        (WebCore::WebGL2RenderingContext::uniform4fv):
     30        (WebCore::WebGL2RenderingContext::uniform1iv):
     31        (WebCore::WebGL2RenderingContext::uniform2iv):
     32        (WebCore::WebGL2RenderingContext::uniform3iv):
     33        (WebCore::WebGL2RenderingContext::uniform4iv):
     34        (WebCore::WebGL2RenderingContext::uniformMatrix2fv):
     35        (WebCore::WebGL2RenderingContext::uniformMatrix3fv):
     36        (WebCore::WebGL2RenderingContext::uniformMatrix4fv):
     37        * html/canvas/WebGLRenderingContextBase.cpp:
     38        (WebCore::WebGLRenderingContextBase::getUniform):
     39        (WebCore::WebGLRenderingContextBase::uniform1fv):
     40        (WebCore::WebGLRenderingContextBase::uniform2fv):
     41        (WebCore::WebGLRenderingContextBase::uniform3fv):
     42        (WebCore::WebGLRenderingContextBase::uniform4fv):
     43        (WebCore::WebGLRenderingContextBase::uniform1iv):
     44        (WebCore::WebGLRenderingContextBase::uniform2iv):
     45        (WebCore::WebGLRenderingContextBase::uniform3iv):
     46        (WebCore::WebGLRenderingContextBase::uniform4iv):
     47        (WebCore::WebGLRenderingContextBase::uniformMatrix2fv):
     48        (WebCore::WebGLRenderingContextBase::uniformMatrix3fv):
     49        (WebCore::WebGLRenderingContextBase::uniformMatrix4fv):
     50        (WebCore::WebGLRenderingContextBase::validateUniformParameters):
     51        (WebCore::WebGLRenderingContextBase::validateUniformMatrixParameters):
     52        * html/canvas/WebGLRenderingContextBase.h:
     53        * platform/graphics/GraphicsContextGL.h:
     54        * platform/graphics/angle/GraphicsContextGLANGLE.cpp:
     55        (WebCore::GraphicsContextGLOpenGL::getUniformuiv):
     56        (WebCore::GraphicsContextGLOpenGL::getFragDataLocation):
     57        (WebCore::GraphicsContextGLOpenGL::uniform1ui):
     58        (WebCore::GraphicsContextGLOpenGL::uniform2ui):
     59        (WebCore::GraphicsContextGLOpenGL::uniform3ui):
     60        (WebCore::GraphicsContextGLOpenGL::uniform4ui):
     61        (WebCore::GraphicsContextGLOpenGL::uniform1uiv):
     62        (WebCore::GraphicsContextGLOpenGL::uniform2uiv):
     63        (WebCore::GraphicsContextGLOpenGL::uniform3uiv):
     64        (WebCore::GraphicsContextGLOpenGL::uniform4uiv):
     65        (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x3fv):
     66        (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x2fv):
     67        (WebCore::GraphicsContextGLOpenGL::uniformMatrix2x4fv):
     68        (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x2fv):
     69        (WebCore::GraphicsContextGLOpenGL::uniformMatrix3x4fv):
     70        (WebCore::GraphicsContextGLOpenGL::uniformMatrix4x3fv):
     71        (WebCore::GraphicsContextGLOpenGL::uniform1fv):
     72        (WebCore::GraphicsContextGLOpenGL::uniform2fv):
     73        (WebCore::GraphicsContextGLOpenGL::uniform3fv):
     74        (WebCore::GraphicsContextGLOpenGL::uniform4fv):
     75        (WebCore::GraphicsContextGLOpenGL::uniform1iv):
     76        (WebCore::GraphicsContextGLOpenGL::uniform2iv):
     77        (WebCore::GraphicsContextGLOpenGL::uniform3iv):
     78        (WebCore::GraphicsContextGLOpenGL::uniform4iv):
     79        (WebCore::GraphicsContextGLOpenGL::uniformMatrix2fv):
     80        (WebCore::GraphicsContextGLOpenGL::uniformMatrix3fv):
     81        (WebCore::GraphicsContextGLOpenGL::uniformMatrix4fv):
     82        * platform/graphics/opengl/GraphicsContextGLOpenGL.h:
     83        * platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp:
     84        (WebCore::GraphicsContextGLOpenGL::getUniformuiv):
     85
    1862020-07-14  Per Arne Vollan  <pvollan@apple.com>
    287
  • trunk/Source/WebCore/html/canvas/WebGL2RenderingContext.cpp

    r263999 r264371  
    12721272}
    12731273
    1274 GCGLint WebGL2RenderingContext::getFragDataLocation(WebGLProgram&, const String&)
    1275 {
    1276     LOG(WebGL, "[[ NOT IMPLEMENTED ]] getFragDataLocation()");
    1277     return 0;
    1278 }
    1279 
    1280 void WebGL2RenderingContext::uniform1ui(WebGLUniformLocation*, GCGLuint)
    1281 {
    1282     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform1ui()");
    1283 }
    1284 
    1285 void WebGL2RenderingContext::uniform2ui(WebGLUniformLocation*, GCGLuint, GCGLuint)
    1286 {
    1287     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform2ui()");
    1288 }
    1289 
    1290 void WebGL2RenderingContext::uniform3ui(WebGLUniformLocation*, GCGLuint, GCGLuint, GCGLuint)
    1291 {
    1292     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform3ui()");
    1293 }
    1294 
    1295 void WebGL2RenderingContext::uniform4ui(WebGLUniformLocation*, GCGLuint, GCGLuint, GCGLuint, GCGLuint)
    1296 {
    1297     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform4ui()");
    1298 }
    1299 
    1300 void WebGL2RenderingContext::uniform1uiv(WebGLUniformLocation*, Uint32List&&, GCGLuint, GCGLuint)
    1301 {
    1302     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform1uiv()");
    1303 }
    1304 
    1305 void WebGL2RenderingContext::uniform2uiv(WebGLUniformLocation*, Uint32List&&, GCGLuint, GCGLuint)
    1306 {
    1307     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform2uiv()");
    1308 }
    1309 
    1310 void WebGL2RenderingContext::uniform3uiv(WebGLUniformLocation*, Uint32List&&, GCGLuint, GCGLuint)
    1311 {
    1312     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform3uiv()");
    1313 }
    1314 
    1315 void WebGL2RenderingContext::uniform4uiv(WebGLUniformLocation*, Uint32List&&, GCGLuint, GCGLuint)
    1316 {
    1317     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform4uiv()");
    1318 }
    1319 
    1320 void WebGL2RenderingContext::uniformMatrix2x3fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1321 {
    1322     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix2x3fv()");
    1323 }
    1324 
    1325 void WebGL2RenderingContext::uniformMatrix3x2fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1326 {
    1327     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix3x2fv()");
    1328 }
    1329 
    1330 void WebGL2RenderingContext::uniformMatrix2x4fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1331 {
    1332     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix2x4fv()");
    1333 }
    1334 
    1335 void WebGL2RenderingContext::uniformMatrix4x2fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1336 {
    1337     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix4x2fv()");
    1338 }
    1339 
    1340 void WebGL2RenderingContext::uniformMatrix3x4fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1341 {
    1342     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix3x4fv()");
    1343 }
    1344 
    1345 void WebGL2RenderingContext::uniformMatrix4x3fv(WebGLUniformLocation*, GCGLboolean, Float32List&&, GCGLuint, GCGLuint)
    1346 {
    1347     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix4x3fv()");
     1274GCGLint WebGL2RenderingContext::getFragDataLocation(WebGLProgram& program, const String& name)
     1275{
     1276    if (isContextLostOrPending() || !validateWebGLObject("getFragDataLocation", &program))
     1277        return -1;
     1278    return m_context->getFragDataLocation(program.object(), name);
     1279}
     1280
     1281void WebGL2RenderingContext::uniform1ui(WebGLUniformLocation* location, GCGLuint v0)
     1282{
     1283    if (isContextLostOrPending() || !validateUniformLocation("uniform1ui", location))
     1284        return;
     1285    m_context->uniform1ui(location->location(), v0);
     1286}
     1287
     1288void WebGL2RenderingContext::uniform2ui(WebGLUniformLocation* location, GCGLuint v0, GCGLuint v1)
     1289{
     1290    if (isContextLostOrPending() || !validateUniformLocation("uniform2ui", location))
     1291        return;
     1292    m_context->uniform2ui(location->location(), v0, v1);
     1293}
     1294
     1295void WebGL2RenderingContext::uniform3ui(WebGLUniformLocation* location, GCGLuint v0, GCGLuint v1, GCGLuint v2)
     1296{
     1297    if (isContextLostOrPending() || !validateUniformLocation("uniform3ui", location))
     1298        return;
     1299    m_context->uniform3ui(location->location(), v0, v1, v2);
     1300}
     1301
     1302void WebGL2RenderingContext::uniform4ui(WebGLUniformLocation* location, GCGLuint v0, GCGLuint v1, GCGLuint v2, GCGLuint v3)
     1303{
     1304    if (isContextLostOrPending() || !validateUniformLocation("uniform4ui", location))
     1305        return;
     1306    m_context->uniform4ui(location->location(), v0, v1, v2, v3);
     1307}
     1308
     1309void WebGL2RenderingContext::uniform1uiv(WebGLUniformLocation* location, Uint32List&& value, GCGLuint srcOffset, GCGLuint srcLength)
     1310{
     1311    if (isContextLostOrPending() || !validateUniformParameters("uniform1uiv", location, value, 1, srcOffset, srcLength))
     1312        return;
     1313    m_context->uniform1uiv(location->location(), value.data(), srcOffset, srcLength ? srcLength : (value.length() - srcOffset));
     1314}
     1315
     1316void WebGL2RenderingContext::uniform2uiv(WebGLUniformLocation* location, Uint32List&& value, GCGLuint srcOffset, GCGLuint srcLength)
     1317{
     1318    if (isContextLostOrPending() || !validateUniformParameters("uniform2uiv", location, value, 2, srcOffset, srcLength))
     1319        return;
     1320    m_context->uniform2uiv(location->location(), value.data(), srcOffset, srcLength ? srcLength : (value.length() - srcOffset) / 2);
     1321}
     1322
     1323void WebGL2RenderingContext::uniform3uiv(WebGLUniformLocation* location, Uint32List&& value, GCGLuint srcOffset, GCGLuint srcLength)
     1324{
     1325    if (isContextLostOrPending() || !validateUniformParameters("uniform3uiv", location, value, 3, srcOffset, srcLength))
     1326        return;
     1327    m_context->uniform3uiv(location->location(), value.data(), srcOffset, srcLength ? srcLength : (value.length() - srcOffset) / 3);
     1328}
     1329
     1330void WebGL2RenderingContext::uniform4uiv(WebGLUniformLocation* location, Uint32List&& value, GCGLuint srcOffset, GCGLuint srcLength)
     1331{
     1332    if (isContextLostOrPending() || !validateUniformParameters("uniform4uiv", location, value, 4, srcOffset, srcLength))
     1333        return;
     1334    m_context->uniform4uiv(location->location(), value.data(), srcOffset, srcLength ? srcLength : (value.length() - srcOffset) / 4);
     1335}
     1336
     1337void WebGL2RenderingContext::uniformMatrix2x3fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1338{
     1339    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix2x3fv", location, transpose, v, 6, srcOffset, srcLength))
     1340        return;
     1341    m_context->uniformMatrix2x3fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 6);
     1342}
     1343
     1344void WebGL2RenderingContext::uniformMatrix3x2fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1345{
     1346    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix3x2fv", location, transpose, v, 6, srcOffset, srcLength))
     1347        return;
     1348    m_context->uniformMatrix3x2fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 6);
     1349}
     1350
     1351void WebGL2RenderingContext::uniformMatrix2x4fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1352{
     1353    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix2x4fv", location, transpose, v, 8, srcOffset, srcLength))
     1354        return;
     1355    m_context->uniformMatrix2x4fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 8);
     1356}
     1357
     1358void WebGL2RenderingContext::uniformMatrix4x2fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1359{
     1360    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix4x2fv", location, transpose, v, 8, srcOffset, srcLength))
     1361        return;
     1362    m_context->uniformMatrix4x2fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 8);
     1363}
     1364
     1365void WebGL2RenderingContext::uniformMatrix3x4fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1366{
     1367    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix3x4fv", location, transpose, v, 12, srcOffset, srcLength))
     1368        return;
     1369    m_context->uniformMatrix3x4fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 12);
     1370}
     1371
     1372void WebGL2RenderingContext::uniformMatrix4x3fv(WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v, GCGLuint srcOffset, GCGLuint srcLength)
     1373{
     1374    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix4x3fv", location, transpose, v, 12, srcOffset, srcLength))
     1375        return;
     1376    m_context->uniformMatrix4x3fv(location->location(), transpose, v.data(), srcOffset, srcLength ? srcLength : (v.length() - srcOffset) / 12);
    13481377}
    13491378
     
    29823011void WebGL2RenderingContext::uniform1fv(WebGLUniformLocation* location, Float32List data, GLuint srcOffset, GLuint srcLength)
    29833012{
    2984     UNUSED_PARAM(location);
    2985     UNUSED_PARAM(data);
    2986     UNUSED_PARAM(srcOffset);
    2987     UNUSED_PARAM(srcLength);
    2988 
    2989     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform1fv()");
     3013    if (isContextLostOrPending() || !validateUniformParameters("uniform1fv", location, data, 1, srcOffset, srcLength))
     3014        return;
     3015    m_context->uniform1fv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset));
    29903016}
    29913017
    29923018void WebGL2RenderingContext::uniform2fv(WebGLUniformLocation* location, Float32List data, GLuint srcOffset, GLuint srcLength)
    29933019{
    2994     UNUSED_PARAM(location);
    2995     UNUSED_PARAM(data);
    2996     UNUSED_PARAM(srcOffset);
    2997     UNUSED_PARAM(srcLength);
    2998 
    2999     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform2fv()");
     3020    if (isContextLostOrPending() || !validateUniformParameters("uniform2fv", location, data, 2, srcOffset, srcLength))
     3021        return;
     3022    m_context->uniform2fv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 2);
    30003023}
    30013024
    30023025void WebGL2RenderingContext::uniform3fv(WebGLUniformLocation* location, Float32List data, GLuint srcOffset, GLuint srcLength)
    30033026{
    3004     UNUSED_PARAM(location);
    3005     UNUSED_PARAM(data);
    3006     UNUSED_PARAM(srcOffset);
    3007     UNUSED_PARAM(srcLength);
    3008 
    3009     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform3fv()");
     3027    if (isContextLostOrPending() || !validateUniformParameters("uniform3fv", location, data, 3, srcOffset, srcLength))
     3028        return;
     3029    m_context->uniform3fv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 3);
    30103030}
    30113031
    30123032void WebGL2RenderingContext::uniform4fv(WebGLUniformLocation* location, Float32List data, GLuint srcOffset, GLuint srcLength)
    30133033{
    3014     UNUSED_PARAM(location);
    3015     UNUSED_PARAM(data);
    3016     UNUSED_PARAM(srcOffset);
    3017     UNUSED_PARAM(srcLength);
    3018 
    3019     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform4fv()");
     3034    if (isContextLostOrPending() || !validateUniformParameters("uniform4fv", location, data, 4, srcOffset, srcLength))
     3035        return;
     3036    m_context->uniform4fv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 4);
    30203037}
    30213038
    30223039void WebGL2RenderingContext::uniform1iv(WebGLUniformLocation* location, Int32List data, GLuint srcOffset, GLuint srcLength)
    30233040{
    3024     UNUSED_PARAM(location);
    3025     UNUSED_PARAM(data);
    3026     UNUSED_PARAM(srcOffset);
    3027     UNUSED_PARAM(srcLength);
    3028 
    3029     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform1iv()");
     3041    if (isContextLostOrPending() || !validateUniformParameters("uniform1iv", location, data, 1, srcOffset, srcLength))
     3042        return;
     3043    m_context->uniform1iv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset));
    30303044}
    30313045
    30323046void WebGL2RenderingContext::uniform2iv(WebGLUniformLocation* location, Int32List data, GLuint srcOffset, GLuint srcLength)
    30333047{
    3034     UNUSED_PARAM(location);
    3035     UNUSED_PARAM(data);
    3036     UNUSED_PARAM(srcOffset);
    3037     UNUSED_PARAM(srcLength);
    3038 
    3039     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform2iv()");
     3048    if (isContextLostOrPending() || !validateUniformParameters("uniform2iv", location, data, 2, srcOffset, srcLength))
     3049        return;
     3050    m_context->uniform2iv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 2);
    30403051}
    30413052
    30423053void WebGL2RenderingContext::uniform3iv(WebGLUniformLocation* location, Int32List data, GLuint srcOffset, GLuint srcLength)
    30433054{
    3044     UNUSED_PARAM(location);
    3045     UNUSED_PARAM(data);
    3046     UNUSED_PARAM(srcOffset);
    3047     UNUSED_PARAM(srcLength);
    3048 
    3049     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform3iv()");
     3055    if (isContextLostOrPending() || !validateUniformParameters("uniform3iv", location, data, 3, srcOffset, srcLength))
     3056        return;
     3057    m_context->uniform3iv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 3);
    30503058}
    30513059
    30523060void WebGL2RenderingContext::uniform4iv(WebGLUniformLocation* location, Int32List data, GLuint srcOffset, GLuint srcLength)
    30533061{
    3054     UNUSED_PARAM(location);
    3055     UNUSED_PARAM(data);
    3056     UNUSED_PARAM(srcOffset);
    3057     UNUSED_PARAM(srcLength);
    3058 
    3059     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniform4iv()");
     3062    if (isContextLostOrPending() || !validateUniformParameters("uniform4iv", location, data, 4, srcOffset, srcLength))
     3063        return;
     3064    m_context->uniform4iv(location->location(), data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / 4);
    30603065}
    30613066
    30623067void WebGL2RenderingContext::uniformMatrix2fv(WebGLUniformLocation* location, GLboolean transpose, Float32List data, GLuint srcOffset, GLuint srcLength)
    30633068{
    3064     UNUSED_PARAM(location);
    3065     UNUSED_PARAM(transpose);
    3066     UNUSED_PARAM(data);
    3067     UNUSED_PARAM(srcOffset);
    3068     UNUSED_PARAM(srcLength);
    3069 
    3070     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix2fv()");
     3069    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, data, 2*2, srcOffset, srcLength))
     3070        return;
     3071    m_context->uniformMatrix2fv(location->location(), transpose, data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / (2*2));
    30713072}
    30723073
    30733074void WebGL2RenderingContext::uniformMatrix3fv(WebGLUniformLocation* location, GLboolean transpose, Float32List data, GLuint srcOffset, GLuint srcLength)
    30743075{
    3075     UNUSED_PARAM(location);
    3076     UNUSED_PARAM(transpose);
    3077     UNUSED_PARAM(data);
    3078     UNUSED_PARAM(srcOffset);
    3079     UNUSED_PARAM(srcLength);
    3080 
    3081     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix3fv()");
     3076    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, data, 3*3, srcOffset, srcLength))
     3077        return;
     3078    m_context->uniformMatrix3fv(location->location(), transpose, data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / (3*3));
    30823079}
    30833080
    30843081void WebGL2RenderingContext::uniformMatrix4fv(WebGLUniformLocation* location, GLboolean transpose, Float32List data, GLuint srcOffset, GLuint srcLength)
    30853082{
    3086     UNUSED_PARAM(location);
    3087     UNUSED_PARAM(transpose);
    3088     UNUSED_PARAM(data);
    3089     UNUSED_PARAM(srcOffset);
    3090     UNUSED_PARAM(srcLength);
    3091 
    3092     LOG(WebGL, "[[ NOT IMPLEMENTED ]] uniformMatrix4fv()");
     3083    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, data, 4*4, srcOffset, srcLength))
     3084        return;
     3085    m_context->uniformMatrix4fv(location->location(), transpose, data.data(), srcOffset, srcLength ? srcLength : (data.length() - srcOffset) / (4*4));
    30933086}
    30943087
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.cpp

    r263281 r264371  
    34063406        break;
    34073407    default:
    3408         // Can't handle this type
    3409         synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getUniform", "unhandled type");
    3410         return nullptr;
     3408        if (!isWebGL2()) {
     3409            // Can't handle this type.
     3410            synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getUniform", "unhandled type");
     3411            return nullptr;
     3412        }
     3413        switch (uniformLocation->type()) {
     3414        case GraphicsContextGL::UNSIGNED_INT:
     3415            baseType = GraphicsContextGL::UNSIGNED_INT;
     3416            length = 1;
     3417            break;
     3418        case GraphicsContextGL::UNSIGNED_INT_VEC2:
     3419            baseType = GraphicsContextGL::UNSIGNED_INT;
     3420            length = 2;
     3421            break;
     3422        case GraphicsContextGL::UNSIGNED_INT_VEC3:
     3423            baseType = GraphicsContextGL::UNSIGNED_INT;
     3424            length = 3;
     3425            break;
     3426        case GraphicsContextGL::UNSIGNED_INT_VEC4:
     3427            baseType = GraphicsContextGL::UNSIGNED_INT;
     3428            length = 4;
     3429            break;
     3430        case GraphicsContextGL::FLOAT_MAT2x3:
     3431            baseType = GraphicsContextGL::FLOAT;
     3432            length = 6;
     3433            break;
     3434        case GraphicsContextGL::FLOAT_MAT2x4:
     3435            baseType = GraphicsContextGL::FLOAT;
     3436            length = 8;
     3437            break;
     3438        case GraphicsContextGL::FLOAT_MAT3x2:
     3439            baseType = GraphicsContextGL::FLOAT;
     3440            length = 6;
     3441            break;
     3442        case GraphicsContextGL::FLOAT_MAT3x4:
     3443            baseType = GraphicsContextGL::FLOAT;
     3444            length = 12;
     3445            break;
     3446        case GraphicsContextGL::FLOAT_MAT4x2:
     3447            baseType = GraphicsContextGL::FLOAT;
     3448            length = 8;
     3449            break;
     3450        case GraphicsContextGL::FLOAT_MAT4x3:
     3451            baseType = GraphicsContextGL::FLOAT;
     3452            length = 12;
     3453            break;
     3454        case GraphicsContextGL::SAMPLER_3D:
     3455        case GraphicsContextGL::SAMPLER_2D_ARRAY:
     3456        case GraphicsContextGL::SAMPLER_2D_SHADOW:
     3457        case GraphicsContextGL::SAMPLER_CUBE_SHADOW:
     3458        case GraphicsContextGL::SAMPLER_2D_ARRAY_SHADOW:
     3459        case GraphicsContextGL::INT_SAMPLER_2D:
     3460        case GraphicsContextGL::INT_SAMPLER_CUBE:
     3461        case GraphicsContextGL::INT_SAMPLER_3D:
     3462        case GraphicsContextGL::INT_SAMPLER_2D_ARRAY:
     3463        case GraphicsContextGL::UNSIGNED_INT_SAMPLER_2D:
     3464        case GraphicsContextGL::UNSIGNED_INT_SAMPLER_CUBE:
     3465        case GraphicsContextGL::UNSIGNED_INT_SAMPLER_3D:
     3466        case GraphicsContextGL::UNSIGNED_INT_SAMPLER_2D_ARRAY:
     3467            baseType = GraphicsContextGL::INT;
     3468            length = 1;
     3469            break;
     3470        default:
     3471            // Can't handle this type.
     3472            synthesizeGLError(GraphicsContextGL::INVALID_VALUE, "getUniform", "unhandled type");
     3473            return nullptr;
     3474        }
    34113475    }
    34123476    switch (baseType) {
     
    34303494            return value[0];
    34313495        return Int32Array::tryCreate(value, length);
     3496    }
     3497    case GraphicsContextGL::UNSIGNED_INT: {
     3498        GCGLuint value[4] = {0};
     3499        m_context->getUniformuiv(objectOrZero(program), location, value);
     3500        if (length == 1)
     3501            return value[0];
     3502        return Uint32Array::tryCreate(value, length);
    34323503    }
    34333504    case GraphicsContextGL::BOOL: {
     
    55065577}
    55075578
     5579bool WebGLRenderingContextBase::validateUniformLocation(const char* functionName, const WebGLUniformLocation* location)
     5580{
     5581    if (!location)
     5582        return false;
     5583    if (location->program() != m_currentProgram) {
     5584        synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "location not for current program");
     5585        return false;
     5586    }
     5587    return true;
     5588}
     5589
    55085590void WebGLRenderingContextBase::uniform1f(const WebGLUniformLocation* location, GCGLfloat x)
    55095591{
    5510     if (isContextLostOrPending() || !location)
    5511         return;
    5512 
    5513     if (location->program() != m_currentProgram) {
    5514         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform1f", "location not for current program");
    5515         return;
    5516     }
     5592    if (isContextLostOrPending() || !validateUniformLocation("uniform1f", location))
     5593        return;
    55175594
    55185595    m_context->uniform1f(location->location(), x);
     
    55215598void WebGLRenderingContextBase::uniform2f(const WebGLUniformLocation* location, GCGLfloat x, GCGLfloat y)
    55225599{
    5523     if (isContextLostOrPending() || !location)
    5524         return;
    5525 
    5526     if (location->program() != m_currentProgram) {
    5527         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform2f", "location not for current program");
    5528         return;
    5529     }
     5600    if (isContextLostOrPending() || !validateUniformLocation("uniform2f", location))
     5601        return;
    55305602
    55315603    m_context->uniform2f(location->location(), x, y);
     
    55345606void WebGLRenderingContextBase::uniform3f(const WebGLUniformLocation* location, GCGLfloat x, GCGLfloat y, GCGLfloat z)
    55355607{
    5536     if (isContextLostOrPending() || !location)
    5537         return;
    5538 
    5539     if (location->program() != m_currentProgram) {
    5540         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform3f", "location not for current program");
    5541         return;
    5542     }
     5608    if (isContextLostOrPending() || !validateUniformLocation("uniform3f", location))
     5609        return;
    55435610
    55445611    m_context->uniform3f(location->location(), x, y, z);
     
    55475614void WebGLRenderingContextBase::uniform4f(const WebGLUniformLocation* location, GCGLfloat x, GCGLfloat y, GCGLfloat z, GCGLfloat w)
    55485615{
    5549     if (isContextLostOrPending() || !location)
    5550         return;
    5551 
    5552     if (location->program() != m_currentProgram) {
    5553         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform4f", "location not for current program");
    5554         return;
    5555     }
     5616    if (isContextLostOrPending() || !validateUniformLocation("uniform4f", location))
     5617        return;
    55565618
    55575619    m_context->uniform4f(location->location(), x, y, z, w);
     
    55605622void WebGLRenderingContextBase::uniform1i(const WebGLUniformLocation* location, GCGLint x)
    55615623{
    5562     if (isContextLostOrPending() || !location)
    5563         return;
    5564 
    5565     if (location->program() != m_currentProgram) {
    5566         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform1i", "location not for current program");
    5567         return;
    5568     }
     5624    if (isContextLostOrPending() || !validateUniformLocation("uniform1i", location))
     5625        return;
    55695626
    55705627    if ((location->type() == GraphicsContextGL::SAMPLER_2D || location->type() == GraphicsContextGL::SAMPLER_CUBE) && x >= (int)m_textureUnits.size()) {
     
    55785635void WebGLRenderingContextBase::uniform2i(const WebGLUniformLocation* location, GCGLint x, GCGLint y)
    55795636{
    5580     if (isContextLostOrPending() || !location)
    5581         return;
    5582 
    5583     if (location->program() != m_currentProgram) {
    5584         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform2i", "location not for current program");
    5585         return;
    5586     }
     5637    if (isContextLostOrPending() || !validateUniformLocation("uniform2i", location))
     5638        return;
    55875639
    55885640    m_context->uniform2i(location->location(), x, y);
     
    55915643void WebGLRenderingContextBase::uniform3i(const WebGLUniformLocation* location, GCGLint x, GCGLint y, GCGLint z)
    55925644{
    5593     if (isContextLostOrPending() || !location)
    5594         return;
    5595 
    5596     if (location->program() != m_currentProgram) {
    5597         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform3i", "location not for current program");
    5598         return;
    5599     }
     5645    if (isContextLostOrPending() || !validateUniformLocation("uniform3i", location))
     5646        return;
    56005647
    56015648    m_context->uniform3i(location->location(), x, y, z);
     
    56045651void WebGLRenderingContextBase::uniform4i(const WebGLUniformLocation* location, GCGLint x, GCGLint y, GCGLint z, GCGLint w)
    56055652{
    5606     if (isContextLostOrPending() || !location)
    5607         return;
    5608 
    5609     if (location->program() != m_currentProgram) {
    5610         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, "uniform4i", "location not for current program");
    5611         return;
    5612     }
     5653    if (isContextLostOrPending() || !validateUniformLocation("uniform4i", location))
     5654        return;
    56135655
    56145656    m_context->uniform4i(location->location(), x, y, z, w);
     
    56175659void WebGLRenderingContextBase::uniform1fv(const WebGLUniformLocation* location, Float32List&& v)
    56185660{
    5619     if (isContextLostOrPending() || !validateUniformParameters("uniform1fv", location, v, 1))
     5661    if (isContextLostOrPending() || !validateUniformParameters("uniform1fv", location, v, 1, 0, v.length()))
    56205662        return;
    56215663
     
    56255667void WebGLRenderingContextBase::uniform2fv(const WebGLUniformLocation* location, Float32List&& v)
    56265668{
    5627     if (isContextLostOrPending() || !validateUniformParameters("uniform2fv", location, v, 2))
     5669    if (isContextLostOrPending() || !validateUniformParameters("uniform2fv", location, v, 2, 0, v.length()))
    56285670        return;
    56295671
     
    56335675void WebGLRenderingContextBase::uniform3fv(const WebGLUniformLocation* location, Float32List&& v)
    56345676{
    5635     if (isContextLostOrPending() || !validateUniformParameters("uniform3fv", location, v, 3))
     5677    if (isContextLostOrPending() || !validateUniformParameters("uniform3fv", location, v, 3, 0, v.length()))
    56365678        return;
    56375679
     
    56415683void WebGLRenderingContextBase::uniform4fv(const WebGLUniformLocation* location, Float32List&& v)
    56425684{
    5643     if (isContextLostOrPending() || !validateUniformParameters("uniform4fv", location, v, 4))
     5685    if (isContextLostOrPending() || !validateUniformParameters("uniform4fv", location, v, 4, 0, v.length()))
    56445686        return;
    56455687
     
    56495691void WebGLRenderingContextBase::uniform1iv(const WebGLUniformLocation* location, Int32List&& v)
    56505692{
    5651     if (isContextLostOrPending() || !validateUniformParameters("uniform1iv", location, v, 1))
     5693    if (isContextLostOrPending() || !validateUniformParameters("uniform1iv", location, v, 1, 0, v.length()))
    56525694        return;
    56535695
     
    56705712void WebGLRenderingContextBase::uniform2iv(const WebGLUniformLocation* location, Int32List&& v)
    56715713{
    5672     if (isContextLostOrPending() || !validateUniformParameters("uniform2iv", location, v, 2))
     5714    if (isContextLostOrPending() || !validateUniformParameters("uniform2iv", location, v, 2, 0, v.length()))
    56735715        return;
    56745716
     
    56785720void WebGLRenderingContextBase::uniform3iv(const WebGLUniformLocation* location, Int32List&& v)
    56795721{
    5680     if (isContextLostOrPending() || !validateUniformParameters("uniform3iv", location, v, 3))
     5722    if (isContextLostOrPending() || !validateUniformParameters("uniform3iv", location, v, 3, 0, v.length()))
    56815723        return;
    56825724
     
    56865728void WebGLRenderingContextBase::uniform4iv(const WebGLUniformLocation* location, Int32List&& v)
    56875729{
    5688     if (isContextLostOrPending() || !validateUniformParameters("uniform4iv", location, v, 4))
     5730    if (isContextLostOrPending() || !validateUniformParameters("uniform4iv", location, v, 4, 0, v.length()))
    56895731        return;
    56905732
     
    56945736void WebGLRenderingContextBase::uniformMatrix2fv(const WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v)
    56955737{
    5696     if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, 4))
     5738    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix2fv", location, transpose, v, 4, 0, v.length()))
    56975739        return;
    56985740    m_context->uniformMatrix2fv(location->location(), v.length() / 4, transpose, v.data());
     
    57015743void WebGLRenderingContextBase::uniformMatrix3fv(const WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v)
    57025744{
    5703     if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, 9))
     5745    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix3fv", location, transpose, v, 9, 0, v.length()))
    57045746        return;
    57055747    m_context->uniformMatrix3fv(location->location(), v.length() / 9, transpose, v.data());
     
    57085750void WebGLRenderingContextBase::uniformMatrix4fv(const WebGLUniformLocation* location, GCGLboolean transpose, Float32List&& v)
    57095751{
    5710     if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, 16))
     5752    if (isContextLostOrPending() || !validateUniformMatrixParameters("uniformMatrix4fv", location, transpose, v, 16, 0, v.length()))
    57115753        return;
    57125754    m_context->uniformMatrix4fv(location->location(), v.length() / 16, transpose, v.data());
     
    67766818}
    67776819
    6778 bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, const Float32List& v, GCGLsizei requiredMinSize)
    6779 {
    6780     return validateUniformMatrixParameters(functionName, location, false, v.data(), v.length(), requiredMinSize);
    6781 }
    6782 
    6783 bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, const Int32List& v, GCGLsizei requiredMinSize)
    6784 {
    6785     return validateUniformMatrixParameters(functionName, location, false, v.data(), v.length(), requiredMinSize);
    6786 }
    6787 
    6788 bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, void* v, GCGLsizei size, GCGLsizei requiredMinSize)
    6789 {
    6790     return validateUniformMatrixParameters(functionName, location, false, v, size, requiredMinSize);
    6791 }
    6792 
    6793 bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GCGLboolean transpose, const Float32List& v, GCGLsizei requiredMinSize)
    6794 {
    6795     return validateUniformMatrixParameters(functionName, location, transpose, v.data(), v.length(), requiredMinSize);
    6796 }
    6797 
    6798 bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GCGLboolean transpose, const void* v, GCGLsizei size, GCGLsizei requiredMinSize)
    6799 {
    6800     if (!location)
    6801         return false;
    6802     if (location->program() != m_currentProgram) {
    6803         synthesizeGLError(GraphicsContextGL::INVALID_OPERATION, functionName, "location is not from current program");
    6804         return false;
    6805     }
     6820bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, const Float32List& v, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6821{
     6822    return validateUniformMatrixParameters(functionName, location, false, v.data(), v.length(), requiredMinSize, srcOffset, srcLength);
     6823}
     6824
     6825bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, const Int32List& v, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6826{
     6827    return validateUniformMatrixParameters(functionName, location, false, v.data(), v.length(), requiredMinSize, srcOffset, srcLength);
     6828}
     6829
     6830bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, const Uint32List& v, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6831{
     6832    return validateUniformMatrixParameters(functionName, location, false, v.data(), v.length(), requiredMinSize, srcOffset, srcLength);
     6833}
     6834
     6835bool WebGLRenderingContextBase::validateUniformParameters(const char* functionName, const WebGLUniformLocation* location, void* v, GCGLsizei size, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6836{
     6837    return validateUniformMatrixParameters(functionName, location, false, v, size, requiredMinSize, srcOffset, srcLength);
     6838}
     6839
     6840bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GCGLboolean transpose, const Float32List& v, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6841{
     6842    return validateUniformMatrixParameters(functionName, location, transpose, v.data(), v.length(), requiredMinSize, srcOffset, srcLength);
     6843}
     6844
     6845bool WebGLRenderingContextBase::validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation* location, GCGLboolean transpose, const void* v, GCGLsizei size, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength)
     6846{
     6847    if (!validateUniformLocation(functionName, location))
     6848        return false;
    68066849    if (!v) {
    68076850        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "no array");
    68086851        return false;
    68096852    }
    6810     if (transpose) {
     6853    if (transpose && !isWebGL2()) {
    68116854        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "transpose not FALSE");
    68126855        return false;
    68136856    }
    6814     if (size < requiredMinSize || (size % requiredMinSize)) {
     6857    if (srcOffset >= static_cast<GCGLuint>(size)) {
     6858        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "invalid srcOffset");
     6859        return false;
     6860    }
     6861    GCGLsizei actualSize = size - srcOffset;
     6862    if (srcLength > 0) {
     6863        if (srcLength > static_cast<GCGLuint>(actualSize)) {
     6864            synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "invalid srcOffset + srcLength");
     6865            return false;
     6866        }
     6867        actualSize = srcLength;
     6868    }
     6869    if (actualSize < requiredMinSize || (actualSize % requiredMinSize)) {
    68156870        synthesizeGLError(GraphicsContextGL::INVALID_VALUE, functionName, "invalid size");
    68166871        return false;
  • trunk/Source/WebCore/html/canvas/WebGLRenderingContextBase.h

    r263281 r264371  
    302302    using Float32List = TypedList<Float32Array, float>;
    303303    using Int32List = TypedList<Int32Array, int>;
     304    using Uint32List = TypedList<Uint32Array, uint32_t>;
    304305
    305306    void uniform1f(const WebGLUniformLocation*, GCGLfloat x);
     
    950951
    951952    // Helper function to validate input parameters for uniform functions.
    952     bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, const Float32List&, GCGLsizei mod);
    953     bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, const Int32List&, GCGLsizei mod);
    954     bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, void*, GCGLsizei, GCGLsizei mod);
    955     bool validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation*, GCGLboolean transpose, const Float32List&, GCGLsizei mod);
    956     bool validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation*, GCGLboolean transpose, const void*, GCGLsizei, GCGLsizei mod);
     953    bool validateUniformLocation(const char* functionName, const WebGLUniformLocation*);
     954    bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, const Float32List&, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
     955    bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, const Int32List&, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
     956    bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, const Uint32List&, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
     957    bool validateUniformParameters(const char* functionName, const WebGLUniformLocation*, void*, GCGLsizei, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
     958    bool validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation*, GCGLboolean transpose, const Float32List&, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
     959    bool validateUniformMatrixParameters(const char* functionName, const WebGLUniformLocation*, GCGLboolean transpose, const void*, GCGLsizei, GCGLsizei requiredMinSize, GCGLuint srcOffset, GCGLuint srcLength);
    957960
    958961    // Helper function to validate parameters for bufferData.
  • trunk/Source/WebCore/platform/graphics/GraphicsContextGL.h

    r263281 r264371  
    10241024    virtual void getUniformfv(PlatformGLObject program, GCGLint location, GCGLfloat* value) = 0;
    10251025    virtual void getUniformiv(PlatformGLObject program, GCGLint location, GCGLint* value) = 0;
     1026    virtual void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value) = 0;
    10261027
    10271028    virtual GCGLint getUniformLocation(PlatformGLObject, const String& name) = 0;
  • trunk/Source/WebCore/platform/graphics/angle/GraphicsContextGLANGLE.cpp

    r263999 r264371  
    17101710}
    17111711
     1712void GraphicsContextGLOpenGL::getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value)
     1713{
     1714    makeContextCurrent();
     1715    gl::GetUniformuiv(program, location, value);
     1716}
     1717
    17121718GCGLint GraphicsContextGLOpenGL::getUniformLocation(PlatformGLObject program, const String& name)
    17131719{
     
    22872293GCGLint GraphicsContextGLOpenGL::getFragDataLocation(PlatformGLObject program, const String& name)
    22882294{
    2289     UNUSED_PARAM(program);
    2290     UNUSED_PARAM(name);
    2291 
    2292     return 0;
     2295    makeContextCurrent();
     2296    return gl::GetFragDataLocation(program, name.utf8().data());
    22932297}
    22942298
    22952299void GraphicsContextGLOpenGL::uniform1ui(GCGLint location, GCGLuint v0)
    22962300{
    2297     UNUSED_PARAM(location);
    2298     UNUSED_PARAM(v0);
     2301    makeContextCurrent();
     2302    gl::Uniform1ui(location, v0);
    22992303}
    23002304
    23012305void GraphicsContextGLOpenGL::uniform2ui(GCGLint location, GCGLuint v0, GCGLuint v1)
    23022306{
    2303     UNUSED_PARAM(location);
    2304     UNUSED_PARAM(v0);
    2305     UNUSED_PARAM(v1);
     2307    makeContextCurrent();
     2308    gl::Uniform2ui(location, v0, v1);
    23062309}
    23072310
    23082311void GraphicsContextGLOpenGL::uniform3ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2)
    23092312{
    2310     UNUSED_PARAM(location);
    2311     UNUSED_PARAM(v0);
    2312     UNUSED_PARAM(v1);
    2313     UNUSED_PARAM(v2);
     2313    makeContextCurrent();
     2314    gl::Uniform3ui(location, v0, v1, v2);
    23142315}
    23152316
    23162317void GraphicsContextGLOpenGL::uniform4ui(GCGLint location, GCGLuint v0, GCGLuint v1, GCGLuint v2, GCGLuint v3)
    23172318{
    2318     UNUSED_PARAM(location);
    2319     UNUSED_PARAM(v0);
    2320     UNUSED_PARAM(v1);
    2321     UNUSED_PARAM(v2);
    2322     UNUSED_PARAM(v3);
     2319    makeContextCurrent();
     2320    gl::Uniform4ui(location, v0, v1, v2, v3);
    23232321}
    23242322
    23252323void GraphicsContextGLOpenGL::uniform1uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength)
    23262324{
    2327     UNUSED_PARAM(location);
    2328     UNUSED_PARAM(data);
    2329     UNUSED_PARAM(srcOffset);
    2330     UNUSED_PARAM(srcLength);
     2325    makeContextCurrent();
     2326    gl::Uniform1uiv(location, srcLength, data + srcOffset);
    23312327}
    23322328
    23332329void GraphicsContextGLOpenGL::uniform2uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength)
    23342330{
    2335     UNUSED_PARAM(location);
    2336     UNUSED_PARAM(data);
    2337     UNUSED_PARAM(srcOffset);
    2338     UNUSED_PARAM(srcLength);
     2331    makeContextCurrent();
     2332    gl::Uniform2uiv(location, srcLength, data + srcOffset);
    23392333}
    23402334
    23412335void GraphicsContextGLOpenGL::uniform3uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength)
    23422336{
    2343     UNUSED_PARAM(location);
    2344     UNUSED_PARAM(data);
    2345     UNUSED_PARAM(srcOffset);
    2346     UNUSED_PARAM(srcLength);
     2337    makeContextCurrent();
     2338    gl::Uniform3uiv(location, srcLength, data + srcOffset);
    23472339}
    23482340
    23492341void GraphicsContextGLOpenGL::uniform4uiv(GCGLint location, const GCGLuint* data, GCGLuint srcOffset, GCGLuint srcLength)
    23502342{
    2351     UNUSED_PARAM(location);
    2352     UNUSED_PARAM(data);
    2353     UNUSED_PARAM(srcOffset);
    2354     UNUSED_PARAM(srcLength);
     2343    makeContextCurrent();
     2344    gl::Uniform4uiv(location, srcLength, data + srcOffset);
    23552345}
    23562346
    23572347void GraphicsContextGLOpenGL::uniformMatrix2x3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    23582348{
    2359     UNUSED_PARAM(location);
    2360     UNUSED_PARAM(transpose);
    2361     UNUSED_PARAM(data);
    2362     UNUSED_PARAM(srcOffset);
    2363     UNUSED_PARAM(srcLength);
     2349    makeContextCurrent();
     2350    gl::UniformMatrix2x3fv(location, srcLength, transpose, data + srcOffset);
    23642351}
    23652352
    23662353void GraphicsContextGLOpenGL::uniformMatrix3x2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    23672354{
    2368     UNUSED_PARAM(location);
    2369     UNUSED_PARAM(transpose);
    2370     UNUSED_PARAM(data);
    2371     UNUSED_PARAM(srcOffset);
    2372     UNUSED_PARAM(srcLength);
     2355    makeContextCurrent();
     2356    gl::UniformMatrix3x2fv(location, srcLength, transpose, data + srcOffset);
    23732357}
    23742358
    23752359void GraphicsContextGLOpenGL::uniformMatrix2x4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    23762360{
    2377     UNUSED_PARAM(location);
    2378     UNUSED_PARAM(transpose);
    2379     UNUSED_PARAM(data);
    2380     UNUSED_PARAM(srcOffset);
    2381     UNUSED_PARAM(srcLength);
     2361    makeContextCurrent();
     2362    gl::UniformMatrix2x4fv(location, srcLength, transpose, data + srcOffset);
    23822363}
    23832364
    23842365void GraphicsContextGLOpenGL::uniformMatrix4x2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    23852366{
    2386     UNUSED_PARAM(location);
    2387     UNUSED_PARAM(transpose);
    2388     UNUSED_PARAM(data);
    2389     UNUSED_PARAM(srcOffset);
    2390     UNUSED_PARAM(srcLength);
     2367    makeContextCurrent();
     2368    gl::UniformMatrix4x2fv(location, srcLength, transpose, data + srcOffset);
    23912369}
    23922370
    23932371void GraphicsContextGLOpenGL::uniformMatrix3x4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    23942372{
    2395     UNUSED_PARAM(location);
    2396     UNUSED_PARAM(transpose);
    2397     UNUSED_PARAM(data);
    2398     UNUSED_PARAM(srcOffset);
    2399     UNUSED_PARAM(srcLength);
     2373    makeContextCurrent();
     2374    gl::UniformMatrix3x4fv(location, srcLength, transpose, data + srcOffset);
    24002375}
    24012376
    24022377void GraphicsContextGLOpenGL::uniformMatrix4x3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    24032378{
    2404     UNUSED_PARAM(location);
    2405     UNUSED_PARAM(transpose);
    2406     UNUSED_PARAM(data);
    2407     UNUSED_PARAM(srcOffset);
    2408     UNUSED_PARAM(srcLength);
     2379    makeContextCurrent();
     2380    gl::UniformMatrix4x3fv(location, srcLength, transpose, data + srcOffset);
    24092381}
    24102382
     
    27052677void GraphicsContextGLOpenGL::uniform1fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27062678{
    2707     UNUSED_PARAM(location);
    2708     UNUSED_PARAM(data);
    2709     UNUSED_PARAM(srcOffset);
    2710     UNUSED_PARAM(srcLength);
     2679    makeContextCurrent();
     2680    gl::Uniform1fv(location, srcLength, data + srcOffset);
    27112681}
    27122682
    27132683void GraphicsContextGLOpenGL::uniform2fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27142684{
    2715     UNUSED_PARAM(location);
    2716     UNUSED_PARAM(data);
    2717     UNUSED_PARAM(srcOffset);
    2718     UNUSED_PARAM(srcLength);
     2685    makeContextCurrent();
     2686    gl::Uniform2fv(location, srcLength, data + srcOffset);
    27192687}
    27202688
    27212689void GraphicsContextGLOpenGL::uniform3fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27222690{
    2723     UNUSED_PARAM(location);
    2724     UNUSED_PARAM(data);
    2725     UNUSED_PARAM(srcOffset);
    2726     UNUSED_PARAM(srcLength);
     2691    makeContextCurrent();
     2692    gl::Uniform3fv(location, srcLength, data + srcOffset);
    27272693}
    27282694
    27292695void GraphicsContextGLOpenGL::uniform4fv(GCGLint location, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27302696{
    2731     UNUSED_PARAM(location);
    2732     UNUSED_PARAM(data);
    2733     UNUSED_PARAM(srcOffset);
    2734     UNUSED_PARAM(srcLength);
     2697    makeContextCurrent();
     2698    gl::Uniform4fv(location, srcLength, data + srcOffset);
    27352699}
    27362700
    27372701void GraphicsContextGLOpenGL::uniform1iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength)
    27382702{
    2739     UNUSED_PARAM(location);
    2740     UNUSED_PARAM(data);
    2741     UNUSED_PARAM(srcOffset);
    2742     UNUSED_PARAM(srcLength);
     2703    makeContextCurrent();
     2704    gl::Uniform1iv(location, srcLength, data + srcOffset);
    27432705}
    27442706
    27452707void GraphicsContextGLOpenGL::uniform2iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength)
    27462708{
    2747     UNUSED_PARAM(location);
    2748     UNUSED_PARAM(data);
    2749     UNUSED_PARAM(srcOffset);
    2750     UNUSED_PARAM(srcLength);
     2709    makeContextCurrent();
     2710    gl::Uniform2iv(location, srcLength, data + srcOffset);
    27512711}
    27522712
    27532713void GraphicsContextGLOpenGL::uniform3iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength)
    27542714{
    2755     UNUSED_PARAM(location);
    2756     UNUSED_PARAM(data);
    2757     UNUSED_PARAM(srcOffset);
    2758     UNUSED_PARAM(srcLength);
     2715    makeContextCurrent();
     2716    gl::Uniform3iv(location, srcLength, data + srcOffset);
    27592717}
    27602718
    27612719void GraphicsContextGLOpenGL::uniform4iv(GCGLint location, const GCGLint* data, GCGLuint srcOffset, GCGLuint srcLength)
    27622720{
    2763     UNUSED_PARAM(location);
    2764     UNUSED_PARAM(data);
    2765     UNUSED_PARAM(srcOffset);
    2766     UNUSED_PARAM(srcLength);
     2721    makeContextCurrent();
     2722    gl::Uniform4iv(location, srcLength, data + srcOffset);
    27672723}
    27682724
    27692725void GraphicsContextGLOpenGL::uniformMatrix2fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27702726{
    2771     UNUSED_PARAM(location);
    2772     UNUSED_PARAM(transpose);
    2773     UNUSED_PARAM(data);
    2774     UNUSED_PARAM(srcOffset);
    2775     UNUSED_PARAM(srcLength);
     2727    makeContextCurrent();
     2728    gl::UniformMatrix2fv(location, srcLength, transpose, data + srcOffset);
    27762729}
    27772730
    27782731void GraphicsContextGLOpenGL::uniformMatrix3fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27792732{
    2780     UNUSED_PARAM(location);
    2781     UNUSED_PARAM(transpose);
    2782     UNUSED_PARAM(data);
    2783     UNUSED_PARAM(srcOffset);
    2784     UNUSED_PARAM(srcLength);
     2733    makeContextCurrent();
     2734    gl::UniformMatrix3fv(location, srcLength, transpose, data + srcOffset);
    27852735}
    27862736
    27872737void GraphicsContextGLOpenGL::uniformMatrix4fv(GCGLint location, GCGLboolean transpose, const GCGLfloat* data, GCGLuint srcOffset, GCGLuint srcLength)
    27882738{
    2789     UNUSED_PARAM(location);
    2790     UNUSED_PARAM(transpose);
    2791     UNUSED_PARAM(data);
    2792     UNUSED_PARAM(srcOffset);
    2793     UNUSED_PARAM(srcLength);
     2739    makeContextCurrent();
     2740    gl::UniformMatrix4fv(location, srcLength, transpose, data + srcOffset);
    27942741}
    27952742
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGL.h

    r263281 r264371  
    295295    void getUniformfv(PlatformGLObject program, GCGLint location, GCGLfloat* value) final;
    296296    void getUniformiv(PlatformGLObject program, GCGLint location, GCGLint* value) final;
     297    void getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value) final;
    297298    GCGLint getUniformLocation(PlatformGLObject, const String& name) final;
    298299    void getVertexAttribfv(GCGLuint index, GCGLenum pname, GCGLfloat* value) final;
  • trunk/Source/WebCore/platform/graphics/opengl/GraphicsContextGLOpenGLCommon.cpp

    r263281 r264371  
    18231823}
    18241824
     1825void GraphicsContextGLOpenGL::getUniformuiv(PlatformGLObject program, GCGLint location, GCGLuint* value)
     1826{
     1827    UNUSED_PARAM(program);
     1828    UNUSED_PARAM(location);
     1829    UNUSED_PARAM(value);
     1830}
     1831
    18251832GCGLint GraphicsContextGLOpenGL::getUniformLocation(PlatformGLObject program, const String& name)
    18261833{
Note: See TracChangeset for help on using the changeset viewer.