<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/slang/slang-ir-string-hash.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>2024-10-29T06:49:26+00:00</updated>
<entry>
<title>format</title>
<updated>2024-10-29T06:49:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-10-29T06:49:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21'/>
<id>urn:sha1:f65d756bff8d4c5cbc15bd0322a2ae8e6b896a21</id>
<content type='text'>
* format

* Minor test fixes

* enable checking cpp format in ci</content>
</entry>
<entry>
<title>Remove `SharedIRBuilder`. (#2657)</title>
<updated>2023-02-17T00:44:04+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-02-17T00:44:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=245466d89cfe54b78da486f06d470bc6daaf4625'/>
<id>urn:sha1:245466d89cfe54b78da486f06d470bc6daaf4625</id>
<content type='text'>
Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Inline functions with string param/return for GPU targets (#2544)</title>
<updated>2022-12-02T14:29:38+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2022-12-02T14:29:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=92ae4949fe1af28ef31331fd4116c8111c057420'/>
<id>urn:sha1:92ae4949fe1af28ef31331fd4116c8111c057420</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP inlining of functions that take or return string related types on GPU targets.

* Small fixes.

* Added a test.

* Add checking for any getStringHash insts are valid.

* Support getStringHash on CUDA.

* Tweak diagnostic.</content>
</entry>
<entry>
<title>Change handling of strings for HLSL/GLSL targets (#1204)</title>
<updated>2020-02-07T16:45:32+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-02-07T16:45:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=af84d85799758234110fc42f0ba5c771dacb5fe3'/>
<id>urn:sha1:af84d85799758234110fc42f0ba5c771dacb5fe3</id>
<content type='text'>
* Change handling of strings for HLSL/GLSL targets

This change switches our handling of string literals and `getStringHash` to something that is more streamlined at the cost of potentially being less general/flexible.

* `String` is now allowed as a parameter type in user-defined functions

* `getStringHash` is now allowed to apply to `String`-type values that aren't literals

* The list of strings in an IR module is now generated during IR lowering as part of lowering a string literal expression, rather than being defined by recursively walking the IR of the module looking for `getStringHash` calls. The public API still refers to these as "hashed" strings, but they are realistically now "static strings."

* When emitting code for HLSL/GLSL, the `String` type emits as `int`, and `getStringHash(x)` emits as `x`.

In terms of implementation, the choice was whether to translate `String` over to `int` in an explicit IR pass, or to lump it into the emit pass. While adding the logic to emit clutters up an already complicated step, it is ultimately much easier to make the change there than to write a clean IR pass to eliminate all `String` use.

Note that other targets that can handle a more full-featured `String` type are *not* addressed by this change and thus do not support `String` at all. It may be woth emitting `String` as `const char*` on those targets, and emitting string literals directly, but the `getStringHash` function would need to be implemented in the "prelude" then, and we probably want to pick a well-known/-documented hash algorithm before we go that far.

This change also brings along some some clean-ups to the `gpu-printing` example, since it can now take advantage of the new functionality of `String`.

* Fix up tests for new string handling

* Add global string literal list to string-literal test (since we now list *all* static string literals and not just those passed to `getStringHash`)

* Disable `getStringHash` test on CPU, since we don't have a working `String` on that platform right now (only HLSL/GLSL)

Co-authored-by: Tim Foley &lt;tim.foley.is@gmail.com&gt;
</content>
</entry>
<entry>
<title>getStringHash on string literals (#1140)</title>
<updated>2019-12-03T14:58:59+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2019-12-03T14:58:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9653dcc2c9d5d20d3d0e8918aaf1d5b09e963060'/>
<id>urn:sha1:9653dcc2c9d5d20d3d0e8918aaf1d5b09e963060</id>
<content type='text'>
* WIP getStringHash

* Have a use.

* Add slang-string-hash.h/.cpp

* Use StringSlicePool for holding strings for StringHash.
Add outputBuffer to string-literal-hash.slang so value can be tested.
Ignore the GlobalHashedStringLiterals instruction on emit.

* Add all the hashed string literals to ProgramLayout.

* Add reflection support for hashed string literals to reflection test.

* Fix string literal hash test.

* Small fixes to pass test suite.

* Fix issue in serialization where IRUse is not correctly initialized.

* Fix problem initializing IRUse for string hash pass.
Remove hack from slang-ir-specialize - specially handling if user is not null.

* * Use shared builder when replacing getStringHash
* Comments for functions in slang-ir-string-hash
* Do not allow zero length string literals. Could be allowed, but doing so would require StringSlicePool to have a special case (or some other mechanism)
</content>
</entry>
</feed>
