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

Star Ocean First Departure #10634

Closed
fivefeet8 opened this issue Feb 21, 2018 · 10 comments
Closed

Star Ocean First Departure #10634

fivefeet8 opened this issue Feb 21, 2018 · 10 comments

Comments

@fivefeet8
Copy link

fivefeet8 commented Feb 21, 2018

screenshot_2018-02-20-19-41-03

What happens?
Characters hidden behind objects.
What should happen?
They should be seen on top of them.

What hardware and operating system are you running PPSSPP on? GPU might matter if it's a graphical issue.
Using opengl on Snapdragon 820 ZTE Axon 7

@fivefeet8
Copy link
Author

fivefeet8 commented Feb 21, 2018

Vulkan render does the opposite. Characters are rendered in front of objects they should be behind.
screenshot_2018-02-20-19-41-40

@unknownbrackets
Copy link
Collaborator

Are you using the latest git build? What render resolution?

-[Unknown]

@fivefeet8
Copy link
Author

Latest build at 4x resolution.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Feb 21, 2018

Interesting, happens at 1x too.

OpenGL: Seems like it's somehow only doing the bottom right quadrant of the screen. Maybe scissor is still set, but I wonder why it behaves differently on desktop.

Vulkan: Maybe it's not even uploading stencil at all, for some reason. Could even be a driver bug.

-[Unknown]

@fivefeet8
Copy link
Author

fivefeet8 commented Feb 21, 2018

Confirmed that the rendering errors don't happen on my Shield Tv on either renders.

@ppmeis
Copy link
Contributor

ppmeis commented Feb 22, 2018

Tested on latest Windows build. Even using 10x IR and texture scaling under Vulkan all seems to be fine:
image

Under OpenGL, if I use any texture scaling (xBR, Hybrid, etc) there are a lot of issues:
image

Without scaling, OpenGL looks fine:
image

@fivefeet8
Copy link
Author

Still the same no the latest builds.

@unknownbrackets
Copy link
Collaborator

Vulkan on Adreno is apparently misdetecting the shader as one that's safe to run early fragment tests on. At least, discard; in the shader as no effect. Changing the coords in the vertex shader does.

Writing statically to gl_FragDepth causes it to work properly, but the spec says that OpKill should disable early fragment tests (unless explicitly enabled.)

Maybe GLES has the same issue... checking.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

So on GLES, this makes it work:

static const char stencil_vs[] = R"(#version 300 es
precision highp float;
out vec2 v_texcoord0;
void main() {
	int id = gl_VertexID;
	v_texcoord0.x = (id == 2) ? 2.0 : 0.0;
	v_texcoord0.y = (id == 1) ? 2.0 : 0.0;
	gl_Position = vec4(v_texcoord0 * vec2(2.0, 2.0) + vec2(-1.0, -1.0), 0.0, 1.0);
}
)";

That works fine with the fs, with appropriate #version. The original vs for reference:

#ifdef GL_ES
precision highp float;
#endif
#if __VERSION__ >= 130
#define attribute in
#define varying out
#endif

attribute vec4 a_position;
attribute vec2 a_texcoord0;
varying vec2 v_texcoord0;

void main() {
  v_texcoord0 = a_texcoord0;
  gl_Position = a_position;
}

I triple checked the verts being passed in, which seem fine. We could in theory just use a different shader on GLES3, if this is a driver bug. Ignoring the attributes doesn't seem like a problem, per se. But I don't get how they're going wrong.

-[Unknown]

@unknownbrackets
Copy link
Collaborator

Arrrggg, no, it's missing the semantics.

-[Unknown]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants