diff options
| author | assiduous <assiduous@diligentgraphics.com> | 2019-12-25 03:23:32 +0000 |
|---|---|---|
| committer | assiduous <assiduous@diligentgraphics.com> | 2019-12-25 03:23:32 +0000 |
| commit | 040e4cb7e454d532d249d2a5de6f2aba0c902baa (patch) | |
| tree | c89a3a009e2d145c3c3cfdb053ad7392eedf6d98 /Tests/TestApp/assets/Shaders | |
| parent | Added codacy bages (diff) | |
| download | DiligentEngine-040e4cb7e454d532d249d2a5de6f2aba0c902baa.tar.gz DiligentEngine-040e4cb7e454d532d249d2a5de6f2aba0c902baa.zip | |
Updated submodules; removed tests folder (tests are now part of every submodule)
Diffstat (limited to 'Tests/TestApp/assets/Shaders')
43 files changed, 0 insertions, 1000 deletions
diff --git a/Tests/TestApp/assets/Shaders/CSTest/FillTextureDX.csh b/Tests/TestApp/assets/Shaders/CSTest/FillTextureDX.csh deleted file mode 100644 index 0006edd..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/FillTextureDX.csh +++ /dev/null @@ -1,14 +0,0 @@ - -RWTexture2D<unorm float4> g_tex2DTestUAV; - -[numthreads(16,16,1)] -void main(uint3 DTid : SV_DispatchThreadID) -{ - uint2 ui2Dim; - g_tex2DTestUAV.GetDimensions(ui2Dim.x, ui2Dim.y); - if( DTid.x >= ui2Dim.x || DTid.y >= ui2Dim.y )return; - - float2 f2UV = float2(DTid.xy) / float2(ui2Dim); - float DistFromCenter = length(f2UV - float2(0.5,0.5)); - g_tex2DTestUAV[DTid.xy] = float4((1-DistFromCenter), abs(f2UV.x-0.5), abs(0.5-f2UV.y), 0.0); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/FillTextureGL.csh b/Tests/TestApp/assets/Shaders/CSTest/FillTextureGL.csh deleted file mode 100644 index 0459cc1..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/FillTextureGL.csh +++ /dev/null @@ -1,17 +0,0 @@ - -layout(rgba8, binding = 2) uniform writeonly image2D g_tex2DTestUAV; - -layout (local_size_x = 16, local_size_y = 8, local_size_z = 1) in; - -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - ivec2 Dim = imageSize(g_tex2DTestUAV); - if( gl_GlobalInvocationID.x >= uint(Dim.x) || gl_GlobalInvocationID.y >= uint(Dim.y) ) - return; - - vec2 f2UV = vec2( ivec2(gl_GlobalInvocationID.xy) % Dim ) / vec2(Dim); - float DistFromCenter = length(f2UV - vec2(0.5,0.5)); - imageStore(g_tex2DTestUAV, ivec2(gl_GlobalInvocationID.xy), vec4((1.0-DistFromCenter), abs(f2UV.x-0.5), abs(0.5-f2UV.y), 0.0) ); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffDX.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffDX.csh deleted file mode 100644 index c930789..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffDX.csh +++ /dev/null @@ -1,9 +0,0 @@ - -RWBuffer<uint4> bufIndirectDispatchArgs; - -[numthreads(1,1,1)] -void main(uint3 DTid : SV_DispatchThreadID) -{ - bufIndirectDispatchArgs[0] = uint4(0,0,0,0); - bufIndirectDispatchArgs[1] = uint4(1,1,1,0); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffGL.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffGL.csh deleted file mode 100644 index 6f44c48..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateDispatchArgsBuffGL.csh +++ /dev/null @@ -1,22 +0,0 @@ - -// Declare input/output buffer from/to wich we will read/write data. -// In this particular shader we only write data into the buffer. -// If you do not want your data to be aligned by compiler try to use: -// packed or shared instead of std140 keyword. -// We also bind the buffer to index 0. You need to set the buffer binding -// in the range [0..3] – this is the minimum range approved by Khronos. -// Notice that various platforms might support more indices than that. -layout(std140, binding = 3) buffer bufIndirectDispatchArgs -{ - uvec4 data[]; -}g_DispatchArgs; - - -layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in; -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - g_DispatchArgs.data[0] = uvec4(0,0,0,0); - g_DispatchArgs.data[1] = uvec4(1,1,1,0); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffDX.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffDX.csh deleted file mode 100644 index 2c754d5..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffDX.csh +++ /dev/null @@ -1,9 +0,0 @@ - -RWBuffer<uint4> bufIndirectDrawArgs; - -[numthreads(1,1,1)] -void main(uint3 DTid : SV_DispatchThreadID) -{ - bufIndirectDrawArgs[0] = uint4(4,1,0,0); - bufIndirectDrawArgs[1] = uint4(0,0,0,0); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffGL.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffGL.csh deleted file mode 100644 index fda2387..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateDrawArgsBuffGL.csh +++ /dev/null @@ -1,12 +0,0 @@ - - -layout(rgba32ui, binding = 3) uniform writeonly uimageBuffer bufIndirectDrawArgs; - -layout (local_size_x = 1, local_size_y = 1, local_size_z = 1) in; -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - imageStore(bufIndirectDrawArgs, 0, uvec4(4,1,0,0)); - imageStore(bufIndirectDrawArgs, 1, uvec4(0,0,0,0)); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffDX.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffDX.csh deleted file mode 100644 index af003ae..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffDX.csh +++ /dev/null @@ -1,8 +0,0 @@ - -RWBuffer<uint4> bufIndices; - -[numthreads(1,1,1)] -void main(uint3 DTid : SV_DispatchThreadID) -{ - bufIndices[0] = uint4(0,1,2,3); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffGL.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffGL.csh deleted file mode 100644 index 347f8cc..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateIndBuffGL.csh +++ /dev/null @@ -1,20 +0,0 @@ - -// Declare input/output buffer from/to wich we will read/write data. -// In this particular shader we only write data into the buffer. -// If you do not want your data to be aligned by compiler try to use: -// packed or shared instead of std140 keyword. -// We also bind the buffer to index 0. You need to set the buffer binding -// in the range [0..3] – this is the minimum range approved by Khronos. -// Notice that various platforms might support more indices than that. -layout(std140, binding = 1) buffer bufIndices -{ - uvec4 data[]; -}g_Indices; - -layout (local_size_x = 2, local_size_y = 1, local_size_z = 1) in; -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - g_Indices.data[0] = uvec4(0,1,2,3); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffDX.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffDX.csh deleted file mode 100644 index c84fabd..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffDX.csh +++ /dev/null @@ -1,35 +0,0 @@ - -RWBuffer<float4> bufPositions : register(u3); -RWBuffer<float4> bufTexcoord; -Buffer<float4> Offsets; - -[numthreads(2,1,1)] -void main(uint3 DTid : SV_DispatchThreadID) -{ - int Ind = int(DTid.x); - - float2 pos[4] = - { - float2(0.0, 0.0), - float2(0.0, 1.0), - float2(1.0, 0.0), - float2(1.0, 1.0) - }; - - float2 CurrPos = pos[Ind]; - float2 Offset = Offsets.Load(Ind); - CurrPos += Offset; - - CurrPos = CurrPos*float2(0.3, 0.3) + float2(0.0, -1.0); - - float2 uv[4] = - { - float2(0.0, 1.0), - float2(0.0, 0.0), - float2(1.0, 1.0), - float2(1.0, 0.0) - }; - - bufPositions[Ind] = float4(CurrPos.xy, 0.0, 0.0); - bufTexcoord[Ind] = float4(uv[Ind],0,0); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGL.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGL.csh deleted file mode 100644 index bb3162b..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGL.csh +++ /dev/null @@ -1,35 +0,0 @@ - -layout(rgba32f) uniform writeonly imageBuffer bufPositions; -layout(rgba32f) uniform writeonly imageBuffer bufTexcoord; - -uniform samplerBuffer Offsets; - -layout (local_size_x = 2, local_size_y = 1, local_size_z = 1) in; -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - int Ind = int(gl_GlobalInvocationID.x); - - vec2 pos[4]; - pos[0] = vec2(0.0, 0.0); - pos[1] = vec2(0.0, 1.0); - pos[2] = vec2(1.0, 0.0); - pos[3] = vec2(1.0, 1.0); - - vec2 CurrPos = pos[Ind]; - - vec4 Offset = texelFetch(Offsets, Ind); - CurrPos += Offset.xy; - - CurrPos = CurrPos*vec2(0.3, 0.3) + vec2(0.0, -1.0); - - vec2 uv[4]; - uv[0] = vec2(0.0, 1.0); - uv[1] = vec2(0.0, 0.0); - uv[2] = vec2(1.0, 1.0); - uv[3] = vec2(1.0, 0.0); - - imageStore(bufPositions, Ind, vec4(CurrPos.xy, 0.0, 0.0)); - imageStore(bufTexcoord, Ind, vec4(uv[Ind].xy, 0.0, 0.0)); -} diff --git a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGLES.csh b/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGLES.csh deleted file mode 100644 index 01f68ee..0000000 --- a/Tests/TestApp/assets/Shaders/CSTest/UpdateVertBuffGLES.csh +++ /dev/null @@ -1,44 +0,0 @@ - -// Declare input/output buffer from/to wich we will read/write data. -// In this particular shader we only write data into the buffer. -// If you do not want your data to be aligned by compiler try to use: -// packed or shared instead of std140 keyword. -// We also bind the buffer to index 0. You need to set the buffer binding -// in the range [0..3] – this is the minimum range approved by Khronos. -// Notice that various platforms might support more indices than that. -layout(std140, binding = 2) buffer bufPositions -{ - vec4 data[]; -}g_Positions; - -layout(std140) buffer bufTexcoord -{ - vec4 data[]; -}g_Texcoords; - - -layout (local_size_x = 2, local_size_y = 1, local_size_z = 1) in; -// Declare main program function which is executed once -// glDispatchCompute is called from the application. -void main() -{ - int Ind = int(gl_GlobalInvocationID.x); - - vec2 pos[4]; - pos[0] = vec2(0.0, 0.0); - pos[1] = vec2(0.0, 1.0); - pos[2] = vec2(1.0, 0.0); - pos[3] = vec2(1.0, 1.0); - - vec2 CurrPos = pos[Ind]; - CurrPos = CurrPos*vec2(0.3, 0.3) + vec2(0.0, -1.0); - - vec2 uv[4]; - uv[0] = vec2(0.0, 1.0); - uv[1] = vec2(0.0, 0.0); - uv[2] = vec2(1.0, 1.0); - uv[3] = vec2(1.0, 0.0); - - g_Positions.data[Ind] = vec4(CurrPos.xy, 0.0, 0.0); - g_Texcoords.data[Ind] = vec4(uv[Ind], 0.0, 0.0); -} diff --git a/Tests/TestApp/assets/Shaders/GSTestDX.gsh b/Tests/TestApp/assets/Shaders/GSTestDX.gsh deleted file mode 100644 index 4916ff2..0000000 --- a/Tests/TestApp/assets/Shaders/GSTestDX.gsh +++ /dev/null @@ -1,37 +0,0 @@ - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -struct GSOut -{ - VSOutput VSOut; -}; - - -[maxvertexcount(6)] -void main(point VSOutput In[1], - inout TriangleStream<GSOut> triStream ) -{ - float2 Offsets[3]; - Offsets[0] = float2(-0.05, -0.05); - Offsets[1] = float2(+0.05, -0.05); - Offsets[2] = float2( 0.0, 0.0); - for(int i=0; i<3; i++) - { - GSOut Out; - Out.VSOut = In[0]; - Out.VSOut.f4Position.xy += Offsets[i]; - triStream.Append( Out ); - } - triStream.RestartStrip(); - for(int j=0; j<3; j++) - { - GSOut Out; - Out.VSOut = In[0]; - Out.VSOut.f4Position.xy += Offsets[j]*float2(1.0, -1.0); - triStream.Append( Out ); - } -} diff --git a/Tests/TestApp/assets/Shaders/GSTestDX.psh b/Tests/TestApp/assets/Shaders/GSTestDX.psh deleted file mode 100644 index 9686129..0000000 --- a/Tests/TestApp/assets/Shaders/GSTestDX.psh +++ /dev/null @@ -1,18 +0,0 @@ -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -struct GSOut -{ - VSOutput VSOut; -}; - - - -void main(GSOut In, - out float4 Color : SV_Target) -{ - Color = float4(In.VSOut.f3Color,1.0); -} diff --git a/Tests/TestApp/assets/Shaders/GSTestDX.vsh b/Tests/TestApp/assets/Shaders/GSTestDX.vsh deleted file mode 100644 index a5c43ea..0000000 --- a/Tests/TestApp/assets/Shaders/GSTestDX.vsh +++ /dev/null @@ -1,24 +0,0 @@ - -struct VSIn -{ - uint uiVertexId : SV_VertexID; -}; - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -void main(VSIn In, - out VSOutput Out) -{ - float4 Positions[2]; - Positions[0] = float4(-0.4,0.3,0.0,1.0); - Positions[1] = float4(-0.35,0.25,0.0,1.0); - float3 Color[2]; - Color[0] = float3(1.0,0.0,0.0); - Color[1] = float3(0.0,1.0,0.0); - Out.f4Position = Positions[In.uiVertexId]; - Out.f3Color = Color[In.uiVertexId]; -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_DX.hlsl b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_DX.hlsl deleted file mode 100644 index e6030f0..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_DX.hlsl +++ /dev/null @@ -1,23 +0,0 @@ - -Texture2D<float4> g_tex2DTest0 : register(t2); -SamplerState g_tex2DTest0_sampler : register(s3); - -Texture2D<float4> g_tex2DTest1; -SamplerState g_tex2DTest1_sampler; - -Texture2D<float4> g_tex2DTest2; -SamplerState g_tex2DTest2_sampler; - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : TEXCOORD; -}; - -float4 main(VSOut In) : SV_Target -{ - float4 Col0 = g_tex2DTest0.Sample( g_tex2DTest0_sampler, In.f2UV ); - float4 Col1 = g_tex2DTest1.Sample( g_tex2DTest1_sampler, In.f2UV ); - float4 Col2 = g_tex2DTest2.Sample( g_tex2DTest2_sampler, In.f2UV ); - return float4(Col0.x, Col1.y, Col2.z, 0.0); -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl b/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl deleted file mode 100644 index 726dfee..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/BlendTexturesPS_GL.glsl +++ /dev/null @@ -1,21 +0,0 @@ - -uniform sampler2D g_tex2DTest0; -uniform sampler2D g_tex2DTest1; -uniform sampler2D g_tex2DTest2; - -layout(location = 1)in vec2 ex_UV; - -layout(location = 0) out vec4 out_Color; - -void main() -{ - vec2 UV = vec2( ex_UV.x, ex_UV.y ); -#ifndef TARGET_API_VULKAN - UV.y = 1.0 - UV.y; -#endif - - vec4 Col0 = texture(g_tex2DTest0, UV); - vec4 Col1 = texture(g_tex2DTest1, UV); - vec4 Col2 = texture(g_tex2DTest2, UV); - out_Color = vec4(Col0.x, Col1.y, Col2.z, 0.0); -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/QuadVS_DX.hlsl b/Tests/TestApp/assets/Shaders/RTTest/QuadVS_DX.hlsl deleted file mode 100644 index d47bb59..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/QuadVS_DX.hlsl +++ /dev/null @@ -1,21 +0,0 @@ - -struct VSIn -{ - float3 f3Position : ATTRIB0; - float2 f2UV : ATTRIB1; -}; - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : TEXCOORD; -}; - -VSOut main(VSIn In) -{ - VSOut Out; - Out.f4Position.xyz = In.f3Position; - Out.f4Position.w = 1; - Out.f2UV = In.f2UV; - return Out; -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/QuadVS_GL.glsl b/Tests/TestApp/assets/Shaders/RTTest/QuadVS_GL.glsl deleted file mode 100644 index 77d984e..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/QuadVS_GL.glsl +++ /dev/null @@ -1,24 +0,0 @@ - -layout(location = 0) in vec3 in_Position; -layout(location = 1) in vec2 in_UV; - -layout(location = 1) out vec2 ex_UV; - -//To use any built-in input or output in the gl_PerVertex and -//gl_PerFragment blocks in separable program objects, shader code must -//redeclare those blocks prior to use. -// -// Declaring this block causes compilation error on NVidia GLES -#ifndef GL_ES -out gl_PerVertex -{ - vec4 gl_Position; -}; -#endif - -void main() -{ - gl_Position.xyz = in_Position; - gl_Position.w = 1.0; - ex_UV = in_UV; -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_DX.hlsl b/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_DX.hlsl deleted file mode 100644 index c3e08bc..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_DX.hlsl +++ /dev/null @@ -1,13 +0,0 @@ -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : TEXCOORD; -}; - -void main(VSOut In, - out float4 Col0 : SV_Target0, - out float4 Col1 : SV_Target1) -{ - Col0 = float4( 0.5+0.5*cos(In.f2UV.x*3.1415*6.0), 0.0, 0.0, 0.0 ); - Col1 = float4( 0.0, 0.5+0.5*cos(In.f2UV.y*3.1415*8.0), 0.0, 0.0 ); -} diff --git a/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_GL.glsl b/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_GL.glsl deleted file mode 100644 index b673f11..0000000 --- a/Tests/TestApp/assets/Shaders/RTTest/RenderToTexturesPS_GL.glsl +++ /dev/null @@ -1,11 +0,0 @@ - -layout(location = 1) in vec2 ex_UV; - -layout (location = 0) out vec4 out_Color0; -layout (location = 1) out vec4 out_Color1; - -void main() -{ - out_Color0 = vec4( 0.5+0.5*cos(ex_UV.x*3.1415*6.0), 0.0, 0.0, 0.0 ); - out_Color1 = vec4( 0.0, 0.5+0.5*cos(ex_UV.y*3.1415*8.0), 0.0, 0.0 ); -} diff --git a/Tests/TestApp/assets/Shaders/SpriteDX.psh b/Tests/TestApp/assets/Shaders/SpriteDX.psh deleted file mode 100644 index 4ec1d7b..0000000 --- a/Tests/TestApp/assets/Shaders/SpriteDX.psh +++ /dev/null @@ -1,14 +0,0 @@ - -Texture2D<float4> g_tex2DTest : register(t2); -SamplerState g_tex2DTest_sampler : register(s3); - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : UV; -}; - -float4 main(VSOut In) : SV_Target -{ - return g_tex2DTest.SampleLevel(g_tex2DTest_sampler, In.f2UV, 0); -} diff --git a/Tests/TestApp/assets/Shaders/SpriteGL.psh b/Tests/TestApp/assets/Shaders/SpriteGL.psh deleted file mode 100644 index f2bdd11..0000000 --- a/Tests/TestApp/assets/Shaders/SpriteGL.psh +++ /dev/null @@ -1,11 +0,0 @@ -// Fragment Shader – file "minimal.frag" - -layout(location = 1)in vec2 in_UV; -uniform sampler2D g_tex2DTest; - -layout(location = 0) out vec4 out_Color; - -void main(void) -{ - out_Color = textureLod(g_tex2DTest, in_UV, 0.0); -} diff --git a/Tests/TestApp/assets/Shaders/TessTestDX.psh b/Tests/TestApp/assets/Shaders/TessTestDX.psh deleted file mode 100644 index 9686129..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestDX.psh +++ /dev/null @@ -1,18 +0,0 @@ -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -struct GSOut -{ - VSOutput VSOut; -}; - - - -void main(GSOut In, - out float4 Color : SV_Target) -{ - Color = float4(In.VSOut.f3Color,1.0); -} diff --git a/Tests/TestApp/assets/Shaders/TessTestQuadDX.dsh b/Tests/TestApp/assets/Shaders/TessTestQuadDX.dsh deleted file mode 100644 index 634ac31..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestQuadDX.dsh +++ /dev/null @@ -1,32 +0,0 @@ - -struct DSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - - -struct HS_CONSTANT_DATA_OUTPUT -{ - float Edges[4] : SV_TessFactor; - float Inside[2] : SV_InsideTessFactor; -}; - -struct HSOutput -{ - float4 Position : POS; - float3 Color : COL; -}; - -[domain("quad")] -/* partitioning = fractional_even , - outputtopology = triangle_cw */ -void main( HS_CONSTANT_DATA_OUTPUT Input, - float2 QuadUV : SV_DomainLocation, - OutputPatch<HSOutput, 1> QuadPatch, - out DSOutput Out) -{ - Out.f4Position.xy = QuadPatch[0].Position.xy + QuadUV.xy * 0.2; - Out.f4Position.zw = QuadPatch[0].Position.zw; - Out.f3Color = frac( (QuadPatch[0].Color + float3(QuadUV.xy, 1.0)) * float3(4121.35f, 8232.25f, 9124.42f) ); -} diff --git a/Tests/TestApp/assets/Shaders/TessTestQuadDX.hsh b/Tests/TestApp/assets/Shaders/TessTestQuadDX.hsh deleted file mode 100644 index 33e24a3..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestQuadDX.hsh +++ /dev/null @@ -1,46 +0,0 @@ - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -// Output patch constant data. -struct HS_CONSTANT_DATA_OUTPUT -{ - float Edges[4] : SV_TessFactor; -}; - -HS_CONSTANT_DATA_OUTPUT ConstantHS( InputPatch<VSOutput, 1> p, - uint BlockID : SV_PrimitiveID, - out float Inside[2] : SV_InsideTessFactor) -{ - HS_CONSTANT_DATA_OUTPUT Factors; - Factors.Edges[0] = 2.5 + float(BlockID); - Factors.Edges[1] = 4.8 + frac(p[0].f4Position.x*223.145); - Factors.Edges[2] = 5.9 + frac(p[0].f4Position.y*142.512); - Factors.Edges[3] = 7.5 - float(BlockID); - Inside[0] = 6.2 + p[0].f4Position.x*3.4; - Inside[1] = 7.3 + p[0].f4Position.y*1.4; - return Factors; -} - -struct HSOutput -{ - float4 Position : POS; - float3 Color : COL; -}; - -[domain("quad")] -[partitioning("fractional_even")] -[outputtopology("triangle_cw")] -[outputcontrolpoints(1)] -[patchconstantfunc("ConstantHS")] -[maxtessfactor( (float)(32.f+2.f) )] -HSOutput main(InputPatch<VSOutput, 1> inputPatch, uint uCPID : SV_OutputControlPointID) -{ - HSOutput Out; - Out.Position = inputPatch[uCPID].f4Position; - Out.Color = inputPatch[uCPID].f3Color; - return Out; -}
\ No newline at end of file diff --git a/Tests/TestApp/assets/Shaders/TessTestQuadDX.vsh b/Tests/TestApp/assets/Shaders/TessTestQuadDX.vsh deleted file mode 100644 index 86042cc..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestQuadDX.vsh +++ /dev/null @@ -1,24 +0,0 @@ - -struct VSIn -{ - uint uiVertexId : SV_VertexID; -}; - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -void main(VSIn In, - out VSOutput Out) -{ - float4 Positions[2]; - Positions[0] = float4(-0.65,0.4,0.0,1.0); - Positions[1] = float4(-0.65,0.65,0.0,1.0); - float3 Color[2]; - Color[0] = float3(1.0,0.0,0.0); - Color[1] = float3(0.0,1.0,0.0); - Out.f4Position = Positions[In.uiVertexId]; - Out.f3Color = Color[In.uiVertexId]; -} diff --git a/Tests/TestApp/assets/Shaders/TessTestTriDX.dsh b/Tests/TestApp/assets/Shaders/TessTestTriDX.dsh deleted file mode 100644 index 1aa899e..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestTriDX.dsh +++ /dev/null @@ -1,32 +0,0 @@ - -struct DSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - - -struct HS_CONSTANT_DATA_OUTPUT -{ - float Edges[3] : SV_TessFactor; - float Inside : SV_InsideTessFactor; -}; - -struct HSOutput -{ - float4 Position : POS; - float3 Color : COL; -}; - -[domain("tri")] -/* partitioning = fractional_odd , - outputtopology = triangle_cw */ -void main( HS_CONSTANT_DATA_OUTPUT Input, - float3 QuadUV : SV_DomainLocation, - OutputPatch<HSOutput, 1> QuadPatch, - out DSOutput Out) -{ - Out.f4Position.xy = QuadPatch[0].Position.xy + QuadUV.x * float2(-0.15, 0.0) + QuadUV.y * float2(0.0, 0.15) + QuadUV.z * float2(+0.15, 0.0); - Out.f4Position.zw = QuadPatch[0].Position.zw; - Out.f3Color = frac( (QuadPatch[0].Color + QuadUV.xyz * float3(4121.35f, 8232.25f, 9124.42f) ) ); -} diff --git a/Tests/TestApp/assets/Shaders/TessTestTriDX.hsh b/Tests/TestApp/assets/Shaders/TessTestTriDX.hsh deleted file mode 100644 index 6280ebd..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestTriDX.hsh +++ /dev/null @@ -1,44 +0,0 @@ - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -// Output patch constant data. -struct HS_CONSTANT_DATA_OUTPUT -{ - float Edges[3] : SV_TessFactor; -}; - -HS_CONSTANT_DATA_OUTPUT ConstantHS( InputPatch<VSOutput, 1> p, - uint BlockID : SV_PrimitiveID, - out float Inside : SV_InsideTessFactor) -{ - HS_CONSTANT_DATA_OUTPUT Factors; - Factors.Edges[0] = 2.5 + float(BlockID); - Factors.Edges[1] = 4.5 + p[0].f4Position.x * 1.53; - Factors.Edges[2] = 5.5 - p[0].f4Position.y * 2.53; - Inside = 6.2 + p[0].f4Position.x * 1.53; - return Factors; -} - -struct HSOutput -{ - float4 Position : POS; - float3 Color : COL; -}; - -[domain("tri")] -[partitioning("fractional_odd")] -[outputtopology("triangle_cw")] -[outputcontrolpoints(1)] -[patchconstantfunc("ConstantHS")] -[maxtessfactor( (float)(32.f+2.f) )] -HSOutput main(InputPatch<VSOutput, 1> inputPatch, uint uCPID : SV_OutputControlPointID) -{ - HSOutput Out; - Out.Position = inputPatch[uCPID].f4Position; - Out.Color = inputPatch[uCPID].f3Color; - return Out; -}
\ No newline at end of file diff --git a/Tests/TestApp/assets/Shaders/TessTestTriDX.vsh b/Tests/TestApp/assets/Shaders/TessTestTriDX.vsh deleted file mode 100644 index c807662..0000000 --- a/Tests/TestApp/assets/Shaders/TessTestTriDX.vsh +++ /dev/null @@ -1,24 +0,0 @@ - -struct VSIn -{ - uint uiVertexId : SV_VertexID; -}; - -struct VSOutput -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -void main(VSIn In, - out VSOutput Out) -{ - float4 Positions[2]; - Positions[0] = float4(-0.5,0.15,0.0,1.0); - Positions[1] = float4(-0.65,0.65,0.0,1.0); - float3 Color[2]; - Color[0] = float3(1.0,0.0,0.0); - Color[1] = float3(0.0,1.0,0.0); - Out.f4Position = Positions[In.uiVertexId]; - Out.f3Color = Color[In.uiVertexId]; -} diff --git a/Tests/TestApp/assets/Shaders/TextureIntTestDX.psh b/Tests/TestApp/assets/Shaders/TextureIntTestDX.psh deleted file mode 100644 index 4dfc67f..0000000 --- a/Tests/TestApp/assets/Shaders/TextureIntTestDX.psh +++ /dev/null @@ -1,28 +0,0 @@ - -Texture2D<DATA_TYPE> g_tex2DTest : register(t4); - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : UV; -}; - - -float4 main(VSOut In) : SV_Target -{ - float Width, Height; - g_tex2DTest.GetDimensions(Width, Height); - float2 IJ = In.f2UV * float2(Width, Height); - float4 Color0 = g_tex2DTest.Load( int3(IJ, 0) ) / 127.f; - float4 Color1 = g_tex2DTest.Load( int3(IJ/4, 2) ) / 127.f; - float4 Color2 = g_tex2DTest.Load( int3(IJ/16, 4) ) / 127.f; - float4 Color3 = g_tex2DTest.Load( int3(IJ/32, 5) ) / 127.f; - if( In.f2UV.x < 0.5 && In.f2UV.y < 0.5 ) - return Color0; - else if( In.f2UV.x > 0.5 && In.f2UV.y < 0.5 ) - return Color1; - else if( In.f2UV.x < 0.5 && In.f2UV.y > 0.5 ) - return Color2; - else - return Color3; -} diff --git a/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh b/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh deleted file mode 100644 index 23c3532..0000000 --- a/Tests/TestApp/assets/Shaders/TextureIntTestGL.psh +++ /dev/null @@ -1,33 +0,0 @@ -// Fragment Shader – file "minimal.frag" - -layout(location = 1)in vec2 in_UV; -uniform SAMPLER_TYPE g_tex2DTest; - -layout(location = 0) out vec4 out_Color; - -void main(void) -{ - vec2 TexSize; - - TexSize = vec2(textureSize(g_tex2DTest, 0)); - vec4 texel0 = vec4(texelFetch(g_tex2DTest, ivec2(in_UV*TexSize), 0)); - - TexSize = vec2(textureSize(g_tex2DTest, 2)); - vec4 texel1 = vec4(texelFetch(g_tex2DTest, ivec2(in_UV*TexSize), 2)); - - TexSize = vec2(textureSize(g_tex2DTest, 4)); - vec4 texel2 = vec4(texelFetch(g_tex2DTest, ivec2(in_UV*TexSize), 4)); - - TexSize = vec2(textureSize(g_tex2DTest, 5)); - vec4 texel3 = vec4(texelFetch(g_tex2DTest, ivec2(in_UV*TexSize), 5)); - - if( in_UV.x < 0.5 && in_UV.y < 0.5 ) - out_Color = texel0 / 127.f; - else if( in_UV.x > 0.5 && in_UV.y < 0.5 ) - out_Color = texel1 / 127.f; - else if( in_UV.x < 0.5 && in_UV.y > 0.5 ) - out_Color = texel2 / 127.f; - else - out_Color = texel3 / 127.f; -} - diff --git a/Tests/TestApp/assets/Shaders/TextureTestDX.psh b/Tests/TestApp/assets/Shaders/TextureTestDX.psh deleted file mode 100644 index 0d8e57e..0000000 --- a/Tests/TestApp/assets/Shaders/TextureTestDX.psh +++ /dev/null @@ -1,26 +0,0 @@ - -Texture2D<float4> g_tex2DTest : register(t2); -SamplerState g_tex2DTest_sampler : register(s3); - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : UV; -}; - - -float4 main(VSOut In) : SV_Target -{ - float4 Color0 = g_tex2DTest.SampleLevel(g_tex2DTest_sampler, In.f2UV, 0); - float4 Color1 = g_tex2DTest.SampleLevel(g_tex2DTest_sampler, In.f2UV, 2); - float4 Color2 = g_tex2DTest.SampleLevel(g_tex2DTest_sampler, In.f2UV, 4); - float4 Color3 = g_tex2DTest.SampleLevel(g_tex2DTest_sampler, In.f2UV, 5); - if( In.f2UV.x < 0.5 && In.f2UV.y < 0.5 ) - return Color0; - else if( In.f2UV.x > 0.5 && In.f2UV.y < 0.5 ) - return Color1; - else if( In.f2UV.x < 0.5 && In.f2UV.y > 0.5 ) - return Color2; - else - return Color3; -} diff --git a/Tests/TestApp/assets/Shaders/TextureTestDX.vsh b/Tests/TestApp/assets/Shaders/TextureTestDX.vsh deleted file mode 100644 index 78e6fd5..0000000 --- a/Tests/TestApp/assets/Shaders/TextureTestDX.vsh +++ /dev/null @@ -1,22 +0,0 @@ - -struct VSIn -{ - float3 f3Position : ATTRIB0; - float2 f2UV : ATTRIB1; -}; - -struct VSOut -{ - float4 f4Position : SV_Position; - float2 f2UV : UV; -}; - -VSOut main(VSIn In) -{ - VSOut Out; - Out.f4Position.xyz = In.f3Position; - //Out.f4Position.x += In.fOffset; - Out.f4Position.w = 1; - Out.f2UV = In.f2UV; - return Out; -} diff --git a/Tests/TestApp/assets/Shaders/TextureTestGL.psh b/Tests/TestApp/assets/Shaders/TextureTestGL.psh deleted file mode 100644 index 3f84f11..0000000 --- a/Tests/TestApp/assets/Shaders/TextureTestGL.psh +++ /dev/null @@ -1,22 +0,0 @@ -// Fragment Shader – file "minimal.frag" - -layout(location = 1)in vec2 in_UV; -uniform sampler2D g_tex2DTest; - -layout(location = 0) out vec4 out_Color; - -void main(void) -{ - vec4 Color0 = textureLod(g_tex2DTest, in_UV, 0.0); - vec4 Color1 = textureLod(g_tex2DTest, in_UV, 2.0); - vec4 Color2 = textureLod(g_tex2DTest, in_UV, 4.0); - vec4 Color3 = textureLod(g_tex2DTest, in_UV, 5.0); - if( in_UV.x < 0.5 && in_UV.y < 0.5 ) - out_Color = Color0; - else if( in_UV.x > 0.5 && in_UV.y < 0.5 ) - out_Color = Color1; - else if( in_UV.x < 0.5 && in_UV.y > 0.5 ) - out_Color = Color2; - else - out_Color = Color3; -} diff --git a/Tests/TestApp/assets/Shaders/TextureTestGL.vsh b/Tests/TestApp/assets/Shaders/TextureTestGL.vsh deleted file mode 100644 index e1faef7..0000000 --- a/Tests/TestApp/assets/Shaders/TextureTestGL.vsh +++ /dev/null @@ -1,25 +0,0 @@ -// Vertex Shader – file "minimal.vert" - -layout(location = 0) in vec3 in_Position; -layout(location = 1) in vec2 in_UV; - -layout(location = 1) out vec2 out_UV; - - -//To use any built-in input or output in the gl_PerVertex and -//gl_PerFragment blocks in separable program objects, shader code must -//redeclare those blocks prior to use. -// -// Declaring this block causes compilation error on NVidia GLES -#ifndef GL_ES -out gl_PerVertex -{ - vec4 gl_Position; -}; -#endif - -void main(void) -{ - out_UV = in_UV; - gl_Position = vec4(in_Position, 1.0); -} diff --git a/Tests/TestApp/assets/Shaders/UniformBufferDX.psh b/Tests/TestApp/assets/Shaders/UniformBufferDX.psh deleted file mode 100644 index fa0d12e..0000000 --- a/Tests/TestApp/assets/Shaders/UniformBufferDX.psh +++ /dev/null @@ -1,21 +0,0 @@ -cbuffer cbTestBlock : register(b5) -{ - float4 g_f4Color; -} - -cbuffer cbTestBlock2 : register(b3) -{ - float4 g_f4Color2; -} - -struct VSOut -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - - -float4 main(VSOut In) : SV_Target -{ - return float4(In.f3Color,1.0) * g_f4Color + g_f4Color2; -} diff --git a/Tests/TestApp/assets/Shaders/UniformBufferGL.psh b/Tests/TestApp/assets/Shaders/UniformBufferGL.psh deleted file mode 100644 index 267e678..0000000 --- a/Tests/TestApp/assets/Shaders/UniformBufferGL.psh +++ /dev/null @@ -1,26 +0,0 @@ -// Fragment Shader – file "minimal.frag" - -layout(location = 1)in vec3 ex_Color; - -uniform cbTestBlock2 -{ - vec4 Color; -}g_TestBlock2; - -uniform cbTestBlock -{ - vec4 Color; -}g_TestBlock; - -layout(location = 0) out vec4 out_Color; - -void main(void) -{ - out_Color = g_TestBlock.Color * vec4(ex_Color,1.0) + g_TestBlock2.Color; - - // Try replacing the above with the following: - //vec3 tmp_Color; - //tmp_Color = ex_Color.rrr; - //out_Color = vec4(tmp_Color,1.0); -} - diff --git a/Tests/TestApp/assets/Shaders/minimalDX.psh b/Tests/TestApp/assets/Shaders/minimalDX.psh deleted file mode 100644 index fe51cd1..0000000 --- a/Tests/TestApp/assets/Shaders/minimalDX.psh +++ /dev/null @@ -1,11 +0,0 @@ -struct VSOut -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - - -float4 main(VSOut In) : SV_Target -{ - return float4(In.f3Color,1); -} diff --git a/Tests/TestApp/assets/Shaders/minimalDX.vsh b/Tests/TestApp/assets/Shaders/minimalDX.vsh deleted file mode 100644 index a8577fd..0000000 --- a/Tests/TestApp/assets/Shaders/minimalDX.vsh +++ /dev/null @@ -1,23 +0,0 @@ - -struct VSIn -{ - float3 f3Position : ATTRIB0; - float3 f3Color : ATTRIB1; - //float fOffset : ATTRIB2; -}; - -struct VSOut -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -VSOut main(VSIn In) -{ - VSOut Out; - Out.f4Position.xyz = In.f3Position; - //Out.f4Position.x += In.fOffset; - Out.f4Position.w = 1; - Out.f3Color = In.f3Color; - return Out; -} diff --git a/Tests/TestApp/assets/Shaders/minimalGL.psh b/Tests/TestApp/assets/Shaders/minimalGL.psh deleted file mode 100644 index 8aafaa2..0000000 --- a/Tests/TestApp/assets/Shaders/minimalGL.psh +++ /dev/null @@ -1,16 +0,0 @@ -// Fragment Shader – file "minimal.frag" - -layout(location = 1) in vec3 ex_Color; - -layout(location = 0) out vec4 out_Color; - -void main(void) -{ - out_Color = vec4(ex_Color,1.0); - - // Try replacing the above with the following: - //vec3 tmp_Color; - //tmp_Color = ex_Color.rrr; - //out_Color = vec4(tmp_Color,1.0); -} - diff --git a/Tests/TestApp/assets/Shaders/minimalGL.vsh b/Tests/TestApp/assets/Shaders/minimalGL.vsh deleted file mode 100644 index 1ef7dbc..0000000 --- a/Tests/TestApp/assets/Shaders/minimalGL.vsh +++ /dev/null @@ -1,35 +0,0 @@ -// Vertex Shader – file "minimal.vert" - -layout(location = 0) in vec3 in_Position; -layout(location = 1) in vec3 in_Color; - -layout(location = 1) out vec3 ex_Color; - -uniform cbTestBlock3 -{ - vec4 Scale; -}g_TestBlock3; - -uniform cbTestBlock4 -{ - vec4 Scale; -}g_TestBlock4; - -//To use any built-in input or output in the gl_PerVertex and -//gl_PerFragment blocks in separable program objects, shader code must -//redeclare those blocks prior to use. -// -// Declaring this block causes compilation error on NVidia GLES -#ifndef GL_ES -out gl_PerVertex -{ - vec4 gl_Position; -}; -#endif - -void main(void) -{ - ex_Color = in_Color; - gl_Position = vec4(in_Position.x * g_TestBlock3.Scale.x, in_Position.y * g_TestBlock4.Scale.y, in_Position.z, 1.0); -} - diff --git a/Tests/TestApp/assets/Shaders/minimalInstDX.vsh b/Tests/TestApp/assets/Shaders/minimalInstDX.vsh deleted file mode 100644 index 1d0c2e3..0000000 --- a/Tests/TestApp/assets/Shaders/minimalInstDX.vsh +++ /dev/null @@ -1,23 +0,0 @@ - -struct VSIn -{ - float3 f3Position : ATTRIB0; - float3 f3Color : ATTRIB1; - float2 f2Offset : ATTRIB2; -}; - -struct VSOut -{ - float4 f4Position : SV_Position; - float3 f3Color : COLOR; -}; - -VSOut main(VSIn In) -{ - VSOut Out; - Out.f4Position.xyz = In.f3Position; - Out.f4Position.xy += In.f2Offset; - Out.f4Position.w = 1; - Out.f3Color = In.f3Color; - return Out; -} diff --git a/Tests/TestApp/assets/Shaders/minimalInstGL.vsh b/Tests/TestApp/assets/Shaders/minimalInstGL.vsh deleted file mode 100644 index 948b55d..0000000 --- a/Tests/TestApp/assets/Shaders/minimalInstGL.vsh +++ /dev/null @@ -1,27 +0,0 @@ -// Vertex Shader – file "minimal.vert" - -layout(location = 0) in vec3 in_Position; -layout(location = 1) in vec3 in_Color; -layout(location = 2) in vec2 in_Offset; - -layout(location = 1) out vec3 ex_Color; - -//To use any built-in input or output in the gl_PerVertex and -//gl_PerFragment blocks in separable program objects, shader code must -//redeclare those blocks prior to use. -// -// Declaring this block causes compilation error on NVidia GLES -#ifndef GL_ES -out gl_PerVertex -{ - vec4 gl_Position; -}; -#endif - - -void main(void) -{ - ex_Color = in_Color; - gl_Position = vec4(in_Position + vec3(in_Offset.xy,0.0), 1.0); -} - |
