aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/wgl
Commit message (Collapse)AuthorAgeFilesLines
* gallium: rename 'state tracker' to 'frontend'Marek Olšák2020-05-1331-7888/+0
| | | | | | | Acked-by: Eric Anholt <[email protected]> Acked-by: Alyssa Rosenzweig <[email protected]> Acked-by: Pierre-Eric Pelloux-Prayer <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4902>
* st/wgl: allocate and resolve msaa-texturesErik Faye-Lund2020-05-071-6/+79
| | | | | | | | | | | | | | LLVMpipe recently got the ability to render to MSAA-surfaces, but in order for this to work on Windows, we need to allocate a separate MSAA resource and resolve using a blit before we can display it. Without this, we end up always displaying the first sample instead of the resolved result. Acked-by: Dave Airlie <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4926>
* st/wgl: pass st_context_iface into stw_st_framebuffer_present_lockedErik Faye-Lund2020-05-073-5/+8
| | | | | | | | | We're going to need this to be able to resolve MSAA buffers. Acked-by: Dave Airlie <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]> Reviewed-by: Jose Fonseca <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4926>
* util/os_memory: never use os_memory_debug.hErik Faye-Lund2020-05-071-8/+0
| | | | | | | | | | | | | | | | This is currently broken hard, because this code is being used in more places that it used to be, and fixing that is prohibitively hard right now. This is far from ideal, as it leaves the same inconsistency in the EMBEDDED_DEVICE code-path. But that only used by VMWare, so it's probably better if they fix it, as they know their requirements better than we do. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2911 Fixes: 76f79db3f5d ("util: stop including files from mesa/main") Acked-by: Jose Fonseca <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4919>
* wgl: silence some cast-warningsErik Faye-Lund2020-04-162-4/+4
| | | | | | | | | | These casts cause warnings on x64. We're passing integers through pointers, which works fine. So let's make the casts a bit more explicit, to silence that warning. Reviewed-by: Brian Paul <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4577>
* wgl: do not create screen from DllMainErik Faye-Lund2020-04-023-7/+31
| | | | | | | | | | | | | There's a lot of operations that aren't allowed from DllMain, so we shouldn't create a driver-screen from there. So let's instead delay this until it's needed from a normal function call. See https://docs.microsoft.com/en-us/windows/win32/dlls/dllmain for details about what is allowed and isn't from DllMain. Reviewed-by: Neha Bhende <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4307> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4307>
* wgl: move screen-init to a helperErik Faye-Lund2020-04-021-12/+19
| | | | | | | This will be useful in the next commit. Reviewed-by: Neha Bhende <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4307>
* wgl: drop unused memberErik Faye-Lund2020-04-022-4/+2
| | | | | | | | | While we're at it, drop trying to re-calculate the max-size from the max-level. It's not accurate on any drivers where the max-size isn't a power of two anyway. Reviewed-by: Neha Bhende <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4307>
* wgl: drop pointless debug_printfErik Faye-Lund2020-04-021-2/+0
| | | | | Reviewed-by: Neha Bhende <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4307>
* wgl: use gldrv.h instead of stw_icd.hJesse Natalie2020-03-2710-647/+33
| | | | | | | | | Now that we have the official header, let's use that instead of stw_icd.h. Reviewed-by: Jose Fonseca <[email protected]> Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4305> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4305>
* wgl: add official gldrv.h header-fileJesse Natalie2020-03-271-0/+589
| | | | | | | | This is the official, Microsoft-provided gldrv.h that describes the driver-interface for OpenGL drivers on Windows. Reviewed-by: Jose Fonseca <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4305>
* util: move debug_memory_{begin,end} to os_memory_debug.hErik Faye-Lund2020-02-241-1/+0
| | | | | | | | | | | This is where the other debug_memory_* functions are declared, so let's move it here for symmetry. This allows us to drop an include of u_debug_gallium.h, which makes us depend on gallium-headers in non-gallium code. Reviewed-by: Eric Anholt <[email protected]> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3901>
* st/wgl: eliminate implicit cast warningErik Faye-Lund2020-01-141-2/+4
| | | | | | | | I get warnings on MSVC for these implicit casts. Let's use explicit casts instead. Signed-off-by: Erik Faye-Lund <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add a notify_before_flush callback param to flushPierre-Eric Pelloux-Prayer2019-12-102-3/+4
| | | | | | | | | | The new callback is called right before the flush is done to allow users of st->flush to do some work after all the previous work has been flushed. This will be used by dri_flush in the next commit. Reviewed-by: Marek Olšák <[email protected]>
* util: Move gallium's PIPE_FORMAT utils to /util/format/Eric Anholt2019-11-142-2/+2
| | | | | | | | | | | | | | | To make PIPE_FORMATs usable from non-gallium parts of Mesa, I want to move their helpers out of gallium. Since u_format used util_copy_rect(), I moved that in there, too. I've put it in a separate directory in util/ because it's a big chunk of related code, and it's not clear to me whether we might want it as a separate library from libmesa_util at some point. Closes: #1905 Acked-by: Marek Olšák <[email protected]> Reviewed-by: Kristian H. Kristensen <[email protected]> Reviewed-by: Alyssa Rosenzweig <[email protected]>
* meson: build wgl state trackerDylan Baker2019-10-101-0/+57
| | | | | | | | v4: - Handle enable gles properly - Add comments about what various #defines do v5: - key NO_EXPORTS on shared glapi instead of gles. Acked-by: Kristian H. Kristensen <[email protected]>
* gallium: remove boolean from state tracker APIsIlia Mirkin2019-07-222-8/+8
| | | | | | Signed-off-by: Ilia Mirkin <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Timothy Arceri <[email protected]>
* gallium: Redefine the max texture 2d cap from _LEVELS to _SIZE.Eric Anholt2019-05-131-2/+2
| | | | | | | | The _LEVELS assumes that the max is always power of two. For V3D 4.2, we can support up to 7680 non-power-of-two MSAA textures, which will let X11 support dual 4k displays on newer hardware. Reviewed-by: Marek Olšák <[email protected]>
* st/wgl: init a variable to silence MinGW warningBrian Paul2019-03-041-1/+1
| | | | | | MinGW release build says 'value' may be used before being initialized. Reviewed-by: Neha Bhende <[email protected]>
* gallium/util: move memory debug declarations into u_debug_galliumDylan Baker2018-10-301-0/+1
| | | | | Tested-by: Brian Paul <[email protected]> Reviewed-by: Marek Olšák <[email protected]>
* scons: Remove gles option.Jose Fonseca2018-10-191-3/+1
| | | | | | | | It's broken, and WGL state tracker is always built with GLES support noawadays. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
* gallium: add storage_sample_count parameter into is_format_supportedMarek Olšák2018-07-311-1/+2
| | | | Tested-by: Dieter Nützel <[email protected]>
* gallium: add pipe_resource::nr_storage_samples, and set it same as nr_samplesMarek Olšák2018-07-311-0/+1
| | | | Tested-by: Dieter Nützel <[email protected]>
* st/wgl: check for NULL piAttribList in wglCreatePbufferARB()Charmaine Lee2018-07-061-39/+41
| | | | | | | | | Java2d opengl pipeline passes NULL piAttribList to wglCreatePbufferARB(). So skip parsing the attribute list if it is NULL. Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Neha Bhende <[email protected]>
* st/wgl: check if WGL_SWAP_INTERVAL is defined in wglSwapIntervalEXT()Brian Paul2018-03-302-2/+2
| | | | | | | | | | | | This allows the WGL_SWAP_INTERVAL env var to override any application calls to wglSwapIntervalEXT(). Useful for debugging, or to set the interval to zero to effectively disable the swap interval. Note: we also rename the previous instance of SVGA_SWAP_INTERVAL to WGL_SWAP_INTERVAL since this is a WGL feature and not related to the svga driver. Reviewed-by: Charmaine Lee <[email protected]>
* gallium/hud: update the HUD interface for multiple contextsMarek Olšák2017-11-252-5/+5
| | | | | | | This is the boring subset of the following commit. All new parameters are optional. Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: use cso_get_pipe_contextMarek Olšák2017-11-251-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/hud: split hud_draw into 3 separate functionsMarek Olšák2017-11-251-1/+1
| | | | Reviewed-by: Nicolai Hähnle <[email protected]>
* gallium/wgl: fix default pixel format issueFrank Richter2017-11-151-2/+21
| | | | | | | | | | | | When creating a context without SetPixelFormat() don't blindly take the pixel format reported by GDI. Instead, look for our own closest pixel format. Minor clean-ups added by Brian Paul. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=103412 Reviewed-by: Brian Paul <[email protected]> Tested-by: Brian Paul <[email protected]>
* util: move os_time.[ch] to src/utilNicolai Hähnle2017-11-091-1/+1
| | | | Reviewed-by: Marek Olšák <[email protected]>
* st/mesa: Initialize textures array in st_framebuffer_validateMichel Dänzer2017-10-181-3/+1
| | | | | | | | | | | | | | | | And just reference pipe_resources to it in the validate callbacks. Avoids pipe_resource leaks when st_framebuffer_validate ends up calling the validate callback multiple times, e.g. when a window is resized. v2: * Use generic stable tag instead of Fixes: tag, since the problem could already happen before the commit referenced in v1 (Thomas Hellstrom) * Use memset to initialize the array on the stack instead of allocating the array with os_calloc. Cc: [email protected] Reviewed-by: Thomas Hellstrom <[email protected]>
* st/wgl: check for negative delta in wait_swap_interval()Frank Richter2017-08-161-2/+5
| | | | | | | | | This can happen because of rollover. See bug report for details. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102241 Cc: [email protected] Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Jose Fonseca <[email protected]>
* st/mesa: create framebuffer iface hash table per st managerCharmaine Lee2017-07-242-0/+4
| | | | | | | | | | | | | | | | With commit 5124bf98239, a framebuffer interface hash table is created in st_gl_api_create(), which is called in dri_init_screen_helper() for each screen. When the hash table is overwritten with multiple calls to st_gl_api_create(), it can cause race condition. This patch fixes the problem by creating a framebuffer interface hash table per state tracker manager. Fixes crash with steam. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101876 Fixes: 5124bf98239 ("st/mesa: add destroy_drawable interface") Tested-by: Christoph Haag <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add destroy_drawable interfaceCharmaine Lee2017-07-201-1/+5
| | | | | | | | | | | | | | | With this patch, the st manager will maintain a hash table for the active framebuffer interface objects. A destroy_drawable interface is added to allow the state tracker to notify the st manager to remove the associated framebuffer interface object from the hash table, so the associated framebuffer and its resources can be deleted at framebuffers purge time. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101829 Fixes: 147d7fb772a ("st/mesa: add a winsys buffers list in st_context") Tested-by: Brad King <[email protected]> Tested-by: Gert Wollny <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/mesa: add a winsys buffers list in st_contextCharmaine Lee2017-07-111-1/+3
| | | | | | | | | | | | | | | | | | | | | Commit a5e733c6b52e93de3000647d075f5ca2f55fcb71 fixes the dangling framebuffer object by unreferencing the window system draw/read buffers when context is released. However this can prematurely destroy the resources associated with these window system buffers. The problem is reproducible with Turbine Demo running with VMware driver. In this case, the depth buffer content was lost when the context is rebound to a drawable. To prevent premature destroy of the resources associated with window system buffers, this patch maintains a list of these buffers in the context, making sure the reference counts of these buffers will not reach zero until the associated framebuffer interface objects no longer exist. This also helps to avoid unnecessary destruction and re-construction of the resources associated with the framebuffer. Fixes VMware bug 1909807. Reviewed-by: Brian Paul <[email protected]>
* st/wgl: Implement wglUseFontBitmaps.Olivier Lauffenburger2017-07-061-16/+49
| | | | | | | | | wglUseFontBitmaps is currently a noop. This patch implements this function for Windows. Misc code clean-ups by Brian. Signed-off-by: Olivier Lauffenburger <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* st/wgl: improve selection of pixel formatOlivier Lauffenburger2017-07-061-7/+29
| | | | | | | | | | | | | | | | | | Current selection of pixel format does not enforce the request of stencil or depth buffer if the color depth is not the same as requested. For instance, GLUT requests a 32-bit color buffer with an 8-bit stencil buffer, but because color buffers are only 24-bit, no priority is given to creating a stencil buffer. This patch gives more priority to the creation of requested buffers and less priority to the difference in bit depth. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101703 Signed-off-by: Olivier Lauffenburger <[email protected]> Tested-by: Brian Paul <[email protected]> Reviewed-by: Brian Paul <[email protected]>
* gallium/wgl: Allow context creation even if SetPixelFormat() wasn't calledFrank Richter2017-06-091-1/+7
| | | | | Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101326 Reviewed-by: Brian Paul <[email protected]>
* st/wgl: whitespace, formatting fixes in stw_device.cBrian Paul2017-05-251-12/+9
| | | | Trivial.
* st/wgl: whitespace, formatting fixes in stw_pixelformat.cBrian Paul2017-04-281-72/+62
| | | | Trivial.
* st/wgl: allow WGL_BIND_TO_TEXTURE_RGB_ARB for RGBA visualsCharmaine Lee2017-04-281-2/+2
| | | | | | | | | | | We do not need to restrict WGL_BIND_TO_TEXTURE_RGB_ARB to RGB visuals only. It can be supported with RGBA visuals as well. This fixes the early exit of cinebench-r15-test trace. Tested with cinebench-r15, piglit, glretrace. Reviewed-by: Brian Paul <[email protected]>
* st/wgl: use ARRAY_SIZE() macro in wglChoosePixelFormatARB()Brian Paul2017-04-281-1/+1
| | | | Trivial.
* st/wgl: whitespace/formatting fixes in stw_ext_pixelformat.cBrian Paul2017-04-281-59/+52
| | | | Trivial.
* st/wgl: sort strings in stw_extension_string[] arrayBrian Paul2017-04-071-3/+3
| | | | Trivial.
* st/wgl: pseudo-implementation of WGL_EXT_swap_controlBrian Paul2017-04-077-12/+86
| | | | | | | | | | | | | | | | | | | | | This implementation is based on querying the time just before swap/present and doing a Sleep() if needed. There is no sync to vblank or actual coordination with the GPU. This isn't perfect, but basically works. We've had some request for this functionality, and it sounds like there are some Windows GL apps that refuse to start if the driver doesn't advertise this extension. Note: NVIDIA's Windows OpenGL driver advertises the WGL_EXT_swap_control string both with wglGetExtensionsStringEXT() and with glGetString(GL_EXTENSIONS). We're only advertising it with the former at this time. Tested with asst. Mesa demos, Google Earth, Lightsmark, etc. VMware bug 1591534. Reviewed-by: José Fonseca <[email protected]>
* st/wgl: Replace variable name hdc with hDrawDCNeha Bhende2017-03-312-10/+10
| | | | Reviewed-by: Brian Paul <[email protected]>
* st/wgl: add support for WGL_ARB_make_current_readBrian Paul2017-03-318-16/+107
| | | | | | | This adds the wglMakeContextCurrentARB() and wglGetCurrentReadDCARB() functions. Signed-off-by: Brian Paul <[email protected]>
* stw/wgl: add null context check in wglBindTexImageARB()Brian Paul2017-03-311-0/+6
| | | | | | | | To avoid dereferencing a null pointer in case wglMakeCurrent() wasn't called. Found while debugging SWKOTOR game. Reviewed-by: Neha Bhende <[email protected]> Reviewed-by: Charmaine Lee <[email protected]>
* st/wgl: consistently use ifndef guards over pragma onceEmil Velikov2017-03-221-1/+3
| | | | | | | Signed-off-by: Emil Velikov <[email protected]> Acked-by: Vedran Miletić <[email protected]> Acked-by: Juha-Pekka Heikkila <[email protected]> Reviewed-by: Edward O'Callaghan <[email protected]>
* st/wgl: flush with ST_FLUSH_WAIT before releasing shared contextsCharmaine Lee2017-02-182-2/+15
| | | | | | | | | | | Before releasing a shared context, flush the context with ST_FLUSH_WAIT to make sure all commands are executed. This ensures that rendering to any shared resources is completed before they will be referenced by another context. Fixes an intermittent flickering with Photoshop. (VMware bug# 1779340) Reviewed-by: Brian Paul <[email protected]>