mirror of
https://github.com/hrydgard/ppsspp.git
synced 2025-02-17 12:47:46 +00:00
Merge pull request #11613 from unknownbrackets/cullmode
GPU: Force use of indexes on cull mode flip
This commit is contained in:
commit
d1cf34cdf3
@ -77,6 +77,10 @@ void IndexGenerator::AddList(int numVerts, bool clockwise) {
|
||||
count_ += numVerts;
|
||||
prim_ = GE_PRIM_TRIANGLES;
|
||||
seenPrims_ |= 1 << GE_PRIM_TRIANGLES;
|
||||
if (!clockwise) {
|
||||
// Make sure we don't treat this as pure.
|
||||
seenPrims_ |= 1 << GE_PRIM_TRIANGLE_STRIP;
|
||||
}
|
||||
}
|
||||
|
||||
void IndexGenerator::AddStrip(int numVerts, bool clockwise) {
|
||||
@ -96,7 +100,7 @@ void IndexGenerator::AddStrip(int numVerts, bool clockwise) {
|
||||
if (numTris > 0)
|
||||
count_ += numTris * 3;
|
||||
// This is so we can detect one single strip by just looking at seenPrims_.
|
||||
if (!seenPrims_) {
|
||||
if (!seenPrims_ && clockwise) {
|
||||
seenPrims_ = 1 << GE_PRIM_TRIANGLE_STRIP;
|
||||
prim_ = GE_PRIM_TRIANGLE_STRIP;
|
||||
pureCount_ = numVerts;
|
||||
@ -123,6 +127,10 @@ void IndexGenerator::AddFan(int numVerts, bool clockwise) {
|
||||
count_ += numTris * 3;
|
||||
prim_ = GE_PRIM_TRIANGLES;
|
||||
seenPrims_ |= 1 << GE_PRIM_TRIANGLE_FAN;
|
||||
if (!clockwise) {
|
||||
// Make sure we don't treat this as pure.
|
||||
seenPrims_ |= 1 << GE_PRIM_TRIANGLE_STRIP;
|
||||
}
|
||||
}
|
||||
|
||||
//Lines
|
||||
|
@ -176,7 +176,6 @@ struct FShaderID : ShaderID {
|
||||
};
|
||||
|
||||
|
||||
bool CanUseHardwareTransform(int prim);
|
||||
void ComputeVertexShaderID(ShaderID *id, uint32_t vertexType, bool useHWTransform);
|
||||
// Generates a compact string that describes the shader. Useful in a list to get an overview
|
||||
// of the current flora of shaders.
|
||||
|
@ -1537,7 +1537,7 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) {
|
||||
}
|
||||
|
||||
void *verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
void *inds = 0;
|
||||
void *inds = nullptr;
|
||||
u32 vertexType = gstate.vertType;
|
||||
if ((vertexType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
u32 indexAddr = gstate_c.indexAddr;
|
||||
@ -1602,9 +1602,10 @@ void GPUCommon::Execute_Prim(u32 op, u32 diff) {
|
||||
}
|
||||
|
||||
GEPrimitiveType newPrim = static_cast<GEPrimitiveType>((data >> 16) & 7);
|
||||
SetDrawType(DRAW_PRIM, newPrim);
|
||||
// TODO: more efficient updating of verts/inds
|
||||
verts = Memory::GetPointerUnchecked(gstate_c.vertexAddr);
|
||||
inds = 0;
|
||||
inds = nullptr;
|
||||
if ((vertexType & GE_VTYPE_IDX_MASK) != GE_VTYPE_IDX_NONE) {
|
||||
inds = Memory::GetPointerUnchecked(gstate_c.indexAddr);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user