summaryrefslogtreecommitdiff
path: root/tests/hlsl/dxsdk/HDRToneMappingCS11/DumpToTexture.hlsl
blob: d2d9611ce20dfd4dbc8e2abf12f0c87c5926a45b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
//TEST_IGNORE_FILE: Currently failing due to Spire compiler issues.
//TEST:COMPARE_HLSL: -target dxbc-assembly -profile ps_4_0 -entry PSDump
//--------------------------------------------------------------------------------------
// File: DumpToTexture.hlsl
//
// The PS for converting CS output buffer to a texture, used in CS path of 
// HDRToneMappingCS11 sample
// 
// Copyright (c) Microsoft Corporation. All rights reserved.
//--------------------------------------------------------------------------------------
StructuredBuffer<float4> buffer : register( t0 );

struct QuadVS_Output
{
    float4 Pos : SV_POSITION;              
    float2 Tex : TEXCOORD0;
};

cbuffer cbPS : register( b0 )
{
    uint4    g_param;   
};

float4 PSDump( QuadVS_Output Input ) : SV_TARGET
{
    // To calculate the buffer offset, it is natural to use the screen space coordinates,
    // Input.Pos is the screen space coordinates of the pixel being written 
    return buffer[ (Input.Pos.x - 0.5) + (Input.Pos.y - 0.5) * g_param.x ];	
}