DxilResourceBinding.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. ///////////////////////////////////////////////////////////////////////////////
  2. // //
  3. // DxilResourceBinding.h //
  4. // Copyright (C) Microsoft Corporation. All rights reserved. //
  5. // This file is distributed under the University of Illinois Open Source //
  6. // License. See LICENSE.TXT for details. //
  7. // //
  8. // Representation properties for DXIL resource binding. //
  9. // //
  10. ///////////////////////////////////////////////////////////////////////////////
  11. #pragma once
  12. #include "DxilConstants.h"
  13. namespace llvm {
  14. class Constant;
  15. class Type;
  16. }
  17. namespace hlsl {
  18. struct DxilResourceBinding {
  19. uint32_t rangeLowerBound;
  20. uint32_t rangeUpperBound;
  21. uint32_t spaceID;
  22. uint8_t resourceClass;
  23. uint8_t Reserved1;
  24. uint8_t Reserved2;
  25. uint8_t Reserved3;
  26. bool operator==(const DxilResourceBinding &);
  27. bool operator!=(const DxilResourceBinding &);
  28. };
  29. static_assert(sizeof(DxilResourceBinding) == 4 * sizeof(uint32_t),
  30. "update shader model and functions read/write "
  31. "DxilResourceBinding when size is changed");
  32. class ShaderModel;
  33. class DxilResourceBase;
  34. struct DxilInst_CreateHandleFromBinding;
  35. namespace resource_helper {
  36. llvm::Constant *getAsConstant(const DxilResourceBinding &, llvm::Type *Ty,
  37. const ShaderModel &);
  38. DxilResourceBinding loadBindingFromConstant(const llvm::Constant &C);
  39. DxilResourceBinding
  40. loadBindingFromCreateHandleFromBinding(const DxilInst_CreateHandleFromBinding &createHandle, llvm::Type *Ty,
  41. const ShaderModel &);
  42. DxilResourceBinding loadBindingFromResourceBase(DxilResourceBase *);
  43. } // namespace resource_helper
  44. } // namespace hlsl