diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 3e858ccd32..ded39a1a73 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -416,9 +416,10 @@ static bool TestBoundingBoxFast(const float *worldViewProj, const void *vdata, i } } - if (AnyCompareBitsSet(anyOutsideMaskZ) || !gstate_c.Use(GPU_USE_CULL_DISTANCE)) { + if (AnyCompareBitsSet(anyOutsideMaskZ)) { // Some vertices were outside the Z clipping planes. Clip againt Z=-W in software (and do culling, too). - // TODO: With a compat flag for Flatout/Sengoku, we'll be able to avoid this in many cases. + // TODO: With a compat flag for Flatout/Sengoku, we'll be able to avoid this in many cases, unless + // GPU_USE_CULL_DISTANCE is missing, in which case we need it for culling. flags |= ClipInfoFlags::SoftClipCull; } diff --git a/GPU/Common/SoftwareTransformCommon.cpp b/GPU/Common/SoftwareTransformCommon.cpp index fe540f8c42..6721b8f286 100644 --- a/GPU/Common/SoftwareTransformCommon.cpp +++ b/GPU/Common/SoftwareTransformCommon.cpp @@ -438,6 +438,22 @@ inline bool IsInsideFarPlane(const TransformedVertex& v) { return v.z <= v.pos_w; } +// TODO: Use CrossSIMD, should help. +inline void LerpTransformedVertex(TransformedVertex *dest, TransformedVertex &a, TransformedVertex &b, float t) { + dest->x = a.x + (b.x - a.x) * t; + dest->y = a.y + (b.y - a.y) * t; + dest->z = a.z + (b.z - a.z) * t; + dest->pos_w = a.pos_w + (b.pos_w - a.pos_w) * t; + dest->u = a.u + (b.u - a.u) * t; + dest->v = a.v + (b.v - a.v) * t; + dest->uv_w = a.uv_w + (b.uv_w - a.uv_w) * t; + dest->fog = a.fog + (b.fog - a.fog) * t; + + // note: colorBlend is backwards. + dest->color0_32 = colorBlend(b.color0_32, a.color0_32, t); + dest->color1_32 = colorBlend(b.color1_32, a.color1_32, t); +} + // Generated by Gemini, and adapted to fit. void ClipTrianglesAgainstNearPlane( TransformedVertex *transformed, int &transformedCount, int maxTransformed, @@ -528,7 +544,7 @@ void ClipTrianglesAgainstNearPlane( // Generate new vertex at the intersection point TransformedVertex newVertex; - TransformedVertex::Lerp(&newVertex, const_cast(a), const_cast(b), t); + LerpTransformedVertex(&newVertex, const_cast(a), const_cast(b), t); // Force exact intersection to eliminate precision creeping down the pipeline newVertex.z = -newVertex.pos_w; diff --git a/GPU/GPUCommonHW.cpp b/GPU/GPUCommonHW.cpp index cdf4d06f78..6164babf5e 100644 --- a/GPU/GPUCommonHW.cpp +++ b/GPU/GPUCommonHW.cpp @@ -596,7 +596,6 @@ u32 GPUCommonHW::CheckGPUFeatures() const { } if (draw_->GetDeviceCaps().depthClampSupported) { - // Some backends always do GPU_USE_ACCURATE_DEPTH, but it's required for depth clamp. features |= GPU_USE_DEPTH_CLAMP; } diff --git a/GPU/GPUDefinitions.h b/GPU/GPUDefinitions.h index c12bb0b533..ea051fdba5 100644 --- a/GPU/GPUDefinitions.h +++ b/GPU/GPUDefinitions.h @@ -218,19 +218,4 @@ struct TransformedVertex { this->y = other.y + yoff; memcpy(&this->z, &other.z, sizeof(*this) - sizeof(float) * 2); } - - static void Lerp(TransformedVertex *dest, TransformedVertex &a, TransformedVertex &b, float t) { - dest->x = a.x + (b.x - a.x) * t; - dest->y = a.y + (b.y - a.y) * t; - dest->z = a.z + (b.z - a.z) * t; - dest->pos_w = a.pos_w + (b.pos_w - a.pos_w) * t; - dest->u = a.u + (b.u - a.u) * t; - dest->v = a.v + (b.v - a.v) * t; - dest->uv_w = a.uv_w + (b.uv_w - a.uv_w) * t; - dest->fog = a.fog + (b.fog - a.fog) * t; - - // note: colorBlend is backwards. - dest->color0_32 = colorBlend(b.color0_32, a.color0_32, t); - dest->color1_32 = colorBlend(b.color1_32, a.color1_32, t); - } }; diff --git a/UI/MiscViews.cpp b/UI/MiscViews.cpp index 9df563f64b..4d61d0f147 100644 --- a/UI/MiscViews.cpp +++ b/UI/MiscViews.cpp @@ -442,6 +442,11 @@ bool ViewSearch::Key(UI::ViewGroup *viewGroup, const KeyInput &input) { if (input.flags & KeyInputFlags::CHAR) { const int unichar = input.keyCode; if (unichar >= 0x20 && unichar != 127) { // 127 gets produced from Ctrl+Backspace on Windows for some reason. + // Don't allow spaces as the first character, it looks confusing (empty search field) + if (searchFilter.empty() && unichar == ' ') { + return false; + } + // TODO: Save focus state here. // Insert it! (todo: do it with a string insert) char buf[8];