<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/source/compiler-core/slang-source-loc.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>2025-04-24T22:48:37+00:00</updated>
<entry>
<title>Implemented #pragma warning (#6748)</title>
<updated>2025-04-24T22:48:37+00:00</updated>
<author>
<name>Ronan</name>
<email>ro.cailleau@gmail.com</email>
</author>
<published>2025-04-24T22:48:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=5f632cd204b7a85f3a97b6c316c5a34f9fc8193e'/>
<id>urn:sha1:5f632cd204b7a85f3a97b6c316c5a34f9fc8193e</id>
<content type='text'>
* Implemented #pragma warning

Based on https://learn.microsoft.com/en-us/cpp/preprocessor/warning?view=msvc-170

* Make #pragma warning work with #includes.

- SourceLoc are not sorted by inclusion order.
- Construct a mapping from SourceLoc to "absolute locations" that are sorted by inclusion order (roughly represents a location in a raw file with all #include resolved).
- The absolute location can be used in the pragma warning timeline

* Added preprocessor #pragma warning tests.

- Fixed #pragma warning (push / pop) SourceLoc
- Fixed unused directiveLoc in #pragma warning parsing

* #pragma warning: Added some comments and fixed some typos

* Cleaned #pragma warning preprocessor implementation.

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Move switch statement bodies to their own lines (#5493)</title>
<updated>2024-11-05T17:47:26+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2024-11-05T17:47:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b118451e301d734e3e783b3acdf871f3f6ea851c'/>
<id>urn:sha1:b118451e301d734e3e783b3acdf871f3f6ea851c</id>
<content type='text'>
* Move switch statement bodies to their own lines

* format

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<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 incorrect UTF decode assert (#5028)</title>
<updated>2024-09-06T18:38:33+00:00</updated>
<author>
<name>cheneym2</name>
<email>acheney@nvidia.com</email>
</author>
<published>2024-09-06T18:38:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=dcd6c246a14d2321e75c657f381b08b7ab08016e'/>
<id>urn:sha1:dcd6c246a14d2321e75c657f381b08b7ab08016e</id>
<content type='text'>
The assert assumed that after removing a BOM and "deflating"
UTF* to UTF8, the decoded (UTF8) size should be less than
the raw size (UTF8 or UTF16). However, UTF8 is not actually
smaller than UTF16 for some UTF16 codepoints. Specifically,
UTF16 code points (2 bytes) 0x800+ are 3 to 4 bytes large.

The assert is mostly obeyed for source code files, but is
easily violated for binary files with more random values.

Wikipedia clarifies why:

https://en.wikipedia.org/wiki/UTF-8#UTF-16

"Text encoded in UTF-8 will be smaller than the same text encoded
in UTF-16 if there are more code points below U+0080 than in the range
U+0800..U+FFFF. This is true for all modern European languages. It is
often true even for languages like Chinese, due to the large number of
spaces, newlines, digits, and HTML markup in typical files."</content>
</entry>
<entry>
<title>Slang: Support UTF-8 with Byte Order Markers (#4135)</title>
<updated>2024-05-14T18:05:58+00:00</updated>
<author>
<name>cheneym2</name>
<email>acheney@nvidia.com</email>
</author>
<published>2024-05-14T18:05:58+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=291b4cd82cebeed39d8c06c8208fc415dfa32a48'/>
<id>urn:sha1:291b4cd82cebeed39d8c06c8208fc415dfa32a48</id>
<content type='text'>
Slang APIs are documented as taking UTF-8 encoded shader source,
though it's not explicitly documented whether it is allowed to
include a BOM (Byte Order Marker). This change adds support for
UTF-8 BOM markers by virtue of disposing of BOM data. As a bonus,
UTF-16 input which can cleanly decode to UTF-8 is now also
accepted.

Throwing out the BOM on input is done by leveraging existing
functionality in "determineEncoding()", however a bug exists there
for null-terminated single character input, where the null byte
caused a heuristic to guess UTF-16, even though the null byte
isn't part of the string. The bug in "determineEncoding" is fixed
by only guessing when bytes &gt;= 2 and not looking past the end
of the buffer. The 'implicit-cast' test was mistakenly relying
on the bug to pass, as its expected file was being read as UTF16
and cropped to zero length due to the bug. The expected output
of implicit-cast is updated to pass with the bug fix in place.

The decoding of UTF-16 to UTF-8 is done through an existing
'decode' method. This change fixes a bug in UTF16-LE 'decode'
where it was decoded as if it were Big-Endian.

Adds 3 small tests to ensure the compiler doesn't choke on source
files in UTF-8 (with BOM), UTF16-LE, or UTF16-BE.

Bonus: Fixes a bug in diagnostic reporting where hex values were
incorrectly translated to text, leading to incorrect, possibly
truncated strings.

Fixes #4046

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<entry>
<title>Add API for querying and reusing precompiled binary modules. (#3614)</title>
<updated>2024-02-22T15:14:55+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-02-22T15:14:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=8ec5b3e6ef2e7e5c3adaa5accb375676b1c09ff0'/>
<id>urn:sha1:8ec5b3e6ef2e7e5c3adaa5accb375676b1c09ff0</id>
<content type='text'>
</content>
</entry>
<entry>
<title>Support `include` for pulling file into the current module. (#3377)</title>
<updated>2023-12-05T18:06:19+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2023-12-05T18:06:19+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1050e0eb96d6c8e7a6cfb253458155e1014625c3'/>
<id>urn:sha1:1050e0eb96d6c8e7a6cfb253458155e1014625c3</id>
<content type='text'>
* Support `include` for pulling file into the current module.

* Add auto-completion, hover info and goto-def support.

* Disable warning for missing `module` declaration for now.

---------

Co-authored-by: Yong He &lt;yhe@nvidia.com&gt;</content>
</entry>
<entry>
<title>Use ankerl/unordered_dense as a hashmap implementation (#3036)</title>
<updated>2023-08-16T00:57:47+00:00</updated>
<author>
<name>Ellie Hermaszewska</name>
<email>ellieh@nvidia.com</email>
</author>
<published>2023-08-16T00:57:47+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=45d9961a6a86d184248ef84f6a07125b0c224f97'/>
<id>urn:sha1:45d9961a6a86d184248ef84f6a07125b0c224f97</id>
<content type='text'>
* Correct namespace for getClockFrequency

* missing const

* Add missing assignment operator

* Remove unused variables

* Return correct modified variable

* Use stable hash code for file system identity

* terse static_assert

* Structured binding for map iteration

* Make (==) and getHashCode const on many structs

* Add ConstIterator for LinkedList

* Replace uses of ItemProxy::getValue with Dictionary::at

* Extract list of loads from gradientsMap before updating it

* Const correctness in type layout

* Add unordered_dense hashmap submodule

* Use wyhash or getHashCode in slang-hash.h

* refactor slang-hash.h

* Use ankerl/unordered_dense as a hashmap implementation

Notable changes:
- The subscript operator returns a reference directly to the value,
  rather than a lazy ItemProxy (pair of dict pointer and key)

slang-profile time (95% over 10 runs):

- Before: 6.3913906 (±0.0746)
- After:  5.9276123 (±0.0964)

* 64 bit hash for strings

So they have the same hash as char buffers with the same contents

* Narrowing warnings for gcc to match msvc

* revert back to c++17

* Correct c++ version for msvc

* Use path to unordered_dense which keeps tests happy

* Do not assign to and read from map in same expression

* Remove redundant map operations in primal-hoist

* Split out stable hash functions into slang-stable-hash.h

* 64 bit hash by default

* regenerate vs projects

* Correct return type from HashSetBase::getCount()

* correct width for call to Dictionary::reserve

* Use stable hash for obfuscated module ids

* Signed int for reserve

* clearer variable naming

* Parameterize Dictionary on hash and equality functors

* Allow heterogenous lookup for Dictionary

* missing const

* Use set over operator[] in some places

* Remove unused function

* s/at/getValue</content>
</entry>
<entry>
<title>nsight Aftermath crash example (#2984)</title>
<updated>2023-07-18T22:45:38+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2023-07-18T22:45:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=1fe5e83f3dcc8ef0efa2dd083ebdfab5d0f101a9'/>
<id>urn:sha1:1fe5e83f3dcc8ef0efa2dd083ebdfab5d0f101a9</id>
<content type='text'>
* Small fixes and improvements around reflection tool.

* Make PrettyWriter printing a class.

* Aftermath crash demo WIP.

* Enable aftermath in test project.

* Setting failCount.

* Dumping out of source maps.

* Improve comments.
Simplify handling of compile products.

* Other small fixes to aftermath example.

* Added Emit SourceLocType.
Track sourcemap association meaning.
Improved documentation.

* Small improvements.

* Capture debug information for D3D11/D3D12/Vulkan.

* Enable debug info.

* Small improvements.

* Improve aftermath example README.md.</content>
</entry>
<entry>
<title>Dictionary using lowerCamel (#2835)</title>
<updated>2023-04-25T14:43:29+00:00</updated>
<author>
<name>jsmall-nvidia</name>
<email>jsmall@nvidia.com</email>
</author>
<published>2023-04-25T14:43:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0'/>
<id>urn:sha1:7b7c095b37e85ca3a8f55eff1c3d9643d467b8e0</id>
<content type='text'>
* #include an absolute path didn't work - because paths were taken to always be relative.

* WIP lowerCamel Dictionary.

* WIP more lowerCamel fixes for Dictionary.

* Add/Remove/Clear

* GetValue/Contains

* Fix tabs in dictionary.
Count -&gt; getCount

* Fix fields with caps.

* Key -&gt; key
Value -&gt; value
Use m_ for members where appropriate.
Use lowerCamel in linked list.

* Some small fixes/improvements to Dictionary.

* Kick CI.</content>
</entry>
</feed>
