bad-include.hlsl 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. // RUN: %clang_cc1 -fsyntax-only -ffreestanding -verify %s
  2. #include "Header1.hlsli" /* expected-error {{'Header1.hlsli' file not found}} fxc-error {{X1507: failed to open source file: 'Header1.hlsli'}} */
  3. // A constant buffer that stores the three basic column-major matrices for composing geometry.
  4. cbuffer ModelViewProjectionConstantBuffer : register(b0)
  5. {
  6. matrix model;
  7. matrix view;
  8. matrix projection;
  9. };
  10. // Per-pixel color data passed through the pixel shader.
  11. struct PixelShaderInput
  12. {
  13. float4 pos : SV_POSITION;
  14. float3 color : COLOR0;
  15. };
  16. // Simple shader to do vertex processing on the GPU.
  17. PixelShaderInput main(VertexShaderInput input) /* fxc-error {{X3000: unrecognized identifier 'VertexShaderInput'}} */
  18. {
  19. PixelShaderInput output;
  20. float4 pos = float4(input.pos, 1.0f);
  21. // Transform the vertex position into projected space.
  22. pos = mul(pos, model);
  23. pos = mul(pos, view);
  24. pos = mul(pos, projection);
  25. output.pos = pos;
  26. // Pass the color through without modification.
  27. output.color = input.color;
  28. return output;
  29. }