Title: [161242] trunk/Source/WebCore
- Revision
- 161242
- Author
- [email protected]
- Date
- 2014-01-02 17:18:29 -0800 (Thu, 02 Jan 2014)
Log Message
[WebGL] Correct symbol lookup logic to handle 1-element arrays
https://bugs.webkit.org/show_bug.cgi?id=126411
<rdar://problem/15394564>
Reviewed by Dean Jackson.
* html/canvas/WebGLRenderingContext.cpp:
(WebCore::WebGLRenderingContext::getUniformLocation): Revise code to handle the case of single-element
arrays.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (161241 => 161242)
--- trunk/Source/WebCore/ChangeLog 2014-01-03 00:40:16 UTC (rev 161241)
+++ trunk/Source/WebCore/ChangeLog 2014-01-03 01:18:29 UTC (rev 161242)
@@ -1,3 +1,15 @@
+2014-01-02 Brent Fulgham <[email protected]>
+
+ [WebGL] Correct symbol lookup logic to handle 1-element arrays
+ https://bugs.webkit.org/show_bug.cgi?id=126411
+ <rdar://problem/15394564>
+
+ Reviewed by Dean Jackson.
+
+ * html/canvas/WebGLRenderingContext.cpp:
+ (WebCore::WebGLRenderingContext::getUniformLocation): Revise code to handle the case of single-element
+ arrays.
+
2014-01-02 Sam Weinig <[email protected]>
Update Promises to the https://github.com/domenic/promises-unwrapping spec
Modified: trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp (161241 => 161242)
--- trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp 2014-01-03 00:40:16 UTC (rev 161241)
+++ trunk/Source/WebCore/html/canvas/WebGLRenderingContext.cpp 2014-01-03 01:18:29 UTC (rev 161242)
@@ -3162,7 +3162,7 @@
GC3Dint uniformLocation = m_context->getUniformLocation(objectOrZero(program), name);
if (uniformLocation == -1)
return 0;
-
+
GC3Dint activeUniforms = 0;
m_context->getProgramiv(objectOrZero(program), GraphicsContext3D::ACTIVE_UNIFORMS, &activeUniforms);
for (GC3Dint i = 0; i < activeUniforms; i++) {
@@ -3170,17 +3170,14 @@
if (!m_context->getActiveUniform(objectOrZero(program), i, info))
return 0;
// Strip "[0]" from the name if it's an array.
- if (info.size > 1 && info.name.endsWith("[0]"))
+ if (info.name.endsWith("[0]"))
info.name = info.name.left(info.name.length() - 3);
// If it's an array, we need to iterate through each element, appending "[index]" to the name.
for (GC3Dint index = 0; index < info.size; ++index) {
- String uniformName = info.name;
if (info.size > 1) {
- uniformName.append('[');
- uniformName.append(String::number(index));
- uniformName.append(']');
- }
- if (info.size > 1) {
+ String arrayBrackets = "[" + String::number(index) + "]";
+ String uniformName = info.name + arrayBrackets;
+
if (name == uniformName || name == info.name)
return WebGLUniformLocation::create(program, uniformLocation, info.type);
} else {
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes