BsGpuParamDesc.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. #pragma once
  2. #include "BsCorePrerequisites.h"
  3. namespace BansheeEngine
  4. {
  5. /**
  6. * @brief Describes a single GPU program data (e.g. int, float, Vector2) parameter.
  7. */
  8. struct GpuParamDataDesc
  9. {
  10. String name;
  11. UINT32 elementSize; /**< In multiples of 4 bytes. */
  12. UINT32 arraySize;
  13. UINT32 arrayElementStride; /**< In multiples of 4 bytes. */
  14. GpuParamDataType type;
  15. UINT32 paramBlockSlot;
  16. UINT32 gpuMemOffset;
  17. UINT32 cpuMemOffset;
  18. };
  19. /**
  20. * @brief Describes a single GPU program object (e.g. texture, sampler state) parameter.
  21. */
  22. struct GpuParamObjectDesc
  23. {
  24. String name;
  25. GpuParamObjectType type;
  26. UINT32 slot;
  27. };
  28. /**
  29. * @brief Describes a GPU program parameter block (collection of GPU program data parameters).
  30. */
  31. struct GpuParamBlockDesc
  32. {
  33. String name;
  34. UINT32 slot;
  35. UINT32 blockSize; /**< In multiples of 4 bytes. */
  36. bool isShareable;
  37. };
  38. /**
  39. * @brief Contains all parameter information for a GPU program, including data and object parameters,
  40. * plus parameter blocks.
  41. */
  42. struct GpuParamDesc
  43. {
  44. Map<String, GpuParamBlockDesc> paramBlocks;
  45. Map<String, GpuParamDataDesc> params;
  46. Map<String, GpuParamObjectDesc> samplers;
  47. Map<String, GpuParamObjectDesc> textures;
  48. Map<String, GpuParamObjectDesc> buffers;
  49. };
  50. }