Add passes to legalization to preserve source line info when generated.

This commit is contained in:
Greg Fischer 2018-11-28 11:10:27 -07:00
parent b23d232ec5
commit 5620a2f95e
4 changed files with 220 additions and 0 deletions

42
Test/hlsl.pp.line4.frag Normal file
View file

@ -0,0 +1,42 @@
#line 1 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
Texture2D g_tColor [ 128 ] ;
layout ( push_constant ) cbuffer PerViewConstantBuffer_t
{
uint g_nDataIdx ;
uint g_nDataIdx2 ;
bool g_B ;
} ;
#line 12
SamplerState g_sAniso ;
struct PS_INPUT
{
float2 vTextureCoords : TEXCOORD2 ;
} ;
struct PS_OUTPUT
{
float4 vColor : SV_Target0 ;
} ;
PS_OUTPUT MainPs ( PS_INPUT i )
{
PS_OUTPUT ps_output ;
uint u ;
if ( g_B )
#line 1 "C:\\Users\\Greg\\shaders\\line\\u1.h"
u = g_nDataIdx ;
#line 31 "C:\\Users\\Greg\\shaders\\line\\foo4.frag"
else
u = g_nDataIdx2 ;
ps_output . vColor = g_tColor [ u ] . Sample ( g_sAniso , i . vTextureCoords . xy ) ;
return ps_output ;
}