Commit 4627b370 by Jamie Madill Committed by Commit Bot

Add gl null driver tests to DrawElements.

Requires a couple tweaks to the back-end to be compatible with the null driver. Bug: angleproject:2966 Change-Id: Ia83651aabb0dd14b7d6f64152c276463a8fb28fc Reviewed-on: https://chromium-review.googlesource.com/c/1392392Reviewed-by: 's avatarShahbaz Youssefi <syoussefi@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org> Commit-Queue: Jamie Madill <jmadill@chromium.org>
parent 904bb918
...@@ -216,8 +216,16 @@ angle::Result BufferGL::getIndexRange(const gl::Context *context, ...@@ -216,8 +216,16 @@ angle::Result BufferGL::getIndexRange(const gl::Context *context,
const uint8_t *bufferData = const uint8_t *bufferData =
MapBufferRangeWithFallback(mFunctions, gl::ToGLenum(DestBufferOperationTarget), offset, MapBufferRangeWithFallback(mFunctions, gl::ToGLenum(DestBufferOperationTarget), offset,
count * typeBytes, GL_MAP_READ_BIT); count * typeBytes, GL_MAP_READ_BIT);
*outRange = gl::ComputeIndexRange(type, bufferData, count, primitiveRestartEnabled); if (bufferData)
mFunctions->unmapBuffer(gl::ToGLenum(DestBufferOperationTarget)); {
*outRange = gl::ComputeIndexRange(type, bufferData, count, primitiveRestartEnabled);
mFunctions->unmapBuffer(gl::ToGLenum(DestBufferOperationTarget));
}
else
{
// Workaround the null driver not having map support.
*outRange = gl::IndexRange(0, 0, 1);
}
} }
return angle::Result::Continue; return angle::Result::Continue;
......
...@@ -413,6 +413,12 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -413,6 +413,12 @@ void GenerateCaps(const FunctionsGL *functions,
functions->isAtLeastGLES(gl::Version(3, 0))) functions->isAtLeastGLES(gl::Version(3, 0)))
{ {
caps->maxElementIndex = QuerySingleGLInt64(functions, GL_MAX_ELEMENT_INDEX); caps->maxElementIndex = QuerySingleGLInt64(functions, GL_MAX_ELEMENT_INDEX);
// Work around the null driver limitations.
if (caps->maxElementIndex == 0)
{
caps->maxElementIndex = 0xFFFF;
}
} }
else else
{ {
...@@ -1117,7 +1123,7 @@ void GenerateCaps(const FunctionsGL *functions, ...@@ -1117,7 +1123,7 @@ void GenerateCaps(const FunctionsGL *functions,
functions->isAtLeastGLES(gl::Version(3, 2)) || functions->isAtLeastGLES(gl::Version(3, 2)) ||
functions->hasGLESExtension("GL_KHR_debug") || functions->hasGLESExtension("GL_KHR_debug") ||
functions->hasGLESExtension("GL_EXT_debug_marker"); functions->hasGLESExtension("GL_EXT_debug_marker");
extensions->eglImage = functions->hasGLESExtension("GL_OES_EGL_image"); extensions->eglImage = functions->hasGLESExtension("GL_OES_EGL_image");
extensions->eglImageExternal = functions->hasGLESExtension("GL_OES_EGL_image_external"); extensions->eglImageExternal = functions->hasGLESExtension("GL_OES_EGL_image_external");
extensions->eglImageExternalEssl3 = extensions->eglImageExternalEssl3 =
functions->hasGLESExtension("GL_OES_EGL_image_external_essl3"); functions->hasGLESExtension("GL_OES_EGL_image_external_essl3");
......
...@@ -232,10 +232,12 @@ DrawElementsPerfParams DrawElementsPerfD3D9Params(bool indexBufferChanged) ...@@ -232,10 +232,12 @@ DrawElementsPerfParams DrawElementsPerfD3D9Params(bool indexBufferChanged)
return params; return params;
} }
DrawElementsPerfParams DrawElementsPerfOpenGLOrGLESParams(bool indexBufferChanged, GLenum indexType) DrawElementsPerfParams DrawElementsPerfOpenGLOrGLESParams(bool indexBufferChanged,
bool useNullDevice,
GLenum indexType)
{ {
DrawElementsPerfParams params; DrawElementsPerfParams params;
params.eglParameters = angle::egl_platform::OPENGL_OR_GLES(false); params.eglParameters = angle::egl_platform::OPENGL_OR_GLES(useNullDevice);
params.indexBufferChanged = indexBufferChanged; params.indexBufferChanged = indexBufferChanged;
params.type = indexType; params.type = indexType;
...@@ -277,10 +279,11 @@ ANGLE_INSTANTIATE_TEST(DrawElementsPerfBenchmark, ...@@ -277,10 +279,11 @@ ANGLE_INSTANTIATE_TEST(DrawElementsPerfBenchmark,
DrawElementsPerfD3D11Params(true, false, GL_UNSIGNED_INT), DrawElementsPerfD3D11Params(true, false, GL_UNSIGNED_INT),
DrawElementsPerfD3D11Params(false, false, GL_UNSIGNED_SHORT), DrawElementsPerfD3D11Params(false, false, GL_UNSIGNED_SHORT),
DrawElementsPerfD3D11Params(false, true, GL_UNSIGNED_SHORT), DrawElementsPerfD3D11Params(false, true, GL_UNSIGNED_SHORT),
DrawElementsPerfOpenGLOrGLESParams(false, GL_UNSIGNED_SHORT), DrawElementsPerfOpenGLOrGLESParams(false, false, GL_UNSIGNED_SHORT),
DrawElementsPerfOpenGLOrGLESParams(true, GL_UNSIGNED_SHORT), DrawElementsPerfOpenGLOrGLESParams(false, true, GL_UNSIGNED_SHORT),
DrawElementsPerfOpenGLOrGLESParams(false, GL_UNSIGNED_INT), DrawElementsPerfOpenGLOrGLESParams(true, false, GL_UNSIGNED_SHORT),
DrawElementsPerfOpenGLOrGLESParams(true, GL_UNSIGNED_INT), DrawElementsPerfOpenGLOrGLESParams(false, false, GL_UNSIGNED_INT),
DrawElementsPerfOpenGLOrGLESParams(true, false, GL_UNSIGNED_INT),
DrawElementsPerfVulkanParams(false, false, GL_UNSIGNED_SHORT), DrawElementsPerfVulkanParams(false, false, GL_UNSIGNED_SHORT),
DrawElementsPerfVulkanParams(false, true, GL_UNSIGNED_SHORT), DrawElementsPerfVulkanParams(false, true, GL_UNSIGNED_SHORT),
DrawElementsPerfVulkanParams(false, false, GL_UNSIGNED_INT), DrawElementsPerfVulkanParams(false, false, GL_UNSIGNED_INT),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment