Bug 911394 - arrayless drawElements works on ANGLE and Android. - r=bjacob

This commit is contained in:
Jeff Gilbert 2013-10-29 11:40:44 -07:00
parent 3b8db956ba
commit 59aa8cf815
2 changed files with 15 additions and 4 deletions

View File

@ -58,6 +58,7 @@ DriverInfo = (function() {
MESA: 'mesa',
NVIDIA: 'nvidia',
ANDROID_X86_EMULATOR: 'android x86 emulator',
ANGLE: 'angle',
};
var kOS = null;
@ -104,6 +105,8 @@ DriverInfo = (function() {
kDriver = DRIVER.MESA;
} else if (glRenderer.contains('Android Emulator')) {
kDriver = DRIVER.ANDROID_X86_EMULATOR;
} else if (glRenderer.contains('ANGLE')) {
kDriver = DRIVER.ANGLE;
} else if (glVendor.contains('NVIDIA')) {
kDriver = DRIVER.NVIDIA;
}

View File

@ -115,23 +115,31 @@ void main(void) {
checkGLError(ok, info);
var elemTestFunc = todo; // We fail on most implementations.
if (DriverInfo.getDriver() == DriverInfo.DRIVER.ANGLE ||
DriverInfo.getOS() == DriverInfo.OS.ANDROID)
{
// ANGLE and Android slaves seem to work fine.
elemTestFunc = ok;
}
// Now for drawElements:
gl.bindBuffer(gl.ELEMENT_ARRAY_BUFFER, gl.createBuffer());
gl.bufferData(gl.ELEMENT_ARRAY_BUFFER, indexArr, gl.STATIC_DRAW);
gl.clear(gl.COLOR_BUFFER_BIT);
gl.drawElements(gl.POINTS, 1, indexType, 0);
todo(!isScreenBlack(), '[' + info + '] drawElements[0] should color pixels.');
elemTestFunc(!isScreenBlack(), '[' + info + '] drawElements[0] should color pixels.');
gl.clear(gl.COLOR_BUFFER_BIT);
gl.drawElements(gl.POINTS, 1, indexType, 1*indexStride);
todo(!isScreenBlack(), '[' + info + '] drawElements[1] should color pixels.');
elemTestFunc(!isScreenBlack(), '[' + info + '] drawElements[1] should color pixels.');
gl.clear(gl.COLOR_BUFFER_BIT);
gl.drawElements(gl.POINTS, 1, indexType, 2*indexStride);
todo(!isScreenBlack(), '[' + info + '] drawElements[huge offset] should color pixels.');
elemTestFunc(!isScreenBlack(), '[' + info + '] drawElements[huge offset] should color pixels.');
checkGLError(todo, info);
checkGLError(elemTestFunc, info);
}
// Begin drawing