CmGpuParamDesc.h 1.3 KB

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