<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/cross-compile/vk-push-constant-set.slang, 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-06-08T12:12:49+00:00</updated>
<entry>
<title>SPIRV `Block` decoration fixes. (#4303)</title>
<updated>2024-06-08T12:12:49+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2024-06-08T12:12:49+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=9a23a9aab3721828526c921db1e779008e133e8f'/>
<id>urn:sha1:9a23a9aab3721828526c921db1e779008e133e8f</id>
<content type='text'>
* SPIRV `Block` decoration fixes.

- SPIRV does not allow duplicate `Block` decorations. So we shouldn't be generating them.

- Also fixes duplication of OpName.

- SPIRV and HLSL do not allow ConstantBuffer with trailing unsized arrays. Added a check in the front-end against such code.

* Convert failing cross-compile tests to filecheck.

---------

Co-authored-by: Jay Kwak &lt;82421531+jkwak-work@users.noreply.github.com&gt;</content>
</entry>
<entry>
<title>Don't allocate a default space for a VK push-constant buffer (#1231)</title>
<updated>2020-02-19T22:36:44+00:00</updated>
<author>
<name>Tim Foley</name>
<email>tfoleyNV@users.noreply.github.com</email>
</author>
<published>2020-02-19T22:36:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=788556aaaab1b5767e24cf86dc2f71fd285c06f5'/>
<id>urn:sha1:788556aaaab1b5767e24cf86dc2f71fd285c06f5</id>
<content type='text'>
When a shader only uses `ParameterBlock`s plus a single buffer for root constants:

```hlsl
ParameterBlock&lt;A&gt; a;
ParameterBlock&lt;B&gt; b;

[[vk::push_constant]] cbuffer Stuff { ... }
```

we expect the push-constant buffer should not affect the `space` allocated to the parameter blocks (so `a` should get `space=0`).

This behavior wasn't being implemented correctly in `slang-parameter-binding.cpp`. There was logic to ignore certain resource kinds in entry-point parameter lists when computing whether a default space is needed, but the equivalent logic for the global scope only considered parameters that consuem whole register spaces/sets.

This change shuffles the code around and makes sure it considers a global push-constant buffer as *not* needing a default space/set.

Note that this change will have no impact on D3D targets, where `Stuff` above would always get put in `space0` because for D3D targets a push-constant buffer is no different from any other constant buffer in terms of register/space allocation.

One unrelated point that this change brings to mind is the `[[vk::push_constant]]` should ideally also be allowed to apply to an entry point (where it would modify the default/implicit constant buffer). In fact, it could be argued that push-constant allocation should be the *default* for (non-RT) entry point `uniform` parameters (while `[[vk::shader_record]]` should be the default for RT entry point `uniform` parameters).</content>
</entry>
</feed>
