summaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2021-08-02mesa-demos: NOTE! Default branch is now mainHEADmasterJordan Justen0-0/+0
To update your local repository to use the new default branch, these commands may help: $ git fetch origin $ git checkout master $ git branch -m main $ git branch --set-upstream-to=origin/main $ git remote set-head origin --auto Signed-off-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
2021-03-24gitlab-ci: Add MinGW build job.Jose Fonseca4-1/+211
A rudimentary job, just to ensure Windows builds don't go south. The FreeGLUT dependencies are derived from the Linux headers plus a .def file, to avoid any further downloads whatsoever. v2: Quote all bash variable expansions and treat unset vars as errors, per Eric Engestrom.
2020-10-08egl: pack all strips per gear into a single drawErik Faye-Lund1-44/+37
We can pack multiple triangle-strips into a single draw, by inserting degenerate triangles between them. This should be a big win in terms of CPU usage. To avoid inserting needless degenerate triangles to invert face-winding, we can manually invert the order of the back-face as well as emit the inner face last. This ensures every strip starts with the right face-winding. Reviewed-by: Alexandros Frantzis <alexandros.frantzis@collbora.com>
2020-09-16Use glad instead of GLEW.Jose Fonseca323-882/+886
glad is a more modern, cleaner, and flexible alternative to GLEW. In particular it has first-class citizen support for OpenGL ES end EGL. Glad can't be used just for defines. For old demos which only need defines, we could bundle Khronos glext, but for now place the necessary defines on gl_wrap.h
2020-09-16glad: Initial import.Jose Fonseca12-2/+32798
2020-09-16wgl: Prevent GL usage before wglMakeCurrent.Jose Fonseca1-1/+4
2020-09-16wgl/rtotex: Remove.Jose Fonseca34-4966/+0
This sample is broken, it's not easy to fix, and it's too complicated/niche to be worth the hassle.
2020-09-16cmake: Build glslstateschange too.Jose Fonseca1-0/+1
2020-09-15glxgears / wglgears: avoid C99 "for" without explicit -std=Jan Beich2-2/+4
GCC < 5 defaults to -std=gnu89, failing to build: glxgears.c: In function 'init': glxgears.c:413: error: 'for' loop initial declaration used outside C99 mode Fixes: 8c73555b4dd5 ("glxgears / wglgears: adjust colors for sRGB") Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2020-09-14egl: use smooth normals for inner faceErik Faye-Lund1-1/+6
glxgears smooth-shades the inner face, so let's do that here as well for visual parity. Reviewed-by: Adam Jackson <ajax@redhat.com>
2020-09-14egl: match lighting of wglgearsErik Faye-Lund1-2/+4
glxgears uses the default value for ambient light, which is 0.2. We should do the same. This makes these two demos look the same. Reviewed-by: Adam Jackson <ajax@redhat.com>
2020-09-14egl: match geometry position of glxgearsErik Faye-Lund1-22/+21
There's two things that differs about the geometry position of this port of glxgears: 1. The camera is moved back by the wrong amount. 2. The projection matrix is computed the wrong way. So let's remedy this, and make the rendering closer to the original. Reviewed-by: Adam Jackson <ajax@redhat.com>
2020-09-11glxgears: Make the swap interval configurableAdam Jackson1-7/+40
As a bonus feature you can set negative values if your driver supports GLX_EXT_swap_control_tear, though heaven help you if your renderer is so slow that that improves things. Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
2020-08-04Revert "wglgears: show stereo-option in usage"Erik Faye-Lund1-1/+0
I don't know what I was thinking; we don't have support for stereo-rendering in wglgears. This reverts commit 8bf5a21becc274d94a790a7e7e1ff460f9b82f02. Reviewed-by: Brian Paul <brianp@vmware.com> Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
2020-07-10wglgears: add srgb-mode to usageErik Faye-Lund1-0/+1
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-07-10wglgears: show stereo-option in usageErik Faye-Lund1-0/+1
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-07-10wglgears: style-fixupErik Faye-Lund1-2/+2
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-07-10wglgears: match glxgears formattingErik Faye-Lund1-4/+4
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-07-06glxgears / wglgears: adjust colors for sRGBErik Faye-Lund2-0/+25
Without this, the colors have a very different look, making the red more orange. This adjust the colors to give the same appearance. Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2020-07-06glxgears: add sRGB mode supportErik Faye-Lund1-0/+14
wglgears already have this, so let's also add it for glxgears! Reviewed-by: Marek Olšák <marek.olsak@amd.com>
2020-05-07wglgears: destroy old window when recreatingErik Faye-Lund1-0/+1
Even if the window is not yet displayed, the object still exists and takes up memory. So let's destroy it before recreating. Fixes: 14688d84 ("wglgears.c: add -srgb option") Reviewed-by: Brian Paul <brianp@vmware.com>
2020-05-07wglgears: respect x and y positionsErik Faye-Lund1-1/+1
When adding support for the "-geometry" option, I forgot to update the second call to CreateWindowEx, meaning it only respected this option when not using srgb or multisampling. Let's fix that. Fixes: 16c9a130 ("wglgears: add geometry option") Reviewed-by: Brian Paul <brianp@vmware.com>
2020-05-07Revert "wglgears: do not re-create window after re-creating context"Erik Faye-Lund1-0/+10
This fix wasn't a great idea; even if it seems to work fine on modern Windows versions, the documentation says that SetPixelFormat can only be set once per window. And worse, Mesa's OpenGL32.DLL emulation code seems to depend on this, ignoring any consecutive calls. This means that with Mesa, we get no multisampling here. So, let's revert this, and instead follow what the docs say. This reverts commit 27813895adef5866e9aee62975c7f5965cd9c601. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: add support for -fullscreen switchErik Faye-Lund1-6/+33
In order to get the correct screen-resolution on hidpi displays, we need to mark the process as dpi-aware first. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: check what the current vsync setting isErik Faye-Lund1-0/+28
This seems to work fine on NVIDIA, but seems to report incorrect results on Intel drivers. Reading the WGL_EXT_swap_control specification, this seems like subtle driver-bug, and not an application problem, so let's do this anyway. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: implemenmt wgl-extension helperErik Faye-Lund1-0/+25
This helper allows us to check if a WGL-extension is supported or not. It will be used in the next commit. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: implement animate-stateErik Faye-Lund1-4/+9
This allows the animation to be paused and resumed, just like with glxgears. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: error properly when no pixel-format is foundErik Faye-Lund1-9/+15
If we're too strict with our requirements, we should properly report the issue. We shouldn't assert, and we should list the requirements so it's easy to understand why. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: do not re-create window after re-creating contextErik Faye-Lund1-10/+0
When we re-created the window, we accidentally leaked the old window. It's not so easy to notice, because it's invisible, but it's still there and taking up some memory. But there's more problems; when I recently added the -geometry switch, I missed the extra CreateWindowEx call, meaning this call didn't respect the x and y offset. But instead of fixing these things indevidually, let's take a step back here. There's no reason to re-create the window here in the first place. We can just set a new pixel-format on hDC and re-create hRC instead. This makes the code both easier to maintain, and squashes a couple of bugs. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: exit with error-code on errorErik Faye-Lund1-1/+1
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: omit paranoid error-checkingErik Faye-Lund1-45/+26
This code contains a lot of code that can't realistically fail; these things can only fail on incorrect input, or under memory pressure. We're passing correct input, and we're not yet at a point where memory pressure is really possible. So for the sake of readability, let's remove some overly paranoid error-checking. It's not like these error-messages are all that useful to most users, compared to running this in a debugger anyway. This makes the code reasier to read, and makes it easier to add meaningful error-checking where it actually matters in the future. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: match usage format more closely to glxgearsErik Faye-Lund1-4/+4
Two things: - We spell "Usage" with an upper-case 'u'. - We print usage to stdout, not stderr. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-20wglgears: remove unused variableErik Faye-Lund1-4/+0
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-17wglgears: fix rotation speed to 70 degrees per secondErik Faye-Lund1-24/+43
This copies the logic from glxgears, omitting the rotating-state, because we have no such option (yet). In order to do this, we also need to swap out our timer. In order to keep things nice and easy, we can use timeGetTime(), but set the minumum period before the event-loop. And for the timing-calculation, this is a lot better with proper resolution anyway. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-17wglgears: implement support for multi-samplingErik Faye-Lund1-3/+24
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-17wglgears: drop random printf in sRGB code-pathErik Faye-Lund1-2/+0
This seems a bit arbitrary, we don't generally print messages about internals like this. So let's drop it. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: set whole process as dpi-awareErik Faye-Lund1-1/+1
It seems different GPU drivers behave differently in the case of per-thread DPI-awareness, causing incorrect rendering on drivers like the NVIDIA-driver. This is probably related to some internal threading in the drivers, and is probably a subtle driver-bug. In either case, setting per-process DPI awareness seems to do the trick. It doesn't matter to us if we're doing per process or per thread, so let's just go with the more robust solution. Fixes: 7fa3a433 ("wglgears: mark application as dpi-aware")
2020-04-16wglgears: mark application as dpi-awareErik Faye-Lund1-0/+9
This makes rendering nice and crisp on high-dpi systems. Since we're not doing any layouting or anything, we can just claim to be aware without doing much. We keep the current window-size when the DPI changes, because the size is specified in pixels, so it seems more useful to keep that as-is. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: add geometry optionErik Faye-Lund1-3/+61
The parser isn't exactly identical with XParseGeometry, but should be close enough for general use. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: respect x and y arguments to make_windowErik Faye-Lund1-1/+1
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: make usage and error-handling similar to glxgearsErik Faye-Lund1-10/+4
This makes the code look a bit more like the similar code for glxgears. There's no good reason to do this differently for these two applications. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: change window-titleErik Faye-Lund1-1/+1
While this application has its roots from glxgears, it's name is wglgears, and we should reflect that in the title. Reviewed-by: Brian Paul <brianp@vmware.com>
2020-04-16wglgears: do not include unistd.h on MSVCErik Faye-Lund1-0/+2
Reviewed-by: Brian Paul <brianp@vmware.com>
2020-02-19eglinfo: Extend for EGL_EXT_platform_device.Mathias Fröhlich1-24/+98
Acked-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Mathias Fröhlich <Mathias.Froehlich@web.de>
2019-12-31fix -Wunused-const-variable compile warningsChristian Gmeiner7-22/+0
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-12-29fix -Wunused-variable compile waringsChristian GMEINER2-2/+0
Signed-off-by: Christian GMEINER <Christian.GMEINER@bachmann.info> Acked-by: Eric Engestrom <eric.engestrom@intel.com>
2019-12-29gitlab-ci: add cmake & autotools buildsEric Engestrom1-0/+103
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
2019-09-16eglinfo: Add support for surfaceless EGL platformMatwey V. Kornilov1-0/+4
Signed-off-by: Matwey V. Kornilov <matwey.kornilov@gmail.com>
2019-09-11fix texdown on macOSYurii Kolesnykov1-1/+0
Signed-off-by: Yurii Kolesnykov <root@yurikoles.com>
2019-09-04eglinfo: Add support for EGL_MESA_query_driverAdam Jackson1-3/+12
Since we don't actually create a context it can be difficult to know which driver's capabilities you think you're looking at.