Stephan Unverwerth
39ff1459f8
LibGL: Improve texture sampling performance
...
GL_NEAREST: Remove unnecessary modulo. UV is always in range due to
wrapping.
GL_LINEAR: Rewrite filter equation to save a few math operations.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
59998ff0b2
LibGL: Return white texel when sampling uninitialized texture
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
b38edf994b
LibGL: Allow glTexImage2D to create uninitialized textures
...
When passing a nullptr as the pixel array LibGL now allocates texture
memory but does not initialize the texture contents.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
22905daacb
LibGL: Fix interpretation of BGRA byte order
...
This fixes byte order interpretation in several places.
2021-08-18 20:30:58 +02:00
Stephan Unverwerth
00d527bc25
LibGL: Implement GL_LINEAR texture filter
2021-08-12 20:57:19 +02:00
Stephan Unverwerth
b9523e15df
LibGL: Implement glTexParameter{i,f}
...
This currently only implements a subset of this function.
Namely setting wrap, mag and min modes for the GL_TETXURE_2D target.
2021-08-12 18:58:41 +02:00
Stephan Unverwerth
e0fef60241
LibGL: Implement "mirrored repeat" wrap mode
2021-08-12 18:58:41 +02:00
Stephan Unverwerth
8902efa52d
LibGL: Implement "clamp" wrap mode
2021-08-12 18:58:41 +02:00
Stephan Unverwerth
12785849aa
LibGL: Turn Sampler2D into an actual class
...
This extracts the sampler functionality into its own class.
Beginning with OpenGL 3 samplers are actual objects, separate
from textures. It makes sense to do this already as it also
cleans up code organization quite a bit.
2021-08-12 18:58:41 +02:00
Jesse Buhagiar
8298e406a4
LibGL: Use Texture Units in Rasterizer and Context
...
The Context and Software Rasterizer now gets the array of texture units
instead of a single texture object. _Technically_, we now support some
primitive form of multi-texturing, though I'm not entirely sure how well
it will work in its current state.
2021-05-31 14:59:47 +01:00
Jesse Buhagiar
52e5d3c961
LibGL: Implement basic texture units
...
These are merely a way to hold the different texture target bind
points that a texture can be bound to.
2021-05-31 14:59:47 +01:00
Stephan Unverwerth
fde0045ebe
LibGL: Introduce Texture base class for all texture types
2021-05-30 00:32:37 +01:00
Jesse Buhagiar
4f324ba4d7
LibGL: Implement Texture State Management
...
Some very primitive Texture State management. Data can now be
uploaded to textures.
2021-05-26 16:36:53 +04:30
Jesse Buhagiar
21dff6d40b
LibGL: Add Texture Name Allocation
...
Texture names can now be allocated via
`glGenTextures` and deallocated via `glDeleteTextures`.
2021-05-26 16:36:53 +04:30