2 * Copyright © 2014 Intel Corporation
4 * Permission is hereby granted, free of charge, to any person obtaining a
5 * copy of this software and associated documentation files (the "Software"),
6 * to deal in the Software without restriction, including without limitation
7 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8 * and/or sell copies of the Software, and to permit persons to whom the
9 * Software is furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice (including the next
12 * paragraph) shall be included in all copies or substantial portions of the
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
21 * DEALINGS IN THE SOFTWARE.
27 #include "api_validate.h"
30 _mesa_DispatchCompute(GLuint num_groups_x
,
34 GET_CURRENT_CONTEXT(ctx
);
35 const GLuint num_groups
[3] = { num_groups_x
, num_groups_y
, num_groups_z
};
37 if (MESA_VERBOSE
& VERBOSE_API
)
38 _mesa_debug(ctx
, "glDispatchCompute(%d, %d, %d)\n",
39 num_groups_x
, num_groups_y
, num_groups_z
);
41 if (!_mesa_validate_DispatchCompute(ctx
, num_groups
))
44 if (num_groups_x
== 0u || num_groups_y
== 0u || num_groups_z
== 0u)
47 ctx
->Driver
.DispatchCompute(ctx
, num_groups
);
50 extern void GLAPIENTRY
51 _mesa_DispatchComputeIndirect(GLintptr indirect
)
53 GET_CURRENT_CONTEXT(ctx
);
55 if (MESA_VERBOSE
& VERBOSE_API
)
56 _mesa_debug(ctx
, "glDispatchComputeIndirect(%ld)\n", (long) indirect
);
58 if (!_mesa_validate_DispatchComputeIndirect(ctx
, indirect
))
61 ctx
->Driver
.DispatchComputeIndirect(ctx
, indirect
);
65 _mesa_DispatchComputeGroupSizeARB(GLuint num_groups_x
, GLuint num_groups_y
,
66 GLuint num_groups_z
, GLuint group_size_x
,
67 GLuint group_size_y
, GLuint group_size_z
)
69 GET_CURRENT_CONTEXT(ctx
);
70 const GLuint num_groups
[3] = { num_groups_x
, num_groups_y
, num_groups_z
};
71 const GLuint group_size
[3] = { group_size_x
, group_size_y
, group_size_z
};
73 if (MESA_VERBOSE
& VERBOSE_API
)
75 "glDispatchComputeGroupSizeARB(%d, %d, %d, %d, %d, %d)\n",
76 num_groups_x
, num_groups_y
, num_groups_z
,
77 group_size_x
, group_size_y
, group_size_z
);
79 if (!_mesa_validate_DispatchComputeGroupSizeARB(ctx
, num_groups
,
83 if (num_groups_x
== 0u || num_groups_y
== 0u || num_groups_z
== 0u)
86 ctx
->Driver
.DispatchComputeGroupSize(ctx
, num_groups
, group_size
);