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

sokol_gfx.h: Pipeline desc without attributes should be valid #280

Closed
agorgl opened this issue Apr 1, 2020 · 9 comments
Closed

sokol_gfx.h: Pipeline desc without attributes should be valid #280

agorgl opened this issue Apr 1, 2020 · 9 comments

Comments

@agorgl
Copy link

agorgl commented Apr 1, 2020

Hello there,

It is perfectly valid to be able to call the draw functions without any vertex or index buffer bound.
For example this vertex shader is a neat trick to draw a fullscreen pass without any vertex buffer:

#version 330 core
out vec2 uv;

void main()
{
    uv = vec2((gl_VertexID << 1) & 2, gl_VertexID & 2);
    gl_Position = vec4(uv * 2.0f + -1.0f, 0.0f, 1.0f);
}

Sokol pipeline validation though does not permit this, using the following validation:
https://github.com/floooh/sokol/blob/master/sokol_gfx.h#L10440

This is not valid, and we should allow pipelines without any layout attributes to be created.

@floooh
Copy link
Owner

floooh commented Apr 2, 2020

Hi, the reason why attribute-less rendering isn't allow in sokol_gfx.h is that this isn't supported by GLES2 and WebGL (gl_VertexID was only added to GLES3 and WebGL2).

It might make sense to declare this as an optional feature though, I'll think about it.

Thanks for writing the issue!

@floooh floooh self-assigned this Apr 2, 2020
@SanderMertens
Copy link
Contributor

Just ran into the same issue, support for this would be great.

@aganm
Copy link

aganm commented Oct 10, 2020

@floooh Why keep GLES2 and WebGL around? Can't they be replaced by GLES3 and WebGL2 across the board?

@Maeiky
Copy link

Maeiky commented Oct 10, 2020

It's also required with WebGL2 and angle backend (d3d9)

@KTRosenberg
Copy link

KTRosenberg commented Oct 11, 2020

@floooh Why keep GLES2 and WebGL around? Can't they be replaced by GLES3 and WebGL2 across the board?

Believe it or not, Apple has never moved beyond a mostly un-implemented webgl2 support on its devices. We'll have to wait until they bother with WebGPU, most likely, as that uses Metal underneath. I think that there should be a WebGL 1 extension for hacking-in some things optionally.

@floooh
Copy link
Owner

floooh commented Oct 11, 2020

Apple has never moved beyond a mostly un-implemented webgl2 support

Safari Technology Review on macOS now actually has a working WebGL2 implementation based on ANGLE (it was just enabled by default a couple of days ago), I don't know how far along the iOS version is. But once this lands in the stable version I might indeed start plotting to remove the GLES2/WebGL1 support.

@iOrange
Copy link

iOrange commented Nov 27, 2021

Upvoting this. Something like a feature flag would be greatly appreciated.

@floooh
Copy link
Owner

floooh commented Oct 23, 2023

Closing this ticket in favour of: #922

(now that GLES2/WebGL1 has been dropped it's time to look into that topic again)

@floooh floooh closed this as completed Oct 23, 2023
@floooh floooh reopened this Oct 23, 2023
@floooh floooh closed this as completed Oct 23, 2023
@floooh floooh closed this as not planned Won't fix, can't repro, duplicate, stale Oct 23, 2023
@floooh
Copy link
Owner

floooh commented Oct 23, 2023

("closed as not planned" actually means "closed as duplicate"!)

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

7 participants