<feed xmlns='http://www.w3.org/2005/Atom'>
<title>slang.git/tests/pipeline/tessellation, 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-07-22T21:29:57+00:00</updated>
<entry>
<title>Fix scalar to array conversion for tessellation factors (#7837)</title>
<updated>2025-07-22T21:29:57+00:00</updated>
<author>
<name>Yong He</name>
<email>yonghe@outlook.com</email>
</author>
<published>2025-07-22T21:29:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.yummers.dev/slang.git/commit/?id=b16d4e955fdba3d68d156f944260f8b7a157fd4d'/>
<id>urn:sha1:b16d4e955fdba3d68d156f944260f8b7a157fd4d</id>
<content type='text'>
* Fix scalar to array conversion for tessellation factors in GLSL legalization

Add scalar-to-array conversion support in adaptType() function to handle
cases where users declare scalar tessellation factors (e.g., float TessLevelInner)
but GLSL requires arrays (float[2] for gl_TessLevelInner). This prevents the
generation of BuiltinCast instructions that crash the SPIR-V emitter.

Fixes crash: "unimplemented: Unhandled local inst in spirv-emit: BuiltinCast"

- Add scalar-to-array case in slang-ir-glsl-legalize.cpp adaptType()
- Fill all array elements with the scalar value for tessellation factors
- Add test case for scalar tessellation factor conversion

Fixes #7000

Co-authored-by: Yong He &lt;csyonghe@users.noreply.github.com&gt;

* Apply review feedback fixes

- Change test directive to TEST:SIMPLE
- Use IRArrayType instead of IRArrayTypeBase
- Use MakeArrayFromElement for cleaner scalar-to-array conversion

Co-authored-by: Yong He &lt;csyonghe@users.noreply.github.com&gt;

* Fix type conversion in scalar-to-array tessellation factor conversion

Convert scalar value to array element type before creating array to handle
cases where scalar type differs from array element type (e.g., int to float[3]).

Co-authored-by: Yong He &lt;csyonghe@users.noreply.github.com&gt;

* Use CHECK-DAG for order-independent tessellation factor checks

Co-authored-by: Yong He &lt;csyonghe@users.noreply.github.com&gt;

---------

Co-authored-by: github-actions[bot] &lt;41898282+github-actions[bot]@users.noreply.github.com&gt;
Co-authored-by: Yong He &lt;csyonghe@users.noreply.github.com&gt;</content>
</entry>
</feed>
