VertexShaderManager.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. // Copyright 2008 Dolphin Emulator Project
  2. // Licensed under GPLv2+
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "VideoCommon/ConstantManager.h"
  6. #include "VideoCommon/VertexShaderGen.h"
  7. class PointerWrap;
  8. void UpdateProjectionHack(int iParams[], std::string sParams[]);
  9. // The non-API dependent parts.
  10. class VertexShaderManager
  11. {
  12. public:
  13. static void Init();
  14. static void Dirty();
  15. static void Shutdown();
  16. static void DoState(PointerWrap &p);
  17. // constant management
  18. static void SetConstants();
  19. static void InvalidateXFRange(int start, int end);
  20. static void SetTexMatrixChangedA(u32 value);
  21. static void SetTexMatrixChangedB(u32 value);
  22. static void SetViewportChanged();
  23. static void SetProjectionChanged();
  24. static void SetMaterialColorChanged(int index, u32 color);
  25. static void TranslateView(float x, float y, float z = 0.0f);
  26. static void RotateView(float x, float y);
  27. static void ResetView();
  28. // data: 3 floats representing the X, Y and Z vertex model coordinates and the posmatrix index.
  29. // out: 4 floats which will be initialized with the corresponding clip space coordinates
  30. // NOTE: g_fProjectionMatrix must be up to date when this is called
  31. // (i.e. VertexShaderManager::SetConstants needs to be called before using this!)
  32. static void TransformToClipSpace(const float* data, float* out, u32 mtxIdx);
  33. static VertexShaderConstants constants;
  34. static bool dirty;
  35. };