<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/reflection/binding-push-constant-gl.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>2025-08-01T09:18:53+00:00</updated>
<entry>
<title>Fix 7441: CUDA boolean vector layout to use 1-byte elements (#7862)</title>
<updated>2025-08-01T09:18:53+00:00</updated>
<author>
<name>Harsh Aggarwal (NVIDIA)</name>
<email>haaggarwal@nvidia.com</email>
</author>
<published>2025-08-01T09:18:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=bdda8a90cdd44ca822b21233ac988f92d1f20826'/>
<id>urn:sha1:bdda8a90cdd44ca822b21233ac988f92d1f20826</id>
<content type='text'>
* Fix 7441: CUDA boolean vector layout to use 1-byte elements

Boolean vectors (bool1, bool2, bool3, bool4) were incorrectly implemented
as integer-based types using 4 bytes per element instead of actual 1-byte
boolean elements on CUDA targets.

Changes:
- Update CUDA prelude to define boolean vectors as structs with bool fields
  instead of typedef aliases to integer vectors
- Implement CUDALayoutRulesImpl::GetVectorLayout to use 1-byte alignment
  for boolean vectors, matching actual CUDA memory layout behavior
- Update make_bool functions to populate struct fields correctly

This ensures boolean vectors have the same memory layout as bool[4] arrays:
- bool1: 1 byte (was 4 bytes)
- bool2: 2 bytes (was 8 bytes)
- bool3: 3 bytes (was 12 bytes)
- bool4: 4 bytes (was 16 bytes)

Fixes memory layout mismatch between Slang reflection API and actual
CUDA compilation, achieving 75% memory savings for boolean vector usage.

* Fix CI issues -

Add and update associated functions and operators

* Make boolX same as uchar

* Use align construct on struct for boolX

* Improve Test case for robust alignment checks

* Formatting

* Disable selected slangpy tests

* add metal check which is slightly different than cuda

* Test-1

* Test-2

* Test-3

* Test-4

* ReflectionChange

* cleanup and update

* _slang_select with plain bool is needed for reverse-loop-checkpoint-test</content>
</entry>
<entry>
<title>Add inner texture type to reflection json (#6416)</title>
<updated>2025-02-28T01:52:14+00:00</updated>
<author>
<name>Devon</name>
<email>devonrutledge03@gmail.com</email>
</author>
<published>2025-02-28T01:52:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=cd20e94af9f384c03e8be69f6c8ce9e97212cc9b'/>
<id>urn:sha1:cd20e94af9f384c03e8be69f6c8ce9e97212cc9b</id>
<content type='text'>
* Add inner texture type to reflection json

* Add expected result of test

* Adjust test expected results

* Fix ci test result

---------

Co-authored-by: Yong He &lt;yonghe@outlook.com&gt;</content>
</entry>
<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>Add datalayout for constant buffers. (#5608)</title>
<updated>2024-11-21T22:07:23+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-11-21T22:07:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=fdf061e278720ec066a1fac8f1f35a22e817bf2d'/>
<id>urn:sha1:fdf061e278720ec066a1fac8f1f35a22e817bf2d</id>
<content type='text'>
* Add datalayout for constant buffers.

* Fixes.

* Fix test.

* Fix glsl codegen.

* Update spirv-specific doc.

* Fix test.

* Fix binding in the presense of specialization constants.

* address comments.

* Add a test for constant buffer layout.</content>
</entry>
<entry>
<title>Cover a few corner cases in reflection API (#1163)</title>
<updated>2020-01-08T22:45:06+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-01-08T22:45:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=0a856f458ff9f17d76bc646d008602713c6c66d1'/>
<id>urn:sha1:0a856f458ff9f17d76bc646d008602713c6c66d1</id>
<content type='text'>
This change adds some new entry points to the reflection API to cover corner cases that a majority of applications won't care about.
These are most likely to come up for users who want to make a complete copy of the Slang reflection information into a data format of their own design.

All of the information is stuff that we already computed as part of layout, and just hadn't exposed:

* Alignment information for type layouts. This is only useful for ordinary/uniform data; in all other cases alignment is always one. Even for uniform/ordinary data, it is unlikely that any application would actually make use of it.

* Layout information for the result of an entry point function. This would be useful for applications that need to enumerate the varying outputs (user- or system-defined) of a shader. Having information available for `out` parameters but not the function result was inconsistent.

* The "element type" of a parameter block type (e.g., going from `ParameterBlock&lt;X&gt;` to `X`). This seems to have been an oversight since `ConstantBuffer&lt;X&gt;` appears to have been implemented, and the case for a type *layout* was handled.

* The "container" variable layout for a parameter block or constant buffer. It took a while for us to arrive at the current representation of layout for parameter groups, and most client code continues to use the original API that requires us to generated kludged "do what I mean" data. However, if we don't expose the more useful new representation fully, there is no way for users to take advantage of it!

The reflection test tool has been updated to print the new information where it makes sense, which provides us some level of coverage for the new code.
Unfortunately, this led to some cascading changes:

* First, a bunch of the tests had their output changed since they include new information. That's the easy bit.

* Next, the "container" and "element" var layouts don't actually have names (because there is no actual variable underlying them), which means that the code to emit variable names in the JSON dump needed to be condition.

* Making the `"name"` output conditional messed up a lot of the delicate logic that had been dealing with when to emit commas for the output JSON (JSON uses commas as separators, and doesn't allow trailing commas). I added a bit of new infrastructure to make it simple(-ish) to track when a comma actually needs to be output.</content>
</entry>
<entry>
<title>Remove the "hack sampler" workaround (#648)</title>
<updated>2018-09-21T18:12:23+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2018-09-21T18:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=7250ed1e73351b6f3f72d6a42a90f2878f78b0f8'/>
<id>urn:sha1:7250ed1e73351b6f3f72d6a42a90f2878f78b0f8</id>
<content type='text'>
* Update glslang version

* Fix build for new glslang

The latest glslang required a few changes to our manual build for their code (because we are *not* taking a dependency on CMake).

* Rebuild project files using premake, which picks up a few files added to glslang, but also a few diffs in Slang's own project files in cases where they were edited manually instead of using premake.

* Fix up the declaration our our device limits (which are inentionally set to *not* limit what code passes through our glslang), because the underlying structure definition in glslang has changed. This is a kludgy bit of glslang's design, but it doesn't make sense for us to invest in a more serious workaround.

* Remove the "hack sampler" workaround

When the `GL_KHR_vulkan_glsl` spec was introduced to allow GLSL to be compiled for Vulkan SPIR-V, it made an annoying mistake by leaving a few builtins as taking `sampler2D`, etc. when the equivalent SPIR-V operations only require a `texture2D`, etc. The relevant builtins are:

* `textureSize`
* `textureQueryLevels`
* `textureSamples`
* `texelFetch`
* `texelFetchOffset`

This means that shader code that wanted to use those operations needed to conspire to have a `sampler` handy so they could write, e.g.:

```glsl
vec4 val = texelFetch(sampler2D(myTexture, someRandomSampler), p, lod);
```

when what they really wanted was this:

```glsl
vec4 val = texelFetch(myTexture, p, lod);
```

That is annoying but probably something each to work around for a GLSL programmer, but when cross-compiling from HLSL, you might have an operation like:

```hlsl
float4 val = myTexure.Load(p);
```

in which case a cross-compiler needs to manufacture a sampler out of thin air. If the shader happened to use a sampler for something else you could snag that, but in the worse case you had to cross-compile to GLSL that declared a new sampler.

Slang did this by declaring a sampler called `SLANG_hack_samplerForTexelFetch` (because `texelFetch` is the operation that first surfaced the issue). For complex reasons we *always* define this sampler, even if we turn out not to need it in a particular output kernel. This choice has a bunch of annoying consequences:

* There is *always* a sampler defined in descriptor set zero, because that's where we put the hack sampler, so a user-defined parameter block always has a set number of 1 or greater (see #646).

* The hack sampler shows up in reflection output because users need to size their descriptor sets appropriately to pass along this sampler that won't actually be used if they don't want to get debug spew from the validation layers.

We filed an issue on glslang about this problem, and eventually some kind folks from the gamedev community (who also saw the same problem) defined an extension spec (`GL_EXT_samplerless_texture_functions`) to fix the underlying issue and contributed a patch to glslang to make it support that extension.

This change just backs the hack out of Slang now that we have a glslang version that supports the extension to get past the defect in the original GLSL-for-Vulkan definition. Besides yanking out the code for the hack, we also change the relevant builtins to declare that they require this new GLSL extension (so that we properly request it from glslang when the builtins are used), and fix some reflection test cases that exposed the existence of the "hack sampler."

* Fixup: syntax error in stdlib generator files

* Remove more code for hack sampler

There was logic to ensure we always have a "default" register space/set when cross-compiling, because the hack sampler would need it. This is no longer necessary once we remove the hack sampler.

* Fix expected test output.

Fixing the root cause of issue #646 means that one of our test cases that tickles that issue now produces different output (luckily it can now be used as a regression test for the issue).
</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>
</feed>
