<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/glsl.meta.slang.h, branch master</title>
<subtitle>Making it easier to work with shaders</subtitle>
<id>https://git.yummers.dev/slang.git/atom?h=master</id>
<link rel='self' href='https://git.yummers.dev/slang.git/atom?h=master'/>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/'/>
<updated>2020-03-06T22:15:58+00:00</updated>
<entry>
<title>Remove generated header files (#1264)</title>
<updated>2020-03-06T22:15:58+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2020-03-06T22:15:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cdee13466080b737ed18c148e36af75898285ed6'/>
<id>urn:sha1:cdee13466080b737ed18c148e36af75898285ed6</id>
<content type='text'>
* Update slang-binaries to verison with SPIR-V version support.

* Support vec and matrix Wave intrinsics on vk.
Added wave-vector.slang test
Add wave-diverge.slang test
Add support for more wave intrinsics to vk.

* Test out Wave intrinsic support for matrices.

* Remove matrix glsl intrinsics -&gt; not available.
Fix some typo.

* Remove generated slang generated headers.</content>
</entry>
<entry>
<title>Cleanups on slang-generate (#437)</title>
<updated>2018-03-08T20:35:00+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-03-08T20:35:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=a22b7520745334ecef3cbd920a0331f01c905935'/>
<id>urn:sha1:a22b7520745334ecef3cbd920a0331f01c905935</id>
<content type='text'>
* Cleanups on slang-generate

There is nothing too significant in these changes, but I'm trying to get
things in place so that we can:

- Clean up the stdlib code to do less explicit `StringBuilder`
operations and instead to use more of the "template engine" approach

- Start using slang-generate for code other than the slang stdlib, so
that we can generate more of our boilerplate.

The main new functionality here is that in a template/meta file, you can
now enclose an expression in `$(...)` to indicate that is should be
spliced into the result. E.g. instead of:

    class ${{ sb &lt;&lt; someClassName; }}
    {
        ...
    }

We can now write:

    class $(someClassName)
    {
        ...
    }

The other bit of new functionality is support for a whole-line statement
escape, so that instead of:

    ${{ for( auto a : someCollection ) { }}
    void $(a)() { ... }
    ${{ } }}

We can instead write:

    $: for(auto a : someCollection) {
    void $(a)() { ... }
    $: }

I haven't yet tried to use that functionality in the stdlib meta-code,
but doing so would be an obvious next step.

* Fixup: change some $P to $p

The capitalization on some of the GLSL intrinsic mappings got messed up during a find-and-replace operation when removing the double `$` that used to be required to escape things.
</content>
</entry>
<entry>
<title>Refactor IR type system, step 0</title>
<updated>2018-02-23T22:41:46+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2018-02-23T22:22:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=5ab20eb2d20d491e258047bd94d9d9d0ac5a5dbf'/>
<id>urn:sha1:5ab20eb2d20d491e258047bd94d9d9d0ac5a5dbf</id>
<content type='text'>
Pull BaseType, TextureFlavor and SamplerStateFlavor enums and helper functions into a shared file "type-system-shared.h".
</content>
</entry>
<entry>
<title>Parameter blocks (#245)</title>
<updated>2017-11-06T18:37:27+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-11-06T18:37:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9919c823938ae929b16efac9d507f6d5eb122bf4'/>
<id>urn:sha1:9919c823938ae929b16efac9d507f6d5eb122bf4</id>
<content type='text'>
* Rename existing ParameterBlock to ParameterGroup

We are planning to add a new `ParameterBlock&lt;T&gt;` type, which maps to the notion of a "parameter block" as used in the Spire research work.
Unfortunately, the compiler codebase already uses the term `ParameterBlock` as catch-all to encompass all of HLSL `cbuffer`/`tbuffer` and GLSL `uniform`/`buffer`/`in`/`out` blocks (all of which are lexical `{}`-enclosed blocks that define parameters...).

This change instead renames all of the existing concepts over to `ParameterGroup`, which isn't an ideal name, but at least doesn't directly overlap the new terminology or any existing terminology.

The new `ParameterBlockType` case will probably be a subclass of `ParameterGroupType`, since it is a logical extension of the underlying concept.

* Add Shader Model 5.1 profiles

The HLSL `register(..., space0)` syntax is only allowed on "SM5.1" and later profiles (which is supported by the newer version of `d3dcompiler_47.dll` that comes with the Win10 SDK, but not the older version of `d3dcompiler_47.dll` - good luck figuring out which you have!).

This change adds those profiles to our master list of profiles, and nothing else.

* First pass at support for `ParameterBlock&lt;T&gt;`

- Add the type declaration in stdlib

- Add a special case of `ParameterGroupType` for parameter blocks

- Handle parameter blocks in type layout (currently handling them identically to constant buffers for now, which isn't going to be right in the long term)

- Add an IR pass that basically replaces `ParameterBlock&lt;T&gt;` with `T`
  - Eventually this should replace it with either `T` or `ConstantBuffer&lt;T&gt;`, depending on whether the layout that was computed required a constant buffer to hold any "free" uniforms

- Add first stab at an IR pass to "scalarize" global variables using aggregate types with resources inside.
  - This currently only applies to global variables, so it won't handle things passed through functions, or used as local variables
  - It also only supports cases where the references to the original variable are always references to its fields, and not the whole value itself

- Add a single test case that technically passes with this level of support, but probably isn't very representative of what we need from the feature

* Fold parameter-block desugaring into a more complete "type legalization" pass

The basic problem that was arising is that once you desugar `ParameterBlock&lt;T&gt;` into `T`, you then need todeal with splitting `T` into its constituent fields if it contains any resource types.
Handling those transformations by following the usual use-def chains wasn't really helping, because you might need systematic rewriting that can really only be handled bottom-up.

This change adds a new pass that is intended to perform multiple kinds of type "legalization" at once:

- It will turn `ParameterBlock&lt;T&gt;` into `T`
  - It may at some point also convert `ConstantBuffer&lt;T&gt;` into `T` as well
- It will turn an value of an aggregate type that contains resources into N different values (one per field)
  - As a result of this, it will also deal with AOS-to-SOA conversion of these types

Legalization is applied to *every* function/instruction/value, so that it can make large-scale changes that would be tough to manage with a work list.

This pass needs to be run *after* generics have been fully specialized, so that we know we are always dealing with fully concrete types, so that their legalization for a given target is completely known.

This is still work in progress; there's more to be done to get this working with all our test cases, and finish the remaining `ParameterBlock&lt;T&gt;` work.

* Improve binding/layout information when using parameter blocks

- When doing type layout for a parameter block, don't include the resources consumed by the element type in the resource usage for the parameter block
  - Note that this is pretty much identical to how a `ConstantBuffer&lt;T&gt;` does not report any `LayoutResourceKind::Uniform` usage, except that `ParameterBlock&lt;T&gt;` is *also* going to hide underlying texture/sampler reigster usage
  - The one exception here is that any nested items that use up entire `space`s or `set`s those need to be exposed in the resource usage of the parent (I don't have a test for this)

- When type legalization needs to scalarize things, it must propagate layout information down to the new leaf variables. In general, the register/index for a new leaf parameter should be the sum of the offsets for all of the parent variables along the "chain" from the original variable down to the leaf (we aren't dealing with arrays here just yet).

- When type legalization decides to eliminate a pointer(-like) type (e.g., desugar `ParameterBlock&lt;T&gt;` over to `T`), actually deal with that in terms of the `LegalVal`s created, so that we can know to turn a `load` into a no-op when applied to a value that got indirection removed.

- Hack up the "complex" parameter-block test so that it actually passes (the big hack here is that the HLSL baseline is using names that are generated by the IR, and are unlikely to be stable as we add/remove transformations).
  - Note: I can't make these be compute tests right now, because regsiter spaces/sets are a feature of D3D12/Vulkan, and our test runner isn't using those APIs.
</content>
</entry>
<entry>
<title>Fix output for matrix multiple in GLSL code (#228)</title>
<updated>2017-10-23T17:37:07+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-10-23T17:37:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=ab64cf2ec05980d72cb2bad45e629d10ebbefdc1'/>
<id>urn:sha1:ab64cf2ec05980d72cb2bad45e629d10ebbefdc1</id>
<content type='text'>
When Slang sees a matrix multiplication `M * v` in GLSL code it should (obviously) output GLSL code that also does `M * v`, but there was a bug introduced where the type-checker manages to resolve the operation and recognize it as a matrix-vector multiply, and then the code-generation logic says "oh, I'm generating output for GLSL, and that is reversed from HLSL/Slang, so I'd better reverse these operands!" and outputs `v * M`... which isn't what we want.

I've fixed the problem in an expedient way, by having the front-end resolve the operation to what it believes is an intrinsic multiply operation, rather than a matrix-vector operation. If we ever support cross compilation *from* GLSL (unlikely), we've need to fix this up so that we have both real matrix-vector multiplies and "reversed" multiplies where the operands folow the GLSL convention).

I've added two tests here to confirm the fix. The one under `tests/bugs` catches the actual issue described above, and confirms the fix. The other one under `tests/cross-compile` is just to make sure that we *do* properly reverse the operands to a matrix-vector product when converting from Slang to GLSL.</content>
</entry>
<entry>
<title>Fix up emission of shader parameter semantics when using IR (#226)</title>
<updated>2017-10-20T22:16:10+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-10-20T22:16:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=624d122a3a110922cd54aab7bbf13f1cac8fbbff'/>
<id>urn:sha1:624d122a3a110922cd54aab7bbf13f1cac8fbbff</id>
<content type='text'>
* Fix up emission of shader parameter semantics when using IR

- Make sure to propagate entry point parameter layouts down to IR parameters when doing the initial cloning to form target-specific IR

- When layout information is present on an IR node, prefer to use that over the original high-level declaration for outputting semantics in final HLSL

- Fix up test runner to generate `.actual` files when running compute tests, in cases where the `render-test` application errors out (e.g., because of a Slang compilation error)

- Add a first test of generics functionality, to show that they generate valid code through the IR
  - Right now this test is *not* using any "interesting" operations on the type parameter, so this is not a test that can confirm that interface constraints work

* fixup: skip compute tests when running on Linux
</content>
</entry>
<entry>
<title>First attempt at a Linux build (#193)</title>
<updated>2017-09-27T18:17:39+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-09-27T18:17:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=74f2f47cb63b02638270beecd20acea1a0f5665e'/>
<id>urn:sha1:74f2f47cb63b02638270beecd20acea1a0f5665e</id>
<content type='text'>
* First attempt at a Linux build

- Fix up places where C++ idioms were written assuming lenient behavior of Microsoft's compiler

- Add a few more alternatives for platform-specific behavior where Windows was the only platform accounted for.

- Add a basic Makefile that can at least invoke our build, even if it isn't going good dependency tracking, etc.

- Build `libslang.so` and `slangc` that depends on it, using a relative `RPATH` to make the binary portable (I hope)

- Add an initial `.travis.yml` to see if we can trigger their build process.

* Fixup: const bug in `List::Sort`

I'm not clear why this gets picked up by the gcc *and* clang that Travis uses, but not the (newer) gcc I'm using on Ubuntu here, but I'm hoping it is just some missing `const` qualifiers.

* Fixup: reorder specialization of "class info"

Clang complains about things being specialized after being instantiated (implicilty), and I hope it is just the fact that I generate the class info for the roots of the hierarchy after the other cases. We'll see.

* Fixup: add `platform.cpp` to unified/lumped build

* Fixup: Windows uses `FreeLibrary`

and not `UnloadLibrary`

* Fixup: fix Windows project file to include new source file

This obviously points to the fact that we are going to need to be generating these files sooner or later.
</content>
</entry>
</feed>
