Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/shaderc
Path: blob/main/libshaderc_util/src/resources.cc
1560 views
1
// Copyright 2015 The Shaderc 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
#include "libshaderc_util/resources.h"
16
17
#include "glslang/Include/ResourceLimits.h"
18
19
namespace shaderc_util {
20
21
// These numbers come from the OpenGL 4.4 core profile specification Chapter 23
22
// unless otherwise specified.
23
const TBuiltInResource kDefaultTBuiltInResource = {
24
/*.maxLights = */ 8, // From OpenGL 3.0 table 6.46.
25
/*.maxClipPlanes = */ 6, // From OpenGL 3.0 table 6.46.
26
/*.maxTextureUnits = */ 2, // From OpenGL 3.0 table 6.50.
27
/*.maxTextureCoords = */ 8, // From OpenGL 3.0 table 6.50.
28
/*.maxVertexAttribs = */ 16,
29
/*.maxVertexUniformComponents = */ 4096,
30
/*.maxVaryingFloats = */ 60, // From OpenGLES 3.1 table 6.44.
31
/*.maxVertexTextureImageUnits = */ 16,
32
/*.maxCombinedTextureImageUnits = */ 80,
33
/*.maxTextureImageUnits = */ 16,
34
/*.maxFragmentUniformComponents = */ 1024,
35
36
// glslang has 32 maxDrawBuffers.
37
// Pixel phone Vulkan driver in Android N has 8
38
// maxFragmentOutputAttachments.
39
/*.maxDrawBuffers = */ 8,
40
41
/*.maxVertexUniformVectors = */ 256,
42
/*.maxVaryingVectors = */ 15, // From OpenGLES 3.1 table 6.44.
43
/*.maxFragmentUniformVectors = */ 256,
44
/*.maxVertexOutputVectors = */ 16, // maxVertexOutputComponents / 4
45
/*.maxFragmentInputVectors = */ 15, // maxFragmentInputComponents / 4
46
/*.minProgramTexelOffset = */ -8,
47
/*.maxProgramTexelOffset = */ 7,
48
/*.maxClipDistances = */ 8,
49
/*.maxComputeWorkGroupCountX = */ 65535,
50
/*.maxComputeWorkGroupCountY = */ 65535,
51
/*.maxComputeWorkGroupCountZ = */ 65535,
52
/*.maxComputeWorkGroupSizeX = */ 1024,
53
/*.maxComputeWorkGroupSizeX = */ 1024,
54
/*.maxComputeWorkGroupSizeZ = */ 64,
55
/*.maxComputeUniformComponents = */ 512,
56
/*.maxComputeTextureImageUnits = */ 16,
57
/*.maxComputeImageUniforms = */ 8,
58
/*.maxComputeAtomicCounters = */ 8,
59
/*.maxComputeAtomicCounterBuffers = */ 1, // From OpenGLES 3.1 Table 6.43
60
/*.maxVaryingComponents = */ 60,
61
/*.maxVertexOutputComponents = */ 64,
62
/*.maxGeometryInputComponents = */ 64,
63
/*.maxGeometryOutputComponents = */ 128,
64
/*.maxFragmentInputComponents = */ 128,
65
/*.maxImageUnits = */ 8, // This does not seem to be defined anywhere,
66
// set to ImageUnits.
67
/*.maxCombinedImageUnitsAndFragmentOutputs = */ 8,
68
/*.maxCombinedShaderOutputResources = */ 8,
69
/*.maxImageSamples = */ 0,
70
/*.maxVertexImageUniforms = */ 0,
71
/*.maxTessControlImageUniforms = */ 0,
72
/*.maxTessEvaluationImageUniforms = */ 0,
73
/*.maxGeometryImageUniforms = */ 0,
74
/*.maxFragmentImageUniforms = */ 8,
75
/*.maxCombinedImageUniforms = */ 8,
76
/*.maxGeometryTextureImageUnits = */ 16,
77
/*.maxGeometryOutputVertices = */ 256,
78
/*.maxGeometryTotalOutputComponents = */ 1024,
79
/*.maxGeometryUniformComponents = */ 512,
80
/*.maxGeometryVaryingComponents = */ 60, // Does not seem to be defined
81
// anywhere, set equal to
82
// maxVaryingComponents.
83
/*.maxTessControlInputComponents = */ 128,
84
/*.maxTessControlOutputComponents = */ 128,
85
/*.maxTessControlTextureImageUnits = */ 16,
86
/*.maxTessControlUniformComponents = */ 1024,
87
/*.maxTessControlTotalOutputComponents = */ 4096,
88
/*.maxTessEvaluationInputComponents = */ 128,
89
/*.maxTessEvaluationOutputComponents = */ 128,
90
/*.maxTessEvaluationTextureImageUnits = */ 16,
91
/*.maxTessEvaluationUniformComponents = */ 1024,
92
/*.maxTessPatchComponents = */ 120,
93
/*.maxPatchVertices = */ 32,
94
/*.maxTessGenLevel = */ 64,
95
/*.maxViewports = */ 16,
96
/*.maxVertexAtomicCounters = */ 0,
97
/*.maxTessControlAtomicCounters = */ 0,
98
/*.maxTessEvaluationAtomicCounters = */ 0,
99
/*.maxGeometryAtomicCounters = */ 0,
100
/*.maxFragmentAtomicCounters = */ 8,
101
/*.maxCombinedAtomicCounters = */ 8,
102
/*.maxAtomicCounterBindings = */ 1,
103
/*.maxVertexAtomicCounterBuffers = */ 0, // From OpenGLES 3.1 Table 6.41.
104
105
// ARB_shader_atomic_counters.
106
/*.maxTessControlAtomicCounterBuffers = */ 0,
107
/*.maxTessEvaluationAtomicCounterBuffers = */ 0,
108
/*.maxGeometryAtomicCounterBuffers = */ 0,
109
// /ARB_shader_atomic_counters.
110
111
/*.maxFragmentAtomicCounterBuffers = */ 0, // From OpenGLES 3.1 Table 6.43.
112
/*.maxCombinedAtomicCounterBuffers = */ 1,
113
/*.maxAtomicCounterBufferSize = */ 32,
114
/*.maxTransformFeedbackBuffers = */ 4,
115
/*.maxTransformFeedbackInterleavedComponents = */ 64,
116
/*.maxCullDistances = */ 8, // ARB_cull_distance.
117
/*.maxCombinedClipAndCullDistances = */ 8, // ARB_cull_distance.
118
/*.maxSamples = */ 4,
119
/* .maxMeshOutputVerticesNV = */ 256,
120
/* .maxMeshOutputPrimitivesNV = */ 512,
121
/* .maxMeshWorkGroupSizeX_NV = */ 32,
122
/* .maxMeshWorkGroupSizeY_NV = */ 1,
123
/* .maxMeshWorkGroupSizeZ_NV = */ 1,
124
/* .maxTaskWorkGroupSizeX_NV = */ 32,
125
/* .maxTaskWorkGroupSizeY_NV = */ 1,
126
/* .maxTaskWorkGroupSizeZ_NV = */ 1,
127
/* .maxMeshViewCountNV = */ 4,
128
/* .maxMeshOutputVerticesEXT = */ 256,
129
/* .maxMeshOutputPrimitivesEXT = */ 256,
130
/* .maxMeshWorkGroupSizeX_EXT = */ 128,
131
/* .maxMeshWorkGroupSizeY_EXT = */ 128,
132
/* .maxMeshWorkGroupSizeZ_EXT = */ 128,
133
/* .maxTaskWorkGroupSizeX_EXT = */ 128,
134
/* .maxTaskWorkGroupSizeY_EXT = */ 128,
135
/* .maxTaskWorkGroupSizeZ_EXT = */ 128,
136
/* .maxMeshViewCountEXT = */ 4,
137
/* .maxDualSourceDrawBuffersEXT = */ 1,
138
// This is the glslang TLimits structure.
139
// It defines whether or not the following features are enabled.
140
// We want them to all be enabled.
141
/*.limits = */ {
142
/*.nonInductiveForLoops = */ 1,
143
/*.whileLoops = */ 1,
144
/*.doWhileLoops = */ 1,
145
/*.generalUniformIndexing = */ 1,
146
/*.generalAttributeMatrixVectorIndexing = */ 1,
147
/*.generalVaryingIndexing = */ 1,
148
/*.generalSamplerIndexing = */ 1,
149
/*.generalVariableIndexing = */ 1,
150
/*.generalConstantMatrixVectorIndexing = */ 1,
151
}};
152
153
} // namespace shaderc_util
154
155