https://github.com/shader-slang/slang
Raw File
Tip revision: 7a1b6deff067b393041e90eb6b1ac6a62dedd5dd authored by jsmall-nvidia on 31 July 2020, 16:25:58 UTC
Fix for bug where memory that has been allocated with new T[] (within a list) is freed with free in the RiffContainer. (#1473)
Tip revision: 7a1b6de
callable-caller.slang
// callable-caller.slang

//TEST:CROSS_COMPILE: -profile sm_6_3 -stage raygeneration -entry main -target spirv-assembly

import callable_shared;

cbuffer C
{
	uint shaderIndex;
};

RWTexture2D<float4> gImage;

void main()
{
	MaterialPayload payload;
	payload.albedo = 0;
	payload.uv = float2(DispatchRaysIndex().xy) / float2(DispatchRaysDimensions().xy);

	CallShader(shaderIndex, payload);

	gImage[DispatchRaysIndex().xy] = payload.albedo;
}
back to top