BsD3D9EmulatedParamBlocks.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //********************************** Banshee Engine (www.banshee3d.com) **************************************************//
  2. //**************** Copyright (c) 2016 Marko Pintera ([email protected]). All rights reserved. **********************//
  3. #pragma once
  4. #include "BsD3D9Prerequisites.h"
  5. namespace BansheeEngine
  6. {
  7. /**
  8. * @brief Represents a parameter block that can be used with GPU programs
  9. * that do not support them natively. Each block is defined with a unique
  10. * name (user defined) and a set of parameter names belonging to that block
  11. * (names must reference actual GPU variables).
  12. */
  13. struct D3D9EmulatedParamBlock
  14. {
  15. String blockName;
  16. Vector<String> paramNames;
  17. };
  18. /**
  19. * @brief Parses GPU program source and retrieves
  20. * parameter blocks from it.
  21. */
  22. class D3D9EmulatedParamBlockParser
  23. {
  24. public:
  25. /**
  26. * Parses GPU program source and retrieves parameter blocks from it. Returns
  27. * source without parameter block code.
  28. *
  29. * Parameter blocks can be anywhere in the source file and they must follow this exact structure:
  30. * BS_PARAM_BLOCK blockName { param1, param2, etc }
  31. */
  32. static String parse(const String& gpuProgSource, Vector<D3D9EmulatedParamBlock>& paramBlocks);
  33. };
  34. }