[GPU/Common/DX9/GLES/Software] Object out of scope optimization for better codegeneration (lower level scope)

This commit is contained in:
Herman Semenov committed 2023-12-20 12:34:34 +03:00
1 parent 2a31f8c6c0
commit ca94de8d4b
8 files changed
+15 -11

No files matched your search

+3 -2
View File
@@ -281,10 +281,11 @@ static inline float Dot33(const Vec3f &a, const Vec3f &b) {
template <bool useSSE4>
static void ProcessSIMD(VertexData &vertex, const WorldCoords &worldpos, const WorldCoords &worldnormal, const State &state) {
// Lighting blending rounds using the half offset method (like alpha blend.)
const Vec4<int> ones = Vec4<int>::AssignToAll(1);
Vec4<int> colorFactor;
if (state.colorForAmbient || state.colorForDiffuse || state.colorForSpecular)
if (state.colorForAmbient || state.colorForDiffuse || state.colorForSpecular) {
const Vec4<int> ones = Vec4<int>::AssignToAll(1);
colorFactor = LightColorFactor(vertex.color0, ones);
}
Vec4<int> mec = Vec4<int>::FromRGBA(gstate.getMaterialEmissive());
+3 -2
View File
@@ -1406,7 +1406,6 @@ void DrawRectangle(const VertexData &v0, const VertexData &v1, const BinCoords &
void DrawPoint(const VertexData &v0, const BinCoords &range, const RasterizerState &state) {
ScreenCoords pos = v0.screenpos;
Vec4<int> prim_color = Vec4<int>::FromRGBA(v0.color0);
Vec3<int> sec_color = Vec3<int>::FromRGB(v0.color1);
auto &pixelID = state.pixelID;
auto &samplerID = state.samplerID;
@@ -1446,8 +1445,10 @@ void DrawPoint(const VertexData &v0, const BinCoords &range, const RasterizerSta
prim_color = ApplyTexturingSingle(s, t, ToVec4IntArg(prim_color), texLevel, texLevelFrac, bilinear, state);
}
if (!pixelID.clearMode)
if (!pixelID.clearMode) {
Vec3<int> sec_color = Vec3<int>::FromRGB(v0.color1);
prim_color += Vec4<int>(sec_color, 0);
}
u8 fog = 255;
if (pixelID.applyFog) {