DepthViewerPS.hlsl 802 B

123456789101112131415161718192021222324252627282930313233343536
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. // CHECK: sample
  3. //
  4. // Copyright (c) Microsoft. All rights reserved.
  5. // This code is licensed under the MIT License (MIT).
  6. // THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
  7. // ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
  8. // IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
  9. // PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
  10. //
  11. // Developed by Minigraph
  12. //
  13. // Author(s): James Stanard
  14. // Alex Nankervis
  15. //
  16. #include "ModelViewerRS.hlsli"
  17. struct VSOutput
  18. {
  19. float4 pos : SV_Position;
  20. float2 uv : TexCoord0;
  21. };
  22. Texture2D<float4> texDiffuse : register(t0);
  23. SamplerState sampler0 : register(s0);
  24. [RootSignature(ModelViewer_RootSig)]
  25. void main(VSOutput vsOutput)
  26. {
  27. if (texDiffuse.Sample(sampler0, vsOutput.uv).a < 0.5)
  28. discard;
  29. }