Counter Strike : Global Offensive Source Code
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
2.7 KiB

  1. //============ Copyright (c) Valve Corporation, All rights reserved. ============
  2. #ifndef IMATERIALSYSTEM2
  3. #define IMATERIALSYSTEM2
  4. #ifdef _WIN32
  5. #pragma once
  6. #endif
  7. #include "appframework/iappsystem.h"
  8. #include "materialsystem2/imaterial2.h"
  9. // TODO: Split out common enums and typedefs out of irenderdevice.h and include the lighter-weight .h file here
  10. #include "rendersystem/irenderdevice.h"
  11. //---------------------------------------------------------------------------------------------------------------------------------------------------
  12. // Forward declarations
  13. //---------------------------------------------------------------------------------------------------------------------------------------------------
  14. class IRenderContext;
  15. class IRenderHardwareConfig;
  16. //---------------------------------------------------------------------------------------------------------------------------------------------------
  17. // The new material system
  18. //---------------------------------------------------------------------------------------------------------------------------------------------------
  19. abstract_class IMaterialSystem2 : public IAppSystem
  20. {
  21. public:
  22. // This must be called before anything else in this interface! If you don't need modes, then call it with an array of { "", NULL } which is the
  23. // same as not using modes at all in your vfx shader files. The error shader is setup in this function, so it must be called! Last element must be NULL!
  24. // NOTE: Most callers will want the first mode string to be "" which is the default mode where the mode section in the .vfx is ignored
  25. virtual void SetModeStrings( const char **pModeStrings ) = 0;
  26. // If material cannot load, it will still return the error material. You can find out if you have that material by calling IMaterial2::IsErrorMaterial()
  27. virtual IMaterial2 *FindOrCreateMaterialFromVmt( const char *pVmtFileName, const char *pTextureGroupName, RenderSystemAssetFileLoadMode_t loadMode = LOADMODE_IMMEDIATE ) = 0;
  28. // renderablePass is created by IMaterial2->IMaterialMode->ComputeRenderablePassesForContext()
  29. virtual void SetRenderStateForRenderablePass( IRenderContext &renderContext, RenderInputLayout_t hInputLayout, const MaterialRenderablePass_t &renderablePass ) const = 0;
  30. // This will free all materials, shaders, constant buffers, textures, etc. that are ref counted to 0
  31. virtual void FreeAllUnreferencedData() = 0;
  32. // Must be called when no one else is calling into the material system or any IMaterial2
  33. virtual void FrameUpdate() = 0;
  34. // Temp interface to reload shaders (This will eventually live inside the material system but we don't have concommands right now)
  35. virtual void DynamicShaderCompile_ReloadAllShaders() = 0;
  36. };
  37. #endif // IMATERIALSYSTEM2