<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/reflection/thread-group-size.hlsl.expected, 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>2024-12-21T16:14:56+00:00</updated>
<entry>
<title>Fixed stage and result field names in json reflection (#5927)</title>
<updated>2024-12-21T16:14:56+00:00</updated>
<author>
<name>Stan</name>
<email>109335133+stanoddly@users.noreply.github.com</email>
</author>
<published>2024-12-21T16:14:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=76fdeaa477a5d21176facf0296f77e28e2d59477'/>
<id>urn:sha1:76fdeaa477a5d21176facf0296f77e28e2d59477</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Fix uses of dynamic_cast on types in reflection API (#731)</title>
<updated>2018-11-29T15:48:38+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-11-29T15:48:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=e5cc4660c634a0dd35a9813e03192d380f253332'/>
<id>urn:sha1:e5cc4660c634a0dd35a9813e03192d380f253332</id>
<content type='text'>
The `Type` infrastructure uses a class hierarchy, but blindly `dynamic_cast`ing to a desired case doesn't always give the expected result, because a `Type` could represent a `typedef` (a `NamedExpressionType`) that itself resolves to, e.g, a vector type (a `VectorExpressionType`). In that case a `dynamic_cast&lt;VectorExpressionType*&gt;(someType)` would fail, even though the type logically represents a vector. The `Type::As&lt;T&gt;()` method is designed to handle this case, by "looking through" simple `typedef`s to get at the real definition of a type.

The fix in this case is to use `Type::As&lt;T&gt;()` at various points in the reflection code (`reflection.cpp`) instead of `dynamic_cast`.

This problem surfaced with a `StructuredBuffer&lt;float2&gt;` not reflecting correctly, because the element type (`float2`) is actually a `typedef` (for `vector&lt;float,2&gt;`), so I've included a test case that stresses that case. Getting the right output in the test required tweaking the `slang-reflection-test` tool to produce additional output for resource types (currently narrowed down to only affect structured buffers to avoid large diffs in expected test outputs).</content>
</entry>
<entry>
<title>More fixups for parameter block binding generation (#311)</title>
<updated>2017-12-15T19:57:53+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-12-15T19:57:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=81c0cd872bcb94f1f05abc3b234d8918d237d77c'/>
<id>urn:sha1:81c0cd872bcb94f1f05abc3b234d8918d237d77c</id>
<content type='text'>
* More fixups for parameter block binding generation

The bug in this case arises when there is both a parameter block and global-scope resources, all of which are relying on automatic binding assignment. If the parameter block is the first global-scope parameter that gets encountered, then it is possible for it to allocate regsiter space/set zero for itself, which confuses the logic for handling other global-scope parameters (which assumes that *they* get space/set zero).

I've also made some fixup to the reflection test harness and reflection API code:

- Have the hardness handle register-space allocations when printing, and be sure to only show their `index` and not their `space` (since that would be redundant)

- Have the reflection API only auto-redirect queries on a parameter group type layout to its container type layout *if* the container type layout has a non-zero number of resource allocations. The problem that arises here is a `ParameterBlock&lt;X&gt;` where `X` doesn't contain any uniforms, so that no container is needed. In that case the container ends up with no resource allocation(s).

* Fixups for test failures.

- The thread-group size tests failed because they had shader parameters with no resources to back them (built-in `SV_` inputs), and the printing of those changed. I fixed up the baseline, but also had to fix a few bugs in the reflection test fixture's printing logic.

- The GLSL parameter block test revealed a corner case of the existing logic: because we always need to generate a binding for the "hack" sampler (even if code doesn't end up needing it), and that sampler should always go in the "default" set (should be set zero), the user's `ParameterBlock` will always end up as `set=1` or later, even if there are no other global-scope parameters.

  - This will be fixed once we don't have to rely on glslang's annoying behavior in this one case, either because glslang gets fixed, or because we implement our own SPIR-V codegen.
</content>
</entry>
<entry>
<title>Reflection: allow querying of semantics on varying input/output (#224)</title>
<updated>2017-10-19T18:49:16+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2017-10-19T18:49:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=88023aea669f258d66e53eab10215337a7f72853'/>
<id>urn:sha1:88023aea669f258d66e53eab10215337a7f72853</id>
<content type='text'>
This is functionality required to support a Falcor bug fix.

Most of the code to compute the right semantic name/index for a parameter was already present.
This change adds:

- Storage for semantic name/index on every `VarLayout`
  - Note: this is wasteful and should be optimized later

- A public API to query the semantic name/index
  - The contract is that this API returns `NULL` if the parameter had no semantic

- A bit of work in `parameter-binding.cpp` to attach semantics to varying input/output when traversing varying parameters.
  - Note: this is intentionally set up so that it associates semantics even with non-leaf parameters, so that an API user can query the semantic of a `struct` parameter and know that its members will be assigned sequential semantic indices from its starting value.

- Support for dumping this information in reflection tests

One notable thing that I did *not* change here is that the reflection test fixture doesn't report information on the output of an entry point, even though it really should. That should be fixed in a separate change, though, because it would affect many of the expected outputs.</content>
</entry>
<entry>
<title>Support scalarization of varying input/output for GLSL</title>
<updated>2017-07-18T19:58:48+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-07-18T14:49:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1c022e2c3654de868c45658683f9e04cf4d68cc0'/>
<id>urn:sha1:1c022e2c3654de868c45658683f9e04cf4d68cc0</id>
<content type='text'>
GLSL technically supports varying (`in`, `out`) parameters of `struct` type, but there are some annoying constraints (not allowed for VS input), and it doesn't work with how an HLSL user would usually put "system-value" inputs/outputs into a `struct` together with ordinary inputs/outputs.

To work around this, this change adds support for using an imported Slang `struct` type for an `in` or `out` parameter, in which case it will (1) be scalarized and (2) will have system-value semantics mapped appropriately, just as for an entry-point parameter when cross-compiling an HLSL-style `main()`.

Changes:

- Add a notion of a `VaryingTupleExpr` and `VaryingTupleVarDecl`, similar to those for the resources-in-structs case

- Trigger use of these when we have a global-scope varying in/out using an imported `struct` type

- Also use these in the cross-compilation case for ordinary varying input/output (since this approach seems like it should be more general, and can hopefully handle stuff like GS input/output some day)

- When generating parameter binding information, special case global-scope input/output, and treat it the same as entry-point-parameter input/output

- Revamp how used resource ranges are computed so that we can eventually make this specific to an entry point

- Actually implement first signs of life for `maybeMoveTemp` so that assignments to the tuple-ified outputs will work better

- Add first test case that actually seems to work

- Add diagnostics for conflicting explicit bindings on a parameter

- Add diagnostic for different parameters with overlapping bindings

- Make global-scope varying input/output use a tracking data structure specific to the translation unit for computing locations (so that they are independent of other TUs)
</content>
</entry>
<entry>
<title>Add reflection support for GLSL thread-group-size modifier</title>
<updated>2017-07-14T21:42:51+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoley@nvidia.com</email>
</author>
<published>2017-07-14T21:38:13+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=66bae403827a37bdc587f3356cc58fde166d04a1'/>
<id>urn:sha1:66bae403827a37bdc587f3356cc58fde166d04a1</id>
<content type='text'>
Fixes #15

These are the modifiers like:

    layout(local_size_x = 16) in;

Unlike the HLSL case, these don't get attache to the entry point function itself, so there is a bit more work involed in looking them up.

Just to make sure I didn't mess up the HLSL case, I went ahead and added two tests for this capability: one for GLSL and one for HLSL.
</content>
</entry>
</feed>
