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
Родитель 172a73e512
Коммит d2a9435163
2 изменённых файлов: 15 добавлений и 4 удалений

Просмотреть файл

@ -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;
}

Просмотреть файл

@ -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