ShaderProgramResource.h 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef ANKI_RESOURCE_SHADER_PROGRAM_RESOURCE_H
  2. #define ANKI_RESOURCE_SHADER_PROGRAM_RESOURCE_H
  3. #include "anki/gl/ShaderProgram.h"
  4. namespace anki {
  5. /// @addtogroup Resource
  6. /// @{
  7. /// Shader program resource
  8. class ShaderProgramResource: public ShaderProgram
  9. {
  10. public:
  11. ShaderProgramResource()
  12. {}
  13. ~ShaderProgramResource()
  14. {}
  15. /// Resource load
  16. void load(const char* filename);
  17. /// Load and add extra code on top of the file
  18. void load(const char* filename, const char* extraSrc);
  19. /// Used by @ref Material and @ref Renderer to create custom shaders in
  20. /// the cache
  21. /// @param filename The file pathname of the shader prog
  22. /// @param preAppendedSrcCode The source code we want to write on top
  23. /// of the shader prog
  24. /// @param filenamePrefix Add that at the base filename for additional
  25. /// ways to identify the file in the cache
  26. /// @return The file pathname of the new shader prog. Its
  27. /// $HOME/.anki/cache/ + filenamePrefix + hash + .glsl
  28. static std::string createSrcCodeToCache(
  29. const char* filename,
  30. const char* preAppendedSrcCode,
  31. const char* filenamePrefix);
  32. };
  33. /// @}
  34. } // end namespace anki
  35. #endif