hrydgard / ppsspp

A PSP emulator for Android, Windows, Mac and Linux, written in C++. Want to contribute? Join us on Discord at https://discord.gg/5NJB6dD or just send pull requests / issues. For discussion use the forums at forums.ppsspp.org.
https://www.ppsspp.org
Other
11.38k stars 2.19k forks source link

Texture Bug in Dissidia Final Fantasy on GPU PowerVR #7740

Open zminhquanz opened 9 years ago

zminhquanz commented 9 years ago

Here this picture , when I turn on buffered render is have this issue , when i switch to non-buffered render is have not issue @hrydgard screenshot_2015-05-11-11-32-43 1

asbel123 commented 9 years ago

are u using iphone on ppsspp

zminhquanz commented 9 years ago

@asbel123 i'm using Iphone and Zenfone using Intel SOC ( using PowerVR GPU )

hrydgard commented 9 years ago

What is the issue? Missing characters? It's not clear to me how it should look from the picture.. I don't play that game.

zminhquanz commented 9 years ago

@hrydgard yes , it's missing character when i switch Buffered Render , when i switch back to non-buffered render , it's normal . The issue is appear on GPU PowerVR, another GPU , Mali is not happen this . I'm using Iphone and ASUS Zenfone ( Intel SOC using PowerVR GPU )

asbel123 commented 9 years ago

just get samsung galaxy s6 edge u wont ppsspp problem i got lots of game fullspeed u can do 5x resoultion no slow down try final fantasy 7 crisi core is full speed i didnt put frameskip and try dissdia final fantasy it will be fullspeed.

powervr gpu is good its a problem is opengl version problems and iphone has lots of bugs and its no easy to hack new firmware now. andriod is best version to play ppsspp no problem.

zminhquanz commented 9 years ago

@asbel123 but , it's picture i'm screenshot is using ASUS Zenfone ( Intel using PowerVR GPU )

eddiebrook commented 9 years ago

@asbel123 i dont have this problem on iphone 6. both OS are good but iOS is optimized and no need to much hardware like android.

Samsung S6 still can not match Nvidia Tegra k1 perfomance in dolphin emu. most games run slow and overheat alot because Mali diver are slow and limit cpu.

source: @ sonicadvance

zminhquanz commented 9 years ago

I think texture bug ( see picture on the top page ) is happen on Intel chip (I'm using ASUS Zenfone and Intel SOC using PowerVR ) @eddiebrook

unknownbrackets commented 9 years ago

It would be great if someone using a PowerVR GPU on an ARM device could confirm whether this is Intel specific (maybe some SSE3-only issue?) or PowerVR specific.

-[Unknown]

zminhquanz commented 9 years ago

screenshot_2015-05-17-19-39-29 My Tablet is using GPU PowerVR SGX544 ( Mediatek MT8389T) like as ASUS Zenfone is also this bug like that @hrydgard @unknownbrackets

zminhquanz commented 9 years ago

I think excactly problem is on GPU PowerVR SGX544 , other GPU don't have this issue

brujo5 commented 9 years ago

Work fine ON iPhone 5S PowerVR (serie 6) G6430

Using latest build

image

zminhquanz commented 9 years ago

@brujo5 you using non-buffered rendering or Buffered Rendering ?

brujo5 commented 9 years ago

Bufered rendering 3x.

zminhquanz commented 9 years ago

@brujo5 so , i update the latest build , this bug isn't resolved and fixed , i think PowerVR on Android and IOS is different

zminhquanz commented 9 years ago

and i also think , PowerVR SGX544 ( Series 5 ) have this bug , but on Series 6 it isn't have this bug

brujo5 commented 9 years ago

Or intel soc specific issue

Ask for help on forum maybe someone have an diferent device/OS whit the same GPU PowerVR SGX544

jcchikikomori commented 8 years ago

Same issue on my Android device with PowerVR SGX544

I tried to hack the graphics config using GLTools 1.99 (XDA) by enabling stencil hacks, and it works, i mean the characters have appeared on gameplay. However, i got weird missing artifacts on each model (including environment) especially in BR mode.

For example: Cloud's buster sword still appears on front.. just like the old issue on OpenGL 2.0 PCs until version 0.7.* (sorry, screenshot not yet available)

Test Specs: ASUS Zenfone C (Zenfone 4-like phone) PowerVR SGX 544MP2 OpenGL ES 1.12@2701748

unknownbrackets commented 8 years ago

Sounds like this is a bug specific to all PowerVR SGX 544 devices (not just x86.) It's hard to tell exactly what's going wrong, and I'm not sure exactly what "stencil hacks" do.

The character is drawn with:

Texture L0: 0x08d6ed80 (256x256) Stencil test - pass if (80 & 80) ALWAYS (a & 80) Depth test - pass if src >= dst Alpha test - pass if (a & ff) > (04 & ff) Alpha blend mode - add: src.a, 1.0 - src.a (the buffer is 5551.)

So, it shouldn't matter what stencil is. The depth values are pretty far apart too. The texture's alpha is usually full, so it shouldn't even be an alpha testing problem.

Bloom is also applied after drawing the character, with the character.

This also renders properly with stencil to alpha disabled.

-[Unknown]

hrydgard commented 8 years ago

If the driver is really silly, maybe it would help to set the stencil test mask to 0xFF if operation is ALWAYS? Otherwise I don't really know what to do about it..

unknownbrackets commented 8 years ago

Yeah, that's probably a good idea, #8779.

-[Unknown]

zminhquanz commented 8 years ago

it's may fix this issue missing texture in other game like Dissidia 012

jcchikikomori commented 8 years ago

Gonna test this tonight with device default configs, and then the GLTools hacks.. i'll give a comparison screenshot later

jcchikikomori commented 8 years ago

Here's what i got, i am using the latest build (v1.2.2-592-gda34e31):

PS: I am using Dissidia playable demo, since they have same issues on 012 duodecim version

But before that, here's my current GLTools config.. the GL_STENCIL_INDEX8 hack was the thing on my PowerVR SGX 544 issue.. if it's activated, the game would be playable in BR but still missing artifacts screenshot_2016-05-29-20-46-12

Now, Here's the result if GL_STENCIL_INDEX8 was disabled. Even the overall preset disabled (device default values) screenshot_2016-05-29-20-44-06

Here's interesting when GL_STENCIL_INDEX8 was activated screenshot_2016-05-29-20-47-50 screenshot_2016-05-29-20-47-54 screenshot_2016-05-29-20-48-14 screenshot_2016-05-29-20-48-23

Therefore, the issue was still there

unknownbrackets commented 8 years ago

Just to mention - GLTools basically lies to PPSSPP and the only thing you'll usually get out of it is worse performance. We may have detection code to use glMapBuffer only when your device supports it natively and it's fast, and use other methods when it's not there. If it lies and says you have it, we might use it even when it's the slow-mo way.

Just to confirm, this still happens with all GLTools hacks disabled, right? I assume that's what you mean by "device default values".

I'm not sure what that setting does. I suspect it's causing depth not to work since the device already natively supports packed depth/stencil buffers, e.g. making us not pick packed even when that's the fastest and best option for your device.

To confirm, can you look at an "adb logcat" with the settings that way? If it says "Creating 480 x 272 FBO using separate stencil", then that's what's happening.

-[Unknown]

jcchikikomori commented 8 years ago

@unknownbrackets unfortunately, my device seems that it doesn't fetch main logs in my logcat

zminhquanz commented 8 years ago

@jccultima123 summary , if you don't using GLtools to have fix the issues that

jcchikikomori commented 8 years ago

Finally, i can fetch the logcat now, so i begin some tests earlier and here's what i got @unknownbrackets

I/NativeApp( 4939): Creating 480 x 272 FBO using DEPTH24_STENCIL8

This is the result when GlTools' emulating GL_STENCIL_INDEX8 hack

Here's the full logcat details: https://gist.github.com/jccultima123/a9a9e5e51b97cf78f573178a2a99ceff

zminhquanz commented 8 years ago

@jccultima123 other a few game have a similarly bug , but i forget that name of this game

jcchikikomori commented 8 years ago

@zminhquanz Crisis Core FFVII has also this issue a little bit but playable unlike Dissidia.

zminhquanz commented 8 years ago

@jccultima123 @unknownbrackets yeah i see the issue in Kingdom Heart birth by sleep USA , when i'm attack , combat and using skill , it's missing effect , switch back Non-buffered rendering , it's normal Buffered rendering screenshot_2016-06-08-07-06-47 screenshot_2016-06-08-07-08-17 Non-buffered rendering screenshot_2016-06-08-07-21-00 screenshot_2016-06-08-07-20-57

jcchikikomori commented 8 years ago

@zminhquanz yeah, that's also relate to this issue. In fact, some Square Enix games was still unable to be playable at least in BR mode. They using extensive use of effects for these games

unknownbrackets commented 8 years ago

A few things we don't do in non-buffered rendering:

  1. Blit depth, but that requires GLES3 anyway.
  2. Reformat framebuffers, which Kingdom Hearts uses for shadows.
  3. Clear the backbuffer color, depth, and stencil to zero before drawing a frame.
  4. Upload initial stencil and memory values to framebuffers.

When skipping buffer effects, we do clear the backbuffer at the very start to have alpha = 1. This is wrong but probably doesn't matter much since games typically clear anyway.

We've seen before that the PowerVR drivers have bad problems with blending and with alpha testing. It seems like it could be anything here:

Not sure.

-[Unknown]

zminhquanz commented 8 years ago

I don't think so , driver from ASUS is good , not bad from Chinese manufacturer

jcchikikomori commented 8 years ago

@zminhquanz let me clear about that. PowerVR drivers are built according to their target model/capabilities and OpenGL version. I believe the drivers have the same capabilities on all devices (depending on the GPU of course).

Therefore, the issue is the PowerVR itself since they are providing lack of graphical features for low to middle-entry devices.

I am also using the other devices and they have a same issue because of their GPUs was the same PowerVR SGX bla bla too.

unknownbrackets commented 8 years ago

That's not really the case. A lot of older phones don't have updated drivers, sometimes. It's not as if video drivers are magically exempt from the rule that all software contains bugs.

For example, I remember there was a blending bug that affected most PowerVR SGX 5xx device drivers. It's potentially an issue here too, but at least it's not affecting the character drawing in Dissidia.

All I know about the bug was that blending with GL_CONSTANT_COLOR / 0xFFFFFF as the blend factor, instead of GL_ONE (which is equivalent), didn't work. Potentially this means other blend factors, like GL_CONSTANT_COLOR / 0xF0F0F0 (which is not the same as GL_ONE) also don't work.

This isn't a "new" OpenGL feature or one that has optional support or is only required by certain versions. It's supposed to work. It works everywhere else. At least for 0xFFFFFF, the driver could've made it work, and didn't. The hardware was capable of at least that value, for sure.

We have other workarounds in the code for known bugs in PowerVR, including the modulus operator simply not operating according to the specification - we have to implement our own. Again, not an optional thing. Not a hardware deficiency. It's just wrong.

FWIW the Rogue (G6xxx) PowerVR devices seem to be better in this regard. At least it seems to have a lower density of bugs in its drivers, based on reports.

-[Unknown]

zminhquanz commented 8 years ago

Maybe you can implement or rewrite a code

jcchikikomori commented 8 years ago

@unknownbrackets I see. In my case, i start to test games since the 0.7.5 release. From there, bugs and issues before was relevant to this issue today (even my drivers was OpenGL 3 capable) until it's fixed in 0.9

zminhquanz commented 7 years ago

1313

afifah1978 commented 7 years ago

This file is optional

for syntax explanation check:

- https://github.com/hrydgard/ppsspp/pull/8715

- https://github.com/hrydgard/ppsspp/pull/8792

unknownbrackets commented 1 year ago

Is this still an issue? There have been lots of changes that might have improved this since. These devices are also becoming less commonly used...

-[Unknown]

ghost commented 1 year ago

This is not a dup of https://github.com/hrydgard/ppsspp/issues/9951?

ghost commented 1 year ago

Anyone with powervr gpu can still reproduce this issue using v1.14???

ghost commented 1 year ago

@zminhquanz no feedback outdated?

Fatcat2024-cpu commented 6 months ago

Any updated framedump that I can test on my redmi 6a?