yum-mirror/slang
Making it easier to work with shaders
git clone https://git.yummers.dev/yum-mirror/slang
725985528
master
1//TEST_DISABLED:COMPARE_HLSL: -profile vs_5_0 2 3// Check output for `do` loops 4 5cbuffer C :register ( b0 ) 6{ 7int n ; 8}; 9 10float4 main () : SV_Position 11{ 12float4 x = 0 ; 13int i = n ; 14{ 15do 16{ 17x = ( x + ( float ) 1 ) * x ; 18 19// Note(tfoley): The "right" thing here would be 20// `i--`, but that leads to a subtle difference 21// in the final code between just invokeing `fxc` 22// and invoking it on the Slang-generated output 23// (despite the generated HLSL for this line being 24// identical, modulo some `#line` directives). 25// 26// I'm using a binary operator that will yield 27// the same code with its operands swapped, just 28// to work around it. A better long-term fix 29// is to have this test be an end-to-end test 30// that we execute. 31i = i * i ; 32} while (( bool ) i ); 33} 34return x ; 35}