mirror of
https://github.com/hrydgard/ppsspp.git
synced 2026-07-11 01:25:07 +02:00
Assorted cleanup and tweaks
This commit is contained in:
@@ -177,14 +177,14 @@ void VtxDec_Tu8_C5551_Ps16(const u8 *srcp, u8 *dstp, int numVerts, const UVScale
|
||||
__m128 pos0_ext = _mm_mul_ps(_mm_cvtepi32_ps(pos0_32), posScale);
|
||||
__m128 pos1_ext = _mm_mul_ps(_mm_cvtepi32_ps(pos1_32), posScale);
|
||||
|
||||
__m128i uv8 = _mm_set1_epi32(uv0);
|
||||
__m128i uv8 = _mm_cvtsi32_si128(uv0);
|
||||
__m128i uv16 = _mm_unpacklo_epi8(uv8, uv8);
|
||||
__m128i uv32 = _mm_srli_epi32(_mm_unpacklo_epi16(uv16, uv16), 24);
|
||||
__m128d uvf = _mm_castps_pd(_mm_add_ps(_mm_mul_ps(_mm_cvtepi32_ps(uv32), uvScale), uvOff));
|
||||
alpha &= col0;
|
||||
|
||||
// Combined 5551 -> 8888 RGBA. Nasty.
|
||||
__m128i col = _mm_set1_epi64x(col0);
|
||||
__m128i col = _mm_cvtsi64_si128(col0);
|
||||
__m128i r = _mm_slli_epi32(_mm_and_si128(col, rmask), 8 - 5);
|
||||
__m128i g = _mm_slli_epi32(_mm_and_si128(col, gmask), 16 - 10);
|
||||
__m128i b = _mm_slli_epi32(_mm_and_si128(col, bmask), 24 - 15);
|
||||
|
||||
@@ -324,7 +324,7 @@ void DrawEngineD3D11::Flush() {
|
||||
bool useElements;
|
||||
DecodeVerts(dec_, decoded_);
|
||||
DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false);
|
||||
gpuStats.perFrame.numUncachedVertsDrawn += vertexCount;
|
||||
gpuStats.perFrame.numVertsDrawn += vertexCount;
|
||||
|
||||
bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE;
|
||||
if (gstate.isModeThrough()) {
|
||||
@@ -412,7 +412,6 @@ void DrawEngineD3D11::Flush() {
|
||||
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
|
||||
}
|
||||
|
||||
gpuStats.perFrame.numUncachedVertsDrawn += vertexCount;
|
||||
prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim);
|
||||
VERBOSE_LOG(Log::G3D, "Flush prim %i SW! %i verts in one go", prim, vertexCount);
|
||||
|
||||
@@ -492,6 +491,7 @@ void DrawEngineD3D11::Flush() {
|
||||
pushInds_->EndPush(context_);
|
||||
context_->IASetIndexBuffer(pushInds_->Buf(), DXGI_FORMAT_R16_UINT, iOffset);
|
||||
context_->DrawIndexed(result.drawIndexCount, 0, 0);
|
||||
gpuStats.perFrame.numVertsDrawn += result.drawIndexCount;
|
||||
} else if (action == SW_CLEAR) {
|
||||
u32 clearColor = result.color;
|
||||
float clearDepth = result.depth;
|
||||
|
||||
@@ -303,6 +303,7 @@ void DrawEngineGLES::Flush() {
|
||||
bool useElements;
|
||||
DecodeVerts(dec_, decoded_);
|
||||
DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false);
|
||||
gpuStats.perFrame.numVertsDrawn += vertexCount;
|
||||
|
||||
if (useElements) {
|
||||
uint32_t esz = sizeof(uint16_t) * vertexCount;
|
||||
@@ -361,7 +362,6 @@ void DrawEngineGLES::Flush() {
|
||||
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
|
||||
}
|
||||
|
||||
gpuStats.perFrame.numUncachedVertsDrawn += vertexCount;
|
||||
prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim);
|
||||
|
||||
int maxIndex = numDecodedVerts_;
|
||||
@@ -424,6 +424,7 @@ void DrawEngineGLES::Flush() {
|
||||
render_->DrawIndexed(
|
||||
softwareInputLayout_, vertexBuffer, vertexBufferOffset, indexBuffer, indexBufferOffset,
|
||||
glprim[prim], result.drawIndexCount, GL_UNSIGNED_SHORT);
|
||||
gpuStats.perFrame.numVertsDrawn += result.drawIndexCount;
|
||||
} else if (action == SW_CLEAR) {
|
||||
u32 clearColor = result.color;
|
||||
float clearDepth = result.depth;
|
||||
|
||||
@@ -104,7 +104,7 @@ struct GPUStatsPerFrame {
|
||||
int numBBOXJumps;
|
||||
int numVertsSubmitted;
|
||||
int numVertsDecoded;
|
||||
int numUncachedVertsDrawn;
|
||||
int numVertsDrawn;
|
||||
int numTextureInvalidations;
|
||||
int numTexturesChanged;
|
||||
int numTextureInvalidationsByFramebuffer;
|
||||
|
||||
+1
-1
@@ -1819,7 +1819,7 @@ void GPUCommonHW::FormatGPUStatsCommon(StringWriter &w) {
|
||||
gpuStats.perFrame.numSoftTransformedDraws,
|
||||
gpuStats.perFrame.numVertsSubmitted,
|
||||
gpuStats.perFrame.numVertsDecoded,
|
||||
gpuStats.perFrame.numUncachedVertsDrawn,
|
||||
gpuStats.perFrame.numVertsDrawn,
|
||||
gpuStats.perFrame.numSoftClippedTriangles,
|
||||
(int)framebufferManager_->NumVFBs(),
|
||||
gpuStats.perFrame.numFramebufferEvaluations,
|
||||
|
||||
@@ -292,6 +292,7 @@ void DrawEngineVulkan::Flush() {
|
||||
int maxIndex;
|
||||
bool useElements;
|
||||
DecodeIndsAndGetData(&prim, &vertexCount, &maxIndex, &useElements, false);
|
||||
gpuStats.perFrame.numVertsDrawn += vertexCount;
|
||||
|
||||
bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE;
|
||||
if (gstate.isModeThrough()) {
|
||||
@@ -420,7 +421,7 @@ void DrawEngineVulkan::Flush() {
|
||||
gstate_c.vertexFullAlpha = gstate_c.vertexFullAlpha && ((hasColor && (gstate.materialupdate & 1)) || gstate.getMaterialAmbientA() == 255) && (!gstate.isLightingEnabled() || gstate.getAmbientA() == 255);
|
||||
}
|
||||
|
||||
gpuStats.perFrame.numUncachedVertsDrawn += vertexCount;
|
||||
gpuStats.perFrame.numVertsDrawn += vertexCount;
|
||||
prim = IndexGenerator::GeneralPrim((GEPrimitiveType)drawInds_[0].prim);
|
||||
|
||||
// At this point, the output is always an indexed triangle/line/point list, no strips/fans.
|
||||
|
||||
Reference in New Issue
Block a user