slang
slang copied to clipboard
Support glslang [[spv::format_formatName]] syntax
nv-ray-tracing-motion-blur.slang & raygen.slang both used for the output image:
layout(rgba8)
RWTexture2D<float4> outputImage;
glslang cross compiles this (HLSL->SPIR-V) incorrectly into:
%251 = OpTypeImage %float 2D 0 0 0 2 Rgba32f
Slang does not follow this behavior due to parsing a format modifier from layout(format)
.
Slang outputs %251 = OpTypeImage %float 2D 0 0 0 2 Rgba8f
glslang covers the incorrect compiling case with the solution of [[spv::format_rgba8]]
as general syntax for specifying layout if spirv is the target. Slang should support this syntax to properly compile with a larger subset of GLSL syntax.