summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorjsmall-nvidia <jsmall@nvidia.com>2019-03-05 14:53:44 -0500
committerGitHub <noreply@github.com>2019-03-05 14:53:44 -0500
commit3d5546600fb4c585b6f6f6dcdb5e122698d1225e (patch)
treea11fc783760fd6e4b03c05b40fd4ff2f11c582da /tests
parent890403f576a85a7dca90d9d20360cd73c9ec9604 (diff)
Hotfix/texture2d gather (#876)
* First pass test to see if GatherRed works. * Add support for generating R_Float32 textures. * Set default texture format. * * Alter the texture2d-gather to work with a R_Float32 texture * Add support for scalar Texture2d types with GatherXXX in stdlib * Remove some left over commented out test code from texture2d-gather.hlsl
Diffstat (limited to 'tests')
-rw-r--r--tests/bugs/texture2d-gather.hlsl44
1 files changed, 44 insertions, 0 deletions
diff --git a/tests/bugs/texture2d-gather.hlsl b/tests/bugs/texture2d-gather.hlsl
new file mode 100644
index 000000000..3886472bd
--- /dev/null
+++ b/tests/bugs/texture2d-gather.hlsl
@@ -0,0 +1,44 @@
+//TEST(smoke):COMPARE_HLSL_RENDER:
+//TEST_INPUT: Texture2D(size=16, content=chessboard, format=R_Float32):dxbinding(0),glbinding(0)
+
+Texture2D<float> g_texture : register(t0);
+SamplerState g_sampler : register(s0);
+
+cbuffer Uniforms
+{
+ float4x4 modelViewProjection;
+}
+
+struct AssembledVertex
+{
+ float3 position;
+ float3 color;
+};
+
+// Vertex Shader
+struct VertexStageInput
+{
+ AssembledVertex assembledVertex : A;
+};
+
+struct VertexStageOutput
+{
+ float4 color : COLOR;
+ float4 position : SV_Position;
+};
+
+VertexStageOutput vertexMain(VertexStageInput input)
+{
+ VertexStageOutput output;
+
+ output.position = mul(modelViewProjection, float4(input.assembledVertex.position, 1.0));
+ output.color = float4(input.assembledVertex.color, 1.0f);
+
+ return output;
+}
+
+// Fragment Shader
+float4 fragmentMain(VertexStageOutput input) : SV_Target
+{
+ return g_texture.GatherRed(g_sampler, input.color.xy);
+} \ No newline at end of file