https://github.com/shader-slang/slang
Raw File
Tip revision: 5ea746a571ced32a8975eb3a238c562b3d487149 authored by Tim Foley on 31 July 2018, 16:02:22 UTC
Fix imageStore output for types other than 4-vectors (#622)
Tip revision: 5ea746a
parameter-block.slang
//TEST(compute):COMPARE_COMPUTE:

//TEST_INPUT:ubuffer(data=[0 0 0 0], stride=4):dxbinding(0),glbinding(0),out
//TEST_INPUT:ubuffer(data=[0 1 2 3], stride=4):dxbinding(1),glbinding(1)

// Ensure that Slang `ParameterBlock` type is lowered
// to HLSL in the fashion that we expect.

struct P
{
	RWStructuredBuffer<int> buffer;
};

ParameterBlock<P> block0;
ParameterBlock<P> block1;

[numthreads(4, 1, 1)]
void computeMain(uint3 dispatchThreadID : SV_DispatchThreadID)
{
	uint tid = dispatchThreadID.x;

	int inVal = block1.buffer[tid];

	int outVal = inVal;

	block0.buffer[tid] = outVal;
}
back to top