Skip to content

Commit cefa910

Browse files
committed
Implement .gsh directive
1 parent 8366ecf commit cefa910

3 files changed

Lines changed: 22 additions & 2 deletions

File tree

Changelog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
- (**Breaking change**) Command line format changed.
66
- Added support for assembling multiple shaders (DVLEs) into a single SHBIN.
7-
- Added new directives: `.entry`, `.nodvle`, `.setf`, `.seti`, `.setb`.
7+
- Added new directives: `.entry`, `.nodvle`, `.gsh`, `.setf`, `.seti`, `.setb`.
88
- Added auto-detection of inverted forms of opcodes. (Explicitly using `dphi`, `sgei`, `slti` and `madi` is now deprecated)
99
- Several miscellaneous bug fixes.
1010

Manual.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ DVLEs are generated in the same order as the files in the command line.
7272

7373
The entry point of a DVLE may be set with the `.entry` directive. If this directive is not used, `main` is assumed as the entrypoint.
7474

75-
A DVLE is marked by default as a vertex shader, unless `setemit` is used (in the case of which a geometry shader is assumed).
75+
A DVLE is marked by default as a vertex shader, unless `setemit` or `.gsh` are used (in the case of which a geometry shader is assumed).
7676

7777
Uniforms that start with the underscore (`_`) character are not exposed in the DVLE table of uniforms. This allows for creating private uniforms that can be internally used to configure the behaviour of shared procedures.
7878

@@ -188,6 +188,12 @@ Specifies the name of the procedure to use as the entrypoint of the current DVLE
188188
```
189189
This directive tells `picasso` not to generate a DVLE for the source code file that is being processed. This allows for writing files that contain shared procedures to be used by other files.
190190

191+
### .gsh
192+
```
193+
.gsh
194+
```
195+
This directive explicitly flags the current DVLE as a geometry shader.
196+
191197
### .setf
192198
```
193199
.setf register(x, y, z, w)

source/picasso_assembler.cpp

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1557,6 +1557,19 @@ DEF_DIRECTIVE(nodvle)
15571557
}
15581558
}
15591559

1560+
DEF_DIRECTIVE(gsh)
1561+
{
1562+
DVLEData* dvle = GetDvleData();
1563+
ENSURE_NO_MORE_ARGS();
1564+
1565+
if (dvle->nodvle)
1566+
return throwError(".gsh has no effect if .nodvle is used\n");
1567+
1568+
dvle->isGeoShader = true;
1569+
return 0;
1570+
}
1571+
1572+
15601573
static const cmdTableType dirTable[] =
15611574
{
15621575
DEC_DIRECTIVE(proc),
@@ -1571,6 +1584,7 @@ static const cmdTableType dirTable[] =
15711584
DEC_DIRECTIVE(out),
15721585
DEC_DIRECTIVE(entry),
15731586
DEC_DIRECTIVE(nodvle),
1587+
DEC_DIRECTIVE(gsh),
15741588
DEC_DIRECTIVE2(setf, setfi, UTYPE_FVEC),
15751589
DEC_DIRECTIVE2(seti, setfi, UTYPE_IVEC),
15761590
DEC_DIRECTIVE(setb),

0 commit comments

Comments
 (0)