CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
CoCalc provides the best real-time collaborative environment for Jupyter Notebooks, LaTeX documents, and SageMath, scalable from individual users to large groups and classes!
Path: blob/master/GPU/GPUCommonHW.h
Views: 1401
#pragma once12#include "GPUCommon.h"34// Shared GPUCommon implementation for the HW backends.5// Things that are irrelevant for SoftGPU should live here.6class GPUCommonHW : public GPUCommon {7public:8GPUCommonHW(GraphicsContext *gfxCtx, Draw::DrawContext *draw);9~GPUCommonHW();1011void CopyDisplayToOutput(bool reallyDirty) override;12void DoState(PointerWrap &p) override;13void DeviceLost() override;14void DeviceRestore(Draw::DrawContext *draw) override;1516void BeginHostFrame() override;1718u32 CheckGPUFeatures() const override;1920// From GPUDebugInterface.21bool GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferType type, int maxRes) override;22bool GetCurrentDepthbuffer(GPUDebugBuffer &buffer) override;23bool GetCurrentStencilbuffer(GPUDebugBuffer &buffer) override;24bool GetOutputFramebuffer(GPUDebugBuffer &buffer) override;25std::vector<const VirtualFramebuffer *> GetFramebufferList() const override;26bool GetCurrentTexture(GPUDebugBuffer &buffer, int level, bool *isFramebuffer) override;27bool GetCurrentClut(GPUDebugBuffer &buffer) override;2829// Using string because it's generic - makes no assumptions on the size of the shader IDs of this backend.30std::vector<std::string> DebugGetShaderIDs(DebugShaderType shader) override;31std::string DebugGetShaderString(std::string id, DebugShaderType shader, DebugShaderStringType stringType) override;3233void SetDisplayFramebuffer(u32 framebuf, u32 stride, GEBufferFormat format) override;34void InvalidateCache(u32 addr, int size, GPUInvalidationType type) override;3536bool FramebufferDirty() override;37bool FramebufferReallyDirty() override;3839void Execute_VertexType(u32 op, u32 diff);40void Execute_VertexTypeSkinning(u32 op, u32 diff);4142void Execute_Prim(u32 op, u32 diff);43void Execute_Bezier(u32 op, u32 diff);44void Execute_Spline(u32 op, u32 diff);45void Execute_BlockTransferStart(u32 op, u32 diff);4647void Execute_TexSize0(u32 op, u32 diff);48void Execute_TexLevel(u32 op, u32 diff);49void Execute_LoadClut(u32 op, u32 diff);5051void Execute_WorldMtxNum(u32 op, u32 diff);52void Execute_WorldMtxData(u32 op, u32 diff);53void Execute_ViewMtxNum(u32 op, u32 diff);54void Execute_ViewMtxData(u32 op, u32 diff);55void Execute_ProjMtxNum(u32 op, u32 diff);56void Execute_ProjMtxData(u32 op, u32 diff);57void Execute_TgenMtxNum(u32 op, u32 diff);58void Execute_TgenMtxData(u32 op, u32 diff);59void Execute_BoneMtxNum(u32 op, u32 diff);60void Execute_BoneMtxData(u32 op, u32 diff);6162void Execute_TexFlush(u32 op, u32 diff);6364// TODO: Have these return an error code if they jump to a bad address. If bad, stop the FastRunLoop.65typedef void (GPUCommonHW::*CmdFunc)(u32 op, u32 diff);6667void FastRunLoop(DisplayList &list) override;68void ExecuteOp(u32 op, u32 diff) override;6970private:71void CheckDepthUsage(VirtualFramebuffer *vfb) override;72void CheckFlushOp(int cmd, u32 diff);7374protected:75size_t FormatGPUStatsCommon(char *buf, size_t size);76void UpdateCmdInfo() override;7778void PreExecuteOp(u32 op, u32 diff) override;79void ClearCacheNextFrame() override;8081// Needs to be called on GPU thread, not reporting thread.82void BuildReportingInfo() override;83void UpdateMSAALevel(Draw::DrawContext *draw) override;8485void CheckDisplayResized() override;86void CheckRenderResized() override;87void CheckConfigChanged() override;8889u32 CheckGPUFeaturesLate(u32 features) const;9091int msaaLevel_ = 0;92bool sawExactEqualDepth_ = false;93ShaderManagerCommon *shaderManager_ = nullptr;94};959697