blob: ec035f9ccc15182918979d21b6dfb7fb8c56cc1c [file] [log] [blame]
Alan Baker202c8c72018-08-13 13:47:44 -04001// Copyright 2018 The Clspv Authors. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15#ifndef CLSPV_LIB_CONSTANTS_H_
16#define CLSPV_LIB_CONSTANTS_H_
17
alan-baker9501b322019-07-16 16:17:15 -040018#include <string>
19
Alan Baker202c8c72018-08-13 13:47:44 -040020namespace clspv {
21
22// Name for module level metadata storing workgroup argument spec ids.
SJW61531372020-06-09 07:31:08 -050023const std::string &LocalSpecIdMetadataName();
Alan Baker202c8c72018-08-13 13:47:44 -040024
25// Base name for workgroup variable accessor function.
SJW61531372020-06-09 07:31:08 -050026const std::string &WorkgroupAccessorFunction();
Alan Baker202c8c72018-08-13 13:47:44 -040027
28// Base name for resource variable accessor function.
SJW61531372020-06-09 07:31:08 -050029const std::string &ResourceAccessorFunction();
Alan Baker202c8c72018-08-13 13:47:44 -040030
Alan Bakerfcda9482018-10-02 17:09:59 -040031// Name for module level metadata storing UBO remapped type offsets.
SJW61531372020-06-09 07:31:08 -050032const std::string &RemappedTypeOffsetMetadataName();
Alan Bakerfcda9482018-10-02 17:09:59 -040033
34// Name for module level metadata storing UBO remapped type sizes.
SJW61531372020-06-09 07:31:08 -050035const std::string &RemappedTypeSizesMetadataName();
Alan Bakerfcda9482018-10-02 17:09:59 -040036
Kévin Petitdf71de32019-04-09 14:09:50 +010037// Name of the function used to encode literal samplers
SJW61531372020-06-09 07:31:08 -050038const std::string &LiteralSamplerFunction();
39
40// Name of the function used for composite construct
41const std::string &CompositeConstructFunction();
42
43// Name of the clspv builtin used for register packing (specifically v2f16)
44const std::string &PackFunction();
45
46// Name of the clspv builtin used for register unpacking (specifically v2f16)
47const std::string &UnpackFunction();
48
49// Name of the clspv builtin for copy_memory
50const std::string &CopyMemoryFunction();
Kévin Petitdf71de32019-04-09 14:09:50 +010051
Kévin Petit617a76d2019-04-04 13:54:16 +010052// Base name for SPIR-V intrinsic functions
SJW61531372020-06-09 07:31:08 -050053const std::string &SPIRVOpIntrinsicFunction();
Kévin Petit617a76d2019-04-04 13:54:16 +010054
alan-baker931d18a2019-12-12 08:21:32 -050055// Name of the literal sampler initializer function.
56inline std::string TranslateSamplerInitializerFunction() {
57 return "__translate_sampler_initializer";
58}
59
Kévin Petitbbbda972020-03-03 19:16:31 +000060// Name of the global variable storing all push constants
61inline std::string PushConstantsVariableName() { return "__push_constants"; }
62
63// Name for module level metadata storing push constant indices.
64inline std::string PushConstantsMetadataName() { return "push_constants"; }
65
alan-bakera1be3322020-04-20 12:48:18 -040066// Name for module level metadata storing next spec constant id.
67inline std::string NextSpecConstantMetadataName() {
68 return "clspv.next_spec_constant_id";
69}
70
71// Name for module level metadata store list of allocated spec constants.
72inline std::string SpecConstantMetadataName() {
73 return "clspv.spec_constant_list";
74}
75
alan-bakerc4579bb2020-04-29 14:15:50 -040076// Pod args implementation metadata name.
77inline std::string PodArgsImplMetadataName() { return "clspv.pod_args_impl"; }
78
alan-bakerff6c9292020-05-04 08:32:09 -040079// Clustered arguments mapping metadata name.
80inline std::string KernelArgMapMetadataName() { return "kernel_arg_map"; }
81
Kévin Petit85bcee02021-08-03 18:21:30 +010082// Clustered constants global variable name.
83inline std::string ClusteredConstantsVariableName() {
84 return "clspv.clustered_constants";
85}
86
Alan Baker202c8c72018-08-13 13:47:44 -040087} // namespace clspv
88
89#endif