BsD3D9EmulatedParamBlocks.h 1.3 KB

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