Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

softgpu: Cull a triangle with all negative w #16231

Merged
merged 3 commits into from
Oct 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions GPU/Software/Clipper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,9 @@ void ProcessTriangle(const ClipVertexData &v0, const ClipVertexData &v1, const C
// If any verts were outside range, throw the entire prim away.
if (v0.OutsideRange() || v1.OutsideRange() || v2.OutsideRange())
return;
// If all verts have negative W, we also cull.
if (v0.clippos.w < 0.0f && v1.clippos.w < 0.0f && v2.clippos.w < 0.0f)
return;

mask |= CalcClipMask(v0.clippos);
mask |= CalcClipMask(v1.clippos);
Expand Down
3 changes: 3 additions & 0 deletions GPU/Software/SoftGpu.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1338,6 +1338,9 @@ bool SoftGPU::GetCurrentFramebuffer(GPUDebugBuffer &buffer, GPUDebugFramebufferT
GEBufferFormat fmt = gstate.FrameBufFormat();
const u8 *src = fb.data;

if (!Memory::IsValidAddress(displayFramebuf_))
return false;

if (type == GPU_DBG_FRAMEBUF_DISPLAY) {
size.x = 480;
size.y = 272;
Expand Down
2 changes: 1 addition & 1 deletion pspautotests
Submodule pspautotests updated 53 files
+1 −1 tests/gpu/clipping/Makefile
+287 −0 tests/gpu/clipping/homogeneous.cpp
+59 −0 tests/gpu/clipping/homogeneous.expected
+ tests/gpu/clipping/homogeneous.prx
+1 −1 tests/gpu/ge/Makefile
+384 −0 tests/gpu/ge/edramswizzle.cpp
+389 −0 tests/gpu/ge/edramswizzle.expected
+ tests/gpu/ge/edramswizzle.prx
+2 −0 tests/gpu/ge/get.cpp
+5 −0 tests/jpeg/Makefile
+ tests/jpeg/background.jpg
+ tests/jpeg/background2x1.jpg
+ tests/jpeg/backgroundgray.jpg
+38 −0 tests/jpeg/create.cpp
+50 −0 tests/jpeg/create.expected
+ tests/jpeg/create.prx
+178 −0 tests/jpeg/csc.cpp
+77 −0 tests/jpeg/csc.expected
+ tests/jpeg/csc.prx
+107 −0 tests/jpeg/decode.cpp
+45 −0 tests/jpeg/decode.expected
+ tests/jpeg/decode.prx
+110 −0 tests/jpeg/decodes.cpp
+45 −0 tests/jpeg/decodes.expected
+ tests/jpeg/decodes.prx
+82 −0 tests/jpeg/decodeycbcr.cpp
+37 −0 tests/jpeg/decodeycbcr.expected
+ tests/jpeg/decodeycbcr.prx
+83 −0 tests/jpeg/decodeycbcrs.cpp
+37 −0 tests/jpeg/decodeycbcrs.expected
+ tests/jpeg/decodeycbcrs.prx
+18 −0 tests/jpeg/delete.cpp
+7 −0 tests/jpeg/delete.expected
+ tests/jpeg/delete.prx
+24 −0 tests/jpeg/finish.cpp
+15 −0 tests/jpeg/finish.expected
+ tests/jpeg/finish.prx
+ tests/jpeg/geb.jpg
+58 −0 tests/jpeg/getoutputinfo.cpp
+28 −0 tests/jpeg/getoutputinfo.expected
+ tests/jpeg/getoutputinfo.prx
+18 −0 tests/jpeg/init.cpp
+10 −0 tests/jpeg/init.expected
+ tests/jpeg/init.prx
+155 −0 tests/jpeg/mjpegcsc.cpp
+57 −0 tests/jpeg/mjpegcsc.expected
+ tests/jpeg/mjpegcsc.prx
+55 −0 tests/jpeg/shared.h
+1 −1 utils/ppdmp-playback/Makefile
+5 −4 utils/ppdmp-playback/playback.cpp
+ utils/ppdmp-playback/playback.prx
+18 −1 utils/ppdmp-playback/replay.cpp
+2 −0 utils/ppdmp-playback/replay.h
13 changes: 13 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ def target():
"font/resolution",
"font/shadowimagerect",
"gpu/callbacks/ge_callbacks",
"gpu/clipping/homogeneous",
"gpu/clut/address",
"gpu/clut/masks",
"gpu/clut/offset",
Expand Down Expand Up @@ -192,6 +193,10 @@ def target():
"intr/suspended",
"intr/vblank/vblank",
"io/cwd/cwd",
"jpeg/create",
"jpeg/delete",
"jpeg/finish",
"jpeg/init",
"loader/bss/bss",
"malloc/malloc",
"misc/dcache",
Expand Down Expand Up @@ -400,6 +405,7 @@ def target():
"gpu/filtering/precisionlinear3d",
"gpu/filtering/precisionnearest2d",
"gpu/filtering/precisionnearest3d",
"gpu/ge/edramswizzle",
"gpu/ge/get",
"gpu/primitives/bezier",
"gpu/primitives/continue",
Expand Down Expand Up @@ -430,6 +436,13 @@ def target():
"io/io/io",
"io/iodrv/iodrv",
"io/open/tty0",
"jpeg/csc",
"jpeg/decode",
"jpeg/decodes",
"jpeg/decodeycbcr",
"jpeg/decodeycbcrs",
"jpeg/getoutputinfo",
"jpeg/mjpegcsc",
# Doesn't work on a PSP for security reasons, hangs in PPSSPP currently.
# Commented out to make tests run much faster.
#"modules/loadexec/loader",
Expand Down