From 366ceacf72258a4a81d9c6b412dd565a4c611b17 Mon Sep 17 00:00:00 2001 From: Ian Romanick Date: Tue, 28 Apr 2015 18:00:43 -0700 Subject: [PATCH] gles/es3.1: Enable dispatch of almost all new GLES 3.1 functions MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit A couple functions are missing because there are no implementations of them yet. These are: glFramebufferParameteri (from GL_ARB_framebuffer_no_attachments) glGetFramebufferParameteriv (from GL_ARB_framebuffer_no_attachments) glMemoryBarrierByRegion v2: Rebase on updated dispatch_sanity.cpp test. v3: Add support for glDraw{Arrays,Elements}Indirect in vbo_exec_array.c. The updated dispatch_sanity.cpp test discovered this omission. v4: Rebase on glapi changes. Signed-off-by: Ian Romanick Reviewed-by: Tapani Pälli --- src/mapi/glapi/gen/ARB_compute_shader.xml | 4 +- src/mapi/glapi/gen/ARB_draw_indirect.xml | 4 +- .../glapi/gen/ARB_program_interface_query.xml | 10 +- .../glapi/gen/ARB_separate_shader_objects.xml | 86 ++++++++--------- .../glapi/gen/ARB_shader_image_load_store.xml | 4 +- .../glapi/gen/ARB_texture_multisample.xml | 4 +- .../gen/ARB_texture_storage_multisample.xml | 2 +- .../glapi/gen/ARB_vertex_attrib_binding.xml | 10 +- src/mapi/glapi/gen/GL3x.xml | 2 +- src/mapi/glapi/gen/gl_API.xml | 4 +- src/mesa/main/tests/dispatch_sanity.cpp | 95 +++++++++++++++++++ src/mesa/vbo/vbo_exec_array.c | 5 +- 12 files changed, 164 insertions(+), 66 deletions(-) diff --git a/src/mapi/glapi/gen/ARB_compute_shader.xml b/src/mapi/glapi/gen/ARB_compute_shader.xml index 78d352f1f37..c2ec842efe1 100644 --- a/src/mapi/glapi/gen/ARB_compute_shader.xml +++ b/src/mapi/glapi/gen/ARB_compute_shader.xml @@ -26,13 +26,13 @@ - + - + diff --git a/src/mapi/glapi/gen/ARB_draw_indirect.xml b/src/mapi/glapi/gen/ARB_draw_indirect.xml index 2001eb00b59..3b29d6b8674 100644 --- a/src/mapi/glapi/gen/ARB_draw_indirect.xml +++ b/src/mapi/glapi/gen/ARB_draw_indirect.xml @@ -8,12 +8,12 @@ - + - + diff --git a/src/mapi/glapi/gen/ARB_program_interface_query.xml b/src/mapi/glapi/gen/ARB_program_interface_query.xml index 5b6d5cc59bd..c3162f5ed16 100644 --- a/src/mapi/glapi/gen/ARB_program_interface_query.xml +++ b/src/mapi/glapi/gen/ARB_program_interface_query.xml @@ -56,21 +56,21 @@ - + - + - + @@ -79,7 +79,7 @@ - + @@ -90,7 +90,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml index c20ee4b50ff..c9f481d8b6b 100644 --- a/src/mapi/glapi/gen/ARB_separate_shader_objects.xml +++ b/src/mapi/glapi/gen/ARB_separate_shader_objects.xml @@ -15,33 +15,33 @@ - + - + - + - + - + - + - + @@ -54,30 +54,30 @@ --> - + - + - + - + - + @@ -85,25 +85,25 @@ - + - + - + - + @@ -111,25 +111,25 @@ - + - + - + - + @@ -137,145 +137,145 @@ - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + diff --git a/src/mapi/glapi/gen/ARB_shader_image_load_store.xml b/src/mapi/glapi/gen/ARB_shader_image_load_store.xml index c6a97bf1878..178e930f1d5 100644 --- a/src/mapi/glapi/gen/ARB_shader_image_load_store.xml +++ b/src/mapi/glapi/gen/ARB_shader_image_load_store.xml @@ -70,7 +70,7 @@ - + @@ -80,7 +80,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_texture_multisample.xml b/src/mapi/glapi/gen/ARB_texture_multisample.xml index d7cf2a30aa2..595e1c7eae6 100644 --- a/src/mapi/glapi/gen/ARB_texture_multisample.xml +++ b/src/mapi/glapi/gen/ARB_texture_multisample.xml @@ -53,13 +53,13 @@ - + - + diff --git a/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml b/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml index 0d39fa235da..6ed8f1a01d8 100644 --- a/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml +++ b/src/mapi/glapi/gen/ARB_texture_storage_multisample.xml @@ -7,7 +7,7 @@ - + diff --git a/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml b/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml index 0f000639f1f..ba9ca57bb54 100644 --- a/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml +++ b/src/mapi/glapi/gen/ARB_vertex_attrib_binding.xml @@ -7,14 +7,14 @@ - + - + @@ -22,7 +22,7 @@ - + @@ -36,12 +36,12 @@ - + - + diff --git a/src/mapi/glapi/gen/GL3x.xml b/src/mapi/glapi/gen/GL3x.xml index 348d5221fb5..7919d657774 100644 --- a/src/mapi/glapi/gen/GL3x.xml +++ b/src/mapi/glapi/gen/GL3x.xml @@ -166,7 +166,7 @@ - + diff --git a/src/mapi/glapi/gen/gl_API.xml b/src/mapi/glapi/gen/gl_API.xml index 3090b9f7e02..bd8db62033e 100644 --- a/src/mapi/glapi/gen/gl_API.xml +++ b/src/mapi/glapi/gen/gl_API.xml @@ -2824,7 +2824,7 @@ - + @@ -2832,7 +2832,7 @@ - + diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index c6f3c395733..ab66f884673 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -72,6 +72,7 @@ extern const struct function gl_core_functions_possible[]; extern const struct function gles11_functions_possible[]; extern const struct function gles2_functions_possible[]; extern const struct function gles3_functions_possible[]; +extern const struct function gles31_functions_possible[]; class DispatchSanity_test : public ::testing::Test { public: @@ -201,6 +202,15 @@ TEST_F(DispatchSanity_test, GLES3) validate_nops(&ctx, nop_table); } +TEST_F(DispatchSanity_test, GLES31) +{ + SetUpCtx(API_OPENGLES2, 31); + validate_functions(&ctx, gles2_functions_possible, nop_table); + validate_functions(&ctx, gles3_functions_possible, nop_table); + validate_functions(&ctx, gles31_functions_possible, nop_table); + validate_nops(&ctx, nop_table); +} + const struct function gl_core_functions_possible[] = { { "glCullFace", 10, -1 }, { "glFrontFace", 10, -1 }, @@ -1611,3 +1621,88 @@ const struct function gles3_functions_possible[] = { { NULL, 0, -1 } }; + +const struct function gles31_functions_possible[] = { + { "glDispatchCompute", 31, -1 }, + { "glDispatchComputeIndirect", 31, -1 }, + { "glDrawArraysIndirect", 31, -1 }, + { "glDrawElementsIndirect", 31, -1 }, + + // FINISHME: These two functions have not been implemented yet. They come + // FINISHME: from the ARB_framebuffer_no_attachments extension. + // { "glFramebufferParameteri", 31, -1 }, + // { "glGetFramebufferParameteriv", 31, -1 }, + + { "glGetProgramInterfaceiv", 31, -1 }, + { "glGetProgramResourceIndex", 31, -1 }, + { "glGetProgramResourceName", 31, -1 }, + { "glGetProgramResourceiv", 31, -1 }, + { "glGetProgramResourceLocation", 31, -1 }, + + // We check for the aliased EXT versions in GLES 2 + // { "glUseProgramStages", 31, -1 }, + // { "glActiveShaderProgram", 31, -1 }, + // { "glCreateShaderProgramv", 31, -1 }, + // { "glBindProgramPipeline", 31, -1 }, + // { "glDeleteProgramPipelines", 31, -1 }, + // { "glGenProgramPipelines", 31, -1 }, + // { "glIsProgramPipeline", 31, -1 }, + // { "glGetProgramPipelineiv", 31, -1 }, + // { "glProgramUniform1i", 31, -1 }, + // { "glProgramUniform2i", 31, -1 }, + // { "glProgramUniform3i", 31, -1 }, + // { "glProgramUniform4i", 31, -1 }, + // { "glProgramUniform1f", 31, -1 }, + // { "glProgramUniform2f", 31, -1 }, + // { "glProgramUniform3f", 31, -1 }, + // { "glProgramUniform4f", 31, -1 }, + // { "glProgramUniform1iv", 31, -1 }, + // { "glProgramUniform2iv", 31, -1 }, + // { "glProgramUniform3iv", 31, -1 }, + // { "glProgramUniform4iv", 31, -1 }, + // { "glProgramUniform1fv", 31, -1 }, + // { "glProgramUniform2fv", 31, -1 }, + // { "glProgramUniform3fv", 31, -1 }, + // { "glProgramUniform4fv", 31, -1 }, + // { "glProgramUniformMatrix2fv", 31, -1 }, + // { "glProgramUniformMatrix3fv", 31, -1 }, + // { "glProgramUniformMatrix4fv", 31, -1 }, + // { "glProgramUniformMatrix2x3fv", 31, -1 }, + // { "glProgramUniformMatrix3x2fv", 31, -1 }, + // { "glProgramUniformMatrix2x4fv", 31, -1 }, + // { "glProgramUniformMatrix4x2fv", 31, -1 }, + // { "glProgramUniformMatrix3x4fv", 31, -1 }, + // { "glProgramUniformMatrix4x3fv", 31, -1 }, + // { "glValidateProgramPipeline", 31, -1 }, + // { "glGetProgramPipelineInfoLog", 31, -1 }, + + // We check for the aliased EXT versions in GLES 3 + // { "glProgramUniform1ui", 31, -1 }, + // { "glProgramUniform2ui", 31, -1 }, + // { "glProgramUniform3ui", 31, -1 }, + // { "glProgramUniform4ui", 31, -1 }, + // { "glProgramUniform1uiv", 31, -1 }, + // { "glProgramUniform2uiv", 31, -1 }, + // { "glProgramUniform3uiv", 31, -1 }, + // { "glProgramUniform4uiv", 31, -1 }, + + { "glBindImageTexture", 31, -1 }, + { "glGetBooleani_v", 31, -1 }, + { "glMemoryBarrier", 31, -1 }, + + // FINISHME: This function has not been implemented yet. + // { "glMemoryBarrierByRegion", 31, -1 }, + + { "glTexStorage2DMultisample", 31, -1 }, + { "glGetMultisamplefv", 31, -1 }, + { "glSampleMaski", 31, -1 }, + { "glGetTexLevelParameteriv", 31, -1 }, + { "glGetTexLevelParameterfv", 31, -1 }, + { "glBindVertexBuffer", 31, -1 }, + { "glVertexAttribFormat", 31, -1 }, + { "glVertexAttribIFormat", 31, -1 }, + { "glVertexAttribBinding", 31, -1 }, + { "glVertexBindingDivisor", 31, -1 }, + + { NULL, 0, -1 }, + }; diff --git a/src/mesa/vbo/vbo_exec_array.c b/src/mesa/vbo/vbo_exec_array.c index 3ea775c0e4a..72b8206ec23 100644 --- a/src/mesa/vbo/vbo_exec_array.c +++ b/src/mesa/vbo/vbo_exec_array.c @@ -1817,9 +1817,12 @@ vbo_initialize_exec_dispatch(const struct gl_context *ctx, SET_DrawElementsInstancedBaseVertexBaseInstance(exec, vbo_exec_DrawElementsInstancedBaseVertexBaseInstance); } - if (ctx->API == API_OPENGL_CORE) { + if (ctx->API == API_OPENGL_CORE || _mesa_is_gles31(ctx)) { SET_DrawArraysIndirect(exec, vbo_exec_DrawArraysIndirect); SET_DrawElementsIndirect(exec, vbo_exec_DrawElementsIndirect); + } + + if (ctx->API == API_OPENGL_CORE) { SET_MultiDrawArraysIndirect(exec, vbo_exec_MultiDrawArraysIndirect); SET_MultiDrawElementsIndirect(exec, vbo_exec_MultiDrawElementsIndirect); } -- 2.30.2