cbuffer-struct.hlsl 731 B

12345678910111213141516171819202122232425
  1. // RUN: %dxc -E main -T ps_6_0 %s | FileCheck %s
  2. class C {
  3. float4 f;
  4. };
  5. struct S {
  6. float4 f;
  7. };
  8. // CHECK: error: 'const int' cannot be used as a type parameter where a struct is required
  9. ConstantBuffer<int> B1;
  10. // CHECK: error: 'const float2' cannot be used as a type parameter where a struct is required
  11. TextureBuffer<float2> B2;
  12. // CHECK: error: 'const float3x4' cannot be used as a type parameter where a struct is required
  13. ConstantBuffer<float3x4> B3;
  14. // CHECK: error: 'const C' cannot be used as a type parameter where a struct is required
  15. TextureBuffer<C> B4;
  16. // CHECK-NOT: const S
  17. ConstantBuffer<S> B5;
  18. TextureBuffer<S> B6[6];
  19. float4 main(int a : A) : SV_Target {
  20. return B4.f;
  21. }