BsD3D9EmulatedParamBlocks.h 991 B

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