Reformat all the things. Have fun with merge conflicts.

This commit is contained in:
Pierre Bourdon
2016-06-24 10:43:46 +02:00
parent 2115e8a4a6
commit 3570c7f03a
1116 changed files with 187405 additions and 180344 deletions

View File

@ -46,84 +46,92 @@
namespace OGL
{
struct XFBSource : public XFBSourceBase
{
XFBSource(GLuint tex, int layers) : texture(tex), m_layers(layers) {}
~XFBSource();
XFBSource(GLuint tex, int layers) : texture(tex), m_layers(layers) {}
~XFBSource();
void CopyEFB(float Gamma) override;
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
void CopyEFB(float Gamma) override;
void DecodeToTexture(u32 xfbAddr, u32 fbWidth, u32 fbHeight) override;
const GLuint texture;
const int m_layers;
const GLuint texture;
const int m_layers;
};
class FramebufferManager : public FramebufferManagerBase
{
public:
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples);
~FramebufferManager();
FramebufferManager(int targetWidth, int targetHeight, int msaaSamples);
~FramebufferManager();
// To get the EFB in texture form, these functions may have to transfer
// the EFB to a resolved texture first.
static GLuint GetEFBColorTexture(const EFBRectangle& sourceRc);
static GLuint GetEFBDepthTexture(const EFBRectangle& sourceRc);
// To get the EFB in texture form, these functions may have to transfer
// the EFB to a resolved texture first.
static GLuint GetEFBColorTexture(const EFBRectangle& sourceRc);
static GLuint GetEFBDepthTexture(const EFBRectangle& sourceRc);
static GLuint GetEFBFramebuffer(unsigned int layer = 0) { return (layer < m_EFBLayers) ? m_efbFramebuffer[layer] : m_efbFramebuffer.back(); }
static GLuint GetXFBFramebuffer() { return m_xfbFramebuffer; }
static GLuint GetEFBFramebuffer(unsigned int layer = 0)
{
return (layer < m_EFBLayers) ? m_efbFramebuffer[layer] : m_efbFramebuffer.back();
}
static GLuint GetXFBFramebuffer() { return m_xfbFramebuffer; }
// Resolved framebuffer is only used in MSAA mode.
static GLuint GetResolvedFramebuffer() { return m_resolvedFramebuffer[0]; }
static void SetFramebuffer(GLuint fb);
static void FramebufferTexture(GLenum target, GLenum attachment, GLenum textarget, GLuint texture,
GLint level);
// Resolved framebuffer is only used in MSAA mode.
static GLuint GetResolvedFramebuffer() { return m_resolvedFramebuffer[0]; }
// If in MSAA mode, this will perform a resolve of the specified rectangle, and return the resolve
// target as a texture ID.
// Thus, this call may be expensive. Don't repeat it unnecessarily.
// If not in MSAA mode, will just return the render target texture ID.
// After calling this, before you render anything else, you MUST bind the framebuffer you want to
// draw to.
static GLuint ResolveAndGetRenderTarget(const EFBRectangle& rect);
static void SetFramebuffer(GLuint fb);
static void FramebufferTexture(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
// Same as above but for the depth Target.
// After calling this, before you render anything else, you MUST bind the framebuffer you want to
// draw to.
static GLuint ResolveAndGetDepthTarget(const EFBRectangle& rect);
// If in MSAA mode, this will perform a resolve of the specified rectangle, and return the resolve target as a texture ID.
// Thus, this call may be expensive. Don't repeat it unnecessarily.
// If not in MSAA mode, will just return the render target texture ID.
// After calling this, before you render anything else, you MUST bind the framebuffer you want to draw to.
static GLuint ResolveAndGetRenderTarget(const EFBRectangle &rect);
// Convert EFB content on pixel format change.
// convtype=0 -> rgb8->rgba6, convtype=2 -> rgba6->rgb8
static void ReinterpretPixelData(unsigned int convtype);
// Same as above but for the depth Target.
// After calling this, before you render anything else, you MUST bind the framebuffer you want to draw to.
static GLuint ResolveAndGetDepthTarget(const EFBRectangle &rect);
// Convert EFB content on pixel format change.
// convtype=0 -> rgb8->rgba6, convtype=2 -> rgba6->rgb8
static void ReinterpretPixelData(unsigned int convtype);
static void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points);
static void PokeEFB(EFBAccessType type, const EfbPokeData* points, size_t num_points);
private:
std::unique_ptr<XFBSourceBase> CreateXFBSource(unsigned int target_width, unsigned int target_height, unsigned int layers) override;
void GetTargetSize(unsigned int *width, unsigned int *height) override;
std::unique_ptr<XFBSourceBase> CreateXFBSource(unsigned int target_width,
unsigned int target_height,
unsigned int layers) override;
void GetTargetSize(unsigned int* width, unsigned int* height) override;
void CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc,float Gamma) override;
void CopyToRealXFB(u32 xfbAddr, u32 fbStride, u32 fbHeight, const EFBRectangle& sourceRc,
float Gamma) override;
static int m_targetWidth;
static int m_targetHeight;
static int m_msaaSamples;
static int m_targetWidth;
static int m_targetHeight;
static int m_msaaSamples;
static GLenum m_textureType;
static std::vector<GLuint> m_efbFramebuffer;
static GLuint m_xfbFramebuffer;
static GLuint m_efbColor;
static GLuint m_efbDepth;
static GLuint m_efbColorSwap;// will be hot swapped with m_efbColor when reinterpreting EFB pixel formats
static GLenum m_textureType;
static std::vector<GLuint> m_efbFramebuffer;
static GLuint m_xfbFramebuffer;
static GLuint m_efbColor;
static GLuint m_efbDepth;
static GLuint
m_efbColorSwap; // will be hot swapped with m_efbColor when reinterpreting EFB pixel formats
// Only used in MSAA mode, TODO: try to avoid them
static std::vector<GLuint> m_resolvedFramebuffer;
static GLuint m_resolvedColorTexture;
static GLuint m_resolvedDepthTexture;
// Only used in MSAA mode, TODO: try to avoid them
static std::vector<GLuint> m_resolvedFramebuffer;
static GLuint m_resolvedColorTexture;
static GLuint m_resolvedDepthTexture;
// For pixel format draw
static SHADER m_pixel_format_shaders[2];
// For pixel format draw
static SHADER m_pixel_format_shaders[2];
// For EFB pokes
static GLuint m_EfbPokes_VBO;
static GLuint m_EfbPokes_VAO;
static SHADER m_EfbPokes;
// For EFB pokes
static GLuint m_EfbPokes_VBO;
static GLuint m_EfbPokes_VAO;
static SHADER m_EfbPokes;
};
} // namespace OGL