Misc: More iNN => sNN
This commit is contained in:
@@ -3525,7 +3525,7 @@ static s16 GetPeakVolume(const u8* raw_sector, u8 channel)
|
||||
GSVector4i v_peak = GSVector4i::zero();
|
||||
for (u32 i = 0; i < NUM_SAMPLES; i += 8)
|
||||
{
|
||||
v_peak = v_peak.max_i16(GSVector4i::load<false>(current_ptr));
|
||||
v_peak = v_peak.max_s16(GSVector4i::load<false>(current_ptr));
|
||||
current_ptr += sizeof(v_peak);
|
||||
}
|
||||
|
||||
|
||||
@@ -341,9 +341,9 @@ protected:
|
||||
// TODO: Coordinates are exclusive, so off by one here...
|
||||
const GSVector2i clamp_min = GSVector2i::load(&m_clamped_drawing_area.x);
|
||||
const GSVector2i clamp_max = GSVector2i::load(&m_clamped_drawing_area.z);
|
||||
v1 = v1.sat_i32(clamp_min, clamp_max);
|
||||
v2 = v2.sat_i32(clamp_min, clamp_max);
|
||||
v3 = v3.sat_i32(clamp_min, clamp_max);
|
||||
v1 = v1.sat_s32(clamp_min, clamp_max);
|
||||
v2 = v2.sat_s32(clamp_min, clamp_max);
|
||||
v3 = v3.sat_s32(clamp_min, clamp_max);
|
||||
|
||||
TickCount pixels =
|
||||
std::abs((v1.x * v2.y + v2.x * v3.y + v3.x * v1.y - v1.x * v3.y - v2.x * v1.y - v3.x * v2.y) / 2);
|
||||
|
||||
@@ -2713,7 +2713,7 @@ void GPU_HW::LoadVertices()
|
||||
const GSVector2i vstart_pos = GSVector2i(start_pos.x + m_drawing_offset.x, start_pos.y + m_drawing_offset.y);
|
||||
const GSVector2i vend_pos = GSVector2i(end_pos.x + m_drawing_offset.x, end_pos.y + m_drawing_offset.y);
|
||||
const GSVector4i bounds = GSVector4i::xyxy(vstart_pos, vend_pos);
|
||||
const GSVector4i rect = GSVector4i::xyxy(vstart_pos.min_i32(vend_pos), vstart_pos.max_i32(vend_pos))
|
||||
const GSVector4i rect = GSVector4i::xyxy(vstart_pos.min_s32(vend_pos), vstart_pos.max_s32(vend_pos))
|
||||
.add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i clamped_rect = rect.rintersect(m_clamped_drawing_area);
|
||||
|
||||
@@ -2773,7 +2773,7 @@ void GPU_HW::LoadVertices()
|
||||
const GSVector2i end_pos = GSVector2i(m_drawing_offset.x + vp.x, m_drawing_offset.y + vp.y);
|
||||
const GSVector4i bounds = GSVector4i::xyxy(start_pos, end_pos);
|
||||
const GSVector4i rect =
|
||||
GSVector4i::xyxy(start_pos.min_i32(end_pos), start_pos.max_i32(end_pos)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
GSVector4i::xyxy(start_pos.min_s32(end_pos), start_pos.max_s32(end_pos)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i clamped_rect = rect.rintersect(m_clamped_drawing_area);
|
||||
if (rect.width() > MAX_PRIMITIVE_WIDTH || rect.height() > MAX_PRIMITIVE_HEIGHT || clamped_rect.rempty())
|
||||
{
|
||||
@@ -2861,7 +2861,7 @@ ALWAYS_INLINE_RELEASE void GPU_HW::CheckForTexPageOverlap(GSVector4i uv_rect)
|
||||
uv_rect = ((uv_rect & twin.xyxy()) | twin.zwzw());
|
||||
|
||||
// Min could be greater than max after applying window, correct for it.
|
||||
uv_rect = uv_rect.min_i32(uv_rect.zwzw()).max_i32(uv_rect.xyxy());
|
||||
uv_rect = uv_rect.min_s32(uv_rect.zwzw()).max_s32(uv_rect.xyxy());
|
||||
}
|
||||
|
||||
const GPUTextureMode tmode = m_draw_mode.mode_reg.texture_mode;
|
||||
|
||||
@@ -533,10 +533,10 @@ void GPU_SW::DispatchRenderCommand()
|
||||
}
|
||||
|
||||
// Cull polygons which are too large.
|
||||
const GSVector2i min_pos_12 = positions[1].min_i32(positions[2]);
|
||||
const GSVector2i max_pos_12 = positions[1].max_i32(positions[2]);
|
||||
const GSVector4i draw_rect_012 = GSVector4i(min_pos_12.min_i32(positions[0]))
|
||||
.upl64(GSVector4i(max_pos_12.max_i32(positions[0])))
|
||||
const GSVector2i min_pos_12 = positions[1].min_s32(positions[2]);
|
||||
const GSVector2i max_pos_12 = positions[1].max_s32(positions[2]);
|
||||
const GSVector4i draw_rect_012 = GSVector4i(min_pos_12.min_s32(positions[0]))
|
||||
.upl64(GSVector4i(max_pos_12.max_s32(positions[0])))
|
||||
.add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const bool first_tri_culled =
|
||||
(draw_rect_012.width() > MAX_PRIMITIVE_WIDTH || draw_rect_012.height() > MAX_PRIMITIVE_HEIGHT ||
|
||||
@@ -558,8 +558,8 @@ void GPU_SW::DispatchRenderCommand()
|
||||
// quads
|
||||
if (rc.quad_polygon)
|
||||
{
|
||||
const GSVector4i draw_rect_123 = GSVector4i(min_pos_12.min_i32(positions[3]))
|
||||
.upl64(GSVector4i(max_pos_12.max_i32(positions[3])))
|
||||
const GSVector4i draw_rect_123 = GSVector4i(min_pos_12.min_s32(positions[3]))
|
||||
.upl64(GSVector4i(max_pos_12.max_s32(positions[3])))
|
||||
.add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
|
||||
// Cull polygons which are too large.
|
||||
@@ -680,7 +680,7 @@ void GPU_SW::DispatchRenderCommand()
|
||||
|
||||
const GSVector4i v0 = GSVector4i::loadl(&cmd->vertices[0].x);
|
||||
const GSVector4i v1 = GSVector4i::loadl(&cmd->vertices[1].x);
|
||||
const GSVector4i rect = v0.min_i32(v1).xyxy(v0.max_i32(v1)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i rect = v0.min_s32(v1).xyxy(v0.max_s32(v1)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i clamped_rect = rect.rintersect(m_clamped_drawing_area);
|
||||
|
||||
if (rect.width() > MAX_PRIMITIVE_WIDTH || rect.height() > MAX_PRIMITIVE_HEIGHT || clamped_rect.rempty())
|
||||
@@ -718,7 +718,7 @@ void GPU_SW::DispatchRenderCommand()
|
||||
|
||||
const GSVector4i v0 = GSVector4i::loadl(&cmd->vertices[0].x);
|
||||
const GSVector4i v1 = GSVector4i::loadl(&cmd->vertices[1].x);
|
||||
const GSVector4i rect = v0.min_i32(v1).xyxy(v0.max_i32(v1)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i rect = v0.min_s32(v1).xyxy(v0.max_s32(v1)).add32(GSVector4i::cxpr(0, 0, 1, 1));
|
||||
const GSVector4i clamped_rect = rect.rintersect(m_clamped_drawing_area);
|
||||
|
||||
if (rect.width() > MAX_PRIMITIVE_WIDTH || rect.height() > MAX_PRIMITIVE_HEIGHT || clamped_rect.rempty())
|
||||
|
||||
@@ -580,8 +580,8 @@ ShadePixel(const PixelVectors<texture_enable>& pv, GPUTextureMode texture_mode,
|
||||
// Convert to 5bit.
|
||||
if constexpr (dithering_enable)
|
||||
{
|
||||
rg = rg.sra16<4>().add16(dither).max_i16(GSVectorNi::zero()).sra16<3>();
|
||||
ba = ba.sra16<4>().add16(dither).max_i16(GSVectorNi::zero()).sra16<3>();
|
||||
rg = rg.sra16<4>().add16(dither).max_s16(GSVectorNi::zero()).sra16<3>();
|
||||
ba = ba.sra16<4>().add16(dither).max_s16(GSVectorNi::zero()).sra16<3>();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -606,8 +606,8 @@ ShadePixel(const PixelVectors<texture_enable>& pv, GPUTextureMode texture_mode,
|
||||
// Non-textured transparent polygons don't set bit 15, but are treated as transparent.
|
||||
if constexpr (dithering_enable)
|
||||
{
|
||||
GSVectorNi rg = vertex_color_rg.add16(dither).max_i16(GSVectorNi::zero()).sra16<3>();
|
||||
GSVectorNi ba = vertex_color_ba.add16(dither).max_i16(GSVectorNi::zero()).sra16<3>();
|
||||
GSVectorNi rg = vertex_color_rg.add16(dither).max_s16(GSVectorNi::zero()).sra16<3>();
|
||||
GSVectorNi ba = vertex_color_ba.add16(dither).max_s16(GSVectorNi::zero()).sra16<3>();
|
||||
|
||||
// Clamp to 5bit. We use 32bit for BA to set a to zero.
|
||||
rg = rg.min_u16(GSVectorNi::cxpr16(0x1F));
|
||||
|
||||
Reference in New Issue
Block a user