Path: blob/main/extensions/hlsl/syntaxes/hlsl.tmLanguage.json
3291 views
{1"information_for_contributors": [2"This file has been converted from https://github.com/tgjones/shaders-tmLanguage/blob/master/grammars/hlsl.json",3"If you want to provide a fix or improvement, please create a pull request against the original repository.",4"Once accepted there, we are happy to receive an update request."5],6"version": "https://github.com/tgjones/shaders-tmLanguage/commit/87c0dca3a39170dbd7ee7e277db4f915fb2de14a",7"name": "HLSL",8"scopeName": "source.hlsl",9"patterns": [10{11"name": "comment.line.block.hlsl",12"begin": "/\\*",13"end": "\\*/"14},15{16"name": "comment.line.double-slash.hlsl",17"begin": "//",18"end": "$"19},20{21"name": "constant.numeric.decimal.hlsl",22"match": "\\b[0-9]+\\.[0-9]*(F|f)?\\b"23},24{25"name": "constant.numeric.decimal.hlsl",26"match": "(\\.([0-9]+)(F|f)?)\\b"27},28{29"name": "constant.numeric.decimal.hlsl",30"match": "\\b([0-9]+(F|f)?)\\b"31},32{33"name": "constant.numeric.hex.hlsl",34"match": "\\b(0(x|X)[0-9a-fA-F]+)\\b"35},36{37"name": "constant.language.hlsl",38"match": "\\b(false|true)\\b"39},40{41"name": "keyword.preprocessor.hlsl",42"match": "^\\s*#\\s*(define|elif|else|endif|ifdef|ifndef|if|undef|include|line|error|pragma)"43},44{45"name": "keyword.control.hlsl",46"match": "\\b(break|case|continue|default|discard|do|else|for|if|return|switch|while)\\b"47},48{49"name": "keyword.control.fx.hlsl",50"match": "\\b(compile)\\b"51},52{53"name": "keyword.typealias.hlsl",54"match": "\\b(typedef)\\b"55},56{57"name": "storage.type.basic.hlsl",58"match": "\\b(bool([1-4](x[1-4])?)?|double([1-4](x[1-4])?)?|dword|float([1-4](x[1-4])?)?|half([1-4](x[1-4])?)?|int([1-4](x[1-4])?)?|matrix|min10float([1-4](x[1-4])?)?|min12int([1-4](x[1-4])?)?|min16float([1-4](x[1-4])?)?|min16int([1-4](x[1-4])?)?|min16uint([1-4](x[1-4])?)?|unsigned|uint([1-4](x[1-4])?)?|vector|void)\\b"59},60{61"name": "support.function.hlsl",62"match": "\\b([a-zA-Z_][a-zA-Z0-9_]*)(?=[\\s]*\\()"63},64{65"name": "support.variable.semantic.hlsl",66"match": "(?<=\\:\\s|\\:)(?i:BINORMAL[0-9]*|BLENDINDICES[0-9]*|BLENDWEIGHT[0-9]*|COLOR[0-9]*|NORMAL[0-9]*|POSITIONT|POSITION|PSIZE[0-9]*|TANGENT[0-9]*|TEXCOORD[0-9]*|FOG|TESSFACTOR[0-9]*|VFACE|VPOS|DEPTH[0-9]*)\\b"67},68{69"name": "support.variable.semantic.sm4.hlsl",70"match": "(?<=\\:\\s|\\:)(?i:SV_ClipDistance[0-9]*|SV_CullDistance[0-9]*|SV_Coverage|SV_Depth|SV_DepthGreaterEqual[0-9]*|SV_DepthLessEqual[0-9]*|SV_InstanceID|SV_IsFrontFace|SV_Position|SV_RenderTargetArrayIndex|SV_SampleIndex|SV_StencilRef|SV_Target[0-7]?|SV_VertexID|SV_ViewportArrayIndex)\\b"71},72{73"name": "support.variable.semantic.sm5.hlsl",74"match": "(?<=\\:\\s|\\:)(?i:SV_DispatchThreadID|SV_DomainLocation|SV_GroupID|SV_GroupIndex|SV_GroupThreadID|SV_GSInstanceID|SV_InsideTessFactor|SV_OutputControlPointID|SV_TessFactor)\\b"75},76{77"name": "support.variable.semantic.sm5_1.hlsl",78"match": "(?<=\\:\\s|\\:)(?i:SV_InnerCoverage|SV_StencilRef)\\b"79},80{81"name": "storage.modifier.hlsl",82"match": "\\b(column_major|const|export|extern|globallycoherent|groupshared|inline|inout|in|out|precise|row_major|shared|static|uniform|volatile)\\b"83},84{85"name": "storage.modifier.float.hlsl",86"match": "\\b(snorm|unorm)\\b"87},88{89"name": "storage.modifier.postfix.hlsl",90"match": "\\b(packoffset|register)\\b"91},92{93"name": "storage.modifier.interpolation.hlsl",94"match": "\\b(centroid|linear|nointerpolation|noperspective|sample)\\b"95},96{97"name": "storage.modifier.geometryshader.hlsl",98"match": "\\b(lineadj|line|point|triangle|triangleadj)\\b"99},100{101"name": "support.type.other.hlsl",102"match": "\\b(string)\\b"103},104{105"name": "support.type.object.hlsl",106"match": "\\b(AppendStructuredBuffer|Buffer|ByteAddressBuffer|ConstantBuffer|ConsumeStructuredBuffer|InputPatch|OutputPatch)\\b"107},108{109"name": "support.type.object.rasterizerordered.hlsl",110"match": "\\b(RasterizerOrderedBuffer|RasterizerOrderedByteAddressBuffer|RasterizerOrderedStructuredBuffer|RasterizerOrderedTexture1D|RasterizerOrderedTexture1DArray|RasterizerOrderedTexture2D|RasterizerOrderedTexture2DArray|RasterizerOrderedTexture3D)\\b"111},112{113"name": "support.type.object.rw.hlsl",114"match": "\\b(RWBuffer|RWByteAddressBuffer|RWStructuredBuffer|RWTexture1D|RWTexture1DArray|RWTexture2D|RWTexture2DArray|RWTexture3D)\\b"115},116{117"name": "support.type.object.geometryshader.hlsl",118"match": "\\b(LineStream|PointStream|TriangleStream)\\b"119},120{121"name": "support.type.sampler.legacy.hlsl",122"match": "\\b(sampler|sampler1D|sampler2D|sampler3D|samplerCUBE|sampler_state)\\b"123},124{125"name": "support.type.sampler.hlsl",126"match": "\\b(SamplerState|SamplerComparisonState)\\b"127},128{129"name": "support.type.texture.legacy.hlsl",130"match": "\\b(texture2D|textureCUBE)\\b"131},132{133"name": "support.type.texture.hlsl",134"match": "\\b(Texture1D|Texture1DArray|Texture2D|Texture2DArray|Texture2DMS|Texture2DMSArray|Texture3D|TextureCube|TextureCubeArray)\\b"135},136{137"name": "storage.type.structured.hlsl",138"match": "\\b(cbuffer|class|interface|namespace|struct|tbuffer)\\b"139},140{141"name": "support.constant.property-value.fx.hlsl",142"match": "\\b(FALSE|TRUE|NULL)\\b"143},144{145"name": "support.type.fx.hlsl",146"match": "\\b(BlendState|DepthStencilState|RasterizerState)\\b"147},148{149"name": "storage.type.fx.technique.hlsl",150"match": "\\b(technique|Technique|technique10|technique11|pass)\\b"151},152{153"name": "meta.object-literal.key.fx.blendstate.hlsl",154"match": "\\b(AlphaToCoverageEnable|BlendEnable|SrcBlend|DestBlend|BlendOp|SrcBlendAlpha|DestBlendAlpha|BlendOpAlpha|RenderTargetWriteMask)\\b"155},156{157"name": "meta.object-literal.key.fx.depthstencilstate.hlsl",158"match": "\\b(DepthEnable|DepthWriteMask|DepthFunc|StencilEnable|StencilReadMask|StencilWriteMask|FrontFaceStencilFail|FrontFaceStencilZFail|FrontFaceStencilPass|FrontFaceStencilFunc|BackFaceStencilFail|BackFaceStencilZFail|BackFaceStencilPass|BackFaceStencilFunc)\\b"159},160{161"name": "meta.object-literal.key.fx.rasterizerstate.hlsl",162"match": "\\b(FillMode|CullMode|FrontCounterClockwise|DepthBias|DepthBiasClamp|SlopeScaleDepthBias|ZClipEnable|ScissorEnable|MultiSampleEnable|AntiAliasedLineEnable)\\b"163},164{165"name": "meta.object-literal.key.fx.samplerstate.hlsl",166"match": "\\b(Filter|AddressU|AddressV|AddressW|MipLODBias|MaxAnisotropy|ComparisonFunc|BorderColor|MinLOD|MaxLOD)\\b"167},168{169"name": "support.constant.property-value.fx.blend.hlsl",170"match": "\\b(?i:ZERO|ONE|SRC_COLOR|INV_SRC_COLOR|SRC_ALPHA|INV_SRC_ALPHA|DEST_ALPHA|INV_DEST_ALPHA|DEST_COLOR|INV_DEST_COLOR|SRC_ALPHA_SAT|BLEND_FACTOR|INV_BLEND_FACTOR|SRC1_COLOR|INV_SRC1_COLOR|SRC1_ALPHA|INV_SRC1_ALPHA)\\b"171},172{173"name": "support.constant.property-value.fx.blendop.hlsl",174"match": "\\b(?i:ADD|SUBTRACT|REV_SUBTRACT|MIN|MAX)\\b"175},176{177"name": "support.constant.property-value.fx.depthwritemask.hlsl",178"match": "\\b(?i:ALL)\\b"179},180{181"name": "support.constant.property-value.fx.comparisonfunc.hlsl",182"match": "\\b(?i:NEVER|LESS|EQUAL|LESS_EQUAL|GREATER|NOT_EQUAL|GREATER_EQUAL|ALWAYS)\\b"183},184{185"name": "support.constant.property-value.fx.stencilop.hlsl",186"match": "\\b(?i:KEEP|REPLACE|INCR_SAT|DECR_SAT|INVERT|INCR|DECR)\\b"187},188{189"name": "support.constant.property-value.fx.fillmode.hlsl",190"match": "\\b(?i:WIREFRAME|SOLID)\\b"191},192{193"name": "support.constant.property-value.fx.cullmode.hlsl",194"match": "\\b(?i:NONE|FRONT|BACK)\\b"195},196{197"name": "support.constant.property-value.fx.filter.hlsl",198"match": "\\b(?i:MIN_MAG_MIP_POINT|MIN_MAG_POINT_MIP_LINEAR|MIN_POINT_MAG_LINEAR_MIP_POINT|MIN_POINT_MAG_MIP_LINEAR|MIN_LINEAR_MAG_MIP_POINT|MIN_LINEAR_MAG_POINT_MIP_LINEAR|MIN_MAG_LINEAR_MIP_POINT|MIN_MAG_MIP_LINEAR|ANISOTROPIC|COMPARISON_MIN_MAG_MIP_POINT|COMPARISON_MIN_MAG_POINT_MIP_LINEAR|COMPARISON_MIN_POINT_MAG_LINEAR_MIP_POINT|COMPARISON_MIN_POINT_MAG_MIP_LINEAR|COMPARISON_MIN_LINEAR_MAG_MIP_POINT|COMPARISON_MIN_LINEAR_MAG_POINT_MIP_LINEAR|COMPARISON_MIN_MAG_LINEAR_MIP_POINT|COMPARISON_MIN_MAG_MIP_LINEAR|COMPARISON_ANISOTROPIC|TEXT_1BIT)\\b"199},200{201"name": "support.constant.property-value.fx.textureaddressmode.hlsl",202"match": "\\b(?i:WRAP|MIRROR|CLAMP|BORDER|MIRROR_ONCE)\\b"203},204{205"name": "string.quoted.double.hlsl",206"begin": "\"",207"end": "\"",208"patterns": [209{210"name": "constant.character.escape.hlsl",211"match": "\\\\."212}213]214}215]216}217218