9 Commits
Author SHA1 Message Date
Sönke Holz cb9e1feee3 LibGL+LibSoftGPU: Support GL_{UN,}PACK_SKIP_{PIXELS,ROWS}
We already store these glPixelStorei() parameters in
m_unpacking_parameters/m_packing_parameters, but didn't do anything
with them.

Setting these parameters is equivalent to offsetting the input/output
texture data pointer by a constant offset.
2026-11-01 21:27:28 +01:00
Sönke Holz 7af126f893 LibGL: Support GL_PROXY_TEXTURE_2D
Proxy textures don't have any image data. They can be used to determine
if a given texture configuration is supported by the implementation.

To support proxy textures in gl_tex_image_2d, we need to tweak the error
handling, since proxy textures don't report an error for unsupported
dimensions:
GL spec 1.5, 3.8.11 Texture State and Proxy State:
"When TexImage3D is executed with target specified as PROXY_TEXTURE_3D,
 the three-dimensional proxy state values of the specified
 level-of-detail are recomputed and updated. If the image array would
 not be supported by TexImage3D called with target set to TEXTURE_3D,
 no error is generated, but the proxy width, height, depth,
 border width, and component resolutions are set to zero."
(The same also applies to TexImage2D.)
2026-10-28 15:15:37 +01:00
Sönke Holz e225bb4255 LibGL: Make null textures have a size of 0x0
GL spec 1.5, 3.8.11 Texture State and Proxy State:
"Each initial texture array is null (zero width, height, and depth,
 zero border width, internal format 1, with the compressed flag
 set to FALSE, a zero compressed size, and zero-sized components)."

GL spec 1.5, 3.8.1 Texture Image Specification:
"An image with zero width, height, or depth indicates the null texture."

Previously, retrieving the texture size for an uninitialized texture
would have resulted in a crash. Since Texture2D initially has a null
device image and device images are not allowed to be 0x0 (GPU::Image
VERIFYs that), represent 0x0 textures by having a null device image.
2026-10-28 15:15:37 +01:00
Tim Schumacher 82a152b696 LibGfx: Remove try_ prefix from bitmap creation functions
Those don't have any non-try counterpart, so we might as well just omit
it.
2023-01-26 20:24:37 +00:00
Jelle Raaijmakers ae82b14e59 LibGL+LibWeb: Remove WebGL-specific API from GLContext
The OpenGL API has ways to retrieve these values, so let's make sure to
implement them. :^)
2022-12-25 15:48:59 +01:00
cflip bad3e2a089 LibGL: Add some tests for the buffer API 2022-11-26 09:38:13 +01:00
Andrew Kaster 8ed5ed3ec0 LibGL: Make GL::create_context fallible
Propagate errors in places that are already set up to handle them, like
WebGLRenderingContext and the Tubes demo, and convert other callers
to using MUST.
2022-09-16 15:32:38 +02:00
Luke Wilde 971d6ce16f LibGL: Reject GL_LEFT and GL_RIGHT in glCullFace
glCullFace only accepts GL_FRONT, GL_BACK and GL_FRONT_AND_BACK.
We checked if the mode was valid by performing
```
cull_mode < GL_FRONT || cull_mode > GL_FRONT_AND_BACK
```

However, this range also contains GL_LEFT and GL_RIGHT, which we would
accept when we should return a GL_INVALID_ENUM error.
2022-06-04 22:25:16 +01:00
Luke Wilde bc5dd8dd0f LibGL: Check that texture name is allocated before marking it as free
glDeleteTextures previously did not check that the texture name was
allocated by glGenTextures before adding it to the free texture name
list.

This means that if you delete a texture twice in a row, the name will
appear twice in the free texture list, making glGenTextures return the
same texture name twice in a row.
2022-06-02 13:14:39 +02:00