Age | Commit message (Collapse) | Author |
|
It seems like we can render this with `GL_TRIANGLE_STRIP`. This makes
the track marks in Tux Racer work.
|
|
Providing anything else than `border == 0` is deprecated and should
result in an invalid value error.
|
|
|
|
These stubs are largely implemented the same: their API is exposed, but
they print to the debug console and sometimes `TODO()`. These changes
allow GLU and Tux Racer to build.
Methods stubbed:
* `glTexImage1D`
* `glTexImage3D`
* `glTexCoord2d(v)`
* `glNormalPointer`
* `glTexGen(d|f|i)`
* `glTexGenfv`
|
|
This adds stubs for `glMap(1|2)(d|f)`, `glMapGrid(1|2)(d|f)`,
`glEvalCoord(1|2)(d|f)`, `glEvalMesh(1|2)` and `glEvalPoint(1|2)`.
|
|
|
|
|
|
|
|
Previously, if the client supplied `GL_STENCIL_BUFFER_BIT`, `glClear`
would return an error. Since it is a valid parameter, we now continue
and report that this parameter is unimplemented instead.
|
|
We should handle this in the context.
|
|
|
|
Libraries like GLU depend on their memory initialization by requesting
these parameters, so if we do not support them, segfaults will occur.
|
|
These constants are used by GLU and Tux Racer.
|
|
|
|
Images are stored on the device side. Texture2D and MipMap are now only
used to store imformation about the texture and reference to the device
image.
|
|
Texture sampling now happens entirely in SoftGPU thus this class will
now only be used to hold the sampler configuration.
|
|
This adds a method `info()` to SoftGPU that returns the name of the
hardware vendor and device name, as well as the number of texture untis.
LibGL uses the returned texture unit count to initialize its internal
texture unit array.
|
|
This removes the last reference to LibGL from LibSoftGPU. The GLenum
has been replaced by our own enum.
|
|
Replaces the GLenum used to setup polygon mode in RasterizerOptions with
our own enum.
|
|
Replaces the GLenum used to set up the fog mode in RasterizerOptions
with out own enum.
|
|
Replaces the GLenum used in the RasterizerConfig for selecting the depth
test function with out own enum.
|
|
Replaces the GLenum used in RasterizerConfig to select the draw buffer
with a simple boolean that disabled color output when the draw buffer
is set to GL_NONE on the OpenGL side.
|
|
Replaces the GLenum in RasterizerConfig, that selects the triangle sides
to be culled, with two booleans.
|
|
Replaces the GLenum used for selecting the frontface in the rasterizer
config with out own enum.
|
|
Replaces the GLenum used for configuring alpha blend factors in the
SoftGPU device with out own enum.
|
|
Replaces the OpenGL enum used for setting the alpha test func in
RasterizerOptions with out own enum.
|
|
We now sample textures from the device owned image samplers.
Passing of enabled texture units has been simplified by only passing a
list of texture unit indices.
|
|
|
|
|
|
This class does everything related to rendering now. It is the software
implementation of a full GPU device.
|
|
|
|
|
|
|
|
|
|
This introduces a new library, LibSoftGPU, that incorporates all
rendering related features that formerly resided within LibGL itself.
Going forward we will make both libraries completely independent from
each other allowing LibGL to load different, possibly accelerated,
rendering backends.
|
|
|
|
This is a deprecated feature that is still in use in some older games,
most notably Grim Fandango in ScummVM makes heavy use of it.
Luckily, since you can only draw convex polygons, the end result is
exactly the same as when you would have used `glBegin(GL_TRIANGLE_FAN)`
- so we just reuse that code as-is.
|
|
|
|
Implement support for the `GL_TEXTURE` matrix mode, the texture matrix
stack and texture coordinate matrix transformation.
Also, an unused `m_current_matrix` was removed to make room for
`m_texture_matrix`.
|
|
In OpenGL, texture coordinates can have up to 4 values. This change
will help with easy application of texture coordinate matrix
transformations in the future.
Additionally, correct the initial value for texture coordinates to
`{ 0.f, 0.f, 0.f, 1.f}`.
|
|
Before, `SoftwareRasterizer` was iterating over all 32 possible texture
units for each fragment and checking each if they're bound to a texture.
After this change, an intrusive list containing only texture units with
bound textures is passed to the rasterizer. In GLQuake, this results in
a performance improvement of ~30% (from 12 to 16 FPS in the first demo)
on my machine.
|
|
This smaller block size allows us to use an `u8` for the pixel mask
during triangle rasterization. These changes result in better FPS in
3DFileViewer, which periodically shoots up to 250-300 FPS on my
machine. Before, the peaks were somewhere in the range of 160-170 FPS.
|
|
Previously we multiplied the interpolated texture coordinates by
width - 1 and height - 1 instead of width and height which resulted in
some wrongly mapped textures, especially visible in the glquake light
maps.
This also corrects the wrap mode being wrongly swapped for s/t
coordinates.
Since we do not have texture borders implemented yet we always use
GL_CLAMP_TO_EDGE for all clamping wrap modes for the time being.
|
|
|
|
If an unsupported drawing mode was configured, `glEnd` would not reach
the line where `m_in_draw_state` was set to `false`. This caused all
subsequent invocations to `glBegin` to fail.
|
|
Most resources seem to suggest that points on the clip planes are also
inside the frustum, e.g.: https://www.cubic.org/docs/3dclip.htm
This seems to resolve some rendering issues in Grim Fandango in OpenGL
mode where the screen remained black. This was because of quads being
drawn with their vertex positions exactly on the clip planes.
|
|
|
|
Instead of calling the public API, call our own internal API.
|
|
In its current state, ScummVM seems to invoke these methods just after
destroying the current GL context. According to the OpenGL spec:
"Issuing GL commands when the program does not have a current
context results in undefined behavior, up to and including program
termination."
Our old behavior was to deref a `nullptr`, which isn't that great. For
now, protect these two methods. If other ports seem to misbehave as
well, we can always expand the check to other methods.
|
|
|