yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

Simon Kallweitupdate slang-rhi (#6587)ae1a5e408

master
628 B17 linesraw
1// Test that we can translate textures whose element type is a small integer type to valid spirv.
2
3//TEST(compute, vulkan):COMPARE_COMPUTE_EX(filecheck-buffer=CHECK):-vk -compute -output-using-type -emit-spirv-directly
4
5//TEST_INPUT: RWTexture2D(format=R8Uint, size=4, content = one, mipMaps = 1):name g_Image
6RWTexture2D<uint8_t> g_Image;
7
8//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):out,name=outputBuffer
9RWStructuredBuffer<int> outputBuffer;
10
11[numthreads(1, 1, 1)]
12void computeMain(int id: SV_DispatchThreadID) {
13    g_Image[id] = uint8_t(23);
14    AllMemoryBarrier();
15    // CHECK: 23
16    outputBuffer[0] = g_Image[id];
17}