BsMaterialProxy.h 1.7 KB

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