cbuffer-struct.hlsl 625 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: 'int' cannot be used as a type parameter where a struct is required
  9. ConstantBuffer<int> B1;
  10. // CHECK: error: 'float2' cannot be used as a type parameter where a struct is required
  11. TextureBuffer<float2> B2;
  12. // CHECK: error: 'float3x4' cannot be used as a type parameter where a struct is required
  13. ConstantBuffer<float3x4> B3;
  14. TextureBuffer<C> B4;
  15. // CHECK-NOT: const S
  16. ConstantBuffer<S> B5;
  17. TextureBuffer<S> B6[6];
  18. float4 main(int a : A) : SV_Target {
  19. return B4.f;
  20. }