BsGpuParamDesc.h 1.4 KB

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