<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tools/slang-reflection-test/main.cpp, 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>2019-01-07T14:14:01+00:00</updated>
<entry>
<title>Feature/unique tool source names (#766)</title>
<updated>2019-01-07T14:14:01+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2019-01-07T14:14:01+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d155eaa92d56a4ec00109d25c8c70fe12fb96c2e'/>
<id>urn:sha1:d155eaa92d56a4ec00109d25c8c70fe12fb96c2e</id>
<content type='text'>
* Remove AppContext. Use StdChannels to hold writers, and TestToolUtil to hold test tool specific functionality.

* StdChannels -&gt; StdWriters

* getStdOut -&gt; getOut, getStdError -&gt; getError

* Renamed main.cpp files of tools to try and stop visual studio getting confused between files - such that clicking on an error takes editor to the right location.
</content>
</entry>
<entry>
<title>Feature/remove app context (#765)</title>
<updated>2018-12-21T16:00:28+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-12-21T16:00:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=efa2c8f41aa5cd2c27990fd9b57ea0eff06976e7'/>
<id>urn:sha1:efa2c8f41aa5cd2c27990fd9b57ea0eff06976e7</id>
<content type='text'>
* Remove AppContext. Use StdChannels to hold writers, and TestToolUtil to hold test tool specific functionality.

* StdChannels -&gt; StdWriters

* getStdOut -&gt; getOut, getStdError -&gt; getError
</content>
</entry>
<entry>
<title>Fix memory leaks around slang-test (#757)</title>
<updated>2018-12-14T20:24:21+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-12-14T20:24:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=d43c566fa29bbc0da1534aea236d54ee5ca104b8'/>
<id>urn:sha1:d43c566fa29bbc0da1534aea236d54ee5ca104b8</id>
<content type='text'>
* Remove circular reference to renderer on Vk &amp; D3D12 DescriptorSetImpl

* Refactor Stbi image loading such that memory is correctly freed when goes out of scope.
Added Crt memory dump at termination.
Reduced erroneous reporting by scoping TestContext.

* Used capitalized acronym for STBImage to keep Tim happy.

* Split out TestReporter - to just handle reporting test results
Split out Options
Made TestContext hold options, and the reporter
Removed remaining memory leaks.

* Small optimization for rawWrite, such that it directly writes over print..

* Improve comments on TestCategorySet

* Fix typos in TestCategorySet
</content>
</entry>
<entry>
<title>Running tests in slang-test process (#740)</title>
<updated>2018-12-12T13:57:48+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-12-12T13:57:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=49ed6b60d662906f290578f802f80b0ead1a2b9d'/>
<id>urn:sha1:49ed6b60d662906f290578f802f80b0ead1a2b9d</id>
<content type='text'>
* First pass at having an interface to write text to that can be replaced.
Simplifed and made more rigerous the interface used to write formatted strings.

* Added AppContext to simplify setting up and parsing around of streams.

* Added more simplified way to get the std error/out from AppContext.

* Work in progress using dll for tools to speed up testing.

* First pass at ISlangWriter interface.

* Added support for writing VaArgs.
Added NullWriter.

* Use ISlangWriter for output.

* Use ISlangWriter for output - replacing OutputCallback.
Make IRDump go to ISlangWriter

* SlangWriterTargetType -&gt; SlangWriterChannel
Improvements around AppContext

* Shared library working with slang-reflection-test.

* Dll testing working for render-test.

* Include va_list definintion from header.

* Fix errors from clang.

* Fix typo for linux.

* Added -usexes option

* Fix typo.

* Fix arguments problem on linux.

* Fix typo for linux.

* Add windows tool shared library projects.

* Fix warning from x86 win build.
Fix signed warning from slang-test/main.cpp

* First attempt at getting premake to work on travis, and run tests.

* Try moving build out into script.

* Invoke bash scripts so they don't have to be executable.

* Drive configuration/tests from env parameters set by travis

* Try using source to run travis tests.

* Remove the build.linux directory - but doing so will overwrite Makefile.

* Made -fno-delete-null-pointer-checks gcc only.

* Try to fix warning from -fno-delete-null-pointer-checks

* Turn of warnings for unknown switches.

* Try to make premake choose the correct tooling.

* Disabled missing braces warning.

* Disable -Wundefined-var-template on clang.

* -Wunused-function disabled for clang.

* Fix typo due to SlangBool.

* Remove this nullptr tests.

* "-Wno-unused-private-field" for clang.

* Added "-Wno-undefined-bool-conversion"

* Add DominatorList::end fix.

* Split scripts into travis_build.sh travis_test.sh

* Fix gcc/clang template pre-declaration issue around QualType.

* Fix premake to build such that pthread correctly links with slang-glslang
</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>Add support for unbounded arrays as shader parameters (#725)</title>
<updated>2018-11-21T16:15:33+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-11-21T16:15:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9bb11b69a08c66e2857f439837e2253658aed9a4'/>
<id>urn:sha1:9bb11b69a08c66e2857f439837e2253658aed9a4</id>
<content type='text'>
* Add support for unbounded arrays as shader parameters

With this change, Slang shaders can use unbounded-size arrays as parameters, e.g.:

```hlsl
Texture2D t[] : register(t3, space2);
SamplerState s[];
```

As shown in the above example, Slang supports both explicit `register` declarations on unbounded-size arrays and also implicit binding.
When doing automatic parmaeter binding, Slang will allocate a full register space to an unbounded-size array of textures/smaplers, starting at register zero.

Note that for the Vulkan target, an array of descriptors of any size (including unbounded size) consumes only a single `bindign`, so much of this logic is specific to D3D targets.

Details on the changes made:

* The single biggest change is a new `LayoutSize` type that is used to store a value that can either be a finite unsigned integer or a dedicated "infinite" value (which is stored as the all-bits-set `-1` value). This is used in places where a size could either be a finite value or an "unbounded" value, to both try to make standard math robust against the infinite case, and also to force code to deal with both the finite and infinite cases more explicitly when they care about the difference.

* The public API was documented so that unbounded-size arrays report their size as `-1`. We should probably change this function to return a signed value instead of `size_t`, but that would technically be a source-breaking change, so we want to make sure we stage it appropriately.

* The code that invokes fxc was updated so that it passes the appropriate flag to enable unbounded arrays of descriptors. I haven't looked yet at whether dxc needs such a flag, so there may need to be a follow-on change to add that.

* The logic in the `UsedRanges::Add` method for tracking what registers have been claimed was rewritten because the previous version had some subtle bugs. The new version includes more detailed comments that attempt to explain why I think the new logic works.

* The top-level logic for auto-assigning bindings to parameters has been overhauled to deal with the fact that a parameter that needs "infinite" amounts of a resource should be claiming a full register space for those resources instead. Whenever a parameter allocates any register spaces we want them all to be contiguous, so we have a loop that counts the requirements and allocates the spaces before we go along and dole them out.

* When computing the layout for an array type, we need to carefully deal with unbounded-size arrays. In the case of an unbounded array of a "simple" resource type (e.g., `Texture2D[]`), we opt to expose the type layout as consuming an infinite number of the appropriate register, while in the case of a complex type (say, a `struct` with two texture fields), we need to instead allocate whole spaces for those fields. The logic here is more subtle than I would like, and interacts with the existing code that "adjusts" the element type of an array in order to make standard indexing math Just Work.

* Similarly, when a `struct` type has unbounded-array fields, then we need to transform any field with infinite register requirements to instead consume a space in the resulting aggregate type. This case is comparatively easier than the array case.

* The test case for unbounded arrays covers both explicit and implicit bindings, and also the case of an unbounded array over a `struct` type (it does not cover the case of a `struct` contianing unbounded arrays, so that will need to be added later). For this test we are both validation the output reflection data and that we produce the same code as fxc (with explicit bindings in the fxc case).

* The reflection test app was modified to use the new API contract and detect when a parameter consumes `SLANG_UNBOUNDED_SIZE` resources.

* Fixup: ensure unbounded size is defined at right bit width
</content>
</entry>
<entry>
<title>Support for [[vk::push_constant]] (#629)</title>
<updated>2018-08-22T15:36:02+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-08-22T15:36:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=6a8ad6eb4cab72c18de48762768e04d08b60a21c'/>
<id>urn:sha1:6a8ad6eb4cab72c18de48762768e04d08b60a21c</id>
<content type='text'>
* Support for attributed [[vk::push_constant]] and [[push_constant]]. Can also use layout(push_constant).

* Fix test so matches the expected output.

* Add expected output to binding-push-constant-gl.hlsl

* Trivial change to force travis rebuild to test the gcc linux build really has a problem.
</content>
</entry>
<entry>
<title>spCompile/spProcessCommandLineArguments return SlangResult  (#610)</title>
<updated>2018-07-06T15:51:19+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2018-07-06T15:51:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7b2a549fcf04263e07127315d72c8570e8063828'/>
<id>urn:sha1:7b2a549fcf04263e07127315d72c8570e8063828</id>
<content type='text'>
* * Make spCompile return SlangResult
* Make spProcessCommandLineArguments return SlangResult (and not internally exit)
* Remove calls to exit()
* Fix typos

* Make all output from spProcessCommandLineArguments get sent to diagnostic sink.
</content>
</entry>
<entry>
<title>Merge from v0.9.15 (#460)</title>
<updated>2018-03-28T15:17:48+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-03-28T15:17:48+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=184dc5cd6998b6277881fae4a68d91de86e2d63f'/>
<id>urn:sha1:184dc5cd6998b6277881fae4a68d91de86e2d63f</id>
<content type='text'>
* Fix bug when subscripting a type that must be split (#396)

The logic was creating a `PairPseudoExpr` as part of a subscript (`operator[]`) operation, but neglecting to fill in its `pairInfo` field, which led to a null-pointer crash further along.

* Allow writes to UAV textures (#416)

Work on #415

This issue is already fixed in the `v0.10.*` line, but I'm back-porting the fix to `v0.9.*`.
The issue here was that the stdlib declarations for texture types were only including the `get` accessor for subscript operations, even if the texture was write-able.

I've also included the fixes for other subscript accessors in the stdlib (notably that `OutputPatch&lt;T&gt;` is readable, but not writable, despite what the name seems to imply).

* Fix infinite loop in semantic parsing (#424)

The code for parsing semantics was looking for a fixed set of tokens to terminate a semantic list, rather than assuming that whenever you don't see a `:` ahead, you probably are done with semantics. This meant that you could get into an infinite loop just with simple mistakes like leaving out a `;`.

This change fixes the parser to note infinite loop in this case, and adds a test case to verify the fix.

* Expose HLSL `shared` modifier through reflection. (#436)

This is a request from Falcor, because the `shared` modifier can be used as a hint to optimize the grouping of parameters for binding. The intention is that `shared` marks shader parameters (including parameter blocks) that will us the same values across many draw calls (e.g., per-frame data, as opposed to per-model or per-instance).

The mechanism I'm using here is to provide a general reflection API for exposing the `Modifier`s already attached to declarations. While the only modifier exposed is `shared`, and the only modifier information being exposed is presence/absence, this interface could be extended down the line.
</content>
</entry>
<entry>
<title>no-codegen compile flag and global generics reflection (#347)</title>
<updated>2018-01-03T06:04:50+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2018-01-03T06:04:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1e0aabf4b28f48bfbfee7b1a9c08031892c004d0'/>
<id>urn:sha1:1e0aabf4b28f48bfbfee7b1a9c08031892c004d0</id>
<content type='text'>
* no-codegen compile flag and global generics reflection

1. Add SLANG_COMPILE_FLAG_NO_CODEGEN (-no-codegen) compiler flag to skip code generation stage, so that a shader that uses global generic type parmameters can be parsed, checked and introspected without knowing the final specialization.

2. Add reflection API to query for global generic type parameters, global parameters of generic type, and the generic type parameter index related to a global generic parameter.

3. Add a reflection test case for global generic type parameters.

* add expected result for global-type-params test case.

* fix reflection json output.

* fix branch condition errors

* fix expected result for global-type-params.slang

* fix expected test case output
</content>
</entry>
</feed>
