//CFTTGraphicsDeviceVulkan - [2020-04-13 11:57:46]
#ifndef _CFTTGRAPHICSDEVICEVULKAN_H_
#define _CFTTGRAPHICSDEVICEVULKAN_H_

#include <android/native_window.h>
#include <vulkan/vulkan.h>
#include "CFTTGraphicsDevice.h"
#include "CFTTRenderTarget.h"
#include "CFTTTexture.h"
#include "CFTTShaderProgram.h"
#include "CFTTGraphicsBuffer.h"
#include "CFTTTextureVulkan.h"
#include "CFTTShaderProgramVulkan.h"

/*
00204364 CFTTGraphicsDeviceVulkan::CFTTGraphicsDeviceVulkan(ANativeWindow *)
00204474 CFTTGraphicsDeviceVulkan::clearTrackedState()
0020448C CFTTGraphicsDeviceVulkan::~CFTTGraphicsDeviceVulkan()
002044AC CFTTGraphicsDeviceVulkan::~CFTTGraphicsDeviceVulkan()
002044BA CFTTGraphicsDeviceVulkan::create()
002044C4 CFTTGraphicsDeviceVulkan::destroy()
0020456C CFTTGraphicsDeviceVulkan::createVolatileResources()
0020456E CFTTGraphicsDeviceVulkan::deleteVolatileResources()
00204570 CFTTGraphicsDeviceVulkan::MultisampleSupported()
00204588 CFTTGraphicsDeviceVulkan::GetGPUName(wchar_t *,int)
0020459C CFTTGraphicsDeviceVulkan::beginScene(CFTTClearSettings const&,CFTTRenderTarget *,bool)
00204760 CFTTGraphicsDeviceVulkan::endScene()
002047D8 CFTTGraphicsDeviceVulkan::width()
002047F8 CFTTGraphicsDeviceVulkan::height()
00204818 CFTTGraphicsDeviceVulkan::getDepthBufferBitDepth()
0020483C CFTTGraphicsDeviceVulkan::setWindowHandle(int *)
0020483E CFTTGraphicsDeviceVulkan::resetDisplay(int,int,int,int)
00204854 CFTTGraphicsDeviceVulkan::savePipelineCache()
00204864 CFTTGraphicsDeviceVulkan::setWireFrame(bool)
0020487C CFTTGraphicsDeviceVulkan::setDither(bool)
0020487E CFTTGraphicsDeviceVulkan::setDepthTest(EFTTDepthTest,bool)
0020488A CFTTGraphicsDeviceVulkan::enableStencilTest(bool)
0020488E CFTTGraphicsDeviceVulkan::setStencilFunc(EFTTStencilFunc,uint,uint)
00204894 CFTTGraphicsDeviceVulkan::setStencilOp(EFTTStencilOp,EFTTStencilOp,EFTTStencilOp)
0020489A CFTTGraphicsDeviceVulkan::setStencilMask(uint)
002048A0 CFTTGraphicsDeviceVulkan::enableScissorTest(int,int,int,int)
00204944 CFTTGraphicsDeviceVulkan::setTrackedState_Scissor(VkRect2D const&)
00204960 CFTTGraphicsDeviceVulkan::disableScissorTest()
00204988 CFTTGraphicsDeviceVulkan::createTexture()
0020499C CFTTGraphicsDeviceVulkan::createTexture(int,int,int,EFTTTexFormat,EFTTTextureType)
002049BC CFTTGraphicsDeviceVulkan::createRenderToTexture(EFTTTexFormat,int,int,uint,int,EFTTRTTZBufMode,bool,EFTTTextureType,uchar)
00204A00 CFTTGraphicsDeviceVulkan::createRenderToTexture(CFTTRTTSetup)
00204A40 CFTTGraphicsDeviceVulkan::getTextureFormatSupport(EFTTTexFormat,bool,bool)
00204ABC CFTTGraphicsDeviceVulkan::createShaderProgram(CFTTUberShader const*,uchar const*,bool)
00204ADC CFTTGraphicsDeviceVulkan::createGraphicsBuffer(EFTTGraphicsBufferType,EFTTGraphicsBufferVolatility,uint)
00204AFC CFTTGraphicsDeviceVulkan::setIndexBuffer(CFTTGraphicsBuffer *)
00204B1C CFTTGraphicsDeviceVulkan::setTrackedState_IndexBuffer(uint64_t,uint64_t)
00204B3C CFTTGraphicsDeviceVulkan::setVertexBuffer(CFTTGraphicsBuffer *,uint,uint,uint)
00204B70 CFTTGraphicsDeviceVulkan::setTrackedState_VertexBuffer(uint64_t,uint64_t)
00204B90 CFTTGraphicsDeviceVulkan::drawIndexed(FTTPRIMTYPE,int,int,int,int)
00204BD8 CFTTGraphicsDeviceVulkan::applyPipelineState(FTTPRIMTYPE)
00204C58 CFTTGraphicsDeviceVulkan::isFullyScissored()
00204C70 CFTTGraphicsDeviceVulkan::drawNonIndexed(FTTPRIMTYPE,int)
00204CB8 CFTTGraphicsDeviceVulkan::applyTrackedState()
00204EE0 CFTTGraphicsDeviceVulkan::applyTextures()
0020504C CFTTGraphicsDeviceVulkan::getSampler(CFTTTextureVulkan *)
00205170 CFTTGraphicsDeviceVulkan::setTrackedState_Viewport(VkViewport const&)
00205192 CFTTGraphicsDeviceVulkan::updateUniformLayoutCompatibility(EFTTVkUniformLayout,EFTTVkUniformLayout)
002051B4 CFTTGraphicsDeviceVulkan::setShaderProgram(CFTTShaderProgramVulkan *)
002051BA CFTTGraphicsDeviceVulkan::setBlend(EFTTBlendFunc,EFTTBlendValue,EFTTBlendValue,EFTTBlendFunc,EFTTBlendValue,EFTTBlendValue)
002051CC CFTTGraphicsDeviceVulkan::setCull(EFTTCullMode)
002051D0 CFTTGraphicsDeviceVulkan::setTextures(CFTTTextureVulkan **)
00205216 CFTTGraphicsDeviceVulkan::GetRendererFamily()
0020521A CFTTGraphicsDeviceVulkan::GetRendererType()
0020521E CFTTGraphicsDeviceVulkan::Matrices_FlipsRTT()
00205222 CFTTGraphicsDeviceVulkan::Matrices_FlipsY()
00205226 CFTTGraphicsDeviceVulkan::Matrices_NDCIsCube()
0020522A CFTTGraphicsDeviceVulkan::DepthTextureSupported()
0020522E CFTTGraphicsDeviceVulkan::FloatTextureSupported()
00205232 CFTTGraphicsDeviceVulkan::TextureLODSupported()
00205236 CFTTGraphicsDeviceVulkan::DepthMultisampleSupported()
0020523A CFTTGraphicsDeviceVulkan::ARGBToPlatformU32(uint,uint,uint,uint)
0020524A CFTTGraphicsDeviceVulkan::ARGBToPlatformU32(uint)
0020525C CFTTGraphicsDeviceVulkan::ExtractAFromPlatformU32(uint)
00205260 CFTTGraphicsDeviceVulkan::ExtractRFromPlatformU32(uint8)
00205264 CFTTGraphicsDeviceVulkan::ExtractGFromPlatformU32(uint)
0020526A CFTTGraphicsDeviceVulkan::ExtractBFromPlatformU32(uint)
00205270 CFTTGraphicsDeviceVulkan::ARGBToPlatform4444(uint,uint,uint,uint)
0020528A CFTTGraphicsDeviceVulkan::ARGBToPlatform4444(uint)
002052A8 CFTTGraphicsDeviceVulkan::ExtractAFromPlatform4444(ushort)
002052AE CFTTGraphicsDeviceVulkan::ExtractRFromPlatform4444(ushort)
002052B4 CFTTGraphicsDeviceVulkan::ExtractGFromPlatform4444(ushort)
002052BA CFTTGraphicsDeviceVulkan::ExtractBFromPlatform4444(ushort)

0x308
*/

enum EFTTVkUniformLayout {
  EFTTVkUniformLayout_0,
  EFTTVkUniformLayout_1,
  EFTTVkUniformLayout_2,
  EFTTVkUniformLayout_3,
  EFTTVkUniformLayout_4,
  EFTTVkUniformLayout_5,
};

enum EFTTBlendFunc {
  EFTTBlendFunc_0,
  EFTTBlendFunc_1,
  EFTTBlendFunc_2,
  EFTTBlendFunc_3,
  EFTTBlendFunc_4,
  EFTTBlendFunc_5,
};

enum EFTTBlendValue {
  EFTTBlendValue_0,
  EFTTBlendValue_1,
  EFTTBlendValue_2,
  EFTTBlendValue_3,
  EFTTBlendValue_4,
  EFTTBlendValue_5,
};

class CFTTGraphicsDeviceVulkan : public CFTTGraphicsDevice {
public:
  CFTTGraphicsDeviceVulkan(ANativeWindow *);                                  //00204364
  ~CFTTGraphicsDeviceVulkan();                                                //0020448C  002044AC
  void clearTrackedState();                                                   //00204474
  int create();                                                               //002044BA
  void destroy();                                                             //002044C4
  void createVolatileResources();                                             //0020456C
  void deleteVolatileResources();                                             //0020456E
  bool MultisampleSupported();                                                //00204570
  void GetGPUName(wchar_t *, int);                                            //00204588
  bool beginScene(CFTTClearSettings const &, CFTTRenderTarget *, bool);       //0020459C
  void endScene();                                                            //00204760
  int width();                                                                //002047D8
  int height();                                                               //002047F8
  int getDepthBufferBitDepth();                                               //00204818
  void setWindowHandle(int *);                                                //0020483C
  int resetDisplay(int, int, int, int);                                       //0020483E
  void savePipelineCache();                                                   //00204854
  void setWireFrame(bool);                                                    //00204864
  void setDither(bool);                                                       //0020487C
  void setDepthTest(EFTTDepthTest, bool);                                     //0020487E
  void enableStencilTest(bool);                                               //0020488A
  void setStencilFunc(EFTTStencilFunc, GLint, GLint);                         //0020488E
  void setStencilOp(EFTTStencilOp, EFTTStencilOp, EFTTStencilOp);             //00204894
  void setStencilMask(uint);                                                  //0020489A
  void enableScissorTest(int, int, int, int);                                 //002048A0
  void setTrackedState_Scissor(VkRect2D const &);                             //00204944
  void disableScissorTest();                                                  //00204960
  CFTTTexture *createTexture();                                               //00204988
  CFTTTexture *createTexture(int, int, int, EFTTTexFormat, EFTTTextureType);  //0020499C
  CFTTRenderToTexture *createRenderToTexture(EFTTTexFormat,
                                             int,
                                             int,
                                             uint,
                                             int,
                                             EFTTRTTZBufMode,
                                             bool,
                                             EFTTTextureType,
                                             uchar);                                    //002049BC
  CFTTRenderToTexture *createRenderToTexture(CFTTRTTSetup);                             //00204A00
  int getTextureFormatSupport(EFTTTexFormat, bool, bool);                               //00204A40
  CFTTShaderProgram *createShaderProgram(CFTTUberShader const *, uchar const *, bool);  //00204ABC
  CFTTGraphicsBuffer *createGraphicsBuffer(EFTTGraphicsBufferType,
                                           EFTTGraphicsBufferVolatility,
                                           uint);                //00204ADC
  void setIndexBuffer(CFTTGraphicsBuffer *);                     //00204AFC
  void setTrackedState_IndexBuffer(uint64_t, uint64_t);          //00204B1C
  void setVertexBuffer(CFTTGraphicsBuffer *, uint, uint, uint);  //00204B3C
  void setTrackedState_VertexBuffer(uint64_t, uint64_t);         //00204B70
  void drawIndexed(FTTPRIMTYPE, int, int, int, int);             //00204B90
  int applyPipelineState(FTTPRIMTYPE);                           //00204BD8
  bool isFullyScissored();                                       //00204C58
  void drawNonIndexed(FTTPRIMTYPE, int);                         //00204C70
  int applyTrackedState();                                       //00204CB8
  int applyTextures();                                           //00204EE0
  int getSampler(CFTTTextureVulkan *);                           //0020504C
  void setTrackedState_Viewport(VkViewport const &);             //00205170
  void updateUniformLayoutCompatibility(EFTTVkUniformLayout,
                                        EFTTVkUniformLayout);  //00205192
  void setShaderProgram(CFTTShaderProgramVulkan *);            //002051B4
  void setBlend(EFTTBlendFunc,
                EFTTBlendValue,
                EFTTBlendValue,
                EFTTBlendFunc,
                EFTTBlendValue,
                EFTTBlendValue);                    //002051BA
  void setCull(EFTTCullMode);                       //002051CC
  void setTextures(CFTTTextureVulkan **);            //002051D0
  int GetRendererFamily();                          //00205216
  int GetRendererType();                            //0020521A
  int Matrices_FlipsRTT();                          //0020521E
  int Matrices_FlipsY();                            //00205222
  int Matrices_NDCIsCube();                         //00205226
  bool DepthTextureSupported();                     //0020522A
  bool FloatTextureSupported();                     //0020522E
  bool TextureLODSupported();                       //00205232
  bool DepthMultisampleSupported();                 //00205236
  uint ARGBToPlatformU32(uint, uint, uint, uint);   //0020523A
  uint ARGBToPlatformU32(uint);                     //0020524A
  uint ExtractAFromPlatformU32(uint);               //0020525C
  uint ExtractRFromPlatformU32(uint8);              //00205260
  uint ExtractGFromPlatformU32(uint);               //00205264
  uint ExtractBFromPlatformU32(uint);               //0020526A
  uint ARGBToPlatform4444(uint, uint, uint, uint);  //00205270
  uint ARGBToPlatform4444(uint);                    //0020528A
  uint ExtractAFromPlatform4444(ushort);            //002052A8
  uint ExtractRFromPlatform4444(ushort);            //002052AE
  uint ExtractGFromPlatform4444(ushort);            //002052B4
  uint ExtractBFromPlatform4444(ushort);            //002052BA
};

extern CFTTGraphicsDeviceVulkan *g_pVkDevice;

#endif  //_CFTTGRAPHICSDEVICEVULKAN_H_