Edit

kc3-lang/angle/src/compiler/translator/builtin_variables.json

Branch :

  • Show log

    Commit

  • Author : Le Hoang Quyen
    Date : 2020-04-21 01:50:00
    Hash : dadd1986
    Message : Implement GL_APPLE_clip_distance - Built-in variable gl_ClipDistance has been added to compiler. - Desktop GL: gl_ClipDistance is supported since GL 3.0. Enable/Disable each gl_ClipDistances[i] works out of the box via glEnable(). - Vulkan/Metal: Use uniform variable to control writing to each gl_ClipDistance. One bit flag controls one element in the gl_ClipDistance array. The writing to the disabled element in vertex shader will be ignored, and turned into zero assignment instead. - Direct3D/Mobile GL: Not implemented yet. - Added ClipDistanceTest to gl_tests and compiler unittests. - GL_APPLE_clip_distance is a subset of GL_EXT_clip_cull_distance, so GL_EXT_clip_cull_distance could be implemented in future if needed. Bug: angleproject:4452 Change-Id: I571ac8b56826989808a680226a04bec4cf59988e Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/2084324 Commit-Queue: Jamie Madill <jmadill@chromium.org> Reviewed-by: Jamie Madill <jmadill@chromium.org>

  • src/compiler/translator/builtin_variables.json
  • {
        "General":{
            "comment":[
                " Copyright 2018 The ANGLE Project Authors. All rights reserved.",
                " Use of this source code is governed by a BSD-style license that can be",
                " found in the LICENSE file.",
                "",
                " The schema of this JSON file is as follows:",
                "",
                " The top-level object contains variable groups. Each group can have the following",
                " properties:",
                "   variables: Object mapping variable names to variable properties.",
                "   subgroups: Object with more groups that fall under the top-level group.",
                "   shader_type: The type of shader this variable is supported in",
                " Each variable can have the following properties:",
                "   essl_level: ESSL symbol table level where the variable is contained.",
                "   glsl_level: GLSL symbol table level where the variable is contained.",
                "   type: Object with properties of the type. Can be substituted with initDynamicType.",
                "   initDynamicType: Template string with C++ code for initializing a TType * with the",
                "                    name {type_name}. The name will be replaced when generating code.",
                "                    May refer to names of previously listed structs or interface",
                "                    blocks.",
                "   essl_extension: Optional. Name of the ESSL extension where this variable is from.",
                "   glsl_extension: Optional. Name of the GLSL extension where this variable is from.",
                "   value: Optional. String that has one valid value: 'resources'. Denotes that the",
                "          value of the variable should be based on the field of ShBuiltInResources",
                "          with the same name as the variable.",
                "   class: Optional. To be used for interface block or struct definitions. Valid",
                "          values are 'TStructure' or 'TInterfaceBlock'.",
                "   fields: Optional. Object to be used for storing fields of interface block and",
                "           struct definitions. Maps field names to field types.",
                "   suffix: Optional. Suffix to give C++ variables storing the properties of this",
                "           variable a unique name that doesn't conflict with C++ keywords.",
                " Each type can have the following properties:",
                "   basic: Basic type as in the TBasicType enum without the Ebt prefix.",
                "   precision: Precision as in TPrecision enum without the Ebp prefix.",
                "   qualifier: Optional. Qualifier as in the TQualifier enum without the Evq prefix.",
                "   primarySize: Optional. Vector size or matrix column count.",
                "   secondarySize: Optional. Matrix row count.",
                " Any group, variable or type can have the property 'comment'."
            ],
            "variables":{
                "gl_DepthRangeParameters":{
                    "class":"TStructure",
                    "essl_level":"COMMON_BUILTINS",
                    "fields":{
                        "near":{
                            "basic":"Float",
                            "precision":"High"
                        },
                        "far":{
                            "basic":"Float",
                            "precision":"High"
                        },
                        "diff":{
                            "basic":"Float",
                            "precision":"High"
                        }
                    }
                },
                "gl_DepthRange":{
                    "essl_level":"COMMON_BUILTINS",
                    "initDynamicType":"TType *{type_name} = new TType(gl_DepthRangeParameters, false); {type_name}->setQualifier(EvqUniform);"
                }
            }
        },
        "Constants":{
            "variables":{
                "gl_MaxVertexAttribs":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVertexUniformVectors":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVertexTextureImageUnits":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxCombinedTextureImageUnits":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxTextureImageUnits":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxFragmentUniformVectors":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVaryingVectors":{
                    "essl_level":"ESSL1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxDrawBuffers":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxDualSourceDrawBuffersEXT":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "essl_extension":"EXT_blend_func_extended",
                    "value":"resources",
                    "valueKey":"MaxDualSourceDrawBuffers"
                },
                "gl_MaxVertexOutputVectors":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxFragmentInputVectors":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MinProgramTexelOffset":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxProgramTexelOffset":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxImageUnits":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVertexImageUniforms":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxFragmentImageUniforms":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxComputeImageUniforms":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxCombinedImageUniforms":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxCombinedShaderOutputResources":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxComputeWorkGroupCount":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"Const",
                        "primarySize":3
                    },
                    "value":"resources"
                },
                "gl_MaxComputeWorkGroupSize":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"Const",
                        "primarySize":3
                    },
                    "value":"resources"
                },
                "gl_MaxComputeUniformComponents":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxComputeTextureImageUnits":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxComputeAtomicCounters":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxComputeAtomicCounterBuffers":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVertexAtomicCounters":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxFragmentAtomicCounters":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxCombinedAtomicCounters":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxAtomicCounterBindings":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxVertexAtomicCounterBuffers":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxFragmentAtomicCounterBuffers":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxCombinedAtomicCounterBuffers":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                },
                "gl_MaxAtomicCounterBufferSize":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"Medium",
                        "qualifier":"Const"
                    },
                    "value":"resources"
                }
            },
            "subgroups":{
                "EXTGeometryShader":{
                    "variables":{
                        "gl_MaxGeometryInputComponents":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryOutputComponents":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryImageUniforms":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryTextureImageUnits":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryOutputVertices":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryTotalOutputComponents":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryUniformComponents":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryAtomicCounters":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        },
                        "gl_MaxGeometryAtomicCounterBuffers":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"EXT_geometry_shader",
                            "value":"resources"
                        }
                    }
                }
            }
        },
        "FragShader":{
            "shader_type": "FRAGMENT",
            "variables":{
                "gl_FragCoord":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"Medium",
                        "qualifier":"FragCoord",
                        "primarySize":4
                    }
                },
                "gl_FrontFacing":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Bool",
                        "qualifier":"FrontFacing"
                    }
                },
                "gl_PointCoord":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"Medium",
                        "qualifier":"PointCoord",
                        "primarySize":2
                    }
                },
                "gl_FragColor":{
                    "essl_level":"ESSL1_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"Medium",
                        "qualifier":"FragColor",
                        "primarySize":4
                    }
                },
                "gl_FragData":{
                    "essl_level":"ESSL1_BUILTINS",
                    "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpMedium, EvqFragData, 4); if (spec != SH_WEBGL2_SPEC && spec != SH_WEBGL3_SPEC) {{ {type_name}->makeArray(resources.MaxDrawBuffers); }} else {{ {type_name}->makeArray(1u); }}"
                },
                "gl_FragDepth":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"High",
                        "qualifier":"FragDepth"
                    }
                },
                "gl_HelperInvocation":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"Bool",
                        "qualifier":"HelperInvocation"
                    }
                }
            },
            "subgroups":{
                "EXTBlendFuncExtended":{
                    "variables":{
                        "gl_SecondaryFragColorEXT":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"EXT_blend_func_extended",
                            "type":{
                                "basic":"Float",
                                "precision":"Medium",
                                "qualifier":"SecondaryFragColorEXT",
                                "primarySize":4
                            }
                        },
                        "gl_SecondaryFragDataEXT":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"EXT_blend_func_extended",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpMedium, EvqSecondaryFragDataEXT, 4, 1); {type_name}->makeArray(resources.MaxDualSourceDrawBuffers);"
                        }
                    }
                },
                "EXTFragDepth":{
                    "variables":{
                        "gl_FragDepthEXT":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"EXT_frag_depth",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, resources.FragmentPrecisionHigh ? EbpHigh : EbpMedium, EvqFragDepthEXT, 1);"
                        }
                    }
                },
                "EXTShaderFramebufferFetch":{
                    "variables":{
                        "gl_LastFragData":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"EXT_shader_framebuffer_fetch",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpMedium, EvqLastFragData, 4, 1); {type_name}->makeArray(resources.MaxDrawBuffers);"
                        }
                    }
                },
                "NVShaderFramebufferFetch":{
                    "variables":{
                        "gl_LastFragColor":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"NV_shader_framebuffer_fetch",
                            "type":{
                                "basic":"Float",
                                "precision":"Medium",
                                "qualifier":"LastFragColor",
                                "primarySize":4
                            }
                        },
                        "gl_LastFragData":{
                            "essl_level":"ESSL1_BUILTINS",
                            "suffix":"NV",
                            "essl_extension":"NV_shader_framebuffer_fetch",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpMedium, EvqLastFragData, 4, 1); {type_name}->makeArray(resources.MaxDrawBuffers);"
                        }
                    }
                },
                "ARMShaderFramebufferFetch":{
                    "variables":{
                        "gl_LastFragColorARM":{
                            "essl_level":"ESSL1_BUILTINS",
                            "essl_extension":"ARM_shader_framebuffer_fetch",
                            "type":{
                                "basic":"Float",
                                "precision":"Medium",
                                "qualifier":"LastFragColor",
                                "primarySize":4
                            }
                        }
                    }
                },
                "GeometryShaderSupported":{
                    "variables":{
                        "gl_PrimitiveID":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "essl_extension":"EXT_geometry_shader",
                            "type":{
                                "basic":"Int",
                                "precision":"High",
                                "qualifier":"PrimitiveID"
                            }
                        },
                        "gl_Layer":{
                            "essl_level":"ESSL3_1_BUILTINS",
                            "essl_extension":"EXT_geometry_shader",
                            "type":{
                                "basic":"Int",
                                "precision":"High",
                                "qualifier":"Layer"
                            }
                        }
                    }
                }
            }
        },
        "VertexShader":{
            "shader_type": "VERTEX",
            "variables":{
                "gl_Position":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"High",
                        "qualifier":"Position",
                        "primarySize":4
                    }
                },
                "gl_PointSize":{
                    "essl_level":"COMMON_BUILTINS",
                    "type":{
                        "basic":"Float",
                        "precision":"Medium",
                        "qualifier":"PointSize"
                    }
                },
                "gl_InstanceID":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"InstanceID"
                    }
                },
                "gl_InstanceIndex":{
                    "essl_level":"GLSL_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"InstanceID",
                        "comment": "In GLSL 450 used by Vulkan"
                    }
                },
                "gl_VertexID":{
                    "essl_level":"ESSL3_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"VertexID"
                    }
                },
                "gl_VertexIndex":{
                    "essl_level":"GLSL_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"VertexID",
                        "comment": "In GLSL 450 used by Vulkan"
                    }
                },
                "gl_ViewportIndex":{
                    "comment":"For internal use by ANGLE - not exposed to the parser.",
                    "essl_level":"GLSL_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"ViewportIndex"
                    }
                },
                "gl_Layer":{
                    "suffix":"VS",
                    "comment":"gl_Layer exists in other shader stages in ESSL, but not in vertex shader so far.",
                    "essl_level":"GLSL_BUILTINS",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"Layer"
                    }
                }
            },
            "subgroups":{
                "ANGLEMultiDraw":{
                    "subgroups":{
                      "ESSL3":{
                            "variables":{
                                "gl_DrawID":{
                                    "essl_level":"COMMON_BUILTINS",
                                    "essl_extension":"ANGLE_multi_draw",
                                    "type":{
                                        "basic":"Int",
                                        "precision":"High",
                                        "qualifier":"DrawID"
                                    }
                                }
                            }
                        }
                    }
                },
                "ANGLEBaseVertexBaseInstance":{
                    "subgroups":{
                      "ESSL3":{
                            "variables":{
                                "gl_BaseVertex":{
                                    "essl_level":"ESSL3_BUILTINS",
                                    "essl_extension":"ANGLE_base_vertex_base_instance",
                                    "type":{
                                        "basic":"Int",
                                        "precision":"High",
                                        "qualifier":"BaseVertex"
                                    }
                                },
                                "gl_BaseInstance":{
                                    "essl_level":"ESSL3_BUILTINS",
                                    "essl_extension":"ANGLE_base_vertex_base_instance",
                                    "type":{
                                        "basic":"Int",
                                        "precision":"High",
                                        "qualifier":"BaseInstance"
                                    }
                                },
                                "angle_BaseVertex":{
                                    "essl_level":"COMMON_BUILTINS",
                                    "essl_extension":"ANGLE_base_vertex_base_instance",
                                    "type":{
                                        "basic":"Int",
                                        "precision":"High",
                                        "qualifier":"BaseVertex"
                                    }
                                },
                                "angle_BaseInstance":{
                                    "essl_level":"COMMON_BUILTINS",
                                    "essl_extension":"ANGLE_base_vertex_base_instance",
                                    "type":{
                                        "basic":"Int",
                                        "precision":"High",
                                        "qualifier":"BaseInstance"
                                    }
                                }
                            }
                        }
                    }
                },
                "APPLEClipDistance":{
                    "variables":{
                        "gl_ClipDistance":{
                            "essl_level":"COMMON_BUILTINS",
                            "essl_extension":"APPLE_clip_distance",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpHigh, EvqClipDistance, 1); {type_name}->makeArray(resources.MaxClipDistances);"
                        },
                        "gl_MaxClipDistances":{
                            "essl_level":"COMMON_BUILTINS",
                            "type":{
                                "basic":"Int",
                                "precision":"Medium",
                                "qualifier":"Const"
                            },
                            "essl_extension":"APPLE_clip_distance",
                            "value":"resources"
                        }
                    }
                }
            }
        },
        "ComputeShader":{
            "shader_type": "COMPUTE",
            "variables":{
                "gl_NumWorkGroups":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"NumWorkGroups",
                        "primarySize":3
                    }
                },
                "gl_WorkGroupSize":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"WorkGroupSize",
                        "primarySize":3
                    }
                },
                "gl_WorkGroupID":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"WorkGroupID",
                        "primarySize":3
                    }
                },
                "gl_LocalInvocationID":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"LocalInvocationID",
                        "primarySize":3
                    }
                },
                "gl_GlobalInvocationID":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"GlobalInvocationID",
                        "primarySize":3
                    }
                },
                "gl_LocalInvocationIndex":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "type":{
                        "basic":"UInt",
                        "precision":"Undefined",
                        "qualifier":"LocalInvocationIndex"
                    }
                }
            }
        },
        "GeometryShader":{
            "shader_type": "GEOMETRY_EXT",
            "variables":{
                "gl_PrimitiveIDIn":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"PrimitiveIDIn"
                    }
                },
                "gl_InvocationID":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"InvocationID"
                    }
                },
                "gl_PrimitiveID":{
                    "suffix":"GS",
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"PrimitiveID"
                    }
                },
                "gl_Layer":{
                    "suffix":"GS",
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "type":{
                        "basic":"Int",
                        "precision":"High",
                        "qualifier":"Layer"
                    }
                },
                "gl_PerVertex":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "class":"TInterfaceBlock",
                    "fields":{
                        "gl_Position":{
                            "basic":"Float",
                            "precision":"High",
                            "qualifier":"Position",
                            "primarySize":4
                        }
                    }
                },
                "gl_in":{
                    "essl_level":"ESSL3_1_BUILTINS",
                    "essl_extension":"EXT_geometry_shader",
                    "initDynamicType":"TType *{type_name} = new TType(gl_PerVertex, EvqPerVertexIn, TLayoutQualifier::Create()); {type_name}->makeArray(0u);",
                    "comment":"The array size of gl_in is undefined until we get a valid input primitive declaration."
                }
            },
            "subgroups":{
                "Out":{
                    "variables":{
                        "gl_PerVertex":{
                            "suffix":"OutBlock",
                            "essl_level":"ESSL3_1_BUILTINS",
                            "essl_extension":"EXT_geometry_shader",
                            "private":true,
                            "class":"TInterfaceBlock",
                            "fields":{
                                "gl_Position":{
                                    "basic":"Float",
                                    "precision":"High",
                                    "qualifier":"Position",
                                    "primarySize":4
                                }
                            }
                        },
                        "gl_Position":{
                            "suffix":"GS",
                            "essl_level":"ESSL3_1_BUILTINS",
                            "essl_extension":"EXT_geometry_shader",
                            "initDynamicType":"TType *{type_name} = new TType(EbtFloat, EbpHigh, EvqPosition, 4); {type_name}->setInterfaceBlock(gl_PerVertexOutBlock);"
                        }
                    }
                }
            }
        },
        "Multiview":{
            "shader_type": "NOT_COMPUTE",
            "subgroups":{
                "ESSL3":{
                    "variables":{
                        "gl_ViewID_OVR":{
                            "essl_level":"ESSL3_BUILTINS",
                            "essl_extension":"OVR_multiview",
                            "type":{
                                "basic":"UInt",
                                "precision":"High",
                                "qualifier":"ViewIDOVR"
                            }
                        }
                    }
                }
            }
        }
    }