├── LICENSE ├── README.md ├── graphicscodepack.lua └── graphicscodepack ├── api ├── cg │ └── stdlib.lua ├── glsl │ └── std.lua ├── hlsl │ └── dx11.lua └── lua │ ├── glewgl.lua │ ├── glfw.lua │ ├── glfw3.lua │ ├── shaderc.lua │ └── vulkan1.lua ├── interpreters └── luajitgfxsandbox.lua ├── spec ├── cbase.lua ├── glsl.lua ├── hlsl.lua └── oglgpuprog.lua └── tools ├── cstringify.lua ├── dxc.lua ├── ffitoapi.lua ├── fxc.lua ├── glslang.lua ├── glslc.lua ├── perforce_edit.lua └── perforce_revert.lua /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2017 Christoph Kubisch 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 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 THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # zbstudio-graphicscodepack 2 | A package for [ZeroBraneStudio](https://studio.zerobrane.com/) to aid graphics programming in Lua (OpenGL, Vulkan etc.). Its content originates from the [Estrela Editor](http://www.luxinia.de/index.php/Estrela/Estrela) from which zbstudio was forked. The installation of this package supercedes the "estrela" configuration that zbstudio used previously. 3 | 4 | ## Installation 5 | 6 | ZeroBraneStudio 1.51 or a version from this [commit](https://github.com/pkulchenko/ZeroBraneStudio/commit/9c8b3f0167361cc7e065e48a5deb9f6c93fd03a4) onwards. 7 | 8 | There is two differnt options: 9 | 10 | * Install like a regular package, put the lua file and the subdirectory of this repository into zbstudio's package directory 11 | * Put a dummy file into the package directory that simply forwards to the content of this repository: 12 | 13 | `return dofile([[Absolute filepath to graphicscodepack.lua]])` 14 | 15 | ## Features 16 | 17 | ### GLSL 18 | This package comes with a spec, api tooltips, and tools for GLSL. 19 | 20 | #### GLSLC Tool 21 | Uses [glslc](https://github.com/pixeljetstream/glslc), which makes use of the system's OpenGL driver to compile the files (not recommended anymore, prefer to use GLSLANG, see below) 22 | To make the GLSLC menu working either modify your zbstudio's `cfg/user.lua` and add `path.glslcbin = [[path to glslc.exe (excluded)]]` or set the `GLSLC_BIN_PATH` environment variable. 23 | 24 | ![glslc inside zbstudio](http://www.luxinia.de/images/estrela_glslc.png). 25 | 26 | The GLASM output from glslc is also analyzed and formated by the tool. However, be aware that this is just an intermediate format for NVIDIA and not the actual assembly. 27 | 28 | ![glslc_glasm](http://www.luxinia.de/uploads/Estrela/Estrelacg.png) 29 | 30 | Depending on the shadertype a define is set, e.g. `-D_VERTEX_SHADER_ -D_IDE_`. 31 | 32 | #### GLSLANG Tool 33 | Uses the official Khronos [glslangValidator](https://github.com/KhronosGroup/glslang) from the installed [VulkanSDK](https://vulkan.lunarg.com/sdk/home). 34 | To get the GLSLANG menu, modify `cfg/user.lua` and add `path.glslangbin = [[path to glslangValidator.exe (excluded)]]` otherwise `(os.getenv("VULKAN_SDK") and os.getenv("VULKAN_SDK").."/Bin")` is used. 35 | 36 | The menu looks similar to the above tool. On success two files are generated `.spv` and `.txt` (humand readable spir-v). 37 | By default shaders are compiled targeting Vulkan 1.1. The tool does support raytracing and mesh shaders. 38 | 39 | Depending on the shadertype a define is set, e.g. `-D_VERTEX_SHADER_ -D_IDE_`. 40 | 41 | To add project specific include directories: 42 | * put `zbsgfxpack.lua` file in project directory 43 | * return include paths through the lua file: `return { glslang = { includes = { "myIncludeDirectory", ...} } }` 44 | 45 | ### HLSL 46 | Similar as above is provided for the DirectX HLSL (however not maintained as much as GLSL). 47 | 48 | #### DXC Tool 49 | To get the DXC menu entry, modify `cfg/user.lua` and add `path.dxcbin = [[path to dxc.exe (excluded)]]` 50 | 51 | #### FXC Tool 52 | To get the FXC menu entry, modify `cfg/user.lua` and add `path.fxcbin = [[path to fxc.exe (excluded)]]` otherwise `(os.getenv("DXSDK_DIR") and os.getenv("DXSDK_DIR").."/Utilities/bin/x86/")` is used. 53 | 54 | Depending on the shadertype a define is set, e.g. `-D_VERTEX_SHADER_ -D_IDE_`. 55 | 56 | ### Lua 57 | #### Api Files 58 | There is api completion for various lua-ffi bindings: 59 | * [GLFW](http://www.glfw.org) 2 and 3 60 | * OpenGL (glewgl) core + ARB,NV,AMD extensions 61 | * Vulkan 62 | * [ShaderC](https://github.com/google/shaderc) 63 | 64 | #### Interpreter 65 | An interpreter for the [LuaJIT gfx sandbox](https://github.com/pixeljetstream/luajit_gfx_sandbox) is provided, which makes use of the above bindings. It can be used by setting `path.luajitgfxsandbox = [[path to luajit gfx runtime directory]]` in the config file or via `LUAJIT_GFX_SANDBOX_PATH` environment variable. The interpreter does support debugging. 66 | 67 | ### Tools 68 | #### LuaJIT ffi string to editor api 69 | A tool is provided to turn a LuaJIT ffi C header into an api specification that zbstudio can use. This makes adding auto completion and tooltips for C apis easier. Ensure the ffi header is in the active editor tab when running the tool. 70 | 71 | #### Perforce edit/revert 72 | To some basic perforce operations with the current file 73 | 74 | #### stringify to C 75 | Surrounds every line of the active editor file by quotes and new line symbol: ```" original content \n"``` 76 | -------------------------------------------------------------------------------- /graphicscodepack.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "Collection of components for graphics modules", 3 | description = "Adds a collection of specs, tools, and interpreters for graphics coding.", 4 | author = "Christoph Kubisch", 5 | version = 0.2, 6 | dependencies = "1.51", 7 | 8 | onRegister = function(self) 9 | local cwd = wx.wxFileName.GetCwd() 10 | local scriptFile = debug.getinfo(1, "S").source:sub(2) 11 | 12 | local usedPath = wx.wxFileName(scriptFile):IsRelative() and 13 | MergeFullPath(self:GetFilePath(), "../"..self:GetFileName()) or 14 | MergeFullPath(GetPathWithSep(scriptFile),GetFileName(scriptFile)) 15 | 16 | --DisplayOutput(usedPath, scriptPath, defaultPath) 17 | wx.wxFileName.SetCwd(usedPath) 18 | ide:LoadTool() 19 | ide:LoadSpec() 20 | ide:LoadInterpreter() 21 | ide:LoadAPI() 22 | if cwd then wx.wxFileName.SetCwd(cwd) end 23 | end, 24 | } 25 | -------------------------------------------------------------------------------- /graphicscodepack/api/cg/stdlib.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local function fn (description) 5 | local description2,returns,args = description:match("(.+)%-%s*(%b())%s*(%b())") 6 | if not description2 then 7 | return {type="function",description=description, 8 | returns="(?)"} 9 | end 10 | return {type="function",description=description2, 11 | returns=returns:gsub("^%s+",""):gsub("%s+$",""), args = args} 12 | end 13 | 14 | local function val (description) 15 | return {type="value",description = description} 16 | end 17 | -- docs 18 | local api = { 19 | abs = fn "returns absolute value of scalars and vectors. - (typeN)(typeN)", 20 | acos = fn "returns arccosine of scalars and vectors. - (typeN)(typeN)", 21 | all = fn "returns true if a boolean scalar or all components of a boolean vector are true. - (bool)(boolN)", 22 | any = fn "returns true if a boolean scalar or any component of a boolean vector is true. - (bool)(boolN)", 23 | asin = fn "returns arcsine of scalars and vectors. - (typeN)(typeN)", 24 | atan = fn "returns arctangent of scalars and vectors. - (typeN)(typeN)", 25 | atan2 = fn "returns the arctangent of y/x. atan2 is well defined for every point other than the origin, even if x equals 0 and y does not equal 0. - (typeN)(typeN y, typeN x)", 26 | ceil = fn "returns smallest integer not less than a scalar or each vector component. - (typeN)(typeN)", 27 | clamp = fn "returns x clamped to the range [a,b]. - (typeN)(typeN x, a, b)", 28 | clip = fn "conditionally (<0) kill a pixel before output. - ()(typeN)", 29 | cos = fn "returns cosine of scalars and vectors. - (typeN)(typeN)", 30 | cosh = fn "returns hyperbolic cosine of scalars and vectors. - (typeN)(typeN)", 31 | cross = fn "returns the cross product of two three-component vectors. - (type3)(type3 a, b)", 32 | ddx = fn "returns approximate partial derivative with respect to window-space X. - (typeN)(typeN)", 33 | ddy = fn "returns approximate partial derivative with respect to window-space Y. - (typeN)(typeN)", 34 | degrees = fn "converts values of scalars and vectors from radians to degrees. - (typeN)(typeN)", 35 | determinant = fn "returns the scalar determinant of a square matrix. - (float)(floatNxN)", 36 | distance = fn "return the Euclidean distance between two points. - (typeN)(typeN a, b)", 37 | dot = fn "returns the scalar dot product of two vectors. - (type)(typeN a, b)", 38 | exp = fn "returns the base-e exponential of scalars and vectors. - (typeN)(typeN)", 39 | exp2 = fn "returns the base-2 exponential of scalars and vectors. - (typeN)(typeN)", 40 | faceforward = fn "returns a normal as-is if a vertex's eye-space position vector points in the opposite direction of a geometric normal, otherwise return the negated version of the normal. - (typeN)(typeN Nperturbated, Incident, Ngeometric)", 41 | floatToIntBits = fn "returns the 32-bit integer representation of an IEEE 754 floating-point scalar or vector - (intN)(floatN)", 42 | floatToRawIntBits = fn "returns the raw 32-bit integer representation of an IEEE 754 floating-point scalar or vector. - (intN)(floatN)", 43 | floor = fn "returns largest integer not greater than a scalar or each vector component. - (typeN)(typeN)", 44 | fmod = fn "returns the remainder of x/y with the same sign as x. - (typeN)(typeN x, y)", 45 | frac = fn "returns the fractional portion of a scalar or each vector component. - (typeN)(typeN)", 46 | frexp = fn "splits scalars and vectors into normalized fraction and a power of 2. - (typeN)(typeN x, out typeN e)", 47 | fwidth = fn "returns sum of approximate window-space partial derivatives magnitudes. - (typeN)(typeN)", 48 | intBitsToFloat = fn "returns the float value corresponding to a given bit represention.of a scalar int value or vector of int values. - (floatN)(intN)", 49 | isfinite = fn "test whether or not a scalar or each vector component is a finite value. - (boolN)(typeN)", 50 | isinf = fn "test whether or not a scalar or each vector component is infinite. - (boolN)(typeN)", 51 | isnan = fn "test whether or not a scalar or each vector component is not-a-number. - (boolN)(typeN)", 52 | ldexp = fn "returns x times 2 rained to n. - (typeN)(typeN a, n)", 53 | length = fn "return scalar Euclidean length of a vector. - (type)(typeN)", 54 | lerp = fn "lerp - returns linear interpolation of two scalars or vectors based on a weight. - (typeN)(typeN a, b, weight)", 55 | lit = fn "computes lighting coefficients for ambient(x), diffuse(y), and specular(z) lighting contributions (w=1). - (type4)(type NdotL, NdotH, specshiny)", 56 | log = fn "returns the natural logarithm of scalars and vectors. - (typeN)(typeN)", 57 | log10 = fn "returns the base-10 logarithm of scalars and vectors. - (typeN)(typeN)", 58 | log2 = fn "returns the base-2 logarithm of scalars and vectors. - (typeN)(typeN)", 59 | max = fn "returns the maximum of two scalars or each respective component of two vectors. - (typeN)(typeN a, b)", 60 | min = fn "returns the minimum of two scalars or each respective component of two vectors. - (typeN)(typeN a, b)", 61 | mul = fn "Returns the vector result of multiplying a matrix M by a column vector v; a row vector v by a matrix M; or a matrix A by a second matrix B. - (typeN)(typeNxN/typeN a, typeN/typeNxN b)", 62 | normalize = fn "Returns the normalized version of a vector, meaning a vector in the same direction as the original vector but with a Euclidean length of one. - (typeN)(typeN)", 63 | pow = fn "returns x to the y-th power of scalars and vectors. - (typeN)(typeN x, y)", 64 | radians = fn "converts values of scalars and vectors from degrees to radians. - (typeN)(typeN)", 65 | reflect = fn "returns the reflectiton vector given an incidence vector and a normal vector. - (typeN)(typeN incidence, normal)", 66 | refract = fn "computes a refraction vector. - (typeN)(typeN incidence, normal, type eta)", 67 | round = fn "returns the rounded value of scalars or vectors. - (typeN)(typeN a)", 68 | rsqrt = fn "returns reciprocal square root of scalars and vectors. 1/sqrt. - (typeN)(typeN)", 69 | saturate = fn "returns x saturated to the range [0,1]. - (typeN)(typeN)", 70 | sign = fn "returns sign (1 or -1) of scalar or each vector component. - (typeN)(typeN)", 71 | sin = fn "returns sine of scalars and vectors. - (typeN)(typeN)", 72 | sincos = fn "returns sine of scalars and vectors. - ()(typeN x, out typeN sin, out typeN cos)", 73 | sinh = fn "returns hyperbolic sine of scalars and vectors. - (typeN)(typeN)", 74 | sqrt = fn "returns square root of scalars and vectors. - (typeN)(typeN)", 75 | step = fn "implement a step function returning either zero or one (a <= b). - (typeN)(typeN a, b)", 76 | tan = fn "returns tangent of scalars and vectors. - (typeN)(typeN)", 77 | tanh = fn "returns hyperbolic tangent of scalars and vectors. - (typeN)(typeN)", 78 | transpose = fn "returns transpose matrix of a matrix. - (typeRxC)(typeCxR)", 79 | trunc = fn "returns largest integer not greater than a scalar or each vector component. - (typeN)(typeN)", 80 | 81 | tex1D = fn "performs a texture lookup in a given 1D sampler and, in some cases, a shadow comparison (as .y coord). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(sampler1D, float/float2 s, |float dx, dy|,[int texeloffset])", 82 | tex1Dbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler1D, float4 s, [int texeloffset])", 83 | tex1Dcmpbias = fn "performs a texture lookup with bias and shadow compare in a given sampler (compare as .y, bias as .w). - (float4)(sampler1D, float4 s, [int texeloffset])", 84 | tex1Dcmplod = fn "performs a texture lookup with a specified level of detail and a shadow compare in a given sampler (compare as .y, lod as .w). - (float4)(sampler1D, float4 s, [int texeloffset])", 85 | tex1Dfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .w). - (float4)(sampler1D, int4 s, [int texeloffset])", 86 | tex1Dlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(sampler1D, float4 s, [int texeloffset])", 87 | tex1Dproj = fn "performs a texture lookup with projection in a given sampler. May perform a shadow comparison if argument for shadow comparison is provided. (shadow in .y for float3 coord, proj in .y or .z) - (float4)(sampler1D, float2/float3 s, [int texeloff])", 88 | tex1Dsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler1D, int lod)", 89 | 90 | tex2D = fn "performs a texture lookup in a given 2D sampler and, in some cases, a shadow comparison (as .z coord). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(sampler2D, float2/float3 s, |float2 dx, dy|,[int texeloffset])", 91 | tex2Dbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler2D, float4 s, [int texeloffset])", 92 | tex2Dcmpbias = fn "performs a texture lookup with bias and shadow compare in a given sampler (compare as .z, bias as .w). - (float4)(sampler2D, float4 s, [int texeloffset])", 93 | tex2Dcmplod = fn "performs a texture lookup with a specified level of detail and a shadow compare in a given sampler (compare as .y, lod as .w). - (float4)(sampler2D, float4 s, [int texeloffset])", 94 | tex2Dfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .w). - (float4)(sampler2D, int4 s, [int texeloffset])", 95 | tex2Dlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(sampler2D, float4 s, [int texeloffset])", 96 | tex2Dproj = fn "performs a texture lookup with projection in a given sampler. May perform a shadow comparison if argument for shadow comparison is provided. (shadow in .z for float3 coord, proj in .z or .w) - (float4)(sampler2D, float3/float4 s, [int texeloff])", 97 | tex2Dsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler2D, int lod)", 98 | tex2Dgather = fn "returns 4 texels of a given single channel texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler2D, int lod)", 99 | 100 | tex3D = fn "performs a texture lookup in a given 3D sampler. May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(sampler3D, float3 s, {float3 dx, dy},[int texeloffset])", 101 | tex3Dbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler3D, float4 s, [int texeloffset])", 102 | tex3Dfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .w). - (float4)(sampler3D, int4 s, [int texeloffset])", 103 | tex3Dlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(sampler3D, float4 s, [int texeloffset])", 104 | tex3Dproj = fn "performs a texture lookup with projection in a given sampler. (proj in .w) - (float4)(sampler3D, float4 s, [int texeloff])", 105 | tex3Dsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler3D, int lod)", 106 | 107 | texBUF = fn "performs an unfiltered texture lookup in a given texture buffer sampler. (only gp4 profiles) - (float4)(samplerBUF, int s)", 108 | texBUFsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(samplerBUF, int lod)", 109 | 110 | texRBUF = fn "performs a multi-sampled texture lookup in a renderbuffer. (only gp4 profiles) - (float4)(samplerRBUF, int2 s, int sample)", 111 | texRBUFsize = fn "returns the size of a given renderbuffer. (only gp4 profiles) - (int2)(samplerBUF)", 112 | 113 | texCUBE = fn "performs a texture lookup in a given CUBE sampler and, in some cases, a shadow comparison (float4 coord). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(samplerCUBE, float3/float4 s, |float3 dx, dy|)", 114 | texCUBEbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler1D, float4 s, [int texeloffset])", 115 | texCUBElod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(sampler1D, float4 s, [int texeloffset])", 116 | texCUBEproj = fn "performs a texture lookup with projection in a given sampler. (proj in .w) - (float4)(samplerCUBE, float4 s)", 117 | texCUBEsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler1D, int lod)", 118 | 119 | texRECT = fn "performs a texture lookup in a given RECT sampler and, in some cases, a shadow comparison (as .z). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(samplerRECT, float2/float3 s, |float2 dx, dy|, [int texeloff])", 120 | texRECTbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(samplerRECT, float4 s, [int texeloffset])", 121 | texRECTfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .w). - (float4)(samplerRECT, int4 s, [int texeloffset])", 122 | texRECTlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(samplerRECT, float4 s, [int texeloffset])", 123 | texRECTproj = fn "performs a texture lookup with projection in a given sampler. May perform a shadow comparison if argument for shadow comparison is provided. (shadow in .z for float3 coord, proj in .z or .w) - (float4)(samplerRECT, float3/float4 s, [int texeloff])", 124 | texRECTsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(samplerRECT, int lod)", 125 | 126 | tex1DARRAY = fn "performs a texture lookup in a given 1D sampler array and, in some cases, a shadow comparison (as .z). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(sampler1DARRAY, float2/float3 s, {float dx, dy},[int texeloffset])", 127 | tex1DARRAYbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler1DARRAY, float4 s, [int texeloffset])", 128 | tex1DARRAYcmpbias = fn "performs a texture lookup with bias and shadow compare in a given sampler (layer as .y, compare as .z, bias as .w). - (float4)(sampler1DARRAY, float4 s, [int texeloffset])", 129 | tex1DARRAYcmplod = fn "performs a texture lookup with a specified level of detail and a shadow compare in a given sampler (compare as .z, lod as .w). - (float4)(sampler1DARRAY, float4 s, [int texeloffset])", 130 | tex1DARRAYfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .z). - (float4)(sampler1DARRAY, int3 s, [int texeloffset])", 131 | tex1DARRAYlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .z) - (float4)(sampler1DARRAY, float3 s, [int texeloffset])", 132 | tex1DARRAYproj = fn "performs a texture lookup with projection in a given sampler. May perform a shadow comparison if argument for shadow comparison is provided. (shadow in .z for float3 coord, proj in .z or .w) - (float4)(sampler1DARRAY, float3/float4 s, [int texeloff])", 133 | tex1DARRAYsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler1DARRAY, int lod)", 134 | 135 | tex2DARRAY = fn "performs a texture lookup in a given 2D sampler array and, in some cases, a shadow comparison (as .w coord). May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(sampler2DARRAY, float3/float4 s, {float2 dx, dy},[int texeloffset])", 136 | tex2DARRAYbias = fn "performs a texture lookup with bias in a given sampler (as .w). - (float4)(sampler2DARRAY, float4 s, [int texeloffset])", 137 | tex2DARRAYfetch = fn "performs an unfiltered texture lookup in a given sampler (lod as .w). - (float4)(sampler2DARRAY, int4 s, [int texeloffset])", 138 | tex2DARRAYlod = fn "performs a texture lookup with a specified level of detail in a given sampler (lod as .w) - (float4)(sampler2DARRAY, float4 s, [int texeloffset])", 139 | tex2DARRAYproj = fn "performs a texture lookup with projection in a given sampler. May perform a shadow comparison if argument for shadow comparison is provided. (proj in .w) - (float4)(sampler2DARRAY, float4 s, [int texeloff])", 140 | tex2DARRAYsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(sampler2DARRAY, int lod)", 141 | 142 | texCUBEARRAY = fn "performs a texture lookup in a given CUBE sampler array. May also use pre computed derivatives if those are provided. Texeloffset only in gp4 or higher profiles. - (float4)(samplerCUBEARRAY, float4 s, {float3 dx, dy},[int texeloffset])", 143 | texCUBEARRAYsize = fn "returns the size of a given texture image for a given level of detail. (only gp4 profiles) - (int3)(samplerCUBEARRAY, int lod)", 144 | 145 | unpack_4ubyte = fn "interprets the single float as 4 normalized unsigned bytes and returns the vector. (only nv/gp4 profiles) - (float4)(float)", 146 | pack_4ubyte = fn "packs the floats into a single storing as normalized unsigned bytes.(only nv/gp4 profiles) - (float)(float4)", 147 | unpack_4byte = fn "interprets the single float as 4 normalized signed bytes and returns the vector. (only nv/gp4 profiles) - (float4)(float)", 148 | pack_4ubyte = fn "packs the floats into a single storing as normalized signed bytes.(only nv/gp4 profiles) - (float)(float4)", 149 | unpack_4ushort = fn "interprets the single float as 2 normalized unsigned shorts and returns the vector. (only nv/gp4 profiles) - (float2)(float)", 150 | pack_4ushort = fn "packs the floats into a single storing as normalized unsigned shorts.(only nv/gp4 profiles) - (float)(float2)", 151 | unpack_2half = fn "interprets the single float as 2 16-bit floats and returns the vector. (only nv/gp4 profiles) - (float2)(float)", 152 | pack_2half = fn "packs the floats into a single storing as 16-bit floats.(only nv/gp4 profiles) - (float)(float2)", 153 | } 154 | 155 | local keyw = 156 | [[int half float float3 float4 float2 float3x3 float3x4 float4x3 float4x4 157 | float1x2 float2x1 float2x2 float2x3 float3x2 float1x3 float3x1 float4x1 float1x4 158 | float2x4 float4x2 double1x4 double4x4 double4x2 double4x3 double3x4 double2x4 double1x4 159 | double half half2 half3 half4 int2 int3 uint uint2 uint3 uint4 160 | int4 bool bool2 bool3 bool4 string struct typedef 161 | usampler usampler1D usampler2D usampler3D usamplerRECT usamplerCUBE isampler1DARRAY usampler2DARRAY usamplerCUBEARRAY 162 | isampler isampler1D isampler2D isampler3D isamplerRECT isamplerCUBE isampler1DARRAY isampler2DARRAY isamplerCUBEARRAY 163 | usamplerBUF isamplerBUF samplerBUF 164 | sampler sampler1D sampler2D sampler3D samplerRECT samplerCUBE sampler1DARRAY sampler2DARRAY samplerCUBEARRAY 165 | texture texture1D texture2D texture3D textureRECT textureCUBE texture1DARRAY texture2DARRAY textureCUBEARRAY 166 | 167 | decl do else extern false for if in inline inout out pass 168 | pixelshader return shared static string technique true 169 | uniform vector vertexshader void volatile while 170 | 171 | asm compile const auto break case catch char class const_cast continue default delete 172 | dynamic_cast enum explicit friend goto long mutable namespace new operator private protected 173 | public register reinterpret_case short signed sizeof static_cast switch template this throw 174 | try typename union unsigned using virtual 175 | 176 | POSITION PSIZE DIFFUSE SPECULAR TEXCOORD FOG COLOR COLOR0 COLOR1 COLOR2 COLOR3 TEXCOORD0 TEXCOORD1 TEXCOORD2 TEXCOORD3 177 | TEXCOORD4 TEXCOORD5 TEXCOORD6 TEXCOORD7 TEXCOORD8 TEXCOORD9 TEXCOORD10 TEXCOORD11 TEXCOORD12 TEXCOORD13 TEXCOORD14 178 | TEXCOORD15 179 | NORMAL WPOS 180 | ATTR0 ATTR1 ATTR2 ATTR3 ATTR4 ATTR5 ATTR6 ATTR7 ATTR8 ATTR9 ATTR10 ATTR11 ATTR12 ATTR13 ATTR14 ATTR15 181 | TEXUNIT0 TEXUNIT1 TEXUNIT2 TEXUNIT3 TEXUNIT4 TEXUNIT5 TEXUNIT6 TEXUNIT7 TEXUNIT8 TEXUNIT9 TEXUNIT10 TEXUNIT11 TEXUNIT12 182 | TEXUNIT13 TEXUNIT14 TEXUNIT15 183 | 184 | PROJ PROJECTION PROJECTIONMATRIX PROJMATRIX 185 | PROJMATRIXINV PROJINV PROJECTIONINV PROJINVERSE PROJECTIONINVERSE PROJINVMATRIX PROJECTIONINVMATRIX PROJINVERSEMATRIX PROJECTIONINVERSEMATRIX 186 | VIEW VIEWMATRIX VIEWMATRIXINV VIEWINV VIEWINVERSE VIEWINVERSEMATRIX VIEWINVMATRIX 187 | VIEWPROJECTION VIEWPROJ VIEWPROJMATRIX VIEWPROJECTIONMATRIX 188 | WORLD WORLDMATRIX WORLDVIEW WORLDVIEWMATRIX 189 | WORLDVIEWPROJ WORLDVIEWPROJECTION WORLDVIEWPROJMATRIX WORLDVIEWPROJECTIONMATRIX 190 | VIEWPORTSIZE VIEWPORTDIMENSION 191 | VIEWPORTSIZEINV VIEWPORTSIZEINVERSE VIEWPORTDIMENSIONINV VIEWPORTDIMENSIONINVERSE INVERSEVIEWPORTDIMENSIONS 192 | FOGCOLOR FOGDISTANCE CAMERAWORLDPOS CAMERAWORLDDIR 193 | 194 | CENTROID FLAT NOPERSPECTIVE FACE PRIMITIVEID VERTEXID 195 | 196 | ]] 197 | 198 | -- keywords - shouldn't be left out 199 | for w in keyw:gmatch("([_%w]+)") do 200 | api[w] = {type="keyword"} 201 | end 202 | 203 | return api 204 | 205 | 206 | -------------------------------------------------------------------------------- /graphicscodepack/api/glsl/std.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | --[[ 5 | -- code to convert list of "blah function(arguments);" 6 | 7 | for ret,fn,args in list:gmatch("([%w_]+) ([%w_]+)(%b());") do 8 | print(fn..' = fn " - ('..(ret == "void" and "" or ret)..')'..args..'",') 9 | end 10 | ]] 11 | 12 | -- function helpers 13 | local function fn (description) 14 | local description2,returns,args = description:match("(.+)%-%s*(%b())%s*(%b())") 15 | if not description2 then 16 | return {type="function",description=description, 17 | returns="(?)"} 18 | end 19 | return {type="function",description=description2, 20 | returns=returns:gsub("^%s+",""):gsub("%s+$",""), args = args} 21 | end 22 | 23 | local function val (description) 24 | return {type="value",description = description} 25 | end 26 | -- docs 27 | local api = { 28 | radians = fn "converts degrees to radians - (vecN)(vecN)", 29 | degrees = fn "converts radians to degrees - (vecN)(vecN)", 30 | sin = fn "returns sine of scalars and vectors. - (vecN)(vecN)", 31 | sinh = fn "returns hyperbolic sine of scalars and vectors. - (vecN)(vecN)", 32 | cos = fn "returns cosine of scalars and vectors. - (vecN)(vecN)", 33 | cosh = fn "returns hyperbolic cosine of scalars and vectors. - (vecN)(vecN)", 34 | atan = fn "returns arc tangent of scalars and vectors. - (vecN)([vecN y_over_x ]/[vecN y, vecN x])", 35 | asin = fn "returns arc sine of scalars and vectors. - (vecN)(vecN)", 36 | acos = fn "returns arc cosine of scalars and vectors. - (vecN)(vecN)", 37 | atan = fn "returns arc tangent of scalars and vectors. - (vecN)(vecN)", 38 | tan = fn "returns tangent of scalars and vectors. - (vecN)(vecN)", 39 | tanh = fn "returns hyperbolic tangent of scalars and vectors. - (vecN)(vecN)", 40 | acosh = fn "returns hyperbolic arc cosine of scalars and vectors. - (vecN)(vecN)", 41 | asinh = fn "returns hyperbolic arc sine of scalars and vectors. - (vecN)(vecN)", 42 | atanh = fn "returns hyperbolic arc tangent of scalars and vectors. - (vecN)(vecN)", 43 | 44 | exp = fn "returns the base-e exponential of scalars and vectors. - (vecN)(vecN)", 45 | exp2 = fn "returns the base-2 exponential of scalars and vectors. - (vecN)(vecN)", 46 | log = fn "returns the natural logarithm of scalars and vectors. - (vecN)(vecN)", 47 | log2 = fn "returns the base-2 logarithm of scalars and vectors. - (vecN)(vecN)", 48 | pow = fn "returns x to the y-th power of scalars and vectors. - (vecN)(vecN x, y)", 49 | sqrt = fn "returns square root of scalars and vectors. - (vecN)(vecN)", 50 | inversesqrt = fn "returns inverse square root of scalars and vectors. - (vecN)(vecN)", 51 | 52 | abs = fn "returns absolute value of scalars and vectors. - (vecN)(vecN)", 53 | sign = fn "returns sign (1 or -1) of scalar or each vector component. - (vecN)(vecN)", 54 | floor = fn "returns largest integer not greater than a scalar or each vector component. - (vecN)(vecN)", 55 | ceil = fn "returns smallest integer not less than a scalar or each vector component. - (vecN)(vecN)", 56 | trunc = fn "returns largest integer not greater than a scalar or each vector component. - (vecN)(vecN)", 57 | round = fn "returns the rounded value of scalars or vectors. - (vecN)(vecN a)", 58 | roundEven = fn "returns the nearest even integer value of scalars or vectors. - (vecN)(vecN a)", 59 | fract = fn "returns the fractional portion of a scalar or each vector component. - (vecN)(vecN)", 60 | mod = fn "modulus - (vecN)(vecN x, y)", 61 | modf = fn "separate integer and fractional parts. - (vecN)(vecN x, out vecN i)", 62 | max = fn "returns the maximum of two scalars or each respective component of two vectors. - (vecN)(vecN a, b)", 63 | min = fn "returns the minimum of two scalars or each respective component of two vectors. - (vecN)(vecN a, b)", 64 | mix = fn "returns linear interpolation of two scalars or vectors based on a weight. - (vecN)(vecN a, b, weight)", 65 | step = fn "implement a step function returning either zero or one (x >= edge). - (vecN)(vecN edge, x)", 66 | 67 | isinf = fn "test whether or not a scalar or each vector component is infinite. - (boolN)(vecN)", 68 | isnan = fn "test whether or not a scalar or each vector component is not-a-number. - (boolN)(vecN)", 69 | clamp = fn "returns x clamped to the range [a,b]. - (vecN)(vecN x, a, b)", 70 | smoothstep = fn "clip and smooth blend [a,b]. - (vecN)(vecN a, b, x)", 71 | floatBitsToInt = fn "returns the 32-bit integer representation of an IEEE 754 floating-point scalar or vector - (uintN/intN)(floatN)", 72 | intBitsToFloat = fn "returns the float value corresponding to a given bit represention.of a scalar int value or vector of int values. - (floatN)(intN)", 73 | uintBitsToFloat = fn "returns the float value corresponding to a given bit represention.of a scalar int value or vector of int values. - (floatN)(uintN)", 74 | doubleBitsToInt64 = fn "returns the 64-bit integer representation of an IEEE 754 double precision floating-point scalar or vector - (int64N)(doubleN)", 75 | doubleBitsToUint64 = fn "returns the 64-bit integer representation of an IEEE 754 double precision floating-point scalar or vector - (uint64N)(doubleN)", 76 | int64BitsToDouble = fn "returns the double value corresponding to a given bit represention.of a scalar int value or vector of int values. - (doubleN)(uint64N)", 77 | uint64BitsToDouble = fn "returns the double value corresponding to a given bit represention.of a scalar int value or vector of int values. - (doubleN)(uint64N)", 78 | 79 | fma = fn "return a*b + c, treated as single operation when using precise - (vecN a, vecN b, vecN c)", 80 | frexp = fn "splits scalars and vectors into normalized fraction [0.5,1.0) and a power of 2. - (vecN)(vecN x, out vecN e)", 81 | ldexp = fn "build floating point number from x and the corresponding integral exponen of 2 in exp. - (vecN)(vecN x, exp)", 82 | 83 | packUnorm2x16 = fn "Converts each comp. of v into 16-bit ints, packs results into the returned 32-bit uint. - (uint)(vec2 v)", 84 | packUnorm4x8 = fn "Converts each comp. of v into 8-bit ints, packs results into the returned 32-bit uint. - (uint)(vec4 v)", 85 | packSnorm4x8 = fn "Converts each comp. of v into 8-bit ints, packs results into the returned 32-bit uint. - (uint)(vec4 v)", 86 | packDouble2x32 = fn "Packs components of v into a 64-bit value and returns a double-prec value. - (double)(uvec2 v)", 87 | packHalf2x16 = fn "Converts each comp. of v into 16-bit half float, packs results into the returned 32-bit uint. - (uint)(vec2 v)", 88 | packInt2x32 = fn "Packs two 32 bit into one 64-bit value. - (int64_t)(ivec2)", 89 | packUint2x32 = fn "Packs two 32 bit into one 64-bit value. - (uint64_t)(uvec2)", 90 | packFloat2x16 = fn "returns an unsigned integer obtained by interpreting the components of a two-component 16-bit floating-point as integers and packing them into 32 bit. - (uint)(f16vec2 v)", 91 | 92 | unpackUnorm2x16 = fn "Unpacks 32-bit p into two 16-bit uints and converts them to normalized float. - (vec2)(uint p)", 93 | unpackUnorm4x8 = fn "Unpacks 32-bit p into four 8-bit uints and converts them to normalized float. - (vec4)(uint p)", 94 | unpackSnorm4x8 = fn "Unpacks 32-bit p into four 8-bit uints and converts them to normalized float. - (vec4)(uint p)", 95 | unpackDouble2x32 = fn "Returns a 2 component vector representation of v. - (uvec2)(double v)", 96 | unpackHalf2x16 = fn "Interprets p as two 16-bit half floats and returns them as vector. - (vec2)(uint p)", 97 | unpackInt2x32 = fn "Unpacks 64-bit into two 32-bit values. - (ivec2)(int64_t)", 98 | unpackUint2x32 = fn "Unpacks 64-bit into two 32-bit values. - (uvec2)(uint64_t)", 99 | unpackFloat2x16 = fn "returns a two-component vector with 16-bit floating-point components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values. - (f16vec2)(uint)", 100 | 101 | 102 | length = fn "return scalar Euclidean length of a vector. - (type)(vecN)", 103 | distance = fn "return the Euclidean distance between two points. - (vecN)(vecN a, b)", 104 | dot = fn "returns the scalar dot product of two vectors. - (type)(vecN a, b)", 105 | cross = fn "returns the cross product of two three-component vectors. - (type3)(type3 a, b)", 106 | normalize = fn "Returns the normalized version of a vector, meaning a vector in the same direction as the original vector but with a Euclidean length of one. - (vecN)(vecN)", 107 | reflect = fn "returns the reflectiton vector given an incidence vector and a normal vector. - (vecN)(vecN incidence, normal)", 108 | refract = fn "computes a refraction vector. - (vecN)(vecN incidence, normal, type eta)", 109 | faceforward = fn "dot(Nreference, incident) < 0 returns N, otherwise it returns -N. - (vecN)(vecN N, incident, Nreference)", 110 | 111 | determinant = fn "returns the scalar determinant of a square matrix. - (float)(matN)", 112 | transpose = fn "returns transpose matrix of a matrix. - (matNxM)(matMxN)", 113 | inverse = fn "returns inverse matrix of a matrix. - (matN)(mat)", 114 | matrixCompMult = fn "component-wise multiply. - (mat)(mat a, b)", 115 | outerProduct = fn "outer product. - (matNxM)(vecM c, vecN r)", 116 | 117 | all = fn "returns true if a boolean scalar or all components of a boolean vector are true. - (bool)(boolN)", 118 | any = fn "returns true if a boolean scalar or any component of a boolean vector is true. - (bool)(boolN)", 119 | ["not"] = fn "returns logical complement. - (boolN)(boolN)", 120 | lessThan = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 121 | lessThanEqual = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 122 | greaterThan = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 123 | greaterThanEqual = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 124 | equal = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 125 | notEqual = fn "returns retusult of component-wise comparison. - (boolN)(vecN a,b)", 126 | 127 | uaddCarry = fn "Adds 32-bit uintx and y, returning the sum modulo 2^32. - (uintN)(uintN x, y, out carry)", 128 | usubBorrow = fn "Subtracts y from x, returning the difference if non-negative otherwise 2^32 plus the difference. - (uint)(uint x, y, out borrow)", 129 | umulExtended = fn "Multiplies 32-bit integers x and y producing 64-bit result. (uintN)(uintN x, y, out msb, out lsb)", 130 | imulExtended = fn "Multiplies 32-bit integers x and y producing 64-bit result. (intN)(intN x, y, out msb, out lsb)", 131 | bitfieldExtract = fn "Extracts bits (offset, offset + bits -1) from value and returns them in lsb of result. - (intN)(intN value, int offset, int bits)", 132 | bitfieldInsert = fn "Returns the insertion the bits lsb of insert into base. - (intN)(intN base, insert, int offset, int bits)", 133 | bitfieldReverse = fn "Returns the reversal of the bits. - (intN)(intN)", 134 | bitCount = fn "returns the number of bits set to 1. - (intN)(intN)", 135 | findLSB = fn "returns bit number of lsb. - (intN)(intN)", 136 | findMSB = fn "returns bit number of msb. - (intN)(intN)", 137 | 138 | discard = fn "conditionally (<0) kill a pixel before output. - ()(vecN)", 139 | dFdx = fn "returns approximate partial derivative with respect to window-space X. - (vecN)(vecN)", 140 | dFdxCoarse = fn "returns approximate partial derivative with respect to window-space X. - (vecN)(vecN)", 141 | dFdxFine = fn "returns approximate partial derivative with respect to window-space X. - (vecN)(vecN)", 142 | dFdy = fn "returns approximate partial derivative with respect to window-space Y. - (vecN)(vecN)", 143 | dFdyCoarse = fn "returns approximate partial derivative with respect to window-space Y. - (vecN)(vecN)", 144 | dFdyFine = fn "returns approximate partial derivative with respect to window-space Y. - (vecN)(vecN)", 145 | fwidth = fn "returns abs sum of approximate window-space partial derivatives magnitudes. - (vecN)(vecN)", 146 | fwidthFine = fn "returns abs sum of approximate window-space partial derivatives magnitudes. - (vecN)(vecN)", 147 | fwidthCoarse = fn "returns abs sum of approximate window-space partial derivatives magnitudes. - (vecN)(vecN)", 148 | interpolateAtCentroid = fn "Return value of interpolant sampled inside pixel and the primitive. - (floatN)(floatN)", 149 | interpolateAtSample = fn "Return value of interpolant at the location fo sample. - (floatN)(floatN, int sample)", 150 | interpolateAtOffset = fn "Return value of interpolant sampled at fixed offset offset from pixel center. - (floatN)(floatN, vec2 offset)", 151 | 152 | EmitStreamVertex = fn "Emits values of the output variables of the current output primitive stream. - ()(int stream)", 153 | EndStreamPrimitive = fn "Completes current output primitive stream and starts a new one. - ()(int stream)", 154 | EmitVertex= fn "Emits values of the output variable of the current output primitive. - ()()", 155 | EndPrimitive = fn "Completes current output primitive and starts a new one. - ()()", 156 | barrier = fn "Synchronizes across shader invocations. - ()()", 157 | 158 | memoryBarrier = fn "control ordering of memory transactions issued by shader thread. - ()()", 159 | memoryBarrierAtomicCounter = fn "control ordering of memory transactions issued by shader thread. - ()()", 160 | memoryBarrierShared = fn "control ordering of memory transactions issued by shader thread. - ()()", 161 | memoryBarrierBuffer = fn "control ordering of memory transactions issued by shader thread. - ()()", 162 | memoryBarrierImage = fn "control ordering of memory transactions issued by shader thread. - ()()", 163 | groupMemoryBarrier = fn "control ordering of memory transactions issued by shader thread. - ()()", 164 | imageAtomicAdd = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 165 | imageAtomicMin = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 166 | imageAtomicMax = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 167 | imageAtomicIncWrap = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 168 | imageAtomicDecWrap = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 169 | imageAtomicAnd = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 170 | imageAtomicOr = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 171 | imageAtomicXor = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 172 | imageAtomicExchange = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint data)", 173 | imageAtomicCompSwap = fn "performs atomic operation on individual texels returns old value. - (uint)(imageN, intN coord, [int sample], uint compare, uint data)", 174 | imageStore = fn "stores the texel at the coordinate. - ()(imageN, intN coord, [int sample], vecN data)", 175 | imageLoad = fn "loads the texel at the coordinate. - (vecN)(imageN, intN coord, [int sample])", 176 | imageSize = fn "returns the size of the image. - (ivecN)(imageN)", 177 | imageSamples = fn "returns the samples of the multi-sampled image. - (int)(image2DMS)", 178 | 179 | atomicCounterIncrement = fn "increments counter and returns old value. - (uint)(atomic_uint)", 180 | atomicCounterDecrement = fn "decrements counter and returns old value. - (uint)(atomic_uint)", 181 | atomicCounter = fn "returns current counter value. - (uint)(atomic_uint)", 182 | atomicMin = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 183 | atomicMax = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 184 | atomicAdd = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 185 | atomicAnd = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 186 | atomicOr = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 187 | atomicXor = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 188 | atomicExchange = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint data)", 189 | atomicCompSwap = fn "performs atomic operation on memory location (ssbo/shared) returns old value. - (uint)(inout uint mem, uint compare, uint data)", 190 | 191 | texelFetch = fn "integer coordinate lookup for a single texel. No lod parameter for Buffer, MS, Rect. Illegal for Cube - (vec4)(samplerN, intN coord, [int lod/sample])", 192 | texelFetchOffset = fn "integer coordinate lookup for a single texel with offset. No lod parameter for Buffer, MS, Rect. Illegal for Cube, Buffer, MS. - (vec4)(samplerN, intN coord, [int lod/sample], intN offset)", 193 | texture = fn "performs a texture lookup. Shadow samplers require base N+1 coordinate. Lod bias is optional (illegal for MS, Buffer, Rect). - (vec4)(samplerN, vecN coord, [float bias])", 194 | textureGather = fn "gather lookup (pixel quad of 4 single channel samples at once). Component 0: x, 1: y ... is ignored for shadow samplers instead reference value must be passed. Only 2D/Cube. Illegal for MS. - (vec4)(samplerN, vecN coord, [int comp] / float shadowRefZ)", 195 | textureGatherOffset = fn "gather lookup (pixel quad of 4 single channel samples at once) with offset. Component 0: x, 1: y ... is ignored for shadow samplers instead reference value must be passed. Only 2D/Cube. Illegal for MS. - (vec4)(samplerN, vecN coord, [float shadowRefZ], intN offset, [int comp])", 196 | textureGatherOffsets = fn "gather lookup (pixel quad of 4 single channel samples at once) with offset. Component 0: x, 1: y ... is ignored for shadow samplers instead reference value must be passed. Only 2D/Cube. Illegal for MS. - (vec4)(samplerN, vecN coord, [float shadowRefZ], intN offsets[4] , [int comp])", 197 | textureGrad = fn "lookup with explicit gradients. Illegal for MS, Buffer. - (vec4)(samplerN, vecN coord, gradX, gradY)", 198 | textureGradOffset = fn "lookup with explicit gradients and offset. Illegal for MS, Buffer, Cube. - (vec4)(samplerN, vecN coord, gradX, gradY, intN offset)", 199 | textureLod = fn "performs a lookup with explicit LOD. Shadows require N+1 base coordinate. Illegal function for Rect, MS, Buffer. - (vec4)(samplerN, vecN coord, float lod)", 200 | textureLodOffset = fn "offset added with explicit LOD. - (vec4)(samplerN, vecN coord, intN offset, int lod)", 201 | textureOffset = fn "offset added before texture lookup. Illegal for MS, Buffer, Cube. - (vec4)(samplerN, vecN coord, intN offset, [float bias])", 202 | textureProj = fn "performs a projective texture lookup (only Nd samplers + Rect). Shadows require N+1 base coordinate, no Lod bias allowed for Rect. - (vec4)(samplerN, vecN+1 coord, [float bias])", 203 | textureProjGrad = fn "performs a projective texture lookup with explicit gradients (only Nd samplers + Rect). Shadows require N+1 base coordinate, no Lod bias allowed for Rect. - (vec4)(samplerN, vecN+1 coord, vecN gradX, gradY)", 204 | textureProjGradOffset = fn "projective lookup with explicit gradients and offset. Illegal for MS, Buffer, Cube. - (vec4)(samplerN, vecN+1 coord, vecN gradX, gradY, intN offset)", 205 | textureProjLod = fn "performs a projective texture lookup with explicit LOD (only Nd samplers). Shadows require N+1 base coordinate. - (vec4)(samplerN, vecN+1 coord, float lod)", 206 | textureProjLodOffset = fn "projective lookup with offset and explicit LOD. - (vec4)(samplerN, vecN+1 coord, intN offset, int lod)", 207 | textureProjOffset = fn "projective texture lookup with offset. Illegal for MS, Buffer, Cube, Array. - (vec4)(samplerN, vecN+1 coord, intN offset, [float bias])", 208 | textureQueryLevels = fn "returns the number of accessible mipmap levels of a texture. - (int)(samplerN)", 209 | textureQueryLod = fn "returns the lod values for a given coordinate. - (vec2)(samplerN, vecN coord)", 210 | textureSamples = fn "returns the samples of the multi-sampled texture. - (int)(texture2DMSN)", 211 | textureSize = fn "returns the size of the texture (no lod required: Rect, MS and Buffer). - (intN)(samplerN, [int lod])", 212 | 213 | 214 | anyInvocationARB = fn "returns true if and only if is true for at least one active invocation in the group. - (bool)(bool value)", 215 | allInvocationsARB = fn "returns true if and only if is true for all active invocations in the group - (bool)(bool value)", 216 | allInvocationsEqualARB = fn "returns true if is the same for all active invocation in the group. - (bool)(bool value)", 217 | 218 | packPtr = fn "returns pointer from uvec2. - (void*)(uvec2)", 219 | unpackPtr = fn "return uvec2 from pointer. - (uvec2)(void*)", 220 | 221 | anyThreadNV = fn "returns true if and only if is true for at least one active invocation in the group. - (bool)(bool value)", 222 | allThreadsNV = fn "returns true if and only if is true for all active invocations in the group - (bool)(bool value)", 223 | allThreadsEqualNV = fn "returns true if is the same for all active invocation in the group. - (bool)(bool value)", 224 | 225 | activeThreadsNV = fn "sets ith bit for every active thread in warp - (uint)()", 226 | ballotThreadNV = fn "sets ith bit for every active thread in warp if true. - (uint)(bool value)", 227 | 228 | quadSwizzle0NV = fn "result[thread N] = swizzledValue[thread 0] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 229 | quadSwizzle1NV = fn "result[thread N] = swizzledValue[thread 1] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 230 | quadSwizzle2NV = fn "result[thread N] = swizzledValue[thread 2] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 231 | quadSwizzle3NV = fn "result[thread N] = swizzledValue[thread 3] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 232 | quadSwizzleXNV = fn "result[thread N] = swizzledValue[thread X neighbor] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 233 | quadSwizzleYNV = fn "result[thread N] = swizzledValue[thread Y neighbor] + unswizzledValue[thread N]. - (vecN)(vecN swizzledValue, [vecN unswizzledValue])", 234 | 235 | shuffleDownNV = fn "result[thread N] = data[thread N + index ]. - (genN)(genN data, uint index, uint width, [out bool threadIdValid])", 236 | shuffleUpNV = fn "result[thread N] = data[thread N - index]. - (genN)(genN data, uint index, uint width, [out bool threadIdValid])", 237 | shuffleXorNV = fn "result[thread N] = data[thread N ^ index]. - (genN)(genN data, uint index, uint width, [out bool threadIdValid])", 238 | shuffleNV = fn "result[thread N] = data[thread index]. - (genN)(genN data, uint index, uint width, [out bool threadIdValid])", 239 | 240 | ballotARB = fn "sets ith bit for every active thread in sub group. - (uint64_t)(bool value)", 241 | readInvocationARB = fn "result[thread N] = data[thread index]. - (genN)(genN data, uint index)", 242 | readFirstInvocationARB = fn "result[thread N] = data[thread 0]. - (genN)(genN data)", 243 | 244 | clock2x32ARB = fn "current execution clock as seen by the shader processor. - (uvec2)()", 245 | clockARB = fn "current execution clock as seen by the shader processor. - (uint64_t)()", 246 | 247 | sparseTexelsResidentARB = fn "false if code represents touching uncommitted texture memory. - (bool)(int code)", 248 | sparseTextureARB = fn " - (int)(gsamplerN sampler, vecN P, out gvec4 texel [, float bias])", 249 | sparseTextureLodARB = fn " - (int)(gsamplerN sampler, vecN P, float lod, out gvec4 texel)", 250 | sparseTextureOffsetARB = fn " - (int)(gsamplerN sampler, vecN P, ivecN offset, out gvec4 texel [, float bias])", 251 | sparseTexelFetchARB = fn " - (int)(gsamplerN sampler, ivecN P, int lod, out gvec4 texel)", 252 | sparseTexelFetchOffsetARB = fn " - (int)(gsamplerN sampler, ivecN P, int lod, ivecN offset, out gvec4 texel)", 253 | sparseTextureLodOffsetARB = fn " - (int)(gsamplerN sampler, vecN P, float lod, ivecN offset, out gvec4 texel)", 254 | sparseTextureGradARB = fn " - (int)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, out gvec4 texel)", 255 | sparseTextureGradOffsetARB = fn " - (int)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, ivec2 offset, out gvec4 texel)", 256 | sparseTextureGatherARB = fn " - (int)(gsamplerN sampler, vecN P, out gvec4 texel [, int comp])", 257 | sparseTextureGatherOffsetARB = fn " - (int)(gsamplerN sampler, vecN P, ivecN offset, out gvec4 texel [, int comp])", 258 | sparseTextureGatherOffsetsARB = fn " - (int)(gsamplerN sampler, vecN P, ivecN offsets[4], out gvec4 texel [, int comp])", 259 | sparseImageLoadARB = fn " - (int)(gsamplerN image, ivecN P, out gvec4 texel)", 260 | sparseTextureClampARB = fn " - (int)(gsamplerN sampler, vecN P, float lodClamp, out gvec4 texel, [float bias])", 261 | sparseTextureOffsetClampARB = fn " - (int)(gsamplerN sampler, vecN P, ivecN offset, float lodClamp, out gvec4 texel [, float bias])", 262 | sparseTextureGradClampARB = fn " - (int)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, float lodClamp, out gvec4 texel)", 263 | sparseTextureGradOffsetClampARB = fn " - (int)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, ivecN offset, float lodClamp, out gvec4 texel)", 264 | textureClampARB = fn " - (gvec4)(gsamplerN sampler, vecN P, float lodClamp [, float bias])", 265 | textureOffsetClampARB = fn " - (gvec4)(gsamplerN sampler, vecN P, ivecN offset, float lodClamp [, float bias])", 266 | textureGradClampARB = fn " - (gvec4)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, float lodClamp)", 267 | textureGradOffsetClampARB = fn " - (gvec4)(gsamplerN sampler, vecN P, vecN dPdx, vecN dPdy, ivecN offset, float lodClamp)", 268 | 269 | subgroupBarrier = fn " - ()()", 270 | subgroupMemoryBarrier = fn " - ()()", 271 | subgroupMemoryBarrierBuffer = fn " - ()()", 272 | subgroupMemoryBarrierShared = fn " - ()()", 273 | subgroupMemoryBarrierImage = fn " - ()()", 274 | subgroupElect = fn " - (bool)()", 275 | subgroupAll = fn " - (bool)(bool)", 276 | subgroupAny = fn " - (bool)(bool)", 277 | subgroupAllEqual = fn " - (bool)(gen)", 278 | subgroupBroadcast = fn " - (genN)(gen value, uint id)", 279 | subgroupBroadcastFirst = fn " - (gen)(gen value)", 280 | subgroupBallot = fn " - (uvec4)(bool)", 281 | subgroupInverseBallot = fn " - (bool)(uvec4 value)", 282 | subgroupBallotBitExtract = fn " - (bool)(uvec4 value, uint index)", 283 | subgroupBallotBitCount = fn " - (uint)(uvec4 value)", 284 | subgroupBallotInclusiveBitCount = fn " - (uint)(uvec4 value)", 285 | subgroupBallotExclusiveBitCount = fn " - (uint)(uvec4 value)", 286 | subgroupBallotFindLSB = fn " - (uint)(uvec4 value)", 287 | subgroupBallotFindMSB = fn " - (uint)(uvec4 value)", 288 | subgroupShuffle = fn " - (gen)(gen value, uint id)", 289 | subgroupShuffleXor = fn " - (gen)(gen value, uint mask)", 290 | subgroupShuffleUp = fn " - (gen)(gen value, uint delta)", 291 | subgroupShuffleDown = fn " - (gen)(gen value, uint delta)", 292 | subgroupAdd = fn " - (gen)(gen value)", 293 | subgroupMul = fn " - (gen)(gen value)", 294 | subgroupMin = fn " - (gen)(gen value)", 295 | subgroupMax = fn " - (gen)(gen value)", 296 | subgroupAnd = fn " - (gen)(gen value)", 297 | subgroupOr = fn " - (gen)(gen value)", 298 | subgroupXor = fn " - (gen)(gen value)", 299 | subgroupInclusiveAdd = fn " - (gen)(gen value)", 300 | subgroupInclusiveMul = fn " - (gen)(gen value)", 301 | subgroupInclusiveMin = fn " - (gen)(gen value)", 302 | subgroupInclusiveMax = fn " - (gen)(gen value)", 303 | subgroupInclusiveAnd = fn " - (gen)(gen value)", 304 | subgroupInclusiveOr = fn " - (gen)(gen value)", 305 | subgroupInclusiveXor = fn " - (gen)(gen value)", 306 | subgroupExclusiveAdd = fn " - (gen)(gen value)", 307 | subgroupExclusiveMul = fn " - (gen)(gen value)", 308 | subgroupExclusiveMin = fn " - (gen)(gen value)", 309 | subgroupExclusiveMax = fn " - (gen)(gen value)", 310 | subgroupExclusiveAnd = fn " - (gen)(gen value)", 311 | subgroupExclusiveOr = fn " - (gen)(gen value)", 312 | subgroupExclusiveXor = fn " - (gen)(gen value)", 313 | subgroupClusteredAdd = fn " - (gen)(gen value, uint clusterSize)", 314 | subgroupClusteredMul = fn " - (gen)(gen value, uint clusterSize)", 315 | subgroupClusteredMin = fn " - (gen)(gen value, uint clusterSize)", 316 | subgroupClusteredMax = fn " - (gen)(gen value, uint clusterSize)", 317 | subgroupClusteredAnd = fn " - (gen)(gen value, uint clusterSize)", 318 | subgroupClusteredOr = fn " - (gen)(gen value, uint clusterSize)", 319 | subgroupClusteredXor = fn " - (gen)(gen value, uint clusterSize)", 320 | subgroupQuadBroadcast = fn " - (gen)(gen value, uint id)", 321 | subgroupQuadSwapHorizontal = fn " - (gen)(gen value)", 322 | subgroupQuadSwapVertical = fn " - (gen)(gen value)", 323 | subgroupQuadSwapDiagonal = fn " - (gen)(gen value)", 324 | 325 | subgroupPartitionNV = fn " - (uvec4)(gen value)", 326 | subgroupPartitionedAddNV = fn " - (gen)(gen value, uvec4 ballot)", 327 | subgroupPartitionedMulNV = fn " - (gen)(gen value, uvec4 ballot)", 328 | subgroupPartitionedMinNV = fn " - (gen)(gen value, uvec4 ballot)", 329 | subgroupPartitionedMaxNV = fn " - (gen)(gen value, uvec4 ballot)", 330 | subgroupPartitionedAndNV = fn " - (gen)(gen value, uvec4 ballot)", 331 | subgroupPartitionedOrNV = fn " - (gen)(gen value, uvec4 ballot)", 332 | subgroupPartitionedXorNV = fn " - (gen)(gen value, uvec4 ballot)", 333 | subgroupPartitionedInclusiveAddNV = fn " - (gen)(gen value, uvec4 ballot)", 334 | subgroupPartitionedInclusiveMulNV = fn " - (gen)(gen value, uvec4 ballot)", 335 | subgroupPartitionedInclusiveMinNV = fn " - (gen)(gen value, uvec4 ballot)", 336 | subgroupPartitionedInclusiveMaxNV = fn " - (gen)(gen value, uvec4 ballot)", 337 | subgroupPartitionedInclusiveAndNV = fn " - (gen)(gen value, uvec4 ballot)", 338 | subgroupPartitionedInclusiveOrNV = fn " - (gen)(gen value, uvec4 ballot)", 339 | subgroupPartitionedInclusiveXorNV = fn " - (gen)(gen value, uvec4 ballot)", 340 | subgroupPartitionedExclusiveAddNV = fn " - (gen)(gen value, uvec4 ballot)", 341 | subgroupPartitionedExclusiveMulNV = fn " - (gen)(gen value, uvec4 ballot)", 342 | subgroupPartitionedExclusiveMinNV = fn " - (gen)(gen value, uvec4 ballot)", 343 | subgroupPartitionedExclusiveMaxNV = fn " - (gen)(gen value, uvec4 ballot)", 344 | subgroupPartitionedExclusiveAndNV = fn " - (gen)(gen value, uvec4 ballot)", 345 | subgroupPartitionedExclusiveOrNV = fn " - (gen)(gen value, uvec4 ballot)", 346 | subgroupPartitionedExclusiveXorNV = fn " - (gen)(gen value, uvec4 ballot)", 347 | 348 | writePackedPrimitiveIndices4x8NV = fn " - ()(uint offset, uint packed)", 349 | 350 | traceNV = fn " - ()(accelerationStructureNV topLevel, uint rayFlags, uint cullMask, uint sbtRecordOffset, uint sbtRecordStride, uint missIndex, vec3 origin, float tmin, vec3 direction, float tmax, int payload)", 351 | reportIntersectionNV = fn " - (bool)(float hit, uint hitKind)", 352 | ignoreIntersectionNV = fn " - ()()", 353 | terminateRayNV = fn " - ()()", 354 | executeCallableNV = fn "- ()(uint sbtRecordIndex, int callable)", 355 | 356 | traceRayEXT = fn " - ()(accelerationStructureEXT topLevel, uint rayFlags, uint cullMask, uint sbtRecordOffset, uint sbtRecordStride, uint missIndex, vec3 origin, float tmin, vec3 direction, float tmax, int payload)", 357 | reportIntersectionEXT = fn " - (bool)(float hit, uint hitKind)", 358 | ignoreIntersectionEXT = fn " - ()()", 359 | terminateRayEXT = fn " - ()()", 360 | executeCallableEXT = fn "- ()(uint sbtRecordIndex, int callable)", 361 | 362 | rayQueryInitializeEXT = fn " - ()(rayQueryEXT rayQuery, accelerationStructureEXT topLevel, uint rayFlags, uint cullMask, vec3 origin, float tMin, vec3 direction, float tMax)", 363 | rayQueryProceedEXT = fn " - (bool)(rayQueryEXT q)", 364 | rayQueryTerminateEXT = fn " - ()(rayQueryEXT q)", 365 | rayQueryGenerateIntersectionEXT = fn " - ()(rayQueryEXT q, float tHit)", 366 | rayQueryConfirmIntersectionEXT = fn " - ()(rayQueryEXT q)", 367 | rayQueryGetIntersectionTypeEXT = fn " - (uint)(rayQueryEXT q, bool committed)", 368 | rayQueryGetRayTMinEXT = fn " - (float)(rayQueryEXT q)", 369 | rayQueryGetRayFlagsEXT = fn " - (uint)(rayQueryEXT q)", 370 | rayQueryGetWorldRayOriginEXT = fn " - (vec3)(rayQueryEXT q)", 371 | rayQueryGetWorldRayDirectionEXT = fn " - (vec3)(rayQueryEXT q)", 372 | rayQueryGetIntersectionTEXT = fn " - (float)(rayQueryEXT q, bool committed)", 373 | rayQueryGetIntersectionInstanceCustomIndexEXT = fn " - (int)(rayQueryEXT q, bool committed)", 374 | rayQueryGetIntersectionInstanceIdEXT = fn " - (int)(rayQueryEXT q, bool committed)", 375 | rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT = fn " - (uint)(rayQueryEXT q, bool committed)", 376 | rayQueryGetIntersectionGeometryIndexEXT = fn " - (int)(rayQueryEXT q, bool committed)", 377 | rayQueryGetIntersectionPrimitiveIndexEXT = fn " - (int)(rayQueryEXT q, bool committed)", 378 | rayQueryGetIntersectionBarycentricsEXT = fn " - (vec2)(rayQueryEXT q, bool committed)", 379 | rayQueryGetIntersectionFrontFaceEXT = fn " - (bool)(rayQueryEXT q, bool committed)", 380 | rayQueryGetIntersectionCandidateAABBOpaqueEXT = fn " - (bool)(rayQueryEXT q)", 381 | rayQueryGetIntersectionObjectRayDirectionEXT = fn " - (vec3)(rayQueryEXT q, bool committed)", 382 | rayQueryGetIntersectionObjectRayOriginEXT = fn " - (vec3)(rayQueryEXT q, bool committed)", 383 | rayQueryGetIntersectionObjectToWorldEXT = fn " - (mat4x3)(rayQueryEXT q, bool committed)", 384 | rayQueryGetIntersectionWorldToObjectEXT = fn " - (mat4x3)(rayQueryEXT q, bool committed)", 385 | 386 | textureFootprintNV = fn " - (bool)(gsamplerND sampler, vecN P, int granularity, bool coarse, out gl_TextureFootprintNDNV footprint, [float bias])", 387 | textureFootprintClampNV = fn " - ()(gsamplerND sampler, vecN P, float lodClamp, int granularity, bool coarse, out gl_TextureFootprintNDNV footprint, [float bias]))", 388 | textureFootprintLodNV = fn " - ()(gsamplerND sampler, vecN P, float lod, int granularity, bool coarse, out gl_TextureFootprintNDNV footprint)", 389 | textureFootprintGradNV = fn " - ()(gsampler2D sampler, vec2 P, vec2 dx, vec2 dy, int granularity, bool coarse, out gl_TextureFootprint2DNV footprint)", 390 | textureFootprintGradClampNV = fn " - ()(gsampler2D sampler, vec2 P, vec2 dx, vec2 dy, float lodclamp, int granularity, bool coarse, out gl_TextureFootprint2DNV footprint)", 391 | } 392 | 393 | local keyw = 394 | [[ 395 | int uint half float bool double 396 | vec2 vec3 vec4 dvec2 dvec3 dvec4 397 | ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 bvec2 bvec3 bvec4 398 | mat2 mat3 mat4 mat2x2 mat3x3 mat4x4 mat2x3 mat3x2 mat4x2 mat2x4 mat4x3 mat3x4 399 | dmat2 dmat3 dmat4 dmat2x2 dmat3x3 dmat4x4 dmat2x3 dmat3x2 dmat4x2 dmat2x4 dmat4x3 dmat3x4 400 | struct void 401 | subroutine 402 | 403 | float16_t f16vec2 f16vec3 f16vec4 404 | float32_t f32vec2 f32vec3 f32vec4 405 | float64_t f64vec2 f64vec3 f64vec4 406 | int8_t i8vec2 i8vec3 i8vec4 407 | int8_t i8vec2 i8vec3 i8vec4 408 | int16_t i16vec2 i16vec3 i16vec4 409 | int32_t i32vec2 i32vec3 i32vec4 410 | int64_t i64vec2 i64vec3 i64vec4 411 | uint8_t u8vec2 u8vec3 u8vec4 412 | uint16_t u16vec2 u16vec3 u16vec4 413 | uint32_t u32vec2 u32vec3 u32vec4 414 | uint64_t u64vec2 u64vec3 u64vec4 415 | 416 | main 417 | attribute const uniform varying buffer shared 418 | coherent volatile restrict readonly writeonly 419 | atomic_uint 420 | layout 421 | centroid flat smooth noperspective 422 | patch sample 423 | break continue do for while switch case default 424 | if else 425 | subroutine 426 | in out inout 427 | float double int void bool true false 428 | invariant precise 429 | discard return 430 | lowp mediump highp precision 431 | buffer_reference buffer_reference_align 432 | 433 | 434 | location vertices line_strip triangle_strip max_vertices stream index 435 | triangles quads equal_spacing isolines fractional_even_spacing lines points 436 | fractional_odd_spacing cw ccw point_mode lines_adjacency triangles_adjacency 437 | invocations offset align xfb_offset xfb_buffer 438 | origin_upper_left pixel_center_integer depth_greater depth_greater depth_greater depth_unchanged 439 | shared packed std140 std430 row_major column_major 440 | local_size_x local_size_y local_size_z 441 | early_fragment_tests 442 | 443 | post_depth_coverage 444 | bindless_sampler bound_sampler bindless_image bound_image 445 | binding set input_attachment_index 446 | pixel_interlock_ordered pixel_interlock_unordered sample_interlock_ordered sample_interlock_unordered 447 | passthrough push_constant secondary_view_offset viewport_relative override_coverage 448 | commandBindableNV 449 | subgroupuniformEXT 450 | scalar 451 | constant_id 452 | 453 | size1x8 size1x16 size1x32 size2x32 size4x32 rgba32f rgba16f rg32f rg16f r32f r16f rgba8 rgba16 r11f_g11f_b10f rgb10_a2ui 454 | rgb10_a2i rg16 rg8 r16 r8 rgba32i rgba16i rgba8i rg32i rg16i rg8i r32i r16i r8i rgba32ui rgba16ui rgba8ui rg32ui rg16ui rg8ui 455 | r32ui r16ui r8ui rgba16_snorm rgba8_snorm rg16_snorm rg8_snorm r16_snorm r8_snorm 456 | r64i r64ui 457 | 458 | subpassInput isubpassInput usubpassInput 459 | subpassInputMS isubpassInputMS usubpassInputMS 460 | 461 | sampler 462 | samplerShadow 463 | 464 | sampler1DShadow sampler2DShadow sampler2DRectShadow samplerCubeShadow sampler1DArrayShadow sampler2DArrayShadow samplerCubeArrayShadow 465 | 466 | image1D image2D image3D image2DRect imageCube imageBuffer image1DArray image2DArray imageCubeArray image2DMS image2DMSArray 467 | uimage1D uimage2D uimage3D uimage2DRect uimageCube uimageBuffer uimage1DArray uimage2DArray uimageCubeArray uimage2DMS uimage2DMSArray 468 | iimage1D iimage2D iimage3D iimage2DRect iimageCube iimageBuffer iimage1DArray iimage2DArray iimageCubeArray iimage2DMS iimage2DMSArray 469 | 470 | texture1D texture2D texture3D textureCube texture2DRect texture1DArray texture2DArray textureBuffer texture2DMS texture2DMSArray textureCubeArray 471 | utexture1D utexture2D utexture3D utextureCube utexture2DRect utexture1DArray utexture2DArray utextureBuffer utexture2DMS utexture2DMSArray utextureCubeArray 472 | itexture1D itexture2D itexture3D itextureCube itexture2DRect itexture1DArray itexture2DArray itextureBuffer itexture2DMS itexture2DMSArray itextureCubeArray 473 | 474 | usampler1D usampler2D usampler3D usampler2DRect usamplerBuffer usamplerCube usampler1DArray usampler2DArray usamplerCubeArray usampler2DMS usampler2DMSArray 475 | isampler1D isampler2D isampler3D isampler2DRect isamplerBuffer isamplerCube isampler1DArray isampler2DArray isamplerCubeArray isampler2DMS isampler2DMSArray 476 | sampler1D sampler2D sampler3D sampler2DRect samplerCube samplerBuffer sampler1DArray sampler2DArray samplerCubeArray sampler2DMS sampler2DMSArray 477 | 478 | i64image1D u64image1D i64image1DArray u64image1DArray i64image2D u64image2D i64image2DArray u64image2DArray i64image2DRect u64image2DRect 479 | i64image2DMS u64image2DMS i64image2DMSArray u64image2DMSArray i64image3D u64image3D i64imageCube u64imageCube i64imageCubeArray u64imageCubeArray 480 | i64imageBuffer u64imageBuffer 481 | 482 | gl_Position gl_FragCoord 483 | gl_VertexID gl_InstanceID gl_PointSize gl_ClipDistance 484 | gl_TexCoord gl_FogFragCoord gl_ClipVertex gl_in gl_out gl_PerVertex 485 | gl_PatchVerticesIn 486 | gl_PrimitiveID gl_InvocationID gl_TessLevelOuter gl_TessLevelInner gl_TessCoord 487 | gl_InvocationID gl_PrimitiveIDIn gl_Layer gl_ViewportIndex gl_FrontFacing 488 | gl_PointCoord gl_SampleID gl_SamplePosition gl_FragColor 489 | gl_FragData gl_FragDepth gl_SampleMask 490 | gl_NumWorkGroups gl_WorkGroupSize gl_WorkGroupID gl_LocalInvocationID gl_GlobalInvocationID gl_LocalInvocationIndex 491 | gl_HelperInvocation gl_CullDistance 492 | gl_VertexIndex gl_InstanceIndex 493 | 494 | gl_BaseVertexARB gl_BaseInstanceARB gl_DrawIDARB 495 | 496 | gl_SubGroupInvocationARB gl_SubGroupEqMaskARB gl_SubGroupGeMaskARB gl_SubGroupGtMaskARB gl_SubGroupLeMaskARB gl_SubGroupLtMaskARB 497 | gl_SubGroupSizeARB 498 | 499 | gl_ViewportMask 500 | gl_SecondaryPositionNV gl_SecondaryViewportMaskNV 501 | gl_ThreadInWarpNV gl_ThreadEqMaskNV gl_ThreadGeMaskNV gl_ThreadGtMaskNV gl_ThreadLeMaskNV gl_ThreadLtMaskNV gl_WarpIDNV gl_SMIDNV gl_HelperThreadNV 502 | gl_WarpSizeNV gl_WarpsPerSMNV gl_WarpsPerSMNV 503 | 504 | gl_NumSubgroups gl_SubgroupID gl_SubgroupSize gl_SubgroupInvocationID 505 | gl_SubgroupEqMask gl_SubgroupGeMask gl_SubgroupGtMask gl_SubgroupLeMask gl_SubgroupLtMask 506 | 507 | gl_TaskCountNV gl_PrimitiveCountNV gl_PrimitiveIndicesNV 508 | gl_ClipDistancePerViewNV gl_PositionPerViewNV gl_CullDistancePerViewNV gl_LayerPerViewN gl_ViewportMaskPerViewNV 509 | gl_MaxMeshViewCountNV 510 | gl_MeshViewCountNV gl_MeshViewIndicesNV gl_MeshPerVertexNV gl_MeshPerPrimitiveNV 511 | gl_MeshVerticesNV gl_MeshPrimitivesNV 512 | perprimitiveNV perviewNV taskNV 513 | max_primitives 514 | 515 | accelerationStructureNV 516 | rayPayloadNV rayPayloadInNV hitAttributeNV 517 | callableDataNV callableDataInNV 518 | shaderRecordNV 519 | gl_LaunchIDNV gl_LaunchSizeNV gl_InstanceCustomIndexNV 520 | gl_WorldRayOriginNV gl_WorldRayDirectionNV gl_ObjectRayOriginNV gl_ObjectRayDirectionNV 521 | gl_RayTminNV gl_RayTmaxNV gl_IncomingRayFlagsNV gl_HitTNV gl_HitKindNV 522 | gl_ObjectToWorldNV gl_WorldToObjectNV 523 | gl_RayFlagsNoneNV 524 | gl_RayFlagsOpaqueNV 525 | gl_RayFlagsNoOpaqueNV 526 | gl_RayFlagsTerminateOnFirstHitNV 527 | gl_RayFlagsSkipClosestHitShaderNV 528 | gl_RayFlagsCullBackFacingTrianglesNV 529 | gl_RayFlagsCullFrontFacingTrianglesNV 530 | gl_RayFlagsCullOpaqueNV 531 | gl_RayFlagsCullNoOpaqueNV 532 | 533 | accelerationStructureEXT rayQueryEXT accelerationStructureEXT 534 | rayPayloadEXT rayPayloadInEXT hitAttributeEXT callableDataEXT callableDataInEXT 535 | shaderRecordEXT 536 | gl_LaunchIDEXT gl_LaunchSizeEXT gl_InstanceCustomIndexEXT gl_GeometryIndexEXT 537 | gl_WorldRayOriginEXT gl_WorldRayDirectionEXT gl_ObjectRayOriginEXT gl_ObjectRayDirectionEXT 538 | gl_RayTminEXT gl_RayTmaxEXT gl_IncomingRayFlagsEXT gl_HitTEXT gl_HitKindEXT 539 | gl_ObjectToWorldEXT gl_WorldToObjectEXT gl_WorldToObject3x4EXT gl_ObjectToWorld3x4EXT 540 | gl_RayFlagsNoneEXT 541 | gl_RayFlagsOpaqueEXT 542 | gl_RayFlagsNoOpaqueEXT 543 | gl_RayFlagsTerminateOnFirstHitEXT 544 | gl_RayFlagsSkipClosestHitShaderEXT 545 | gl_RayFlagsCullBackFacingTrianglesEXT 546 | gl_RayFlagsCullFrontFacingTrianglesEXT 547 | gl_RayFlagsCullOpaqueEXT 548 | gl_RayFlagsCullNoOpaqueEXT 549 | gl_HitKindFrontFacingTriangleEXT gl_HitKindBackFacingTriangleEXT 550 | gl_RayQueryCommittedIntersectionNoneEXT 551 | gl_RayQueryCommittedIntersectionTriangleEXT 552 | gl_RayQueryCommittedIntersectionGeneratedEXT 553 | gl_RayQueryCandidateIntersectionTriangleEXT 554 | gl_RayQueryCandidateIntersectionAABBEXT 555 | shadercallcoherent 556 | 557 | gl_FragmentSizeNV gl_InvocationsPerPixelNV 558 | shading_rate_interlock_ordered shading_rate_interlock_unordered 559 | 560 | pervertexNV 561 | gl_BaryCoordNV 562 | gl_BaryCoordNoPerspNV 563 | 564 | derivative_group_quadsNV derivative_group_linearNV 565 | 566 | nonuniformEXT 567 | 568 | gl_FragSizeEXT 569 | gl_FragInvocationCountEXT 570 | 571 | gl_ScopeDevice 572 | gl_ScopeWorkgroup 573 | gl_ScopeSubgroup 574 | gl_ScopeInvocation 575 | gl_ScopeQueueFamily 576 | 577 | gl_SemanticsRelaxed 578 | gl_SemanticsAcquire 579 | gl_SemanticsRelease 580 | gl_SemanticsAcquireRelease 581 | gl_SemanticsMakeAvailable 582 | gl_SemanticsMakeVisible 583 | 584 | gl_StorageSemanticsNone 585 | gl_StorageSemanticsBuffer 586 | gl_StorageSemanticsShared 587 | gl_StorageSemanticsImage 588 | gl_StorageSemanticsOutput 589 | ]] 590 | 591 | -- keywords - shouldn't be left out 592 | for w in keyw:gmatch("([a-zA-Z_0-9]+)") do 593 | api[w] = {type="keyword"} 594 | end 595 | 596 | return api 597 | 598 | 599 | -------------------------------------------------------------------------------- /graphicscodepack/api/hlsl/dx11.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local function fn (description) 5 | local description2,returns,args = description:match("(.+)%-%s*(%b())%s*(%b())") 6 | if not description2 then 7 | return {type="function",description=description, 8 | returns="(?)"} 9 | end 10 | return {type="function",description=description2, 11 | returns=returns:gsub("^%s+",""):gsub("%s+$",""), args = args} 12 | end 13 | 14 | local api = {} 15 | 16 | local funcs = [[ 17 | abs acos all AllMemoryBarrier AllMemoryBarrierWithGroupSync any asdouble asfloat asin asint asuint atan atan2 ceil clamp clip cos cosh countbits cross ddx ddx_coarse ddx_fine ddy ddy_coards ddy_fine degrees determinant DeviceMemoryBarrier DeviceMemoryBarrierWithGroupSync distance dot dst EvaluateAttributeAtCentroid EvaluateAttributeAtSample EvaluateAttributeSnapped exp exp2 f16tof32 f32tof16 faceforward firstbithigh firstbitlow floor fmod frac frexp fwidth GetRenderTargetSampleCount GetRenderTargetSamplePosition GroupMemoryBarrier GroupMemoryBarrierWithGroupSync InterlockedAdd InterlockedAnd InterlockedCompareExchange InterlockedExchange InterlockedMax InterlockedMin IntterlockedOr InterlockedXor isfinite isinf isnan ldexp length lerp lit log log10 log2 mad max min modf mul normalize pow Process2DQuadTessFactorsAvg Process2DQuadTessFactorsMax Process2DQuadTessFactorsMin ProcessIsolineTessFactors ProcessQuadTessFactorsAvg ProcessQuadTessFactorsMax ProcessQuadTessFactorsMin ProcessTriTessFactorsAvg ProcessTriTessFactorsMax ProcessTriTessFactorsMin radians rcp reflect refract reversebits round rsqrt saturate sign sin sincos sinh smoothstep sqrt step tan tanh transpose trunc 18 | ]] 19 | 20 | for w in funcs:gmatch("([_%w]+)") do 21 | api[w] = {type="function",returns="(?)"} 22 | end 23 | 24 | local objfuncs = [[ 25 | Append RestartStrip CalculateLevelOfDetail CalculateLevelOfDetailUnclamped GetDimensions GetSamplePosition Load Sample SampleBias SampleCmp SampleCmpLevelZero SampleGrad SampleLevel Load2 Load3 Load4 Consume Store Store2 Store3 Store4 DecrementCounter IncrementCounter mips Gather GatherRed GatherGreen GatherBlue GatherAlpha GatherCmp GatherCmpRed GatherCmpGreen GatherCmpBlue GatherCmpAlpha 26 | ]] 27 | 28 | for w in objfuncs:gmatch("([_%w]+)") do 29 | api[w] = {type="function",returns="(?)"} 30 | end 31 | 32 | local keyw = 33 | [[ break continue if else switch return for while do typedef namespace true false compile 34 | const void struct static extern register volatile inline target nointerpolation shared uniform row_major column_major snorm unorm 35 | bool bool1 bool2 bool3 bool4 int int1 int2 int3 int4 uint uint1 uint2 uint3 uint4 half half1 half2 half3 half4 float float1 float2 float3 float4 double double1 double2 double3 double4 36 | matrix bool1x1 bool1x2 bool1x3 bool1x4 bool2x1 bool2x2 bool2x3 bool2x4 bool3x1 bool3x2 bool3x3 bool3x4 bool4x1 bool4x2 bool4x3 bool4x4 37 | int1x1 int1x2 int1x3 int1x4 int2x1 int2x2 int2x3 int2x4 int3x1 int3x2 int3x3 int3x4 int4x1 int4x2 int4x3 int4x4 uint1x1 uint1x2 uint1x3 uint1x4 38 | uint2x1 uint2x2 uint2x3 uint2x4 uint3x1 uint3x2 uint3x3 uint3x4 uint4x1 uint4x2 uint4x3 uint4x4 half1x1 half1x2 half1x3 half1x4 half2x1 half2x2 39 | half2x3 half2x4 half3x1 half3x2 half3x3 half3x4 half4x1 half4x2 half4x3 half4x4 float1x1 float1x2 float1x3 float1x4 float2x1 float2x2 float2x3 40 | float2x4 float3x1 float3x2 float3x3 float3x4 float4x1 float4x2 float4x3 float4x4 double1x1 double1x2 double1x3 double1x4 double2x1 double2x2 41 | double2x3 double2x4 double3x1 double3x2 double3x3 double3x4 double4x1 double4x2 double4x3 double4x4 cbuffer tbuffer groupshared 42 | in out inout vector matrix interface class point triangle line lineadj triangleadj 43 | 44 | Texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D TextureCube RWTexture1D RWTexture1DArray RWTexture2D RWTexture2DArray RWTexture3D 45 | Buffer StructuredBuffer AppendStructuredBuffer ConsumeStructuredBuffer RWBuffer RWStructuredBuffer ByteAddressBuffer RWByteAddressBuffer PointStream TriangleStream LineStream InputPatch OutputPatch 46 | unroll loop flatten branch earlydepthstencil allow_uav_condition domain instance maxtessfactor outputcontrolpoints outputtopology partitioning patchconstantfunc numthreads maxvertexcount precise 47 | SamplerState SamplerComparisonState 48 | 49 | SV_DispatchThreadID SV_DomainLocation SV_GroupID SV_GroupIndex SV_GroupThreadID SV_GSInstanceID SV_InsideTessFactor SV_OutputControlPointID SV_Coverage SV_Depth SV_Position SV_IsFrontFace SV_RenderTargetArrayIndex SV_SampleIndex SV_ViewportArrayIndex SV_InstanceID SV_PrimitiveID SV_VertexID 50 | SV_ClipDistance SV_CullDistance SV_Target 51 | 52 | ]] 53 | 54 | -- keywords - shouldn't be left out 55 | for w in keyw:gmatch("([_%w]+)") do 56 | api[w] = {type="keyword"} 57 | end 58 | 59 | return api 60 | 61 | 62 | -------------------------------------------------------------------------------- /graphicscodepack/api/lua/glfw.lua: -------------------------------------------------------------------------------- 1 | -- glfw | GLFW 2.x 2 | -- auto-generated api from ffi headers 3 | local api= 4 | { 5 | ["GLFW_VERSION_MAJOR"] = { type ="value", }, 6 | ["GLFW_VERSION_MINOR"] = { type ="value", }, 7 | ["GLFW_VERSION_REVISION"] = { type ="value", }, 8 | ["GLFW_RELEASE"] = { type ="value", }, 9 | ["GLFW_PRESS"] = { type ="value", }, 10 | ["GLFW_TRUE"] = { type ="value", }, 11 | ["GLFW_FALSE"] = { type ="value", }, 12 | ["GLFW_KEY_UNKNOWN"] = { type ="value", }, 13 | ["GLFW_KEY_SPACE"] = { type ="value", }, 14 | ["GLFW_KEY_APOSTROPHE"] = { type ="value", }, 15 | ["GLFW_KEY_COMMA"] = { type ="value", }, 16 | ["GLFW_KEY_MINUS"] = { type ="value", }, 17 | ["GLFW_KEY_PERIOD"] = { type ="value", }, 18 | ["GLFW_KEY_SLASH"] = { type ="value", }, 19 | ["GLFW_KEY_0"] = { type ="value", }, 20 | ["GLFW_KEY_1"] = { type ="value", }, 21 | ["GLFW_KEY_2"] = { type ="value", }, 22 | ["GLFW_KEY_3"] = { type ="value", }, 23 | ["GLFW_KEY_4"] = { type ="value", }, 24 | ["GLFW_KEY_5"] = { type ="value", }, 25 | ["GLFW_KEY_6"] = { type ="value", }, 26 | ["GLFW_KEY_7"] = { type ="value", }, 27 | ["GLFW_KEY_8"] = { type ="value", }, 28 | ["GLFW_KEY_9"] = { type ="value", }, 29 | ["GLFW_KEY_SEMICOLON"] = { type ="value", }, 30 | ["GLFW_KEY_EQUAL"] = { type ="value", }, 31 | ["GLFW_KEY_A"] = { type ="value", }, 32 | ["GLFW_KEY_B"] = { type ="value", }, 33 | ["GLFW_KEY_C"] = { type ="value", }, 34 | ["GLFW_KEY_D"] = { type ="value", }, 35 | ["GLFW_KEY_E"] = { type ="value", }, 36 | ["GLFW_KEY_F"] = { type ="value", }, 37 | ["GLFW_KEY_G"] = { type ="value", }, 38 | ["GLFW_KEY_H"] = { type ="value", }, 39 | ["GLFW_KEY_I"] = { type ="value", }, 40 | ["GLFW_KEY_J"] = { type ="value", }, 41 | ["GLFW_KEY_K"] = { type ="value", }, 42 | ["GLFW_KEY_L"] = { type ="value", }, 43 | ["GLFW_KEY_M"] = { type ="value", }, 44 | ["GLFW_KEY_N"] = { type ="value", }, 45 | ["GLFW_KEY_O"] = { type ="value", }, 46 | ["GLFW_KEY_P"] = { type ="value", }, 47 | ["GLFW_KEY_Q"] = { type ="value", }, 48 | ["GLFW_KEY_R"] = { type ="value", }, 49 | ["GLFW_KEY_S"] = { type ="value", }, 50 | ["GLFW_KEY_T"] = { type ="value", }, 51 | ["GLFW_KEY_U"] = { type ="value", }, 52 | ["GLFW_KEY_V"] = { type ="value", }, 53 | ["GLFW_KEY_W"] = { type ="value", }, 54 | ["GLFW_KEY_X"] = { type ="value", }, 55 | ["GLFW_KEY_Y"] = { type ="value", }, 56 | ["GLFW_KEY_Z"] = { type ="value", }, 57 | ["GLFW_KEY_LEFT_BRACKET"] = { type ="value", }, 58 | ["GLFW_KEY_BACKSLASH"] = { type ="value", }, 59 | ["GLFW_KEY_RIGHT_BRACKET"] = { type ="value", }, 60 | ["GLFW_KEY_GRAVE_ACCENT"] = { type ="value", }, 61 | ["GLFW_KEY_WORLD_1"] = { type ="value", }, 62 | ["GLFW_KEY_WORLD_2"] = { type ="value", }, 63 | ["GLFW_KEY_SPECIAL"] = { type ="value", }, 64 | ["GLFW_KEY_ESC"] = { type ="value", }, 65 | ["GLFW_KEY_F1"] = { type ="value", }, 66 | ["GLFW_KEY_F2"] = { type ="value", }, 67 | ["GLFW_KEY_F3"] = { type ="value", }, 68 | ["GLFW_KEY_F4"] = { type ="value", }, 69 | ["GLFW_KEY_F5"] = { type ="value", }, 70 | ["GLFW_KEY_F6"] = { type ="value", }, 71 | ["GLFW_KEY_F7"] = { type ="value", }, 72 | ["GLFW_KEY_F8"] = { type ="value", }, 73 | ["GLFW_KEY_F9"] = { type ="value", }, 74 | ["GLFW_KEY_F10"] = { type ="value", }, 75 | ["GLFW_KEY_F11"] = { type ="value", }, 76 | ["GLFW_KEY_F12"] = { type ="value", }, 77 | ["GLFW_KEY_F13"] = { type ="value", }, 78 | ["GLFW_KEY_F14"] = { type ="value", }, 79 | ["GLFW_KEY_F15"] = { type ="value", }, 80 | ["GLFW_KEY_F16"] = { type ="value", }, 81 | ["GLFW_KEY_F17"] = { type ="value", }, 82 | ["GLFW_KEY_F18"] = { type ="value", }, 83 | ["GLFW_KEY_F19"] = { type ="value", }, 84 | ["GLFW_KEY_F20"] = { type ="value", }, 85 | ["GLFW_KEY_F21"] = { type ="value", }, 86 | ["GLFW_KEY_F22"] = { type ="value", }, 87 | ["GLFW_KEY_F23"] = { type ="value", }, 88 | ["GLFW_KEY_F24"] = { type ="value", }, 89 | ["GLFW_KEY_F25"] = { type ="value", }, 90 | ["GLFW_KEY_UP"] = { type ="value", }, 91 | ["GLFW_KEY_DOWN"] = { type ="value", }, 92 | ["GLFW_KEY_LEFT"] = { type ="value", }, 93 | ["GLFW_KEY_RIGHT"] = { type ="value", }, 94 | ["GLFW_KEY_LSHIFT"] = { type ="value", }, 95 | ["GLFW_KEY_RSHIFT"] = { type ="value", }, 96 | ["GLFW_KEY_LCTRL"] = { type ="value", }, 97 | ["GLFW_KEY_RCTRL"] = { type ="value", }, 98 | ["GLFW_KEY_LALT"] = { type ="value", }, 99 | ["GLFW_KEY_RALT"] = { type ="value", }, 100 | ["GLFW_KEY_TAB"] = { type ="value", }, 101 | ["GLFW_KEY_ENTER"] = { type ="value", }, 102 | ["GLFW_KEY_BACKSPACE"] = { type ="value", }, 103 | ["GLFW_KEY_INSERT"] = { type ="value", }, 104 | ["GLFW_KEY_DEL"] = { type ="value", }, 105 | ["GLFW_KEY_PAGEUP"] = { type ="value", }, 106 | ["GLFW_KEY_PAGEDOWN"] = { type ="value", }, 107 | ["GLFW_KEY_HOME"] = { type ="value", }, 108 | ["GLFW_KEY_END"] = { type ="value", }, 109 | ["GLFW_KEY_KP_0"] = { type ="value", }, 110 | ["GLFW_KEY_KP_1"] = { type ="value", }, 111 | ["GLFW_KEY_KP_2"] = { type ="value", }, 112 | ["GLFW_KEY_KP_3"] = { type ="value", }, 113 | ["GLFW_KEY_KP_4"] = { type ="value", }, 114 | ["GLFW_KEY_KP_5"] = { type ="value", }, 115 | ["GLFW_KEY_KP_6"] = { type ="value", }, 116 | ["GLFW_KEY_KP_7"] = { type ="value", }, 117 | ["GLFW_KEY_KP_8"] = { type ="value", }, 118 | ["GLFW_KEY_KP_9"] = { type ="value", }, 119 | ["GLFW_KEY_KP_DIVIDE"] = { type ="value", }, 120 | ["GLFW_KEY_KP_MULTIPLY"] = { type ="value", }, 121 | ["GLFW_KEY_KP_SUBTRACT"] = { type ="value", }, 122 | ["GLFW_KEY_KP_ADD"] = { type ="value", }, 123 | ["GLFW_KEY_KP_DECIMAL"] = { type ="value", }, 124 | ["GLFW_KEY_KP_EQUAL"] = { type ="value", }, 125 | ["GLFW_KEY_KP_ENTER"] = { type ="value", }, 126 | ["GLFW_KEY_KP_NUM_LOCK"] = { type ="value", }, 127 | ["GLFW_KEY_CAPS_LOCK"] = { type ="value", }, 128 | ["GLFW_KEY_SCROLL_LOCK"] = { type ="value", }, 129 | ["GLFW_KEY_PAUSE"] = { type ="value", }, 130 | ["GLFW_KEY_LSUPER"] = { type ="value", }, 131 | ["GLFW_KEY_RSUPER"] = { type ="value", }, 132 | ["GLFW_KEY_MENU"] = { type ="value", }, 133 | ["GLFW_KEY_LAST"] = { type ="value", }, 134 | ["GLFW_MOUSE_BUTTON_1"] = { type ="value", }, 135 | ["GLFW_MOUSE_BUTTON_2"] = { type ="value", }, 136 | ["GLFW_MOUSE_BUTTON_3"] = { type ="value", }, 137 | ["GLFW_MOUSE_BUTTON_4"] = { type ="value", }, 138 | ["GLFW_MOUSE_BUTTON_5"] = { type ="value", }, 139 | ["GLFW_MOUSE_BUTTON_6"] = { type ="value", }, 140 | ["GLFW_MOUSE_BUTTON_7"] = { type ="value", }, 141 | ["GLFW_MOUSE_BUTTON_8"] = { type ="value", }, 142 | ["GLFW_MOUSE_BUTTON_LAST"] = { type ="value", }, 143 | ["GLFW_MOUSE_BUTTON_LEFT"] = { type ="value", }, 144 | ["GLFW_MOUSE_BUTTON_RIGHT"] = { type ="value", }, 145 | ["GLFW_MOUSE_BUTTON_MIDDLE"] = { type ="value", }, 146 | ["GLFW_JOYSTICK_1"] = { type ="value", }, 147 | ["GLFW_JOYSTICK_2"] = { type ="value", }, 148 | ["GLFW_JOYSTICK_3"] = { type ="value", }, 149 | ["GLFW_JOYSTICK_4"] = { type ="value", }, 150 | ["GLFW_JOYSTICK_5"] = { type ="value", }, 151 | ["GLFW_JOYSTICK_6"] = { type ="value", }, 152 | ["GLFW_JOYSTICK_7"] = { type ="value", }, 153 | ["GLFW_JOYSTICK_8"] = { type ="value", }, 154 | ["GLFW_JOYSTICK_9"] = { type ="value", }, 155 | ["GLFW_JOYSTICK_10"] = { type ="value", }, 156 | ["GLFW_JOYSTICK_11"] = { type ="value", }, 157 | ["GLFW_JOYSTICK_12"] = { type ="value", }, 158 | ["GLFW_JOYSTICK_13"] = { type ="value", }, 159 | ["GLFW_JOYSTICK_14"] = { type ="value", }, 160 | ["GLFW_JOYSTICK_15"] = { type ="value", }, 161 | ["GLFW_JOYSTICK_16"] = { type ="value", }, 162 | ["GLFW_JOYSTICK_LAST"] = { type ="value", }, 163 | ["GLFW_WINDOW"] = { type ="value", }, 164 | ["GLFW_FULLSCREEN"] = { type ="value", }, 165 | ["GLFW_OPENED"] = { type ="value", }, 166 | ["GLFW_ACTIVE"] = { type ="value", }, 167 | ["GLFW_ICONIFIED"] = { type ="value", }, 168 | ["GLFW_ACCELERATED"] = { type ="value", }, 169 | ["GLFW_RED_BITS"] = { type ="value", }, 170 | ["GLFW_GREEN_BITS"] = { type ="value", }, 171 | ["GLFW_BLUE_BITS"] = { type ="value", }, 172 | ["GLFW_ALPHA_BITS"] = { type ="value", }, 173 | ["GLFW_DEPTH_BITS"] = { type ="value", }, 174 | ["GLFW_STENCIL_BITS"] = { type ="value", }, 175 | ["GLFW_REFRESH_RATE"] = { type ="value", }, 176 | ["GLFW_ACCUM_RED_BITS"] = { type ="value", }, 177 | ["GLFW_ACCUM_GREEN_BITS"] = { type ="value", }, 178 | ["GLFW_ACCUM_BLUE_BITS"] = { type ="value", }, 179 | ["GLFW_ACCUM_ALPHA_BITS"] = { type ="value", }, 180 | ["GLFW_AUX_BUFFERS"] = { type ="value", }, 181 | ["GLFW_STEREO"] = { type ="value", }, 182 | ["GLFW_WINDOW_NO_RESIZE"] = { type ="value", }, 183 | ["GLFW_FSAA_SAMPLES"] = { type ="value", }, 184 | ["GLFW_OPENGL_VERSION_MAJOR"] = { type ="value", }, 185 | ["GLFW_OPENGL_VERSION_MINOR"] = { type ="value", }, 186 | ["GLFW_OPENGL_FORWARD_COMPAT"] = { type ="value", }, 187 | ["GLFW_OPENGL_DEBUG_CONTEXT"] = { type ="value", }, 188 | ["GLFW_OPENGL_PROFILE"] = { type ="value", }, 189 | ["GLFW_OPENGL_CORE_PROFILE"] = { type ="value", }, 190 | ["GLFW_OPENGL_COMPAT_PROFILE"] = { type ="value", }, 191 | ["GLFW_MOUSE_CURSOR"] = { type ="value", }, 192 | ["GLFW_STICKY_KEYS"] = { type ="value", }, 193 | ["GLFW_STICKY_MOUSE_BUTTONS"] = { type ="value", }, 194 | ["GLFW_SYSTEM_KEYS"] = { type ="value", }, 195 | ["GLFW_KEY_REPEAT"] = { type ="value", }, 196 | ["GLFW_AUTO_POLL_EVENTS"] = { type ="value", }, 197 | ["GLFW_WAIT"] = { type ="value", }, 198 | ["GLFW_NOWAIT"] = { type ="value", }, 199 | ["GLFW_PRESENT"] = { type ="value", }, 200 | ["GLFW_AXES"] = { type ="value", }, 201 | ["GLFW_BUTTONS"] = { type ="value", }, 202 | ["GLFW_NO_RESCALE_BIT"] = { type ="value", }, 203 | ["GLFW_ORIGIN_UL_BIT"] = { type ="value", }, 204 | ["GLFW_BUILD_MIPMAPS_BIT"] = { type ="value", }, 205 | ["GLFW_ALPHA_MAP_BIT"] = { type ="value", }, 206 | ["glfwInit"] = { type ="function", 207 | description = "", 208 | returns = "(int)", 209 | args = "(void)", }, 210 | ["glfwTerminate"] = { type ="function", 211 | description = "", 212 | returns = "()", 213 | args = "(void)", }, 214 | ["glfwGetVersion"] = { type ="function", 215 | description = "", 216 | returns = "()", 217 | args = "(int *major, int *minor, int *rev)", }, 218 | ["glfwOpenWindow"] = { type ="function", 219 | description = "", 220 | returns = "(int)", 221 | args = "(int width, int height, int redbits, int greenbits, int bluebits, int alphabits, int depthbits, int stencilbits, int mode)", }, 222 | ["glfwOpenWindowHint"] = { type ="function", 223 | description = "", 224 | returns = "()", 225 | args = "(int target, int hint)", }, 226 | ["glfwCloseWindow"] = { type ="function", 227 | description = "", 228 | returns = "()", 229 | args = "(void)", }, 230 | ["glfwSetWindowTitle"] = { type ="function", 231 | description = "", 232 | returns = "()", 233 | args = "(const char *title)", }, 234 | ["glfwGetWindowSize"] = { type ="function", 235 | description = "", 236 | returns = "()", 237 | args = "(int *width, int *height)", }, 238 | ["glfwSetWindowSize"] = { type ="function", 239 | description = "", 240 | returns = "()", 241 | args = "(int width, int height)", }, 242 | ["glfwSetWindowPos"] = { type ="function", 243 | description = "", 244 | returns = "()", 245 | args = "(int x, int y)", }, 246 | ["glfwIconifyWindow"] = { type ="function", 247 | description = "", 248 | returns = "()", 249 | args = "(void)", }, 250 | ["glfwRestoreWindow"] = { type ="function", 251 | description = "", 252 | returns = "()", 253 | args = "(void)", }, 254 | ["glfwSwapBuffers"] = { type ="function", 255 | description = "", 256 | returns = "()", 257 | args = "(void)", }, 258 | ["glfwSwapInterval"] = { type ="function", 259 | description = "", 260 | returns = "()", 261 | args = "(int interval)", }, 262 | ["glfwGetWindowParam"] = { type ="function", 263 | description = "", 264 | returns = "(int)", 265 | args = "(int param)", }, 266 | ["glfwSetWindowSizeCallback"] = { type ="function", 267 | description = "", 268 | returns = "()", 269 | args = "(GLFWwindowsizefun cbfun)", }, 270 | ["glfwSetWindowCloseCallback"] = { type ="function", 271 | description = "", 272 | returns = "()", 273 | args = "(GLFWwindowclosefun cbfun)", }, 274 | ["glfwSetWindowRefreshCallback"] = { type ="function", 275 | description = "", 276 | returns = "()", 277 | args = "(GLFWwindowrefreshfun cbfun)", }, 278 | ["glfwGetVideoModes"] = { type ="function", 279 | description = "", 280 | returns = "(int)", 281 | args = "(GLFWvidmode *list, int maxcount)", }, 282 | ["glfwGetDesktopMode"] = { type ="function", 283 | description = "", 284 | returns = "()", 285 | args = "(GLFWvidmode *mode)", }, 286 | ["glfwPollEvents"] = { type ="function", 287 | description = "", 288 | returns = "()", 289 | args = "(void)", }, 290 | ["glfwWaitEvents"] = { type ="function", 291 | description = "", 292 | returns = "()", 293 | args = "(void)", }, 294 | ["glfwGetKey"] = { type ="function", 295 | description = "", 296 | returns = "(int)", 297 | args = "(int key)", }, 298 | ["glfwGetMouseButton"] = { type ="function", 299 | description = "", 300 | returns = "(int)", 301 | args = "(int button)", }, 302 | ["glfwGetMousePos"] = { type ="function", 303 | description = "", 304 | returns = "()", 305 | args = "(int *xpos, int *ypos)", }, 306 | ["glfwSetMousePos"] = { type ="function", 307 | description = "", 308 | returns = "()", 309 | args = "(int xpos, int ypos)", }, 310 | ["glfwGetMouseWheel"] = { type ="function", 311 | description = "", 312 | returns = "(int)", 313 | args = "(void)", }, 314 | ["glfwSetMouseWheel"] = { type ="function", 315 | description = "", 316 | returns = "()", 317 | args = "(int pos)", }, 318 | ["glfwSetKeyCallback"] = { type ="function", 319 | description = "", 320 | returns = "()", 321 | args = "(GLFWkeyfun cbfun)", }, 322 | ["glfwSetCharCallback"] = { type ="function", 323 | description = "", 324 | returns = "()", 325 | args = "(GLFWcharfun cbfun)", }, 326 | ["glfwSetMouseButtonCallback"] = { type ="function", 327 | description = "", 328 | returns = "()", 329 | args = "(GLFWmousebuttonfun cbfun)", }, 330 | ["glfwSetMousePosCallback"] = { type ="function", 331 | description = "", 332 | returns = "()", 333 | args = "(GLFWmouseposfun cbfun)", }, 334 | ["glfwSetMouseWheelCallback"] = { type ="function", 335 | description = "", 336 | returns = "()", 337 | args = "(GLFWmousewheelfun cbfun)", }, 338 | ["glfwGetJoystickParam"] = { type ="function", 339 | description = "", 340 | returns = "(int)", 341 | args = "(int joy, int param)", }, 342 | ["glfwGetJoystickPos"] = { type ="function", 343 | description = "", 344 | returns = "(int)", 345 | args = "(int joy, float *pos, int numaxes)", }, 346 | ["glfwGetJoystickButtons"] = { type ="function", 347 | description = "", 348 | returns = "(int)", 349 | args = "(int joy, unsigned char *buttons, int numbuttons)", }, 350 | ["glfwGetTime"] = { type ="function", 351 | description = "", 352 | returns = "(double)", 353 | args = "(void)", }, 354 | ["glfwSetTime"] = { type ="function", 355 | description = "", 356 | returns = "()", 357 | args = "(double time)", }, 358 | ["glfwSleep"] = { type ="function", 359 | description = "", 360 | returns = "()", 361 | args = "(double time)", }, 362 | ["glfwExtensionSupported"] = { type ="function", 363 | description = "", 364 | returns = "(int)", 365 | args = "(const char *extension)", }, 366 | ["glfwGetProcAddress"] = { type ="function", 367 | description = "", 368 | returns = "(void*)", 369 | args = "(const char *procname)", }, 370 | ["glfwGetGLVersion"] = { type ="function", 371 | description = "", 372 | returns = "()", 373 | args = "(int *major, int *minor, int *rev)", }, 374 | ["glfwCreateThread"] = { type ="function", 375 | description = "", 376 | returns = "(GLFWthread)", 377 | args = "(GLFWthreadfun fun, void *arg)", }, 378 | ["glfwDestroyThread"] = { type ="function", 379 | description = "", 380 | returns = "()", 381 | args = "(GLFWthread ID)", }, 382 | ["glfwWaitThread"] = { type ="function", 383 | description = "", 384 | returns = "(int)", 385 | args = "(GLFWthread ID, int waitmode)", }, 386 | ["glfwGetThreadID"] = { type ="function", 387 | description = "", 388 | returns = "(GLFWthread)", 389 | args = "(void)", }, 390 | ["glfwCreateMutex"] = { type ="function", 391 | description = "", 392 | returns = "(GLFWmutex)", 393 | args = "(void)", }, 394 | ["glfwDestroyMutex"] = { type ="function", 395 | description = "", 396 | returns = "()", 397 | args = "(GLFWmutex mutex)", }, 398 | ["glfwLockMutex"] = { type ="function", 399 | description = "", 400 | returns = "()", 401 | args = "(GLFWmutex mutex)", }, 402 | ["glfwUnlockMutex"] = { type ="function", 403 | description = "", 404 | returns = "()", 405 | args = "(GLFWmutex mutex)", }, 406 | ["glfwCreateCond"] = { type ="function", 407 | description = "", 408 | returns = "(GLFWcond)", 409 | args = "(void)", }, 410 | ["glfwDestroyCond"] = { type ="function", 411 | description = "", 412 | returns = "()", 413 | args = "(GLFWcond cond)", }, 414 | ["glfwWaitCond"] = { type ="function", 415 | description = "", 416 | returns = "()", 417 | args = "(GLFWcond cond, GLFWmutex mutex, double timeout)", }, 418 | ["glfwSignalCond"] = { type ="function", 419 | description = "", 420 | returns = "()", 421 | args = "(GLFWcond cond)", }, 422 | ["glfwBroadcastCond"] = { type ="function", 423 | description = "", 424 | returns = "()", 425 | args = "(GLFWcond cond)", }, 426 | ["glfwGetNumberOfProcessors"] = { type ="function", 427 | description = "", 428 | returns = "(int)", 429 | args = "(void)", }, 430 | ["glfwEnable"] = { type ="function", 431 | description = "", 432 | returns = "()", 433 | args = "(int token)", }, 434 | ["glfwDisable"] = { type ="function", 435 | description = "", 436 | returns = "()", 437 | args = "(int token)", }, 438 | ["glfwReadImage"] = { type ="function", 439 | description = "", 440 | returns = "(int)", 441 | args = "(const char *name, GLFWimage *img, int flags)", }, 442 | ["glfwReadMemoryImage"] = { type ="function", 443 | description = "", 444 | returns = "(int)", 445 | args = "(const void *data, long size, GLFWimage *img, int flags)", }, 446 | ["glfwFreeImage"] = { type ="function", 447 | description = "", 448 | returns = "()", 449 | args = "(GLFWimage *img)", }, 450 | ["glfwLoadTexture2D"] = { type ="function", 451 | description = "", 452 | returns = "(int)", 453 | args = "(const char *name, int flags)", }, 454 | ["glfwLoadMemoryTexture2D"] = { type ="function", 455 | description = "", 456 | returns = "(int)", 457 | args = "(const void *data, long size, int flags)", }, 458 | ["glfwLoadTextureImage2D"] = { type ="function", 459 | description = "", 460 | returns = "(int)", 461 | args = "(GLFWimage *img, int flags)", }, 462 | ["GLFWvidmode"] = { type ="class", 463 | description = "", 464 | childs = 465 | { 466 | ["Width"] = { type ="value", description = "int", }, 467 | ["Height"] = { type ="value", description = "int", }, 468 | ["RedBits"] = { type ="value", description = "int", }, 469 | ["BlueBits"] = { type ="value", description = "int", }, 470 | ["GreenBits"] = { type ="value", description = "int", }, 471 | } }, 472 | ["GLFWimage"] = { type ="class", 473 | description = "", 474 | childs = 475 | { 476 | ["Width"] = { type ="value", description = "int", }, 477 | ["Height"] = { type ="value", description = "int", }, 478 | ["Format"] = { type ="value", description = "int", }, 479 | ["BytesPerPixel"] = { type ="value", description = "int", }, 480 | } }, 481 | } 482 | 483 | return { 484 | glfw = { 485 | type = "lib", 486 | description = "GLFW window manager", 487 | childs = api, 488 | }, 489 | } 490 | -------------------------------------------------------------------------------- /graphicscodepack/api/lua/glfw3.lua: -------------------------------------------------------------------------------- 1 | -- glfw | GLFW 3.x 2 | -- auto-generated api from ffi headers 3 | local api= 4 | { 5 | ["GLFW_VERSION_MAJOR"] = { type ="value", }, 6 | ["GLFW_VERSION_MINOR"] = { type ="value", }, 7 | ["GLFW_VERSION_REVISION"] = { type ="value", }, 8 | ["GLFW_RELEASE"] = { type ="value", }, 9 | ["GLFW_PRESS"] = { type ="value", }, 10 | ["GLFW_KEY_SPACE"] = { type ="value", }, 11 | ["GLFW_KEY_APOSTROPHE"] = { type ="value", }, 12 | ["GLFW_KEY_COMMA"] = { type ="value", }, 13 | ["GLFW_KEY_MINUS"] = { type ="value", }, 14 | ["GLFW_KEY_PERIOD"] = { type ="value", }, 15 | ["GLFW_KEY_SLASH"] = { type ="value", }, 16 | ["GLFW_KEY_0"] = { type ="value", }, 17 | ["GLFW_KEY_1"] = { type ="value", }, 18 | ["GLFW_KEY_2"] = { type ="value", }, 19 | ["GLFW_KEY_3"] = { type ="value", }, 20 | ["GLFW_KEY_4"] = { type ="value", }, 21 | ["GLFW_KEY_5"] = { type ="value", }, 22 | ["GLFW_KEY_6"] = { type ="value", }, 23 | ["GLFW_KEY_7"] = { type ="value", }, 24 | ["GLFW_KEY_8"] = { type ="value", }, 25 | ["GLFW_KEY_9"] = { type ="value", }, 26 | ["GLFW_KEY_SEMICOLON"] = { type ="value", }, 27 | ["GLFW_KEY_EQUAL"] = { type ="value", }, 28 | ["GLFW_KEY_A"] = { type ="value", }, 29 | ["GLFW_KEY_B"] = { type ="value", }, 30 | ["GLFW_KEY_C"] = { type ="value", }, 31 | ["GLFW_KEY_D"] = { type ="value", }, 32 | ["GLFW_KEY_E"] = { type ="value", }, 33 | ["GLFW_KEY_F"] = { type ="value", }, 34 | ["GLFW_KEY_G"] = { type ="value", }, 35 | ["GLFW_KEY_H"] = { type ="value", }, 36 | ["GLFW_KEY_I"] = { type ="value", }, 37 | ["GLFW_KEY_J"] = { type ="value", }, 38 | ["GLFW_KEY_K"] = { type ="value", }, 39 | ["GLFW_KEY_L"] = { type ="value", }, 40 | ["GLFW_KEY_M"] = { type ="value", }, 41 | ["GLFW_KEY_N"] = { type ="value", }, 42 | ["GLFW_KEY_O"] = { type ="value", }, 43 | ["GLFW_KEY_P"] = { type ="value", }, 44 | ["GLFW_KEY_Q"] = { type ="value", }, 45 | ["GLFW_KEY_R"] = { type ="value", }, 46 | ["GLFW_KEY_S"] = { type ="value", }, 47 | ["GLFW_KEY_T"] = { type ="value", }, 48 | ["GLFW_KEY_U"] = { type ="value", }, 49 | ["GLFW_KEY_V"] = { type ="value", }, 50 | ["GLFW_KEY_W"] = { type ="value", }, 51 | ["GLFW_KEY_X"] = { type ="value", }, 52 | ["GLFW_KEY_Y"] = { type ="value", }, 53 | ["GLFW_KEY_Z"] = { type ="value", }, 54 | ["GLFW_KEY_LEFT_BRACKET"] = { type ="value", }, 55 | ["GLFW_KEY_BACKSLASH"] = { type ="value", }, 56 | ["GLFW_KEY_RIGHT_BRACKET"] = { type ="value", }, 57 | ["GLFW_KEY_GRAVE_ACCENT"] = { type ="value", }, 58 | ["GLFW_KEY_WORLD_1"] = { type ="value", }, 59 | ["GLFW_KEY_WORLD_2"] = { type ="value", }, 60 | ["GLFW_KEY_ESCAPE"] = { type ="value", }, 61 | ["GLFW_KEY_ENTER"] = { type ="value", }, 62 | ["GLFW_KEY_TAB"] = { type ="value", }, 63 | ["GLFW_KEY_BACKSPACE"] = { type ="value", }, 64 | ["GLFW_KEY_INSERT"] = { type ="value", }, 65 | ["GLFW_KEY_DELETE"] = { type ="value", }, 66 | ["GLFW_KEY_RIGHT"] = { type ="value", }, 67 | ["GLFW_KEY_LEFT"] = { type ="value", }, 68 | ["GLFW_KEY_DOWN"] = { type ="value", }, 69 | ["GLFW_KEY_UP"] = { type ="value", }, 70 | ["GLFW_KEY_PAGE_UP"] = { type ="value", }, 71 | ["GLFW_KEY_PAGE_DOWN"] = { type ="value", }, 72 | ["GLFW_KEY_HOME"] = { type ="value", }, 73 | ["GLFW_KEY_END"] = { type ="value", }, 74 | ["GLFW_KEY_CAPS_LOCK"] = { type ="value", }, 75 | ["GLFW_KEY_SCROLL_LOCK"] = { type ="value", }, 76 | ["GLFW_KEY_NUM_LOCK"] = { type ="value", }, 77 | ["GLFW_KEY_PRINT_SCREEN"] = { type ="value", }, 78 | ["GLFW_KEY_PAUSE"] = { type ="value", }, 79 | ["GLFW_KEY_F1"] = { type ="value", }, 80 | ["GLFW_KEY_F2"] = { type ="value", }, 81 | ["GLFW_KEY_F3"] = { type ="value", }, 82 | ["GLFW_KEY_F4"] = { type ="value", }, 83 | ["GLFW_KEY_F5"] = { type ="value", }, 84 | ["GLFW_KEY_F6"] = { type ="value", }, 85 | ["GLFW_KEY_F7"] = { type ="value", }, 86 | ["GLFW_KEY_F8"] = { type ="value", }, 87 | ["GLFW_KEY_F9"] = { type ="value", }, 88 | ["GLFW_KEY_F10"] = { type ="value", }, 89 | ["GLFW_KEY_F11"] = { type ="value", }, 90 | ["GLFW_KEY_F12"] = { type ="value", }, 91 | ["GLFW_KEY_F13"] = { type ="value", }, 92 | ["GLFW_KEY_F14"] = { type ="value", }, 93 | ["GLFW_KEY_F15"] = { type ="value", }, 94 | ["GLFW_KEY_F16"] = { type ="value", }, 95 | ["GLFW_KEY_F17"] = { type ="value", }, 96 | ["GLFW_KEY_F18"] = { type ="value", }, 97 | ["GLFW_KEY_F19"] = { type ="value", }, 98 | ["GLFW_KEY_F20"] = { type ="value", }, 99 | ["GLFW_KEY_F21"] = { type ="value", }, 100 | ["GLFW_KEY_F22"] = { type ="value", }, 101 | ["GLFW_KEY_F23"] = { type ="value", }, 102 | ["GLFW_KEY_F24"] = { type ="value", }, 103 | ["GLFW_KEY_F25"] = { type ="value", }, 104 | ["GLFW_KEY_KP_0"] = { type ="value", }, 105 | ["GLFW_KEY_KP_1"] = { type ="value", }, 106 | ["GLFW_KEY_KP_2"] = { type ="value", }, 107 | ["GLFW_KEY_KP_3"] = { type ="value", }, 108 | ["GLFW_KEY_KP_4"] = { type ="value", }, 109 | ["GLFW_KEY_KP_5"] = { type ="value", }, 110 | ["GLFW_KEY_KP_6"] = { type ="value", }, 111 | ["GLFW_KEY_KP_7"] = { type ="value", }, 112 | ["GLFW_KEY_KP_8"] = { type ="value", }, 113 | ["GLFW_KEY_KP_9"] = { type ="value", }, 114 | ["GLFW_KEY_KP_DECIMAL"] = { type ="value", }, 115 | ["GLFW_KEY_KP_DIVIDE"] = { type ="value", }, 116 | ["GLFW_KEY_KP_MULTIPLY"] = { type ="value", }, 117 | ["GLFW_KEY_KP_SUBTRACT"] = { type ="value", }, 118 | ["GLFW_KEY_KP_ADD"] = { type ="value", }, 119 | ["GLFW_KEY_KP_ENTER"] = { type ="value", }, 120 | ["GLFW_KEY_KP_EQUAL"] = { type ="value", }, 121 | ["GLFW_KEY_LEFT_SHIFT"] = { type ="value", }, 122 | ["GLFW_KEY_LEFT_CONTROL"] = { type ="value", }, 123 | ["GLFW_KEY_LEFT_ALT"] = { type ="value", }, 124 | ["GLFW_KEY_LEFT_SUPER"] = { type ="value", }, 125 | ["GLFW_KEY_RIGHT_SHIFT"] = { type ="value", }, 126 | ["GLFW_KEY_RIGHT_CONTROL"] = { type ="value", }, 127 | ["GLFW_KEY_RIGHT_ALT"] = { type ="value", }, 128 | ["GLFW_KEY_RIGHT_SUPER"] = { type ="value", }, 129 | ["GLFW_KEY_MENU"] = { type ="value", }, 130 | ["GLFW_KEY_LAST"] = { type ="value", }, 131 | ["GLFW_MOUSE_BUTTON_1"] = { type ="value", }, 132 | ["GLFW_MOUSE_BUTTON_2"] = { type ="value", }, 133 | ["GLFW_MOUSE_BUTTON_3"] = { type ="value", }, 134 | ["GLFW_MOUSE_BUTTON_4"] = { type ="value", }, 135 | ["GLFW_MOUSE_BUTTON_5"] = { type ="value", }, 136 | ["GLFW_MOUSE_BUTTON_6"] = { type ="value", }, 137 | ["GLFW_MOUSE_BUTTON_7"] = { type ="value", }, 138 | ["GLFW_MOUSE_BUTTON_8"] = { type ="value", }, 139 | ["GLFW_MOUSE_BUTTON_LAST"] = { type ="value", }, 140 | ["GLFW_MOUSE_BUTTON_LEFT"] = { type ="value", }, 141 | ["GLFW_MOUSE_BUTTON_RIGHT"] = { type ="value", }, 142 | ["GLFW_MOUSE_BUTTON_MIDDLE"] = { type ="value", }, 143 | ["GLFW_JOYSTICK_1"] = { type ="value", }, 144 | ["GLFW_JOYSTICK_2"] = { type ="value", }, 145 | ["GLFW_JOYSTICK_3"] = { type ="value", }, 146 | ["GLFW_JOYSTICK_4"] = { type ="value", }, 147 | ["GLFW_JOYSTICK_5"] = { type ="value", }, 148 | ["GLFW_JOYSTICK_6"] = { type ="value", }, 149 | ["GLFW_JOYSTICK_7"] = { type ="value", }, 150 | ["GLFW_JOYSTICK_8"] = { type ="value", }, 151 | ["GLFW_JOYSTICK_9"] = { type ="value", }, 152 | ["GLFW_JOYSTICK_10"] = { type ="value", }, 153 | ["GLFW_JOYSTICK_11"] = { type ="value", }, 154 | ["GLFW_JOYSTICK_12"] = { type ="value", }, 155 | ["GLFW_JOYSTICK_13"] = { type ="value", }, 156 | ["GLFW_JOYSTICK_14"] = { type ="value", }, 157 | ["GLFW_JOYSTICK_15"] = { type ="value", }, 158 | ["GLFW_JOYSTICK_16"] = { type ="value", }, 159 | ["GLFW_JOYSTICK_LAST"] = { type ="value", }, 160 | ["GLFW_WINDOWED"] = { type ="value", }, 161 | ["GLFW_FULLSCREEN"] = { type ="value", }, 162 | ["GLFW_ACTIVE"] = { type ="value", }, 163 | ["GLFW_ICONIFIED"] = { type ="value", }, 164 | ["GLFW_ACCELERATED"] = { type ="value", }, 165 | ["GLFW_RED_BITS"] = { type ="value", }, 166 | ["GLFW_GREEN_BITS"] = { type ="value", }, 167 | ["GLFW_BLUE_BITS"] = { type ="value", }, 168 | ["GLFW_ALPHA_BITS"] = { type ="value", }, 169 | ["GLFW_DEPTH_BITS"] = { type ="value", }, 170 | ["GLFW_STENCIL_BITS"] = { type ="value", }, 171 | ["GLFW_REFRESH_RATE"] = { type ="value", }, 172 | ["GLFW_ACCUM_RED_BITS"] = { type ="value", }, 173 | ["GLFW_ACCUM_GREEN_BITS"] = { type ="value", }, 174 | ["GLFW_ACCUM_BLUE_BITS"] = { type ="value", }, 175 | ["GLFW_ACCUM_ALPHA_BITS"] = { type ="value", }, 176 | ["GLFW_AUX_BUFFERS"] = { type ="value", }, 177 | ["GLFW_STEREO"] = { type ="value", }, 178 | ["GLFW_WINDOW_NO_RESIZE"] = { type ="value", }, 179 | ["GLFW_FSAA_SAMPLES"] = { type ="value", }, 180 | ["GLFW_OPENGL_VERSION_MAJOR"] = { type ="value", }, 181 | ["GLFW_OPENGL_VERSION_MINOR"] = { type ="value", }, 182 | ["GLFW_OPENGL_FORWARD_COMPAT"] = { type ="value", }, 183 | ["GLFW_OPENGL_DEBUG_CONTEXT"] = { type ="value", }, 184 | ["GLFW_OPENGL_PROFILE"] = { type ="value", }, 185 | ["GLFW_OPENGL_CORE_PROFILE"] = { type ="value", }, 186 | ["GLFW_OPENGL_COMPAT_PROFILE"] = { type ="value", }, 187 | ["GLFW_OPENGL_ES2_PROFILE"] = { type ="value", }, 188 | ["GLFW_MOUSE_CURSOR"] = { type ="value", }, 189 | ["GLFW_STICKY_KEYS"] = { type ="value", }, 190 | ["GLFW_STICKY_MOUSE_BUTTONS"] = { type ="value", }, 191 | ["GLFW_SYSTEM_KEYS"] = { type ="value", }, 192 | ["GLFW_KEY_REPEAT"] = { type ="value", }, 193 | ["GLFW_PRESENT"] = { type ="value", }, 194 | ["GLFW_AXES"] = { type ="value", }, 195 | ["GLFW_BUTTONS"] = { type ="value", }, 196 | ["GLFW_NO_ERROR"] = { type ="value", }, 197 | ["GLFW_NOT_INITIALIZED"] = { type ="value", }, 198 | ["GLFW_NO_CURRENT_WINDOW"] = { type ="value", }, 199 | ["GLFW_INVALID_ENUM"] = { type ="value", }, 200 | ["GLFW_INVALID_VALUE"] = { type ="value", }, 201 | ["GLFW_OUT_OF_MEMORY"] = { type ="value", }, 202 | ["GLFW_OPENGL_UNAVAILABLE"] = { type ="value", }, 203 | ["GLFW_VERSION_UNAVAILABLE"] = { type ="value", }, 204 | ["GLFW_PLATFORM_ERROR"] = { type ="value", }, 205 | ["GLFW_GAMMA_RAMP_SIZE"] = { type ="value", }, 206 | ["glfwInit"] = { type ="function", 207 | description = "", 208 | returns = "(int)", 209 | args = "(void)", }, 210 | ["glfwTerminate"] = { type ="function", 211 | description = "", 212 | returns = "()", 213 | args = "(void)", }, 214 | ["glfwGetVersion"] = { type ="function", 215 | description = "", 216 | returns = "()", 217 | args = "(int* major, int* minor, int* rev)", }, 218 | ["glfwGetVersionString"] = { type ="function", 219 | description = "", 220 | returns = "(const char*)", 221 | valuetype = "string", 222 | args = "(void)", }, 223 | ["glfwGetError"] = { type ="function", 224 | description = "", 225 | returns = "(int)", 226 | args = "(void)", }, 227 | ["glfwErrorString"] = { type ="function", 228 | description = "", 229 | returns = "(const char*)", 230 | valuetype = "string", 231 | args = "(int error)", }, 232 | ["glfwGetVideoModes"] = { type ="function", 233 | description = "", 234 | returns = "(int)", 235 | args = "(GLFWvidmode* list, int maxcount)", }, 236 | ["glfwGetDesktopMode"] = { type ="function", 237 | description = "", 238 | returns = "()", 239 | args = "(GLFWvidmode* mode)", }, 240 | ["glfwSetGammaFormula"] = { type ="function", 241 | description = "", 242 | returns = "()", 243 | args = "(float gamma, float blacklevel, float gain)", }, 244 | ["glfwGetGammaRamp"] = { type ="function", 245 | description = "", 246 | returns = "()", 247 | args = "(GLFWgammaramp* ramp)", }, 248 | ["glfwSetGammaRamp"] = { type ="function", 249 | description = "", 250 | returns = "()", 251 | args = "(const GLFWgammaramp* ramp)", }, 252 | ["glfwOpenWindow"] = { type ="function", 253 | description = "", 254 | returns = "(GLFWwindow)", 255 | args = "(int width, int height, int mode, const char* title, GLFWwindow share)", }, 256 | ["glfwOpenWindowHint"] = { type ="function", 257 | description = "", 258 | returns = "()", 259 | args = "(int target, int hint)", }, 260 | ["glfwMakeWindowCurrent"] = { type ="function", 261 | description = "", 262 | returns = "()", 263 | args = "(GLFWwindow window)", }, 264 | ["glfwIsWindow"] = { type ="function", 265 | description = "", 266 | returns = "(int)", 267 | args = "(GLFWwindow window)", }, 268 | ["glfwGetCurrentWindow"] = { type ="function", 269 | description = "", 270 | returns = "(GLFWwindow)", 271 | args = "(void)", }, 272 | ["glfwCloseWindow"] = { type ="function", 273 | description = "", 274 | returns = "()", 275 | args = "(GLFWwindow window)", }, 276 | ["glfwSetWindowTitle"] = { type ="function", 277 | description = "", 278 | returns = "()", 279 | args = "(GLFWwindow, const char* title)", }, 280 | ["glfwGetWindowSize"] = { type ="function", 281 | description = "", 282 | returns = "()", 283 | args = "(GLFWwindow, int* width, int* height)", }, 284 | ["glfwSetWindowSize"] = { type ="function", 285 | description = "", 286 | returns = "()", 287 | args = "(GLFWwindow, int width, int height)", }, 288 | ["glfwGetWindowPos"] = { type ="function", 289 | description = "", 290 | returns = "()", 291 | args = "(GLFWwindow, int* x, int* y)", }, 292 | ["glfwSetWindowPos"] = { type ="function", 293 | description = "", 294 | returns = "()", 295 | args = "(GLFWwindow, int x, int y)", }, 296 | ["glfwIconifyWindow"] = { type ="function", 297 | description = "", 298 | returns = "()", 299 | args = "(GLFWwindow window)", }, 300 | ["glfwRestoreWindow"] = { type ="function", 301 | description = "", 302 | returns = "()", 303 | args = "(GLFWwindow window)", }, 304 | ["glfwGetWindowParam"] = { type ="function", 305 | description = "", 306 | returns = "(int)", 307 | args = "(GLFWwindow window, int param)", }, 308 | ["glfwSetWindowUserPointer"] = { type ="function", 309 | description = "", 310 | returns = "()", 311 | args = "(GLFWwindow window, void* pointer)", }, 312 | ["glfwGetWindowUserPointer"] = { type ="function", 313 | description = "", 314 | returns = "(void*)", 315 | args = "(GLFWwindow window)", }, 316 | ["glfwPollEvents"] = { type ="function", 317 | description = "", 318 | returns = "()", 319 | args = "(void)", }, 320 | ["glfwWaitEvents"] = { type ="function", 321 | description = "", 322 | returns = "()", 323 | args = "(void)", }, 324 | ["glfwGetKey"] = { type ="function", 325 | description = "", 326 | returns = "(int)", 327 | args = "(GLFWwindow window, int key)", }, 328 | ["glfwGetMouseButton"] = { type ="function", 329 | description = "", 330 | returns = "(int)", 331 | args = "(GLFWwindow window, int button)", }, 332 | ["glfwGetMousePos"] = { type ="function", 333 | description = "", 334 | returns = "()", 335 | args = "(GLFWwindow window, int* xpos, int* ypos)", }, 336 | ["glfwSetMousePos"] = { type ="function", 337 | description = "", 338 | returns = "()", 339 | args = "(GLFWwindow window, int xpos, int ypos)", }, 340 | ["glfwGetScrollOffset"] = { type ="function", 341 | description = "", 342 | returns = "()", 343 | args = "(GLFWwindow window, int* x, int* y)", }, 344 | ["glfwGetJoystickParam"] = { type ="function", 345 | description = "", 346 | returns = "(int)", 347 | args = "(int joy, int param)", }, 348 | ["glfwGetJoystickPos"] = { type ="function", 349 | description = "", 350 | returns = "(int)", 351 | args = "(int joy, float* pos, int numaxes)", }, 352 | ["glfwGetJoystickButtons"] = { type ="function", 353 | description = "", 354 | returns = "(int)", 355 | args = "(int joy, unsigned char* buttons, int numbuttons)", }, 356 | ["glfwGetTime"] = { type ="function", 357 | description = "", 358 | returns = "(double)", 359 | args = "(void)", }, 360 | ["glfwSetTime"] = { type ="function", 361 | description = "", 362 | returns = "()", 363 | args = "(double time)", }, 364 | ["glfwSwapBuffers"] = { type ="function", 365 | description = "", 366 | returns = "()", 367 | args = "(void)", }, 368 | ["glfwSwapInterval"] = { type ="function", 369 | description = "", 370 | returns = "()", 371 | args = "(int interval)", }, 372 | ["glfwExtensionSupported"] = { type ="function", 373 | description = "", 374 | returns = "(int)", 375 | args = "(const char* extension)", }, 376 | ["glfwGetProcAddress"] = { type ="function", 377 | description = "", 378 | returns = "(void*)", 379 | args = "(const char* procname)", }, 380 | ["glfwGetGLVersion"] = { type ="function", 381 | description = "", 382 | returns = "()", 383 | args = "(int* major, int* minor, int* rev)", }, 384 | ["glfwEnable"] = { type ="function", 385 | description = "", 386 | returns = "()", 387 | args = "(GLFWwindow window, int token)", }, 388 | ["glfwDisable"] = { type ="function", 389 | description = "", 390 | returns = "()", 391 | args = "(GLFWwindow window, int token)", }, 392 | ["GLFWvidmode"] = { type ="class", 393 | description = "", 394 | childs = 395 | { 396 | ["width"] = { type ="value", description = "int", }, 397 | ["height"] = { type ="value", description = "int", }, 398 | ["redBits"] = { type ="value", description = "int", }, 399 | ["blueBits"] = { type ="value", description = "int", }, 400 | ["greenBits"] = { type ="value", description = "int", }, 401 | } }, 402 | ["GLFWgammaramp"] = { type ="class", 403 | description = "", 404 | childs = 405 | { 406 | ["red"] = { type ="value", description = "unsigned short[GLFW_GAMMA_RAMP_SIZE]", }, 407 | ["green"] = { type ="value", description = "unsigned short[GLFW_GAMMA_RAMP_SIZE]", }, 408 | ["blue"] = { type ="value", description = "unsigned short[GLFW_GAMMA_RAMP_SIZE]", }, 409 | } }, 410 | } 411 | 412 | return { 413 | glfw = { 414 | type = "lib", 415 | description = "GLFW window manager", 416 | childs = api, 417 | }, 418 | } 419 | -------------------------------------------------------------------------------- /graphicscodepack/api/lua/shaderc.lua: -------------------------------------------------------------------------------- 1 | -- shaderc shdc | SHADERC GLSL to SPIR-V 2 | -- auto-generated api from ffi headers 3 | local api= 4 | { 5 | ["shaderc_source_language_glsl"] = { type ="value", }, 6 | ["shaderc_source_language_hlsl"] = { type ="value", }, 7 | ["shaderc_glsl_vertex_shader"] = { type ="value", }, 8 | ["shaderc_glsl_fragment_shader"] = { type ="value", }, 9 | ["shaderc_glsl_compute_shader"] = { type ="value", }, 10 | ["shaderc_glsl_geometry_shader"] = { type ="value", }, 11 | ["shaderc_glsl_tess_control_shader"] = { type ="value", }, 12 | ["shaderc_glsl_tess_evaluation_shader"] = { type ="value", }, 13 | ["shaderc_glsl_infer_from_source"] = { type ="value", }, 14 | ["shaderc_glsl_default_vertex_shader"] = { type ="value", }, 15 | ["shaderc_glsl_default_fragment_shader"] = { type ="value", }, 16 | ["shaderc_glsl_default_compute_shader"] = { type ="value", }, 17 | ["shaderc_glsl_default_geometry_shader"] = { type ="value", }, 18 | ["shaderc_glsl_default_tess_control_shader"] = { type ="value", }, 19 | ["shaderc_glsl_default_tess_evaluation_shader"] = { type ="value", }, 20 | ["shaderc_spirv_assembly"] = { type ="value", }, 21 | ["shaderc_target_env_vulkan"] = { type ="value", }, 22 | ["shaderc_target_env_opengl"] = { type ="value", }, 23 | ["shaderc_target_env_opengl_compat"] = { type ="value", }, 24 | ["shaderc_target_env_default"] = { type ="value", }, 25 | ["shaderc_profile_none"] = { type ="value", }, 26 | ["shaderc_profile_core"] = { type ="value", }, 27 | ["shaderc_profile_compatibility"] = { type ="value", }, 28 | ["shaderc_profile_es"] = { type ="value", }, 29 | ["shaderc_compilation_status_success"] = { type ="value", }, 30 | ["shaderc_compilation_status_invalid_stage"] = { type ="value", }, 31 | ["shaderc_compilation_status_compilation_error"] = { type ="value", }, 32 | ["shaderc_compilation_status_internal_error"] = { type ="value", }, 33 | ["shaderc_compilation_status_null_result_object"] = { type ="value", }, 34 | ["shaderc_compilation_status_invalid_assembly"] = { type ="value", }, 35 | ["shaderc_optimization_level_zero"] = { type ="value", }, 36 | ["shaderc_optimization_level_size"] = { type ="value", }, 37 | ["shaderc_limit_max_lights"] = { type ="value", }, 38 | ["shaderc_limit_max_clip_planes"] = { type ="value", }, 39 | ["shaderc_limit_max_texture_units"] = { type ="value", }, 40 | ["shaderc_limit_max_texture_coords"] = { type ="value", }, 41 | ["shaderc_limit_max_vertex_attribs"] = { type ="value", }, 42 | ["shaderc_limit_max_vertex_uniform_components"] = { type ="value", }, 43 | ["shaderc_limit_max_varying_floats"] = { type ="value", }, 44 | ["shaderc_limit_max_vertex_texture_image_units"] = { type ="value", }, 45 | ["shaderc_limit_max_combined_texture_image_units"] = { type ="value", }, 46 | ["shaderc_limit_max_texture_image_units"] = { type ="value", }, 47 | ["shaderc_limit_max_fragment_uniform_components"] = { type ="value", }, 48 | ["shaderc_limit_max_draw_buffers"] = { type ="value", }, 49 | ["shaderc_limit_max_vertex_uniform_vectors"] = { type ="value", }, 50 | ["shaderc_limit_max_varying_vectors"] = { type ="value", }, 51 | ["shaderc_limit_max_fragment_uniform_vectors"] = { type ="value", }, 52 | ["shaderc_limit_max_vertex_output_vectors"] = { type ="value", }, 53 | ["shaderc_limit_max_fragment_input_vectors"] = { type ="value", }, 54 | ["shaderc_limit_min_program_texel_offset"] = { type ="value", }, 55 | ["shaderc_limit_max_program_texel_offset"] = { type ="value", }, 56 | ["shaderc_limit_max_clip_distances"] = { type ="value", }, 57 | ["shaderc_limit_max_compute_work_group_count_x"] = { type ="value", }, 58 | ["shaderc_limit_max_compute_work_group_count_y"] = { type ="value", }, 59 | ["shaderc_limit_max_compute_work_group_count_z"] = { type ="value", }, 60 | ["shaderc_limit_max_compute_work_group_size_x"] = { type ="value", }, 61 | ["shaderc_limit_max_compute_work_group_size_y"] = { type ="value", }, 62 | ["shaderc_limit_max_compute_work_group_size_z"] = { type ="value", }, 63 | ["shaderc_limit_max_compute_uniform_components"] = { type ="value", }, 64 | ["shaderc_limit_max_compute_texture_image_units"] = { type ="value", }, 65 | ["shaderc_limit_max_compute_image_uniforms"] = { type ="value", }, 66 | ["shaderc_limit_max_compute_atomic_counters"] = { type ="value", }, 67 | ["shaderc_limit_max_compute_atomic_counter_buffers"] = { type ="value", }, 68 | ["shaderc_limit_max_varying_components"] = { type ="value", }, 69 | ["shaderc_limit_max_vertex_output_components"] = { type ="value", }, 70 | ["shaderc_limit_max_geometry_input_components"] = { type ="value", }, 71 | ["shaderc_limit_max_geometry_output_components"] = { type ="value", }, 72 | ["shaderc_limit_max_fragment_input_components"] = { type ="value", }, 73 | ["shaderc_limit_max_image_units"] = { type ="value", }, 74 | ["shaderc_limit_max_combined_image_units_and_fragment_outputs"] = { type ="value", }, 75 | ["shaderc_limit_max_combined_shader_output_resources"] = { type ="value", }, 76 | ["shaderc_limit_max_image_samples"] = { type ="value", }, 77 | ["shaderc_limit_max_vertex_image_uniforms"] = { type ="value", }, 78 | ["shaderc_limit_max_tess_control_image_uniforms"] = { type ="value", }, 79 | ["shaderc_limit_max_tess_evaluation_image_uniforms"] = { type ="value", }, 80 | ["shaderc_limit_max_geometry_image_uniforms"] = { type ="value", }, 81 | ["shaderc_limit_max_fragment_image_uniforms"] = { type ="value", }, 82 | ["shaderc_limit_max_combined_image_uniforms"] = { type ="value", }, 83 | ["shaderc_limit_max_geometry_texture_image_units"] = { type ="value", }, 84 | ["shaderc_limit_max_geometry_output_vertices"] = { type ="value", }, 85 | ["shaderc_limit_max_geometry_total_output_components"] = { type ="value", }, 86 | ["shaderc_limit_max_geometry_uniform_components"] = { type ="value", }, 87 | ["shaderc_limit_max_geometry_varying_components"] = { type ="value", }, 88 | ["shaderc_limit_max_tess_control_input_components"] = { type ="value", }, 89 | ["shaderc_limit_max_tess_control_output_components"] = { type ="value", }, 90 | ["shaderc_limit_max_tess_control_texture_image_units"] = { type ="value", }, 91 | ["shaderc_limit_max_tess_control_uniform_components"] = { type ="value", }, 92 | ["shaderc_limit_max_tess_control_total_output_components"] = { type ="value", }, 93 | ["shaderc_limit_max_tess_evaluation_input_components"] = { type ="value", }, 94 | ["shaderc_limit_max_tess_evaluation_output_components"] = { type ="value", }, 95 | ["shaderc_limit_max_tess_evaluation_texture_image_units"] = { type ="value", }, 96 | ["shaderc_limit_max_tess_evaluation_uniform_components"] = { type ="value", }, 97 | ["shaderc_limit_max_tess_patch_components"] = { type ="value", }, 98 | ["shaderc_limit_max_patch_vertices"] = { type ="value", }, 99 | ["shaderc_limit_max_tess_gen_level"] = { type ="value", }, 100 | ["shaderc_limit_max_viewports"] = { type ="value", }, 101 | ["shaderc_limit_max_vertex_atomic_counters"] = { type ="value", }, 102 | ["shaderc_limit_max_tess_control_atomic_counters"] = { type ="value", }, 103 | ["shaderc_limit_max_tess_evaluation_atomic_counters"] = { type ="value", }, 104 | ["shaderc_limit_max_geometry_atomic_counters"] = { type ="value", }, 105 | ["shaderc_limit_max_fragment_atomic_counters"] = { type ="value", }, 106 | ["shaderc_limit_max_combined_atomic_counters"] = { type ="value", }, 107 | ["shaderc_limit_max_atomic_counter_bindings"] = { type ="value", }, 108 | ["shaderc_limit_max_vertex_atomic_counter_buffers"] = { type ="value", }, 109 | ["shaderc_limit_max_tess_control_atomic_counter_buffers"] = { type ="value", }, 110 | ["shaderc_limit_max_tess_evaluation_atomic_counter_buffers"] = { type ="value", }, 111 | ["shaderc_limit_max_geometry_atomic_counter_buffers"] = { type ="value", }, 112 | ["shaderc_limit_max_fragment_atomic_counter_buffers"] = { type ="value", }, 113 | ["shaderc_limit_max_combined_atomic_counter_buffers"] = { type ="value", }, 114 | ["shaderc_limit_max_atomic_counter_buffer_size"] = { type ="value", }, 115 | ["shaderc_limit_max_transform_feedback_buffers"] = { type ="value", }, 116 | ["shaderc_limit_max_transform_feedback_interleaved_components"] = { type ="value", }, 117 | ["shaderc_limit_max_cull_distances"] = { type ="value", }, 118 | ["shaderc_limit_max_combined_clip_and_cull_distances"] = { type ="value", }, 119 | ["shaderc_limit_max_samples"] = { type ="value", }, 120 | ["shaderc_include_type_relative"] = { type ="value", }, 121 | ["shaderc_include_type_standard"] = { type ="value", }, 122 | ["shaderc_compiler_initialize"] = { type ="function", 123 | description = "", 124 | returns = "(shaderc_compiler_t)", 125 | args = "(void)", }, 126 | ["shaderc_compiler_release"] = { type ="function", 127 | description = "", 128 | returns = "()", 129 | args = "(shaderc_compiler_t)", }, 130 | ["shaderc_compile_options_initialize"] = { type ="function", 131 | description = "", 132 | returns = "(shaderc_compile_options_t)", 133 | args = "(void)", }, 134 | ["shaderc_compile_options_clone"] = { type ="function", 135 | description = "", 136 | returns = "(shaderc_compile_options_t)", 137 | args = "(const shaderc_compile_options_t options)", }, 138 | ["shaderc_compile_options_release"] = { type ="function", 139 | description = "", 140 | returns = "()", 141 | args = "(shaderc_compile_options_t options)", }, 142 | ["shaderc_compile_options_add_macro_definition"] = { type ="function", 143 | description = "", 144 | returns = "()", 145 | args = "(shaderc_compile_options_t options, const char* name, size_t name_length, const char* value, size_t value_length)", }, 146 | ["shaderc_compile_options_set_source_language"] = { type ="function", 147 | description = "", 148 | returns = "()", 149 | args = "(shaderc_compile_options_t options, shaderc_source_language lang)", }, 150 | ["shaderc_compile_options_set_generate_debug_info"] = { type ="function", 151 | description = "", 152 | returns = "()", 153 | args = "(shaderc_compile_options_t options)", }, 154 | ["shaderc_compile_options_set_optimization_level"] = { type ="function", 155 | description = "", 156 | returns = "()", 157 | args = "(shaderc_compile_options_t options, shaderc_optimization_level level)", }, 158 | ["shaderc_compile_options_set_forced_version_profile"] = { type ="function", 159 | description = "", 160 | returns = "()", 161 | args = "(shaderc_compile_options_t options, int version, shaderc_profile profile)", }, 162 | ["shaderc_compile_options_set_include_callbacks"] = { type ="function", 163 | description = "", 164 | returns = "()", 165 | args = "(shaderc_compile_options_t options, shaderc_include_resolve_fn resolver, shaderc_include_result_release_fn result_releaser, void* user_data)", }, 166 | ["shaderc_compile_options_set_suppress_warnings"] = { type ="function", 167 | description = "", 168 | returns = "()", 169 | args = "(shaderc_compile_options_t options)", }, 170 | ["shaderc_compile_options_set_target_env"] = { type ="function", 171 | description = "", 172 | returns = "()", 173 | args = "(shaderc_compile_options_t options, shaderc_target_env target, uint32_t version)", }, 174 | ["shaderc_compile_options_set_warnings_as_errors"] = { type ="function", 175 | description = "", 176 | returns = "()", 177 | args = "(shaderc_compile_options_t options)", }, 178 | ["shaderc_compile_options_set_limit"] = { type ="function", 179 | description = "", 180 | returns = "()", 181 | args = "(shaderc_compile_options_t options, shaderc_limit limit, int value)", }, 182 | ["shaderc_compile_into_spv"] = { type ="function", 183 | description = "", 184 | returns = "(shaderc_compilation_result_t)", 185 | args = "(const shaderc_compiler_t compiler, const char* source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char* input_file_name, const char* entry_point_name, const shaderc_compile_options_t additional_options)", }, 186 | ["shaderc_compile_into_spv_assembly"] = { type ="function", 187 | description = "", 188 | returns = "(shaderc_compilation_result_t)", 189 | args = "(const shaderc_compiler_t compiler, const char* source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char* input_file_name, const char* entry_point_name, const shaderc_compile_options_t additional_options)", }, 190 | ["shaderc_compile_into_preprocessed_text"] = { type ="function", 191 | description = "", 192 | returns = "(shaderc_compilation_result_t)", 193 | args = "(const shaderc_compiler_t compiler, const char* source_text, size_t source_text_size, shaderc_shader_kind shader_kind, const char* input_file_name, const char* entry_point_name, const shaderc_compile_options_t additional_options)", }, 194 | ["shaderc_assemble_into_spv"] = { type ="function", 195 | description = "", 196 | returns = "(shaderc_compilation_result_t)", 197 | args = "(const shaderc_compiler_t compiler, const char* source_assembly, size_t source_assembly_size, const shaderc_compile_options_t additional_options)", }, 198 | ["shaderc_result_release"] = { type ="function", 199 | description = "", 200 | returns = "()", 201 | args = "(shaderc_compilation_result_t result)", }, 202 | ["shaderc_result_get_length"] = { type ="function", 203 | description = "", 204 | returns = "(size_t)", 205 | args = "(const shaderc_compilation_result_t result)", }, 206 | ["shaderc_result_get_num_warnings"] = { type ="function", 207 | description = "", 208 | returns = "(size_t)", 209 | args = "(const shaderc_compilation_result_t result)", }, 210 | ["shaderc_result_get_num_errors"] = { type ="function", 211 | description = "", 212 | returns = "(size_t)", 213 | args = "(const shaderc_compilation_result_t result)", }, 214 | ["shaderc_result_get_compilation_status"] = { type ="function", 215 | description = "", 216 | returns = "(shaderc_compilation_status)", 217 | args = "(const shaderc_compilation_result_t)", }, 218 | ["shaderc_result_get_bytes"] = { type ="function", 219 | description = "", 220 | returns = "(const char*)", 221 | valuetype = "string", 222 | args = "(const shaderc_compilation_result_t result)", }, 223 | ["shaderc_result_get_error_message"] = { type ="function", 224 | description = "", 225 | returns = "(const char*)", 226 | valuetype = "string", 227 | args = "(const shaderc_compilation_result_t result)", }, 228 | ["shaderc_get_spv_version"] = { type ="function", 229 | description = "", 230 | returns = "()", 231 | args = "(unsigned int* version, unsigned int* revision)", }, 232 | ["shaderc_parse_version_profile"] = { type ="function", 233 | description = "", 234 | returns = "(bool)", 235 | args = "(const char* str, int* version, shaderc_profile* profile)", }, 236 | ["shaderc_include_result"] = { type ="class", 237 | description = "", 238 | childs = 239 | { 240 | ["source_name"] = { type ="value", description = "const char*", valuetype = "string", }, 241 | ["source_name_length"] = { type ="value", description = "size_t", }, 242 | ["content"] = { type ="value", description = "const char*", valuetype = "string", }, 243 | ["content_length"] = { type ="value", description = "size_t", }, 244 | ["user_data"] = { type ="value", description = "void*", }, 245 | } }, 246 | } 247 | 248 | return { 249 | shaderc = { 250 | type = "lib", 251 | description = "SHADERC glsl to spir-v", 252 | childs = api, 253 | }, 254 | shdc = { 255 | type = "lib", 256 | description = "SHADERC glsl to spir-v", 257 | childs = api, 258 | }, 259 | } 260 | -------------------------------------------------------------------------------- /graphicscodepack/interpreters/luajitgfxsandbox.lua: -------------------------------------------------------------------------------- 1 | return { 2 | name = "LuaJIT gfx sandbox", 3 | description = "LuaJIT GFX Sandbox interpreter with debugger", 4 | api = {"baselib","luajit2","glfw3","glewgl", "shaderc", "vulkan1",}, 5 | luaversion = '5.1', 6 | frun = function(self,wfilename,rundebug) 7 | local binpath = ide.config.path.luajitgfxsandbox or os.getenv("LUAJIT_GFX_SANDBOX_PATH") 8 | if not binpath then 9 | ide:Print("Failed to determine binary directory") 10 | return 11 | end 12 | local exe = binpath.."/luajit.cmd" 13 | local filepath = wfilename:GetFullPath() 14 | 15 | do 16 | -- if running on Windows and can't open the file, this may mean that 17 | -- the file path includes unicode characters that need special handling 18 | local fh = io.open(filepath, "r") 19 | if fh then fh:close() end 20 | if ide.osname == 'Windows' and pcall(require, "winapi") 21 | and wfilename:FileExists() and not fh then 22 | winapi.set_encoding(winapi.CP_UTF8) 23 | local shortpath = winapi.short_path(filepath) 24 | if shortpath == filepath then 25 | ide:Print( 26 | ("Can't get short path for a Unicode file name '%s' to open the file.") 27 | :format(filepath)) 28 | ide:Print( 29 | ("You can enable short names by using `fsutil 8dot3name set %s: 0` and recreate the file or directory.") 30 | :format(wfilename:GetVolume())) 31 | end 32 | filepath = shortpath 33 | end 34 | end 35 | 36 | if rundebug then 37 | ide:GetDebugger():SetOptions({runstart = ide.config.debugger.runonstart == true}) 38 | 39 | -- update arg to point to the proper file 40 | rundebug = ('if arg then arg[0] = [[%s]] end '):format(filepath)..rundebug 41 | 42 | local tmpfile = wx.wxFileName() 43 | tmpfile:AssignTempFileName(".") 44 | filepath = tmpfile:GetFullPath() 45 | local f = io.open(filepath, "w") 46 | if not f then 47 | ide:Print("Can't open temporary file '"..filepath.."' for writing.") 48 | return 49 | end 50 | f:write(rundebug) 51 | f:close() 52 | end 53 | local params = self:GetCommandLineArg("lua") 54 | local code = ([["%s"]]):format(filepath) 55 | local cmd = '"'..exe..'" '..code..(params and " "..params or "") 56 | 57 | -- CommandLineRun(cmd,wdir,tooutput,nohide,stringcallback,uid,endcallback) 58 | local pid = CommandLineRun(cmd,self:fworkdir(wfilename),true,false,nil,nil, 59 | function() if rundebug then wx.wxRemoveFile(filepath) end end) 60 | 61 | return pid 62 | end, 63 | hasdebugger = true, 64 | scratchextloop = false, 65 | unhideanywindow = true, 66 | takeparameters = true, 67 | } 68 | 69 | -------------------------------------------------------------------------------- /graphicscodepack/spec/cbase.lua: -------------------------------------------------------------------------------- 1 | function CMarkSymbols(code, pos, vars) 2 | local idtmpl = "[A-Za-z_][A-Za-z0-9_ ]*" 3 | local funcdeftmpl = "("..idtmpl.."%s+%*?"..idtmpl..")%s*%(([A-Za-z0-9_ %*,]*)%)%s*%{" 4 | local isfndef = function(str, pos) 5 | local s,e,pref,cap 6 | while true do 7 | s,e,pref,cap,parms = str:find("^(%s*)"..funcdeftmpl, pos) 8 | if (not s) then 9 | s,e,pref,cap,parms = str:find("([\r\n]%s*)"..funcdeftmpl, pos) 10 | end 11 | -- skip strange parameters and things of `else if ()` variety 12 | if parms and #parms > 0 and not parms:find(idtmpl) 13 | or cap and cap:find("%sif%s*$") then 14 | pos = s+#pref+#cap+#parms 15 | else 16 | break 17 | end 18 | end 19 | if s then return s+#pref,s+#pref+#cap-1,cap end 20 | end 21 | 22 | return coroutine.wrap(function() 23 | -- return a dummy token to produce faster result for quick typing 24 | coroutine.yield("String", "dummy", 1, {}) 25 | while true do 26 | local fpos, lpos, name = isfndef(code, pos) 27 | if not fpos then return end 28 | coroutine.yield("Function", name, fpos, {}, 1) 29 | pos = fpos + #name 30 | end 31 | end) 32 | end 33 | 34 | return nil -- not a real spec 35 | -------------------------------------------------------------------------------- /graphicscodepack/spec/glsl.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local funccall = "([A-Za-z_][A-Za-z0-9_]*)%s*" 5 | 6 | if not CMarkSymbols then dofile "spec/cbase.lua" end 7 | return { 8 | exts = {"glsl","vert","frag","geom","cont","eval", "glslv", "glslf"}, 9 | lexer = wxstc.wxSTC_LEX_CPP, 10 | apitype = "glsl", 11 | sep = ".", 12 | linecomment = "//", 13 | 14 | isfncall = function(str) 15 | return string.find(str, funccall .. "%(") 16 | end, 17 | 18 | marksymbols = CMarkSymbols, 19 | 20 | lexerstyleconvert = { 21 | text = {wxstc.wxSTC_C_IDENTIFIER,}, 22 | 23 | lexerdef = {wxstc.wxSTC_C_DEFAULT,}, 24 | comment = {wxstc.wxSTC_C_COMMENT, 25 | wxstc.wxSTC_C_COMMENTLINE, 26 | wxstc.wxSTC_C_COMMENTDOC,}, 27 | stringtxt = {wxstc.wxSTC_C_STRING, 28 | wxstc.wxSTC_C_CHARACTER, 29 | wxstc.wxSTC_C_VERBATIM,}, 30 | stringeol = {wxstc.wxSTC_C_STRINGEOL,}, 31 | preprocessor= {wxstc.wxSTC_C_PREPROCESSOR,}, 32 | operator = {wxstc.wxSTC_C_OPERATOR,}, 33 | number = {wxstc.wxSTC_C_NUMBER,}, 34 | 35 | keywords0 = {wxstc.wxSTC_C_WORD,}, 36 | keywords1 = {wxstc.wxSTC_C_WORD2,}, 37 | }, 38 | 39 | keywords = 40 | { 41 | [[ 42 | int uint half float bool double 43 | vec2 vec3 vec4 dvec2 dvec3 dvec4 44 | ivec2 ivec3 ivec4 uvec2 uvec3 uvec4 bvec2 bvec3 bvec4 45 | mat2 mat3 mat4 mat2x2 mat3x3 mat4x4 mat2x3 mat3x2 mat4x2 mat2x4 mat4x3 mat3x4 46 | dmat2 dmat3 dmat4 dmat2x2 dmat3x3 dmat4x4 dmat2x3 dmat3x2 dmat4x2 dmat2x4 dmat4x3 dmat3x4 47 | struct void 48 | subroutine 49 | 50 | float16_t f16vec2 f16vec3 f16vec4 51 | float32_t f32vec2 f32vec3 f32vec4 52 | float64_t f64vec2 f64vec3 f64vec4 53 | int8_t i8vec2 i8vec3 i8vec4 54 | int8_t i8vec2 i8vec3 i8vec4 55 | int16_t i16vec2 i16vec3 i16vec4 56 | int32_t i32vec2 i32vec3 i32vec4 57 | int64_t i64vec2 i64vec3 i64vec4 58 | uint8_t u8vec2 u8vec3 u8vec4 59 | uint16_t u16vec2 u16vec3 u16vec4 60 | uint32_t u32vec2 u32vec3 u32vec4 61 | uint64_t u64vec2 u64vec3 u64vec4 62 | 63 | main 64 | attribute const uniform varying buffer shared 65 | coherent volatile restrict readonly writeonly 66 | atomic_uint 67 | layout 68 | centroid flat smooth noperspective 69 | patch sample 70 | break continue do for while switch case default 71 | if else 72 | subroutine 73 | in out inout 74 | float double int void bool true false 75 | invariant precise 76 | discard return 77 | lowp mediump highp precision 78 | buffer_reference buffer_reference_align 79 | 80 | location vertices line_strip triangle_strip max_vertices stream index 81 | triangles quads equal_spacing isolines fractional_even_spacing lines points 82 | fractional_odd_spacing cw ccw point_mode lines_adjacency triangles_adjacency 83 | invocations offset align xfb_offset xfb_buffer 84 | origin_upper_left pixel_center_integer depth_greater depth_greater depth_greater depth_unchanged 85 | shared packed std140 std430 row_major column_major 86 | local_size_x local_size_y local_size_z 87 | early_fragment_tests 88 | 89 | post_depth_coverage 90 | bindless_sampler bound_sampler bindless_image bound_image 91 | binding set input_attachment_index 92 | pixel_interlock_ordered pixel_interlock_unordered sample_interlock_ordered sample_interlock_unordered 93 | passthrough push_constant secondary_view_offset viewport_relative override_coverage 94 | commandBindableNV 95 | subgroupuniformEXT 96 | scalar 97 | constant_id 98 | 99 | size1x8 size1x16 size1x32 size2x32 size4x32 rgba32f rgba16f rg32f rg16f r32f r16f rgba8 rgba16 r11f_g11f_b10f rgb10_a2ui 100 | rgb10_a2i rg16 rg8 r16 r8 rgba32i rgba16i rgba8i rg32i rg16i rg8i r32i r16i r8i rgba32ui rgba16ui rgba8ui rg32ui rg16ui rg8ui 101 | r32ui r16ui r8ui rgba16_snorm rgba8_snorm rg16_snorm rg8_snorm r16_snorm r8_snorm 102 | r64i r64ui 103 | 104 | subpassInput isubpassInput usubpassInput 105 | subpassInputMS isubpassInputMS usubpassInputMS 106 | 107 | sampler 108 | samplerShadow 109 | 110 | sampler1DShadow sampler2DShadow sampler2DRectShadow samplerCubeShadow sampler1DArrayShadow sampler2DArrayShadow samplerCubeArrayShadow 111 | 112 | image1D image2D image3D image2DRect imageCube imageBuffer image1DArray image2DArray imageCubeArray image2DMS image2DMSArray 113 | uimage1D uimage2D uimage3D uimage2DRect uimageCube uimageBuffer uimage1DArray uimage2DArray uimageCubeArray uimage2DMS uimage2DMSArray 114 | iimage1D iimage2D iimage3D iimage2DRect iimageCube iimageBuffer iimage1DArray iimage2DArray iimageCubeArray iimage2DMS iimage2DMSArray 115 | 116 | texture1D texture2D texture3D textureCube texture2DRect texture1DArray texture2DArray textureBuffer texture2DMS texture2DMSArray textureCubeArray 117 | utexture1D utexture2D utexture3D utextureCube utexture2DRect utexture1DArray utexture2DArray utextureBuffer utexture2DMS utexture2DMSArray utextureCubeArray 118 | itexture1D itexture2D itexture3D itextureCube itexture2DRect itexture1DArray itexture2DArray itextureBuffer itexture2DMS itexture2DMSArray itextureCubeArray 119 | 120 | usampler1D usampler2D usampler3D usampler2DRect usamplerBuffer usamplerCube usampler1DArray usampler2DArray usamplerCubeArray usampler2DMS usampler2DMSArray 121 | isampler1D isampler2D isampler3D isampler2DRect isamplerBuffer isamplerCube isampler1DArray isampler2DArray isamplerCubeArray isampler2DMS isampler2DMSArray 122 | sampler1D sampler2D sampler3D sampler2DRect samplerCube samplerBuffer sampler1DArray sampler2DArray samplerCubeArray sampler2DMS sampler2DMSArray 123 | 124 | i64image1D u64image1D i64image1DArray u64image1DArray i64image2D u64image2D i64image2DArray u64image2DArray i64image2DRect u64image2DRect 125 | i64image2DMS u64image2DMS i64image2DMSArray u64image2DMSArray i64image3D u64image3D i64imageCube u64imageCube i64imageCubeArray u64imageCubeArray 126 | i64imageBuffer u64imageBuffer 127 | 128 | gl_Position gl_FragCoord 129 | gl_VertexID gl_InstanceID gl_PointSize gl_ClipDistance 130 | gl_TexCoord gl_FogFragCoord gl_ClipVertex gl_in gl_out gl_PerVertex 131 | gl_PatchVerticesIn 132 | gl_PrimitiveID gl_InvocationID gl_TessLevelOuter gl_TessLevelInner gl_TessCoord 133 | gl_InvocationID gl_PrimitiveIDIn gl_Layer gl_ViewportIndex gl_FrontFacing 134 | gl_PointCoord gl_SampleID gl_SamplePosition gl_FragColor 135 | gl_FragData gl_FragDepth gl_SampleMask 136 | gl_NumWorkGroups gl_WorkGroupSize gl_WorkGroupID gl_LocalInvocationID gl_GlobalInvocationID gl_LocalInvocationIndex 137 | gl_HelperInvocation gl_CullDistance 138 | gl_VertexIndex gl_InstanceIndex 139 | 140 | gl_BaseVertexARB gl_BaseInstanceARB gl_DrawIDARB 141 | gl_DrawID 142 | 143 | gl_SubGroupInvocationARB gl_SubGroupEqMaskARB gl_SubGroupGeMaskARB gl_SubGroupGtMaskARB gl_SubGroupLeMaskARB gl_SubGroupLtMaskARB 144 | gl_SubGroupSizeARB 145 | 146 | gl_ViewportMask 147 | gl_SecondaryPositionNV gl_SecondaryViewportMaskNV 148 | gl_ThreadInWarpNV gl_ThreadEqMaskNV gl_ThreadGeMaskNV gl_ThreadGtMaskNV gl_ThreadLeMaskNV gl_ThreadLtMaskNV gl_WarpIDNV gl_SMIDNV gl_HelperThreadNV 149 | gl_WarpSizeNV gl_WarpsPerSMNV gl_WarpsPerSMNV 150 | 151 | gl_NumSubgroups gl_SubgroupID gl_SubgroupSize gl_SubgroupInvocationID 152 | gl_SubgroupEqMask gl_SubgroupGeMask gl_SubgroupGtMask gl_SubgroupLeMask gl_SubgroupLtMask 153 | 154 | gl_TaskCountNV gl_PrimitiveCountNV gl_PrimitiveIndicesNV 155 | gl_ClipDistancePerViewNV gl_PositionPerViewNV gl_CullDistancePerViewNV gl_LayerPerViewN gl_ViewportMaskPerViewNV 156 | gl_MaxMeshViewCountNV 157 | gl_MeshViewCountNV gl_MeshViewIndicesNV gl_MeshPerVertexNV gl_MeshPerPrimitiveNV 158 | gl_MeshVerticesNV gl_MeshPrimitivesNV 159 | perprimitiveNV perviewNV taskNV 160 | max_primitives 161 | 162 | accelerationStructureNV 163 | rayPayloadNV rayPayloadInNV hitAttributeNV callableDataNV callableDataInNV 164 | shaderRecordNV 165 | gl_LaunchIDNV gl_LaunchSizeNV gl_InstanceCustomIndexNV 166 | gl_WorldRayOriginNV gl_WorldRayDirectionNV gl_ObjectRayOriginNV gl_ObjectRayDirectionNV 167 | gl_RayTminNV gl_RayTmaxNV gl_IncomingRayFlagsNV gl_HitTNV gl_HitKindNV 168 | gl_ObjectToWorldNV gl_WorldToObjectNV 169 | gl_RayFlagsNoneNV 170 | gl_RayFlagsOpaqueNV 171 | gl_RayFlagsNoOpaqueNV 172 | gl_RayFlagsTerminateOnFirstHitNV 173 | gl_RayFlagsSkipClosestHitShaderNV 174 | gl_RayFlagsCullBackFacingTrianglesNV 175 | gl_RayFlagsCullFrontFacingTrianglesNV 176 | gl_RayFlagsCullOpaqueNV 177 | gl_RayFlagsCullNoOpaqueNV 178 | 179 | accelerationStructureEXT rayQueryEXT accelerationStructureEXT 180 | rayPayloadEXT rayPayloadInEXT hitAttributeEXT callableDataEXT callableDataInEXT 181 | shaderRecordEXT 182 | gl_LaunchIDEXT gl_LaunchSizeEXT gl_InstanceCustomIndexEXT gl_GeometryIndexEXT 183 | gl_WorldRayOriginEXT gl_WorldRayDirectionEXT gl_ObjectRayOriginEXT gl_ObjectRayDirectionEXT 184 | gl_RayTminEXT gl_RayTmaxEXT gl_IncomingRayFlagsEXT gl_HitTEXT gl_HitKindEXT 185 | gl_ObjectToWorldEXT gl_WorldToObjectEXT gl_WorldToObject3x4EXT gl_ObjectToWorld3x4EXT 186 | gl_RayFlagsNoneEXT 187 | gl_RayFlagsOpaqueEXT 188 | gl_RayFlagsNoOpaqueEXT 189 | gl_RayFlagsTerminateOnFirstHitEXT 190 | gl_RayFlagsSkipClosestHitShaderEXT 191 | gl_RayFlagsCullBackFacingTrianglesEXT 192 | gl_RayFlagsCullFrontFacingTrianglesEXT 193 | gl_RayFlagsCullOpaqueEXT 194 | gl_RayFlagsCullNoOpaqueEXT 195 | gl_HitKindFrontFacingTriangleEXT gl_HitKindBackFacingTriangleEXT 196 | gl_RayQueryCommittedIntersectionNoneEXT 197 | gl_RayQueryCommittedIntersectionTriangleEXT 198 | gl_RayQueryCommittedIntersectionGeneratedEXT 199 | gl_RayQueryCandidateIntersectionTriangleEXT 200 | gl_RayQueryCandidateIntersectionAABBEXT 201 | shadercallcoherent 202 | 203 | gl_FragmentSizeNV gl_InvocationsPerPixelNV 204 | shading_rate_interlock_ordered shading_rate_interlock_unordered 205 | 206 | pervertexNV 207 | gl_BaryCoordNV 208 | gl_BaryCoordNoPerspNV 209 | 210 | derivative_group_quadsNV derivative_group_linearNV 211 | 212 | nonuniformEXT 213 | 214 | gl_FragSizeEXT 215 | gl_FragInvocationCountEXT 216 | 217 | gl_ScopeDevice 218 | gl_ScopeWorkgroup 219 | gl_ScopeSubgroup 220 | gl_ScopeInvocation 221 | gl_ScopeQueueFamily 222 | 223 | gl_SemanticsRelaxed 224 | gl_SemanticsAcquire 225 | gl_SemanticsRelease 226 | gl_SemanticsAcquireRelease 227 | gl_SemanticsMakeAvailable 228 | gl_SemanticsMakeVisible 229 | 230 | gl_StorageSemanticsNone 231 | gl_StorageSemanticsBuffer 232 | gl_StorageSemanticsShared 233 | gl_StorageSemanticsImage 234 | gl_StorageSemanticsOutput 235 | 236 | common partition active asm class union enum typedef template this resource goto 237 | noinline inline public static private extern external interface long short half fixed unsigned superp 238 | input output filter sizeof cast namespace using 239 | ]], 240 | 241 | [[ 242 | radians degrees sin cos tan asin acos atan sinh cosh tanh asinh acosh atanh 243 | pow exp log exp2 log2 sqrt inversesqrt abs sign floor trunc round 244 | roundEven ceil fract mod modf min max mix step isnan isinf clamp smoothstep 245 | fma frexp ldexp 246 | 247 | floatBitsToInt floatBitsToUint intBitsToFloat uintBitsToFloat 248 | doubleBitsToInt64 doubleBitsToUint64 int64BitsToDouble uint64BitsToDouble 249 | 250 | packUnorm2x16 packUnorm4x8 packSnorm4x8 251 | unpackUnorm2x16 unpackUnorm4x8 unpackSnorm4x8 252 | packDouble2x32 unpackDouble2x32 253 | packHalf2x16 unpackHalf2x16 254 | packInt2x32 packUint2x32 unpackInt2x32 unpackUint2x32 255 | packFloat2x16 unpackFloat2x16 256 | 257 | length distance dot cross normalize ftransform faceforward 258 | reflect refract 259 | matrixCompMult outerProduct transpose determinant inverse 260 | lessThan lessThanEqual greaterThan greaterThanEqual equal 261 | notEqual any all not 262 | uaddCarry usubBorrow umulExtended imulExtended 263 | bitfeldExtract bitfieldInsert bitfeldReverse bitCount 264 | findLSB findMSB 265 | dFdx dFdy fwidth dFdxFine dFdyFine fwidthFine dFdxCoarse dFdyCoarse fwidthCoarse 266 | interpolateAtCentroid interpolateAtSample interpolateAtOffset 267 | noise1 noise2 noise3 noise4 268 | 269 | EmitStreamVertex EndStreamPrimitive EmitVertex EndPrimitive 270 | 271 | textureSize textureSamples textureQueryLod textureQueryLevels 272 | texture textureOffset textureProj 273 | textureLod textureProjOffset textureLodOffset 274 | texelFetchOffset texelFetch textureProjLod textureProjLodOffset 275 | textureGrad textureGradOffset textureProjGrad textureProjGradOffset 276 | textureGather textureGatherOffset textureGatherOffsets 277 | 278 | imageLoad imageStore 279 | imageAtomicAdd imageAtomicMin imageAtomicMax 280 | imageAtomicIncWrap imageAtomicDecWrap imageAtomicAnd 281 | imageAtomicOr imageAtomixXor imageAtomicExchange 282 | imageAtomicCompSwap imageSize imageSamples 283 | 284 | subpassLoad 285 | 286 | barrier 287 | memoryBarrier groupMemoryBarrier memoryBarrierAtomicCounter memoryBarrierShared memoryBarrierBuffer memoryBarrierImage 288 | 289 | atomicCounterIncrement atomicCounterDecrement atomicCounter 290 | atomicMin atomicMax atomicAdd atomicAnd atomicOr atomicXor atomicExchange atomicCompSwap 291 | 292 | anyInvocationARB allInvocationsARB allInvocationsEqualARB 293 | 294 | packPtr unpackPtr 295 | anyThreadNV allThreadsNV allThreadsEqualNV 296 | activeThreadsNV ballotThreadNV 297 | quadSwizzle0NV quadSwizzle1NV quadSwizzle2NV quadSwizzle3NV 298 | quadSwizzleXNV quadSwizzleYNV 299 | shuffleDownNV shuffleUpNV shuffleXorNV shuffleNV 300 | 301 | ballotARB readInvocationARB readFirstInvocationARB 302 | clock2x32ARB clockARB 303 | 304 | sparseTexelsResidentARB 305 | sparseTextureARB sparseTextureLodARB sparseTextureOffsetARB sparseTexelFetchARB 306 | sparseTexelFetchOffsetARB sparseTextureLodOffsetARB sparseTextureGradARB 307 | sparseTextureGradOffsetARB sparseTextureGatherARB sparseTextureGatherOffsetARB sparseTextureGatherOffsetsARB 308 | sparseImageLoadARB 309 | sparseTextureClampARB sparseTextureOffsetClampARB sparseTextureGradClampARB sparseTextureGradOffsetClampARB 310 | textureClampARB textureOffsetClampARB textureGradClampARB textureGradOffsetClampARB 311 | 312 | subgroupBarrier subgroupMemoryBarrier subgroupMemoryBarrierBuffer subgroupMemoryBarrierShared subgroupMemoryBarrierImage 313 | subgroupElect subgroupAll subgroupAny subgroupAllEqual 314 | subgroupBroadcast subgroupBroadcastFirst subgroupBallot subgroupInverseBallot 315 | subgroupBallotBitExtract subgroupBallotBitCount subgroupBallotInclusiveBitCount subgroupBallotExclusiveBitCount 316 | subgroupBallotFindLSB subgroupBallotFindMSB 317 | subgroupShuffle subgroupShuffleXor subgroupShuffleUp subgroupShuffleDown 318 | subgroupAdd subgroupMul subgroupMin subgroupMax subgroupAnd subgroupOr subgroupXor 319 | subgroupInclusiveAdd subgroupInclusiveMul subgroupInclusiveMin subgroupInclusiveMax subgroupInclusiveAnd subgroupInclusiveOr subgroupInclusiveXor 320 | subgroupExclusiveAdd subgroupExclusiveMul subgroupExclusiveMin subgroupExclusiveMax subgroupExclusiveAnd subgroupExclusiveOr subgroupExclusiveXor 321 | subgroupClusteredAdd subgroupClusteredMul subgroupClusteredMin subgroupClusteredMax subgroupClusteredAnd subgroupClusteredOr subgroupClusteredXor 322 | subgroupQuadBroadcast subgroupQuadSwapHorizontal subgroupQuadSwapVertical subgroupQuadSwapDiagonal 323 | 324 | writePackedPrimitiveIndices4x8NV 325 | 326 | traceNV reportIntersectionNV ignoreIntersectionNV terminateRayNV executeCallableNV 327 | traceRayEXT reportIntersectionEXT ignoreIntersectioneXT terminateRayEXT executeCallableEXT 328 | 329 | rayQueryInitializeEXT rayQueryProceedEXT rayQueryTerminateEXT rayQueryGenerateIntersectionEXT rayQueryConfirmIntersectionEXT 330 | rayQueryGetIntersectionTypeEXT rayQueryGetRayTMinEXT rayQueryGetRayFlagsEXT rayQueryGetRayFlagsEXT rayQueryGetRayFlagsEXT rayQueryGetIntersectionTEXT 331 | rayQueryGetIntersectionInstanceCustomIndexEXT rayQueryGetIntersectionInstanceIdEXT rayQueryGetIntersectionInstanceShaderBindingTableRecordOffsetEXT 332 | rayQueryGetIntersectionGeometryIndexEXT rayQueryGetIntersectionPrimitiveIndexEXT rayQueryGetIntersectionBarycentricsEXT 333 | rayQueryGetIntersectionFrontFaceEXT rayQueryGetIntersectionCandidateAABBOpaqueEXT rayQueryGetIntersectionObjectRayDirectionEXT 334 | rayQueryGetIntersectionObjectRayOriginEXT rayQueryGetIntersectionObjectToWorldEXT rayQueryGetIntersectionWorldToObjectEXT 335 | 336 | textureFootprintNV 337 | textureFootprintClampNV 338 | textureFootprintLodNV 339 | textureFootprintGradNV 340 | textureFootprintGradClampNV 341 | 342 | subgroupPartitionNV 343 | subgroupPartitionedAddNV subgroupPartitionedMulNV subgroupPartitionedMinNV subgroupPartitionedMaxNV 344 | subgroupPartitionedAndNV subgroupPartitionedOrNV subgroupPartitionedXorNV 345 | subgroupPartitionedInclusiveAddNV subgroupPartitionedInclusiveMulNV subgroupPartitionedInclusiveMinNV subgroupPartitionedInclusiveMaxNV 346 | subgroupPartitionedInclusiveAndNV subgroupPartitionedInclusiveOrNV subgroupPartitionedInclusiveXorNV 347 | subgroupPartitionedExclusiveAddNV subgroupPartitionedExclusiveMulNV subgroupPartitionedExclusiveMinNV subgroupPartitionedExclusiveMaxNV 348 | subgroupPartitionedExclusiveAndNV subgroupPartitionedExclusiveOrNV subgroupPartitionedExclusiveXorNV 349 | ]], 350 | 351 | }, 352 | } 353 | -------------------------------------------------------------------------------- /graphicscodepack/spec/hlsl.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local funccall = "([A-Za-z_][A-Za-z0-9_]*)%s*" 5 | 6 | if not CMarkSymbols then dofile "spec/cbase.lua" end 7 | return { 8 | exts = {"hlsl","fx","fxh","usf",}, 9 | lexer = wxstc.wxSTC_LEX_CPP, 10 | apitype = "hlsl", 11 | sep = ".", 12 | linecomment = "//", 13 | 14 | isfncall = function(str) 15 | return string.find(str, funccall .. "%(") 16 | end, 17 | 18 | marksymbols = CMarkSymbols, 19 | 20 | lexerstyleconvert = { 21 | text = {wxstc.wxSTC_C_IDENTIFIER,}, 22 | 23 | lexerdef = {wxstc.wxSTC_C_DEFAULT,}, 24 | comment = {wxstc.wxSTC_C_COMMENT, 25 | wxstc.wxSTC_C_COMMENTLINE, 26 | wxstc.wxSTC_C_COMMENTDOC,}, 27 | stringtxt = {wxstc.wxSTC_C_STRING, 28 | wxstc.wxSTC_C_CHARACTER, 29 | wxstc.wxSTC_C_VERBATIM,}, 30 | stringeol = {wxstc.wxSTC_C_STRINGEOL,}, 31 | preprocessor= {wxstc.wxSTC_C_PREPROCESSOR,}, 32 | operator = {wxstc.wxSTC_C_OPERATOR,}, 33 | number = {wxstc.wxSTC_C_NUMBER,}, 34 | 35 | keywords0 = {wxstc.wxSTC_C_WORD,}, 36 | keywords1 = {wxstc.wxSTC_C_WORD2,}, 37 | }, 38 | 39 | keywords = { 40 | [[break continue if else switch return for while do typedef namespace true false compile 41 | const void struct static extern register volatile inline target nointerpolation shared uniform row_major column_major snorm unorm 42 | bool bool1 bool2 bool3 bool4 int int1 int2 int3 int4 uint uint1 uint2 uint3 uint4 half half1 half2 half3 half4 float float1 float2 float3 float4 double double1 double2 double3 double4 43 | matrix bool1x1 bool1x2 bool1x3 bool1x4 bool2x1 bool2x2 bool2x3 bool2x4 bool3x1 bool3x2 bool3x3 bool3x4 bool4x1 bool4x2 bool4x3 bool4x4 44 | int1x1 int1x2 int1x3 int1x4 int2x1 int2x2 int2x3 int2x4 int3x1 int3x2 int3x3 int3x4 int4x1 int4x2 int4x3 int4x4 uint1x1 uint1x2 uint1x3 uint1x4 45 | uint2x1 uint2x2 uint2x3 uint2x4 uint3x1 uint3x2 uint3x3 uint3x4 uint4x1 uint4x2 uint4x3 uint4x4 half1x1 half1x2 half1x3 half1x4 half2x1 half2x2 46 | half2x3 half2x4 half3x1 half3x2 half3x3 half3x4 half4x1 half4x2 half4x3 half4x4 float1x1 float1x2 float1x3 float1x4 float2x1 float2x2 float2x3 47 | float2x4 float3x1 float3x2 float3x3 float3x4 float4x1 float4x2 float4x3 float4x4 double1x1 double1x2 double1x3 double1x4 double2x1 double2x2 48 | double2x3 double2x4 double3x1 double3x2 double3x3 double3x4 double4x1 double4x2 double4x3 double4x4 cbuffer tbuffer groupshared SamplerState SamplerComparisonState 49 | in out inout vector matrix interface class point triangle line lineadj triangleadj unsigned 50 | pass technique technique10 technique11 51 | 52 | Texture Texture1D Texture1DArray Texture2D Texture2DArray Texture2DMS Texture2DMSArray Texture3D TextureCube RWTexture1D RWTexture1DArray RWTexture2D RWTexture2DArray RWTexture3D 53 | Buffer StructuredBuffer AppendStructuredBuffer ConsumeStructuredBuffer RWBuffer RWStructuredBuffer ByteAddressBuffer RWByteAddressBuffer PointStream TriangleStream LineStream InputPatch OutputPatch 54 | ]], 55 | 56 | [[unroll loop flatten branch allow_uav_condition earlydepthstencil domain instance maxtessfactor outputcontrolpoints outputtopology partitioning patchconstantfunc numthreads maxvertexcount precise 57 | 58 | SV_DispatchThreadID SV_DomainLocation SV_GroupID SV_GroupIndex SV_GroupThreadID SV_GSInstanceID SV_InsideTessFactor SV_OutputControlPointID SV_Coverage SV_Depth SV_Position SV_IsFrontFace SV_RenderTargetArrayIndex SV_SampleIndex SV_ViewportArrayIndex SV_InstanceID SV_PrimitiveID SV_VertexID 59 | SV_ClipDistance SV_CullDistance SV_Target 60 | 61 | abs acos all AllMemoryBarrier AllMemoryBarrierWithGroupSync any asdouble asfloat asin asint asuint atan atan2 ceil clamp clip cos cosh countbits cross ddx ddx_coarse ddx_fine ddy ddy_coards ddy_fine degrees determinant DeviceMemoryBarrier DeviceMemoryBarrierWithGroupSync distance dot dst EvaluateAttributeAtCentroid EvaluateAttributeAtSample EvaluateAttributeSnapped exp exp2 f16tof32 f32tof16 faceforward firstbithigh firstbitlow floor fmod frac frexp fwidth GetRenderTargetSampleCount GetRenderTargetSamplePosition GroupMemoryBarrier GroupMemoryBarrierWithGroupSync InterlockedAdd InterlockedAnd InterlockedCompareExchange InterlockedExchange InterlockedMax InterlockedMin IntterlockedOr InterlockedXor isfinite isinf isnan ldexp length lerp lit log log10 log2 mad max min modf mul normalize pow Process2DQuadTessFactorsAvg Process2DQuadTessFactorsMax Process2DQuadTessFactorsMin ProcessIsolineTessFactors ProcessQuadTessFactorsAvg ProcessQuadTessFactorsMax ProcessQuadTessFactorsMin ProcessTriTessFactorsAvg ProcessTriTessFactorsMax ProcessTriTessFactorsMin radians rcp reflect refract reversebits round rsqrt saturate sign sin sincos sinh smoothstep sqrt step tan tanh transpose trunc 62 | Append RestartStrip CalculateLevelOfDetail CalculateLevelOfDetailUnclamped GetDimensions GetSamplePosition Load Sample SampleBias SampleCmp SampleCmpLevelZero SampleGrad SampleLevel Load2 Load3 Load4 Consume Store Store2 Store3 Store4 DecrementCounter IncrementCounter mips Gather GatherRed GatherGreen GatherBlue GatherAlpha GatherCmp GatherCmpRed GatherCmpGreen GatherCmpBlue GatherCmpAlpha 63 | 64 | x y z w 65 | xxxx xxxy xxxz xxxw xxyx xxyy xxyz xxyw xxzx xxzy 66 | xxzz xxzw xxwx xxwy xxwz xxww xyxx xyxy xyxz xyxw 67 | xyyx xyyy xyyz xyyw xyzx xyzy xyzz xyzw xywx xywy 68 | xywz xyww xzxx xzxy xzxz xzxw xzyx xzyy xzyz xzyw 69 | xzzx xzzy xzzz xzzw xzwx xzwy xzwz xzww xwxx xwxy 70 | xwxz xwxw xwyx xwyy xwyz xwyw xwzx xwzy xwzz xwzw 71 | xwwx xwwy xwwz xwww yxxx yxxy yxxz yxxw yxyx yxyy 72 | yxyz yxyw yxzx yxzy yxzz yxzw yxwx yxwy yxwz yxww 73 | yyxx yyxy yyxz yyxw yyyx yyyy yyyz yyyw yyzx yyzy 74 | yyzz yyzw yywx yywy yywz yyww yzxx yzxy yzxz yzxw 75 | yzyx yzyy yzyz yzyw yzzx yzzy yzzz yzzw yzwx yzwy 76 | yzwz yzww ywxx ywxy ywxz ywxw ywyx ywyy ywyz ywyw 77 | ywzx ywzy ywzz ywzw ywwx ywwy ywwz ywww zxxx zxxy 78 | zxxz zxxw zxyx zxyy zxyz zxyw zxzx zxzy zxzz zxzw 79 | zxwx zxwy zxwz zxww zyxx zyxy zyxz zyxw zyyx zyyy 80 | zyyz zyyw zyzx zyzy zyzz zyzw zywx zywy zywz zyww 81 | zzxx zzxy zzxz zzxw zzyx zzyy zzyz zzyw zzzx zzzy 82 | zzzz zzzw zzwx zzwy zzwz zzww zwxx zwxy zwxz zwxw 83 | zwyx zwyy zwyz zwyw zwzx zwzy zwzz zwzw zwwx zwwy 84 | zwwz zwww wxxx wxxy wxxz wxxw wxyx wxyy wxyz wxyw 85 | wxzx wxzy wxzz wxzw wxwx wxwy wxwz wxww wyxx wyxy 86 | wyxz wyxw wyyx wyyy wyyz wyyw wyzx wyzy wyzz wyzw 87 | wywx wywy wywz wyww wzxx wzxy wzxz wzxw wzyx wzyy 88 | wzyz wzyw wzzx wzzy wzzz wzzw wzwx wzwy wzwz wzww 89 | wwxx wwxy wwxz wwxw wwyx wwyy wwyz wwyw wwzx wwzy 90 | wwzz wwzw wwwx wwwy wwwz wwww xy xz yz xyz 91 | xw yw xyw zw xzw yzw xyzw 92 | ]], 93 | 94 | }, 95 | } 96 | -------------------------------------------------------------------------------- /graphicscodepack/spec/oglgpuprog.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | return { 5 | -- unfortunately no good lexer 6 | -- ASM comments start with ; 7 | -- and TCL doesnt allow coloring 8 | -- behind keywords 9 | 10 | exts = {"glp","vp","fp"}, 11 | lexer = wxstc.wxSTC_LEX_TCL, 12 | --apitype = "cg", 13 | linecomment = "#", 14 | lexerstyleconvert = { 15 | text = {4,5,7,8,9,10,11, 16 | }, 17 | 18 | lexerdef = {0,}, 19 | comment = {1,2,20,21, 20 | }, 21 | --stringtxt = {wxstc.wxSTC_SQL_STRING, 22 | -- wxstc.wxSTC_SQL_CHARACTER, 23 | -- }, 24 | --stringeol = {wxstc.wxSTC_SQL_STRINGEOL,}, 25 | --preprocessor= {,}, 26 | operator = {6,}, 27 | number = {3, 28 | }, 29 | 30 | keywords0 = {12,}, 31 | keywords1 = {13,}, 32 | keywords2 = {14,}, 33 | keywords3 = {15,}, 34 | }, 35 | 36 | keywords = { 37 | [[EMIT ENDPRIM 38 | ABS ADD AND BRK CAL CEIL CMP CONT COS DIV DP2 DP2A DP3 DP4 DPH DST ELSE 39 | ENDIF ENDREP EX2 FLR FRC I2F IF KIL LG2 LIT LRP MAD MAX MIN MOD MOV MUL 40 | NOT NRM OR PK2H PK2US PK4B PK4UB POW RCC RCP REP RET RFL ROUND RSQ SAD 41 | SCS SEQ SFL SGE SGT SHL SHR SIN SLE SLT SNE SSG STR SUB SWZ TEX TRUNC LOOP 42 | TXB TXD TXF TXL TXP TXQ UP2H UP2US UP4B UP4UB X2D XOR XPD REP.S REP.F REP.U 43 | ENDLOOP SUBROUTINENUM CALI 44 | 45 | ABS_SAT ADD_SAT CEIL_SAT CMP_SAT COS_SAT DIV_SAT DP2_SAT DP2A_SAT DP3_SAT 46 | DP4_SAT DPH_SAT DST_SAT EX2_SAT FLR_SAT FRC_SAT LG2_SAT LIT_SAT LRP_SAT 47 | MAD_SAT MAX_SAT MIN_SAT MOV_SAT MUL_SAT NRM_SAT POW_SAT RCC_SAT RCP_SAT 48 | RFL_SAT ROUND_SAT RSQ_SAT SCS_SAT SEQ_SAT SFL_SAT SGE_SAT SGT_SAT SIN_SAT 49 | SLE_SAT SLT_SAT SNE_SAT SSG_SAT STR_SAT SUB_SAT SWZ_SAT TEX_SAT TRUNC_SAT 50 | TXB_SAT TXD_SAT TXF_SAT TXL_SAT TXP_SAT UP2H_SAT UP2US_SAT UP4B_SAT UP4UB_SAT 51 | X2D_SAT XPD_SAT 52 | 53 | ]], 54 | [[ 55 | 56 | ATTRIB PARAM TEMP ADDRESS OUTPUT ALIAS OPTION TEXTURE 57 | PRIMITIVE_IN PRIMITIVE_OUT VERTICES_OUT POINTS LINES LINES_ADJACENCY 58 | TRIANGLES TRIANGLES_ADJACENCY 59 | LINE_STRIP TRIANGLE_STRIP 60 | EQ GE GT LE LT NE TR FL EQ0 GE0 GT0 LE0 LT0 NE0 TR0 FL0 EQ1 GE1 GT1 LE1 LT1 61 | NE1 TR1 FL1 NAN NAN0 NAN1 LEG LEG0 LEG1 CF CF0 CF1 NCF NCF0 NCF1 OF OF0 OF1 62 | NOF NOF0 NOF1 AB AB0 AB1 BLE BLE0 BLE1 SF SF0 SF1 NSF NSF0 NSF1 63 | END SUBROUTINETYPE SUBROUTINE 64 | 65 | ]], 66 | [[ 67 | 68 | vertex position weight normal color primary secondary fogcoord texcoord 69 | matrixindex attrib 70 | program env local fragment 71 | state material ambient diffuse specular emission shininess front back 72 | light attenuation spot direction half 73 | lightmodel scene lightprod 74 | texgen eye object s t r q 75 | fog params 76 | clip plane 77 | point size attenuation 78 | matrix modelview projection mvp texture palette row transpose inverse invtrans 79 | result pointsize 1D 2D 3D CUBE RECT 80 | 81 | ]], 82 | [[ 83 | 84 | x y z w xxxx xxxy xxxz xxxw 85 | xxyx xxyy xxyz xxyw xxzx xxzy xxzz xxzw xxwx xxwy 86 | xxwz xxww xyxx xyxy xyxz xyxw xyyx xyyy xyyz xyyw 87 | xyzx xyzy xyzz xyzw xywx xywy xywz xyww xzxx xzxy 88 | xzxz xzxw xzyx xzyy xzyz xzyw xzzx xzzy xzzz xzzw 89 | xzwx xzwy xzwz xzww xwxx xwxy xwxz xwxw xwyx xwyy 90 | xwyz xwyw xwzx xwzy xwzz xwzw xwwx xwwy xwwz xwww 91 | yxxx yxxy yxxz yxxw yxyx yxyy yxyz yxyw yxzx yxzy 92 | yxzz yxzw yxwx yxwy yxwz yxww yyxx yyxy yyxz yyxw 93 | yyyx yyyy yyyz yyyw yyzx yyzy yyzz yyzw yywx yywy 94 | yywz yyww yzxx yzxy yzxz yzxw yzyx yzyy yzyz yzyw 95 | yzzx yzzy yzzz yzzw yzwx yzwy yzwz yzww ywxx ywxy 96 | ywxz ywxw ywyx ywyy ywyz ywyw ywzx ywzy ywzz ywzw 97 | ywwx ywwy ywwz ywww zxxx zxxy zxxz zxxw zxyx zxyy 98 | zxyz zxyw zxzx zxzy zxzz zxzw zxwx zxwy zxwz zxww 99 | zyxx zyxy zyxz zyxw zyyx zyyy zyyz zyyw zyzx zyzy 100 | zyzz zyzw zywx zywy zywz zyww zzxx zzxy zzxz zzxw 101 | zzyx zzyy zzyz zzyw zzzx zzzy zzzz zzzw zzwx zzwy 102 | zzwz zzww zwxx zwxy zwxz zwxw zwyx zwyy zwyz zwyw 103 | zwzx zwzy zwzz zwzw zwwx zwwy zwwz zwww wxxx wxxy 104 | wxxz wxxw wxyx wxyy wxyz wxyw wxzx wxzy wxzz wxzw 105 | wxwx wxwy wxwz wxww wyxx wyxy wyxz wyxw wyyx wyyy 106 | wyyz wyyw wyzx wyzy wyzz wyzw wywx wywy wywz wyww 107 | wzxx wzxy wzxz wzxw wzyx wzyy wzyz wzyw wzzx wzzy 108 | wzzz wzzw wzwx wzwy wzwz wzww wwxx wwxy wwxz wwxw 109 | wwyx wwyy wwyz wwyw wwzx wwzy wwzz wwzw wwwx wwwy 110 | wwwz wwww xy xz yz xyz xw yw xyw zw 111 | xzw yzw xyzw ]], 112 | 113 | }, 114 | } 115 | -------------------------------------------------------------------------------- /graphicscodepack/tools/cstringify.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | ----------------------------------------------------------------- 3 | 4 | local function cstringify() 5 | local editor = ide:GetEditor() 6 | if (not editor) then end 7 | local tx = editor:GetText() 8 | local new = "" 9 | for l in tx:gmatch("([^\r\n]*)([\r]?[\n]?)") do 10 | l = l:gsub('\\','\\\\') 11 | l = l:gsub('"','\\"') 12 | new = new..'"'..l..'\\n"'.."\n" 13 | end 14 | -- replace text 15 | editor:SetText(new) 16 | end 17 | 18 | return { 19 | exec = { 20 | name = "stringify to C", 21 | description = "stringifys the content for use in C", 22 | fn = cstringify, 23 | }, 24 | } 25 | -------------------------------------------------------------------------------- /graphicscodepack/tools/dxc.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2020 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local binpath = ide.config.path.dxcbin 5 | local dxprofile 6 | 7 | return binpath and { 8 | fninit = function(frame,menuBar) 9 | dxprofile = ide.config.dxcprofile or "dx_6_5" 10 | 11 | if (wx.wxFileName(binpath):IsRelative()) then 12 | local editorDir = string.gsub(ide.editorFilename:gsub("[^/\\]+$",""),"\\","/") 13 | binpath = editorDir..binpath 14 | end 15 | 16 | local myMenu = wx.wxMenu{ 17 | { ID "dxc.profile.dx_5", "DX SM&5_0", "DirectX sm5_0 profile", wx.wxITEM_CHECK }, 18 | { ID "dxc.profile.dx_6", "DX SM&6_0", "DirectX sm6_0 profile", wx.wxITEM_CHECK }, 19 | { }, 20 | { ID "dxc.compile.input", "Custom &Args", "when set a popup for custom compiler args will be envoked", wx.wxITEM_CHECK }, 21 | { ID "dxc.compile.binary", "&Binary", "when set compiles binary output", wx.wxITEM_CHECK }, 22 | { ID "dxc.compile.backwards", "Backwards Compatibility", "when set compiles in backwards compatibility mode", wx.wxITEM_CHECK }, 23 | { }, 24 | { ID "dxc.compile.any", "Compile from &Entry\tCtrl-3", "Compile Shader (select entry word, matches _?s or ?S suffix for type)" }, 25 | { ID "dxc.compile.last", "Compile &Last\tCtrl-4", "Compile Shader using last domain and entry word" }, 26 | { ID "dxc.compile.vertex", "Compile &Vertex", "Compile Vertex shader (select entry word)" }, 27 | { ID "dxc.compile.pixel", "Compile &Pixel", "Compile Pixel shader (select entry word)" }, 28 | { ID "dxc.compile.geometry", "Compile &Geometry", "Compile Geometry shader (select entry word)" }, 29 | { ID "dxc.compile.domain", "Compile &Domain", "Compile Domain shader (select entry word)" }, 30 | { ID "dxc.compile.hull", "Compile &Hull", "Compile Hull shader (select entry word)" }, 31 | { ID "dxc.compile.compute", "Compile &Compute", "Compile Compute shader (select entry word)" }, 32 | { ID "dxc.compile.effects", "Compile E&ffects", "Compile all effects in shader" }, 33 | { ID "dxc.compile.preprocess", "Preprocess file only", "preprocess the current file" }, 34 | } 35 | menuBar:Append(myMenu, "D&XC") 36 | 37 | local data = {} 38 | data.lastentry = nil 39 | data.lastdomain = nil 40 | data.customarg = false 41 | data.custom = "" 42 | data.backwards = false 43 | data.binary = false 44 | data.preprocess = false 45 | data.profid = ID ("dxc.profile."..dxprofile) 46 | data.types = { 47 | ["vs"] = 1, 48 | ["ps"] = 2, 49 | ["as"] = 3, 50 | ["ms"] = 4, 51 | ["cs"] = 5, 52 | } 53 | data.domains = { 54 | [ID "dxc.compile.vertex"] = 1, 55 | [ID "dxc.compile.pixel"] = 2, 56 | [ID "dxc.compile.amp"] = 3, 57 | [ID "dxc.compile.mesh"] = 4, 58 | [ID "dxc.compile.compute"] = 5, 59 | [ID "dxc.compile.last"] = "last", 60 | } 61 | data.profiles = { 62 | [ID "dxc.profile.dx_6_0"] = {"vs_6_0","ps_6_0","as_6_5","ms_6_5","cs_6_0",ext=".dxc."}, 63 | [ID "dxc.profile.dx_6_5"] = {"vs_6_5","ps_6_5","as_6_5","ms_6_5","cs_6_5",ext=".dxc."}, 64 | } 65 | data.domaindefs = { 66 | " /D _VERTEX_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 67 | " /D _FRAGMENT_SHADER_=1 /D _PIXEL_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 68 | " /D _TASK_SHADER_=1 /D _AMPLIFICATION_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 69 | " /D _COMPUTE_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 70 | } 71 | -- Profile related 72 | menuBar:Check(data.profid, true) 73 | 74 | local function selectProfile (id) 75 | for id,profile in pairs(data.profiles) do 76 | menuBar:Check(id, false) 77 | end 78 | menuBar:Check(id, true) 79 | data.profid = id 80 | end 81 | 82 | local function evSelectProfile (event) 83 | local chose = event:GetId() 84 | selectProfile(chose) 85 | end 86 | 87 | for id,profile in pairs(data.profiles) do 88 | frame:Connect(id,wx.wxEVT_COMMAND_MENU_SELECTED,evSelectProfile) 89 | end 90 | 91 | -- Compile Arg 92 | frame:Connect(ID "dxc.compile.input",wx.wxEVT_COMMAND_MENU_SELECTED, 93 | function(event) 94 | data.customarg = event:IsChecked() 95 | end) 96 | frame:Connect(ID "dxc.compile.backwards",wx.wxEVT_COMMAND_MENU_SELECTED, 97 | function(event) 98 | data.backwards = event:IsChecked() 99 | end) 100 | frame:Connect(ID "dxc.compile.binary",wx.wxEVT_COMMAND_MENU_SELECTED, 101 | function(event) 102 | data.binary = event:IsChecked() 103 | end) 104 | 105 | local function getEditorFileAndCurInfo(nochecksave) 106 | local editor = ide:GetEditor() 107 | if (not (editor and (nochecksave or SaveIfModified(editor)))) then 108 | return 109 | end 110 | 111 | local id = editor:GetId() 112 | local filepath = ide.openDocuments[id].filePath 113 | if not filepath then return end 114 | 115 | local fn = wx.wxFileName(filepath) 116 | fn:Normalize() 117 | 118 | local info = {} 119 | info.pos = editor:GetCurrentPos() 120 | info.line = editor:GetCurrentLine() 121 | info.sel = editor:GetSelectedText() 122 | info.sel = info.sel and info.sel:len() > 0 and info.sel or nil 123 | info.selword = info.sel and info.sel:match("([^a-zA-Z_0-9]+)") or info.sel 124 | 125 | return fn,info 126 | end 127 | -- Compile 128 | local function evCompile(event) 129 | local filename,info = getEditorFileAndCurInfo() 130 | local editor = ide:GetEditor() 131 | local domain = data.domains[event:GetId()] 132 | local entry = info.selword 133 | 134 | if (domain == "last") then 135 | domain = data.lastdomain 136 | entry = data.lastentry 137 | end 138 | 139 | if (not domain and entry) then 140 | for typename,id in pairs(data.types) do 141 | if(entry:match("_"..typename) or entry:match("[a-z0-9_]"..string.upper(typename).."$") or entry:match("^"..string.lower(typename).."[A-Z]")) then 142 | domain = id 143 | end 144 | end 145 | end 146 | 147 | if (not (filename and binpath) or not (domain == 7 or entry )) then 148 | DisplayOutput("Error: Dx Compile: Insufficient parameters (nofile / no selected entry function!\n") 149 | return 150 | end 151 | 152 | data.lastdomain = domain 153 | data.lastentry = entry 154 | 155 | local profile = data.profiles[data.profid] 156 | if (not profile[domain]) then 157 | DisplayOutput("Error: Dx Compile: no profile\n") 158 | return 159 | end 160 | 161 | -- popup for custom input 162 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","Dx",data.custom) or data.custom 163 | local args = data.custom:len() > 0 and data.custom or nil 164 | 165 | local fullname = filename:GetFullPath() 166 | 167 | local outname = fullname.."."..(entry or "").."^" 168 | outname = args and outname..args:gsub("%s*[%-%/]",";-")..";^" or outname 169 | outname = outname..profile[domain]..profile.ext..(data.binary and "dxo" or "txt") 170 | outname = '"'..outname..'"' 171 | 172 | local cmdline = " /T "..profile[domain].." " 173 | cmdline = cmdline..(args and args.." " or "") 174 | cmdline = cmdline..(data.backwards and "/Gec " or "") 175 | cmdline = cmdline..(data.domaindefs[domain]) 176 | cmdline = cmdline..(data.binary and "/Fo " or "/Fc ")..outname.." " 177 | if (entry) then 178 | cmdline = cmdline.."/E "..entry.." " 179 | end 180 | cmdline = cmdline.."/nologo " 181 | cmdline = cmdline..' "'..fullname..'"' 182 | 183 | cmdline = '"'..binpath..'/dxc.exe"'..cmdline 184 | 185 | -- run compiler process 186 | CommandLineRun(cmdline,nil,true,nil,nil) 187 | end 188 | 189 | frame:Connect(ID "dxc.compile.preprocess",wx.wxEVT_COMMAND_MENU_SELECTED, 190 | function(event) 191 | local filename,info = getEditorFileAndCurInfo() 192 | 193 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","Dx",data.custom) or data.custom 194 | local args = data.custom:len() > 0 and data.custom or nil 195 | 196 | local fullname = filename:GetFullPath() 197 | 198 | local outname = fullname 199 | outname = args and outname..".^"..args:gsub("%s*[%-%/]",";-")..";^" or outname 200 | outname = outname..".fx" 201 | outname = '"'..outname..'"' 202 | 203 | local cmdline = " /P "..outname.." " 204 | cmdline = cmdline..(args and args.." " or "") 205 | cmdline = cmdline.."/nologo " 206 | cmdline = cmdline..' "'..fullname..'"' 207 | 208 | cmdline = '"'..binpath..'/dxc.exe"'..cmdline 209 | 210 | CommandLineRun(cmdline,nil,true,nil,nil) 211 | end) 212 | 213 | frame:Connect(ID "dxc.compile.any",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 214 | frame:Connect(ID "dxc.compile.last",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 215 | frame:Connect(ID "dxc.compile.vertex",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 216 | frame:Connect(ID "dxc.compile.pixel",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 217 | frame:Connect(ID "dxc.compile.mesh",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 218 | frame:Connect(ID "dxc.compile.amp",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 219 | frame:Connect(ID "dxc.compile.compute",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 220 | end, 221 | } 222 | -------------------------------------------------------------------------------- /graphicscodepack/tools/ffitoapi.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | local StripCommentsC = StripCommentsC 4 | if not StripCommentsC then 5 | StripCommentsC = function(tx) 6 | local out = "" 7 | local lastc = "" 8 | local skip 9 | local skipline 10 | local skipmulti 11 | local tx = string.gsub(tx, "\r\n", "\n") 12 | for c in tx:gmatch(".") do 13 | local oc = c 14 | local tu = lastc..c 15 | skip = c == '/' 16 | 17 | if ( not (skipmulti or skipline)) then 18 | if (tu == "//") then 19 | skipline = true 20 | elseif (tu == "/*") then 21 | skipmulti = true 22 | c = "" 23 | elseif (lastc == '/') then 24 | oc = tu 25 | end 26 | elseif (skipmulti and tu == "*/") then 27 | skipmulti = false 28 | c = "" 29 | elseif (skipline and lastc == "\n") then 30 | out = out.."\n" 31 | skipline = false 32 | end 33 | 34 | lastc = c 35 | if (not (skip or skipline or skipmulti)) then 36 | out = out..oc 37 | end 38 | end 39 | 40 | return out..lastc 41 | end 42 | 43 | end 44 | 45 | local function ffiToApi(ffidef) 46 | local str = ffidef:gsub("\r","") 47 | str = ffidef:match("(%-%-%[%[.+%]%])") 48 | local header = ffidef:match("[^\r\n]+") 49 | ffidef = StripCommentsC(ffidef) 50 | 51 | local description = header:match("|%s*(.*)") 52 | local descrprefixes = header:match("(.-)%s*|") 53 | if not descrprefixes then return end 54 | 55 | local prefixes = {} 56 | for prefix in descrprefixes:gmatch("([_%w]+)") do 57 | table.insert(prefixes,prefix) 58 | end 59 | local ns = prefixes[1] 60 | if not ns then return end 61 | 62 | local lktypes = { 63 | ["string"] = "string", 64 | } 65 | 66 | local function gencontent(tx) 67 | local enums = {} 68 | local funcs = {} 69 | local values = {} 70 | local classes = {} 71 | 72 | -- extract function names 73 | local curfunc 74 | local function registerfunc() 75 | local fn = curfunc 76 | -- parse args 77 | local args = fn.ARGS:match("%(%s*(.-)%s*%)%s*;") or "" 78 | fn.ARGS = "("..args..")" 79 | 80 | -- skip return void types 81 | local what = fn.RET == "void" and "" or fn.RET 82 | what = what:match("%s*(.-)%s*$") 83 | fn.RET = "("..what..")" 84 | fn.DESCR = "" 85 | if (what ~= "") then 86 | fn.TYPE = what 87 | end 88 | 89 | table.insert(funcs,curfunc) 90 | curfunc = nil 91 | end 92 | 93 | local outer = tx 94 | -- remove structs/enums content 95 | :gsub("(%b{})","{}") 96 | -- remove multiline function arguments 97 | :gsub("(%b())", function(cap) return cap:gsub("[\r\n]"," ") end) 98 | :gsub("[ \t]+", " ") 99 | 100 | for l in outer:gmatch("[^\r\n]+") do 101 | -- extern void func(blubb); 102 | -- extern void ( * func )(blubb); 103 | -- void func(blubb); 104 | -- void ( * func )(blubb); 105 | -- void * ( * func )(blubb); 106 | local typedef = l:match("typedef") 107 | local ret,name,args = string.match(typedef and "" or l, 108 | "%s*([_%w%*%s]+)%s+%(?[%s%*]*([_%w]+)%s*%)?%s*(%([^%(]*;)") 109 | 110 | if (not (curfunc or typedef) and (ret and name and args)) then 111 | ret = ret:gsub("^%s*extern%s*","") 112 | curfunc = {RET=ret,NAME=name,ARGS=args} 113 | registerfunc() 114 | elseif (not typedef) then 115 | local typ,names,val = l:match("%s*([_%w%s%*]+)%s+([_%w%[%]]+)[\r\n%s]*=[\r\n%s]*([_%w]+)[\r\n%s]*;") 116 | if (not (typ and names and val)) then 117 | typ,names = l:match("%s*([_%w%s%*]+)%s+([_%w%[%]%:%s,]+)[\r\n%s]*;") 118 | end 119 | if (typ and names) then 120 | for name,rest in names:gmatch("([_%w]+)([^,]*)") do 121 | rest = rest and rest:gsub("%s","") or "" 122 | local what = typ..(rest:gsub("%b[]","*")) 123 | table.insert(values,{NAME=name, DESCR=(typ..rest..(val and (" = "..val) or "")), TYPE = what,}) 124 | end 125 | end 126 | elseif(typedef) then 127 | -- typedef struct lxgTextureUpdate_s * lxgTextureUpdatePTR; 128 | -- typedef float lxVector2[2]; 129 | local what,name = l:match("typedef%s+([_%w%s%*]-)%s+([_%w%[%]]+)%s*;") 130 | if (what and name) then 131 | what = what:gsub("const%s","") 132 | what = what:gsub("static%s","") 133 | what = what:gsub("%s+"," ") 134 | what = what:gsub("%s+%*","*") 135 | local name,rest = name:match("([_%w]+)(.*)") 136 | rest = rest and rest:gsub("%s","") or "" 137 | if (what and name) then 138 | lktypes[name] = what..(rest:gsub("%b[]","*")) 139 | end 140 | end 141 | end 142 | end 143 | 144 | -- collapse 145 | tx = tx:gsub("[ \t]+", " ") 146 | 147 | -- search for enums 148 | for def in tx:gmatch("enum[_%w%s\r\n]*(%b{})[_%w%s\r\n]*;") do 149 | for enum in def:gmatch("([_%w]+).-[,}]") do 150 | table.insert(enums,{NAME=enum}) 151 | end 152 | end 153 | 154 | -- search for classes 155 | for class,def,final in tx:gmatch("struct%s+([_%w]*)[%s\r\n]*(%b{})([_%w%s\r\n]*);") do 156 | final = final:match("[_%w]+") 157 | if (final) then 158 | lktypes["struct "..class] = ns.."."..final 159 | lktypes[final] = ns.."."..final 160 | lktypes[ns.."."..final] = ns.."."..final 161 | else 162 | lktypes["struct "..class] = ns.."."..class 163 | lktypes[ns.."."..class] = ns.."."..class 164 | end 165 | table.insert(classes,{NAME= final or class,DESCR = "",content = gencontent(def:sub(2,-2))}) 166 | end 167 | 168 | return (#classes > 0 or #funcs > 0 or #enums > 0 or #values > 0) and 169 | {classes=classes,funcs=funcs, enums=enums, values=values} 170 | end 171 | 172 | local content = gencontent(ffidef) 173 | local function fixtypes(tab) 174 | for i,v in ipairs(tab) do 175 | local vt = v.TYPE 176 | if (vt) then 177 | local nt = vt 178 | 179 | repeat 180 | nt = nt:match("%s*(.-)%s*$") 181 | nt = nt:gsub("%s+"," ") 182 | nt = nt:gsub("%s%*","*") 183 | nt = nt == "const char*" and "string" or nt 184 | nt = nt:gsub("%*","") 185 | nt = nt:gsub("const%s","") 186 | nt = nt:gsub("static%s","") 187 | vt = nt 188 | local typ,qual = nt:match("([_%w%.%s]+)(%**)") 189 | nt = (lktypes[typ] or "")..(qual or "") 190 | until nt==vt 191 | v.TYPE = nt ~= "" and '"'..nt..'"' or "nil" 192 | else 193 | v.TYPE = "nil" 194 | end 195 | end 196 | end 197 | local function fixcontent(tab) 198 | fixtypes(tab.values) 199 | fixtypes(tab.funcs) 200 | for i,v in ipairs(tab.classes) do 201 | fixcontent(v.content) 202 | end 203 | end 204 | fixcontent(content) 205 | 206 | str = 207 | --str.. 208 | "-- "..header.. 209 | "-- auto-generated api from ffi headers\n".. 210 | "local api=\n" 211 | 212 | -- serialize api string 213 | local function serialize(str,id,tab,lvl) 214 | lvl = string.rep(" ",lvl or 1) 215 | for i,k in ipairs(tab) do 216 | str = str..string.gsub(id,"%$([%w]+)%$",k):gsub("##",lvl) 217 | end 218 | return str 219 | end 220 | 221 | local function genapi(str,content,lvl) 222 | lvl = lvl or 2 223 | str = str..string.gsub("##{\n","##",string.rep(" ",lvl)) 224 | 225 | local value = 226 | '##["$NAME$"] = { type ="value", description = "$DESCR$", valuetype = $TYPE$, },\n' 227 | local enum = 228 | '##["$NAME$"] = { type ="value", },\n' 229 | local funcdef = 230 | '##["$NAME$"] = { type ="function",\n'.. 231 | '## description = "$DESCR$",\n'.. 232 | '## returns = "$RET$",\n'.. 233 | '## valuetype = $TYPE$,\n'.. 234 | '## args = "$ARGS$", },\n' 235 | 236 | str = serialize(str,value,content.values or {},lvl) 237 | str = serialize(str,enum,content.enums or {},lvl) 238 | str = serialize(str,funcdef,content.funcs or {},lvl) 239 | 240 | local classdef = 241 | '##["$NAME$"] = { type ="class",\n'.. 242 | '## description = "$DESCR$",\n'.. 243 | '## $CHILDS$ },\n' 244 | 245 | for i,v in pairs(content.classes or {}) do 246 | v.CHILDS = v.content and genapi("childs =\n",v.content,lvl+2) or "" 247 | end 248 | 249 | str = serialize(str,classdef,content.classes or {},lvl) 250 | 251 | str = str..string.gsub("##}","##",string.rep(" ",lvl)) 252 | 253 | return str 254 | end 255 | 256 | str = genapi(str,content):gsub("%s*valuetype = nil,","") 257 | 258 | str = str.."\n\nreturn {\n" 259 | 260 | local lib = 261 | ' $NAME$ = {\n'.. 262 | ' type = "lib",\n'.. 263 | ' description = "$DESCR$",\n'.. 264 | ' childs = api,\n'.. 265 | ' },\n' 266 | 267 | 268 | local libs = {} 269 | for i,prefix in ipairs(prefixes) do 270 | local p = {NAME=prefix, DESCR = description} 271 | table.insert(libs,p) 272 | end 273 | 274 | str = serialize(str,lib,libs) 275 | str = str.."}\n" 276 | 277 | return str 278 | end 279 | 280 | if (not ide) then 281 | ffitoapi = function(fname) 282 | local f = io.open(fname,"rb") 283 | local tx = f:read("*a") 284 | f:close() 285 | tx = ffiToApi(tx) 286 | local f = io.open(fname,"wb") 287 | f:write(tx) 288 | f:close() 289 | end 290 | end 291 | 292 | return { 293 | exec = { 294 | name = "luajit ffi string to editor api", 295 | description = "converts current file to api, for autocompletion inside this editor", 296 | fn = function(wxfname,projectdir) 297 | print(wxfname,projectdir) 298 | -- get cur editor text 299 | local editor = GetEditor() 300 | if (not editor) then return end 301 | local tx = editor:GetText() 302 | tx = ffiToApi(tx) 303 | -- replace text 304 | if tx then editor:SetText(tx) end 305 | end, 306 | }, 307 | } 308 | -------------------------------------------------------------------------------- /graphicscodepack/tools/fxc.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2020 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local binpath = ide.config.path.fxcbin or (os.getenv("DXSDK_DIR") and os.getenv("DXSDK_DIR").."/Utilities/bin/x86/") 5 | local dxprofile 6 | 7 | return binpath and { 8 | fninit = function(frame,menuBar) 9 | dxprofile = ide.config.fxcprofile or "dx_5" 10 | 11 | if (wx.wxFileName(binpath):IsRelative()) then 12 | local editorDir = string.gsub(ide.editorFilename:gsub("[^/\\]+$",""),"\\","/") 13 | binpath = editorDir..binpath 14 | end 15 | 16 | local myMenu = wx.wxMenu{ 17 | { ID "fxc.profile.dx_2x", "DX SM&2_x", "DirectX sm2_x profile", wx.wxITEM_CHECK }, 18 | { ID "fxc.profile.dx_3", "DX SM&3_0", "DirectX sm3_0 profile", wx.wxITEM_CHECK }, 19 | { ID "fxc.profile.dx_4", "DX SM&4_0", "DirectX sm4_0 profile", wx.wxITEM_CHECK }, 20 | { ID "fxc.profile.dx_5", "DX SM&5_0", "DirectX sm5_0 profile", wx.wxITEM_CHECK }, 21 | --{ ID "fxc.profile.dx_6", "DX SM&6_0", "DirectX sm6_0 profile", wx.wxITEM_CHECK }, 22 | { }, 23 | { ID "fxc.compile.input", "Custom &Args", "when set a popup for custom compiler args will be envoked", wx.wxITEM_CHECK }, 24 | { ID "fxc.compile.binary", "&Binary", "when set compiles binary output", wx.wxITEM_CHECK }, 25 | { ID "fxc.compile.legacy", "Legacy", "when set compiles in legacy mode", wx.wxITEM_CHECK }, 26 | { ID "fxc.compile.backwards", "Backwards Compatibility", "when set compiles in backwards compatibility mode", wx.wxITEM_CHECK }, 27 | { }, 28 | { ID "fxc.compile.any", "Compile from &Entry", "Compile Shader (select entry word, matches _?s or ?S suffix for type)" }, 29 | { ID "fxc.compile.last", "Compile &Last", "Compile Shader using last domain and entry word" }, 30 | { ID "fxc.compile.vertex", "Compile &Vertex", "Compile Vertex shader (select entry word)" }, 31 | { ID "fxc.compile.pixel", "Compile &Pixel", "Compile Pixel shader (select entry word)" }, 32 | { ID "fxc.compile.geometry", "Compile &Geometry", "Compile Geometry shader (select entry word)" }, 33 | { ID "fxc.compile.domain", "Compile &Domain", "Compile Domain shader (select entry word)" }, 34 | { ID "fxc.compile.hull", "Compile &Hull", "Compile Hull shader (select entry word)" }, 35 | { ID "fxc.compile.compute", "Compile &Compute", "Compile Compute shader (select entry word)" }, 36 | { ID "fxc.compile.effects", "Compile E&ffects", "Compile all effects in shader" }, 37 | { ID "fxc.compile.preprocess", "Preprocess file only", "preprocess the current file" }, 38 | } 39 | menuBar:Append(myMenu, "FX&C") 40 | 41 | local data = {} 42 | data.lastentry = nil 43 | data.lastdomain = nil 44 | data.customarg = false 45 | data.custom = "" 46 | data.legacy = false 47 | data.backwards = false 48 | data.binary = false 49 | data.preprocess = false 50 | data.profid = ID ("fxc.profile."..dxprofile) 51 | data.types = { 52 | ["vs"] = 1, 53 | ["ps"] = 2, 54 | ["gs"] = 3, 55 | ["ds"] = 4, 56 | ["hs"] = 5, 57 | ["cs"] = 6, 58 | } 59 | data.domains = { 60 | [ID "fxc.compile.vertex"] = 1, 61 | [ID "fxc.compile.pixel"] = 2, 62 | [ID "fxc.compile.geometry"] = 3, 63 | [ID "fxc.compile.domain"] = 4, 64 | [ID "fxc.compile.hull"] = 5, 65 | [ID "fxc.compile.compute"] = 6, 66 | [ID "fxc.compile.effects"] = 7, 67 | [ID "fxc.compile.last"] = "last", 68 | } 69 | data.profiles = { 70 | [ID "fxc.profile.dx_2x"] = {"vs_2_0","ps_2_x",false,false,false,false,"fx_2_x",ext=".fxc."}, 71 | [ID "fxc.profile.dx_3"] = {"vs_3_0","ps_3_0",false,false,false,false,"fx_3_0",ext=".fxc."}, 72 | [ID "fxc.profile.dx_4"] = {"vs_4_0","ps_4_0","gs_4_0",false,false,false,"fx_4_0",ext=".fxc."}, 73 | [ID "fxc.profile.dx_5"] = {"vs_5_0","ps_5_0","gs_5_0","ds_5_0","hs_5_0","cs_5_0","fx_5_0",ext=".fxc."}, 74 | [ID "fxc.profile.dx_6"] = {"vs_6_0","ps_6_0","gs_6_0","ds_6_0","hs_6_0","cs_6_0",false,ext=".fxc."}, 75 | } 76 | data.domaindefs = { 77 | " /D _VERTEX_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 78 | " /D _FRAGMENT_SHADER_=1 /D _PIXEL_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 79 | " /D _GEOMETRY_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 80 | " /D _TESS_CONTROL_SHADER_=1 /D _HULL_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 81 | " /D _TESS_EVALUATION_SHADER_=1 /D _DOMAIN_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 82 | " /D _COMPUTE_SHADER_=1 /D _DX_=1 /D _IDE_=1 ", 83 | " /D _EFFECTS_=1 /D _DX_=1 /D _IDE_=1 ", 84 | } 85 | -- Profile related 86 | menuBar:Check(data.profid, true) 87 | 88 | local function selectProfile (id) 89 | for id,profile in pairs(data.profiles) do 90 | menuBar:Check(id, false) 91 | end 92 | menuBar:Check(id, true) 93 | data.profid = id 94 | end 95 | 96 | local function evSelectProfile (event) 97 | local chose = event:GetId() 98 | selectProfile(chose) 99 | end 100 | 101 | for id,profile in pairs(data.profiles) do 102 | frame:Connect(id,wx.wxEVT_COMMAND_MENU_SELECTED,evSelectProfile) 103 | end 104 | 105 | -- Compile Arg 106 | frame:Connect(ID "fxc.compile.input",wx.wxEVT_COMMAND_MENU_SELECTED, 107 | function(event) 108 | data.customarg = event:IsChecked() 109 | end) 110 | frame:Connect(ID "fxc.compile.legacy",wx.wxEVT_COMMAND_MENU_SELECTED, 111 | function(event) 112 | data.legacy = event:IsChecked() 113 | end) 114 | frame:Connect(ID "fxc.compile.backwards",wx.wxEVT_COMMAND_MENU_SELECTED, 115 | function(event) 116 | data.backwards = event:IsChecked() 117 | end) 118 | frame:Connect(ID "fxc.compile.binary",wx.wxEVT_COMMAND_MENU_SELECTED, 119 | function(event) 120 | data.binary = event:IsChecked() 121 | end) 122 | 123 | local function getEditorFileAndCurInfo(nochecksave) 124 | local editor = ide:GetEditor() 125 | if (not (editor and (nochecksave or SaveIfModified(editor)))) then 126 | return 127 | end 128 | 129 | local id = editor:GetId() 130 | local filepath = ide.openDocuments[id].filePath 131 | if not filepath then return end 132 | 133 | local fn = wx.wxFileName(filepath) 134 | fn:Normalize() 135 | 136 | local info = {} 137 | info.pos = editor:GetCurrentPos() 138 | info.line = editor:GetCurrentLine() 139 | info.sel = editor:GetSelectedText() 140 | info.sel = info.sel and info.sel:len() > 0 and info.sel or nil 141 | info.selword = info.sel and info.sel:match("([^a-zA-Z_0-9]+)") or info.sel 142 | 143 | return fn,info 144 | end 145 | -- Compile 146 | local function evCompile(event) 147 | local filename,info = getEditorFileAndCurInfo() 148 | local editor = ide:GetEditor() 149 | local domain = data.domains[event:GetId()] 150 | local entry = info.selword 151 | 152 | if (domain == "last") then 153 | domain = data.lastdomain 154 | entry = data.lastentry 155 | end 156 | 157 | if (not domain and entry) then 158 | for typename,id in pairs(data.types) do 159 | if(entry:match("_"..typename) or entry:match("[a-z0-9_]"..string.upper(typename).."$") or entry:match("^"..string.lower(typename).."[A-Z]")) then 160 | domain = id 161 | end 162 | end 163 | end 164 | 165 | if (not (filename and binpath) or not (domain == 7 or entry )) then 166 | DisplayOutput("Error: Dx Compile: Insufficient parameters (nofile / no selected entry function!\n") 167 | return 168 | end 169 | 170 | data.lastdomain = domain 171 | data.lastentry = entry 172 | 173 | local profile = data.profiles[data.profid] 174 | if (not profile[domain]) then 175 | DisplayOutput("Error: Dx Compile: no profile\n") 176 | return 177 | end 178 | 179 | -- popup for custom input 180 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","Dx",data.custom) or data.custom 181 | local args = data.custom:len() > 0 and data.custom or nil 182 | 183 | local fullname = filename:GetFullPath() 184 | 185 | local outname = fullname.."."..(entry or "").."^" 186 | outname = args and outname..args:gsub("%s*[%-%/]",";-")..";^" or outname 187 | outname = outname..profile[domain]..profile.ext..(data.binary and "fxo" or "txt") 188 | outname = '"'..outname..'"' 189 | 190 | local cmdline = " /T "..profile[domain].." " 191 | cmdline = cmdline..(args and args.." " or "") 192 | cmdline = cmdline..(data.legacy and "/LD " or "") 193 | cmdline = cmdline..(data.backwards and "/Gec " or "") 194 | cmdline = cmdline..(data.domaindefs[domain]) 195 | cmdline = cmdline..(data.binary and "/Fo " or "/Fc ")..outname.." " 196 | if (entry) then 197 | cmdline = cmdline.."/E "..entry.." " 198 | end 199 | cmdline = cmdline.."/nologo " 200 | cmdline = cmdline..' "'..fullname..'"' 201 | 202 | cmdline = '"'..binpath..'/fxc.exe"'..cmdline 203 | 204 | -- run compiler process 205 | CommandLineRun(cmdline,nil,true,nil,nil) 206 | end 207 | 208 | frame:Connect(ID "fxc.compile.preprocess",wx.wxEVT_COMMAND_MENU_SELECTED, 209 | function(event) 210 | local filename,info = getEditorFileAndCurInfo() 211 | 212 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","Dx",data.custom) or data.custom 213 | local args = data.custom:len() > 0 and data.custom or nil 214 | 215 | local fullname = filename:GetFullPath() 216 | 217 | local outname = fullname 218 | outname = args and outname..".^"..args:gsub("%s*[%-%/]",";-")..";^" or outname 219 | outname = outname..".fx" 220 | outname = '"'..outname..'"' 221 | 222 | local cmdline = " /P "..outname.." " 223 | cmdline = cmdline..(args and args.." " or "") 224 | cmdline = cmdline.."/nologo " 225 | cmdline = cmdline..' "'..fullname..'"' 226 | 227 | cmdline = '"'..binpath..'/fxc.exe"'..cmdline 228 | 229 | CommandLineRun(cmdline,nil,true,nil,nil) 230 | end) 231 | 232 | frame:Connect(ID "fxc.compile.any",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 233 | frame:Connect(ID "fxc.compile.last",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 234 | frame:Connect(ID "fxc.compile.vertex",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 235 | frame:Connect(ID "fxc.compile.pixel",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 236 | frame:Connect(ID "fxc.compile.geometry",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 237 | frame:Connect(ID "fxc.compile.domain",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 238 | frame:Connect(ID "fxc.compile.hull",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 239 | frame:Connect(ID "fxc.compile.compute",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 240 | frame:Connect(ID "fxc.compile.effects",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 241 | end, 242 | } 243 | -------------------------------------------------------------------------------- /graphicscodepack/tools/glslang.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local binpath = ide.config.path.glslangbin or os.getenv("GLSLANG_BIN_PATH") or (os.getenv("VULKAN_SDK") and 5 | os.getenv("VULKAN_SDK").."/Bin") 6 | 7 | return binpath and { 8 | fninit = function(frame,menuBar) 9 | 10 | if (wx.wxFileName(binpath):IsRelative()) then 11 | local editorDir = string.gsub(ide.editorFilename:gsub("[^/\\]+$",""),"\\","/") 12 | binpath = editorDir..binpath 13 | end 14 | 15 | local myMenu = wx.wxMenu{ 16 | { ID "glslang.compile.input", "&Custom Args", "when set a popup for custom compiler args will be envoked", wx.wxITEM_CHECK }, 17 | { ID "glslang.compile.preproc", "Preprocess File", "Pre-process the files only, resolving #inlcudes", wx.wxITEM_CHECK }, 18 | { }, 19 | { ID "glslang.compile.ext", "Compile from .ext\tF8", "Compile based on file extension" }, 20 | { ID "glslang.compile.vert", "Compile Vertex", "Compile Vertex shader" }, 21 | { ID "glslang.compile.frag", "Compile Fragment", "Compile Fragment shader" }, 22 | { ID "glslang.compile.geom", "Compile Geometry", "Compile Geometry shader" }, 23 | { ID "glslang.compile.tesc", "Compile T.Ctrl", "Compile T.Ctrl shader" }, 24 | { ID "glslang.compile.tese", "Compile T.Eval", "Compile T.Eval shader" }, 25 | { ID "glslang.compile.comp", "Compile Compute", "Compile Compute shader" }, 26 | { ID "glslang.compile.mesh", "Compile Mesh", "Compile Mesh shader" }, 27 | { ID "glslang.compile.task", "Compile Task", "Compile Task shader" }, 28 | { ID "glslang.compile.rgen", "Compile R. Generation", "Compile Ray Generation shader" }, 29 | { ID "glslang.compile.rint", "Compile R. Intersection", "Compile Ray Intersection shader" }, 30 | { ID "glslang.compile.rahit", "Compile R. Any Hit", "Compile Ray Any Hit shader" }, 31 | { ID "glslang.compile.rchit", "Compile R. Closest Hit", "Compile Ray Closest Hit shader" }, 32 | { ID "glslang.compile.rmiss", "Compile R. Miss", "Compile Ray Miss shader" }, 33 | --{ ID "glslang.compile.rcall", "Compile R. Callable", "Compile Ray Callable shader" }, 34 | } 35 | menuBar:Append(myMenu, "&GLSLANG") 36 | 37 | local data = {} 38 | data.customarg = false 39 | data.separable = false 40 | data.preproc = false 41 | data.custom = "" 42 | data.domains = { 43 | [ID "glslang.compile.vert"] = 1, 44 | [ID "glslang.compile.frag"] = 2, 45 | [ID "glslang.compile.geom"] = 3, 46 | [ID "glslang.compile.tesc"] = 4, 47 | [ID "glslang.compile.tese"] = 5, 48 | [ID "glslang.compile.comp"] = 6, 49 | [ID "glslang.compile.mesh"] = 7, 50 | [ID "glslang.compile.task"] = 8, 51 | [ID "glslang.compile.rgen"] = 9, 52 | [ID "glslang.compile.rint"] = 10, 53 | [ID "glslang.compile.rahit"] = 11, 54 | [ID "glslang.compile.rchit"] = 12, 55 | [ID "glslang.compile.rmiss"] = 13, 56 | --[ID "glslang.compile.rcall"] = 14, 57 | } 58 | data.domainprofiles = { 59 | "vert", 60 | "frag", 61 | "geom", 62 | "tesc", 63 | "tese", 64 | "comp", 65 | "mesh", 66 | "task", 67 | "rgen", 68 | "rint", 69 | "rahit", 70 | "rchit", 71 | "rmiss", 72 | --"rcall", 73 | } 74 | data.domainexts = { 75 | vert = 1, 76 | frag = 2, 77 | geom = 3, 78 | geo = 3, 79 | tesc = 4, 80 | tctrl = 4, 81 | tese = 5, 82 | teval = 5, 83 | comp = 6, 84 | mesh = 7, 85 | task = 8, 86 | rgen = 9, 87 | rint = 10, 88 | rahit = 11, 89 | rchit = 12, 90 | rmiss = 13, 91 | --rcall = 14, 92 | } 93 | 94 | data.domaindefs = { 95 | " -D_VERTEX_SHADER_ -D_IDE_ ", 96 | " -D_FRAGMENT_SHADER_ -D_IDE_ ", 97 | " -D_GEOMETRY_SHADER_ -D_IDE_ ", 98 | " -D_TESS_CONTROL_SHADER_ -D_IDE_ ", 99 | " -D_TESS_EVALUATION_SHADER_ -D_IDE_ ", 100 | " -D_COMPUTE_SHADER_ -D_IDE_ ", 101 | " -D_MESH_SHADER_ -D_IDE_ ", 102 | " -D_TASK_SHADER_ -D_IDE_ ", 103 | " -D_RAY_GENERATION_SHADER_ -D_IDE_ ", 104 | " -D_RAY_INTERSECTION_SHADER_ -D_IDE_ ", 105 | " -D_RAY_ANY_HIT_SHADER_ -D_IDE_ ", 106 | " -D_RAY_CLOSEST_HIT_SHADER_ -D_IDE_ ", 107 | " -D_RAY_MISS_SHADER_ -D_IDE_ ", 108 | --" -D_RAY_CALLABLE_SHADER_ -D_IDE_ ", 109 | } 110 | 111 | local function getEditorFileAndCurInfo(nochecksave) 112 | local editor = ide:GetEditor() 113 | if (not (editor and (nochecksave or SaveIfModified(editor)))) then 114 | return 115 | end 116 | 117 | local id = editor:GetId() 118 | local filepath = ide.openDocuments[id].filePath 119 | if not filepath then return end 120 | 121 | local fn = wx.wxFileName(filepath) 122 | fn:Normalize() 123 | 124 | local info = {} 125 | info.pos = editor:GetCurrentPos() 126 | info.line = editor:GetCurrentLine() 127 | info.sel = editor:GetSelectedText() 128 | info.sel = info.sel and info.sel:len() > 0 and info.sel or nil 129 | info.selword = info.sel and info.sel:match("([^a-zA-Z_0-9]+)") or info.sel 130 | 131 | return fn,info 132 | end 133 | 134 | -- Compile Arg 135 | frame:Connect(ID "glslang.compile.input",wx.wxEVT_COMMAND_MENU_SELECTED, 136 | function(event) 137 | data.customarg = event:IsChecked() 138 | end) 139 | 140 | frame:Connect(ID "glslang.compile.preproc",wx.wxEVT_COMMAND_MENU_SELECTED, 141 | function(event) 142 | data.preproc = event:IsChecked() 143 | end) 144 | 145 | -- Compile 146 | local function evCompile(event) 147 | local filename,info = getEditorFileAndCurInfo() 148 | local editor = ide:GetEditor() 149 | local glsl = true 150 | 151 | if (not (filename and binpath)) then 152 | DisplayOutput("Error: GLSLANG Compile: Insufficient parameters (nofile)\n") 153 | return 154 | end 155 | 156 | local function getDomain(filename) 157 | local fname = filename:GetFullName() 158 | for i,v in pairs(data.domainexts) do 159 | if (fname:match("%."..i)) then 160 | domain = v 161 | break 162 | end 163 | end 164 | if (not domain) then 165 | DisplayOutput("Error: GLSLANG Compile: could not derive domain\n") 166 | end 167 | return domain 168 | end 169 | 170 | local function getCompileArg(filename,domain) 171 | --if (data.preproc) then return '"'..filename:GetFullPath()..'" ' 172 | --else return "-S "..data.domainprofiles[domain]..' "'..filename:GetFullPath()..'" ' 173 | --end 174 | return "-S "..data.domainprofiles[domain]..' "'..filename:GetFullPath()..'" ' 175 | end 176 | 177 | 178 | local outname 179 | local outsuffix 180 | local compileargs 181 | local getinstructions 182 | do 183 | -- compile single file 184 | getinstructions = true 185 | 186 | local domain = data.domains[event:GetId()] 187 | if (not domain) then 188 | domain = getDomain(filename) 189 | end 190 | if (not domain) then 191 | return 192 | end 193 | 194 | local profile = data.domainprofiles[domain] 195 | local fullname = filename:GetFullPath() 196 | 197 | outname = fullname.."." 198 | outsuffix = nil 199 | compileargs = data.domaindefs[domain].." "..getCompileArg(filename,domain) 200 | end 201 | 202 | -- popup for custom input 203 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","GLSLANG",data.custom) or data.custom 204 | local args = data.customarg and data.custom or "" 205 | args = args:len() > 0 and args or nil 206 | 207 | outname = outname..(args and "^"..args:gsub("%s*[%-%/]",";-")..";^" or "") 208 | outname = outname..(outsuffix or "") 209 | outname = outname..((outsuffix or args) and "." or "") 210 | local logname = outname..'spva' 211 | outname = '"'..outname..'spv"' 212 | 213 | --DisplayOutput("logname", logname) 214 | 215 | local projpath = ide:GetProject() 216 | local includeargs = "" 217 | 218 | --DisplayOutput("proj", projpath.."zbsgfxpack.lua", wx.wxFileExists(projpath.."/zbsgfxpack.lua"), "\n") 219 | if (projpath and wx.wxFileExists(projpath.."zbsgfxpack.lua")) then 220 | local gfxpack = LoadLuaFileExt({}, projpath.."zbsgfxpack.lua") 221 | if (gfxpack and gfxpack.zbsgfxpack and gfxpack.zbsgfxpack.glslang and gfxpack.zbsgfxpack.glslang.includes) then 222 | for i,v in ipairs(gfxpack.zbsgfxpack.glslang.includes) do 223 | includeargs = includeargs..'-I"'..v..'" ' 224 | end 225 | end 226 | end 227 | 228 | local cmdline = binpath.."/glslangValidator.exe " 229 | if (data.preproc) then 230 | logname = filename:GetPath(wx.wxPATH_GET_VOLUME + wx.wxPATH_GET_SEPARATOR).."_"..filename:GetFullName() 231 | cmdline = cmdline.."-E " 232 | cmdline = cmdline..includeargs 233 | cmdline = cmdline..compileargs 234 | else 235 | cmdline = cmdline..(args and args.." " or "") 236 | cmdline = cmdline.."--target-env vulkan1.2 -H -g " 237 | cmdline = cmdline..includeargs 238 | cmdline = cmdline.."-o "..outname.." " 239 | cmdline = cmdline..compileargs 240 | end 241 | 242 | do 243 | -- reset log file 244 | local f = io.open(logname,"wt") 245 | if (f) then 246 | f:flush() 247 | f:close() 248 | end 249 | end 250 | 251 | local moduleFile = false 252 | local function compilecallback(str) 253 | if (data.preproc or (not moduleFile and str:match("// Module"))) then 254 | moduleFile = true 255 | end 256 | 257 | if (moduleFile) then 258 | local f = io.open(logname,"at") 259 | if (f) then 260 | local ostr = str:gsub("\n","") 261 | f:write(ostr) 262 | f:flush() 263 | f:close() 264 | end 265 | return 266 | else 267 | return str 268 | end 269 | end 270 | 271 | local wdir = filename:GetPath(wx.wxPATH_GET_VOLUME) 272 | 273 | -- run compiler process 274 | CommandLineRun(cmdline,wdir,true, nil, compilecallback) 275 | 276 | end 277 | 278 | for i,v in pairs(data.domains) do 279 | frame:Connect(i,wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 280 | end 281 | frame:Connect(ID "glslang.compile.ext",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 282 | 283 | end, 284 | } 285 | -------------------------------------------------------------------------------- /graphicscodepack/tools/glslc.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | local binpath = ide.config.path.glslcbin or os.getenv("GLSLC_BIN_PATH") 5 | 6 | return binpath and { 7 | fninit = function(frame,menuBar) 8 | 9 | if (wx.wxFileName(binpath):IsRelative()) then 10 | local editorDir = string.gsub(ide.editorFilename:gsub("[^/\\]+$",""),"\\","/") 11 | binpath = editorDir..binpath 12 | end 13 | 14 | local myMenu = wx.wxMenu{ 15 | { ID "glslc.compile.input", "&Custom Args", "when set a popup for custom compiler args will be envoked", wx.wxITEM_CHECK }, 16 | { ID "glslc.compile.separable", "Separable", "when set separable programs are used", wx.wxITEM_CHECK }, 17 | { ID "glslc.compile.preproc", "Preprocess File", "Pre-process the files only, resolving #inlcudes", wx.wxITEM_CHECK }, 18 | { }, 19 | { ID "glslc.compile.ext", "Compile from .ext\tCtrl-1", "Compile based on file extension" }, 20 | { ID "glslc.compile.all", "Link multiple .ext\tCtrl-2", "Tries to link multiple shaders based on filename" }, 21 | { ID "glslc.compile.vertex", "Compile &Vertex", "Compile Vertex program" }, 22 | { ID "glslc.compile.fragment", "Compile &Fragment", "Compile Fragment program" }, 23 | { ID "glslc.compile.geometry", "Compile &Geometry", "Compile Geometry program" }, 24 | { ID "glslc.compile.tessctrl", "Compile T.Ctrl", "Compile T.Ctrl program" }, 25 | { ID "glslc.compile.tesseval", "Compile T.Eval", "Compile T.Eval program" }, 26 | { ID "glslc.compile.compute", "Compile Compute", "Compile Compute program" }, 27 | { }, 28 | { ID "glslc.format.asm", "Annotate ASM", "indent and add comments to ASM output" }, 29 | } 30 | menuBar:Append(myMenu, "&GLSLC") 31 | 32 | local data = {} 33 | data.customarg = false 34 | data.separable = false 35 | data.preproc = false 36 | data.custom = "" 37 | data.domains = { 38 | [ID "glslc.compile.vertex"] = 1, 39 | [ID "glslc.compile.fragment"] = 2, 40 | [ID "glslc.compile.geometry"] = 3, 41 | [ID "glslc.compile.tessctrl"] = 4, 42 | [ID "glslc.compile.tesseval"] = 5, 43 | [ID "glslc.compile.compute"] = 6, 44 | } 45 | data.domainprofiles = { 46 | "vertex", 47 | "fragment", 48 | "geometry", 49 | "tesscontrol", 50 | "tessevaluation", 51 | "compute", 52 | } 53 | data.domaindefs = { 54 | " -D_VERTEX_SHADER_ -D_IDE_ ", 55 | " -D_FRAGMENT_SHADER_ -D_IDE_ ", 56 | " -D_GEOMETRY_SHADER_ -D_IDE_ ", 57 | " -D_TESS_CONTROL_SHADER_ -D_IDE_ ", 58 | " -D_TESS_EVALUATION_SHADER_ -D_IDE_ ", 59 | " -D_COMPUTE_SHADER_ -D_IDE_ ", 60 | } 61 | 62 | local function getEditorFileAndCurInfo(nochecksave) 63 | local editor = ide:GetEditor() 64 | if (not (editor and (nochecksave or SaveIfModified(editor)))) then 65 | return 66 | end 67 | 68 | local id = editor:GetId() 69 | local filepath = ide.openDocuments[id].filePath 70 | if not filepath then return end 71 | 72 | local fn = wx.wxFileName(filepath) 73 | fn:Normalize() 74 | 75 | local info = {} 76 | info.pos = editor:GetCurrentPos() 77 | info.line = editor:GetCurrentLine() 78 | info.sel = editor:GetSelectedText() 79 | info.sel = info.sel and info.sel:len() > 0 and info.sel or nil 80 | info.selword = info.sel and info.sel:match("([^a-zA-Z_0-9]+)") or info.sel 81 | 82 | return fn,info 83 | end 84 | 85 | local function beautifyAsmEach(tx) 86 | local newtx = "" 87 | local indent = 0 88 | local maxindent = 0 89 | local isbranch = { 90 | ["IF"]=true,["REP"]=true,["ELSE"]=true,["LOOP"]=true, 91 | } 92 | local startindent = { 93 | ["IF"]=true,["REP"]=true,["ELSE"]=true,["LOOP"]=true,["BB"]=true, 94 | } 95 | local endindent = { 96 | ["ENDIF"]=true,["ENDREP"]=true,["ELSE"]=true,["ENDLOOP"]=true,["END"]=true,["RET"]=true, 97 | } 98 | 99 | local function check(str,tab) 100 | local res 101 | local chk = str:match("%s*(BB)%d+.*:") 102 | chk = chk or str:match("%s*(%w+)") 103 | res = chk and tab[chk] and chk 104 | 105 | return res 106 | end 107 | 108 | local argregistry = {} 109 | local argbuffersfixed = false 110 | 111 | local registercc = 0 112 | local registermem = 0 113 | local registers = 0 114 | local instructions = 0 115 | local branches = 0 116 | 117 | local function fixargbuffers() 118 | if (argbuffersfixed) then return end 119 | 120 | local argnew = {} 121 | for i,v in pairs(argregistry) do 122 | local buf,bufstart = string.match(i,"buf(%d+)%[(%d+)%]") 123 | if (buf and bufstart) then 124 | bufstart = tonumber(bufstart)/16 125 | argnew["buf"..buf.."["..tostring(bufstart).."]"] = v 126 | else 127 | argnew[i] = v 128 | end 129 | end 130 | argregistry = argnew 131 | argbuffersfixed = true 132 | end 133 | 134 | local function checkregistry(w) 135 | local regsuccess = true 136 | 137 | local vtype,vname,sem,resource,pnum,pref = string.match(w,"#var ([_%w]+) ([%[%]%._%w]+) : ([^%:]*) : ([^%:]*) : ([^%:]*) : (%d*)") 138 | local funcname,subroutine = string.match(w,"#function %d+ ([_%w]+)%((%d+)%)") 139 | if (pref == "1") then 140 | local descriptor = vtype.." "..vname 141 | 142 | -- check if resource is array 143 | local resstart,rescnt = string.match(resource,"c%[(%d+)%], (%d+)") 144 | resstart = tonumber(resstart) 145 | rescnt = tonumber(rescnt) 146 | 147 | -- check if resource is buffer/buffer array 148 | local buf,bufstart,bufcnt = string.match(resource,"buffer%[(%d+)%]%[(%d+)%],? ?(%d*)") 149 | buf = tonumber(buf) 150 | bufstart = tonumber(bufstart) 151 | bufcnt = tonumber(bufcnt) 152 | 153 | -- check if texture 154 | local texnum = string.match(resource,"texunit (%d+)") 155 | 156 | local argnames = {} 157 | if (rescnt) then 158 | for i=0,(rescnt-1) do 159 | table.insert(argnames,"c["..tostring(resstart + i).."]") 160 | end 161 | elseif (texnum) then 162 | table.insert(argnames,"texture["..tostring(texnum).."]") 163 | table.insert(argnames,"texture"..tostring(texnum)) 164 | elseif (buf) then 165 | table.insert(argnames,"buf"..tostring(buf).."["..tostring(bufstart).."]") 166 | else 167 | table.insert(argnames,resource) 168 | end 169 | 170 | for i,v in ipairs(argnames) do 171 | argregistry[v] = descriptor 172 | end 173 | elseif (funcname and subroutine) then 174 | argregistry["SUBROUTINENUM("..subroutine..")"] = "function "..funcname 175 | elseif string.find(w,"BUFFER4 ") then 176 | fixargbuffers() 177 | elseif string.find(w,"TEMP ") then 178 | --TEMP R0, R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11; 179 | --TEMP RC, HC; 180 | --TEMP lmem[9]; 181 | for i in string.gmatch(w,"C") do 182 | registercc = registercc + 1 183 | end 184 | for i in string.gmatch(w,"R%d+") do 185 | registers = registers + 1 186 | end 187 | registermem = tonumber(string.match(w,"lmem%[(%d+)%]")) 188 | elseif (string.find(w,"CBUFFER ") or string.find(w,"ATTRIB ") or string.find(w,"OPTION ") or 189 | string.find(w,"OUTPUT ") or string.find(w,"PARAM ") or string.find(w,"!!NV") or 190 | string.find(w,"STORAGE ")) then 191 | 192 | else 193 | regsuccess = false 194 | end 195 | 196 | return regsuccess 197 | end 198 | 199 | local function checkargs(str) 200 | local comment = "#" 201 | local declared = {} 202 | for i in string.gmatch(str,"([%[%]%(%)%w]+)") do 203 | local descr = argregistry[i] 204 | if (descr and not declared[i]) then 205 | comment = comment.." "..i.." = "..descr 206 | declared[i] = true 207 | end 208 | end 209 | 210 | return comment ~= "#" and comment 211 | end 212 | 213 | local registerlevels = {{}} 214 | local function checkregisters(str,indent) 215 | if (indent < 0) then return end 216 | local cur = registerlevels[indent+1] 217 | for i in string.gmatch(str,"R(%d+)") do 218 | cur[i] = true 219 | end 220 | end 221 | 222 | local function clearregisters(indent) 223 | registerlevels[math.max(0,indent)+1] = {} 224 | end 225 | 226 | local function outputregisters(indent) 227 | if (indent < 0) then return "" end 228 | local tab = registerlevels[indent+1] 229 | local out = {} 230 | for i,v in pairs(tab) do 231 | table.insert(out,i) 232 | end 233 | table.sort(out) 234 | local cnt = #out 235 | if (cnt < 1) then return "" end 236 | 237 | local str = string.rep(" ",indent).."# "..tostring(cnt).." R used: " 238 | for i,v in ipairs(out) do 239 | str = str..tostring(v)..((i==cnt) and "" or ", ") 240 | end 241 | return str.."\n" 242 | end 243 | 244 | -- check declarations 245 | local lastline = "" 246 | local addinstr = false 247 | for w in string.gmatch(tx, "[^\n]*\n") do 248 | if (not checkregistry(w)) then 249 | 250 | if (not w:match("%s*#")) then 251 | instructions = instructions + 1 252 | end 253 | 254 | if (check(w,isbranch)) then 255 | branches = branches + 1 256 | end 257 | 258 | if (check(w,endindent)) then 259 | newtx = newtx..outputregisters(indent) 260 | if (indent == 0) then clearregisters(indent) end 261 | indent = math.max(0,indent - 1) 262 | end 263 | 264 | local firstchar = string.sub(w,1,1) 265 | local indentstr = (firstchar ~= " " and firstchar ~= "\t" and string.rep(" ",indent) or "") 266 | local linestr = indentstr..w 267 | local argcomment = (firstchar ~= "#") and checkargs(w) 268 | 269 | checkregisters(w,indent) 270 | 271 | newtx = newtx..(argcomment and (indentstr..argcomment.."\n") or "") 272 | newtx = newtx..linestr 273 | 274 | if (check(w,startindent)) then 275 | indent = indent + 1 276 | maxindent = math.max(maxindent,indent) 277 | clearregisters(indent) 278 | end 279 | else 280 | newtx = newtx..w 281 | end 282 | lastline = w 283 | end 284 | 285 | local registers = tonumber(string.match(lastline, "(%d+) R%-regs")) or registers 286 | registermem = registermem or 0 287 | registercc = registercc or 0 288 | local stats = "# "..instructions.." ~ instructions\n" 289 | stats = stats.."# "..branches.." ~ branches\n" 290 | stats = stats.."# "..registers.." R-regs\n" 291 | stats = stats.."# "..tostring(registercc).." C-regs, "..tostring(registermem).." L-regs\n" 292 | stats = stats.."# "..tostring(registercc + registermem + registers).." maximum registers\n" 293 | stats = stats.."# "..maxindent.." maximum nesting level\n" 294 | newtx = newtx..stats.."\n" 295 | 296 | return newtx,stats 297 | end 298 | local function beautifyAsm(tx) 299 | local newtx = "" 300 | local stats 301 | for t in tx:gmatch("!!.-END[^%w]%s*") do 302 | local nt 303 | nt,stats = beautifyAsmEach(t) 304 | newtx = newtx..nt 305 | end 306 | return newtx,stats 307 | end 308 | 309 | local function beautifyAsmFile(filePath) 310 | local file_text = "" 311 | local statlines = "" 312 | local handle = io.open(filePath, "rb") 313 | if handle then 314 | file_text = handle:read("*a") 315 | file_text,statlines = beautifyAsm(file_text) 316 | handle:close() 317 | end 318 | 319 | if (file_text == "") then return end 320 | 321 | local handle = io.open(filePath, "wb") 322 | if handle then 323 | handle:write(file_text) 324 | handle:close() 325 | end 326 | return statlines 327 | end 328 | 329 | -- Compile Arg 330 | frame:Connect(ID "glslc.compile.input",wx.wxEVT_COMMAND_MENU_SELECTED, 331 | function(event) 332 | data.customarg = event:IsChecked() 333 | end) 334 | 335 | frame:Connect(ID "glslc.compile.separable",wx.wxEVT_COMMAND_MENU_SELECTED, 336 | function(event) 337 | data.separable = event:IsChecked() 338 | end) 339 | 340 | frame:Connect(ID "glslc.compile.preproc",wx.wxEVT_COMMAND_MENU_SELECTED, 341 | function(event) 342 | data.preproc = event:IsChecked() 343 | end) 344 | 345 | -- Compile 346 | local function evCompile(event) 347 | local filename,info = getEditorFileAndCurInfo() 348 | local editor = ide:GetEditor() 349 | local glsl = true 350 | 351 | if (not (filename and binpath)) then 352 | DisplayOutput("Error: GLSL Compile: Insufficient parameters (nofile)\n") 353 | return 354 | end 355 | 356 | local function getDomain(filename) 357 | local fname = filename:GetFullName() 358 | if (fname:match("%.v")) then 359 | domain = 1 360 | elseif (fname:match("%.f")) then 361 | domain = 2 362 | elseif (fname:match("%.ge")) then 363 | domain = 3 364 | elseif (fname:match("%.t.*c")) then 365 | domain = 4 366 | elseif (fname:match("%.t.*e")) then 367 | domain = 5 368 | elseif (fname:match("%.c")) then 369 | domain = 6 370 | end 371 | if (not domain) then 372 | DisplayOutput("Error: GLSL Compile: could not derive domain\n") 373 | end 374 | return domain 375 | end 376 | 377 | local function getCompileArg(filename,domain) 378 | local str = "" 379 | if (data.preproc) then 380 | str = '-P "'..filename:GetPath(wx.wxPATH_GET_VOLUME + wx.wxPATH_GET_SEPARATOR).."_"..filename:GetFullName()..'" ' 381 | end 382 | return str.."-profile "..data.domainprofiles[domain]..' "'..filename:GetFullPath()..'" ' 383 | end 384 | 385 | 386 | local outname 387 | local outsuffix 388 | local compileargs 389 | local getinstructions 390 | 391 | if (event:GetId() == ID "glslc.compile.all") then 392 | -- look for multiple files to link 393 | local basename = filename:GetFullName():match(".-%.") 394 | 395 | outname = filename:GetPathWithSep()..basename 396 | 397 | local cnt,files = wx.wxDir.GetAllFiles(filename:GetPathWithSep(), basename.."*" ) 398 | compileargs = "" 399 | for i,v in ipairs(files) do 400 | local filename = wx.wxFileName(v) 401 | if (filename:GetExt() ~= "glp" and 402 | filename:GetExt() ~= "bak") 403 | then 404 | local domain = getDomain(filename) 405 | if (not domain) then 406 | return 407 | end 408 | compileargs = compileargs..getCompileArg(filename,domain) 409 | end 410 | end 411 | 412 | else 413 | -- compile single file 414 | getinstructions = true 415 | 416 | local domain = data.domains[event:GetId()] 417 | if (not domain) then 418 | domain = getDomain(filename) 419 | end 420 | if (not domain) then 421 | return 422 | end 423 | 424 | local profile = data.domainprofiles[domain] 425 | local fullname = filename:GetFullPath() 426 | 427 | outname = fullname.."." 428 | outsuffix = profile 429 | compileargs = data.domaindefs[domain].." "..getCompileArg(filename,domain) 430 | end 431 | 432 | -- popup for custom input 433 | data.custom = data.customarg and wx.wxGetTextFromUser("Compiler Args","GLSLC",data.custom) or data.custom 434 | local args = data.customarg and data.custom or "" 435 | args = args:len() > 0 and args or nil 436 | 437 | outname = outname..(args and "^"..args:gsub("%s*[%-%/]",";-")..";^" or "") 438 | outname = outname..(outsuffix or "") 439 | outname = outname..((outsuffix or args) and "." or "").."glp" 440 | outname = '"'..outname..'"' 441 | 442 | local cmdline = binpath.."/glslc.exe " 443 | cmdline = cmdline..(args and args.." " or "") 444 | cmdline = cmdline..(data.preproc and "-E " or "") 445 | cmdline = cmdline..(data.separable and "-separable " or "") 446 | cmdline = cmdline.."-o "..outname.." " 447 | cmdline = cmdline..compileargs 448 | 449 | local function compilecallback(str) 450 | local postfunc 451 | -- check for errors, if none, launch nvperf 452 | -- and indentation 453 | if (string.find(str,"successfully linked")) then 454 | postfunc = function() 455 | -- beautify asm 456 | if (true) then 457 | local statlines = beautifyAsmFile(outname:sub(2,-2)) 458 | if (getinstructions) then 459 | DisplayOutput(statlines) 460 | end 461 | end 462 | end 463 | end 464 | 465 | return str,postfunc 466 | end 467 | 468 | local wdir = filename:GetPath(wx.wxPATH_GET_VOLUME) 469 | 470 | -- run compiler process 471 | CommandLineRun(cmdline,wdir,true,nil,compilecallback) 472 | 473 | end 474 | 475 | frame:Connect(ID "glslc.compile.vertex",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 476 | frame:Connect(ID "glslc.compile.fragment",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 477 | frame:Connect(ID "glslc.compile.geometry",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 478 | frame:Connect(ID "glslc.compile.tessctrl",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 479 | frame:Connect(ID "glslc.compile.tesseval",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 480 | frame:Connect(ID "glslc.compile.compute",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 481 | frame:Connect(ID "glslc.compile.ext",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 482 | frame:Connect(ID "glslc.compile.all",wx.wxEVT_COMMAND_MENU_SELECTED,evCompile) 483 | 484 | -- indent asm 485 | frame:Connect(ID "glslc.format.asm", wx.wxEVT_COMMAND_MENU_SELECTED, 486 | function(event) 487 | local curedit = ide:GetEditor() 488 | local newtx = beautifyAsm( curedit:GetText() ) 489 | 490 | curedit:SetText(newtx) 491 | end) 492 | end, 493 | } 494 | -------------------------------------------------------------------------------- /graphicscodepack/tools/perforce_edit.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | return { 5 | exec = { 6 | name = "Perforce edit", 7 | description = "does p4 edit", 8 | fn = function(fname,projectdir) 9 | local cmd = 'p4 edit "'..fname..'"' 10 | 11 | CommandLineRun(cmd,nil,true) 12 | end, 13 | }, 14 | } 15 | -------------------------------------------------------------------------------- /graphicscodepack/tools/perforce_revert.lua: -------------------------------------------------------------------------------- 1 | -- Copyright (C) 2008-2017 Christoph Kubisch. All rights reserved. 2 | --------------------------------------------------------- 3 | 4 | return { 5 | exec = { 6 | name = "Perforce revert", 7 | description = "does p4 revert", 8 | fn = function(fname,projectdir) 9 | local cmd = 'p4 revert "'..fname..'"' 10 | 11 | CommandLineRun(cmd,nil,true) 12 | end, 13 | }, 14 | } 15 | --------------------------------------------------------------------------------