mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 07:20:10 +01:00
Remove osmesa
It's redundant with EGL surfaceless and it doesn't have much use. It's also available from the amber branch, so distros should get it from there if they want to continue packaging it. Reviewed-by: Adam Jackson <ajax@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33836>
This commit is contained in:
parent
e8e4022dde
commit
027ccd963b
22 changed files with 3 additions and 3597 deletions
|
|
@ -241,7 +241,6 @@ debian-build-testing:
|
||||||
BUILDTYPE: "debugoptimized"
|
BUILDTYPE: "debugoptimized"
|
||||||
EXTRA_OPTION: >
|
EXTRA_OPTION: >
|
||||||
-D spirv-to-dxil=true
|
-D spirv-to-dxil=true
|
||||||
-D osmesa=true
|
|
||||||
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
|
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
|
||||||
-D perfetto=true
|
-D perfetto=true
|
||||||
S3_ARTIFACT_NAME: debian-build-testing
|
S3_ARTIFACT_NAME: debian-build-testing
|
||||||
|
|
@ -273,7 +272,6 @@ debian-release:
|
||||||
VULKAN_DRIVERS: "swrast,intel_hasvk,imagination-experimental,microsoft-experimental"
|
VULKAN_DRIVERS: "swrast,intel_hasvk,imagination-experimental,microsoft-experimental"
|
||||||
EXTRA_OPTION: >
|
EXTRA_OPTION: >
|
||||||
-D spirv-to-dxil=true
|
-D spirv-to-dxil=true
|
||||||
-D osmesa=true
|
|
||||||
-D tools=all
|
-D tools=all
|
||||||
-D mesa-clc=enabled
|
-D mesa-clc=enabled
|
||||||
-D precomp-compiler=enabled
|
-D precomp-compiler=enabled
|
||||||
|
|
@ -344,7 +342,6 @@ fedora-release:
|
||||||
-D glvnd=enabled
|
-D glvnd=enabled
|
||||||
-D platforms=x11,wayland
|
-D platforms=x11,wayland
|
||||||
EXTRA_OPTION: >
|
EXTRA_OPTION: >
|
||||||
-D osmesa=true
|
|
||||||
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
|
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,nir,nouveau,lima,panfrost,imagination
|
||||||
-D vulkan-layers=device-select,overlay
|
-D vulkan-layers=device-select,overlay
|
||||||
-D intel-rt=enabled
|
-D intel-rt=enabled
|
||||||
|
|
@ -450,7 +447,6 @@ debian-android:
|
||||||
-D gbm=enabled
|
-D gbm=enabled
|
||||||
-D egl=enabled
|
-D egl=enabled
|
||||||
-D platforms=x11,wayland
|
-D platforms=x11,wayland
|
||||||
-D osmesa=false
|
|
||||||
GALLIUM_ST: >
|
GALLIUM_ST: >
|
||||||
-D gallium-vdpau=disabled
|
-D gallium-vdpau=disabled
|
||||||
-D gallium-va=disabled
|
-D gallium-va=disabled
|
||||||
|
|
@ -677,7 +673,6 @@ debian-clang:
|
||||||
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental,nouveau
|
VULKAN_DRIVERS: intel,amd,freedreno,broadcom,virtio,swrast,panfrost,imagination-experimental,microsoft-experimental,nouveau
|
||||||
EXTRA_OPTION:
|
EXTRA_OPTION:
|
||||||
-D spirv-to-dxil=true
|
-D spirv-to-dxil=true
|
||||||
-D osmesa=true
|
|
||||||
-D imagination-srv=true
|
-D imagination-srv=true
|
||||||
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi,imagination
|
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi,imagination
|
||||||
-D vulkan-layers=device-select,overlay
|
-D vulkan-layers=device-select,overlay
|
||||||
|
|
@ -743,7 +738,6 @@ debian-vulkan:
|
||||||
-D gles2=disabled
|
-D gles2=disabled
|
||||||
-D glvnd=disabled
|
-D glvnd=disabled
|
||||||
-D platforms=x11,wayland
|
-D platforms=x11,wayland
|
||||||
-D osmesa=false
|
|
||||||
GALLIUM_ST: >
|
GALLIUM_ST: >
|
||||||
-D gallium-vdpau=disabled
|
-D gallium-vdpau=disabled
|
||||||
-D gallium-va=disabled
|
-D gallium-va=disabled
|
||||||
|
|
|
||||||
|
|
@ -74,9 +74,6 @@ def gen_vs_module_def(in_file: str, out_file: str, compiler_abi: str, compiler_i
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.def --compiler_abi gcc --cpu_family x86_64
|
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.def --compiler_abi gcc --cpu_family x86_64
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.mingw.def --compiler_abi gcc --cpu_family x86
|
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/libgl-gdi/opengl32.def.in --out_file src/gallium/targets/libgl-gdi/opengl32.mingw.def --compiler_abi gcc --cpu_family x86
|
||||||
|
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/osmesa/osmesa.def.in --out_file src/gallium/targets/osmesa/osmesa.def --compiler_abi gcc --cpu_family x86_64
|
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/osmesa/osmesa.def.in --out_file src/gallium/targets/osmesa/osmesa.mingw.def --compiler_abi gcc --cpu_family x86
|
|
||||||
|
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.def --compiler_abi gcc --cpu_family x86_64
|
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.def --compiler_abi gcc --cpu_family x86_64
|
||||||
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.mingw.def --compiler_abi gcc --cpu_family x86
|
python ./bin/gen_vs_module_defs.py --in_file src/gallium/targets/wgl/gallium_wgl.def.in --out_file src/gallium/targets/wgl/gallium_wgl.mingw.def --compiler_abi gcc --cpu_family x86
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -124,7 +124,6 @@ SOURCES = [
|
||||||
Source('include/GL/glx.h', None), # FIXME: I don't know what the canonical source is
|
Source('include/GL/glx.h', None), # FIXME: I don't know what the canonical source is
|
||||||
Source('include/GL/internal/', None),
|
Source('include/GL/internal/', None),
|
||||||
Source('include/GL/mesa_glinterop.h', None),
|
Source('include/GL/mesa_glinterop.h', None),
|
||||||
Source('include/GL/osmesa.h', None),
|
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -167,8 +167,6 @@ Basically you'll want the following:
|
||||||
the OpenGL extensions header
|
the OpenGL extensions header
|
||||||
``/usr/include/GL/glxext.h``
|
``/usr/include/GL/glxext.h``
|
||||||
the OpenGL GLX extensions header
|
the OpenGL GLX extensions header
|
||||||
``/usr/include/GL/osmesa.h``
|
|
||||||
the Mesa off-screen rendering header
|
|
||||||
``/usr/lib/libGL.so``
|
``/usr/lib/libGL.so``
|
||||||
a symlink to ``libGL.so.1``
|
a symlink to ``libGL.so.1``
|
||||||
``/usr/lib/libGL.so.1``
|
``/usr/lib/libGL.so.1``
|
||||||
|
|
|
||||||
|
|
@ -66,7 +66,6 @@ Linux, FreeBSD, and other operating systems.
|
||||||
egl
|
egl
|
||||||
opengles
|
opengles
|
||||||
envvars
|
envvars
|
||||||
osmesa
|
|
||||||
debugging
|
debugging
|
||||||
perf
|
perf
|
||||||
gpu-perf-tracing
|
gpu-perf-tracing
|
||||||
|
|
|
||||||
|
|
@ -217,12 +217,8 @@ this:
|
||||||
lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
|
lrwxrwxrwx 1 brian users 10 Mar 26 07:53 libGL.so -> libGL.so.1*
|
||||||
lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
|
lrwxrwxrwx 1 brian users 19 Mar 26 07:53 libGL.so.1 -> libGL.so.1.5.060100*
|
||||||
-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
|
-rwxr-xr-x 1 brian users 3375861 Mar 26 07:53 libGL.so.1.5.060100*
|
||||||
lrwxrwxrwx 1 brian users 14 Mar 26 07:53 libOSMesa.so -> libOSMesa.so.6*
|
|
||||||
lrwxrwxrwx 1 brian users 23 Mar 26 07:53 libOSMesa.so.6 -> libOSMesa.so.6.1.060100*
|
|
||||||
-rwxr-xr-x 1 brian users 23871 Mar 26 07:53 libOSMesa.so.6.1.060100*
|
|
||||||
|
|
||||||
**libGL** is the main OpenGL library (i.e. Mesa), while **libOSMesa** is
|
**libGL** is the main OpenGL library (i.e. Mesa).
|
||||||
the OSMesa (Off-Screen) interface library.
|
|
||||||
|
|
||||||
If you built the DRI hardware drivers, you'll also see the DRI drivers:
|
If you built the DRI hardware drivers, you'll also see the DRI drivers:
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,4 @@ Mesa's default builds with the Apple GLX uses Mesa as a front for the
|
||||||
hardware-accelerated system OpenGL framework, to provide hardware acceleration
|
hardware-accelerated system OpenGL framework, to provide hardware acceleration
|
||||||
to X11 applications on macOS running via XQuartz.
|
to X11 applications on macOS running via XQuartz.
|
||||||
|
|
||||||
Mesa's software rasterizers also work on macOS. To build, set the build options
|
|
||||||
``-Dosmesa=true -Dglx=xlib``.
|
|
||||||
|
|
||||||
Mesa's Gallium drivers can be used on macOS by using the ``-Dgallium-drivers=<drivers>`` build option. Do not use with the previous software rasterizers options, instead add ``swrast`` to the ``<drivers>`` list. Only software renderers and drivers that forward to other APIs can work, any linux hardware drivers will not work. For details on each driver's macOS support see their specific documentation.
|
Mesa's Gallium drivers can be used on macOS by using the ``-Dgallium-drivers=<drivers>`` build option. Do not use with the previous software rasterizers options, instead add ``swrast`` to the ``<drivers>`` list. Only software renderers and drivers that forward to other APIs can work, any linux hardware drivers will not work. For details on each driver's macOS support see their specific documentation.
|
||||||
|
|
|
||||||
|
|
@ -1,43 +0,0 @@
|
||||||
Off-screen Rendering
|
|
||||||
====================
|
|
||||||
|
|
||||||
Mesa's off-screen interface is used for rendering into user-allocated
|
|
||||||
memory without any sort of window system or operating system
|
|
||||||
dependencies. That is, the GL_FRONT colorbuffer is actually a buffer in
|
|
||||||
main memory, rather than a window on your display.
|
|
||||||
|
|
||||||
The OSMesa API provides three basic functions for making off-screen
|
|
||||||
renderings: OSMesaCreateContext(), OSMesaMakeCurrent(), and
|
|
||||||
OSMesaDestroyContext(). See the Mesa/include/GL/osmesa.h header for more
|
|
||||||
information about the API functions.
|
|
||||||
|
|
||||||
The OSMesa interface may be used with the gallium software renderers:
|
|
||||||
|
|
||||||
#. LLVMpipe - this is the high-performance Gallium LLVM driver
|
|
||||||
#. Softpipe - this is the reference Gallium software driver
|
|
||||||
|
|
||||||
There are several examples of OSMesa in the mesa/demos repository.
|
|
||||||
|
|
||||||
Building OSMesa
|
|
||||||
---------------
|
|
||||||
|
|
||||||
Configure and build Mesa with something like:
|
|
||||||
|
|
||||||
.. code-block:: sh
|
|
||||||
|
|
||||||
meson setup builddir -Dosmesa=true -Dgallium-drivers=swrast -Dvulkan-drivers=[] -Dprefix=$PWD/builddir/install
|
|
||||||
meson install -C builddir
|
|
||||||
|
|
||||||
Make sure you have LLVM installed first if you want to use the LLVMpipe
|
|
||||||
driver.
|
|
||||||
|
|
||||||
When the build is complete you should find:
|
|
||||||
|
|
||||||
::
|
|
||||||
|
|
||||||
$PWD/builddir/install/lib/libOSMesa.so
|
|
||||||
|
|
||||||
Set your LD_LIBRARY_PATH to point to $PWD/builddir/install to use the
|
|
||||||
libraries
|
|
||||||
|
|
||||||
When you link your application, link with -lOSMesa
|
|
||||||
|
|
@ -139,7 +139,6 @@ each directory.
|
||||||
- **hgl** - Haiku OpenGL
|
- **hgl** - Haiku OpenGL
|
||||||
- **lavapipe** - Vulkan frontend, software Vulkan rasterizer using LLVMpipe.
|
- **lavapipe** - Vulkan frontend, software Vulkan rasterizer using LLVMpipe.
|
||||||
- **nine** - D3D9 frontend, see targets/d3dadapter9
|
- **nine** - D3D9 frontend, see targets/d3dadapter9
|
||||||
- **osmesa** - Off-screen OpenGL rendering library
|
|
||||||
- **va** - VA-API frontend
|
- **va** - VA-API frontend
|
||||||
- **vdpau** - VDPAU frontend
|
- **vdpau** - VDPAU frontend
|
||||||
- **wgl** - Windows WGL frontend
|
- **wgl** - Windows WGL frontend
|
||||||
|
|
|
||||||
|
|
@ -1,332 +0,0 @@
|
||||||
/*
|
|
||||||
* Mesa 3-D graphics library
|
|
||||||
*
|
|
||||||
* Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
|
||||||
* to deal in the Software without restriction, including without limitation
|
|
||||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
* and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
* Software is furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included
|
|
||||||
* in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Mesa Off-Screen rendering interface.
|
|
||||||
*
|
|
||||||
* This is an operating system and window system independent interface to
|
|
||||||
* Mesa which allows one to render images into a client-supplied buffer in
|
|
||||||
* main memory. Such images may manipulated or saved in whatever way the
|
|
||||||
* client wants.
|
|
||||||
*
|
|
||||||
* These are the API functions:
|
|
||||||
* OSMesaCreateContext - create a new Off-Screen Mesa rendering context
|
|
||||||
* OSMesaMakeCurrent - bind an OSMesaContext to a client's image buffer
|
|
||||||
* and make the specified context the current one.
|
|
||||||
* OSMesaDestroyContext - destroy an OSMesaContext
|
|
||||||
* OSMesaGetCurrentContext - return thread's current context ID
|
|
||||||
* OSMesaPixelStore - controls how pixels are stored in image buffer
|
|
||||||
* OSMesaGetIntegerv - return OSMesa state parameters
|
|
||||||
*
|
|
||||||
*
|
|
||||||
* The limits on the width and height of an image buffer can be retrieved
|
|
||||||
* via OSMesaGetIntegerv(OSMESA_MAX_WIDTH/OSMESA_MAX_HEIGHT).
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#ifndef OSMESA_H
|
|
||||||
#define OSMESA_H
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#include <GL/gl.h>
|
|
||||||
|
|
||||||
|
|
||||||
#define OSMESA_MAJOR_VERSION 11
|
|
||||||
#define OSMESA_MINOR_VERSION 2
|
|
||||||
#define OSMESA_PATCH_VERSION 0
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Values for the format parameter of OSMesaCreateContext()
|
|
||||||
* New in version 2.0.
|
|
||||||
*/
|
|
||||||
#define OSMESA_COLOR_INDEX GL_COLOR_INDEX
|
|
||||||
#define OSMESA_RGBA GL_RGBA
|
|
||||||
#define OSMESA_BGRA 0x1
|
|
||||||
#define OSMESA_ARGB 0x2
|
|
||||||
#define OSMESA_RGB GL_RGB
|
|
||||||
#define OSMESA_BGR 0x4
|
|
||||||
#define OSMESA_RGB_565 0x5
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* OSMesaPixelStore() parameters:
|
|
||||||
* New in version 2.0.
|
|
||||||
*/
|
|
||||||
#define OSMESA_ROW_LENGTH 0x10
|
|
||||||
#define OSMESA_Y_UP 0x11
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Accepted by OSMesaGetIntegerv:
|
|
||||||
*/
|
|
||||||
#define OSMESA_WIDTH 0x20
|
|
||||||
#define OSMESA_HEIGHT 0x21
|
|
||||||
#define OSMESA_FORMAT 0x22
|
|
||||||
#define OSMESA_TYPE 0x23
|
|
||||||
#define OSMESA_MAX_WIDTH 0x24 /* new in 4.0 */
|
|
||||||
#define OSMESA_MAX_HEIGHT 0x25 /* new in 4.0 */
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Accepted in OSMesaCreateContextAttrib's attribute list.
|
|
||||||
*/
|
|
||||||
#define OSMESA_DEPTH_BITS 0x30
|
|
||||||
#define OSMESA_STENCIL_BITS 0x31
|
|
||||||
#define OSMESA_ACCUM_BITS 0x32
|
|
||||||
#define OSMESA_PROFILE 0x33
|
|
||||||
#define OSMESA_CORE_PROFILE 0x34
|
|
||||||
#define OSMESA_COMPAT_PROFILE 0x35
|
|
||||||
#define OSMESA_CONTEXT_MAJOR_VERSION 0x36
|
|
||||||
#define OSMESA_CONTEXT_MINOR_VERSION 0x37
|
|
||||||
|
|
||||||
|
|
||||||
typedef struct osmesa_context *OSMesaContext;
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Create an Off-Screen Mesa rendering context. The only attribute needed is
|
|
||||||
* an RGBA vs Color-Index mode flag.
|
|
||||||
*
|
|
||||||
* Input: format - one of OSMESA_COLOR_INDEX, OSMESA_RGBA, OSMESA_BGRA,
|
|
||||||
* OSMESA_ARGB, OSMESA_RGB, or OSMESA_BGR.
|
|
||||||
* sharelist - specifies another OSMesaContext with which to share
|
|
||||||
* display lists. NULL indicates no sharing.
|
|
||||||
* Return: an OSMesaContext or 0 if error
|
|
||||||
*/
|
|
||||||
GLAPI OSMesaContext APIENTRY
|
|
||||||
OSMesaCreateContext( GLenum format, OSMesaContext sharelist );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Create an Off-Screen Mesa rendering context and specify desired
|
|
||||||
* size of depth buffer, stencil buffer and accumulation buffer.
|
|
||||||
* If you specify zero for depthBits, stencilBits, accumBits you
|
|
||||||
* can save some memory.
|
|
||||||
*
|
|
||||||
* New in Mesa 3.5
|
|
||||||
*/
|
|
||||||
GLAPI OSMesaContext APIENTRY
|
|
||||||
OSMesaCreateContextExt( GLenum format, GLint depthBits, GLint stencilBits,
|
|
||||||
GLint accumBits, OSMesaContext sharelist);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Create an Off-Screen Mesa rendering context with attribute list.
|
|
||||||
* The list is composed of (attribute, value) pairs and terminated with
|
|
||||||
* attribute==0. Supported Attributes:
|
|
||||||
*
|
|
||||||
* Attributes Values
|
|
||||||
* --------------------------------------------------------------------------
|
|
||||||
* OSMESA_FORMAT OSMESA_RGBA*, OSMESA_BGRA, OSMESA_ARGB, etc.
|
|
||||||
* OSMESA_DEPTH_BITS 0*, 16, 24, 32
|
|
||||||
* OSMESA_STENCIL_BITS 0*, 8
|
|
||||||
* OSMESA_ACCUM_BITS 0*, 16
|
|
||||||
* OSMESA_PROFILE OSMESA_COMPAT_PROFILE*, OSMESA_CORE_PROFILE
|
|
||||||
* OSMESA_CONTEXT_MAJOR_VERSION 1*, 2, 3
|
|
||||||
* OSMESA_CONTEXT_MINOR_VERSION 0+
|
|
||||||
*
|
|
||||||
* Note: * = default value
|
|
||||||
*
|
|
||||||
* We return a context version >= what's specified by OSMESA_CONTEXT_MAJOR/
|
|
||||||
* MINOR_VERSION for the given profile. For example, if you request a GL 1.4
|
|
||||||
* compat profile, you might get a GL 3.0 compat profile.
|
|
||||||
* Otherwise, null is returned if the version/profile is not supported.
|
|
||||||
*
|
|
||||||
* New in Mesa 11.2
|
|
||||||
*/
|
|
||||||
GLAPI OSMesaContext APIENTRY
|
|
||||||
OSMesaCreateContextAttribs( const int *attribList, OSMesaContext sharelist );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Destroy an Off-Screen Mesa rendering context.
|
|
||||||
*
|
|
||||||
* Input: ctx - the context to destroy
|
|
||||||
*/
|
|
||||||
GLAPI void APIENTRY
|
|
||||||
OSMesaDestroyContext( OSMesaContext ctx );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Bind an OSMesaContext to an image buffer. The image buffer is just a
|
|
||||||
* block of memory which the client provides. Its size must be at least
|
|
||||||
* as large as width*height*sizeof(type). Its address should be a multiple
|
|
||||||
* of 4 if using RGBA mode.
|
|
||||||
*
|
|
||||||
* Image data is stored in the order of glDrawPixels: row-major order
|
|
||||||
* with the lower-left image pixel stored in the first array position
|
|
||||||
* (ie. bottom-to-top).
|
|
||||||
*
|
|
||||||
* Since the only type initially supported is GL_UNSIGNED_BYTE, if the
|
|
||||||
* context is in RGBA mode, each pixel will be stored as a 4-byte RGBA
|
|
||||||
* value. If the context is in color indexed mode, each pixel will be
|
|
||||||
* stored as a 1-byte value.
|
|
||||||
*
|
|
||||||
* If the context's viewport hasn't been initialized yet, it will now be
|
|
||||||
* initialized to (0,0,width,height).
|
|
||||||
*
|
|
||||||
* Input: ctx - the rendering context
|
|
||||||
* buffer - the image buffer memory
|
|
||||||
* type - data type for pixel components, only GL_UNSIGNED_BYTE
|
|
||||||
* supported now
|
|
||||||
* width, height - size of image buffer in pixels, at least 1
|
|
||||||
* Return: GL_TRUE if success, GL_FALSE if error because of invalid ctx,
|
|
||||||
* invalid buffer address, type!=GL_UNSIGNED_BYTE, width<1, height<1,
|
|
||||||
* width>internal limit or height>internal limit.
|
|
||||||
*/
|
|
||||||
GLAPI GLboolean APIENTRY
|
|
||||||
OSMesaMakeCurrent( OSMesaContext ctx, void *buffer, GLenum type,
|
|
||||||
GLsizei width, GLsizei height );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the current Off-Screen Mesa rendering context handle.
|
|
||||||
*/
|
|
||||||
GLAPI OSMesaContext APIENTRY
|
|
||||||
OSMesaGetCurrentContext( void );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Set pixel store/packing parameters for the current context.
|
|
||||||
* This is similar to glPixelStore.
|
|
||||||
* Input: pname - OSMESA_ROW_LENGTH
|
|
||||||
* specify actual pixels per row in image buffer
|
|
||||||
* 0 = same as image width (default)
|
|
||||||
* OSMESA_Y_UP
|
|
||||||
* zero = Y coordinates increase downward
|
|
||||||
* non-zero = Y coordinates increase upward (default)
|
|
||||||
* value - the value for the parameter pname
|
|
||||||
*
|
|
||||||
* New in version 2.0.
|
|
||||||
*/
|
|
||||||
GLAPI void APIENTRY
|
|
||||||
OSMesaPixelStore( GLint pname, GLint value );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return an integer value like glGetIntegerv.
|
|
||||||
* Input: pname -
|
|
||||||
* OSMESA_WIDTH return current image width
|
|
||||||
* OSMESA_HEIGHT return current image height
|
|
||||||
* OSMESA_FORMAT return image format
|
|
||||||
* OSMESA_TYPE return color component data type
|
|
||||||
* OSMESA_ROW_LENGTH return row length in pixels
|
|
||||||
* OSMESA_Y_UP returns 1 or 0 to indicate Y axis direction
|
|
||||||
* value - pointer to integer in which to return result.
|
|
||||||
*/
|
|
||||||
GLAPI void APIENTRY
|
|
||||||
OSMesaGetIntegerv( GLint pname, GLint *value );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the depth buffer associated with an OSMesa context.
|
|
||||||
* Input: c - the OSMesa context
|
|
||||||
* Output: width, height - size of buffer in pixels
|
|
||||||
* bytesPerValue - bytes per depth value (2 or 4)
|
|
||||||
* buffer - pointer to depth buffer values
|
|
||||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
|
||||||
*
|
|
||||||
* New in Mesa 2.4.
|
|
||||||
*/
|
|
||||||
GLAPI GLboolean APIENTRY
|
|
||||||
OSMesaGetDepthBuffer( OSMesaContext c, GLint *width, GLint *height,
|
|
||||||
GLint *bytesPerValue, void **buffer );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return the color buffer associated with an OSMesa context.
|
|
||||||
* Input: c - the OSMesa context
|
|
||||||
* Output: width, height - size of buffer in pixels
|
|
||||||
* format - buffer format (OSMESA_FORMAT)
|
|
||||||
* buffer - pointer to depth buffer values
|
|
||||||
* Return: GL_TRUE or GL_FALSE to indicate success or failure.
|
|
||||||
*
|
|
||||||
* New in Mesa 3.3.
|
|
||||||
*/
|
|
||||||
GLAPI GLboolean APIENTRY
|
|
||||||
OSMesaGetColorBuffer( OSMesaContext c, GLint *width, GLint *height,
|
|
||||||
GLint *format, void **buffer );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* This typedef is new in Mesa 6.3.
|
|
||||||
*/
|
|
||||||
typedef void (*OSMESAproc)();
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
* Return pointer to the named function.
|
|
||||||
* New in Mesa 4.1
|
|
||||||
* Return OSMESAproc in 6.3.
|
|
||||||
*/
|
|
||||||
GLAPI OSMESAproc APIENTRY
|
|
||||||
OSMesaGetProcAddress( const char *funcName );
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable/disable color clamping, off by default.
|
|
||||||
* New in Mesa 6.4.2
|
|
||||||
*/
|
|
||||||
GLAPI void APIENTRY
|
|
||||||
OSMesaColorClamp(GLboolean enable);
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enable/disable Gallium post-process filters.
|
|
||||||
* This should be called after a context is created, but before it is
|
|
||||||
* made current for the first time. After a context has been made
|
|
||||||
* current, this function has no effect.
|
|
||||||
* If the enable_value param is zero, the filter is disabled. Otherwise
|
|
||||||
* the filter is enabled, and the value may control the filter's quality.
|
|
||||||
* New in Mesa 10.0
|
|
||||||
*/
|
|
||||||
GLAPI void APIENTRY
|
|
||||||
OSMesaPostprocess(OSMesaContext osmesa, const char *filter,
|
|
||||||
unsigned enable_value);
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef __cplusplus
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
@ -79,10 +79,6 @@ if with_egl
|
||||||
)
|
)
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_osmesa
|
|
||||||
install_headers('GL/osmesa.h', subdir : 'GL')
|
|
||||||
endif
|
|
||||||
|
|
||||||
if with_dri
|
if with_dri
|
||||||
install_headers('GL/internal/dri_interface.h', subdir : 'GL/internal')
|
install_headers('GL/internal/dri_interface.h', subdir : 'GL/internal')
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
13
meson.build
13
meson.build
|
|
@ -67,7 +67,6 @@ with_glcpp_tests = get_option('enable-glcpp-tests')
|
||||||
with_aco_tests = get_option('build-aco-tests')
|
with_aco_tests = get_option('build-aco-tests')
|
||||||
with_glx_read_only_text = get_option('glx-read-only-text')
|
with_glx_read_only_text = get_option('glx-read-only-text')
|
||||||
with_glx_direct = get_option('glx-direct')
|
with_glx_direct = get_option('glx-direct')
|
||||||
with_osmesa = get_option('osmesa')
|
|
||||||
with_vulkan_overlay_layer = get_option('vulkan-layers').contains('overlay')
|
with_vulkan_overlay_layer = get_option('vulkan-layers').contains('overlay')
|
||||||
with_vulkan_device_select_layer = get_option('vulkan-layers').contains('device-select')
|
with_vulkan_device_select_layer = get_option('vulkan-layers').contains('device-select')
|
||||||
with_vulkan_screenshot_layer = get_option('vulkan-layers').contains('screenshot')
|
with_vulkan_screenshot_layer = get_option('vulkan-layers').contains('screenshot')
|
||||||
|
|
@ -2043,17 +2042,6 @@ if dep_unwind.found()
|
||||||
pre_args += '-DHAVE_LIBUNWIND'
|
pre_args += '-DHAVE_LIBUNWIND'
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if with_osmesa
|
|
||||||
if not with_gallium_swrast
|
|
||||||
error('OSMesa gallium requires gallium softpipe or llvmpipe.')
|
|
||||||
endif
|
|
||||||
if host_machine.system() == 'windows'
|
|
||||||
osmesa_lib_name = 'osmesa'
|
|
||||||
else
|
|
||||||
osmesa_lib_name = 'OSMesa'
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
# TODO: symbol mangling
|
# TODO: symbol mangling
|
||||||
|
|
||||||
if with_platform_wayland
|
if with_platform_wayland
|
||||||
|
|
@ -2456,7 +2444,6 @@ if with_gallium
|
||||||
gallium_frontends += 'rusticl'
|
gallium_frontends += 'rusticl'
|
||||||
endif
|
endif
|
||||||
gallium_summary += {'Frontends': gallium_frontends}
|
gallium_summary += {'Frontends': gallium_frontends}
|
||||||
gallium_summary += {'Off-screen rendering (OSMesa)': with_osmesa ? 'lib' + osmesa_lib_name : false}
|
|
||||||
gallium_summary += {'HUD lm-sensors': dep_lmsensors.found()}
|
gallium_summary += {'HUD lm-sensors': dep_lmsensors.found()}
|
||||||
endif
|
endif
|
||||||
summary(gallium_summary, section: 'Gallium', bool_yn: true, list_sep: ' ')
|
summary(gallium_summary, section: 'Gallium', bool_yn: true, list_sep: ' ')
|
||||||
|
|
|
||||||
|
|
@ -513,7 +513,8 @@ option(
|
||||||
'osmesa',
|
'osmesa',
|
||||||
type : 'boolean',
|
type : 'boolean',
|
||||||
value : false,
|
value : false,
|
||||||
description : 'Build OSmesa.'
|
deprecated : true,
|
||||||
|
description : 'Does nothing, left here for a while to avoid build breakages.',
|
||||||
)
|
)
|
||||||
|
|
||||||
option(
|
option(
|
||||||
|
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
# Copyright © 2017-2018 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
osmesa_st_c_args = []
|
|
||||||
if with_platform_windows
|
|
||||||
if not with_shared_glapi
|
|
||||||
osmesa_st_c_args += ['-D_GLAPI_NO_EXPORTS']
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
libosmesa_st = static_library(
|
|
||||||
'osmesa_st',
|
|
||||||
'osmesa.c',
|
|
||||||
c_args : osmesa_st_c_args,
|
|
||||||
include_directories : [
|
|
||||||
inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_mapi, inc_mesa,
|
|
||||||
],
|
|
||||||
dependencies : [idep_mesautil],
|
|
||||||
)
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -229,10 +229,6 @@ if with_dri
|
||||||
subdir('frontends/dri')
|
subdir('frontends/dri')
|
||||||
subdir('targets/dri')
|
subdir('targets/dri')
|
||||||
endif
|
endif
|
||||||
if with_osmesa
|
|
||||||
subdir('frontends/osmesa')
|
|
||||||
subdir('targets/osmesa')
|
|
||||||
endif
|
|
||||||
if with_gallium_xa
|
if with_gallium_xa
|
||||||
subdir('frontends/xa')
|
subdir('frontends/xa')
|
||||||
subdir('targets/xa')
|
subdir('targets/xa')
|
||||||
|
|
|
||||||
|
|
@ -1,82 +0,0 @@
|
||||||
# Copyright © 2017 Intel Corporation
|
|
||||||
# SPDX-License-Identifier: MIT
|
|
||||||
|
|
||||||
osmesa_link_with = []
|
|
||||||
osmesa_link_args = []
|
|
||||||
osmesa_link_deps = []
|
|
||||||
|
|
||||||
if with_shared_glapi
|
|
||||||
osmesa_link_with += libglapi
|
|
||||||
endif
|
|
||||||
if with_ld_version_script
|
|
||||||
osmesa_link_args += [
|
|
||||||
'-Wl,--version-script', join_paths(meson.current_source_dir(), 'osmesa.sym')
|
|
||||||
]
|
|
||||||
osmesa_link_deps += files('osmesa.sym')
|
|
||||||
endif
|
|
||||||
|
|
||||||
osmesa_def = custom_target(
|
|
||||||
'osmesa.def',
|
|
||||||
input: 'osmesa.def.in',
|
|
||||||
output : 'osmesa.def',
|
|
||||||
command : gen_vs_module_defs_normal_command,
|
|
||||||
)
|
|
||||||
|
|
||||||
libosmesa = shared_library(
|
|
||||||
osmesa_lib_name,
|
|
||||||
'osmesa_target.c',
|
|
||||||
gnu_symbol_visibility : 'hidden',
|
|
||||||
link_args : [ld_args_gc_sections, osmesa_link_args],
|
|
||||||
vs_module_defs : osmesa_def,
|
|
||||||
include_directories : [
|
|
||||||
inc_include, inc_src, inc_gallium, inc_gallium_aux, inc_gallium_winsys,
|
|
||||||
inc_gallium_drivers,
|
|
||||||
],
|
|
||||||
link_depends : osmesa_link_deps,
|
|
||||||
link_whole : [libosmesa_st, (with_shared_glapi ? libglapi_bridge : libglapi_static)],
|
|
||||||
link_with : [
|
|
||||||
libmesa, libgallium, libws_null, osmesa_link_with,
|
|
||||||
],
|
|
||||||
dependencies : [
|
|
||||||
dep_ws2_32, dep_thread, dep_clock, dep_unwind, driver_swrast, idep_mesautil,
|
|
||||||
],
|
|
||||||
name_prefix : host_machine.system() == 'windows' ? '' : [], # otherwise mingw will create libosmesa.dll
|
|
||||||
soversion : host_machine.system() == 'windows' ? '' : '8',
|
|
||||||
version : '8.0.0',
|
|
||||||
darwin_versions : '9.0.0',
|
|
||||||
install : true,
|
|
||||||
)
|
|
||||||
|
|
||||||
if with_symbols_check
|
|
||||||
test('osmesa-symbols-check',
|
|
||||||
symbols_check,
|
|
||||||
args : [
|
|
||||||
'--lib', libosmesa,
|
|
||||||
'--symbols-file', files('osmesa-symbols.txt'),
|
|
||||||
symbols_check_args,
|
|
||||||
],
|
|
||||||
suite : ['gallium'],
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
|
|
||||||
pkg.generate(
|
|
||||||
name : 'osmesa',
|
|
||||||
description : 'Mesa Off-screen Rendering Library',
|
|
||||||
version : '8.0.0',
|
|
||||||
libraries : libosmesa,
|
|
||||||
libraries_private : gl_priv_libs,
|
|
||||||
)
|
|
||||||
|
|
||||||
if with_tests
|
|
||||||
test('osmesa-render',
|
|
||||||
executable(
|
|
||||||
'osmesa-render',
|
|
||||||
'test-render.cpp',
|
|
||||||
include_directories : [inc_include, inc_src, inc_mapi, inc_mesa, inc_gallium, inc_gallium_aux],
|
|
||||||
link_with: libosmesa,
|
|
||||||
dependencies : [idep_gtest, idep_mesautil],
|
|
||||||
),
|
|
||||||
suite: 'gallium',
|
|
||||||
protocol : 'gtest',
|
|
||||||
)
|
|
||||||
endif
|
|
||||||
File diff suppressed because it is too large
Load diff
|
|
@ -1,353 +0,0 @@
|
||||||
; Mesa OSMesa lib for Win32
|
|
||||||
|
|
||||||
; stdcall calling convention have @number suffix on 32 bits architecture for gcc
|
|
||||||
OSMesaCreateContext@8
|
|
||||||
OSMesaCreateContextAttribs@8
|
|
||||||
OSMesaCreateContextExt@20
|
|
||||||
OSMesaDestroyContext@4
|
|
||||||
OSMesaMakeCurrent@20
|
|
||||||
OSMesaGetCurrentContext@0
|
|
||||||
OSMesaPixelStore@8
|
|
||||||
OSMesaGetIntegerv@8
|
|
||||||
OSMesaGetDepthBuffer@20
|
|
||||||
OSMesaGetColorBuffer@20
|
|
||||||
OSMesaGetProcAddress@4
|
|
||||||
OSMesaColorClamp@4
|
|
||||||
OSMesaPostprocess@12
|
|
||||||
glAccum@8
|
|
||||||
glAlphaFunc@8
|
|
||||||
glAreTexturesResident@12
|
|
||||||
glArrayElement@4
|
|
||||||
glBegin@4
|
|
||||||
glBindTexture@8
|
|
||||||
glBitmap@28
|
|
||||||
glBlendFunc@8
|
|
||||||
glCallList@4
|
|
||||||
glCallLists@12
|
|
||||||
glClear@4
|
|
||||||
glClearAccum@16
|
|
||||||
glClearColor@16
|
|
||||||
glClearDepth@8
|
|
||||||
glClearIndex@4
|
|
||||||
glClearStencil@4
|
|
||||||
glClipPlane@8
|
|
||||||
glColor3b@12
|
|
||||||
glColor3bv@4
|
|
||||||
glColor3d@24
|
|
||||||
glColor3dv@4
|
|
||||||
glColor3f@12
|
|
||||||
glColor3fv@4
|
|
||||||
glColor3i@12
|
|
||||||
glColor3iv@4
|
|
||||||
glColor3s@12
|
|
||||||
glColor3sv@4
|
|
||||||
glColor3ub@12
|
|
||||||
glColor3ubv@4
|
|
||||||
glColor3ui@12
|
|
||||||
glColor3uiv@4
|
|
||||||
glColor3us@12
|
|
||||||
glColor3usv@4
|
|
||||||
glColor4b@16
|
|
||||||
glColor4bv@4
|
|
||||||
glColor4d@32
|
|
||||||
glColor4dv@4
|
|
||||||
glColor4f@16
|
|
||||||
glColor4fv@4
|
|
||||||
glColor4i@16
|
|
||||||
glColor4iv@4
|
|
||||||
glColor4s@16
|
|
||||||
glColor4sv@4
|
|
||||||
glColor4ub@16
|
|
||||||
glColor4ubv@4
|
|
||||||
glColor4ui@16
|
|
||||||
glColor4uiv@4
|
|
||||||
glColor4us@16
|
|
||||||
glColor4usv@4
|
|
||||||
glColorMask@16
|
|
||||||
glColorMaterial@8
|
|
||||||
glColorPointer@16
|
|
||||||
glCopyPixels@20
|
|
||||||
glCopyTexImage1D@28
|
|
||||||
glCopyTexImage2D@32
|
|
||||||
glCopyTexSubImage1D@24
|
|
||||||
glCopyTexSubImage2D@32
|
|
||||||
glCullFace@4
|
|
||||||
;glDebugEntry@8
|
|
||||||
glDeleteLists@8
|
|
||||||
glDeleteTextures@8
|
|
||||||
glDepthFunc@4
|
|
||||||
glDepthMask@4
|
|
||||||
glDepthRange@16
|
|
||||||
glDisable@4
|
|
||||||
glDisableClientState@4
|
|
||||||
glDrawArrays@12
|
|
||||||
glDrawBuffer@4
|
|
||||||
glDrawElements@16
|
|
||||||
glDrawPixels@20
|
|
||||||
glEdgeFlag@4
|
|
||||||
glEdgeFlagPointer@8
|
|
||||||
glEdgeFlagv@4
|
|
||||||
glEnable@4
|
|
||||||
glEnableClientState@4
|
|
||||||
glEnd@0
|
|
||||||
glEndList@0
|
|
||||||
glEvalCoord1d@8
|
|
||||||
glEvalCoord1dv@4
|
|
||||||
glEvalCoord1f@4
|
|
||||||
glEvalCoord1fv@4
|
|
||||||
glEvalCoord2d@16
|
|
||||||
glEvalCoord2dv@4
|
|
||||||
glEvalCoord2f@8
|
|
||||||
glEvalCoord2fv@4
|
|
||||||
glEvalMesh1@12
|
|
||||||
glEvalMesh2@20
|
|
||||||
glEvalPoint1@4
|
|
||||||
glEvalPoint2@8
|
|
||||||
glFeedbackBuffer@12
|
|
||||||
glFinish@0
|
|
||||||
glFlush@0
|
|
||||||
glFogf@8
|
|
||||||
glFogfv@8
|
|
||||||
glFogi@8
|
|
||||||
glFogiv@8
|
|
||||||
glFrontFace@4
|
|
||||||
glFrustum@48
|
|
||||||
glGenLists@4
|
|
||||||
glGenTextures@8
|
|
||||||
glGetBooleanv@8
|
|
||||||
glGetClipPlane@8
|
|
||||||
glGetDoublev@8
|
|
||||||
glGetError@0
|
|
||||||
glGetFloatv@8
|
|
||||||
glGetIntegerv@8
|
|
||||||
glGetLightfv@12
|
|
||||||
glGetLightiv@12
|
|
||||||
glGetMapdv@12
|
|
||||||
glGetMapfv@12
|
|
||||||
glGetMapiv@12
|
|
||||||
glGetMaterialfv@12
|
|
||||||
glGetMaterialiv@12
|
|
||||||
glGetPixelMapfv@8
|
|
||||||
glGetPixelMapuiv@8
|
|
||||||
glGetPixelMapusv@8
|
|
||||||
glGetPointerv@8
|
|
||||||
glGetPolygonStipple@4
|
|
||||||
glGetString@4
|
|
||||||
glGetTexEnvfv@12
|
|
||||||
glGetTexEnviv@12
|
|
||||||
glGetTexGendv@12
|
|
||||||
glGetTexGenfv@12
|
|
||||||
glGetTexGeniv@12
|
|
||||||
glGetTexImage@20
|
|
||||||
glGetTexLevelParameterfv@16
|
|
||||||
glGetTexLevelParameteriv@16
|
|
||||||
glGetTexParameterfv@12
|
|
||||||
glGetTexParameteriv@12
|
|
||||||
glHint@8
|
|
||||||
glIndexMask@4
|
|
||||||
glIndexPointer@12
|
|
||||||
glIndexd@8
|
|
||||||
glIndexdv@4
|
|
||||||
glIndexf@4
|
|
||||||
glIndexfv@4
|
|
||||||
glIndexi@4
|
|
||||||
glIndexiv@4
|
|
||||||
glIndexs@4
|
|
||||||
glIndexsv@4
|
|
||||||
glIndexub@4
|
|
||||||
glIndexubv@4
|
|
||||||
glInitNames@0
|
|
||||||
glInterleavedArrays@12
|
|
||||||
glIsEnabled@4
|
|
||||||
glIsList@4
|
|
||||||
glIsTexture@4
|
|
||||||
glLightModelf@8
|
|
||||||
glLightModelfv@8
|
|
||||||
glLightModeli@8
|
|
||||||
glLightModeliv@8
|
|
||||||
glLightf@12
|
|
||||||
glLightfv@12
|
|
||||||
glLighti@12
|
|
||||||
glLightiv@12
|
|
||||||
glLineStipple@8
|
|
||||||
glLineWidth@4
|
|
||||||
glListBase@4
|
|
||||||
glLoadIdentity@0
|
|
||||||
glLoadMatrixd@4
|
|
||||||
glLoadMatrixf@4
|
|
||||||
glLoadName@4
|
|
||||||
glLogicOp@4
|
|
||||||
glMap1d@32
|
|
||||||
glMap1f@24
|
|
||||||
glMap2d@56
|
|
||||||
glMap2f@40
|
|
||||||
glMapGrid1d@20
|
|
||||||
glMapGrid1f@12
|
|
||||||
glMapGrid2d@40
|
|
||||||
glMapGrid2f@24
|
|
||||||
glMaterialf@12
|
|
||||||
glMaterialfv@12
|
|
||||||
glMateriali@12
|
|
||||||
glMaterialiv@12
|
|
||||||
glMatrixMode@4
|
|
||||||
glMultMatrixd@4
|
|
||||||
glMultMatrixf@4
|
|
||||||
glNewList@8
|
|
||||||
glNormal3b@12
|
|
||||||
glNormal3bv@4
|
|
||||||
glNormal3d@24
|
|
||||||
glNormal3dv@4
|
|
||||||
glNormal3f@12
|
|
||||||
glNormal3fv@4
|
|
||||||
glNormal3i@12
|
|
||||||
glNormal3iv@4
|
|
||||||
glNormal3s@12
|
|
||||||
glNormal3sv@4
|
|
||||||
glNormalPointer@12
|
|
||||||
glOrtho@48
|
|
||||||
glPassThrough@4
|
|
||||||
glPixelMapfv@12
|
|
||||||
glPixelMapuiv@12
|
|
||||||
glPixelMapusv@12
|
|
||||||
glPixelStoref@8
|
|
||||||
glPixelStorei@8
|
|
||||||
glPixelTransferf@8
|
|
||||||
glPixelTransferi@8
|
|
||||||
glPixelZoom@8
|
|
||||||
glPointSize@4
|
|
||||||
glPolygonMode@8
|
|
||||||
glPolygonOffset@8
|
|
||||||
glPolygonStipple@4
|
|
||||||
glPopAttrib@0
|
|
||||||
glPopClientAttrib@0
|
|
||||||
glPopMatrix@0
|
|
||||||
glPopName@0
|
|
||||||
glPrioritizeTextures@12
|
|
||||||
glPushAttrib@4
|
|
||||||
glPushClientAttrib@4
|
|
||||||
glPushMatrix@0
|
|
||||||
glPushName@4
|
|
||||||
glRasterPos2d@16
|
|
||||||
glRasterPos2dv@4
|
|
||||||
glRasterPos2f@8
|
|
||||||
glRasterPos2fv@4
|
|
||||||
glRasterPos2i@8
|
|
||||||
glRasterPos2iv@4
|
|
||||||
glRasterPos2s@8
|
|
||||||
glRasterPos2sv@4
|
|
||||||
glRasterPos3d@24
|
|
||||||
glRasterPos3dv@4
|
|
||||||
glRasterPos3f@12
|
|
||||||
glRasterPos3fv@4
|
|
||||||
glRasterPos3i@12
|
|
||||||
glRasterPos3iv@4
|
|
||||||
glRasterPos3s@12
|
|
||||||
glRasterPos3sv@4
|
|
||||||
glRasterPos4d@32
|
|
||||||
glRasterPos4dv@4
|
|
||||||
glRasterPos4f@16
|
|
||||||
glRasterPos4fv@4
|
|
||||||
glRasterPos4i@16
|
|
||||||
glRasterPos4iv@4
|
|
||||||
glRasterPos4s@16
|
|
||||||
glRasterPos4sv@4
|
|
||||||
glReadBuffer@4
|
|
||||||
glReadPixels@28
|
|
||||||
glRectd@32
|
|
||||||
glRectdv@8
|
|
||||||
glRectf@16
|
|
||||||
glRectfv@8
|
|
||||||
glRecti@16
|
|
||||||
glRectiv@8
|
|
||||||
glRects@16
|
|
||||||
glRectsv@8
|
|
||||||
glRenderMode@4
|
|
||||||
glRotated@32
|
|
||||||
glRotatef@16
|
|
||||||
glScaled@24
|
|
||||||
glScalef@12
|
|
||||||
glScissor@16
|
|
||||||
glSelectBuffer@8
|
|
||||||
glShadeModel@4
|
|
||||||
glStencilFunc@12
|
|
||||||
glStencilMask@4
|
|
||||||
glStencilOp@12
|
|
||||||
glTexCoord1d@8
|
|
||||||
glTexCoord1dv@4
|
|
||||||
glTexCoord1f@4
|
|
||||||
glTexCoord1fv@4
|
|
||||||
glTexCoord1i@4
|
|
||||||
glTexCoord1iv@4
|
|
||||||
glTexCoord1s@4
|
|
||||||
glTexCoord1sv@4
|
|
||||||
glTexCoord2d@16
|
|
||||||
glTexCoord2dv@4
|
|
||||||
glTexCoord2f@8
|
|
||||||
glTexCoord2fv@4
|
|
||||||
glTexCoord2i@8
|
|
||||||
glTexCoord2iv@4
|
|
||||||
glTexCoord2s@8
|
|
||||||
glTexCoord2sv@4
|
|
||||||
glTexCoord3d@24
|
|
||||||
glTexCoord3dv@4
|
|
||||||
glTexCoord3f@12
|
|
||||||
glTexCoord3fv@4
|
|
||||||
glTexCoord3i@12
|
|
||||||
glTexCoord3iv@4
|
|
||||||
glTexCoord3s@12
|
|
||||||
glTexCoord3sv@4
|
|
||||||
glTexCoord4d@32
|
|
||||||
glTexCoord4dv@4
|
|
||||||
glTexCoord4f@16
|
|
||||||
glTexCoord4fv@4
|
|
||||||
glTexCoord4i@16
|
|
||||||
glTexCoord4iv@4
|
|
||||||
glTexCoord4s@16
|
|
||||||
glTexCoord4sv@4
|
|
||||||
glTexCoordPointer@16
|
|
||||||
glTexEnvf@12
|
|
||||||
glTexEnvfv@12
|
|
||||||
glTexEnvi@12
|
|
||||||
glTexEnviv@12
|
|
||||||
glTexGend@16
|
|
||||||
glTexGendv@12
|
|
||||||
glTexGenf@12
|
|
||||||
glTexGenfv@12
|
|
||||||
glTexGeni@12
|
|
||||||
glTexGeniv@12
|
|
||||||
glTexImage1D@32
|
|
||||||
glTexImage2D@36
|
|
||||||
glTexParameterf@12
|
|
||||||
glTexParameterfv@12
|
|
||||||
glTexParameteri@12
|
|
||||||
glTexParameteriv@12
|
|
||||||
glTexSubImage1D@28
|
|
||||||
glTexSubImage2D@36
|
|
||||||
glTranslated@24
|
|
||||||
glTranslatef@12
|
|
||||||
glVertex2d@16
|
|
||||||
glVertex2dv@4
|
|
||||||
glVertex2f@8
|
|
||||||
glVertex2fv@4
|
|
||||||
glVertex2i@8
|
|
||||||
glVertex2iv@4
|
|
||||||
glVertex2s@8
|
|
||||||
glVertex2sv@4
|
|
||||||
glVertex3d@24
|
|
||||||
glVertex3dv@4
|
|
||||||
glVertex3f@12
|
|
||||||
glVertex3fv@4
|
|
||||||
glVertex3i@12
|
|
||||||
glVertex3iv@4
|
|
||||||
glVertex3s@12
|
|
||||||
glVertex3sv@4
|
|
||||||
glVertex4d@32
|
|
||||||
glVertex4dv@4
|
|
||||||
glVertex4f@16
|
|
||||||
glVertex4fv@4
|
|
||||||
glVertex4i@16
|
|
||||||
glVertex4iv@4
|
|
||||||
glVertex4s@16
|
|
||||||
glVertex4sv@4
|
|
||||||
glVertexPointer@16
|
|
||||||
glViewport@16
|
|
||||||
|
|
@ -1,19 +0,0 @@
|
||||||
{
|
|
||||||
global:
|
|
||||||
OSMesaColorClamp;
|
|
||||||
OSMesaCreateContext;
|
|
||||||
OSMesaCreateContextAttribs;
|
|
||||||
OSMesaCreateContextExt;
|
|
||||||
OSMesaDestroyContext;
|
|
||||||
OSMesaGetColorBuffer;
|
|
||||||
OSMesaGetCurrentContext;
|
|
||||||
OSMesaGetDepthBuffer;
|
|
||||||
OSMesaGetIntegerv;
|
|
||||||
OSMesaGetProcAddress;
|
|
||||||
OSMesaMakeCurrent;
|
|
||||||
OSMesaPixelStore;
|
|
||||||
OSMesaPostprocess;
|
|
||||||
gl*;
|
|
||||||
local:
|
|
||||||
*;
|
|
||||||
};
|
|
||||||
|
|
@ -1,56 +0,0 @@
|
||||||
/*
|
|
||||||
* Copyright (c) 2013 Brian Paul All Rights Reserved.
|
|
||||||
*
|
|
||||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
|
||||||
* copy of this software and associated documentation files (the "Software"),
|
|
||||||
* to deal in the Software without restriction, including without limitation
|
|
||||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
|
||||||
* and/or sell copies of the Software, and to permit persons to whom the
|
|
||||||
* Software is furnished to do so, subject to the following conditions:
|
|
||||||
*
|
|
||||||
* The above copyright notice and this permission notice shall be included
|
|
||||||
* in all copies or substantial portions of the Software.
|
|
||||||
*
|
|
||||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
|
||||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
||||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
|
||||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
|
||||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
|
||||||
* OTHER DEALINGS IN THE SOFTWARE.
|
|
||||||
*/
|
|
||||||
|
|
||||||
|
|
||||||
#include "target-helpers/inline_sw_helper.h"
|
|
||||||
#include "target-helpers/inline_debug_helper.h"
|
|
||||||
|
|
||||||
#include "sw/null/null_sw_winsys.h"
|
|
||||||
|
|
||||||
|
|
||||||
struct pipe_screen *
|
|
||||||
osmesa_create_screen(void);
|
|
||||||
|
|
||||||
|
|
||||||
struct pipe_screen *
|
|
||||||
osmesa_create_screen(void)
|
|
||||||
{
|
|
||||||
struct sw_winsys *winsys;
|
|
||||||
struct pipe_screen *screen;
|
|
||||||
|
|
||||||
/* We use a null software winsys since we always just render to ordinary
|
|
||||||
* driver resources.
|
|
||||||
*/
|
|
||||||
winsys = null_sw_create();
|
|
||||||
if (!winsys)
|
|
||||||
return NULL;
|
|
||||||
|
|
||||||
/* Create llvmpipe or softpipe screen */
|
|
||||||
screen = sw_screen_create(winsys);
|
|
||||||
if (!screen) {
|
|
||||||
winsys->destroy(winsys);
|
|
||||||
return NULL;
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Inject optional trace, debug, etc. wrappers */
|
|
||||||
return debug_screen_wrap(screen);
|
|
||||||
}
|
|
||||||
|
|
@ -1,310 +0,0 @@
|
||||||
#include <cstdint>
|
|
||||||
#include <cstdio>
|
|
||||||
#include <cstdlib>
|
|
||||||
#include <array>
|
|
||||||
#include <memory>
|
|
||||||
|
|
||||||
#include <gtest/gtest.h>
|
|
||||||
|
|
||||||
#include "GL/osmesa.h"
|
|
||||||
#include "util/macros.h"
|
|
||||||
#include "util/u_endian.h"
|
|
||||||
#include "util/u_math.h"
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
unsigned format;
|
|
||||||
GLenum type;
|
|
||||||
int bpp;
|
|
||||||
uint64_t expected;
|
|
||||||
} Params;
|
|
||||||
|
|
||||||
class OSMesaRenderTestFixture : public testing::TestWithParam<Params> {};
|
|
||||||
|
|
||||||
std::string
|
|
||||||
name_params(const testing::TestParamInfo<Params> params) {
|
|
||||||
auto p = params.param;
|
|
||||||
std::string first, second;
|
|
||||||
switch (p.format) {
|
|
||||||
case OSMESA_RGBA:
|
|
||||||
first = "rgba";
|
|
||||||
break;
|
|
||||||
case OSMESA_BGRA:
|
|
||||||
first = "bgra";
|
|
||||||
break;
|
|
||||||
case OSMESA_RGB:
|
|
||||||
first = "rgb";
|
|
||||||
break;
|
|
||||||
case OSMESA_RGB_565:
|
|
||||||
first = "rgb_565";
|
|
||||||
break;
|
|
||||||
case OSMESA_ARGB:
|
|
||||||
first = "argb";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
switch (p.type) {
|
|
||||||
case GL_UNSIGNED_SHORT:
|
|
||||||
second = "unsigned_short";
|
|
||||||
break;
|
|
||||||
case GL_UNSIGNED_BYTE:
|
|
||||||
second = "unsigned_byte";
|
|
||||||
break;
|
|
||||||
case GL_FLOAT:
|
|
||||||
second = "float";
|
|
||||||
break;
|
|
||||||
case GL_UNSIGNED_SHORT_5_6_5:
|
|
||||||
second = "unsigned_short_565";
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
return first + "_" + second;
|
|
||||||
};
|
|
||||||
|
|
||||||
TEST_P(OSMesaRenderTestFixture, Render)
|
|
||||||
{
|
|
||||||
auto p = GetParam();
|
|
||||||
const int w = 2, h = 2;
|
|
||||||
uint8_t pixels[w * h * 8] = { 0 };
|
|
||||||
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx{
|
|
||||||
OSMesaCreateContext(p.format, NULL), &OSMesaDestroyContext};
|
|
||||||
ASSERT_TRUE(ctx);
|
|
||||||
|
|
||||||
auto ret = OSMesaMakeCurrent(ctx.get(), &pixels, p.type, w, h);
|
|
||||||
ASSERT_EQ(ret, GL_TRUE);
|
|
||||||
|
|
||||||
glClearColor(0.25, 1.0, 0.5, 0.75);
|
|
||||||
|
|
||||||
uint64_t expected = p.expected;
|
|
||||||
|
|
||||||
/* All the formats other than 565 and RGB/byte are array formats, but our
|
|
||||||
* expected values are packed, so byte swap appropriately.
|
|
||||||
*/
|
|
||||||
if (UTIL_ARCH_BIG_ENDIAN) {
|
|
||||||
switch (p.bpp) {
|
|
||||||
case 8:
|
|
||||||
expected = util_bswap64(expected);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 4:
|
|
||||||
expected = util_bswap32(expected);
|
|
||||||
break;
|
|
||||||
|
|
||||||
case 3:
|
|
||||||
case 2:
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
|
|
||||||
#if 0 /* XXX */
|
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(pixels); i += 4) {
|
|
||||||
fprintf(stderr, "pixel %d: %02x %02x %02x %02x\n",
|
|
||||||
i / 4,
|
|
||||||
pixels[i + 0],
|
|
||||||
pixels[i + 1],
|
|
||||||
pixels[i + 2],
|
|
||||||
pixels[i + 3]);
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
for (unsigned i = 0; i < w * h; i++) {
|
|
||||||
switch (p.bpp) {
|
|
||||||
case 2: {
|
|
||||||
uint16_t color = 0;
|
|
||||||
memcpy(&color, &pixels[i * p.bpp], p.bpp);
|
|
||||||
ASSERT_EQ(expected, color);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 3: {
|
|
||||||
uint32_t color = ((pixels[i * p.bpp + 0] << 0) |
|
|
||||||
(pixels[i * p.bpp + 1] << 8) |
|
|
||||||
(pixels[i * p.bpp + 2] << 16));
|
|
||||||
ASSERT_EQ(expected, color);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 4: {
|
|
||||||
uint32_t color = 0;
|
|
||||||
memcpy(&color, &pixels[i * p.bpp], p.bpp);
|
|
||||||
ASSERT_EQ(expected, color);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
case 8: {
|
|
||||||
uint64_t color = 0;
|
|
||||||
memcpy(&color, &pixels[i * p.bpp], p.bpp);
|
|
||||||
ASSERT_EQ(expected, color);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
default:
|
|
||||||
unreachable("bad bpp");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
INSTANTIATE_TEST_SUITE_P(
|
|
||||||
OSMesaRenderTest,
|
|
||||||
OSMesaRenderTestFixture,
|
|
||||||
testing::Values(
|
|
||||||
Params{ OSMESA_RGBA, GL_UNSIGNED_BYTE, 4, 0xbf80ff40 },
|
|
||||||
Params{ OSMESA_BGRA, GL_UNSIGNED_BYTE, 4, 0xbf40ff80 },
|
|
||||||
Params{ OSMESA_ARGB, GL_UNSIGNED_BYTE, 4, 0x80ff40bf},
|
|
||||||
Params{ OSMESA_RGB, GL_UNSIGNED_BYTE, 3, 0x80ff40 },
|
|
||||||
Params{ OSMESA_RGBA, GL_UNSIGNED_SHORT, 8, 0xbfff8000ffff4000ull },
|
|
||||||
Params{ OSMESA_RGB_565, GL_UNSIGNED_SHORT_5_6_5, 2, ((0x10 << 0) |
|
|
||||||
(0x3f << 5) |
|
|
||||||
(0x8 << 11)) }
|
|
||||||
),
|
|
||||||
name_params
|
|
||||||
);
|
|
||||||
|
|
||||||
TEST(OSMesaRenderTest, depth)
|
|
||||||
{
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx{
|
|
||||||
OSMesaCreateContextExt(OSMESA_RGB_565, 24, 8, 0, NULL), &OSMesaDestroyContext};
|
|
||||||
ASSERT_TRUE(ctx);
|
|
||||||
|
|
||||||
const int w = 3, h = 2;
|
|
||||||
uint8_t pixels[4096 * h * 2] = {0}; /* different cpp from our depth! */
|
|
||||||
auto ret = OSMesaMakeCurrent(ctx.get(), &pixels, GL_UNSIGNED_SHORT_5_6_5, w, h);
|
|
||||||
ASSERT_EQ(ret, GL_TRUE);
|
|
||||||
|
|
||||||
/* Expand the row length for the color buffer so we can see that it doesn't affect depth. */
|
|
||||||
OSMesaPixelStore(OSMESA_ROW_LENGTH, 4096);
|
|
||||||
|
|
||||||
uint32_t *depth;
|
|
||||||
GLint dw, dh, depth_cpp;
|
|
||||||
ASSERT_EQ(true, OSMesaGetDepthBuffer(ctx.get(), &dw, &dh, &depth_cpp, (void **)&depth));
|
|
||||||
|
|
||||||
ASSERT_EQ(dw, w);
|
|
||||||
ASSERT_EQ(dh, h);
|
|
||||||
ASSERT_EQ(depth_cpp, 4);
|
|
||||||
|
|
||||||
glClearDepth(1.0);
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(depth[w * 0 + 0], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 0 + 1], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 0], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 1], 0x00ffffff);
|
|
||||||
|
|
||||||
/* Scissor to the top half and clear */
|
|
||||||
glEnable(GL_SCISSOR_TEST);
|
|
||||||
glScissor(0, 1, 2, 1);
|
|
||||||
glClearDepth(0.0);
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(depth[w * 0 + 0], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 0 + 1], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 0], 0x00000000);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 1], 0x00000000);
|
|
||||||
|
|
||||||
/* Y_UP didn't affect depth buffer orientation in classic osmesa. */
|
|
||||||
OSMesaPixelStore(OSMESA_Y_UP, false);
|
|
||||||
glScissor(0, 1, 1, 1);
|
|
||||||
glClearDepth(1.0);
|
|
||||||
glClear(GL_DEPTH_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(depth[w * 0 + 0], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 0 + 1], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 0], 0x00ffffff);
|
|
||||||
EXPECT_EQ(depth[w * 1 + 1], 0x00000000);
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(OSMesaRenderTest, depth_get_no_attachment)
|
|
||||||
{
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx{
|
|
||||||
OSMesaCreateContextExt(OSMESA_RGBA, 0, 0, 0, NULL), &OSMesaDestroyContext};
|
|
||||||
ASSERT_TRUE(ctx);
|
|
||||||
|
|
||||||
uint32_t pixel;
|
|
||||||
auto ret = OSMesaMakeCurrent(ctx.get(), &pixel, GL_UNSIGNED_BYTE, 1, 1);
|
|
||||||
ASSERT_EQ(ret, GL_TRUE);
|
|
||||||
|
|
||||||
uint32_t *depth;
|
|
||||||
GLint dw = 1, dh = 1, depth_cpp = 1;
|
|
||||||
ASSERT_EQ(false, OSMesaGetDepthBuffer(ctx.get(), &dw, &dh, &depth_cpp, (void **)&depth));
|
|
||||||
ASSERT_EQ(depth, nullptr);
|
|
||||||
ASSERT_EQ(dw, 0);
|
|
||||||
ASSERT_EQ(dh, 0);
|
|
||||||
ASSERT_EQ(depth_cpp, 0);
|
|
||||||
}
|
|
||||||
|
|
||||||
static uint32_t be_bswap32(uint32_t x)
|
|
||||||
{
|
|
||||||
if (UTIL_ARCH_BIG_ENDIAN)
|
|
||||||
return util_bswap32(x);
|
|
||||||
else
|
|
||||||
return x;
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(OSMesaRenderTest, separate_buffers_per_context)
|
|
||||||
{
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx1{
|
|
||||||
OSMesaCreateContext(GL_RGBA, NULL), &OSMesaDestroyContext};
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx2{
|
|
||||||
OSMesaCreateContext(GL_RGBA, NULL), &OSMesaDestroyContext};
|
|
||||||
ASSERT_TRUE(ctx1);
|
|
||||||
ASSERT_TRUE(ctx2);
|
|
||||||
|
|
||||||
uint32_t pixel1, pixel2;
|
|
||||||
|
|
||||||
ASSERT_EQ(OSMesaMakeCurrent(ctx1.get(), &pixel1, GL_UNSIGNED_BYTE, 1, 1), GL_TRUE);
|
|
||||||
glClearColor(1.0, 0.0, 0.0, 0.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(pixel1, be_bswap32(0x000000ff));
|
|
||||||
|
|
||||||
ASSERT_EQ(OSMesaMakeCurrent(ctx2.get(), &pixel2, GL_UNSIGNED_BYTE, 1, 1), GL_TRUE);
|
|
||||||
glClearColor(0.0, 1.0, 0.0, 0.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(pixel1, be_bswap32(0x000000ff));
|
|
||||||
EXPECT_EQ(pixel2, be_bswap32(0x0000ff00));
|
|
||||||
|
|
||||||
/* Leave a dangling render to pixel2 as we switch contexts (there should be
|
|
||||||
*/
|
|
||||||
glClearColor(0.0, 0.0, 1.0, 0.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
|
|
||||||
ASSERT_EQ(OSMesaMakeCurrent(ctx1.get(), &pixel1, GL_UNSIGNED_BYTE, 1, 1), GL_TRUE);
|
|
||||||
/* Draw something off screen to trigger a real flush. We should have the
|
|
||||||
* same contents in pixel1 as before
|
|
||||||
*/
|
|
||||||
glBegin(GL_TRIANGLES);
|
|
||||||
glVertex2f(-2, -2);
|
|
||||||
glVertex2f(-2, -2);
|
|
||||||
glVertex2f(-2, -2);
|
|
||||||
glEnd();
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(pixel1, be_bswap32(0x000000ff));
|
|
||||||
EXPECT_EQ(pixel2, be_bswap32(0x00ff0000));
|
|
||||||
}
|
|
||||||
|
|
||||||
TEST(OSMesaRenderTest, resize)
|
|
||||||
{
|
|
||||||
std::unique_ptr<osmesa_context, decltype(&OSMesaDestroyContext)> ctx{
|
|
||||||
OSMesaCreateContext(GL_RGBA, NULL), &OSMesaDestroyContext};
|
|
||||||
ASSERT_TRUE(ctx);
|
|
||||||
|
|
||||||
uint32_t draw1[1], draw2[4];
|
|
||||||
|
|
||||||
ASSERT_EQ(OSMesaMakeCurrent(ctx.get(), draw1, GL_UNSIGNED_BYTE, 1, 1), GL_TRUE);
|
|
||||||
glClearColor(1.0, 0.0, 0.0, 0.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
EXPECT_EQ(draw1[0], be_bswap32(0x000000ff));
|
|
||||||
|
|
||||||
ASSERT_EQ(OSMesaMakeCurrent(ctx.get(), draw2, GL_UNSIGNED_BYTE, 2, 2), GL_TRUE);
|
|
||||||
glClearColor(0.0, 1.0, 0.0, 0.0);
|
|
||||||
glClear(GL_COLOR_BUFFER_BIT);
|
|
||||||
glFinish();
|
|
||||||
for (unsigned i = 0; i < ARRAY_SIZE(draw2); i++)
|
|
||||||
EXPECT_EQ(draw2[i], be_bswap32(0x0000ff00));
|
|
||||||
EXPECT_EQ(draw1[0], be_bswap32(0x000000ff));
|
|
||||||
}
|
|
||||||
Loading…
Add table
Reference in a new issue