https://github.com/shader-slang/slang
Raw File
Tip revision: bc0d0f9e2a5a7297d8559a2ee1e3bd59454813cf authored by Tim Foley on 27 August 2020, 17:46:50 UTC
Clean up the way that lookup "through" a base type is encoded (#1519)
Tip revision: bc0d0f9
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