BsGpuParamDesc.h 1.7 KB

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