<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/spirv/spec-constant-sized-array-4.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>2025-05-16T00:01:08+00:00</updated>
<entry>
<title>Fix broken -emit-spirv-via-glsl test option (#7091)</title>
<updated>2025-05-16T00:01:08+00:00</updated>
<author>
<name>sricker-nvidia</name>
<email>115114531+sricker-nvidia@users.noreply.github.com</email>
</author>
<published>2025-05-16T00:01:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b39ec87cccaadebbb9325dd2adb8c0b13b364805'/>
<id>urn:sha1:b39ec87cccaadebbb9325dd2adb8c0b13b364805</id>
<content type='text'>
Fixes issue #6898

The -emit-spirv-via-glsl slang-test option has been broken for
some amount of time. Tests that were using it were operating as
if using -emit-spirv-directly, leading to many duplicated tests.

After fixing the test option, there were an number of errors that
appeared as a result.

This change fixes the broken test option and the resulting test
errors. Some of the test errors revealed some legitimate issues,
such as:

-The GLSL bitCount instrinsic only supports 32-bit integers and
 requires emulation for other bit widths.
-Emitting GLSL 8-bit and 16-bit glsl integer types did not emit
 the proper extension requirements
-Emitting GLSL and casting for 16-bit integers was missing a
 closing parenthesis.
-Missing profile for GL_EXT_shader_explicit_arithmetic_types
-Missing toType cases for UInt8/Int8 for the kIROp_BitCast case
 in tryEmitInstExprImpl.</content>
</entry>
<entry>
<title>support specialization constant sized array (#6871)</title>
<updated>2025-05-14T17:11:53+00:00</updated>
<author>
<name>kaizhangNV</name>
<email>149626564+kaizhangNV@users.noreply.github.com</email>
</author>
<published>2025-05-14T17:11:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=375ecfe2903b09f07abeba2eafb88d9a564c1458'/>
<id>urn:sha1:375ecfe2903b09f07abeba2eafb88d9a564c1458</id>
<content type='text'>
Close #6859

Goal of this PR
We want to support an array whose size can be specialization constant for shared/global variable e.g.

layout (constant_id = 0) const uint BLOCK_SIZE = 64;
shared float buf_a[(BLOCK_SIZE + 5) * 4];
Overview of the solution:

During IndexExpr check, we will loose the restriction to allow SpecConst passing, but the size parameter will not be a constant value because it cannot be folded into a constant, so we will make it follow the same logic as generic parameter value, and the size will be represented by FuncCallIntVal/PolynomialIntVal/DeclRefIntVal.

During IR lowering, we will detect whether there is spec constant in the IntVal, and wrap the IRInst with a SpecConstRateType, and propagate the type though the lowering logic, such that the IntVal representing the array size will have SpecConstRateType.

During spirv emit stage, if we detect that a IRInst has SpecConstRateType, we will emit it as SpecConstantOp.

We have to implement new logic to emit OpSpecConstantOp, the existing emit logic doesn't support emitting OpSpecConstantOp, especially this op can embed arithmetic operation at global scope, where we can only emit arithmetic instruct at local. But there are only few instructs we need to support.

Overview of the solution:
This PR doesn't support generic, and we will create a separate PR to extend that, tracked in #6840.</content>
</entry>
</feed>
