diff options
author | Paul Berry <[email protected]> | 2014-01-06 15:08:04 -0800 |
---|---|---|
committer | Paul Berry <[email protected]> | 2014-02-05 09:00:14 -0800 |
commit | 79134cb51609724cc4d94ade12dc52a09e2e91db (patch) | |
tree | 9cb30c5ffc3600d04e07c01b2cbb830ea016271a /src/mesa | |
parent | b7d05a58ae3655730f84c9786439e2461cdb77da (diff) |
mesa/cs: Add dispatch API stubs for ARB_compute_shader.
Reviewed-by: Matt Turner <[email protected]>
Diffstat (limited to 'src/mesa')
-rw-r--r-- | src/mesa/Makefile.sources | 1 | ||||
-rw-r--r-- | src/mesa/SConscript | 1 | ||||
-rw-r--r-- | src/mesa/main/compute.c | 54 | ||||
-rw-r--r-- | src/mesa/main/compute.h | 38 | ||||
-rw-r--r-- | src/mesa/main/tests/dispatch_sanity.cpp | 4 |
5 files changed, 96 insertions, 2 deletions
diff --git a/src/mesa/Makefile.sources b/src/mesa/Makefile.sources index 3cdcae21368..bd02d3ee802 100644 --- a/src/mesa/Makefile.sources +++ b/src/mesa/Makefile.sources @@ -24,6 +24,7 @@ MAIN_FILES = \ $(SRCDIR)main/clear.c \ $(SRCDIR)main/clip.c \ $(SRCDIR)main/colortab.c \ + $(SRCDIR)main/compute.c \ $(SRCDIR)main/condrender.c \ $(SRCDIR)main/context.c \ $(SRCDIR)main/convolve.c \ diff --git a/src/mesa/SConscript b/src/mesa/SConscript index 5b3358d5bed..b52bbdc23d4 100644 --- a/src/mesa/SConscript +++ b/src/mesa/SConscript @@ -52,6 +52,7 @@ main_sources = [ 'main/clear.c', 'main/clip.c', 'main/colortab.c', + 'main/compute.c', 'main/condrender.c', 'main/context.c', 'main/convolve.c', diff --git a/src/mesa/main/compute.c b/src/mesa/main/compute.c new file mode 100644 index 00000000000..5756666b609 --- /dev/null +++ b/src/mesa/main/compute.c @@ -0,0 +1,54 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#include "glheader.h" +#include "compute.h" +#include "context.h" + +void GLAPIENTRY +_mesa_DispatchCompute(GLuint num_groups_x, + GLuint num_groups_y, + GLuint num_groups_z) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Extensions.ARB_compute_shader) { + assert(!"TODO"); + } else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "unsupported function (glDispatchCompute) called"); + } +} + +extern void GLAPIENTRY +_mesa_DispatchComputeIndirect(GLintptr indirect) +{ + GET_CURRENT_CONTEXT(ctx); + + if (ctx->Extensions.ARB_compute_shader) { + assert(!"TODO"); + } else { + _mesa_error(ctx, GL_INVALID_OPERATION, + "unsupported function (glDispatchComputeIndirect) called"); + } +} diff --git a/src/mesa/main/compute.h b/src/mesa/main/compute.h new file mode 100644 index 00000000000..0cc034fd61c --- /dev/null +++ b/src/mesa/main/compute.h @@ -0,0 +1,38 @@ +/* + * Copyright © 2014 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ + +#ifndef COMPUTE_H +#define COMPUTE_H + + +#include "glheader.h" + +extern void GLAPIENTRY +_mesa_DispatchCompute(GLuint num_groups_x, + GLuint num_groups_y, + GLuint num_groups_z); + +extern void GLAPIENTRY +_mesa_DispatchComputeIndirect(GLintptr indirect); + +#endif diff --git a/src/mesa/main/tests/dispatch_sanity.cpp b/src/mesa/main/tests/dispatch_sanity.cpp index 78a218ea17b..d8969e268b9 100644 --- a/src/mesa/main/tests/dispatch_sanity.cpp +++ b/src/mesa/main/tests/dispatch_sanity.cpp @@ -850,8 +850,8 @@ const struct function gl_core_functions_possible[] = { { "glClearBufferSubData", 43, -1 }, // { "glClearNamedBufferDataEXT", 43, -1 }, // XXX: Add to xml // { "glClearNamedBufferSubDataEXT", 43, -1 }, // XXX: Add to xml -// { "glDispatchCompute", 43, -1 }, // XXX: Add to xml -// { "glDispatchComputeIndirect", 43, -1 }, // XXX: Add to xml + { "glDispatchCompute", 43, -1 }, + { "glDispatchComputeIndirect", 43, -1 }, // { "glCopyImageSubData", 43, -1 }, // XXX: Add to xml { "glTextureView", 43, -1 }, { "glBindVertexBuffer", 43, -1 }, |