BsMaterialProxy.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. //__________________________ Banshee Project - A modern game development toolkit _________________________________//
  2. //_____________________________________ www.banshee-project.com __________________________________________________//
  3. //________________________ Copyright (c) 2014 Marko Pintera. All rights reserved. ________________________________//
  4. #pragma once
  5. #include "BsCorePrerequisites.h"
  6. namespace BansheeEngine
  7. {
  8. /**
  9. * @brief Contains data about a single pass in a material used by the
  10. * material proxy.
  11. */
  12. struct BS_CORE_EXPORT MaterialProxyPass
  13. {
  14. HGpuProgram vertexProg;
  15. HGpuProgram fragmentProg;
  16. HGpuProgram geometryProg;
  17. HGpuProgram hullProg;
  18. HGpuProgram domainProg;
  19. HGpuProgram computeProg;
  20. UINT32 vertexProgParamsIdx;
  21. UINT32 fragmentProgParamsIdx;
  22. UINT32 geometryProgParamsIdx;
  23. UINT32 hullProgParamsIdx;
  24. UINT32 domainProgParamsIdx;
  25. UINT32 computeProgParamsIdx;
  26. HBlendState blendState;
  27. HRasterizerState rasterizerState;
  28. HDepthStencilState depthStencilState;
  29. UINT32 stencilRefValue;
  30. };
  31. /**
  32. * @brief Contains material information as seen by the core thread.
  33. * (Used for rendering and such.)
  34. */
  35. struct BS_CORE_EXPORT MaterialProxy
  36. {
  37. /**
  38. * @brief Contains a hardware GPU parameter buffer and index of the parameters and the slot
  39. * it binds to in a material proxy.
  40. */
  41. struct BS_CORE_EXPORT BufferBindInfo
  42. {
  43. BufferBindInfo(UINT32 paramsIdx, UINT32 slotIdx, const GpuParamBlockBufferPtr& buffer)
  44. :paramsIdx(paramsIdx), slotIdx(slotIdx), buffer(buffer)
  45. { }
  46. UINT32 paramsIdx;
  47. UINT32 slotIdx;
  48. GpuParamBlockBufferPtr buffer;
  49. };
  50. /**
  51. * @brief Contains GPU parameters and index of the parameters it binds to in the material proxy.
  52. */
  53. struct BS_CORE_EXPORT ParamsBindInfo
  54. {
  55. ParamsBindInfo(UINT32 paramsIdx, const GpuParamsPtr& params)
  56. :paramsIdx(paramsIdx), params(params)
  57. { }
  58. UINT32 paramsIdx;
  59. GpuParamsPtr params;
  60. };
  61. Vector<MaterialProxyPass> passes;
  62. Vector<GpuParamsPtr> params;
  63. ShaderProxyPtr shader;
  64. Vector<BufferBindInfo> rendererBuffers;
  65. };
  66. }