diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index fc0200d76d..77ef5d5dd9 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -1019,13 +1019,13 @@ int DrawEngineCommon::DecodeInds() { return indexGen.VertexCount(); } -bool DrawEngineCommon::CanUseHardwareTransform(int prim) { +bool DrawEngineCommon::CanUseHardwareTransform(int prim) const { if (!useHWTransform_) return false; return !gstate.isModeThrough() && prim != GE_PRIM_RECTANGLES && prim > GE_PRIM_LINE_STRIP; } -bool DrawEngineCommon::CanUseHardwareTessellation(GEPatchPrimType prim) { +bool DrawEngineCommon::CanUseHardwareTessellation(GEPatchPrimType prim) const { if (useHWTessellation_) { return CanUseHardwareTransform(PatchPrimToPrim(prim)); } diff --git a/GPU/Common/DrawEngineCommon.h b/GPU/Common/DrawEngineCommon.h index b59a1c73a0..4ee167a1b5 100644 --- a/GPU/Common/DrawEngineCommon.h +++ b/GPU/Common/DrawEngineCommon.h @@ -65,7 +65,7 @@ namespace Spline { struct Weight2D; } class TessellationDataTransfer { public: virtual ~TessellationDataTransfer() {} - void CopyControlPoints(float *pos, float *tex, float *col, int posStride, int texStride, int colStride, const SimpleVertex *const *points, int size, u32 vertType); + static void CopyControlPoints(float *pos, float *tex, float *col, int posStride, int texStride, int colStride, const SimpleVertex *const *points, int size, u32 vertType); virtual void SendDataToShader(const SimpleVertex *const *points, int size_u, int size_v, u32 vertType, const Spline::Weight2D &weights) = 0; }; @@ -121,10 +121,10 @@ public: template void SubmitCurve(const void *control_points, const void *indices, Surface &surface, u32 vertType, int *bytesRead, const char *scope); - void ClearSplineBezierWeights(); + static void ClearSplineBezierWeights(); - bool CanUseHardwareTransform(int prim); - bool CanUseHardwareTessellation(GEPatchPrimType prim); + bool CanUseHardwareTransform(int prim) const; + bool CanUseHardwareTessellation(GEPatchPrimType prim) const; std::vector DebugGetVertexLoaderIDs(); std::string DebugGetVertexLoaderString(std::string id, DebugShaderStringType stringType); @@ -161,7 +161,7 @@ protected: void ApplyFramebufferRead(FBOTexState *fboTexState); - inline int IndexSize(u32 vtype) const { + static inline int IndexSize(u32 vtype) { const u32 indexType = (vtype & GE_VTYPE_IDX_MASK); if (indexType == GE_VTYPE_IDX_16BIT) { return 2; diff --git a/GPU/Common/FramebufferManagerCommon.cpp b/GPU/Common/FramebufferManagerCommon.cpp index e5fb5d0df9..50451f4514 100644 --- a/GPU/Common/FramebufferManagerCommon.cpp +++ b/GPU/Common/FramebufferManagerCommon.cpp @@ -1045,12 +1045,12 @@ void FramebufferManagerCommon::DownloadFramebufferOnSwitch(VirtualFramebuffer *v } } -bool FramebufferManagerCommon::ShouldDownloadFramebufferColor(const VirtualFramebuffer *vfb) const { +bool FramebufferManagerCommon::ShouldDownloadFramebufferColor(const VirtualFramebuffer *vfb) { // Dangan Ronpa hack return PSP_CoreParameter().compat.flags().Force04154000Download && vfb->fb_address == 0x04154000; } -bool FramebufferManagerCommon::ShouldDownloadFramebufferDepth(const VirtualFramebuffer *vfb) const { +bool FramebufferManagerCommon::ShouldDownloadFramebufferDepth(const VirtualFramebuffer *vfb) { // Download depth buffer for Syphon Filter lens flares if (!PSP_CoreParameter().compat.flags().ReadbackDepth || g_Config.iSkipGPUReadbackMode != (int)SkipGPUReadbackMode::NO_SKIP) { return false; @@ -2895,7 +2895,7 @@ Draw::Framebuffer *FramebufferManagerCommon::GetTempFBO(TempFBO reason, u16 w, u return fbo; } -void FramebufferManagerCommon::UpdateFramebufUsage(VirtualFramebuffer *vfb) { +void FramebufferManagerCommon::UpdateFramebufUsage(VirtualFramebuffer *vfb) const { auto checkFlag = [&](u16 flag, int last_frame) { if (vfb->usageFlags & flag) { const int age = frameLastFramebufUsed_ - last_frame; diff --git a/GPU/Common/FramebufferManagerCommon.h b/GPU/Common/FramebufferManagerCommon.h index 02b0c467fc..99c45295b0 100644 --- a/GPU/Common/FramebufferManagerCommon.h +++ b/GPU/Common/FramebufferManagerCommon.h @@ -512,15 +512,15 @@ protected: void EstimateDrawingSize(u32 fb_address, int fb_stride, GEBufferFormat fb_format, int viewport_width, int viewport_height, int region_width, int region_height, int scissor_width, int scissor_height, int &drawing_width, int &drawing_height); void NotifyRenderFramebufferCreated(VirtualFramebuffer *vfb); - void NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb); + static void NotifyRenderFramebufferUpdated(VirtualFramebuffer *vfb); void NotifyRenderFramebufferSwitched(VirtualFramebuffer *prevVfb, VirtualFramebuffer *vfb, bool isClearingDepth); void BlitFramebufferDepth(VirtualFramebuffer *src, VirtualFramebuffer *dst); void ResizeFramebufFBO(VirtualFramebuffer *vfb, int w, int h, bool force = false, bool skipCopy = false); - bool ShouldDownloadFramebufferColor(const VirtualFramebuffer *vfb) const; - bool ShouldDownloadFramebufferDepth(const VirtualFramebuffer *vfb) const; + static bool ShouldDownloadFramebufferColor(const VirtualFramebuffer *vfb); + static bool ShouldDownloadFramebufferDepth(const VirtualFramebuffer *vfb); void DownloadFramebufferOnSwitch(VirtualFramebuffer *vfb); bool FindTransferFramebuffer(u32 basePtr, int stride, int x, int y, int w, int h, int bpp, bool destination, BlockTransferRect *rect); @@ -530,7 +530,7 @@ protected: VirtualFramebuffer *CreateRAMFramebuffer(uint32_t fbAddress, int width, int height, int stride, GEBufferFormat format); - void UpdateFramebufUsage(VirtualFramebuffer *vfb); + void UpdateFramebufUsage(VirtualFramebuffer *vfb) const; int GetFramebufferLayers() const; diff --git a/GPU/Common/GPUDebugInterface.cpp b/GPU/Common/GPUDebugInterface.cpp index 743d884093..6aa2fb884f 100644 --- a/GPU/Common/GPUDebugInterface.cpp +++ b/GPU/Common/GPUDebugInterface.cpp @@ -521,8 +521,8 @@ public: private: bool parseFieldReference(const char *ref, const char *field, uint32_t &referenceIndex); - uint32_t getFieldValue(GECmdFormat fmt, GECmdField field, uint32_t value); - ExpressionType getFieldType(GECmdFormat fmt, GECmdField field); + static uint32_t getFieldValue(GECmdFormat fmt, GECmdField field, uint32_t value); + static ExpressionType getFieldType(GECmdFormat fmt, GECmdField field); GPUDebugInterface *gpu_; }; diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index ddea136608..4e5cce6985 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -639,7 +639,7 @@ void SoftwareTransform::BuildDrawingParams(int prim, int vertexCount, u32 vertTy result->drawNumTrans = numTrans; } -void SoftwareTransform::CalcCullParams(float &minZValue, float &maxZValue) { +void SoftwareTransform::CalcCullParams(float &minZValue, float &maxZValue) const { // The projected Z can be up to 0x3F8000FF, which is where this constant is from. // It seems like it may only maintain 15 mantissa bits (excluding implied.) maxZValue = 1.000030517578125f * gstate_c.vpDepthScale; @@ -758,7 +758,7 @@ bool SoftwareTransform::ExpandRectangles(int vertexCount, int &numDecodedVerts, return true; } -bool SoftwareTransform::ExpandLines(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) const { +bool SoftwareTransform::ExpandLines(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) { // Before we start, do a sanity check - does the output fit? if ((vertexCount / 2) * 6 > indsSize) { // Won't fit, kill the draw. @@ -892,7 +892,7 @@ bool SoftwareTransform::ExpandLines(int vertexCount, int &numDecodedVerts, int v return true; } -bool SoftwareTransform::ExpandPoints(int vertexCount, int &maxIndex, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) const { +bool SoftwareTransform::ExpandPoints(int vertexCount, int &maxIndex, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) { // Before we start, do a sanity check - does the output fit? if (vertexCount * 6 > indsSize) { // Won't fit, kill the draw. diff --git a/GPU/Common/SoftwareTransformCommon.h b/GPU/Common/SoftwareTransformCommon.h index c33eb9151a..78717cdfa3 100644 --- a/GPU/Common/SoftwareTransformCommon.h +++ b/GPU/Common/SoftwareTransformCommon.h @@ -74,10 +74,10 @@ public: void BuildDrawingParams(int prim, int vertexCount, u32 vertType, u16 *&inds, int indsSize, int &numDecodedVerts, int vertsSize, SoftwareTransformResult *result); protected: - void CalcCullParams(float &minZValue, float &maxZValue); + void CalcCullParams(float &minZValue, float &maxZValue) const; bool ExpandRectangles(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode, bool *pixelMappedExactly) const; - bool ExpandLines(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) const; - bool ExpandPoints(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) const; + static bool ExpandLines(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) ; + static bool ExpandPoints(int vertexCount, int &numDecodedVerts, int vertsSize, u16 *&inds, int indsSize, const TransformedVertex *transformed, TransformedVertex *transformedExpanded, int &numTrans, bool throughmode) ; const SoftwareTransformParams ¶ms_; Lin::Matrix4x4 projMatrix_; diff --git a/GPU/Common/SplineCommon.cpp b/GPU/Common/SplineCommon.cpp index 69c80d1c02..bf0921c54a 100644 --- a/GPU/Common/SplineCommon.cpp +++ b/GPU/Common/SplineCommon.cpp @@ -81,7 +81,7 @@ void BuildIndex(u16 *indices, int &count, int num_u, int num_v, GEPatchPrimType class Bezier3DWeight { private: - void CalcWeights(float t, Weight &w) { + static void CalcWeights(float t, Weight &w) { // Bernstein 3D basis polynomial w.basis[0] = (1 - t) * (1 - t) * (1 - t); w.basis[1] = 3 * t * (1 - t) * (1 - t); @@ -95,7 +95,7 @@ private: w.deriv[3] = 3 * t * t; } public: - Weight *CalcWeightsAll(u32 key) { + static Weight *CalcWeightsAll(u32 key) { int tess = (int)key; Weight *weights = new Weight[tess + 1]; const float inv_tess = 1.0f / (float)tess; @@ -129,7 +129,7 @@ private: }; // knot should be an array sized n + 5 (n + 1 + 1 + degree (cubic)) - void CalcKnots(int n, int type, float *knots, KnotDiv *divs) { + static void CalcKnots(int n, int type, float *knots, KnotDiv *divs) { // Basic theory (-2 to +3), optimized with KnotDiv (-2 to +0) // for (int i = 0; i < n + 5; ++i) { for (int i = 0; i < n + 2; ++i) { @@ -160,7 +160,7 @@ private: } } - void CalcWeights(float t, const float *knots, const KnotDiv &div, Weight &w) { + static void CalcWeights(float t, const float *knots, const KnotDiv &div, Weight &w) { #ifdef _M_SSE const __m128 knot012 = _mm_loadu_ps(knots); const __m128 t012 = _mm_sub_ps(_mm_set_ps1(t), knot012); diff --git a/GPU/Common/TextureCacheCommon.h b/GPU/Common/TextureCacheCommon.h index 4e15abab66..e3e30de652 100644 --- a/GPU/Common/TextureCacheCommon.h +++ b/GPU/Common/TextureCacheCommon.h @@ -400,7 +400,7 @@ protected: virtual void BindAsClutTexture(Draw::Texture *tex, bool smooth) {} CheckAlphaResult DecodeTextureLevel(u8 *out, int outPitch, GETextureFormat format, GEPaletteFormat clutformat, uint32_t texaddr, int level, int bufw, TexDecodeFlags flags); - void UnswizzleFromMem(u32 *dest, u32 destPitch, const u8 *texptr, u32 bufw, u32 height, u32 bytesPerPixel); + static void UnswizzleFromMem(u32 *dest, u32 destPitch, const u8 *texptr, u32 bufw, u32 height, u32 bytesPerPixel); CheckAlphaResult ReadIndexedTex(u8 *out, int outPitch, int level, const u8 *texptr, int bytesPerIndex, int bufw, bool reverseColors, bool expandTo32Bit); ReplacedTexture *FindReplacement(TexCacheEntry *entry, int *w, int *h, int *d); void PollReplacement(TexCacheEntry *entry, int *w, int *h, int *d); @@ -418,7 +418,7 @@ protected: return (const T *)clutBufRaw_; } - u32 EstimateTexMemoryUsage(const TexCacheEntry *entry); + static u32 EstimateTexMemoryUsage(const TexCacheEntry *entry); SamplerCacheKey GetSamplingParams(int maxLevel, const TexCacheEntry *entry); SamplerCacheKey GetFramebufferSamplingParams(u16 bufferWidth, u16 bufferHeight); diff --git a/GPU/Common/TextureReplacer.cpp b/GPU/Common/TextureReplacer.cpp index bca1b4cf09..53f7e716a8 100644 --- a/GPU/Common/TextureReplacer.cpp +++ b/GPU/Common/TextureReplacer.cpp @@ -723,7 +723,7 @@ public: } }; -bool TextureReplacer::WillSave(const ReplacedTextureDecodeInfo &replacedInfo) { +bool TextureReplacer::WillSave(const ReplacedTextureDecodeInfo &replacedInfo) const { if (!saveEnabled_) return false; // Don't save the PPGe texture. diff --git a/GPU/Common/TextureReplacer.h b/GPU/Common/TextureReplacer.h index 53b92dfcfb..d941be87e9 100644 --- a/GPU/Common/TextureReplacer.h +++ b/GPU/Common/TextureReplacer.h @@ -112,7 +112,7 @@ public: ReplacedTexture *FindReplacement(u64 cachekey, u32 hash, int w, int h); // Check if a NotifyTextureDecoded for this texture is desired (used to avoid reads from write-combined memory.) - bool WillSave(const ReplacedTextureDecodeInfo &replacedInfo); + bool WillSave(const ReplacedTextureDecodeInfo &replacedInfo) const; // Notify that a new texture was decoded. May already be upscaled, saves the data passed. // If the replacer knows about this one already, texture will be passed in, otherwise nullptr. @@ -140,7 +140,7 @@ protected: float LookupReduceHashRange(int w, int h); std::string LookupHashFile(u64 cachekey, u32 hash, bool *foundAlias, bool *ignored); - void ScanForHashNamedFiles(VFSBackend *dir, std::map> &filenameMap); + static void ScanForHashNamedFiles(VFSBackend *dir, std::map> &filenameMap); void ComputeAliasMap(const std::map> &filenameMap); bool replaceEnabled_ = false; diff --git a/GPU/Common/TextureScalerCommon.cpp b/GPU/Common/TextureScalerCommon.cpp index a02ada92ff..a27e109c5c 100644 --- a/GPU/Common/TextureScalerCommon.cpp +++ b/GPU/Common/TextureScalerCommon.cpp @@ -595,7 +595,7 @@ TextureScalerCommon::TextureScalerCommon() { TextureScalerCommon::~TextureScalerCommon() { } -bool TextureScalerCommon::IsEmptyOrFlat(const u32 *data, int pixels) const { +bool TextureScalerCommon::IsEmptyOrFlat(const u32 *data, int pixels) { u32 ref = data[0]; // TODO: SIMD-ify this (although, for most textures we'll get out very early) for (int i = 1; i < pixels; ++i) { diff --git a/GPU/Common/TextureScalerCommon.h b/GPU/Common/TextureScalerCommon.h index 7f6881d1ce..fbe91a2511 100644 --- a/GPU/Common/TextureScalerCommon.h +++ b/GPU/Common/TextureScalerCommon.h @@ -37,15 +37,15 @@ public: enum { XBRZ = 0, HYBRID = 1, BICUBIC = 2, HYBRID_BICUBIC = 3 }; protected: - void ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height); + static void ScaleXBRZ(int factor, u32* source, u32* dest, int width, int height); void ScaleBilinear(int factor, u32* source, u32* dest, int width, int height); - void ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height); - void ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height); + static void ScaleBicubicBSpline(int factor, u32* source, u32* dest, int width, int height); + static void ScaleBicubicMitchell(int factor, u32* source, u32* dest, int width, int height); void ScaleHybrid(int factor, u32* source, u32* dest, int width, int height, bool bicubic = false); void DePosterize(u32* source, u32* dest, int width, int height); - bool IsEmptyOrFlat(const u32 *data, int pixels) const; + static bool IsEmptyOrFlat(const u32 *data, int pixels) ; // depending on the factor and texture sizes, these can get pretty large // maximum is (100 MB total for a 512 by 512 texture with scaling factor 5 and hybrid scaling) diff --git a/GPU/Common/VertexDecoderCommon.cpp b/GPU/Common/VertexDecoderCommon.cpp index bef8e6f8c4..4921e3bba8 100644 --- a/GPU/Common/VertexDecoderCommon.cpp +++ b/GPU/Common/VertexDecoderCommon.cpp @@ -1488,7 +1488,7 @@ int VertexDecoder::ToString(char *output, bool spaces) const { return output - start; } -std::string VertexDecoder::GetString(DebugShaderStringType stringType) { +std::string VertexDecoder::GetString(DebugShaderStringType stringType) const { char buffer[256]; switch (stringType) { case SHADER_STRING_SHORT_DESC: diff --git a/GPU/Common/VertexDecoderCommon.h b/GPU/Common/VertexDecoderCommon.h index 20683eb0ba..4a30c5bef6 100644 --- a/GPU/Common/VertexDecoderCommon.h +++ b/GPU/Common/VertexDecoderCommon.h @@ -342,7 +342,7 @@ public: int VertexSize() const { return size; } // PSP format size - std::string GetString(DebugShaderStringType stringType); + std::string GetString(DebugShaderStringType stringType) const; void Step_WeightsU8() const; void Step_WeightsU16() const; diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index 4445dd57c3..1fcfc119bd 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -464,7 +464,7 @@ bail: } // TODO: Refactor this to a single USE flag. -bool DrawEngineGLES::SupportsHWTessellation() const { +bool DrawEngineGLES::SupportsHWTessellation() { bool hasTexelFetch = gl_extensions.GLES3 || (!gl_extensions.IsGLES && gl_extensions.VersionGEThan(3, 3, 0)) || gl_extensions.EXT_gpu_shader4; return hasTexelFetch && gstate_c.UseAll(GPU_USE_VERTEX_TEXTURE_FETCH | GPU_USE_TEXTURE_FLOAT | GPU_USE_INSTANCE_RENDERING); } diff --git a/GPU/GLES/DrawEngineGLES.h b/GPU/GLES/DrawEngineGLES.h index e61951c1f1..06264637f7 100644 --- a/GPU/GLES/DrawEngineGLES.h +++ b/GPU/GLES/DrawEngineGLES.h @@ -105,7 +105,7 @@ public: void ClearInputLayoutMap(); - bool SupportsHWTessellation() const; + static bool SupportsHWTessellation() ; protected: bool UpdateUseHWTessellation(bool enable) const override; diff --git a/GPU/GLES/FragmentTestCacheGLES.cpp b/GPU/GLES/FragmentTestCacheGLES.cpp index 1033f2a2a2..31907f78ce 100644 --- a/GPU/GLES/FragmentTestCacheGLES.cpp +++ b/GPU/GLES/FragmentTestCacheGLES.cpp @@ -85,7 +85,7 @@ void FragmentTestCacheGLES::BindTestTexture(int slot) { cache_[id] = item; } -FragmentTestID FragmentTestCacheGLES::GenerateTestID() const { +FragmentTestID FragmentTestCacheGLES::GenerateTestID() { FragmentTestID id; // Let's just keep it simple, it's all in here. id.alpha = gstate.isAlphaTestEnabled() ? gstate.alphatest : 0; diff --git a/GPU/GLES/FragmentTestCacheGLES.h b/GPU/GLES/FragmentTestCacheGLES.h index c1c434698f..ddb9eca154 100644 --- a/GPU/GLES/FragmentTestCacheGLES.h +++ b/GPU/GLES/FragmentTestCacheGLES.h @@ -78,7 +78,7 @@ public: private: GLRTexture *CreateTestTexture(const GEComparison funcs[4], const u8 refs[4], const u8 masks[4], const bool valid[4]); - FragmentTestID GenerateTestID() const; + static FragmentTestID GenerateTestID() ; GLRenderManager *render_; TextureCacheGLES *textureCache_; diff --git a/GPU/GLES/ShaderManagerGLES.cpp b/GPU/GLES/ShaderManagerGLES.cpp index 4ebe8fb516..dc36d8e114 100644 --- a/GPU/GLES/ShaderManagerGLES.cpp +++ b/GPU/GLES/ShaderManagerGLES.cpp @@ -379,7 +379,7 @@ static inline bool GuessVRDrawingHUD(bool is2D, bool flatScreen) { return hud; } -void LinkedShader::use(const ShaderID &VSID) { +void LinkedShader::use(const ShaderID &VSID) const { render_->BindProgram(program); // Note that we no longer track attr masks here - we do it for the input layouts instead. } @@ -1026,7 +1026,7 @@ bool ShaderManagerGLES::LoadCache(File::IOFile &f) { linkPos = 0; } - bool Done() { + bool Done() const { return vertPos >= vert.size() && fragPos >= frag.size() && linkPos >= link.size(); } } diskCachePending_; diff --git a/GPU/GLES/ShaderManagerGLES.h b/GPU/GLES/ShaderManagerGLES.h index 5a91bc7f7c..063c7d012b 100644 --- a/GPU/GLES/ShaderManagerGLES.h +++ b/GPU/GLES/ShaderManagerGLES.h @@ -40,7 +40,7 @@ public: LinkedShader(GLRenderManager *render, VShaderID VSID, Shader *vs, FShaderID FSID, Shader *fs, bool useHWTransform, bool preloading = false); ~LinkedShader(); - void use(const ShaderID &VSID); + void use(const ShaderID &VSID) const; void UpdateUniforms(const ShaderID &VSID, bool useBufferedRendering, const ShaderLanguageDesc &shaderLanguage); void Delete(); @@ -181,7 +181,7 @@ public: std::vector DebugGetShaderIDs(DebugShaderType type) override; std::string DebugGetShaderString(std::string id, DebugShaderType type, DebugShaderStringType stringType) override; - bool LoadCacheFlags(File::IOFile &f, DrawEngineGLES *drawEngine); + static bool LoadCacheFlags(File::IOFile &f, DrawEngineGLES *drawEngine); bool LoadCache(File::IOFile &f); void SaveCache(const Path &filename, DrawEngineGLES *drawEngine); diff --git a/GPU/GLES/TextureCacheGLES.cpp b/GPU/GLES/TextureCacheGLES.cpp index 94dcf0db04..25fe23eea3 100644 --- a/GPU/GLES/TextureCacheGLES.cpp +++ b/GPU/GLES/TextureCacheGLES.cpp @@ -362,7 +362,7 @@ void TextureCacheGLES::BuildTexture(TexCacheEntry *const entry) { } } -Draw::DataFormat TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { +Draw::DataFormat TextureCacheGLES::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) { switch (format) { case GE_TFMT_CLUT4: case GE_TFMT_CLUT8: diff --git a/GPU/GLES/TextureCacheGLES.h b/GPU/GLES/TextureCacheGLES.h index 6f90475ed1..5d3e993020 100644 --- a/GPU/GLES/TextureCacheGLES.h +++ b/GPU/GLES/TextureCacheGLES.h @@ -67,7 +67,7 @@ protected: private: void ApplySamplingParams(const SamplerCacheKey &key) override; - Draw::DataFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; + static Draw::DataFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) ; void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void BuildTexture(TexCacheEntry *const entry) override; diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index ede8d1ec73..f5732b3f1f 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -158,7 +158,7 @@ public: void Execute_Unknown(u32 op, u32 diff); - int EstimatePerVertexCost(); + static int EstimatePerVertexCost(); // Note: Not virtual! void Flush(); diff --git a/GPU/GPUState.h b/GPU/GPUState.h index 664313d48f..c15601fdc7 100644 --- a/GPU/GPUState.h +++ b/GPU/GPUState.h @@ -456,7 +456,7 @@ struct GPUgstate { // Real data in the context ends here - void Reset(); + static void Reset(); void Save(u32_le *ptr); void Restore(const u32_le *ptr); }; @@ -720,7 +720,7 @@ public: GEBufferFormat depalFramebufferFormat; u32 getRelativeAddress(u32 data) const; - void Reset(); + static void Reset(); void DoState(PointerWrap &p); }; diff --git a/GPU/Software/BinManager.h b/GPU/Software/BinManager.h index a361ca414a..45f5f964e2 100644 --- a/GPU/Software/BinManager.h +++ b/GPU/Software/BinManager.h @@ -277,7 +277,7 @@ private: void MarkPendingReads(const Rasterizer::RasterizerState &state); void MarkPendingWrites(const Rasterizer::RasterizerState &state); bool HasTextureWrite(const Rasterizer::RasterizerState &state); - bool IsExactSelfRender(const Rasterizer::RasterizerState &state, const BinItem &item); + static bool IsExactSelfRender(const Rasterizer::RasterizerState &state, const BinItem &item); void OptimizePendingStates(uint16_t first, uint16_t last); BinCoords Scissor(BinCoords range); BinCoords Range(const VertexData &v0, const VertexData &v1, const VertexData &v2); diff --git a/GPU/Software/DrawPixel.h b/GPU/Software/DrawPixel.h index e989e17e76..f6f6ec0be1 100644 --- a/GPU/Software/DrawPixel.h +++ b/GPU/Software/DrawPixel.h @@ -66,7 +66,7 @@ public: // Returns a pointer to the code to run. SingleFunc GetSingle(const PixelFuncID &id, BinManager *binner); - SingleFunc GenericSingle(const PixelFuncID &id); + static SingleFunc GenericSingle(const PixelFuncID &id); void Clear() override; void Flush(); diff --git a/GPU/Software/SoftGpu.h b/GPU/Software/SoftGpu.h index 05ae3bb8e9..5f2499c34f 100644 --- a/GPU/Software/SoftGpu.h +++ b/GPU/Software/SoftGpu.h @@ -30,27 +30,27 @@ struct FormatBuffer { u32 *as32; }; - inline void Set16(int x, int y, int stride, u16 v) { + inline void Set16(int x, int y, int stride, u16 v) const { as16[x + y * stride] = v; } - inline void Set32(int x, int y, int stride, u32 v) { + inline void Set32(int x, int y, int stride, u32 v) const { as32[x + y * stride] = v; } - inline u16 Get16(int x, int y, int stride) { + inline u16 Get16(int x, int y, int stride) const { return as16[x + y * stride]; } - inline u32 Get32(int x, int y, int stride) { + inline u32 Get32(int x, int y, int stride) const { return as32[x + y * stride]; } - inline u16 *Get16Ptr(int x, int y, int stride) { + inline u16 *Get16Ptr(int x, int y, int stride) const { return &as16[x + y * stride]; } - inline u32 *Get32Ptr(int x, int y, int stride) { + inline u32 *Get32Ptr(int x, int y, int stride) const { return &as32[x + y * stride]; } }; diff --git a/GPU/Software/TransformUnit.h b/GPU/Software/TransformUnit.h index 295953a8e0..488a31980f 100644 --- a/GPU/Software/TransformUnit.h +++ b/GPU/Software/TransformUnit.h @@ -139,7 +139,7 @@ public: void SubmitPrimitive(const void* vertices, const void* indices, GEPrimitiveType prim_type, int vertex_count, u32 vertex_type, int *bytesRead, SoftwareDrawEngine *drawEngine); void SubmitImmVertex(const ClipVertexData &vert, SoftwareDrawEngine *drawEngine); - bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices); + static bool GetCurrentSimpleVertices(int count, std::vector &vertices, std::vector &indices); void Flush(const char *reason); void FlushIfOverlap(const char *reason, bool modifying, uint32_t addr, uint32_t stride, uint32_t w, uint32_t h); diff --git a/GPU/Vulkan/ShaderManagerVulkan.h b/GPU/Vulkan/ShaderManagerVulkan.h index dc566a426e..eedd863321 100644 --- a/GPU/Vulkan/ShaderManagerVulkan.h +++ b/GPU/Vulkan/ShaderManagerVulkan.h @@ -150,7 +150,7 @@ public: return dest->Push(&ub_bones, sizeof(ub_bones), uboAlignment_, buf); } - bool LoadCacheFlags(FILE *f, DrawEngineVulkan *drawEngine); + static bool LoadCacheFlags(FILE *f, DrawEngineVulkan *drawEngine); bool LoadCache(FILE *f); void SaveCache(FILE *f, DrawEngineVulkan *drawEngine); diff --git a/GPU/Vulkan/TextureCacheVulkan.cpp b/GPU/Vulkan/TextureCacheVulkan.cpp index faa1eabdf0..08efbc62ed 100644 --- a/GPU/Vulkan/TextureCacheVulkan.cpp +++ b/GPU/Vulkan/TextureCacheVulkan.cpp @@ -699,7 +699,7 @@ void TextureCacheVulkan::BuildTexture(TexCacheEntry *const entry) { } } -VkFormat TextureCacheVulkan::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const { +VkFormat TextureCacheVulkan::GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) { if (!gstate_c.Use(GPU_USE_16BIT_FORMATS)) { return VK_FORMAT_R8G8B8A8_UNORM; } diff --git a/GPU/Vulkan/TextureCacheVulkan.h b/GPU/Vulkan/TextureCacheVulkan.h index 806ef13d59..e62f5ff73a 100644 --- a/GPU/Vulkan/TextureCacheVulkan.h +++ b/GPU/Vulkan/TextureCacheVulkan.h @@ -44,7 +44,7 @@ public: void DeviceRestore(VulkanContext *vulkan); std::vector DebugGetSamplerIDs() const; - std::string DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType); + static std::string DebugGetSamplerString(const std::string &id, DebugShaderStringType stringType); private: VulkanContext *vulkan_; @@ -94,7 +94,7 @@ protected: private: void LoadVulkanTextureLevel(TexCacheEntry &entry, uint8_t *writePtr, int rowPitch, int level, int scaleFactor, VkFormat dstFmt); - VkFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) const; + static VkFormat GetDestFormat(GETextureFormat format, GEPaletteFormat clutFormat) ; void UpdateCurrentClut(GEPaletteFormat clutFormat, u32 clutBase, bool clutIndexIsSimple) override; void BuildTexture(TexCacheEntry *const entry) override;