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

HW Tessellation grayed out on GLES2 devices #9455

Open
zminhquanz opened this issue Mar 19, 2017 · 20 comments
Open

HW Tessellation grayed out on GLES2 devices #9455

zminhquanz opened this issue Mar 19, 2017 · 20 comments
Labels

Comments

@zminhquanz
Copy link
Contributor

I don't think HW tessellation isn't support for GLES 2.0 device
Can you tell me about that ?
2017_3_19_10_5_44_963_am
2017_3_19_10_6_2_112_am

@unknownbrackets
Copy link
Collaborator

Hardware tessellation requires:

  • Vertex texture fetch - YES, likely supported by your GPU.
  • Floating point textures - YES, likely supported by your GPU.
  • Instanced rendering - MAYBE supported by your GPU, but probably incorrectly detected by PPSSPP.

If you go to OGL extensions, do you see GL_EXT_draw_instanced? I think PPSSPP is incorrectly checking for GL_EXT_gpu_shader4 instead, which I doubt your GPU has.

That being said, I'm not seeing any reports on the server of SGX 544MP GPUs/drivers with GL_EXT_draw_instanced. I do see some SGX 535, SGX 543, and SGX 554 that have it though - so may just be missing report data. Or it may be iOS devices only.

-[Unknown]

@zminhquanz
Copy link
Contributor Author

ok @unknownbrackets , i will post info driver

@zminhquanz
Copy link
Contributor Author

2017_3_19_10_53_59_23_am
I think PPSSPP doesn't detect this @unknownbrackets

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Mar 19, 2017

If it's not in that list (which I don't see it), your driver doesn't support it, or isn't telling PPSSPP it's allowed to use it. It's likely this feature is only supported on iOS under GLES 2.0.

Even if your hardware theoretically supports it, if the driver doesn't let us talk to the hardware about the feature, it effectively means PPSSPP can't use it. You can try contacting support for whoever maintains your driver (i.e. whoever gives you Android updates possibly - i.e. Samsung for Samsung devices, etc.) Unfortunately, this is unlikely to be fruitful, but it's in their hands.

-[Unknown]

@zminhquanz
Copy link
Contributor Author

You can see that again , i don't think SGX 544 isn't support this

@unknownbrackets
Copy link
Collaborator

Hmm, that doesn't seem right. Any device that supports GLES 3 should have instanced rendering and floating point texture support, and I'm quite sure the A8 had enough vertex texture fetch units.

-[Unknown]

@xebra
Copy link
Contributor

xebra commented Mar 26, 2017

Thanks @unknownbrackets, I actually didn't know about the extension named GL_EXT_draw_instanced. However I think it's not incorrect checks using GL_EXT_gpu_shader4 probably.

I think "instanced rendering" needs to check two extensions.

  1. For definition and compiling shaders with gl_InstanceID.
    gl_InstanceID needs GLSL ES 3.0 or GLSL 1.4 or GL_EXT_gpu_shader4 or GL_NV_vertex_shader4.

  2. To use the value of gl_InstanceID.

Interactions with EXT_draw_instanced

    If EXT_draw_instanced is not supported, the value of gl_InstanceID
    is always zero.

https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_gpu_shader4.txt

@xebra
Copy link
Contributor

xebra commented Mar 26, 2017

I think old mobile devices don't support "instanced rendering" unfortunately.
Actually we can avoid the extensions checks but it doesn't work correctly.

@iOS4all
Copy link

iOS4all commented Mar 26, 2017

This is my device details

img_0077
img_0078
This screenshot for my jailbroken iPad Air 2 on iOS 10.2 with 2 GB Ram
As well as non-jailbroken iPhone 7 plus 10.2.1

I guess A8X and above should handle it without any issues but it's not detected correctly.

@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Mar 26, 2017

https://www.khronos.org/registry/OpenGL/extensions/EXT/EXT_draw_instanced.txt

Note:

OpenGL 2.0 or OpenGL ES 2.0 is required.

EXT_gpu_shader4 or NV_vertex_shader4 is required if the GL is not OpenGL ES 2.0.

...

"Besides having access to vertex attributes and uniform variables,
vertex shaders can access the read-only built-in variable
gl_InstanceIDEXT. The variable gl_InstanceIDEXT holds the integer
index of the current primitive in an instanced draw call.  See also
section 7.1 of the OpenGL ES Shading Language Specification."

...


"Including the following line in a shader can be used to control the
language features described in this extension:

    #extension GL_EXT_draw_instanced : <behavior>

where <behavior> is as specified in section 3.4.

A new preprocessor #define is added to the OpenGL Shading Language:

    #define GL_EXT_draw_instanced 1

Change Section 7.1 "Vertex Shader Special Variables"

Add the following definitions to the list of built-in variable definitions:

    highp int gl_InstanceIDEXT; // read-only

Add the following paragraph at the end of the section:

The variable gl_InstanceIDEXT is available as a read-only variable
from within vertex shaders and holds the integer index of the current
primitive in an instanced draw call (DrawArraysInstancedEXT,
DrawElementsInstancedEXT). If the current primitive does not come
from an instanced draw call, the value of gl_InstanceIDEXT is zero."

Note that the EXT_gpu_shader4 snippet is only correct for non-ES. In this document, it says:

If EXT_gpu_shader4 is not supported and the GL is not OpenGL ES 2.0, 
all references to gl_InstanceID are deleted.

I don't think EXT_gpu_shader4 and GLES are compatible - only desktop has that extension, I believe.

-[Unknown]

@zminhquanz
Copy link
Contributor Author

oh , Mobile like modern GPU is PVR G6430 or Mali-T760 doesn's support gl_instanced extension , only GPU on desktop supported it

@hrydgard
Copy link
Owner

Tesselation in the context of PPSSPP is the rarely-used hardware functionality that the PSP has to generate curved geometry. It was only used to full effect in a few games, and our hardware tesselation looks the same as our software tesselation, only faster, so you would not have seen 'smoother mapping graphics'.

@hrydgard
Copy link
Owner

About the A8X CPU, you are right that we don't detect it, nobody has spent the time to figure out how yet.

@xebra
Copy link
Contributor

xebra commented Mar 28, 2017

https://play.google.com/store/apps/details?id=com.gomdev.shader&hl=en
I confirmed gl_InstanceID can't define with GLES 2 using this useful app.
However this app can work instanced rendering with GLES 2 without gl_InstanceID.
Anyway GLES 3 to use it without any extensions.
Also I may implement it without instancing for GLES 2 in the future.

@zminhquanz
Copy link
Contributor Author

@xebra tks , good luck bro

@unknownbrackets
Copy link
Collaborator

Isn't it gl_InstanceIDEXT on GLES2?

http://stackoverflow.com/questions/28041936/use-of-undeclared-identifier-gl-instanceid

-[Unknown]

@unknownbrackets unknownbrackets changed the title HW Tessellation gray out HW Tessellation grayed out on GLES2 devices Dec 2, 2017
@unknownbrackets
Copy link
Collaborator

I think we should probably include EXT_color_buffer_float for GLES3, as per #14774 (comment).

-[Unknown]

@hrydgard
Copy link
Owner

hrydgard commented Sep 8, 2021

Include, you mean, declare it in the shader? Or check for it?

@unknownbrackets
Copy link
Collaborator

I just meant, potentially include EXT_color_buffer_float as part of the check to allow HW tessellation. The comment I linked to was about how the option is not available for some devices which seem like they could support it.

-[Unknown]

@ghost
Copy link

ghost commented Sep 10, 2022

I can use hardware tessellation on both vulkan and opengl using my Oppo a3s Snapdragon 450 Adreno 506 gpu.

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

No branches or pull requests

5 participants