Merge remote-tracking branch 'mesa-public/master' into vulkan
This commit is contained in:
commit
a62edcce4e
|
@ -68,7 +68,16 @@ LOCAL_CFLAGS += \
|
|||
endif
|
||||
endif
|
||||
|
||||
ifeq ($(MESA_ENABLE_LLVM),true)
|
||||
LOCAL_CFLAGS += \
|
||||
-DHAVE_LLVM=0x0305 -DLLVM_VERSION_PATCH=2 \
|
||||
-D__STDC_CONSTANT_MACROS \
|
||||
-D__STDC_FORMAT_MACROS \
|
||||
-D__STDC_LIMIT_MACROS
|
||||
endif
|
||||
|
||||
LOCAL_CPPFLAGS += \
|
||||
$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),-D_USING_LIBCXX) \
|
||||
-Wno-error=non-virtual-dtor \
|
||||
-Wno-non-virtual-dtor
|
||||
|
||||
|
|
12
Android.mk
12
Android.mk
|
@ -24,7 +24,7 @@
|
|||
# BOARD_GPU_DRIVERS should be defined. The valid values are
|
||||
#
|
||||
# classic drivers: i915 i965
|
||||
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
|
||||
# gallium drivers: swrast freedreno i915g ilo nouveau r300g r600g radeonsi vc4 vmwgfx
|
||||
#
|
||||
# The main target is libGLES_mesa. For each classic driver enabled, a DRI
|
||||
# module will also be built. DRI modules will be loaded by libGLES_mesa.
|
||||
|
@ -48,7 +48,7 @@ MESA_PYTHON2 := python
|
|||
DRM_GRALLOC_TOP := hardware/drm_gralloc
|
||||
|
||||
classic_drivers := i915 i965
|
||||
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx
|
||||
gallium_drivers := swrast freedreno i915g ilo nouveau r300g r600g radeonsi vmwgfx vc4
|
||||
|
||||
MESA_GPU_DRIVERS := $(strip $(BOARD_GPU_DRIVERS))
|
||||
|
||||
|
@ -80,6 +80,8 @@ else
|
|||
MESA_BUILD_GALLIUM := false
|
||||
endif
|
||||
|
||||
MESA_ENABLE_LLVM := $(if $(filter radeonsi,$(MESA_GPU_DRIVERS)),true,false)
|
||||
|
||||
# add subdirectories
|
||||
ifneq ($(strip $(MESA_GPU_DRIVERS)),)
|
||||
|
||||
|
@ -89,13 +91,9 @@ SUBDIRS := \
|
|||
src/glsl \
|
||||
src/mesa \
|
||||
src/util \
|
||||
src/egl/main
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
|
||||
SUBDIRS += \
|
||||
src/egl/main \
|
||||
src/egl/drivers/dri2 \
|
||||
src/mesa/drivers/dri
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
SUBDIRS += src/gallium
|
||||
|
|
|
@ -13,3 +13,4 @@ $(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/libGLES_mesa_int
|
|||
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/mesa_*_intermediates)
|
||||
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/EXECUTABLES/glsl_compiler_intermediates)
|
||||
$(call add-clean-step, rm -rf $(HOST_OUT_release)/*/STATIC_LIBRARIES/libmesa_*_intermediates)
|
||||
$(call add-clean-step, rm -rf $(PRODUCT_OUT)/*/SHARED_LIBRARIES/*_dri_intermediates)
|
||||
|
|
58
configure.ac
58
configure.ac
|
@ -649,6 +649,7 @@ if test "x$enable_asm" = xyes; then
|
|||
fi
|
||||
|
||||
AC_CHECK_HEADER([xlocale.h], [DEFINES="$DEFINES -DHAVE_XLOCALE_H"])
|
||||
AC_CHECK_HEADER([sys/sysctl.h], [DEFINES="$DEFINES -DHAVE_SYS_SYSCTL_H"])
|
||||
AC_CHECK_FUNC([strtof], [DEFINES="$DEFINES -DHAVE_STRTOF"])
|
||||
|
||||
dnl Check to see if dlopen is in default libraries (like Solaris, which
|
||||
|
@ -713,15 +714,15 @@ AC_ARG_ENABLE([opengl],
|
|||
[enable_opengl="$enableval"],
|
||||
[enable_opengl=yes])
|
||||
AC_ARG_ENABLE([gles1],
|
||||
[AS_HELP_STRING([--enable-gles1],
|
||||
[enable support for OpenGL ES 1.x API @<:@default=disabled@:>@])],
|
||||
[AS_HELP_STRING([--disable-gles1],
|
||||
[disable support for OpenGL ES 1.x API @<:@default=enabled@:>@])],
|
||||
[enable_gles1="$enableval"],
|
||||
[enable_gles1=no])
|
||||
[enable_gles1=yes])
|
||||
AC_ARG_ENABLE([gles2],
|
||||
[AS_HELP_STRING([--enable-gles2],
|
||||
[enable support for OpenGL ES 2.x API @<:@default=disabled@:>@])],
|
||||
[AS_HELP_STRING([--disable-gles2],
|
||||
[disable support for OpenGL ES 2.x API @<:@default=enabled@:>@])],
|
||||
[enable_gles2="$enableval"],
|
||||
[enable_gles2=no])
|
||||
[enable_gles2=yes])
|
||||
|
||||
AC_ARG_ENABLE([dri],
|
||||
[AS_HELP_STRING([--enable-dri],
|
||||
|
@ -940,12 +941,6 @@ x*yes*yes*)
|
|||
;;
|
||||
esac
|
||||
|
||||
# Building Xlib-GLX requires shared glapi to be disabled.
|
||||
if test "x$enable_xlib_glx" = xyes; then
|
||||
AC_MSG_NOTICE([Shared GLAPI should not used with Xlib-GLX, disabling])
|
||||
enable_shared_glapi=no
|
||||
fi
|
||||
|
||||
AM_CONDITIONAL(HAVE_SHARED_GLAPI, test "x$enable_shared_glapi" = xyes)
|
||||
|
||||
# Build the pipe-drivers as separate libraries/modules.
|
||||
|
@ -1516,7 +1511,6 @@ if test "x$enable_gbm" = xyes; then
|
|||
fi
|
||||
|
||||
if test "x$enable_dri" = xyes; then
|
||||
GBM_BACKEND_DIRS="$GBM_BACKEND_DIRS dri"
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
AC_MSG_ERROR([gbm_dri requires --enable-shared-glapi])
|
||||
fi
|
||||
|
@ -1553,8 +1547,15 @@ if test "x$enable_egl" = xyes; then
|
|||
|
||||
if test "$enable_static" != yes; then
|
||||
if test "x$enable_dri" = xyes; then
|
||||
HAVE_EGL_DRIVER_DRI2=1
|
||||
fi
|
||||
HAVE_EGL_DRIVER_DRI2=1
|
||||
if test "x$enable_shared_glapi" = xno; then
|
||||
AC_MSG_ERROR([egl_dri2 requires --enable-shared-glapi])
|
||||
fi
|
||||
else
|
||||
# Avoid building an "empty" libEGL. Drop/update this
|
||||
# when other backends (haiku?) come along.
|
||||
AC_MSG_ERROR([egl requires --enable-dri])
|
||||
fi
|
||||
|
||||
fi
|
||||
fi
|
||||
|
@ -1782,6 +1783,11 @@ for plat in $egl_platforms; do
|
|||
AC_MSG_ERROR([EGL platform drm requires libdrm >= $LIBDRM_REQUIRED])
|
||||
;;
|
||||
|
||||
surfaceless)
|
||||
test "x$have_libdrm" != xyes &&
|
||||
AC_MSG_ERROR([EGL platform surfaceless requires libdrm >= $LIBDRM_REQUIRED])
|
||||
;;
|
||||
|
||||
android|gdi|null)
|
||||
;;
|
||||
|
||||
|
@ -1811,6 +1817,7 @@ fi
|
|||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_X11, echo "$egl_platforms" | grep -q 'x11')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_WAYLAND, echo "$egl_platforms" | grep -q 'wayland')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_DRM, echo "$egl_platforms" | grep -q 'drm')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_SURFACELESS, echo "$egl_platforms" | grep -q 'surfaceless')
|
||||
AM_CONDITIONAL(HAVE_EGL_PLATFORM_NULL, echo "$egl_platforms" | grep -q 'null')
|
||||
|
||||
AM_CONDITIONAL(HAVE_EGL_DRIVER_DRI2, test "x$HAVE_EGL_DRIVER_DRI2" != "x")
|
||||
|
@ -1926,10 +1933,7 @@ if test "x$enable_gallium_llvm" = xyes; then
|
|||
AC_MSG_ERROR([LLVM $LLVM_REQUIRED_VERSION_MAJOR.$LLVM_REQUIRED_VERSION_MINOR or newer is required])
|
||||
fi
|
||||
|
||||
LLVM_COMPONENTS="engine bitwriter"
|
||||
if $LLVM_CONFIG --components | grep -qw 'mcjit'; then
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} mcjit"
|
||||
fi
|
||||
LLVM_COMPONENTS="engine bitwriter mcjit mcdisassembler"
|
||||
|
||||
if test "x$enable_opencl" = xyes; then
|
||||
llvm_check_version_for "3" "5" "0" "opencl"
|
||||
|
@ -1937,7 +1941,7 @@ if test "x$enable_gallium_llvm" = xyes; then
|
|||
LLVM_COMPONENTS="${LLVM_COMPONENTS} all-targets ipo linker instrumentation"
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} irreader option objcarcopts profiledata"
|
||||
fi
|
||||
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DLLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
|
||||
DEFINES="${DEFINES} -DHAVE_LLVM=0x0$LLVM_VERSION_INT -DMESA_LLVM_VERSION_PATCH=$LLVM_VERSION_PATCH"
|
||||
MESA_LLVM=1
|
||||
|
||||
dnl Check for Clang internal headers
|
||||
|
@ -2056,16 +2060,19 @@ require_egl_drm() {
|
|||
}
|
||||
|
||||
radeon_llvm_check() {
|
||||
if test ${LLVM_VERSION_INT} -lt 307; then
|
||||
amdgpu_llvm_target_name='r600'
|
||||
else
|
||||
amdgpu_llvm_target_name='amdgpu'
|
||||
fi
|
||||
if test "x$enable_gallium_llvm" != "xyes"; then
|
||||
AC_MSG_ERROR([--enable-gallium-llvm is required when building $1])
|
||||
fi
|
||||
llvm_check_version_for "3" "4" "2" $1
|
||||
if test true && $LLVM_CONFIG --targets-built | grep -qvw 'R600' ; then
|
||||
AC_MSG_ERROR([LLVM R600 Target not enabled. You can enable it when building the LLVM
|
||||
sources with the --enable-experimental-targets=R600
|
||||
configure flag])
|
||||
if test true && $LLVM_CONFIG --targets-built | grep -iqvw $amdgpu_llvm_target_name ; then
|
||||
AC_MSG_ERROR([LLVM $amdgpu_llvm_target_name not enabled in your LLVM build.])
|
||||
fi
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} r600 bitreader ipo"
|
||||
LLVM_COMPONENTS="${LLVM_COMPONENTS} $amdgpu_llvm_target_name bitreader ipo"
|
||||
NEED_RADEON_LLVM=yes
|
||||
if test "x$have_libelf" != xyes; then
|
||||
AC_MSG_ERROR([$1 requires libelf when using llvm])
|
||||
|
@ -2365,7 +2372,6 @@ AC_CONFIG_FILES([Makefile
|
|||
src/gallium/drivers/svga/Makefile
|
||||
src/gallium/drivers/trace/Makefile
|
||||
src/gallium/drivers/vc4/Makefile
|
||||
src/gallium/drivers/vc4/kernel/Makefile
|
||||
src/gallium/state_trackers/clover/Makefile
|
||||
src/gallium/state_trackers/dri/Makefile
|
||||
src/gallium/state_trackers/glx/xlib/Makefile
|
||||
|
|
36
docs/GL3.txt
36
docs/GL3.txt
|
@ -98,13 +98,13 @@ GL 4.0, GLSL 4.00:
|
|||
GL_ARB_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_gpu_shader5 DONE (i965, nvc0)
|
||||
- 'precise' qualifier DONE
|
||||
- Dynamically uniform sampler array indices DONE (r600)
|
||||
- Dynamically uniform sampler array indices DONE (r600, softpipe)
|
||||
- Dynamically uniform UBO array indices DONE (r600)
|
||||
- Implicit signed -> unsigned conversions DONE
|
||||
- Fused multiply-add DONE ()
|
||||
- Packing/bitfield/conversion functions DONE (r600, radeonsi)
|
||||
- Enhanced textureGather DONE (r600, radeonsi)
|
||||
- Geometry shader instancing DONE (r600)
|
||||
- Packing/bitfield/conversion functions DONE (r600, radeonsi, softpipe)
|
||||
- Enhanced textureGather DONE (r600, radeonsi, softpipe)
|
||||
- Geometry shader instancing DONE (r600, llvmpipe, softpipe)
|
||||
- Geometry shader multiple streams DONE ()
|
||||
- Enhanced per-sample shading DONE (r600, radeonsi)
|
||||
- Interpolation functions DONE (r600)
|
||||
|
@ -115,10 +115,10 @@ GL 4.0, GLSL 4.00:
|
|||
GL_ARB_tessellation_shader started (Chris, Ilia)
|
||||
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_cube_map_array DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_texture_gather DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_query_lod DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback2 DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_transform_feedback3 DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
|
||||
|
||||
GL 4.1, GLSL 4.10:
|
||||
|
@ -137,7 +137,7 @@ GL 4.2, GLSL 4.20:
|
|||
GL_ARB_compressed_texture_pixel_storage DONE (all drivers)
|
||||
GL_ARB_shader_atomic_counters DONE (i965)
|
||||
GL_ARB_texture_storage DONE (all drivers)
|
||||
GL_ARB_transform_feedback_instanced DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_transform_feedback_instanced DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_base_instance DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_shader_image_load_store in progress (curro)
|
||||
GL_ARB_conservative_depth DONE (all drivers that support GLSL 1.30)
|
||||
|
@ -153,23 +153,23 @@ GL 4.3, GLSL 4.30:
|
|||
GL_ARB_ES3_compatibility DONE (all drivers that support GLSL 3.30)
|
||||
GL_ARB_clear_buffer_object DONE (all drivers)
|
||||
GL_ARB_compute_shader in progress (jljusten)
|
||||
GL_ARB_copy_image DONE (i965)
|
||||
GL_ARB_copy_image DONE (i965) (gallium - in progress, VMware)
|
||||
GL_KHR_debug DONE (all drivers)
|
||||
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
||||
GL_ARB_fragment_layer_viewport DONE (nv50, nvc0, r600, llvmpipe)
|
||||
GL_ARB_framebuffer_no_attachments not started
|
||||
GL_ARB_framebuffer_no_attachments DONE (i965)
|
||||
GL_ARB_internalformat_query2 not started
|
||||
GL_ARB_invalidate_subdata DONE (all drivers)
|
||||
GL_ARB_multi_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_program_interface_query DONE (all drivers)
|
||||
GL_ARB_robust_buffer_access_behavior not started
|
||||
GL_ARB_shader_image_size in progress (Martin Peres)
|
||||
GL_ARB_shader_storage_buffer_object not started
|
||||
GL_ARB_shader_storage_buffer_object in progress (Iago Toral, Samuel Iglesias)
|
||||
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_texture_buffer_range DONE (nv50, nvc0, i965, r600, radeonsi, llvmpipe)
|
||||
GL_ARB_texture_query_levels DONE (all drivers that support GLSL 1.30)
|
||||
GL_ARB_texture_storage_multisample DONE (all drivers that support GL_ARB_texture_multisample)
|
||||
GL_ARB_texture_view DONE (i965, nv50, nvc0)
|
||||
GL_ARB_texture_view DONE (i965, nv50, nvc0, llvmpipe, softpipe)
|
||||
GL_ARB_vertex_attrib_binding DONE (all drivers)
|
||||
|
||||
|
||||
|
@ -177,7 +177,7 @@ GL 4.4, GLSL 4.40:
|
|||
|
||||
GL_MAX_VERTEX_ATTRIB_STRIDE DONE (all drivers)
|
||||
GL_ARB_buffer_storage DONE (i965, nv50, nvc0, r600, radeonsi)
|
||||
GL_ARB_clear_texture DONE (i965)
|
||||
GL_ARB_clear_texture DONE (i965) (gallium - in progress, VMware)
|
||||
GL_ARB_enhanced_layouts not started
|
||||
GL_ARB_multi_bind DONE (all drivers)
|
||||
GL_ARB_query_buffer_object not started
|
||||
|
@ -190,12 +190,12 @@ GL 4.5, GLSL 4.50:
|
|||
GL_ARB_ES3_1_compatibility not started
|
||||
GL_ARB_clip_control DONE (i965, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_conditional_render_inverted DONE (i965, nv50, nvc0, llvmpipe, softpipe)
|
||||
GL_ARB_cull_distance not started
|
||||
GL_ARB_cull_distance in progress (Tobias)
|
||||
GL_ARB_derivative_control DONE (i965, nv50, nvc0, r600)
|
||||
GL_ARB_direct_state_access started
|
||||
GL_ARB_direct_state_access DONE (all drivers)
|
||||
- Transform Feedback object DONE
|
||||
- Buffer object DONE
|
||||
- Framebuffer object started (Laura Ekstrand)
|
||||
- Framebuffer object DONE
|
||||
- Renderbuffer object DONE
|
||||
- Texture object DONE
|
||||
- Vertex array object DONE
|
||||
|
@ -216,12 +216,12 @@ GLES3.1, GLSL ES 3.1
|
|||
GL_ARB_compute_shader in progress (jljusten)
|
||||
GL_ARB_draw_indirect DONE (i965, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
GL_ARB_explicit_uniform_location DONE (all drivers that support GLSL)
|
||||
GL_ARB_framebuffer_no_attachments not started
|
||||
GL_ARB_framebuffer_no_attachments DONE (i965)
|
||||
GL_ARB_program_interface_query DONE (all drivers)
|
||||
GL_ARB_shader_atomic_counters DONE (i965)
|
||||
GL_ARB_shader_image_load_store in progress (curro)
|
||||
GL_ARB_shader_image_size in progress (Martin Peres)
|
||||
GL_ARB_shader_storage_buffer_object not started
|
||||
GL_ARB_shader_storage_buffer_object in progress (Iago Toral, Samuel Iglesias)
|
||||
GL_ARB_shading_language_packing DONE (all drivers)
|
||||
GL_ARB_separate_shader_objects DONE (all drivers)
|
||||
GL_ARB_stencil_texturing DONE (i965/gen8+, nv50, nvc0, r600, radeonsi, llvmpipe, softpipe)
|
||||
|
|
|
@ -17,158 +17,240 @@
|
|||
<h1>Development Notes</h1>
|
||||
|
||||
|
||||
<h2>Adding Extensions</h2>
|
||||
|
||||
<p>
|
||||
To add a new GL extension to Mesa you have to do at least the following.
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
If glext.h doesn't define the extension, edit include/GL/gl.h and add
|
||||
code like this:
|
||||
<pre>
|
||||
#ifndef GL_EXT_the_extension_name
|
||||
#define GL_EXT_the_extension_name 1
|
||||
/* declare the new enum tokens */
|
||||
/* prototype the new functions */
|
||||
/* TYPEDEFS for the new functions */
|
||||
#endif
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
In the src/mapi/glapi/gen/ directory, add the new extension functions and
|
||||
enums to the gl_API.xml file.
|
||||
Then, a bunch of source files must be regenerated by executing the
|
||||
corresponding Python scripts.
|
||||
</li>
|
||||
<li>
|
||||
Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
|
||||
</li>
|
||||
<li>
|
||||
Update the <code>extensions.c</code> file.
|
||||
</li>
|
||||
<li>
|
||||
From this point, the best way to proceed is to find another extension,
|
||||
similar to the new one, that's already implemented in Mesa and use it
|
||||
as an example.
|
||||
</li>
|
||||
<li>
|
||||
If the new extension adds new GL state, the functions in get.c, enable.c
|
||||
and attrib.c will most likely require new code.
|
||||
</li>
|
||||
<li>
|
||||
The dispatch tests check_table.cpp and dispatch_sanity.cpp
|
||||
should be updated with details about the new extensions functions. These
|
||||
tests are run using 'make check'
|
||||
</li>
|
||||
<li><a href="#style">Coding Style</a>
|
||||
<li><a href="#submitting">Submitting Patches</a>
|
||||
<li><a href="#release">Making a New Mesa Release</a>
|
||||
<li><a href="#extensions">Adding Extensions</a>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h2>Coding Style</h2>
|
||||
<h2 id="style">Coding Style</h2>
|
||||
|
||||
<p>
|
||||
Mesa's code style has changed over the years. Here's the latest.
|
||||
Mesa is over 20 years old and the coding style has evolved over time.
|
||||
Some old parts use a style that's a bit out of date.
|
||||
If the guidelines below don't cover something, try following the format of
|
||||
existing, neighboring code.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Comment your code! It's extremely important that open-source code be
|
||||
well documented. Also, strive to write clean, easily understandable code.
|
||||
Basic formatting guidelines
|
||||
</p>
|
||||
|
||||
<p>
|
||||
3-space indentation
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If you use tabs, set them to 8 columns
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Line width: the preferred width to fill comments and code in Mesa is 78
|
||||
columns. Exceptions are sometimes made for clarity (e.g. tabular data is
|
||||
sometimes filled to a much larger width so that extraneous carriage returns
|
||||
don't obscure the table).
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Brace example:
|
||||
</p>
|
||||
<ul>
|
||||
<li>3-space indentation, no tabs.
|
||||
<li>Limit lines to 78 or fewer characters. The idea is to prevent line
|
||||
wrapping in 80-column editors and terminals. There are exceptions, such
|
||||
as if you're defining a large, static table of information.
|
||||
<li>Opening braces go on the same line as the if/for/while statement.
|
||||
For example:
|
||||
<pre>
|
||||
if (condition) {
|
||||
foo;
|
||||
}
|
||||
else {
|
||||
bar;
|
||||
}
|
||||
|
||||
switch (condition) {
|
||||
case 0:
|
||||
foo();
|
||||
break;
|
||||
|
||||
case 1: {
|
||||
...
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
...
|
||||
break;
|
||||
}
|
||||
if (condition) {
|
||||
foo;
|
||||
} else {
|
||||
bar;
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Here's the GNU indent command which will best approximate my preferred style:
|
||||
(Note that it won't format switch statements in the preferred way)
|
||||
</p>
|
||||
<li>Put a space before/after operators. For example, <tt>a = b + c;</tt>
|
||||
and not <tt>a=b+c;</tt>
|
||||
|
||||
<li>This GNU indent command generally does the right thing for formatting:
|
||||
<pre>
|
||||
indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
|
||||
indent -br -i3 -npcs --no-tabs infile.c -o outfile.c
|
||||
</pre>
|
||||
|
||||
|
||||
<p>
|
||||
Local variable name example: localVarName (no underscores)
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Constants and macros are ALL_UPPERCASE, with _ between words
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Global variables are not allowed.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Function name examples:
|
||||
</p>
|
||||
<li>Use comments wherever you think it would be helpful for other developers.
|
||||
Several specific cases and style examples follow. Note that we roughly
|
||||
follow <a href="http://www.stack.nl/~dimitri/doxygen/">Doxygen</a> conventions.
|
||||
<br>
|
||||
<br>
|
||||
Single-line comments:
|
||||
<pre>
|
||||
glFooBar() - a public GL entry point (in glapi_dispatch.c)
|
||||
_mesa_FooBar() - the internal immediate mode function
|
||||
save_FooBar() - retained mode (display list) function in dlist.c
|
||||
foo_bar() - a static (private) function
|
||||
_mesa_foo_bar() - an internal non-static Mesa function
|
||||
/* null-out pointer to prevent dangling reference below */
|
||||
bufferObj = NULL;
|
||||
</pre>
|
||||
Or,
|
||||
<pre>
|
||||
bufferObj = NULL; /* prevent dangling reference below */
|
||||
</pre>
|
||||
Multi-line comment:
|
||||
<pre>
|
||||
/* If this is a new buffer object id, or one which was generated but
|
||||
* never used before, allocate a buffer object now.
|
||||
*/
|
||||
</pre>
|
||||
We try to quote the OpenGL specification where prudent:
|
||||
<pre>
|
||||
/* Page 38 of the PDF of the OpenGL ES 3.0 spec says:
|
||||
*
|
||||
* "An INVALID_OPERATION error is generated for any of the following
|
||||
* conditions:
|
||||
*
|
||||
* * <length> is zero."
|
||||
*
|
||||
* Additionally, page 94 of the PDF of the OpenGL 4.5 core spec
|
||||
* (30.10.2014) also says this, so it's no longer allowed for desktop GL,
|
||||
* either.
|
||||
*/
|
||||
</pre>
|
||||
Function comment example:
|
||||
<pre>
|
||||
/**
|
||||
* Create and initialize a new buffer object. Called via the
|
||||
* ctx->Driver.CreateObject() driver callback function.
|
||||
* \param name integer name of the object
|
||||
* \param type one of GL_FOO, GL_BAR, etc.
|
||||
* \return pointer to new object or NULL if error
|
||||
*/
|
||||
struct gl_object *
|
||||
_mesa_create_object(GLuint name, GLenum type)
|
||||
{
|
||||
/* function body */
|
||||
}
|
||||
</pre>
|
||||
|
||||
<p>
|
||||
Places that are not directly visible to the GL API should prefer the use
|
||||
of <tt>bool</tt>, <tt>true</tt>, and
|
||||
<li>Put the function return type and qualifiers on one line and the function
|
||||
name and parameters on the next, as seen above. This makes it easy to use
|
||||
<code>grep ^function_name dir/*</code> to find function definitions. Also,
|
||||
the opening brace goes on the next line by itself (see above.)
|
||||
|
||||
<li>Function names follow various conventions depending on the type of function:
|
||||
<pre>
|
||||
glFooBar() - a public GL entry point (in glapi_dispatch.c)
|
||||
_mesa_FooBar() - the internal immediate mode function
|
||||
save_FooBar() - retained mode (display list) function in dlist.c
|
||||
foo_bar() - a static (private) function
|
||||
_mesa_foo_bar() - an internal non-static Mesa function
|
||||
</pre>
|
||||
|
||||
<li>Constants, macros and enumerant names are ALL_UPPERCASE, with _ between
|
||||
words.
|
||||
<li>Mesa usually uses camel case for local variables (Ex: "localVarname")
|
||||
while gallium typically uses underscores (Ex: "local_var_name").
|
||||
<li>Global variables are almost never used because Mesa should be thread-safe.
|
||||
|
||||
<li>Booleans. Places that are not directly visible to the GL API
|
||||
should prefer the use of <tt>bool</tt>, <tt>true</tt>, and
|
||||
<tt>false</tt> over <tt>GLboolean</tt>, <tt>GL_TRUE</tt>, and
|
||||
<tt>GL_FALSE</tt>. In C code, this may mean that
|
||||
<tt>#include <stdbool.h></tt> needs to be added. The
|
||||
<tt>try_emit_</tt>* methods in src/mesa/program/ir_to_mesa.cpp and
|
||||
src/mesa/state_tracker/st_glsl_to_tgsi.cpp can serve as examples.
|
||||
</p>
|
||||
|
||||
<h2>Submitting patches</h2>
|
||||
</ul>
|
||||
|
||||
|
||||
<h2 id="submitting">Submitting patches</h2>
|
||||
|
||||
<p>
|
||||
You should always run the Mesa Testsuite before submitting patches.
|
||||
The Testsuite can be run using the 'make check' command. All tests
|
||||
The basic guidelines for submitting patches are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Patches should be sufficiently tested before submitting.
|
||||
<li>Code patches should follow Mesa coding conventions.
|
||||
<li>Whenever possible, patches should only effect individual Mesa/Gallium
|
||||
components.
|
||||
<li>Patches should never introduce build breaks and should be bisectable (see
|
||||
<code>git bisect</code>.)
|
||||
<li>Patches should be properly formatted (see below).
|
||||
<li>Patches should be submitted to mesa-dev for review using
|
||||
<code>git send-email</code>.
|
||||
<li>Patches should not mix code changes with code formatting changes (except,
|
||||
perhaps, in very trivial cases.)
|
||||
</ul>
|
||||
|
||||
<h3>Patch formatting</h3>
|
||||
|
||||
<p>
|
||||
The basic rules for patch formatting are:
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>Lines should be limited to 75 characters or less so that git logs
|
||||
displayed in 80-column terminals avoid line wrapping. Note that git
|
||||
log uses 4 spaces of indentation (4 + 75 < 80).
|
||||
<li>The first line should be a short, concise summary of the change prefixed
|
||||
with a module name. Examples:
|
||||
<pre>
|
||||
mesa: Add support for querying GL_VERTEX_ATTRIB_ARRAY_LONG
|
||||
|
||||
gallium: add PIPE_CAP_DEVICE_RESET_STATUS_QUERY
|
||||
|
||||
i965: Fix missing type in local variable declaration.
|
||||
</pre>
|
||||
<li>Subsequent patch comments should describe the change in more detail,
|
||||
if needed. For example:
|
||||
<pre>
|
||||
i965: Remove end-of-thread SEND alignment code.
|
||||
|
||||
This was present in Eric's initial implementation of the compaction code
|
||||
for Sandybridge (commit 077d01b6). There is no documentation saying this
|
||||
is necessary, and removing it causes no regressions in piglit on any
|
||||
platform.
|
||||
</pre>
|
||||
<li>A "Signed-off-by:" line is not required, but not discouraged either.
|
||||
<li>If a patch address a bugzilla issue, that should be noted in the
|
||||
patch comment. For example:
|
||||
<pre>
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89689
|
||||
</pre>
|
||||
<li>If there have been several revisions to a patch during the review
|
||||
process, they should be noted such as in this example:
|
||||
<pre>
|
||||
st/mesa: add ARB_texture_stencil8 support (v4)
|
||||
|
||||
if we support stencil texturing, enable texture_stencil8
|
||||
there is no requirement to support native S8 for this,
|
||||
the texture can be converted to x24s8 fine.
|
||||
|
||||
v2: fold fixes from Marek in:
|
||||
a) put S8 last in the list
|
||||
b) fix renderable to always test for d/s renderable
|
||||
fixup the texture case to use a stencil only format
|
||||
for picking the format for the texture view.
|
||||
v3: hit fallback for getteximage
|
||||
v4: put s8 back in front, it shouldn't get picked now (Ilia)
|
||||
</pre>
|
||||
<li>If someone tested your patch, document it with a line like this:
|
||||
<pre>
|
||||
Tested-by: Joe Hacker <jhacker@foo.com>
|
||||
</pre>
|
||||
<li>If the patch was reviewed (usually the case) or acked by someone,
|
||||
that should be documented with:
|
||||
<pre>
|
||||
Reviewed-by: Joe Hacker <jhacker@foo.com>
|
||||
Acked-by: Joe Hacker <jhacker@foo.com>
|
||||
</pre>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
<h3>Testing Patches</h3>
|
||||
|
||||
<p>
|
||||
It should go without saying that patches must be tested. In general,
|
||||
do whatever testing is prudent.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
You should always run the Mesa test suite before submitting patches.
|
||||
The test suite can be run using the 'make check' command. All tests
|
||||
must pass before patches will be accepted, this may mean you have
|
||||
to update the tests themselves.
|
||||
</p>
|
||||
|
||||
<p>
|
||||
Whenever possible and applicable, test the patch with
|
||||
<a href="http://piglit.freedesktop.org">Piglit</a> to
|
||||
check for regressions.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Mailing Patches</h3>
|
||||
|
||||
<p>
|
||||
Patches should be sent to the Mesa mailing list for review.
|
||||
When submitting a patch make sure to use git send-email rather than attaching
|
||||
|
@ -184,7 +266,38 @@ re-sending the whole series). Using --in-reply-to makes
|
|||
it harder for reviewers to accidentally review old patches.
|
||||
</p>
|
||||
|
||||
<h2>Marking a commit as a candidate for a stable branch</h2>
|
||||
<p>
|
||||
When submitting follow-up patches you should also login to
|
||||
<a href="https://patchwork.freedesktop.org">patchwork</a> and change the
|
||||
state of your old patches to Superseded.
|
||||
</p>
|
||||
|
||||
<h3>Reviewing Patches</h3>
|
||||
|
||||
<p>
|
||||
When you've reviewed a patch on the mailing list, please be unambiguous
|
||||
about your review. That is, state either
|
||||
<pre>
|
||||
Reviewed-by: Joe Hacker <jhacker@foo.com>
|
||||
</pre>
|
||||
or
|
||||
<pre>
|
||||
Acked-by: Joe Hacker <jhacker@foo.com>
|
||||
</pre>
|
||||
Rather than saying just "LGTM" or "Seems OK".
|
||||
</p>
|
||||
|
||||
<p>
|
||||
If small changes are suggested, it's OK to say something like:
|
||||
<pre>
|
||||
With the above fixes, Reviewed-by: Joe Hacker <jhacker@foo.com>
|
||||
</pre>
|
||||
which tells the patch author that the patch can be committed, as long
|
||||
as the issues are resolved first.
|
||||
</p>
|
||||
|
||||
|
||||
<h3>Marking a commit as a candidate for a stable branch</h3>
|
||||
|
||||
<p>
|
||||
If you want a commit to be applied to a stable branch,
|
||||
|
@ -221,7 +334,7 @@ the upcoming stable release can always be seen on the
|
|||
<a href="http://cworth.org/~cworth/mesa-stable-queue/">Mesa Stable Queue</a>
|
||||
page.
|
||||
|
||||
<h2>Criteria for accepting patches to the stable branch</h2>
|
||||
<h3>Criteria for accepting patches to the stable branch</h3>
|
||||
|
||||
Mesa has a designated release manager for each stable branch, and the release
|
||||
manager is the only developer that should be pushing changes to these
|
||||
|
@ -306,7 +419,8 @@ be rejected:
|
|||
regression that is unaacceptable for the stable branch.</li>
|
||||
</ul>
|
||||
|
||||
<h2>Making a New Mesa Release</h2>
|
||||
|
||||
<h2 id="release">Making a New Mesa Release</h2>
|
||||
|
||||
<p>
|
||||
These are the instructions for making a new Mesa release.
|
||||
|
@ -456,7 +570,7 @@ Edit docs/relnotes/X.Y.Z.html to add the sha256sums printed as part of "make
|
|||
tarballs" in the previous step. Commit this change.
|
||||
</p>
|
||||
|
||||
<h3>Push all commits and the tag creates above</h3>
|
||||
<h3>Push all commits and the tag created above</h3>
|
||||
|
||||
<p>
|
||||
This is the first step that cannot easily be undone. The release is going
|
||||
|
@ -483,7 +597,7 @@ signatures to the freedesktop.org server:
|
|||
mv ~/MesaLib-X.Y.Z* .
|
||||
</pre>
|
||||
|
||||
<h3>Back on mesa master, andd the new release notes into the tree</h3>
|
||||
<h3>Back on mesa master, add the new release notes into the tree</h3>
|
||||
|
||||
<p>
|
||||
Something like the following steps will do the trick:
|
||||
|
@ -543,6 +657,56 @@ release announcement:
|
|||
</pre>
|
||||
</p>
|
||||
|
||||
|
||||
<h2 id="extensions">Adding Extensions</h2>
|
||||
|
||||
<p>
|
||||
To add a new GL extension to Mesa you have to do at least the following.
|
||||
|
||||
<ul>
|
||||
<li>
|
||||
If glext.h doesn't define the extension, edit include/GL/gl.h and add
|
||||
code like this:
|
||||
<pre>
|
||||
#ifndef GL_EXT_the_extension_name
|
||||
#define GL_EXT_the_extension_name 1
|
||||
/* declare the new enum tokens */
|
||||
/* prototype the new functions */
|
||||
/* TYPEDEFS for the new functions */
|
||||
#endif
|
||||
</pre>
|
||||
</li>
|
||||
<li>
|
||||
In the src/mapi/glapi/gen/ directory, add the new extension functions and
|
||||
enums to the gl_API.xml file.
|
||||
Then, a bunch of source files must be regenerated by executing the
|
||||
corresponding Python scripts.
|
||||
</li>
|
||||
<li>
|
||||
Add a new entry to the <code>gl_extensions</code> struct in mtypes.h
|
||||
</li>
|
||||
<li>
|
||||
Update the <code>extensions.c</code> file.
|
||||
</li>
|
||||
<li>
|
||||
From this point, the best way to proceed is to find another extension,
|
||||
similar to the new one, that's already implemented in Mesa and use it
|
||||
as an example.
|
||||
</li>
|
||||
<li>
|
||||
If the new extension adds new GL state, the functions in get.c, enable.c
|
||||
and attrib.c will most likely require new code.
|
||||
</li>
|
||||
<li>
|
||||
The dispatch tests check_table.cpp and dispatch_sanity.cpp
|
||||
should be updated with details about the new extensions functions. These
|
||||
tests are run using 'make check'
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -183,14 +183,6 @@ probably required only for some of the demos found in mesa/demo repository.</p>
|
|||
values are: <code>debug</code>, <code>info</code>, <code>warning</code>, and
|
||||
<code>fatal</code>.</p>
|
||||
|
||||
</dd>
|
||||
|
||||
<dt><code>EGL_SOFTWARE</code></dt>
|
||||
<dd>
|
||||
|
||||
<p>For drivers that support both hardware and software rendering, setting this
|
||||
variable to true forces the use of software rendering.</p>
|
||||
|
||||
</dd>
|
||||
</dl>
|
||||
|
||||
|
|
|
@ -16,6 +16,37 @@
|
|||
|
||||
<h1>News</h1>
|
||||
|
||||
<h2>June 20, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.8.html">Mesa 10.5.8</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>June 14, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.6.0.html">Mesa 10.6.0</a> is released. This is a new
|
||||
development release. See the release notes for more information about
|
||||
the release.
|
||||
</p>
|
||||
|
||||
<h2>June 07, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.7.html">Mesa 10.5.7</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>May 23, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.6.html">Mesa 10.5.6</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>May 11, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.5.html">Mesa 10.5.5</a> is released.
|
||||
This is a bug-fix release.
|
||||
</p>
|
||||
|
||||
<h2>April 24, 2015</h2>
|
||||
<p>
|
||||
<a href="relnotes/10.5.4.html">Mesa 10.5.4</a> is released.
|
||||
|
|
|
@ -21,6 +21,11 @@ The release notes summarize what's new or changed in each Mesa release.
|
|||
</p>
|
||||
|
||||
<ul>
|
||||
<li><a href="relnotes/10.5.8.html">10.5.8 release notes</a>
|
||||
<li><a href="relnotes/10.6.0.html">10.6.0 release notes</a>
|
||||
<li><a href="relnotes/10.5.7.html">10.5.7 release notes</a>
|
||||
<li><a href="relnotes/10.5.6.html">10.5.6 release notes</a>
|
||||
<li><a href="relnotes/10.5.5.html">10.5.5 release notes</a>
|
||||
<li><a href="relnotes/10.5.4.html">10.5.4 release notes</a>
|
||||
<li><a href="relnotes/10.5.3.html">10.5.3 release notes</a>
|
||||
<li><a href="relnotes/10.5.2.html">10.5.2 release notes</a>
|
||||
|
|
|
@ -0,0 +1,95 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.5.5 Release Notes / May 11, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.5 is a bug fix release which fixes bugs found since the 10.5.4 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.5 implements the OpenGL 3.3 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
c10f00fd792b8290dd51ebcc48a9016c4cafab19ec205423c6fcadfd7f3a59f2 mesa-10.5.5.tar.gz
|
||||
4ac4e4ea3414f1cadb1467f2f173f9e56170d31e8674f7953a46f0549d319f28 mesa-10.5.5.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88521">Bug 88521</a> - GLBenchmark 2.7 TRex renders with artifacts on Gen8 with !UXA</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89455">Bug 89455</a> - [NVC0/Gallium] Unigine Heaven black and white boxes</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89689">Bug 89689</a> - [Regression] Weston on DRM backend won't start with new version of mesa</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90130">Bug 90130</a> - gl_PrimitiveId seems to reset at 340</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Boyan Ding (1):</p>
|
||||
<ul>
|
||||
<li>i965: Add XRGB8888 format to intel_screen_make_configs</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (3):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.5.4 release</li>
|
||||
<li>r300: do not link against libdrm_intel</li>
|
||||
<li>Update version to 10.5.5</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (4):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: flush denorms to zero in non-compute shaders</li>
|
||||
<li>gk110/ir: fix set with a register dest to not auto-set the abs flag</li>
|
||||
<li>nvc0/ir: fix predicated PFETCH emission</li>
|
||||
<li>nv50/ir: fix asFlow() const helper for OP_JOIN</li>
|
||||
</ul>
|
||||
|
||||
<p>Kenneth Graunke (2):</p>
|
||||
<ul>
|
||||
<li>i965: Make intel_emit_linear_blit handle Gen8+ alignment restrictions.</li>
|
||||
<li>i965: Disallow linear blits that are not cacheline aligned.</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>draw: fix prim ids when there's no gs</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,147 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.5.6 Release Notes / May 23, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.6 is a bug fix release which fixes bugs found since the 10.5.5 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.6 implements the OpenGL 3.3 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
89ff9cb08d0f6e3f34154864c3071253057cd21020759457c8ae27e0f70985d3 mesa-10.5.6.tar.gz
|
||||
66017853bde5f7a6647db3eede30512a091a3491daa1708e0ad8027c328ba595 mesa-10.5.6.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86792">Bug 86792</a> - [NVC0] Portal 2 Crashes in Wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90147">Bug 90147</a> - swrast: build error undeclared _SC_PHYS_PAGES on osx</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90350">Bug 90350</a> - [G96] Portal's portal are incorrectly rendered</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90363">Bug 90363</a> - [nv50] HW state is not reset correctly when using a new GL context</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Alex Deucher (1):</p>
|
||||
<ul>
|
||||
<li>radeonsi: add new bonaire pci id</li>
|
||||
</ul>
|
||||
|
||||
<p>Axel Davy (2):</p>
|
||||
<ul>
|
||||
<li>egl/wayland: properly destroy wayland objects</li>
|
||||
<li>glx/dri3: Add additional check for gpu offloading case</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256 sums for the 10.5.5 release</li>
|
||||
<li>egl/main: fix EGL_KHR_get_all_proc_addresses</li>
|
||||
<li>targets/osmesa: drop the -module tag from LDFLAGS</li>
|
||||
<li>Update version to 10.5.6</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (4):</p>
|
||||
<ul>
|
||||
<li>clover: Refactor event::trigger and ::abort to prevent deadlock and reentrancy issues.</li>
|
||||
<li>clover: Wrap event::_status in a method to prevent unlocked access.</li>
|
||||
<li>clover: Implement locking of the wait_count, _chain and _status members of event.</li>
|
||||
<li>i965: Fix PBO cache coherency issue after _mesa_meta_pbo_GetTexSubImage().</li>
|
||||
</ul>
|
||||
|
||||
<p>Fredrik Höglund (2):</p>
|
||||
<ul>
|
||||
<li>main: Require that the texture exists in framebuffer_texture</li>
|
||||
<li>mesa: Generate GL_INVALID_VALUE in framebuffer_texture when layer < 0</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (7):</p>
|
||||
<ul>
|
||||
<li>nv50/ir: only propagate saturate up if some actual folding took place</li>
|
||||
<li>nv50: keep track of PGRAPH state in nv50_screen</li>
|
||||
<li>nvc0: keep track of PGRAPH state in nvc0_screen</li>
|
||||
<li>nvc0: reset the instanced elements state when doing blit using 3d engine</li>
|
||||
<li>nv50/ir: only enable mul saturate on G200+</li>
|
||||
<li>st/mesa: make sure to create a "clean" bool when doing i2b</li>
|
||||
<li>nvc0: switch mechanism for shader eviction to be a while loop</li>
|
||||
</ul>
|
||||
|
||||
<p>Jeremy Huddleston Sequoia (2):</p>
|
||||
<ul>
|
||||
<li>swrast: Build fix for darwin</li>
|
||||
<li>darwin: Fix install name of libOSMesa</li>
|
||||
</ul>
|
||||
|
||||
<p>Laura Ekstrand (2):</p>
|
||||
<ul>
|
||||
<li>main: Fix an error generated by FramebufferTexture</li>
|
||||
<li>main: Complete error conditions for glInvalidate*Framebuffer.</li>
|
||||
</ul>
|
||||
|
||||
<p>Marta Lofstedt (1):</p>
|
||||
<ul>
|
||||
<li>main: glGetIntegeri_v fails for GL_VERTEX_BINDING_STRIDE</li>
|
||||
</ul>
|
||||
|
||||
<p>Rob Clark (2):</p>
|
||||
<ul>
|
||||
<li>freedreno: enable a306</li>
|
||||
<li>freedreno: fix bug in tile/slot calculation</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>draw: (trivial) fix out-of-bounds vector initialization</li>
|
||||
</ul>
|
||||
|
||||
<p>Tim Rowley (1):</p>
|
||||
<ul>
|
||||
<li>mesa: fix shininess check for ffvertex_prog v2</li>
|
||||
</ul>
|
||||
|
||||
<p>Tom Stellard (2):</p>
|
||||
<ul>
|
||||
<li>clover: Add a mutex to guard queue::queued_events</li>
|
||||
<li>clover: Fix a bug with multi-threaded events v2</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,103 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.5.7 Release Notes / June 07, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.7 is a bug fix release which fixes bugs found since the 10.5.6 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.7 implements the OpenGL 3.3 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
8f865ce497435fdf25d4e35f3b5551b2bcd5f9bc6570561183be82af20d18b82 mesa-10.5.7.tar.gz
|
||||
04d06890cd69af8089d6ca76f40e46dcf9cacfe4a9788b32be620574d4638818 mesa-10.5.7.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89131">Bug 89131</a> - [Bisected] Graphical corruption in Weston, shows old framebuffer pieces</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965: Emit 3DSTATE_MULTISAMPLE before WM_HZ_OP (gen8+)</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (4):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256sums for the 10.5.6 release</li>
|
||||
<li>get-pick-list.sh: Require explicit "10.5" for nominating stable patches</li>
|
||||
<li>cherry-ignore: add clover build fix not applicable for 10.5</li>
|
||||
<li>Update version to 10.5.7</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (18):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: set ftz when sources are floats, not just destinations</li>
|
||||
<li>nv50/ir: guess that the constant offset is the starting slot of array</li>
|
||||
<li>nvc0/ir: LOAD's can't be used for shader inputs</li>
|
||||
<li>nvc0: a geometry shader can have up to 1024 vertices output</li>
|
||||
<li>nv50/ir: avoid messing up arg1 of PFETCH</li>
|
||||
<li>nv30: don't leak fragprog consts</li>
|
||||
<li>nv30: avoid leaking render state and draw shaders</li>
|
||||
<li>nv30: fix clip plane uploads and enable changes</li>
|
||||
<li>nv30/draw: avoid leaving stale pointers in draw state</li>
|
||||
<li>nv30/draw: draw expects constbuf size in bytes, not vec4 units</li>
|
||||
<li>st/mesa: don't leak glsl_to_tgsi object on link failure</li>
|
||||
<li>glsl: avoid leaking linked gl_shader when there's a late linker error</li>
|
||||
<li>nv30/draw: fix indexed draws with swtnl path and a resource index buffer</li>
|
||||
<li>nv30/draw: only use the DMA1 object (GART) if the bo is not in VRAM</li>
|
||||
<li>nv30/draw: allocate vertex buffers in gart</li>
|
||||
<li>nv30/draw: switch varying hookup logic to know about texcoords</li>
|
||||
<li>nv30: falling back to draw path for edgeflag does no good</li>
|
||||
<li>nv30: avoid doing extra work on clear and hitting unexpected states</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Fix implied_mrf_writes for scratch writes</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>st/dri: fix postprocessing crash when there's no depth buffer</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,112 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.5.8 Release Notes / June 20, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.5.8 is a bug fix release which fixes bugs found since the 10.5.7 release.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.5.8 implements the OpenGL 3.3 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
611ddcfa3c1bf13f7e6ccac785c8749c3b74c9a78452bac70f8372cf6b209aa0 mesa-10.5.8.tar.gz
|
||||
2866b855c5299a4aed066338c77ff6467c389b2c30ada7647be8758663da2b54 mesa-10.5.8.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
<p>None</p>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90310">Bug 90310</a> - Fails to build gallium_dri.so at linking stage with clang because of multiple redefinitions</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90347">Bug 90347</a> - [NVE0+] Failure to insert texbar under some circumstances (causing bad colors in Terasology)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90520">Bug 90520</a> - Register spilling clobbers registers used elsewhere in the shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90905">Bug 90905</a> - mesa: Finish subdir-objects transition</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
<p>Ben Widawsky (1):</p>
|
||||
<ul>
|
||||
<li>i965: Disable compaction for EOT send messages</li>
|
||||
</ul>
|
||||
|
||||
<p>Boyan Ding (1):</p>
|
||||
<ul>
|
||||
<li>egl/x11: Set version of swrastLoader to 2</li>
|
||||
</ul>
|
||||
|
||||
<p>Emil Velikov (2):</p>
|
||||
<ul>
|
||||
<li>docs: Add sha256sums for the 10.5.7 release</li>
|
||||
<li>Update version to 10.5.8</li>
|
||||
</ul>
|
||||
|
||||
<p>Erik Faye-Lund (1):</p>
|
||||
<ul>
|
||||
<li>mesa: build xmlconfig to a separate static library</li>
|
||||
</ul>
|
||||
|
||||
<p>Francisco Jerez (1):</p>
|
||||
<ul>
|
||||
<li>i965: Don't compact instructions with unmapped bits.</li>
|
||||
</ul>
|
||||
|
||||
<p>Ilia Mirkin (3):</p>
|
||||
<ul>
|
||||
<li>nvc0/ir: fix collection of first uses for texture barrier insertion</li>
|
||||
<li>nv50,nvc0: clamp uniform size to 64k</li>
|
||||
<li>nvc0/ir: can't have a join on a load with an indirect source</li>
|
||||
</ul>
|
||||
|
||||
<p>Jason Ekstrand (1):</p>
|
||||
<ul>
|
||||
<li>i965/fs: Don't let the EOT send message interfere with the MRF hack</li>
|
||||
</ul>
|
||||
|
||||
<p>Marek Olšák (1):</p>
|
||||
<ul>
|
||||
<li>egl: fix setting context flags</li>
|
||||
</ul>
|
||||
|
||||
<p>Roland Scheidegger (1):</p>
|
||||
<ul>
|
||||
<li>draw: (trivial) fix NULL pointer dereference</li>
|
||||
</ul>
|
||||
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -14,7 +14,7 @@
|
|||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.6.0 Release Notes / TBD</h1>
|
||||
<h1>Mesa 10.6.0 Release Notes / June 14, 2015</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.6.0 is a new development release.
|
||||
|
@ -31,9 +31,10 @@ because compatibility contexts are not supported.
|
|||
</p>
|
||||
|
||||
|
||||
<h2>MD5 checksums</h2>
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
9bc659abdba26202509304f259723aaa4343dba6aac4bd87d5baea11d23c8c63 mesa-10.6.0.tar.gz
|
||||
f37e2633978deed02ff0522abc36c709586e2b555fd439a82ab71dce2c866c76 mesa-10.6.0.tar.xz
|
||||
</pre>
|
||||
|
||||
|
||||
|
@ -48,6 +49,7 @@ Note: some of the new features are only available with certain drivers.
|
|||
<li>GL_ARB_clip_control on i965</li>
|
||||
<li>GL_ARB_depth_buffer_float on freedreno</li>
|
||||
<li>GL_ARB_depth_clamp on freedreno</li>
|
||||
<li>GL_ARB_direct_state_access on all drivers that support GL 2.0+</li>
|
||||
<li>GL_ARB_draw_indirect, GL_ARB_multi_draw_indirect on r600</li>
|
||||
<li>GL_ARB_draw_instanced on freedreno</li>
|
||||
<li>GL_ARB_gpu_shader_fp64 on nvc0, softpipe</li>
|
||||
|
@ -56,6 +58,7 @@ Note: some of the new features are only available with certain drivers.
|
|||
<li>GL_ARB_pipeline_statistics_query on i965, nv50, nvc0, r600, radeonsi, softpipe</li>
|
||||
<li>GL_ARB_program_interface_query (all drivers)</li>
|
||||
<li>GL_ARB_texture_stencil8 on nv50, nvc0, r600, radeonsi, softpipe</li>
|
||||
<li>GL_ARB_texture_view on llvmpipe, softpipe</li>
|
||||
<li>GL_ARB_uniform_buffer_object on freedreno</li>
|
||||
<li>GL_ARB_vertex_attrib_64bit on nvc0, softpipe</li>
|
||||
<li>GL_ARB_viewport_array, GL_AMD_vertex_shader_viewport_index on i965/gen6</li>
|
||||
|
@ -69,7 +72,246 @@ Note: some of the new features are only available with certain drivers.
|
|||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
TBD.
|
||||
<p>This list is likely incomplete.</p>
|
||||
|
||||
<ul>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=15006">Bug 15006</a> - translate & rotate the line cause Aliasing</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=27007">Bug 27007</a> - Lines disappear with GL_LINE_SMOOTH</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=28832">Bug 28832</a> - piglit/general/line-aa-width fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=45348">Bug 45348</a> - [swrast] piglit fbo-drawbuffers-arbfp regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=60797">Bug 60797</a> - 1px lines in octave plot aliased to 0</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=67564">Bug 67564</a> - HiZ buffers are much larger than necessary</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=69226">Bug 69226</a> - Cannot enable basic shaders with Second Life aborts attempt</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=71591">Bug 71591</a> - Second Life shaders fail to compile (extension declared in middle of shader)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=79202">Bug 79202</a> - valgrind errors in glsl-fs-uniform-array-loop-unroll.shader_test; random code generation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=81025">Bug 81025</a> - [IVB/BYT Bisected]Piglit spec_ARB_draw_indirect_arb_draw_indirect-draw-elements-prim-restart-ugly fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82477">Bug 82477</a> - [softpipe] piglit fp-long-alu regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82668">Bug 82668</a> - Can't set int attributes to certain values on 32-bit</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=82831">Bug 82831</a> - i965: Support GL_ARB_blend_func_extended in SIMD16</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=83962">Bug 83962</a> - [HSW/BYT]Piglit spec_ARB_gpu_shader5_arb_gpu_shader5-emitstreamvertex_nodraw fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=84613">Bug 84613</a> - [G965, bisected] piglit regressions : glslparsertest.glsl2</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86747">Bug 86747</a> - Noise in Football Manager 2014 textures</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86792">Bug 86792</a> - [NVC0] Portal 2 Crashes in Wine</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86811">Bug 86811</a> - [BDW/BSW Bisected]Piglit spec_arb_shading_language_packing_execution_built-in-functions_vs-unpackSnorm4x8 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86837">Bug 86837</a> - kodi segfault since auxiliary/vl: rework the build of the VL code</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86944">Bug 86944</a> - glsl_parser_extras.cpp", line 1455: Error: Badly formed expression. (Oracle Studio)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86974">Bug 86974</a> - INTEL_DEBUG=shader_time always asserts in fs_generator::generate_code() when Mesa is built with --enable-debug (= with asserts)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=86980">Bug 86980</a> - [swrast] piglit fp-rfl regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=87258">Bug 87258</a> - [BDW/BSW Bisected]Piglit spec_ARB_shader_atomic_counters_array-indexing fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88246">Bug 88246</a> - Commit 2881b12 causes 43 DrawElements test regressions</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88248">Bug 88248</a> - Calling glClear while there is an occlusion query in progress messes up the results</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88521">Bug 88521</a> - GLBenchmark 2.7 TRex renders with artifacts on Gen8 with !UXA</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88534">Bug 88534</a> - include/c11/threads_posix.h PTHREAD_MUTEX_RECURSIVE_NP not defined</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88561">Bug 88561</a> - [radeonsi][regression,bisected] Depth test/buffer issues in Portal</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88793">Bug 88793</a> - [BDW/BSW Bisected]Piglit/shaders_glsl-max-varyings fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88815">Bug 88815</a> - Incorrect handling of GLSL #line directive</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88883">Bug 88883</a> - ir-a2xx.c: variable changed in assert statement</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88885">Bug 88885</a> - Transform feedback uses incorrect interleaving if a previous draw did not write gl_Position</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88905">Bug 88905</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.packed_pixels.packed_pixels fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=88999">Bug 88999</a> - [SKL] Compiz crashes after opening unity dash</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89014">Bug 89014</a> - PIPE_QUERY_GPU_FINISHED is not acting as expected on SI</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89026">Bug 89026</a> - Renderbuffer layered state used for framebuffer completeness test</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89032">Bug 89032</a> - [BDW/BSW/SKL Bisected]Piglit spec_OpenGL_1.1_infinite-spot-light fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89037">Bug 89037</a> - [SKL]Piglit spec_EXT_texture_array_copyteximage_1D_ARRAY_samples=2 sporadically causes GPU hang</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89039">Bug 89039</a> - [SKL]etqw system hang</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89058">Bug 89058</a> - [SKL]Render error in some games (etqw-demo, nexuiz, portal)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89068">Bug 89068</a> - glTexImage2D regression by texstore_rgba switch to _mesa_format_convert</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89069">Bug 89069</a> - Lack of grass in The Talos Principle on radeonsi (native\wine\nine)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89094">Bug 89094</a> - [SNB/IVB/HSW/BYT Bisected]Ogles3conform ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89095">Bug 89095</a> - [SNB/IVB/BYT Bisected]Webglc conformance/glsl/functions/glsl-function-mix-float.html fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89112">Bug 89112</a> - u_atomic_test: u_atomic_test.c:124: test_atomic_8bits_bool: Assertion `r == 65 && "p_atomic_add"' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89118">Bug 89118</a> - [SKL Bisected]many Ogles3conform cases core dumped</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89131">Bug 89131</a> - [Bisected] Graphical corruption in Weston, shows old framebuffer pieces</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89156">Bug 89156</a> - r300g: GL_COMPRESSED_RED_RGTC1 / ATI1N support broken</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89180">Bug 89180</a> - [IVB regression] Rendering issues in Mass Effect through VMware Workstation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89210">Bug 89210</a> - GS statistics fail on SNB</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89218">Bug 89218</a> - lower_instructions.cpp:648:48: error: invalid suffix 'd' on floating constant</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89224">Bug 89224</a> - Incorrect rendering of Unigine Valley running in VM on VMware Workstation</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89260">Bug 89260</a> - macros.h:34:25: fatal error: util/u_math.h: No such file or directory</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89292">Bug 89292</a> - [regression,bisected] incomplete screenshots in some cases</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89311">Bug 89311</a> - [regression, bisected] dEQP: Added entry points for glCompressedTextureSubImage*D.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89312">Bug 89312</a> - [regression, bisected] main: Added entry points for CopyTextureSubImage*D. (d6b7c40cecfe01)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89315">Bug 89315</a> - [HSW, regression, bisected] i965/fs: Emit MAD instructions when possible.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89317">Bug 89317</a> - [HSW, regression, bisected] i965: Add LINTERP/CINTERP to can_do_cmod() (d91390634)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89328">Bug 89328</a> - python required to build Mesa release tarballs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89342">Bug 89342</a> - main/light.c:159:62: error: 'M_PI' undeclared (first use in this function)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89343">Bug 89343</a> - compiler/tests/radeon_compiler_optimize_tests.c:43:3: error: implicit declaration of function ‘fprintf’ [-Werror=implicit-function-declaration]</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89345">Bug 89345</a> - imports.h:452:58: error: expected declaration specifiers or '...' before 'va_list'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89364">Bug 89364</a> - c99_alloca.h:40:22: fatal error: alloca.h: No such file or directory</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89372">Bug 89372</a> - [softpipe] piglit glsl-1.50 generate-zero-primitives regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89387">Bug 89387</a> - Double delete in lp_bld_misc.cpp</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89416">Bug 89416</a> - UE4Editor crash after load project</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89430">Bug 89430</a> - [g965][bisected] arb_copy_image-targets gl_texture* tests fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89433">Bug 89433</a> - GCC 4.2 does not support -Wvla</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89455">Bug 89455</a> - [NVC0/Gallium] Unigine Heaven black and white boxes</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89457">Bug 89457</a> - [BSW Bisected]ogles3conform ES3-CTS.gtf.GL3Tests.shadow.shadow_execution_vert fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89477">Bug 89477</a> - include/no_extern_c.h:47:1: error: template with C linkage</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89508">Bug 89508</a> - Bad int(floatBitsToInt(vec4))</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89530">Bug 89530</a> - FTBFS in loader: missing fstat</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89569">Bug 89569</a> - Papo & Yo crash on startup [HSW]</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89590">Bug 89590</a> - Crash in glLinkProgram with shaders with multiple constant arrays</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89662">Bug 89662</a> - context.c:943: undefined reference to `_glapi_new_nop_table'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89670">Bug 89670</a> - cmod_propagation_test.andnz_one regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89679">Bug 89679</a> - [NV50] Portal/Half-Life 2 will not start (native Steam)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89689">Bug 89689</a> - [Regression] Weston on DRM backend won't start with new version of mesa</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89722">Bug 89722</a> - [ILK Bisected]Ogles2conform/ES2-CTS.gtf.GL.equal.equal_vec2_frag fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89726">Bug 89726</a> - [Bisected] dEQP-GLES3: uniform linking logic in the presence of structs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89746">Bug 89746</a> - Mesa and LLVM 3.6+ break opengl for genymotion</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89754">Bug 89754</a> - vertexAttrib fails WebGL Conformance test with mesa drivers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89758">Bug 89758</a> - pow WebGL Conformance test with mesa drivers</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89759">Bug 89759</a> - WebGL OGL ES GLSL conformance test with mesa drivers fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89831">Bug 89831</a> - [r600] r600_asm.c:310:assign_alu_units: Assertion `0' failed.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89899">Bug 89899</a> - nir/nir_lower_tex_projector.c:112: error: unknown field ‘ssa’ specified in initializer</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89957">Bug 89957</a> - vm protection faults in piglit lest: texsubimage cube_map_array pbo</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89960">Bug 89960</a> - [softpipe] piglit copy-pixels regreession</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89961">Bug 89961</a> - [BDW/BSW Bisected]Synmark2_v6 OglDrvRes/OglDrvShComp/OglDrvState/OglPSPom Image Validation fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=89963">Bug 89963</a> - lp_bld_debug.cpp:100:31: error: no matching function for call to ‘llvm::raw_ostream::raw_ostream()’</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90000">Bug 90000</a> - [i965 Bisected NIR] Piglit/gglean_fragprog1-z-write_test fail</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90109">Bug 90109</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.uniform_block.random.basic_arrays.3 fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90114">Bug 90114</a> - [SNB+ Bisected]Ogles3conform ES3-CTS.shaders.struct.uniform.sampler_array_fragment fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90130">Bug 90130</a> - gl_PrimitiveId seems to reset at 340</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90147">Bug 90147</a> - swrast: build error undeclared _SC_PHYS_PAGES on osx</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90149">Bug 90149</a> - [SNB+ Bisected]ES3-CTS.gtf.GL3Tests.uniform_buffer_object.uniform_buffer_object_getactiveuniformsiv_for_nonexistent_uniform_indices fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90153">Bug 90153</a> - [SKL Bisected]ES3-CTS.gtf.GL3Tests.uniform_buffer_object.uniform_buffer_object_all_valid_basic_types fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90167">Bug 90167</a> - [softpipe] piglit depthstencil-default_fb-drawpixels-32f_24_8_rev regression</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90207">Bug 90207</a> - [r600g, bisected] regression: NI/Turks crash on WebGL Water (most WebGL stuff)</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90213">Bug 90213</a> - glDrawPixels with GL_COLOR_INDEX never returns.</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90243">Bug 90243</a> - [bisected] regression: spec.!opengl 3_2.get-active-attrib-returns-all-inputs</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90258">Bug 90258</a> - [IVB] spec.glsl-1_10.execution.fs-dfdy-accuracy fails intermittently</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90310">Bug 90310</a> - Fails to build gallium_dri.so at linking stage with clang because of multiple redefinitions</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90350">Bug 90350</a> - [G96] Portal's portal are incorrectly rendered</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90363">Bug 90363</a> - [nv50] HW state is not reset correctly when using a new GL context</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90397">Bug 90397</a> - ARB_program_interface_query: glGetProgramResourceiv() returns wrong value for GL_REFERENCED_BY_*_SHADER prop for GL_UNIFORM for members of an interface block with an instance name</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90466">Bug 90466</a> - arm: linker error ndefined reference to `nir_metadata_preserve'</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90520">Bug 90520</a> - Register spilling clobbers registers used elsewhere in the shader</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90547">Bug 90547</a> - [BDW/BSW/SKL Bisected]Piglit/glean@vertprog1-rsq_test_2_(reciprocal_square_root_of_negative_value) fais</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90580">Bug 90580</a> - [HSW bisected] integer multiplication bug</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90629">Bug 90629</a> - [i965] SIMD16 dual_source_blend assertion `src[i].file != GRF || src[i].width == dst.width' failed</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90749">Bug 90749</a> - [BDW Bisected]dEQP-GLES3.functional.rasterization.fbo.rbo_multisample_max.primitives.lines_wide fails</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90830">Bug 90830</a> - [bsw bisected regression] GPU hang for spec.arb_gpu_shader5.execution.sampler_array_indexing.vs-nonzero-base</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90839">Bug 90839</a> - [10.5.5/10.6 regression, bisected] PBO glDrawPixels no longer using blit fastpath</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=90905">Bug 90905</a> - mesa: Finish subdir-objects transition</li>
|
||||
|
||||
<li><a href="https://bugs.freedesktop.org/show_bug.cgi?id=9951">Bug 9951</a> - GL_LINE_SMOOTH and GL_POLYGON_SMOOTH with i965 driver</li>
|
||||
|
||||
</ul>
|
||||
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
|
|
|
@ -0,0 +1,61 @@
|
|||
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta http-equiv="content-type" content="text/html; charset=utf-8">
|
||||
<title>Mesa Release Notes</title>
|
||||
<link rel="stylesheet" type="text/css" href="../mesa.css">
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="header">
|
||||
<h1>The Mesa 3D Graphics Library</h1>
|
||||
</div>
|
||||
|
||||
<iframe src="../contents.html"></iframe>
|
||||
<div class="content">
|
||||
|
||||
<h1>Mesa 10.7.0 Release Notes / TBD</h1>
|
||||
|
||||
<p>
|
||||
Mesa 10.7.0 is a new development release.
|
||||
People who are concerned with stability and reliability should stick
|
||||
with a previous release or wait for Mesa 10.7.1.
|
||||
</p>
|
||||
<p>
|
||||
Mesa 10.7.0 implements the OpenGL 3.3 API, but the version reported by
|
||||
glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
|
||||
glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
|
||||
Some drivers don't support all the features required in OpenGL 3.3. OpenGL
|
||||
3.3 is <strong>only</strong> available if requested at context creation
|
||||
because compatibility contexts are not supported.
|
||||
</p>
|
||||
|
||||
|
||||
<h2>SHA256 checksums</h2>
|
||||
<pre>
|
||||
TBD.
|
||||
</pre>
|
||||
|
||||
|
||||
<h2>New features</h2>
|
||||
|
||||
<p>
|
||||
Note: some of the new features are only available with certain drivers.
|
||||
</p>
|
||||
|
||||
<ul>
|
||||
<li>GL_ARB_framebuffer_no_attachments on i965</li>
|
||||
<li>GL_ARB_shader_stencil_export on llvmpipe</li>
|
||||
</ul>
|
||||
|
||||
<h2>Bug fixes</h2>
|
||||
|
||||
TBD.
|
||||
|
||||
<h2>Changes</h2>
|
||||
|
||||
TBD.
|
||||
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
|
@ -1,11 +1,12 @@
|
|||
/* -*- mode: c; tab-width: 8; -*- */
|
||||
/* vi: set sw=4 ts=8: */
|
||||
/* Reference version of egl.h for EGL 1.4.
|
||||
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
|
||||
*/
|
||||
#ifndef __egl_h_
|
||||
#define __egl_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
** Copyright (c) 2013-2014 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
|
@ -26,304 +27,277 @@
|
|||
** TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
/*
|
||||
** This header is generated from the Khronos OpenGL / OpenGL ES XML
|
||||
** API Registry. The current version of the Registry, generator scripts
|
||||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision: 31039 $ on $Date: 2015-05-04 17:01:57 -0700 (Mon, 04 May 2015) $
|
||||
*/
|
||||
|
||||
#ifndef __egl_h_
|
||||
#define __egl_h_
|
||||
|
||||
/* All platform-dependent types and macro boilerplate (such as EGLAPI
|
||||
* and EGLAPIENTRY) should go in eglplatform.h.
|
||||
*/
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
/* Generated on date 20150504 */
|
||||
|
||||
/* EGL Types */
|
||||
/* EGLint is defined in eglplatform.h */
|
||||
/* Generated C header for:
|
||||
* API: egl
|
||||
* Versions considered: .*
|
||||
* Versions emitted: .*
|
||||
* Default extensions included: None
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef EGL_VERSION_1_0
|
||||
#define EGL_VERSION_1_0 1
|
||||
typedef unsigned int EGLBoolean;
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLContext;
|
||||
typedef void *EGLDisplay;
|
||||
#include <KHR/khrplatform.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLSurface;
|
||||
typedef void *EGLClientBuffer;
|
||||
|
||||
/* EGL Versioning */
|
||||
#define EGL_VERSION_1_0 1
|
||||
#define EGL_VERSION_1_1 1
|
||||
#define EGL_VERSION_1_2 1
|
||||
#define EGL_VERSION_1_3 1
|
||||
#define EGL_VERSION_1_4 1
|
||||
|
||||
/* EGL Enumerants. Bitmasks and other exceptional cases aside, most
|
||||
* enums are assigned unique values starting at 0x3000.
|
||||
*/
|
||||
|
||||
/* EGL aliases */
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_TRUE 1
|
||||
|
||||
/* Out-of-band handle values */
|
||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||
|
||||
/* Out-of-band attribute value */
|
||||
#define EGL_DONT_CARE ((EGLint)-1)
|
||||
|
||||
/* Errors / GetError return values */
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_CONTEXT_LOST 0x300E /* EGL 1.1 - IMG_power_management */
|
||||
|
||||
/* Reserved 0x300F-0x301F for additional errors */
|
||||
|
||||
/* Config attributes */
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_NONE 0x3038 /* Attrib list terminator */
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041 /* Pseudo-attribute (not queryable) */
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
|
||||
/* Reserved 0x3041-0x304F for additional config attributes */
|
||||
|
||||
/* Config attribute values */
|
||||
#define EGL_SLOW_CONFIG 0x3050 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051 /* EGL_CONFIG_CAVEAT value */
|
||||
#define EGL_TRANSPARENT_RGB 0x3052 /* EGL_TRANSPARENT_TYPE value */
|
||||
#define EGL_RGB_BUFFER 0x308E /* EGL_COLOR_BUFFER_TYPE value */
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F /* EGL_COLOR_BUFFER_TYPE value */
|
||||
|
||||
/* More config attribute values, for EGL_TEXTURE_FORMAT */
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
|
||||
/* Config attribute mask bits */
|
||||
#define EGL_PBUFFER_BIT 0x0001 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_PIXMAP_BIT 0x0002 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_WINDOW_BIT 0x0004 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200 /* EGL_SURFACE_TYPE mask bits */
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400 /* EGL_SURFACE_TYPE mask bits */
|
||||
|
||||
#define EGL_OPENGL_ES_BIT 0x0001 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENVG_BIT 0x0002 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
#define EGL_OPENGL_BIT 0x0008 /* EGL_RENDERABLE_TYPE mask bits */
|
||||
|
||||
/* QueryString targets */
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
|
||||
/* QuerySurface / SurfaceAttrib / CreatePbufferSurface targets */
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
|
||||
/* EGL_RENDER_BUFFER values / BindTexImage / ReleaseTexImage buffer targets */
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
|
||||
/* OpenVG color spaces */
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089 /* EGL_VG_COLORSPACE value */
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A /* EGL_VG_COLORSPACE value */
|
||||
|
||||
/* OpenVG alpha formats */
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B /* EGL_ALPHA_FORMAT value */
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C /* EGL_ALPHA_FORMAT value */
|
||||
|
||||
/* Constant scale factor by which fractional display resolutions &
|
||||
* aspect ratio are scaled when queried as integer values.
|
||||
*/
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
|
||||
/* Unknown display resolution/aspect ratio */
|
||||
#define EGL_UNKNOWN ((EGLint)-1)
|
||||
|
||||
/* Back buffer swap behaviors */
|
||||
#define EGL_BUFFER_PRESERVED 0x3094 /* EGL_SWAP_BEHAVIOR value */
|
||||
#define EGL_BUFFER_DESTROYED 0x3095 /* EGL_SWAP_BEHAVIOR value */
|
||||
|
||||
/* CreatePbufferFromClientBuffer buffer types */
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
|
||||
/* QueryContext targets */
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
|
||||
/* CreateContext attributes */
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
|
||||
/* Multisample resolution behaviors */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B /* EGL_MULTISAMPLE_RESOLVE value */
|
||||
|
||||
/* BindAPI/QueryAPI targets */
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
|
||||
/* GetCurrentSurface targets */
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_READ 0x305A
|
||||
|
||||
/* WaitNative engines */
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
|
||||
/* EGL 1.2 tokens renamed for consistency in EGL 1.3 */
|
||||
#define EGL_COLORSPACE EGL_VG_COLORSPACE
|
||||
#define EGL_ALPHA_FORMAT EGL_VG_ALPHA_FORMAT
|
||||
#define EGL_COLORSPACE_sRGB EGL_VG_COLORSPACE_sRGB
|
||||
#define EGL_COLORSPACE_LINEAR EGL_VG_COLORSPACE_LINEAR
|
||||
#define EGL_ALPHA_FORMAT_NONPRE EGL_VG_ALPHA_FORMAT_NONPRE
|
||||
#define EGL_ALPHA_FORMAT_PRE EGL_VG_ALPHA_FORMAT_PRE
|
||||
|
||||
/* EGL extensions must request enum blocks from the Khronos
|
||||
* API Registrar, who maintains the enumerant registry. Submit
|
||||
* a bug in Khronos Bugzilla against task "Registry".
|
||||
*/
|
||||
|
||||
|
||||
|
||||
/* EGL Functions */
|
||||
|
||||
EGLAPI EGLint EGLAPIENTRY eglGetError(void);
|
||||
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay(EGLNativeDisplayType display_id);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize(EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate(EGLDisplay dpy);
|
||||
|
||||
EGLAPI const char * EGLAPIENTRY eglQueryString(EGLDisplay dpy, EGLint name);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs(EGLDisplay dpy, EGLConfig *configs,
|
||||
EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig(EGLDisplay dpy, const EGLint *attrib_list,
|
||||
EGLConfig *configs, EGLint config_size,
|
||||
EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativeWindowType win,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config,
|
||||
EGLNativePixmapType pixmap,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI(EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient(void);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread(void);
|
||||
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer(
|
||||
EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer,
|
||||
EGLConfig config, const EGLint *attrib_list);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval(EGLDisplay dpy, EGLint interval);
|
||||
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext(EGLDisplay dpy, EGLConfig config,
|
||||
EGLContext share_context,
|
||||
const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext(EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent(EGLDisplay dpy, EGLSurface draw,
|
||||
EGLSurface read, EGLContext ctx);
|
||||
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext(void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface(EGLint readdraw);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext(EGLDisplay dpy, EGLContext ctx,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL(void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative(EGLint engine);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers(EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers(EGLDisplay dpy, EGLSurface surface,
|
||||
EGLNativePixmapType target);
|
||||
|
||||
/* This is a generic function pointer type, whose name indicates it must
|
||||
* be cast to the proper type *and calling convention* before use.
|
||||
*/
|
||||
typedef void *EGLContext;
|
||||
typedef void (*__eglMustCastToProperFunctionPointerType)(void);
|
||||
#define EGL_ALPHA_SIZE 0x3021
|
||||
#define EGL_BAD_ACCESS 0x3002
|
||||
#define EGL_BAD_ALLOC 0x3003
|
||||
#define EGL_BAD_ATTRIBUTE 0x3004
|
||||
#define EGL_BAD_CONFIG 0x3005
|
||||
#define EGL_BAD_CONTEXT 0x3006
|
||||
#define EGL_BAD_CURRENT_SURFACE 0x3007
|
||||
#define EGL_BAD_DISPLAY 0x3008
|
||||
#define EGL_BAD_MATCH 0x3009
|
||||
#define EGL_BAD_NATIVE_PIXMAP 0x300A
|
||||
#define EGL_BAD_NATIVE_WINDOW 0x300B
|
||||
#define EGL_BAD_PARAMETER 0x300C
|
||||
#define EGL_BAD_SURFACE 0x300D
|
||||
#define EGL_BLUE_SIZE 0x3022
|
||||
#define EGL_BUFFER_SIZE 0x3020
|
||||
#define EGL_CONFIG_CAVEAT 0x3027
|
||||
#define EGL_CONFIG_ID 0x3028
|
||||
#define EGL_CORE_NATIVE_ENGINE 0x305B
|
||||
#define EGL_DEPTH_SIZE 0x3025
|
||||
#define EGL_DONT_CARE ((EGLint)-1)
|
||||
#define EGL_DRAW 0x3059
|
||||
#define EGL_EXTENSIONS 0x3055
|
||||
#define EGL_FALSE 0
|
||||
#define EGL_GREEN_SIZE 0x3023
|
||||
#define EGL_HEIGHT 0x3056
|
||||
#define EGL_LARGEST_PBUFFER 0x3058
|
||||
#define EGL_LEVEL 0x3029
|
||||
#define EGL_MAX_PBUFFER_HEIGHT 0x302A
|
||||
#define EGL_MAX_PBUFFER_PIXELS 0x302B
|
||||
#define EGL_MAX_PBUFFER_WIDTH 0x302C
|
||||
#define EGL_NATIVE_RENDERABLE 0x302D
|
||||
#define EGL_NATIVE_VISUAL_ID 0x302E
|
||||
#define EGL_NATIVE_VISUAL_TYPE 0x302F
|
||||
#define EGL_NONE 0x3038
|
||||
#define EGL_NON_CONFORMANT_CONFIG 0x3051
|
||||
#define EGL_NOT_INITIALIZED 0x3001
|
||||
#define EGL_NO_CONTEXT ((EGLContext)0)
|
||||
#define EGL_NO_DISPLAY ((EGLDisplay)0)
|
||||
#define EGL_NO_SURFACE ((EGLSurface)0)
|
||||
#define EGL_PBUFFER_BIT 0x0001
|
||||
#define EGL_PIXMAP_BIT 0x0002
|
||||
#define EGL_READ 0x305A
|
||||
#define EGL_RED_SIZE 0x3024
|
||||
#define EGL_SAMPLES 0x3031
|
||||
#define EGL_SAMPLE_BUFFERS 0x3032
|
||||
#define EGL_SLOW_CONFIG 0x3050
|
||||
#define EGL_STENCIL_SIZE 0x3026
|
||||
#define EGL_SUCCESS 0x3000
|
||||
#define EGL_SURFACE_TYPE 0x3033
|
||||
#define EGL_TRANSPARENT_BLUE_VALUE 0x3035
|
||||
#define EGL_TRANSPARENT_GREEN_VALUE 0x3036
|
||||
#define EGL_TRANSPARENT_RED_VALUE 0x3037
|
||||
#define EGL_TRANSPARENT_RGB 0x3052
|
||||
#define EGL_TRANSPARENT_TYPE 0x3034
|
||||
#define EGL_TRUE 1
|
||||
#define EGL_VENDOR 0x3053
|
||||
#define EGL_VERSION 0x3054
|
||||
#define EGL_WIDTH 0x3057
|
||||
#define EGL_WINDOW_BIT 0x0004
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseConfig (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyBuffers (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
EGLAPI EGLContext EGLAPIENTRY eglCreateContext (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferSurface (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePixmapSurface (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateWindowSurface (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyContext (EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySurface (EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigAttrib (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetConfigs (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetCurrentDisplay (void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglGetCurrentSurface (EGLint readdraw);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetDisplay (EGLNativeDisplayType display_id);
|
||||
EGLAPI EGLint EGLAPIENTRY eglGetError (void);
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY eglGetProcAddress (const char *procname);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglInitialize (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglMakeCurrent (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryContext (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryString (EGLDisplay dpy, EGLint name);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffers (EGLDisplay dpy, EGLSurface surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglTerminate (EGLDisplay dpy);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitGL (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitNative (EGLint engine);
|
||||
#endif /* EGL_VERSION_1_0 */
|
||||
|
||||
/* Now, define eglGetProcAddress using the generic function ptr. type */
|
||||
EGLAPI __eglMustCastToProperFunctionPointerType EGLAPIENTRY
|
||||
eglGetProcAddress(const char *procname);
|
||||
#ifndef EGL_VERSION_1_1
|
||||
#define EGL_VERSION_1_1 1
|
||||
#define EGL_BACK_BUFFER 0x3084
|
||||
#define EGL_BIND_TO_TEXTURE_RGB 0x3039
|
||||
#define EGL_BIND_TO_TEXTURE_RGBA 0x303A
|
||||
#define EGL_CONTEXT_LOST 0x300E
|
||||
#define EGL_MIN_SWAP_INTERVAL 0x303B
|
||||
#define EGL_MAX_SWAP_INTERVAL 0x303C
|
||||
#define EGL_MIPMAP_TEXTURE 0x3082
|
||||
#define EGL_MIPMAP_LEVEL 0x3083
|
||||
#define EGL_NO_TEXTURE 0x305C
|
||||
#define EGL_TEXTURE_2D 0x305F
|
||||
#define EGL_TEXTURE_FORMAT 0x3080
|
||||
#define EGL_TEXTURE_RGB 0x305D
|
||||
#define EGL_TEXTURE_RGBA 0x305E
|
||||
#define EGL_TEXTURE_TARGET 0x3081
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseTexImage (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSurfaceAttrib (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapInterval (EGLDisplay dpy, EGLint interval);
|
||||
#endif /* EGL_VERSION_1_1 */
|
||||
|
||||
#ifndef EGL_VERSION_1_2
|
||||
#define EGL_VERSION_1_2 1
|
||||
typedef unsigned int EGLenum;
|
||||
typedef void *EGLClientBuffer;
|
||||
#define EGL_ALPHA_FORMAT 0x3088
|
||||
#define EGL_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_ALPHA_MASK_SIZE 0x303E
|
||||
#define EGL_BUFFER_PRESERVED 0x3094
|
||||
#define EGL_BUFFER_DESTROYED 0x3095
|
||||
#define EGL_CLIENT_APIS 0x308D
|
||||
#define EGL_COLORSPACE 0x3087
|
||||
#define EGL_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_COLOR_BUFFER_TYPE 0x303F
|
||||
#define EGL_CONTEXT_CLIENT_TYPE 0x3097
|
||||
#define EGL_DISPLAY_SCALING 10000
|
||||
#define EGL_HORIZONTAL_RESOLUTION 0x3090
|
||||
#define EGL_LUMINANCE_BUFFER 0x308F
|
||||
#define EGL_LUMINANCE_SIZE 0x303D
|
||||
#define EGL_OPENGL_ES_BIT 0x0001
|
||||
#define EGL_OPENVG_BIT 0x0002
|
||||
#define EGL_OPENGL_ES_API 0x30A0
|
||||
#define EGL_OPENVG_API 0x30A1
|
||||
#define EGL_OPENVG_IMAGE 0x3096
|
||||
#define EGL_PIXEL_ASPECT_RATIO 0x3092
|
||||
#define EGL_RENDERABLE_TYPE 0x3040
|
||||
#define EGL_RENDER_BUFFER 0x3086
|
||||
#define EGL_RGB_BUFFER 0x308E
|
||||
#define EGL_SINGLE_BUFFER 0x3085
|
||||
#define EGL_SWAP_BEHAVIOR 0x3093
|
||||
#define EGL_UNKNOWN ((EGLint)-1)
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglBindAPI (EGLenum api);
|
||||
EGLAPI EGLenum EGLAPIENTRY eglQueryAPI (void);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePbufferFromClientBuffer (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseThread (void);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitClient (void);
|
||||
#endif /* EGL_VERSION_1_2 */
|
||||
|
||||
#ifndef EGL_VERSION_1_3
|
||||
#define EGL_VERSION_1_3 1
|
||||
#define EGL_CONFORMANT 0x3042
|
||||
#define EGL_CONTEXT_CLIENT_VERSION 0x3098
|
||||
#define EGL_MATCH_NATIVE_PIXMAP 0x3041
|
||||
#define EGL_OPENGL_ES2_BIT 0x0004
|
||||
#define EGL_VG_ALPHA_FORMAT 0x3088
|
||||
#define EGL_VG_ALPHA_FORMAT_NONPRE 0x308B
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE 0x308C
|
||||
#define EGL_VG_ALPHA_FORMAT_PRE_BIT 0x0040
|
||||
#define EGL_VG_COLORSPACE 0x3087
|
||||
#define EGL_VG_COLORSPACE_sRGB 0x3089
|
||||
#define EGL_VG_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_VG_COLORSPACE_LINEAR_BIT 0x0020
|
||||
#endif /* EGL_VERSION_1_3 */
|
||||
|
||||
#ifndef EGL_VERSION_1_4
|
||||
#define EGL_VERSION_1_4 1
|
||||
#define EGL_DEFAULT_DISPLAY ((EGLNativeDisplayType)0)
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX_BIT 0x0200
|
||||
#define EGL_MULTISAMPLE_RESOLVE 0x3099
|
||||
#define EGL_MULTISAMPLE_RESOLVE_DEFAULT 0x309A
|
||||
#define EGL_MULTISAMPLE_RESOLVE_BOX 0x309B
|
||||
#define EGL_OPENGL_API 0x30A2
|
||||
#define EGL_OPENGL_BIT 0x0008
|
||||
#define EGL_SWAP_BEHAVIOR_PRESERVED_BIT 0x0400
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
|
||||
#endif /* EGL_VERSION_1_4 */
|
||||
|
||||
#ifndef EGL_VERSION_1_5
|
||||
#define EGL_VERSION_1_5 1
|
||||
typedef void *EGLSync;
|
||||
typedef intptr_t EGLAttrib;
|
||||
typedef khronos_utime_nanoseconds_t EGLTime;
|
||||
typedef void *EGLImage;
|
||||
#define EGL_CONTEXT_MAJOR_VERSION 0x3098
|
||||
#define EGL_CONTEXT_MINOR_VERSION 0x30FB
|
||||
#define EGL_CONTEXT_OPENGL_PROFILE_MASK 0x30FD
|
||||
#define EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY 0x31BD
|
||||
#define EGL_NO_RESET_NOTIFICATION 0x31BE
|
||||
#define EGL_LOSE_CONTEXT_ON_RESET 0x31BF
|
||||
#define EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT 0x00000001
|
||||
#define EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT 0x00000002
|
||||
#define EGL_CONTEXT_OPENGL_DEBUG 0x31B0
|
||||
#define EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE 0x31B1
|
||||
#define EGL_CONTEXT_OPENGL_ROBUST_ACCESS 0x31B2
|
||||
#define EGL_OPENGL_ES3_BIT 0x00000040
|
||||
#define EGL_CL_EVENT_HANDLE 0x309C
|
||||
#define EGL_SYNC_CL_EVENT 0x30FE
|
||||
#define EGL_SYNC_CL_EVENT_COMPLETE 0x30FF
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE 0x30F0
|
||||
#define EGL_SYNC_TYPE 0x30F7
|
||||
#define EGL_SYNC_STATUS 0x30F1
|
||||
#define EGL_SYNC_CONDITION 0x30F8
|
||||
#define EGL_SIGNALED 0x30F2
|
||||
#define EGL_UNSIGNALED 0x30F3
|
||||
#define EGL_SYNC_FLUSH_COMMANDS_BIT 0x0001
|
||||
#define EGL_FOREVER 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_TIMEOUT_EXPIRED 0x30F5
|
||||
#define EGL_CONDITION_SATISFIED 0x30F6
|
||||
#define EGL_NO_SYNC ((EGLSync)0)
|
||||
#define EGL_SYNC_FENCE 0x30F9
|
||||
#define EGL_GL_COLORSPACE 0x309D
|
||||
#define EGL_GL_COLORSPACE_SRGB 0x3089
|
||||
#define EGL_GL_COLORSPACE_LINEAR 0x308A
|
||||
#define EGL_GL_RENDERBUFFER 0x30B9
|
||||
#define EGL_GL_TEXTURE_2D 0x30B1
|
||||
#define EGL_GL_TEXTURE_LEVEL 0x30BC
|
||||
#define EGL_GL_TEXTURE_3D 0x30B2
|
||||
#define EGL_GL_TEXTURE_ZOFFSET 0x30BD
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x30B3
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x30B4
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x30B5
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x30B6
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x30B7
|
||||
#define EGL_GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x30B8
|
||||
#define EGL_IMAGE_PRESERVED 0x30D2
|
||||
#define EGL_NO_IMAGE ((EGLImage)0)
|
||||
EGLAPI EGLSync EGLAPIENTRY eglCreateSync (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySync (EGLDisplay dpy, EGLSync sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttrib (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
EGLAPI EGLImage EGLAPIENTRY eglCreateImage (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroyImage (EGLDisplay dpy, EGLImage image);
|
||||
EGLAPI EGLDisplay EGLAPIENTRY eglGetPlatformDisplay (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformWindowSurface (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurface (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglWaitSync (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#endif /* EGL_VERSION_1_5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __egl_h_ */
|
||||
#endif
|
||||
|
|
|
@ -6,7 +6,7 @@ extern "C" {
|
|||
#endif
|
||||
|
||||
/*
|
||||
** Copyright (c) 2013 The Khronos Group Inc.
|
||||
** Copyright (c) 2013-2014 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
|
@ -33,12 +33,12 @@ extern "C" {
|
|||
** used to make the header, and the header can be found at
|
||||
** http://www.opengl.org/registry/
|
||||
**
|
||||
** Khronos $Revision: 24567 $ on $Date: 2013-12-18 09:50:17 -0800 (Wed, 18 Dec 2013) $
|
||||
** Khronos $Revision$ on $Date$
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#define EGL_EGLEXT_VERSION 20131218
|
||||
#define EGL_EGLEXT_VERSION 20150508
|
||||
|
||||
/* Generated C header for:
|
||||
* API: egl
|
||||
|
@ -94,12 +94,28 @@ EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSync64KHR (EGLDisplay dpy, EGLenum type,
|
|||
#define EGL_OPENGL_ES3_BIT_KHR 0x00000040
|
||||
#endif /* EGL_KHR_create_context */
|
||||
|
||||
#ifndef EGL_KHR_create_context_no_error
|
||||
#define EGL_KHR_create_context_no_error 1
|
||||
#define EGL_CONTEXT_OPENGL_NO_ERROR_KHR 0x31B3
|
||||
#endif /* EGL_KHR_create_context_no_error */
|
||||
|
||||
#ifndef EGL_KHR_fence_sync
|
||||
#define EGL_KHR_fence_sync 1
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
#ifdef KHRONOS_SUPPORT_INT64
|
||||
#define EGL_SYNC_PRIOR_COMMANDS_COMPLETE_KHR 0x30F0
|
||||
#define EGL_SYNC_CONDITION_KHR 0x30F8
|
||||
#define EGL_SYNC_FENCE_KHR 0x30F9
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif /* KHRONOS_SUPPORT_INT64 */
|
||||
#endif /* EGL_KHR_fence_sync */
|
||||
|
||||
|
@ -207,9 +223,38 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurface64KHR (EGLDisplay dpy, EGLSurface s
|
|||
#endif
|
||||
#endif /* EGL_KHR_lock_surface3 */
|
||||
|
||||
#ifndef EGL_KHR_partial_update
|
||||
#define EGL_KHR_partial_update 1
|
||||
#define EGL_BUFFER_AGE_KHR 0x313D
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSETDAMAGEREGIONKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSetDamageRegionKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
#endif
|
||||
#endif /* EGL_KHR_partial_update */
|
||||
|
||||
#ifndef EGL_KHR_platform_android
|
||||
#define EGL_KHR_platform_android 1
|
||||
#define EGL_PLATFORM_ANDROID_KHR 0x3141
|
||||
#endif /* EGL_KHR_platform_android */
|
||||
|
||||
#ifndef EGL_KHR_platform_gbm
|
||||
#define EGL_KHR_platform_gbm 1
|
||||
#define EGL_PLATFORM_GBM_KHR 0x31D7
|
||||
#endif /* EGL_KHR_platform_gbm */
|
||||
|
||||
#ifndef EGL_KHR_platform_wayland
|
||||
#define EGL_KHR_platform_wayland 1
|
||||
#define EGL_PLATFORM_WAYLAND_KHR 0x31D8
|
||||
#endif /* EGL_KHR_platform_wayland */
|
||||
|
||||
#ifndef EGL_KHR_platform_x11
|
||||
#define EGL_KHR_platform_x11 1
|
||||
#define EGL_PLATFORM_X11_KHR 0x31D5
|
||||
#define EGL_PLATFORM_X11_SCREEN_KHR 0x31D6
|
||||
#endif /* EGL_KHR_platform_x11 */
|
||||
|
||||
#ifndef EGL_KHR_reusable_sync
|
||||
#define EGL_KHR_reusable_sync 1
|
||||
typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
||||
#ifdef KHRONOS_SUPPORT_INT64
|
||||
#define EGL_SYNC_STATUS_KHR 0x30F1
|
||||
#define EGL_SIGNALED_KHR 0x30F2
|
||||
|
@ -221,17 +266,9 @@ typedef khronos_utime_nanoseconds_t EGLTimeKHR;
|
|||
#define EGL_SYNC_FLUSH_COMMANDS_BIT_KHR 0x0001
|
||||
#define EGL_FOREVER_KHR 0xFFFFFFFFFFFFFFFFull
|
||||
#define EGL_NO_SYNC_KHR ((EGLSyncKHR)0)
|
||||
typedef EGLSyncKHR (EGLAPIENTRYP PFNEGLCREATESYNCKHRPROC) (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSIGNALSYNCKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBKHRPROC) (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLSyncKHR EGLAPIENTRY eglCreateSyncKHR (EGLDisplay dpy, EGLenum type, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglDestroySyncKHR (EGLDisplay dpy, EGLSyncKHR sync);
|
||||
EGLAPI EGLint EGLAPIENTRY eglClientWaitSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint flags, EGLTimeKHR timeout);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSignalSyncKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLenum mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncAttribKHR (EGLDisplay dpy, EGLSyncKHR sync, EGLint attribute, EGLint *value);
|
||||
#endif
|
||||
#endif /* KHRONOS_SUPPORT_INT64 */
|
||||
#endif /* EGL_KHR_reusable_sync */
|
||||
|
@ -333,6 +370,14 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreateStreamProducerSurfaceKHR (EGLDisplay dpy,
|
|||
#define EGL_KHR_surfaceless_context 1
|
||||
#endif /* EGL_KHR_surfaceless_context */
|
||||
|
||||
#ifndef EGL_KHR_swap_buffers_with_damage
|
||||
#define EGL_KHR_swap_buffers_with_damage 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEKHRPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageKHR (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
#endif
|
||||
#endif /* EGL_KHR_swap_buffers_with_damage */
|
||||
|
||||
#ifndef EGL_KHR_vg_parent_image
|
||||
#define EGL_KHR_vg_parent_image 1
|
||||
#define EGL_VG_PARENT_IMAGE_KHR 0x30BA
|
||||
|
@ -389,6 +434,12 @@ EGLAPI EGLint EGLAPIENTRY eglDupNativeFenceFDANDROID (EGLDisplay dpy, EGLSyncKHR
|
|||
#define EGL_D3D_TEXTURE_2D_SHARE_HANDLE_ANGLE 0x3200
|
||||
#endif /* EGL_ANGLE_d3d_share_handle_client_buffer */
|
||||
|
||||
#ifndef EGL_ANGLE_device_d3d
|
||||
#define EGL_ANGLE_device_d3d 1
|
||||
#define EGL_D3D9_DEVICE_ANGLE 0x33A0
|
||||
#define EGL_D3D11_DEVICE_ANGLE 0x33A1
|
||||
#endif /* EGL_ANGLE_device_d3d */
|
||||
|
||||
#ifndef EGL_ANGLE_query_surface_pointer
|
||||
#define EGL_ANGLE_query_surface_pointer 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPOINTERANGLEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, void **value);
|
||||
|
@ -401,6 +452,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
|
|||
#define EGL_ANGLE_surface_d3d_texture_2d_share_handle 1
|
||||
#endif /* EGL_ANGLE_surface_d3d_texture_2d_share_handle */
|
||||
|
||||
#ifndef EGL_ANGLE_window_fixed_size
|
||||
#define EGL_ANGLE_window_fixed_size 1
|
||||
#define EGL_FIXED_SIZE_ANGLE 0x3201
|
||||
#endif /* EGL_ANGLE_window_fixed_size */
|
||||
|
||||
#ifndef EGL_ARM_pixmap_multisample_discard
|
||||
#define EGL_ARM_pixmap_multisample_discard 1
|
||||
#define EGL_DISCARD_SAMPLES_ARM 0x3286
|
||||
|
@ -423,6 +479,42 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
|
|||
#define EGL_LOSE_CONTEXT_ON_RESET_EXT 0x31BF
|
||||
#endif /* EGL_EXT_create_context_robustness */
|
||||
|
||||
#ifndef EGL_EXT_device_base
|
||||
#define EGL_EXT_device_base 1
|
||||
typedef void *EGLDeviceEXT;
|
||||
#define EGL_NO_DEVICE_EXT ((EGLDeviceEXT)(0))
|
||||
#define EGL_BAD_DEVICE_EXT 0x322B
|
||||
#define EGL_DEVICE_EXT 0x322C
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICEATTRIBEXTPROC) (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYDEVICESTRINGEXTPROC) (EGLDeviceEXT device, EGLint name);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDEVICESEXTPROC) (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBEXTPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDeviceAttribEXT (EGLDeviceEXT device, EGLint attribute, EGLAttrib *value);
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryDeviceStringEXT (EGLDeviceEXT device, EGLint name);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDevicesEXT (EGLint max_devices, EGLDeviceEXT *devices, EGLint *num_devices);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribEXT (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#endif
|
||||
#endif /* EGL_EXT_device_base */
|
||||
|
||||
#ifndef EGL_EXT_device_drm
|
||||
#define EGL_EXT_device_drm 1
|
||||
#define EGL_DRM_DEVICE_FILE_EXT 0x3233
|
||||
#endif /* EGL_EXT_device_drm */
|
||||
|
||||
#ifndef EGL_EXT_device_enumeration
|
||||
#define EGL_EXT_device_enumeration 1
|
||||
#endif /* EGL_EXT_device_enumeration */
|
||||
|
||||
#ifndef EGL_EXT_device_openwf
|
||||
#define EGL_EXT_device_openwf 1
|
||||
#define EGL_OPENWF_DEVICE_ID_EXT 0x3237
|
||||
#endif /* EGL_EXT_device_openwf */
|
||||
|
||||
#ifndef EGL_EXT_device_query
|
||||
#define EGL_EXT_device_query 1
|
||||
#endif /* EGL_EXT_device_query */
|
||||
|
||||
#ifndef EGL_EXT_image_dma_buf_import
|
||||
#define EGL_EXT_image_dma_buf_import 1
|
||||
#define EGL_LINUX_DMA_BUF_EXT 0x3270
|
||||
|
@ -454,6 +546,48 @@ EGLAPI EGLBoolean EGLAPIENTRY eglQuerySurfacePointerANGLE (EGLDisplay dpy, EGLSu
|
|||
#define EGL_MULTIVIEW_VIEW_COUNT_EXT 0x3134
|
||||
#endif /* EGL_EXT_multiview_window */
|
||||
|
||||
#ifndef EGL_EXT_output_base
|
||||
#define EGL_EXT_output_base 1
|
||||
typedef void *EGLOutputLayerEXT;
|
||||
typedef void *EGLOutputPortEXT;
|
||||
#define EGL_NO_OUTPUT_LAYER_EXT ((EGLOutputLayerEXT)0)
|
||||
#define EGL_NO_OUTPUT_PORT_EXT ((EGLOutputPortEXT)0)
|
||||
#define EGL_BAD_OUTPUT_LAYER_EXT 0x322D
|
||||
#define EGL_BAD_OUTPUT_PORT_EXT 0x322E
|
||||
#define EGL_SWAP_INTERVAL_EXT 0x322F
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTLAYERSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETOUTPUTPORTSEXTPROC) (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTLAYERSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTATTRIBEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYOUTPUTPORTSTRINGEXTPROC) (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputLayersEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputLayerEXT *layers, EGLint max_layers, EGLint *num_layers);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetOutputPortsEXT (EGLDisplay dpy, const EGLAttrib *attrib_list, EGLOutputPortEXT *ports, EGLint max_ports, EGLint *num_ports);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputLayerAttribEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint attribute, EGLAttrib *value);
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryOutputLayerStringEXT (EGLDisplay dpy, EGLOutputLayerEXT layer, EGLint name);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryOutputPortAttribEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint attribute, EGLAttrib *value);
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryOutputPortStringEXT (EGLDisplay dpy, EGLOutputPortEXT port, EGLint name);
|
||||
#endif
|
||||
#endif /* EGL_EXT_output_base */
|
||||
|
||||
#ifndef EGL_EXT_output_drm
|
||||
#define EGL_EXT_output_drm 1
|
||||
#define EGL_DRM_CRTC_EXT 0x3234
|
||||
#define EGL_DRM_PLANE_EXT 0x3235
|
||||
#define EGL_DRM_CONNECTOR_EXT 0x3236
|
||||
#endif /* EGL_EXT_output_drm */
|
||||
|
||||
#ifndef EGL_EXT_output_openwf
|
||||
#define EGL_EXT_output_openwf 1
|
||||
#define EGL_OPENWF_PIPELINE_ID_EXT 0x3238
|
||||
#define EGL_OPENWF_PORT_ID_EXT 0x3239
|
||||
#endif /* EGL_EXT_output_openwf */
|
||||
|
||||
#ifndef EGL_EXT_platform_base
|
||||
#define EGL_EXT_platform_base 1
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYEXTPROC) (EGLenum platform, void *native_display, const EGLint *attrib_list);
|
||||
|
@ -466,6 +600,11 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
|
|||
#endif
|
||||
#endif /* EGL_EXT_platform_base */
|
||||
|
||||
#ifndef EGL_EXT_platform_device
|
||||
#define EGL_EXT_platform_device 1
|
||||
#define EGL_PLATFORM_DEVICE_EXT 0x313F
|
||||
#endif /* EGL_EXT_platform_device */
|
||||
|
||||
#ifndef EGL_EXT_platform_wayland
|
||||
#define EGL_EXT_platform_wayland 1
|
||||
#define EGL_PLATFORM_WAYLAND_EXT 0x31D8
|
||||
|
@ -477,6 +616,19 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy,
|
|||
#define EGL_PLATFORM_X11_SCREEN_EXT 0x31D6
|
||||
#endif /* EGL_EXT_platform_x11 */
|
||||
|
||||
#ifndef EGL_EXT_protected_surface
|
||||
#define EGL_EXT_protected_surface 1
|
||||
#define EGL_PROTECTED_CONTENT_EXT 0x32C0
|
||||
#endif /* EGL_EXT_protected_surface */
|
||||
|
||||
#ifndef EGL_EXT_stream_consumer_egloutput
|
||||
#define EGL_EXT_stream_consumer_egloutput 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSTREAMCONSUMEROUTPUTEXTPROC) (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamConsumerOutputEXT (EGLDisplay dpy, EGLStreamKHR stream, EGLOutputLayerEXT layer);
|
||||
#endif
|
||||
#endif /* EGL_EXT_stream_consumer_egloutput */
|
||||
|
||||
#ifndef EGL_EXT_swap_buffers_with_damage
|
||||
#define EGL_EXT_swap_buffers_with_damage 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHDAMAGEEXTPROC) (EGLDisplay dpy, EGLSurface surface, EGLint *rects, EGLint n_rects);
|
||||
|
@ -485,6 +637,35 @@ EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithDamageEXT (EGLDisplay dpy, EGLSu
|
|||
#endif
|
||||
#endif /* EGL_EXT_swap_buffers_with_damage */
|
||||
|
||||
#ifndef EGL_EXT_yuv_surface
|
||||
#define EGL_EXT_yuv_surface 1
|
||||
#define EGL_YUV_ORDER_EXT 0x3301
|
||||
#define EGL_YUV_NUMBER_OF_PLANES_EXT 0x3311
|
||||
#define EGL_YUV_SUBSAMPLE_EXT 0x3312
|
||||
#define EGL_YUV_DEPTH_RANGE_EXT 0x3317
|
||||
#define EGL_YUV_CSC_STANDARD_EXT 0x330A
|
||||
#define EGL_YUV_PLANE_BPP_EXT 0x331A
|
||||
#define EGL_YUV_BUFFER_EXT 0x3300
|
||||
#define EGL_YUV_ORDER_YUV_EXT 0x3302
|
||||
#define EGL_YUV_ORDER_YVU_EXT 0x3303
|
||||
#define EGL_YUV_ORDER_YUYV_EXT 0x3304
|
||||
#define EGL_YUV_ORDER_UYVY_EXT 0x3305
|
||||
#define EGL_YUV_ORDER_YVYU_EXT 0x3306
|
||||
#define EGL_YUV_ORDER_VYUY_EXT 0x3307
|
||||
#define EGL_YUV_ORDER_AYUV_EXT 0x3308
|
||||
#define EGL_YUV_SUBSAMPLE_4_2_0_EXT 0x3313
|
||||
#define EGL_YUV_SUBSAMPLE_4_2_2_EXT 0x3314
|
||||
#define EGL_YUV_SUBSAMPLE_4_4_4_EXT 0x3315
|
||||
#define EGL_YUV_DEPTH_RANGE_LIMITED_EXT 0x3318
|
||||
#define EGL_YUV_DEPTH_RANGE_FULL_EXT 0x3319
|
||||
#define EGL_YUV_CSC_STANDARD_601_EXT 0x330B
|
||||
#define EGL_YUV_CSC_STANDARD_709_EXT 0x330C
|
||||
#define EGL_YUV_CSC_STANDARD_2020_EXT 0x330D
|
||||
#define EGL_YUV_PLANE_BPP_0_EXT 0x331B
|
||||
#define EGL_YUV_PLANE_BPP_8_EXT 0x331C
|
||||
#define EGL_YUV_PLANE_BPP_10_EXT 0x331D
|
||||
#endif /* EGL_EXT_yuv_surface */
|
||||
|
||||
#ifndef EGL_HI_clientpixmap
|
||||
#define EGL_HI_clientpixmap 1
|
||||
struct EGLClientPixmapHI {
|
||||
|
@ -533,11 +714,42 @@ EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR
|
|||
#endif
|
||||
#endif /* EGL_MESA_drm_image */
|
||||
|
||||
#ifndef EGL_MESA_image_dma_buf_export
|
||||
#define EGL_MESA_image_dma_buf_export 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEQUERYMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTDMABUFIMAGEMESAPROC) (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, int *fourcc, int *num_planes, EGLuint64KHR *modifiers);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
|
||||
#endif
|
||||
#endif /* EGL_MESA_image_dma_buf_export */
|
||||
|
||||
#ifndef EGL_MESA_platform_gbm
|
||||
#define EGL_MESA_platform_gbm 1
|
||||
#define EGL_PLATFORM_GBM_MESA 0x31D7
|
||||
#endif /* EGL_MESA_platform_gbm */
|
||||
|
||||
#ifndef EGL_NOK_swap_region
|
||||
#define EGL_NOK_swap_region 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
|
||||
#endif
|
||||
#endif /* EGL_NOK_swap_region */
|
||||
|
||||
#ifndef EGL_NOK_swap_region2
|
||||
#define EGL_NOK_swap_region2 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGION2NOKPROC) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegion2NOK (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects);
|
||||
#endif
|
||||
#endif /* EGL_NOK_swap_region2 */
|
||||
|
||||
#ifndef EGL_NOK_texture_from_pixmap
|
||||
#define EGL_NOK_texture_from_pixmap 1
|
||||
#define EGL_Y_INVERTED_NOK 0x307F
|
||||
#endif /* EGL_NOK_texture_from_pixmap */
|
||||
|
||||
#ifndef EGL_NV_3dvision_surface
|
||||
#define EGL_NV_3dvision_surface 1
|
||||
#define EGL_AUTO_STEREO_NV 0x3136
|
||||
|
@ -556,6 +768,13 @@ EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR
|
|||
#define EGL_COVERAGE_SAMPLE_RESOLVE_NONE_NV 0x3133
|
||||
#endif /* EGL_NV_coverage_sample_resolve */
|
||||
|
||||
#ifndef EGL_NV_cuda_event
|
||||
#define EGL_NV_cuda_event 1
|
||||
#define EGL_CUDA_EVENT_HANDLE_NV 0x323B
|
||||
#define EGL_SYNC_CUDA_EVENT_NV 0x323C
|
||||
#define EGL_SYNC_CUDA_EVENT_COMPLETE_NV 0x323D
|
||||
#endif /* EGL_NV_cuda_event */
|
||||
|
||||
#ifndef EGL_NV_depth_nonlinear
|
||||
#define EGL_NV_depth_nonlinear 1
|
||||
#define EGL_DEPTH_ENCODING_NV 0x30E2
|
||||
|
@ -563,6 +782,11 @@ EGLAPI EGLBoolean EGLAPIENTRY eglExportDRMImageMESA (EGLDisplay dpy, EGLImageKHR
|
|||
#define EGL_DEPTH_ENCODING_NONLINEAR_NV 0x30E3
|
||||
#endif /* EGL_NV_depth_nonlinear */
|
||||
|
||||
#ifndef EGL_NV_device_cuda
|
||||
#define EGL_NV_device_cuda 1
|
||||
#define EGL_CUDA_DEVICE_NV 0x323A
|
||||
#endif /* EGL_NV_device_cuda */
|
||||
|
||||
#ifndef EGL_NV_native_query
|
||||
#define EGL_NV_native_query 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYNATIVEDISPLAYNVPROC) (EGLDisplay dpy, EGLNativeDisplayType *display_id);
|
||||
|
@ -645,6 +869,16 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void);
|
|||
#endif /* KHRONOS_SUPPORT_INT64 */
|
||||
#endif /* EGL_NV_system_time */
|
||||
|
||||
#ifndef EGL_TIZEN_image_native_buffer
|
||||
#define EGL_TIZEN_image_native_buffer 1
|
||||
#define EGL_NATIVE_BUFFER_TIZEN 0x32A0
|
||||
#endif /* EGL_TIZEN_image_native_buffer */
|
||||
|
||||
#ifndef EGL_TIZEN_image_native_surface
|
||||
#define EGL_TIZEN_image_native_surface 1
|
||||
#define EGL_NATIVE_SURFACE_TIZEN 0x32A1
|
||||
#endif /* EGL_TIZEN_image_native_surface */
|
||||
|
||||
#include <EGL/eglmesaext.h>
|
||||
#include <EGL/eglextchromium.h>
|
||||
|
||||
|
|
|
@ -34,63 +34,6 @@ extern "C" {
|
|||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/* EGL_MESA_screen extension >>> PRELIMINARY <<< */
|
||||
#ifndef EGL_MESA_screen_surface
|
||||
#define EGL_MESA_screen_surface 1
|
||||
|
||||
#define EGL_BAD_SCREEN_MESA 0x4000
|
||||
#define EGL_BAD_MODE_MESA 0x4001
|
||||
#define EGL_SCREEN_COUNT_MESA 0x4002
|
||||
#define EGL_SCREEN_POSITION_MESA 0x4003
|
||||
#define EGL_SCREEN_POSITION_GRANULARITY_MESA 0x4004
|
||||
#define EGL_MODE_ID_MESA 0x4005
|
||||
#define EGL_REFRESH_RATE_MESA 0x4006
|
||||
#define EGL_OPTIMAL_MESA 0x4007
|
||||
#define EGL_INTERLACED_MESA 0x4008
|
||||
#define EGL_SCREEN_BIT_MESA 0x08
|
||||
|
||||
typedef khronos_uint32_t EGLScreenMESA;
|
||||
typedef khronos_uint32_t EGLModeMESA;
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglChooseModeMESA(EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetModesMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetModeAttribMESA(EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetScreensMESA(EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
EGLAPI EGLSurface EGLAPIENTRY eglCreateScreenSurfaceMESA(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglShowScreenSurfaceMESA(EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglScreenPositionMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenSurfaceMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryScreenModeMESA(EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
EGLAPI const char * EGLAPIENTRY eglQueryModeStringMESA(EGLDisplay dpy, EGLModeMESA mode);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSEMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMODESMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGetModeATTRIBMESA) (EGLDisplay dpy, EGLModeMESA mode, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSCRREENSMESA) (EGLDisplay dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATESCREENSURFACEMESA) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSHOWSCREENSURFACEMESA) (EGLDisplay dpy, EGLint screen, EGLSurface surface, EGLModeMESA mode);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSCREENPOSIITONMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint x, EGLint y);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENSURFACEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLSurface *surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSCREENMODEMESA) (EGLDisplay dpy, EGLScreenMESA screen, EGLModeMESA *mode);
|
||||
typedef const char * (EGLAPIENTRYP PFNEGLQUERYMODESTRINGMESA) (EGLDisplay dpy, EGLModeMESA mode);
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
#ifndef EGL_MESA_copy_context
|
||||
#define EGL_MESA_copy_context 1
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCopyContextMESA(EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
#endif /* EGL_EGLEXT_PROTOTYPES */
|
||||
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYCONTEXTMESA) (EGLDisplay dpy, EGLContext source, EGLContext dest, EGLint mask);
|
||||
|
||||
#endif /* EGL_MESA_copy_context */
|
||||
|
||||
#ifndef EGL_MESA_drm_display
|
||||
#define EGL_MESA_drm_display 1
|
||||
|
||||
|
@ -144,39 +87,14 @@ typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (
|
|||
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NOK_swap_region
|
||||
#define EGL_NOK_swap_region 1
|
||||
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersRegionNOK(EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
|
||||
#endif
|
||||
|
||||
/* remnant of EGL_NOK_swap_region kept for compatibility because of a non-standard type name */
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSREGIONNOK) (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint* rects);
|
||||
#endif
|
||||
|
||||
#ifndef EGL_NOK_texture_from_pixmap
|
||||
#define EGL_NOK_texture_from_pixmap 1
|
||||
|
||||
#define EGL_Y_INVERTED_NOK 0x307F
|
||||
#endif /* EGL_NOK_texture_from_pixmap */
|
||||
|
||||
#ifndef EGL_ANDROID_image_native_buffer
|
||||
#define EGL_ANDROID_image_native_buffer 1
|
||||
#define EGL_NATIVE_BUFFER_ANDROID 0x3140 /* eglCreateImageKHR target */
|
||||
#endif
|
||||
|
||||
#ifndef EGL_MESA_configless_context
|
||||
#define EGL_MESA_configless_context 1
|
||||
#define EGL_NO_CONFIG_MESA ((EGLConfig)0)
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
#ifndef EGL_MESA_image_dma_buf_export
|
||||
#define EGL_MESA_image_dma_buf_export 1
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageQueryMESA (EGLDisplay dpy, EGLImageKHR image, EGLint *fourcc, EGLint *nplanes, EGLuint64KHR *modifiers);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportDMABUFImageMESA (EGLDisplay dpy, EGLImageKHR image, int *fds, EGLint *strides, EGLint *offsets);
|
||||
#endif
|
||||
#endif
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2007-2009 The Khronos Group Inc.
|
||||
** Copyright (c) 2007-2013 The Khronos Group Inc.
|
||||
**
|
||||
** Permission is hereby granted, free of charge, to any person obtaining a
|
||||
** copy of this software and/or associated documentation files (the
|
||||
|
@ -25,7 +25,7 @@
|
|||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
* $Revision: 12306 $ on $Date: 2010-08-25 09:51:28 -0700 (Wed, 25 Aug 2010) $
|
||||
* $Revision: 30994 $ on $Date: 2015-04-30 13:36:48 -0700 (Thu, 30 Apr 2015) $
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* You are encouraged to submit all modifications to the Khronos group so that
|
||||
|
@ -77,7 +77,7 @@ typedef HDC EGLNativeDisplayType;
|
|||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
#elif defined(__APPLE__) || defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
@ -95,14 +95,15 @@ typedef struct gbm_device *EGLNativeDisplayType;
|
|||
typedef struct gbm_bo *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(ANDROID) /* Android */
|
||||
#elif defined(__ANDROID__) || defined(ANDROID)
|
||||
|
||||
#include <android/native_window.h>
|
||||
|
||||
struct ANativeWindow;
|
||||
struct egl_native_pixmap_t;
|
||||
|
||||
typedef struct ANativeWindow *EGLNativeWindowType;
|
||||
typedef struct egl_native_pixmap_t *EGLNativePixmapType;
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef struct ANativeWindow* EGLNativeWindowType;
|
||||
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
|
||||
typedef void* EGLNativeDisplayType;
|
||||
|
||||
#elif defined(__unix__)
|
||||
|
||||
|
@ -131,9 +132,7 @@ typedef khronos_uintptr_t EGLNativePixmapType;
|
|||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#else
|
||||
|
||||
#error "Platform not recognized"
|
||||
|
||||
#endif
|
||||
|
||||
/* EGL 1.2 types, renamed for consistency in EGL 1.3 */
|
||||
|
|
|
@ -26,7 +26,7 @@
|
|||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* $Revision: 9356 $ on $Date: 2009-10-21 02:52:25 -0700 (Wed, 21 Oct 2009) $
|
||||
* $Revision: 23298 $ on $Date: 2013-09-30 17:07:13 -0700 (Mon, 30 Sep 2013) $
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
|
@ -106,9 +106,9 @@
|
|||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif (defined(__GNUC__) && (__GNUC__ * 100 + __GNUC_MINOR__) >= 303) \
|
||||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
|| (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
|
||||
/* KHRONOS_APIATTRIBUTES is not used by the client API headers yet */
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
@ -229,10 +229,23 @@ typedef signed char khronos_int8_t;
|
|||
typedef unsigned char khronos_uint8_t;
|
||||
typedef signed short int khronos_int16_t;
|
||||
typedef unsigned short int khronos_uint16_t;
|
||||
|
||||
/*
|
||||
* Types that differ between LLP64 and LP64 architectures - in LLP64,
|
||||
* pointers are 64 bits, but 'long' is still 32 bits. Win64 appears
|
||||
* to be the only LLP64 architecture in current use.
|
||||
*/
|
||||
#ifdef _WIN64
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
|
|
|
@ -85,6 +85,7 @@ CHIPSET(0x6651, BONAIRE_6651, BONAIRE)
|
|||
CHIPSET(0x6658, BONAIRE_6658, BONAIRE)
|
||||
CHIPSET(0x665C, BONAIRE_665C, BONAIRE)
|
||||
CHIPSET(0x665D, BONAIRE_665D, BONAIRE)
|
||||
CHIPSET(0x665F, BONAIRE_665F, BONAIRE)
|
||||
|
||||
CHIPSET(0x9830, KABINI_9830, KABINI)
|
||||
CHIPSET(0x9831, KABINI_9831, KABINI)
|
||||
|
|
|
@ -120,6 +120,7 @@ def generate(env):
|
|||
])
|
||||
elif llvm_version >= distutils.version.LooseVersion('3.5'):
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMMCDisassembler',
|
||||
'LLVMBitWriter', 'LLVMMCJIT', 'LLVMRuntimeDyld',
|
||||
'LLVMX86Disassembler', 'LLVMX86AsmParser', 'LLVMX86CodeGen',
|
||||
'LLVMSelectionDAG', 'LLVMAsmPrinter', 'LLVMX86Desc',
|
||||
|
@ -132,6 +133,7 @@ def generate(env):
|
|||
])
|
||||
else:
|
||||
env.Prepend(LIBS = [
|
||||
'LLVMMCDisassembler',
|
||||
'LLVMBitWriter', 'LLVMX86Disassembler', 'LLVMX86AsmParser',
|
||||
'LLVMX86CodeGen', 'LLVMX86Desc', 'LLVMSelectionDAG',
|
||||
'LLVMAsmPrinter', 'LLVMMCParser', 'LLVMX86AsmPrinter',
|
||||
|
@ -189,7 +191,7 @@ def generate(env):
|
|||
if '-fno-rtti' in cxxflags:
|
||||
env.Append(CXXFLAGS = ['-fno-rtti'])
|
||||
|
||||
components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter']
|
||||
components = ['engine', 'mcjit', 'bitwriter', 'x86asmprinter', 'mcdisassembler']
|
||||
|
||||
env.ParseConfig('llvm-config --libs ' + ' '.join(components))
|
||||
env.ParseConfig('llvm-config --ldflags')
|
||||
|
|
|
@ -76,4 +76,5 @@ noinst_LTLIBRARIES = libglsl_util.la
|
|||
libglsl_util_la_SOURCES = \
|
||||
mesa/main/imports.c \
|
||||
mesa/program/prog_hash_table.c \
|
||||
mesa/program/symbol_table.c
|
||||
mesa/program/symbol_table.c \
|
||||
mesa/program/dummy_errors.c
|
||||
|
|
|
@ -36,6 +36,7 @@ LOCAL_CFLAGS := \
|
|||
-DHAVE_ANDROID_PLATFORM
|
||||
|
||||
ifeq ($(MESA_LOLLIPOP_BUILD),true)
|
||||
LOCAL_CFLAGS_arm := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\"
|
||||
LOCAL_CFLAGS_x86 := -DDEFAULT_DRIVER_DIR=\"/system/lib/dri\"
|
||||
LOCAL_CFLAGS_x86_64 := -DDEFAULT_DRIVER_DIR=\"/system/lib64/dri\"
|
||||
else
|
||||
|
@ -45,7 +46,6 @@ endif
|
|||
LOCAL_C_INCLUDES := \
|
||||
$(MESA_TOP)/src/mapi \
|
||||
$(MESA_TOP)/src/egl/main \
|
||||
$(MESA_TOP)/src/loader \
|
||||
$(DRM_GRALLOC_TOP)
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
|
|
|
@ -65,4 +65,9 @@ libegl_dri2_la_SOURCES += platform_drm.c
|
|||
AM_CFLAGS += -DHAVE_DRM_PLATFORM
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_SURFACELESS
|
||||
libegl_dri2_la_SOURCES += platform_surfaceless.c
|
||||
AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM
|
||||
endif
|
||||
|
||||
EXTRA_DIST = SConscript
|
||||
|
|
|
@ -397,7 +397,7 @@ dri2_open_driver(_EGLDisplay *disp)
|
|||
|
||||
dri2_dpy->driver = NULL;
|
||||
end = search_paths + strlen(search_paths);
|
||||
for (p = search_paths; p < end && dri2_dpy->driver == NULL; p = next + 1) {
|
||||
for (p = search_paths; p < end; p = next + 1) {
|
||||
int len;
|
||||
next = strchr(p, ':');
|
||||
if (next == NULL)
|
||||
|
@ -419,6 +419,15 @@ dri2_open_driver(_EGLDisplay *disp)
|
|||
/* not need continue to loop all paths once the driver is found */
|
||||
if (dri2_dpy->driver != NULL)
|
||||
break;
|
||||
|
||||
#ifdef ANDROID
|
||||
snprintf(path, sizeof path, "%.*s/gallium_dri.so", len, p);
|
||||
dri2_dpy->driver = dlopen(path, RTLD_NOW | RTLD_GLOBAL);
|
||||
if (dri2_dpy->driver == NULL)
|
||||
_eglLog(_EGL_DEBUG, "failed to open %s: %s\n", path, dlerror());
|
||||
else
|
||||
break;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (dri2_dpy->driver == NULL) {
|
||||
|
@ -576,6 +585,7 @@ dri2_create_screen(_EGLDisplay *disp)
|
|||
{
|
||||
const __DRIextension **extensions;
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
unsigned i;
|
||||
|
||||
dri2_dpy = disp->DriverData;
|
||||
|
||||
|
@ -616,28 +626,26 @@ dri2_create_screen(_EGLDisplay *disp)
|
|||
extensions = dri2_dpy->core->getExtensions(dri2_dpy->dri_screen);
|
||||
|
||||
if (dri2_dpy->dri2) {
|
||||
unsigned i;
|
||||
|
||||
if (!dri2_bind_extensions(dri2_dpy, dri2_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
|
||||
dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
|
||||
}
|
||||
if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
|
||||
dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
|
||||
}
|
||||
if (strcmp(extensions[i]->name, __DRI2_FENCE) == 0) {
|
||||
dri2_dpy->fence = (__DRI2fenceExtension *) extensions[i];
|
||||
}
|
||||
}
|
||||
} else {
|
||||
assert(dri2_dpy->swrast);
|
||||
if (!dri2_bind_extensions(dri2_dpy, swrast_core_extensions, extensions))
|
||||
goto cleanup_dri_screen;
|
||||
}
|
||||
|
||||
for (i = 0; extensions[i]; i++) {
|
||||
if (strcmp(extensions[i]->name, __DRI2_ROBUSTNESS) == 0) {
|
||||
dri2_dpy->robustness = (__DRIrobustnessExtension *) extensions[i];
|
||||
}
|
||||
if (strcmp(extensions[i]->name, __DRI2_CONFIG_QUERY) == 0) {
|
||||
dri2_dpy->config = (__DRI2configQueryExtension *) extensions[i];
|
||||
}
|
||||
if (strcmp(extensions[i]->name, __DRI2_FENCE) == 0) {
|
||||
dri2_dpy->fence = (__DRI2fenceExtension *) extensions[i];
|
||||
}
|
||||
}
|
||||
|
||||
dri2_setup_screen(disp);
|
||||
|
||||
return EGL_TRUE;
|
||||
|
@ -659,6 +667,13 @@ dri2_initialize(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
return EGL_FALSE;
|
||||
|
||||
switch (disp->Platform) {
|
||||
#ifdef HAVE_SURFACELESS_PLATFORM
|
||||
case _EGL_PLATFORM_SURFACELESS:
|
||||
if (disp->Options.TestOnly)
|
||||
return EGL_TRUE;
|
||||
return dri2_initialize_surfaceless(drv, disp);
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_X11_PLATFORM
|
||||
case _EGL_PLATFORM_X11:
|
||||
if (disp->Options.TestOnly)
|
||||
|
@ -729,7 +744,12 @@ dri2_terminate(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
#endif
|
||||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
case _EGL_PLATFORM_WAYLAND:
|
||||
wl_drm_destroy(dri2_dpy->wl_drm);
|
||||
if (dri2_dpy->wl_drm)
|
||||
wl_drm_destroy(dri2_dpy->wl_drm);
|
||||
if (dri2_dpy->wl_shm)
|
||||
wl_shm_destroy(dri2_dpy->wl_shm);
|
||||
wl_registry_destroy(dri2_dpy->wl_registry);
|
||||
wl_event_queue_destroy(dri2_dpy->wl_queue);
|
||||
if (dri2_dpy->own_device) {
|
||||
wl_display_disconnect(dri2_dpy->wl_dpy);
|
||||
}
|
||||
|
@ -1252,7 +1272,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
|||
format = __DRI_TEXTURE_FORMAT_RGBA;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
assert(!"Unexpected texture format in dri2_bind_tex_image()");
|
||||
format = __DRI_TEXTURE_FORMAT_RGBA;
|
||||
}
|
||||
|
||||
switch (dri2_surf->base.TextureTarget) {
|
||||
|
@ -1260,7 +1281,8 @@ dri2_bind_tex_image(_EGLDriver *drv,
|
|||
target = GL_TEXTURE_2D;
|
||||
break;
|
||||
default:
|
||||
assert(0);
|
||||
target = GL_TEXTURE_2D;
|
||||
assert(!"Unexpected texture target in dri2_bind_tex_image()");
|
||||
}
|
||||
|
||||
(*dri2_dpy->tex_buffer->setTexBuffer2)(dri2_ctx->dri_context,
|
||||
|
@ -2210,7 +2232,7 @@ dri2_egl_unref_sync(struct dri2_egl_display *dri2_dpy,
|
|||
static _EGLSync *
|
||||
dri2_create_sync(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
EGLenum type, const EGLint *attrib_list,
|
||||
const EGLAttribKHR *attrib_list64)
|
||||
const EGLAttrib *attrib_list64)
|
||||
{
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
|
||||
|
@ -2276,7 +2298,7 @@ dri2_destroy_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync)
|
|||
|
||||
static EGLint
|
||||
dri2_client_wait_sync(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
EGLint flags, EGLTimeKHR timeout)
|
||||
EGLint flags, EGLTime timeout)
|
||||
{
|
||||
_EGLContext *ctx = _eglGetCurrentContext();
|
||||
struct dri2_egl_display *dri2_dpy = dri2_egl_display(dpy);
|
||||
|
|
|
@ -196,10 +196,13 @@ struct dri2_egl_display
|
|||
struct wl_registry *wl_registry;
|
||||
struct wl_drm *wl_server_drm;
|
||||
struct wl_drm *wl_drm;
|
||||
struct wl_shm *wl_shm;
|
||||
struct wl_event_queue *wl_queue;
|
||||
int authenticated;
|
||||
int formats;
|
||||
uint32_t capabilities;
|
||||
int is_render_node;
|
||||
int is_different_gpu;
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@ -253,6 +256,11 @@ struct dri2_egl_surface
|
|||
#ifdef HAVE_WAYLAND_PLATFORM
|
||||
struct wl_buffer *wl_buffer;
|
||||
__DRIimage *dri_image;
|
||||
/* for is_different_gpu case. NULL else */
|
||||
__DRIimage *linear_copy;
|
||||
/* for swrast */
|
||||
void *data;
|
||||
int data_size;
|
||||
#endif
|
||||
#ifdef HAVE_DRM_PLATFORM
|
||||
struct gbm_bo *bo;
|
||||
|
@ -343,6 +351,9 @@ dri2_initialize_wayland(_EGLDriver *drv, _EGLDisplay *disp);
|
|||
EGLBoolean
|
||||
dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *disp);
|
||||
|
||||
EGLBoolean
|
||||
dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp);
|
||||
|
||||
void
|
||||
dri2_flush_drawable_for_swapbuffers(_EGLDisplay *disp, _EGLSurface *draw);
|
||||
|
||||
|
|
|
@ -45,6 +45,15 @@ dri2_fallback_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static inline _EGLImage*
|
||||
dri2_fallback_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer,
|
||||
const EGLint *attr_list)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static inline EGLBoolean
|
||||
dri2_fallback_swap_interval(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLSurface *surf, EGLint interval)
|
||||
|
|
|
@ -707,10 +707,6 @@ dri2_initialize_android(_EGLDriver *drv, _EGLDisplay *dpy)
|
|||
dpy->Extensions.ANDROID_image_native_buffer = EGL_TRUE;
|
||||
dpy->Extensions.KHR_image_base = EGL_TRUE;
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
dpy->VersionMajor = 1;
|
||||
dpy->VersionMinor = 4;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
* initialization.
|
||||
*/
|
||||
|
|
|
@ -611,9 +611,9 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
char buf[64];
|
||||
int n = snprintf(buf, sizeof(buf), DRM_DEV_NAME, DRM_DIR_NAME, 0);
|
||||
if (n != -1 && n < sizeof(buf))
|
||||
fd = open(buf, O_RDWR);
|
||||
fd = loader_open_device(buf);
|
||||
if (fd < 0)
|
||||
fd = open("/dev/dri/card0", O_RDWR);
|
||||
fd = loader_open_device("/dev/dri/card0");
|
||||
dri2_dpy->own_device = 1;
|
||||
gbm = gbm_create_device(fd);
|
||||
if (gbm == NULL)
|
||||
|
@ -632,7 +632,7 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
|
||||
if (fd < 0) {
|
||||
fd = dup(gbm_device_get_fd(gbm));
|
||||
fd = fcntl(gbm_device_get_fd(gbm), F_DUPFD_CLOEXEC, 3);
|
||||
if (fd < 0) {
|
||||
free(dri2_dpy);
|
||||
return EGL_FALSE;
|
||||
|
@ -715,10 +715,6 @@ dri2_initialize_drm(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
}
|
||||
#endif
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
disp->VersionMajor = 1;
|
||||
disp->VersionMinor = 4;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
* initialization.
|
||||
*/
|
||||
|
|
|
@ -0,0 +1,162 @@
|
|||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright (c) 2014 The Chromium OS Authors.
|
||||
* Copyright © 2011 Intel Corporation
|
||||
*
|
||||
* 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 <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <xf86drm.h>
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include "egl_dri2.h"
|
||||
#include "egl_dri2_fallbacks.h"
|
||||
#include "loader.h"
|
||||
|
||||
static struct dri2_egl_display_vtbl dri2_surfaceless_display_vtbl = {
|
||||
.create_pixmap_surface = dri2_fallback_create_pixmap_surface,
|
||||
.create_image = dri2_create_image_khr,
|
||||
.swap_interval = dri2_fallback_swap_interval,
|
||||
.swap_buffers_with_damage = dri2_fallback_swap_buffers_with_damage,
|
||||
.swap_buffers_region = dri2_fallback_swap_buffers_region,
|
||||
.post_sub_buffer = dri2_fallback_post_sub_buffer,
|
||||
.copy_buffers = dri2_fallback_copy_buffers,
|
||||
.query_buffer_age = dri2_fallback_query_buffer_age,
|
||||
.create_wayland_buffer_from_image = dri2_fallback_create_wayland_buffer_from_image,
|
||||
.get_sync_values = dri2_fallback_get_sync_values,
|
||||
};
|
||||
|
||||
static void
|
||||
surfaceless_flush_front_buffer(__DRIdrawable *driDrawable, void *loaderPrivate)
|
||||
{
|
||||
}
|
||||
|
||||
static __DRIbuffer *
|
||||
surfaceless_get_buffers_with_format(__DRIdrawable * driDrawable,
|
||||
int *width, int *height,
|
||||
unsigned int *attachments, int count,
|
||||
int *out_count, void *loaderPrivate)
|
||||
{
|
||||
struct dri2_egl_surface *dri2_surf = loaderPrivate;
|
||||
|
||||
dri2_surf->buffer_count = 1;
|
||||
if (width)
|
||||
*width = dri2_surf->base.Width;
|
||||
if (height)
|
||||
*height = dri2_surf->base.Height;
|
||||
*out_count = dri2_surf->buffer_count;;
|
||||
return dri2_surf->buffers;
|
||||
}
|
||||
|
||||
#define DRM_RENDER_DEV_NAME "%s/renderD%d"
|
||||
|
||||
EGLBoolean
|
||||
dri2_initialize_surfaceless(_EGLDriver *drv, _EGLDisplay *disp)
|
||||
{
|
||||
struct dri2_egl_display *dri2_dpy;
|
||||
const char* err;
|
||||
int i;
|
||||
int driver_loaded = 0;
|
||||
|
||||
loader_set_logger(_eglLog);
|
||||
|
||||
dri2_dpy = calloc(1, sizeof *dri2_dpy);
|
||||
if (!dri2_dpy)
|
||||
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
|
||||
|
||||
disp->DriverData = (void *) dri2_dpy;
|
||||
|
||||
const int limit = 64;
|
||||
const int base = 128;
|
||||
for (i = 0; i < limit; ++i) {
|
||||
char *card_path;
|
||||
if (asprintf(&card_path, DRM_RENDER_DEV_NAME, DRM_DIR_NAME, base + i) < 0)
|
||||
continue;
|
||||
|
||||
dri2_dpy->fd = loader_open_device(card_path);
|
||||
|
||||
free(card_path);
|
||||
if (dri2_dpy->fd < 0)
|
||||
continue;
|
||||
|
||||
dri2_dpy->driver_name = loader_get_driver_for_fd(dri2_dpy->fd, 0);
|
||||
if (dri2_dpy->driver_name) {
|
||||
if (dri2_load_driver(disp)) {
|
||||
driver_loaded = 1;
|
||||
break;
|
||||
}
|
||||
free(dri2_dpy->driver_name);
|
||||
}
|
||||
close(dri2_dpy->fd);
|
||||
}
|
||||
|
||||
if (!driver_loaded) {
|
||||
err = "DRI2: failed to load driver";
|
||||
goto cleanup_display;
|
||||
}
|
||||
|
||||
dri2_dpy->dri2_loader_extension.base.name = __DRI_DRI2_LOADER;
|
||||
dri2_dpy->dri2_loader_extension.base.version = 3;
|
||||
dri2_dpy->dri2_loader_extension.getBuffers = NULL;
|
||||
dri2_dpy->dri2_loader_extension.flushFrontBuffer =
|
||||
surfaceless_flush_front_buffer;
|
||||
dri2_dpy->dri2_loader_extension.getBuffersWithFormat =
|
||||
surfaceless_get_buffers_with_format;
|
||||
|
||||
dri2_dpy->extensions[0] = &dri2_dpy->dri2_loader_extension.base;
|
||||
dri2_dpy->extensions[1] = &image_lookup_extension.base;
|
||||
dri2_dpy->extensions[2] = &use_invalidate.base;
|
||||
dri2_dpy->extensions[3] = NULL;
|
||||
|
||||
if (!dri2_create_screen(disp)) {
|
||||
err = "DRI2: failed to create screen";
|
||||
goto cleanup_driver;
|
||||
}
|
||||
|
||||
for (i = 0; dri2_dpy->driver_configs[i]; i++) {
|
||||
dri2_add_config(disp, dri2_dpy->driver_configs[i],
|
||||
i + 1, EGL_WINDOW_BIT, NULL, NULL);
|
||||
}
|
||||
|
||||
disp->Extensions.KHR_image_base = EGL_TRUE;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
* initialization.
|
||||
*/
|
||||
dri2_dpy->vtbl = &dri2_surfaceless_display_vtbl;
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
cleanup_driver:
|
||||
dlclose(dri2_dpy->driver);
|
||||
free(dri2_dpy->driver_name);
|
||||
close(dri2_dpy->fd);
|
||||
cleanup_display:
|
||||
free(dri2_dpy);
|
||||
|
||||
return _eglError(EGL_NOT_INITIALIZED, err);
|
||||
}
|
File diff suppressed because it is too large
Load Diff
|
@ -43,6 +43,7 @@
|
|||
|
||||
#include "egl_dri2.h"
|
||||
#include "egl_dri2_fallbacks.h"
|
||||
#include "loader.h"
|
||||
|
||||
static EGLBoolean
|
||||
dri2_x11_swap_interval(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf,
|
||||
|
@ -1017,15 +1018,6 @@ dri2_x11_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
|||
}
|
||||
}
|
||||
|
||||
static _EGLImage*
|
||||
dri2_x11_swrast_create_image_khr(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLContext *ctx, EGLenum target,
|
||||
EGLClientBuffer buffer,
|
||||
const EGLint *attr_list)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static EGLBoolean
|
||||
dri2_x11_get_sync_values(_EGLDisplay *display, _EGLSurface *surface,
|
||||
EGLuint64KHR *ust, EGLuint64KHR *msc,
|
||||
|
@ -1058,7 +1050,7 @@ static struct dri2_egl_display_vtbl dri2_x11_swrast_display_vtbl = {
|
|||
.create_pixmap_surface = dri2_x11_create_pixmap_surface,
|
||||
.create_pbuffer_surface = dri2_x11_create_pbuffer_surface,
|
||||
.destroy_surface = dri2_x11_destroy_surface,
|
||||
.create_image = dri2_x11_swrast_create_image_khr,
|
||||
.create_image = dri2_fallback_create_image_khr,
|
||||
.swap_interval = dri2_fallback_swap_interval,
|
||||
.swap_buffers = dri2_x11_swap_buffers,
|
||||
.swap_buffers_region = dri2_fallback_swap_buffers_region,
|
||||
|
@ -1121,7 +1113,7 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
goto cleanup_conn;
|
||||
|
||||
dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;
|
||||
dri2_dpy->swrast_loader_extension.base.version = __DRI_SWRAST_LOADER_VERSION;
|
||||
dri2_dpy->swrast_loader_extension.base.version = 2;
|
||||
dri2_dpy->swrast_loader_extension.getDrawableInfo = swrastGetDrawableInfo;
|
||||
dri2_dpy->swrast_loader_extension.putImage = swrastPutImage;
|
||||
dri2_dpy->swrast_loader_extension.getImage = swrastGetImage;
|
||||
|
@ -1138,10 +1130,6 @@ dri2_initialize_x11_swrast(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
goto cleanup_configs;
|
||||
}
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
disp->VersionMajor = 1;
|
||||
disp->VersionMinor = 4;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
* initialization.
|
||||
*/
|
||||
|
@ -1243,16 +1231,7 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
if (!dri2_load_driver(disp))
|
||||
goto cleanup_conn;
|
||||
|
||||
#ifdef O_CLOEXEC
|
||||
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR | O_CLOEXEC);
|
||||
if (dri2_dpy->fd == -1 && errno == EINVAL)
|
||||
#endif
|
||||
{
|
||||
dri2_dpy->fd = open(dri2_dpy->device_name, O_RDWR);
|
||||
if (dri2_dpy->fd != -1)
|
||||
fcntl(dri2_dpy->fd, F_SETFD, fcntl(dri2_dpy->fd, F_GETFD) |
|
||||
FD_CLOEXEC);
|
||||
}
|
||||
dri2_dpy->fd = loader_open_device(dri2_dpy->device_name);
|
||||
if (dri2_dpy->fd == -1) {
|
||||
_eglLog(_EGL_WARNING,
|
||||
"DRI2: could not open %s (%s)", dri2_dpy->device_name,
|
||||
|
@ -1292,11 +1271,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
|
||||
dri2_x11_setup_swap_interval(dri2_dpy);
|
||||
|
||||
if (dri2_dpy->conn) {
|
||||
if (!dri2_x11_add_configs_for_visuals(dri2_dpy, disp))
|
||||
goto cleanup_configs;
|
||||
}
|
||||
|
||||
disp->Extensions.KHR_image_pixmap = EGL_TRUE;
|
||||
disp->Extensions.NOK_swap_region = EGL_TRUE;
|
||||
disp->Extensions.NOK_texture_from_pixmap = EGL_TRUE;
|
||||
|
@ -1312,10 +1286,6 @@ dri2_initialize_x11_dri2(_EGLDriver *drv, _EGLDisplay *disp)
|
|||
goto cleanup_configs;
|
||||
}
|
||||
|
||||
/* we're supporting EGL 1.4 */
|
||||
disp->VersionMajor = 1;
|
||||
disp->VersionMinor = 4;
|
||||
|
||||
/* Fill vtbl last to prevent accidentally calling virtual function during
|
||||
* initialization.
|
||||
*/
|
||||
|
|
|
@ -9,7 +9,6 @@ env.Append(CPPDEFINES = [
|
|||
env.Append(CPPPATH = [
|
||||
'#/include',
|
||||
'#/src/egl/main',
|
||||
'#/src/loader',
|
||||
])
|
||||
|
||||
sources = [
|
||||
|
@ -22,10 +21,6 @@ if env['platform'] == 'haiku':
|
|||
'_EGL_NATIVE_PLATFORM=haiku',
|
||||
])
|
||||
|
||||
env.Prepend(LIBS = [
|
||||
libloader,
|
||||
])
|
||||
|
||||
egl_haiku = env.ConvenienceLibrary(
|
||||
target = 'egl_haiku',
|
||||
source = sources,
|
||||
|
|
|
@ -27,8 +27,6 @@
|
|||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
|
||||
extern "C" {
|
||||
#include "loader.h"
|
||||
#include "eglconfig.h"
|
||||
#include "eglcontext.h"
|
||||
#include "egldisplay.h"
|
||||
|
@ -38,13 +36,19 @@ extern "C" {
|
|||
#include "eglsurface.h"
|
||||
#include "eglimage.h"
|
||||
#include "egltypedefs.h"
|
||||
}
|
||||
|
||||
#include <InterfaceKit.h>
|
||||
#include <OpenGLKit.h>
|
||||
|
||||
|
||||
#define CALLOC_STRUCT(T) (struct T *) calloc(1, sizeof(struct T))
|
||||
#ifdef DEBUG
|
||||
# define TRACE(x...) printf("egl_haiku: " x)
|
||||
# define CALLED() TRACE("CALLED: %s\n", __PRETTY_FUNCTION__)
|
||||
#else
|
||||
# define TRACE(x...)
|
||||
# define CALLED()
|
||||
#endif
|
||||
#define ERROR(x...) printf("egl_haiku: " x)
|
||||
|
||||
|
||||
_EGL_DRIVER_STANDARD_TYPECASTS(haiku_egl)
|
||||
|
@ -53,10 +57,6 @@ _EGL_DRIVER_STANDARD_TYPECASTS(haiku_egl)
|
|||
struct haiku_egl_driver
|
||||
{
|
||||
_EGLDriver base;
|
||||
|
||||
void *handle;
|
||||
_EGLProc (*get_proc_address)(const char *procname);
|
||||
void (*glFlush)(void);
|
||||
};
|
||||
|
||||
struct haiku_egl_config
|
||||
|
@ -76,81 +76,6 @@ struct haiku_egl_surface
|
|||
};
|
||||
|
||||
|
||||
/*
|
||||
static void
|
||||
swrastCreateDrawable(struct dri2_egl_display * dri2_dpy,
|
||||
struct dri2_egl_surface * dri2_surf, int depth)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
swrastDestroyDrawable(struct dri2_egl_display * dri2_dpy,
|
||||
struct dri2_egl_surface * dri2_surf)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
swrastGetDrawableInfo(__DRIdrawable * draw, int *x, int *y,
|
||||
int *w, int *h, void *loaderPrivate)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
swrastPutImage(__DRIdrawable * draw, int op, int x, int y,
|
||||
int w, int h, char *data, void *loaderPrivate)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
swrastGetImage(__DRIdrawable * read, int x, int y,
|
||||
int w, int h, char *data, void *loaderPrivate)
|
||||
{
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
static void
|
||||
haiku_log(EGLint level, const char *msg)
|
||||
{
|
||||
switch (level) {
|
||||
case _EGL_DEBUG:
|
||||
fprintf(stderr,"%s", msg);
|
||||
break;
|
||||
case _EGL_INFO:
|
||||
fprintf(stderr,"%s", msg);
|
||||
break;
|
||||
case _EGL_WARNING:
|
||||
fprintf(stderr,"%s", msg);
|
||||
break;
|
||||
case _EGL_FATAL:
|
||||
fprintf(stderr,"%s", msg);
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
|
||||
*/
|
||||
static _EGLSurface *
|
||||
haiku_create_surface(_EGLDriver *drv, _EGLDisplay *disp, EGLint type,
|
||||
_EGLConfig *conf, void *native_surface, const EGLint *attrib_list)
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Called via eglCreateWindowSurface(), drv->API.CreateWindowSurface().
|
||||
*/
|
||||
|
@ -158,25 +83,37 @@ static _EGLSurface *
|
|||
haiku_create_window_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
||||
_EGLConfig *conf, void *native_window, const EGLint *attrib_list)
|
||||
{
|
||||
struct haiku_egl_surface* surface;
|
||||
surface = (struct haiku_egl_surface*)calloc(1,sizeof (*surface));
|
||||
CALLED();
|
||||
|
||||
struct haiku_egl_surface* surface;
|
||||
surface = (struct haiku_egl_surface*) calloc(1, sizeof (*surface));
|
||||
if (!surface) {
|
||||
_eglError(EGL_BAD_ALLOC, "haiku_create_window_surface");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitSurface(&surface->surf, disp, EGL_WINDOW_BIT, conf, attrib_list))
|
||||
goto cleanup_surface;
|
||||
|
||||
_eglInitSurface(&surface->surf, disp, EGL_WINDOW_BIT, conf, attrib_list);
|
||||
(&surface->surf)->SwapInterval = 1;
|
||||
|
||||
_eglLog(_EGL_DEBUG, "Creating window");
|
||||
TRACE("Creating window\n");
|
||||
BWindow* win = (BWindow*)native_window;
|
||||
|
||||
_eglLog(_EGL_DEBUG, "Creating GL view");
|
||||
TRACE("Creating GL view\n");
|
||||
surface->gl = new BGLView(win->Bounds(), "OpenGL", B_FOLLOW_ALL_SIDES, 0,
|
||||
BGL_RGB | BGL_DOUBLE | BGL_ALPHA);
|
||||
|
||||
_eglLog(_EGL_DEBUG, "Adding GL");
|
||||
TRACE("Adding GL\n");
|
||||
win->AddChild(surface->gl);
|
||||
|
||||
_eglLog(_EGL_DEBUG, "Showing window");
|
||||
TRACE("Showing window\n");
|
||||
win->Show();
|
||||
return &surface->surf;
|
||||
|
||||
cleanup_surface:
|
||||
free(surface);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -199,6 +136,10 @@ haiku_create_pbuffer_surface(_EGLDriver *drv, _EGLDisplay *disp,
|
|||
static EGLBoolean
|
||||
haiku_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
||||
{
|
||||
if (_eglPutSurface(surf)) {
|
||||
// XXX: detach haiku_egl_surface::gl from the native window and destroy it
|
||||
free(surf);
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
@ -206,13 +147,18 @@ haiku_destroy_surface(_EGLDriver *drv, _EGLDisplay *disp, _EGLSurface *surf)
|
|||
static EGLBoolean
|
||||
haiku_add_configs_for_visuals(_EGLDisplay *dpy)
|
||||
{
|
||||
printf("Adding configs\n");
|
||||
CALLED();
|
||||
|
||||
struct haiku_egl_config* conf;
|
||||
conf = CALLOC_STRUCT(haiku_egl_config);
|
||||
conf = (struct haiku_egl_config*) calloc(1, sizeof (*conf));
|
||||
if (!conf) {
|
||||
_eglError(EGL_BAD_ALLOC, "haiku_add_configs_for_visuals");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_eglInitConfig(&conf->base, dpy, 1);
|
||||
_eglLog(_EGL_DEBUG,"Config inited\n");
|
||||
TRACE("Config inited\n");
|
||||
|
||||
_eglSetConfigKey(&conf->base, EGL_RED_SIZE, 8);
|
||||
_eglSetConfigKey(&conf->base, EGL_BLUE_SIZE, 8);
|
||||
_eglSetConfigKey(&conf->base, EGL_GREEN_SIZE, 8);
|
||||
|
@ -243,76 +189,40 @@ haiku_add_configs_for_visuals(_EGLDisplay *dpy)
|
|||
_eglSetConfigKey(&conf->base, EGL_MAX_PBUFFER_PIXELS, 0); // TODO: How to get the right value ?
|
||||
_eglSetConfigKey(&conf->base, EGL_SURFACE_TYPE, EGL_WINDOW_BIT /*| EGL_PIXMAP_BIT | EGL_PBUFFER_BIT*/);
|
||||
|
||||
printf("Config configuated\n");
|
||||
TRACE("Config configuated\n");
|
||||
if (!_eglValidateConfig(&conf->base, EGL_FALSE)) {
|
||||
_eglLog(_EGL_DEBUG, "Haiku failed to validate config");
|
||||
return EGL_FALSE;
|
||||
_eglLog(_EGL_DEBUG, "Haiku: failed to validate config");
|
||||
goto cleanup;
|
||||
}
|
||||
printf("Validated config\n");
|
||||
TRACE("Validated config\n");
|
||||
|
||||
_eglLinkConfig(&conf->base);
|
||||
if (!_eglGetArraySize(dpy->Configs)) {
|
||||
_eglLog(_EGL_WARNING, "Haiku: failed to create any config");
|
||||
return EGL_FALSE;
|
||||
goto cleanup;
|
||||
}
|
||||
printf("Config successful!\n");
|
||||
|
||||
TRACE("Config successfull\n");
|
||||
|
||||
return EGL_TRUE;
|
||||
|
||||
cleanup:
|
||||
free(conf);
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
extern "C"
|
||||
EGLBoolean
|
||||
init_haiku(_EGLDriver *drv, _EGLDisplay *dpy)
|
||||
{
|
||||
_eglLog(_EGL_DEBUG,"\nInitializing Haiku EGL\n");
|
||||
//_EGLDisplay* egl_dpy;
|
||||
CALLED();
|
||||
|
||||
printf("Initializing Haiku EGL\n");
|
||||
_eglSetLogProc(haiku_log);
|
||||
TRACE("Add configs\n");
|
||||
if (!haiku_add_configs_for_visuals(dpy))
|
||||
return EGL_FALSE;
|
||||
|
||||
loader_set_logger(_eglLog);
|
||||
|
||||
/*egl_dpy = (_EGLDisplay*) calloc(1, sizeof(_EGLDisplay));
|
||||
if (!egl_dpy)
|
||||
return _eglError(EGL_BAD_ALLOC, "eglInitialize");
|
||||
|
||||
dpy->DriverData=(void*) egl_dpy;
|
||||
if (!dpy->PlatformDisplay) {
|
||||
// OPEN DEVICE
|
||||
//dri2_dpy->bwindow = (void*)haiku_create_window();
|
||||
//dri2_dpy->own_device = true;
|
||||
} else {
|
||||
//dri2_dpy->bwindow = (BWindow*)dpy->PlatformDisplay;
|
||||
}*/
|
||||
|
||||
//dri2_dpy->driver_name = strdup("swrast");
|
||||
//if (!dri2_load_driver_swrast(dpy))
|
||||
// goto cleanup_conn;
|
||||
|
||||
/*dri2_dpy->swrast_loader_extension.base.name = __DRI_SWRAST_LOADER;
|
||||
dri2_dpy->swrast_loader_extension.base.version = __DRI_SWRAST_LOADER_VERSION;
|
||||
dri2_dpy->swrast_loader_extension.getDrawableInfo = swrastGetDrawableInfo;
|
||||
dri2_dpy->swrast_loader_extension.putImage = swrastPutImage;
|
||||
dri2_dpy->swrast_loader_extension.getImage = swrastGetImage;
|
||||
|
||||
dri2_dpy->extensions[0] = &dri2_dpy->swrast_loader_extension.base;
|
||||
dri2_dpy->extensions[1] = NULL;
|
||||
dri2_dpy->extensions[2] = NULL;*/
|
||||
|
||||
/*if (dri2_dpy->bwindow) {
|
||||
if (!dri2_haiku_add_configs_for_visuals(dri2_dpy, dpy))
|
||||
goto cleanup_configs;
|
||||
}*/
|
||||
_eglLog(_EGL_DEBUG,"Add configs");
|
||||
haiku_add_configs_for_visuals(dpy);
|
||||
|
||||
dpy->VersionMajor=1;
|
||||
dpy->VersionMinor=4;
|
||||
dpy->Version = 14;
|
||||
|
||||
//dpy->Extensions.KHR_create_context = true;
|
||||
|
||||
//dri2_dpy->vtbl = &dri2_haiku_display_vtbl;
|
||||
_eglLog(_EGL_DEBUG, "Initialization finished");
|
||||
TRACE("Initialization finished\n");
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
@ -331,13 +241,24 @@ _EGLContext*
|
|||
haiku_create_context(_EGLDriver *drv, _EGLDisplay *disp, _EGLConfig *conf,
|
||||
_EGLContext *share_list, const EGLint *attrib_list)
|
||||
{
|
||||
_eglLog(_EGL_DEBUG,"Creating context");
|
||||
CALLED();
|
||||
|
||||
struct haiku_egl_context* context;
|
||||
context=(struct haiku_egl_context*)calloc(1,sizeof (*context));
|
||||
if(!_eglInitContext(&context->ctx, disp, conf, attrib_list))
|
||||
printf("ERROR creating context");
|
||||
_eglLog(_EGL_DEBUG, "Context created");
|
||||
context = (struct haiku_egl_context*) calloc(1, sizeof (*context));
|
||||
if (!context) {
|
||||
_eglError(EGL_BAD_ALLOC, "haiku_create_context");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!_eglInitContext(&context->ctx, disp, conf, attrib_list))
|
||||
goto cleanup;
|
||||
|
||||
TRACE("Context created\n");
|
||||
return &context->ctx;
|
||||
|
||||
cleanup:
|
||||
free(context);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -345,7 +266,13 @@ extern "C"
|
|||
EGLBoolean
|
||||
haiku_destroy_context(_EGLDriver* drv, _EGLDisplay *disp, _EGLContext* ctx)
|
||||
{
|
||||
ctx=NULL;
|
||||
struct haiku_egl_context* context = haiku_egl_context(ctx);
|
||||
|
||||
if (_eglPutContext(ctx)) {
|
||||
// XXX: teardown the context ?
|
||||
free(context);
|
||||
ctx = NULL
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
@ -355,11 +282,16 @@ EGLBoolean
|
|||
haiku_make_current(_EGLDriver* drv, _EGLDisplay* dpy, _EGLSurface *dsurf,
|
||||
_EGLSurface *rsurf, _EGLContext *ctx)
|
||||
{
|
||||
struct haiku_egl_context* cont=haiku_egl_context(ctx);
|
||||
struct haiku_egl_surface* surf=haiku_egl_surface(dsurf);
|
||||
CALLED();
|
||||
|
||||
struct haiku_egl_context* cont = haiku_egl_context(ctx);
|
||||
struct haiku_egl_surface* surf = haiku_egl_surface(dsurf);
|
||||
_EGLContext *old_ctx;
|
||||
_EGLSurface *old_dsurf, *old_rsurf;
|
||||
_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf);
|
||||
_EGLSurface *old_dsurf, *old_rsurf;
|
||||
|
||||
if (!_eglBindContext(ctx, dsurf, rsurf, &old_ctx, &old_dsurf, &old_rsurf))
|
||||
return EGL_FALSE;
|
||||
|
||||
//cont->ctx.DrawSurface=&surf->surf;
|
||||
surf->gl->LockGL();
|
||||
return EGL_TRUE;
|
||||
|
@ -370,7 +302,8 @@ extern "C"
|
|||
EGLBoolean
|
||||
haiku_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf)
|
||||
{
|
||||
struct haiku_egl_surface* surface=haiku_egl_surface(surf);
|
||||
struct haiku_egl_surface* surface = haiku_egl_surface(surf);
|
||||
|
||||
surface->gl->SwapBuffers();
|
||||
//gl->Render();
|
||||
return EGL_TRUE;
|
||||
|
@ -393,9 +326,15 @@ extern "C"
|
|||
_EGLDriver*
|
||||
_eglBuiltInDriverHaiku(const char *args)
|
||||
{
|
||||
_eglLog(_EGL_DEBUG,"Driver loaded");
|
||||
CALLED();
|
||||
|
||||
struct haiku_egl_driver* driver;
|
||||
driver=(struct haiku_egl_driver*)calloc(1,sizeof(*driver));
|
||||
driver = (struct haiku_egl_driver*) calloc(1, sizeof(*driver));
|
||||
if (!driver) {
|
||||
_eglError(EGL_BAD_ALLOC, "_eglBuiltInDriverHaiku");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
_eglInitDriverFallbacks(&driver->base);
|
||||
driver->base.API.Initialize = init_haiku;
|
||||
driver->base.API.Terminate = haiku_terminate;
|
||||
|
@ -406,32 +345,13 @@ _eglBuiltInDriverHaiku(const char *args)
|
|||
driver->base.API.CreatePixmapSurface = haiku_create_pixmap_surface;
|
||||
driver->base.API.CreatePbufferSurface = haiku_create_pbuffer_surface;
|
||||
driver->base.API.DestroySurface = haiku_destroy_surface;
|
||||
/*
|
||||
driver->API.GetProcAddress = dri2_get_proc_address;
|
||||
driver->API.WaitClient = dri2_wait_client;
|
||||
driver->API.WaitNative = dri2_wait_native;
|
||||
driver->API.BindTexImage = dri2_bind_tex_image;
|
||||
driver->API.ReleaseTexImage = dri2_release_tex_image;
|
||||
driver->API.SwapInterval = dri2_swap_interval;
|
||||
*/
|
||||
|
||||
driver->base.API.SwapBuffers = haiku_swap_buffers;
|
||||
/*
|
||||
driver->API.SwapBuffersWithDamageEXT = dri2_swap_buffers_with_damage;
|
||||
driver->API.SwapBuffersRegionNOK = dri2_swap_buffers_region;
|
||||
driver->API.PostSubBufferNV = dri2_post_sub_buffer;
|
||||
driver->API.CopyBuffers = dri2_copy_buffers,
|
||||
driver->API.QueryBufferAge = dri2_query_buffer_age;
|
||||
driver->API.CreateImageKHR = dri2_create_image;
|
||||
driver->API.DestroyImageKHR = dri2_destroy_image_khr;
|
||||
driver->API.CreateWaylandBufferFromImageWL = dri2_create_wayland_buffer_from_image;
|
||||
driver->API.GetSyncValuesCHROMIUM = dri2_get_sync_values_chromium;
|
||||
*/
|
||||
|
||||
driver->base.Name = "Haiku";
|
||||
driver->base.Unload = haiku_unload;
|
||||
|
||||
_eglLog(_EGL_DEBUG, "API Calls defined");
|
||||
|
||||
TRACE("API Calls defined\n");
|
||||
|
||||
return &driver->base;
|
||||
}
|
||||
|
|
|
@ -43,10 +43,7 @@ LOCAL_CFLAGS := \
|
|||
-D_EGL_DRIVER_SEARCH_DIR=\"/system/lib/egl\" \
|
||||
-D_EGL_OS_UNIX=1
|
||||
|
||||
LOCAL_STATIC_LIBRARIES :=
|
||||
|
||||
LOCAL_SHARED_LIBRARIES := \
|
||||
libglapi \
|
||||
libdl \
|
||||
libhardware \
|
||||
liblog \
|
||||
|
@ -62,95 +59,20 @@ ifneq ($(MESA_GPU_DRIVERS),swrast)
|
|||
LOCAL_SHARED_LIBRARIES += libdrm
|
||||
endif
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
|
||||
LOCAL_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
|
||||
LOCAL_STATIC_LIBRARIES += libmesa_egl_dri2
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_CLASSIC)),true)
|
||||
# require i915_dri and/or i965_dri
|
||||
LOCAL_REQUIRED_MODULES += \
|
||||
$(addsuffix _dri, $(filter i915 i965, $(MESA_GPU_DRIVERS)))
|
||||
endif # MESA_BUILD_CLASSIC
|
||||
|
||||
ifeq ($(strip $(MESA_BUILD_GALLIUM)),true)
|
||||
|
||||
gallium_DRIVERS :=
|
||||
|
||||
# swrast
|
||||
gallium_DRIVERS += libmesa_pipe_softpipe libmesa_winsys_sw_android
|
||||
|
||||
# freedreno
|
||||
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_freedreno libmesa_pipe_freedreno
|
||||
LOCAL_SHARED_LIBRARIES += libdrm_freedreno
|
||||
endif
|
||||
|
||||
# i915g
|
||||
ifneq ($(filter i915g, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_i915 libmesa_pipe_i915
|
||||
LOCAL_SHARED_LIBRARIES += libdrm_intel
|
||||
endif
|
||||
|
||||
# ilo
|
||||
ifneq ($(filter ilo, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_intel libmesa_pipe_ilo
|
||||
LOCAL_SHARED_LIBRARIES += libdrm_intel
|
||||
endif
|
||||
|
||||
# nouveau
|
||||
ifneq ($(filter nouveau, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_nouveau libmesa_pipe_nouveau
|
||||
LOCAL_SHARED_LIBRARIES += libdrm_nouveau
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
endif
|
||||
|
||||
# r300g/r600g/radeonsi
|
||||
ifneq ($(filter r300g r600g radeonsi, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_radeon
|
||||
LOCAL_SHARED_LIBRARIES += libdrm_radeon
|
||||
ifneq ($(filter r300g, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_pipe_r300
|
||||
endif # r300g
|
||||
ifneq ($(filter r600g radeonsi, $(MESA_GPU_DRIVERS)),)
|
||||
ifneq ($(filter r600g, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_pipe_r600
|
||||
LOCAL_SHARED_LIBRARIES += libstlport
|
||||
endif # r600g
|
||||
ifneq ($(filter radeonsi, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_pipe_radeonsi
|
||||
endif # radeonsi
|
||||
gallium_DRIVERS += libmesa_pipe_radeon
|
||||
endif # r600g || radeonsi
|
||||
endif # r300g || r600g || radeonsi
|
||||
|
||||
# vmwgfx
|
||||
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
|
||||
gallium_DRIVERS += libmesa_winsys_svga libmesa_pipe_svga
|
||||
endif
|
||||
|
||||
#
|
||||
# Notes about the order here:
|
||||
#
|
||||
# * libmesa_st_egl depends on libmesa_winsys_sw_android in $(gallium_DRIVERS)
|
||||
# * libmesa_pipe_r300 in $(gallium_DRIVERS) depends on libmesa_st_mesa and
|
||||
# libmesa_glsl
|
||||
# * libmesa_st_mesa depends on libmesa_glsl
|
||||
# * libmesa_glsl depends on libmesa_glsl_utils
|
||||
#
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
libmesa_egl_gallium \
|
||||
libmesa_st_egl \
|
||||
$(gallium_DRIVERS) \
|
||||
libmesa_st_mesa \
|
||||
libmesa_util \
|
||||
libmesa_glsl \
|
||||
libmesa_glsl_utils \
|
||||
libmesa_gallium \
|
||||
$(LOCAL_STATIC_LIBRARIES)
|
||||
|
||||
LOCAL_REQUIRED_MODULES += gallium_dri
|
||||
endif # MESA_BUILD_GALLIUM
|
||||
|
||||
LOCAL_STATIC_LIBRARIES := \
|
||||
$(LOCAL_STATIC_LIBRARIES) \
|
||||
libmesa_egl_dri2 \
|
||||
libmesa_loader
|
||||
|
||||
LOCAL_MODULE := libGLES_mesa
|
||||
|
|
|
@ -68,6 +68,10 @@ if HAVE_EGL_PLATFORM_NULL
|
|||
AM_CFLAGS += -DHAVE_NULL_PLATFORM
|
||||
endif
|
||||
|
||||
if HAVE_EGL_PLATFORM_SURFACELESS
|
||||
AM_CFLAGS += -DHAVE_SURFACELESS_PLATFORM
|
||||
endif
|
||||
|
||||
if HAVE_EGL_DRIVER_DRI2
|
||||
AM_CFLAGS += -D_EGL_BUILT_IN_DRIVER_DRI2
|
||||
AM_CFLAGS += -DHAVE_XCB_DRI2
|
||||
|
|
|
@ -22,10 +22,6 @@ LIBEGL_C_FILES := \
|
|||
eglimage.h \
|
||||
egllog.c \
|
||||
egllog.h \
|
||||
eglmode.c \
|
||||
eglmode.h \
|
||||
eglscreen.c \
|
||||
eglscreen.h \
|
||||
eglstring.c \
|
||||
eglstring.h \
|
||||
eglsurface.c \
|
||||
|
|
|
@ -16,10 +16,10 @@ The EGL code here basically consists of two things:
|
|||
|
||||
Bootstrapping:
|
||||
|
||||
When the apps calls eglOpenDisplay() a device driver is selected and loaded
|
||||
(look for dlsym() or LoadLibrary() in egldriver.c).
|
||||
When the apps calls eglInitialize() a device driver is selected and loaded
|
||||
(look for _eglAddDrivers() and _eglLoadModule() in egldriver.c).
|
||||
|
||||
The driver's _eglMain() function is then called. This driver function
|
||||
The built-in driver's entry point function is then called. This driver function
|
||||
allocates, initializes and returns a new _EGLDriver object (usually a
|
||||
subclass of that type).
|
||||
|
||||
|
@ -30,10 +30,9 @@ driver->API.Initialize and driver->API.Terminate _must_ be implemented
|
|||
with driver-specific code (no default/fallback function is possible).
|
||||
|
||||
|
||||
A bit later, the app will call eglInitialize(). This will get routed
|
||||
to the driver->API.Initialize() function. Any additional driver
|
||||
initialization that wasn't done in _eglMain() should be done at this
|
||||
point. Typically, this will involve setting up visual configs, etc.
|
||||
Shortly after, the driver->API.Initialize() function is executed. Any additional
|
||||
driver initialization that wasn't done in the driver entry point should be
|
||||
done at this point. Typically, this will involve setting up visual configs, etc.
|
||||
|
||||
|
||||
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -31,6 +31,11 @@
|
|||
#ifndef EGLAPI_INCLUDED
|
||||
#define EGLAPI_INCLUDED
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* A generic function ptr type
|
||||
*/
|
||||
|
@ -79,22 +84,6 @@ typedef _EGLProc (*GetProcAddress_t)(_EGLDriver *drv, const char *procname);
|
|||
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
typedef EGLBoolean (*ChooseModeMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, const EGLint *attrib_list, EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
typedef EGLBoolean (*GetModesMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, EGLModeMESA *modes, EGLint mode_size, EGLint *num_mode);
|
||||
typedef EGLBoolean (*GetModeAttribMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *mode, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (*CopyContextMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLContext *source, _EGLContext *dest, EGLint mask);
|
||||
typedef EGLBoolean (*GetScreensMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
typedef _EGLSurface *(*CreateScreenSurfaceMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLConfig *config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (*ShowScreenSurfaceMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, _EGLSurface *surface, _EGLMode *mode);
|
||||
typedef EGLBoolean (*ScreenPositionMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, EGLint x, EGLint y);
|
||||
typedef EGLBoolean (*QueryScreenMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (*QueryScreenSurfaceMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, _EGLSurface **surface);
|
||||
typedef EGLBoolean (*QueryScreenModeMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *screen, _EGLMode **mode);
|
||||
typedef const char * (*QueryModeStringMESA_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *mode);
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
typedef _EGLSurface *(*CreatePbufferFromClientBuffer_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLenum buftype, EGLClientBuffer buffer, _EGLConfig *config, const EGLint *attrib_list);
|
||||
|
||||
|
||||
|
@ -102,12 +91,12 @@ typedef _EGLImage *(*CreateImageKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLCo
|
|||
typedef EGLBoolean (*DestroyImageKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLImage *image);
|
||||
|
||||
|
||||
typedef _EGLSync *(*CreateSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLenum type, const EGLint *attrib_list, const EGLAttribKHR *attrib_list64);
|
||||
typedef _EGLSync *(*CreateSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, EGLenum type, const EGLint *attrib_list, const EGLAttrib *attrib_list64);
|
||||
typedef EGLBoolean (*DestroySyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync);
|
||||
typedef EGLint (*ClientWaitSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint flags, EGLTimeKHR timeout);
|
||||
typedef EGLint (*ClientWaitSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint flags, EGLTime timeout);
|
||||
typedef EGLint (*WaitSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync);
|
||||
typedef EGLBoolean (*SignalSyncKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLenum mode);
|
||||
typedef EGLBoolean (*GetSyncAttribKHR_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (*GetSyncAttrib_t)(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync, EGLint attribute, EGLAttrib *value);
|
||||
|
||||
|
||||
#ifdef EGL_NOK_swap_region
|
||||
|
@ -179,21 +168,6 @@ struct _egl_api
|
|||
WaitNative_t WaitNative;
|
||||
GetProcAddress_t GetProcAddress;
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
ChooseModeMESA_t ChooseModeMESA;
|
||||
GetModesMESA_t GetModesMESA;
|
||||
GetModeAttribMESA_t GetModeAttribMESA;
|
||||
CopyContextMESA_t CopyContextMESA;
|
||||
GetScreensMESA_t GetScreensMESA;
|
||||
CreateScreenSurfaceMESA_t CreateScreenSurfaceMESA;
|
||||
ShowScreenSurfaceMESA_t ShowScreenSurfaceMESA;
|
||||
ScreenPositionMESA_t ScreenPositionMESA;
|
||||
QueryScreenMESA_t QueryScreenMESA;
|
||||
QueryScreenSurfaceMESA_t QueryScreenSurfaceMESA;
|
||||
QueryScreenModeMESA_t QueryScreenModeMESA;
|
||||
QueryModeStringMESA_t QueryModeStringMESA;
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
CreatePbufferFromClientBuffer_t CreatePbufferFromClientBuffer;
|
||||
|
||||
CreateImageKHR_t CreateImageKHR;
|
||||
|
@ -204,7 +178,7 @@ struct _egl_api
|
|||
ClientWaitSyncKHR_t ClientWaitSyncKHR;
|
||||
WaitSyncKHR_t WaitSyncKHR;
|
||||
SignalSyncKHR_t SignalSyncKHR;
|
||||
GetSyncAttribKHR_t GetSyncAttribKHR;
|
||||
GetSyncAttrib_t GetSyncAttrib;
|
||||
|
||||
#ifdef EGL_NOK_swap_region
|
||||
SwapBuffersRegionNOK_t SwapBuffersRegionNOK;
|
||||
|
@ -240,4 +214,9 @@ struct _egl_api
|
|||
#endif
|
||||
};
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLAPI_INCLUDED */
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef EGLBoolean (*_EGLArrayForEach)(void *elem, void *foreach_data);
|
||||
|
||||
|
||||
|
@ -83,4 +87,8 @@ _eglGetArraySize(_EGLArray *array)
|
|||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLARRAY_INCLUDED */
|
||||
|
|
|
@ -30,9 +30,17 @@
|
|||
#ifndef EGLCOMPILER_INCLUDED
|
||||
#define EGLCOMPILER_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define STATIC_ASSERT(COND) \
|
||||
do { \
|
||||
(void) sizeof(char [1 - 2*!(COND)]); \
|
||||
} while (0)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLCOMPILER_INCLUDED */
|
||||
|
|
|
@ -323,10 +323,6 @@ _eglValidateConfig(const _EGLConfig *conf, EGLBoolean for_matching)
|
|||
EGL_VG_ALPHA_FORMAT_PRE_BIT |
|
||||
EGL_MULTISAMPLE_RESOLVE_BOX_BIT |
|
||||
EGL_SWAP_BEHAVIOR_PRESERVED_BIT;
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
if (conf->Display->Extensions.MESA_screen_surface)
|
||||
mask |= EGL_SCREEN_BIT_MESA;
|
||||
#endif
|
||||
break;
|
||||
case EGL_RENDERABLE_TYPE:
|
||||
case EGL_CONFORMANT:
|
||||
|
|
|
@ -39,6 +39,10 @@
|
|||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* update _eglValidationTable and _eglOffsetOfConfig before updating this
|
||||
* struct */
|
||||
struct _egl_config
|
||||
|
@ -225,4 +229,8 @@ extern EGLBoolean
|
|||
_eglGetConfigs(_EGLDriver *drv, _EGLDisplay *dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLCONFIG_INCLUDED */
|
||||
|
|
|
@ -131,7 +131,7 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
|||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = val;
|
||||
ctx->Flags |= val;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
|
||||
|
@ -194,7 +194,38 @@ _eglParseContextAttribList(_EGLContext *ctx, _EGLDisplay *dpy,
|
|||
break;
|
||||
}
|
||||
|
||||
ctx->Flags = EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
if (val == EGL_TRUE)
|
||||
ctx->Flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_ROBUST_ACCESS:
|
||||
if (dpy->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (val == EGL_TRUE)
|
||||
ctx->Flags |= EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_DEBUG:
|
||||
if (dpy->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (val == EGL_TRUE)
|
||||
ctx->Flags |= EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR;
|
||||
break;
|
||||
|
||||
case EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE:
|
||||
if (dpy->Version < 15) {
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (val == EGL_TRUE)
|
||||
ctx->Flags |= EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
#include "egldisplay.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* "Base" class for device driver contexts.
|
||||
*/
|
||||
|
@ -150,4 +154,8 @@ _eglGetContextHandle(_EGLContext *ctx)
|
|||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLCONTEXT_INCLUDED */
|
||||
|
|
|
@ -282,14 +282,6 @@ _eglError(EGLint errCode, const char *msg)
|
|||
case EGL_NOT_INITIALIZED:
|
||||
s = "EGL_NOT_INITIALIZED";
|
||||
break;
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
case EGL_BAD_SCREEN_MESA:
|
||||
s = "EGL_BAD_SCREEN_MESA";
|
||||
break;
|
||||
case EGL_BAD_MODE_MESA:
|
||||
s = "EGL_BAD_MODE_MESA";
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
s = "other EGL error";
|
||||
}
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _EGL_API_ALL_BITS \
|
||||
(EGL_OPENGL_ES_BIT | \
|
||||
EGL_OPENVG_BIT | \
|
||||
|
@ -115,4 +119,8 @@ extern EGLBoolean
|
|||
_eglError(EGLint errCode, const char *msg);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLCURRENT_INCLUDED */
|
||||
|
|
|
@ -34,6 +34,9 @@
|
|||
#ifndef EGLDEFINES_INCLUDED
|
||||
#define EGLDEFINES_INCLUDED
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _EGL_MAX_EXTENSIONS_LEN 1000
|
||||
|
||||
|
@ -41,5 +44,8 @@
|
|||
|
||||
#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLDEFINES_INCLUDED */
|
||||
|
|
|
@ -71,7 +71,8 @@ static const struct {
|
|||
{ _EGL_PLATFORM_DRM, "drm" },
|
||||
{ _EGL_PLATFORM_NULL, "null" },
|
||||
{ _EGL_PLATFORM_ANDROID, "android" },
|
||||
{ _EGL_PLATFORM_HAIKU, "haiku" }
|
||||
{ _EGL_PLATFORM_HAIKU, "haiku" },
|
||||
{ _EGL_PLATFORM_SURFACELESS, "surfaceless" },
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -39,6 +39,10 @@
|
|||
#include "eglarray.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum _egl_platform_type {
|
||||
_EGL_PLATFORM_WINDOWS,
|
||||
_EGL_PLATFORM_X11,
|
||||
|
@ -47,6 +51,7 @@ enum _egl_platform_type {
|
|||
_EGL_PLATFORM_NULL,
|
||||
_EGL_PLATFORM_ANDROID,
|
||||
_EGL_PLATFORM_HAIKU,
|
||||
_EGL_PLATFORM_SURFACELESS,
|
||||
|
||||
_EGL_NUM_PLATFORMS,
|
||||
_EGL_INVALID_PLATFORM = -1
|
||||
|
@ -86,8 +91,6 @@ struct _egl_resource
|
|||
*/
|
||||
struct _egl_extensions
|
||||
{
|
||||
EGLBoolean MESA_screen_surface;
|
||||
EGLBoolean MESA_copy_context;
|
||||
EGLBoolean MESA_drm_display;
|
||||
EGLBoolean MESA_drm_image;
|
||||
EGLBoolean MESA_configless_context;
|
||||
|
@ -99,6 +102,7 @@ struct _egl_extensions
|
|||
EGLBoolean KHR_image_pixmap;
|
||||
EGLBoolean KHR_vg_parent_image;
|
||||
EGLBoolean KHR_get_all_proc_addresses;
|
||||
EGLBoolean KHR_gl_colorspace;
|
||||
EGLBoolean KHR_gl_texture_2D_image;
|
||||
EGLBoolean KHR_gl_texture_cubemap_image;
|
||||
EGLBoolean KHR_gl_texture_3D_image;
|
||||
|
@ -151,8 +155,7 @@ struct _egl_display
|
|||
|
||||
/* these fields are set by the driver during init */
|
||||
void *DriverData; /**< Driver private data */
|
||||
EGLint VersionMajor; /**< EGL major version */
|
||||
EGLint VersionMinor; /**< EGL minor version */
|
||||
EGLint Version; /**< EGL version major*10+minor */
|
||||
EGLint ClientAPIs; /**< Bitmask of APIs supported (EGL_xxx_BIT) */
|
||||
_EGLExtensions Extensions; /**< Extensions supported */
|
||||
|
||||
|
@ -271,4 +274,9 @@ _eglGetWaylandDisplay(struct wl_display *native_display,
|
|||
const EGLint *attrib_list);
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLDISPLAY_INCLUDED */
|
||||
|
|
|
@ -45,21 +45,9 @@
|
|||
#include "egldriver.h"
|
||||
#include "egllog.h"
|
||||
|
||||
#if defined(_EGL_OS_UNIX)
|
||||
#include <dlfcn.h>
|
||||
#include <sys/types.h>
|
||||
#include <dirent.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
|
||||
#ifdef _EGL_BUILT_IN_DRIVER_HAIKU
|
||||
_EGLDriver* _eglBuiltInDriverHaiku(const char* args);
|
||||
#endif
|
||||
|
||||
typedef struct _egl_module {
|
||||
char *Path;
|
||||
char *Name;
|
||||
_EGLMain_t BuiltIn;
|
||||
void *Handle;
|
||||
_EGLDriver *Driver;
|
||||
} _EGLModule;
|
||||
|
||||
|
@ -79,153 +67,24 @@ const struct {
|
|||
{ NULL, NULL }
|
||||
};
|
||||
|
||||
/**
|
||||
* Wrappers for dlopen/dlclose()
|
||||
*/
|
||||
#if defined(_EGL_OS_WINDOWS)
|
||||
|
||||
|
||||
typedef HMODULE lib_handle;
|
||||
|
||||
static HMODULE
|
||||
open_library(const char *filename)
|
||||
{
|
||||
return LoadLibrary(filename);
|
||||
}
|
||||
|
||||
static void
|
||||
close_library(HMODULE lib)
|
||||
{
|
||||
FreeLibrary(lib);
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
library_suffix(void)
|
||||
{
|
||||
return ".dll";
|
||||
}
|
||||
|
||||
|
||||
#elif defined(_EGL_OS_UNIX)
|
||||
|
||||
|
||||
typedef void * lib_handle;
|
||||
|
||||
static void *
|
||||
open_library(const char *filename)
|
||||
{
|
||||
return dlopen(filename, RTLD_LAZY);
|
||||
}
|
||||
|
||||
static void
|
||||
close_library(void *lib)
|
||||
{
|
||||
dlclose(lib);
|
||||
}
|
||||
|
||||
|
||||
static const char *
|
||||
library_suffix(void)
|
||||
{
|
||||
return ".so";
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Open the named driver and find its bootstrap function: _eglMain().
|
||||
*/
|
||||
static _EGLMain_t
|
||||
_eglOpenLibrary(const char *driverPath, lib_handle *handle)
|
||||
{
|
||||
lib_handle lib;
|
||||
_EGLMain_t mainFunc = NULL;
|
||||
const char *error = "unknown error";
|
||||
|
||||
assert(driverPath);
|
||||
|
||||
_eglLog(_EGL_DEBUG, "dlopen(%s)", driverPath);
|
||||
lib = open_library(driverPath);
|
||||
|
||||
#if defined(_EGL_OS_WINDOWS)
|
||||
/* XXX untested */
|
||||
if (lib)
|
||||
mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain");
|
||||
#elif defined(_EGL_OS_UNIX)
|
||||
if (lib) {
|
||||
union {
|
||||
_EGLMain_t func;
|
||||
void *ptr;
|
||||
} tmp = { NULL };
|
||||
/* direct cast gives a warning when compiled with -pedantic */
|
||||
tmp.ptr = dlsym(lib, "_eglMain");
|
||||
mainFunc = tmp.func;
|
||||
if (!mainFunc)
|
||||
error = dlerror();
|
||||
}
|
||||
else {
|
||||
error = dlerror();
|
||||
}
|
||||
#endif
|
||||
|
||||
if (!lib) {
|
||||
_eglLog(_EGL_WARNING, "Could not open driver %s (%s)",
|
||||
driverPath, error);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (!mainFunc) {
|
||||
_eglLog(_EGL_WARNING, "_eglMain not found in %s (%s)",
|
||||
driverPath, error);
|
||||
if (lib)
|
||||
close_library(lib);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*handle = lib;
|
||||
return mainFunc;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Load a module and create the driver object.
|
||||
*/
|
||||
static EGLBoolean
|
||||
_eglLoadModule(_EGLModule *mod)
|
||||
{
|
||||
_EGLMain_t mainFunc;
|
||||
lib_handle lib;
|
||||
_EGLDriver *drv;
|
||||
|
||||
if (mod->Driver)
|
||||
return EGL_TRUE;
|
||||
|
||||
if (mod->BuiltIn) {
|
||||
lib = (lib_handle) NULL;
|
||||
mainFunc = mod->BuiltIn;
|
||||
}
|
||||
else {
|
||||
mainFunc = _eglOpenLibrary(mod->Path, &lib);
|
||||
if (!mainFunc)
|
||||
if (!mod->BuiltIn)
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
drv = mainFunc(NULL);
|
||||
if (!drv) {
|
||||
if (lib)
|
||||
close_library(lib);
|
||||
drv = mod->BuiltIn(NULL);
|
||||
if (!drv || !drv->Name)
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
if (!drv->Name) {
|
||||
_eglLog(_EGL_WARNING, "Driver loaded from %s has no name", mod->Path);
|
||||
drv->Name = "UNNAMED";
|
||||
}
|
||||
|
||||
mod->Handle = (void *) lib;
|
||||
mod->Driver = drv;
|
||||
|
||||
return EGL_TRUE;
|
||||
|
@ -243,20 +102,11 @@ _eglUnloadModule(_EGLModule *mod)
|
|||
if (mod->Driver && mod->Driver->Unload)
|
||||
mod->Driver->Unload(mod->Driver);
|
||||
|
||||
/*
|
||||
* XXX At this point (atexit), the module might be the last reference to
|
||||
* libEGL. Closing the module might unmap libEGL and give problems.
|
||||
*/
|
||||
#if 0
|
||||
if (mod->Handle)
|
||||
close_library(mod->Handle);
|
||||
#endif
|
||||
#elif defined(_EGL_OS_WINDOWS)
|
||||
/* XXX Windows unloads DLLs before atexit */
|
||||
#endif
|
||||
|
||||
mod->Driver = NULL;
|
||||
mod->Handle = NULL;
|
||||
}
|
||||
|
||||
|
||||
|
@ -264,7 +114,7 @@ _eglUnloadModule(_EGLModule *mod)
|
|||
* Add a module to the module array.
|
||||
*/
|
||||
static _EGLModule *
|
||||
_eglAddModule(const char *path)
|
||||
_eglAddModule(const char *name)
|
||||
{
|
||||
_EGLModule *mod;
|
||||
EGLint i;
|
||||
|
@ -278,22 +128,22 @@ _eglAddModule(const char *path)
|
|||
/* find duplicates */
|
||||
for (i = 0; i < _eglModules->Size; i++) {
|
||||
mod = _eglModules->Elements[i];
|
||||
if (strcmp(mod->Path, path) == 0)
|
||||
if (strcmp(mod->Name, name) == 0)
|
||||
return mod;
|
||||
}
|
||||
|
||||
/* allocate a new one */
|
||||
mod = calloc(1, sizeof(*mod));
|
||||
if (mod) {
|
||||
mod->Path = _eglstrdup(path);
|
||||
if (!mod->Path) {
|
||||
mod->Name = _eglstrdup(name);
|
||||
if (!mod->Name) {
|
||||
free(mod);
|
||||
mod = NULL;
|
||||
}
|
||||
}
|
||||
if (mod) {
|
||||
_eglAppendArray(_eglModules, (void *) mod);
|
||||
_eglLog(_EGL_DEBUG, "added %s to module array", mod->Path);
|
||||
_eglLog(_EGL_DEBUG, "added %s to module array", mod->Name);
|
||||
}
|
||||
|
||||
return mod;
|
||||
|
@ -309,154 +159,11 @@ _eglFreeModule(void *module)
|
|||
_EGLModule *mod = (_EGLModule *) module;
|
||||
|
||||
_eglUnloadModule(mod);
|
||||
free(mod->Path);
|
||||
free(mod->Name);
|
||||
free(mod);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* A loader function for use with _eglPreloadForEach. The loader data is the
|
||||
* filename of the driver. This function stops on the first valid driver.
|
||||
*/
|
||||
static EGLBoolean
|
||||
_eglLoaderFile(const char *dir, size_t len, void *loader_data)
|
||||
{
|
||||
char path[1024];
|
||||
const char *filename = (const char *) loader_data;
|
||||
size_t flen = strlen(filename);
|
||||
|
||||
/* make a full path */
|
||||
if (len + flen + 2 > sizeof(path))
|
||||
return EGL_TRUE;
|
||||
if (len) {
|
||||
memcpy(path, dir, len);
|
||||
path[len++] = '/';
|
||||
}
|
||||
memcpy(path + len, filename, flen);
|
||||
len += flen;
|
||||
path[len] = '\0';
|
||||
|
||||
if (library_suffix()) {
|
||||
const char *suffix = library_suffix();
|
||||
size_t slen = strlen(suffix);
|
||||
const char *p;
|
||||
EGLBoolean need_suffix;
|
||||
|
||||
p = filename + flen - slen;
|
||||
need_suffix = (p < filename || strcmp(p, suffix) != 0);
|
||||
if (need_suffix) {
|
||||
/* overflow */
|
||||
if (len + slen + 1 > sizeof(path))
|
||||
return EGL_TRUE;
|
||||
strcpy(path + len, suffix);
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_EGL_OS_UNIX)
|
||||
/* check if the file exists */
|
||||
if (access(path, F_OK))
|
||||
return EGL_TRUE;
|
||||
#endif
|
||||
|
||||
_eglAddModule(path);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Run the callback function on each driver directory.
|
||||
*
|
||||
* The process may end prematurely if the callback function returns false.
|
||||
*/
|
||||
static void
|
||||
_eglPreloadForEach(const char *search_path,
|
||||
EGLBoolean (*loader)(const char *, size_t, void *),
|
||||
void *loader_data)
|
||||
{
|
||||
const char *cur, *next;
|
||||
size_t len;
|
||||
|
||||
cur = search_path;
|
||||
while (cur) {
|
||||
next = strchr(cur, ':');
|
||||
len = (next) ? next - cur : strlen(cur);
|
||||
|
||||
if (!loader(cur, len, loader_data))
|
||||
break;
|
||||
|
||||
cur = (next) ? next + 1 : NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return a list of colon-separated driver directories.
|
||||
*/
|
||||
static const char *
|
||||
_eglGetSearchPath(void)
|
||||
{
|
||||
static char search_path[1024];
|
||||
|
||||
#if defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS)
|
||||
if (search_path[0] == '\0') {
|
||||
char *buf = search_path;
|
||||
size_t len = sizeof(search_path);
|
||||
EGLBoolean use_env;
|
||||
char dir_sep;
|
||||
int ret;
|
||||
|
||||
#if defined(_EGL_OS_UNIX)
|
||||
use_env = (geteuid() == getuid() && getegid() == getgid());
|
||||
dir_sep = '/';
|
||||
#else
|
||||
use_env = EGL_TRUE;
|
||||
dir_sep = '\\';
|
||||
#endif
|
||||
|
||||
if (use_env) {
|
||||
char *p;
|
||||
|
||||
/* extract the dirname from EGL_DRIVER */
|
||||
p = getenv("EGL_DRIVER");
|
||||
if (p && strchr(p, dir_sep)) {
|
||||
ret = _eglsnprintf(buf, len, "%s", p);
|
||||
if (ret > 0 && ret < len) {
|
||||
p = strrchr(buf, dir_sep);
|
||||
*p++ = ':';
|
||||
|
||||
len -= p - buf;
|
||||
buf = p;
|
||||
}
|
||||
}
|
||||
|
||||
/* append EGL_DRIVERS_PATH */
|
||||
p = getenv("EGL_DRIVERS_PATH");
|
||||
if (p) {
|
||||
ret = _eglsnprintf(buf, len, "%s:", p);
|
||||
if (ret > 0 && ret < len) {
|
||||
buf += ret;
|
||||
len -= ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
_eglLog(_EGL_DEBUG,
|
||||
"ignore EGL_DRIVERS_PATH for setuid/setgid binaries");
|
||||
}
|
||||
|
||||
ret = _eglsnprintf(buf, len, "%s", _EGL_DRIVER_SEARCH_DIR);
|
||||
if (ret < 0 || ret >= len)
|
||||
search_path[0] = '\0';
|
||||
|
||||
_eglLog(_EGL_DEBUG, "EGL search path is %s", search_path);
|
||||
}
|
||||
#endif /* defined(_EGL_OS_UNIX) || defined(_EGL_OS_WINDOWS) */
|
||||
|
||||
return search_path;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Add the user driver to the module array.
|
||||
*
|
||||
|
@ -465,42 +172,15 @@ _eglGetSearchPath(void)
|
|||
static EGLBoolean
|
||||
_eglAddUserDriver(void)
|
||||
{
|
||||
const char *search_path = _eglGetSearchPath();
|
||||
char *env;
|
||||
size_t name_len = 0;
|
||||
|
||||
env = getenv("EGL_DRIVER");
|
||||
#if defined(_EGL_OS_UNIX)
|
||||
if (env && strchr(env, '/')) {
|
||||
search_path = "";
|
||||
if ((geteuid() != getuid() || getegid() != getgid())) {
|
||||
_eglLog(_EGL_DEBUG,
|
||||
"ignore EGL_DRIVER for setuid/setgid binaries");
|
||||
env = NULL;
|
||||
}
|
||||
}
|
||||
else if (env) {
|
||||
char *suffix = strchr(env, '.');
|
||||
name_len = (suffix) ? suffix - env : strlen(env);
|
||||
}
|
||||
#else
|
||||
if (env)
|
||||
name_len = strlen(env);
|
||||
#endif /* _EGL_OS_UNIX */
|
||||
|
||||
/*
|
||||
* Try built-in drivers first if we know the driver name. This makes sure
|
||||
* we do not load the outdated external driver that is still on the
|
||||
* filesystem.
|
||||
*/
|
||||
if (name_len) {
|
||||
_EGLModule *mod;
|
||||
if (env) {
|
||||
EGLint i;
|
||||
|
||||
for (i = 0; _eglBuiltInDrivers[i].name; i++) {
|
||||
if (strlen(_eglBuiltInDrivers[i].name) == name_len &&
|
||||
!strncmp(_eglBuiltInDrivers[i].name, env, name_len)) {
|
||||
mod = _eglAddModule(env);
|
||||
if (!strcmp(_eglBuiltInDrivers[i].name, env)) {
|
||||
_EGLModule *mod = _eglAddModule(env);
|
||||
if (mod)
|
||||
mod->BuiltIn = _eglBuiltInDrivers[i].main;
|
||||
|
||||
|
@ -509,13 +189,6 @@ _eglAddUserDriver(void)
|
|||
}
|
||||
}
|
||||
|
||||
/* otherwise, treat env as a path */
|
||||
if (env) {
|
||||
_eglPreloadForEach(search_path, _eglLoaderFile, (void *) env);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
|
@ -683,18 +356,3 @@ _eglUnloadDrivers(void)
|
|||
_eglModules = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Invoke a callback function on each EGL search path.
|
||||
*
|
||||
* The first argument of the callback function is the name of the search path.
|
||||
* The second argument is the length of the name.
|
||||
*/
|
||||
void
|
||||
_eglSearchPathForEach(EGLBoolean (*callback)(const char *, size_t, void *),
|
||||
void *callback_data)
|
||||
{
|
||||
const char *search_path = _eglGetSearchPath();
|
||||
_eglPreloadForEach(search_path, callback, callback_data);
|
||||
}
|
||||
|
|
|
@ -38,6 +38,11 @@
|
|||
#include "eglapi.h"
|
||||
#include <stddef.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Define an inline driver typecast function.
|
||||
*
|
||||
|
@ -86,20 +91,12 @@ struct _egl_driver
|
|||
};
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
_eglBuiltInDriverGALLIUM(const char *args);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
_eglBuiltInDriverDRI2(const char *args);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
_eglBuiltInDriverGLX(const char *args);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
_eglMain(const char *args);
|
||||
extern _EGLDriver*
|
||||
_eglBuiltInDriverHaiku(const char* args);
|
||||
|
||||
|
||||
extern _EGLDriver *
|
||||
|
@ -124,4 +121,9 @@ _eglSearchPathForEach(EGLBoolean (*callback)(const char *, size_t, void *),
|
|||
void *callback_data);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* EGLDRIVER_INCLUDED */
|
||||
|
|
|
@ -32,8 +32,6 @@
|
|||
#include "eglconfig.h"
|
||||
#include "eglcontext.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglscreen.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglsync.h"
|
||||
|
||||
|
||||
|
@ -85,22 +83,6 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
|||
drv->API.WaitNative = (WaitNative_t) _eglReturnFalse;
|
||||
drv->API.GetProcAddress = (GetProcAddress_t) _eglReturnFalse;
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
drv->API.CopyContextMESA = (CopyContextMESA_t) _eglReturnFalse;
|
||||
drv->API.CreateScreenSurfaceMESA =
|
||||
(CreateScreenSurfaceMESA_t) _eglReturnFalse;
|
||||
drv->API.ShowScreenSurfaceMESA = (ShowScreenSurfaceMESA_t) _eglReturnFalse;
|
||||
drv->API.ChooseModeMESA = _eglChooseModeMESA;
|
||||
drv->API.GetModesMESA = _eglGetModesMESA;
|
||||
drv->API.GetModeAttribMESA = _eglGetModeAttribMESA;
|
||||
drv->API.GetScreensMESA = _eglGetScreensMESA;
|
||||
drv->API.ScreenPositionMESA = _eglScreenPositionMESA;
|
||||
drv->API.QueryScreenMESA = _eglQueryScreenMESA;
|
||||
drv->API.QueryScreenSurfaceMESA = _eglQueryScreenSurfaceMESA;
|
||||
drv->API.QueryScreenModeMESA = _eglQueryScreenModeMESA;
|
||||
drv->API.QueryModeStringMESA = _eglQueryModeStringMESA;
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
drv->API.CreateImageKHR = NULL;
|
||||
drv->API.DestroyImageKHR = NULL;
|
||||
|
||||
|
@ -109,7 +91,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
|||
drv->API.ClientWaitSyncKHR = NULL;
|
||||
drv->API.WaitSyncKHR = NULL;
|
||||
drv->API.SignalSyncKHR = NULL;
|
||||
drv->API.GetSyncAttribKHR = _eglGetSyncAttribKHR;
|
||||
drv->API.GetSyncAttrib = _eglGetSyncAttrib;
|
||||
|
||||
#ifdef EGL_MESA_drm_image
|
||||
drv->API.CreateDRMImageMESA = NULL;
|
||||
|
@ -120,7 +102,7 @@ _eglInitDriverFallbacks(_EGLDriver *drv)
|
|||
drv->API.SwapBuffersRegionNOK = NULL;
|
||||
#endif
|
||||
|
||||
#ifdef EGL_MESA_dma_buf_image_export
|
||||
#ifdef EGL_MESA_image_dma_buf_export
|
||||
drv->API.ExportDMABUFImageQueryMESA = NULL;
|
||||
drv->API.ExportDMABUFImageMESA = NULL;
|
||||
#endif
|
||||
|
|
|
@ -50,16 +50,6 @@ struct _egl_global _eglGlobal =
|
|||
_eglFiniDisplay
|
||||
},
|
||||
|
||||
/* ClientExtensions */
|
||||
{
|
||||
true, /* EGL_EXT_client_extensions */
|
||||
true, /* EGL_EXT_platform_base */
|
||||
true, /* EGL_EXT_platform_x11 */
|
||||
true, /* EGL_EXT_platform_wayland */
|
||||
true, /* EGL_MESA_platform_gbm */
|
||||
true, /* EGL_KHR_client_get_all_proc_addresses */
|
||||
},
|
||||
|
||||
/* ClientExtensionsString */
|
||||
"EGL_EXT_client_extensions"
|
||||
" EGL_EXT_platform_base"
|
||||
|
|
|
@ -50,15 +50,6 @@ struct _egl_global
|
|||
EGLint NumAtExitCalls;
|
||||
void (*AtExitCalls[10])(void);
|
||||
|
||||
struct _egl_client_extensions {
|
||||
bool EXT_client_extensions;
|
||||
bool EXT_platform_base;
|
||||
bool EXT_platform_x11;
|
||||
bool EXT_platform_wayland;
|
||||
bool MESA_platform_gbm;
|
||||
bool KHR_get_all_proc_addresses;
|
||||
} ClientExtensions;
|
||||
|
||||
const char *ClientExtensionString;
|
||||
};
|
||||
|
||||
|
|
|
@ -35,6 +35,11 @@
|
|||
#include "egltypedefs.h"
|
||||
#include "egldisplay.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct _egl_image_attrib_int
|
||||
{
|
||||
EGLint Value;
|
||||
|
@ -116,11 +121,11 @@ _eglPutImage(_EGLImage *img)
|
|||
* Link an image to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLImageKHR
|
||||
static inline EGLImage
|
||||
_eglLinkImage(_EGLImage *img)
|
||||
{
|
||||
_eglLinkResource(&img->Resource, _EGL_RESOURCE_IMAGE);
|
||||
return (EGLImageKHR) img;
|
||||
return (EGLImage) img;
|
||||
}
|
||||
|
||||
|
||||
|
@ -140,7 +145,7 @@ _eglUnlinkImage(_EGLImage *img)
|
|||
* Return NULL if the handle has no corresponding linked image.
|
||||
*/
|
||||
static inline _EGLImage *
|
||||
_eglLookupImage(EGLImageKHR image, _EGLDisplay *dpy)
|
||||
_eglLookupImage(EGLImage image, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLImage *img = (_EGLImage *) image;
|
||||
if (!dpy || !_eglCheckResource((void *) img, _EGL_RESOURCE_IMAGE, dpy))
|
||||
|
@ -152,13 +157,17 @@ _eglLookupImage(EGLImageKHR image, _EGLDisplay *dpy)
|
|||
/**
|
||||
* Return the handle of a linked image, or EGL_NO_IMAGE_KHR.
|
||||
*/
|
||||
static inline EGLImageKHR
|
||||
static inline EGLImage
|
||||
_eglGetImageHandle(_EGLImage *img)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) img;
|
||||
return (res && _eglIsResourceLinked(res)) ?
|
||||
(EGLImageKHR) img : EGL_NO_IMAGE_KHR;
|
||||
(EGLImage) img : EGL_NO_IMAGE_KHR;
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLIMAGE_INCLUDED */
|
||||
|
|
|
@ -34,6 +34,10 @@
|
|||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define _EGL_FATAL 0 /* unrecoverable error */
|
||||
#define _EGL_WARNING 1 /* recoverable error/problem */
|
||||
#define _EGL_INFO 2 /* just useful info */
|
||||
|
@ -55,4 +59,8 @@ extern void
|
|||
_eglLog(EGLint level, const char *fmtStr, ...);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLLOG_INCLUDED */
|
||||
|
|
|
@ -1,357 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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, sub license, 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 (including the
|
||||
* next paragraph) 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 <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "egldisplay.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "eglscreen.h"
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
#define MIN2(A, B) (((A) < (B)) ? (A) : (B))
|
||||
|
||||
|
||||
/**
|
||||
* Given an EGLModeMESA handle, return the corresponding _EGLMode object
|
||||
* or null if non-existant.
|
||||
*/
|
||||
_EGLMode *
|
||||
_eglLookupMode(EGLModeMESA mode, _EGLDisplay *disp)
|
||||
{
|
||||
EGLint scrnum;
|
||||
|
||||
if (!disp || !disp->Screens)
|
||||
return NULL;
|
||||
|
||||
/* loop over all screens on the display */
|
||||
for (scrnum = 0; scrnum < disp->Screens->Size; scrnum++) {
|
||||
const _EGLScreen *scrn = disp->Screens->Elements[scrnum];
|
||||
EGLint idx;
|
||||
|
||||
/*
|
||||
* the mode ids of a screen ranges from scrn->Handle to scrn->Handle +
|
||||
* scrn->NumModes
|
||||
*/
|
||||
if (mode >= scrn->Handle &&
|
||||
mode < scrn->Handle + _EGL_SCREEN_MAX_MODES) {
|
||||
idx = mode - scrn->Handle;
|
||||
|
||||
assert(idx < scrn->NumModes && scrn->Modes[idx].Handle == mode);
|
||||
|
||||
return &scrn->Modes[idx];
|
||||
}
|
||||
}
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Parse the attrib_list to fill in the fields of the given _eglMode
|
||||
* Return EGL_FALSE if any errors, EGL_TRUE otherwise.
|
||||
*/
|
||||
static EGLBoolean
|
||||
_eglParseModeAttribs(_EGLMode *mode, const EGLint *attrib_list)
|
||||
{
|
||||
EGLint i;
|
||||
|
||||
/* init all attribs to EGL_DONT_CARE */
|
||||
mode->Handle = EGL_DONT_CARE;
|
||||
mode->Width = EGL_DONT_CARE;
|
||||
mode->Height = EGL_DONT_CARE;
|
||||
mode->RefreshRate = EGL_DONT_CARE;
|
||||
mode->Optimal = EGL_DONT_CARE;
|
||||
mode->Interlaced = EGL_DONT_CARE;
|
||||
mode->Name = NULL;
|
||||
|
||||
for (i = 0; attrib_list && attrib_list[i] != EGL_NONE; i++) {
|
||||
switch (attrib_list[i]) {
|
||||
case EGL_MODE_ID_MESA:
|
||||
mode->Handle = attrib_list[++i];
|
||||
if (mode->Handle <= 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(handle)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
case EGL_WIDTH:
|
||||
mode->Width = attrib_list[++i];
|
||||
if (mode->Width <= 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(width)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
case EGL_HEIGHT:
|
||||
mode->Height = attrib_list[++i];
|
||||
if (mode->Height <= 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(height)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
case EGL_REFRESH_RATE_MESA:
|
||||
mode->RefreshRate = attrib_list[++i];
|
||||
if (mode->RefreshRate <= 0) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(refresh rate)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
case EGL_INTERLACED_MESA:
|
||||
mode->Interlaced = attrib_list[++i];
|
||||
if (mode->Interlaced != EGL_TRUE && mode->Interlaced != EGL_FALSE) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(interlaced)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
case EGL_OPTIMAL_MESA:
|
||||
mode->Optimal = attrib_list[++i];
|
||||
if (mode->Optimal != EGL_TRUE && mode->Optimal != EGL_FALSE) {
|
||||
_eglError(EGL_BAD_PARAMETER, "eglChooseModeMESA(optimal)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglChooseModeMESA");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
}
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Determine if the candidate mode's attributes are at least as good
|
||||
* as the minimal mode's.
|
||||
* \return EGL_TRUE if qualifies, EGL_FALSE otherwise
|
||||
*/
|
||||
static EGLBoolean
|
||||
_eglModeQualifies(const _EGLMode *c, const _EGLMode *min)
|
||||
{
|
||||
if (min->Handle != EGL_DONT_CARE && c->Handle != min->Handle)
|
||||
return EGL_FALSE;
|
||||
if (min->Width != EGL_DONT_CARE && c->Width < min->Width)
|
||||
return EGL_FALSE;
|
||||
if (min->Height != EGL_DONT_CARE && c->Height < min->Height)
|
||||
return EGL_FALSE;
|
||||
if (min->RefreshRate != EGL_DONT_CARE && c->RefreshRate < min->RefreshRate)
|
||||
return EGL_FALSE;
|
||||
if (min->Optimal != EGL_DONT_CARE && c->Optimal != min->Optimal)
|
||||
return EGL_FALSE;
|
||||
if (min->Interlaced != EGL_DONT_CARE && c->Interlaced != min->Interlaced)
|
||||
return EGL_FALSE;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return value of given mode attribute, or -1 if bad attrib.
|
||||
*/
|
||||
static EGLint
|
||||
getModeAttrib(const _EGLMode *m, EGLint attrib)
|
||||
{
|
||||
switch (attrib) {
|
||||
case EGL_MODE_ID_MESA:
|
||||
return m->Handle;
|
||||
case EGL_WIDTH:
|
||||
return m->Width;
|
||||
case EGL_HEIGHT:
|
||||
return m->Height;
|
||||
case EGL_REFRESH_RATE_MESA:
|
||||
return m->RefreshRate;
|
||||
case EGL_OPTIMAL_MESA:
|
||||
return m->Optimal;
|
||||
case EGL_INTERLACED_MESA:
|
||||
return m->Interlaced;
|
||||
default:
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#define SMALLER 1
|
||||
#define LARGER 2
|
||||
|
||||
struct sort_info {
|
||||
EGLint Attrib;
|
||||
EGLint Order; /* SMALLER or LARGER */
|
||||
};
|
||||
|
||||
/* the order of these entries is the priority */
|
||||
static struct sort_info SortInfo[] = {
|
||||
{ EGL_OPTIMAL_MESA, LARGER },
|
||||
{ EGL_INTERLACED_MESA, SMALLER },
|
||||
{ EGL_WIDTH, LARGER },
|
||||
{ EGL_HEIGHT, LARGER },
|
||||
{ EGL_REFRESH_RATE_MESA, LARGER },
|
||||
{ EGL_MODE_ID_MESA, SMALLER },
|
||||
{ 0, 0 }
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Compare modes 'a' and 'b' and return -1 if a belongs before b, or 1 if a
|
||||
* belongs after b, or 0 if they're equal.
|
||||
* Used by qsort().
|
||||
*/
|
||||
static int
|
||||
_eglCompareModes(const void *a, const void *b)
|
||||
{
|
||||
const _EGLMode *aMode = *((const _EGLMode **) a);
|
||||
const _EGLMode *bMode = *((const _EGLMode **) b);
|
||||
EGLint i;
|
||||
|
||||
for (i = 0; SortInfo[i].Attrib; i++) {
|
||||
const EGLint aVal = getModeAttrib(aMode, SortInfo[i].Attrib);
|
||||
const EGLint bVal = getModeAttrib(bMode, SortInfo[i].Attrib);
|
||||
if (aVal == bVal) {
|
||||
/* a tie */
|
||||
continue;
|
||||
}
|
||||
else if (SortInfo[i].Order == SMALLER) {
|
||||
return (aVal < bVal) ? -1 : 1;
|
||||
}
|
||||
else if (SortInfo[i].Order == LARGER) {
|
||||
return (aVal > bVal) ? -1 : 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* all attributes identical */
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Search for EGLModes which match the given attribute list.
|
||||
* Called via eglChooseModeMESA API function.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglChooseModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
const EGLint *attrib_list, EGLModeMESA *modes,
|
||||
EGLint modes_size, EGLint *num_modes)
|
||||
{
|
||||
_EGLMode **modeList, min;
|
||||
EGLint i, count;
|
||||
|
||||
if (!_eglParseModeAttribs(&min, attrib_list)) {
|
||||
/* error code will have been recorded */
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
/* allocate array of mode pointers */
|
||||
modeList = malloc(modes_size * sizeof(_EGLMode *));
|
||||
if (!modeList) {
|
||||
_eglError(EGL_BAD_MODE_MESA, "eglChooseModeMESA(out of memory)");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
/* make array of pointers to qualifying modes */
|
||||
for (i = count = 0; i < scrn->NumModes && count < modes_size; i++) {
|
||||
if (_eglModeQualifies(scrn->Modes + i, &min)) {
|
||||
modeList[count++] = scrn->Modes + i;
|
||||
}
|
||||
}
|
||||
|
||||
/* sort array of pointers */
|
||||
qsort(modeList, count, sizeof(_EGLMode *), _eglCompareModes);
|
||||
|
||||
/* copy mode handles to output array */
|
||||
for (i = 0; i < count; i++) {
|
||||
modes[i] = modeList[i]->Handle;
|
||||
}
|
||||
|
||||
free(modeList);
|
||||
|
||||
*num_modes = count;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Return all possible modes for the given screen. No sorting of results.
|
||||
* Called via eglGetModesMESA() API function.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglGetModesMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes)
|
||||
{
|
||||
if (modes) {
|
||||
EGLint i;
|
||||
*num_modes = MIN2(scrn->NumModes, modes_size);
|
||||
for (i = 0; i < *num_modes; i++) {
|
||||
modes[i] = scrn->Modes[i].Handle;
|
||||
}
|
||||
}
|
||||
else {
|
||||
/* just return total number of supported modes */
|
||||
*num_modes = scrn->NumModes;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Query an attribute of a mode.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglGetModeAttribMESA(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLMode *m, EGLint attribute, EGLint *value)
|
||||
{
|
||||
EGLint v;
|
||||
|
||||
v = getModeAttrib(m, attribute);
|
||||
if (v < 0) {
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglGetModeAttribMESA");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
*value = v;
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Return human-readable string for given mode.
|
||||
* This is the default function called by eglQueryModeStringMESA().
|
||||
*/
|
||||
const char *
|
||||
_eglQueryModeStringMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *m)
|
||||
{
|
||||
return m->Name;
|
||||
}
|
||||
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
|
@ -1,88 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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, sub license, 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 (including the
|
||||
* next paragraph) 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLMODE_INCLUDED
|
||||
#define EGLMODE_INCLUDED
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
#define EGL_NO_MODE_MESA 0
|
||||
|
||||
|
||||
/**
|
||||
* Data structure which corresponds to an EGLModeMESA.
|
||||
*/
|
||||
struct _egl_mode
|
||||
{
|
||||
EGLModeMESA Handle; /* the public/opaque handle which names this mode */
|
||||
EGLint Width, Height; /* size in pixels */
|
||||
EGLint RefreshRate; /* rate * 1000.0 */
|
||||
EGLint Optimal;
|
||||
EGLint Interlaced;
|
||||
const char *Name;
|
||||
|
||||
/* Other possible attributes */
|
||||
/* interlaced */
|
||||
/* external sync */
|
||||
};
|
||||
|
||||
|
||||
extern _EGLMode *
|
||||
_eglLookupMode(EGLModeMESA mode, _EGLDisplay *dpy);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglChooseModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
const EGLint *attrib_list, EGLModeMESA *modes,
|
||||
EGLint modes_size, EGLint *num_modes);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetModesMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
EGLModeMESA *modes, EGLint modes_size, EGLint *num_modes);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetModeAttribMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *m,
|
||||
EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
extern const char *
|
||||
_eglQueryModeStringMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLMode *m);
|
||||
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
#endif /* EGLMODE_INCLUDED */
|
|
@ -1,235 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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, sub license, 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 (including the
|
||||
* next paragraph) 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Ideas for screen management extension to EGL.
|
||||
*
|
||||
* Each EGLDisplay has one or more screens (CRTs, Flat Panels, etc).
|
||||
* The screens' handles can be obtained with eglGetScreensMESA().
|
||||
*
|
||||
* A new kind of EGLSurface is possible- one which can be directly scanned
|
||||
* out on a screen. Such a surface is created with eglCreateScreenSurface().
|
||||
*
|
||||
* To actually display a screen surface on a screen, the eglShowSurface()
|
||||
* function is called.
|
||||
*/
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "c11/threads.h"
|
||||
|
||||
#include "egldisplay.h"
|
||||
#include "eglcurrent.h"
|
||||
#include "eglmode.h"
|
||||
#include "eglsurface.h"
|
||||
#include "eglscreen.h"
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
/* ugh, no atomic op? */
|
||||
static mtx_t _eglNextScreenHandleMutex = _MTX_INITIALIZER_NP;
|
||||
static EGLScreenMESA _eglNextScreenHandle = 1;
|
||||
|
||||
|
||||
/**
|
||||
* Return a new screen handle/ID.
|
||||
* NOTE: we never reuse these!
|
||||
*/
|
||||
static EGLScreenMESA
|
||||
_eglAllocScreenHandle(void)
|
||||
{
|
||||
EGLScreenMESA s;
|
||||
|
||||
mtx_lock(&_eglNextScreenHandleMutex);
|
||||
s = _eglNextScreenHandle;
|
||||
_eglNextScreenHandle += _EGL_SCREEN_MAX_MODES;
|
||||
mtx_unlock(&_eglNextScreenHandleMutex);
|
||||
|
||||
return s;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Initialize an _EGLScreen object to default values.
|
||||
*/
|
||||
void
|
||||
_eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes)
|
||||
{
|
||||
memset(screen, 0, sizeof(_EGLScreen));
|
||||
|
||||
screen->Display = dpy;
|
||||
screen->NumModes = num_modes;
|
||||
screen->StepX = 1;
|
||||
screen->StepY = 1;
|
||||
|
||||
if (num_modes > _EGL_SCREEN_MAX_MODES)
|
||||
num_modes = _EGL_SCREEN_MAX_MODES;
|
||||
screen->Modes = calloc(num_modes, sizeof(*screen->Modes));
|
||||
screen->NumModes = (screen->Modes) ? num_modes : 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Link a screen to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
EGLScreenMESA
|
||||
_eglLinkScreen(_EGLScreen *screen)
|
||||
{
|
||||
_EGLDisplay *display;
|
||||
EGLint i;
|
||||
|
||||
assert(screen && screen->Display);
|
||||
display = screen->Display;
|
||||
|
||||
if (!display->Screens) {
|
||||
display->Screens = _eglCreateArray("Screen", 4);
|
||||
if (!display->Screens)
|
||||
return (EGLScreenMESA) 0;
|
||||
}
|
||||
|
||||
screen->Handle = _eglAllocScreenHandle();
|
||||
for (i = 0; i < screen->NumModes; i++)
|
||||
screen->Modes[i].Handle = screen->Handle + i;
|
||||
|
||||
_eglAppendArray(display->Screens, (void *) screen);
|
||||
|
||||
return screen->Handle;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Lookup a handle to find the linked config.
|
||||
* Return NULL if the handle has no corresponding linked config.
|
||||
*/
|
||||
_EGLScreen *
|
||||
_eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *display)
|
||||
{
|
||||
EGLint i;
|
||||
|
||||
if (!display || !display->Screens)
|
||||
return NULL;
|
||||
|
||||
for (i = 0; i < display->Screens->Size; i++) {
|
||||
_EGLScreen *scr = (_EGLScreen *) display->Screens->Elements[i];
|
||||
if (scr->Handle == screen) {
|
||||
assert(scr->Display == display);
|
||||
return scr;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
static EGLBoolean
|
||||
_eglFlattenScreen(void *elem, void *buffer)
|
||||
{
|
||||
_EGLScreen *scr = (_EGLScreen *) elem;
|
||||
EGLScreenMESA *handle = (EGLScreenMESA *) buffer;
|
||||
*handle = _eglGetScreenHandle(scr);
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *display, EGLScreenMESA *screens,
|
||||
EGLint max_screens, EGLint *num_screens)
|
||||
{
|
||||
*num_screens = _eglFlattenArray(display->Screens, (void *) screens,
|
||||
sizeof(screens[0]), max_screens, _eglFlattenScreen);
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set a screen's surface origin.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglScreenPositionMESA(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLScreen *scrn, EGLint x, EGLint y)
|
||||
{
|
||||
scrn->OriginX = x;
|
||||
scrn->OriginY = y;
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Query a screen's current surface.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglQueryScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLScreen *scrn, _EGLSurface **surf)
|
||||
{
|
||||
*surf = scrn->CurrentSurface;
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Query a screen's current mode.
|
||||
*/
|
||||
EGLBoolean
|
||||
_eglQueryScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
_EGLMode **m)
|
||||
{
|
||||
*m = scrn->CurrentMode;
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
EGLBoolean
|
||||
_eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn,
|
||||
EGLint attribute, EGLint *value)
|
||||
{
|
||||
switch (attribute) {
|
||||
case EGL_SCREEN_POSITION_MESA:
|
||||
value[0] = scrn->OriginX;
|
||||
value[1] = scrn->OriginY;
|
||||
break;
|
||||
case EGL_SCREEN_POSITION_GRANULARITY_MESA:
|
||||
value[0] = scrn->StepX;
|
||||
value[1] = scrn->StepY;
|
||||
break;
|
||||
default:
|
||||
_eglError(EGL_BAD_ATTRIBUTE, "eglQueryScreenMESA");
|
||||
return EGL_FALSE;
|
||||
}
|
||||
|
||||
return EGL_TRUE;
|
||||
}
|
||||
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
|
@ -1,117 +0,0 @@
|
|||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, Inc.
|
||||
* Copyright 2009-2010 Chia-I Wu <olvaffe@gmail.com>
|
||||
* Copyright 2010 LunarG, Inc.
|
||||
* 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, sub license, 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 (including the
|
||||
* next paragraph) 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.
|
||||
*
|
||||
**************************************************************************/
|
||||
|
||||
|
||||
#ifndef EGLSCREEN_INCLUDED
|
||||
#define EGLSCREEN_INCLUDED
|
||||
|
||||
#include "c99_compat.h"
|
||||
|
||||
#include "egltypedefs.h"
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
|
||||
|
||||
#define _EGL_SCREEN_MAX_MODES 16
|
||||
|
||||
|
||||
/**
|
||||
* Per-screen information.
|
||||
* Note that an EGL screen doesn't have a size. A screen may be set to
|
||||
* one of several display modes (width/height/scanrate). The screen
|
||||
* then displays a drawing surface. The drawing surface must be at least
|
||||
* as large as the display mode's resolution. If it's larger, the
|
||||
* OriginX and OriginY fields control what part of the surface is visible
|
||||
* on the screen.
|
||||
*/
|
||||
struct _egl_screen
|
||||
{
|
||||
_EGLDisplay *Display;
|
||||
|
||||
EGLScreenMESA Handle; /* The public/opaque handle which names this object */
|
||||
|
||||
_EGLMode *CurrentMode;
|
||||
_EGLSurface *CurrentSurface;
|
||||
|
||||
EGLint OriginX, OriginY; /**< Origin of scan-out region w.r.t. surface */
|
||||
EGLint StepX, StepY; /**< Screen position/origin granularity */
|
||||
|
||||
EGLint NumModes;
|
||||
_EGLMode *Modes; /**< array [NumModes] */
|
||||
};
|
||||
|
||||
|
||||
extern void
|
||||
_eglInitScreen(_EGLScreen *screen, _EGLDisplay *dpy, EGLint num_modes);
|
||||
|
||||
|
||||
extern EGLScreenMESA
|
||||
_eglLinkScreen(_EGLScreen *screen);
|
||||
|
||||
|
||||
extern _EGLScreen *
|
||||
_eglLookupScreen(EGLScreenMESA screen, _EGLDisplay *dpy);
|
||||
|
||||
|
||||
/**
|
||||
* Return the handle of a linked screen.
|
||||
*/
|
||||
static inline EGLScreenMESA
|
||||
_eglGetScreenHandle(_EGLScreen *screen)
|
||||
{
|
||||
return (screen) ? screen->Handle : (EGLScreenMESA) 0;
|
||||
}
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetScreensMESA(_EGLDriver *drv, _EGLDisplay *dpy, EGLScreenMESA *screens, EGLint max_screens, EGLint *num_screens);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglScreenPositionMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint x, EGLint y);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQueryScreenSurfaceMESA(_EGLDriver *drv, _EGLDisplay *dpy,
|
||||
_EGLScreen *scrn, _EGLSurface **surface);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQueryScreenModeMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, _EGLMode **m);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglQueryScreenMESA(_EGLDriver *drv, _EGLDisplay *dpy, _EGLScreen *scrn, EGLint attribute, EGLint *value);
|
||||
|
||||
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
#endif /* EGLSCREEN_INCLUDED */
|
|
@ -61,50 +61,6 @@ _eglClampSwapInterval(_EGLSurface *surf, EGLint interval)
|
|||
}
|
||||
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
static EGLint
|
||||
_eglParseScreenSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
||||
{
|
||||
EGLint i, err = EGL_SUCCESS;
|
||||
|
||||
if (!attrib_list)
|
||||
return EGL_SUCCESS;
|
||||
|
||||
for (i = 0; attrib_list[i] != EGL_NONE; i++) {
|
||||
EGLint attr = attrib_list[i++];
|
||||
EGLint val = attrib_list[i];
|
||||
|
||||
switch (attr) {
|
||||
case EGL_WIDTH:
|
||||
if (val < 0) {
|
||||
err = EGL_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
surf->Width = val;
|
||||
break;
|
||||
case EGL_HEIGHT:
|
||||
if (val < 0) {
|
||||
err = EGL_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
surf->Height = val;
|
||||
break;
|
||||
default:
|
||||
err = EGL_BAD_ATTRIBUTE;
|
||||
break;
|
||||
}
|
||||
|
||||
if (err != EGL_SUCCESS) {
|
||||
_eglLog(_EGL_WARNING, "bad surface attribute 0x%04x", attr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return err;
|
||||
}
|
||||
#endif /* EGL_MESA_screen_surface */
|
||||
|
||||
|
||||
/**
|
||||
* Parse the list of surface attributes and return the proper error code.
|
||||
*/
|
||||
|
@ -119,11 +75,6 @@ _eglParseSurfaceAttribList(_EGLSurface *surf, const EGLint *attrib_list)
|
|||
if (!attrib_list)
|
||||
return EGL_SUCCESS;
|
||||
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
if (type == EGL_SCREEN_BIT_MESA)
|
||||
return _eglParseScreenSurfaceAttribList(surf, attrib_list);
|
||||
#endif
|
||||
|
||||
if (dpy->Extensions.NOK_texture_from_pixmap)
|
||||
texture_type |= EGL_PIXMAP_BIT;
|
||||
|
||||
|
@ -297,12 +248,6 @@ _eglInitSurface(_EGLSurface *surf, _EGLDisplay *dpy, EGLint type,
|
|||
case EGL_PBUFFER_BIT:
|
||||
func = "eglCreatePBufferSurface";
|
||||
break;
|
||||
#ifdef EGL_MESA_screen_surface
|
||||
case EGL_SCREEN_BIT_MESA:
|
||||
func = "eglCreateScreenSurface";
|
||||
renderBuffer = EGL_SINGLE_BUFFER; /* XXX correct? */
|
||||
break;
|
||||
#endif
|
||||
default:
|
||||
_eglLog(_EGL_WARNING, "Bad type in _eglInitSurface");
|
||||
return EGL_FALSE;
|
||||
|
|
|
@ -37,6 +37,10 @@
|
|||
#include "egldisplay.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* "Base" class for device driver surfaces.
|
||||
*/
|
||||
|
@ -174,4 +178,8 @@ _eglGetSurfaceHandle(_EGLSurface *surf)
|
|||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLSURFACE_INCLUDED */
|
||||
|
|
|
@ -67,7 +67,7 @@ _eglParseSyncAttribList(_EGLSync *sync, const EGLint *attrib_list)
|
|||
|
||||
|
||||
static EGLint
|
||||
_eglParseSyncAttribList64(_EGLSync *sync, const EGLAttribKHR *attrib_list)
|
||||
_eglParseSyncAttribList64(_EGLSync *sync, const EGLAttrib *attrib_list)
|
||||
{
|
||||
EGLint i, err = EGL_SUCCESS;
|
||||
|
||||
|
@ -103,7 +103,7 @@ _eglParseSyncAttribList64(_EGLSync *sync, const EGLAttribKHR *attrib_list)
|
|||
|
||||
EGLBoolean
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
||||
const EGLint *attrib_list, const EGLAttribKHR *attrib_list64)
|
||||
const EGLint *attrib_list, const EGLAttrib *attrib_list64)
|
||||
{
|
||||
EGLint err;
|
||||
|
||||
|
@ -141,8 +141,8 @@ _eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
|||
|
||||
|
||||
EGLBoolean
|
||||
_eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
EGLint attribute, EGLint *value)
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
EGLint attribute, EGLAttrib *value)
|
||||
{
|
||||
if (!value)
|
||||
return _eglError(EGL_BAD_PARAMETER, "eglGetSyncAttribKHR");
|
||||
|
|
|
@ -47,18 +47,18 @@ struct _egl_sync
|
|||
EGLenum Type;
|
||||
EGLenum SyncStatus;
|
||||
EGLenum SyncCondition;
|
||||
EGLAttribKHR CLEvent;
|
||||
EGLAttrib CLEvent;
|
||||
};
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglInitSync(_EGLSync *sync, _EGLDisplay *dpy, EGLenum type,
|
||||
const EGLint *attrib_list, const EGLAttribKHR *attrib_list64);
|
||||
const EGLint *attrib_list, const EGLAttrib *attrib_list64);
|
||||
|
||||
|
||||
extern EGLBoolean
|
||||
_eglGetSyncAttribKHR(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
EGLint attribute, EGLint *value);
|
||||
_eglGetSyncAttrib(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSync *sync,
|
||||
EGLint attribute, EGLAttrib *value);
|
||||
|
||||
|
||||
/**
|
||||
|
@ -87,11 +87,11 @@ _eglPutSync(_EGLSync *sync)
|
|||
* Link a sync to its display and return the handle of the link.
|
||||
* The handle can be passed to client directly.
|
||||
*/
|
||||
static inline EGLSyncKHR
|
||||
static inline EGLSync
|
||||
_eglLinkSync(_EGLSync *sync)
|
||||
{
|
||||
_eglLinkResource(&sync->Resource, _EGL_RESOURCE_SYNC);
|
||||
return (EGLSyncKHR) sync;
|
||||
return (EGLSync) sync;
|
||||
}
|
||||
|
||||
|
||||
|
@ -110,7 +110,7 @@ _eglUnlinkSync(_EGLSync *sync)
|
|||
* Return NULL if the handle has no corresponding linked sync.
|
||||
*/
|
||||
static inline _EGLSync *
|
||||
_eglLookupSync(EGLSyncKHR handle, _EGLDisplay *dpy)
|
||||
_eglLookupSync(EGLSync handle, _EGLDisplay *dpy)
|
||||
{
|
||||
_EGLSync *sync = (_EGLSync *) handle;
|
||||
if (!dpy || !_eglCheckResource((void *) sync, _EGL_RESOURCE_SYNC, dpy))
|
||||
|
@ -122,12 +122,12 @@ _eglLookupSync(EGLSyncKHR handle, _EGLDisplay *dpy)
|
|||
/**
|
||||
* Return the handle of a linked sync, or EGL_NO_SYNC_KHR.
|
||||
*/
|
||||
static inline EGLSyncKHR
|
||||
static inline EGLSync
|
||||
_eglGetSyncHandle(_EGLSync *sync)
|
||||
{
|
||||
_EGLResource *res = (_EGLResource *) sync;
|
||||
return (res && _eglIsResourceLinked(res)) ?
|
||||
(EGLSyncKHR) sync : EGL_NO_SYNC_KHR;
|
||||
(EGLSync) sync : EGL_NO_SYNC_KHR;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -31,13 +31,16 @@
|
|||
#ifndef EGLTYPEDEFS_INCLUDED
|
||||
#define EGLTYPEDEFS_INCLUDED
|
||||
|
||||
#define EGL_EGLEXT_PROTOTYPES
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <EGL/eglext.h>
|
||||
|
||||
#include "eglcompiler.h"
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef struct _egl_api _EGLAPI;
|
||||
|
||||
typedef struct _egl_array _EGLArray;
|
||||
|
@ -68,4 +71,9 @@ typedef struct _egl_sync _EGLSync;
|
|||
|
||||
typedef struct _egl_thread_info _EGLThreadInfo;
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* EGLTYPEDEFS_INCLUDED */
|
||||
|
|
|
@ -29,4 +29,12 @@ LOCAL_C_INCLUDES += \
|
|||
$(GALLIUM_TOP)/winsys \
|
||||
$(GALLIUM_TOP)/drivers
|
||||
|
||||
ifeq ($(MESA_ENABLE_LLVM),true)
|
||||
LOCAL_C_INCLUDES += \
|
||||
external/llvm/include \
|
||||
external/llvm/device/include \
|
||||
external/libcxx/include \
|
||||
external/elfutils/$(if $(filter true,$(MESA_LOLLIPOP_BUILD)),0.153/)libelf
|
||||
endif
|
||||
|
||||
include $(MESA_COMMON_MK)
|
||||
|
|
|
@ -33,7 +33,9 @@ SUBDIRS := auxiliary
|
|||
#
|
||||
|
||||
# swrast
|
||||
SUBDIRS += winsys/sw/android drivers/softpipe
|
||||
ifneq ($(filter swrast,$(MESA_GPU_DRIVERS)),)
|
||||
SUBDIRS += winsys/sw/dri winsys/sw/kms-dri drivers/softpipe
|
||||
endif
|
||||
|
||||
# freedreno
|
||||
ifneq ($(filter freedreno, $(MESA_GPU_DRIVERS)),)
|
||||
|
@ -74,10 +76,17 @@ endif
|
|||
endif
|
||||
endif
|
||||
|
||||
# vc4
|
||||
ifneq ($(filter vc4, $(MESA_GPU_DRIVERS)),)
|
||||
SUBDIRS += winsys/vc4/drm drivers/vc4
|
||||
endif
|
||||
|
||||
# vmwgfx
|
||||
ifneq ($(filter vmwgfx, $(MESA_GPU_DRIVERS)),)
|
||||
SUBDIRS += winsys/svga/drm drivers/svga
|
||||
endif
|
||||
|
||||
mkfiles := $(patsubst %,$(GALLIUM_TOP)/%/Android.mk,$(SUBDIRS))
|
||||
include $(mkfiles)
|
||||
# Gallium state trackers and target for dri
|
||||
SUBDIRS += state_trackers/dri targets/dri
|
||||
|
||||
include $(call all-named-subdir-makefiles,$(SUBDIRS))
|
||||
|
|
|
@ -30,12 +30,23 @@ include $(CLEAR_VARS)
|
|||
|
||||
LOCAL_SRC_FILES := \
|
||||
$(C_SOURCES) \
|
||||
$(NIR_SOURCES) \
|
||||
$(VL_STUB_SOURCES)
|
||||
|
||||
LOCAL_C_INCLUDES := \
|
||||
$(GALLIUM_TOP)/auxiliary/util
|
||||
|
||||
ifeq ($(MESA_ENABLE_LLVM),true)
|
||||
LOCAL_SRC_FILES += \
|
||||
$(GALLIVM_SOURCES) \
|
||||
$(GALLIVM_CPP_SOURCES)
|
||||
|
||||
LOCAL_CPPFLAGS := -std=c++11
|
||||
endif
|
||||
|
||||
# We need libmesa_glsl to get NIR's generated include directories.
|
||||
LOCAL_MODULE := libmesa_gallium
|
||||
LOCAL_STATIC_LIBRARIES += libmesa_glsl
|
||||
|
||||
# generate sources
|
||||
LOCAL_MODULE_CLASS := STATIC_LIBRARIES
|
||||
|
|
|
@ -82,6 +82,7 @@ struct cso_context {
|
|||
struct u_vbuf *vbuf;
|
||||
|
||||
boolean has_geometry_shader;
|
||||
boolean has_tessellation;
|
||||
boolean has_streamout;
|
||||
|
||||
struct sampler_info samplers[PIPE_SHADER_TYPES];
|
||||
|
@ -108,6 +109,8 @@ struct cso_context {
|
|||
void *fragment_shader, *fragment_shader_saved;
|
||||
void *vertex_shader, *vertex_shader_saved;
|
||||
void *geometry_shader, *geometry_shader_saved;
|
||||
void *tessctrl_shader, *tessctrl_shader_saved;
|
||||
void *tesseval_shader, *tesseval_shader_saved;
|
||||
void *velements, *velements_saved;
|
||||
struct pipe_query *render_condition, *render_condition_saved;
|
||||
uint render_condition_mode, render_condition_mode_saved;
|
||||
|
@ -273,6 +276,10 @@ struct cso_context *cso_create_context( struct pipe_context *pipe )
|
|||
PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) {
|
||||
ctx->has_geometry_shader = TRUE;
|
||||
}
|
||||
if (pipe->screen->get_shader_param(pipe->screen, PIPE_SHADER_TESS_CTRL,
|
||||
PIPE_SHADER_CAP_MAX_INSTRUCTIONS) > 0) {
|
||||
ctx->has_tessellation = TRUE;
|
||||
}
|
||||
if (pipe->screen->get_param(pipe->screen,
|
||||
PIPE_CAP_MAX_STREAM_OUTPUT_BUFFERS) != 0) {
|
||||
ctx->has_streamout = TRUE;
|
||||
|
@ -293,6 +300,8 @@ void cso_destroy_context( struct cso_context *ctx )
|
|||
unsigned i, shader;
|
||||
|
||||
if (ctx->pipe) {
|
||||
ctx->pipe->set_index_buffer(ctx->pipe, NULL);
|
||||
|
||||
ctx->pipe->bind_blend_state( ctx->pipe, NULL );
|
||||
ctx->pipe->bind_rasterizer_state( ctx->pipe, NULL );
|
||||
|
||||
|
@ -319,7 +328,19 @@ void cso_destroy_context( struct cso_context *ctx )
|
|||
|
||||
ctx->pipe->bind_depth_stencil_alpha_state( ctx->pipe, NULL );
|
||||
ctx->pipe->bind_fs_state( ctx->pipe, NULL );
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_FRAGMENT, 0, NULL);
|
||||
ctx->pipe->bind_vs_state( ctx->pipe, NULL );
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_VERTEX, 0, NULL);
|
||||
if (ctx->has_geometry_shader) {
|
||||
ctx->pipe->bind_gs_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_GEOMETRY, 0, NULL);
|
||||
}
|
||||
if (ctx->has_tessellation) {
|
||||
ctx->pipe->bind_tcs_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_TESS_CTRL, 0, NULL);
|
||||
ctx->pipe->bind_tes_state(ctx->pipe, NULL);
|
||||
ctx->pipe->set_constant_buffer(ctx->pipe, PIPE_SHADER_TESS_EVAL, 0, NULL);
|
||||
}
|
||||
ctx->pipe->bind_vertex_elements_state( ctx->pipe, NULL );
|
||||
|
||||
if (ctx->has_streamout)
|
||||
|
@ -812,6 +833,92 @@ void cso_restore_geometry_shader(struct cso_context *ctx)
|
|||
ctx->geometry_shader_saved = NULL;
|
||||
}
|
||||
|
||||
void cso_set_tessctrl_shader_handle(struct cso_context *ctx, void *handle)
|
||||
{
|
||||
assert(ctx->has_tessellation || !handle);
|
||||
|
||||
if (ctx->has_tessellation && ctx->tessctrl_shader != handle) {
|
||||
ctx->tessctrl_shader = handle;
|
||||
ctx->pipe->bind_tcs_state(ctx->pipe, handle);
|
||||
}
|
||||
}
|
||||
|
||||
void cso_delete_tessctrl_shader(struct cso_context *ctx, void *handle)
|
||||
{
|
||||
if (handle == ctx->tessctrl_shader) {
|
||||
/* unbind before deleting */
|
||||
ctx->pipe->bind_tcs_state(ctx->pipe, NULL);
|
||||
ctx->tessctrl_shader = NULL;
|
||||
}
|
||||
ctx->pipe->delete_tcs_state(ctx->pipe, handle);
|
||||
}
|
||||
|
||||
void cso_save_tessctrl_shader(struct cso_context *ctx)
|
||||
{
|
||||
if (!ctx->has_tessellation) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(!ctx->tessctrl_shader_saved);
|
||||
ctx->tessctrl_shader_saved = ctx->tessctrl_shader;
|
||||
}
|
||||
|
||||
void cso_restore_tessctrl_shader(struct cso_context *ctx)
|
||||
{
|
||||
if (!ctx->has_tessellation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->tessctrl_shader_saved != ctx->tessctrl_shader) {
|
||||
ctx->pipe->bind_tcs_state(ctx->pipe, ctx->tessctrl_shader_saved);
|
||||
ctx->tessctrl_shader = ctx->tessctrl_shader_saved;
|
||||
}
|
||||
ctx->tessctrl_shader_saved = NULL;
|
||||
}
|
||||
|
||||
void cso_set_tesseval_shader_handle(struct cso_context *ctx, void *handle)
|
||||
{
|
||||
assert(ctx->has_tessellation || !handle);
|
||||
|
||||
if (ctx->has_tessellation && ctx->tesseval_shader != handle) {
|
||||
ctx->tesseval_shader = handle;
|
||||
ctx->pipe->bind_tes_state(ctx->pipe, handle);
|
||||
}
|
||||
}
|
||||
|
||||
void cso_delete_tesseval_shader(struct cso_context *ctx, void *handle)
|
||||
{
|
||||
if (handle == ctx->tesseval_shader) {
|
||||
/* unbind before deleting */
|
||||
ctx->pipe->bind_tes_state(ctx->pipe, NULL);
|
||||
ctx->tesseval_shader = NULL;
|
||||
}
|
||||
ctx->pipe->delete_tes_state(ctx->pipe, handle);
|
||||
}
|
||||
|
||||
void cso_save_tesseval_shader(struct cso_context *ctx)
|
||||
{
|
||||
if (!ctx->has_tessellation) {
|
||||
return;
|
||||
}
|
||||
|
||||
assert(!ctx->tesseval_shader_saved);
|
||||
ctx->tesseval_shader_saved = ctx->tesseval_shader;
|
||||
}
|
||||
|
||||
void cso_restore_tesseval_shader(struct cso_context *ctx)
|
||||
{
|
||||
if (!ctx->has_tessellation) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (ctx->tesseval_shader_saved != ctx->tesseval_shader) {
|
||||
ctx->pipe->bind_tes_state(ctx->pipe, ctx->tesseval_shader_saved);
|
||||
ctx->tesseval_shader = ctx->tesseval_shader_saved;
|
||||
}
|
||||
ctx->tesseval_shader_saved = NULL;
|
||||
}
|
||||
|
||||
/* clip state */
|
||||
|
||||
static INLINE void
|
||||
|
|
|
@ -141,6 +141,18 @@ void cso_save_geometry_shader(struct cso_context *cso);
|
|||
void cso_restore_geometry_shader(struct cso_context *cso);
|
||||
|
||||
|
||||
void cso_set_tessctrl_shader_handle(struct cso_context *ctx, void *handle);
|
||||
void cso_delete_tessctrl_shader(struct cso_context *ctx, void *handle);
|
||||
void cso_save_tessctrl_shader(struct cso_context *cso);
|
||||
void cso_restore_tessctrl_shader(struct cso_context *cso);
|
||||
|
||||
|
||||
void cso_set_tesseval_shader_handle(struct cso_context *ctx, void *handle);
|
||||
void cso_delete_tesseval_shader(struct cso_context *ctx, void *handle);
|
||||
void cso_save_tesseval_shader(struct cso_context *cso);
|
||||
void cso_restore_tesseval_shader(struct cso_context *cso);
|
||||
|
||||
|
||||
void cso_set_framebuffer(struct cso_context *cso,
|
||||
const struct pipe_framebuffer_state *fb);
|
||||
void cso_save_framebuffer(struct cso_context *cso);
|
||||
|
|
|
@ -190,9 +190,15 @@ static void tgsi_gs_prepare(struct draw_geometry_shader *shader,
|
|||
const unsigned constants_size[PIPE_MAX_CONSTANT_BUFFERS])
|
||||
{
|
||||
struct tgsi_exec_machine *machine = shader->machine;
|
||||
|
||||
int j;
|
||||
tgsi_exec_set_constant_buffers(machine, PIPE_MAX_CONSTANT_BUFFERS,
|
||||
constants, constants_size);
|
||||
|
||||
if (shader->info.uses_invocationid) {
|
||||
unsigned i = machine->SysSemanticToIndex[TGSI_SEMANTIC_INVOCATIONID];
|
||||
for (j = 0; j < TGSI_QUAD_SIZE; j++)
|
||||
machine->SystemValue[i].i[j] = shader->invocation_id;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned tgsi_gs_run(struct draw_geometry_shader *shader,
|
||||
|
@ -385,7 +391,8 @@ llvm_gs_run(struct draw_geometry_shader *shader,
|
|||
(struct vertex_header*)input,
|
||||
input_primitives,
|
||||
shader->draw->instance_id,
|
||||
shader->llvm_prim_ids);
|
||||
shader->llvm_prim_ids,
|
||||
shader->invocation_id);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
@ -555,7 +562,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
|
|||
* overflown vertices into some area where they won't harm anyone */
|
||||
unsigned total_verts_per_buffer = shader->primitive_boundary *
|
||||
num_in_primitives;
|
||||
|
||||
unsigned invocation;
|
||||
//Assume at least one primitive
|
||||
max_out_prims = MAX2(max_out_prims, 1);
|
||||
|
||||
|
@ -564,7 +571,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
|
|||
output_verts->stride = output_verts->vertex_size;
|
||||
output_verts->verts =
|
||||
(struct vertex_header *)MALLOC(output_verts->vertex_size *
|
||||
total_verts_per_buffer);
|
||||
total_verts_per_buffer * shader->num_invocations);
|
||||
debug_assert(output_verts->verts);
|
||||
|
||||
#if 0
|
||||
|
@ -592,7 +599,7 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
|
|||
shader->input = input;
|
||||
shader->input_info = input_info;
|
||||
FREE(shader->primitive_lengths);
|
||||
shader->primitive_lengths = MALLOC(max_out_prims * sizeof(unsigned));
|
||||
shader->primitive_lengths = MALLOC(max_out_prims * sizeof(unsigned) * shader->num_invocations);
|
||||
|
||||
|
||||
#ifdef HAVE_LLVM
|
||||
|
@ -622,24 +629,27 @@ int draw_geometry_shader_run(struct draw_geometry_shader *shader,
|
|||
}
|
||||
#endif
|
||||
|
||||
shader->prepare(shader, constants, constants_size);
|
||||
for (invocation = 0; invocation < shader->num_invocations; invocation++) {
|
||||
shader->invocation_id = invocation;
|
||||
|
||||
if (input_prim->linear)
|
||||
gs_run(shader, input_prim, input_verts,
|
||||
output_prims, output_verts);
|
||||
else
|
||||
gs_run_elts(shader, input_prim, input_verts,
|
||||
output_prims, output_verts);
|
||||
shader->prepare(shader, constants, constants_size);
|
||||
|
||||
/* Flush the remaining primitives. Will happen if
|
||||
* num_input_primitives % 4 != 0
|
||||
*/
|
||||
if (shader->fetched_prim_count > 0) {
|
||||
gs_flush(shader);
|
||||
if (input_prim->linear)
|
||||
gs_run(shader, input_prim, input_verts,
|
||||
output_prims, output_verts);
|
||||
else
|
||||
gs_run_elts(shader, input_prim, input_verts,
|
||||
output_prims, output_verts);
|
||||
|
||||
/* Flush the remaining primitives. Will happen if
|
||||
* num_input_primitives % 4 != 0
|
||||
*/
|
||||
if (shader->fetched_prim_count > 0) {
|
||||
gs_flush(shader);
|
||||
}
|
||||
debug_assert(shader->fetched_prim_count == 0);
|
||||
}
|
||||
|
||||
debug_assert(shader->fetched_prim_count == 0);
|
||||
|
||||
/* Update prim_info:
|
||||
*/
|
||||
output_prims->linear = TRUE;
|
||||
|
@ -771,6 +781,8 @@ draw_create_geometry_shader(struct draw_context *draw,
|
|||
gs->info.properties[TGSI_PROPERTY_GS_OUTPUT_PRIM];
|
||||
gs->max_output_vertices =
|
||||
gs->info.properties[TGSI_PROPERTY_GS_MAX_OUTPUT_VERTICES];
|
||||
gs->num_invocations =
|
||||
gs->info.properties[TGSI_PROPERTY_GS_INVOCATIONS];
|
||||
if (!gs->max_output_vertices)
|
||||
gs->max_output_vertices = 32;
|
||||
|
||||
|
|
|
@ -90,6 +90,8 @@ struct draw_geometry_shader {
|
|||
unsigned vector_length;
|
||||
unsigned max_out_prims;
|
||||
|
||||
unsigned num_invocations;
|
||||
unsigned invocation_id;
|
||||
#ifdef HAVE_LLVM
|
||||
struct draw_gs_inputs *gs_input;
|
||||
struct draw_gs_jit_context *jit_context;
|
||||
|
|
|
@ -97,6 +97,7 @@ create_jit_dvbuffer_type(struct gallivm_state *gallivm,
|
|||
dvbuffer_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
|
||||
(void) target; /* silence unused var warning for non-debug build */
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_vertex_buffer, map,
|
||||
target, dvbuffer_type,
|
||||
DRAW_JIT_DVBUFFER_MAP);
|
||||
|
@ -133,6 +134,7 @@ create_jit_texture_type(struct gallivm_state *gallivm, const char *struct_name)
|
|||
texture_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
|
||||
(void) target; /* silence unused var warning for non-debug build */
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_jit_texture, width,
|
||||
target, texture_type,
|
||||
DRAW_JIT_TEXTURE_WIDTH);
|
||||
|
@ -290,6 +292,7 @@ create_gs_jit_context_type(struct gallivm_state *gallivm,
|
|||
context_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
|
||||
(void) target; /* silence unused var warning for non-debug build */
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, constants,
|
||||
target, context_type, DRAW_GS_JIT_CTX_CONSTANTS);
|
||||
LP_CHECK_MEMBER_OFFSET(struct draw_gs_jit_context, num_constants,
|
||||
|
@ -353,6 +356,7 @@ create_jit_vertex_buffer_type(struct gallivm_state *gallivm,
|
|||
vb_type = LLVMStructTypeInContext(gallivm->context, elem_types,
|
||||
Elements(elem_types), 0);
|
||||
|
||||
(void) target; /* silence unused var warning for non-debug build */
|
||||
LP_CHECK_MEMBER_OFFSET(struct pipe_vertex_buffer, stride,
|
||||
target, vb_type, 0);
|
||||
LP_CHECK_MEMBER_OFFSET(struct pipe_vertex_buffer, buffer_offset,
|
||||
|
@ -1965,7 +1969,7 @@ draw_llvm_set_sampler_state(struct draw_context *draw,
|
|||
for (i = 0; i < draw->num_samplers[PIPE_SHADER_VERTEX]; i++) {
|
||||
struct draw_jit_sampler *jit_sam = &draw->llvm->jit_context.samplers[i];
|
||||
|
||||
if (draw->samplers[i]) {
|
||||
if (draw->samplers[PIPE_SHADER_VERTEX][i]) {
|
||||
const struct pipe_sampler_state *s
|
||||
= draw->samplers[PIPE_SHADER_VERTEX][i];
|
||||
jit_sam->min_lod = s->min_lod;
|
||||
|
@ -1978,7 +1982,7 @@ draw_llvm_set_sampler_state(struct draw_context *draw,
|
|||
for (i = 0; i < draw->num_samplers[PIPE_SHADER_GEOMETRY]; i++) {
|
||||
struct draw_jit_sampler *jit_sam = &draw->llvm->gs_jit_context.samplers[i];
|
||||
|
||||
if (draw->samplers[i]) {
|
||||
if (draw->samplers[PIPE_SHADER_GEOMETRY][i]) {
|
||||
const struct pipe_sampler_state *s
|
||||
= draw->samplers[PIPE_SHADER_GEOMETRY][i];
|
||||
jit_sam->min_lod = s->min_lod;
|
||||
|
@ -2065,7 +2069,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
|||
struct gallivm_state *gallivm = variant->gallivm;
|
||||
LLVMContextRef context = gallivm->context;
|
||||
LLVMTypeRef int32_type = LLVMInt32TypeInContext(context);
|
||||
LLVMTypeRef arg_types[6];
|
||||
LLVMTypeRef arg_types[7];
|
||||
LLVMTypeRef func_type;
|
||||
LLVMValueRef variant_func;
|
||||
LLVMValueRef context_ptr;
|
||||
|
@ -2101,6 +2105,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
|||
arg_types[4] = int32_type; /* instance_id */
|
||||
arg_types[5] = LLVMPointerType(
|
||||
LLVMVectorType(int32_type, vector_length), 0); /* prim_id_ptr */
|
||||
arg_types[6] = int32_type;
|
||||
|
||||
func_type = LLVMFunctionType(int32_type, arg_types, Elements(arg_types), 0);
|
||||
|
||||
|
@ -2121,6 +2126,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
|||
num_prims = LLVMGetParam(variant_func, 3);
|
||||
system_values.instance_id = LLVMGetParam(variant_func, 4);
|
||||
prim_id_ptr = LLVMGetParam(variant_func, 5);
|
||||
system_values.invocation_id = LLVMGetParam(variant_func, 6);
|
||||
|
||||
lp_build_name(context_ptr, "context");
|
||||
lp_build_name(input_array, "input");
|
||||
|
@ -2128,6 +2134,7 @@ draw_gs_llvm_generate(struct draw_llvm *llvm,
|
|||
lp_build_name(num_prims, "num_prims");
|
||||
lp_build_name(system_values.instance_id, "instance_id");
|
||||
lp_build_name(prim_id_ptr, "prim_id_ptr");
|
||||
lp_build_name(system_values.invocation_id, "invocation_id");
|
||||
|
||||
variant->context_ptr = context_ptr;
|
||||
variant->io_ptr = io_ptr;
|
||||
|
|
|
@ -298,7 +298,8 @@ typedef int
|
|||
struct vertex_header *output,
|
||||
unsigned num_prims,
|
||||
unsigned instance_id,
|
||||
int *prim_ids);
|
||||
int *prim_ids,
|
||||
unsigned invocation_id);
|
||||
|
||||
struct draw_llvm_variant_key
|
||||
{
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
|
||||
|
||||
/** Approx number of new tokens for instructions in aa_transform_inst() */
|
||||
#define NUM_NEW_TOKENS 50
|
||||
#define NUM_NEW_TOKENS 53
|
||||
|
||||
|
||||
/**
|
||||
|
@ -137,6 +137,7 @@ struct aa_transform_context {
|
|||
uint tempsUsed; /**< bitmask */
|
||||
int colorOutput; /**< which output is the primary color */
|
||||
uint samplersUsed; /**< bitfield of samplers used */
|
||||
bool hasSview;
|
||||
int freeSampler; /** an available sampler for the pstipple */
|
||||
int maxInput, maxGeneric; /**< max input index found */
|
||||
int colorTemp, texTemp; /**< temp registers */
|
||||
|
@ -165,6 +166,9 @@ aa_transform_decl(struct tgsi_transform_context *ctx,
|
|||
aactx->samplersUsed |= 1 << i;
|
||||
}
|
||||
}
|
||||
else if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) {
|
||||
aactx->hasSview = true;
|
||||
}
|
||||
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
|
||||
if ((int) decl->Range.Last > aactx->maxInput)
|
||||
aactx->maxInput = decl->Range.Last;
|
||||
|
@ -232,6 +236,17 @@ aa_transform_prolog(struct tgsi_transform_context *ctx)
|
|||
/* declare new sampler */
|
||||
tgsi_transform_sampler_decl(ctx, aactx->freeSampler);
|
||||
|
||||
/* if the src shader has SVIEW decl's for each SAMP decl, we
|
||||
* need to continue the trend and ensure there is a matching
|
||||
* SVIEW for the new SAMP we just created
|
||||
*/
|
||||
if (aactx->hasSview) {
|
||||
tgsi_transform_sampler_view_decl(ctx,
|
||||
aactx->freeSampler,
|
||||
TGSI_TEXTURE_2D,
|
||||
TGSI_RETURN_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/* declare new temp regs */
|
||||
tgsi_transform_temp_decl(ctx, aactx->texTemp);
|
||||
tgsi_transform_temp_decl(ctx, aactx->colorTemp);
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
|
||||
|
||||
/** Approx number of new tokens for instructions in pstip_transform_inst() */
|
||||
#define NUM_NEW_TOKENS 50
|
||||
#define NUM_NEW_TOKENS 53
|
||||
|
||||
|
||||
/**
|
||||
|
@ -126,6 +126,7 @@ struct pstip_transform_context {
|
|||
int wincoordInput;
|
||||
int maxInput;
|
||||
uint samplersUsed; /**< bitfield of samplers used */
|
||||
bool hasSview;
|
||||
int freeSampler; /** an available sampler for the pstipple */
|
||||
int texTemp; /**< temp registers */
|
||||
int numImmed;
|
||||
|
@ -149,6 +150,9 @@ pstip_transform_decl(struct tgsi_transform_context *ctx,
|
|||
pctx->samplersUsed |= 1 << i;
|
||||
}
|
||||
}
|
||||
else if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) {
|
||||
pctx->hasSview = true;
|
||||
}
|
||||
else if (decl->Declaration.File == TGSI_FILE_INPUT) {
|
||||
pctx->maxInput = MAX2(pctx->maxInput, (int) decl->Range.Last);
|
||||
if (decl->Semantic.Name == TGSI_SEMANTIC_POSITION)
|
||||
|
@ -232,6 +236,17 @@ pstip_transform_prolog(struct tgsi_transform_context *ctx)
|
|||
/* declare new sampler */
|
||||
tgsi_transform_sampler_decl(ctx, pctx->freeSampler);
|
||||
|
||||
/* if the src shader has SVIEW decl's for each SAMP decl, we
|
||||
* need to continue the trend and ensure there is a matching
|
||||
* SVIEW for the new SAMP we just created
|
||||
*/
|
||||
if (pctx->hasSview) {
|
||||
tgsi_transform_sampler_view_decl(ctx,
|
||||
pctx->freeSampler,
|
||||
TGSI_TEXTURE_2D,
|
||||
TGSI_RETURN_TYPE_FLOAT);
|
||||
}
|
||||
|
||||
/* declare new temp regs */
|
||||
tgsi_transform_temp_decl(ctx, pctx->texTemp);
|
||||
|
||||
|
|
|
@ -28,40 +28,12 @@
|
|||
#include <stddef.h>
|
||||
|
||||
#include <llvm-c/Core.h>
|
||||
#include <llvm/Target/TargetMachine.h>
|
||||
#include <llvm/Target/TargetInstrInfo.h>
|
||||
#include <llvm-c/Disassembler.h>
|
||||
#include <llvm/Support/raw_ostream.h>
|
||||
#include <llvm/Support/Format.h>
|
||||
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
#include <llvm/Target/TargetSubtargetInfo.h>
|
||||
#else
|
||||
#include <llvm/Support/MemoryObject.h>
|
||||
#endif
|
||||
|
||||
#include <llvm/Support/TargetRegistry.h>
|
||||
#include <llvm/MC/MCSubtargetInfo.h>
|
||||
|
||||
#include <llvm/Support/Host.h>
|
||||
|
||||
#include <llvm/IR/Module.h>
|
||||
|
||||
#include <llvm/MC/MCDisassembler.h>
|
||||
#include <llvm/MC/MCAsmInfo.h>
|
||||
#include <llvm/MC/MCInst.h>
|
||||
#include <llvm/MC/MCInstPrinter.h>
|
||||
#include <llvm/MC/MCRegisterInfo.h>
|
||||
|
||||
#if HAVE_LLVM >= 0x0305
|
||||
#define OwningPtr std::unique_ptr
|
||||
#else
|
||||
#include <llvm/ADT/OwningPtr.h>
|
||||
#endif
|
||||
|
||||
#if HAVE_LLVM >= 0x0305
|
||||
#include <llvm/MC/MCContext.h>
|
||||
#endif
|
||||
|
||||
#include "util/u_math.h"
|
||||
#include "util/u_debug.h"
|
||||
|
||||
|
@ -133,7 +105,7 @@ lp_get_module_id(LLVMModuleRef module)
|
|||
extern "C" void
|
||||
lp_debug_dump_value(LLVMValueRef value)
|
||||
{
|
||||
#if (defined(PIPE_OS_WINDOWS) && !defined(PIPE_CC_MSVC)) || defined(PIPE_OS_EMBDDED)
|
||||
#if (defined(PIPE_OS_WINDOWS) && !defined(PIPE_CC_MSVC)) || defined(PIPE_OS_EMBEDDED)
|
||||
raw_debug_ostream os;
|
||||
llvm::unwrap(value)->print(os);
|
||||
os.flush();
|
||||
|
@ -143,46 +115,6 @@ lp_debug_dump_value(LLVMValueRef value)
|
|||
}
|
||||
|
||||
|
||||
#if HAVE_LLVM < 0x0306
|
||||
|
||||
/*
|
||||
* MemoryObject wrapper around a buffer of memory, to be used by MC
|
||||
* disassembler.
|
||||
*/
|
||||
class BufferMemoryObject:
|
||||
public llvm::MemoryObject
|
||||
{
|
||||
private:
|
||||
const uint8_t *Bytes;
|
||||
uint64_t Length;
|
||||
public:
|
||||
BufferMemoryObject(const uint8_t *bytes, uint64_t length) :
|
||||
Bytes(bytes), Length(length)
|
||||
{
|
||||
}
|
||||
|
||||
uint64_t getBase() const
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
uint64_t getExtent() const
|
||||
{
|
||||
return Length;
|
||||
}
|
||||
|
||||
int readByte(uint64_t addr, uint8_t *byte) const
|
||||
{
|
||||
if (addr > getExtent())
|
||||
return -1;
|
||||
*byte = Bytes[addr];
|
||||
return 0;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* HAVE_LLVM < 0x0306 */
|
||||
|
||||
|
||||
/*
|
||||
* Disassemble a function, using the LLVM MC disassembler.
|
||||
*
|
||||
|
@ -193,8 +125,6 @@ public:
|
|||
static size_t
|
||||
disassemble(const void* func, llvm::raw_ostream & Out)
|
||||
{
|
||||
using namespace llvm;
|
||||
|
||||
const uint8_t *bytes = (const uint8_t *)func;
|
||||
|
||||
/*
|
||||
|
@ -202,99 +132,23 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
|||
*/
|
||||
const uint64_t extent = 96 * 1024;
|
||||
|
||||
uint64_t max_pc = 0;
|
||||
|
||||
/*
|
||||
* Initialize all used objects.
|
||||
*/
|
||||
|
||||
std::string Triple = sys::getDefaultTargetTriple();
|
||||
std::string Triple = llvm::sys::getProcessTriple();
|
||||
LLVMDisasmContextRef D = LLVMCreateDisasm(Triple.c_str(), NULL, 0, NULL, NULL);
|
||||
char outline[1024];
|
||||
|
||||
std::string Error;
|
||||
const Target *T = TargetRegistry::lookupTarget(Triple, Error);
|
||||
|
||||
#if HAVE_LLVM >= 0x0304
|
||||
OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(*T->createMCRegInfo(Triple), Triple));
|
||||
#else
|
||||
OwningPtr<const MCAsmInfo> AsmInfo(T->createMCAsmInfo(Triple));
|
||||
#endif
|
||||
|
||||
if (!AsmInfo) {
|
||||
Out << "error: no assembly info for target " << Triple << "\n";
|
||||
Out.flush();
|
||||
if (!D) {
|
||||
Out << "error: couldn't create disassembler for triple " << Triple << "\n";
|
||||
return 0;
|
||||
}
|
||||
|
||||
unsigned int AsmPrinterVariant = AsmInfo->getAssemblerDialect();
|
||||
|
||||
OwningPtr<const MCRegisterInfo> MRI(T->createMCRegInfo(Triple));
|
||||
if (!MRI) {
|
||||
Out << "error: no register info for target " << Triple.c_str() << "\n";
|
||||
Out.flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
OwningPtr<const MCInstrInfo> MII(T->createMCInstrInfo());
|
||||
if (!MII) {
|
||||
Out << "error: no instruction info for target " << Triple.c_str() << "\n";
|
||||
Out.flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if HAVE_LLVM >= 0x0305
|
||||
OwningPtr<const MCSubtargetInfo> STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""));
|
||||
OwningPtr<MCContext> MCCtx(new MCContext(AsmInfo.get(), MRI.get(), 0));
|
||||
OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI, *MCCtx));
|
||||
#else
|
||||
OwningPtr<const MCSubtargetInfo> STI(T->createMCSubtargetInfo(Triple, sys::getHostCPUName(), ""));
|
||||
OwningPtr<const MCDisassembler> DisAsm(T->createMCDisassembler(*STI));
|
||||
#endif
|
||||
if (!DisAsm) {
|
||||
Out << "error: no disassembler for target " << Triple << "\n";
|
||||
Out.flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(llvm::Triple(Triple), AsmPrinterVariant, *AsmInfo, *MII, *MRI));
|
||||
#else
|
||||
OwningPtr<MCInstPrinter> Printer(
|
||||
T->createMCInstPrinter(AsmPrinterVariant, *AsmInfo, *MII, *MRI, *STI));
|
||||
#endif
|
||||
if (!Printer) {
|
||||
Out << "error: no instruction printer for target " << Triple.c_str() << "\n";
|
||||
Out.flush();
|
||||
return 0;
|
||||
}
|
||||
|
||||
TargetOptions options;
|
||||
#if defined(DEBUG) && HAVE_LLVM < 0x0307
|
||||
options.JITEmitDebugInfo = true;
|
||||
#endif
|
||||
#if defined(PIPE_ARCH_X86)
|
||||
options.StackAlignmentOverride = 4;
|
||||
#endif
|
||||
#if defined(DEBUG) || defined(PROFILE)
|
||||
options.NoFramePointerElim = true;
|
||||
#endif
|
||||
OwningPtr<TargetMachine> TM(T->createTargetMachine(Triple, sys::getHostCPUName(), "", options));
|
||||
|
||||
/*
|
||||
* Wrap the data in a MemoryObject
|
||||
*/
|
||||
#if HAVE_LLVM >= 0x0306
|
||||
ArrayRef<uint8_t> memoryObject((const uint8_t *)bytes, extent);
|
||||
#else
|
||||
BufferMemoryObject memoryObject((const uint8_t *)bytes, extent);
|
||||
#endif
|
||||
|
||||
uint64_t pc;
|
||||
pc = 0;
|
||||
while (true) {
|
||||
MCInst Inst;
|
||||
uint64_t Size;
|
||||
while (pc < extent) {
|
||||
size_t Size;
|
||||
|
||||
/*
|
||||
* Print address. We use addresses relative to the start of the function,
|
||||
|
@ -303,11 +157,13 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
|||
|
||||
Out << llvm::format("%6lu:\t", (unsigned long)pc);
|
||||
|
||||
if (!DisAsm->getInstruction(Inst, Size, memoryObject,
|
||||
pc,
|
||||
nulls(), nulls())) {
|
||||
Out << "invalid";
|
||||
Size = LLVMDisasmInstruction(D, (uint8_t *)bytes + pc, extent - pc, 0, outline,
|
||||
sizeof outline);
|
||||
|
||||
if (!Size) {
|
||||
Out << "invalid\n";
|
||||
pc += 1;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -317,7 +173,7 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
|||
if (0) {
|
||||
unsigned i;
|
||||
for (i = 0; i < Size; ++i) {
|
||||
Out << llvm::format("%02x ", ((const uint8_t*)bytes)[pc + i]);
|
||||
Out << llvm::format("%02x ", bytes[pc + i]);
|
||||
}
|
||||
for (; i < 16; ++i) {
|
||||
Out << " ";
|
||||
|
@ -327,82 +183,28 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
|||
/*
|
||||
* Print the instruction.
|
||||
*/
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
Printer->printInst(&Inst, Out, "", *STI);
|
||||
#else
|
||||
Printer->printInst(&Inst, Out, "");
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Advance.
|
||||
*/
|
||||
|
||||
pc += Size;
|
||||
|
||||
const MCInstrDesc &TID = MII->get(Inst.getOpcode());
|
||||
|
||||
/*
|
||||
* Keep track of forward jumps to a nearby address.
|
||||
*/
|
||||
|
||||
if (TID.isBranch()) {
|
||||
for (unsigned i = 0; i < Inst.getNumOperands(); ++i) {
|
||||
const MCOperand &operand = Inst.getOperand(i);
|
||||
if (operand.isImm()) {
|
||||
uint64_t jump;
|
||||
|
||||
/*
|
||||
* FIXME: Handle both relative and absolute addresses correctly.
|
||||
* EDInstInfo actually has this info, but operandTypes and
|
||||
* operandFlags enums are not exposed in the public interface.
|
||||
*/
|
||||
|
||||
if (1) {
|
||||
/*
|
||||
* PC relative addr.
|
||||
*/
|
||||
|
||||
jump = pc + operand.getImm();
|
||||
} else {
|
||||
/*
|
||||
* Absolute addr.
|
||||
*/
|
||||
|
||||
jump = (uint64_t)operand.getImm();
|
||||
}
|
||||
|
||||
/*
|
||||
* Output the address relative to the function start, given
|
||||
* that MC will print the addresses relative the current pc.
|
||||
*/
|
||||
Out << "\t\t; " << jump;
|
||||
|
||||
/*
|
||||
* Ignore far jumps given it could be actually a tail return to
|
||||
* a random address.
|
||||
*/
|
||||
|
||||
if (jump > max_pc &&
|
||||
jump < extent) {
|
||||
max_pc = jump;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Out << outline;
|
||||
|
||||
Out << "\n";
|
||||
|
||||
/*
|
||||
* Stop disassembling on return statements, if there is no record of a
|
||||
* jump to a successive address.
|
||||
*
|
||||
* XXX: This currently assumes x86
|
||||
*/
|
||||
|
||||
if (TID.isReturn()) {
|
||||
if (pc > max_pc) {
|
||||
break;
|
||||
}
|
||||
if (Size == 1 && bytes[pc] == 0xc3) {
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Advance.
|
||||
*/
|
||||
|
||||
pc += Size;
|
||||
|
||||
if (pc >= extent) {
|
||||
Out << "disassembly larger than " << extent << "bytes, aborting\n";
|
||||
break;
|
||||
|
@ -412,6 +214,8 @@ disassemble(const void* func, llvm::raw_ostream & Out)
|
|||
Out << "\n";
|
||||
Out.flush();
|
||||
|
||||
LLVMDisasmDispose(D);
|
||||
|
||||
/*
|
||||
* Print GDB command, useful to verify output.
|
||||
*/
|
||||
|
@ -442,7 +246,7 @@ lp_disassemble(LLVMValueRef func, const void *code) {
|
|||
extern "C" void
|
||||
lp_profile(LLVMValueRef func, const void *code)
|
||||
{
|
||||
#if defined(__linux__) && (defined(DEBUG) || defined(PROFILE))
|
||||
#if defined(__linux__) && defined(PROFILE)
|
||||
static boolean first_time = TRUE;
|
||||
static FILE *perf_map_file = NULL;
|
||||
static int perf_asm_fd = -1;
|
||||
|
|
|
@ -405,6 +405,7 @@ lp_build_fetch_rgba_aos(struct gallivm_state *gallivm,
|
|||
aligned, base_ptr, offset, TRUE);
|
||||
|
||||
assert(format_desc->block.bits <= vec_len);
|
||||
(void) vec_len; /* silence unused var warning for non-debug build */
|
||||
|
||||
packed = LLVMBuildBitCast(gallivm->builder, packed, dst_vec_type, "");
|
||||
return lp_build_format_swizzle_aos(format_desc, &bld, packed);
|
||||
|
|
|
@ -533,6 +533,16 @@ gallivm_compile_module(struct gallivm_state *gallivm)
|
|||
if (0) {
|
||||
debug_printf("optimizing func %s...\n", LLVMGetValueName(func));
|
||||
}
|
||||
|
||||
/* Disable frame pointer omission on debug/profile builds */
|
||||
/* XXX: And workaround http://llvm.org/PR21435 */
|
||||
#if HAVE_LLVM >= 0x0307 && \
|
||||
(defined(DEBUG) || defined(PROFILE) || \
|
||||
defined(PIPE_ARCH_X86) || defined(PIPE_ARCH_X86_64))
|
||||
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim", "true");
|
||||
LLVMAddTargetDependentFunctionAttr(func, "no-frame-pointer-elim-non-leaf", "true");
|
||||
#endif
|
||||
|
||||
LLVMRunFunctionPassManager(gallivm->passmgr, func);
|
||||
func = LLVMGetNextFunction(func);
|
||||
}
|
||||
|
|
|
@ -51,8 +51,12 @@
|
|||
|
||||
#define LP_MAX_TGSI_PREDS 16
|
||||
|
||||
#define LP_MAX_TGSI_CONSTS 4096
|
||||
|
||||
#define LP_MAX_TGSI_CONST_BUFFERS 16
|
||||
|
||||
#define LP_MAX_TGSI_CONST_BUFFER_SIZE (LP_MAX_TGSI_CONSTS * sizeof(float[4]))
|
||||
|
||||
/*
|
||||
* For quick access we cache registers in statically
|
||||
* allocated arrays. Here we define the maximum size
|
||||
|
@ -100,7 +104,7 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
|
|||
case PIPE_SHADER_CAP_MAX_OUTPUTS:
|
||||
return 32;
|
||||
case PIPE_SHADER_CAP_MAX_CONST_BUFFER_SIZE:
|
||||
return sizeof(float[4]) * 4096;
|
||||
return LP_MAX_TGSI_CONST_BUFFER_SIZE;
|
||||
case PIPE_SHADER_CAP_MAX_CONST_BUFFERS:
|
||||
return PIPE_MAX_CONSTANT_BUFFERS;
|
||||
case PIPE_SHADER_CAP_MAX_TEMPS:
|
||||
|
@ -125,6 +129,7 @@ gallivm_get_shader_param(enum pipe_shader_cap param)
|
|||
case PIPE_SHADER_CAP_PREFERRED_IR:
|
||||
return PIPE_SHADER_IR_TGSI;
|
||||
case PIPE_SHADER_CAP_TGSI_SQRT_SUPPORTED:
|
||||
case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE:
|
||||
return 1;
|
||||
case PIPE_SHADER_CAP_DOUBLES:
|
||||
case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
|
||||
|
|
|
@ -50,6 +50,12 @@
|
|||
|
||||
#include <stddef.h>
|
||||
|
||||
// Workaround http://llvm.org/PR23628
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
# pragma push_macro("DEBUG")
|
||||
# undef DEBUG
|
||||
#endif
|
||||
|
||||
#include <llvm-c/Core.h>
|
||||
#include <llvm-c/ExecutionEngine.h>
|
||||
#include <llvm/Target/TargetOptions.h>
|
||||
|
@ -70,6 +76,11 @@
|
|||
#include <llvm/IR/Module.h>
|
||||
#include <llvm/Support/CBindingWrapping.h>
|
||||
|
||||
// Workaround http://llvm.org/PR23628
|
||||
#if HAVE_LLVM >= 0x0307
|
||||
# pragma pop_macro("DEBUG")
|
||||
#endif
|
||||
|
||||
#include "pipe/p_config.h"
|
||||
#include "util/u_debug.h"
|
||||
#include "util/u_cpu_detect.h"
|
||||
|
@ -439,7 +450,9 @@ lp_build_create_jit_compiler_for_module(LLVMExecutionEngineRef *OutJIT,
|
|||
#if HAVE_LLVM < 0x0304
|
||||
options.NoFramePointerElimNonLeaf = true;
|
||||
#endif
|
||||
#if HAVE_LLVM < 0x0307
|
||||
options.NoFramePointerElim = true;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
builder.setEngineKind(EngineKind::JIT)
|
||||
|
|
|
@ -113,7 +113,7 @@ lp_sampler_static_texture_state(struct lp_static_texture_state *state,
|
|||
state->swizzle_b = view->swizzle_b;
|
||||
state->swizzle_a = view->swizzle_a;
|
||||
|
||||
state->target = texture->target;
|
||||
state->target = view->target;
|
||||
state->pot_width = util_is_power_of_two(texture->width0);
|
||||
state->pot_height = util_is_power_of_two(texture->height0);
|
||||
state->pot_depth = util_is_power_of_two(texture->depth0);
|
||||
|
|
|
@ -2501,7 +2501,7 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
|||
* all zero as mandated by d3d10 in this case.
|
||||
*/
|
||||
unsigned chan;
|
||||
LLVMValueRef zero = lp_build_const_vec(gallivm, type, 0.0F);
|
||||
LLVMValueRef zero = lp_build_zero(gallivm, type);
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
texel_out[chan] = zero;
|
||||
}
|
||||
|
@ -2748,11 +2748,37 @@ lp_build_sample_soa_code(struct gallivm_state *gallivm,
|
|||
else {
|
||||
LLVMValueRef lod_fpart = NULL, lod_positive = NULL;
|
||||
LLVMValueRef ilevel0 = NULL, ilevel1 = NULL;
|
||||
boolean use_aos = util_format_fits_8unorm(bld.format_desc) &&
|
||||
op_is_tex &&
|
||||
/* not sure this is strictly needed or simply impossible */
|
||||
derived_sampler_state.compare_mode == PIPE_TEX_COMPARE_NONE &&
|
||||
lp_is_simple_wrap_mode(derived_sampler_state.wrap_s);
|
||||
boolean use_aos;
|
||||
|
||||
if (util_format_is_pure_integer(static_texture_state->format) &&
|
||||
!util_format_has_depth(bld.format_desc) &&
|
||||
(static_sampler_state->min_mip_filter == PIPE_TEX_MIPFILTER_LINEAR ||
|
||||
static_sampler_state->min_img_filter == PIPE_TEX_FILTER_LINEAR ||
|
||||
static_sampler_state->mag_img_filter == PIPE_TEX_FILTER_LINEAR)) {
|
||||
/*
|
||||
* Bail if impossible filtering is specified (the awkard additional
|
||||
* depth check is because it is legal in gallium to have things like S8Z24
|
||||
* here which would say it's pure int despite such formats should sample
|
||||
* the depth component).
|
||||
* In GL such filters make the texture incomplete, this makes it robust
|
||||
* against state trackers which set this up regardless (we'd crash in the
|
||||
* lerp later (except for gather)).
|
||||
* Must do this after fetch_texel code since with GL state tracker we'll
|
||||
* get some junk sampler for buffer textures.
|
||||
*/
|
||||
unsigned chan;
|
||||
LLVMValueRef zero = lp_build_zero(gallivm, type);
|
||||
for (chan = 0; chan < 4; chan++) {
|
||||
texel_out[chan] = zero;
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
use_aos = util_format_fits_8unorm(bld.format_desc) &&
|
||||
op_is_tex &&
|
||||
/* not sure this is strictly needed or simply impossible */
|
||||
derived_sampler_state.compare_mode == PIPE_TEX_COMPARE_NONE &&
|
||||
lp_is_simple_wrap_mode(derived_sampler_state.wrap_s);
|
||||
|
||||
use_aos &= bld.num_lods <= num_quads ||
|
||||
derived_sampler_state.min_img_filter ==
|
||||
|
|
|
@ -165,6 +165,7 @@ struct lp_bld_tgsi_system_values {
|
|||
LLVMValueRef vertex_id_nobase;
|
||||
LLVMValueRef prim_id;
|
||||
LLVMValueRef basevertex;
|
||||
LLVMValueRef invocation_id;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -232,23 +232,9 @@ lp_emit_store_aos(
|
|||
/*
|
||||
* Saturate the value
|
||||
*/
|
||||
|
||||
switch (inst->Instruction.Saturate) {
|
||||
case TGSI_SAT_NONE:
|
||||
break;
|
||||
|
||||
case TGSI_SAT_ZERO_ONE:
|
||||
if (inst->Instruction.Saturate) {
|
||||
value = lp_build_max(&bld->bld_base.base, value, bld->bld_base.base.zero);
|
||||
value = lp_build_min(&bld->bld_base.base, value, bld->bld_base.base.one);
|
||||
break;
|
||||
|
||||
case TGSI_SAT_MINUS_PLUS_ONE:
|
||||
value = lp_build_max(&bld->bld_base.base, value, lp_build_const_vec(bld->bld_base.base.gallivm, bld->bld_base.base.type, -1.0));
|
||||
value = lp_build_min(&bld->bld_base.base, value, bld->bld_base.base.one);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -1532,6 +1532,11 @@ emit_fetch_system_value(
|
|||
atype = TGSI_TYPE_UNSIGNED;
|
||||
break;
|
||||
|
||||
case TGSI_SEMANTIC_INVOCATIONID:
|
||||
res = lp_build_broadcast_scalar(&bld_base->uint_bld, bld->system_values.invocation_id);
|
||||
atype = TGSI_TYPE_UNSIGNED;
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(!"unexpected semantic in emit_fetch_system_value");
|
||||
res = bld_base->base.zero;
|
||||
|
@ -1670,30 +1675,11 @@ emit_store_chan(
|
|||
*
|
||||
* It is always assumed to be float.
|
||||
*/
|
||||
switch( inst->Instruction.Saturate ) {
|
||||
case TGSI_SAT_NONE:
|
||||
break;
|
||||
|
||||
case TGSI_SAT_ZERO_ONE:
|
||||
if (inst->Instruction.Saturate) {
|
||||
assert(dtype == TGSI_TYPE_FLOAT ||
|
||||
dtype == TGSI_TYPE_UNTYPED);
|
||||
value = LLVMBuildBitCast(builder, value, float_bld->vec_type, "");
|
||||
value = lp_build_clamp_zero_one_nanzero(float_bld, value);
|
||||
break;
|
||||
|
||||
case TGSI_SAT_MINUS_PLUS_ONE:
|
||||
assert(dtype == TGSI_TYPE_FLOAT ||
|
||||
dtype == TGSI_TYPE_UNTYPED);
|
||||
value = LLVMBuildBitCast(builder, value, float_bld->vec_type, "");
|
||||
/* This will give -1.0 for NaN which is probably not what we want. */
|
||||
value = lp_build_max_ext(float_bld, value,
|
||||
lp_build_const_vec(gallivm, float_bld->type, -1.0),
|
||||
GALLIVM_NAN_RETURN_OTHER_SECOND_NONNAN);
|
||||
value = lp_build_min(float_bld, value, float_bld->one);
|
||||
break;
|
||||
|
||||
default:
|
||||
assert(0);
|
||||
}
|
||||
|
||||
if (reg->Register.Indirect) {
|
||||
|
|
|
@ -423,6 +423,8 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
|
|||
cso_save_viewport(cso);
|
||||
cso_save_stream_outputs(cso);
|
||||
cso_save_geometry_shader(cso);
|
||||
cso_save_tessctrl_shader(cso);
|
||||
cso_save_tesseval_shader(cso);
|
||||
cso_save_vertex_shader(cso);
|
||||
cso_save_vertex_elements(cso);
|
||||
cso_save_aux_vertex_buffer_slot(cso);
|
||||
|
@ -456,6 +458,8 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
|
|||
cso_set_rasterizer(cso, &hud->rasterizer);
|
||||
cso_set_viewport(cso, &viewport);
|
||||
cso_set_stream_outputs(cso, 0, NULL, NULL);
|
||||
cso_set_tessctrl_shader_handle(cso, NULL);
|
||||
cso_set_tesseval_shader_handle(cso, NULL);
|
||||
cso_set_geometry_shader_handle(cso, NULL);
|
||||
cso_set_vertex_shader_handle(cso, hud->vs);
|
||||
cso_set_vertex_elements(cso, 2, hud->velems);
|
||||
|
@ -548,6 +552,8 @@ hud_draw(struct hud_context *hud, struct pipe_resource *tex)
|
|||
cso_restore_rasterizer(cso);
|
||||
cso_restore_viewport(cso);
|
||||
cso_restore_stream_outputs(cso);
|
||||
cso_restore_tessctrl_shader(cso);
|
||||
cso_restore_tesseval_shader(cso);
|
||||
cso_restore_geometry_shader(cso);
|
||||
cso_restore_vertex_shader(cso);
|
||||
cso_restore_vertex_elements(cso);
|
||||
|
|
|
@ -58,6 +58,9 @@ struct ttn_compile {
|
|||
struct ttn_reg_info *temp_regs;
|
||||
nir_ssa_def **imm_defs;
|
||||
|
||||
unsigned num_samp_types;
|
||||
nir_alu_type *samp_types;
|
||||
|
||||
nir_register *addr_reg;
|
||||
|
||||
/**
|
||||
|
@ -156,6 +159,30 @@ ttn_emit_declaration(struct ttn_compile *c)
|
|||
/* Nothing to record for system values. */
|
||||
} else if (file == TGSI_FILE_SAMPLER) {
|
||||
/* Nothing to record for samplers. */
|
||||
} else if (file == TGSI_FILE_SAMPLER_VIEW) {
|
||||
struct tgsi_declaration_sampler_view *sview = &decl->SamplerView;
|
||||
nir_alu_type type;
|
||||
|
||||
assert((sview->ReturnTypeX == sview->ReturnTypeY) &&
|
||||
(sview->ReturnTypeX == sview->ReturnTypeZ) &&
|
||||
(sview->ReturnTypeX == sview->ReturnTypeW));
|
||||
|
||||
switch (sview->ReturnTypeX) {
|
||||
case TGSI_RETURN_TYPE_SINT:
|
||||
type = nir_type_int;
|
||||
break;
|
||||
case TGSI_RETURN_TYPE_UINT:
|
||||
type = nir_type_unsigned;
|
||||
break;
|
||||
case TGSI_RETURN_TYPE_FLOAT:
|
||||
default:
|
||||
type = nir_type_float;
|
||||
break;
|
||||
}
|
||||
|
||||
for (i = 0; i < array_size; i++) {
|
||||
c->samp_types[decl->Range.First + i] = type;
|
||||
}
|
||||
} else {
|
||||
nir_variable *var;
|
||||
assert(file == TGSI_FILE_INPUT ||
|
||||
|
@ -401,7 +428,6 @@ ttn_src_for_file_and_index(struct ttn_compile *c, unsigned file, unsigned index,
|
|||
|
||||
load->num_components = 4;
|
||||
load->const_index[0] = index;
|
||||
load->const_index[1] = 1;
|
||||
if (dim) {
|
||||
if (dimind) {
|
||||
load->src[srcn] =
|
||||
|
@ -1027,7 +1053,7 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
|
|||
struct tgsi_full_instruction *tgsi_inst = &c->token->FullInstruction;
|
||||
nir_tex_instr *instr;
|
||||
nir_texop op;
|
||||
unsigned num_srcs, samp = 1, i;
|
||||
unsigned num_srcs, samp = 1, sview, i;
|
||||
|
||||
switch (tgsi_inst->Instruction.Opcode) {
|
||||
case TGSI_OPCODE_TEX:
|
||||
|
@ -1106,6 +1132,18 @@ ttn_tex(struct ttn_compile *c, nir_alu_dest dest, nir_ssa_def **src)
|
|||
assert(tgsi_inst->Src[samp].Register.File == TGSI_FILE_SAMPLER);
|
||||
instr->sampler_index = tgsi_inst->Src[samp].Register.Index;
|
||||
|
||||
/* TODO if we supported any opc's which take an explicit SVIEW
|
||||
* src, we would use that here instead. But for the "legacy"
|
||||
* texture opc's the SVIEW index is same as SAMP index:
|
||||
*/
|
||||
sview = instr->sampler_index;
|
||||
|
||||
if (sview < c->num_samp_types) {
|
||||
instr->dest_type = c->samp_types[sview];
|
||||
} else {
|
||||
instr->dest_type = nir_type_float;
|
||||
}
|
||||
|
||||
unsigned src_number = 0;
|
||||
|
||||
instr->src[src_number].src =
|
||||
|
@ -1286,6 +1324,7 @@ static const nir_op op_trans[TGSI_OPCODE_LAST] = {
|
|||
[TGSI_OPCODE_SEQ] = nir_op_seq,
|
||||
[TGSI_OPCODE_SGT] = 0,
|
||||
[TGSI_OPCODE_SIN] = nir_op_fsin,
|
||||
[TGSI_OPCODE_SNE] = nir_op_sne,
|
||||
[TGSI_OPCODE_SLE] = 0,
|
||||
[TGSI_OPCODE_TEX] = 0,
|
||||
[TGSI_OPCODE_TXD] = 0,
|
||||
|
@ -1625,7 +1664,6 @@ ttn_emit_instruction(struct ttn_compile *c)
|
|||
}
|
||||
|
||||
if (tgsi_inst->Instruction.Saturate) {
|
||||
assert(tgsi_inst->Instruction.Saturate == TGSI_SAT_ZERO_ONE);
|
||||
assert(!dest.dest.is_ssa);
|
||||
ttn_move_dest(b, dest, nir_fsat(b, ttn_src_for_dest(b, &dest)));
|
||||
}
|
||||
|
@ -1672,7 +1710,6 @@ ttn_add_output_stores(struct ttn_compile *c)
|
|||
nir_intrinsic_instr_create(b->shader, nir_intrinsic_store_output);
|
||||
store->num_components = 4;
|
||||
store->const_index[0] = var->data.driver_location + i;
|
||||
store->const_index[1] = 1;
|
||||
store->src[0].reg.reg = c->output_regs[var->data.driver_location].reg;
|
||||
nir_instr_insert_after_cf_list(b->cf_node_list, &store->instr);
|
||||
}
|
||||
|
@ -1713,6 +1750,9 @@ tgsi_to_nir(const void *tgsi_tokens,
|
|||
c->imm_defs = rzalloc_array(c, nir_ssa_def *,
|
||||
scan.file_max[TGSI_FILE_IMMEDIATE] + 1);
|
||||
|
||||
c->num_samp_types = scan.file_max[TGSI_FILE_SAMPLER_VIEW] + 1;
|
||||
c->samp_types = rzalloc_array(c, nir_alu_type, c->num_samp_types);
|
||||
|
||||
c->if_stack = rzalloc_array(c, struct exec_list *,
|
||||
(scan.opcode_count[TGSI_OPCODE_IF] +
|
||||
scan.opcode_count[TGSI_OPCODE_UIF]) * 2);
|
||||
|
|
|
@ -376,6 +376,7 @@ fenced_buffer_finish_locked(struct fenced_manager *fenced_mgr,
|
|||
/* TODO: remove consequents buffers with the same fence? */
|
||||
|
||||
assert(!destroyed);
|
||||
(void) destroyed; /* silence unused var warning for non-debug build */
|
||||
|
||||
fenced_buf->flags &= ~PB_USAGE_GPU_READ_WRITE;
|
||||
|
||||
|
|
|
@ -30,6 +30,10 @@
|
|||
|
||||
#include "pipe/p_state.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct cso_context;
|
||||
|
||||
struct pp_queue_t; /* Forward definition */
|
||||
|
@ -85,4 +89,9 @@ void pp_celshade_free(struct pp_queue_t *, unsigned int);
|
|||
void pp_nocolor_free(struct pp_queue_t *, unsigned int);
|
||||
void pp_jimenezmlaa_free(struct pp_queue_t *, unsigned int);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
|
|
@ -119,6 +119,8 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
|||
cso_save_depth_stencil_alpha(cso);
|
||||
cso_save_fragment_shader(cso);
|
||||
cso_save_framebuffer(cso);
|
||||
cso_save_tessctrl_shader(cso);
|
||||
cso_save_tesseval_shader(cso);
|
||||
cso_save_geometry_shader(cso);
|
||||
cso_save_rasterizer(cso);
|
||||
cso_save_sample_mask(cso);
|
||||
|
@ -139,6 +141,8 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
|||
cso_set_sample_mask(cso, ~0);
|
||||
cso_set_min_samples(cso, 1);
|
||||
cso_set_stream_outputs(cso, 0, NULL, NULL);
|
||||
cso_set_tessctrl_shader_handle(cso, NULL);
|
||||
cso_set_tesseval_shader_handle(cso, NULL);
|
||||
cso_set_geometry_shader_handle(cso, NULL);
|
||||
cso_set_render_condition(cso, NULL, FALSE, 0);
|
||||
|
||||
|
@ -186,6 +190,8 @@ pp_run(struct pp_queue_t *ppq, struct pipe_resource *in,
|
|||
cso_restore_depth_stencil_alpha(cso);
|
||||
cso_restore_fragment_shader(cso);
|
||||
cso_restore_framebuffer(cso);
|
||||
cso_restore_tessctrl_shader(cso);
|
||||
cso_restore_tesseval_shader(cso);
|
||||
cso_restore_geometry_shader(cso);
|
||||
cso_restore_rasterizer(cso);
|
||||
cso_restore_sample_mask(cso);
|
||||
|
|
|
@ -49,7 +49,7 @@
|
|||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#if defined(PIPE_OS_LINUX) || defined(PIPE_OS_BSD) || defined(PIPE_OS_SOLARIS) || defined(PIPE_OS_HAIKU) || defined(PIPE_OS_CYGWIN)
|
||||
#if defined(PIPE_OS_UNIX)
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -610,7 +610,7 @@ tgsi_default_instruction( void )
|
|||
instruction.Type = TGSI_TOKEN_TYPE_INSTRUCTION;
|
||||
instruction.NrTokens = 0;
|
||||
instruction.Opcode = TGSI_OPCODE_MOV;
|
||||
instruction.Saturate = TGSI_SAT_NONE;
|
||||
instruction.Saturate = 0;
|
||||
instruction.Predicate = 0;
|
||||
instruction.NumDstRegs = 1;
|
||||
instruction.NumSrcRegs = 1;
|
||||
|
@ -632,7 +632,7 @@ tgsi_build_instruction(unsigned opcode,
|
|||
struct tgsi_instruction instruction;
|
||||
|
||||
assert (opcode <= TGSI_OPCODE_LAST);
|
||||
assert (saturate <= TGSI_SAT_MINUS_PLUS_ONE);
|
||||
assert (saturate <= 1);
|
||||
assert (num_dst_regs <= 3);
|
||||
assert (num_src_regs <= 15);
|
||||
|
||||
|
|
|
@ -271,14 +271,30 @@ iter_declaration(
|
|||
struct tgsi_full_declaration *decl )
|
||||
{
|
||||
struct dump_ctx *ctx = (struct dump_ctx *)iter;
|
||||
boolean patch = decl->Semantic.Name == TGSI_SEMANTIC_PATCH ||
|
||||
decl->Semantic.Name == TGSI_SEMANTIC_TESSINNER ||
|
||||
decl->Semantic.Name == TGSI_SEMANTIC_TESSOUTER ||
|
||||
decl->Semantic.Name == TGSI_SEMANTIC_PRIMID;
|
||||
|
||||
TXT( "DCL " );
|
||||
|
||||
TXT(tgsi_file_name(decl->Declaration.File));
|
||||
|
||||
/* all geometry shader inputs are two dimensional */
|
||||
/* all geometry shader inputs and non-patch tessellation shader inputs are
|
||||
* two dimensional
|
||||
*/
|
||||
if (decl->Declaration.File == TGSI_FILE_INPUT &&
|
||||
iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY) {
|
||||
(iter->processor.Processor == TGSI_PROCESSOR_GEOMETRY ||
|
||||
(!patch &&
|
||||
(iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL ||
|
||||
iter->processor.Processor == TGSI_PROCESSOR_TESS_EVAL)))) {
|
||||
TXT("[]");
|
||||
}
|
||||
|
||||
/* all non-patch tess ctrl shader outputs are two dimensional */
|
||||
if (decl->Declaration.File == TGSI_FILE_OUTPUT &&
|
||||
!patch &&
|
||||
iter->processor.Processor == TGSI_PROCESSOR_TESS_CTRL) {
|
||||
TXT("[]");
|
||||
}
|
||||
|
||||
|
@ -523,17 +539,8 @@ iter_instruction(
|
|||
|
||||
TXT( info->mnemonic );
|
||||
|
||||
switch (inst->Instruction.Saturate) {
|
||||
case TGSI_SAT_NONE:
|
||||
break;
|
||||
case TGSI_SAT_ZERO_ONE:
|
||||
if (inst->Instruction.Saturate) {
|
||||
TXT( "_SAT" );
|
||||
break;
|
||||
case TGSI_SAT_MINUS_PLUS_ONE:
|
||||
TXT( "_SATNV" );
|
||||
break;
|
||||
default:
|
||||
assert( 0 );
|
||||
}
|
||||
|
||||
for (i = 0; i < inst->Instruction.NumDstRegs; i++) {
|
||||
|
|
|
@ -1765,14 +1765,12 @@ store_dest(struct tgsi_exec_machine *mach,
|
|||
if (!dst)
|
||||
return;
|
||||
|
||||
switch (inst->Instruction.Saturate) {
|
||||
case TGSI_SAT_NONE:
|
||||
if (!inst->Instruction.Saturate) {
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i))
|
||||
dst->i[i] = chan->i[i];
|
||||
break;
|
||||
|
||||
case TGSI_SAT_ZERO_ONE:
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i)) {
|
||||
if (chan->f[i] < 0.0f)
|
||||
|
@ -1782,22 +1780,6 @@ store_dest(struct tgsi_exec_machine *mach,
|
|||
else
|
||||
dst->i[i] = chan->i[i];
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_SAT_MINUS_PLUS_ONE:
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i)) {
|
||||
if (chan->f[i] < -1.0f)
|
||||
dst->f[i] = -1.0f;
|
||||
else if (chan->f[i] > 1.0f)
|
||||
dst->f[i] = 1.0f;
|
||||
else
|
||||
dst->i[i] = chan->i[i];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert( 0 );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1952,7 +1934,7 @@ fetch_texel( struct tgsi_sampler *sampler,
|
|||
#define TEX_MODIFIER_LOD_BIAS 2
|
||||
#define TEX_MODIFIER_EXPLICIT_LOD 3
|
||||
#define TEX_MODIFIER_LEVEL_ZERO 4
|
||||
|
||||
#define TEX_MODIFIER_GATHER 5
|
||||
|
||||
/*
|
||||
* Fetch all 3 (for s,t,r coords) texel offsets, put them into int array.
|
||||
|
@ -2006,6 +1988,35 @@ fetch_assign_deriv_channel(struct tgsi_exec_machine *mach,
|
|||
derivs[1][3] = d.f[3];
|
||||
}
|
||||
|
||||
static uint
|
||||
fetch_sampler_unit(struct tgsi_exec_machine *mach,
|
||||
const struct tgsi_full_instruction *inst,
|
||||
uint sampler)
|
||||
{
|
||||
uint unit;
|
||||
|
||||
if (inst->Src[sampler].Register.Indirect) {
|
||||
const struct tgsi_full_src_register *reg = &inst->Src[sampler];
|
||||
union tgsi_exec_channel indir_index, index2;
|
||||
|
||||
index2.i[0] =
|
||||
index2.i[1] =
|
||||
index2.i[2] =
|
||||
index2.i[3] = reg->Indirect.Index;
|
||||
|
||||
fetch_src_file_channel(mach,
|
||||
0,
|
||||
reg->Indirect.File,
|
||||
reg->Indirect.Swizzle,
|
||||
&index2,
|
||||
&ZeroVec,
|
||||
&indir_index);
|
||||
unit = inst->Src[sampler].Register.Index + indir_index.i[0];
|
||||
} else {
|
||||
unit = inst->Src[sampler].Register.Index;
|
||||
}
|
||||
return unit;
|
||||
}
|
||||
|
||||
/*
|
||||
* execute a texture instruction.
|
||||
|
@ -2019,14 +2030,15 @@ exec_tex(struct tgsi_exec_machine *mach,
|
|||
const struct tgsi_full_instruction *inst,
|
||||
uint modifier, uint sampler)
|
||||
{
|
||||
const uint unit = inst->Src[sampler].Register.Index;
|
||||
const union tgsi_exec_channel *args[5], *proj = NULL;
|
||||
union tgsi_exec_channel r[5];
|
||||
enum tgsi_sampler_control control = tgsi_sampler_lod_none;
|
||||
uint chan;
|
||||
uint unit;
|
||||
int8_t offsets[3];
|
||||
int dim, shadow_ref, i;
|
||||
|
||||
unit = fetch_sampler_unit(mach, inst, sampler);
|
||||
/* always fetch all 3 offsets, overkill but keeps code simple */
|
||||
fetch_texel_offsets(mach, inst, offsets);
|
||||
|
||||
|
@ -2069,6 +2081,8 @@ exec_tex(struct tgsi_exec_machine *mach,
|
|||
control = tgsi_sampler_lod_explicit;
|
||||
else if (modifier == TEX_MODIFIER_LOD_BIAS)
|
||||
control = tgsi_sampler_lod_bias;
|
||||
else if (modifier == TEX_MODIFIER_GATHER)
|
||||
control = tgsi_sampler_gather;
|
||||
}
|
||||
else {
|
||||
for (i = dim; i < Elements(args); i++)
|
||||
|
@ -2123,12 +2137,13 @@ static void
|
|||
exec_txd(struct tgsi_exec_machine *mach,
|
||||
const struct tgsi_full_instruction *inst)
|
||||
{
|
||||
const uint unit = inst->Src[3].Register.Index;
|
||||
union tgsi_exec_channel r[4];
|
||||
float derivs[3][2][TGSI_QUAD_SIZE];
|
||||
uint chan;
|
||||
uint unit;
|
||||
int8_t offsets[3];
|
||||
|
||||
unit = fetch_sampler_unit(mach, inst, 3);
|
||||
/* always fetch all 3 offsets, overkill but keeps code simple */
|
||||
fetch_texel_offsets(mach, inst, offsets);
|
||||
|
||||
|
@ -2230,14 +2245,15 @@ static void
|
|||
exec_txf(struct tgsi_exec_machine *mach,
|
||||
const struct tgsi_full_instruction *inst)
|
||||
{
|
||||
const uint unit = inst->Src[1].Register.Index;
|
||||
union tgsi_exec_channel r[4];
|
||||
uint chan;
|
||||
uint unit;
|
||||
float rgba[TGSI_NUM_CHANNELS][TGSI_QUAD_SIZE];
|
||||
int j;
|
||||
int8_t offsets[3];
|
||||
unsigned target;
|
||||
|
||||
unit = fetch_sampler_unit(mach, inst, 1);
|
||||
/* always fetch all 3 offsets, overkill but keeps code simple */
|
||||
fetch_texel_offsets(mach, inst, offsets);
|
||||
|
||||
|
@ -2312,12 +2328,14 @@ static void
|
|||
exec_txq(struct tgsi_exec_machine *mach,
|
||||
const struct tgsi_full_instruction *inst)
|
||||
{
|
||||
const uint unit = inst->Src[1].Register.Index;
|
||||
int result[4];
|
||||
union tgsi_exec_channel r[4], src;
|
||||
uint chan;
|
||||
uint unit;
|
||||
int i,j;
|
||||
|
||||
unit = fetch_sampler_unit(mach, inst, 1);
|
||||
|
||||
fetch_source(mach, &src, &inst->Src[0], TGSI_CHAN_X, TGSI_EXEC_DATA_INT);
|
||||
|
||||
/* XXX: This interface can't return per-pixel values */
|
||||
|
@ -3315,16 +3333,14 @@ store_double_channel(struct tgsi_exec_machine *mach,
|
|||
union tgsi_double_channel temp;
|
||||
const uint execmask = mach->ExecMask;
|
||||
|
||||
switch (inst->Instruction.Saturate) {
|
||||
case TGSI_SAT_NONE:
|
||||
if (!inst->Instruction.Saturate) {
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i)) {
|
||||
dst[0].u[i] = chan->u[i][0];
|
||||
dst[1].u[i] = chan->u[i][1];
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_SAT_ZERO_ONE:
|
||||
}
|
||||
else {
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i)) {
|
||||
if (chan->d[i] < 0.0)
|
||||
|
@ -3337,25 +3353,6 @@ store_double_channel(struct tgsi_exec_machine *mach,
|
|||
dst[0].u[i] = temp.u[i][0];
|
||||
dst[1].u[i] = temp.u[i][1];
|
||||
}
|
||||
break;
|
||||
|
||||
case TGSI_SAT_MINUS_PLUS_ONE:
|
||||
for (i = 0; i < TGSI_QUAD_SIZE; i++)
|
||||
if (execmask & (1 << i)) {
|
||||
if (chan->d[i] < -1.0)
|
||||
temp.d[i] = -1.0;
|
||||
else if (chan->d[i] > 1.0)
|
||||
temp.d[i] = 1.0;
|
||||
else
|
||||
temp.d[i] = chan->d[i];
|
||||
|
||||
dst[0].u[i] = temp.u[i][0];
|
||||
dst[1].u[i] = temp.u[i][1];
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
assert( 0 );
|
||||
}
|
||||
|
||||
store_dest_double(mach, &dst[0], reg, inst, chan_0, TGSI_EXEC_DATA_UINT);
|
||||
|
@ -4374,6 +4371,13 @@ exec_instruction(
|
|||
exec_tex(mach, inst, TEX_MODIFIER_PROJECTED, 1);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_TG4:
|
||||
/* src[0] = texcoord */
|
||||
/* src[1] = component */
|
||||
/* src[2] = sampler unit */
|
||||
exec_tex(mach, inst, TEX_MODIFIER_GATHER, 2);
|
||||
break;
|
||||
|
||||
case TGSI_OPCODE_UP2H:
|
||||
assert (0);
|
||||
break;
|
||||
|
@ -4431,8 +4435,12 @@ exec_instruction(
|
|||
mach->BreakStack[mach->BreakStackTop++] = mach->BreakType;
|
||||
mach->FuncStack[mach->FuncStackTop++] = mach->FuncMask;
|
||||
|
||||
/* Finally, jump to the subroutine */
|
||||
/* Finally, jump to the subroutine. The label is a pointer
|
||||
* (an instruction number) to the BGNSUB instruction.
|
||||
*/
|
||||
*pc = inst->Label.Label;
|
||||
assert(mach->Instructions[*pc].Instruction.Opcode
|
||||
== TGSI_OPCODE_BGNSUB);
|
||||
}
|
||||
break;
|
||||
|
||||
|
|
|
@ -93,7 +93,8 @@ enum tgsi_sampler_control {
|
|||
tgsi_sampler_lod_bias,
|
||||
tgsi_sampler_lod_explicit,
|
||||
tgsi_sampler_lod_zero,
|
||||
tgsi_sampler_derivs_explicit
|
||||
tgsi_sampler_derivs_explicit,
|
||||
tgsi_sampler_gather,
|
||||
};
|
||||
|
||||
/**
|
||||
|
@ -457,6 +458,7 @@ tgsi_exec_get_shader_param(enum pipe_shader_cap param)
|
|||
return 1;
|
||||
case PIPE_SHADER_CAP_DOUBLES:
|
||||
case PIPE_SHADER_CAP_TGSI_DFRACEXP_DLDEXP_SUPPORTED:
|
||||
case PIPE_SHADER_CAP_TGSI_ANY_INOUT_DECL_RANGE:
|
||||
return 1;
|
||||
case PIPE_SHADER_CAP_TGSI_DROUND_SUPPORTED:
|
||||
case PIPE_SHADER_CAP_TGSI_FMA_SUPPORTED:
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue