BsMaterialProxy.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  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 SPtr<GpuParamBlockBufferCore>& buffer)
  41. :paramsIdx(paramsIdx), slotIdx(slotIdx), buffer(buffer)
  42. { }
  43. UINT32 paramsIdx;
  44. UINT32 slotIdx;
  45. SPtr<GpuParamBlockBufferCore> buffer;
  46. };
  47. Vector<MaterialProxyPass> passes;
  48. Vector<SPtr<GpuParamsCore>> params;
  49. SPtr<ShaderCore> shader;
  50. Vector<BufferBindInfo> rendererBuffers;
  51. };
  52. }