https://github.com/shader-slang/slang
Raw File
Tip revision: 3572f7f833a2e3019f31b6c55a20cd678c8e01e8 authored by lucy96chen on 22 April 2022, 00:05:05 UTC
Treat warnings as errors in slang-gfx (#2201)
Tip revision: 3572f7f
negative-literal.slang
//TEST(compute):COMPARE_COMPUTE_EX:-cpu -compute -compile-arg -O3 -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -shaderobj
//TEST(compute):COMPARE_COMPUTE_EX:-slang -compute -dx12 -shaderobj
//TEST(compute, vulkan):COMPARE_COMPUTE_EX:-vk -compute -shaderobj

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name outputBuffer
RWStructuredBuffer<float> outputBuffer;

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
    float v = asfloat((int(dispatchThreadID.x) & -2147483648) | 1065353216);
	outputBuffer[dispatchThreadID.x] = v;
}
back to top