mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-10-01 14:58:14 +00:00
Add a few (disabled) lines of code to kinda-simulate the Mali feature set.
This commit is contained in:
1 parent
04571a15e3
commit
20113c67f3
4 files changed
+13
-10
No files matched your search
@@ -166,12 +166,13 @@ void ComputeVertexShaderID(VShaderID *id_out, u32 vertType, bool useHWTransform,
|
||||
*id_out = id;
|
||||
}
|
||||
|
||||
|
||||
static const char * const alphaTestFuncs[] = { "NEVER", "ALWAYS", "==", "!=", "<", "<=", ">", ">=" };
|
||||
static_assert(ARRAY_SIZE(alphaTestFuncs) == 8);
|
||||
static const char * const logicFuncs[] = {
|
||||
"CLEAR", "AND", "AND_REV", "COPY", "AND_INV", "NOOP", "XOR", "OR",
|
||||
"NOR", "EQUIV", "INVERTED", "OR_REV", "COPY_INV", "OR_INV", "NAND", "SET",
|
||||
};
|
||||
static_assert(ARRAY_SIZE(logicFuncs) == 16);
|
||||
|
||||
static bool MatrixNeedsProjection(const float m[12], GETexProjMapMode mode) {
|
||||
// For GE_PROJMAP_UV, we can ignore m[8] since it multiplies to zero.
|
||||
|
||||
@@ -90,7 +90,6 @@ void BaseUpdateUniforms(UB_VS_FS_Base *ub, uint64_t dirtyUniforms, bool useBuffe
|
||||
ub->rasterOffset[1] = gstate.getOffsetY();
|
||||
ub->minZmaxZ[0] = (float)gstate.getDepthRangeMin();
|
||||
ub->minZmaxZ[1] = (float)gstate.getDepthRangeMax();
|
||||
|
||||
// test sine wave
|
||||
// ub->minZmaxZ[0] = (sin(time_now_d()) * 0.5f + 0.5f) * 65536.0;
|
||||
}
|
||||
|
||||
@@ -127,17 +127,13 @@ void UpdateFogCoef(const GEState &state, float fogCoef[2]);
|
||||
|
||||
// This happens so much that I want it inline.
|
||||
inline void UpdateUVScaleOff(const GEState &state, float uvScaleOff[4]) {
|
||||
float widthFactor;
|
||||
float heightFactor;
|
||||
if (gstate_c.textureIsFramebuffer) {
|
||||
widthFactor = (float)gstate.getTextureWidth(0) / (float)gstate_c.curTextureWidth;
|
||||
heightFactor = (float)gstate.getTextureHeight(0) / (float)gstate_c.curTextureHeight;
|
||||
uvScaleOff[0] = (float)gstate.getTextureWidth(0) / (float)gstate_c.curTextureWidth;
|
||||
uvScaleOff[1] = (float)gstate.getTextureHeight(0) / (float)gstate_c.curTextureHeight;
|
||||
} else {
|
||||
widthFactor = 1.0f;
|
||||
heightFactor = 1.0f;
|
||||
uvScaleOff[0] = 1.0f;
|
||||
uvScaleOff[1] = 1.0f;
|
||||
}
|
||||
uvScaleOff[0] = widthFactor;
|
||||
uvScaleOff[1] = heightFactor;
|
||||
uvScaleOff[2] = 0.0f;
|
||||
uvScaleOff[3] = 0.0f;
|
||||
}
|
||||
@@ -621,6 +621,13 @@ u32 GPUCommonHW::CheckGPUFeatures() const {
|
||||
features |= GPU_USE_VS_RANGE_CULLING;
|
||||
}
|
||||
|
||||
// Set this to true to easily test our fallback shaders for depth clamp and min/max clipping.
|
||||
// DO NOT check that in! This should be false normally.
|
||||
constexpr bool simulateOldMali = false;
|
||||
if (simulateOldMali) {
|
||||
features &= ~(GPU_USE_CLIP_DISTANCE | GPU_USE_CULL_DISTANCE | GPU_USE_DEPTH_CLAMP);
|
||||
}
|
||||
|
||||
return features;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user