From 3d5546600fb4c585b6f6f6dcdb5e122698d1225e Mon Sep 17 00:00:00 2001 From: jsmall-nvidia Date: Tue, 5 Mar 2019 14:53:44 -0500 Subject: 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 --- tests/bugs/texture2d-gather.hlsl | 44 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 tests/bugs/texture2d-gather.hlsl (limited to 'tests/bugs') 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 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 -- cgit v1.2.3