Merge pull request #16481 from unknownbrackets/gedebugger

Cleanup some GE debugger logspam, small texture proj optimization
This commit is contained in:
Henrik Rydgård authored and GitHub committed 2022-12-02 11:10:49 +01:00
commit a349e2b85b
3 files changed
+15 -4

No files matched your search

+4 -3
View File
@@ -173,8 +173,9 @@ void ComputeVertexShaderID(VShaderID *id_out, u32 vertType, bool useHWTransform,
static const char *alphaTestFuncs[] = { "NEVER", "ALWAYS", "==", "!=", "<", "<=", ">", ">=" };
static bool MatrixNeedsProjection(const float m[12]) {
return m[2] != 0.0f || m[5] != 0.0f || m[8] != 0.0f || m[11] != 1.0f;
static bool MatrixNeedsProjection(const float m[12], GETexProjMapMode mode) {
// For GE_PROJMAP_UV, we can ignore m[8] since it multiplies to zero.
return m[2] != 0.0f || m[5] != 0.0f || (m[8] != 0.0f && mode != GE_PROJMAP_UV) || m[11] != 1.0f;
}
std::string FragmentShaderDesc(const FShaderID &id) {
@@ -283,7 +284,7 @@ void ComputeFragmentShaderID(FShaderID *id_out, const ComputedPipelineState &pip
bool enableAlphaTest = gstate.isAlphaTestEnabled() && !IsAlphaTestTriviallyTrue();
bool enableColorTest = gstate.isColorTestEnabled() && !IsColorTestTriviallyTrue();
bool enableColorDoubling = gstate.isColorDoublingEnabled() && gstate.isTextureMapEnabled();
bool doTextureProjection = (gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX && MatrixNeedsProjection(gstate.tgenMatrix));
bool doTextureProjection = (gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX && MatrixNeedsProjection(gstate.tgenMatrix, gstate.getUVProjMode()));
bool doTextureAlpha = gstate.isTextureAlphaUsed();
bool doFlatShading = gstate.getShadeMode() == GE_SHADE_FLAT;
+5
View File
@@ -134,6 +134,11 @@ bool NotifyCommand(u32 pc) {
if (IsBreakpoint(pc, op)) {
GPUBreakpoints::ClearTempBreakpoints();
if (coreState == CORE_POWERDOWN || !gpuDebug) {
breakNext = BreakNext::NONE;
return process;
}
auto info = gpuDebug->DissassembleOp(pc);
if (lastStepTime >= 0.0) {
NOTICE_LOG(G3D, "Waiting at %08x, %s (%fms)", pc, info.desc.c_str(), (time_now_d() - lastStepTime) * 1000.0);
+6 -1
View File
@@ -132,7 +132,12 @@ void ComputeRasterizerState(RasterizerState *state, std::function<void()> flushF
state->textureProj = gstate.getUVGenMode() == GE_TEXMAP_TEXTURE_MATRIX;
if (state->textureProj) {
// We may be able to optimize this off. This is actually kinda common.
if (gstate.tgenMatrix[2] == 0.0f && gstate.tgenMatrix[5] == 0.0f && gstate.tgenMatrix[8] == 0.0f && gstate.tgenMatrix[11] == 1.0f) {
const bool qZeroST = gstate.tgenMatrix[2] == 0.0f && gstate.tgenMatrix[5] == 0.0f;
const bool qZeroQ = gstate.tgenMatrix[8] == 0.0f;
// Two common cases: the source q factor is zero, OR source is UV.
const bool qFactorZero = gstate.getUVProjMode() == GE_PROJMAP_UV;
if (qZeroST && (qZeroQ || qFactorZero) && gstate.tgenMatrix[11] == 1.0f) {
state->textureProj = false;
}
}