diff options
| author | jsmall-nvidia <jsmall@nvidia.com> | 2018-10-04 10:25:36 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2018-10-04 10:25:36 -0400 |
| commit | 84a48475067af70c9acccc9816dd60e623714328 (patch) | |
| tree | ecb4fbc2932a3a5771a0240af367c7712f5fc620 /tests/hlsl | |
| parent | eaafafe772366a23ed847cbb10770c72aa5cfc28 (diff) | |
Remove need of IRHightLevelDecoration in emit (#660)
* * Remove the need for IRHighLevelDecoration in Emit
* Use the IRLayoutDecoration for GeometryShaderPrimitiveTypeModifier
* Fixing problems with comparison due to naming differences with slang/fxc.
Diffstat (limited to 'tests/hlsl')
| -rw-r--r-- | tests/hlsl/dxsdk/FluidCS11/FluidRender.hlsl | 26 |
1 files changed, 19 insertions, 7 deletions
diff --git a/tests/hlsl/dxsdk/FluidCS11/FluidRender.hlsl b/tests/hlsl/dxsdk/FluidCS11/FluidRender.hlsl index cf1e7c227..496240dc9 100644 --- a/tests/hlsl/dxsdk/FluidCS11/FluidRender.hlsl +++ b/tests/hlsl/dxsdk/FluidCS11/FluidRender.hlsl @@ -1,5 +1,17 @@ -//TEST_IGNORE_FILE: Currently failing due to Slang compiler issues. -//TEST:COMPARE_HLSL: -target dxbc-assembly -profile vs_4_0 -entry ParticleVS -profile gs_4_0 -entry ParticleGS -profile ps_4_0 -entry ParticlePS +//TEST:COMPARE_HLSL:-no-mangle -target dxbc-assembly -profile vs_4_0 -entry ParticleVS -profile gs_4_0 -entry ParticleGS -profile ps_4_0 -entry ParticlePS + +#ifndef __SLANG__ +#define ParticlesRO ParticlesRO_0 +#define ParticleDensityRO ParticleDensityRO_0 +#define cbRenderConstants cbRenderConstants_0 +#define g_mViewProjection g_mViewProjection_0 +#define g_fParticleSize g_fParticleSize_0 +#define density density_0 +#define position position_0 +#define velocity velocity_0 + +#endif + //-------------------------------------------------------------------------------------- // File: FluidRender.hlsl // @@ -56,7 +68,7 @@ static const float4 Rainbow[5] = { float4 VisualizeNumber(float n) { - return lerp( Rainbow[ floor(n * 4.0f) ], Rainbow[ ceil(n * 4.0f) ], frac(n * 4.0f) ); + return lerp( Rainbow[ int(floor(n * 4.0f)) ], Rainbow[ int(ceil(n * 4.0f)) ], frac(n * 4.0f) ); } float4 VisualizeNumber(float n, float lower, float upper) @@ -69,9 +81,9 @@ float4 VisualizeNumber(float n, float lower, float upper) // Vertex Shader //-------------------------------------------------------------------------------------- -VSParticleOut ParticleVS(uint ID : SV_VertexID) +VSParticleOut ParticleVS(uint ID : SV_VERTEXID) { - VSParticleOut Out = (VSParticleOut)0; + VSParticleOut Out; // = { { 0, 0 } , { 0, 0, 0, 0 } }; // (VSParticleOut)0; Out.position = ParticlesRO[ID].position; Out.color = VisualizeNumber(ParticleDensityRO[ID].density, 1000.0f, 2000.0f); return Out; @@ -91,7 +103,7 @@ void ParticleGS(point VSParticleOut In[1], inout TriangleStream<GSParticleOut> S [unroll] for (int i = 0; i < 4; i++) { - GSParticleOut Out = (GSParticleOut)0; + GSParticleOut Out; // = (GSParticleOut)0; float4 position = float4(In[0].position, 0, 1) + g_fParticleSize * float4(g_positions[i], 0, 0); Out.position = mul(position, g_mViewProjection); Out.color = In[0].color; @@ -106,7 +118,7 @@ void ParticleGS(point VSParticleOut In[1], inout TriangleStream<GSParticleOut> S // Pixel Shader //-------------------------------------------------------------------------------------- -float4 ParticlePS(GSParticleOut In) : SV_Target +float4 ParticlePS(GSParticleOut In) : SV_TARGET { return In.color; } |
