Code-X Processor
The Code-X Processor tool is contained in the Tinman 3D SDK as the codex
component.
It analyzes the C# source code of Code-X compliant libraries and then generates source code for other programming languages, for example C++, HLSL or GLSL.
For details on this workflow, please refer to Code-X Framework. |
The following sections explain the command line and project file syntax that are required to run a Code-X workflow.
Command Line
To perform a Code-X workflow, run the codex
tool and point it to a Code-X Project File.
The codex tool requires a Development licence key, which must be specified with an environment variable:TINMAN_3D_LICENCEKEY= ...
|
codex
tool> codex <task> (1)
1 | The command-line task to perform. |
!task := api | check | process | generate | run ; (1) api := 'api' ; check := 'check' project-file ; generate := 'generate' targets? project-file ; process := 'process' project-file ; run := 'run' targets? project-file ; !project-file := ws path ; (2) !language := @'cs' | @'cpp' | @'java' | @'hlsl' | @'glsl' ; (3) language-list := language .. ',' ; targets := '[' language-list ']' (4) | ']' language-list '[' ; (5) ws := [\t ]+ ;
1 | Chooses the task to perform: api , check , process , generate or run |
2 | Chooses the Code-X Project File, as an absolute or relative file path. |
3 | Specifies a single target programming language. |
4 | Selects only the specified target programming languages. |
5 | Selects all target programming languages except the specified ones. |
Status messages that are intended for human consumption are output to the standard output stream in an unspecified format and may be discarded without loosing any relevant information about the Code-X workflow.
Errors, warnings and hints regarding the Code-X workflow are output to the standard error stream in a well-defined format and are supposed to be consumed by human beings or machines, see Message Format.
The process exit codes may be used when integrating a Code-X workflow invocation into a build pipeline.
Code | Meaning |
---|---|
0 |
The Code-X workflow has completed successfully. No syntax errors have been reported. No semantic problems have been reported. No semantic hints have been reported. |
1 |
The Code-X workflow has completed successfully. No syntax errors have been reported. No semantic problems have been reported. At least one semantic hint has been generated. |
2 |
The Code-X workflow has completed successfully. No syntax errors have been reported. No semantic errors have been reported. At least one semantic warning has been generated. |
3 |
The Code-X workflow has failed with errors. At least one syntax error or semantic error has been generated. |
-1 |
The Code-X workflow did not run. The command-line arguments are incorrect or the licence key is missing. |
-2 |
The Code-X workflow has crashed. An unexpected internal error has occurred and status messages have been output to provide additional information. |
api
This task scans the current directory for *.psi
and *.api
files and outputs the <project-id/>
values for each one to the standard output stream.
Use this task to gather the information that is required for adding <external/>
and <dependency/>
elements to the Code-X Project File.
check
> codex check my-project.xml
This task parses the Code-X compliant input source code files and collects the native code blocks (see CxStatementCode and CodeX::NativeAttribute
) of each target programming language, by scanning the output source code files.
If there are syntax errors, the task reports them and then terminates.
If there are no syntax errors, the task inspects the parsed input source code files and the collected native code blocks. If there are semantic problems, the task reports them and then terminates.
This task does not modify the filesystem. |
process
> codex process my-project.xml
This task first runs check
and terminates if there are any errors or problems.
Upon success, it writes the .psi
and .api
files for each project.
The .psi
files contain the full code model as well as the content of all native code regions.
The .api
files only contain those parts of the full code model which are required for use as external libraries.
This task modifies the filesystem. |
generate
> codex generate @ cpp my-project.xml
This task uses the .psi
files of each project and thus requires that process
has been run before.
It generates the output source code for the chosen target programming languages.
This task modifies the filesystem. |
MSBuild
The Code-X processor can be invoked from the Microsoft Build Engine (MSBuild).
Although MSBuild can run arbitrary command-line tools (and thus the codex
tool), using a build task eases setup and provides better feedback for errors, warnings and notices, with out-of-the box integration in IDEs.
The codex task requires a Development licence key, which must be specified with an environment variable:TINMAN_3D_LICENCEKEY= ...
|
To add the Code-X processor to a project, insert a <UsingTask/>
element to the project file, which will register the processor task with the build engine.
<UsingTask
TaskName="CodeX.Processor.Task"
AssemblyFile="codex-task.dll"/> (1)
1 | Path to the processor task binary, see lib/win.any/ or Preview (Web) / Tools. |
Once the processor task has been registered, build targets may be defined by adding <Target/>
elements to the project file.
<Target
Name="MyTaskName" BeforeTargets="Build"> (1)
<CodeX.Processor.Task
Arguments="check codex.xml"
Directory="$(ProjectDir)"
FailOnErrors="true"
FailOnNotices="false"
FailOnWarnings="false"/>
</Target>
1 | Choose these according to your build pipeline. |
The processor task properties are described by the subsequent sections.
Arguments
- Default Value
-
"check codex.xml"
The command-line arguments for the Code-X processor, see Command Line.
If not specified, runs check
on the default project file.
Directory
- Default Value
-
"$(ProjectDir)"
The base directory to use for resolving relative paths that are present in Arguments
.
If not specified, the directory of the project file that has called this task is used.
Message Format
The Code-X workflow outputs messages in a well-defined format, as described by the subsequent sections.
Syntax Errors
A syntax error indicates that an input source file does match the grammar for Code-X code units (see CxCodeUnit).
All errors must be fixed before the Code-X workflow can succeed.
Syntax errors may be generated for valid C# code, because not all C# language features are supported by Code-X. |
['project.codex\CodeX.Examples.CodeX\Constants.cs'] (1) 45: public const int SomeNumber = 1x0; (2) ___________________________________/\__ (3) [Syntax] Mismatch in rule constant, expected this: ';' (4) [Syntax] Mismatch in rule expr-add, expected this: [ +- ] | '\n' | ... [Syntax] Mismatch in rule expr-assign, expected this: [ = ] | '%=' | ... [Syntax] Mismatch in rule expr-cond, expected this: [ ? ] | '\n' | ... [Syntax] Mismatch in rule expr-cond-and, expected this: ' ' | '&&' | ... [Syntax] Mismatch in rule expr-cond-or, expected this: ' ' | '\n' | ... [Syntax] Mismatch in rule expr-equal, expected this: ' ' | '!=' | ... [Syntax] Mismatch in rule expr-logic-and, expected this: [ & ] | '\n' | ... [Syntax] Mismatch in rule expr-logic-or, expected this: [ | ] | '\n' | ... [Syntax] Mismatch in rule expr-logic-xor, expected this: [ ^ ] | '\n' | ... [Syntax] Mismatch in rule expr-mul, expected this: [ %*/ ] | '//' | ... [Syntax] Mismatch in rule expr-relate, expected this: [ <> ] | '<=' | ... [Syntax] Mismatch in rule expr-shift, expected this: ' ' | '<<' | '>>' | ... [Syntax] Mismatch in rule expr-suffix, expected this: [ (. ] | '++' | ... [Syntax] Mismatch in rule literal-number, expected this: '.' | '0'..'9' | ...
1 | Path to the source code file, relative to $(BaseDir) |
2 | The source code line, including the line number |
3 | Visual indicator of the syntax error column |
4 | The grammar rules that were matching the preceding input |
Semantic Problems
A semantic problem is a critical error, a non-critical error or a warning, in terms of the Code-X Framework.
All errors must be fixed before the Code-X workflow can succeed.
All warnings should be fixed.
The workflow will fail on warnings.
By configuring <ignore/>
elements in the Code-X Project File, specific warnings can be ignored.
[Critical] ConstantDeclaration.MemberType has incomplete / unresolved value! (1) ['project.codex\CodeX.Examples.CodeX\Constants.cs'] (2) ::CodeX.Examples/Constants/SomeString (3) ---- (4) /// <summary> /// Summary /// </summary> public const string2 SomeString = "Hallo"; ---- [Critical] NamedType has incomplete / unresolved value! ::CodeX.Examples/Constants/SomeString string2 (3)
1 | The severity (Critical, Error, Warning or Notice), followed by the message. Will be omitted iff it is identical to the part of the previous message. |
2 | Path to the source code file, relative to $(BaseDir) |
3 | A name path that identifies the code element, in the form ::Namespace/Type/Member/Parameter .
Will be omitted iff it is identical to the part of the previous message. |
4 | The source code fragment, will be surrounded by ---- , if multi-line. |
Semantic Hints
A semantic hint is a notice, in terms of the Code-X Framework.
The format of semantic hints is identical to the format of Semantic Problems.
By configuring <ignore/>
elements in the Code-X Project File, specific hints can be silenced.
After adding native code blocks to the input source code, there will be hints stating that code blocks in the output source code are incomplete. Running the Code-X workflow in such a case will create the missing code blocks. The hints will disappear once theses blocks have been filled with code. |
Code-X Project File
Regular XML files are used to define Code-X workflows. File paths need to be specified at various places in a project file. This documentation uses the following placeholders to refer to common directories:
$(ProjectFile)
-
This is the absolute path to the Code-X project file.
$(BaseDir)
-
The base directory of the Code-X workflow, defined by
base
of<codex/>
. $(ProjectDir)
-
The base directory of a project, defined by
base
of<project/>
. $(OutputDir)
-
The output directory for generated source code of a
<module/>
for a specific<target/>
.
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE codex PUBLIC "-//TINMAN//CODEX//EN"
"https://dtd.tinman3d.com/Code-X.1.dtd"> (1)
<codex format="1"> (2)
...
</codex>
1 | The Document Type Definition for validation, which also chooses the Code-X project file format version. |
2 | See <codex/> element. |
The following sections contain a documentation block for each XML element, of this style:
The Parent section links to the possible XML parent elements, Children lists the allowed child XML elements and Attributes shows the attributes of the XML element. For each attribute, there is a separate documentation section.
<codex/>
This is the root XML element of a Code-X Project File document.
<dictionary/>
Defines the dictionary that will be used for spell-checking when analyzing source code comments.
<filter/>
Defines a filter for file paths or fully qualified type names.
For input files of a <project/>
, the <filter/>
attributes operate on relative file paths, based on $(ProjectDir)
.
Directory separators are normalized, so /
and \
may be used interchangeably.
Relative/Path/To/Input.cs
For input types of a <module/>
and <target/>
, the <filter/>
attributes operate on the fully-qualified C# type name, not including the global::
prefix and omitting any generic type suffixes.
CodeX.Examples.HelloWorld
Input files and types are processed in the following sequence:
-
<project/>
Matching input files are parsed, which yields project input types. -
<module/>
Matching project input types are collected as module input types. -
<target/>
Matching module input types are collected as target input types.
<global/>
The elements in the global section define properties for the whole workspace. Some properties may be overridden by elements at lower levels.
<ignore/>
Defines filters for ignoring non-critical Semantic Problems and Semantic Hints.
Ignored inspection messages a dropped silently, the processor will behave as if the message had not been generated in the first place.
The <ignore/>
filter will match if all of the following conditions are true:
The message-op
and node-op
attributes depict the matching operator and may be one of the following:
message
Chooses the message text of an inspection message as the match token (i.e. the first line of text, excluding the tag for the inspection severity).
If empty, all inspection messages will be matched, regardless of message-op
.
node
Chooses the name path of the code element of an inspection message as the match token (i.e. the second line of text).
If empty, all inspection messages will be matched, regardless of node-op
.
<input/>
Specifies the files / types that will be used as input for the Code-X workflow.
The <exclude/>
filters are applied before the <include/>
filters, which means that exclusions have higher precedence as inclusions when they have the same priority
.
If the <input/>
element is not present, all input files / types will be used, as if <input default="Include"/>
had been specified.
<module/>
Defines a module within a <project/>
.
name
Specifies a human-readable name for the module.
This name is used in comments of the generated source code when referring to a module of a project and should thus be plausible.
output
Defines $(OutputDir)
as the concatenation (indicated by |
) of the following tokens:
$(ProjectDir)
| "/"
| output
|
full-source
? | path-suffix
| "/"
If a <module/>
is not obfuscated, the full-source
token will not be used.
For obfuscated modules, two output passes are performed: the first pass outputs the obfuscated source code and the second pass output the full (i.e. non-obfuscated) source code.
The full-source
token is used to generate a distinct $(OutputDir)
value for the second pass.
$(OutputDir)
Given these values:
$(ProjectDir)
= "/my-project"
output
= "MyModule"
full-source
= ".Full"
path-suffix
= ".Cpp"
Code for non-obfuscated modules and for the first pass of obfuscated modules is then output to:
$(OutputDir)
= "/my-project/MyModule.Cpp"
Code for the second pass of obfuscated modules is output to:
$(OutputDir)
= "/my-project/MyModule.Full.Cpp"
tag
Assigns a machine-readable tag to the module, which must be suitable for use as filesystem path element and as a programming language identifier.
type-prefix
Specifies a common type name prefix that depicts which types of are included in the module.
The <input/>
of <project/>
yields source code files, which are parsed into code units.
Each code unit contains a single type declaration, which has a fully-qualified name.
A code unit belongs to a module iff the fully-qualified type name of its declaration starts with type-prefix
.
header
Optional override for the header
attribute of the enclosing <project/>
.
<option/>
Defines a single option in a set of <options/>
.
<project/>
Defines a project for the Code-X workflow.
name
Specifies a human-readable name for the project.
This name is used in comments of the generated source code when referring to a project and should thus be plausible.
tag
Assigns a machine-readable tag to the project, which must be suitable for use in filesystem paths.
The tag does not need to be unique, multiple projects may share the same tag.
psi
Path to the .psi
file of this project, either absolute or relative to $(ProjectDir)
.
The .api
file of the project will be written into the same directory as the .psi
file.
base
If absolute, defines $(ProjectDir)
.
If relative, resolves against $(BaseDir)
and then defines $(ProjectDir)
.
If not specified, $(ProjectDir)
will be identical to $(BaseDir)
.
header
Path to an optional copyright text file in UTF-8 encoding, either absolute or relative to $(ProjectDir)
, which will be read and its content be written at the beginning of each generated output
source code file.
The file header must be plain text.
Depending on the <target/>
programming language, it will be wrapped in suitable source code comments.
Usually, these will be single-line comments.
Example file header with two text lines
// Example file header // with two text lines ...
The file header text may contain placeholders, which will be expanded, as described below.
Placeholder | Replacement | Values |
---|---|---|
|
|
|
<project-id/>
References a specific project and version.
guid
Defines a unique identifier for the project, in form of a GUID, for example A3252944-2D5D-4010-B0FE-D68DB002A19A
.
name
Optional human-readable name to use instead of guid
, for better readability.
This name does not have any impact on the Code-X workflow.
However, it should correlate with name
.
major
Defines the major version number of the project.
Each time the public API of a project (i.e. the contents of the .api
file) changes, the major version number must be incremented and the minor version number must be set to 0.
If not specified, the major version number will be 1.
minor
Defines the minor version number of the project.
Each time the implementation of a project (i.e. the contents of the .psi
file) changes but the public API remains unchanged (i.e. the contents of the .api
file), the minor version number must be incremented.
If not specified, the minor version number will be 0.
<target/>
Defines a target for code generation.
Native code blocks are collected and stored separately for each defined target language.
When using a single target for a programming language, native code blocks may need to do compile-time branching (e.g. pre-processor #ifdef
).
By using language tags, separate targets may be defined for the same programming language, which will allow the native code blocks to be separated, as well.
language
Depicts the programming language to generate.
Before generating code, the output directory is cleaned by deleting all files, except certain retained files.
May be one of the following:
- CPP
-
The C++ programming language version 11 for the Cpu-X Workflow.
Retained files:
-
CodeX_System*.h
-
CodeX_System*.cpp
-
*.Test.*
-
*.Native.*
-
stdafx.cpp
-
stdafx.h
-
*.natvis
-
- CS
-
The C# programming language version 7.3 for the Cpu-X Workflow.
Retained files:
-
AssemblyInfo.cs
-
SafeNativeMethods*.cs
-
- JAVA
-
The Java programming language version 11 for the Cpu-X Workflow.
Retained files:
-
none
-
- HLSL
-
The High-Level Shader Language for the Gpu-X Workflow.
Retained files:
-
none
-
- GLSL
-
The OpenGL Shading Language for the Gpu-X Workflow.
Retained files:
-
none
-
language-tag
Optional tag to use for discriminating this target against others with the same language
.
<word-list/>
Declares a word file that shall be used for spell-checking. Word files are simple text files in UTF-8 encoding, where each line of text defines a single word.
kind
Defines the usage of the word list. May be one of the following:
Abbreviation
-
Case-sensitive abbreviations that shall be ignored.
Example 2. Common abbreviationsJSON
WKT
XML Designation
-
Case-sensitive names and designations that shall be ignored.
Example 3. Common namesMercator
Euler
Lambert Dictionary
-
Case-insensitive words to use for spell-checking.
Example 4. Common dictionary wordshello
world Reserved
-
Reserved identifiers that shall be ignored.
Example 5. Common reserved identifiersstackalloc
readonly
Cpu-X Workflow
This section explains those Code-X Project File elements that belong to the Cpu-X workflow.
<dependency/>
Declares that the enclosing <project/>
depends on the project that is specified by this element.
The dependency may be an external library (see <external/>
) or another project (see <project/>
).
guid
The guid
of the referenced <project/>
.
name
Optional human-readable name to use instead of guid
, for better readability.
This name does not have any impact on the Code-X workflow.
However, it should correlate with name
.
major
The exact major
version number of the referenced <project/>
.
The major versions of the dependency and the referenced project must match exactly.
If not specified, the major version number will be 1.
minor
The minimum minor
version number of the referenced <project/>
.
The minor version of the dependency must be less than or equal to the minor version of the referenced <project/>
.
If not specified, the minor version number will be 0.
<external/>
Defines an external library, which is provided as a separate .psi
or .api
file.
path
The file path of the .psi
or .api
file which represents the external library.
If relative, resolves against $(BaseDir)
.
Since .api
files have a smaller file size, the Code-X workflow will finish more quickly.
Also, they will not expose any implementation details, as they contain only those parts of the code model which belong to the public API.
<options/>
This section lists the <options/>
that may be configured for the Cpu-X Workflow.
Option | Allowed in <module/> |
Allowed in <target/> |
Used by language |
---|---|---|---|
yes |
yes |
any |
|
yes |
yes |
any |
|
yes |
yes |
any |
|
yes |
yes |
any |
|
yes |
yes |
any |
|
yes |
no |
any |
|
yes |
yes |
CPP |
|
yes |
yes |
any |
|
yes |
yes |
CPP |
"BuggyCode"
This custom option enables ("yes"
) or disables ("no"
) output of buggy code.
Defaults to "no"
.
Buggy code is a defined as the modification of functional code:
-
The structural design remains unchanged (namespaces, types and members).
-
The program flow (i.e. statements) remains unchanged.
-
Near-terminal expressions are modified in order to yield non-functional code.
The modifications should be hardly noticeable, so that a reviewer can still make statements about the code quality and structure. Furthermore, the modifications must not cause compiler errors and should not cause additional compiler warnings. This way, a developer can set up a full integration using the buggy code. After shaking off all integration issues, the developer can swap in the functional code.
"Encoding"
Name of the output encoding to use, may be one of the following:
-
"US-ASCII"
-
"ISO-8859-1"
-
"UTF-8"
-
"UTF-16BE"
-
"UTF-16LE"
Specifying a name that does not match any of the above ones (case-insensitively), the fallback "US-ASCII"
will be used.
If the encoding has a preamble (for example BOM for Unicode), it will be used when writing generated files.
Defaults to "UTF-8"
.
"IndentCount"
Specified the width of a single indentation level, measured in indentation characters.
Defaults to 2.
"IndentWidth"
Specified the width of a single indentation level, measured in text columns.
Defaults to 2.
"NamingStyle"
Specifies the naming style to use.
May be one of the following values, as indicated by the sub-section captions.
"Default"
This is the default naming style for language
CPP and CS.
-
"UpperMixedCase"
for type declarations-
with
"I…"
prefix for interface declarations
-
-
"UpperMixedCase"
for public members -
"lowerMixedCase"
for non-public members
"Hungarian"
Based on "Default"
, adding name prefixes for type declarations and their members.
Name prefixes for type declarations:
-
"C…"
for classes -
"S…"
for structures -
"E…"
for enumerations
Name prefixes for members have two parts:
-
"m_"
for instance members -
"s_"
for static members
The second prefix part depends on the member type:
"NoExport"
This options disables ("yes"
) or enables ("no"
) export of symbols for dynamic linking.
Defaults to "no"
.
"Obfuscate"
This options enables ("yes"
) or disables ("no"
) obfuscation of non-public code.
If specified by <module/>
, obfuscation will be configured accordingly.
Otherwise, if specified by <target/>
, obfuscation will be configured accordingly.
Otherwise, obfuscation will be disabled.
When obfuscation is enabled, all code elements that are neither public nor protected will / be obfuscated in the following manner:
-
They will be renamed to
X_
, whereX
is a randomly chosen identifier. -
All code comments are removed.
-
All non-significant whitespaces are removed.
Obfuscation will not be performed for local variables with identifiers that end with
_keep
.
Code elements annotated with [Keep]
will also not be obfuscated.
Gpu-X Workflow
This section explains those Code-X Project File elements that belong to the Gpu-X workflow.
The Gpu-X workflow generates content in the $(OutputDir)
according to the following descriptions.
$(OutputDir)/glsl/
$(OutputDir)/hlsl/
-
Output for the GLSL / HLSL target
language
is generated in this subdirectory. $(OutputDir)/glsl/GpuX.glsl
$(OutputDir)/hlsl/GpuX.hlsl
-
Gpu-X framework file for GLSL / HLSL
$(OutputDir)/glsl/{module}/**/*.glsl
$(OutputDir)/hlsl/{module}/**/*.hlsl
-
The shared GLSL / HLSL source code for each
<module/>
is output into this directory, where{module}
is the moduletag
. $(OutputDir)/glsl.{api}/{module}/*.glsl
$(OutputDir)/hlsl.{api}/{module}/*.hlsl
-
This is the output for shader entry points for a specific API target, where
{api}
is a token that has been defined by"APIs"
and{module}
stands for the moduletag
.
For the HLSL target language
, additional content is generated.
{build}/**/*.asm
{build}/**/*.cso
-
These files are treated as build output files and can optionally be cleaned via
"Output.Clean"
. The{build}
path is"Output.Build"
, resolved against$(ProjectDir)
, if relative. {ide}/{api}/{api}.vcxproj
{ide}/{api}/{api}.vcxproj.filters
-
Visual Studio project files for compiling the HLSL source code are generated in these locations, where
{ide}
is the"Output.IDE"
path (resolved against$(ProjectDir)
, if relative) and{api}
is a token from"APIs"
.
The HLSL project files for Visual Studio are generated based on a template which has the following structure.
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="...">
<Import Project="[NuGet]\Microsoft.Direct3D.DXC.[Version]\..."
Condition="..."/> (1)
...
<PropertyGroup>
<ProjectGuid>{[Guid]}</ProjectGuid> (2)
<OutDir>$(ProjectDir)..\[Output]\</OutDir> (3)
...
</PropertyGroup>
<!-- =========================================== -->
<!-- HLSL shaders (entry points for compilation) -->
<!-- =========================================== -->
<ItemGroup>
<FxCompile Include="[InputFile]" ShaderType="..."
ObjectFileOutput="[OutputFile1]"
AssemblerOutputFile="[OutputFile2]"/> (4)
...
</ItemGroup>
...
<!-- =========================================== -->
<!-- HLSL compiler options -->
<!-- =========================================== -->
...
<ItemDefinitionGroup>
<FxCompile>
<AdditionalOptions>[Options]</AdditionalOptions> (5)
...
<ShaderModel>[Model]</ShaderModel> (6)
...
</FxCompile>
</ItemDefinitionGroup>
...
</Project>
1 | [NuGet] locates the NuGet package for the DirectX compiler and may be specified via the "api:Vcxproj.NuGetPackagePath" option.
|
2 | [Guid] is the project identifier and may be chosen arbitrarily, as long as it is unique within the solution.
Use "api:Vcxproj.ProjectGuid" to specify it. |
3 | [Output] is the output directory for compiled shaders.
It is derived from $(OutputDir) and "Output.Build" . |
4 | [InputFile] is the path to a generated HLSL source file.[OutputFile1] is the compiled shader binary.[OutputFile2] is the shader assembly output. |
5 | [Options] specifies additional compiler options, see "api:Vcxproj.CompilerOptions" |
6 | [Model] chooses the Shader Model, see "api:Vcxproj.ShaderModel" . |
<options/>
This section lists the <options/>
that may be configured for the Gpu-X Workflow.
Option | Allowed in <module/> |
Allowed in <target/> |
Used by language |
---|---|---|---|
yes |
no |
any |
|
yes |
no |
any |
|
yes |
no |
any |
|
no |
yes |
any |
|
no |
yes |
any |
|
no |
yes |
HLSL |
|
no |
yes |
HLSL |
|
no |
yes |
HLSL |
|
no |
yes |
HLSL |
|
no |
yes |
HLSL |
"Output.Build"
Specifies the output directory for compiled shaders.
If not specified, $(OutputDir)
is used instead.
"Output.Clean"
Specifies whether to clean compiler output files in "Output.Build"
("yes"
) or to leave them intact ("no"
).
Defaults to "no"
.
"Output.IDE"
Specifies the output directory for project files.
Will be resolved against $(ProjectDir)
if relative.
"APIs"
Chooses the target APIs for which to generate shader entry points.
Options that have names prefixed with a target API token (see api:*
) apply only to that API.
Without the prefix, an option applies to all target APIs.
Common values are:
-
dx9
→ Direct3D 9 -
dx11
→ Direct3D 11 -
dx12
→ Direct3D 12 -
gl41
→ OpenGL 4.1 Core Profile (or newer) -
gles30
→ OpenGLES 3.0 (or newer)
"api:Config[NAME]"
Specifies a compile-time configuration value, which is provided as a pre-processor macro in the generated source code files.
The Gpu-X compliant C# source accesses the configuration values via classes that are annotated with ConfigurationAttribute.
By setting this option, the default configuration values may be overridden.
"api:Vcxproj.DirectXCompilerVersion"
Chooses the DirectX Shader Compiler version.
"api:Vcxproj.NuGetPackagePath"
Defines the location of the NuGet package storage, relative to the generated project file.
Defaults to "..\packages"
.
"api:Vcxproj.ProjectGuid"
An arbitrary but unique identifier in the form 00000000-0000-0000-0000-000000000000
, to be used as the identifier for the generated project file.
"api:Vcxproj.ShaderModel"
Chooses the Direct3D Shader Model / Profile.