summaryrefslogtreecommitdiff
path: root/Userland/Libraries/LibGL
AgeCommit message (Collapse)Author
2023-02-21LibGL: Fix minor const-correctness issuesAndreas Kling
2023-02-10Everywhere: Remove needless copies of Error / ErrorOr instancesTimothy Flynn
Either take the underlying objects with release_* methods or move() the instances around.
2023-01-30LibGL: Remove DeprecatedString usageJelle Raaijmakers
We only use it for the extension string, which we now convert into a `ByteBuffer` object containing the null-terminated bytes :^)
2023-01-20Everywhere: Convert known short-strings to the infallible String factoryTimothy Flynn
For now, this is limited to strings that are 3 bytes or less. We can use 7 bytes on 64-bit platforms, but we do not yet assume 64-bit for Lagom hosts (e.g. wasm).
2023-01-03LibGL: Implement `GL_BLEND_DST` and `GL_BLEND_SRC`Jelle Raaijmakers
These context parameters are used to retrieve the active blend functions.
2023-01-03LibGL: Remove i686 data types in favor of 64-bit typesJelle Raaijmakers
2023-01-03LibGL: Make `GLsizeiptr` signedJelle Raaijmakers
The Khronos description of a "non-negative binary integer" does not mean an unsigned type, just that it should not be negative.
2023-01-02LibGL: Move AK/Debug.h include to where it is usedBen Wiederhake
2023-01-01LibGL: Stop unnecessarily casting to `float`Jelle Raaijmakers
If the `GLContext`'s internal state uses a `float`, it makes no sense casting to and from `double`s.
2023-01-01LibGL: Implement `GL_TEXTURE_ENV_COLOR`Jelle Raaijmakers
This sets a constant color in the texture's environment for the fixed function pipeline.
2022-12-25LibGL+LibWeb: Remove WebGL-specific API from GLContextJelle Raaijmakers
The OpenGL API has ways to retrieve these values, so let's make sure to implement them. :^)
2022-12-20LibGL: Generate the API wrappersJelle Raaijmakers
We now generate all LibGL API wrappers from a single API method definition list stored in `GLAPI.json`. Since a significant portion of the OpenGL API methods are relatively consistent variants, we take advantage of this to generate a lot of these variants at once. The autogenerated methods check for the non-nullness of the current `GLContext`, and only perform an action if a `GLContext` is present. This prevents a crash in ports like GLTron, who assume you can still call the OpenGL API without an active context. This increases our API wrapper method count from 211 to 356. Fixes #15814.
2022-12-20LibGL: Implement `glLightModel` integer normalizationJelle Raaijmakers
For the ambient light model, integers need to be remapped to a range of `-1.` through `1.`. Add the `+` and `-` operators to `VectorN` to make it a bit easier to normalize 4 values at once.
2022-12-20LibGL: Support `glLightModel` inside listsJelle Raaijmakers
We now dereference the pointer given to us before adding the arguments to an active list. This also factors out the switching logic from the API wrappers, which helps us with a future commit where we autogenerate all API wrapper functions.
2022-12-20LibGL: Correct `GL_LIGHT_MODEL_LOCAL_VIEWER` comparisonJelle Raaijmakers
We were comparing the `x` parameter to `1.f` instead of `0.f`.
2022-12-20LibGL: Dereference pointer in a consistent way for `glMaterial*`Jelle Raaijmakers
2022-12-20LibGL: Simplify transposing input matricesJelle Raaijmakers
We do not need to templatize the output type - it's always `float`. Also, the input type can be inferred. Finally, use template specialization instead of a conditional to deal with same type input and output matrices.
2022-12-17LibGL: Pass generated GPU IR to GPU side compiler when linking programStephan Unverwerth
2022-12-17LibGL+LibSoftGPU: Add GPU side shader infrastructureStephan Unverwerth
This adds a shader class to LibSoftGPU and makes use of it when linking GLSL program in LibGL. Also adds actual rendering code to the shader tests.
2022-12-17LibGL: Use LibGLSL to compile shadersStephan Unverwerth
2022-12-17LibGLSL: Add LibGLSLStephan Unverwerth
This adds a new library, LibGLSL for parsing and compiling GLSL programs to LibGPU IR. Currently the compiler consists only of stubs.
2022-12-17LibGL: Implement glGetProgramivStephan Unverwerth
2022-12-17LibGL: Implement glGetShaderivStephan Unverwerth
2022-12-17LibGL: Implement glUseProgramStephan Unverwerth
2022-12-17LibGL: Make shader compilation and program linking always succeedStephan Unverwerth
This will help with testing until the actual compilation infrastructure is in place.
2022-12-17LibGL: Implement glLinkProgramStephan Unverwerth
2022-12-17LibGL: Implement glAttachShaderStephan Unverwerth
2022-12-17LibGL: Implement glCompileShaderStephan Unverwerth
2022-12-17LibGL: Implement glShaderSourceStephan Unverwerth
2022-12-17LibGL: Implement glCreateProgram and glDeleteProgramStephan Unverwerth
2022-12-17LibGL: Implement glCreateShader and glDeleteShaderStephan Unverwerth
2022-12-17LibGL: Add Shader and Program class stubsStephan Unverwerth
2022-12-17LibGL: Remove Texture note leftovers from the NameAllocator classStephan Unverwerth
The NameAllocator class is not only about Textures, so let's change a comment being related to it.
2022-12-17LibGL: Add stubs for shader and program related functionsStephan Unverwerth
2022-12-07LibGL: Generate GL_OUT_OF_MEMORY error in `glBufferData` when OOMMarcus Nilsson
2022-12-06AK+Everywhere: Rename String to DeprecatedStringLinus Groh
We have a new, improved string type coming up in AK (OOM aware, no null state), and while it's going to use UTF-8, the name UTF8String is a mouthful - so let's free up the String name by renaming the existing class. Making the old one have an annoying name will hopefully also help with quick adoption :^)
2022-12-03Everywhere: Run clang-formatLinus Groh
2022-11-26LibGL: Use buffers in vertex pointer functions and glDrawElementscflip
Many of these functions will treat the 'pointer' parameter as an offset into a buffer if one is currently bound. This makes it possible to run ClassiCube with OpenGL 1.5 support!
2022-11-26LibGL: Add simple implementation of buffer objectscflip
For now, buffers are only implemented on the LibGL side, however in the future buffer objects should be stored in LibGPU.
2022-11-26LibGL: Refactor TextureNameAllocator to a more general NameAllocatorcflip
This functionality can also be used for other types of objects.
2022-11-01Everywhere: Mark dependencies of most targets as PRIVATETim Schumacher
Otherwise, we end up propagating those dependencies into targets that link against that library, which creates unnecessary link-time dependencies. Also included are changes to readd now missing dependencies to tools that actually need them.
2022-10-19LibGL: Correctly normalize different vertex attribute type pointersJelle Raaijmakers
According to the OpenGL 2.0 spec ยง 2.8, the data for each attribute type pointer is normalized according to the type. The only exception to this is `glVertexAttribPointer` which accepts a `normalized` parameter, but we have not yet implemented that API.
2022-10-19LibGL: Return `GLboolean` value in `glIsEnabled`Jelle Raaijmakers
2022-10-19LibGL: Implement state for all pixel store parametersJelle Raaijmakers
This implements the state and context parameters for all packing and unpacking parameters accepted by `glPixelStore*`.
2022-10-19LibGL: Don't repeat ourselves in `read_from_vertex_attribute_pointer`Jelle Raaijmakers
2022-10-19LibGL: Implement missing `glDeleteLists` error conditionsJelle Raaijmakers
2022-10-19LibGL: Make `read_from_vertex_attribute_pointer` staticJelle Raaijmakers
2022-10-19LibGL: Do not return early if client-side vertex array is disabledJelle Raaijmakers
According to the spec, enabling the client-side vertex array should behave as if `glVertex` is executed after all other states such as the normal, color, etc. have changed. We were not changing these states if the client-side vertex array was disabled which probably does not affect a lot of applications, but this seems like the correct thing to do. :^)
2022-10-19LibGL: Add buffer API stubsJelle Raaijmakers
No implemented functionality, but this makes it easier to see if software is using this family of functions.
2022-10-19LibGL+LibGPU+LibSoftGPU: Report maximum texture sizecflip