mesa-clc: vendor as full-fork recipe (path=source, patches baked)
This commit is contained in:
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,268 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_D3D10_H_
|
||||
#define OPENCL_CL_D3D10_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#pragma warning( disable : 5105 )
|
||||
#endif
|
||||
#endif
|
||||
#include <d3d10.h>
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_d3d10_sharing
|
||||
***************************************************************/
|
||||
#define cl_khr_d3d10_sharing 1
|
||||
#define CL_KHR_D3D10_SHARING_EXTENSION_NAME \
|
||||
"cl_khr_d3d10_sharing"
|
||||
|
||||
|
||||
#define CL_KHR_D3D10_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef cl_uint cl_d3d10_device_source_khr;
|
||||
typedef cl_uint cl_d3d10_device_set_khr;
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_D3D10_DEVICE_KHR -1002
|
||||
#define CL_INVALID_D3D10_RESOURCE_KHR -1003
|
||||
#define CL_D3D10_RESOURCE_ALREADY_ACQUIRED_KHR -1004
|
||||
#define CL_D3D10_RESOURCE_NOT_ACQUIRED_KHR -1005
|
||||
|
||||
/* cl_d3d10_device_source_khr */
|
||||
#define CL_D3D10_DEVICE_KHR 0x4010
|
||||
#define CL_D3D10_DXGI_ADAPTER_KHR 0x4011
|
||||
|
||||
/* cl_d3d10_device_set_khr */
|
||||
#define CL_PREFERRED_DEVICES_FOR_D3D10_KHR 0x4012
|
||||
#define CL_ALL_DEVICES_FOR_D3D10_KHR 0x4013
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_D3D10_DEVICE_KHR 0x4014
|
||||
#define CL_CONTEXT_D3D10_PREFER_SHARED_RESOURCES_KHR 0x402C
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_D3D10_RESOURCE_KHR 0x4015
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_D3D10_SUBRESOURCE_KHR 0x4016
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_D3D10_OBJECTS_KHR 0x4017
|
||||
#define CL_COMMAND_RELEASE_D3D10_OBJECTS_KHR 0x4018
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromD3D10KHR_t(
|
||||
cl_platform_id platform,
|
||||
cl_d3d10_device_source_khr d3d_device_source,
|
||||
void* d3d_object,
|
||||
cl_d3d10_device_set_khr d3d_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices);
|
||||
|
||||
typedef clGetDeviceIDsFromD3D10KHR_t *
|
||||
clGetDeviceIDsFromD3D10KHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D10BufferKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Buffer* resource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D10BufferKHR_t *
|
||||
clCreateFromD3D10BufferKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D10Texture2DKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Texture2D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D10Texture2DKHR_t *
|
||||
clCreateFromD3D10Texture2DKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D10Texture3DKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Texture3D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D10Texture3DKHR_t *
|
||||
clCreateFromD3D10Texture3DKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireD3D10ObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireD3D10ObjectsKHR_t *
|
||||
clEnqueueAcquireD3D10ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseD3D10ObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseD3D10ObjectsKHR_t *
|
||||
clEnqueueReleaseD3D10ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromD3D10KHR(
|
||||
cl_platform_id platform,
|
||||
cl_d3d10_device_source_khr d3d_device_source,
|
||||
void* d3d_object,
|
||||
cl_d3d10_device_set_khr d3d_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D10BufferKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Buffer* resource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D10Texture2DKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Texture2D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D10Texture3DKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D10Texture3D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireD3D10ObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseD3D10ObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_sharing_format_query_d3d10
|
||||
***************************************************************/
|
||||
#define cl_intel_sharing_format_query_d3d10 1
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_D3D10_EXTENSION_NAME \
|
||||
"cl_intel_sharing_format_query_d3d10"
|
||||
|
||||
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_D3D10_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
/* when cl_khr_d3d10_sharing is supported */
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetSupportedD3D10TextureFormatsINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint num_entries,
|
||||
DXGI_FORMAT* d3d10_formats,
|
||||
cl_uint* num_texture_formats);
|
||||
|
||||
typedef clGetSupportedD3D10TextureFormatsINTEL_t *
|
||||
clGetSupportedD3D10TextureFormatsINTEL_fn ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetSupportedD3D10TextureFormatsINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint num_entries,
|
||||
DXGI_FORMAT* d3d10_formats,
|
||||
cl_uint* num_texture_formats) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_D3D10_H_ */
|
||||
@@ -0,0 +1,270 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_D3D11_H_
|
||||
#define OPENCL_CL_D3D11_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#pragma warning( disable : 5105 )
|
||||
#endif
|
||||
#endif
|
||||
#include <d3d11.h>
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_d3d11_sharing
|
||||
***************************************************************/
|
||||
#define cl_khr_d3d11_sharing 1
|
||||
#define CL_KHR_D3D11_SHARING_EXTENSION_NAME \
|
||||
"cl_khr_d3d11_sharing"
|
||||
|
||||
|
||||
#define CL_KHR_D3D11_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef cl_uint cl_d3d11_device_source_khr;
|
||||
typedef cl_uint cl_d3d11_device_set_khr;
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_D3D11_DEVICE_KHR -1006
|
||||
#define CL_INVALID_D3D11_RESOURCE_KHR -1007
|
||||
#define CL_D3D11_RESOURCE_ALREADY_ACQUIRED_KHR -1008
|
||||
#define CL_D3D11_RESOURCE_NOT_ACQUIRED_KHR -1009
|
||||
|
||||
/* cl_d3d11_device_source_khr */
|
||||
#define CL_D3D11_DEVICE_KHR 0x4019
|
||||
#define CL_D3D11_DXGI_ADAPTER_KHR 0x401A
|
||||
|
||||
/* cl_d3d11_device_set_khr */
|
||||
#define CL_PREFERRED_DEVICES_FOR_D3D11_KHR 0x401B
|
||||
#define CL_ALL_DEVICES_FOR_D3D11_KHR 0x401C
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_D3D11_DEVICE_KHR 0x401D
|
||||
#define CL_CONTEXT_D3D11_PREFER_SHARED_RESOURCES_KHR 0x402D
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_D3D11_RESOURCE_KHR 0x401E
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_D3D11_SUBRESOURCE_KHR 0x401F
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_D3D11_OBJECTS_KHR 0x4020
|
||||
#define CL_COMMAND_RELEASE_D3D11_OBJECTS_KHR 0x4021
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromD3D11KHR_t(
|
||||
cl_platform_id platform,
|
||||
cl_d3d11_device_source_khr d3d_device_source,
|
||||
void* d3d_object,
|
||||
cl_d3d11_device_set_khr d3d_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices);
|
||||
|
||||
typedef clGetDeviceIDsFromD3D11KHR_t *
|
||||
clGetDeviceIDsFromD3D11KHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D11BufferKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Buffer* resource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D11BufferKHR_t *
|
||||
clCreateFromD3D11BufferKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D11Texture2DKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Texture2D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D11Texture2DKHR_t *
|
||||
clCreateFromD3D11Texture2DKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromD3D11Texture3DKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Texture3D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromD3D11Texture3DKHR_t *
|
||||
clCreateFromD3D11Texture3DKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireD3D11ObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireD3D11ObjectsKHR_t *
|
||||
clEnqueueAcquireD3D11ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseD3D11ObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseD3D11ObjectsKHR_t *
|
||||
clEnqueueReleaseD3D11ObjectsKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromD3D11KHR(
|
||||
cl_platform_id platform,
|
||||
cl_d3d11_device_source_khr d3d_device_source,
|
||||
void* d3d_object,
|
||||
cl_d3d11_device_set_khr d3d_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D11BufferKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Buffer* resource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D11Texture2DKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Texture2D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromD3D11Texture3DKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
ID3D11Texture3D* resource,
|
||||
UINT subresource,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireD3D11ObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseD3D11ObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_sharing_format_query_d3d11
|
||||
***************************************************************/
|
||||
#define cl_intel_sharing_format_query_d3d11 1
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_NAME \
|
||||
"cl_intel_sharing_format_query_d3d11"
|
||||
|
||||
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_D3D11_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
/* when cl_khr_d3d11_sharing is supported */
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetSupportedD3D11TextureFormatsINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
DXGI_FORMAT* d3d11_formats,
|
||||
cl_uint* num_texture_formats);
|
||||
|
||||
typedef clGetSupportedD3D11TextureFormatsINTEL_t *
|
||||
clGetSupportedD3D11TextureFormatsINTEL_fn ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetSupportedD3D11TextureFormatsINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
DXGI_FORMAT* d3d11_formats,
|
||||
cl_uint* num_texture_formats) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_D3D11_H_ */
|
||||
@@ -0,0 +1,386 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_DX9_MEDIA_SHARING_H_
|
||||
#define OPENCL_CL_DX9_MEDIA_SHARING_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#if defined(_WIN32)
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#pragma warning( disable : 5105 )
|
||||
#endif
|
||||
#endif
|
||||
#include <d3d9.h>
|
||||
#if defined(_MSC_VER)
|
||||
#if _MSC_VER >=1500
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_dx9_media_sharing
|
||||
***************************************************************/
|
||||
#define cl_khr_dx9_media_sharing 1
|
||||
#define CL_KHR_DX9_MEDIA_SHARING_EXTENSION_NAME \
|
||||
"cl_khr_dx9_media_sharing"
|
||||
|
||||
|
||||
#define CL_KHR_DX9_MEDIA_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef cl_uint cl_dx9_media_adapter_type_khr;
|
||||
typedef cl_uint cl_dx9_media_adapter_set_khr;
|
||||
|
||||
#if defined(_WIN32)
|
||||
typedef struct _cl_dx9_surface_info_khr {
|
||||
IDirect3DSurface9* resource;
|
||||
HANDLE shared_handle;
|
||||
} cl_dx9_surface_info_khr;
|
||||
|
||||
#endif /* defined(_WIN32) */
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_DX9_MEDIA_ADAPTER_KHR -1010
|
||||
#define CL_INVALID_DX9_MEDIA_SURFACE_KHR -1011
|
||||
#define CL_DX9_MEDIA_SURFACE_ALREADY_ACQUIRED_KHR -1012
|
||||
#define CL_DX9_MEDIA_SURFACE_NOT_ACQUIRED_KHR -1013
|
||||
|
||||
/* cl_media_adapter_type_khr */
|
||||
#define CL_ADAPTER_D3D9_KHR 0x2020
|
||||
#define CL_ADAPTER_D3D9EX_KHR 0x2021
|
||||
#define CL_ADAPTER_DXVA_KHR 0x2022
|
||||
|
||||
/* cl_media_adapter_set_khr */
|
||||
#define CL_PREFERRED_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2023
|
||||
#define CL_ALL_DEVICES_FOR_DX9_MEDIA_ADAPTER_KHR 0x2024
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_ADAPTER_D3D9_KHR 0x2025
|
||||
#define CL_CONTEXT_ADAPTER_D3D9EX_KHR 0x2026
|
||||
#define CL_CONTEXT_ADAPTER_DXVA_KHR 0x2027
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_DX9_MEDIA_ADAPTER_TYPE_KHR 0x2028
|
||||
#define CL_MEM_DX9_MEDIA_SURFACE_INFO_KHR 0x2029
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_DX9_MEDIA_PLANE_KHR 0x202A
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_DX9_MEDIA_SURFACES_KHR 0x202B
|
||||
#define CL_COMMAND_RELEASE_DX9_MEDIA_SURFACES_KHR 0x202C
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromDX9MediaAdapterKHR_t(
|
||||
cl_platform_id platform,
|
||||
cl_uint num_media_adapters,
|
||||
cl_dx9_media_adapter_type_khr* media_adapter_type,
|
||||
void* media_adapters,
|
||||
cl_dx9_media_adapter_set_khr media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices);
|
||||
|
||||
typedef clGetDeviceIDsFromDX9MediaAdapterKHR_t *
|
||||
clGetDeviceIDsFromDX9MediaAdapterKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromDX9MediaSurfaceKHR_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_dx9_media_adapter_type_khr adapter_type,
|
||||
void* surface_info,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromDX9MediaSurfaceKHR_t *
|
||||
clCreateFromDX9MediaSurfaceKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireDX9MediaSurfacesKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireDX9MediaSurfacesKHR_t *
|
||||
clEnqueueAcquireDX9MediaSurfacesKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseDX9MediaSurfacesKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseDX9MediaSurfacesKHR_t *
|
||||
clEnqueueReleaseDX9MediaSurfacesKHR_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromDX9MediaAdapterKHR(
|
||||
cl_platform_id platform,
|
||||
cl_uint num_media_adapters,
|
||||
cl_dx9_media_adapter_type_khr* media_adapter_type,
|
||||
void* media_adapters,
|
||||
cl_dx9_media_adapter_set_khr media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromDX9MediaSurfaceKHR(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_dx9_media_adapter_type_khr adapter_type,
|
||||
void* surface_info,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireDX9MediaSurfacesKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseDX9MediaSurfacesKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_dx9_media_sharing
|
||||
***************************************************************/
|
||||
#define cl_intel_dx9_media_sharing 1
|
||||
#define CL_INTEL_DX9_MEDIA_SHARING_EXTENSION_NAME \
|
||||
"cl_intel_dx9_media_sharing"
|
||||
|
||||
|
||||
#define CL_INTEL_DX9_MEDIA_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
typedef cl_uint cl_dx9_device_source_intel;
|
||||
typedef cl_uint cl_dx9_device_set_intel;
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_DX9_DEVICE_INTEL -1010
|
||||
#define CL_INVALID_DX9_RESOURCE_INTEL -1011
|
||||
#define CL_DX9_RESOURCE_ALREADY_ACQUIRED_INTEL -1012
|
||||
#define CL_DX9_RESOURCE_NOT_ACQUIRED_INTEL -1013
|
||||
|
||||
/* cl_dx9_device_source_intel */
|
||||
#define CL_D3D9_DEVICE_INTEL 0x4022
|
||||
#define CL_D3D9EX_DEVICE_INTEL 0x4070
|
||||
#define CL_DXVA_DEVICE_INTEL 0x4071
|
||||
|
||||
/* cl_dx9_device_set_intel */
|
||||
#define CL_PREFERRED_DEVICES_FOR_DX9_INTEL 0x4024
|
||||
#define CL_ALL_DEVICES_FOR_DX9_INTEL 0x4025
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_D3D9_DEVICE_INTEL 0x4026
|
||||
#define CL_CONTEXT_D3D9EX_DEVICE_INTEL 0x4072
|
||||
#define CL_CONTEXT_DXVA_DEVICE_INTEL 0x4073
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_DX9_RESOURCE_INTEL 0x4027
|
||||
#define CL_MEM_DX9_SHARED_HANDLE_INTEL 0x4074
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_DX9_PLANE_INTEL 0x4075
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_DX9_OBJECTS_INTEL 0x402A
|
||||
#define CL_COMMAND_RELEASE_DX9_OBJECTS_INTEL 0x402B
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromDX9INTEL_t(
|
||||
cl_platform_id platform,
|
||||
cl_dx9_device_source_intel dx9_device_source,
|
||||
void* dx9_object,
|
||||
cl_dx9_device_set_intel dx9_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices);
|
||||
|
||||
typedef clGetDeviceIDsFromDX9INTEL_t *
|
||||
clGetDeviceIDsFromDX9INTEL_fn CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromDX9MediaSurfaceINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
IDirect3DSurface9* resource,
|
||||
HANDLE sharedHandle,
|
||||
UINT plane,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromDX9MediaSurfaceINTEL_t *
|
||||
clCreateFromDX9MediaSurfaceINTEL_fn CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireDX9ObjectsINTEL_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireDX9ObjectsINTEL_t *
|
||||
clEnqueueAcquireDX9ObjectsINTEL_fn CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseDX9ObjectsINTEL_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseDX9ObjectsINTEL_t *
|
||||
clEnqueueReleaseDX9ObjectsINTEL_fn CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromDX9INTEL(
|
||||
cl_platform_id platform,
|
||||
cl_dx9_device_source_intel dx9_device_source,
|
||||
void* dx9_object,
|
||||
cl_dx9_device_set_intel dx9_device_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromDX9MediaSurfaceINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
IDirect3DSurface9* resource,
|
||||
HANDLE sharedHandle,
|
||||
UINT plane,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireDX9ObjectsINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseDX9ObjectsINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_sharing_format_query_dx9
|
||||
***************************************************************/
|
||||
#define cl_intel_sharing_format_query_dx9 1
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_DX9_EXTENSION_NAME \
|
||||
"cl_intel_sharing_format_query_dx9"
|
||||
|
||||
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_DX9_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
/* when cl_khr_dx9_media_sharing or cl_intel_dx9_media_sharing is supported */
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetSupportedDX9MediaSurfaceFormatsINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
D3DFORMAT* dx9_formats,
|
||||
cl_uint* num_surface_formats);
|
||||
|
||||
typedef clGetSupportedDX9MediaSurfaceFormatsINTEL_t *
|
||||
clGetSupportedDX9MediaSurfaceFormatsINTEL_fn ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetSupportedDX9MediaSurfaceFormatsINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
D3DFORMAT* dx9_formats,
|
||||
cl_uint* num_surface_formats) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_DX9_MEDIA_SHARING_H_ */
|
||||
@@ -0,0 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#include <CL/cl_dx9_media_sharing.h>
|
||||
#pragma message("The Intel DX9 media sharing extensions have been moved into cl_dx9_media_sharing.h. Please include cl_dx9_media_sharing.h directly.")
|
||||
@@ -0,0 +1,185 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_EGL_H_
|
||||
#define OPENCL_CL_EGL_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_egl_image
|
||||
***************************************************************/
|
||||
#define cl_khr_egl_image 1
|
||||
#define CL_KHR_EGL_IMAGE_EXTENSION_NAME \
|
||||
"cl_khr_egl_image"
|
||||
|
||||
|
||||
#define CL_KHR_EGL_IMAGE_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
/* Command type for events created with clEnqueueAcquireEGLObjectsKHR */
|
||||
#define CL_COMMAND_EGL_FENCE_SYNC_OBJECT_KHR 0x202F
|
||||
#define CL_COMMAND_ACQUIRE_EGL_OBJECTS_KHR 0x202D
|
||||
#define CL_COMMAND_RELEASE_EGL_OBJECTS_KHR 0x202E
|
||||
|
||||
/* Error type for clCreateFromEGLImageKHR */
|
||||
#define CL_INVALID_EGL_OBJECT_KHR -1093
|
||||
#define CL_EGL_RESOURCE_NOT_ACQUIRED_KHR -1092
|
||||
|
||||
/* CLeglImageKHR is an opaque handle to an EGLImage */
|
||||
typedef void* CLeglImageKHR;
|
||||
|
||||
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
|
||||
typedef void* CLeglDisplayKHR;
|
||||
|
||||
/* properties passed to clCreateFromEGLImageKHR */
|
||||
typedef intptr_t cl_egl_image_properties_khr;
|
||||
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromEGLImageKHR_t(
|
||||
cl_context context,
|
||||
CLeglDisplayKHR egldisplay,
|
||||
CLeglImageKHR eglimage,
|
||||
cl_mem_flags flags,
|
||||
const cl_egl_image_properties_khr* properties,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromEGLImageKHR_t *
|
||||
clCreateFromEGLImageKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireEGLObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireEGLObjectsKHR_t *
|
||||
clEnqueueAcquireEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseEGLObjectsKHR_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseEGLObjectsKHR_t *
|
||||
clEnqueueReleaseEGLObjectsKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromEGLImageKHR(
|
||||
cl_context context,
|
||||
CLeglDisplayKHR egldisplay,
|
||||
CLeglImageKHR eglimage,
|
||||
cl_mem_flags flags,
|
||||
const cl_egl_image_properties_khr* properties,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireEGLObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseEGLObjectsKHR(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_egl_event
|
||||
***************************************************************/
|
||||
#define cl_khr_egl_event 1
|
||||
#define CL_KHR_EGL_EVENT_EXTENSION_NAME \
|
||||
"cl_khr_egl_event"
|
||||
|
||||
|
||||
#define CL_KHR_EGL_EVENT_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
/* CLeglDisplayKHR is an opaque handle to an EGLDisplay */
|
||||
/* type CLeglDisplayKHR */
|
||||
|
||||
/* CLeglSyncKHR is an opaque handle to an EGLSync object */
|
||||
typedef void* CLeglSyncKHR;
|
||||
|
||||
|
||||
typedef cl_event CL_API_CALL
|
||||
clCreateEventFromEGLSyncKHR_t(
|
||||
cl_context context,
|
||||
CLeglSyncKHR sync,
|
||||
CLeglDisplayKHR display,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateEventFromEGLSyncKHR_t *
|
||||
clCreateEventFromEGLSyncKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_event CL_API_CALL
|
||||
clCreateEventFromEGLSyncKHR(
|
||||
cl_context context,
|
||||
CLeglSyncKHR sync,
|
||||
CLeglDisplayKHR display,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_EGL_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,19 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#include <CL/cl_ext.h>
|
||||
#pragma message("The Intel extensions have been moved into cl_ext.h. Please include cl_ext.h directly.")
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,421 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_GL_H_
|
||||
#define OPENCL_CL_GL_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_gl_sharing
|
||||
***************************************************************/
|
||||
#define cl_khr_gl_sharing 1
|
||||
#define CL_KHR_GL_SHARING_EXTENSION_NAME \
|
||||
"cl_khr_gl_sharing"
|
||||
|
||||
|
||||
#define CL_KHR_GL_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef int cl_GLint;
|
||||
typedef unsigned int cl_GLenum;
|
||||
typedef unsigned int cl_GLuint;
|
||||
|
||||
typedef cl_uint cl_gl_context_info;
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_GL_SHAREGROUP_REFERENCE_KHR -1000
|
||||
|
||||
/* cl_gl_context_info */
|
||||
#define CL_CURRENT_DEVICE_FOR_GL_CONTEXT_KHR 0x2006
|
||||
#define CL_DEVICES_FOR_GL_CONTEXT_KHR 0x2007
|
||||
|
||||
/* Additional cl_context_properties */
|
||||
#define CL_GL_CONTEXT_KHR 0x2008
|
||||
#define CL_EGL_DISPLAY_KHR 0x2009
|
||||
#define CL_GLX_DISPLAY_KHR 0x200A
|
||||
#define CL_WGL_HDC_KHR 0x200B
|
||||
#define CL_CGL_SHAREGROUP_KHR 0x200C
|
||||
|
||||
typedef cl_uint cl_gl_object_type;
|
||||
typedef cl_uint cl_gl_texture_info;
|
||||
typedef cl_uint cl_gl_platform_info;
|
||||
|
||||
/* cl_gl_object_type */
|
||||
#define CL_GL_OBJECT_BUFFER 0x2000
|
||||
#define CL_GL_OBJECT_TEXTURE2D 0x2001
|
||||
#define CL_GL_OBJECT_TEXTURE3D 0x2002
|
||||
#define CL_GL_OBJECT_RENDERBUFFER 0x2003
|
||||
|
||||
#if defined(CL_VERSION_1_2)
|
||||
/* cl_gl_object_type */
|
||||
#define CL_GL_OBJECT_TEXTURE2D_ARRAY 0x200E
|
||||
#define CL_GL_OBJECT_TEXTURE1D 0x200F
|
||||
#define CL_GL_OBJECT_TEXTURE1D_ARRAY 0x2010
|
||||
#define CL_GL_OBJECT_TEXTURE_BUFFER 0x2011
|
||||
|
||||
#endif /* defined(CL_VERSION_1_2) */
|
||||
|
||||
/* cl_gl_texture_info */
|
||||
#define CL_GL_TEXTURE_TARGET 0x2004
|
||||
#define CL_GL_MIPMAP_LEVEL 0x2005
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetGLContextInfoKHR_t(
|
||||
const cl_context_properties* properties,
|
||||
cl_gl_context_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret);
|
||||
|
||||
typedef clGetGLContextInfoKHR_t *
|
||||
clGetGLContextInfoKHR_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromGLBuffer_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLuint bufobj,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromGLBuffer_t *
|
||||
clCreateFromGLBuffer_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetGLContextInfoKHR(
|
||||
const cl_context_properties* properties,
|
||||
cl_gl_context_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromGLBuffer(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLuint bufobj,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#if defined(CL_VERSION_1_2)
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromGLTexture_t *
|
||||
clCreateFromGLTexture_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#endif /* defined(CL_VERSION_1_2) */
|
||||
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromGLRenderbuffer_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLuint renderbuffer,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromGLRenderbuffer_t *
|
||||
clCreateFromGLRenderbuffer_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetGLObjectInfo_t(
|
||||
cl_mem memobj,
|
||||
cl_gl_object_type* gl_object_type,
|
||||
cl_GLuint* gl_object_name);
|
||||
|
||||
typedef clGetGLObjectInfo_t *
|
||||
clGetGLObjectInfo_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetGLTextureInfo_t(
|
||||
cl_mem memobj,
|
||||
cl_gl_texture_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret);
|
||||
|
||||
typedef clGetGLTextureInfo_t *
|
||||
clGetGLTextureInfo_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireGLObjects_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireGLObjects_t *
|
||||
clEnqueueAcquireGLObjects_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseGLObjects_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseGLObjects_t *
|
||||
clEnqueueReleaseGLObjects_fn CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromGLRenderbuffer(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLuint renderbuffer,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetGLObjectInfo(
|
||||
cl_mem memobj,
|
||||
cl_gl_object_type* gl_object_type,
|
||||
cl_GLuint* gl_object_name) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetGLTextureInfo(
|
||||
cl_mem memobj,
|
||||
cl_gl_texture_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireGLObjects(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseGLObjects(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_0;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/* OpenCL 1.0 APIs that were deprecated in OpenCL 1.2 */
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture2D_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromGLTexture2D_t *
|
||||
clCreateFromGLTexture2D_fn CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture3D_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromGLTexture3D_t *
|
||||
clCreateFromGLTexture3D_fn CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture2D(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromGLTexture3D(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_GLenum target,
|
||||
cl_GLint miplevel,
|
||||
cl_GLuint texture,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1_DEPRECATED;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_gl_event
|
||||
***************************************************************/
|
||||
#define cl_khr_gl_event 1
|
||||
#define CL_KHR_GL_EVENT_EXTENSION_NAME \
|
||||
"cl_khr_gl_event"
|
||||
|
||||
|
||||
#define CL_KHR_GL_EVENT_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef struct __GLsync * cl_GLsync;
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_GL_FENCE_SYNC_OBJECT_KHR 0x200D
|
||||
|
||||
|
||||
typedef cl_event CL_API_CALL
|
||||
clCreateEventFromGLsyncKHR_t(
|
||||
cl_context context,
|
||||
cl_GLsync sync,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateEventFromGLsyncKHR_t *
|
||||
clCreateEventFromGLsyncKHR_fn CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
#if !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_event CL_API_CALL
|
||||
clCreateEventFromGLsyncKHR(
|
||||
cl_context context,
|
||||
cl_GLsync sync,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_1;
|
||||
|
||||
#endif /* !defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_gl_depth_images
|
||||
***************************************************************/
|
||||
#define cl_khr_gl_depth_images 1
|
||||
#define CL_KHR_GL_DEPTH_IMAGES_EXTENSION_NAME \
|
||||
"cl_khr_gl_depth_images"
|
||||
|
||||
|
||||
#define CL_KHR_GL_DEPTH_IMAGES_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
/* cl_channel_order */
|
||||
#define CL_DEPTH_STENCIL 0x10BE
|
||||
|
||||
/* cl_channel_type */
|
||||
#define CL_UNORM_INT24 0x10DF
|
||||
|
||||
/***************************************************************
|
||||
* cl_khr_gl_msaa_sharing
|
||||
***************************************************************/
|
||||
#define cl_khr_gl_msaa_sharing 1
|
||||
#define CL_KHR_GL_MSAA_SHARING_EXTENSION_NAME \
|
||||
"cl_khr_gl_msaa_sharing"
|
||||
|
||||
|
||||
#define CL_KHR_GL_MSAA_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
/* cl_gl_texture_info */
|
||||
#define CL_GL_NUM_SAMPLES 0x2012
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_sharing_format_query_gl
|
||||
***************************************************************/
|
||||
#define cl_intel_sharing_format_query_gl 1
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_GL_EXTENSION_NAME \
|
||||
"cl_intel_sharing_format_query_gl"
|
||||
|
||||
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_GL_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
/* when cl_khr_gl_sharing is supported */
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetSupportedGLTextureFormatsINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint num_entries,
|
||||
cl_GLenum* gl_formats,
|
||||
cl_uint* num_texture_formats);
|
||||
|
||||
typedef clGetSupportedGLTextureFormatsINTEL_t *
|
||||
clGetSupportedGLTextureFormatsINTEL_fn ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetSupportedGLTextureFormatsINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint num_entries,
|
||||
cl_GLenum* gl_formats,
|
||||
cl_uint* num_texture_formats) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_GL_H_ */
|
||||
@@ -0,0 +1,18 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2021 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#include <CL/cl_gl.h>
|
||||
#pragma message("The extensions in cl_gl_ext.h have been moved into cl_gl.h. Please include cl_gl.h directly.")
|
||||
@@ -0,0 +1,440 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2019-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
/**
|
||||
* This is a header-only utility library that provides OpenCL host code with
|
||||
* routines for converting to/from cl_half values.
|
||||
*
|
||||
* Example usage:
|
||||
*
|
||||
* #include <CL/cl_half.h>
|
||||
* ...
|
||||
* cl_half h = cl_half_from_float(0.5f, CL_HALF_RTE);
|
||||
* cl_float f = cl_half_to_float(h);
|
||||
*/
|
||||
|
||||
#ifndef OPENCL_CL_HALF_H
|
||||
#define OPENCL_CL_HALF_H
|
||||
|
||||
#include <CL/cl_platform.h>
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
/**
|
||||
* Rounding mode used when converting to cl_half.
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
CL_HALF_RTE, // round to nearest even
|
||||
CL_HALF_RTZ, // round towards zero
|
||||
CL_HALF_RTP, // round towards positive infinity
|
||||
CL_HALF_RTN, // round towards negative infinity
|
||||
} cl_half_rounding_mode;
|
||||
|
||||
|
||||
/* Private utility macros. */
|
||||
#define CL_HALF_EXP_MASK 0x7C00
|
||||
#define CL_HALF_MAX_FINITE_MAG 0x7BFF
|
||||
|
||||
|
||||
/*
|
||||
* Utility to deal with values that overflow when converting to half precision.
|
||||
*/
|
||||
static inline cl_half cl_half_handle_overflow(cl_half_rounding_mode rounding_mode,
|
||||
uint16_t sign)
|
||||
{
|
||||
if (rounding_mode == CL_HALF_RTZ)
|
||||
{
|
||||
// Round overflow towards zero -> largest finite number (preserving sign)
|
||||
return (sign << 15) | CL_HALF_MAX_FINITE_MAG;
|
||||
}
|
||||
else if (rounding_mode == CL_HALF_RTP && sign)
|
||||
{
|
||||
// Round negative overflow towards positive infinity -> most negative finite number
|
||||
return (1 << 15) | CL_HALF_MAX_FINITE_MAG;
|
||||
}
|
||||
else if (rounding_mode == CL_HALF_RTN && !sign)
|
||||
{
|
||||
// Round positive overflow towards negative infinity -> largest finite number
|
||||
return CL_HALF_MAX_FINITE_MAG;
|
||||
}
|
||||
|
||||
// Overflow to infinity
|
||||
return (sign << 15) | CL_HALF_EXP_MASK;
|
||||
}
|
||||
|
||||
/*
|
||||
* Utility to deal with values that underflow when converting to half precision.
|
||||
*/
|
||||
static inline cl_half cl_half_handle_underflow(cl_half_rounding_mode rounding_mode,
|
||||
uint16_t sign)
|
||||
{
|
||||
if (rounding_mode == CL_HALF_RTP && !sign)
|
||||
{
|
||||
// Round underflow towards positive infinity -> smallest positive value
|
||||
return (sign << 15) | 1;
|
||||
}
|
||||
else if (rounding_mode == CL_HALF_RTN && sign)
|
||||
{
|
||||
// Round underflow towards negative infinity -> largest negative value
|
||||
return (sign << 15) | 1;
|
||||
}
|
||||
|
||||
// Flush to zero
|
||||
return (sign << 15);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a cl_float to a cl_half.
|
||||
*/
|
||||
static inline cl_half cl_half_from_float(cl_float f, cl_half_rounding_mode rounding_mode)
|
||||
{
|
||||
// Type-punning to get direct access to underlying bits
|
||||
union
|
||||
{
|
||||
cl_float f;
|
||||
uint32_t i;
|
||||
} f32;
|
||||
f32.f = f;
|
||||
|
||||
// Extract sign bit
|
||||
uint16_t sign = f32.i >> 31;
|
||||
|
||||
// Extract FP32 exponent and mantissa
|
||||
uint32_t f_exp = (f32.i >> (CL_FLT_MANT_DIG - 1)) & 0xFF;
|
||||
uint32_t f_mant = f32.i & ((1 << (CL_FLT_MANT_DIG - 1)) - 1);
|
||||
|
||||
// Remove FP32 exponent bias
|
||||
int32_t exp = f_exp - CL_FLT_MAX_EXP + 1;
|
||||
|
||||
// Add FP16 exponent bias
|
||||
uint16_t h_exp = (uint16_t)(exp + CL_HALF_MAX_EXP - 1);
|
||||
|
||||
// Position of the bit that will become the FP16 mantissa LSB
|
||||
uint32_t lsb_pos = CL_FLT_MANT_DIG - CL_HALF_MANT_DIG;
|
||||
|
||||
// Check for NaN / infinity
|
||||
if (f_exp == 0xFF)
|
||||
{
|
||||
if (f_mant)
|
||||
{
|
||||
// NaN -> propagate mantissa and silence it
|
||||
uint16_t h_mant = (uint16_t)(f_mant >> lsb_pos);
|
||||
h_mant |= 0x200;
|
||||
return (sign << 15) | CL_HALF_EXP_MASK | h_mant;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Infinity -> zero mantissa
|
||||
return (sign << 15) | CL_HALF_EXP_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for zero
|
||||
if (!f_exp && !f_mant)
|
||||
{
|
||||
return (sign << 15);
|
||||
}
|
||||
|
||||
// Check for overflow
|
||||
if (exp >= CL_HALF_MAX_EXP)
|
||||
{
|
||||
return cl_half_handle_overflow(rounding_mode, sign);
|
||||
}
|
||||
|
||||
// Check for underflow
|
||||
if (exp < (CL_HALF_MIN_EXP - CL_HALF_MANT_DIG - 1))
|
||||
{
|
||||
return cl_half_handle_underflow(rounding_mode, sign);
|
||||
}
|
||||
|
||||
// Check for value that will become denormal
|
||||
if (exp < -14)
|
||||
{
|
||||
// Denormal -> include the implicit 1 from the FP32 mantissa
|
||||
h_exp = 0;
|
||||
f_mant |= 1 << (CL_FLT_MANT_DIG - 1);
|
||||
|
||||
// Mantissa shift amount depends on exponent
|
||||
lsb_pos = -exp + (CL_FLT_MANT_DIG - 25);
|
||||
}
|
||||
|
||||
// Generate FP16 mantissa by shifting FP32 mantissa
|
||||
uint16_t h_mant = (uint16_t)(f_mant >> lsb_pos);
|
||||
|
||||
// Check whether we need to round
|
||||
uint32_t halfway = 1 << (lsb_pos - 1);
|
||||
uint32_t mask = (halfway << 1) - 1;
|
||||
switch (rounding_mode)
|
||||
{
|
||||
case CL_HALF_RTE:
|
||||
if ((f_mant & mask) > halfway)
|
||||
{
|
||||
// More than halfway -> round up
|
||||
h_mant += 1;
|
||||
}
|
||||
else if ((f_mant & mask) == halfway)
|
||||
{
|
||||
// Exactly halfway -> round to nearest even
|
||||
if (h_mant & 0x1)
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
case CL_HALF_RTZ:
|
||||
// Mantissa has already been truncated -> do nothing
|
||||
break;
|
||||
case CL_HALF_RTP:
|
||||
if ((f_mant & mask) && !sign)
|
||||
{
|
||||
// Round positive numbers up
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
case CL_HALF_RTN:
|
||||
if ((f_mant & mask) && sign)
|
||||
{
|
||||
// Round negative numbers down
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for mantissa overflow
|
||||
if (h_mant & 0x400)
|
||||
{
|
||||
h_exp += 1;
|
||||
h_mant = 0;
|
||||
}
|
||||
|
||||
return (sign << 15) | (h_exp << 10) | h_mant;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a cl_double to a cl_half.
|
||||
*/
|
||||
static inline cl_half cl_half_from_double(cl_double d, cl_half_rounding_mode rounding_mode)
|
||||
{
|
||||
// Type-punning to get direct access to underlying bits
|
||||
union
|
||||
{
|
||||
cl_double d;
|
||||
uint64_t i;
|
||||
} f64;
|
||||
f64.d = d;
|
||||
|
||||
// Extract sign bit
|
||||
uint16_t sign = f64.i >> 63;
|
||||
|
||||
// Extract FP64 exponent and mantissa
|
||||
uint64_t d_exp = (f64.i >> (CL_DBL_MANT_DIG - 1)) & 0x7FF;
|
||||
uint64_t d_mant = f64.i & (((uint64_t)1 << (CL_DBL_MANT_DIG - 1)) - 1);
|
||||
|
||||
// Remove FP64 exponent bias
|
||||
int64_t exp = d_exp - CL_DBL_MAX_EXP + 1;
|
||||
|
||||
// Add FP16 exponent bias
|
||||
uint16_t h_exp = (uint16_t)(exp + CL_HALF_MAX_EXP - 1);
|
||||
|
||||
// Position of the bit that will become the FP16 mantissa LSB
|
||||
uint32_t lsb_pos = CL_DBL_MANT_DIG - CL_HALF_MANT_DIG;
|
||||
|
||||
// Check for NaN / infinity
|
||||
if (d_exp == 0x7FF)
|
||||
{
|
||||
if (d_mant)
|
||||
{
|
||||
// NaN -> propagate mantissa and silence it
|
||||
uint16_t h_mant = (uint16_t)(d_mant >> lsb_pos);
|
||||
h_mant |= 0x200;
|
||||
return (sign << 15) | CL_HALF_EXP_MASK | h_mant;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Infinity -> zero mantissa
|
||||
return (sign << 15) | CL_HALF_EXP_MASK;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for zero
|
||||
if (!d_exp && !d_mant)
|
||||
{
|
||||
return (sign << 15);
|
||||
}
|
||||
|
||||
// Check for overflow
|
||||
if (exp >= CL_HALF_MAX_EXP)
|
||||
{
|
||||
return cl_half_handle_overflow(rounding_mode, sign);
|
||||
}
|
||||
|
||||
// Check for underflow
|
||||
if (exp < (CL_HALF_MIN_EXP - CL_HALF_MANT_DIG - 1))
|
||||
{
|
||||
return cl_half_handle_underflow(rounding_mode, sign);
|
||||
}
|
||||
|
||||
// Check for value that will become denormal
|
||||
if (exp < -14)
|
||||
{
|
||||
// Include the implicit 1 from the FP64 mantissa
|
||||
h_exp = 0;
|
||||
d_mant |= (uint64_t)1 << (CL_DBL_MANT_DIG - 1);
|
||||
|
||||
// Mantissa shift amount depends on exponent
|
||||
lsb_pos = (uint32_t)(-exp + (CL_DBL_MANT_DIG - 25));
|
||||
}
|
||||
|
||||
// Generate FP16 mantissa by shifting FP64 mantissa
|
||||
uint16_t h_mant = (uint16_t)(d_mant >> lsb_pos);
|
||||
|
||||
// Check whether we need to round
|
||||
uint64_t halfway = (uint64_t)1 << (lsb_pos - 1);
|
||||
uint64_t mask = (halfway << 1) - 1;
|
||||
switch (rounding_mode)
|
||||
{
|
||||
case CL_HALF_RTE:
|
||||
if ((d_mant & mask) > halfway)
|
||||
{
|
||||
// More than halfway -> round up
|
||||
h_mant += 1;
|
||||
}
|
||||
else if ((d_mant & mask) == halfway)
|
||||
{
|
||||
// Exactly halfway -> round to nearest even
|
||||
if (h_mant & 0x1)
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
case CL_HALF_RTZ:
|
||||
// Mantissa has already been truncated -> do nothing
|
||||
break;
|
||||
case CL_HALF_RTP:
|
||||
if ((d_mant & mask) && !sign)
|
||||
{
|
||||
// Round positive numbers up
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
case CL_HALF_RTN:
|
||||
if ((d_mant & mask) && sign)
|
||||
{
|
||||
// Round negative numbers down
|
||||
h_mant += 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
// Check for mantissa overflow
|
||||
if (h_mant & 0x400)
|
||||
{
|
||||
h_exp += 1;
|
||||
h_mant = 0;
|
||||
}
|
||||
|
||||
return (sign << 15) | (h_exp << 10) | h_mant;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Convert a cl_half to a cl_float.
|
||||
*/
|
||||
static inline cl_float cl_half_to_float(cl_half h)
|
||||
{
|
||||
// Type-punning to get direct access to underlying bits
|
||||
union
|
||||
{
|
||||
cl_float f;
|
||||
uint32_t i;
|
||||
} f32;
|
||||
|
||||
// Extract sign bit
|
||||
uint16_t sign = h >> 15;
|
||||
|
||||
// Extract FP16 exponent and mantissa
|
||||
uint16_t h_exp = (h >> (CL_HALF_MANT_DIG - 1)) & 0x1F;
|
||||
uint16_t h_mant = h & 0x3FF;
|
||||
|
||||
// Remove FP16 exponent bias
|
||||
int32_t exp = h_exp - CL_HALF_MAX_EXP + 1;
|
||||
|
||||
// Add FP32 exponent bias
|
||||
uint32_t f_exp = exp + CL_FLT_MAX_EXP - 1;
|
||||
|
||||
// Check for NaN / infinity
|
||||
if (h_exp == 0x1F)
|
||||
{
|
||||
if (h_mant)
|
||||
{
|
||||
// NaN -> propagate mantissa and silence it
|
||||
uint32_t f_mant = h_mant << (CL_FLT_MANT_DIG - CL_HALF_MANT_DIG);
|
||||
f_mant |= 0x400000;
|
||||
f32.i = (sign << 31) | 0x7F800000 | f_mant;
|
||||
return f32.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Infinity -> zero mantissa
|
||||
f32.i = (sign << 31) | 0x7F800000;
|
||||
return f32.f;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for zero / denormal
|
||||
if (h_exp == 0)
|
||||
{
|
||||
if (h_mant == 0)
|
||||
{
|
||||
// Zero -> zero exponent
|
||||
f_exp = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
// Denormal -> normalize it
|
||||
// - Shift mantissa to make most-significant 1 implicit
|
||||
// - Adjust exponent accordingly
|
||||
uint32_t shift = 0;
|
||||
while ((h_mant & 0x400) == 0)
|
||||
{
|
||||
h_mant <<= 1;
|
||||
shift++;
|
||||
}
|
||||
h_mant &= 0x3FF;
|
||||
f_exp -= shift - 1;
|
||||
}
|
||||
}
|
||||
|
||||
f32.i = (sign << 31) | (f_exp << 23) | (h_mant << 13);
|
||||
return f32.f;
|
||||
}
|
||||
|
||||
|
||||
#undef CL_HALF_EXP_MASK
|
||||
#undef CL_HALF_MAX_FINITE_MAG
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* OPENCL_CL_HALF_H */
|
||||
@@ -0,0 +1,342 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2019-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_ICD_H
|
||||
#define OPENCL_CL_ICD_H
|
||||
|
||||
#include <CL/cl.h>
|
||||
#include <CL/cl_function_types.h>
|
||||
#include <CL/cl_egl.h>
|
||||
#include <CL/cl_ext.h>
|
||||
#include <CL/cl_gl.h>
|
||||
#include <CL/cl_platform.h>
|
||||
|
||||
#if defined(_WIN32)
|
||||
#include <CL/cl_d3d11.h>
|
||||
#include <CL/cl_d3d10.h>
|
||||
#include <CL/cl_dx9_media_sharing.h>
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
/* Disable warning C4201: nonstandard extension used : nameless struct/union */
|
||||
#pragma warning( push )
|
||||
#pragma warning( disable : 4201 )
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Vendor dispatch table structure */
|
||||
|
||||
typedef struct _cl_icd_dispatch {
|
||||
/* OpenCL 1.0 */
|
||||
#if __CL_HAS_ANON_UNION__
|
||||
__CL_ANON_UNION__ union {
|
||||
#endif
|
||||
clGetPlatformIDs_t *clGetPlatformIDs;
|
||||
#if __CL_HAS_ANON_UNION__
|
||||
/* Set to CL_ICD2_TAG_KHR for cl_khr_icd 2.0.0 */
|
||||
intptr_t clGetPlatformIDs_icd2_tag;
|
||||
};
|
||||
#endif
|
||||
clGetPlatformInfo_t *clGetPlatformInfo;
|
||||
clGetDeviceIDs_t *clGetDeviceIDs;
|
||||
clGetDeviceInfo_t *clGetDeviceInfo;
|
||||
clCreateContext_t *clCreateContext;
|
||||
clCreateContextFromType_t *clCreateContextFromType;
|
||||
clRetainContext_t *clRetainContext;
|
||||
clReleaseContext_t *clReleaseContext;
|
||||
clGetContextInfo_t *clGetContextInfo;
|
||||
clCreateCommandQueue_t *clCreateCommandQueue;
|
||||
clRetainCommandQueue_t *clRetainCommandQueue;
|
||||
clReleaseCommandQueue_t *clReleaseCommandQueue;
|
||||
clGetCommandQueueInfo_t *clGetCommandQueueInfo;
|
||||
clSetCommandQueueProperty_t *clSetCommandQueueProperty;
|
||||
clCreateBuffer_t *clCreateBuffer;
|
||||
clCreateImage2D_t *clCreateImage2D;
|
||||
clCreateImage3D_t *clCreateImage3D;
|
||||
clRetainMemObject_t *clRetainMemObject;
|
||||
clReleaseMemObject_t *clReleaseMemObject;
|
||||
clGetSupportedImageFormats_t *clGetSupportedImageFormats;
|
||||
clGetMemObjectInfo_t *clGetMemObjectInfo;
|
||||
clGetImageInfo_t *clGetImageInfo;
|
||||
clCreateSampler_t *clCreateSampler;
|
||||
clRetainSampler_t *clRetainSampler;
|
||||
clReleaseSampler_t *clReleaseSampler;
|
||||
clGetSamplerInfo_t *clGetSamplerInfo;
|
||||
clCreateProgramWithSource_t *clCreateProgramWithSource;
|
||||
clCreateProgramWithBinary_t *clCreateProgramWithBinary;
|
||||
clRetainProgram_t *clRetainProgram;
|
||||
clReleaseProgram_t *clReleaseProgram;
|
||||
clBuildProgram_t *clBuildProgram;
|
||||
#if __CL_HAS_ANON_UNION__
|
||||
__CL_ANON_UNION__ union {
|
||||
#endif
|
||||
clUnloadCompiler_t *clUnloadCompiler;
|
||||
#if __CL_HAS_ANON_UNION__
|
||||
/* Set to CL_ICD2_TAG_KHR for cl_khr_icd 2.0.0 */
|
||||
intptr_t clUnloadCompiler_icd2_tag;
|
||||
};
|
||||
#endif
|
||||
clGetProgramInfo_t *clGetProgramInfo;
|
||||
clGetProgramBuildInfo_t *clGetProgramBuildInfo;
|
||||
clCreateKernel_t *clCreateKernel;
|
||||
clCreateKernelsInProgram_t *clCreateKernelsInProgram;
|
||||
clRetainKernel_t *clRetainKernel;
|
||||
clReleaseKernel_t *clReleaseKernel;
|
||||
clSetKernelArg_t *clSetKernelArg;
|
||||
clGetKernelInfo_t *clGetKernelInfo;
|
||||
clGetKernelWorkGroupInfo_t *clGetKernelWorkGroupInfo;
|
||||
clWaitForEvents_t *clWaitForEvents;
|
||||
clGetEventInfo_t *clGetEventInfo;
|
||||
clRetainEvent_t *clRetainEvent;
|
||||
clReleaseEvent_t *clReleaseEvent;
|
||||
clGetEventProfilingInfo_t *clGetEventProfilingInfo;
|
||||
clFlush_t *clFlush;
|
||||
clFinish_t *clFinish;
|
||||
clEnqueueReadBuffer_t *clEnqueueReadBuffer;
|
||||
clEnqueueWriteBuffer_t *clEnqueueWriteBuffer;
|
||||
clEnqueueCopyBuffer_t *clEnqueueCopyBuffer;
|
||||
clEnqueueReadImage_t *clEnqueueReadImage;
|
||||
clEnqueueWriteImage_t *clEnqueueWriteImage;
|
||||
clEnqueueCopyImage_t *clEnqueueCopyImage;
|
||||
clEnqueueCopyImageToBuffer_t *clEnqueueCopyImageToBuffer;
|
||||
clEnqueueCopyBufferToImage_t *clEnqueueCopyBufferToImage;
|
||||
clEnqueueMapBuffer_t *clEnqueueMapBuffer;
|
||||
clEnqueueMapImage_t *clEnqueueMapImage;
|
||||
clEnqueueUnmapMemObject_t *clEnqueueUnmapMemObject;
|
||||
clEnqueueNDRangeKernel_t *clEnqueueNDRangeKernel;
|
||||
clEnqueueTask_t *clEnqueueTask;
|
||||
clEnqueueNativeKernel_t *clEnqueueNativeKernel;
|
||||
clEnqueueMarker_t *clEnqueueMarker;
|
||||
clEnqueueWaitForEvents_t *clEnqueueWaitForEvents;
|
||||
clEnqueueBarrier_t *clEnqueueBarrier;
|
||||
clGetExtensionFunctionAddress_t *clGetExtensionFunctionAddress;
|
||||
clCreateFromGLBuffer_t *clCreateFromGLBuffer;
|
||||
clCreateFromGLTexture2D_t *clCreateFromGLTexture2D;
|
||||
clCreateFromGLTexture3D_t *clCreateFromGLTexture3D;
|
||||
clCreateFromGLRenderbuffer_t *clCreateFromGLRenderbuffer;
|
||||
clGetGLObjectInfo_t *clGetGLObjectInfo;
|
||||
clGetGLTextureInfo_t *clGetGLTextureInfo;
|
||||
clEnqueueAcquireGLObjects_t *clEnqueueAcquireGLObjects;
|
||||
clEnqueueReleaseGLObjects_t *clEnqueueReleaseGLObjects;
|
||||
clGetGLContextInfoKHR_t *clGetGLContextInfoKHR;
|
||||
|
||||
/* cl_khr_d3d10_sharing */
|
||||
#ifdef _WIN32
|
||||
clGetDeviceIDsFromD3D10KHR_t *clGetDeviceIDsFromD3D10KHR;
|
||||
clCreateFromD3D10BufferKHR_t *clCreateFromD3D10BufferKHR;
|
||||
clCreateFromD3D10Texture2DKHR_t *clCreateFromD3D10Texture2DKHR;
|
||||
clCreateFromD3D10Texture3DKHR_t *clCreateFromD3D10Texture3DKHR;
|
||||
clEnqueueAcquireD3D10ObjectsKHR_t *clEnqueueAcquireD3D10ObjectsKHR;
|
||||
clEnqueueReleaseD3D10ObjectsKHR_t *clEnqueueReleaseD3D10ObjectsKHR;
|
||||
#else
|
||||
void *clGetDeviceIDsFromD3D10KHR;
|
||||
void *clCreateFromD3D10BufferKHR;
|
||||
void *clCreateFromD3D10Texture2DKHR;
|
||||
void *clCreateFromD3D10Texture3DKHR;
|
||||
void *clEnqueueAcquireD3D10ObjectsKHR;
|
||||
void *clEnqueueReleaseD3D10ObjectsKHR;
|
||||
#endif
|
||||
|
||||
/* OpenCL 1.1 */
|
||||
#ifdef CL_VERSION_1_1
|
||||
clSetEventCallback_t *clSetEventCallback;
|
||||
clCreateSubBuffer_t *clCreateSubBuffer;
|
||||
clSetMemObjectDestructorCallback_t *clSetMemObjectDestructorCallback;
|
||||
clCreateUserEvent_t *clCreateUserEvent;
|
||||
clSetUserEventStatus_t *clSetUserEventStatus;
|
||||
clEnqueueReadBufferRect_t *clEnqueueReadBufferRect;
|
||||
clEnqueueWriteBufferRect_t *clEnqueueWriteBufferRect;
|
||||
clEnqueueCopyBufferRect_t *clEnqueueCopyBufferRect;
|
||||
#else
|
||||
void *clSetEventCallback;
|
||||
void *clCreateSubBuffer;
|
||||
void *clSetMemObjectDestructorCallback;
|
||||
void *clCreateUserEvent;
|
||||
void *clSetUserEventStatus;
|
||||
void *clEnqueueReadBufferRect;
|
||||
void *clEnqueueWriteBufferRect;
|
||||
void *clEnqueueCopyBufferRect;
|
||||
#endif
|
||||
|
||||
/* cl_ext_device_fission */
|
||||
clCreateSubDevicesEXT_t *clCreateSubDevicesEXT;
|
||||
clRetainDeviceEXT_t *clRetainDeviceEXT;
|
||||
clReleaseDeviceEXT_t *clReleaseDeviceEXT;
|
||||
|
||||
/* cl_khr_gl_event */
|
||||
clCreateEventFromGLsyncKHR_t *clCreateEventFromGLsyncKHR;
|
||||
|
||||
/* OpenCL 1.2 */
|
||||
#ifdef CL_VERSION_1_2
|
||||
clCreateSubDevices_t *clCreateSubDevices;
|
||||
clRetainDevice_t *clRetainDevice;
|
||||
clReleaseDevice_t *clReleaseDevice;
|
||||
clCreateImage_t *clCreateImage;
|
||||
clCreateProgramWithBuiltInKernels_t *clCreateProgramWithBuiltInKernels;
|
||||
clCompileProgram_t *clCompileProgram;
|
||||
clLinkProgram_t *clLinkProgram;
|
||||
clUnloadPlatformCompiler_t *clUnloadPlatformCompiler;
|
||||
clGetKernelArgInfo_t *clGetKernelArgInfo;
|
||||
clEnqueueFillBuffer_t *clEnqueueFillBuffer;
|
||||
clEnqueueFillImage_t *clEnqueueFillImage;
|
||||
clEnqueueMigrateMemObjects_t *clEnqueueMigrateMemObjects;
|
||||
clEnqueueMarkerWithWaitList_t *clEnqueueMarkerWithWaitList;
|
||||
clEnqueueBarrierWithWaitList_t *clEnqueueBarrierWithWaitList;
|
||||
clGetExtensionFunctionAddressForPlatform_t *
|
||||
clGetExtensionFunctionAddressForPlatform;
|
||||
clCreateFromGLTexture_t *clCreateFromGLTexture;
|
||||
#else
|
||||
void *clCreateSubDevices;
|
||||
void *clRetainDevice;
|
||||
void *clReleaseDevice;
|
||||
void *clCreateImage;
|
||||
void *clCreateProgramWithBuiltInKernels;
|
||||
void *clCompileProgram;
|
||||
void *clLinkProgram;
|
||||
void *clUnloadPlatformCompiler;
|
||||
void *clGetKernelArgInfo;
|
||||
void *clEnqueueFillBuffer;
|
||||
void *clEnqueueFillImage;
|
||||
void *clEnqueueMigrateMemObjects;
|
||||
void *clEnqueueMarkerWithWaitList;
|
||||
void *clEnqueueBarrierWithWaitList;
|
||||
void *clGetExtensionFunctionAddressForPlatform;
|
||||
void *clCreateFromGLTexture;
|
||||
#endif
|
||||
|
||||
/* cl_khr_d3d11_sharing and cl_khr_dx9_media_sharing */
|
||||
#ifdef _WIN32
|
||||
clGetDeviceIDsFromD3D11KHR_t *clGetDeviceIDsFromD3D11KHR;
|
||||
clCreateFromD3D11BufferKHR_t *clCreateFromD3D11BufferKHR;
|
||||
clCreateFromD3D11Texture2DKHR_t *clCreateFromD3D11Texture2DKHR;
|
||||
clCreateFromD3D11Texture3DKHR_t *clCreateFromD3D11Texture3DKHR;
|
||||
clCreateFromDX9MediaSurfaceKHR_t *clCreateFromDX9MediaSurfaceKHR;
|
||||
clEnqueueAcquireD3D11ObjectsKHR_t *clEnqueueAcquireD3D11ObjectsKHR;
|
||||
clEnqueueReleaseD3D11ObjectsKHR_t *clEnqueueReleaseD3D11ObjectsKHR;
|
||||
clGetDeviceIDsFromDX9MediaAdapterKHR_t *
|
||||
clGetDeviceIDsFromDX9MediaAdapterKHR;
|
||||
clEnqueueAcquireDX9MediaSurfacesKHR_t *
|
||||
clEnqueueAcquireDX9MediaSurfacesKHR;
|
||||
clEnqueueReleaseDX9MediaSurfacesKHR_t *
|
||||
clEnqueueReleaseDX9MediaSurfacesKHR;
|
||||
#else
|
||||
void *clGetDeviceIDsFromD3D11KHR;
|
||||
void *clCreateFromD3D11BufferKHR;
|
||||
void *clCreateFromD3D11Texture2DKHR;
|
||||
void *clCreateFromD3D11Texture3DKHR;
|
||||
void *clCreateFromDX9MediaSurfaceKHR;
|
||||
void *clEnqueueAcquireD3D11ObjectsKHR;
|
||||
void *clEnqueueReleaseD3D11ObjectsKHR;
|
||||
void *clGetDeviceIDsFromDX9MediaAdapterKHR;
|
||||
void *clEnqueueAcquireDX9MediaSurfacesKHR;
|
||||
void *clEnqueueReleaseDX9MediaSurfacesKHR;
|
||||
#endif
|
||||
|
||||
/* cl_khr_egl_image */
|
||||
clCreateFromEGLImageKHR_t *clCreateFromEGLImageKHR;
|
||||
clEnqueueAcquireEGLObjectsKHR_t *clEnqueueAcquireEGLObjectsKHR;
|
||||
clEnqueueReleaseEGLObjectsKHR_t *clEnqueueReleaseEGLObjectsKHR;
|
||||
|
||||
/* cl_khr_egl_event */
|
||||
clCreateEventFromEGLSyncKHR_t *clCreateEventFromEGLSyncKHR;
|
||||
|
||||
/* OpenCL 2.0 */
|
||||
#ifdef CL_VERSION_2_0
|
||||
clCreateCommandQueueWithProperties_t *clCreateCommandQueueWithProperties;
|
||||
clCreatePipe_t *clCreatePipe;
|
||||
clGetPipeInfo_t *clGetPipeInfo;
|
||||
clSVMAlloc_t *clSVMAlloc;
|
||||
clSVMFree_t *clSVMFree;
|
||||
clEnqueueSVMFree_t *clEnqueueSVMFree;
|
||||
clEnqueueSVMMemcpy_t *clEnqueueSVMMemcpy;
|
||||
clEnqueueSVMMemFill_t *clEnqueueSVMMemFill;
|
||||
clEnqueueSVMMap_t *clEnqueueSVMMap;
|
||||
clEnqueueSVMUnmap_t *clEnqueueSVMUnmap;
|
||||
clCreateSamplerWithProperties_t *clCreateSamplerWithProperties;
|
||||
clSetKernelArgSVMPointer_t *clSetKernelArgSVMPointer;
|
||||
clSetKernelExecInfo_t *clSetKernelExecInfo;
|
||||
#else
|
||||
void *clCreateCommandQueueWithProperties;
|
||||
void *clCreatePipe;
|
||||
void *clGetPipeInfo;
|
||||
void *clSVMAlloc;
|
||||
void *clSVMFree;
|
||||
void *clEnqueueSVMFree;
|
||||
void *clEnqueueSVMMemcpy;
|
||||
void *clEnqueueSVMMemFill;
|
||||
void *clEnqueueSVMMap;
|
||||
void *clEnqueueSVMUnmap;
|
||||
void *clCreateSamplerWithProperties;
|
||||
void *clSetKernelArgSVMPointer;
|
||||
void *clSetKernelExecInfo;
|
||||
#endif
|
||||
|
||||
/* cl_khr_sub_groups */
|
||||
clGetKernelSubGroupInfoKHR_t *clGetKernelSubGroupInfoKHR;
|
||||
|
||||
/* OpenCL 2.1 */
|
||||
#ifdef CL_VERSION_2_1
|
||||
clCloneKernel_t *clCloneKernel;
|
||||
clCreateProgramWithIL_t *clCreateProgramWithIL;
|
||||
clEnqueueSVMMigrateMem_t *clEnqueueSVMMigrateMem;
|
||||
clGetDeviceAndHostTimer_t *clGetDeviceAndHostTimer;
|
||||
clGetHostTimer_t *clGetHostTimer;
|
||||
clGetKernelSubGroupInfo_t *clGetKernelSubGroupInfo;
|
||||
clSetDefaultDeviceCommandQueue_t *clSetDefaultDeviceCommandQueue;
|
||||
#else
|
||||
void *clCloneKernel;
|
||||
void *clCreateProgramWithIL;
|
||||
void *clEnqueueSVMMigrateMem;
|
||||
void *clGetDeviceAndHostTimer;
|
||||
void *clGetHostTimer;
|
||||
void *clGetKernelSubGroupInfo;
|
||||
void *clSetDefaultDeviceCommandQueue;
|
||||
#endif
|
||||
|
||||
/* OpenCL 2.2 */
|
||||
#ifdef CL_VERSION_2_2
|
||||
clSetProgramReleaseCallback_t *clSetProgramReleaseCallback;
|
||||
clSetProgramSpecializationConstant_t *clSetProgramSpecializationConstant;
|
||||
#else
|
||||
void *clSetProgramReleaseCallback;
|
||||
void *clSetProgramSpecializationConstant;
|
||||
#endif
|
||||
|
||||
/* OpenCL 3.0 */
|
||||
#ifdef CL_VERSION_3_0
|
||||
clCreateBufferWithProperties_t *clCreateBufferWithProperties;
|
||||
clCreateImageWithProperties_t *clCreateImageWithProperties;
|
||||
clSetContextDestructorCallback_t *clSetContextDestructorCallback;
|
||||
#else
|
||||
void *clCreateBufferWithProperties;
|
||||
void *clCreateImageWithProperties;
|
||||
void *clSetContextDestructorCallback;
|
||||
#endif
|
||||
|
||||
} cl_icd_dispatch;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && __CL_HAS_ANON_STRUCT__
|
||||
#pragma warning( pop )
|
||||
#endif
|
||||
|
||||
#endif /* #ifndef OPENCL_CL_ICD_H */
|
||||
@@ -0,0 +1,125 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_LAYER_H_
|
||||
#define OPENCL_CL_LAYER_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#include <CL/cl_icd.h>
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_loader_layers
|
||||
***************************************************************/
|
||||
#define cl_loader_layers 1
|
||||
#define CL_LOADER_LAYERS_EXTENSION_NAME \
|
||||
"cl_loader_layers"
|
||||
|
||||
|
||||
#define CL_LOADER_LAYERS_EXTENSION_VERSION CL_MAKE_VERSION(1, 0, 0)
|
||||
|
||||
typedef cl_uint cl_layer_info;
|
||||
typedef cl_uint cl_layer_api_version;
|
||||
|
||||
/* cl_layer_info */
|
||||
#define CL_LAYER_API_VERSION 0x4240
|
||||
#define CL_LAYER_NAME 0x4241
|
||||
|
||||
/* Misc API enums */
|
||||
#define CL_LAYER_API_VERSION_100 100
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetLayerInfo_t(
|
||||
cl_layer_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret);
|
||||
|
||||
typedef clGetLayerInfo_t *
|
||||
clGetLayerInfo_fn ;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clInitLayer_t(
|
||||
cl_uint num_entries,
|
||||
const cl_icd_dispatch* target_dispatch,
|
||||
cl_uint* num_entries_ret,
|
||||
const cl_icd_dispatch** layer_dispatch_ret);
|
||||
|
||||
typedef clInitLayer_t *
|
||||
clInitLayer_fn ;
|
||||
|
||||
/*
|
||||
** The function pointer typedefs prefixed with "pfn_" are provided for
|
||||
** compatibility with earlier versions of the headers. New code is
|
||||
** encouraged to use the function pointer typedefs that are suffixed with
|
||||
** "_fn" instead, for consistency.
|
||||
*/
|
||||
|
||||
typedef clGetLayerInfo_t *
|
||||
pfn_clGetLayerInfo ;
|
||||
|
||||
typedef clInitLayer_t *
|
||||
pfn_clInitLayer ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetLayerInfo(
|
||||
cl_layer_info param_name,
|
||||
size_t param_value_size,
|
||||
void* param_value,
|
||||
size_t* param_value_size_ret) ;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clInitLayer(
|
||||
cl_uint num_entries,
|
||||
const cl_icd_dispatch* target_dispatch,
|
||||
cl_uint* num_entries_ret,
|
||||
const cl_icd_dispatch** layer_dispatch_ret) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_LAYER_H_ */
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,220 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2023 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_
|
||||
#define OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_
|
||||
|
||||
/*
|
||||
** This header is generated from the Khronos OpenCL XML API Registry.
|
||||
*/
|
||||
|
||||
#include <va/va.h>
|
||||
|
||||
#include <CL/cl.h>
|
||||
|
||||
/* CL_NO_PROTOTYPES implies CL_NO_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_PROTOTYPES) && !defined(CL_NO_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
/* CL_NO_EXTENSION_PROTOTYPES implies
|
||||
CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES and
|
||||
CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES: */
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
#if defined(CL_NO_EXTENSION_PROTOTYPES) && \
|
||||
!defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
#define CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_sharing_format_query_va_api
|
||||
***************************************************************/
|
||||
#define cl_intel_sharing_format_query_va_api 1
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_VA_API_EXTENSION_NAME \
|
||||
"cl_intel_sharing_format_query_va_api"
|
||||
|
||||
|
||||
#define CL_INTEL_SHARING_FORMAT_QUERY_VA_API_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
/* when cl_intel_va_api_media_sharing is supported */
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetSupportedVA_APIMediaSurfaceFormatsINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
VAImageFormat* va_api_formats,
|
||||
cl_uint* num_surface_formats);
|
||||
|
||||
typedef clGetSupportedVA_APIMediaSurfaceFormatsINTEL_t *
|
||||
clGetSupportedVA_APIMediaSurfaceFormatsINTEL_fn ;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetSupportedVA_APIMediaSurfaceFormatsINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
cl_mem_object_type image_type,
|
||||
cl_uint plane,
|
||||
cl_uint num_entries,
|
||||
VAImageFormat* va_api_formats,
|
||||
cl_uint* num_surface_formats) ;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
/***************************************************************
|
||||
* cl_intel_va_api_media_sharing
|
||||
***************************************************************/
|
||||
#define cl_intel_va_api_media_sharing 1
|
||||
#define CL_INTEL_VA_API_MEDIA_SHARING_EXTENSION_NAME \
|
||||
"cl_intel_va_api_media_sharing"
|
||||
|
||||
|
||||
#define CL_INTEL_VA_API_MEDIA_SHARING_EXTENSION_VERSION CL_MAKE_VERSION(0, 0, 0)
|
||||
|
||||
typedef cl_uint cl_va_api_device_source_intel;
|
||||
typedef cl_uint cl_va_api_device_set_intel;
|
||||
|
||||
/* Error codes */
|
||||
#define CL_INVALID_VA_API_MEDIA_ADAPTER_INTEL -1098
|
||||
#define CL_INVALID_VA_API_MEDIA_SURFACE_INTEL -1099
|
||||
#define CL_VA_API_MEDIA_SURFACE_ALREADY_ACQUIRED_INTEL -1100
|
||||
#define CL_VA_API_MEDIA_SURFACE_NOT_ACQUIRED_INTEL -1101
|
||||
|
||||
/* cl_va_api_device_source_intel */
|
||||
#define CL_VA_API_DISPLAY_INTEL 0x4094
|
||||
|
||||
/* cl_va_api_device_set_intel */
|
||||
#define CL_PREFERRED_DEVICES_FOR_VA_API_INTEL 0x4095
|
||||
#define CL_ALL_DEVICES_FOR_VA_API_INTEL 0x4096
|
||||
|
||||
/* cl_context_info */
|
||||
#define CL_CONTEXT_VA_API_DISPLAY_INTEL 0x4097
|
||||
|
||||
/* cl_mem_info */
|
||||
#define CL_MEM_VA_API_MEDIA_SURFACE_INTEL 0x4098
|
||||
|
||||
/* cl_image_info */
|
||||
#define CL_IMAGE_VA_API_PLANE_INTEL 0x4099
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_ACQUIRE_VA_API_MEDIA_SURFACES_INTEL 0x409A
|
||||
#define CL_COMMAND_RELEASE_VA_API_MEDIA_SURFACES_INTEL 0x409B
|
||||
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromVA_APIMediaAdapterINTEL_t(
|
||||
cl_platform_id platform,
|
||||
cl_va_api_device_source_intel media_adapter_type,
|
||||
void* media_adapter,
|
||||
cl_va_api_device_set_intel media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices);
|
||||
|
||||
typedef clGetDeviceIDsFromVA_APIMediaAdapterINTEL_t *
|
||||
clGetDeviceIDsFromVA_APIMediaAdapterINTEL_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_mem CL_API_CALL
|
||||
clCreateFromVA_APIMediaSurfaceINTEL_t(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
VASurfaceID* surface,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret);
|
||||
|
||||
typedef clCreateFromVA_APIMediaSurfaceINTEL_t *
|
||||
clCreateFromVA_APIMediaSurfaceINTEL_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueAcquireVA_APIMediaSurfacesINTEL_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueAcquireVA_APIMediaSurfacesINTEL_t *
|
||||
clEnqueueAcquireVA_APIMediaSurfacesINTEL_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
typedef cl_int CL_API_CALL
|
||||
clEnqueueReleaseVA_APIMediaSurfacesINTEL_t(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event);
|
||||
|
||||
typedef clEnqueueReleaseVA_APIMediaSurfacesINTEL_t *
|
||||
clEnqueueReleaseVA_APIMediaSurfacesINTEL_fn CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#if !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES)
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clGetDeviceIDsFromVA_APIMediaAdapterINTEL(
|
||||
cl_platform_id platform,
|
||||
cl_va_api_device_source_intel media_adapter_type,
|
||||
void* media_adapter,
|
||||
cl_va_api_device_set_intel media_adapter_set,
|
||||
cl_uint num_entries,
|
||||
cl_device_id* devices,
|
||||
cl_uint* num_devices) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_mem CL_API_CALL
|
||||
clCreateFromVA_APIMediaSurfaceINTEL(
|
||||
cl_context context,
|
||||
cl_mem_flags flags,
|
||||
VASurfaceID* surface,
|
||||
cl_uint plane,
|
||||
cl_int* errcode_ret) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueAcquireVA_APIMediaSurfacesINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
extern CL_API_ENTRY cl_int CL_API_CALL
|
||||
clEnqueueReleaseVA_APIMediaSurfacesINTEL(
|
||||
cl_command_queue command_queue,
|
||||
cl_uint num_objects,
|
||||
const cl_mem* mem_objects,
|
||||
cl_uint num_events_in_wait_list,
|
||||
const cl_event* event_wait_list,
|
||||
cl_event* event) CL_API_SUFFIX__VERSION_1_2;
|
||||
|
||||
#endif /* !defined(CL_NO_NON_ICD_DISPATCH_EXTENSION_PROTOTYPES) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* OPENCL_CL_VA_API_MEDIA_SHARING_INTEL_H_ */
|
||||
@@ -0,0 +1,81 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2018-2020 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __CL_VERSION_H
|
||||
#define __CL_VERSION_H
|
||||
|
||||
/* Detect which version to target */
|
||||
#if !defined(CL_TARGET_OPENCL_VERSION)
|
||||
#pragma message("cl_version.h: CL_TARGET_OPENCL_VERSION is not defined. Defaulting to 300 (OpenCL 3.0)")
|
||||
#define CL_TARGET_OPENCL_VERSION 300
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION != 100 && \
|
||||
CL_TARGET_OPENCL_VERSION != 110 && \
|
||||
CL_TARGET_OPENCL_VERSION != 120 && \
|
||||
CL_TARGET_OPENCL_VERSION != 200 && \
|
||||
CL_TARGET_OPENCL_VERSION != 210 && \
|
||||
CL_TARGET_OPENCL_VERSION != 220 && \
|
||||
CL_TARGET_OPENCL_VERSION != 300
|
||||
#pragma message("cl_version: CL_TARGET_OPENCL_VERSION is not a valid value (100, 110, 120, 200, 210, 220, 300). Defaulting to 300 (OpenCL 3.0)")
|
||||
#undef CL_TARGET_OPENCL_VERSION
|
||||
#define CL_TARGET_OPENCL_VERSION 300
|
||||
#endif
|
||||
|
||||
|
||||
/* OpenCL Version */
|
||||
#if CL_TARGET_OPENCL_VERSION >= 300 && !defined(CL_VERSION_3_0)
|
||||
#define CL_VERSION_3_0 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 220 && !defined(CL_VERSION_2_2)
|
||||
#define CL_VERSION_2_2 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 210 && !defined(CL_VERSION_2_1)
|
||||
#define CL_VERSION_2_1 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 200 && !defined(CL_VERSION_2_0)
|
||||
#define CL_VERSION_2_0 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 120 && !defined(CL_VERSION_1_2)
|
||||
#define CL_VERSION_1_2 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 110 && !defined(CL_VERSION_1_1)
|
||||
#define CL_VERSION_1_1 1
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION >= 100 && !defined(CL_VERSION_1_0)
|
||||
#define CL_VERSION_1_0 1
|
||||
#endif
|
||||
|
||||
/* Allow deprecated APIs for older OpenCL versions. */
|
||||
#if CL_TARGET_OPENCL_VERSION <= 220 && !defined(CL_USE_DEPRECATED_OPENCL_2_2_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_2_2_APIS
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION <= 210 && !defined(CL_USE_DEPRECATED_OPENCL_2_1_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_2_1_APIS
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION <= 200 && !defined(CL_USE_DEPRECATED_OPENCL_2_0_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_2_0_APIS
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION <= 120 && !defined(CL_USE_DEPRECATED_OPENCL_1_2_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_2_APIS
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION <= 110 && !defined(CL_USE_DEPRECATED_OPENCL_1_1_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_1_APIS
|
||||
#endif
|
||||
#if CL_TARGET_OPENCL_VERSION <= 100 && !defined(CL_USE_DEPRECATED_OPENCL_1_0_APIS)
|
||||
#define CL_USE_DEPRECATED_OPENCL_1_0_APIS
|
||||
#endif
|
||||
|
||||
#endif /* __CL_VERSION_H */
|
||||
@@ -0,0 +1,32 @@
|
||||
/*******************************************************************************
|
||||
* Copyright (c) 2008-2021 The Khronos Group Inc.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef __OPENCL_H
|
||||
#define __OPENCL_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <CL/cl.h>
|
||||
#include <CL/cl_gl.h>
|
||||
#include <CL/cl_ext.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* __OPENCL_H */
|
||||
@@ -0,0 +1,396 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2025 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include "CL/cl.h"
|
||||
#include "CL/cl_ext.h"
|
||||
|
||||
/**********************************
|
||||
* Internal only queue properties *
|
||||
**********************************/
|
||||
// Intel evaluation now. Remove it after approval for public release
|
||||
#define CL_DEVICE_DRIVER_VERSION_INTEL 0x10010
|
||||
|
||||
#define CL_DEVICE_DRIVER_VERSION_INTEL_NEO1 0x454E4831 // Driver version is ENH1
|
||||
|
||||
/*********************************************
|
||||
* Internal only kernel exec info properties *
|
||||
*********************************************/
|
||||
|
||||
#define CL_KERNEL_EXEC_INFO_KERNEL_TYPE_INTEL 0x1000C
|
||||
#define CL_KERNEL_EXEC_INFO_DEFAULT_TYPE_INTEL 0x1000D
|
||||
#define CL_KERNEL_EXEC_INFO_CONCURRENT_TYPE_INTEL 0x1000E
|
||||
|
||||
/*********************************
|
||||
* cl_intel_debug_info extension *
|
||||
*********************************/
|
||||
#define cl_intel_debug_info 1
|
||||
|
||||
// New queries for clGetProgramInfo:
|
||||
#define CL_PROGRAM_DEBUG_INFO_INTEL 0x4100
|
||||
#define CL_PROGRAM_DEBUG_INFO_SIZES_INTEL 0x4101
|
||||
|
||||
// New queries for clGetKernelInfo:
|
||||
#define CL_KERNEL_BINARY_PROGRAM_INTEL 0x407D
|
||||
#define CL_KERNEL_BINARIES_INTEL 0x4102
|
||||
#define CL_KERNEL_BINARY_SIZES_INTEL 0x4103
|
||||
#define CL_KERNEL_BINARY_GPU_ADDRESS_INTEL 0x10010
|
||||
|
||||
/********************************************
|
||||
* event properties for performance counter *
|
||||
********************************************/
|
||||
/* performance counter */
|
||||
#define CL_PROFILING_COMMAND_PERFCOUNTERS_INTEL 0x407F
|
||||
|
||||
/**************************
|
||||
* Internal only cl types *
|
||||
**************************/
|
||||
|
||||
using cl_execution_info_kernel_type_intel = cl_uint;
|
||||
using cl_mem_flags_intel = cl_mem_flags;
|
||||
using cl_unified_shared_memory_capabilities_intel = cl_bitfield;
|
||||
|
||||
#if !defined(cl_intel_unified_shared_memory)
|
||||
using cl_mem_alloc_flags_intel = cl_bitfield;
|
||||
using cl_mem_properties_intel = cl_bitfield;
|
||||
using cl_mem_info_intel = cl_uint;
|
||||
using cl_mem_advice_intel = cl_uint;
|
||||
using cl_unified_shared_memory_type_intel = cl_uint;
|
||||
#endif
|
||||
|
||||
/******************************
|
||||
* Internal only cl_mem_flags *
|
||||
******************************/
|
||||
|
||||
#define CL_MEM_FLAGS_INTEL 0x10001
|
||||
#define CL_MEM_LOCALLY_UNCACHED_RESOURCE (1 << 18)
|
||||
#define CL_MEM_LOCALLY_UNCACHED_SURFACE_STATE_RESOURCE (1 << 25)
|
||||
#define CL_MEM_48BIT_RESOURCE_INTEL (1 << 26)
|
||||
|
||||
#define CL_MEM_DEVICE_ID_INTEL_DEPRECATED 0x10011
|
||||
|
||||
// Used with clEnqueueVerifyMemory
|
||||
#define CL_MEM_COMPARE_EQUAL 0u
|
||||
#define CL_MEM_COMPARE_NOT_EQUAL 1u
|
||||
|
||||
#define CL_MEM_FORCE_LINEAR_STORAGE_INTEL (1 << 19)
|
||||
#define CL_MEM_FORCE_HOST_MEMORY_INTEL (1 << 20)
|
||||
|
||||
#define CL_MEM_ALLOCATION_HANDLE_INTEL 0x10050
|
||||
#define CL_MEM_USES_COMPRESSION_INTEL 0x10051
|
||||
|
||||
// Used with createBuffer
|
||||
#define CL_MEM_ALLOW_UNRESTRICTED_SIZE_INTEL (1 << 23)
|
||||
|
||||
/******************************
|
||||
* UNIFIED MEMORY *
|
||||
*******************************/
|
||||
|
||||
#if !defined(cl_intel_unified_shared_memory)
|
||||
|
||||
/* cl_device_info */
|
||||
#define CL_DEVICE_HOST_MEM_CAPABILITIES_INTEL 0x4190
|
||||
#define CL_DEVICE_DEVICE_MEM_CAPABILITIES_INTEL 0x4191
|
||||
#define CL_DEVICE_SINGLE_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4192
|
||||
#define CL_DEVICE_CROSS_DEVICE_SHARED_MEM_CAPABILITIES_INTEL 0x4193
|
||||
#define CL_DEVICE_SHARED_SYSTEM_MEM_CAPABILITIES_INTEL 0x4194
|
||||
|
||||
/* cl_unified_shared_memory_capabilities_intel - bitfield */
|
||||
#define CL_UNIFIED_SHARED_MEMORY_ACCESS_INTEL (1 << 0)
|
||||
#define CL_UNIFIED_SHARED_MEMORY_ATOMIC_ACCESS_INTEL (1 << 1)
|
||||
#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ACCESS_INTEL (1 << 2)
|
||||
#define CL_UNIFIED_SHARED_MEMORY_CONCURRENT_ATOMIC_ACCESS_INTEL (1 << 3)
|
||||
|
||||
/* cl_mem_properties_intel */
|
||||
#define CL_MEM_ALLOC_FLAGS_INTEL 0x4195
|
||||
#define CL_MEM_ALLOC_USE_HOST_PTR_INTEL 0x1000F
|
||||
|
||||
/* cl_mem_alloc_flags_intel - bitfield */
|
||||
#define CL_MEM_ALLOC_WRITE_COMBINED_INTEL (1 << 0)
|
||||
#define CL_MEM_ALLOC_INITIAL_PLACEMENT_DEVICE_INTEL (1 << 1)
|
||||
#define CL_MEM_ALLOC_INITIAL_PLACEMENT_HOST_INTEL (1 << 2)
|
||||
|
||||
/* cl_mem_alloc_info_intel */
|
||||
#define CL_MEM_ALLOC_TYPE_INTEL 0x419A
|
||||
#define CL_MEM_ALLOC_BASE_PTR_INTEL 0x419B
|
||||
#define CL_MEM_ALLOC_SIZE_INTEL 0x419C
|
||||
#define CL_MEM_ALLOC_DEVICE_INTEL 0x419D
|
||||
|
||||
/* cl_unified_shared_memory_type_intel */
|
||||
#define CL_MEM_TYPE_UNKNOWN_INTEL 0x4196
|
||||
#define CL_MEM_TYPE_HOST_INTEL 0x4197
|
||||
#define CL_MEM_TYPE_DEVICE_INTEL 0x4198
|
||||
#define CL_MEM_TYPE_SHARED_INTEL 0x4199
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_MEMFILL_INTEL 0x4204
|
||||
#define CL_COMMAND_MEMCPY_INTEL 0x4205
|
||||
#define CL_COMMAND_MIGRATEMEM_INTEL 0x4206
|
||||
#define CL_COMMAND_MEMADVISE_INTEL 0x4207
|
||||
|
||||
#endif
|
||||
|
||||
/* cl_mem_alloc_flags_intel - bitfield */
|
||||
#define CL_MEM_ALLOC_DEFAULT_INTEL 0
|
||||
|
||||
/* cl_mem_properties_intel */
|
||||
#define CL_MEM_ALLOC_USE_HOST_PTR_INTEL 0x1000F
|
||||
|
||||
/* cl_command_type */
|
||||
#define CL_COMMAND_MEMSET_INTEL 0x4204
|
||||
|
||||
/******************************
|
||||
* THREAD ARBITRATION POLICY *
|
||||
*******************************/
|
||||
|
||||
/* cl_device_info */
|
||||
#define CL_DEVICE_SUPPORTED_THREAD_ARBITRATION_POLICY_INTEL 0x4208
|
||||
|
||||
/* cl_kernel_exec_info */
|
||||
#if !defined(cl_intel_unified_shared_memory)
|
||||
#define CL_KERNEL_EXEC_INFO_INDIRECT_HOST_ACCESS_INTEL 0x4200
|
||||
#define CL_KERNEL_EXEC_INFO_INDIRECT_DEVICE_ACCESS_INTEL 0x4201
|
||||
#define CL_KERNEL_EXEC_INFO_INDIRECT_SHARED_ACCESS_INTEL 0x4202
|
||||
#define CL_KERNEL_EXEC_INFO_USM_PTRS_INTEL 0x4203
|
||||
#endif
|
||||
|
||||
#define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_OLDEST_FIRST_INTEL 0x10022
|
||||
#define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_ROUND_ROBIN_INTEL 0x10023
|
||||
#define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_AFTER_DEPENDENCY_ROUND_ROBIN_INTEL 0x10024
|
||||
#define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_INTEL 0x10025
|
||||
#define CL_KERNEL_EXEC_INFO_THREAD_ARBITRATION_POLICY_STALL_BASED_ROUND_ROBIN_INTEL 0x10026
|
||||
|
||||
/******************************
|
||||
* SLICE COUNT SELECTING *
|
||||
*******************************/
|
||||
|
||||
/* cl_device_info */
|
||||
#define CL_DEVICE_SLICE_COUNT_INTEL 0x10020
|
||||
|
||||
/* cl_queue_properties */
|
||||
#define CL_QUEUE_SLICE_COUNT_INTEL 0x10021
|
||||
|
||||
/******************************
|
||||
* QUEUE FAMILY SELECTING *
|
||||
*******************************/
|
||||
|
||||
#if !defined(cl_intel_command_queue_families)
|
||||
|
||||
/* cl_device_info */
|
||||
#define CL_DEVICE_QUEUE_FAMILY_PROPERTIES_INTEL 0x418B
|
||||
|
||||
/* cl_queue_properties */
|
||||
#define CL_QUEUE_FAMILY_INTEL 0x418C
|
||||
#define CL_QUEUE_INDEX_INTEL 0x418D
|
||||
|
||||
/* cl_command_queue_capabilities_intel */
|
||||
#define CL_QUEUE_DEFAULT_CAPABILITIES_INTEL 0
|
||||
#define CL_QUEUE_CAPABILITY_CREATE_SINGLE_QUEUE_EVENTS_INTEL (1 << 0)
|
||||
#define CL_QUEUE_CAPABILITY_CREATE_CROSS_QUEUE_EVENTS_INTEL (1 << 1)
|
||||
#define CL_QUEUE_CAPABILITY_SINGLE_QUEUE_EVENT_WAIT_LIST_INTEL (1 << 2)
|
||||
#define CL_QUEUE_CAPABILITY_CROSS_QUEUE_EVENT_WAIT_LIST_INTEL (1 << 3)
|
||||
#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_INTEL (1 << 8)
|
||||
#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_RECT_INTEL (1 << 9)
|
||||
#define CL_QUEUE_CAPABILITY_MAP_BUFFER_INTEL (1 << 10)
|
||||
#define CL_QUEUE_CAPABILITY_FILL_BUFFER_INTEL (1 << 11)
|
||||
#define CL_QUEUE_CAPABILITY_TRANSFER_IMAGE_INTEL (1 << 12)
|
||||
#define CL_QUEUE_CAPABILITY_MAP_IMAGE_INTEL (1 << 13)
|
||||
#define CL_QUEUE_CAPABILITY_FILL_IMAGE_INTEL (1 << 14)
|
||||
#define CL_QUEUE_CAPABILITY_TRANSFER_BUFFER_IMAGE_INTEL (1 << 15)
|
||||
#define CL_QUEUE_CAPABILITY_TRANSFER_IMAGE_BUFFER_INTEL (1 << 16)
|
||||
#define CL_QUEUE_CAPABILITY_MARKER_INTEL (1 << 24)
|
||||
#define CL_QUEUE_CAPABILITY_BARRIER_INTEL (1 << 25)
|
||||
#define CL_QUEUE_CAPABILITY_KERNEL_INTEL (1 << 26)
|
||||
|
||||
typedef cl_bitfield cl_command_queue_capabilities_intel;
|
||||
|
||||
#define CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL 64
|
||||
typedef struct _cl_queue_family_properties_intel {
|
||||
cl_command_queue_properties properties;
|
||||
cl_command_queue_capabilities_intel capabilities;
|
||||
cl_uint count;
|
||||
char name[CL_QUEUE_FAMILY_MAX_NAME_SIZE_INTEL];
|
||||
} cl_queue_family_properties_intel;
|
||||
|
||||
#endif
|
||||
|
||||
/******************************
|
||||
* DEVICE ATTRIBUTE QUERY *
|
||||
*******************************/
|
||||
|
||||
#if !defined(cl_intel_device_attribute_query)
|
||||
|
||||
/* For GPU devices, version 1.0.0: */
|
||||
#define CL_DEVICE_IP_VERSION_INTEL 0x4250
|
||||
#define CL_DEVICE_ID_INTEL 0x4251
|
||||
#define CL_DEVICE_NUM_SLICES_INTEL 0x4252
|
||||
#define CL_DEVICE_NUM_SUB_SLICES_PER_SLICE_INTEL 0x4253
|
||||
#define CL_DEVICE_NUM_EUS_PER_SUB_SLICE_INTEL 0x4254
|
||||
#define CL_DEVICE_NUM_THREADS_PER_EU_INTEL 0x4255
|
||||
#define CL_DEVICE_FEATURE_CAPABILITIES_INTEL 0x4256
|
||||
|
||||
typedef cl_bitfield cl_device_feature_capabilities_intel;
|
||||
|
||||
/* For GPU devices, version 1.0.0: */
|
||||
#define CL_DEVICE_FEATURE_FLAG_DP4A_INTEL (1 << 0)
|
||||
#define CL_DEVICE_FEATURE_FLAG_DPAS_INTEL (1 << 1)
|
||||
|
||||
#endif
|
||||
|
||||
////// RESOURCE BARRIER EXT
|
||||
#define CL_COMMAND_RESOURCE_BARRIER 0x10010
|
||||
|
||||
typedef cl_uint cl_resource_barrier_type;
|
||||
#define CL_RESOURCE_BARRIER_TYPE_ACQUIRE 0x1 // FLUSH+EVICT
|
||||
#define CL_RESOURCE_BARRIER_TYPE_RELEASE 0x2 // FLUSH
|
||||
#define CL_RESOURCE_BARRIER_TYPE_DISCARD 0x3 // DISCARD
|
||||
|
||||
typedef cl_uint cl_resource_memory_scope;
|
||||
#define CL_MEMORY_SCOPE_DEVICE 0x0 // INCLUDES CROSS-TILE
|
||||
#define CL_MEMORY_SCOPE_ALL_SVM_DEVICES 0x1 // CL_MEMORY_SCOPE_DEVICE + CROSS-DEVICE
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef struct _cl_resource_barrier_descriptor_intel {
|
||||
void *svmAllocationPointer;
|
||||
cl_mem memObject;
|
||||
cl_resource_barrier_type type;
|
||||
cl_resource_memory_scope scope;
|
||||
} cl_resource_barrier_descriptor_intel;
|
||||
#pragma pack(pop)
|
||||
|
||||
/****************************************
|
||||
* cl_khr_pci_bus_info extension *
|
||||
***************************************/
|
||||
|
||||
#if !defined(cl_khr_pci_bus_info)
|
||||
|
||||
#define cl_khr_pci_bus_info 1
|
||||
|
||||
// New queries for clGetDeviceInfo:
|
||||
#define CL_DEVICE_PCI_BUS_INFO_KHR 0x410F
|
||||
|
||||
typedef struct _cl_device_pci_bus_info_khr {
|
||||
cl_uint pci_domain;
|
||||
cl_uint pci_bus;
|
||||
cl_uint pci_device;
|
||||
cl_uint pci_function;
|
||||
} cl_device_pci_bus_info_khr;
|
||||
|
||||
#endif
|
||||
|
||||
/************************************************
|
||||
* cl_intel_mem_compression_hints extension *
|
||||
*************************************************/
|
||||
#define CL_MEM_COMPRESSED_HINT_INTEL (1u << 21)
|
||||
#define CL_MEM_UNCOMPRESSED_HINT_INTEL (1u << 22)
|
||||
|
||||
// New query for clGetDeviceInfo:
|
||||
#define CL_MEM_COMPRESSED_INTEL 0x417D
|
||||
|
||||
/* cl_queue_properties */
|
||||
#define CL_QUEUE_MDAPI_PROPERTIES_INTEL 0x425E
|
||||
#define CL_QUEUE_MDAPI_CONFIGURATION_INTEL 0x425F
|
||||
|
||||
typedef cl_bitfield cl_command_queue_mdapi_properties_intel;
|
||||
|
||||
/* cl_command_queue_mdapi_properties_intel - bitfield */
|
||||
#define CL_QUEUE_MDAPI_ENABLE_INTEL (1 << 0)
|
||||
|
||||
/************************************************
|
||||
* cl_khr_external_memory extension *
|
||||
*************************************************/
|
||||
|
||||
#if !defined(cl_khr_external_memory)
|
||||
|
||||
/* clGetPlatformInfo */
|
||||
#define CL_PLATFORM_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR 0x2044
|
||||
|
||||
/* clGetDeviceInfo */
|
||||
#define CL_DEVICE_EXTERNAL_MEMORY_IMPORT_HANDLE_TYPES_KHR 0x204F
|
||||
|
||||
/* clCreateBufferWithProperties and clCreateImageWithProperties */
|
||||
#define CL_DEVICE_HANDLE_LIST_KHR 0x2051
|
||||
#define CL_DEVICE_HANDLE_LIST_END_KHR 0
|
||||
|
||||
#endif
|
||||
|
||||
#if !defined(cl_khr_external_memory_opaque_fd)
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_FD_KHR 0x2060
|
||||
#endif
|
||||
|
||||
#if !defined(cl_khr_external_memory_win32)
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KHR 0x2061
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_OPAQUE_WIN32_KMT_KHR 0x2062
|
||||
#endif
|
||||
|
||||
#if !defined(cl_khr_external_memory_dx)
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KHR 0x2063
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_D3D11_TEXTURE_KMT_KHR 0x2064
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_D3D12_HEAP_KHR 0x2065
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_D3D12_RESOURCE_KHR 0x2066
|
||||
#endif
|
||||
|
||||
#if !defined(cl_khr_external_memory_dma_buf)
|
||||
#define CL_EXTERNAL_MEMORY_HANDLE_DMA_BUF_KHR 0x2067
|
||||
#endif
|
||||
|
||||
// cl_intel_variable_eu_thread_count
|
||||
#define CL_DEVICE_EU_THREAD_COUNTS_INTEL 0x1000A // placeholder
|
||||
#define CL_KERNEL_EU_THREAD_COUNT_INTEL 0x1000B // placeholder
|
||||
|
||||
#if !defined(cl_intel_maximum_registers)
|
||||
#define CL_KERNEL_REGISTER_COUNT_INTEL 0x425B
|
||||
#endif
|
||||
|
||||
/*************************************************
|
||||
* cl_khr_spirv_queries extension *
|
||||
*************************************************/
|
||||
|
||||
#ifndef cl_khr_spirv_queries
|
||||
#define cl_khr_spirv_queries 1
|
||||
#define CL_KHR_SPIRV_QUERIES_EXTENSION_NAME "cl_khr_spirv_queries"
|
||||
#define CL_DEVICE_SPIRV_EXTENDED_INSTRUCTION_SETS_KHR 0x12B9
|
||||
#define CL_DEVICE_SPIRV_EXTENSIONS_KHR 0x12BA
|
||||
#define CL_DEVICE_SPIRV_CAPABILITIES_KHR 0x12BB
|
||||
#endif
|
||||
|
||||
/*************************************************
|
||||
* cl_ext_float_atomics extension *
|
||||
*************************************************/
|
||||
|
||||
#if !defined(cl_ext_float_atomics)
|
||||
|
||||
#define cl_ext_float_atomics 1
|
||||
|
||||
#define CL_DEVICE_SINGLE_FP_ATOMIC_CAPABILITIES_EXT 0x4231
|
||||
#define CL_DEVICE_DOUBLE_FP_ATOMIC_CAPABILITIES_EXT 0x4232
|
||||
#define CL_DEVICE_HALF_FP_ATOMIC_CAPABILITIES_EXT 0x4233
|
||||
|
||||
typedef cl_bitfield cl_device_fp_atomic_capabilities_ext;
|
||||
|
||||
#define CL_DEVICE_GLOBAL_FP_ATOMIC_LOAD_STORE_EXT (1 << 0)
|
||||
#define CL_DEVICE_GLOBAL_FP_ATOMIC_ADD_EXT (1 << 1)
|
||||
#define CL_DEVICE_GLOBAL_FP_ATOMIC_MIN_MAX_EXT (1 << 2)
|
||||
|
||||
/* bits 3 - 15 are currently unused */
|
||||
|
||||
#define CL_DEVICE_LOCAL_FP_ATOMIC_LOAD_STORE_EXT (1 << 16)
|
||||
#define CL_DEVICE_LOCAL_FP_ATOMIC_ADD_EXT (1 << 17)
|
||||
#define CL_DEVICE_LOCAL_FP_ATOMIC_MIN_MAX_EXT (1 << 18)
|
||||
|
||||
/* bits 19 and beyond are currently unused */
|
||||
|
||||
#endif
|
||||
|
||||
/*************************************************
|
||||
* CL_PLATFORM_UNLOADABLE_KHR *
|
||||
*************************************************/
|
||||
|
||||
#if !defined(CL_PLATFORM_UNLOADABLE_KHR)
|
||||
#define CL_PLATFORM_UNLOADABLE_KHR 0x0921
|
||||
#endif
|
||||
@@ -0,0 +1,342 @@
|
||||
#ifndef __egl_h_
|
||||
#define __egl_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
**
|
||||
** This header is generated from the Khronos EGL 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.khronos.org/registry/egl
|
||||
**
|
||||
** Khronos $Git commit SHA1: f4cc936b88 $ on $Git commit date: 2023-12-16 01:21:49 -0500 $
|
||||
*/
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
#ifndef EGL_EGL_PROTOTYPES
|
||||
#define EGL_EGL_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20231215 */
|
||||
|
||||
/* 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 void *EGLDisplay;
|
||||
#include <KHR/khrplatform.h>
|
||||
#include <EGL/eglplatform.h>
|
||||
typedef void *EGLConfig;
|
||||
typedef void *EGLSurface;
|
||||
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 EGL_CAST(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 EGL_CAST(EGLContext,0)
|
||||
#define EGL_NO_DISPLAY EGL_CAST(EGLDisplay,0)
|
||||
#define EGL_NO_SURFACE EGL_CAST(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
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCHOOSECONFIGPROC) (EGLDisplay dpy, const EGLint *attrib_list, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLCOPYBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target);
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLCREATECONTEXTPROC) (EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERSURFACEPROC) (EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGATTRIBPROC) (EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETCONFIGSPROC) (EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETCURRENTDISPLAYPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLGETCURRENTSURFACEPROC) (EGLint readdraw);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETDISPLAYPROC) (EGLNativeDisplayType display_id);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLGETERRORPROC) (void);
|
||||
typedef __eglMustCastToProperFunctionPointerType (EGLAPIENTRYP PFNEGLGETPROCADDRESSPROC) (const char *procname);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLINITIALIZEPROC) (EGLDisplay dpy, EGLint *major, EGLint *minor);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLMAKECURRENTPROC) (EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYCONTEXTPROC) (EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value);
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGPROC) (EGLDisplay dpy, EGLint name);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYSURFACEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSPROC) (EGLDisplay dpy, EGLSurface surface);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLTERMINATEPROC) (EGLDisplay dpy);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITGLPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITNATIVEPROC) (EGLint engine);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
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
|
||||
#endif /* EGL_VERSION_1_0 */
|
||||
|
||||
#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
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDTEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETEXIMAGEPROC) (EGLDisplay dpy, EGLSurface surface, EGLint buffer);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSURFACEATTRIBPROC) (EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPINTERVALPROC) (EGLDisplay dpy, EGLint interval);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
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
|
||||
#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 EGL_CAST(EGLint,-1)
|
||||
#define EGL_VERTICAL_RESOLUTION 0x3091
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDAPIPROC) (EGLenum api);
|
||||
typedef EGLenum (EGLAPIENTRYP PFNEGLQUERYAPIPROC) (void);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPBUFFERFROMCLIENTBUFFERPROC) (EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLRELEASETHREADPROC) (void);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITCLIENTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
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
|
||||
#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 EGL_CAST(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
|
||||
typedef EGLContext (EGLAPIENTRYP PFNEGLGETCURRENTCONTEXTPROC) (void);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
EGLAPI EGLContext EGLAPIENTRY eglGetCurrentContext (void);
|
||||
#endif
|
||||
#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 EGL_CAST(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 EGL_CAST(EGLImage,0)
|
||||
typedef EGLSync (EGLAPIENTRYP PFNEGLCREATESYNCPROC) (EGLDisplay dpy, EGLenum type, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYSYNCPROC) (EGLDisplay dpy, EGLSync sync);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLCLIENTWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags, EGLTime timeout);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCATTRIBPROC) (EGLDisplay dpy, EGLSync sync, EGLint attribute, EGLAttrib *value);
|
||||
typedef EGLImage (EGLAPIENTRYP PFNEGLCREATEIMAGEPROC) (EGLDisplay dpy, EGLContext ctx, EGLenum target, EGLClientBuffer buffer, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLDESTROYIMAGEPROC) (EGLDisplay dpy, EGLImage image);
|
||||
typedef EGLDisplay (EGLAPIENTRYP PFNEGLGETPLATFORMDISPLAYPROC) (EGLenum platform, void *native_display, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMWINDOWSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_window, const EGLAttrib *attrib_list);
|
||||
typedef EGLSurface (EGLAPIENTRYP PFNEGLCREATEPLATFORMPIXMAPSURFACEPROC) (EGLDisplay dpy, EGLConfig config, void *native_pixmap, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLWAITSYNCPROC) (EGLDisplay dpy, EGLSync sync, EGLint flags);
|
||||
#if EGL_EGL_PROTOTYPES
|
||||
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
|
||||
#endif /* EGL_VERSION_1_5 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,433 @@
|
||||
//
|
||||
// Copyright 2017 The ANGLE Project Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
//
|
||||
// eglext_angle.h: ANGLE modifications to the eglext.h header file.
|
||||
// Currently we don't include this file directly, we patch eglext.h
|
||||
// to include it implicitly so it is visible throughout our code.
|
||||
|
||||
#ifndef INCLUDE_EGL_EGLEXT_ANGLE_
|
||||
#define INCLUDE_EGL_EGLEXT_ANGLE_
|
||||
|
||||
// clang-format off
|
||||
|
||||
#ifndef EGL_ANGLE_robust_resource_initialization
|
||||
#define EGL_ANGLE_robust_resource_initialization 1
|
||||
#define EGL_ROBUST_RESOURCE_INITIALIZATION_ANGLE 0x3453
|
||||
#endif /* EGL_ANGLE_robust_resource_initialization */
|
||||
|
||||
#ifndef EGL_ANGLE_keyed_mutex
|
||||
#define EGL_ANGLE_keyed_mutex 1
|
||||
#define EGL_DXGI_KEYED_MUTEX_ANGLE 0x33A2
|
||||
#endif /* EGL_ANGLE_keyed_mutex */
|
||||
|
||||
#ifndef EGL_ANGLE_d3d_texture_client_buffer
|
||||
#define EGL_ANGLE_d3d_texture_client_buffer 1
|
||||
#define EGL_D3D_TEXTURE_ANGLE 0x33A3
|
||||
#define EGL_TEXTURE_OFFSET_X_ANGLE 0x3490
|
||||
#define EGL_TEXTURE_OFFSET_Y_ANGLE 0x3491
|
||||
#define EGL_D3D11_TEXTURE_PLANE_ANGLE 0x3492
|
||||
#define EGL_D3D11_TEXTURE_ARRAY_SLICE_ANGLE 0x3493
|
||||
#endif /* EGL_ANGLE_d3d_texture_client_buffer */
|
||||
|
||||
#ifndef EGL_ANGLE_software_display
|
||||
#define EGL_ANGLE_software_display 1
|
||||
#define EGL_SOFTWARE_DISPLAY_ANGLE ((EGLNativeDisplayType)-1)
|
||||
#endif /* EGL_ANGLE_software_display */
|
||||
|
||||
#ifndef EGL_ANGLE_direct3d_display
|
||||
#define EGL_ANGLE_direct3d_display 1
|
||||
#define EGL_D3D11_ELSE_D3D9_DISPLAY_ANGLE ((EGLNativeDisplayType)-2)
|
||||
#define EGL_D3D11_ONLY_DISPLAY_ANGLE ((EGLNativeDisplayType)-3)
|
||||
#endif /* EGL_ANGLE_direct3d_display */
|
||||
|
||||
#ifndef EGL_ANGLE_direct_composition
|
||||
#define EGL_ANGLE_direct_composition 1
|
||||
#define EGL_DIRECT_COMPOSITION_ANGLE 0x33A5
|
||||
#endif /* EGL_ANGLE_direct_composition */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle
|
||||
#define EGL_ANGLE_platform_angle 1
|
||||
#define EGL_PLATFORM_ANGLE_ANGLE 0x3202
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_ANGLE 0x3203
|
||||
#define EGL_PLATFORM_ANGLE_MAX_VERSION_MAJOR_ANGLE 0x3204
|
||||
#define EGL_PLATFORM_ANGLE_MAX_VERSION_MINOR_ANGLE 0x3205
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_DEFAULT_ANGLE 0x3206
|
||||
#define EGL_PLATFORM_ANGLE_DEBUG_LAYERS_ENABLED_ANGLE 0x3451
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_ANGLE 0x3209
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_HARDWARE_ANGLE 0x320A
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_NULL_ANGLE 0x345E
|
||||
#define EGL_PLATFORM_ANGLE_NATIVE_PLATFORM_TYPE_ANGLE 0x348F
|
||||
#endif /* EGL_ANGLE_platform_angle */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_d3d
|
||||
#define EGL_ANGLE_platform_angle_d3d 1
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_D3D9_ANGLE 0x3207
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_D3D11_ANGLE 0x3208
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_WARP_ANGLE 0x320B
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_D3D_REFERENCE_ANGLE 0x320C
|
||||
#define EGL_PLATFORM_ANGLE_ENABLE_AUTOMATIC_TRIM_ANGLE 0x320F
|
||||
#endif /* EGL_ANGLE_platform_angle_d3d */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_d3d_luid
|
||||
#define EGL_ANGLE_platform_angle_d3d_luid 1
|
||||
#define EGL_PLATFORM_ANGLE_D3D_LUID_HIGH_ANGLE 0x34A0
|
||||
#define EGL_PLATFORM_ANGLE_D3D_LUID_LOW_ANGLE 0x34A1
|
||||
#endif /* EGL_ANGLE_platform_angle_d3d_luid */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_d3d11on12
|
||||
#define EGL_ANGLE_platform_angle_d3d11on12 1
|
||||
#define EGL_PLATFORM_ANGLE_D3D11ON12_ANGLE 0x3488
|
||||
#endif /* EGL_ANGLE_platform_angle_d3d11on12 */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_opengl
|
||||
#define EGL_ANGLE_platform_angle_opengl 1
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_OPENGL_ANGLE 0x320D
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_OPENGLES_ANGLE 0x320E
|
||||
#define EGL_PLATFORM_ANGLE_EGL_HANDLE_ANGLE 0x3480
|
||||
#endif /* EGL_ANGLE_platform_angle_opengl */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_null
|
||||
#define EGL_ANGLE_platform_angle_null 1
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_NULL_ANGLE 0x33AE
|
||||
#endif /* EGL_ANGLE_platform_angle_null */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_vulkan
|
||||
#define EGL_ANGLE_platform_angle_vulkan 1
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_VULKAN_ANGLE 0x3450
|
||||
#define EGL_PLATFORM_VULKAN_DISPLAY_MODE_SIMPLE_ANGLE 0x34A4
|
||||
#define EGL_PLATFORM_VULKAN_DISPLAY_MODE_HEADLESS_ANGLE 0x34A5
|
||||
#endif /* EGL_ANGLE_platform_angle_vulkan */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_metal
|
||||
#define EGL_ANGLE_platform_angle_metal 1
|
||||
#define EGL_PLATFORM_ANGLE_TYPE_METAL_ANGLE 0x3489
|
||||
#endif /* EGL_ANGLE_platform_angle_metal */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_device_type_swiftshader
|
||||
#define EGL_ANGLE_platform_angle_device_type_swiftshader
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_SWIFTSHADER_ANGLE 0x3487
|
||||
#endif /* EGL_ANGLE_platform_angle_device_type_swiftshader */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_device_type_egl_angle
|
||||
#define EGL_ANGLE_platform_angle_device_type_egl_angle
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_TYPE_EGL_ANGLE 0x348E
|
||||
#endif /* EGL_ANGLE_platform_angle_device_type_egl_angle */
|
||||
|
||||
#ifndef EGL_ANGLE_context_virtualization
|
||||
#define EGL_ANGLE_context_virtualization 1
|
||||
#define EGL_CONTEXT_VIRTUALIZATION_GROUP_ANGLE 0x3481
|
||||
#endif /* EGL_ANGLE_context_virtualization */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_device_context_volatile_eagl
|
||||
#define EGL_ANGLE_platform_angle_device_context_volatile_eagl 1
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_CONTEXT_VOLATILE_EAGL_ANGLE 0x34A2
|
||||
#endif /* EGL_ANGLE_platform_angle_device_context_volatile_eagl */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_device_context_volatile_cgl
|
||||
#define EGL_ANGLE_platform_angle_device_context_volatile_cgl 1
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_CONTEXT_VOLATILE_CGL_ANGLE 0x34A3
|
||||
#endif /* EGL_ANGLE_platform_angle_device_context_volatile_cgl */
|
||||
|
||||
#ifndef EGL_ANGLE_platform_angle_device_id
|
||||
#define EGL_ANGLE_platform_angle_device_id
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_ID_HIGH_ANGLE 0x34D6
|
||||
#define EGL_PLATFORM_ANGLE_DEVICE_ID_LOW_ANGLE 0x34D7
|
||||
#define EGL_PLATFORM_ANGLE_DISPLAY_KEY_ANGLE 0x34DC
|
||||
#endif /* EGL_ANGLE_platform_angle_device_id */
|
||||
|
||||
#ifndef EGL_ANGLE_x11_visual
|
||||
#define EGL_ANGLE_x11_visual
|
||||
#define EGL_X11_VISUAL_ID_ANGLE 0x33A3
|
||||
#endif /* EGL_ANGLE_x11_visual */
|
||||
|
||||
#ifndef EGL_ANGLE_surface_orientation
|
||||
#define EGL_ANGLE_surface_orientation
|
||||
#define EGL_OPTIMAL_SURFACE_ORIENTATION_ANGLE 0x33A7
|
||||
#define EGL_SURFACE_ORIENTATION_ANGLE 0x33A8
|
||||
#define EGL_SURFACE_ORIENTATION_INVERT_X_ANGLE 0x0001
|
||||
#define EGL_SURFACE_ORIENTATION_INVERT_Y_ANGLE 0x0002
|
||||
#endif /* EGL_ANGLE_surface_orientation */
|
||||
|
||||
#ifndef EGL_ANGLE_experimental_present_path
|
||||
#define EGL_ANGLE_experimental_present_path
|
||||
#define EGL_EXPERIMENTAL_PRESENT_PATH_ANGLE 0x33A4
|
||||
#define EGL_EXPERIMENTAL_PRESENT_PATH_FAST_ANGLE 0x33A9
|
||||
#define EGL_EXPERIMENTAL_PRESENT_PATH_COPY_ANGLE 0x33AA
|
||||
#endif /* EGL_ANGLE_experimental_present_path */
|
||||
|
||||
#ifndef EGL_ANGLE_stream_producer_d3d_texture
|
||||
#define EGL_ANGLE_stream_producer_d3d_texture
|
||||
#define EGL_D3D_TEXTURE_SUBRESOURCE_ID_ANGLE 0x33AB
|
||||
typedef EGLBoolean(EGLAPIENTRYP PFNEGLCREATESTREAMPRODUCERD3DTEXTUREANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean(EGLAPIENTRYP PFNEGLSTREAMPOSTD3DTEXTUREANGLEPROC)(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglCreateStreamProducerD3DTextureANGLE(EGLDisplay dpy, EGLStreamKHR stream, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglStreamPostD3DTextureANGLE(EGLDisplay dpy, EGLStreamKHR stream, void *texture, const EGLAttrib *attrib_list);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_stream_producer_d3d_texture */
|
||||
|
||||
#ifndef EGL_ANGLE_create_context_webgl_compatibility
|
||||
#define EGL_ANGLE_create_context_webgl_compatibility 1
|
||||
#define EGL_CONTEXT_WEBGL_COMPATIBILITY_ANGLE 0x33AC
|
||||
#endif /* EGL_ANGLE_create_context_webgl_compatibility */
|
||||
|
||||
#ifndef EGL_ANGLE_display_texture_share_group
|
||||
#define EGL_ANGLE_display_texture_share_group 1
|
||||
#define EGL_DISPLAY_TEXTURE_SHARE_GROUP_ANGLE 0x33AF
|
||||
#endif /* EGL_ANGLE_display_texture_share_group */
|
||||
|
||||
#ifndef EGL_CHROMIUM_create_context_bind_generates_resource
|
||||
#define EGL_CHROMIUM_create_context_bind_generates_resource 1
|
||||
#define EGL_CONTEXT_BIND_GENERATES_RESOURCE_CHROMIUM 0x33AD
|
||||
#endif /* EGL_CHROMIUM_create_context_bind_generates_resource */
|
||||
|
||||
#ifndef EGL_ANGLE_metal_create_context_ownership_identity
|
||||
#define EGL_ANGLE_metal_create_context_ownership_identity 1
|
||||
#define EGL_CONTEXT_METAL_OWNERSHIP_IDENTITY_ANGLE 0x34D2
|
||||
#endif /* EGL_ANGLE_metal_create_context_ownership_identity */
|
||||
|
||||
#ifndef EGL_ANGLE_create_context_client_arrays
|
||||
#define EGL_ANGLE_create_context_client_arrays 1
|
||||
#define EGL_CONTEXT_CLIENT_ARRAYS_ENABLED_ANGLE 0x3452
|
||||
#endif /* EGL_ANGLE_create_context_client_arrays */
|
||||
|
||||
#ifndef EGL_ANGLE_device_creation
|
||||
#define EGL_ANGLE_device_creation 1
|
||||
typedef EGLDeviceEXT(EGLAPIENTRYP PFNEGLCREATEDEVICEANGLEPROC) (EGLint device_type, void *native_device, const EGLAttrib *attrib_list);
|
||||
typedef EGLBoolean(EGLAPIENTRYP PFNEGLRELEASEDEVICEANGLEPROC) (EGLDeviceEXT device);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLDeviceEXT EGLAPIENTRY eglCreateDeviceANGLE(EGLint device_type, void *native_device, const EGLAttrib *attrib_list);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglReleaseDeviceANGLE(EGLDeviceEXT device);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_device_creation */
|
||||
|
||||
#ifndef EGL_ANGLE_program_cache_control
|
||||
#define EGL_ANGLE_program_cache_control 1
|
||||
#define EGL_PROGRAM_CACHE_SIZE_ANGLE 0x3455
|
||||
#define EGL_PROGRAM_CACHE_KEY_LENGTH_ANGLE 0x3456
|
||||
#define EGL_PROGRAM_CACHE_RESIZE_ANGLE 0x3457
|
||||
#define EGL_PROGRAM_CACHE_TRIM_ANGLE 0x3458
|
||||
#define EGL_CONTEXT_PROGRAM_BINARY_CACHE_ENABLED_ANGLE 0x3459
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHEGETATTRIBANGLEPROC) (EGLDisplay dpy, EGLenum attrib);
|
||||
typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEQUERYANGLEPROC) (EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize);
|
||||
typedef void (EGLAPIENTRYP PFNEGLPROGRAMCACHEPOPULATEANGLEPROC) (EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize);
|
||||
typedef EGLint (EGLAPIENTRYP PFNEGLPROGRAMCACHERESIZEANGLEPROC) (EGLDisplay dpy, EGLint limit, EGLint mode);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLint EGLAPIENTRY eglProgramCacheGetAttribANGLE(EGLDisplay dpy, EGLenum attrib);
|
||||
EGLAPI void EGLAPIENTRY eglProgramCacheQueryANGLE(EGLDisplay dpy, EGLint index, void *key, EGLint *keysize, void *binary, EGLint *binarysize);
|
||||
EGLAPI void EGLAPIENTRY eglProgramCachePopulateANGLE(EGLDisplay dpy, const void *key, EGLint keysize, const void *binary, EGLint binarysize);
|
||||
EGLAPI EGLint EGLAPIENTRY eglProgramCacheResizeANGLE(EGLDisplay dpy, EGLint limit, EGLint mode);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_program_cache_control */
|
||||
|
||||
#ifndef EGL_ANGLE_iosurface_client_buffer
|
||||
#define EGL_ANGLE_iosurface_client_buffer 1
|
||||
#define EGL_IOSURFACE_ANGLE 0x3454
|
||||
#define EGL_IOSURFACE_PLANE_ANGLE 0x345A
|
||||
#define EGL_TEXTURE_RECTANGLE_ANGLE 0x345B
|
||||
#define EGL_TEXTURE_TYPE_ANGLE 0x345C
|
||||
#define EGL_TEXTURE_INTERNAL_FORMAT_ANGLE 0x345D
|
||||
#define EGL_IOSURFACE_USAGE_HINT_ANGLE 0x348A
|
||||
#define EGL_IOSURFACE_READ_HINT_ANGLE 0x0001
|
||||
#define EGL_IOSURFACE_WRITE_HINT_ANGLE 0x0002
|
||||
#define EGL_BIND_TO_TEXTURE_TARGET_ANGLE 0x348D
|
||||
#endif /* EGL_ANGLE_iosurface_client_buffer */
|
||||
|
||||
#ifndef ANGLE_metal_texture_client_buffer
|
||||
#define ANGLE_metal_texture_client_buffer 1
|
||||
#define EGL_METAL_TEXTURE_ANGLE 0x34A7
|
||||
#endif /* ANGLE_metal_texture_client_buffer */
|
||||
|
||||
#ifndef EGL_ANGLE_create_context_extensions_enabled
|
||||
#define EGL_ANGLE_create_context_extensions_enabled 1
|
||||
#define EGL_EXTENSIONS_ENABLED_ANGLE 0x345F
|
||||
#endif /* EGL_ANGLE_create_context_extensions_enabled */
|
||||
|
||||
#ifndef EGL_CHROMIUM_sync_control
|
||||
#define EGL_CHROMIUM_sync_control 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETSYNCVALUESCHROMIUMPROC) (EGLDisplay dpy,
|
||||
EGLSurface surface,
|
||||
EGLuint64KHR *ust,
|
||||
EGLuint64KHR *msc,
|
||||
EGLuint64KHR *sbc);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetSyncValuesCHROMIUM(EGLDisplay dpy,
|
||||
EGLSurface surface,
|
||||
EGLuint64KHR *ust,
|
||||
EGLuint64KHR *msc,
|
||||
EGLuint64KHR *sbc);
|
||||
#endif
|
||||
#endif /* EGL_CHROMIUM_sync_control */
|
||||
|
||||
#ifndef EGL_ANGLE_sync_control_rate
|
||||
#define EGL_ANGLE_sync_control_rate 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLGETMSCRATEANGLEPROC) (EGLDisplay dpy,
|
||||
EGLSurface surface,
|
||||
EGLint *numerator,
|
||||
EGLint *denominator);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglGetMscRateANGLE(EGLDisplay dpy,
|
||||
EGLSurface surface,
|
||||
EGLint *numerator,
|
||||
EGLint *denominator);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_sync_control_rate */
|
||||
|
||||
#ifndef EGL_ANGLE_power_preference
|
||||
#define EGL_ANGLE_power_preference 1
|
||||
#define EGL_POWER_PREFERENCE_ANGLE 0x3482
|
||||
#define EGL_LOW_POWER_ANGLE 0x0001
|
||||
#define EGL_HIGH_POWER_ANGLE 0x0002
|
||||
typedef void(EGLAPIENTRYP PFNEGLRELEASEHIGHPOWERGPUANGLEPROC) (EGLDisplay dpy, EGLContext ctx);
|
||||
typedef void(EGLAPIENTRYP PFNEGLREACQUIREHIGHPOWERGPUANGLEPROC) (EGLDisplay dpy, EGLContext ctx);
|
||||
typedef void(EGLAPIENTRYP PFNEGLHANDLEGPUSWITCHANGLEPROC) (EGLDisplay dpy);
|
||||
typedef void(EGLAPIENTRYP PFNEGLFORCEGPUSWITCHANGLEPROC) (EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglReleaseHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI void EGLAPIENTRY eglReacquireHighPowerGPUANGLE(EGLDisplay dpy, EGLContext ctx);
|
||||
EGLAPI void EGLAPIENTRY eglHandleGPUSwitchANGLE(EGLDisplay dpy);
|
||||
EGLAPI void EGLAPIENTRY eglForceGPUSwitchANGLE(EGLDisplay dpy, EGLint gpuIDHigh, EGLint gpuIDLow);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_power_preference */
|
||||
|
||||
#ifndef EGL_ANGLE_wait_until_work_scheduled
|
||||
#define EGL_ANGLE_wait_until_work_scheduled 1
|
||||
typedef void(EGLAPIENTRYP PFNEGLWAITUNTILWORKSCHEDULEDANGLEPROC) (EGLDisplay dpy);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglWaitUntilWorkScheduledANGLE(EGLDisplay dpy);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_wait_until_work_scheduled */
|
||||
|
||||
#ifndef EGL_ANGLE_feature_control
|
||||
#define EGL_ANGLE_feature_control 1
|
||||
#define EGL_FEATURE_NAME_ANGLE 0x3460
|
||||
#define EGL_FEATURE_CATEGORY_ANGLE 0x3461
|
||||
#define EGL_FEATURE_DESCRIPTION_ANGLE 0x3462
|
||||
#define EGL_FEATURE_BUG_ANGLE 0x3463
|
||||
#define EGL_FEATURE_STATUS_ANGLE 0x3464
|
||||
#define EGL_FEATURE_COUNT_ANGLE 0x3465
|
||||
#define EGL_FEATURE_OVERRIDES_ENABLED_ANGLE 0x3466
|
||||
#define EGL_FEATURE_OVERRIDES_DISABLED_ANGLE 0x3467
|
||||
#define EGL_FEATURE_CONDITION_ANGLE 0x3468
|
||||
#define EGL_FEATURE_ALL_DISABLED_ANGLE 0x3469
|
||||
typedef const char *(EGLAPIENTRYP PFNEGLQUERYSTRINGIANGLEPROC) (EGLDisplay dpy, EGLint name, EGLint index);
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYDISPLAYATTRIBANGLEPROC) (EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI const char *EGLAPIENTRY eglQueryStringiANGLE(EGLDisplay dpy, EGLint name, EGLint index);
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglQueryDisplayAttribANGLE(EGLDisplay dpy, EGLint attribute, EGLAttrib *value);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_feature_control */
|
||||
|
||||
#ifndef EGL_ANGLE_image_d3d11_texture
|
||||
#define EGL_D3D11_TEXTURE_ANGLE 0x3484
|
||||
#define EGL_TEXTURE_INTERNAL_FORMAT_ANGLE 0x345D
|
||||
#endif /* EGL_ANGLE_image_d3d11_texture */
|
||||
|
||||
#ifndef EGL_ANGLE_create_context_backwards_compatible
|
||||
#define EGL_ANGLE_create_context_backwards_compatible 1
|
||||
#define EGL_CONTEXT_OPENGL_BACKWARDS_COMPATIBLE_ANGLE 0x3483
|
||||
#endif /* EGL_ANGLE_create_context_backwards_compatible */
|
||||
|
||||
#ifndef EGL_ANGLE_device_cgl
|
||||
#define EGL_ANGLE_device_cgl 1
|
||||
#define EGL_CGL_CONTEXT_ANGLE 0x3485
|
||||
#define EGL_CGL_PIXEL_FORMAT_ANGLE 0x3486
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_ggp_stream_descriptor
|
||||
#define EGL_ANGLE_ggp_stream_descriptor 1
|
||||
#define EGL_GGP_STREAM_DESCRIPTOR_ANGLE 0x348B
|
||||
#endif /* EGL_ANGLE_ggp_stream_descriptor */
|
||||
|
||||
#ifndef EGL_ANGLE_swap_with_frame_token
|
||||
#define EGL_ANGLE_swap_with_frame_token 1
|
||||
typedef khronos_uint64_t EGLFrameTokenANGLE;
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLSWAPBUFFERSWITHFRAMETOKENANGLEPROC)(EGLDisplay dpy, EGLSurface surface, EGLFrameTokenANGLE frametoken);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglSwapBuffersWithFrameTokenANGLE(EGLDisplay dpy, EGLSurface surface, EGLFrameTokenANGLE frametoken);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_swap_with_frame_token */
|
||||
|
||||
#ifndef EGL_ANGLE_prepare_swap_buffers
|
||||
#define EGL_ANGLE_prepare_swap_buffers 1
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLPREPARESWAPBUFFERSANGLEPROC)(EGLDisplay dpy, EGLSurface surface);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglPrepareSwapBuffersANGLE(EGLDisplay dpy, EGLSurface surface);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_prepare_swap_buffers */
|
||||
|
||||
#ifndef EGL_ANGLE_device_eagl
|
||||
#define EGL_ANGLE_device_eagl 1
|
||||
#define EGL_EAGL_CONTEXT_ANGLE 0x348C
|
||||
#endif
|
||||
|
||||
#ifndef EGL_ANGLE_device_metal
|
||||
#define EGL_ANGLE_device_metal 1
|
||||
#define EGL_METAL_DEVICE_ANGLE 0x34A6
|
||||
#endif /* EGL_ANGLE_device_metal */
|
||||
|
||||
#ifndef EGL_ANGLE_display_semaphore_share_group
|
||||
#define EGL_ANGLE_display_semaphore_share_group 1
|
||||
#define EGL_DISPLAY_SEMAPHORE_SHARE_GROUP_ANGLE 0x348D
|
||||
#endif /* EGL_ANGLE_display_semaphore_share_group */
|
||||
|
||||
#ifndef EGL_ANGLE_external_context_and_surface
|
||||
#define EGL_ANGLE_external_context_and_surface 1
|
||||
#define EGL_EXTERNAL_CONTEXT_ANGLE 0x348E
|
||||
#define EGL_EXTERNAL_SURFACE_ANGLE 0x348F
|
||||
typedef void (EGLAPIENTRYP PFNEGLACQUIREEXTERNALCONTEXTANGLEPROC) (EGLDisplay dpy, EGLSurface readAndDraw);
|
||||
typedef void (EGLAPIENTRYP PFNEGLRELEASEEXTERNALCONTEXTANGLEPROC) (EGLDisplay dpy);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void EGLAPIENTRY eglAcquireExternalContextANGLE(EGLDisplay dpy, EGLSurface drawAndRead);
|
||||
EGLAPI void EGLAPIENTRY eglReleaseExternalContextANGLE(EGLDisplay dpy);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_external_context_and_surface */
|
||||
|
||||
#ifndef EGL_ANGLE_create_surface_swap_interval
|
||||
#define EGL_ANGLE_create_surface_swap_interval 1
|
||||
#define EGL_SWAP_INTERVAL_ANGLE 0x322F
|
||||
#endif /* EGL_ANGLE_create_surface_swap_interval */
|
||||
|
||||
#ifndef EGL_ANGLE_device_vulkan
|
||||
#define EGL_ANGLE_device_vulkan 1
|
||||
#define EGL_VULKAN_VERSION_ANGLE 0x34A8
|
||||
#define EGL_VULKAN_INSTANCE_ANGLE 0x34A9
|
||||
#define EGL_VULKAN_INSTANCE_EXTENSIONS_ANGLE 0x34AA
|
||||
#define EGL_VULKAN_PHYSICAL_DEVICE_ANGLE 0x34AB
|
||||
#define EGL_VULKAN_DEVICE_ANGLE 0x34AC
|
||||
#define EGL_VULKAN_DEVICE_EXTENSIONS_ANGLE 0x34AD
|
||||
#define EGL_VULKAN_FEATURES_ANGLE 0x34AE
|
||||
#define EGL_VULKAN_QUEUE_ANGLE 0x34AF
|
||||
#define EGL_VULKAN_QUEUE_FAMILIY_INDEX_ANGLE 0x34D0
|
||||
#define EGL_VULKAN_GET_INSTANCE_PROC_ADDR 0x34D1
|
||||
#endif /* EGL_ANGLE_device_vulkan */
|
||||
|
||||
#ifndef EGL_ANGLE_vulkan_image
|
||||
#define EGL_ANGLE_vulkan_image
|
||||
#define EGL_VULKAN_IMAGE_ANGLE 0x34D3
|
||||
#define EGL_VULKAN_IMAGE_CREATE_INFO_HI_ANGLE 0x34D4
|
||||
#define EGL_VULKAN_IMAGE_CREATE_INFO_LO_ANGLE 0x34D5
|
||||
typedef EGLBoolean (EGLAPIENTRYP PFNEGLEXPORTVKIMAGEANGLEPROC)(EGLDisplay dpy, EGLImage image, void* vk_image, void* vk_image_create_info);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI EGLBoolean EGLAPIENTRY eglExportVkImageANGLE(EGLDisplay dpy, EGLImage image, void* vk_image, void* vk_image_create_info);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_vulkan_image */
|
||||
|
||||
#ifndef EGL_ANGLE_metal_shared_event_sync
|
||||
#define EGL_ANGLE_metal_hared_event_sync 1
|
||||
#define EGL_SYNC_METAL_SHARED_EVENT_ANGLE 0x34D8
|
||||
#define EGL_SYNC_METAL_SHARED_EVENT_OBJECT_ANGLE 0x34D9
|
||||
#define EGL_SYNC_METAL_SHARED_EVENT_SIGNAL_VALUE_LO_ANGLE 0x34DA
|
||||
#define EGL_SYNC_METAL_SHARED_EVENT_SIGNAL_VALUE_HI_ANGLE 0x34DB
|
||||
#define EGL_SYNC_METAL_SHARED_EVENT_SIGNALED_ANGLE 0x34DC
|
||||
typedef void* (EGLAPIENTRYP PFNEGLCOPYMETALSHAREDEVENTANGLEPROC)(EGLDisplay dpy, EGLSync sync);
|
||||
#ifdef EGL_EGLEXT_PROTOTYPES
|
||||
EGLAPI void *EGLAPIENTRY eglCopyMetalSharedEventANGLE(EGLDisplay dpy, EGLSync sync);
|
||||
#endif
|
||||
#endif /* EGL_ANGLE_metal_shared_event_sync */
|
||||
|
||||
// clang-format on
|
||||
|
||||
#endif // INCLUDE_EGL_EGLEXT_ANGLE_
|
||||
@@ -0,0 +1,56 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2008 VMware, 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 __eglmesaext_h_
|
||||
#define __eglmesaext_h_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <EGL/eglplatform.h>
|
||||
|
||||
/* 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);
|
||||
|
||||
#ifndef EGL_MESA_configless_context
|
||||
#define EGL_MESA_configless_context 1
|
||||
#define EGL_NO_CONFIG_MESA EGL_CAST(EGLConfig,0)
|
||||
#endif
|
||||
|
||||
#ifndef EGL_MESA_drm_image_formats
|
||||
#define EGL_MESA_drm_image_formats 1
|
||||
#define EGL_DRM_BUFFER_FORMAT_ARGB2101010_MESA 0x3290
|
||||
#define EGL_DRM_BUFFER_FORMAT_ARGB1555_MESA 0x3291
|
||||
#define EGL_DRM_BUFFER_FORMAT_RGB565_MESA 0x3292
|
||||
#endif /* EGL_MESA_drm_image_formats */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,175 @@
|
||||
#ifndef __eglplatform_h_
|
||||
#define __eglplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2007-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for egl.h
|
||||
*
|
||||
* 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
|
||||
* they can be included in future versions of this file. Please submit changes
|
||||
* by filing an issue or pull request on the public Khronos EGL Registry, at
|
||||
* https://www.github.com/KhronosGroup/EGL-Registry/
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
/* Macros used in EGL function prototype declarations.
|
||||
*
|
||||
* EGL functions should be prototyped as:
|
||||
*
|
||||
* EGLAPI return-type EGLAPIENTRY eglFunction(arguments);
|
||||
* typedef return-type (EXPAPIENTRYP PFNEGLFUNCTIONPROC) (arguments);
|
||||
*
|
||||
* KHRONOS_APICALL and KHRONOS_APIENTRY are defined in KHR/khrplatform.h
|
||||
*/
|
||||
|
||||
#ifndef EGLAPI
|
||||
#define EGLAPI KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef EGLAPIENTRY
|
||||
#define EGLAPIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
#define EGLAPIENTRYP EGLAPIENTRY*
|
||||
|
||||
/* The types NativeDisplayType, NativeWindowType, and NativePixmapType
|
||||
* are aliases of window-system-dependent types, such as X Display * or
|
||||
* Windows Device Context. They must be defined in platform-specific
|
||||
* code below. The EGL-prefixed versions of Native*Type are the same
|
||||
* types, renamed in EGL 1.3 so all types in the API start with "EGL".
|
||||
*
|
||||
* Khronos STRONGLY RECOMMENDS that you use the default definitions
|
||||
* provided below, since these changes affect both binary and source
|
||||
* portability of applications using EGL running on different EGL
|
||||
* implementations.
|
||||
*/
|
||||
|
||||
#if defined(EGL_NO_PLATFORM_SPECIFIC_TYPES)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(_WIN32) || defined(__VC32__) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) /* Win32 and WinCE */
|
||||
#ifndef WIN32_LEAN_AND_MEAN
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#endif
|
||||
#include <windows.h>
|
||||
|
||||
typedef HDC EGLNativeDisplayType;
|
||||
typedef HBITMAP EGLNativePixmapType;
|
||||
typedef HWND EGLNativeWindowType;
|
||||
|
||||
#elif defined(__QNX__)
|
||||
|
||||
typedef khronos_uintptr_t EGLNativeDisplayType;
|
||||
typedef struct _screen_pixmap* EGLNativePixmapType; /* screen_pixmap_t */
|
||||
typedef struct _screen_window* EGLNativeWindowType; /* screen_window_t */
|
||||
|
||||
#elif defined(__EMSCRIPTEN__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef int EGLNativePixmapType;
|
||||
typedef int EGLNativeWindowType;
|
||||
|
||||
#elif defined(__WINSCW__) || defined(__SYMBIAN32__) /* Symbian */
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(WL_EGL_PLATFORM)
|
||||
|
||||
typedef struct wl_display *EGLNativeDisplayType;
|
||||
typedef struct wl_egl_pixmap *EGLNativePixmapType;
|
||||
typedef struct wl_egl_window *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__GBM__)
|
||||
|
||||
typedef struct gbm_device *EGLNativeDisplayType;
|
||||
typedef struct gbm_bo *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__ANDROID__) || defined(ANDROID)
|
||||
|
||||
struct ANativeWindow;
|
||||
struct egl_native_pixmap_t;
|
||||
|
||||
typedef void* EGLNativeDisplayType;
|
||||
typedef struct egl_native_pixmap_t* EGLNativePixmapType;
|
||||
typedef struct ANativeWindow* EGLNativeWindowType;
|
||||
|
||||
#elif defined(USE_OZONE)
|
||||
|
||||
typedef intptr_t EGLNativeDisplayType;
|
||||
typedef intptr_t EGLNativePixmapType;
|
||||
typedef intptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(USE_X11)
|
||||
|
||||
/* X11 (tentative) */
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
|
||||
typedef Display *EGLNativeDisplayType;
|
||||
typedef Pixmap EGLNativePixmapType;
|
||||
typedef Window EGLNativeWindowType;
|
||||
|
||||
#elif defined(__unix__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__APPLE__)
|
||||
|
||||
typedef int EGLNativeDisplayType;
|
||||
typedef void *EGLNativePixmapType;
|
||||
typedef void *EGLNativeWindowType;
|
||||
|
||||
#elif defined(__HAIKU__)
|
||||
|
||||
#include <kernel/image.h>
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
typedef khronos_uintptr_t EGLNativePixmapType;
|
||||
typedef khronos_uintptr_t EGLNativeWindowType;
|
||||
|
||||
#elif defined(__Fuchsia__)
|
||||
|
||||
typedef void *EGLNativeDisplayType;
|
||||
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 */
|
||||
typedef EGLNativeDisplayType NativeDisplayType;
|
||||
typedef EGLNativePixmapType NativePixmapType;
|
||||
typedef EGLNativeWindowType NativeWindowType;
|
||||
|
||||
|
||||
/* Define EGLint. This must be a signed integral type large enough to contain
|
||||
* all legal attribute names and values passed into and out of EGL, whether
|
||||
* their type is boolean, bitmask, enumerant (symbolic constant), integer,
|
||||
* handle, or other. While in general a 32-bit integer will suffice, if
|
||||
* handles are 64 bit types, then EGLint should be defined as a signed 64-bit
|
||||
* integer type.
|
||||
*/
|
||||
typedef khronos_int32_t EGLint;
|
||||
|
||||
|
||||
/* C++ / C typecast macros for special EGL handle values */
|
||||
#if defined(__cplusplus)
|
||||
#define EGL_CAST(type, value) (static_cast<type>(value))
|
||||
#else
|
||||
#define EGL_CAST(type, value) ((type) (value))
|
||||
#endif
|
||||
|
||||
#endif /* __eglplatform_h */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,371 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef GLX_H
|
||||
#define GLX_H
|
||||
|
||||
|
||||
#include <X11/Xlib.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <GL/gl.h>
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
#define GLX_VERSION_1_1 1
|
||||
#define GLX_VERSION_1_2 1
|
||||
#define GLX_VERSION_1_3 1
|
||||
#define GLX_VERSION_1_4 1
|
||||
|
||||
#define GLX_EXTENSION_NAME "GLX"
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Tokens for glXChooseVisual and glXGetConfig:
|
||||
*/
|
||||
#define GLX_USE_GL 1
|
||||
#define GLX_BUFFER_SIZE 2
|
||||
#define GLX_LEVEL 3
|
||||
#define GLX_RGBA 4
|
||||
#define GLX_DOUBLEBUFFER 5
|
||||
#define GLX_STEREO 6
|
||||
#define GLX_AUX_BUFFERS 7
|
||||
#define GLX_RED_SIZE 8
|
||||
#define GLX_GREEN_SIZE 9
|
||||
#define GLX_BLUE_SIZE 10
|
||||
#define GLX_ALPHA_SIZE 11
|
||||
#define GLX_DEPTH_SIZE 12
|
||||
#define GLX_STENCIL_SIZE 13
|
||||
#define GLX_ACCUM_RED_SIZE 14
|
||||
#define GLX_ACCUM_GREEN_SIZE 15
|
||||
#define GLX_ACCUM_BLUE_SIZE 16
|
||||
#define GLX_ACCUM_ALPHA_SIZE 17
|
||||
|
||||
|
||||
/*
|
||||
* Error codes returned by glXGetConfig:
|
||||
*/
|
||||
#define GLX_BAD_SCREEN 1
|
||||
#define GLX_BAD_ATTRIBUTE 2
|
||||
#define GLX_NO_EXTENSION 3
|
||||
#define GLX_BAD_VISUAL 4
|
||||
#define GLX_BAD_CONTEXT 5
|
||||
#define GLX_BAD_VALUE 6
|
||||
#define GLX_BAD_ENUM 7
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.1 and later:
|
||||
*/
|
||||
#define GLX_VENDOR 1
|
||||
#define GLX_VERSION 2
|
||||
#define GLX_EXTENSIONS 3
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.3 and later:
|
||||
*/
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
|
||||
|
||||
/*
|
||||
* GLX 1.4 and later:
|
||||
*/
|
||||
#define GLX_SAMPLE_BUFFERS 0x186a0 /*100000*/
|
||||
#define GLX_SAMPLES 0x186a1 /*100001*/
|
||||
|
||||
|
||||
|
||||
typedef struct __GLXcontextRec *GLXContext;
|
||||
typedef XID GLXPixmap;
|
||||
typedef XID GLXDrawable;
|
||||
/* GLX 1.3 and later */
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXFBConfigID;
|
||||
typedef XID GLXContextID;
|
||||
typedef XID GLXWindow;
|
||||
typedef XID GLXPbuffer;
|
||||
|
||||
|
||||
/*
|
||||
** Events.
|
||||
** __GLX_NUMBER_EVENTS is set to 17 to account for the BufferClobberSGIX
|
||||
** event - this helps initialization if the server supports the pbuffer
|
||||
** extension and the client doesn't.
|
||||
*/
|
||||
#define GLX_PbufferClobber 0
|
||||
#define GLX_BufferSwapComplete 1
|
||||
|
||||
#define __GLX_NUMBER_EVENTS 17
|
||||
|
||||
extern XVisualInfo* glXChooseVisual( Display *dpy, int screen,
|
||||
int *attribList );
|
||||
|
||||
extern GLXContext glXCreateContext( Display *dpy, XVisualInfo *vis,
|
||||
GLXContext shareList, Bool direct );
|
||||
|
||||
extern void glXDestroyContext( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern Bool glXMakeCurrent( Display *dpy, GLXDrawable drawable,
|
||||
GLXContext ctx);
|
||||
|
||||
extern void glXCopyContext( Display *dpy, GLXContext src, GLXContext dst,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXSwapBuffers( Display *dpy, GLXDrawable drawable );
|
||||
|
||||
extern GLXPixmap glXCreateGLXPixmap( Display *dpy, XVisualInfo *visual,
|
||||
Pixmap pixmap );
|
||||
|
||||
extern void glXDestroyGLXPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern Bool glXQueryExtension( Display *dpy, int *errorb, int *event );
|
||||
|
||||
extern Bool glXQueryVersion( Display *dpy, int *maj, int *min );
|
||||
|
||||
extern Bool glXIsDirect( Display *dpy, GLXContext ctx );
|
||||
|
||||
extern int glXGetConfig( Display *dpy, XVisualInfo *visual,
|
||||
int attrib, int *value );
|
||||
|
||||
extern GLXContext glXGetCurrentContext( void );
|
||||
|
||||
extern GLXDrawable glXGetCurrentDrawable( void );
|
||||
|
||||
extern void glXWaitGL( void );
|
||||
|
||||
extern void glXWaitX( void );
|
||||
|
||||
extern void glXUseXFont( Font font, int first, int count, int list );
|
||||
|
||||
|
||||
|
||||
/* GLX 1.1 and later */
|
||||
extern const char *glXQueryExtensionsString( Display *dpy, int screen );
|
||||
|
||||
extern const char *glXQueryServerString( Display *dpy, int screen, int name );
|
||||
|
||||
extern const char *glXGetClientString( Display *dpy, int name );
|
||||
|
||||
|
||||
/* GLX 1.2 and later */
|
||||
extern Display *glXGetCurrentDisplay( void );
|
||||
|
||||
|
||||
/* GLX 1.3 and later */
|
||||
extern GLXFBConfig *glXChooseFBConfig( Display *dpy, int screen,
|
||||
const int *attribList, int *nitems );
|
||||
|
||||
extern int glXGetFBConfigAttrib( Display *dpy, GLXFBConfig config,
|
||||
int attribute, int *value );
|
||||
|
||||
extern GLXFBConfig *glXGetFBConfigs( Display *dpy, int screen,
|
||||
int *nelements );
|
||||
|
||||
extern XVisualInfo *glXGetVisualFromFBConfig( Display *dpy,
|
||||
GLXFBConfig config );
|
||||
|
||||
extern GLXWindow glXCreateWindow( Display *dpy, GLXFBConfig config,
|
||||
Window win, const int *attribList );
|
||||
|
||||
extern void glXDestroyWindow( Display *dpy, GLXWindow window );
|
||||
|
||||
extern GLXPixmap glXCreatePixmap( Display *dpy, GLXFBConfig config,
|
||||
Pixmap pixmap, const int *attribList );
|
||||
|
||||
extern void glXDestroyPixmap( Display *dpy, GLXPixmap pixmap );
|
||||
|
||||
extern GLXPbuffer glXCreatePbuffer( Display *dpy, GLXFBConfig config,
|
||||
const int *attribList );
|
||||
|
||||
extern void glXDestroyPbuffer( Display *dpy, GLXPbuffer pbuf );
|
||||
|
||||
extern void glXQueryDrawable( Display *dpy, GLXDrawable draw, int attribute,
|
||||
unsigned int *value );
|
||||
|
||||
extern GLXContext glXCreateNewContext( Display *dpy, GLXFBConfig config,
|
||||
int renderType, GLXContext shareList,
|
||||
Bool direct );
|
||||
|
||||
extern Bool glXMakeContextCurrent( Display *dpy, GLXDrawable draw,
|
||||
GLXDrawable read, GLXContext ctx );
|
||||
|
||||
extern GLXDrawable glXGetCurrentReadDrawable( void );
|
||||
|
||||
extern int glXQueryContext( Display *dpy, GLXContext ctx, int attribute,
|
||||
int *value );
|
||||
|
||||
extern void glXSelectEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long mask );
|
||||
|
||||
extern void glXGetSelectedEvent( Display *dpy, GLXDrawable drawable,
|
||||
unsigned long *mask );
|
||||
|
||||
/* GLX 1.3 function pointer typedefs */
|
||||
typedef GLXFBConfig * (* PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig * (* PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int (* PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo * (* PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow (* PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap (* PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer (* PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void (* PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void (* PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext (* PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool (* PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable (* PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef Display * (* PFNGLXGETCURRENTDISPLAYPROC) (void);
|
||||
typedef int (* PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void (* PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void (* PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
|
||||
|
||||
/*
|
||||
* ARB 2. GLX_ARB_get_proc_address
|
||||
*/
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
|
||||
typedef void (*__GLXextFuncPtr)(void);
|
||||
extern __GLXextFuncPtr glXGetProcAddressARB (const GLubyte *);
|
||||
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
|
||||
|
||||
/* GLX 1.4 and later */
|
||||
extern void (*glXGetProcAddress(const GLubyte *procname))( void );
|
||||
|
||||
/* GLX 1.4 function pointer typedefs */
|
||||
typedef __GLXextFuncPtr (* PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
|
||||
|
||||
#ifndef GLX_GLXEXT_LEGACY
|
||||
#include <GL/glxext.h>
|
||||
#endif /* GLX_GLXEXT_LEGACY */
|
||||
|
||||
|
||||
/*** Should these go here, or in another header? */
|
||||
/*
|
||||
** GLX Events
|
||||
*/
|
||||
typedef struct {
|
||||
int event_type; /* GLX_DAMAGED or GLX_SAVED */
|
||||
int draw_type; /* GLX_WINDOW or GLX_PBUFFER */
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came for SendEvent request */
|
||||
Display *display; /* display the event was read from */
|
||||
GLXDrawable drawable; /* XID of Drawable */
|
||||
unsigned int buffer_mask; /* mask indicating which buffers are affected */
|
||||
unsigned int aux_buffer; /* which aux buffer was affected */
|
||||
int x, y;
|
||||
int width, height;
|
||||
int count; /* if nonzero, at least this many more */
|
||||
} GLXPbufferClobberEvent;
|
||||
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial; /* # of last request processed by server */
|
||||
Bool send_event; /* true if this came from a SendEvent request */
|
||||
Display *display; /* Display the event was read from */
|
||||
Drawable drawable; /* drawable on which event was requested in event mask */
|
||||
int event_type;
|
||||
int64_t ust;
|
||||
int64_t msc;
|
||||
int64_t sbc;
|
||||
} GLXBufferSwapComplete;
|
||||
|
||||
typedef union __GLXEvent {
|
||||
GLXPbufferClobberEvent glxpbufferclobber;
|
||||
GLXBufferSwapComplete glxbufferswapcomplete;
|
||||
long pad[24];
|
||||
} GLXEvent;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,954 @@
|
||||
#ifndef __glx_glxext_h_
|
||||
#define __glx_glxext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** 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
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#define GLX_GLXEXT_VERSION 20250203
|
||||
|
||||
/* Generated C header for:
|
||||
* API: glx
|
||||
* Versions considered: .*
|
||||
* Versions emitted: 1\.[3-9]
|
||||
* Default extensions included: glx
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef GLX_VERSION_1_3
|
||||
#define GLX_VERSION_1_3 1
|
||||
typedef XID GLXContextID;
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfig;
|
||||
typedef XID GLXWindow;
|
||||
typedef XID GLXPbuffer;
|
||||
#define GLX_WINDOW_BIT 0x00000001
|
||||
#define GLX_PIXMAP_BIT 0x00000002
|
||||
#define GLX_PBUFFER_BIT 0x00000004
|
||||
#define GLX_RGBA_BIT 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT 0x00000002
|
||||
#define GLX_PBUFFER_CLOBBER_MASK 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT 0x00000080
|
||||
#define GLX_CONFIG_CAVEAT 0x20
|
||||
#define GLX_X_VISUAL_TYPE 0x22
|
||||
#define GLX_TRANSPARENT_TYPE 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE 0x28
|
||||
#define GLX_DONT_CARE 0xFFFFFFFF
|
||||
#define GLX_NONE 0x8000
|
||||
#define GLX_SLOW_CONFIG 0x8001
|
||||
#define GLX_TRUE_COLOR 0x8002
|
||||
#define GLX_DIRECT_COLOR 0x8003
|
||||
#define GLX_PSEUDO_COLOR 0x8004
|
||||
#define GLX_STATIC_COLOR 0x8005
|
||||
#define GLX_GRAY_SCALE 0x8006
|
||||
#define GLX_STATIC_GRAY 0x8007
|
||||
#define GLX_TRANSPARENT_RGB 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX 0x8009
|
||||
#define GLX_VISUAL_ID 0x800B
|
||||
#define GLX_SCREEN 0x800C
|
||||
#define GLX_NON_CONFORMANT_CONFIG 0x800D
|
||||
#define GLX_DRAWABLE_TYPE 0x8010
|
||||
#define GLX_RENDER_TYPE 0x8011
|
||||
#define GLX_X_RENDERABLE 0x8012
|
||||
#define GLX_FBCONFIG_ID 0x8013
|
||||
#define GLX_RGBA_TYPE 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE 0x8015
|
||||
#define GLX_MAX_PBUFFER_WIDTH 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS 0x8018
|
||||
#define GLX_PRESERVED_CONTENTS 0x801B
|
||||
#define GLX_LARGEST_PBUFFER 0x801C
|
||||
#define GLX_WIDTH 0x801D
|
||||
#define GLX_HEIGHT 0x801E
|
||||
#define GLX_EVENT_MASK 0x801F
|
||||
#define GLX_DAMAGED 0x8020
|
||||
#define GLX_SAVED 0x8021
|
||||
#define GLX_WINDOW 0x8022
|
||||
#define GLX_PBUFFER 0x8023
|
||||
#define GLX_PBUFFER_HEIGHT 0x8040
|
||||
#define GLX_PBUFFER_WIDTH 0x8041
|
||||
typedef GLXFBConfig *( *PFNGLXGETFBCONFIGSPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef GLXFBConfig *( *PFNGLXCHOOSEFBCONFIGPROC) (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
typedef int ( *PFNGLXGETFBCONFIGATTRIBPROC) (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
typedef XVisualInfo *( *PFNGLXGETVISUALFROMFBCONFIGPROC) (Display *dpy, GLXFBConfig config);
|
||||
typedef GLXWindow ( *PFNGLXCREATEWINDOWPROC) (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYWINDOWPROC) (Display *dpy, GLXWindow win);
|
||||
typedef GLXPixmap ( *PFNGLXCREATEPIXMAPPROC) (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYPIXMAPPROC) (Display *dpy, GLXPixmap pixmap);
|
||||
typedef GLXPbuffer ( *PFNGLXCREATEPBUFFERPROC) (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYPBUFFERPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef void ( *PFNGLXQUERYDRAWABLEPROC) (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
typedef GLXContext ( *PFNGLXCREATENEWCONTEXTPROC) (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef Bool ( *PFNGLXMAKECONTEXTCURRENTPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( *PFNGLXGETCURRENTREADDRAWABLEPROC) (void);
|
||||
typedef int ( *PFNGLXQUERYCONTEXTPROC) (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
typedef void ( *PFNGLXSELECTEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
typedef void ( *PFNGLXGETSELECTEDEVENTPROC) (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXFBConfig *glXGetFBConfigs (Display *dpy, int screen, int *nelements);
|
||||
GLXFBConfig *glXChooseFBConfig (Display *dpy, int screen, const int *attrib_list, int *nelements);
|
||||
int glXGetFBConfigAttrib (Display *dpy, GLXFBConfig config, int attribute, int *value);
|
||||
XVisualInfo *glXGetVisualFromFBConfig (Display *dpy, GLXFBConfig config);
|
||||
GLXWindow glXCreateWindow (Display *dpy, GLXFBConfig config, Window win, const int *attrib_list);
|
||||
void glXDestroyWindow (Display *dpy, GLXWindow win);
|
||||
GLXPixmap glXCreatePixmap (Display *dpy, GLXFBConfig config, Pixmap pixmap, const int *attrib_list);
|
||||
void glXDestroyPixmap (Display *dpy, GLXPixmap pixmap);
|
||||
GLXPbuffer glXCreatePbuffer (Display *dpy, GLXFBConfig config, const int *attrib_list);
|
||||
void glXDestroyPbuffer (Display *dpy, GLXPbuffer pbuf);
|
||||
void glXQueryDrawable (Display *dpy, GLXDrawable draw, int attribute, unsigned int *value);
|
||||
GLXContext glXCreateNewContext (Display *dpy, GLXFBConfig config, int render_type, GLXContext share_list, Bool direct);
|
||||
Bool glXMakeContextCurrent (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
GLXDrawable glXGetCurrentReadDrawable (void);
|
||||
int glXQueryContext (Display *dpy, GLXContext ctx, int attribute, int *value);
|
||||
void glXSelectEvent (Display *dpy, GLXDrawable draw, unsigned long event_mask);
|
||||
void glXGetSelectedEvent (Display *dpy, GLXDrawable draw, unsigned long *event_mask);
|
||||
#endif
|
||||
#endif /* GLX_VERSION_1_3 */
|
||||
|
||||
#ifndef GLX_VERSION_1_4
|
||||
#define GLX_VERSION_1_4 1
|
||||
typedef void ( *__GLXextFuncPtr)(void);
|
||||
#define GLX_SAMPLE_BUFFERS 100000
|
||||
#define GLX_SAMPLES 100001
|
||||
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSPROC) (const GLubyte *procName);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
__GLXextFuncPtr glXGetProcAddress (const GLubyte *procName);
|
||||
#endif
|
||||
#endif /* GLX_VERSION_1_4 */
|
||||
|
||||
#ifndef GLX_ARB_context_flush_control
|
||||
#define GLX_ARB_context_flush_control 1
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
|
||||
#define GLX_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
#endif /* GLX_ARB_context_flush_control */
|
||||
|
||||
#ifndef GLX_ARB_create_context
|
||||
#define GLX_ARB_create_context 1
|
||||
#define GLX_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define GLX_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define GLX_CONTEXT_FLAGS_ARB 0x2094
|
||||
typedef GLXContext ( *PFNGLXCREATECONTEXTATTRIBSARBPROC) (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXContext glXCreateContextAttribsARB (Display *dpy, GLXFBConfig config, GLXContext share_context, Bool direct, const int *attrib_list);
|
||||
#endif
|
||||
#endif /* GLX_ARB_create_context */
|
||||
|
||||
#ifndef GLX_ARB_create_context_no_error
|
||||
#define GLX_ARB_create_context_no_error 1
|
||||
#define GLX_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
|
||||
#endif /* GLX_ARB_create_context_no_error */
|
||||
|
||||
#ifndef GLX_ARB_create_context_profile
|
||||
#define GLX_ARB_create_context_profile 1
|
||||
#define GLX_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define GLX_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define GLX_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#endif /* GLX_ARB_create_context_profile */
|
||||
|
||||
#ifndef GLX_ARB_create_context_robustness
|
||||
#define GLX_ARB_create_context_robustness 1
|
||||
#define GLX_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define GLX_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define GLX_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define GLX_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif /* GLX_ARB_create_context_robustness */
|
||||
|
||||
#ifndef GLX_ARB_fbconfig_float
|
||||
#define GLX_ARB_fbconfig_float 1
|
||||
#define GLX_RGBA_FLOAT_TYPE_ARB 0x20B9
|
||||
#define GLX_RGBA_FLOAT_BIT_ARB 0x00000004
|
||||
#endif /* GLX_ARB_fbconfig_float */
|
||||
|
||||
#ifndef GLX_ARB_framebuffer_sRGB
|
||||
#define GLX_ARB_framebuffer_sRGB 1
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20B2
|
||||
#endif /* GLX_ARB_framebuffer_sRGB */
|
||||
|
||||
#ifndef GLX_ARB_get_proc_address
|
||||
#define GLX_ARB_get_proc_address 1
|
||||
typedef __GLXextFuncPtr ( *PFNGLXGETPROCADDRESSARBPROC) (const GLubyte *procName);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
__GLXextFuncPtr glXGetProcAddressARB (const GLubyte *procName);
|
||||
#endif
|
||||
#endif /* GLX_ARB_get_proc_address */
|
||||
|
||||
#ifndef GLX_ARB_multisample
|
||||
#define GLX_ARB_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_ARB 100000
|
||||
#define GLX_SAMPLES_ARB 100001
|
||||
#endif /* GLX_ARB_multisample */
|
||||
|
||||
#ifndef GLX_ARB_robustness_application_isolation
|
||||
#define GLX_ARB_robustness_application_isolation 1
|
||||
#define GLX_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
|
||||
#endif /* GLX_ARB_robustness_application_isolation */
|
||||
|
||||
#ifndef GLX_ARB_robustness_share_group_isolation
|
||||
#define GLX_ARB_robustness_share_group_isolation 1
|
||||
#endif /* GLX_ARB_robustness_share_group_isolation */
|
||||
|
||||
#ifndef GLX_ARB_vertex_buffer_object
|
||||
#define GLX_ARB_vertex_buffer_object 1
|
||||
#define GLX_CONTEXT_ALLOW_BUFFER_BYTE_ORDER_MISMATCH_ARB 0x2095
|
||||
#endif /* GLX_ARB_vertex_buffer_object */
|
||||
|
||||
#ifndef GLX_3DFX_multisample
|
||||
#define GLX_3DFX_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_3DFX 0x8050
|
||||
#define GLX_SAMPLES_3DFX 0x8051
|
||||
#endif /* GLX_3DFX_multisample */
|
||||
|
||||
#ifndef GLX_AMD_gpu_association
|
||||
#define GLX_AMD_gpu_association 1
|
||||
#define GLX_GPU_VENDOR_AMD 0x1F00
|
||||
#define GLX_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define GLX_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define GLX_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define GLX_GPU_RAM_AMD 0x21A3
|
||||
#define GLX_GPU_CLOCK_AMD 0x21A4
|
||||
#define GLX_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define GLX_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define GLX_GPU_NUM_RB_AMD 0x21A7
|
||||
#define GLX_GPU_NUM_SPI_AMD 0x21A8
|
||||
typedef unsigned int ( *PFNGLXGETGPUIDSAMDPROC) (unsigned int maxCount, unsigned int *ids);
|
||||
typedef int ( *PFNGLXGETGPUINFOAMDPROC) (unsigned int id, int property, GLenum dataType, unsigned int size, void *data);
|
||||
typedef unsigned int ( *PFNGLXGETCONTEXTGPUIDAMDPROC) (GLXContext ctx);
|
||||
typedef GLXContext ( *PFNGLXCREATEASSOCIATEDCONTEXTAMDPROC) (unsigned int id, GLXContext share_list);
|
||||
typedef GLXContext ( *PFNGLXCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (unsigned int id, GLXContext share_context, const int *attribList);
|
||||
typedef Bool ( *PFNGLXDELETEASSOCIATEDCONTEXTAMDPROC) (GLXContext ctx);
|
||||
typedef Bool ( *PFNGLXMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (GLXContext ctx);
|
||||
typedef GLXContext ( *PFNGLXGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef void ( *PFNGLXBLITCONTEXTFRAMEBUFFERAMDPROC) (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
unsigned int glXGetGPUIDsAMD (unsigned int maxCount, unsigned int *ids);
|
||||
int glXGetGPUInfoAMD (unsigned int id, int property, GLenum dataType, unsigned int size, void *data);
|
||||
unsigned int glXGetContextGPUIDAMD (GLXContext ctx);
|
||||
GLXContext glXCreateAssociatedContextAMD (unsigned int id, GLXContext share_list);
|
||||
GLXContext glXCreateAssociatedContextAttribsAMD (unsigned int id, GLXContext share_context, const int *attribList);
|
||||
Bool glXDeleteAssociatedContextAMD (GLXContext ctx);
|
||||
Bool glXMakeAssociatedContextCurrentAMD (GLXContext ctx);
|
||||
GLXContext glXGetCurrentAssociatedContextAMD (void);
|
||||
void glXBlitContextFramebufferAMD (GLXContext dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
#endif /* GLX_AMD_gpu_association */
|
||||
|
||||
#ifndef GLX_EXT_buffer_age
|
||||
#define GLX_EXT_buffer_age 1
|
||||
#define GLX_BACK_BUFFER_AGE_EXT 0x20F4
|
||||
#endif /* GLX_EXT_buffer_age */
|
||||
|
||||
#ifndef GLX_EXT_context_priority
|
||||
#define GLX_EXT_context_priority 1
|
||||
#define GLX_CONTEXT_PRIORITY_LEVEL_EXT 0x3100
|
||||
#define GLX_CONTEXT_PRIORITY_HIGH_EXT 0x3101
|
||||
#define GLX_CONTEXT_PRIORITY_MEDIUM_EXT 0x3102
|
||||
#define GLX_CONTEXT_PRIORITY_LOW_EXT 0x3103
|
||||
#endif /* GLX_EXT_context_priority */
|
||||
|
||||
#ifndef GLX_EXT_create_context_es2_profile
|
||||
#define GLX_EXT_create_context_es2_profile 1
|
||||
#define GLX_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* GLX_EXT_create_context_es2_profile */
|
||||
|
||||
#ifndef GLX_EXT_create_context_es_profile
|
||||
#define GLX_EXT_create_context_es_profile 1
|
||||
#define GLX_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* GLX_EXT_create_context_es_profile */
|
||||
|
||||
#ifndef GLX_EXT_fbconfig_packed_float
|
||||
#define GLX_EXT_fbconfig_packed_float 1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_TYPE_EXT 0x20B1
|
||||
#define GLX_RGBA_UNSIGNED_FLOAT_BIT_EXT 0x00000008
|
||||
#endif /* GLX_EXT_fbconfig_packed_float */
|
||||
|
||||
#ifndef GLX_EXT_framebuffer_sRGB
|
||||
#define GLX_EXT_framebuffer_sRGB 1
|
||||
#define GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20B2
|
||||
#endif /* GLX_EXT_framebuffer_sRGB */
|
||||
|
||||
#ifndef GLX_EXT_get_drawable_type
|
||||
#define GLX_EXT_get_drawable_type 1
|
||||
#endif /* GLX_EXT_get_drawable_type */
|
||||
|
||||
#ifndef GLX_EXT_import_context
|
||||
#define GLX_EXT_import_context 1
|
||||
#define GLX_SHARE_CONTEXT_EXT 0x800A
|
||||
#define GLX_VISUAL_ID_EXT 0x800B
|
||||
#define GLX_SCREEN_EXT 0x800C
|
||||
typedef Display *( *PFNGLXGETCURRENTDISPLAYEXTPROC) (void);
|
||||
typedef int ( *PFNGLXQUERYCONTEXTINFOEXTPROC) (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
typedef GLXContextID ( *PFNGLXGETCONTEXTIDEXTPROC) (const GLXContext context);
|
||||
typedef GLXContext ( *PFNGLXIMPORTCONTEXTEXTPROC) (Display *dpy, GLXContextID contextID);
|
||||
typedef void ( *PFNGLXFREECONTEXTEXTPROC) (Display *dpy, GLXContext context);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Display *glXGetCurrentDisplayEXT (void);
|
||||
int glXQueryContextInfoEXT (Display *dpy, GLXContext context, int attribute, int *value);
|
||||
GLXContextID glXGetContextIDEXT (const GLXContext context);
|
||||
GLXContext glXImportContextEXT (Display *dpy, GLXContextID contextID);
|
||||
void glXFreeContextEXT (Display *dpy, GLXContext context);
|
||||
#endif
|
||||
#endif /* GLX_EXT_import_context */
|
||||
|
||||
#ifndef GLX_EXT_libglvnd
|
||||
#define GLX_EXT_libglvnd 1
|
||||
#define GLX_VENDOR_NAMES_EXT 0x20F6
|
||||
#endif /* GLX_EXT_libglvnd */
|
||||
|
||||
#ifndef GLX_EXT_no_config_context
|
||||
#define GLX_EXT_no_config_context 1
|
||||
#endif /* GLX_EXT_no_config_context */
|
||||
|
||||
#ifndef GLX_EXT_stereo_tree
|
||||
#define GLX_EXT_stereo_tree 1
|
||||
typedef struct {
|
||||
int type;
|
||||
unsigned long serial;
|
||||
Bool send_event;
|
||||
Display *display;
|
||||
int extension;
|
||||
int evtype;
|
||||
GLXDrawable window;
|
||||
Bool stereo_tree;
|
||||
} GLXStereoNotifyEventEXT;
|
||||
#define GLX_STEREO_TREE_EXT 0x20F5
|
||||
#define GLX_STEREO_NOTIFY_MASK_EXT 0x00000001
|
||||
#define GLX_STEREO_NOTIFY_EXT 0x00000000
|
||||
#endif /* GLX_EXT_stereo_tree */
|
||||
|
||||
#ifndef GLX_EXT_swap_control
|
||||
#define GLX_EXT_swap_control 1
|
||||
#define GLX_SWAP_INTERVAL_EXT 0x20F1
|
||||
#define GLX_MAX_SWAP_INTERVAL_EXT 0x20F2
|
||||
typedef void ( *PFNGLXSWAPINTERVALEXTPROC) (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXSwapIntervalEXT (Display *dpy, GLXDrawable drawable, int interval);
|
||||
#endif
|
||||
#endif /* GLX_EXT_swap_control */
|
||||
|
||||
#ifndef GLX_EXT_swap_control_tear
|
||||
#define GLX_EXT_swap_control_tear 1
|
||||
#define GLX_LATE_SWAPS_TEAR_EXT 0x20F3
|
||||
#endif /* GLX_EXT_swap_control_tear */
|
||||
|
||||
#ifndef GLX_EXT_texture_from_pixmap
|
||||
#define GLX_EXT_texture_from_pixmap 1
|
||||
#define GLX_TEXTURE_1D_BIT_EXT 0x00000001
|
||||
#define GLX_TEXTURE_2D_BIT_EXT 0x00000002
|
||||
#define GLX_TEXTURE_RECTANGLE_BIT_EXT 0x00000004
|
||||
#define GLX_BIND_TO_TEXTURE_RGB_EXT 0x20D0
|
||||
#define GLX_BIND_TO_TEXTURE_RGBA_EXT 0x20D1
|
||||
#define GLX_BIND_TO_MIPMAP_TEXTURE_EXT 0x20D2
|
||||
#define GLX_BIND_TO_TEXTURE_TARGETS_EXT 0x20D3
|
||||
#define GLX_Y_INVERTED_EXT 0x20D4
|
||||
#define GLX_TEXTURE_FORMAT_EXT 0x20D5
|
||||
#define GLX_TEXTURE_TARGET_EXT 0x20D6
|
||||
#define GLX_MIPMAP_TEXTURE_EXT 0x20D7
|
||||
#define GLX_TEXTURE_FORMAT_NONE_EXT 0x20D8
|
||||
#define GLX_TEXTURE_FORMAT_RGB_EXT 0x20D9
|
||||
#define GLX_TEXTURE_FORMAT_RGBA_EXT 0x20DA
|
||||
#define GLX_TEXTURE_1D_EXT 0x20DB
|
||||
#define GLX_TEXTURE_2D_EXT 0x20DC
|
||||
#define GLX_TEXTURE_RECTANGLE_EXT 0x20DD
|
||||
#define GLX_FRONT_LEFT_EXT 0x20DE
|
||||
#define GLX_FRONT_RIGHT_EXT 0x20DF
|
||||
#define GLX_BACK_LEFT_EXT 0x20E0
|
||||
#define GLX_BACK_RIGHT_EXT 0x20E1
|
||||
#define GLX_FRONT_EXT 0x20DE
|
||||
#define GLX_BACK_EXT 0x20E0
|
||||
#define GLX_AUX0_EXT 0x20E2
|
||||
#define GLX_AUX1_EXT 0x20E3
|
||||
#define GLX_AUX2_EXT 0x20E4
|
||||
#define GLX_AUX3_EXT 0x20E5
|
||||
#define GLX_AUX4_EXT 0x20E6
|
||||
#define GLX_AUX5_EXT 0x20E7
|
||||
#define GLX_AUX6_EXT 0x20E8
|
||||
#define GLX_AUX7_EXT 0x20E9
|
||||
#define GLX_AUX8_EXT 0x20EA
|
||||
#define GLX_AUX9_EXT 0x20EB
|
||||
typedef void ( *PFNGLXBINDTEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
typedef void ( *PFNGLXRELEASETEXIMAGEEXTPROC) (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXBindTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer, const int *attrib_list);
|
||||
void glXReleaseTexImageEXT (Display *dpy, GLXDrawable drawable, int buffer);
|
||||
#endif
|
||||
#endif /* GLX_EXT_texture_from_pixmap */
|
||||
|
||||
#ifndef GLX_EXT_visual_info
|
||||
#define GLX_EXT_visual_info 1
|
||||
#define GLX_X_VISUAL_TYPE_EXT 0x22
|
||||
#define GLX_TRANSPARENT_TYPE_EXT 0x23
|
||||
#define GLX_TRANSPARENT_INDEX_VALUE_EXT 0x24
|
||||
#define GLX_TRANSPARENT_RED_VALUE_EXT 0x25
|
||||
#define GLX_TRANSPARENT_GREEN_VALUE_EXT 0x26
|
||||
#define GLX_TRANSPARENT_BLUE_VALUE_EXT 0x27
|
||||
#define GLX_TRANSPARENT_ALPHA_VALUE_EXT 0x28
|
||||
#define GLX_NONE_EXT 0x8000
|
||||
#define GLX_TRUE_COLOR_EXT 0x8002
|
||||
#define GLX_DIRECT_COLOR_EXT 0x8003
|
||||
#define GLX_PSEUDO_COLOR_EXT 0x8004
|
||||
#define GLX_STATIC_COLOR_EXT 0x8005
|
||||
#define GLX_GRAY_SCALE_EXT 0x8006
|
||||
#define GLX_STATIC_GRAY_EXT 0x8007
|
||||
#define GLX_TRANSPARENT_RGB_EXT 0x8008
|
||||
#define GLX_TRANSPARENT_INDEX_EXT 0x8009
|
||||
#endif /* GLX_EXT_visual_info */
|
||||
|
||||
#ifndef GLX_EXT_visual_rating
|
||||
#define GLX_EXT_visual_rating 1
|
||||
#define GLX_VISUAL_CAVEAT_EXT 0x20
|
||||
#define GLX_SLOW_VISUAL_EXT 0x8001
|
||||
#define GLX_NON_CONFORMANT_VISUAL_EXT 0x800D
|
||||
#endif /* GLX_EXT_visual_rating */
|
||||
|
||||
#ifndef GLX_INTEL_swap_event
|
||||
#define GLX_INTEL_swap_event 1
|
||||
#define GLX_BUFFER_SWAP_COMPLETE_INTEL_MASK 0x04000000
|
||||
#define GLX_EXCHANGE_COMPLETE_INTEL 0x8180
|
||||
#define GLX_COPY_COMPLETE_INTEL 0x8181
|
||||
#define GLX_FLIP_COMPLETE_INTEL 0x8182
|
||||
#endif /* GLX_INTEL_swap_event */
|
||||
|
||||
#ifndef GLX_MESA_agp_offset
|
||||
#define GLX_MESA_agp_offset 1
|
||||
typedef unsigned int ( *PFNGLXGETAGPOFFSETMESAPROC) (const void *pointer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
unsigned int glXGetAGPOffsetMESA (const void *pointer);
|
||||
#endif
|
||||
#endif /* GLX_MESA_agp_offset */
|
||||
|
||||
#ifndef GLX_MESA_copy_sub_buffer
|
||||
#define GLX_MESA_copy_sub_buffer 1
|
||||
typedef void ( *PFNGLXCOPYSUBBUFFERMESAPROC) (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopySubBufferMESA (Display *dpy, GLXDrawable drawable, int x, int y, int width, int height);
|
||||
#endif
|
||||
#endif /* GLX_MESA_copy_sub_buffer */
|
||||
|
||||
#ifndef GLX_MESA_pixmap_colormap
|
||||
#define GLX_MESA_pixmap_colormap 1
|
||||
typedef GLXPixmap ( *PFNGLXCREATEGLXPIXMAPMESAPROC) (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXPixmap glXCreateGLXPixmapMESA (Display *dpy, XVisualInfo *visual, Pixmap pixmap, Colormap cmap);
|
||||
#endif
|
||||
#endif /* GLX_MESA_pixmap_colormap */
|
||||
|
||||
#ifndef GLX_MESA_query_renderer
|
||||
#define GLX_MESA_query_renderer 1
|
||||
#define GLX_RENDERER_VENDOR_ID_MESA 0x8183
|
||||
#define GLX_RENDERER_DEVICE_ID_MESA 0x8184
|
||||
#define GLX_RENDERER_VERSION_MESA 0x8185
|
||||
#define GLX_RENDERER_ACCELERATED_MESA 0x8186
|
||||
#define GLX_RENDERER_VIDEO_MEMORY_MESA 0x8187
|
||||
#define GLX_RENDERER_UNIFIED_MEMORY_ARCHITECTURE_MESA 0x8188
|
||||
#define GLX_RENDERER_PREFERRED_PROFILE_MESA 0x8189
|
||||
#define GLX_RENDERER_OPENGL_CORE_PROFILE_VERSION_MESA 0x818A
|
||||
#define GLX_RENDERER_OPENGL_COMPATIBILITY_PROFILE_VERSION_MESA 0x818B
|
||||
#define GLX_RENDERER_OPENGL_ES_PROFILE_VERSION_MESA 0x818C
|
||||
#define GLX_RENDERER_OPENGL_ES2_PROFILE_VERSION_MESA 0x818D
|
||||
typedef Bool ( *PFNGLXQUERYCURRENTRENDERERINTEGERMESAPROC) (int attribute, unsigned int *value);
|
||||
typedef const char *( *PFNGLXQUERYCURRENTRENDERERSTRINGMESAPROC) (int attribute);
|
||||
typedef Bool ( *PFNGLXQUERYRENDERERINTEGERMESAPROC) (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
|
||||
typedef const char *( *PFNGLXQUERYRENDERERSTRINGMESAPROC) (Display *dpy, int screen, int renderer, int attribute);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXQueryCurrentRendererIntegerMESA (int attribute, unsigned int *value);
|
||||
const char *glXQueryCurrentRendererStringMESA (int attribute);
|
||||
Bool glXQueryRendererIntegerMESA (Display *dpy, int screen, int renderer, int attribute, unsigned int *value);
|
||||
const char *glXQueryRendererStringMESA (Display *dpy, int screen, int renderer, int attribute);
|
||||
#endif
|
||||
#endif /* GLX_MESA_query_renderer */
|
||||
|
||||
#ifndef GLX_MESA_release_buffers
|
||||
#define GLX_MESA_release_buffers 1
|
||||
typedef Bool ( *PFNGLXRELEASEBUFFERSMESAPROC) (Display *dpy, GLXDrawable drawable);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXReleaseBuffersMESA (Display *dpy, GLXDrawable drawable);
|
||||
#endif
|
||||
#endif /* GLX_MESA_release_buffers */
|
||||
|
||||
#ifndef GLX_MESA_set_3dfx_mode
|
||||
#define GLX_MESA_set_3dfx_mode 1
|
||||
#define GLX_3DFX_WINDOW_MODE_MESA 0x1
|
||||
#define GLX_3DFX_FULLSCREEN_MODE_MESA 0x2
|
||||
typedef GLboolean ( *PFNGLXSET3DFXMODEMESAPROC) (GLint mode);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLboolean glXSet3DfxModeMESA (GLint mode);
|
||||
#endif
|
||||
#endif /* GLX_MESA_set_3dfx_mode */
|
||||
|
||||
#ifndef GLX_MESA_swap_control
|
||||
#define GLX_MESA_swap_control 1
|
||||
typedef int ( *PFNGLXGETSWAPINTERVALMESAPROC) (void);
|
||||
typedef int ( *PFNGLXSWAPINTERVALMESAPROC) (unsigned int interval);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetSwapIntervalMESA (void);
|
||||
int glXSwapIntervalMESA (unsigned int interval);
|
||||
#endif
|
||||
#endif /* GLX_MESA_swap_control */
|
||||
|
||||
#ifndef GLX_NV_copy_buffer
|
||||
#define GLX_NV_copy_buffer 1
|
||||
typedef void ( *PFNGLXCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
typedef void ( *PFNGLXNAMEDCOPYBUFFERSUBDATANVPROC) (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
void glXNamedCopyBufferSubDataNV (Display *dpy, GLXContext readCtx, GLXContext writeCtx, GLuint readBuffer, GLuint writeBuffer, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size);
|
||||
#endif
|
||||
#endif /* GLX_NV_copy_buffer */
|
||||
|
||||
#ifndef GLX_NV_copy_image
|
||||
#define GLX_NV_copy_image 1
|
||||
typedef void ( *PFNGLXCOPYIMAGESUBDATANVPROC) (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCopyImageSubDataNV (Display *dpy, GLXContext srcCtx, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLXContext dstCtx, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* GLX_NV_copy_image */
|
||||
|
||||
#ifndef GLX_NV_delay_before_swap
|
||||
#define GLX_NV_delay_before_swap 1
|
||||
typedef Bool ( *PFNGLXDELAYBEFORESWAPNVPROC) (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXDelayBeforeSwapNV (Display *dpy, GLXDrawable drawable, GLfloat seconds);
|
||||
#endif
|
||||
#endif /* GLX_NV_delay_before_swap */
|
||||
|
||||
#ifndef GLX_NV_float_buffer
|
||||
#define GLX_NV_float_buffer 1
|
||||
#define GLX_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#endif /* GLX_NV_float_buffer */
|
||||
|
||||
#ifndef GLX_NV_multigpu_context
|
||||
#define GLX_NV_multigpu_context 1
|
||||
#define GLX_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA
|
||||
#define GLX_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB
|
||||
#define GLX_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC
|
||||
#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD
|
||||
#define GLX_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE
|
||||
#endif /* GLX_NV_multigpu_context */
|
||||
|
||||
#ifndef GLX_NV_multisample_coverage
|
||||
#define GLX_NV_multisample_coverage 1
|
||||
#define GLX_COVERAGE_SAMPLES_NV 100001
|
||||
#define GLX_COLOR_SAMPLES_NV 0x20B3
|
||||
#endif /* GLX_NV_multisample_coverage */
|
||||
|
||||
#ifndef GLX_NV_present_video
|
||||
#define GLX_NV_present_video 1
|
||||
#define GLX_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
typedef unsigned int *( *PFNGLXENUMERATEVIDEODEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef int ( *PFNGLXBINDVIDEODEVICENVPROC) (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
unsigned int *glXEnumerateVideoDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
int glXBindVideoDeviceNV (Display *dpy, unsigned int video_slot, unsigned int video_device, const int *attrib_list);
|
||||
#endif
|
||||
#endif /* GLX_NV_present_video */
|
||||
|
||||
#ifndef GLX_NV_robustness_video_memory_purge
|
||||
#define GLX_NV_robustness_video_memory_purge 1
|
||||
#define GLX_GENERATE_RESET_ON_VIDEO_MEMORY_PURGE_NV 0x20F7
|
||||
#endif /* GLX_NV_robustness_video_memory_purge */
|
||||
|
||||
#ifndef GLX_NV_swap_group
|
||||
#define GLX_NV_swap_group 1
|
||||
typedef Bool ( *PFNGLXJOINSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
typedef Bool ( *PFNGLXBINDSWAPBARRIERNVPROC) (Display *dpy, GLuint group, GLuint barrier);
|
||||
typedef Bool ( *PFNGLXQUERYSWAPGROUPNVPROC) (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
typedef Bool ( *PFNGLXQUERYMAXSWAPGROUPSNVPROC) (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef Bool ( *PFNGLXQUERYFRAMECOUNTNVPROC) (Display *dpy, int screen, GLuint *count);
|
||||
typedef Bool ( *PFNGLXRESETFRAMECOUNTNVPROC) (Display *dpy, int screen);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXJoinSwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint group);
|
||||
Bool glXBindSwapBarrierNV (Display *dpy, GLuint group, GLuint barrier);
|
||||
Bool glXQuerySwapGroupNV (Display *dpy, GLXDrawable drawable, GLuint *group, GLuint *barrier);
|
||||
Bool glXQueryMaxSwapGroupsNV (Display *dpy, int screen, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
Bool glXQueryFrameCountNV (Display *dpy, int screen, GLuint *count);
|
||||
Bool glXResetFrameCountNV (Display *dpy, int screen);
|
||||
#endif
|
||||
#endif /* GLX_NV_swap_group */
|
||||
|
||||
#ifndef GLX_NV_video_capture
|
||||
#define GLX_NV_video_capture 1
|
||||
typedef XID GLXVideoCaptureDeviceNV;
|
||||
#define GLX_DEVICE_ID_NV 0x20CD
|
||||
#define GLX_UNIQUE_ID_NV 0x20CE
|
||||
#define GLX_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef int ( *PFNGLXBINDVIDEOCAPTUREDEVICENVPROC) (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
typedef GLXVideoCaptureDeviceNV *( *PFNGLXENUMERATEVIDEOCAPTUREDEVICESNVPROC) (Display *dpy, int screen, int *nelements);
|
||||
typedef void ( *PFNGLXLOCKVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
typedef int ( *PFNGLXQUERYVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
typedef void ( *PFNGLXRELEASEVIDEOCAPTUREDEVICENVPROC) (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXBindVideoCaptureDeviceNV (Display *dpy, unsigned int video_capture_slot, GLXVideoCaptureDeviceNV device);
|
||||
GLXVideoCaptureDeviceNV *glXEnumerateVideoCaptureDevicesNV (Display *dpy, int screen, int *nelements);
|
||||
void glXLockVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
int glXQueryVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device, int attribute, int *value);
|
||||
void glXReleaseVideoCaptureDeviceNV (Display *dpy, GLXVideoCaptureDeviceNV device);
|
||||
#endif
|
||||
#endif /* GLX_NV_video_capture */
|
||||
|
||||
#ifndef GLX_NV_video_out
|
||||
#define GLX_NV_video_out 1
|
||||
typedef unsigned int GLXVideoDeviceNV;
|
||||
#define GLX_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define GLX_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define GLX_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define GLX_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define GLX_VIDEO_OUT_FRAME_NV 0x20C8
|
||||
#define GLX_VIDEO_OUT_FIELD_1_NV 0x20C9
|
||||
#define GLX_VIDEO_OUT_FIELD_2_NV 0x20CA
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_1_2_NV 0x20CB
|
||||
#define GLX_VIDEO_OUT_STACKED_FIELDS_2_1_NV 0x20CC
|
||||
typedef int ( *PFNGLXGETVIDEODEVICENVPROC) (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
typedef int ( *PFNGLXRELEASEVIDEODEVICENVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
typedef int ( *PFNGLXBINDVIDEOIMAGENVPROC) (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
typedef int ( *PFNGLXRELEASEVIDEOIMAGENVPROC) (Display *dpy, GLXPbuffer pbuf);
|
||||
typedef int ( *PFNGLXSENDPBUFFERTOVIDEONVPROC) (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
typedef int ( *PFNGLXGETVIDEOINFONVPROC) (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetVideoDeviceNV (Display *dpy, int screen, int numVideoDevices, GLXVideoDeviceNV *pVideoDevice);
|
||||
int glXReleaseVideoDeviceNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice);
|
||||
int glXBindVideoImageNV (Display *dpy, GLXVideoDeviceNV VideoDevice, GLXPbuffer pbuf, int iVideoBuffer);
|
||||
int glXReleaseVideoImageNV (Display *dpy, GLXPbuffer pbuf);
|
||||
int glXSendPbufferToVideoNV (Display *dpy, GLXPbuffer pbuf, int iBufferType, unsigned long *pulCounterPbuffer, GLboolean bBlock);
|
||||
int glXGetVideoInfoNV (Display *dpy, int screen, GLXVideoDeviceNV VideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
#endif /* GLX_NV_video_out */
|
||||
|
||||
#ifndef GLX_OML_swap_method
|
||||
#define GLX_OML_swap_method 1
|
||||
#define GLX_SWAP_METHOD_OML 0x8060
|
||||
#define GLX_SWAP_EXCHANGE_OML 0x8061
|
||||
#define GLX_SWAP_COPY_OML 0x8062
|
||||
#define GLX_SWAP_UNDEFINED_OML 0x8063
|
||||
#endif /* GLX_OML_swap_method */
|
||||
|
||||
#ifndef GLX_OML_sync_control
|
||||
#define GLX_OML_sync_control 1
|
||||
#ifndef GLEXT_64_TYPES_DEFINED
|
||||
/* This code block is duplicated in glext.h, so must be protected */
|
||||
#define GLEXT_64_TYPES_DEFINED
|
||||
/* Define int32_t, int64_t, and uint64_t types for UST/MSC */
|
||||
/* (as used in the GLX_OML_sync_control extension). */
|
||||
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
||||
#include <inttypes.h>
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
#include <inttypes.h>
|
||||
#if defined(__STDC__)
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int int64_t;
|
||||
typedef unsigned long int uint64_t;
|
||||
#else
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#endif /* __STDC__ */
|
||||
#elif defined( __VMS ) || defined(__sgi)
|
||||
#include <inttypes.h>
|
||||
#elif defined(__SCO__) || defined(__USLC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(__UNIXOS2__) || defined(__SOL64__)
|
||||
typedef long int int32_t;
|
||||
typedef long long int int64_t;
|
||||
typedef unsigned long long int uint64_t;
|
||||
#elif defined(_WIN32) && defined(__GNUC__)
|
||||
#include <stdint.h>
|
||||
#elif defined(_WIN32)
|
||||
typedef __int32 int32_t;
|
||||
typedef __int64 int64_t;
|
||||
typedef unsigned __int64 uint64_t;
|
||||
#else
|
||||
/* Fallback if nothing above works */
|
||||
#include <inttypes.h>
|
||||
#endif
|
||||
#endif
|
||||
typedef Bool ( *PFNGLXGETSYNCVALUESOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( *PFNGLXGETMSCRATEOMLPROC) (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
typedef int64_t ( *PFNGLXSWAPBUFFERSMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
typedef Bool ( *PFNGLXWAITFORMSCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
typedef Bool ( *PFNGLXWAITFORSBCOMLPROC) (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXGetSyncValuesOML (Display *dpy, GLXDrawable drawable, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
Bool glXGetMscRateOML (Display *dpy, GLXDrawable drawable, int32_t *numerator, int32_t *denominator);
|
||||
int64_t glXSwapBuffersMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder);
|
||||
Bool glXWaitForMscOML (Display *dpy, GLXDrawable drawable, int64_t target_msc, int64_t divisor, int64_t remainder, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
Bool glXWaitForSbcOML (Display *dpy, GLXDrawable drawable, int64_t target_sbc, int64_t *ust, int64_t *msc, int64_t *sbc);
|
||||
#endif
|
||||
#endif /* GLX_OML_sync_control */
|
||||
|
||||
#ifndef GLX_SGIS_blended_overlay
|
||||
#define GLX_SGIS_blended_overlay 1
|
||||
#define GLX_BLENDED_RGBA_SGIS 0x8025
|
||||
#endif /* GLX_SGIS_blended_overlay */
|
||||
|
||||
#ifndef GLX_SGIS_multisample
|
||||
#define GLX_SGIS_multisample 1
|
||||
#define GLX_SAMPLE_BUFFERS_SGIS 100000
|
||||
#define GLX_SAMPLES_SGIS 100001
|
||||
#endif /* GLX_SGIS_multisample */
|
||||
|
||||
#ifndef GLX_SGIS_shared_multisample
|
||||
#define GLX_SGIS_shared_multisample 1
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_WIDTH_SGIS 0x8026
|
||||
#define GLX_MULTISAMPLE_SUB_RECT_HEIGHT_SGIS 0x8027
|
||||
#endif /* GLX_SGIS_shared_multisample */
|
||||
|
||||
#ifndef GLX_SGIX_dmbuffer
|
||||
#define GLX_SGIX_dmbuffer 1
|
||||
typedef XID GLXPbufferSGIX;
|
||||
#ifdef _DM_BUFFER_H_
|
||||
#define GLX_DIGITAL_MEDIA_PBUFFER_SGIX 0x8024
|
||||
typedef Bool ( *PFNGLXASSOCIATEDMPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXAssociateDMPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuffer, DMparams *params, DMbuffer dmbuffer);
|
||||
#endif
|
||||
#endif /* _DM_BUFFER_H_ */
|
||||
#endif /* GLX_SGIX_dmbuffer */
|
||||
|
||||
#ifndef GLX_SGIX_fbconfig
|
||||
#define GLX_SGIX_fbconfig 1
|
||||
typedef struct __GLXFBConfigRec *GLXFBConfigSGIX;
|
||||
#define GLX_WINDOW_BIT_SGIX 0x00000001
|
||||
#define GLX_PIXMAP_BIT_SGIX 0x00000002
|
||||
#define GLX_RGBA_BIT_SGIX 0x00000001
|
||||
#define GLX_COLOR_INDEX_BIT_SGIX 0x00000002
|
||||
#define GLX_DRAWABLE_TYPE_SGIX 0x8010
|
||||
#define GLX_RENDER_TYPE_SGIX 0x8011
|
||||
#define GLX_X_RENDERABLE_SGIX 0x8012
|
||||
#define GLX_FBCONFIG_ID_SGIX 0x8013
|
||||
#define GLX_RGBA_TYPE_SGIX 0x8014
|
||||
#define GLX_COLOR_INDEX_TYPE_SGIX 0x8015
|
||||
typedef int ( *PFNGLXGETFBCONFIGATTRIBSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
typedef GLXFBConfigSGIX *( *PFNGLXCHOOSEFBCONFIGSGIXPROC) (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
typedef GLXPixmap ( *PFNGLXCREATEGLXPIXMAPWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
typedef GLXContext ( *PFNGLXCREATECONTEXTWITHCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
typedef XVisualInfo *( *PFNGLXGETVISUALFROMFBCONFIGSGIXPROC) (Display *dpy, GLXFBConfigSGIX config);
|
||||
typedef GLXFBConfigSGIX ( *PFNGLXGETFBCONFIGFROMVISUALSGIXPROC) (Display *dpy, XVisualInfo *vis);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetFBConfigAttribSGIX (Display *dpy, GLXFBConfigSGIX config, int attribute, int *value);
|
||||
GLXFBConfigSGIX *glXChooseFBConfigSGIX (Display *dpy, int screen, int *attrib_list, int *nelements);
|
||||
GLXPixmap glXCreateGLXPixmapWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, Pixmap pixmap);
|
||||
GLXContext glXCreateContextWithConfigSGIX (Display *dpy, GLXFBConfigSGIX config, int render_type, GLXContext share_list, Bool direct);
|
||||
XVisualInfo *glXGetVisualFromFBConfigSGIX (Display *dpy, GLXFBConfigSGIX config);
|
||||
GLXFBConfigSGIX glXGetFBConfigFromVisualSGIX (Display *dpy, XVisualInfo *vis);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_fbconfig */
|
||||
|
||||
#ifndef GLX_SGIX_hyperpipe
|
||||
#define GLX_SGIX_hyperpipe 1
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int networkId;
|
||||
} GLXHyperpipeNetworkSGIX;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int channel;
|
||||
unsigned int participationType;
|
||||
int timeSlice;
|
||||
} GLXHyperpipeConfigSGIX;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int srcXOrigin, srcYOrigin, srcWidth, srcHeight;
|
||||
int destXOrigin, destYOrigin, destWidth, destHeight;
|
||||
} GLXPipeRect;
|
||||
typedef struct {
|
||||
char pipeName[80]; /* Should be [GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX] */
|
||||
int XOrigin, YOrigin, maxHeight, maxWidth;
|
||||
} GLXPipeRectLimits;
|
||||
#define GLX_HYPERPIPE_PIPE_NAME_LENGTH_SGIX 80
|
||||
#define GLX_BAD_HYPERPIPE_CONFIG_SGIX 91
|
||||
#define GLX_BAD_HYPERPIPE_SGIX 92
|
||||
#define GLX_HYPERPIPE_DISPLAY_PIPE_SGIX 0x00000001
|
||||
#define GLX_HYPERPIPE_RENDER_PIPE_SGIX 0x00000002
|
||||
#define GLX_PIPE_RECT_SGIX 0x00000001
|
||||
#define GLX_PIPE_RECT_LIMITS_SGIX 0x00000002
|
||||
#define GLX_HYPERPIPE_STEREO_SGIX 0x00000003
|
||||
#define GLX_HYPERPIPE_PIXEL_AVERAGE_SGIX 0x00000004
|
||||
#define GLX_HYPERPIPE_ID_SGIX 0x8030
|
||||
typedef GLXHyperpipeNetworkSGIX *( *PFNGLXQUERYHYPERPIPENETWORKSGIXPROC) (Display *dpy, int *npipes);
|
||||
typedef int ( *PFNGLXHYPERPIPECONFIGSGIXPROC) (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
typedef GLXHyperpipeConfigSGIX *( *PFNGLXQUERYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId, int *npipes);
|
||||
typedef int ( *PFNGLXDESTROYHYPERPIPECONFIGSGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( *PFNGLXBINDHYPERPIPESGIXPROC) (Display *dpy, int hpId);
|
||||
typedef int ( *PFNGLXQUERYHYPERPIPEBESTATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
typedef int ( *PFNGLXHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
typedef int ( *PFNGLXQUERYHYPERPIPEATTRIBSGIXPROC) (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXHyperpipeNetworkSGIX *glXQueryHyperpipeNetworkSGIX (Display *dpy, int *npipes);
|
||||
int glXHyperpipeConfigSGIX (Display *dpy, int networkId, int npipes, GLXHyperpipeConfigSGIX *cfg, int *hpId);
|
||||
GLXHyperpipeConfigSGIX *glXQueryHyperpipeConfigSGIX (Display *dpy, int hpId, int *npipes);
|
||||
int glXDestroyHyperpipeConfigSGIX (Display *dpy, int hpId);
|
||||
int glXBindHyperpipeSGIX (Display *dpy, int hpId);
|
||||
int glXQueryHyperpipeBestAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList, void *returnAttribList);
|
||||
int glXHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *attribList);
|
||||
int glXQueryHyperpipeAttribSGIX (Display *dpy, int timeSlice, int attrib, int size, void *returnAttribList);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_hyperpipe */
|
||||
|
||||
#ifndef GLX_SGIX_pbuffer
|
||||
#define GLX_SGIX_pbuffer 1
|
||||
#define GLX_PBUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BUFFER_CLOBBER_MASK_SGIX 0x08000000
|
||||
#define GLX_FRONT_LEFT_BUFFER_BIT_SGIX 0x00000001
|
||||
#define GLX_FRONT_RIGHT_BUFFER_BIT_SGIX 0x00000002
|
||||
#define GLX_BACK_LEFT_BUFFER_BIT_SGIX 0x00000004
|
||||
#define GLX_BACK_RIGHT_BUFFER_BIT_SGIX 0x00000008
|
||||
#define GLX_AUX_BUFFERS_BIT_SGIX 0x00000010
|
||||
#define GLX_DEPTH_BUFFER_BIT_SGIX 0x00000020
|
||||
#define GLX_STENCIL_BUFFER_BIT_SGIX 0x00000040
|
||||
#define GLX_ACCUM_BUFFER_BIT_SGIX 0x00000080
|
||||
#define GLX_SAMPLE_BUFFERS_BIT_SGIX 0x00000100
|
||||
#define GLX_MAX_PBUFFER_WIDTH_SGIX 0x8016
|
||||
#define GLX_MAX_PBUFFER_HEIGHT_SGIX 0x8017
|
||||
#define GLX_MAX_PBUFFER_PIXELS_SGIX 0x8018
|
||||
#define GLX_OPTIMAL_PBUFFER_WIDTH_SGIX 0x8019
|
||||
#define GLX_OPTIMAL_PBUFFER_HEIGHT_SGIX 0x801A
|
||||
#define GLX_PRESERVED_CONTENTS_SGIX 0x801B
|
||||
#define GLX_LARGEST_PBUFFER_SGIX 0x801C
|
||||
#define GLX_WIDTH_SGIX 0x801D
|
||||
#define GLX_HEIGHT_SGIX 0x801E
|
||||
#define GLX_EVENT_MASK_SGIX 0x801F
|
||||
#define GLX_DAMAGED_SGIX 0x8020
|
||||
#define GLX_SAVED_SGIX 0x8021
|
||||
#define GLX_WINDOW_SGIX 0x8022
|
||||
#define GLX_PBUFFER_SGIX 0x8023
|
||||
typedef GLXPbufferSGIX ( *PFNGLXCREATEGLXPBUFFERSGIXPROC) (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
typedef void ( *PFNGLXDESTROYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
typedef void ( *PFNGLXQUERYGLXPBUFFERSGIXPROC) (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
typedef void ( *PFNGLXSELECTEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
typedef void ( *PFNGLXGETSELECTEDEVENTSGIXPROC) (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXPbufferSGIX glXCreateGLXPbufferSGIX (Display *dpy, GLXFBConfigSGIX config, unsigned int width, unsigned int height, int *attrib_list);
|
||||
void glXDestroyGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf);
|
||||
void glXQueryGLXPbufferSGIX (Display *dpy, GLXPbufferSGIX pbuf, int attribute, unsigned int *value);
|
||||
void glXSelectEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long mask);
|
||||
void glXGetSelectedEventSGIX (Display *dpy, GLXDrawable drawable, unsigned long *mask);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_pbuffer */
|
||||
|
||||
#ifndef GLX_SGIX_swap_barrier
|
||||
#define GLX_SGIX_swap_barrier 1
|
||||
typedef void ( *PFNGLXBINDSWAPBARRIERSGIXPROC) (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
typedef Bool ( *PFNGLXQUERYMAXSWAPBARRIERSSGIXPROC) (Display *dpy, int screen, int *max);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXBindSwapBarrierSGIX (Display *dpy, GLXDrawable drawable, int barrier);
|
||||
Bool glXQueryMaxSwapBarriersSGIX (Display *dpy, int screen, int *max);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_swap_barrier */
|
||||
|
||||
#ifndef GLX_SGIX_swap_group
|
||||
#define GLX_SGIX_swap_group 1
|
||||
typedef void ( *PFNGLXJOINSWAPGROUPSGIXPROC) (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXJoinSwapGroupSGIX (Display *dpy, GLXDrawable drawable, GLXDrawable member);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_swap_group */
|
||||
|
||||
#ifndef GLX_SGIX_video_resize
|
||||
#define GLX_SGIX_video_resize 1
|
||||
#define GLX_SYNC_FRAME_SGIX 0x00000000
|
||||
#define GLX_SYNC_SWAP_SGIX 0x00000001
|
||||
typedef int ( *PFNGLXBINDCHANNELTOWINDOWSGIXPROC) (Display *display, int screen, int channel, Window window);
|
||||
typedef int ( *PFNGLXCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
typedef int ( *PFNGLXQUERYCHANNELRECTSGIXPROC) (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
typedef int ( *PFNGLXQUERYCHANNELDELTASSGIXPROC) (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
typedef int ( *PFNGLXCHANNELRECTSYNCSGIXPROC) (Display *display, int screen, int channel, GLenum synctype);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXBindChannelToWindowSGIX (Display *display, int screen, int channel, Window window);
|
||||
int glXChannelRectSGIX (Display *display, int screen, int channel, int x, int y, int w, int h);
|
||||
int glXQueryChannelRectSGIX (Display *display, int screen, int channel, int *dx, int *dy, int *dw, int *dh);
|
||||
int glXQueryChannelDeltasSGIX (Display *display, int screen, int channel, int *x, int *y, int *w, int *h);
|
||||
int glXChannelRectSyncSGIX (Display *display, int screen, int channel, GLenum synctype);
|
||||
#endif
|
||||
#endif /* GLX_SGIX_video_resize */
|
||||
|
||||
#ifndef GLX_SGIX_video_source
|
||||
#define GLX_SGIX_video_source 1
|
||||
typedef XID GLXVideoSourceSGIX;
|
||||
#ifdef _VL_H
|
||||
typedef GLXVideoSourceSGIX ( *PFNGLXCREATEGLXVIDEOSOURCESGIXPROC) (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
typedef void ( *PFNGLXDESTROYGLXVIDEOSOURCESGIXPROC) (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
GLXVideoSourceSGIX glXCreateGLXVideoSourceSGIX (Display *display, int screen, VLServer server, VLPath path, int nodeClass, VLNode drainNode);
|
||||
void glXDestroyGLXVideoSourceSGIX (Display *dpy, GLXVideoSourceSGIX glxvideosource);
|
||||
#endif
|
||||
#endif /* _VL_H */
|
||||
#endif /* GLX_SGIX_video_source */
|
||||
|
||||
#ifndef GLX_SGIX_visual_select_group
|
||||
#define GLX_SGIX_visual_select_group 1
|
||||
#define GLX_VISUAL_SELECT_GROUP_SGIX 0x8028
|
||||
#endif /* GLX_SGIX_visual_select_group */
|
||||
|
||||
#ifndef GLX_SGI_cushion
|
||||
#define GLX_SGI_cushion 1
|
||||
typedef void ( *PFNGLXCUSHIONSGIPROC) (Display *dpy, Window window, float cushion);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
void glXCushionSGI (Display *dpy, Window window, float cushion);
|
||||
#endif
|
||||
#endif /* GLX_SGI_cushion */
|
||||
|
||||
#ifndef GLX_SGI_make_current_read
|
||||
#define GLX_SGI_make_current_read 1
|
||||
typedef Bool ( *PFNGLXMAKECURRENTREADSGIPROC) (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
typedef GLXDrawable ( *PFNGLXGETCURRENTREADDRAWABLESGIPROC) (void);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Bool glXMakeCurrentReadSGI (Display *dpy, GLXDrawable draw, GLXDrawable read, GLXContext ctx);
|
||||
GLXDrawable glXGetCurrentReadDrawableSGI (void);
|
||||
#endif
|
||||
#endif /* GLX_SGI_make_current_read */
|
||||
|
||||
#ifndef GLX_SGI_swap_control
|
||||
#define GLX_SGI_swap_control 1
|
||||
typedef int ( *PFNGLXSWAPINTERVALSGIPROC) (int interval);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXSwapIntervalSGI (int interval);
|
||||
#endif
|
||||
#endif /* GLX_SGI_swap_control */
|
||||
|
||||
#ifndef GLX_SGI_video_sync
|
||||
#define GLX_SGI_video_sync 1
|
||||
typedef int ( *PFNGLXGETVIDEOSYNCSGIPROC) (unsigned int *count);
|
||||
typedef int ( *PFNGLXWAITVIDEOSYNCSGIPROC) (int divisor, int remainder, unsigned int *count);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
int glXGetVideoSyncSGI (unsigned int *count);
|
||||
int glXWaitVideoSyncSGI (int divisor, int remainder, unsigned int *count);
|
||||
#endif
|
||||
#endif /* GLX_SGI_video_sync */
|
||||
|
||||
#ifndef GLX_SUN_get_transparent_index
|
||||
#define GLX_SUN_get_transparent_index 1
|
||||
typedef Status ( *PFNGLXGETTRANSPARENTINDEXSUNPROC) (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);
|
||||
#ifdef GLX_GLXEXT_PROTOTYPES
|
||||
Status glXGetTransparentIndexSUN (Display *dpy, Window overlay, Window underlay, unsigned long *pTransparentIndex);
|
||||
#endif
|
||||
#endif /* GLX_SUN_get_transparent_index */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,450 @@
|
||||
/*
|
||||
* Mesa 3-D graphics library
|
||||
*
|
||||
* Copyright 2016 Advanced Micro Devices, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
* to deal in the Software without restriction, including without limitation
|
||||
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
|
||||
* and/or sell copies of the Software, and to permit persons to whom the
|
||||
* Software is furnished to do so, subject to the following conditions:
|
||||
*
|
||||
* The above copyright notice and this permission notice shall be included
|
||||
* in all copies or substantial portions of the Software.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
|
||||
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
||||
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||
* OTHER DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
/* Mesa OpenGL inter-driver interoperability interface designed for but not
|
||||
* limited to OpenCL.
|
||||
*
|
||||
* This is a driver-agnostic, backward-compatible interface. The structures
|
||||
* are only allowed to grow. They can never shrink and their members can
|
||||
* never be removed, renamed, or redefined.
|
||||
*
|
||||
* The interface doesn't return a lot of static texture parameters like
|
||||
* width, height, etc. It mainly returns mutable buffer and texture view
|
||||
* parameters that can't be part of the texture allocation (because they are
|
||||
* mutable). If drivers want to return more data or want to return static
|
||||
* allocation parameters, they can do it in one of these two ways:
|
||||
* - attaching the data to the DMABUF handle in a driver-specific way
|
||||
* - passing the data via "out_driver_data" in the "in" structure.
|
||||
*
|
||||
* Mesa is expected to do a lot of error checking on behalf of OpenCL, such
|
||||
* as checking the target, miplevel, and texture completeness.
|
||||
*
|
||||
* OpenCL, on the other hand, needs to check if the display+context combo
|
||||
* is compatible with the OpenCL driver by querying the device information.
|
||||
* It also needs to check if the texture internal format and channel ordering
|
||||
* (returned in a driver-specific way) is supported by OpenCL, among other
|
||||
* things.
|
||||
*/
|
||||
|
||||
#ifndef MESA_GLINTEROP_H
|
||||
#define MESA_GLINTEROP_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Forward declarations to avoid inclusion of GL/glx.h */
|
||||
#ifndef GLX_H
|
||||
struct _XDisplay;
|
||||
struct __GLXcontextRec;
|
||||
#endif
|
||||
|
||||
/* Forward declarations to avoid inclusion of EGL/egl.h */
|
||||
#ifndef __egl_h_
|
||||
typedef void *EGLDisplay;
|
||||
typedef void *EGLContext;
|
||||
#endif
|
||||
|
||||
#ifndef _WINDEF_
|
||||
struct HDC__;
|
||||
typedef struct HDC__ *HDC;
|
||||
struct HGLRC__;
|
||||
typedef struct HGLRC__ *HGLRC;
|
||||
typedef void *HANDLE;
|
||||
#endif
|
||||
|
||||
typedef struct __GLsync *GLsync;
|
||||
|
||||
/** Returned error codes. */
|
||||
enum {
|
||||
MESA_GLINTEROP_SUCCESS = 0,
|
||||
MESA_GLINTEROP_OUT_OF_RESOURCES,
|
||||
MESA_GLINTEROP_OUT_OF_HOST_MEMORY,
|
||||
MESA_GLINTEROP_INVALID_OPERATION,
|
||||
MESA_GLINTEROP_INVALID_VERSION,
|
||||
MESA_GLINTEROP_INVALID_DISPLAY,
|
||||
MESA_GLINTEROP_INVALID_CONTEXT,
|
||||
MESA_GLINTEROP_INVALID_TARGET,
|
||||
MESA_GLINTEROP_INVALID_OBJECT,
|
||||
MESA_GLINTEROP_INVALID_MIP_LEVEL,
|
||||
MESA_GLINTEROP_UNSUPPORTED
|
||||
};
|
||||
|
||||
/** Access flags. */
|
||||
enum {
|
||||
MESA_GLINTEROP_ACCESS_READ_WRITE = 0,
|
||||
MESA_GLINTEROP_ACCESS_READ_ONLY,
|
||||
MESA_GLINTEROP_ACCESS_WRITE_ONLY
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_DEVICE_INFO_VERSION 4
|
||||
|
||||
#define UUID_SIZE 16
|
||||
|
||||
/**
|
||||
* Device information returned by Mesa.
|
||||
*/
|
||||
struct mesa_glinterop_device_info {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_DEVICE_INFO_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* PCI location */
|
||||
uint32_t pci_segment_group;
|
||||
uint32_t pci_bus;
|
||||
uint32_t pci_device;
|
||||
uint32_t pci_function;
|
||||
|
||||
/* Device identification */
|
||||
uint32_t vendor_id;
|
||||
uint32_t device_id;
|
||||
|
||||
/* Structure version 1 ends here. */
|
||||
|
||||
/* Size of memory pointed to by out_driver_data. */
|
||||
uint32_t driver_data_size;
|
||||
|
||||
/* If the caller wants to query driver-specific data about the OpenGL
|
||||
* object, this should point to the memory where that data will be stored.
|
||||
* This is expected to be a temporary staging memory. The pointer is not
|
||||
* allowed to be saved for later use by Mesa.
|
||||
*/
|
||||
void *driver_data;
|
||||
|
||||
/* Structure version 2 ends here. */
|
||||
|
||||
char device_uuid[UUID_SIZE];
|
||||
|
||||
/* Structure version 3 ends here. */
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_EXPORT_IN_VERSION 2
|
||||
|
||||
/**
|
||||
* Input parameters to Mesa interop export functions.
|
||||
*/
|
||||
struct mesa_glinterop_export_in {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_IN_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* One of the following:
|
||||
* - GL_TEXTURE_BUFFER
|
||||
* - GL_TEXTURE_1D
|
||||
* - GL_TEXTURE_2D
|
||||
* - GL_TEXTURE_3D
|
||||
* - GL_TEXTURE_RECTANGLE
|
||||
* - GL_TEXTURE_1D_ARRAY
|
||||
* - GL_TEXTURE_2D_ARRAY
|
||||
* - GL_TEXTURE_CUBE_MAP_ARRAY
|
||||
* - GL_TEXTURE_CUBE_MAP
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_X
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_X
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_Y
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_Y
|
||||
* - GL_TEXTURE_CUBE_MAP_POSITIVE_Z
|
||||
* - GL_TEXTURE_CUBE_MAP_NEGATIVE_Z
|
||||
* - GL_TEXTURE_2D_MULTISAMPLE
|
||||
* - GL_TEXTURE_2D_MULTISAMPLE_ARRAY
|
||||
* - GL_TEXTURE_EXTERNAL_OES
|
||||
* - GL_RENDERBUFFER
|
||||
* - GL_ARRAY_BUFFER
|
||||
*/
|
||||
unsigned target;
|
||||
|
||||
/* If target is GL_ARRAY_BUFFER, it's a buffer object.
|
||||
* If target is GL_RENDERBUFFER, it's a renderbuffer object.
|
||||
* If target is GL_TEXTURE_*, it's a texture object.
|
||||
*/
|
||||
unsigned obj;
|
||||
|
||||
/* Mipmap level. Ignored for non-texture objects. */
|
||||
unsigned miplevel;
|
||||
|
||||
/* One of MESA_GLINTEROP_ACCESS_* flags. This describes how the exported
|
||||
* object is going to be used.
|
||||
*/
|
||||
uint32_t access;
|
||||
|
||||
/* Size of memory pointed to by out_driver_data. */
|
||||
uint32_t out_driver_data_size;
|
||||
|
||||
/* If the caller wants to query driver-specific data about the OpenGL
|
||||
* object, this should point to the memory where that data will be stored.
|
||||
* This is expected to be a temporary staging memory. The pointer is not
|
||||
* allowed to be saved for later use by Mesa.
|
||||
*/
|
||||
void *out_driver_data;
|
||||
/* Structure version 1 ends here. */
|
||||
|
||||
/* Structure version 2 starts here. */
|
||||
/* NOTE: Version 2 doesn't add any fields to input but redefines the
|
||||
* argument to flush call to `struct mesa_glinterop_flush_out *`
|
||||
* instead of `GLsync *` */
|
||||
/* Structure version 2 ends here. */
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_EXPORT_OUT_VERSION 2
|
||||
|
||||
/**
|
||||
* Outputs of Mesa interop export functions.
|
||||
*/
|
||||
struct mesa_glinterop_export_out {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_OUT_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
#ifndef _WIN32
|
||||
/* The DMABUF handle. It must be closed by the caller using the POSIX
|
||||
* close() function when it's not needed anymore. Mesa is not responsible
|
||||
* for closing the handle.
|
||||
*
|
||||
* Not closing the handle by the caller will lead to a resource leak,
|
||||
* will prevent releasing the GPU buffer, and may prevent creating new
|
||||
* DMABUF handles within the process.
|
||||
*/
|
||||
int dmabuf_fd;
|
||||
#else
|
||||
/* Same concept as a DMABUF, but for Windows/WDDM. It must be closed by
|
||||
* the caller using CloseHandle() when it's not needed anymore.
|
||||
*/
|
||||
HANDLE win32_handle;
|
||||
#endif
|
||||
|
||||
/* The mutable OpenGL internal format specified by glTextureView or
|
||||
* glTexBuffer. If the object is not one of those, the original internal
|
||||
* format specified by glTexStorage, glTexImage, or glRenderbufferStorage
|
||||
* will be returned.
|
||||
*/
|
||||
unsigned internal_format;
|
||||
|
||||
/* Buffer offset and size for GL_ARRAY_BUFFER and GL_TEXTURE_BUFFER.
|
||||
* This allows interop with suballocations (a buffer allocated within
|
||||
* a larger buffer).
|
||||
*
|
||||
* Parameters specified by glTexBufferRange for GL_TEXTURE_BUFFER are
|
||||
* applied to these and can shrink the range further.
|
||||
*/
|
||||
ptrdiff_t buf_offset;
|
||||
ptrdiff_t buf_size;
|
||||
|
||||
/* Parameters specified by glTextureView. If the object is not a texture
|
||||
* view, default parameters covering the whole texture will be returned.
|
||||
*/
|
||||
unsigned view_minlevel;
|
||||
unsigned view_numlevels;
|
||||
unsigned view_minlayer;
|
||||
unsigned view_numlayers;
|
||||
|
||||
/* The number of bytes written to out_driver_data. */
|
||||
uint32_t out_driver_data_written;
|
||||
/* Structure version 1 ends here. */
|
||||
|
||||
/* Structure version 2 starts here. */
|
||||
/* Texture sizes. If the object is not a texture, default parameters will
|
||||
* be returned.
|
||||
*/
|
||||
uint32_t width;
|
||||
uint32_t height;
|
||||
uint32_t depth;
|
||||
uint32_t stride;
|
||||
/* the modifier to use when reimporting the fd */
|
||||
uint64_t modifier;
|
||||
/* Structure version 2 ends here. */
|
||||
};
|
||||
|
||||
#define MESA_GLINTEROP_FLUSH_OUT_VERSION 1
|
||||
|
||||
/**
|
||||
* Outputs of Mesa interop flush functions.
|
||||
*/
|
||||
struct mesa_glinterop_flush_out {
|
||||
/* The caller should set this to the version of the struct they support */
|
||||
/* The callee will overwrite it if it supports a lower version.
|
||||
*
|
||||
* The caller should check the value and access up-to the version supported
|
||||
* by the callee.
|
||||
*/
|
||||
/* NOTE: Do not use the MESA_GLINTEROP_EXPORT_OUT_VERSION macro */
|
||||
uint32_t version;
|
||||
|
||||
/* GLsync to map to CL event, caller set it non-NULL to be filled */
|
||||
GLsync *sync;
|
||||
|
||||
/* fence_fd to use in CL, caller set it to non-NULL to be filled */
|
||||
int *fence_fd;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* Query device information.
|
||||
*
|
||||
* \param dpy GLX display
|
||||
* \param context GLX context
|
||||
* \param out where to return the information
|
||||
*
|
||||
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
|
||||
*/
|
||||
int
|
||||
MesaGLInteropGLXQueryDeviceInfo(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXQueryDeviceInfo except that it accepts EGLDisplay
|
||||
* and EGLContext.
|
||||
*/
|
||||
int
|
||||
MesaGLInteropEGLQueryDeviceInfo(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXQueryDeviceInfo except that it accepts HDC
|
||||
* and HGLRC.
|
||||
*/
|
||||
int
|
||||
wglMesaGLInteropQueryDeviceInfo(HDC dpy, HGLRC context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
|
||||
/**
|
||||
* Create and return a DMABUF handle corresponding to the given OpenGL
|
||||
* object, and return other parameters about the OpenGL object.
|
||||
*
|
||||
* \param dpy GLX display
|
||||
* \param context GLX context
|
||||
* \param in input parameters
|
||||
* \param out return values
|
||||
*
|
||||
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
|
||||
*/
|
||||
int
|
||||
MesaGLInteropGLXExportObject(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXExportObject except that it accepts
|
||||
* EGLDisplay and EGLContext.
|
||||
*/
|
||||
int
|
||||
MesaGLInteropEGLExportObject(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXExportObject except that it accepts
|
||||
* HDC and HGLRC.
|
||||
*/
|
||||
int
|
||||
wglMesaGLInteropExportObject(HDC dpy, HGLRC context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
|
||||
|
||||
/**
|
||||
* Prepare OpenGL resources for being accessed by OpenCL.
|
||||
*
|
||||
* \param dpy GLX display
|
||||
* \param context GLX context
|
||||
* \param count number of resources
|
||||
* \param resources resources to flush
|
||||
* \param out return values
|
||||
*
|
||||
* \return MESA_GLINTEROP_SUCCESS or MESA_GLINTEROP_* != 0 on error
|
||||
*/
|
||||
int
|
||||
MesaGLInteropGLXFlushObjects(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXFlushObjects except that it accepts
|
||||
* EGLDisplay and EGLContext.
|
||||
*/
|
||||
int
|
||||
MesaGLInteropEGLFlushObjects(EGLDisplay dpy, EGLContext context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
|
||||
/**
|
||||
* Same as MesaGLInteropGLXFlushObjects except that it accepts
|
||||
* HDC and HGLRC.
|
||||
*/
|
||||
int
|
||||
wglMesaGLInteropFlushObjects(HDC dpy, HGLRC context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
|
||||
|
||||
typedef int (*PFNMESAGLINTEROPGLXQUERYDEVICEINFOPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
typedef int (*PFNMESAGLINTEROPEGLQUERYDEVICEINFOPROC)(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
typedef int (*PFNWGLMESAGLINTEROPQUERYDEVICEINFOPROC)(HDC dpy, HGLRC context,
|
||||
struct mesa_glinterop_device_info *out);
|
||||
typedef int (*PFNMESAGLINTEROPGLXEXPORTOBJECTPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
typedef int (*PFNMESAGLINTEROPEGLEXPORTOBJECTPROC)(EGLDisplay dpy, EGLContext context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
typedef int (*PFNWGLMESAGLINTEROPEXPORTOBJECTPROC)(HDC dpy, HGLRC context,
|
||||
struct mesa_glinterop_export_in *in,
|
||||
struct mesa_glinterop_export_out *out);
|
||||
typedef int (*PFNMESAGLINTEROPGLXFLUSHOBJECTSPROC)(struct _XDisplay *dpy, struct __GLXcontextRec *context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
typedef int (*PFNMESAGLINTEROPEGLFLUSHOBJECTSPROC)(EGLDisplay dpy, EGLContext context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
typedef int (*PFNWGLMESAGLINTEROPFLUSHOBJECTSPROC)(HDC dpy, HGLRC context,
|
||||
unsigned count, struct mesa_glinterop_export_in *resources,
|
||||
struct mesa_glinterop_flush_out *out);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* MESA_GLINTEROP_H */
|
||||
@@ -0,0 +1,845 @@
|
||||
#ifndef __wgl_wglext_h_
|
||||
#define __wgl_wglext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** 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
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
|
||||
#define WIN32_LEAN_AND_MEAN 1
|
||||
#include <windows.h>
|
||||
#endif
|
||||
|
||||
#define WGL_WGLEXT_VERSION 20250203
|
||||
|
||||
/* Generated C header for:
|
||||
* API: wgl
|
||||
* Versions considered: .*
|
||||
* Versions emitted: _nomatch_^
|
||||
* Default extensions included: wgl
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef WGL_ARB_buffer_region
|
||||
#define WGL_ARB_buffer_region 1
|
||||
#define WGL_FRONT_COLOR_BUFFER_BIT_ARB 0x00000001
|
||||
#define WGL_BACK_COLOR_BUFFER_BIT_ARB 0x00000002
|
||||
#define WGL_DEPTH_BUFFER_BIT_ARB 0x00000004
|
||||
#define WGL_STENCIL_BUFFER_BIT_ARB 0x00000008
|
||||
typedef HANDLE (WINAPI * PFNWGLCREATEBUFFERREGIONARBPROC) (HDC hDC, int iLayerPlane, UINT uType);
|
||||
typedef VOID (WINAPI * PFNWGLDELETEBUFFERREGIONARBPROC) (HANDLE hRegion);
|
||||
typedef BOOL (WINAPI * PFNWGLSAVEBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height);
|
||||
typedef BOOL (WINAPI * PFNWGLRESTOREBUFFERREGIONARBPROC) (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HANDLE WINAPI wglCreateBufferRegionARB (HDC hDC, int iLayerPlane, UINT uType);
|
||||
VOID WINAPI wglDeleteBufferRegionARB (HANDLE hRegion);
|
||||
BOOL WINAPI wglSaveBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height);
|
||||
BOOL WINAPI wglRestoreBufferRegionARB (HANDLE hRegion, int x, int y, int width, int height, int xSrc, int ySrc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_buffer_region */
|
||||
|
||||
#ifndef WGL_ARB_context_flush_control
|
||||
#define WGL_ARB_context_flush_control 1
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_ARB 0x2097
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_NONE_ARB 0
|
||||
#define WGL_CONTEXT_RELEASE_BEHAVIOR_FLUSH_ARB 0x2098
|
||||
#endif /* WGL_ARB_context_flush_control */
|
||||
|
||||
#ifndef WGL_ARB_create_context
|
||||
#define WGL_ARB_create_context 1
|
||||
#define WGL_CONTEXT_DEBUG_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_FORWARD_COMPATIBLE_BIT_ARB 0x00000002
|
||||
#define WGL_CONTEXT_MAJOR_VERSION_ARB 0x2091
|
||||
#define WGL_CONTEXT_MINOR_VERSION_ARB 0x2092
|
||||
#define WGL_CONTEXT_LAYER_PLANE_ARB 0x2093
|
||||
#define WGL_CONTEXT_FLAGS_ARB 0x2094
|
||||
#define ERROR_INVALID_VERSION_ARB 0x2095
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATECONTEXTATTRIBSARBPROC) (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HGLRC WINAPI wglCreateContextAttribsARB (HDC hDC, HGLRC hShareContext, const int *attribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_create_context */
|
||||
|
||||
#ifndef WGL_ARB_create_context_no_error
|
||||
#define WGL_ARB_create_context_no_error 1
|
||||
#define WGL_CONTEXT_OPENGL_NO_ERROR_ARB 0x31B3
|
||||
#endif /* WGL_ARB_create_context_no_error */
|
||||
|
||||
#ifndef WGL_ARB_create_context_profile
|
||||
#define WGL_ARB_create_context_profile 1
|
||||
#define WGL_CONTEXT_PROFILE_MASK_ARB 0x9126
|
||||
#define WGL_CONTEXT_CORE_PROFILE_BIT_ARB 0x00000001
|
||||
#define WGL_CONTEXT_COMPATIBILITY_PROFILE_BIT_ARB 0x00000002
|
||||
#define ERROR_INVALID_PROFILE_ARB 0x2096
|
||||
#endif /* WGL_ARB_create_context_profile */
|
||||
|
||||
#ifndef WGL_ARB_create_context_robustness
|
||||
#define WGL_ARB_create_context_robustness 1
|
||||
#define WGL_CONTEXT_ROBUST_ACCESS_BIT_ARB 0x00000004
|
||||
#define WGL_LOSE_CONTEXT_ON_RESET_ARB 0x8252
|
||||
#define WGL_CONTEXT_RESET_NOTIFICATION_STRATEGY_ARB 0x8256
|
||||
#define WGL_NO_RESET_NOTIFICATION_ARB 0x8261
|
||||
#endif /* WGL_ARB_create_context_robustness */
|
||||
|
||||
#ifndef WGL_ARB_extensions_string
|
||||
#define WGL_ARB_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGARBPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringARB (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_ARB_extensions_string */
|
||||
|
||||
#ifndef WGL_ARB_framebuffer_sRGB
|
||||
#define WGL_ARB_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_ARB 0x20A9
|
||||
#endif /* WGL_ARB_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_ARB_make_current_read
|
||||
#define WGL_ARB_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_ARB 0x2043
|
||||
#define ERROR_INCOMPATIBLE_DEVICE_CONTEXTS_ARB 0x2054
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTARBPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCARBPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentARB (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCARB (void);
|
||||
#endif
|
||||
#endif /* WGL_ARB_make_current_read */
|
||||
|
||||
#ifndef WGL_ARB_multisample
|
||||
#define WGL_ARB_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_ARB 0x2041
|
||||
#define WGL_SAMPLES_ARB 0x2042
|
||||
#endif /* WGL_ARB_multisample */
|
||||
|
||||
#ifndef WGL_ARB_pbuffer
|
||||
#define WGL_ARB_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFERARB);
|
||||
#define WGL_DRAW_TO_PBUFFER_ARB 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_ARB 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_ARB 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_ARB 0x2030
|
||||
#define WGL_PBUFFER_LARGEST_ARB 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_ARB 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_ARB 0x2035
|
||||
#define WGL_PBUFFER_LOST_ARB 0x2036
|
||||
typedef HPBUFFERARB (WINAPI * PFNWGLCREATEPBUFFERARBPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCARBPROC) (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFERARBPROC) (HPBUFFERARB hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFERARBPROC) (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFERARB WINAPI wglCreatePbufferARB (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCARB (HPBUFFERARB hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCARB (HPBUFFERARB hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferARB (HPBUFFERARB hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferARB (HPBUFFERARB hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pbuffer */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format
|
||||
#define WGL_ARB_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_ARB 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_ARB 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_ARB 0x2002
|
||||
#define WGL_ACCELERATION_ARB 0x2003
|
||||
#define WGL_NEED_PALETTE_ARB 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_ARB 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_ARB 0x2006
|
||||
#define WGL_SWAP_METHOD_ARB 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_ARB 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_ARB 0x2009
|
||||
#define WGL_TRANSPARENT_ARB 0x200A
|
||||
#define WGL_TRANSPARENT_RED_VALUE_ARB 0x2037
|
||||
#define WGL_TRANSPARENT_GREEN_VALUE_ARB 0x2038
|
||||
#define WGL_TRANSPARENT_BLUE_VALUE_ARB 0x2039
|
||||
#define WGL_TRANSPARENT_ALPHA_VALUE_ARB 0x203A
|
||||
#define WGL_TRANSPARENT_INDEX_VALUE_ARB 0x203B
|
||||
#define WGL_SHARE_DEPTH_ARB 0x200C
|
||||
#define WGL_SHARE_STENCIL_ARB 0x200D
|
||||
#define WGL_SHARE_ACCUM_ARB 0x200E
|
||||
#define WGL_SUPPORT_GDI_ARB 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_ARB 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_ARB 0x2011
|
||||
#define WGL_STEREO_ARB 0x2012
|
||||
#define WGL_PIXEL_TYPE_ARB 0x2013
|
||||
#define WGL_COLOR_BITS_ARB 0x2014
|
||||
#define WGL_RED_BITS_ARB 0x2015
|
||||
#define WGL_RED_SHIFT_ARB 0x2016
|
||||
#define WGL_GREEN_BITS_ARB 0x2017
|
||||
#define WGL_GREEN_SHIFT_ARB 0x2018
|
||||
#define WGL_BLUE_BITS_ARB 0x2019
|
||||
#define WGL_BLUE_SHIFT_ARB 0x201A
|
||||
#define WGL_ALPHA_BITS_ARB 0x201B
|
||||
#define WGL_ALPHA_SHIFT_ARB 0x201C
|
||||
#define WGL_ACCUM_BITS_ARB 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_ARB 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_ARB 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_ARB 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_ARB 0x2021
|
||||
#define WGL_DEPTH_BITS_ARB 0x2022
|
||||
#define WGL_STENCIL_BITS_ARB 0x2023
|
||||
#define WGL_AUX_BUFFERS_ARB 0x2024
|
||||
#define WGL_NO_ACCELERATION_ARB 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_ARB 0x2026
|
||||
#define WGL_FULL_ACCELERATION_ARB 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_ARB 0x2028
|
||||
#define WGL_SWAP_COPY_ARB 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_ARB 0x202A
|
||||
#define WGL_TYPE_RGBA_ARB 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_ARB 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVARBPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATARBPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvARB (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, const int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatARB (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_ARB_pixel_format */
|
||||
|
||||
#ifndef WGL_ARB_pixel_format_float
|
||||
#define WGL_ARB_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ARB 0x21A0
|
||||
#endif /* WGL_ARB_pixel_format_float */
|
||||
|
||||
#ifndef WGL_ARB_render_texture
|
||||
#define WGL_ARB_render_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_RGB_ARB 0x2070
|
||||
#define WGL_BIND_TO_TEXTURE_RGBA_ARB 0x2071
|
||||
#define WGL_TEXTURE_FORMAT_ARB 0x2072
|
||||
#define WGL_TEXTURE_TARGET_ARB 0x2073
|
||||
#define WGL_MIPMAP_TEXTURE_ARB 0x2074
|
||||
#define WGL_TEXTURE_RGB_ARB 0x2075
|
||||
#define WGL_TEXTURE_RGBA_ARB 0x2076
|
||||
#define WGL_NO_TEXTURE_ARB 0x2077
|
||||
#define WGL_TEXTURE_CUBE_MAP_ARB 0x2078
|
||||
#define WGL_TEXTURE_1D_ARB 0x2079
|
||||
#define WGL_TEXTURE_2D_ARB 0x207A
|
||||
#define WGL_MIPMAP_LEVEL_ARB 0x207B
|
||||
#define WGL_CUBE_MAP_FACE_ARB 0x207C
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x207D
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x207E
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x207F
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x2080
|
||||
#define WGL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x2081
|
||||
#define WGL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x2082
|
||||
#define WGL_FRONT_LEFT_ARB 0x2083
|
||||
#define WGL_FRONT_RIGHT_ARB 0x2084
|
||||
#define WGL_BACK_LEFT_ARB 0x2085
|
||||
#define WGL_BACK_RIGHT_ARB 0x2086
|
||||
#define WGL_AUX0_ARB 0x2087
|
||||
#define WGL_AUX1_ARB 0x2088
|
||||
#define WGL_AUX2_ARB 0x2089
|
||||
#define WGL_AUX3_ARB 0x208A
|
||||
#define WGL_AUX4_ARB 0x208B
|
||||
#define WGL_AUX5_ARB 0x208C
|
||||
#define WGL_AUX6_ARB 0x208D
|
||||
#define WGL_AUX7_ARB 0x208E
|
||||
#define WGL_AUX8_ARB 0x208F
|
||||
#define WGL_AUX9_ARB 0x2090
|
||||
typedef BOOL (WINAPI * PFNWGLBINDTEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASETEXIMAGEARBPROC) (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSETPBUFFERATTRIBARBPROC) (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglReleaseTexImageARB (HPBUFFERARB hPbuffer, int iBuffer);
|
||||
BOOL WINAPI wglSetPbufferAttribARB (HPBUFFERARB hPbuffer, const int *piAttribList);
|
||||
#endif
|
||||
#endif /* WGL_ARB_render_texture */
|
||||
|
||||
#ifndef WGL_ARB_robustness_application_isolation
|
||||
#define WGL_ARB_robustness_application_isolation 1
|
||||
#define WGL_CONTEXT_RESET_ISOLATION_BIT_ARB 0x00000008
|
||||
#endif /* WGL_ARB_robustness_application_isolation */
|
||||
|
||||
#ifndef WGL_ARB_robustness_share_group_isolation
|
||||
#define WGL_ARB_robustness_share_group_isolation 1
|
||||
#endif /* WGL_ARB_robustness_share_group_isolation */
|
||||
|
||||
#ifndef WGL_3DFX_multisample
|
||||
#define WGL_3DFX_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_3DFX 0x2060
|
||||
#define WGL_SAMPLES_3DFX 0x2061
|
||||
#endif /* WGL_3DFX_multisample */
|
||||
|
||||
#ifndef WGL_3DL_stereo_control
|
||||
#define WGL_3DL_stereo_control 1
|
||||
#define WGL_STEREO_EMITTER_ENABLE_3DL 0x2055
|
||||
#define WGL_STEREO_EMITTER_DISABLE_3DL 0x2056
|
||||
#define WGL_STEREO_POLARITY_NORMAL_3DL 0x2057
|
||||
#define WGL_STEREO_POLARITY_INVERT_3DL 0x2058
|
||||
typedef BOOL (WINAPI * PFNWGLSETSTEREOEMITTERSTATE3DLPROC) (HDC hDC, UINT uState);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSetStereoEmitterState3DL (HDC hDC, UINT uState);
|
||||
#endif
|
||||
#endif /* WGL_3DL_stereo_control */
|
||||
|
||||
#ifndef WGL_AMD_gpu_association
|
||||
#define WGL_AMD_gpu_association 1
|
||||
#define WGL_GPU_VENDOR_AMD 0x1F00
|
||||
#define WGL_GPU_RENDERER_STRING_AMD 0x1F01
|
||||
#define WGL_GPU_OPENGL_VERSION_STRING_AMD 0x1F02
|
||||
#define WGL_GPU_FASTEST_TARGET_GPUS_AMD 0x21A2
|
||||
#define WGL_GPU_RAM_AMD 0x21A3
|
||||
#define WGL_GPU_CLOCK_AMD 0x21A4
|
||||
#define WGL_GPU_NUM_PIPES_AMD 0x21A5
|
||||
#define WGL_GPU_NUM_SIMD_AMD 0x21A6
|
||||
#define WGL_GPU_NUM_RB_AMD 0x21A7
|
||||
#define WGL_GPU_NUM_SPI_AMD 0x21A8
|
||||
typedef UINT (WINAPI * PFNWGLGETGPUIDSAMDPROC) (UINT maxCount, UINT *ids);
|
||||
typedef INT (WINAPI * PFNWGLGETGPUINFOAMDPROC) (UINT id, INT property, GLenum dataType, UINT size, void *data);
|
||||
typedef UINT (WINAPI * PFNWGLGETCONTEXTGPUIDAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTAMDPROC) (UINT id);
|
||||
typedef HGLRC (WINAPI * PFNWGLCREATEASSOCIATEDCONTEXTATTRIBSAMDPROC) (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEASSOCIATEDCONTEXTAMDPROC) (HGLRC hglrc);
|
||||
typedef BOOL (WINAPI * PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC) (HGLRC hglrc);
|
||||
typedef HGLRC (WINAPI * PFNWGLGETCURRENTASSOCIATEDCONTEXTAMDPROC) (void);
|
||||
typedef VOID (WINAPI * PFNWGLBLITCONTEXTFRAMEBUFFERAMDPROC) (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
UINT WINAPI wglGetGPUIDsAMD (UINT maxCount, UINT *ids);
|
||||
INT WINAPI wglGetGPUInfoAMD (UINT id, INT property, GLenum dataType, UINT size, void *data);
|
||||
UINT WINAPI wglGetContextGPUIDAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAMD (UINT id);
|
||||
HGLRC WINAPI wglCreateAssociatedContextAttribsAMD (UINT id, HGLRC hShareContext, const int *attribList);
|
||||
BOOL WINAPI wglDeleteAssociatedContextAMD (HGLRC hglrc);
|
||||
BOOL WINAPI wglMakeAssociatedContextCurrentAMD (HGLRC hglrc);
|
||||
HGLRC WINAPI wglGetCurrentAssociatedContextAMD (void);
|
||||
VOID WINAPI wglBlitContextFramebufferAMD (HGLRC dstCtx, GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
|
||||
#endif
|
||||
#endif /* WGL_AMD_gpu_association */
|
||||
|
||||
#ifndef WGL_ATI_pixel_format_float
|
||||
#define WGL_ATI_pixel_format_float 1
|
||||
#define WGL_TYPE_RGBA_FLOAT_ATI 0x21A0
|
||||
#endif /* WGL_ATI_pixel_format_float */
|
||||
|
||||
#ifndef WGL_ATI_render_texture_rectangle
|
||||
#define WGL_ATI_render_texture_rectangle 1
|
||||
#define WGL_TEXTURE_RECTANGLE_ATI 0x21A5
|
||||
#endif /* WGL_ATI_render_texture_rectangle */
|
||||
|
||||
#ifndef WGL_EXT_colorspace
|
||||
#define WGL_EXT_colorspace 1
|
||||
#define WGL_COLORSPACE_EXT 0x309D
|
||||
#define WGL_COLORSPACE_SRGB_EXT 0x3089
|
||||
#define WGL_COLORSPACE_LINEAR_EXT 0x308A
|
||||
#endif /* WGL_EXT_colorspace */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es2_profile
|
||||
#define WGL_EXT_create_context_es2_profile 1
|
||||
#define WGL_CONTEXT_ES2_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es2_profile */
|
||||
|
||||
#ifndef WGL_EXT_create_context_es_profile
|
||||
#define WGL_EXT_create_context_es_profile 1
|
||||
#define WGL_CONTEXT_ES_PROFILE_BIT_EXT 0x00000004
|
||||
#endif /* WGL_EXT_create_context_es_profile */
|
||||
|
||||
#ifndef WGL_EXT_depth_float
|
||||
#define WGL_EXT_depth_float 1
|
||||
#define WGL_DEPTH_FLOAT_EXT 0x2040
|
||||
#endif /* WGL_EXT_depth_float */
|
||||
|
||||
#ifndef WGL_EXT_display_color_table
|
||||
#define WGL_EXT_display_color_table 1
|
||||
typedef GLboolean (WINAPI * PFNWGLCREATEDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef GLboolean (WINAPI * PFNWGLLOADDISPLAYCOLORTABLEEXTPROC) (const GLushort *table, GLuint length);
|
||||
typedef GLboolean (WINAPI * PFNWGLBINDDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
typedef VOID (WINAPI * PFNWGLDESTROYDISPLAYCOLORTABLEEXTPROC) (GLushort id);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
GLboolean WINAPI wglCreateDisplayColorTableEXT (GLushort id);
|
||||
GLboolean WINAPI wglLoadDisplayColorTableEXT (const GLushort *table, GLuint length);
|
||||
GLboolean WINAPI wglBindDisplayColorTableEXT (GLushort id);
|
||||
VOID WINAPI wglDestroyDisplayColorTableEXT (GLushort id);
|
||||
#endif
|
||||
#endif /* WGL_EXT_display_color_table */
|
||||
|
||||
#ifndef WGL_EXT_extensions_string
|
||||
#define WGL_EXT_extensions_string 1
|
||||
typedef const char *(WINAPI * PFNWGLGETEXTENSIONSSTRINGEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
const char *WINAPI wglGetExtensionsStringEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_extensions_string */
|
||||
|
||||
#ifndef WGL_EXT_framebuffer_sRGB
|
||||
#define WGL_EXT_framebuffer_sRGB 1
|
||||
#define WGL_FRAMEBUFFER_SRGB_CAPABLE_EXT 0x20A9
|
||||
#endif /* WGL_EXT_framebuffer_sRGB */
|
||||
|
||||
#ifndef WGL_EXT_make_current_read
|
||||
#define WGL_EXT_make_current_read 1
|
||||
#define ERROR_INVALID_PIXEL_TYPE_EXT 0x2043
|
||||
typedef BOOL (WINAPI * PFNWGLMAKECONTEXTCURRENTEXTPROC) (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
typedef HDC (WINAPI * PFNWGLGETCURRENTREADDCEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglMakeContextCurrentEXT (HDC hDrawDC, HDC hReadDC, HGLRC hglrc);
|
||||
HDC WINAPI wglGetCurrentReadDCEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_make_current_read */
|
||||
|
||||
#ifndef WGL_EXT_multisample
|
||||
#define WGL_EXT_multisample 1
|
||||
#define WGL_SAMPLE_BUFFERS_EXT 0x2041
|
||||
#define WGL_SAMPLES_EXT 0x2042
|
||||
#endif /* WGL_EXT_multisample */
|
||||
|
||||
#ifndef WGL_EXT_pbuffer
|
||||
#define WGL_EXT_pbuffer 1
|
||||
DECLARE_HANDLE(HPBUFFEREXT);
|
||||
#define WGL_DRAW_TO_PBUFFER_EXT 0x202D
|
||||
#define WGL_MAX_PBUFFER_PIXELS_EXT 0x202E
|
||||
#define WGL_MAX_PBUFFER_WIDTH_EXT 0x202F
|
||||
#define WGL_MAX_PBUFFER_HEIGHT_EXT 0x2030
|
||||
#define WGL_OPTIMAL_PBUFFER_WIDTH_EXT 0x2031
|
||||
#define WGL_OPTIMAL_PBUFFER_HEIGHT_EXT 0x2032
|
||||
#define WGL_PBUFFER_LARGEST_EXT 0x2033
|
||||
#define WGL_PBUFFER_WIDTH_EXT 0x2034
|
||||
#define WGL_PBUFFER_HEIGHT_EXT 0x2035
|
||||
typedef HPBUFFEREXT (WINAPI * PFNWGLCREATEPBUFFEREXTPROC) (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
typedef HDC (WINAPI * PFNWGLGETPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef int (WINAPI * PFNWGLRELEASEPBUFFERDCEXTPROC) (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYPBUFFEREXTPROC) (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
HPBUFFEREXT WINAPI wglCreatePbufferEXT (HDC hDC, int iPixelFormat, int iWidth, int iHeight, const int *piAttribList);
|
||||
HDC WINAPI wglGetPbufferDCEXT (HPBUFFEREXT hPbuffer);
|
||||
int WINAPI wglReleasePbufferDCEXT (HPBUFFEREXT hPbuffer, HDC hDC);
|
||||
BOOL WINAPI wglDestroyPbufferEXT (HPBUFFEREXT hPbuffer);
|
||||
BOOL WINAPI wglQueryPbufferEXT (HPBUFFEREXT hPbuffer, int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pbuffer */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format
|
||||
#define WGL_EXT_pixel_format 1
|
||||
#define WGL_NUMBER_PIXEL_FORMATS_EXT 0x2000
|
||||
#define WGL_DRAW_TO_WINDOW_EXT 0x2001
|
||||
#define WGL_DRAW_TO_BITMAP_EXT 0x2002
|
||||
#define WGL_ACCELERATION_EXT 0x2003
|
||||
#define WGL_NEED_PALETTE_EXT 0x2004
|
||||
#define WGL_NEED_SYSTEM_PALETTE_EXT 0x2005
|
||||
#define WGL_SWAP_LAYER_BUFFERS_EXT 0x2006
|
||||
#define WGL_SWAP_METHOD_EXT 0x2007
|
||||
#define WGL_NUMBER_OVERLAYS_EXT 0x2008
|
||||
#define WGL_NUMBER_UNDERLAYS_EXT 0x2009
|
||||
#define WGL_TRANSPARENT_EXT 0x200A
|
||||
#define WGL_TRANSPARENT_VALUE_EXT 0x200B
|
||||
#define WGL_SHARE_DEPTH_EXT 0x200C
|
||||
#define WGL_SHARE_STENCIL_EXT 0x200D
|
||||
#define WGL_SHARE_ACCUM_EXT 0x200E
|
||||
#define WGL_SUPPORT_GDI_EXT 0x200F
|
||||
#define WGL_SUPPORT_OPENGL_EXT 0x2010
|
||||
#define WGL_DOUBLE_BUFFER_EXT 0x2011
|
||||
#define WGL_STEREO_EXT 0x2012
|
||||
#define WGL_PIXEL_TYPE_EXT 0x2013
|
||||
#define WGL_COLOR_BITS_EXT 0x2014
|
||||
#define WGL_RED_BITS_EXT 0x2015
|
||||
#define WGL_RED_SHIFT_EXT 0x2016
|
||||
#define WGL_GREEN_BITS_EXT 0x2017
|
||||
#define WGL_GREEN_SHIFT_EXT 0x2018
|
||||
#define WGL_BLUE_BITS_EXT 0x2019
|
||||
#define WGL_BLUE_SHIFT_EXT 0x201A
|
||||
#define WGL_ALPHA_BITS_EXT 0x201B
|
||||
#define WGL_ALPHA_SHIFT_EXT 0x201C
|
||||
#define WGL_ACCUM_BITS_EXT 0x201D
|
||||
#define WGL_ACCUM_RED_BITS_EXT 0x201E
|
||||
#define WGL_ACCUM_GREEN_BITS_EXT 0x201F
|
||||
#define WGL_ACCUM_BLUE_BITS_EXT 0x2020
|
||||
#define WGL_ACCUM_ALPHA_BITS_EXT 0x2021
|
||||
#define WGL_DEPTH_BITS_EXT 0x2022
|
||||
#define WGL_STENCIL_BITS_EXT 0x2023
|
||||
#define WGL_AUX_BUFFERS_EXT 0x2024
|
||||
#define WGL_NO_ACCELERATION_EXT 0x2025
|
||||
#define WGL_GENERIC_ACCELERATION_EXT 0x2026
|
||||
#define WGL_FULL_ACCELERATION_EXT 0x2027
|
||||
#define WGL_SWAP_EXCHANGE_EXT 0x2028
|
||||
#define WGL_SWAP_COPY_EXT 0x2029
|
||||
#define WGL_SWAP_UNDEFINED_EXT 0x202A
|
||||
#define WGL_TYPE_RGBA_EXT 0x202B
|
||||
#define WGL_TYPE_COLORINDEX_EXT 0x202C
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBIVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
typedef BOOL (WINAPI * PFNWGLGETPIXELFORMATATTRIBFVEXTPROC) (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
typedef BOOL (WINAPI * PFNWGLCHOOSEPIXELFORMATEXTPROC) (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetPixelFormatAttribivEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, int *piValues);
|
||||
BOOL WINAPI wglGetPixelFormatAttribfvEXT (HDC hdc, int iPixelFormat, int iLayerPlane, UINT nAttributes, int *piAttributes, FLOAT *pfValues);
|
||||
BOOL WINAPI wglChoosePixelFormatEXT (HDC hdc, const int *piAttribIList, const FLOAT *pfAttribFList, UINT nMaxFormats, int *piFormats, UINT *nNumFormats);
|
||||
#endif
|
||||
#endif /* WGL_EXT_pixel_format */
|
||||
|
||||
#ifndef WGL_EXT_pixel_format_packed_float
|
||||
#define WGL_EXT_pixel_format_packed_float 1
|
||||
#define WGL_TYPE_RGBA_UNSIGNED_FLOAT_EXT 0x20A8
|
||||
#endif /* WGL_EXT_pixel_format_packed_float */
|
||||
|
||||
#ifndef WGL_EXT_swap_control
|
||||
#define WGL_EXT_swap_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLSWAPINTERVALEXTPROC) (int interval);
|
||||
typedef int (WINAPI * PFNWGLGETSWAPINTERVALEXTPROC) (void);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglSwapIntervalEXT (int interval);
|
||||
int WINAPI wglGetSwapIntervalEXT (void);
|
||||
#endif
|
||||
#endif /* WGL_EXT_swap_control */
|
||||
|
||||
#ifndef WGL_EXT_swap_control_tear
|
||||
#define WGL_EXT_swap_control_tear 1
|
||||
#endif /* WGL_EXT_swap_control_tear */
|
||||
|
||||
#ifndef WGL_I3D_digital_video_control
|
||||
#define WGL_I3D_digital_video_control 1
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_FRAMEBUFFER_I3D 0x2050
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_ALPHA_VALUE_I3D 0x2051
|
||||
#define WGL_DIGITAL_VIDEO_CURSOR_INCLUDED_I3D 0x2052
|
||||
#define WGL_DIGITAL_VIDEO_GAMMA_CORRECTED_I3D 0x2053
|
||||
typedef BOOL (WINAPI * PFNWGLGETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETDIGITALVIDEOPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetDigitalVideoParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetDigitalVideoParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_digital_video_control */
|
||||
|
||||
#ifndef WGL_I3D_gamma
|
||||
#define WGL_I3D_gamma 1
|
||||
#define WGL_GAMMA_TABLE_SIZE_I3D 0x204E
|
||||
#define WGL_GAMMA_EXCLUDE_DESKTOP_I3D 0x204F
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEPARAMETERSI3DPROC) (HDC hDC, int iAttribute, const int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
typedef BOOL (WINAPI * PFNWGLSETGAMMATABLEI3DPROC) (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetGammaTableParametersI3D (HDC hDC, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglSetGammaTableParametersI3D (HDC hDC, int iAttribute, const int *piValue);
|
||||
BOOL WINAPI wglGetGammaTableI3D (HDC hDC, int iEntries, USHORT *puRed, USHORT *puGreen, USHORT *puBlue);
|
||||
BOOL WINAPI wglSetGammaTableI3D (HDC hDC, int iEntries, const USHORT *puRed, const USHORT *puGreen, const USHORT *puBlue);
|
||||
#endif
|
||||
#endif /* WGL_I3D_gamma */
|
||||
|
||||
#ifndef WGL_I3D_genlock
|
||||
#define WGL_I3D_genlock 1
|
||||
#define WGL_GENLOCK_SOURCE_MULTIVIEW_I3D 0x2044
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_SYNC_I3D 0x2045
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_FIELD_I3D 0x2046
|
||||
#define WGL_GENLOCK_SOURCE_EXTERNAL_TTL_I3D 0x2047
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_SYNC_I3D 0x2048
|
||||
#define WGL_GENLOCK_SOURCE_DIGITAL_FIELD_I3D 0x2049
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_FALLING_I3D 0x204A
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_RISING_I3D 0x204B
|
||||
#define WGL_GENLOCK_SOURCE_EDGE_BOTH_I3D 0x204C
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEGENLOCKI3DPROC) (HDC hDC);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDGENLOCKI3DPROC) (HDC hDC, BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEI3DPROC) (HDC hDC, UINT uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEI3DPROC) (HDC hDC, UINT *uSource);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEEDGEI3DPROC) (HDC hDC, UINT *uEdge);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSAMPLERATEI3DPROC) (HDC hDC, UINT *uRate);
|
||||
typedef BOOL (WINAPI * PFNWGLGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLGETGENLOCKSOURCEDELAYI3DPROC) (HDC hDC, UINT *uDelay);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYGENLOCKMAXSOURCEDELAYI3DPROC) (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglDisableGenlockI3D (HDC hDC);
|
||||
BOOL WINAPI wglIsEnabledGenlockI3D (HDC hDC, BOOL *pFlag);
|
||||
BOOL WINAPI wglGenlockSourceI3D (HDC hDC, UINT uSource);
|
||||
BOOL WINAPI wglGetGenlockSourceI3D (HDC hDC, UINT *uSource);
|
||||
BOOL WINAPI wglGenlockSourceEdgeI3D (HDC hDC, UINT uEdge);
|
||||
BOOL WINAPI wglGetGenlockSourceEdgeI3D (HDC hDC, UINT *uEdge);
|
||||
BOOL WINAPI wglGenlockSampleRateI3D (HDC hDC, UINT uRate);
|
||||
BOOL WINAPI wglGetGenlockSampleRateI3D (HDC hDC, UINT *uRate);
|
||||
BOOL WINAPI wglGenlockSourceDelayI3D (HDC hDC, UINT uDelay);
|
||||
BOOL WINAPI wglGetGenlockSourceDelayI3D (HDC hDC, UINT *uDelay);
|
||||
BOOL WINAPI wglQueryGenlockMaxSourceDelayI3D (HDC hDC, UINT *uMaxLineDelay, UINT *uMaxPixelDelay);
|
||||
#endif
|
||||
#endif /* WGL_I3D_genlock */
|
||||
|
||||
#ifndef WGL_I3D_image_buffer
|
||||
#define WGL_I3D_image_buffer 1
|
||||
#define WGL_IMAGE_BUFFER_MIN_ACCESS_I3D 0x00000001
|
||||
#define WGL_IMAGE_BUFFER_LOCK_I3D 0x00000002
|
||||
typedef LPVOID (WINAPI * PFNWGLCREATEIMAGEBUFFERI3DPROC) (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
typedef BOOL (WINAPI * PFNWGLDESTROYIMAGEBUFFERI3DPROC) (HDC hDC, LPVOID pAddress);
|
||||
typedef BOOL (WINAPI * PFNWGLASSOCIATEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEIMAGEBUFFEREVENTSI3DPROC) (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
LPVOID WINAPI wglCreateImageBufferI3D (HDC hDC, DWORD dwSize, UINT uFlags);
|
||||
BOOL WINAPI wglDestroyImageBufferI3D (HDC hDC, LPVOID pAddress);
|
||||
BOOL WINAPI wglAssociateImageBufferEventsI3D (HDC hDC, const HANDLE *pEvent, const LPVOID *pAddress, const DWORD *pSize, UINT count);
|
||||
BOOL WINAPI wglReleaseImageBufferEventsI3D (HDC hDC, const LPVOID *pAddress, UINT count);
|
||||
#endif
|
||||
#endif /* WGL_I3D_image_buffer */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_lock
|
||||
#define WGL_I3D_swap_frame_lock 1
|
||||
typedef BOOL (WINAPI * PFNWGLENABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLDISABLEFRAMELOCKI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLISENABLEDFRAMELOCKI3DPROC) (BOOL *pFlag);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMELOCKMASTERI3DPROC) (BOOL *pFlag);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnableFrameLockI3D (void);
|
||||
BOOL WINAPI wglDisableFrameLockI3D (void);
|
||||
BOOL WINAPI wglIsEnabledFrameLockI3D (BOOL *pFlag);
|
||||
BOOL WINAPI wglQueryFrameLockMasterI3D (BOOL *pFlag);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_lock */
|
||||
|
||||
#ifndef WGL_I3D_swap_frame_usage
|
||||
#define WGL_I3D_swap_frame_usage 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETFRAMEUSAGEI3DPROC) (float *pUsage);
|
||||
typedef BOOL (WINAPI * PFNWGLBEGINFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLENDFRAMETRACKINGI3DPROC) (void);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMETRACKINGI3DPROC) (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetFrameUsageI3D (float *pUsage);
|
||||
BOOL WINAPI wglBeginFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglEndFrameTrackingI3D (void);
|
||||
BOOL WINAPI wglQueryFrameTrackingI3D (DWORD *pFrameCount, DWORD *pMissedFrames, float *pLastMissedUsage);
|
||||
#endif
|
||||
#endif /* WGL_I3D_swap_frame_usage */
|
||||
|
||||
#ifndef WGL_NV_DX_interop
|
||||
#define WGL_NV_DX_interop 1
|
||||
#define WGL_ACCESS_READ_ONLY_NV 0x00000000
|
||||
#define WGL_ACCESS_READ_WRITE_NV 0x00000001
|
||||
#define WGL_ACCESS_WRITE_DISCARD_NV 0x00000002
|
||||
typedef BOOL (WINAPI * PFNWGLDXSETRESOURCESHAREHANDLENVPROC) (void *dxObject, HANDLE shareHandle);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXOPENDEVICENVPROC) (void *dxDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLDXCLOSEDEVICENVPROC) (HANDLE hDevice);
|
||||
typedef HANDLE (WINAPI * PFNWGLDXREGISTEROBJECTNVPROC) (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNREGISTEROBJECTNVPROC) (HANDLE hDevice, HANDLE hObject);
|
||||
typedef BOOL (WINAPI * PFNWGLDXOBJECTACCESSNVPROC) (HANDLE hObject, GLenum access);
|
||||
typedef BOOL (WINAPI * PFNWGLDXLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
typedef BOOL (WINAPI * PFNWGLDXUNLOCKOBJECTSNVPROC) (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDXSetResourceShareHandleNV (void *dxObject, HANDLE shareHandle);
|
||||
HANDLE WINAPI wglDXOpenDeviceNV (void *dxDevice);
|
||||
BOOL WINAPI wglDXCloseDeviceNV (HANDLE hDevice);
|
||||
HANDLE WINAPI wglDXRegisterObjectNV (HANDLE hDevice, void *dxObject, GLuint name, GLenum type, GLenum access);
|
||||
BOOL WINAPI wglDXUnregisterObjectNV (HANDLE hDevice, HANDLE hObject);
|
||||
BOOL WINAPI wglDXObjectAccessNV (HANDLE hObject, GLenum access);
|
||||
BOOL WINAPI wglDXLockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
BOOL WINAPI wglDXUnlockObjectsNV (HANDLE hDevice, GLint count, HANDLE *hObjects);
|
||||
#endif
|
||||
#endif /* WGL_NV_DX_interop */
|
||||
|
||||
#ifndef WGL_NV_DX_interop2
|
||||
#define WGL_NV_DX_interop2 1
|
||||
#endif /* WGL_NV_DX_interop2 */
|
||||
|
||||
#ifndef WGL_NV_copy_image
|
||||
#define WGL_NV_copy_image 1
|
||||
typedef BOOL (WINAPI * PFNWGLCOPYIMAGESUBDATANVPROC) (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglCopyImageSubDataNV (HGLRC hSrcRC, GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, HGLRC hDstRC, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* WGL_NV_copy_image */
|
||||
|
||||
#ifndef WGL_NV_delay_before_swap
|
||||
#define WGL_NV_delay_before_swap 1
|
||||
typedef BOOL (WINAPI * PFNWGLDELAYBEFORESWAPNVPROC) (HDC hDC, GLfloat seconds);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglDelayBeforeSwapNV (HDC hDC, GLfloat seconds);
|
||||
#endif
|
||||
#endif /* WGL_NV_delay_before_swap */
|
||||
|
||||
#ifndef WGL_NV_float_buffer
|
||||
#define WGL_NV_float_buffer 1
|
||||
#define WGL_FLOAT_COMPONENTS_NV 0x20B0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_R_NV 0x20B1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RG_NV 0x20B2
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGB_NV 0x20B3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_FLOAT_RGBA_NV 0x20B4
|
||||
#define WGL_TEXTURE_FLOAT_R_NV 0x20B5
|
||||
#define WGL_TEXTURE_FLOAT_RG_NV 0x20B6
|
||||
#define WGL_TEXTURE_FLOAT_RGB_NV 0x20B7
|
||||
#define WGL_TEXTURE_FLOAT_RGBA_NV 0x20B8
|
||||
#endif /* WGL_NV_float_buffer */
|
||||
|
||||
#ifndef WGL_NV_gpu_affinity
|
||||
#define WGL_NV_gpu_affinity 1
|
||||
DECLARE_HANDLE(HGPUNV);
|
||||
struct _GPU_DEVICE {
|
||||
DWORD cb;
|
||||
CHAR DeviceName[32];
|
||||
CHAR DeviceString[128];
|
||||
DWORD Flags;
|
||||
RECT rcVirtualScreen;
|
||||
};
|
||||
typedef struct _GPU_DEVICE *PGPU_DEVICE;
|
||||
#define ERROR_INCOMPATIBLE_AFFINITY_MASKS_NV 0x20D0
|
||||
#define ERROR_MISSING_AFFINITY_MASK_NV 0x20D1
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSNVPROC) (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUDEVICESNVPROC) (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
typedef HDC (WINAPI * PFNWGLCREATEAFFINITYDCNVPROC) (const HGPUNV *phGpuList);
|
||||
typedef BOOL (WINAPI * PFNWGLENUMGPUSFROMAFFINITYDCNVPROC) (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
typedef BOOL (WINAPI * PFNWGLDELETEDCNVPROC) (HDC hdc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglEnumGpusNV (UINT iGpuIndex, HGPUNV *phGpu);
|
||||
BOOL WINAPI wglEnumGpuDevicesNV (HGPUNV hGpu, UINT iDeviceIndex, PGPU_DEVICE lpGpuDevice);
|
||||
HDC WINAPI wglCreateAffinityDCNV (const HGPUNV *phGpuList);
|
||||
BOOL WINAPI wglEnumGpusFromAffinityDCNV (HDC hAffinityDC, UINT iGpuIndex, HGPUNV *hGpu);
|
||||
BOOL WINAPI wglDeleteDCNV (HDC hdc);
|
||||
#endif
|
||||
#endif /* WGL_NV_gpu_affinity */
|
||||
|
||||
#ifndef WGL_NV_multigpu_context
|
||||
#define WGL_NV_multigpu_context 1
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_NV 0x20AA
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_SINGLE_NV 0x20AB
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_AFR_NV 0x20AC
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTICAST_NV 0x20AD
|
||||
#define WGL_CONTEXT_MULTIGPU_ATTRIB_MULTI_DISPLAY_MULTICAST_NV 0x20AE
|
||||
#endif /* WGL_NV_multigpu_context */
|
||||
|
||||
#ifndef WGL_NV_multisample_coverage
|
||||
#define WGL_NV_multisample_coverage 1
|
||||
#define WGL_COVERAGE_SAMPLES_NV 0x2042
|
||||
#define WGL_COLOR_SAMPLES_NV 0x20B9
|
||||
#endif /* WGL_NV_multisample_coverage */
|
||||
|
||||
#ifndef WGL_NV_present_video
|
||||
#define WGL_NV_present_video 1
|
||||
DECLARE_HANDLE(HVIDEOOUTPUTDEVICENV);
|
||||
#define WGL_NUM_VIDEO_SLOTS_NV 0x20F0
|
||||
typedef int (WINAPI * PFNWGLENUMERATEVIDEODEVICESNVPROC) (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEODEVICENVPROC) (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYCURRENTCONTEXTNVPROC) (int iAttribute, int *piValue);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
int WINAPI wglEnumerateVideoDevicesNV (HDC hDc, HVIDEOOUTPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglBindVideoDeviceNV (HDC hDc, unsigned int uVideoSlot, HVIDEOOUTPUTDEVICENV hVideoDevice, const int *piAttribList);
|
||||
BOOL WINAPI wglQueryCurrentContextNV (int iAttribute, int *piValue);
|
||||
#endif
|
||||
#endif /* WGL_NV_present_video */
|
||||
|
||||
#ifndef WGL_NV_render_depth_texture
|
||||
#define WGL_NV_render_depth_texture 1
|
||||
#define WGL_BIND_TO_TEXTURE_DEPTH_NV 0x20A3
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_DEPTH_NV 0x20A4
|
||||
#define WGL_DEPTH_TEXTURE_FORMAT_NV 0x20A5
|
||||
#define WGL_TEXTURE_DEPTH_COMPONENT_NV 0x20A6
|
||||
#define WGL_DEPTH_COMPONENT_NV 0x20A7
|
||||
#endif /* WGL_NV_render_depth_texture */
|
||||
|
||||
#ifndef WGL_NV_render_texture_rectangle
|
||||
#define WGL_NV_render_texture_rectangle 1
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGB_NV 0x20A0
|
||||
#define WGL_BIND_TO_TEXTURE_RECTANGLE_RGBA_NV 0x20A1
|
||||
#define WGL_TEXTURE_RECTANGLE_NV 0x20A2
|
||||
#endif /* WGL_NV_render_texture_rectangle */
|
||||
|
||||
#ifndef WGL_NV_swap_group
|
||||
#define WGL_NV_swap_group 1
|
||||
typedef BOOL (WINAPI * PFNWGLJOINSWAPGROUPNVPROC) (HDC hDC, GLuint group);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDSWAPBARRIERNVPROC) (GLuint group, GLuint barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYSWAPGROUPNVPROC) (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYMAXSWAPGROUPSNVPROC) (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYFRAMECOUNTNVPROC) (HDC hDC, GLuint *count);
|
||||
typedef BOOL (WINAPI * PFNWGLRESETFRAMECOUNTNVPROC) (HDC hDC);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglJoinSwapGroupNV (HDC hDC, GLuint group);
|
||||
BOOL WINAPI wglBindSwapBarrierNV (GLuint group, GLuint barrier);
|
||||
BOOL WINAPI wglQuerySwapGroupNV (HDC hDC, GLuint *group, GLuint *barrier);
|
||||
BOOL WINAPI wglQueryMaxSwapGroupsNV (HDC hDC, GLuint *maxGroups, GLuint *maxBarriers);
|
||||
BOOL WINAPI wglQueryFrameCountNV (HDC hDC, GLuint *count);
|
||||
BOOL WINAPI wglResetFrameCountNV (HDC hDC);
|
||||
#endif
|
||||
#endif /* WGL_NV_swap_group */
|
||||
|
||||
#ifndef WGL_NV_vertex_array_range
|
||||
#define WGL_NV_vertex_array_range 1
|
||||
typedef void *(WINAPI * PFNWGLALLOCATEMEMORYNVPROC) (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
typedef void (WINAPI * PFNWGLFREEMEMORYNVPROC) (void *pointer);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
void *WINAPI wglAllocateMemoryNV (GLsizei size, GLfloat readfreq, GLfloat writefreq, GLfloat priority);
|
||||
void WINAPI wglFreeMemoryNV (void *pointer);
|
||||
#endif
|
||||
#endif /* WGL_NV_vertex_array_range */
|
||||
|
||||
#ifndef WGL_NV_video_capture
|
||||
#define WGL_NV_video_capture 1
|
||||
DECLARE_HANDLE(HVIDEOINPUTDEVICENV);
|
||||
#define WGL_UNIQUE_ID_NV 0x20CE
|
||||
#define WGL_NUM_VIDEO_CAPTURE_SLOTS_NV 0x20CF
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOCAPTUREDEVICENVPROC) (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef UINT (WINAPI * PFNWGLENUMERATEVIDEOCAPTUREDEVICESNVPROC) (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
typedef BOOL (WINAPI * PFNWGLLOCKVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLQUERYVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOCAPTUREDEVICENVPROC) (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglBindVideoCaptureDeviceNV (UINT uVideoSlot, HVIDEOINPUTDEVICENV hDevice);
|
||||
UINT WINAPI wglEnumerateVideoCaptureDevicesNV (HDC hDc, HVIDEOINPUTDEVICENV *phDeviceList);
|
||||
BOOL WINAPI wglLockVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
BOOL WINAPI wglQueryVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice, int iAttribute, int *piValue);
|
||||
BOOL WINAPI wglReleaseVideoCaptureDeviceNV (HDC hDc, HVIDEOINPUTDEVICENV hDevice);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_capture */
|
||||
|
||||
#ifndef WGL_NV_video_output
|
||||
#define WGL_NV_video_output 1
|
||||
DECLARE_HANDLE(HPVIDEODEV);
|
||||
#define WGL_BIND_TO_VIDEO_RGB_NV 0x20C0
|
||||
#define WGL_BIND_TO_VIDEO_RGBA_NV 0x20C1
|
||||
#define WGL_BIND_TO_VIDEO_RGB_AND_DEPTH_NV 0x20C2
|
||||
#define WGL_VIDEO_OUT_COLOR_NV 0x20C3
|
||||
#define WGL_VIDEO_OUT_ALPHA_NV 0x20C4
|
||||
#define WGL_VIDEO_OUT_DEPTH_NV 0x20C5
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_ALPHA_NV 0x20C6
|
||||
#define WGL_VIDEO_OUT_COLOR_AND_DEPTH_NV 0x20C7
|
||||
#define WGL_VIDEO_OUT_FRAME 0x20C8
|
||||
#define WGL_VIDEO_OUT_FIELD_1 0x20C9
|
||||
#define WGL_VIDEO_OUT_FIELD_2 0x20CA
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_1_2 0x20CB
|
||||
#define WGL_VIDEO_OUT_STACKED_FIELDS_2_1 0x20CC
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEODEVICENVPROC) (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEODEVICENVPROC) (HPVIDEODEV hVideoDevice);
|
||||
typedef BOOL (WINAPI * PFNWGLBINDVIDEOIMAGENVPROC) (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLRELEASEVIDEOIMAGENVPROC) (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
typedef BOOL (WINAPI * PFNWGLSENDPBUFFERTOVIDEONVPROC) (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
typedef BOOL (WINAPI * PFNWGLGETVIDEOINFONVPROC) (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetVideoDeviceNV (HDC hDC, int numDevices, HPVIDEODEV *hVideoDevice);
|
||||
BOOL WINAPI wglReleaseVideoDeviceNV (HPVIDEODEV hVideoDevice);
|
||||
BOOL WINAPI wglBindVideoImageNV (HPVIDEODEV hVideoDevice, HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglReleaseVideoImageNV (HPBUFFERARB hPbuffer, int iVideoBuffer);
|
||||
BOOL WINAPI wglSendPbufferToVideoNV (HPBUFFERARB hPbuffer, int iBufferType, unsigned long *pulCounterPbuffer, BOOL bBlock);
|
||||
BOOL WINAPI wglGetVideoInfoNV (HPVIDEODEV hpVideoDevice, unsigned long *pulCounterOutputPbuffer, unsigned long *pulCounterOutputVideo);
|
||||
#endif
|
||||
#endif /* WGL_NV_video_output */
|
||||
|
||||
#ifndef WGL_OML_sync_control
|
||||
#define WGL_OML_sync_control 1
|
||||
typedef BOOL (WINAPI * PFNWGLGETSYNCVALUESOMLPROC) (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLGETMSCRATEOMLPROC) (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPBUFFERSMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef INT64 (WINAPI * PFNWGLSWAPLAYERBUFFERSMSCOMLPROC) (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORMSCOMLPROC) (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
typedef BOOL (WINAPI * PFNWGLWAITFORSBCOMLPROC) (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#ifdef WGL_WGLEXT_PROTOTYPES
|
||||
BOOL WINAPI wglGetSyncValuesOML (HDC hdc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglGetMscRateOML (HDC hdc, INT32 *numerator, INT32 *denominator);
|
||||
INT64 WINAPI wglSwapBuffersMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
INT64 WINAPI wglSwapLayerBuffersMscOML (HDC hdc, INT fuPlanes, INT64 target_msc, INT64 divisor, INT64 remainder);
|
||||
BOOL WINAPI wglWaitForMscOML (HDC hdc, INT64 target_msc, INT64 divisor, INT64 remainder, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
BOOL WINAPI wglWaitForSbcOML (HDC hdc, INT64 target_sbc, INT64 *ust, INT64 *msc, INT64 *sbc);
|
||||
#endif
|
||||
#endif /* WGL_OML_sync_control */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,18 @@
|
||||
/*
|
||||
** Copyright 2008-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* Skeleton egl.h to provide compatibility for early GLES 1.0
|
||||
* applications. Several early implementations included gl.h
|
||||
* in egl.h leading applications to include only egl.h
|
||||
*/
|
||||
|
||||
#ifndef __legacy_egl_h_
|
||||
#define __legacy_egl_h_
|
||||
|
||||
#include <EGL/egl.h>
|
||||
#include <GLES/gl.h>
|
||||
|
||||
#endif /* __legacy_egl_h_ */
|
||||
@@ -0,0 +1,571 @@
|
||||
#ifndef __gles1_gl_h_
|
||||
#define __gles1_gl_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** 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
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <GLES/glplatform.h>
|
||||
|
||||
/* Generated on date 20250203 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles1
|
||||
* Profile: common
|
||||
* Versions considered: .*
|
||||
* Versions emitted: .*
|
||||
* Default extensions included: None
|
||||
* Additional extensions included: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef GL_VERSION_ES_CM_1_0
|
||||
#define GL_VERSION_ES_CM_1_0 1
|
||||
#include <KHR/khrplatform.h>
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int16_t GLshort;
|
||||
typedef khronos_uint16_t GLushort;
|
||||
typedef void GLvoid;
|
||||
typedef unsigned int GLenum;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef unsigned int GLuint;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef int GLint;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_int32_t GLclampx;
|
||||
#define GL_VERSION_ES_CL_1_0 1
|
||||
#define GL_VERSION_ES_CM_1_1 1
|
||||
#define GL_VERSION_ES_CL_1_1 1
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_LINE_LOOP 0x0002
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_TRIANGLE_FAN 0x0006
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_ALWAYS 0x0207
|
||||
#define GL_ZERO 0
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
#define GL_CLIP_PLANE0 0x3000
|
||||
#define GL_CLIP_PLANE1 0x3001
|
||||
#define GL_CLIP_PLANE2 0x3002
|
||||
#define GL_CLIP_PLANE3 0x3003
|
||||
#define GL_CLIP_PLANE4 0x3004
|
||||
#define GL_CLIP_PLANE5 0x3005
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
#define GL_FOG 0x0B60
|
||||
#define GL_LIGHTING 0x0B50
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_ALPHA_TEST 0x0BC0
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_COLOR_LOGIC_OP 0x0BF2
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_POINT_SMOOTH 0x0B10
|
||||
#define GL_LINE_SMOOTH 0x0B20
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_COLOR_MATERIAL 0x0B57
|
||||
#define GL_NORMALIZE 0x0BA1
|
||||
#define GL_RESCALE_NORMAL 0x803A
|
||||
#define GL_VERTEX_ARRAY 0x8074
|
||||
#define GL_NORMAL_ARRAY 0x8075
|
||||
#define GL_COLOR_ARRAY 0x8076
|
||||
#define GL_TEXTURE_COORD_ARRAY 0x8078
|
||||
#define GL_MULTISAMPLE 0x809D
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_ALPHA_TO_ONE 0x809F
|
||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_STACK_OVERFLOW 0x0503
|
||||
#define GL_STACK_UNDERFLOW 0x0504
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
#define GL_EXP 0x0800
|
||||
#define GL_EXP2 0x0801
|
||||
#define GL_FOG_DENSITY 0x0B62
|
||||
#define GL_FOG_START 0x0B63
|
||||
#define GL_FOG_END 0x0B64
|
||||
#define GL_FOG_MODE 0x0B65
|
||||
#define GL_FOG_COLOR 0x0B66
|
||||
#define GL_CW 0x0900
|
||||
#define GL_CCW 0x0901
|
||||
#define GL_CURRENT_COLOR 0x0B00
|
||||
#define GL_CURRENT_NORMAL 0x0B02
|
||||
#define GL_CURRENT_TEXTURE_COORDS 0x0B03
|
||||
#define GL_POINT_SIZE 0x0B11
|
||||
#define GL_POINT_SIZE_MIN 0x8126
|
||||
#define GL_POINT_SIZE_MAX 0x8127
|
||||
#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128
|
||||
#define GL_POINT_DISTANCE_ATTENUATION 0x8129
|
||||
#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12
|
||||
#define GL_LINE_WIDTH 0x0B21
|
||||
#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#define GL_CULL_FACE_MODE 0x0B45
|
||||
#define GL_FRONT_FACE 0x0B46
|
||||
#define GL_SHADE_MODEL 0x0B54
|
||||
#define GL_DEPTH_RANGE 0x0B70
|
||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
||||
#define GL_DEPTH_FUNC 0x0B74
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_MATRIX_MODE 0x0BA0
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_MODELVIEW_STACK_DEPTH 0x0BA3
|
||||
#define GL_PROJECTION_STACK_DEPTH 0x0BA4
|
||||
#define GL_TEXTURE_STACK_DEPTH 0x0BA5
|
||||
#define GL_MODELVIEW_MATRIX 0x0BA6
|
||||
#define GL_PROJECTION_MATRIX 0x0BA7
|
||||
#define GL_TEXTURE_MATRIX 0x0BA8
|
||||
#define GL_ALPHA_TEST_FUNC 0x0BC1
|
||||
#define GL_ALPHA_TEST_REF 0x0BC2
|
||||
#define GL_BLEND_DST 0x0BE0
|
||||
#define GL_BLEND_SRC 0x0BE1
|
||||
#define GL_LOGIC_OP_MODE 0x0BF0
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||
#define GL_COLOR_WRITEMASK 0x0C23
|
||||
#define GL_MAX_LIGHTS 0x0D31
|
||||
#define GL_MAX_CLIP_PLANES 0x0D32
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_MODELVIEW_STACK_DEPTH 0x0D36
|
||||
#define GL_MAX_PROJECTION_STACK_DEPTH 0x0D38
|
||||
#define GL_MAX_TEXTURE_STACK_DEPTH 0x0D39
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_MAX_TEXTURE_UNITS 0x84E2
|
||||
#define GL_SUBPIXEL_BITS 0x0D50
|
||||
#define GL_RED_BITS 0x0D52
|
||||
#define GL_GREEN_BITS 0x0D53
|
||||
#define GL_BLUE_BITS 0x0D54
|
||||
#define GL_ALPHA_BITS 0x0D55
|
||||
#define GL_DEPTH_BITS 0x0D56
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
#define GL_VERTEX_ARRAY_SIZE 0x807A
|
||||
#define GL_VERTEX_ARRAY_TYPE 0x807B
|
||||
#define GL_VERTEX_ARRAY_STRIDE 0x807C
|
||||
#define GL_NORMAL_ARRAY_TYPE 0x807E
|
||||
#define GL_NORMAL_ARRAY_STRIDE 0x807F
|
||||
#define GL_COLOR_ARRAY_SIZE 0x8081
|
||||
#define GL_COLOR_ARRAY_TYPE 0x8082
|
||||
#define GL_COLOR_ARRAY_STRIDE 0x8083
|
||||
#define GL_TEXTURE_COORD_ARRAY_SIZE 0x8088
|
||||
#define GL_TEXTURE_COORD_ARRAY_TYPE 0x8089
|
||||
#define GL_TEXTURE_COORD_ARRAY_STRIDE 0x808A
|
||||
#define GL_VERTEX_ARRAY_POINTER 0x808E
|
||||
#define GL_NORMAL_ARRAY_POINTER 0x808F
|
||||
#define GL_COLOR_ARRAY_POINTER 0x8090
|
||||
#define GL_TEXTURE_COORD_ARRAY_POINTER 0x8092
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
#define GL_PERSPECTIVE_CORRECTION_HINT 0x0C50
|
||||
#define GL_POINT_SMOOTH_HINT 0x0C51
|
||||
#define GL_LINE_SMOOTH_HINT 0x0C52
|
||||
#define GL_FOG_HINT 0x0C54
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
#define GL_LIGHT_MODEL_AMBIENT 0x0B53
|
||||
#define GL_LIGHT_MODEL_TWO_SIDE 0x0B52
|
||||
#define GL_AMBIENT 0x1200
|
||||
#define GL_DIFFUSE 0x1201
|
||||
#define GL_SPECULAR 0x1202
|
||||
#define GL_POSITION 0x1203
|
||||
#define GL_SPOT_DIRECTION 0x1204
|
||||
#define GL_SPOT_EXPONENT 0x1205
|
||||
#define GL_SPOT_CUTOFF 0x1206
|
||||
#define GL_CONSTANT_ATTENUATION 0x1207
|
||||
#define GL_LINEAR_ATTENUATION 0x1208
|
||||
#define GL_QUADRATIC_ATTENUATION 0x1209
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FIXED 0x140C
|
||||
#define GL_CLEAR 0x1500
|
||||
#define GL_AND 0x1501
|
||||
#define GL_AND_REVERSE 0x1502
|
||||
#define GL_COPY 0x1503
|
||||
#define GL_AND_INVERTED 0x1504
|
||||
#define GL_NOOP 0x1505
|
||||
#define GL_XOR 0x1506
|
||||
#define GL_OR 0x1507
|
||||
#define GL_NOR 0x1508
|
||||
#define GL_EQUIV 0x1509
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_OR_REVERSE 0x150B
|
||||
#define GL_COPY_INVERTED 0x150C
|
||||
#define GL_OR_INVERTED 0x150D
|
||||
#define GL_NAND 0x150E
|
||||
#define GL_SET 0x150F
|
||||
#define GL_EMISSION 0x1600
|
||||
#define GL_SHININESS 0x1601
|
||||
#define GL_AMBIENT_AND_DIFFUSE 0x1602
|
||||
#define GL_MODELVIEW 0x1700
|
||||
#define GL_PROJECTION 0x1701
|
||||
#define GL_TEXTURE 0x1702
|
||||
#define GL_ALPHA 0x1906
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#define GL_LUMINANCE_ALPHA 0x190A
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
#define GL_FLAT 0x1D00
|
||||
#define GL_SMOOTH 0x1D01
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DECR 0x1E03
|
||||
#define GL_VENDOR 0x1F00
|
||||
#define GL_RENDERER 0x1F01
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
#define GL_MODULATE 0x2100
|
||||
#define GL_DECAL 0x2101
|
||||
#define GL_ADD 0x0104
|
||||
#define GL_TEXTURE_ENV_MODE 0x2200
|
||||
#define GL_TEXTURE_ENV_COLOR 0x2201
|
||||
#define GL_TEXTURE_ENV 0x2300
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
#define GL_GENERATE_MIPMAP 0x8191
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_TEXTURE2 0x84C2
|
||||
#define GL_TEXTURE3 0x84C3
|
||||
#define GL_TEXTURE4 0x84C4
|
||||
#define GL_TEXTURE5 0x84C5
|
||||
#define GL_TEXTURE6 0x84C6
|
||||
#define GL_TEXTURE7 0x84C7
|
||||
#define GL_TEXTURE8 0x84C8
|
||||
#define GL_TEXTURE9 0x84C9
|
||||
#define GL_TEXTURE10 0x84CA
|
||||
#define GL_TEXTURE11 0x84CB
|
||||
#define GL_TEXTURE12 0x84CC
|
||||
#define GL_TEXTURE13 0x84CD
|
||||
#define GL_TEXTURE14 0x84CE
|
||||
#define GL_TEXTURE15 0x84CF
|
||||
#define GL_TEXTURE16 0x84D0
|
||||
#define GL_TEXTURE17 0x84D1
|
||||
#define GL_TEXTURE18 0x84D2
|
||||
#define GL_TEXTURE19 0x84D3
|
||||
#define GL_TEXTURE20 0x84D4
|
||||
#define GL_TEXTURE21 0x84D5
|
||||
#define GL_TEXTURE22 0x84D6
|
||||
#define GL_TEXTURE23 0x84D7
|
||||
#define GL_TEXTURE24 0x84D8
|
||||
#define GL_TEXTURE25 0x84D9
|
||||
#define GL_TEXTURE26 0x84DA
|
||||
#define GL_TEXTURE27 0x84DB
|
||||
#define GL_TEXTURE28 0x84DC
|
||||
#define GL_TEXTURE29 0x84DD
|
||||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
#define GL_LIGHT0 0x4000
|
||||
#define GL_LIGHT1 0x4001
|
||||
#define GL_LIGHT2 0x4002
|
||||
#define GL_LIGHT3 0x4003
|
||||
#define GL_LIGHT4 0x4004
|
||||
#define GL_LIGHT5 0x4005
|
||||
#define GL_LIGHT6 0x4006
|
||||
#define GL_LIGHT7 0x4007
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896
|
||||
#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897
|
||||
#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898
|
||||
#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
#define GL_BUFFER_SIZE 0x8764
|
||||
#define GL_BUFFER_USAGE 0x8765
|
||||
#define GL_SUBTRACT 0x84E7
|
||||
#define GL_COMBINE 0x8570
|
||||
#define GL_COMBINE_RGB 0x8571
|
||||
#define GL_COMBINE_ALPHA 0x8572
|
||||
#define GL_RGB_SCALE 0x8573
|
||||
#define GL_ADD_SIGNED 0x8574
|
||||
#define GL_INTERPOLATE 0x8575
|
||||
#define GL_CONSTANT 0x8576
|
||||
#define GL_PRIMARY_COLOR 0x8577
|
||||
#define GL_PREVIOUS 0x8578
|
||||
#define GL_OPERAND0_RGB 0x8590
|
||||
#define GL_OPERAND1_RGB 0x8591
|
||||
#define GL_OPERAND2_RGB 0x8592
|
||||
#define GL_OPERAND0_ALPHA 0x8598
|
||||
#define GL_OPERAND1_ALPHA 0x8599
|
||||
#define GL_OPERAND2_ALPHA 0x859A
|
||||
#define GL_ALPHA_SCALE 0x0D1C
|
||||
#define GL_SRC0_RGB 0x8580
|
||||
#define GL_SRC1_RGB 0x8581
|
||||
#define GL_SRC2_RGB 0x8582
|
||||
#define GL_SRC0_ALPHA 0x8588
|
||||
#define GL_SRC1_ALPHA 0x8589
|
||||
#define GL_SRC2_ALPHA 0x858A
|
||||
#define GL_DOT3_RGB 0x86AE
|
||||
#define GL_DOT3_RGBA 0x86AF
|
||||
GL_API void GL_APIENTRY glAlphaFunc (GLenum func, GLfloat ref);
|
||||
GL_API void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GL_API void GL_APIENTRY glClearDepthf (GLfloat d);
|
||||
GL_API void GL_APIENTRY glClipPlanef (GLenum p, const GLfloat *eqn);
|
||||
GL_API void GL_APIENTRY glColor4f (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GL_API void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
|
||||
GL_API void GL_APIENTRY glFogf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glFogfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glFrustumf (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
GL_API void GL_APIENTRY glGetClipPlanef (GLenum plane, GLfloat *equation);
|
||||
GL_API void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
|
||||
GL_API void GL_APIENTRY glGetLightfv (GLenum light, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetMaterialfv (GLenum face, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetTexEnvfv (GLenum target, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLightModelf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glLightModelfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLightf (GLenum light, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glLightfv (GLenum light, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glLineWidth (GLfloat width);
|
||||
GL_API void GL_APIENTRY glLoadMatrixf (const GLfloat *m);
|
||||
GL_API void GL_APIENTRY glMaterialf (GLenum face, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glMaterialfv (GLenum face, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glMultMatrixf (const GLfloat *m);
|
||||
GL_API void GL_APIENTRY glMultiTexCoord4f (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q);
|
||||
GL_API void GL_APIENTRY glNormal3f (GLfloat nx, GLfloat ny, GLfloat nz);
|
||||
GL_API void GL_APIENTRY glOrthof (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
GL_API void GL_APIENTRY glPointParameterf (GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glPointParameterfv (GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glPointSize (GLfloat size);
|
||||
GL_API void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
GL_API void GL_APIENTRY glRotatef (GLfloat angle, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_API void GL_APIENTRY glScalef (GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_API void GL_APIENTRY glTexEnvf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glTexEnvfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glTranslatef (GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_API void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||
GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLfixed ref);
|
||||
GL_API void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GL_API void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GL_API void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GL_API void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
GL_API void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||
GL_API void GL_APIENTRY glClear (GLbitfield mask);
|
||||
GL_API void GL_APIENTRY glClearColorx (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
GL_API void GL_APIENTRY glClearDepthx (GLfixed depth);
|
||||
GL_API void GL_APIENTRY glClearStencil (GLint s);
|
||||
GL_API void GL_APIENTRY glClientActiveTexture (GLenum texture);
|
||||
GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
|
||||
GL_API void GL_APIENTRY glColor4ub (GLubyte red, GLubyte green, GLubyte blue, GLubyte alpha);
|
||||
GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
GL_API void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
GL_API void GL_APIENTRY glColorPointer (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
GL_API void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||
GL_API void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
|
||||
GL_API void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GL_API void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glCullFace (GLenum mode);
|
||||
GL_API void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||
GL_API void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||
GL_API void GL_APIENTRY glDepthFunc (GLenum func);
|
||||
GL_API void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||
GL_API void GL_APIENTRY glDepthRangex (GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glDisable (GLenum cap);
|
||||
GL_API void GL_APIENTRY glDisableClientState (GLenum array);
|
||||
GL_API void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GL_API void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
GL_API void GL_APIENTRY glEnable (GLenum cap);
|
||||
GL_API void GL_APIENTRY glEnableClientState (GLenum array);
|
||||
GL_API void GL_APIENTRY glFinish (void);
|
||||
GL_API void GL_APIENTRY glFlush (void);
|
||||
GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glFrontFace (GLenum mode);
|
||||
GL_API void GL_APIENTRY glFrustumx (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
|
||||
GL_API void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetClipPlanex (GLenum plane, GLfixed *equation);
|
||||
GL_API void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
|
||||
GL_API void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||
GL_API GLenum GL_APIENTRY glGetError (void);
|
||||
GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
|
||||
GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetPointerv (GLenum pname, void **params);
|
||||
GL_API const GLubyte *GL_APIENTRY glGetString (GLenum name);
|
||||
GL_API void GL_APIENTRY glGetTexEnviv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetTexEnvxv (GLenum target, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||
GL_API GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||
GL_API GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||
GL_API GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||
GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
|
||||
GL_API void GL_APIENTRY glLoadIdentity (void);
|
||||
GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glLogicOp (GLenum opcode);
|
||||
GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glMatrixMode (GLenum mode);
|
||||
GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
GL_API void GL_APIENTRY glNormalPointer (GLenum type, GLsizei stride, const void *pointer);
|
||||
GL_API void GL_APIENTRY glOrthox (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glPointSizex (GLfixed size);
|
||||
GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
|
||||
GL_API void GL_APIENTRY glPopMatrix (void);
|
||||
GL_API void GL_APIENTRY glPushMatrix (void);
|
||||
GL_API void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
|
||||
GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
|
||||
GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glShadeModel (GLenum mode);
|
||||
GL_API void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_API void GL_APIENTRY glStencilMask (GLuint mask);
|
||||
GL_API void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_API void GL_APIENTRY glTexCoordPointer (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
GL_API void GL_APIENTRY glTexEnvi (GLenum target, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexEnviv (GLenum target, GLenum pname, const GLint *params);
|
||||
GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
GL_API void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
|
||||
GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||
GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glVertexPointer (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
GL_API void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#endif /* GL_VERSION_ES_CM_1_0 */
|
||||
|
||||
#ifndef GL_OES_compressed_paletted_texture
|
||||
#define GL_OES_compressed_paletted_texture 1
|
||||
#define GL_PALETTE4_RGB8_OES 0x8B90
|
||||
#define GL_PALETTE4_RGBA8_OES 0x8B91
|
||||
#define GL_PALETTE4_R5_G6_B5_OES 0x8B92
|
||||
#define GL_PALETTE4_RGBA4_OES 0x8B93
|
||||
#define GL_PALETTE4_RGB5_A1_OES 0x8B94
|
||||
#define GL_PALETTE8_RGB8_OES 0x8B95
|
||||
#define GL_PALETTE8_RGBA8_OES 0x8B96
|
||||
#define GL_PALETTE8_R5_G6_B5_OES 0x8B97
|
||||
#define GL_PALETTE8_RGBA4_OES 0x8B98
|
||||
#define GL_PALETTE8_RGB5_A1_OES 0x8B99
|
||||
#endif /* GL_OES_compressed_paletted_texture */
|
||||
|
||||
#ifndef GL_OES_point_size_array
|
||||
#define GL_OES_point_size_array 1
|
||||
#define GL_POINT_SIZE_ARRAY_OES 0x8B9C
|
||||
#define GL_POINT_SIZE_ARRAY_TYPE_OES 0x898A
|
||||
#define GL_POINT_SIZE_ARRAY_STRIDE_OES 0x898B
|
||||
#define GL_POINT_SIZE_ARRAY_POINTER_OES 0x898C
|
||||
#define GL_POINT_SIZE_ARRAY_BUFFER_BINDING_OES 0x8B9F
|
||||
GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const void *pointer);
|
||||
#endif /* GL_OES_point_size_array */
|
||||
|
||||
#ifndef GL_OES_point_sprite
|
||||
#define GL_OES_point_sprite 1
|
||||
#define GL_POINT_SPRITE_OES 0x8861
|
||||
#define GL_COORD_REPLACE_OES 0x8862
|
||||
#endif /* GL_OES_point_sprite */
|
||||
|
||||
#ifndef GL_OES_read_format
|
||||
#define GL_OES_read_format 1
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B
|
||||
#endif /* GL_OES_read_format */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,954 @@
|
||||
#ifndef __gles1_glext_h_
|
||||
#define __gles1_glext_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** 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
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#ifndef GL_APIENTRYP
|
||||
#define GL_APIENTRYP GL_APIENTRY*
|
||||
#endif
|
||||
|
||||
/* Generated on date 20250203 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles1
|
||||
* Profile: common
|
||||
* Versions considered: .*
|
||||
* Versions emitted: _nomatch_^
|
||||
* Default extensions included: gles1
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: ^(GL_OES_read_format|GL_OES_compressed_paletted_texture|GL_OES_point_size_array|GL_OES_point_sprite)$
|
||||
*/
|
||||
|
||||
#ifndef GL_KHR_debug
|
||||
#define GL_KHR_debug 1
|
||||
#endif /* GL_KHR_debug */
|
||||
|
||||
#ifndef GL_OES_EGL_image
|
||||
#define GL_OES_EGL_image 1
|
||||
typedef void *GLeglImageOES;
|
||||
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETTEXTURE2DOESPROC) (GLenum target, GLeglImageOES image);
|
||||
typedef void (GL_APIENTRYP PFNGLEGLIMAGETARGETRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLeglImageOES image);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glEGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image);
|
||||
GL_API void GL_APIENTRY glEGLImageTargetRenderbufferStorageOES (GLenum target, GLeglImageOES image);
|
||||
#endif
|
||||
#endif /* GL_OES_EGL_image */
|
||||
|
||||
#ifndef GL_OES_EGL_image_external
|
||||
#define GL_OES_EGL_image_external 1
|
||||
#define GL_TEXTURE_EXTERNAL_OES 0x8D65
|
||||
#define GL_TEXTURE_BINDING_EXTERNAL_OES 0x8D67
|
||||
#define GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES 0x8D68
|
||||
#endif /* GL_OES_EGL_image_external */
|
||||
|
||||
#ifndef GL_OES_blend_equation_separate
|
||||
#define GL_OES_blend_equation_separate 1
|
||||
#define GL_BLEND_EQUATION_RGB_OES 0x8009
|
||||
#define GL_BLEND_EQUATION_ALPHA_OES 0x883D
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEOESPROC) (GLenum modeRGB, GLenum modeAlpha);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glBlendEquationSeparateOES (GLenum modeRGB, GLenum modeAlpha);
|
||||
#endif
|
||||
#endif /* GL_OES_blend_equation_separate */
|
||||
|
||||
#ifndef GL_OES_blend_func_separate
|
||||
#define GL_OES_blend_func_separate 1
|
||||
#define GL_BLEND_DST_RGB_OES 0x80C8
|
||||
#define GL_BLEND_SRC_RGB_OES 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA_OES 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA_OES 0x80CB
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEOESPROC) (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glBlendFuncSeparateOES (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha);
|
||||
#endif
|
||||
#endif /* GL_OES_blend_func_separate */
|
||||
|
||||
#ifndef GL_OES_blend_subtract
|
||||
#define GL_OES_blend_subtract 1
|
||||
#define GL_BLEND_EQUATION_OES 0x8009
|
||||
#define GL_FUNC_ADD_OES 0x8006
|
||||
#define GL_FUNC_SUBTRACT_OES 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT_OES 0x800B
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONOESPROC) (GLenum mode);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glBlendEquationOES (GLenum mode);
|
||||
#endif
|
||||
#endif /* GL_OES_blend_subtract */
|
||||
|
||||
#ifndef GL_OES_byte_coordinates
|
||||
#define GL_OES_byte_coordinates 1
|
||||
#endif /* GL_OES_byte_coordinates */
|
||||
|
||||
#ifndef GL_OES_compressed_ETC1_RGB8_sub_texture
|
||||
#define GL_OES_compressed_ETC1_RGB8_sub_texture 1
|
||||
#endif /* GL_OES_compressed_ETC1_RGB8_sub_texture */
|
||||
|
||||
#ifndef GL_OES_compressed_ETC1_RGB8_texture
|
||||
#define GL_OES_compressed_ETC1_RGB8_texture 1
|
||||
#define GL_ETC1_RGB8_OES 0x8D64
|
||||
#endif /* GL_OES_compressed_ETC1_RGB8_texture */
|
||||
|
||||
#ifndef GL_OES_depth24
|
||||
#define GL_OES_depth24 1
|
||||
#define GL_DEPTH_COMPONENT24_OES 0x81A6
|
||||
#endif /* GL_OES_depth24 */
|
||||
|
||||
#ifndef GL_OES_depth32
|
||||
#define GL_OES_depth32 1
|
||||
#define GL_DEPTH_COMPONENT32_OES 0x81A7
|
||||
#endif /* GL_OES_depth32 */
|
||||
|
||||
#ifndef GL_OES_draw_texture
|
||||
#define GL_OES_draw_texture 1
|
||||
#define GL_TEXTURE_CROP_RECT_OES 0x8B9D
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXSOESPROC) (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXIOESPROC) (GLint x, GLint y, GLint z, GLint width, GLint height);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXXOESPROC) (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXSVOESPROC) (const GLshort *coords);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXIVOESPROC) (const GLint *coords);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXXVOESPROC) (const GLfixed *coords);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXFOESPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWTEXFVOESPROC) (const GLfloat *coords);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glDrawTexsOES (GLshort x, GLshort y, GLshort z, GLshort width, GLshort height);
|
||||
GL_API void GL_APIENTRY glDrawTexiOES (GLint x, GLint y, GLint z, GLint width, GLint height);
|
||||
GL_API void GL_APIENTRY glDrawTexxOES (GLfixed x, GLfixed y, GLfixed z, GLfixed width, GLfixed height);
|
||||
GL_API void GL_APIENTRY glDrawTexsvOES (const GLshort *coords);
|
||||
GL_API void GL_APIENTRY glDrawTexivOES (const GLint *coords);
|
||||
GL_API void GL_APIENTRY glDrawTexxvOES (const GLfixed *coords);
|
||||
GL_API void GL_APIENTRY glDrawTexfOES (GLfloat x, GLfloat y, GLfloat z, GLfloat width, GLfloat height);
|
||||
GL_API void GL_APIENTRY glDrawTexfvOES (const GLfloat *coords);
|
||||
#endif
|
||||
#endif /* GL_OES_draw_texture */
|
||||
|
||||
#ifndef GL_OES_element_index_uint
|
||||
#define GL_OES_element_index_uint 1
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#endif /* GL_OES_element_index_uint */
|
||||
|
||||
#ifndef GL_OES_extended_matrix_palette
|
||||
#define GL_OES_extended_matrix_palette 1
|
||||
#endif /* GL_OES_extended_matrix_palette */
|
||||
|
||||
#ifndef GL_OES_fbo_render_mipmap
|
||||
#define GL_OES_fbo_render_mipmap 1
|
||||
#endif /* GL_OES_fbo_render_mipmap */
|
||||
|
||||
#ifndef GL_OES_fixed_point
|
||||
#define GL_OES_fixed_point 1
|
||||
#define GL_FIXED_OES 0x140C
|
||||
typedef void (GL_APIENTRYP PFNGLALPHAFUNCXOESPROC) (GLenum func, GLfixed ref);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARCOLORXOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHXOESPROC) (GLfixed depth);
|
||||
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXOESPROC) (GLenum plane, const GLfixed *equation);
|
||||
typedef void (GL_APIENTRYP PFNGLCOLOR4XOESPROC) (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
typedef void (GL_APIENTRYP PFNGLDEPTHRANGEXOESPROC) (GLfixed n, GLfixed f);
|
||||
typedef void (GL_APIENTRYP PFNGLFOGXOESPROC) (GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLFOGXVOESPROC) (GLenum pname, const GLfixed *param);
|
||||
typedef void (GL_APIENTRYP PFNGLFRUSTUMXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEXOESPROC) (GLenum plane, GLfixed *equation);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFIXEDVOESPROC) (GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXENVXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLLIGHTMODELXOESPROC) (GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLLIGHTMODELXVOESPROC) (GLenum pname, const GLfixed *param);
|
||||
typedef void (GL_APIENTRYP PFNGLLIGHTXOESPROC) (GLenum light, GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLLIGHTXVOESPROC) (GLenum light, GLenum pname, const GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLLINEWIDTHXOESPROC) (GLfixed width);
|
||||
typedef void (GL_APIENTRYP PFNGLLOADMATRIXXOESPROC) (const GLfixed *m);
|
||||
typedef void (GL_APIENTRYP PFNGLMATERIALXOESPROC) (GLenum face, GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLMATERIALXVOESPROC) (GLenum face, GLenum pname, const GLfixed *param);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTMATRIXXOESPROC) (const GLfixed *m);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4XOESPROC) (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
typedef void (GL_APIENTRYP PFNGLNORMAL3XOESPROC) (GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
typedef void (GL_APIENTRYP PFNGLORTHOXOESPROC) (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXVOESPROC) (GLenum pname, const GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLPOINTSIZEXOESPROC) (GLfixed size);
|
||||
typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETXOESPROC) (GLfixed factor, GLfixed units);
|
||||
typedef void (GL_APIENTRYP PFNGLROTATEXOESPROC) (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
typedef void (GL_APIENTRYP PFNGLSCALEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXENVXOESPROC) (GLenum target, GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z);
|
||||
typedef void (GL_APIENTRYP PFNGLGETLIGHTXVOESPROC) (GLenum light, GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETMATERIALXVOESPROC) (GLenum face, GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLPOINTPARAMETERXOESPROC) (GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEXOESPROC) (GLclampx value, GLboolean invert);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXGENXVOESPROC) (GLenum coord, GLenum pname, GLfixed *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENXOESPROC) (GLenum coord, GLenum pname, GLfixed param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENXVOESPROC) (GLenum coord, GLenum pname, const GLfixed *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glAlphaFuncxOES (GLenum func, GLfixed ref);
|
||||
GL_API void GL_APIENTRY glClearColorxOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
GL_API void GL_APIENTRY glClearDepthxOES (GLfixed depth);
|
||||
GL_API void GL_APIENTRY glClipPlanexOES (GLenum plane, const GLfixed *equation);
|
||||
GL_API void GL_APIENTRY glColor4xOES (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
|
||||
GL_API void GL_APIENTRY glDepthRangexOES (GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glFogxOES (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glFogxvOES (GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glFrustumxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glGetClipPlanexOES (GLenum plane, GLfixed *equation);
|
||||
GL_API void GL_APIENTRY glGetFixedvOES (GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetTexEnvxvOES (GLenum target, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetTexParameterxvOES (GLenum target, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glLightModelxOES (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightModelxvOES (GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glLightxOES (GLenum light, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glLightxvOES (GLenum light, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glLineWidthxOES (GLfixed width);
|
||||
GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *param);
|
||||
GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m);
|
||||
GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum texture, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
|
||||
GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz);
|
||||
GL_API void GL_APIENTRY glOrthoxOES (GLfixed l, GLfixed r, GLfixed b, GLfixed t, GLfixed n, GLfixed f);
|
||||
GL_API void GL_APIENTRY glPointParameterxvOES (GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glPointSizexOES (GLfixed size);
|
||||
GL_API void GL_APIENTRY glPolygonOffsetxOES (GLfixed factor, GLfixed units);
|
||||
GL_API void GL_APIENTRY glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glScalexOES (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glTexEnvxOES (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexParameterxOES (GLenum target, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTranslatexOES (GLfixed x, GLfixed y, GLfixed z);
|
||||
GL_API void GL_APIENTRY glGetLightxvOES (GLenum light, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glGetMaterialxvOES (GLenum face, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glPointParameterxOES (GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glSampleCoveragexOES (GLclampx value, GLboolean invert);
|
||||
GL_API void GL_APIENTRY glGetTexGenxvOES (GLenum coord, GLenum pname, GLfixed *params);
|
||||
GL_API void GL_APIENTRY glTexGenxOES (GLenum coord, GLenum pname, GLfixed param);
|
||||
GL_API void GL_APIENTRY glTexGenxvOES (GLenum coord, GLenum pname, const GLfixed *params);
|
||||
#endif
|
||||
#endif /* GL_OES_fixed_point */
|
||||
|
||||
#ifndef GL_OES_framebuffer_object
|
||||
#define GL_OES_framebuffer_object 1
|
||||
#define GL_NONE_OES 0
|
||||
#define GL_FRAMEBUFFER_OES 0x8D40
|
||||
#define GL_RENDERBUFFER_OES 0x8D41
|
||||
#define GL_RGBA4_OES 0x8056
|
||||
#define GL_RGB5_A1_OES 0x8057
|
||||
#define GL_RGB565_OES 0x8D62
|
||||
#define GL_DEPTH_COMPONENT16_OES 0x81A5
|
||||
#define GL_RENDERBUFFER_WIDTH_OES 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT_OES 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT_OES 0x8D44
|
||||
#define GL_RENDERBUFFER_RED_SIZE_OES 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE_OES 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE_OES 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE_OES 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE_OES 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE_OES 0x8D55
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_OES 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_OES 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_OES 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_OES 0x8CD3
|
||||
#define GL_COLOR_ATTACHMENT0_OES 0x8CE0
|
||||
#define GL_DEPTH_ATTACHMENT_OES 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT_OES 0x8D20
|
||||
#define GL_FRAMEBUFFER_COMPLETE_OES 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_OES 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_OES 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_OES 0x8CD9
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_OES 0x8CDA
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED_OES 0x8CDD
|
||||
#define GL_FRAMEBUFFER_BINDING_OES 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING_OES 0x8CA7
|
||||
#define GL_MAX_RENDERBUFFER_SIZE_OES 0x84E8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION_OES 0x0506
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFEROESPROC) (GLuint renderbuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFEROESPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSOESPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSOESPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEOESPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVOESPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFEROESPROC) (GLuint framebuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFEROESPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSOESPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSOESPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSOESPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEROESPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DOESPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVOESPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPOESPROC) (GLenum target);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API GLboolean GL_APIENTRY glIsRenderbufferOES (GLuint renderbuffer);
|
||||
GL_API void GL_APIENTRY glBindRenderbufferOES (GLenum target, GLuint renderbuffer);
|
||||
GL_API void GL_APIENTRY glDeleteRenderbuffersOES (GLsizei n, const GLuint *renderbuffers);
|
||||
GL_API void GL_APIENTRY glGenRenderbuffersOES (GLsizei n, GLuint *renderbuffers);
|
||||
GL_API void GL_APIENTRY glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glGetRenderbufferParameterivOES (GLenum target, GLenum pname, GLint *params);
|
||||
GL_API GLboolean GL_APIENTRY glIsFramebufferOES (GLuint framebuffer);
|
||||
GL_API void GL_APIENTRY glBindFramebufferOES (GLenum target, GLuint framebuffer);
|
||||
GL_API void GL_APIENTRY glDeleteFramebuffersOES (GLsizei n, const GLuint *framebuffers);
|
||||
GL_API void GL_APIENTRY glGenFramebuffersOES (GLsizei n, GLuint *framebuffers);
|
||||
GL_API GLenum GL_APIENTRY glCheckFramebufferStatusOES (GLenum target);
|
||||
GL_API void GL_APIENTRY glFramebufferRenderbufferOES (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
GL_API void GL_APIENTRY glFramebufferTexture2DOES (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GL_API void GL_APIENTRY glGetFramebufferAttachmentParameterivOES (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glGenerateMipmapOES (GLenum target);
|
||||
#endif
|
||||
#endif /* GL_OES_framebuffer_object */
|
||||
|
||||
#ifndef GL_OES_mapbuffer
|
||||
#define GL_OES_mapbuffer 1
|
||||
#define GL_WRITE_ONLY_OES 0x88B9
|
||||
#define GL_BUFFER_ACCESS_OES 0x88BB
|
||||
#define GL_BUFFER_MAPPED_OES 0x88BC
|
||||
#define GL_BUFFER_MAP_POINTER_OES 0x88BD
|
||||
typedef void *(GL_APIENTRYP PFNGLMAPBUFFEROESPROC) (GLenum target, GLenum access);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLUNMAPBUFFEROESPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLGETBUFFERPOINTERVOESPROC) (GLenum target, GLenum pname, void **params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void *GL_APIENTRY glMapBufferOES (GLenum target, GLenum access);
|
||||
GL_API GLboolean GL_APIENTRY glUnmapBufferOES (GLenum target);
|
||||
GL_API void GL_APIENTRY glGetBufferPointervOES (GLenum target, GLenum pname, void **params);
|
||||
#endif
|
||||
#endif /* GL_OES_mapbuffer */
|
||||
|
||||
#ifndef GL_OES_matrix_get
|
||||
#define GL_OES_matrix_get 1
|
||||
#define GL_MODELVIEW_MATRIX_FLOAT_AS_INT_BITS_OES 0x898D
|
||||
#define GL_PROJECTION_MATRIX_FLOAT_AS_INT_BITS_OES 0x898E
|
||||
#define GL_TEXTURE_MATRIX_FLOAT_AS_INT_BITS_OES 0x898F
|
||||
#endif /* GL_OES_matrix_get */
|
||||
|
||||
#ifndef GL_OES_matrix_palette
|
||||
#define GL_OES_matrix_palette 1
|
||||
#define GL_MAX_VERTEX_UNITS_OES 0x86A4
|
||||
#define GL_MAX_PALETTE_MATRICES_OES 0x8842
|
||||
#define GL_MATRIX_PALETTE_OES 0x8840
|
||||
#define GL_MATRIX_INDEX_ARRAY_OES 0x8844
|
||||
#define GL_WEIGHT_ARRAY_OES 0x86AD
|
||||
#define GL_CURRENT_PALETTE_MATRIX_OES 0x8843
|
||||
#define GL_MATRIX_INDEX_ARRAY_SIZE_OES 0x8846
|
||||
#define GL_MATRIX_INDEX_ARRAY_TYPE_OES 0x8847
|
||||
#define GL_MATRIX_INDEX_ARRAY_STRIDE_OES 0x8848
|
||||
#define GL_MATRIX_INDEX_ARRAY_POINTER_OES 0x8849
|
||||
#define GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES 0x8B9E
|
||||
#define GL_WEIGHT_ARRAY_SIZE_OES 0x86AB
|
||||
#define GL_WEIGHT_ARRAY_TYPE_OES 0x86A9
|
||||
#define GL_WEIGHT_ARRAY_STRIDE_OES 0x86AA
|
||||
#define GL_WEIGHT_ARRAY_POINTER_OES 0x86AC
|
||||
#define GL_WEIGHT_ARRAY_BUFFER_BINDING_OES 0x889E
|
||||
typedef void (GL_APIENTRYP PFNGLCURRENTPALETTEMATRIXOESPROC) (GLuint matrixpaletteindex);
|
||||
typedef void (GL_APIENTRYP PFNGLLOADPALETTEFROMMODELVIEWMATRIXOESPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLMATRIXINDEXPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
typedef void (GL_APIENTRYP PFNGLWEIGHTPOINTEROESPROC) (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glCurrentPaletteMatrixOES (GLuint matrixpaletteindex);
|
||||
GL_API void GL_APIENTRY glLoadPaletteFromModelViewMatrixOES (void);
|
||||
GL_API void GL_APIENTRY glMatrixIndexPointerOES (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
GL_API void GL_APIENTRY glWeightPointerOES (GLint size, GLenum type, GLsizei stride, const void *pointer);
|
||||
#endif
|
||||
#endif /* GL_OES_matrix_palette */
|
||||
|
||||
#ifndef GL_OES_packed_depth_stencil
|
||||
#define GL_OES_packed_depth_stencil 1
|
||||
#define GL_DEPTH_STENCIL_OES 0x84F9
|
||||
#define GL_UNSIGNED_INT_24_8_OES 0x84FA
|
||||
#define GL_DEPTH24_STENCIL8_OES 0x88F0
|
||||
#endif /* GL_OES_packed_depth_stencil */
|
||||
|
||||
#ifndef GL_OES_query_matrix
|
||||
#define GL_OES_query_matrix 1
|
||||
typedef GLbitfield (GL_APIENTRYP PFNGLQUERYMATRIXXOESPROC) (GLfixed *mantissa, GLint *exponent);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API GLbitfield GL_APIENTRY glQueryMatrixxOES (GLfixed *mantissa, GLint *exponent);
|
||||
#endif
|
||||
#endif /* GL_OES_query_matrix */
|
||||
|
||||
#ifndef GL_OES_required_internalformat
|
||||
#define GL_OES_required_internalformat 1
|
||||
#define GL_ALPHA8_OES 0x803C
|
||||
#define GL_LUMINANCE4_ALPHA4_OES 0x8043
|
||||
#define GL_LUMINANCE8_ALPHA8_OES 0x8045
|
||||
#define GL_LUMINANCE8_OES 0x8040
|
||||
#define GL_RGB8_OES 0x8051
|
||||
#define GL_RGBA8_OES 0x8058
|
||||
#define GL_RGB10_EXT 0x8052
|
||||
#define GL_RGB10_A2_EXT 0x8059
|
||||
#endif /* GL_OES_required_internalformat */
|
||||
|
||||
#ifndef GL_OES_rgb8_rgba8
|
||||
#define GL_OES_rgb8_rgba8 1
|
||||
#endif /* GL_OES_rgb8_rgba8 */
|
||||
|
||||
#ifndef GL_OES_single_precision
|
||||
#define GL_OES_single_precision 1
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFOESPROC) (GLclampf depth);
|
||||
typedef void (GL_APIENTRYP PFNGLCLIPPLANEFOESPROC) (GLenum plane, const GLfloat *equation);
|
||||
typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFOESPROC) (GLclampf n, GLclampf f);
|
||||
typedef void (GL_APIENTRYP PFNGLFRUSTUMFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
typedef void (GL_APIENTRYP PFNGLGETCLIPPLANEFOESPROC) (GLenum plane, GLfloat *equation);
|
||||
typedef void (GL_APIENTRYP PFNGLORTHOFOESPROC) (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glClearDepthfOES (GLclampf depth);
|
||||
GL_API void GL_APIENTRY glClipPlanefOES (GLenum plane, const GLfloat *equation);
|
||||
GL_API void GL_APIENTRY glDepthRangefOES (GLclampf n, GLclampf f);
|
||||
GL_API void GL_APIENTRY glFrustumfOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
GL_API void GL_APIENTRY glGetClipPlanefOES (GLenum plane, GLfloat *equation);
|
||||
GL_API void GL_APIENTRY glOrthofOES (GLfloat l, GLfloat r, GLfloat b, GLfloat t, GLfloat n, GLfloat f);
|
||||
#endif
|
||||
#endif /* GL_OES_single_precision */
|
||||
|
||||
#ifndef GL_OES_stencil1
|
||||
#define GL_OES_stencil1 1
|
||||
#define GL_STENCIL_INDEX1_OES 0x8D46
|
||||
#endif /* GL_OES_stencil1 */
|
||||
|
||||
#ifndef GL_OES_stencil4
|
||||
#define GL_OES_stencil4 1
|
||||
#define GL_STENCIL_INDEX4_OES 0x8D47
|
||||
#endif /* GL_OES_stencil4 */
|
||||
|
||||
#ifndef GL_OES_stencil8
|
||||
#define GL_OES_stencil8 1
|
||||
#define GL_STENCIL_INDEX8_OES 0x8D48
|
||||
#endif /* GL_OES_stencil8 */
|
||||
|
||||
#ifndef GL_OES_stencil_wrap
|
||||
#define GL_OES_stencil_wrap 1
|
||||
#define GL_INCR_WRAP_OES 0x8507
|
||||
#define GL_DECR_WRAP_OES 0x8508
|
||||
#endif /* GL_OES_stencil_wrap */
|
||||
|
||||
#ifndef GL_OES_surfaceless_context
|
||||
#define GL_OES_surfaceless_context 1
|
||||
#define GL_FRAMEBUFFER_UNDEFINED_OES 0x8219
|
||||
#endif /* GL_OES_surfaceless_context */
|
||||
|
||||
#ifndef GL_OES_texture_cube_map
|
||||
#define GL_OES_texture_cube_map 1
|
||||
#define GL_NORMAL_MAP_OES 0x8511
|
||||
#define GL_REFLECTION_MAP_OES 0x8512
|
||||
#define GL_TEXTURE_CUBE_MAP_OES 0x8513
|
||||
#define GL_TEXTURE_BINDING_CUBE_MAP_OES 0x8514
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_OES 0x8515
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_OES 0x8516
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_OES 0x8517
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_OES 0x8518
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_OES 0x8519
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_OES 0x851A
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_OES 0x851C
|
||||
#define GL_TEXTURE_GEN_MODE_OES 0x2500
|
||||
#define GL_TEXTURE_GEN_STR_OES 0x8D60
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENFOESPROC) (GLenum coord, GLenum pname, GLfloat param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENFVOESPROC) (GLenum coord, GLenum pname, const GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENIOESPROC) (GLenum coord, GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXGENIVOESPROC) (GLenum coord, GLenum pname, const GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXGENFVOESPROC) (GLenum coord, GLenum pname, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXGENIVOESPROC) (GLenum coord, GLenum pname, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glTexGenfOES (GLenum coord, GLenum pname, GLfloat param);
|
||||
GL_API void GL_APIENTRY glTexGenfvOES (GLenum coord, GLenum pname, const GLfloat *params);
|
||||
GL_API void GL_APIENTRY glTexGeniOES (GLenum coord, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glTexGenivOES (GLenum coord, GLenum pname, const GLint *params);
|
||||
GL_API void GL_APIENTRY glGetTexGenfvOES (GLenum coord, GLenum pname, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetTexGenivOES (GLenum coord, GLenum pname, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_OES_texture_cube_map */
|
||||
|
||||
#ifndef GL_OES_texture_env_crossbar
|
||||
#define GL_OES_texture_env_crossbar 1
|
||||
#endif /* GL_OES_texture_env_crossbar */
|
||||
|
||||
#ifndef GL_OES_texture_mirrored_repeat
|
||||
#define GL_OES_texture_mirrored_repeat 1
|
||||
#define GL_MIRRORED_REPEAT_OES 0x8370
|
||||
#endif /* GL_OES_texture_mirrored_repeat */
|
||||
|
||||
#ifndef GL_OES_texture_npot
|
||||
#define GL_OES_texture_npot 1
|
||||
#endif /* GL_OES_texture_npot */
|
||||
|
||||
#ifndef GL_OES_vertex_array_object
|
||||
#define GL_OES_vertex_array_object 1
|
||||
#define GL_VERTEX_ARRAY_BINDING_OES 0x85B5
|
||||
typedef void (GL_APIENTRYP PFNGLBINDVERTEXARRAYOESPROC) (GLuint array);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEVERTEXARRAYSOESPROC) (GLsizei n, const GLuint *arrays);
|
||||
typedef void (GL_APIENTRYP PFNGLGENVERTEXARRAYSOESPROC) (GLsizei n, GLuint *arrays);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISVERTEXARRAYOESPROC) (GLuint array);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glBindVertexArrayOES (GLuint array);
|
||||
GL_API void GL_APIENTRY glDeleteVertexArraysOES (GLsizei n, const GLuint *arrays);
|
||||
GL_API void GL_APIENTRY glGenVertexArraysOES (GLsizei n, GLuint *arrays);
|
||||
GL_API GLboolean GL_APIENTRY glIsVertexArrayOES (GLuint array);
|
||||
#endif
|
||||
#endif /* GL_OES_vertex_array_object */
|
||||
|
||||
#ifndef GL_AMD_compressed_3DC_texture
|
||||
#define GL_AMD_compressed_3DC_texture 1
|
||||
#define GL_3DC_X_AMD 0x87F9
|
||||
#define GL_3DC_XY_AMD 0x87FA
|
||||
#endif /* GL_AMD_compressed_3DC_texture */
|
||||
|
||||
#ifndef GL_AMD_compressed_ATC_texture
|
||||
#define GL_AMD_compressed_ATC_texture 1
|
||||
#define GL_ATC_RGB_AMD 0x8C92
|
||||
#define GL_ATC_RGBA_EXPLICIT_ALPHA_AMD 0x8C93
|
||||
#define GL_ATC_RGBA_INTERPOLATED_ALPHA_AMD 0x87EE
|
||||
#endif /* GL_AMD_compressed_ATC_texture */
|
||||
|
||||
#ifndef GL_APPLE_copy_texture_levels
|
||||
#define GL_APPLE_copy_texture_levels 1
|
||||
typedef void (GL_APIENTRYP PFNGLCOPYTEXTURELEVELSAPPLEPROC) (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glCopyTextureLevelsAPPLE (GLuint destinationTexture, GLuint sourceTexture, GLint sourceBaseLevel, GLsizei sourceLevelCount);
|
||||
#endif
|
||||
#endif /* GL_APPLE_copy_texture_levels */
|
||||
|
||||
#ifndef GL_APPLE_framebuffer_multisample
|
||||
#define GL_APPLE_framebuffer_multisample 1
|
||||
#define GL_RENDERBUFFER_SAMPLES_APPLE 0x8CAB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_APPLE 0x8D56
|
||||
#define GL_MAX_SAMPLES_APPLE 0x8D57
|
||||
#define GL_READ_FRAMEBUFFER_APPLE 0x8CA8
|
||||
#define GL_DRAW_FRAMEBUFFER_APPLE 0x8CA9
|
||||
#define GL_DRAW_FRAMEBUFFER_BINDING_APPLE 0x8CA6
|
||||
#define GL_READ_FRAMEBUFFER_BINDING_APPLE 0x8CAA
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEAPPLEPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLRESOLVEMULTISAMPLEFRAMEBUFFERAPPLEPROC) (void);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleAPPLE (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glResolveMultisampleFramebufferAPPLE (void);
|
||||
#endif
|
||||
#endif /* GL_APPLE_framebuffer_multisample */
|
||||
|
||||
#ifndef GL_APPLE_sync
|
||||
#define GL_APPLE_sync 1
|
||||
typedef struct __GLsync *GLsync;
|
||||
typedef khronos_uint64_t GLuint64;
|
||||
typedef khronos_int64_t GLint64;
|
||||
#define GL_SYNC_OBJECT_APPLE 0x8A53
|
||||
#define GL_MAX_SERVER_WAIT_TIMEOUT_APPLE 0x9111
|
||||
#define GL_OBJECT_TYPE_APPLE 0x9112
|
||||
#define GL_SYNC_CONDITION_APPLE 0x9113
|
||||
#define GL_SYNC_STATUS_APPLE 0x9114
|
||||
#define GL_SYNC_FLAGS_APPLE 0x9115
|
||||
#define GL_SYNC_FENCE_APPLE 0x9116
|
||||
#define GL_SYNC_GPU_COMMANDS_COMPLETE_APPLE 0x9117
|
||||
#define GL_UNSIGNALED_APPLE 0x9118
|
||||
#define GL_SIGNALED_APPLE 0x9119
|
||||
#define GL_ALREADY_SIGNALED_APPLE 0x911A
|
||||
#define GL_TIMEOUT_EXPIRED_APPLE 0x911B
|
||||
#define GL_CONDITION_SATISFIED_APPLE 0x911C
|
||||
#define GL_WAIT_FAILED_APPLE 0x911D
|
||||
#define GL_SYNC_FLUSH_COMMANDS_BIT_APPLE 0x00000001
|
||||
#define GL_TIMEOUT_IGNORED_APPLE 0xFFFFFFFFFFFFFFFFull
|
||||
typedef GLsync (GL_APIENTRYP PFNGLFENCESYNCAPPLEPROC) (GLenum condition, GLbitfield flags);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISSYNCAPPLEPROC) (GLsync sync);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETESYNCAPPLEPROC) (GLsync sync);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLCLIENTWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLWAITSYNCAPPLEPROC) (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGER64VAPPLEPROC) (GLenum pname, GLint64 *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSYNCIVAPPLEPROC) (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API GLsync GL_APIENTRY glFenceSyncAPPLE (GLenum condition, GLbitfield flags);
|
||||
GL_API GLboolean GL_APIENTRY glIsSyncAPPLE (GLsync sync);
|
||||
GL_API void GL_APIENTRY glDeleteSyncAPPLE (GLsync sync);
|
||||
GL_API GLenum GL_APIENTRY glClientWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_API void GL_APIENTRY glWaitSyncAPPLE (GLsync sync, GLbitfield flags, GLuint64 timeout);
|
||||
GL_API void GL_APIENTRY glGetInteger64vAPPLE (GLenum pname, GLint64 *params);
|
||||
GL_API void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei count, GLsizei *length, GLint *values);
|
||||
#endif
|
||||
#endif /* GL_APPLE_sync */
|
||||
|
||||
#ifndef GL_APPLE_texture_2D_limited_npot
|
||||
#define GL_APPLE_texture_2D_limited_npot 1
|
||||
#endif /* GL_APPLE_texture_2D_limited_npot */
|
||||
|
||||
#ifndef GL_APPLE_texture_format_BGRA8888
|
||||
#define GL_APPLE_texture_format_BGRA8888 1
|
||||
#define GL_BGRA_EXT 0x80E1
|
||||
#define GL_BGRA8_EXT 0x93A1
|
||||
#endif /* GL_APPLE_texture_format_BGRA8888 */
|
||||
|
||||
#ifndef GL_APPLE_texture_max_level
|
||||
#define GL_APPLE_texture_max_level 1
|
||||
#define GL_TEXTURE_MAX_LEVEL_APPLE 0x813D
|
||||
#endif /* GL_APPLE_texture_max_level */
|
||||
|
||||
#ifndef GL_ARM_rgba8
|
||||
#define GL_ARM_rgba8 1
|
||||
#endif /* GL_ARM_rgba8 */
|
||||
|
||||
#ifndef GL_EXT_blend_minmax
|
||||
#define GL_EXT_blend_minmax 1
|
||||
#define GL_MIN_EXT 0x8007
|
||||
#define GL_MAX_EXT 0x8008
|
||||
#endif /* GL_EXT_blend_minmax */
|
||||
|
||||
#ifndef GL_EXT_debug_marker
|
||||
#define GL_EXT_debug_marker 1
|
||||
typedef char GLchar;
|
||||
typedef void (GL_APIENTRYP PFNGLINSERTEVENTMARKEREXTPROC) (GLsizei length, const GLchar *marker);
|
||||
typedef void (GL_APIENTRYP PFNGLPUSHGROUPMARKEREXTPROC) (GLsizei length, const GLchar *marker);
|
||||
typedef void (GL_APIENTRYP PFNGLPOPGROUPMARKEREXTPROC) (void);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glInsertEventMarkerEXT (GLsizei length, const GLchar *marker);
|
||||
GL_API void GL_APIENTRY glPushGroupMarkerEXT (GLsizei length, const GLchar *marker);
|
||||
GL_API void GL_APIENTRY glPopGroupMarkerEXT (void);
|
||||
#endif
|
||||
#endif /* GL_EXT_debug_marker */
|
||||
|
||||
#ifndef GL_EXT_discard_framebuffer
|
||||
#define GL_EXT_discard_framebuffer 1
|
||||
#define GL_COLOR_EXT 0x1800
|
||||
#define GL_DEPTH_EXT 0x1801
|
||||
#define GL_STENCIL_EXT 0x1802
|
||||
typedef void (GL_APIENTRYP PFNGLDISCARDFRAMEBUFFEREXTPROC) (GLenum target, GLsizei numAttachments, const GLenum *attachments);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glDiscardFramebufferEXT (GLenum target, GLsizei numAttachments, const GLenum *attachments);
|
||||
#endif
|
||||
#endif /* GL_EXT_discard_framebuffer */
|
||||
|
||||
#ifndef GL_EXT_map_buffer_range
|
||||
#define GL_EXT_map_buffer_range 1
|
||||
#define GL_MAP_READ_BIT_EXT 0x0001
|
||||
#define GL_MAP_WRITE_BIT_EXT 0x0002
|
||||
#define GL_MAP_INVALIDATE_RANGE_BIT_EXT 0x0004
|
||||
#define GL_MAP_INVALIDATE_BUFFER_BIT_EXT 0x0008
|
||||
#define GL_MAP_FLUSH_EXPLICIT_BIT_EXT 0x0010
|
||||
#define GL_MAP_UNSYNCHRONIZED_BIT_EXT 0x0020
|
||||
typedef void *(GL_APIENTRYP PFNGLMAPBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
||||
typedef void (GL_APIENTRYP PFNGLFLUSHMAPPEDBUFFERRANGEEXTPROC) (GLenum target, GLintptr offset, GLsizeiptr length);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void *GL_APIENTRY glMapBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
|
||||
GL_API void GL_APIENTRY glFlushMappedBufferRangeEXT (GLenum target, GLintptr offset, GLsizeiptr length);
|
||||
#endif
|
||||
#endif /* GL_EXT_map_buffer_range */
|
||||
|
||||
#ifndef GL_EXT_multi_draw_arrays
|
||||
#define GL_EXT_multi_draw_arrays 1
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
|
||||
typedef void (GL_APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glMultiDrawArraysEXT (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount);
|
||||
GL_API void GL_APIENTRY glMultiDrawElementsEXT (GLenum mode, const GLsizei *count, GLenum type, const void *const*indices, GLsizei primcount);
|
||||
#endif
|
||||
#endif /* GL_EXT_multi_draw_arrays */
|
||||
|
||||
#ifndef GL_EXT_multisampled_render_to_texture
|
||||
#define GL_EXT_multisampled_render_to_texture 1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_SAMPLES_EXT 0x8D6C
|
||||
#define GL_RENDERBUFFER_SAMPLES_EXT 0x8CAB
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_EXT 0x8D56
|
||||
#define GL_MAX_SAMPLES_EXT 0x8D57
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEEXTPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleEXT (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleEXT (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#endif
|
||||
#endif /* GL_EXT_multisampled_render_to_texture */
|
||||
|
||||
#ifndef GL_EXT_read_format_bgra
|
||||
#define GL_EXT_read_format_bgra 1
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_EXT 0x8365
|
||||
#define GL_UNSIGNED_SHORT_1_5_5_5_REV_EXT 0x8366
|
||||
#endif /* GL_EXT_read_format_bgra */
|
||||
|
||||
#ifndef GL_EXT_robustness
|
||||
#define GL_EXT_robustness 1
|
||||
#define GL_GUILTY_CONTEXT_RESET_EXT 0x8253
|
||||
#define GL_INNOCENT_CONTEXT_RESET_EXT 0x8254
|
||||
#define GL_UNKNOWN_CONTEXT_RESET_EXT 0x8255
|
||||
#define GL_CONTEXT_ROBUST_ACCESS_EXT 0x90F3
|
||||
#define GL_RESET_NOTIFICATION_STRATEGY_EXT 0x8256
|
||||
#define GL_LOSE_CONTEXT_ON_RESET_EXT 0x8252
|
||||
#define GL_NO_RESET_NOTIFICATION_EXT 0x8261
|
||||
typedef GLenum (GL_APIENTRYP PFNGLGETGRAPHICSRESETSTATUSEXTPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLREADNPIXELSEXTPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMFVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETNUNIFORMIVEXTPROC) (GLuint program, GLint location, GLsizei bufSize, GLint *params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API GLenum GL_APIENTRY glGetGraphicsResetStatusEXT (void);
|
||||
GL_API void GL_APIENTRY glReadnPixelsEXT (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data);
|
||||
GL_API void GL_APIENTRY glGetnUniformfvEXT (GLuint program, GLint location, GLsizei bufSize, GLfloat *params);
|
||||
GL_API void GL_APIENTRY glGetnUniformivEXT (GLuint program, GLint location, GLsizei bufSize, GLint *params);
|
||||
#endif
|
||||
#endif /* GL_EXT_robustness */
|
||||
|
||||
#ifndef GL_EXT_sRGB
|
||||
#define GL_EXT_sRGB 1
|
||||
#define GL_SRGB_EXT 0x8C40
|
||||
#define GL_SRGB_ALPHA_EXT 0x8C42
|
||||
#define GL_SRGB8_ALPHA8_EXT 0x8C43
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING_EXT 0x8210
|
||||
#endif /* GL_EXT_sRGB */
|
||||
|
||||
#ifndef GL_EXT_texture_compression_dxt1
|
||||
#define GL_EXT_texture_compression_dxt1 1
|
||||
#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0
|
||||
#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1
|
||||
#endif /* GL_EXT_texture_compression_dxt1 */
|
||||
|
||||
#ifndef GL_EXT_texture_filter_anisotropic
|
||||
#define GL_EXT_texture_filter_anisotropic 1
|
||||
#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE
|
||||
#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF
|
||||
#endif /* GL_EXT_texture_filter_anisotropic */
|
||||
|
||||
#ifndef GL_EXT_texture_format_BGRA8888
|
||||
#define GL_EXT_texture_format_BGRA8888 1
|
||||
#endif /* GL_EXT_texture_format_BGRA8888 */
|
||||
|
||||
#ifndef GL_EXT_texture_lod_bias
|
||||
#define GL_EXT_texture_lod_bias 1
|
||||
#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD
|
||||
#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500
|
||||
#define GL_TEXTURE_LOD_BIAS_EXT 0x8501
|
||||
#endif /* GL_EXT_texture_lod_bias */
|
||||
|
||||
#ifndef GL_EXT_texture_storage
|
||||
#define GL_EXT_texture_storage 1
|
||||
#define GL_TEXTURE_IMMUTABLE_FORMAT_EXT 0x912F
|
||||
#define GL_ALPHA8_EXT 0x803C
|
||||
#define GL_LUMINANCE8_EXT 0x8040
|
||||
#define GL_LUMINANCE8_ALPHA8_EXT 0x8045
|
||||
#define GL_RGBA32F_EXT 0x8814
|
||||
#define GL_RGB32F_EXT 0x8815
|
||||
#define GL_ALPHA32F_EXT 0x8816
|
||||
#define GL_LUMINANCE32F_EXT 0x8818
|
||||
#define GL_LUMINANCE_ALPHA32F_EXT 0x8819
|
||||
#define GL_RGBA16F_EXT 0x881A
|
||||
#define GL_RGB16F_EXT 0x881B
|
||||
#define GL_ALPHA16F_EXT 0x881C
|
||||
#define GL_LUMINANCE16F_EXT 0x881E
|
||||
#define GL_LUMINANCE_ALPHA16F_EXT 0x881F
|
||||
#define GL_R8_EXT 0x8229
|
||||
#define GL_RG8_EXT 0x822B
|
||||
#define GL_R32F_EXT 0x822E
|
||||
#define GL_RG32F_EXT 0x8230
|
||||
#define GL_R16F_EXT 0x822D
|
||||
#define GL_RG16F_EXT 0x822F
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE1DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE2DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSTORAGE3DEXTPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glTexStorage1DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
GL_API void GL_APIENTRY glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
GL_API void GL_APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
|
||||
GL_API void GL_APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
|
||||
#endif
|
||||
#endif /* GL_EXT_texture_storage */
|
||||
|
||||
#ifndef GL_IMG_multisampled_render_to_texture
|
||||
#define GL_IMG_multisampled_render_to_texture 1
|
||||
#define GL_RENDERBUFFER_SAMPLES_IMG 0x9133
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE_IMG 0x9134
|
||||
#define GL_MAX_SAMPLES_IMG 0x9135
|
||||
#define GL_TEXTURE_SAMPLES_IMG 0x9136
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEMULTISAMPLEIMGPROC) (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DMULTISAMPLEIMGPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glRenderbufferStorageMultisampleIMG (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_API void GL_APIENTRY glFramebufferTexture2DMultisampleIMG (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples);
|
||||
#endif
|
||||
#endif /* GL_IMG_multisampled_render_to_texture */
|
||||
|
||||
#ifndef GL_IMG_read_format
|
||||
#define GL_IMG_read_format 1
|
||||
#define GL_BGRA_IMG 0x80E1
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4_REV_IMG 0x8365
|
||||
#endif /* GL_IMG_read_format */
|
||||
|
||||
#ifndef GL_IMG_texture_compression_pvrtc
|
||||
#define GL_IMG_texture_compression_pvrtc 1
|
||||
#define GL_COMPRESSED_RGB_PVRTC_4BPPV1_IMG 0x8C00
|
||||
#define GL_COMPRESSED_RGB_PVRTC_2BPPV1_IMG 0x8C01
|
||||
#define GL_COMPRESSED_RGBA_PVRTC_4BPPV1_IMG 0x8C02
|
||||
#define GL_COMPRESSED_RGBA_PVRTC_2BPPV1_IMG 0x8C03
|
||||
#endif /* GL_IMG_texture_compression_pvrtc */
|
||||
|
||||
#ifndef GL_IMG_texture_env_enhanced_fixed_function
|
||||
#define GL_IMG_texture_env_enhanced_fixed_function 1
|
||||
#define GL_MODULATE_COLOR_IMG 0x8C04
|
||||
#define GL_RECIP_ADD_SIGNED_ALPHA_IMG 0x8C05
|
||||
#define GL_TEXTURE_ALPHA_MODULATE_IMG 0x8C06
|
||||
#define GL_FACTOR_ALPHA_MODULATE_IMG 0x8C07
|
||||
#define GL_FRAGMENT_ALPHA_MODULATE_IMG 0x8C08
|
||||
#define GL_ADD_BLEND_IMG 0x8C09
|
||||
#define GL_DOT3_RGBA_IMG 0x86AF
|
||||
#endif /* GL_IMG_texture_env_enhanced_fixed_function */
|
||||
|
||||
#ifndef GL_IMG_user_clip_plane
|
||||
#define GL_IMG_user_clip_plane 1
|
||||
#define GL_CLIP_PLANE0_IMG 0x3000
|
||||
#define GL_CLIP_PLANE1_IMG 0x3001
|
||||
#define GL_CLIP_PLANE2_IMG 0x3002
|
||||
#define GL_CLIP_PLANE3_IMG 0x3003
|
||||
#define GL_CLIP_PLANE4_IMG 0x3004
|
||||
#define GL_CLIP_PLANE5_IMG 0x3005
|
||||
#define GL_MAX_CLIP_PLANES_IMG 0x0D32
|
||||
typedef void (GL_APIENTRYP PFNGLCLIPPLANEFIMGPROC) (GLenum p, const GLfloat *eqn);
|
||||
typedef void (GL_APIENTRYP PFNGLCLIPPLANEXIMGPROC) (GLenum p, const GLfixed *eqn);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glClipPlanefIMG (GLenum p, const GLfloat *eqn);
|
||||
GL_API void GL_APIENTRY glClipPlanexIMG (GLenum p, const GLfixed *eqn);
|
||||
#endif
|
||||
#endif /* GL_IMG_user_clip_plane */
|
||||
|
||||
#ifndef GL_NV_fence
|
||||
#define GL_NV_fence 1
|
||||
#define GL_ALL_COMPLETED_NV 0x84F2
|
||||
#define GL_FENCE_STATUS_NV 0x84F3
|
||||
#define GL_FENCE_CONDITION_NV 0x84F4
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences);
|
||||
typedef void (GL_APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISFENCENVPROC) (GLuint fence);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence);
|
||||
typedef void (GL_APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glDeleteFencesNV (GLsizei n, const GLuint *fences);
|
||||
GL_API void GL_APIENTRY glGenFencesNV (GLsizei n, GLuint *fences);
|
||||
GL_API GLboolean GL_APIENTRY glIsFenceNV (GLuint fence);
|
||||
GL_API GLboolean GL_APIENTRY glTestFenceNV (GLuint fence);
|
||||
GL_API void GL_APIENTRY glGetFenceivNV (GLuint fence, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glFinishFenceNV (GLuint fence);
|
||||
GL_API void GL_APIENTRY glSetFenceNV (GLuint fence, GLenum condition);
|
||||
#endif
|
||||
#endif /* GL_NV_fence */
|
||||
|
||||
#ifndef GL_QCOM_driver_control
|
||||
#define GL_QCOM_driver_control 1
|
||||
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSQCOMPROC) (GLint *num, GLsizei size, GLuint *driverControls);
|
||||
typedef void (GL_APIENTRYP PFNGLGETDRIVERCONTROLSTRINGQCOMPROC) (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
|
||||
typedef void (GL_APIENTRYP PFNGLENABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
|
||||
typedef void (GL_APIENTRYP PFNGLDISABLEDRIVERCONTROLQCOMPROC) (GLuint driverControl);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glGetDriverControlsQCOM (GLint *num, GLsizei size, GLuint *driverControls);
|
||||
GL_API void GL_APIENTRY glGetDriverControlStringQCOM (GLuint driverControl, GLsizei bufSize, GLsizei *length, GLchar *driverControlString);
|
||||
GL_API void GL_APIENTRY glEnableDriverControlQCOM (GLuint driverControl);
|
||||
GL_API void GL_APIENTRY glDisableDriverControlQCOM (GLuint driverControl);
|
||||
#endif
|
||||
#endif /* GL_QCOM_driver_control */
|
||||
|
||||
#ifndef GL_QCOM_extended_get
|
||||
#define GL_QCOM_extended_get 1
|
||||
#define GL_TEXTURE_WIDTH_QCOM 0x8BD2
|
||||
#define GL_TEXTURE_HEIGHT_QCOM 0x8BD3
|
||||
#define GL_TEXTURE_DEPTH_QCOM 0x8BD4
|
||||
#define GL_TEXTURE_INTERNAL_FORMAT_QCOM 0x8BD5
|
||||
#define GL_TEXTURE_FORMAT_QCOM 0x8BD6
|
||||
#define GL_TEXTURE_TYPE_QCOM 0x8BD7
|
||||
#define GL_TEXTURE_IMAGE_VALID_QCOM 0x8BD8
|
||||
#define GL_TEXTURE_NUM_LEVELS_QCOM 0x8BD9
|
||||
#define GL_TEXTURE_TARGET_QCOM 0x8BDA
|
||||
#define GL_TEXTURE_OBJECT_VALID_QCOM 0x8BDB
|
||||
#define GL_STATE_RESTORE 0x8BDC
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXTURESQCOMPROC) (GLuint *textures, GLint maxTextures, GLint *numTextures);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERSQCOMPROC) (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETRENDERBUFFERSQCOMPROC) (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETFRAMEBUFFERSQCOMPROC) (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXLEVELPARAMETERIVQCOMPROC) (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTTEXOBJECTSTATEOVERRIDEIQCOMPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETTEXSUBIMAGEQCOMPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETBUFFERPOINTERVQCOMPROC) (GLenum target, void **params);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glExtGetTexturesQCOM (GLuint *textures, GLint maxTextures, GLint *numTextures);
|
||||
GL_API void GL_APIENTRY glExtGetBuffersQCOM (GLuint *buffers, GLint maxBuffers, GLint *numBuffers);
|
||||
GL_API void GL_APIENTRY glExtGetRenderbuffersQCOM (GLuint *renderbuffers, GLint maxRenderbuffers, GLint *numRenderbuffers);
|
||||
GL_API void GL_APIENTRY glExtGetFramebuffersQCOM (GLuint *framebuffers, GLint maxFramebuffers, GLint *numFramebuffers);
|
||||
GL_API void GL_APIENTRY glExtGetTexLevelParameterivQCOM (GLuint texture, GLenum face, GLint level, GLenum pname, GLint *params);
|
||||
GL_API void GL_APIENTRY glExtTexObjectStateOverrideiQCOM (GLenum target, GLenum pname, GLint param);
|
||||
GL_API void GL_APIENTRY glExtGetTexSubImageQCOM (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, void *texels);
|
||||
GL_API void GL_APIENTRY glExtGetBufferPointervQCOM (GLenum target, void **params);
|
||||
#endif
|
||||
#endif /* GL_QCOM_extended_get */
|
||||
|
||||
#ifndef GL_QCOM_extended_get2
|
||||
#define GL_QCOM_extended_get2 1
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETSHADERSQCOMPROC) (GLuint *shaders, GLint maxShaders, GLint *numShaders);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMSQCOMPROC) (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLEXTISPROGRAMBINARYQCOMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLEXTGETPROGRAMBINARYSOURCEQCOMPROC) (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glExtGetShadersQCOM (GLuint *shaders, GLint maxShaders, GLint *numShaders);
|
||||
GL_API void GL_APIENTRY glExtGetProgramsQCOM (GLuint *programs, GLint maxPrograms, GLint *numPrograms);
|
||||
GL_API GLboolean GL_APIENTRY glExtIsProgramBinaryQCOM (GLuint program);
|
||||
GL_API void GL_APIENTRY glExtGetProgramBinarySourceQCOM (GLuint program, GLenum shadertype, GLchar *source, GLint *length);
|
||||
#endif
|
||||
#endif /* GL_QCOM_extended_get2 */
|
||||
|
||||
#ifndef GL_QCOM_perfmon_global_mode
|
||||
#define GL_QCOM_perfmon_global_mode 1
|
||||
#define GL_PERFMON_GLOBAL_MODE_QCOM 0x8FA0
|
||||
#endif /* GL_QCOM_perfmon_global_mode */
|
||||
|
||||
#ifndef GL_QCOM_tiled_rendering
|
||||
#define GL_QCOM_tiled_rendering 1
|
||||
#define GL_COLOR_BUFFER_BIT0_QCOM 0x00000001
|
||||
#define GL_COLOR_BUFFER_BIT1_QCOM 0x00000002
|
||||
#define GL_COLOR_BUFFER_BIT2_QCOM 0x00000004
|
||||
#define GL_COLOR_BUFFER_BIT3_QCOM 0x00000008
|
||||
#define GL_COLOR_BUFFER_BIT4_QCOM 0x00000010
|
||||
#define GL_COLOR_BUFFER_BIT5_QCOM 0x00000020
|
||||
#define GL_COLOR_BUFFER_BIT6_QCOM 0x00000040
|
||||
#define GL_COLOR_BUFFER_BIT7_QCOM 0x00000080
|
||||
#define GL_DEPTH_BUFFER_BIT0_QCOM 0x00000100
|
||||
#define GL_DEPTH_BUFFER_BIT1_QCOM 0x00000200
|
||||
#define GL_DEPTH_BUFFER_BIT2_QCOM 0x00000400
|
||||
#define GL_DEPTH_BUFFER_BIT3_QCOM 0x00000800
|
||||
#define GL_DEPTH_BUFFER_BIT4_QCOM 0x00001000
|
||||
#define GL_DEPTH_BUFFER_BIT5_QCOM 0x00002000
|
||||
#define GL_DEPTH_BUFFER_BIT6_QCOM 0x00004000
|
||||
#define GL_DEPTH_BUFFER_BIT7_QCOM 0x00008000
|
||||
#define GL_STENCIL_BUFFER_BIT0_QCOM 0x00010000
|
||||
#define GL_STENCIL_BUFFER_BIT1_QCOM 0x00020000
|
||||
#define GL_STENCIL_BUFFER_BIT2_QCOM 0x00040000
|
||||
#define GL_STENCIL_BUFFER_BIT3_QCOM 0x00080000
|
||||
#define GL_STENCIL_BUFFER_BIT4_QCOM 0x00100000
|
||||
#define GL_STENCIL_BUFFER_BIT5_QCOM 0x00200000
|
||||
#define GL_STENCIL_BUFFER_BIT6_QCOM 0x00400000
|
||||
#define GL_STENCIL_BUFFER_BIT7_QCOM 0x00800000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT0_QCOM 0x01000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT1_QCOM 0x02000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT2_QCOM 0x04000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT3_QCOM 0x08000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT4_QCOM 0x10000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT5_QCOM 0x20000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT6_QCOM 0x40000000
|
||||
#define GL_MULTISAMPLE_BUFFER_BIT7_QCOM 0x80000000
|
||||
typedef void (GL_APIENTRYP PFNGLSTARTTILINGQCOMPROC) (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
typedef void (GL_APIENTRYP PFNGLENDTILINGQCOMPROC) (GLbitfield preserveMask);
|
||||
#ifdef GL_GLEXT_PROTOTYPES
|
||||
GL_API void GL_APIENTRY glStartTilingQCOM (GLuint x, GLuint y, GLuint width, GLuint height, GLbitfield preserveMask);
|
||||
GL_API void GL_APIENTRY glEndTilingQCOM (GLbitfield preserveMask);
|
||||
#endif
|
||||
#endif /* GL_QCOM_tiled_rendering */
|
||||
|
||||
#ifndef GL_QCOM_writeonly_rendering
|
||||
#define GL_QCOM_writeonly_rendering 1
|
||||
#define GL_WRITEONLY_RENDERING_QCOM 0x8823
|
||||
#endif /* GL_QCOM_writeonly_rendering */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef __glplatform_h_
|
||||
#define __glplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 1.X gl.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* Please contribute modifications back to Khronos as pull requests on the
|
||||
* public github repository:
|
||||
* https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_API
|
||||
#define GL_API KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __glplatform_h_ */
|
||||
@@ -0,0 +1,656 @@
|
||||
#ifndef __gles2_gl2_h_
|
||||
#define __gles2_gl2_h_ 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
** Copyright 2013-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: MIT
|
||||
**
|
||||
** 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
|
||||
** https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <GLES2/gl2platform.h>
|
||||
|
||||
#ifndef GL_APIENTRYP
|
||||
#define GL_APIENTRYP GL_APIENTRY*
|
||||
#endif
|
||||
|
||||
#ifndef GL_GLES_PROTOTYPES
|
||||
#define GL_GLES_PROTOTYPES 1
|
||||
#endif
|
||||
|
||||
/* Generated on date 20250203 */
|
||||
|
||||
/* Generated C header for:
|
||||
* API: gles2
|
||||
* Profile: common
|
||||
* Versions considered: 2\.[0-9]
|
||||
* Versions emitted: .*
|
||||
* Default extensions included: None
|
||||
* Additional extensions included: _nomatch_^
|
||||
* Extensions removed: _nomatch_^
|
||||
*/
|
||||
|
||||
#ifndef GL_ES_VERSION_2_0
|
||||
#define GL_ES_VERSION_2_0 1
|
||||
#include <KHR/khrplatform.h>
|
||||
typedef khronos_int8_t GLbyte;
|
||||
typedef khronos_float_t GLclampf;
|
||||
typedef khronos_int32_t GLfixed;
|
||||
typedef khronos_int16_t GLshort;
|
||||
typedef khronos_uint16_t GLushort;
|
||||
typedef void GLvoid;
|
||||
typedef struct __GLsync *GLsync;
|
||||
typedef khronos_int64_t GLint64;
|
||||
typedef khronos_uint64_t GLuint64;
|
||||
typedef unsigned int GLenum;
|
||||
typedef unsigned int GLuint;
|
||||
typedef char GLchar;
|
||||
typedef khronos_float_t GLfloat;
|
||||
typedef khronos_ssize_t GLsizeiptr;
|
||||
typedef khronos_intptr_t GLintptr;
|
||||
typedef unsigned int GLbitfield;
|
||||
typedef int GLint;
|
||||
typedef unsigned char GLboolean;
|
||||
typedef int GLsizei;
|
||||
typedef khronos_uint8_t GLubyte;
|
||||
#define GL_DEPTH_BUFFER_BIT 0x00000100
|
||||
#define GL_STENCIL_BUFFER_BIT 0x00000400
|
||||
#define GL_COLOR_BUFFER_BIT 0x00004000
|
||||
#define GL_FALSE 0
|
||||
#define GL_TRUE 1
|
||||
#define GL_POINTS 0x0000
|
||||
#define GL_LINES 0x0001
|
||||
#define GL_LINE_LOOP 0x0002
|
||||
#define GL_LINE_STRIP 0x0003
|
||||
#define GL_TRIANGLES 0x0004
|
||||
#define GL_TRIANGLE_STRIP 0x0005
|
||||
#define GL_TRIANGLE_FAN 0x0006
|
||||
#define GL_ZERO 0
|
||||
#define GL_ONE 1
|
||||
#define GL_SRC_COLOR 0x0300
|
||||
#define GL_ONE_MINUS_SRC_COLOR 0x0301
|
||||
#define GL_SRC_ALPHA 0x0302
|
||||
#define GL_ONE_MINUS_SRC_ALPHA 0x0303
|
||||
#define GL_DST_ALPHA 0x0304
|
||||
#define GL_ONE_MINUS_DST_ALPHA 0x0305
|
||||
#define GL_DST_COLOR 0x0306
|
||||
#define GL_ONE_MINUS_DST_COLOR 0x0307
|
||||
#define GL_SRC_ALPHA_SATURATE 0x0308
|
||||
#define GL_FUNC_ADD 0x8006
|
||||
#define GL_BLEND_EQUATION 0x8009
|
||||
#define GL_BLEND_EQUATION_RGB 0x8009
|
||||
#define GL_BLEND_EQUATION_ALPHA 0x883D
|
||||
#define GL_FUNC_SUBTRACT 0x800A
|
||||
#define GL_FUNC_REVERSE_SUBTRACT 0x800B
|
||||
#define GL_BLEND_DST_RGB 0x80C8
|
||||
#define GL_BLEND_SRC_RGB 0x80C9
|
||||
#define GL_BLEND_DST_ALPHA 0x80CA
|
||||
#define GL_BLEND_SRC_ALPHA 0x80CB
|
||||
#define GL_CONSTANT_COLOR 0x8001
|
||||
#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002
|
||||
#define GL_CONSTANT_ALPHA 0x8003
|
||||
#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004
|
||||
#define GL_BLEND_COLOR 0x8005
|
||||
#define GL_ARRAY_BUFFER 0x8892
|
||||
#define GL_ELEMENT_ARRAY_BUFFER 0x8893
|
||||
#define GL_ARRAY_BUFFER_BINDING 0x8894
|
||||
#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895
|
||||
#define GL_STREAM_DRAW 0x88E0
|
||||
#define GL_STATIC_DRAW 0x88E4
|
||||
#define GL_DYNAMIC_DRAW 0x88E8
|
||||
#define GL_BUFFER_SIZE 0x8764
|
||||
#define GL_BUFFER_USAGE 0x8765
|
||||
#define GL_CURRENT_VERTEX_ATTRIB 0x8626
|
||||
#define GL_FRONT 0x0404
|
||||
#define GL_BACK 0x0405
|
||||
#define GL_FRONT_AND_BACK 0x0408
|
||||
#define GL_TEXTURE_2D 0x0DE1
|
||||
#define GL_CULL_FACE 0x0B44
|
||||
#define GL_BLEND 0x0BE2
|
||||
#define GL_DITHER 0x0BD0
|
||||
#define GL_STENCIL_TEST 0x0B90
|
||||
#define GL_DEPTH_TEST 0x0B71
|
||||
#define GL_SCISSOR_TEST 0x0C11
|
||||
#define GL_POLYGON_OFFSET_FILL 0x8037
|
||||
#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E
|
||||
#define GL_SAMPLE_COVERAGE 0x80A0
|
||||
#define GL_NO_ERROR 0
|
||||
#define GL_INVALID_ENUM 0x0500
|
||||
#define GL_INVALID_VALUE 0x0501
|
||||
#define GL_INVALID_OPERATION 0x0502
|
||||
#define GL_OUT_OF_MEMORY 0x0505
|
||||
#define GL_CW 0x0900
|
||||
#define GL_CCW 0x0901
|
||||
#define GL_LINE_WIDTH 0x0B21
|
||||
#define GL_ALIASED_POINT_SIZE_RANGE 0x846D
|
||||
#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E
|
||||
#define GL_CULL_FACE_MODE 0x0B45
|
||||
#define GL_FRONT_FACE 0x0B46
|
||||
#define GL_DEPTH_RANGE 0x0B70
|
||||
#define GL_DEPTH_WRITEMASK 0x0B72
|
||||
#define GL_DEPTH_CLEAR_VALUE 0x0B73
|
||||
#define GL_DEPTH_FUNC 0x0B74
|
||||
#define GL_STENCIL_CLEAR_VALUE 0x0B91
|
||||
#define GL_STENCIL_FUNC 0x0B92
|
||||
#define GL_STENCIL_FAIL 0x0B94
|
||||
#define GL_STENCIL_PASS_DEPTH_FAIL 0x0B95
|
||||
#define GL_STENCIL_PASS_DEPTH_PASS 0x0B96
|
||||
#define GL_STENCIL_REF 0x0B97
|
||||
#define GL_STENCIL_VALUE_MASK 0x0B93
|
||||
#define GL_STENCIL_WRITEMASK 0x0B98
|
||||
#define GL_STENCIL_BACK_FUNC 0x8800
|
||||
#define GL_STENCIL_BACK_FAIL 0x8801
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802
|
||||
#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803
|
||||
#define GL_STENCIL_BACK_REF 0x8CA3
|
||||
#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4
|
||||
#define GL_STENCIL_BACK_WRITEMASK 0x8CA5
|
||||
#define GL_VIEWPORT 0x0BA2
|
||||
#define GL_SCISSOR_BOX 0x0C10
|
||||
#define GL_COLOR_CLEAR_VALUE 0x0C22
|
||||
#define GL_COLOR_WRITEMASK 0x0C23
|
||||
#define GL_UNPACK_ALIGNMENT 0x0CF5
|
||||
#define GL_PACK_ALIGNMENT 0x0D05
|
||||
#define GL_MAX_TEXTURE_SIZE 0x0D33
|
||||
#define GL_MAX_VIEWPORT_DIMS 0x0D3A
|
||||
#define GL_SUBPIXEL_BITS 0x0D50
|
||||
#define GL_RED_BITS 0x0D52
|
||||
#define GL_GREEN_BITS 0x0D53
|
||||
#define GL_BLUE_BITS 0x0D54
|
||||
#define GL_ALPHA_BITS 0x0D55
|
||||
#define GL_DEPTH_BITS 0x0D56
|
||||
#define GL_STENCIL_BITS 0x0D57
|
||||
#define GL_POLYGON_OFFSET_UNITS 0x2A00
|
||||
#define GL_POLYGON_OFFSET_FACTOR 0x8038
|
||||
#define GL_TEXTURE_BINDING_2D 0x8069
|
||||
#define GL_SAMPLE_BUFFERS 0x80A8
|
||||
#define GL_SAMPLES 0x80A9
|
||||
#define GL_SAMPLE_COVERAGE_VALUE 0x80AA
|
||||
#define GL_SAMPLE_COVERAGE_INVERT 0x80AB
|
||||
#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2
|
||||
#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3
|
||||
#define GL_DONT_CARE 0x1100
|
||||
#define GL_FASTEST 0x1101
|
||||
#define GL_NICEST 0x1102
|
||||
#define GL_GENERATE_MIPMAP_HINT 0x8192
|
||||
#define GL_BYTE 0x1400
|
||||
#define GL_UNSIGNED_BYTE 0x1401
|
||||
#define GL_SHORT 0x1402
|
||||
#define GL_UNSIGNED_SHORT 0x1403
|
||||
#define GL_INT 0x1404
|
||||
#define GL_UNSIGNED_INT 0x1405
|
||||
#define GL_FLOAT 0x1406
|
||||
#define GL_FIXED 0x140C
|
||||
#define GL_DEPTH_COMPONENT 0x1902
|
||||
#define GL_ALPHA 0x1906
|
||||
#define GL_RGB 0x1907
|
||||
#define GL_RGBA 0x1908
|
||||
#define GL_LUMINANCE 0x1909
|
||||
#define GL_LUMINANCE_ALPHA 0x190A
|
||||
#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033
|
||||
#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034
|
||||
#define GL_UNSIGNED_SHORT_5_6_5 0x8363
|
||||
#define GL_FRAGMENT_SHADER 0x8B30
|
||||
#define GL_VERTEX_SHADER 0x8B31
|
||||
#define GL_MAX_VERTEX_ATTRIBS 0x8869
|
||||
#define GL_MAX_VERTEX_UNIFORM_VECTORS 0x8DFB
|
||||
#define GL_MAX_VARYING_VECTORS 0x8DFC
|
||||
#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D
|
||||
#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C
|
||||
#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872
|
||||
#define GL_MAX_FRAGMENT_UNIFORM_VECTORS 0x8DFD
|
||||
#define GL_SHADER_TYPE 0x8B4F
|
||||
#define GL_DELETE_STATUS 0x8B80
|
||||
#define GL_LINK_STATUS 0x8B82
|
||||
#define GL_VALIDATE_STATUS 0x8B83
|
||||
#define GL_ATTACHED_SHADERS 0x8B85
|
||||
#define GL_ACTIVE_UNIFORMS 0x8B86
|
||||
#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87
|
||||
#define GL_ACTIVE_ATTRIBUTES 0x8B89
|
||||
#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A
|
||||
#define GL_SHADING_LANGUAGE_VERSION 0x8B8C
|
||||
#define GL_CURRENT_PROGRAM 0x8B8D
|
||||
#define GL_NEVER 0x0200
|
||||
#define GL_LESS 0x0201
|
||||
#define GL_EQUAL 0x0202
|
||||
#define GL_LEQUAL 0x0203
|
||||
#define GL_GREATER 0x0204
|
||||
#define GL_NOTEQUAL 0x0205
|
||||
#define GL_GEQUAL 0x0206
|
||||
#define GL_ALWAYS 0x0207
|
||||
#define GL_KEEP 0x1E00
|
||||
#define GL_REPLACE 0x1E01
|
||||
#define GL_INCR 0x1E02
|
||||
#define GL_DECR 0x1E03
|
||||
#define GL_INVERT 0x150A
|
||||
#define GL_INCR_WRAP 0x8507
|
||||
#define GL_DECR_WRAP 0x8508
|
||||
#define GL_VENDOR 0x1F00
|
||||
#define GL_RENDERER 0x1F01
|
||||
#define GL_VERSION 0x1F02
|
||||
#define GL_EXTENSIONS 0x1F03
|
||||
#define GL_NEAREST 0x2600
|
||||
#define GL_LINEAR 0x2601
|
||||
#define GL_NEAREST_MIPMAP_NEAREST 0x2700
|
||||
#define GL_LINEAR_MIPMAP_NEAREST 0x2701
|
||||
#define GL_NEAREST_MIPMAP_LINEAR 0x2702
|
||||
#define GL_LINEAR_MIPMAP_LINEAR 0x2703
|
||||
#define GL_TEXTURE_MAG_FILTER 0x2800
|
||||
#define GL_TEXTURE_MIN_FILTER 0x2801
|
||||
#define GL_TEXTURE_WRAP_S 0x2802
|
||||
#define GL_TEXTURE_WRAP_T 0x2803
|
||||
#define GL_TEXTURE 0x1702
|
||||
#define GL_TEXTURE_CUBE_MAP 0x8513
|
||||
#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518
|
||||
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519
|
||||
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A
|
||||
#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C
|
||||
#define GL_TEXTURE0 0x84C0
|
||||
#define GL_TEXTURE1 0x84C1
|
||||
#define GL_TEXTURE2 0x84C2
|
||||
#define GL_TEXTURE3 0x84C3
|
||||
#define GL_TEXTURE4 0x84C4
|
||||
#define GL_TEXTURE5 0x84C5
|
||||
#define GL_TEXTURE6 0x84C6
|
||||
#define GL_TEXTURE7 0x84C7
|
||||
#define GL_TEXTURE8 0x84C8
|
||||
#define GL_TEXTURE9 0x84C9
|
||||
#define GL_TEXTURE10 0x84CA
|
||||
#define GL_TEXTURE11 0x84CB
|
||||
#define GL_TEXTURE12 0x84CC
|
||||
#define GL_TEXTURE13 0x84CD
|
||||
#define GL_TEXTURE14 0x84CE
|
||||
#define GL_TEXTURE15 0x84CF
|
||||
#define GL_TEXTURE16 0x84D0
|
||||
#define GL_TEXTURE17 0x84D1
|
||||
#define GL_TEXTURE18 0x84D2
|
||||
#define GL_TEXTURE19 0x84D3
|
||||
#define GL_TEXTURE20 0x84D4
|
||||
#define GL_TEXTURE21 0x84D5
|
||||
#define GL_TEXTURE22 0x84D6
|
||||
#define GL_TEXTURE23 0x84D7
|
||||
#define GL_TEXTURE24 0x84D8
|
||||
#define GL_TEXTURE25 0x84D9
|
||||
#define GL_TEXTURE26 0x84DA
|
||||
#define GL_TEXTURE27 0x84DB
|
||||
#define GL_TEXTURE28 0x84DC
|
||||
#define GL_TEXTURE29 0x84DD
|
||||
#define GL_TEXTURE30 0x84DE
|
||||
#define GL_TEXTURE31 0x84DF
|
||||
#define GL_ACTIVE_TEXTURE 0x84E0
|
||||
#define GL_REPEAT 0x2901
|
||||
#define GL_CLAMP_TO_EDGE 0x812F
|
||||
#define GL_MIRRORED_REPEAT 0x8370
|
||||
#define GL_FLOAT_VEC2 0x8B50
|
||||
#define GL_FLOAT_VEC3 0x8B51
|
||||
#define GL_FLOAT_VEC4 0x8B52
|
||||
#define GL_INT_VEC2 0x8B53
|
||||
#define GL_INT_VEC3 0x8B54
|
||||
#define GL_INT_VEC4 0x8B55
|
||||
#define GL_BOOL 0x8B56
|
||||
#define GL_BOOL_VEC2 0x8B57
|
||||
#define GL_BOOL_VEC3 0x8B58
|
||||
#define GL_BOOL_VEC4 0x8B59
|
||||
#define GL_FLOAT_MAT2 0x8B5A
|
||||
#define GL_FLOAT_MAT3 0x8B5B
|
||||
#define GL_FLOAT_MAT4 0x8B5C
|
||||
#define GL_SAMPLER_2D 0x8B5E
|
||||
#define GL_SAMPLER_CUBE 0x8B60
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645
|
||||
#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_TYPE 0x8B9A
|
||||
#define GL_IMPLEMENTATION_COLOR_READ_FORMAT 0x8B9B
|
||||
#define GL_COMPILE_STATUS 0x8B81
|
||||
#define GL_INFO_LOG_LENGTH 0x8B84
|
||||
#define GL_SHADER_SOURCE_LENGTH 0x8B88
|
||||
#define GL_SHADER_COMPILER 0x8DFA
|
||||
#define GL_SHADER_BINARY_FORMATS 0x8DF8
|
||||
#define GL_NUM_SHADER_BINARY_FORMATS 0x8DF9
|
||||
#define GL_LOW_FLOAT 0x8DF0
|
||||
#define GL_MEDIUM_FLOAT 0x8DF1
|
||||
#define GL_HIGH_FLOAT 0x8DF2
|
||||
#define GL_LOW_INT 0x8DF3
|
||||
#define GL_MEDIUM_INT 0x8DF4
|
||||
#define GL_HIGH_INT 0x8DF5
|
||||
#define GL_FRAMEBUFFER 0x8D40
|
||||
#define GL_RENDERBUFFER 0x8D41
|
||||
#define GL_RGBA4 0x8056
|
||||
#define GL_RGB5_A1 0x8057
|
||||
#define GL_RGB565 0x8D62
|
||||
#define GL_DEPTH_COMPONENT16 0x81A5
|
||||
#define GL_STENCIL_INDEX8 0x8D48
|
||||
#define GL_RENDERBUFFER_WIDTH 0x8D42
|
||||
#define GL_RENDERBUFFER_HEIGHT 0x8D43
|
||||
#define GL_RENDERBUFFER_INTERNAL_FORMAT 0x8D44
|
||||
#define GL_RENDERBUFFER_RED_SIZE 0x8D50
|
||||
#define GL_RENDERBUFFER_GREEN_SIZE 0x8D51
|
||||
#define GL_RENDERBUFFER_BLUE_SIZE 0x8D52
|
||||
#define GL_RENDERBUFFER_ALPHA_SIZE 0x8D53
|
||||
#define GL_RENDERBUFFER_DEPTH_SIZE 0x8D54
|
||||
#define GL_RENDERBUFFER_STENCIL_SIZE 0x8D55
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE 0x8CD0
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME 0x8CD1
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL 0x8CD2
|
||||
#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE 0x8CD3
|
||||
#define GL_COLOR_ATTACHMENT0 0x8CE0
|
||||
#define GL_DEPTH_ATTACHMENT 0x8D00
|
||||
#define GL_STENCIL_ATTACHMENT 0x8D20
|
||||
#define GL_NONE 0
|
||||
#define GL_FRAMEBUFFER_COMPLETE 0x8CD5
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT 0x8CD6
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT 0x8CD7
|
||||
#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS 0x8CD9
|
||||
#define GL_FRAMEBUFFER_UNSUPPORTED 0x8CDD
|
||||
#define GL_FRAMEBUFFER_BINDING 0x8CA6
|
||||
#define GL_RENDERBUFFER_BINDING 0x8CA7
|
||||
#define GL_MAX_RENDERBUFFER_SIZE 0x84E8
|
||||
#define GL_INVALID_FRAMEBUFFER_OPERATION 0x0506
|
||||
typedef void (GL_APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture);
|
||||
typedef void (GL_APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDFRAMEBUFFERPROC) (GLenum target, GLuint framebuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDRENDERBUFFERPROC) (GLenum target, GLuint renderbuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLBINDTEXTUREPROC) (GLenum target, GLuint texture);
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode);
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha);
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDFUNCPROC) (GLenum sfactor, GLenum dfactor);
|
||||
typedef void (GL_APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
typedef void (GL_APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
typedef void (GL_APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARPROC) (GLbitfield mask);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARCOLORPROC) (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARDEPTHFPROC) (GLfloat d);
|
||||
typedef void (GL_APIENTRYP PFNGLCLEARSTENCILPROC) (GLint s);
|
||||
typedef void (GL_APIENTRYP PFNGLCOLORMASKPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
typedef void (GL_APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader);
|
||||
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||
typedef void (GL_APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
|
||||
typedef void (GL_APIENTRYP PFNGLCOPYTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
typedef void (GL_APIENTRYP PFNGLCOPYTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef GLuint (GL_APIENTRYP PFNGLCREATEPROGRAMPROC) (void);
|
||||
typedef GLuint (GL_APIENTRYP PFNGLCREATESHADERPROC) (GLenum type);
|
||||
typedef void (GL_APIENTRYP PFNGLCULLFACEPROC) (GLenum mode);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEFRAMEBUFFERSPROC) (GLsizei n, const GLuint *framebuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETERENDERBUFFERSPROC) (GLsizei n, const GLuint *renderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader);
|
||||
typedef void (GL_APIENTRYP PFNGLDELETETEXTURESPROC) (GLsizei n, const GLuint *textures);
|
||||
typedef void (GL_APIENTRYP PFNGLDEPTHFUNCPROC) (GLenum func);
|
||||
typedef void (GL_APIENTRYP PFNGLDEPTHMASKPROC) (GLboolean flag);
|
||||
typedef void (GL_APIENTRYP PFNGLDEPTHRANGEFPROC) (GLfloat n, GLfloat f);
|
||||
typedef void (GL_APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader);
|
||||
typedef void (GL_APIENTRYP PFNGLDISABLEPROC) (GLenum cap);
|
||||
typedef void (GL_APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWARRAYSPROC) (GLenum mode, GLint first, GLsizei count);
|
||||
typedef void (GL_APIENTRYP PFNGLDRAWELEMENTSPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
typedef void (GL_APIENTRYP PFNGLENABLEPROC) (GLenum cap);
|
||||
typedef void (GL_APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index);
|
||||
typedef void (GL_APIENTRYP PFNGLFINISHPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLFLUSHPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFERPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
typedef void (GL_APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
typedef void (GL_APIENTRYP PFNGLFRONTFACEPROC) (GLenum mode);
|
||||
typedef void (GL_APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers);
|
||||
typedef void (GL_APIENTRYP PFNGLGENERATEMIPMAPPROC) (GLenum target);
|
||||
typedef void (GL_APIENTRYP PFNGLGENFRAMEBUFFERSPROC) (GLsizei n, GLuint *framebuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLGENRENDERBUFFERSPROC) (GLsizei n, GLuint *renderbuffers);
|
||||
typedef void (GL_APIENTRYP PFNGLGENTEXTURESPROC) (GLsizei n, GLuint *textures);
|
||||
typedef void (GL_APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
typedef void (GL_APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
typedef void (GL_APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
|
||||
typedef GLint (GL_APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (GL_APIENTRYP PFNGLGETBOOLEANVPROC) (GLenum pname, GLboolean *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef GLenum (GL_APIENTRYP PFNGLGETERRORPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFLOATVPROC) (GLenum pname, GLfloat *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETINTEGERVPROC) (GLenum pname, GLint *data);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef void (GL_APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADERPRECISIONFORMATPROC) (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||
typedef void (GL_APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||
typedef const GLubyte *(GL_APIENTRYP PFNGLGETSTRINGPROC) (GLenum name);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETTEXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params);
|
||||
typedef GLint (GL_APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name);
|
||||
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, void **pointer);
|
||||
typedef void (GL_APIENTRYP PFNGLHINTPROC) (GLenum target, GLenum mode);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISENABLEDPROC) (GLenum cap);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISFRAMEBUFFERPROC) (GLuint framebuffer);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISPROGRAMPROC) (GLuint program);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISRENDERBUFFERPROC) (GLuint renderbuffer);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISSHADERPROC) (GLuint shader);
|
||||
typedef GLboolean (GL_APIENTRYP PFNGLISTEXTUREPROC) (GLuint texture);
|
||||
typedef void (GL_APIENTRYP PFNGLLINEWIDTHPROC) (GLfloat width);
|
||||
typedef void (GL_APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLPIXELSTOREIPROC) (GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLPOLYGONOFFSETPROC) (GLfloat factor, GLfloat units);
|
||||
typedef void (GL_APIENTRYP PFNGLREADPIXELSPROC) (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
typedef void (GL_APIENTRYP PFNGLRELEASESHADERCOMPILERPROC) (void);
|
||||
typedef void (GL_APIENTRYP PFNGLRENDERBUFFERSTORAGEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLfloat value, GLboolean invert);
|
||||
typedef void (GL_APIENTRYP PFNGLSCISSORPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERBINARYPROC) (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
typedef void (GL_APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCPROC) (GLenum func, GLint ref, GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILMASKPROC) (GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILOPPROC) (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
typedef void (GL_APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXIMAGE2DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIPROC) (GLenum target, GLenum pname, GLint param);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params);
|
||||
typedef void (GL_APIENTRYP PFNGLTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
typedef void (GL_APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v);
|
||||
typedef void (GL_APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||
typedef void (GL_APIENTRYP PFNGLVIEWPORTPROC) (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#if GL_GLES_PROTOTYPES
|
||||
GL_APICALL void GL_APIENTRY glActiveTexture (GLenum texture);
|
||||
GL_APICALL void GL_APIENTRY glAttachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glBindAttribLocation (GLuint program, GLuint index, const GLchar *name);
|
||||
GL_APICALL void GL_APIENTRY glBindBuffer (GLenum target, GLuint buffer);
|
||||
GL_APICALL void GL_APIENTRY glBindFramebuffer (GLenum target, GLuint framebuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindRenderbuffer (GLenum target, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glBindTexture (GLenum target, GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glBlendColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendEquation (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glBlendEquationSeparate (GLenum modeRGB, GLenum modeAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBlendFunc (GLenum sfactor, GLenum dfactor);
|
||||
GL_APICALL void GL_APIENTRY glBlendFuncSeparate (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha);
|
||||
GL_APICALL void GL_APIENTRY glBufferData (GLenum target, GLsizeiptr size, const void *data, GLenum usage);
|
||||
GL_APICALL void GL_APIENTRY glBufferSubData (GLenum target, GLintptr offset, GLsizeiptr size, const void *data);
|
||||
GL_APICALL GLenum GL_APIENTRY glCheckFramebufferStatus (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glClear (GLbitfield mask);
|
||||
GL_APICALL void GL_APIENTRY glClearColor (GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha);
|
||||
GL_APICALL void GL_APIENTRY glClearDepthf (GLfloat d);
|
||||
GL_APICALL void GL_APIENTRY glClearStencil (GLint s);
|
||||
GL_APICALL void GL_APIENTRY glColorMask (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha);
|
||||
GL_APICALL void GL_APIENTRY glCompileShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexImage2D (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const void *data);
|
||||
GL_APICALL void GL_APIENTRY glCompressedTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const void *data);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexImage2D (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border);
|
||||
GL_APICALL void GL_APIENTRY glCopyTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateProgram (void);
|
||||
GL_APICALL GLuint GL_APIENTRY glCreateShader (GLenum type);
|
||||
GL_APICALL void GL_APIENTRY glCullFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glDeleteBuffers (GLsizei n, const GLuint *buffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteFramebuffers (GLsizei n, const GLuint *framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glDeleteRenderbuffers (GLsizei n, const GLuint *renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glDeleteShader (GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDeleteTextures (GLsizei n, const GLuint *textures);
|
||||
GL_APICALL void GL_APIENTRY glDepthFunc (GLenum func);
|
||||
GL_APICALL void GL_APIENTRY glDepthMask (GLboolean flag);
|
||||
GL_APICALL void GL_APIENTRY glDepthRangef (GLfloat n, GLfloat f);
|
||||
GL_APICALL void GL_APIENTRY glDetachShader (GLuint program, GLuint shader);
|
||||
GL_APICALL void GL_APIENTRY glDisable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glDisableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glDrawArrays (GLenum mode, GLint first, GLsizei count);
|
||||
GL_APICALL void GL_APIENTRY glDrawElements (GLenum mode, GLsizei count, GLenum type, const void *indices);
|
||||
GL_APICALL void GL_APIENTRY glEnable (GLenum cap);
|
||||
GL_APICALL void GL_APIENTRY glEnableVertexAttribArray (GLuint index);
|
||||
GL_APICALL void GL_APIENTRY glFinish (void);
|
||||
GL_APICALL void GL_APIENTRY glFlush (void);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferRenderbuffer (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer);
|
||||
GL_APICALL void GL_APIENTRY glFramebufferTexture2D (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level);
|
||||
GL_APICALL void GL_APIENTRY glFrontFace (GLenum mode);
|
||||
GL_APICALL void GL_APIENTRY glGenBuffers (GLsizei n, GLuint *buffers);
|
||||
GL_APICALL void GL_APIENTRY glGenerateMipmap (GLenum target);
|
||||
GL_APICALL void GL_APIENTRY glGenFramebuffers (GLsizei n, GLuint *framebuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenRenderbuffers (GLsizei n, GLuint *renderbuffers);
|
||||
GL_APICALL void GL_APIENTRY glGenTextures (GLsizei n, GLuint *textures);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveAttrib (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
GL_APICALL void GL_APIENTRY glGetActiveUniform (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name);
|
||||
GL_APICALL void GL_APIENTRY glGetAttachedShaders (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *shaders);
|
||||
GL_APICALL GLint GL_APIENTRY glGetAttribLocation (GLuint program, const GLchar *name);
|
||||
GL_APICALL void GL_APIENTRY glGetBooleanv (GLenum pname, GLboolean *data);
|
||||
GL_APICALL void GL_APIENTRY glGetBufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_APICALL GLenum GL_APIENTRY glGetError (void);
|
||||
GL_APICALL void GL_APIENTRY glGetFloatv (GLenum pname, GLfloat *data);
|
||||
GL_APICALL void GL_APIENTRY glGetFramebufferAttachmentParameteriv (GLenum target, GLenum attachment, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetIntegerv (GLenum pname, GLint *data);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramiv (GLuint program, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetProgramInfoLog (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
GL_APICALL void GL_APIENTRY glGetRenderbufferParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderiv (GLuint shader, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderInfoLog (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderPrecisionFormat (GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision);
|
||||
GL_APICALL void GL_APIENTRY glGetShaderSource (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source);
|
||||
GL_APICALL const GLubyte *GL_APIENTRY glGetString (GLenum name);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameterfv (GLenum target, GLenum pname, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetTexParameteriv (GLenum target, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformfv (GLuint program, GLint location, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetUniformiv (GLuint program, GLint location, GLint *params);
|
||||
GL_APICALL GLint GL_APIENTRY glGetUniformLocation (GLuint program, const GLchar *name);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribfv (GLuint index, GLenum pname, GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribiv (GLuint index, GLenum pname, GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glGetVertexAttribPointerv (GLuint index, GLenum pname, void **pointer);
|
||||
GL_APICALL void GL_APIENTRY glHint (GLenum target, GLenum mode);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsBuffer (GLuint buffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsEnabled (GLenum cap);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsFramebuffer (GLuint framebuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsProgram (GLuint program);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsRenderbuffer (GLuint renderbuffer);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsShader (GLuint shader);
|
||||
GL_APICALL GLboolean GL_APIENTRY glIsTexture (GLuint texture);
|
||||
GL_APICALL void GL_APIENTRY glLineWidth (GLfloat width);
|
||||
GL_APICALL void GL_APIENTRY glLinkProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glPixelStorei (GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glPolygonOffset (GLfloat factor, GLfloat units);
|
||||
GL_APICALL void GL_APIENTRY glReadPixels (GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, void *pixels);
|
||||
GL_APICALL void GL_APIENTRY glReleaseShaderCompiler (void);
|
||||
GL_APICALL void GL_APIENTRY glRenderbufferStorage (GLenum target, GLenum internalformat, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glSampleCoverage (GLfloat value, GLboolean invert);
|
||||
GL_APICALL void GL_APIENTRY glScissor (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
GL_APICALL void GL_APIENTRY glShaderBinary (GLsizei count, const GLuint *shaders, GLenum binaryFormat, const void *binary, GLsizei length);
|
||||
GL_APICALL void GL_APIENTRY glShaderSource (GLuint shader, GLsizei count, const GLchar *const*string, const GLint *length);
|
||||
GL_APICALL void GL_APIENTRY glStencilFunc (GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilFuncSeparate (GLenum face, GLenum func, GLint ref, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMask (GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilMaskSeparate (GLenum face, GLuint mask);
|
||||
GL_APICALL void GL_APIENTRY glStencilOp (GLenum fail, GLenum zfail, GLenum zpass);
|
||||
GL_APICALL void GL_APIENTRY glStencilOpSeparate (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass);
|
||||
GL_APICALL void GL_APIENTRY glTexImage2D (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const void *pixels);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterf (GLenum target, GLenum pname, GLfloat param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameterfv (GLenum target, GLenum pname, const GLfloat *params);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteri (GLenum target, GLenum pname, GLint param);
|
||||
GL_APICALL void GL_APIENTRY glTexParameteriv (GLenum target, GLenum pname, const GLint *params);
|
||||
GL_APICALL void GL_APIENTRY glTexSubImage2D (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const void *pixels);
|
||||
GL_APICALL void GL_APIENTRY glUniform1f (GLint location, GLfloat v0);
|
||||
GL_APICALL void GL_APIENTRY glUniform1fv (GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform1i (GLint location, GLint v0);
|
||||
GL_APICALL void GL_APIENTRY glUniform1iv (GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform2f (GLint location, GLfloat v0, GLfloat v1);
|
||||
GL_APICALL void GL_APIENTRY glUniform2fv (GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform2i (GLint location, GLint v0, GLint v1);
|
||||
GL_APICALL void GL_APIENTRY glUniform2iv (GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform3f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
|
||||
GL_APICALL void GL_APIENTRY glUniform3fv (GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform3i (GLint location, GLint v0, GLint v1, GLint v2);
|
||||
GL_APICALL void GL_APIENTRY glUniform3iv (GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform4f (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
|
||||
GL_APICALL void GL_APIENTRY glUniform4fv (GLint location, GLsizei count, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniform4i (GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
|
||||
GL_APICALL void GL_APIENTRY glUniform4iv (GLint location, GLsizei count, const GLint *value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix2fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix3fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUniformMatrix4fv (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value);
|
||||
GL_APICALL void GL_APIENTRY glUseProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glValidateProgram (GLuint program);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1f (GLuint index, GLfloat x);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib1fv (GLuint index, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2f (GLuint index, GLfloat x, GLfloat y);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib2fv (GLuint index, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3f (GLuint index, GLfloat x, GLfloat y, GLfloat z);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib3fv (GLuint index, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4f (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttrib4fv (GLuint index, const GLfloat *v);
|
||||
GL_APICALL void GL_APIENTRY glVertexAttribPointer (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void *pointer);
|
||||
GL_APICALL void GL_APIENTRY glViewport (GLint x, GLint y, GLsizei width, GLsizei height);
|
||||
#endif
|
||||
#endif /* GL_ES_VERSION_2_0 */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,27 @@
|
||||
#ifndef __gl2platform_h_
|
||||
#define __gl2platform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 2.X gl2.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* Please contribute modifications back to Khronos as pull requests on the
|
||||
* public github repository:
|
||||
* https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __gl2platform_h_ */
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,24 @@
|
||||
#ifndef __gl3ext_h_
|
||||
#define __gl3ext_h_
|
||||
|
||||
/* $Revision: 17809 $ on $Date:: 2012-05-14 08:03:36 -0700 #$ */
|
||||
|
||||
/*
|
||||
* This document is licensed under the SGI Free Software B License Version
|
||||
* 2.0. For details, see http://oss.sgi.com/projects/FreeB/ .
|
||||
*/
|
||||
|
||||
/* OpenGL ES 3 Extensions
|
||||
*
|
||||
* After an OES extension's interactions with OpenGl ES 3.0 have been documented,
|
||||
* its tokens and function definitions should be added to this file in a manner
|
||||
* that does not conflict with gl2ext.h or gl3.h.
|
||||
*
|
||||
* Tokens and function definitions for extensions that have become standard
|
||||
* features in OpenGL ES 3.0 will not be added to this file.
|
||||
*
|
||||
* Applications using OpenGL-ES-2-only extensions should include gl2ext.h
|
||||
*/
|
||||
|
||||
#endif /* __gl3ext_h_ */
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
#ifndef __gl3platform_h_
|
||||
#define __gl3platform_h_
|
||||
|
||||
/*
|
||||
** Copyright 2017-2020 The Khronos Group Inc.
|
||||
** SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/* Platform-specific types and definitions for OpenGL ES 3.X gl3.h
|
||||
*
|
||||
* Adopters may modify khrplatform.h and this file to suit their platform.
|
||||
* Please contribute modifications back to Khronos as pull requests on the
|
||||
* public github repository:
|
||||
* https://github.com/KhronosGroup/OpenGL-Registry
|
||||
*/
|
||||
|
||||
#include <KHR/khrplatform.h>
|
||||
|
||||
#ifndef GL_APICALL
|
||||
#define GL_APICALL KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
#ifndef GL_APIENTRY
|
||||
#define GL_APIENTRY KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
#endif /* __gl3platform_h_ */
|
||||
@@ -0,0 +1,311 @@
|
||||
#ifndef __khrplatform_h_
|
||||
#define __khrplatform_h_
|
||||
|
||||
/*
|
||||
** Copyright (c) 2008-2018 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
|
||||
** "Materials"), to deal in the Materials without restriction, including
|
||||
** without limitation the rights to use, copy, modify, merge, publish,
|
||||
** distribute, sublicense, and/or sell copies of the Materials, and to
|
||||
** permit persons to whom the Materials are 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 Materials.
|
||||
**
|
||||
** THE MATERIALS ARE 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
|
||||
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
|
||||
*/
|
||||
|
||||
/* Khronos platform-specific types and definitions.
|
||||
*
|
||||
* The master copy of khrplatform.h is maintained in the Khronos EGL
|
||||
* Registry repository at https://github.com/KhronosGroup/EGL-Registry
|
||||
* The last semantic modification to khrplatform.h was at commit ID:
|
||||
* 67a3e0864c2d75ea5287b9f3d2eb74a745936692
|
||||
*
|
||||
* Adopters may modify this file to suit their platform. Adopters are
|
||||
* encouraged to submit platform specific modifications to the Khronos
|
||||
* group so that they can be included in future versions of this file.
|
||||
* Please submit changes by filing pull requests or issues on
|
||||
* the EGL Registry repository linked above.
|
||||
*
|
||||
*
|
||||
* See the Implementer's Guidelines for information about where this file
|
||||
* should be located on your system and for more details of its use:
|
||||
* http://www.khronos.org/registry/implementers_guide.pdf
|
||||
*
|
||||
* This file should be included as
|
||||
* #include <KHR/khrplatform.h>
|
||||
* by Khronos client API header files that use its types and defines.
|
||||
*
|
||||
* The types in khrplatform.h should only be used to define API-specific types.
|
||||
*
|
||||
* Types defined in khrplatform.h:
|
||||
* khronos_int8_t signed 8 bit
|
||||
* khronos_uint8_t unsigned 8 bit
|
||||
* khronos_int16_t signed 16 bit
|
||||
* khronos_uint16_t unsigned 16 bit
|
||||
* khronos_int32_t signed 32 bit
|
||||
* khronos_uint32_t unsigned 32 bit
|
||||
* khronos_int64_t signed 64 bit
|
||||
* khronos_uint64_t unsigned 64 bit
|
||||
* khronos_intptr_t signed same number of bits as a pointer
|
||||
* khronos_uintptr_t unsigned same number of bits as a pointer
|
||||
* khronos_ssize_t signed size
|
||||
* khronos_usize_t unsigned size
|
||||
* khronos_float_t signed 32 bit floating point
|
||||
* khronos_time_ns_t unsigned 64 bit time in nanoseconds
|
||||
* khronos_utime_nanoseconds_t unsigned time interval or absolute time in
|
||||
* nanoseconds
|
||||
* khronos_stime_nanoseconds_t signed time interval in nanoseconds
|
||||
* khronos_boolean_enum_t enumerated boolean type. This should
|
||||
* only be used as a base type when a client API's boolean type is
|
||||
* an enum. Client APIs which use an integer or other type for
|
||||
* booleans cannot use this as the base type for their boolean.
|
||||
*
|
||||
* Tokens defined in khrplatform.h:
|
||||
*
|
||||
* KHRONOS_FALSE, KHRONOS_TRUE Enumerated boolean false/true values.
|
||||
*
|
||||
* KHRONOS_SUPPORT_INT64 is 1 if 64 bit integers are supported; otherwise 0.
|
||||
* KHRONOS_SUPPORT_FLOAT is 1 if floats are supported; otherwise 0.
|
||||
*
|
||||
* Calling convention macros defined in this file:
|
||||
* KHRONOS_APICALL
|
||||
* KHRONOS_APIENTRY
|
||||
* KHRONOS_APIATTRIBUTES
|
||||
*
|
||||
* These may be used in function prototypes as:
|
||||
*
|
||||
* KHRONOS_APICALL void KHRONOS_APIENTRY funcname(
|
||||
* int arg1,
|
||||
* int arg2) KHRONOS_APIATTRIBUTES;
|
||||
*/
|
||||
|
||||
#if defined(__SCITECH_SNAP__) && !defined(KHRONOS_STATIC)
|
||||
# define KHRONOS_STATIC 1
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APICALL
|
||||
*-------------------------------------------------------------------------
|
||||
* This precedes the return type of the function in the function prototype.
|
||||
*/
|
||||
#if defined(KHRONOS_STATIC)
|
||||
/* If the preprocessor constant KHRONOS_STATIC is defined, make the
|
||||
* header compatible with static linking. */
|
||||
# define KHRONOS_APICALL
|
||||
#elif defined(_WIN32)
|
||||
# define KHRONOS_APICALL __declspec(dllimport)
|
||||
#elif defined (__SYMBIAN32__)
|
||||
# define KHRONOS_APICALL IMPORT_C
|
||||
#elif defined(__ANDROID__)
|
||||
# define KHRONOS_APICALL __attribute__((visibility("default")))
|
||||
#else
|
||||
# define KHRONOS_APICALL
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIENTRY
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the return type of the function and precedes the function
|
||||
* name in the function prototype.
|
||||
*/
|
||||
#if defined(_WIN32) && !defined(_WIN32_WCE) && !defined(__SCITECH_SNAP__)
|
||||
/* Win32 but not WinCE */
|
||||
# define KHRONOS_APIENTRY __stdcall
|
||||
#else
|
||||
# define KHRONOS_APIENTRY
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* Definition of KHRONOS_APIATTRIBUTES
|
||||
*-------------------------------------------------------------------------
|
||||
* This follows the closing parenthesis of the function prototype arguments.
|
||||
*/
|
||||
#if defined (__ARMCC_2__)
|
||||
#define KHRONOS_APIATTRIBUTES __softfp
|
||||
#else
|
||||
#define KHRONOS_APIATTRIBUTES
|
||||
#endif
|
||||
|
||||
/*-------------------------------------------------------------------------
|
||||
* basic type definitions
|
||||
*-----------------------------------------------------------------------*/
|
||||
#if (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L) || defined(__GNUC__) || defined(__SCO__) || defined(__USLC__)
|
||||
|
||||
|
||||
/*
|
||||
* Using <stdint.h>
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
/*
|
||||
* To support platform where unsigned long cannot be used interchangeably with
|
||||
* inptr_t (e.g. CHERI-extended ISAs), we can use the stdint.h intptr_t.
|
||||
* Ideally, we could just use (u)intptr_t everywhere, but this could result in
|
||||
* ABI breakage if khronos_uintptr_t is changed from unsigned long to
|
||||
* unsigned long long or similar (this results in different C++ name mangling).
|
||||
* To avoid changes for existing platforms, we restrict usage of intptr_t to
|
||||
* platforms where the size of a pointer is larger than the size of long.
|
||||
*/
|
||||
#if defined(__SIZEOF_LONG__) && defined(__SIZEOF_POINTER__)
|
||||
#if __SIZEOF_POINTER__ > __SIZEOF_LONG__
|
||||
#define KHRONOS_USE_INTPTR_T
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#elif defined(__VMS ) || defined(__sgi)
|
||||
|
||||
/*
|
||||
* Using <inttypes.h>
|
||||
*/
|
||||
#include <inttypes.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(_WIN32) && !defined(__SCITECH_SNAP__)
|
||||
|
||||
/*
|
||||
* Win32
|
||||
*/
|
||||
typedef __int32 khronos_int32_t;
|
||||
typedef unsigned __int32 khronos_uint32_t;
|
||||
typedef __int64 khronos_int64_t;
|
||||
typedef unsigned __int64 khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif defined(__sun__) || defined(__digital__)
|
||||
|
||||
/*
|
||||
* Sun or Digital
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#if defined(__arch64__) || defined(_LP64)
|
||||
typedef long int khronos_int64_t;
|
||||
typedef unsigned long int khronos_uint64_t;
|
||||
#else
|
||||
typedef long long int khronos_int64_t;
|
||||
typedef unsigned long long int khronos_uint64_t;
|
||||
#endif /* __arch64__ */
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#elif 0
|
||||
|
||||
/*
|
||||
* Hypothetical platform with no float or int64 support
|
||||
*/
|
||||
typedef int khronos_int32_t;
|
||||
typedef unsigned int khronos_uint32_t;
|
||||
#define KHRONOS_SUPPORT_INT64 0
|
||||
#define KHRONOS_SUPPORT_FLOAT 0
|
||||
|
||||
#else
|
||||
|
||||
/*
|
||||
* Generic fallback
|
||||
*/
|
||||
#include <stdint.h>
|
||||
typedef int32_t khronos_int32_t;
|
||||
typedef uint32_t khronos_uint32_t;
|
||||
typedef int64_t khronos_int64_t;
|
||||
typedef uint64_t khronos_uint64_t;
|
||||
#define KHRONOS_SUPPORT_INT64 1
|
||||
#define KHRONOS_SUPPORT_FLOAT 1
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Types that are (so far) the same on all platforms
|
||||
*/
|
||||
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 KHRONOS_USE_INTPTR_T
|
||||
typedef intptr_t khronos_intptr_t;
|
||||
typedef uintptr_t khronos_uintptr_t;
|
||||
#elif defined(_WIN64)
|
||||
typedef signed long long int khronos_intptr_t;
|
||||
typedef unsigned long long int khronos_uintptr_t;
|
||||
#else
|
||||
typedef signed long int khronos_intptr_t;
|
||||
typedef unsigned long int khronos_uintptr_t;
|
||||
#endif
|
||||
|
||||
#if defined(_WIN64)
|
||||
typedef signed long long int khronos_ssize_t;
|
||||
typedef unsigned long long int khronos_usize_t;
|
||||
#else
|
||||
typedef signed long int khronos_ssize_t;
|
||||
typedef unsigned long int khronos_usize_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_FLOAT
|
||||
/*
|
||||
* Float type
|
||||
*/
|
||||
typedef float khronos_float_t;
|
||||
#endif
|
||||
|
||||
#if KHRONOS_SUPPORT_INT64
|
||||
/* Time types
|
||||
*
|
||||
* These types can be used to represent a time interval in nanoseconds or
|
||||
* an absolute Unadjusted System Time. Unadjusted System Time is the number
|
||||
* of nanoseconds since some arbitrary system event (e.g. since the last
|
||||
* time the system booted). The Unadjusted System Time is an unsigned
|
||||
* 64 bit value that wraps back to 0 every 584 years. Time intervals
|
||||
* may be either signed or unsigned.
|
||||
*/
|
||||
typedef khronos_uint64_t khronos_utime_nanoseconds_t;
|
||||
typedef khronos_int64_t khronos_stime_nanoseconds_t;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Dummy value used to pad enum types to 32 bits.
|
||||
*/
|
||||
#ifndef KHRONOS_MAX_ENUM
|
||||
#define KHRONOS_MAX_ENUM 0x7FFFFFFF
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Enumerated boolean type
|
||||
*
|
||||
* Values other than zero should be considered to be true. Therefore
|
||||
* comparisons should not be made against KHRONOS_TRUE.
|
||||
*/
|
||||
typedef enum {
|
||||
KHRONOS_FALSE = 0,
|
||||
KHRONOS_TRUE = 1,
|
||||
KHRONOS_BOOLEAN_ENUM_FORCE_SIZE = KHRONOS_MAX_ENUM
|
||||
} khronos_boolean_enum_t;
|
||||
|
||||
#endif /* __khrplatform_h_ */
|
||||
@@ -0,0 +1,158 @@
|
||||
/*
|
||||
* Copyright 2018 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file data_space.h
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_DATA_SPACE_H
|
||||
#define ANDROID_DATA_SPACE_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* ADataSpace.
|
||||
*/
|
||||
enum ADataSpace {
|
||||
/**
|
||||
* Default-assumption data space, when not explicitly specified.
|
||||
*
|
||||
* It is safest to assume the buffer is an image with sRGB primaries and
|
||||
* encoding ranges, but the consumer and/or the producer of the data may
|
||||
* simply be using defaults. No automatic gamma transform should be
|
||||
* expected, except for a possible display gamma transform when drawn to a
|
||||
* screen.
|
||||
*/
|
||||
ADATASPACE_UNKNOWN = 0,
|
||||
|
||||
/**
|
||||
* scRGB linear encoding:
|
||||
*
|
||||
* The red, green, and blue components are stored in extended sRGB space,
|
||||
* but are linear, not gamma-encoded.
|
||||
* The RGB primaries and the white point are the same as BT.709.
|
||||
*
|
||||
* The values are floating point.
|
||||
* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
|
||||
* Values beyond the range [0.0 - 1.0] would correspond to other colors
|
||||
* spaces and/or HDR content.
|
||||
*/
|
||||
ADATASPACE_SCRGB_LINEAR = 406913024, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED
|
||||
|
||||
/**
|
||||
* sRGB gamma encoding:
|
||||
*
|
||||
* The red, green and blue components are stored in sRGB space, and
|
||||
* converted to linear space when read, using the SRGB transfer function
|
||||
* for each of the R, G and B components. When written, the inverse
|
||||
* transformation is performed.
|
||||
*
|
||||
* The alpha component, if present, is always stored in linear space and
|
||||
* is left unmodified when read or written.
|
||||
*
|
||||
* Use full range and BT.709 standard.
|
||||
*/
|
||||
ADATASPACE_SRGB = 142671872, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_FULL
|
||||
|
||||
/**
|
||||
* scRGB:
|
||||
*
|
||||
* The red, green, and blue components are stored in extended sRGB space,
|
||||
* and gamma-encoded using the SRGB transfer function.
|
||||
* The RGB primaries and the white point are the same as BT.709.
|
||||
*
|
||||
* The values are floating point.
|
||||
* A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
|
||||
* Values beyond the range [0.0 - 1.0] would correspond to other colors
|
||||
* spaces and/or HDR content.
|
||||
*/
|
||||
ADATASPACE_SCRGB = 411107328, // STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED
|
||||
|
||||
/**
|
||||
* Display P3
|
||||
*
|
||||
* Use same primaries and white-point as DCI-P3
|
||||
* but sRGB transfer function.
|
||||
*/
|
||||
ADATASPACE_DISPLAY_P3 = 143261696, // STANDARD_DCI_P3 | TRANSFER_SRGB | RANGE_FULL
|
||||
|
||||
/**
|
||||
* ITU-R Recommendation 2020 (BT.2020)
|
||||
*
|
||||
* Ultra High-definition television
|
||||
*
|
||||
* Use full range, SMPTE 2084 (PQ) transfer and BT2020 standard
|
||||
*/
|
||||
ADATASPACE_BT2020_PQ = 163971072, // STANDARD_BT2020 | TRANSFER_ST2084 | RANGE_FULL
|
||||
|
||||
/**
|
||||
* Adobe RGB
|
||||
*
|
||||
* Use full range, gamma 2.2 transfer and Adobe RGB primaries
|
||||
* Note: Application is responsible for gamma encoding the data as
|
||||
* a 2.2 gamma encoding is not supported in HW.
|
||||
*/
|
||||
ADATASPACE_ADOBE_RGB = 151715840, // STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL
|
||||
|
||||
/**
|
||||
* ITU-R Recommendation 2020 (BT.2020)
|
||||
*
|
||||
* Ultra High-definition television
|
||||
*
|
||||
* Use full range, BT.709 transfer and BT2020 standard
|
||||
*/
|
||||
ADATASPACE_BT2020 = 147193856, // STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_FULL
|
||||
|
||||
/**
|
||||
* ITU-R Recommendation 709 (BT.709)
|
||||
*
|
||||
* High-definition television
|
||||
*
|
||||
* Use limited range, BT.709 transfer and BT.709 standard.
|
||||
*/
|
||||
ADATASPACE_BT709 = 281083904, // STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_LIMITED
|
||||
|
||||
/**
|
||||
* SMPTE EG 432-1 and SMPTE RP 431-2.
|
||||
*
|
||||
* Digital Cinema DCI-P3
|
||||
*
|
||||
* Use full range, gamma 2.6 transfer and D65 DCI-P3 standard
|
||||
* Note: Application is responsible for gamma encoding the data as
|
||||
* a 2.6 gamma encoding is not supported in HW.
|
||||
*/
|
||||
ADATASPACE_DCI_P3 = 155844608, // STANDARD_DCI_P3 | TRANSFER_GAMMA2_6 | RANGE_FULL
|
||||
|
||||
/**
|
||||
* sRGB linear encoding:
|
||||
*
|
||||
* The red, green, and blue components are stored in sRGB space, but
|
||||
* are linear, not gamma-encoded.
|
||||
* The RGB primaries and the white point are the same as BT.709.
|
||||
*
|
||||
* The values are encoded using the full range ([0,255] for 8-bit) for all
|
||||
* components.
|
||||
*/
|
||||
ADATASPACE_SRGB_LINEAR = 138477568, // STANDARD_BT709 | TRANSFER_LINEAR | RANGE_FULL
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_DATA_SPACE_H
|
||||
@@ -0,0 +1,557 @@
|
||||
/*
|
||||
* Copyright 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file hardware_buffer.h
|
||||
* @brief API for native hardware buffers.
|
||||
*/
|
||||
/**
|
||||
* @defgroup AHardwareBuffer Native Hardware Buffer
|
||||
*
|
||||
* AHardwareBuffer objects represent chunks of memory that can be
|
||||
* accessed by various hardware components in the system. It can be
|
||||
* easily converted to the Java counterpart
|
||||
* android.hardware.HardwareBuffer and passed between processes using
|
||||
* Binder. All operations involving AHardwareBuffer and HardwareBuffer
|
||||
* are zero-copy, i.e., passing AHardwareBuffer to another process
|
||||
* creates a shared view of the same region of memory.
|
||||
*
|
||||
* AHardwareBuffers can be bound to EGL/OpenGL and Vulkan primitives.
|
||||
* For EGL, use the extension function eglGetNativeClientBufferANDROID
|
||||
* to obtain an EGLClientBuffer and pass it directly to
|
||||
* eglCreateImageKHR. Refer to the EGL extensions
|
||||
* EGL_ANDROID_get_native_client_buffer and
|
||||
* EGL_ANDROID_image_native_buffer for more information. In Vulkan,
|
||||
* the contents of the AHardwareBuffer can be accessed as external
|
||||
* memory. See the VK_ANDROID_external_memory_android_hardware_buffer
|
||||
* extension for details.
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HARDWARE_BUFFER_H
|
||||
#define ANDROID_HARDWARE_BUFFER_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <android/rect.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* Buffer pixel formats.
|
||||
*/
|
||||
enum AHardwareBuffer_Format {
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R8G8B8A8_UNORM
|
||||
* OpenGL ES: GL_RGBA8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM = 1,
|
||||
|
||||
/**
|
||||
* 32 bits per pixel, 8 bits per channel format where alpha values are
|
||||
* ignored (always opaque).
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R8G8B8A8_UNORM
|
||||
* OpenGL ES: GL_RGB8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM = 2,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R8G8B8_UNORM
|
||||
* OpenGL ES: GL_RGB8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R8G8B8_UNORM = 3,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R5G6B5_UNORM_PACK16
|
||||
* OpenGL ES: GL_RGB565
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM = 4,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R16G16B16A16_SFLOAT
|
||||
* OpenGL ES: GL_RGBA16F
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R16G16B16A16_FLOAT = 0x16,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_A2B10G10R10_UNORM_PACK32
|
||||
* OpenGL ES: GL_RGB10_A2
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R10G10B10A2_UNORM = 0x2b,
|
||||
|
||||
/**
|
||||
* Opaque binary blob format.
|
||||
* Must have height 1 and one layer, with width equal to the buffer
|
||||
* size in bytes. Corresponds to Vulkan buffers and OpenGL buffer
|
||||
* objects. Can be bound to the latter using GL_EXT_external_buffer.
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_BLOB = 0x21,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_D16_UNORM
|
||||
* OpenGL ES: GL_DEPTH_COMPONENT16
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_D16_UNORM = 0x30,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_X8_D24_UNORM_PACK32
|
||||
* OpenGL ES: GL_DEPTH_COMPONENT24
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_D24_UNORM = 0x31,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_D24_UNORM_S8_UINT
|
||||
* OpenGL ES: GL_DEPTH24_STENCIL8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_D24_UNORM_S8_UINT = 0x32,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_D32_SFLOAT
|
||||
* OpenGL ES: GL_DEPTH_COMPONENT32F
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_D32_FLOAT = 0x33,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_D32_SFLOAT_S8_UINT
|
||||
* OpenGL ES: GL_DEPTH32F_STENCIL8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_D32_FLOAT_S8_UINT = 0x34,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_S8_UINT
|
||||
* OpenGL ES: GL_STENCIL_INDEX8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_S8_UINT = 0x35,
|
||||
|
||||
/**
|
||||
* YUV 420 888 format.
|
||||
* Must have an even width and height. Can be accessed in OpenGL
|
||||
* shaders through an external sampler. Does not support mip-maps
|
||||
* cube-maps or multi-layered textures.
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_Y8Cb8Cr8_420 = 0x23,
|
||||
|
||||
/**
|
||||
* YUV P010 format.
|
||||
* Must have an even width and height. Can be accessed in OpenGL
|
||||
* shaders through an external sampler. Does not support mip-maps
|
||||
* cube-maps or multi-layered textures.
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_YCbCr_P010 = 0x36,
|
||||
|
||||
/**
|
||||
* Corresponding formats:
|
||||
* Vulkan: VK_FORMAT_R8_UNORM
|
||||
* OpenGL ES: GR_GL_R8
|
||||
*/
|
||||
AHARDWAREBUFFER_FORMAT_R8_UNORM = 0x38,
|
||||
};
|
||||
|
||||
/**
|
||||
* Buffer usage flags, specifying how the buffer will be accessed.
|
||||
*/
|
||||
enum AHardwareBuffer_UsageFlags {
|
||||
/// The buffer will never be locked for direct CPU reads using the
|
||||
/// AHardwareBuffer_lock() function. Note that reading the buffer
|
||||
/// using OpenGL or Vulkan functions or memory mappings is still
|
||||
/// allowed.
|
||||
AHARDWAREBUFFER_USAGE_CPU_READ_NEVER = 0UL,
|
||||
/// The buffer will sometimes be locked for direct CPU reads using
|
||||
/// the AHardwareBuffer_lock() function. Note that reading the
|
||||
/// buffer using OpenGL or Vulkan functions or memory mappings
|
||||
/// does not require the presence of this flag.
|
||||
AHARDWAREBUFFER_USAGE_CPU_READ_RARELY = 2UL,
|
||||
/// The buffer will often be locked for direct CPU reads using
|
||||
/// the AHardwareBuffer_lock() function. Note that reading the
|
||||
/// buffer using OpenGL or Vulkan functions or memory mappings
|
||||
/// does not require the presence of this flag.
|
||||
AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN = 3UL,
|
||||
/// CPU read value mask.
|
||||
AHARDWAREBUFFER_USAGE_CPU_READ_MASK = 0xFUL,
|
||||
|
||||
/// The buffer will never be locked for direct CPU writes using the
|
||||
/// AHardwareBuffer_lock() function. Note that writing the buffer
|
||||
/// using OpenGL or Vulkan functions or memory mappings is still
|
||||
/// allowed.
|
||||
AHARDWAREBUFFER_USAGE_CPU_WRITE_NEVER = 0UL << 4,
|
||||
/// The buffer will sometimes be locked for direct CPU writes using
|
||||
/// the AHardwareBuffer_lock() function. Note that writing the
|
||||
/// buffer using OpenGL or Vulkan functions or memory mappings
|
||||
/// does not require the presence of this flag.
|
||||
AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY = 2UL << 4,
|
||||
/// The buffer will often be locked for direct CPU writes using
|
||||
/// the AHardwareBuffer_lock() function. Note that writing the
|
||||
/// buffer using OpenGL or Vulkan functions or memory mappings
|
||||
/// does not require the presence of this flag.
|
||||
AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN = 3UL << 4,
|
||||
/// CPU write value mask.
|
||||
AHARDWAREBUFFER_USAGE_CPU_WRITE_MASK = 0xFUL << 4,
|
||||
|
||||
/// The buffer will be read from by the GPU as a texture.
|
||||
AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE = 1UL << 8,
|
||||
/// The buffer will be written to by the GPU as a framebuffer attachment.
|
||||
AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER = 1UL << 9,
|
||||
/**
|
||||
* The buffer will be written to by the GPU as a framebuffer
|
||||
* attachment.
|
||||
*
|
||||
* Note that the name of this flag is somewhat misleading: it does
|
||||
* not imply that the buffer contains a color format. A buffer with
|
||||
* depth or stencil format that will be used as a framebuffer
|
||||
* attachment should also have this flag. Use the equivalent flag
|
||||
* AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER to avoid this confusion.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT = AHARDWAREBUFFER_USAGE_GPU_FRAMEBUFFER,
|
||||
/**
|
||||
* The buffer will be used as a composer HAL overlay layer.
|
||||
*
|
||||
* This flag is currently only needed when using ASurfaceTransaction_setBuffer
|
||||
* to set a buffer. In all other cases, the framework adds this flag
|
||||
* internally to buffers that could be presented in a composer overlay.
|
||||
* ASurfaceTransaction_setBuffer is special because it uses buffers allocated
|
||||
* directly through AHardwareBuffer_allocate instead of buffers allocated
|
||||
* by the framework.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_COMPOSER_OVERLAY = 1ULL << 11,
|
||||
/**
|
||||
* The buffer is protected from direct CPU access or being read by
|
||||
* non-secure hardware, such as video encoders.
|
||||
*
|
||||
* This flag is incompatible with CPU read and write flags. It is
|
||||
* mainly used when handling DRM video. Refer to the EGL extension
|
||||
* EGL_EXT_protected_content and GL extension
|
||||
* GL_EXT_protected_textures for more information on how these
|
||||
* buffers are expected to behave.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_PROTECTED_CONTENT = 1UL << 14,
|
||||
/// The buffer will be read by a hardware video encoder.
|
||||
AHARDWAREBUFFER_USAGE_VIDEO_ENCODE = 1UL << 16,
|
||||
/**
|
||||
* The buffer will be used for direct writes from sensors.
|
||||
* When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_SENSOR_DIRECT_DATA = 1UL << 23,
|
||||
/**
|
||||
* The buffer will be used as a shader storage or uniform buffer object.
|
||||
* When this flag is present, the format must be AHARDWAREBUFFER_FORMAT_BLOB.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_GPU_DATA_BUFFER = 1UL << 24,
|
||||
/**
|
||||
* The buffer will be used as a cube map texture.
|
||||
* When this flag is present, the buffer must have a layer count
|
||||
* that is a multiple of 6. Note that buffers with this flag must be
|
||||
* bound to OpenGL textures using the extension
|
||||
* GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP = 1UL << 25,
|
||||
/**
|
||||
* The buffer contains a complete mipmap hierarchy.
|
||||
* Note that buffers with this flag must be bound to OpenGL textures using
|
||||
* the extension GL_EXT_EGL_image_storage instead of GL_KHR_EGL_image.
|
||||
*/
|
||||
AHARDWAREBUFFER_USAGE_GPU_MIPMAP_COMPLETE = 1UL << 26,
|
||||
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_0 = 1ULL << 28,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_1 = 1ULL << 29,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_2 = 1ULL << 30,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_3 = 1ULL << 31,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_4 = 1ULL << 48,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_5 = 1ULL << 49,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_6 = 1ULL << 50,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_7 = 1ULL << 51,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_8 = 1ULL << 52,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_9 = 1ULL << 53,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_10 = 1ULL << 54,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_11 = 1ULL << 55,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_12 = 1ULL << 56,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_13 = 1ULL << 57,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_14 = 1ULL << 58,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_15 = 1ULL << 59,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_16 = 1ULL << 60,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_17 = 1ULL << 61,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_18 = 1ULL << 62,
|
||||
AHARDWAREBUFFER_USAGE_VENDOR_19 = 1ULL << 63,
|
||||
};
|
||||
|
||||
/**
|
||||
* Buffer description. Used for allocating new buffers and querying
|
||||
* parameters of existing ones.
|
||||
*/
|
||||
typedef struct AHardwareBuffer_Desc {
|
||||
uint32_t width; ///< Width in pixels.
|
||||
uint32_t height; ///< Height in pixels.
|
||||
/**
|
||||
* Number of images in an image array. AHardwareBuffers with one
|
||||
* layer correspond to regular 2D textures. AHardwareBuffers with
|
||||
* more than layer correspond to texture arrays. If the layer count
|
||||
* is a multiple of 6 and the usage flag
|
||||
* AHARDWAREBUFFER_USAGE_GPU_CUBE_MAP is present, the buffer is
|
||||
* a cube map or a cube map array.
|
||||
*/
|
||||
uint32_t layers;
|
||||
uint32_t format; ///< One of AHardwareBuffer_Format.
|
||||
uint64_t usage; ///< Combination of AHardwareBuffer_UsageFlags.
|
||||
uint32_t stride; ///< Row stride in pixels, ignored for AHardwareBuffer_allocate()
|
||||
uint32_t rfu0; ///< Initialize to zero, reserved for future use.
|
||||
uint64_t rfu1; ///< Initialize to zero, reserved for future use.
|
||||
} AHardwareBuffer_Desc;
|
||||
|
||||
/**
|
||||
* Holds data for a single image plane.
|
||||
*/
|
||||
typedef struct AHardwareBuffer_Plane {
|
||||
void* data; ///< Points to first byte in plane
|
||||
uint32_t pixelStride; ///< Distance in bytes from the color channel of one pixel to the next
|
||||
uint32_t rowStride; ///< Distance in bytes from the first value of one row of the image to
|
||||
/// the first value of the next row.
|
||||
} AHardwareBuffer_Plane;
|
||||
|
||||
/**
|
||||
* Holds all image planes that contain the pixel data.
|
||||
*/
|
||||
typedef struct AHardwareBuffer_Planes {
|
||||
uint32_t planeCount; ///< Number of distinct planes
|
||||
AHardwareBuffer_Plane planes[4]; ///< Array of image planes
|
||||
} AHardwareBuffer_Planes;
|
||||
|
||||
/**
|
||||
* Opaque handle for a native hardware buffer.
|
||||
*/
|
||||
typedef struct AHardwareBuffer AHardwareBuffer;
|
||||
|
||||
/**
|
||||
* Allocates a buffer that matches the passed AHardwareBuffer_Desc.
|
||||
*
|
||||
* If allocation succeeds, the buffer can be used according to the
|
||||
* usage flags specified in its description. If a buffer is used in ways
|
||||
* not compatible with its usage flags, the results are undefined and
|
||||
* may include program termination.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \return 0 on success, or an error number of the allocation fails for
|
||||
* any reason. The returned buffer has a reference count of 1.
|
||||
*/
|
||||
int AHardwareBuffer_allocate(const AHardwareBuffer_Desc* desc,
|
||||
AHardwareBuffer** outBuffer) __INTRODUCED_IN(26);
|
||||
/**
|
||||
* Acquire a reference on the given AHardwareBuffer object.
|
||||
*
|
||||
* This prevents the object from being deleted until the last reference
|
||||
* is removed.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
void AHardwareBuffer_acquire(AHardwareBuffer* buffer) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Remove a reference that was previously acquired with
|
||||
* AHardwareBuffer_acquire() or AHardwareBuffer_allocate().
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
void AHardwareBuffer_release(AHardwareBuffer* buffer) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Return a description of the AHardwareBuffer in the passed
|
||||
* AHardwareBuffer_Desc struct.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
void AHardwareBuffer_describe(const AHardwareBuffer* buffer,
|
||||
AHardwareBuffer_Desc* outDesc) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Lock the AHardwareBuffer for direct CPU access.
|
||||
*
|
||||
* This function can lock the buffer for either reading or writing.
|
||||
* It may block if the hardware needs to finish rendering, if CPU caches
|
||||
* need to be synchronized, or possibly for other implementation-
|
||||
* specific reasons.
|
||||
*
|
||||
* The passed AHardwareBuffer must have one layer, otherwise the call
|
||||
* will fail.
|
||||
*
|
||||
* If \a fence is not negative, it specifies a fence file descriptor on
|
||||
* which to wait before locking the buffer. If it's negative, the caller
|
||||
* is responsible for ensuring that writes to the buffer have completed
|
||||
* before calling this function. Using this parameter is more efficient
|
||||
* than waiting on the fence and then calling this function.
|
||||
*
|
||||
* The \a usage parameter may only specify AHARDWAREBUFFER_USAGE_CPU_*.
|
||||
* If set, then outVirtualAddress is filled with the address of the
|
||||
* buffer in virtual memory. The flags must also be compatible with
|
||||
* usage flags specified at buffer creation: if a read flag is passed,
|
||||
* the buffer must have been created with
|
||||
* AHARDWAREBUFFER_USAGE_CPU_READ_RARELY or
|
||||
* AHARDWAREBUFFER_USAGE_CPU_READ_OFTEN. If a write flag is passed, it
|
||||
* must have been created with AHARDWAREBUFFER_USAGE_CPU_WRITE_RARELY or
|
||||
* AHARDWAREBUFFER_USAGE_CPU_WRITE_OFTEN.
|
||||
*
|
||||
* If \a rect is not NULL, the caller promises to modify only data in
|
||||
* the area specified by rect. If rect is NULL, the caller may modify
|
||||
* the contents of the entire buffer. The content of the buffer outside
|
||||
* of the specified rect is NOT modified by this call.
|
||||
*
|
||||
* It is legal for several different threads to lock a buffer for read
|
||||
* access; none of the threads are blocked.
|
||||
*
|
||||
* Locking a buffer simultaneously for write or read/write is undefined,
|
||||
* but will neither terminate the process nor block the caller.
|
||||
* AHardwareBuffer_lock may return an error or leave the buffer's
|
||||
* content in an indeterminate state.
|
||||
*
|
||||
* If the buffer has AHARDWAREBUFFER_FORMAT_BLOB, it is legal lock it
|
||||
* for reading and writing in multiple threads and/or processes
|
||||
* simultaneously, and the contents of the buffer behave like shared
|
||||
* memory.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \return 0 on success. -EINVAL if \a buffer is NULL, the usage flags
|
||||
* are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer
|
||||
* has more than one layer. Error number if the lock fails for any other
|
||||
* reason.
|
||||
*/
|
||||
int AHardwareBuffer_lock(AHardwareBuffer* buffer, uint64_t usage,
|
||||
int32_t fence, const ARect* rect, void** outVirtualAddress) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Lock a potentially multi-planar AHardwareBuffer for direct CPU access.
|
||||
*
|
||||
* This function is similar to AHardwareBuffer_lock, but can lock multi-planar
|
||||
* formats. The locked planes are returned in the \a outPlanes argument. Note,
|
||||
* that multi-planar should not be confused with multi-layer images, which this
|
||||
* locking function does not support.
|
||||
*
|
||||
* YUV formats are always represented by three separate planes of data, one for
|
||||
* each color plane. The order of planes in the array is guaranteed such that
|
||||
* plane #0 is always Y, plane #1 is always U (Cb), and plane #2 is always V
|
||||
* (Cr). All other formats are represented by a single plane.
|
||||
*
|
||||
* Additional information always accompanies the buffers, describing the row
|
||||
* stride and the pixel stride for each plane.
|
||||
*
|
||||
* In case the buffer cannot be locked, \a outPlanes will contain zero planes.
|
||||
*
|
||||
* See the AHardwareBuffer_lock documentation for all other locking semantics.
|
||||
*
|
||||
* Available since API level 29.
|
||||
*
|
||||
* \return 0 on success. -EINVAL if \a buffer is NULL, the usage flags
|
||||
* are not a combination of AHARDWAREBUFFER_USAGE_CPU_*, or the buffer
|
||||
* has more than one layer. Error number if the lock fails for any other
|
||||
* reason.
|
||||
*/
|
||||
int AHardwareBuffer_lockPlanes(AHardwareBuffer* buffer, uint64_t usage,
|
||||
int32_t fence, const ARect* rect, AHardwareBuffer_Planes* outPlanes) __INTRODUCED_IN(29);
|
||||
|
||||
/**
|
||||
* Unlock the AHardwareBuffer from direct CPU access.
|
||||
*
|
||||
* Must be called after all changes to the buffer are completed by the
|
||||
* caller. If \a fence is NULL, the function will block until all work
|
||||
* is completed. Otherwise, \a fence will be set either to a valid file
|
||||
* descriptor or to -1. The file descriptor will become signaled once
|
||||
* the unlocking is complete and buffer contents are updated.
|
||||
* The caller is responsible for closing the file descriptor once it's
|
||||
* no longer needed. The value -1 indicates that unlocking has already
|
||||
* completed before the function returned and no further operations are
|
||||
* necessary.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \return 0 on success. -EINVAL if \a buffer is NULL. Error number if
|
||||
* the unlock fails for any reason.
|
||||
*/
|
||||
int AHardwareBuffer_unlock(AHardwareBuffer* buffer, int32_t* fence) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Send the AHardwareBuffer to an AF_UNIX socket.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \return 0 on success, -EINVAL if \a buffer is NULL, or an error
|
||||
* number if the operation fails for any reason.
|
||||
*/
|
||||
int AHardwareBuffer_sendHandleToUnixSocket(const AHardwareBuffer* buffer, int socketFd) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Receive an AHardwareBuffer from an AF_UNIX socket.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \return 0 on success, -EINVAL if \a outBuffer is NULL, or an error
|
||||
* number if the operation fails for any reason.
|
||||
*/
|
||||
int AHardwareBuffer_recvHandleFromUnixSocket(int socketFd, AHardwareBuffer** outBuffer) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Test whether the given format and usage flag combination is
|
||||
* allocatable.
|
||||
*
|
||||
* If this function returns true, it means that a buffer with the given
|
||||
* description can be allocated on this implementation, unless resource
|
||||
* exhaustion occurs. If this function returns false, it means that the
|
||||
* allocation of the given description will never succeed.
|
||||
*
|
||||
* The return value of this function may depend on all fields in the
|
||||
* description, except stride, which is always ignored. For example,
|
||||
* some implementations have implementation-defined limits on texture
|
||||
* size and layer count.
|
||||
*
|
||||
* Available since API level 29.
|
||||
*
|
||||
* \return 1 if the format and usage flag combination is allocatable,
|
||||
* 0 otherwise.
|
||||
*/
|
||||
int AHardwareBuffer_isSupported(const AHardwareBuffer_Desc* desc) __INTRODUCED_IN(29);
|
||||
|
||||
/**
|
||||
* Lock an AHardwareBuffer for direct CPU access.
|
||||
*
|
||||
* This function is the same as the above lock function, but passes back
|
||||
* additional information about the bytes per pixel and the bytes per stride
|
||||
* of the locked buffer. If the bytes per pixel or bytes per stride are unknown
|
||||
* or variable, or if the underlying mapper implementation does not support returning
|
||||
* additional information, then this call will fail with INVALID_OPERATION
|
||||
*
|
||||
* Available since API level 29.
|
||||
*/
|
||||
int AHardwareBuffer_lockAndGetInfo(AHardwareBuffer* buffer, uint64_t usage,
|
||||
int32_t fence, const ARect* rect, void** outVirtualAddress,
|
||||
int32_t* outBytesPerPixel, int32_t* outBytesPerStride) __INTRODUCED_IN(29);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_HARDWARE_BUFFER_H
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2019 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file hdr_metadata.h
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HDR_METADATA_H
|
||||
#define ANDROID_HDR_METADATA_H
|
||||
|
||||
#include <inttypes.h>
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* These structures are used to define the display's capabilities for HDR content.
|
||||
* They can be used to better tone map content to user's display.
|
||||
*/
|
||||
|
||||
/**
|
||||
* HDR metadata standards that are supported by Android.
|
||||
*/
|
||||
enum AHdrMetadataType : uint32_t {
|
||||
HDR10_SMPTE2086 = 1,
|
||||
HDR10_CTA861_3 = 2,
|
||||
HDR10PLUS_SEI = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Color is defined in CIE XYZ coordinates.
|
||||
*/
|
||||
struct AColor_xy {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
/**
|
||||
* SMPTE ST 2086 "Mastering Display Color Volume" static metadata
|
||||
*/
|
||||
struct AHdrMetadata_smpte2086 {
|
||||
struct AColor_xy displayPrimaryRed;
|
||||
struct AColor_xy displayPrimaryGreen;
|
||||
struct AColor_xy displayPrimaryBlue;
|
||||
struct AColor_xy whitePoint;
|
||||
float maxLuminance;
|
||||
float minLuminance;
|
||||
};
|
||||
|
||||
/**
|
||||
* CTA 861.3 "HDR Static Metadata Extension" static metadata
|
||||
*/
|
||||
struct AHdrMetadata_cta861_3 {
|
||||
float maxContentLightLevel;
|
||||
float maxFrameAverageLightLevel;
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_HDR_METADATA_H
|
||||
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* Copyright (C) 2009 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/**
|
||||
* @addtogroup Logging
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* \file
|
||||
*
|
||||
* Support routines to send messages to the Android log buffer,
|
||||
* which can later be accessed through the `logcat` utility.
|
||||
*
|
||||
* Each log message must have
|
||||
* - a priority
|
||||
* - a log tag
|
||||
* - some text
|
||||
*
|
||||
* The tag normally corresponds to the component that emits the log message,
|
||||
* and should be reasonably small.
|
||||
*
|
||||
* Log message text may be truncated to less than an implementation-specific
|
||||
* limit (1023 bytes).
|
||||
*
|
||||
* Note that a newline character ("\n") will be appended automatically to your
|
||||
* log message, if not already there. It is not possible to send several
|
||||
* messages and have them appear on a single line in logcat.
|
||||
*
|
||||
* Please use logging in moderation:
|
||||
*
|
||||
* - Sending log messages eats CPU and slow down your application and the
|
||||
* system.
|
||||
*
|
||||
* - The circular log buffer is pretty small, so sending many messages
|
||||
* will hide other important log messages.
|
||||
*
|
||||
* - In release builds, only send log messages to account for exceptional
|
||||
* conditions.
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#if !defined(__BIONIC__) && !defined(__INTRODUCED_IN)
|
||||
#define __INTRODUCED_IN(x)
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Android log priority values, in increasing order of priority.
|
||||
*/
|
||||
typedef enum android_LogPriority {
|
||||
/** For internal use only. */
|
||||
ANDROID_LOG_UNKNOWN = 0,
|
||||
/** The default priority, for internal use only. */
|
||||
ANDROID_LOG_DEFAULT, /* only for SetMinPriority() */
|
||||
/** Verbose logging. Should typically be disabled for a release apk. */
|
||||
ANDROID_LOG_VERBOSE,
|
||||
/** Debug logging. Should typically be disabled for a release apk. */
|
||||
ANDROID_LOG_DEBUG,
|
||||
/** Informational logging. Should typically be disabled for a release apk. */
|
||||
ANDROID_LOG_INFO,
|
||||
/** Warning logging. For use with recoverable failures. */
|
||||
ANDROID_LOG_WARN,
|
||||
/** Error logging. For use with unrecoverable failures. */
|
||||
ANDROID_LOG_ERROR,
|
||||
/** Fatal logging. For use when aborting. */
|
||||
ANDROID_LOG_FATAL,
|
||||
/** For internal use only. */
|
||||
ANDROID_LOG_SILENT, /* only for SetMinPriority(); must be last */
|
||||
} android_LogPriority;
|
||||
|
||||
/**
|
||||
* Writes the constant string `text` to the log, with priority `prio` and tag
|
||||
* `tag`.
|
||||
*/
|
||||
int __android_log_write(int prio, const char* tag, const char* text);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to the log, with priority `prio` and tag `tag`.
|
||||
* The details of formatting are the same as for
|
||||
* [printf(3)](http://man7.org/linux/man-pages/man3/printf.3.html).
|
||||
*/
|
||||
int __android_log_print(int prio, const char* tag, const char* fmt, ...)
|
||||
__attribute__((__format__(printf, 3, 4)));
|
||||
|
||||
/**
|
||||
* Equivalent to `__android_log_print`, but taking a `va_list`.
|
||||
* (If `__android_log_print` is like `printf`, this is like `vprintf`.)
|
||||
*/
|
||||
int __android_log_vprint(int prio, const char* tag, const char* fmt, va_list ap)
|
||||
__attribute__((__format__(printf, 3, 0)));
|
||||
|
||||
/**
|
||||
* Writes an assertion failure to the log (as `ANDROID_LOG_FATAL`) and to
|
||||
* stderr, before calling
|
||||
* [abort(3)](http://man7.org/linux/man-pages/man3/abort.3.html).
|
||||
*
|
||||
* If `fmt` is non-null, `cond` is unused. If `fmt` is null, the string
|
||||
* `Assertion failed: %s` is used with `cond` as the string argument.
|
||||
* If both `fmt` and `cond` are null, a default string is provided.
|
||||
*
|
||||
* Most callers should use
|
||||
* [assert(3)](http://man7.org/linux/man-pages/man3/assert.3.html) from
|
||||
* `<assert.h>` instead, or the `__assert` and `__assert2` functions
|
||||
* provided by bionic if more control is needed. They support automatically
|
||||
* including the source filename and line number more conveniently than this
|
||||
* function.
|
||||
*/
|
||||
void __android_log_assert(const char* cond, const char* tag, const char* fmt, ...)
|
||||
__attribute__((__noreturn__)) __attribute__((__format__(printf, 3, 4)));
|
||||
|
||||
/**
|
||||
* Identifies a specific log buffer for __android_log_buf_write()
|
||||
* and __android_log_buf_print().
|
||||
*/
|
||||
typedef enum log_id {
|
||||
LOG_ID_MIN = 0,
|
||||
|
||||
/** The main log buffer. This is the only log buffer available to apps. */
|
||||
LOG_ID_MAIN = 0,
|
||||
/** The radio log buffer. */
|
||||
LOG_ID_RADIO = 1,
|
||||
/** The event log buffer. */
|
||||
LOG_ID_EVENTS = 2,
|
||||
/** The system log buffer. */
|
||||
LOG_ID_SYSTEM = 3,
|
||||
/** The crash log buffer. */
|
||||
LOG_ID_CRASH = 4,
|
||||
/** The statistics log buffer. */
|
||||
LOG_ID_STATS = 5,
|
||||
/** The security log buffer. */
|
||||
LOG_ID_SECURITY = 6,
|
||||
/** The kernel log buffer. */
|
||||
LOG_ID_KERNEL = 7,
|
||||
|
||||
LOG_ID_MAX,
|
||||
|
||||
/** Let the logging function choose the best log target. */
|
||||
LOG_ID_DEFAULT = 0x7FFFFFFF
|
||||
} log_id_t;
|
||||
|
||||
/**
|
||||
* Writes the constant string `text` to the log buffer `id`,
|
||||
* with priority `prio` and tag `tag`.
|
||||
*
|
||||
* Apps should use __android_log_write() instead.
|
||||
*/
|
||||
int __android_log_buf_write(int bufID, int prio, const char* tag, const char* text);
|
||||
|
||||
/**
|
||||
* Writes a formatted string to log buffer `id`,
|
||||
* with priority `prio` and tag `tag`.
|
||||
* The details of formatting are the same as for
|
||||
* [printf(3)](http://man7.org/linux/man-pages/man3/printf.3.html).
|
||||
*
|
||||
* Apps should use __android_log_print() instead.
|
||||
*/
|
||||
int __android_log_buf_print(int bufID, int prio, const char* tag, const char* fmt, ...)
|
||||
__attribute__((__format__(printf, 4, 5)));
|
||||
|
||||
/**
|
||||
* Logger data struct used for writing log messages to liblog via __android_log_write_logger_data()
|
||||
* and sending log messages to user defined loggers specified in __android_log_set_logger().
|
||||
*/
|
||||
struct __android_log_message {
|
||||
/** Must be set to sizeof(__android_log_message) and is used for versioning. */
|
||||
size_t struct_size;
|
||||
|
||||
/** {@link log_id_t} values. */
|
||||
int32_t buffer_id;
|
||||
|
||||
/** {@link android_LogPriority} values. */
|
||||
int32_t priority;
|
||||
|
||||
/** The tag for the log message. */
|
||||
const char* tag;
|
||||
|
||||
/** Optional file name, may be set to nullptr. */
|
||||
const char* file;
|
||||
|
||||
/** Optional line number, ignore if file is nullptr. */
|
||||
uint32_t line;
|
||||
|
||||
/** The log message itself. */
|
||||
const char* message;
|
||||
};
|
||||
|
||||
/**
|
||||
* Prototype for the 'logger' function that is called for every log message.
|
||||
*/
|
||||
typedef void (*__android_logger_function)(const struct __android_log_message* log_message);
|
||||
/**
|
||||
* Prototype for the 'abort' function that is called when liblog will abort due to
|
||||
* __android_log_assert() failures.
|
||||
*/
|
||||
typedef void (*__android_aborter_function)(const char* abort_message);
|
||||
|
||||
/**
|
||||
* Writes the log message specified by log_message. log_message includes additional file name and
|
||||
* line number information that a logger may use. log_message is versioned for backwards
|
||||
* compatibility.
|
||||
* This assumes that loggability has already been checked through __android_log_is_loggable().
|
||||
* Higher level logging libraries, such as libbase, first check loggability, then format their
|
||||
* buffers, then pass the message to liblog via this function, and therefore we do not want to
|
||||
* duplicate the loggability check here.
|
||||
*
|
||||
* @param log_message the log message itself, see __android_log_message.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_write_log_message(struct __android_log_message* log_message) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Sets a user defined logger function. All log messages sent to liblog will be set to the
|
||||
* function pointer specified by logger for processing. It is not expected that log messages are
|
||||
* already terminated with a new line. This function should add new lines if required for line
|
||||
* separation.
|
||||
*
|
||||
* @param logger the new function that will handle log messages.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_set_logger(__android_logger_function logger) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Writes the log message to logd. This is an __android_logger_function and can be provided to
|
||||
* __android_log_set_logger(). It is the default logger when running liblog on a device.
|
||||
*
|
||||
* @param log_message the log message to write, see __android_log_message.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_logd_logger(const struct __android_log_message* log_message) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Writes the log message to stderr. This is an __android_logger_function and can be provided to
|
||||
* __android_log_set_logger(). It is the default logger when running liblog on host.
|
||||
*
|
||||
* @param log_message the log message to write, see __android_log_message.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_stderr_logger(const struct __android_log_message* log_message)
|
||||
__INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Sets a user defined aborter function that is called for __android_log_assert() failures. This
|
||||
* user defined aborter function is highly recommended to abort and be noreturn, but is not strictly
|
||||
* required to.
|
||||
*
|
||||
* @param aborter the new aborter function, see __android_aborter_function.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_set_aborter(__android_aborter_function aborter) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Calls the stored aborter function. This allows for other logging libraries to use the same
|
||||
* aborter function by calling this function in liblog.
|
||||
*
|
||||
* @param abort_message an additional message supplied when aborting, for example this is used to
|
||||
* call android_set_abort_message() in __android_log_default_aborter().
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_call_aborter(const char* abort_message) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Sets android_set_abort_message() on device then aborts(). This is the default aborter.
|
||||
*
|
||||
* @param abort_message an additional message supplied when aborting. This functions calls
|
||||
* android_set_abort_message() with its contents.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_default_aborter(const char* abort_message) __attribute__((noreturn))
|
||||
__INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Use the per-tag properties "log.tag.<tagname>" along with the minimum priority from
|
||||
* __android_log_set_minimum_priority() to determine if a log message with a given prio and tag will
|
||||
* be printed. A non-zero result indicates yes, zero indicates false.
|
||||
*
|
||||
* If both a priority for a tag and a minimum priority are set by
|
||||
* __android_log_set_minimum_priority(), then the lowest of the two values are to determine the
|
||||
* minimum priority needed to log. If only one is set, then that value is used to determine the
|
||||
* minimum priority needed. If none are set, then default_priority is used.
|
||||
*
|
||||
* @param prio the priority to test, takes android_LogPriority values.
|
||||
* @param tag the tag to test.
|
||||
* @param default_prio the default priority to use if no properties or minimum priority are set.
|
||||
* @return an integer where 1 indicates that the message is loggable and 0 indicates that it is not.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
int __android_log_is_loggable(int prio, const char* tag, int default_prio) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Use the per-tag properties "log.tag.<tagname>" along with the minimum priority from
|
||||
* __android_log_set_minimum_priority() to determine if a log message with a given prio and tag will
|
||||
* be printed. A non-zero result indicates yes, zero indicates false.
|
||||
*
|
||||
* If both a priority for a tag and a minimum priority are set by
|
||||
* __android_log_set_minimum_priority(), then the lowest of the two values are to determine the
|
||||
* minimum priority needed to log. If only one is set, then that value is used to determine the
|
||||
* minimum priority needed. If none are set, then default_priority is used.
|
||||
*
|
||||
* @param prio the priority to test, takes android_LogPriority values.
|
||||
* @param tag the tag to test.
|
||||
* @param len the length of the tag.
|
||||
* @param default_prio the default priority to use if no properties or minimum priority are set.
|
||||
* @return an integer where 1 indicates that the message is loggable and 0 indicates that it is not.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int default_prio)
|
||||
__INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Sets the minimum priority that will be logged for this process.
|
||||
*
|
||||
* @param priority the new minimum priority to set, takes android_LogPriority values.
|
||||
* @return the previous set minimum priority as android_LogPriority values, or
|
||||
* ANDROID_LOG_DEFAULT if none was set.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
int32_t __android_log_set_minimum_priority(int32_t priority) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Gets the minimum priority that will be logged for this process. If none has been set by a
|
||||
* previous __android_log_set_minimum_priority() call, this returns ANDROID_LOG_DEFAULT.
|
||||
*
|
||||
* @return the current minimum priority as android_LogPriority values, or
|
||||
* ANDROID_LOG_DEFAULT if none is set.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
int32_t __android_log_get_minimum_priority(void) __INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Sets the default tag if no tag is provided when writing a log message. Defaults to
|
||||
* getprogname(). This truncates tag to the maximum log message size, though appropriate tags
|
||||
* should be much smaller.
|
||||
*
|
||||
* @param tag the new log tag.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void __android_log_set_default_tag(const char* tag) __INTRODUCED_IN(30);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,300 @@
|
||||
/*
|
||||
* Copyright (C) 2010 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @defgroup ANativeWindow Native Window
|
||||
*
|
||||
* ANativeWindow represents the producer end of an image queue.
|
||||
* It is the C counterpart of the android.view.Surface object in Java,
|
||||
* and can be converted both ways. Depending on the consumer, images
|
||||
* submitted to ANativeWindow can be shown on the display or sent to
|
||||
* other consumers, such as video encoders.
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file native_window.h
|
||||
* @brief API for accessing a native window.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_NATIVE_WINDOW_H
|
||||
#define ANDROID_NATIVE_WINDOW_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <android/data_space.h>
|
||||
#include <android/hardware_buffer.h>
|
||||
#include <android/rect.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Legacy window pixel format names, kept for backwards compatibility.
|
||||
* New code and APIs should use AHARDWAREBUFFER_FORMAT_*.
|
||||
*/
|
||||
enum ANativeWindow_LegacyFormat {
|
||||
// NOTE: these values must match the values from graphics/common/x.x/types.hal
|
||||
|
||||
/** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Alpha: 8 bits. **/
|
||||
WINDOW_FORMAT_RGBA_8888 = AHARDWAREBUFFER_FORMAT_R8G8B8A8_UNORM,
|
||||
/** Red: 8 bits, Green: 8 bits, Blue: 8 bits, Unused: 8 bits. **/
|
||||
WINDOW_FORMAT_RGBX_8888 = AHARDWAREBUFFER_FORMAT_R8G8B8X8_UNORM,
|
||||
/** Red: 5 bits, Green: 6 bits, Blue: 5 bits. **/
|
||||
WINDOW_FORMAT_RGB_565 = AHARDWAREBUFFER_FORMAT_R5G6B5_UNORM,
|
||||
};
|
||||
|
||||
/**
|
||||
* Transforms that can be applied to buffers as they are displayed to a window.
|
||||
*
|
||||
* Supported transforms are any combination of horizontal mirror, vertical
|
||||
* mirror, and clockwise 90 degree rotation, in that order. Rotations of 180
|
||||
* and 270 degrees are made up of those basic transforms.
|
||||
*/
|
||||
enum ANativeWindowTransform {
|
||||
ANATIVEWINDOW_TRANSFORM_IDENTITY = 0x00,
|
||||
ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL = 0x01,
|
||||
ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL = 0x02,
|
||||
ANATIVEWINDOW_TRANSFORM_ROTATE_90 = 0x04,
|
||||
|
||||
ANATIVEWINDOW_TRANSFORM_ROTATE_180 = ANATIVEWINDOW_TRANSFORM_MIRROR_HORIZONTAL |
|
||||
ANATIVEWINDOW_TRANSFORM_MIRROR_VERTICAL,
|
||||
ANATIVEWINDOW_TRANSFORM_ROTATE_270 = ANATIVEWINDOW_TRANSFORM_ROTATE_180 |
|
||||
ANATIVEWINDOW_TRANSFORM_ROTATE_90,
|
||||
};
|
||||
|
||||
struct ANativeWindow;
|
||||
/**
|
||||
* Opaque type that provides access to a native window.
|
||||
*
|
||||
* A pointer can be obtained using {@link ANativeWindow_fromSurface()}.
|
||||
*/
|
||||
typedef struct ANativeWindow ANativeWindow;
|
||||
|
||||
/**
|
||||
* Struct that represents a windows buffer.
|
||||
*
|
||||
* A pointer can be obtained using {@link ANativeWindow_lock()}.
|
||||
*/
|
||||
typedef struct ANativeWindow_Buffer {
|
||||
/// The number of pixels that are shown horizontally.
|
||||
int32_t width;
|
||||
|
||||
/// The number of pixels that are shown vertically.
|
||||
int32_t height;
|
||||
|
||||
/// The number of *pixels* that a line in the buffer takes in
|
||||
/// memory. This may be >= width.
|
||||
int32_t stride;
|
||||
|
||||
/// The format of the buffer. One of AHardwareBuffer_Format.
|
||||
int32_t format;
|
||||
|
||||
/// The actual bits.
|
||||
void* bits;
|
||||
|
||||
/// Do not touch.
|
||||
uint32_t reserved[6];
|
||||
} ANativeWindow_Buffer;
|
||||
|
||||
/**
|
||||
* Acquire a reference on the given {@link ANativeWindow} object. This prevents the object
|
||||
* from being deleted until the reference is removed.
|
||||
*/
|
||||
void ANativeWindow_acquire(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Remove a reference that was previously acquired with {@link ANativeWindow_acquire()}.
|
||||
*/
|
||||
void ANativeWindow_release(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Return the current width in pixels of the window surface.
|
||||
*
|
||||
* \return negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_getWidth(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Return the current height in pixels of the window surface.
|
||||
*
|
||||
* \return a negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_getHeight(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Return the current pixel format (AHARDWAREBUFFER_FORMAT_*) of the window surface.
|
||||
*
|
||||
* \return a negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_getFormat(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Change the format and size of the window buffers.
|
||||
*
|
||||
* The width and height control the number of pixels in the buffers, not the
|
||||
* dimensions of the window on screen. If these are different than the
|
||||
* window's physical size, then its buffer will be scaled to match that size
|
||||
* when compositing it to the screen. The width and height must be either both zero
|
||||
* or both non-zero.
|
||||
*
|
||||
* For all of these parameters, if 0 is supplied then the window's base
|
||||
* value will come back in force.
|
||||
*
|
||||
* \param width width of the buffers in pixels.
|
||||
* \param height height of the buffers in pixels.
|
||||
* \param format one of the AHardwareBuffer_Format constants.
|
||||
* \return 0 for success, or a negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_setBuffersGeometry(ANativeWindow* window,
|
||||
int32_t width, int32_t height, int32_t format);
|
||||
|
||||
/**
|
||||
* Lock the window's next drawing surface for writing.
|
||||
* inOutDirtyBounds is used as an in/out parameter, upon entering the
|
||||
* function, it contains the dirty region, that is, the region the caller
|
||||
* intends to redraw. When the function returns, inOutDirtyBounds is updated
|
||||
* with the actual area the caller needs to redraw -- this region is often
|
||||
* extended by {@link ANativeWindow_lock}.
|
||||
*
|
||||
* \return 0 for success, or a negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_lock(ANativeWindow* window, ANativeWindow_Buffer* outBuffer,
|
||||
ARect* inOutDirtyBounds);
|
||||
|
||||
/**
|
||||
* Unlock the window's drawing surface after previously locking it,
|
||||
* posting the new buffer to the display.
|
||||
*
|
||||
* \return 0 for success, or a negative value on error.
|
||||
*/
|
||||
int32_t ANativeWindow_unlockAndPost(ANativeWindow* window);
|
||||
|
||||
/**
|
||||
* Set a transform that will be applied to future buffers posted to the window.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*
|
||||
* \param transform combination of {@link ANativeWindowTransform} flags
|
||||
* \return 0 for success, or -EINVAL if \p transform is invalid
|
||||
*/
|
||||
int32_t ANativeWindow_setBuffersTransform(ANativeWindow* window, int32_t transform) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* All buffers queued after this call will be associated with the dataSpace
|
||||
* parameter specified.
|
||||
*
|
||||
* dataSpace specifies additional information about the buffer.
|
||||
* For example, it can be used to convey the color space of the image data in
|
||||
* the buffer, or it can be used to indicate that the buffers contain depth
|
||||
* measurement data instead of color images. The default dataSpace is 0,
|
||||
* ADATASPACE_UNKNOWN, unless it has been overridden by the producer.
|
||||
*
|
||||
* Available since API level 28.
|
||||
*
|
||||
* \param dataSpace data space of all buffers queued after this call.
|
||||
* \return 0 for success, -EINVAL if window is invalid or the dataspace is not
|
||||
* supported.
|
||||
*/
|
||||
int32_t ANativeWindow_setBuffersDataSpace(ANativeWindow* window, int32_t dataSpace) __INTRODUCED_IN(28);
|
||||
|
||||
/**
|
||||
* Get the dataspace of the buffers in window.
|
||||
*
|
||||
* Available since API level 28.
|
||||
*
|
||||
* \return the dataspace of buffers in window, ADATASPACE_UNKNOWN is returned if
|
||||
* dataspace is unknown, or -EINVAL if window is invalid.
|
||||
*/
|
||||
int32_t ANativeWindow_getBuffersDataSpace(ANativeWindow* window) __INTRODUCED_IN(28);
|
||||
|
||||
/** Compatibility value for ANativeWindow_setFrameRate. */
|
||||
enum ANativeWindow_FrameRateCompatibility {
|
||||
/**
|
||||
* There are no inherent restrictions on the frame rate of this window. When
|
||||
* the system selects a frame rate other than what the app requested, the
|
||||
* app will be able to run at the system frame rate without requiring pull
|
||||
* down. This value should be used when displaying game content, UIs, and
|
||||
* anything that isn't video.
|
||||
*/
|
||||
ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_DEFAULT = 0,
|
||||
/**
|
||||
* This window is being used to display content with an inherently fixed
|
||||
* frame rate, e.g.\ a video that has a specific frame rate. When the system
|
||||
* selects a frame rate other than what the app requested, the app will need
|
||||
* to do pull down or use some other technique to adapt to the system's
|
||||
* frame rate. The user experience is likely to be worse (e.g. more frame
|
||||
* stuttering) than it would be if the system had chosen the app's requested
|
||||
* frame rate. This value should be used for video content.
|
||||
*/
|
||||
ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_FIXED_SOURCE = 1
|
||||
};
|
||||
|
||||
/**
|
||||
* Sets the intended frame rate for this window.
|
||||
*
|
||||
* On devices that are capable of running the display at different refresh
|
||||
* rates, the system may choose a display refresh rate to better match this
|
||||
* window's frame rate. Usage of this API won't introduce frame rate throttling,
|
||||
* or affect other aspects of the application's frame production
|
||||
* pipeline. However, because the system may change the display refresh rate,
|
||||
* calls to this function may result in changes to Choreographer callback
|
||||
* timings, and changes to the time interval at which the system releases
|
||||
* buffers back to the application.
|
||||
*
|
||||
* Note that this only has an effect for windows presented on the display. If
|
||||
* this ANativeWindow is consumed by something other than the system compositor,
|
||||
* e.g. a media codec, this call has no effect.
|
||||
*
|
||||
* Available since API level 30.
|
||||
*
|
||||
* \param frameRate The intended frame rate of this window, in frames per
|
||||
* second. 0 is a special value that indicates the app will accept the system's
|
||||
* choice for the display frame rate, which is the default behavior if this
|
||||
* function isn't called. The frameRate param does <em>not</em> need to be a
|
||||
* valid refresh rate for this device's display - e.g., it's fine to pass 30fps
|
||||
* to a device that can only run the display at 60fps.
|
||||
*
|
||||
* \param compatibility The frame rate compatibility of this window. The
|
||||
* compatibility value may influence the system's choice of display refresh
|
||||
* rate. See the ANATIVEWINDOW_FRAME_RATE_COMPATIBILITY_* values for more info.
|
||||
*
|
||||
* \return 0 for success, -EINVAL if the window, frame rate, or compatibility
|
||||
* value are invalid.
|
||||
*/
|
||||
int32_t ANativeWindow_setFrameRate(ANativeWindow* window, float frameRate, int8_t compatibility)
|
||||
__INTRODUCED_IN(30);
|
||||
|
||||
/**
|
||||
* Provides a hint to the window that buffers should be preallocated ahead of
|
||||
* time. Note that the window implementation is not guaranteed to preallocate
|
||||
* any buffers, for instance if an implementation disallows allocation of new
|
||||
* buffers, or if there is insufficient memory in the system to preallocate
|
||||
* additional buffers
|
||||
*
|
||||
* Available since API level 30.
|
||||
*/
|
||||
void ANativeWindow_tryAllocateBuffers(ANativeWindow* window);
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ANDROID_NATIVE_WINDOW_H
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,65 @@
|
||||
/*
|
||||
* Copyright (C) 2010 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup NativeActivity Native Activity
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file rect.h
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_RECT_H
|
||||
#define ANDROID_RECT_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Rectangular window area.
|
||||
*
|
||||
* This is the NDK equivalent of the android.graphics.Rect class in Java. It is
|
||||
* used with {@link ANativeActivityCallbacks::onContentRectChanged} event
|
||||
* callback and the ANativeWindow_lock() function.
|
||||
*
|
||||
* In a valid ARect, left <= right and top <= bottom. ARect with left=0, top=10,
|
||||
* right=1, bottom=11 contains only one pixel at x=0, y=10.
|
||||
*/
|
||||
typedef struct ARect {
|
||||
#ifdef __cplusplus
|
||||
typedef int32_t value_type;
|
||||
#endif
|
||||
/// Minimum X coordinate of the rectangle.
|
||||
int32_t left;
|
||||
/// Minimum Y coordinate of the rectangle.
|
||||
int32_t top;
|
||||
/// Maximum X coordinate of the rectangle.
|
||||
int32_t right;
|
||||
/// Maximum Y coordinate of the rectangle.
|
||||
int32_t bottom;
|
||||
} ARect;
|
||||
|
||||
#ifdef __cplusplus
|
||||
};
|
||||
#endif
|
||||
|
||||
#endif // ANDROID_RECT_H
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1,49 @@
|
||||
/*
|
||||
* sync.h
|
||||
*
|
||||
* Copyright 2012 Google, Inc
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef __SYS_CORE_SYNC_H
|
||||
#define __SYS_CORE_SYNC_H
|
||||
|
||||
/* This file contains the legacy sync interface used by Android platform and
|
||||
* device code. The direct contents will be removed over time as code
|
||||
* transitions to using the updated interface in ndk/sync.h. When this file is
|
||||
* empty other than the ndk/sync.h include, that file will be renamed to
|
||||
* replace this one.
|
||||
*
|
||||
* New code should continue to include this file (#include <android/sync.h>)
|
||||
* instead of ndk/sync.h so the eventual rename is seamless, but should only
|
||||
* use the things declared in ndk/sync.h.
|
||||
*
|
||||
* This file used to be called sync/sync.h, but we renamed to that both the
|
||||
* platform and NDK call it android/sync.h. A symlink from the old name to this
|
||||
* one exists temporarily to avoid having to change all sync clients
|
||||
* simultaneously. It will be removed when they've been updated, and probably
|
||||
* after this change has been delivered to AOSP so that integrations don't
|
||||
* break builds.
|
||||
*/
|
||||
|
||||
#include "../ndk/sync.h"
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* timeout in msecs */
|
||||
int sync_wait(int fd, int timeout);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* __SYS_CORE_SYNC_H */
|
||||
@@ -0,0 +1,214 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _BACKTRACE_BACKTRACE_H
|
||||
#define _BACKTRACE_BACKTRACE_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
#include <backtrace/backtrace_constants.h>
|
||||
#include <backtrace/BacktraceMap.h>
|
||||
|
||||
#if defined(__LP64__)
|
||||
#define PRIPTR "016" PRIx64
|
||||
typedef uint64_t word_t;
|
||||
#else
|
||||
#define PRIPTR "08" PRIx64
|
||||
typedef uint32_t word_t;
|
||||
#endif
|
||||
|
||||
enum BacktraceUnwindErrorCode : uint32_t {
|
||||
BACKTRACE_UNWIND_NO_ERROR,
|
||||
// Something failed while trying to perform the setup to begin the unwind.
|
||||
BACKTRACE_UNWIND_ERROR_SETUP_FAILED,
|
||||
// There is no map information to use with the unwind.
|
||||
BACKTRACE_UNWIND_ERROR_MAP_MISSING,
|
||||
// An error occurred that indicates a programming error.
|
||||
BACKTRACE_UNWIND_ERROR_INTERNAL,
|
||||
// The thread to unwind has disappeared before the unwind can begin.
|
||||
BACKTRACE_UNWIND_ERROR_THREAD_DOESNT_EXIST,
|
||||
// The thread to unwind has not responded to a signal in a timely manner.
|
||||
BACKTRACE_UNWIND_ERROR_THREAD_TIMEOUT,
|
||||
// Attempt to do an unsupported operation.
|
||||
BACKTRACE_UNWIND_ERROR_UNSUPPORTED_OPERATION,
|
||||
// Attempt to do an offline unwind without a context.
|
||||
BACKTRACE_UNWIND_ERROR_NO_CONTEXT,
|
||||
// The count of frames exceed MAX_BACKTRACE_FRAMES.
|
||||
BACKTRACE_UNWIND_ERROR_EXCEED_MAX_FRAMES_LIMIT,
|
||||
// Failed to read memory.
|
||||
BACKTRACE_UNWIND_ERROR_ACCESS_MEM_FAILED,
|
||||
// Failed to read registers.
|
||||
BACKTRACE_UNWIND_ERROR_ACCESS_REG_FAILED,
|
||||
// Failed to find a function in debug sections.
|
||||
BACKTRACE_UNWIND_ERROR_FIND_PROC_INFO_FAILED,
|
||||
// Failed to execute dwarf instructions in debug sections.
|
||||
BACKTRACE_UNWIND_ERROR_EXECUTE_DWARF_INSTRUCTION_FAILED,
|
||||
// Unwind information is incorrect.
|
||||
BACKTRACE_UNWIND_ERROR_UNWIND_INFO,
|
||||
// Unwind information stopped due to sp/pc repeating.
|
||||
BACKTRACE_UNWIND_ERROR_REPEATED_FRAME,
|
||||
// Unwind information stopped due to invalid elf.
|
||||
BACKTRACE_UNWIND_ERROR_INVALID_ELF,
|
||||
};
|
||||
|
||||
struct BacktraceUnwindError {
|
||||
enum BacktraceUnwindErrorCode error_code;
|
||||
|
||||
union {
|
||||
// for BACKTRACE_UNWIND_ERROR_ACCESS_MEM_FAILED
|
||||
uint64_t addr;
|
||||
// for BACKTRACE_UNWIND_ERROR_ACCESS_REG_FAILED
|
||||
uint64_t regno;
|
||||
} error_info;
|
||||
|
||||
BacktraceUnwindError() : error_code(BACKTRACE_UNWIND_NO_ERROR) {}
|
||||
};
|
||||
|
||||
struct backtrace_frame_data_t {
|
||||
size_t num; // The current fame number.
|
||||
uint64_t pc; // The absolute pc.
|
||||
uint64_t rel_pc; // The relative pc.
|
||||
uint64_t sp; // The top of the stack.
|
||||
size_t stack_size; // The size of the stack, zero indicate an unknown stack size.
|
||||
backtrace_map_t map; // The map associated with the given pc.
|
||||
std::string func_name; // The function name associated with this pc, NULL if not found.
|
||||
uint64_t func_offset; // pc relative to the start of the function, only valid if func_name is not
|
||||
// NULL.
|
||||
};
|
||||
|
||||
struct backtrace_stackinfo_t {
|
||||
uint64_t start;
|
||||
uint64_t end;
|
||||
const uint8_t* data;
|
||||
};
|
||||
|
||||
namespace unwindstack {
|
||||
class Regs;
|
||||
}
|
||||
|
||||
class Backtrace {
|
||||
public:
|
||||
enum ArchEnum : uint8_t {
|
||||
ARCH_ARM,
|
||||
ARCH_ARM64,
|
||||
ARCH_X86,
|
||||
ARCH_X86_64,
|
||||
};
|
||||
|
||||
static void SetGlobalElfCache(bool enable);
|
||||
|
||||
// Create the correct Backtrace object based on what is to be unwound.
|
||||
// If pid < 0 or equals the current pid, then the Backtrace object
|
||||
// corresponds to the current process.
|
||||
// If pid < 0 or equals the current pid and tid >= 0, then the Backtrace
|
||||
// object corresponds to a thread in the current process.
|
||||
// If pid >= 0 and tid < 0, then the Backtrace object corresponds to a
|
||||
// different process.
|
||||
// Tracing a thread in a different process is not supported.
|
||||
// If map is NULL, then create the map and manage it internally.
|
||||
// If map is not NULL, the map is still owned by the caller.
|
||||
static Backtrace* Create(pid_t pid, pid_t tid, BacktraceMap* map = nullptr);
|
||||
|
||||
virtual ~Backtrace();
|
||||
|
||||
// Get the current stack trace and store in the backtrace_ structure.
|
||||
virtual bool Unwind(size_t num_ignore_frames, void* context = nullptr) = 0;
|
||||
|
||||
static bool Unwind(unwindstack::Regs* regs, BacktraceMap* back_map,
|
||||
std::vector<backtrace_frame_data_t>* frames, size_t num_ignore_frames,
|
||||
std::vector<std::string>* skip_names, BacktraceUnwindError* error = nullptr);
|
||||
|
||||
// Get the function name and offset into the function given the pc.
|
||||
// If the string is empty, then no valid function name was found,
|
||||
// or the pc is not in any valid map.
|
||||
virtual std::string GetFunctionName(uint64_t pc, uint64_t* offset,
|
||||
const backtrace_map_t* map = nullptr);
|
||||
|
||||
// Fill in the map data associated with the given pc.
|
||||
virtual void FillInMap(uint64_t pc, backtrace_map_t* map);
|
||||
|
||||
// Read the data at a specific address.
|
||||
virtual bool ReadWord(uint64_t ptr, word_t* out_value) = 0;
|
||||
|
||||
// Read arbitrary data from a specific address. If a read request would
|
||||
// span from one map to another, this call only reads up until the end
|
||||
// of the current map.
|
||||
// Returns the total number of bytes actually read.
|
||||
virtual size_t Read(uint64_t addr, uint8_t* buffer, size_t bytes) = 0;
|
||||
|
||||
// Create a string representing the formatted line of backtrace information
|
||||
// for a single frame.
|
||||
virtual std::string FormatFrameData(size_t frame_num);
|
||||
static std::string FormatFrameData(const backtrace_frame_data_t* frame);
|
||||
|
||||
pid_t Pid() const { return pid_; }
|
||||
pid_t Tid() const { return tid_; }
|
||||
size_t NumFrames() const { return frames_.size(); }
|
||||
|
||||
const backtrace_frame_data_t* GetFrame(size_t frame_num) {
|
||||
if (frame_num >= frames_.size()) {
|
||||
return nullptr;
|
||||
}
|
||||
return &frames_[frame_num];
|
||||
}
|
||||
|
||||
typedef std::vector<backtrace_frame_data_t>::iterator iterator;
|
||||
iterator begin() { return frames_.begin(); }
|
||||
iterator end() { return frames_.end(); }
|
||||
|
||||
typedef std::vector<backtrace_frame_data_t>::const_iterator const_iterator;
|
||||
const_iterator begin() const { return frames_.begin(); }
|
||||
const_iterator end() const { return frames_.end(); }
|
||||
|
||||
BacktraceMap* GetMap() { return map_; }
|
||||
|
||||
BacktraceUnwindError GetError() { return error_; }
|
||||
|
||||
std::string GetErrorString(BacktraceUnwindError error);
|
||||
|
||||
// Set whether to skip frames in libbacktrace/libunwindstack when doing a local unwind.
|
||||
void SetSkipFrames(bool skip_frames) { skip_frames_ = skip_frames; }
|
||||
|
||||
protected:
|
||||
Backtrace(pid_t pid, pid_t tid, BacktraceMap* map);
|
||||
|
||||
// The name returned is not demangled, GetFunctionName() takes care of
|
||||
// demangling the name.
|
||||
virtual std::string GetFunctionNameRaw(uint64_t pc, uint64_t* offset) = 0;
|
||||
|
||||
virtual bool VerifyReadWordArgs(uint64_t ptr, word_t* out_value);
|
||||
|
||||
bool BuildMap();
|
||||
|
||||
pid_t pid_;
|
||||
pid_t tid_;
|
||||
|
||||
BacktraceMap* map_;
|
||||
bool map_shared_;
|
||||
|
||||
std::vector<backtrace_frame_data_t> frames_;
|
||||
|
||||
// Skip frames in libbacktrace/libunwindstack when doing a local unwind.
|
||||
bool skip_frames_ = true;
|
||||
|
||||
BacktraceUnwindError error_;
|
||||
};
|
||||
|
||||
#endif // _BACKTRACE_BACKTRACE_H
|
||||
@@ -0,0 +1,191 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _BACKTRACE_BACKTRACE_MAP_H
|
||||
#define _BACKTRACE_BACKTRACE_MAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef _WIN32
|
||||
// MINGW does not define these constants.
|
||||
#define PROT_NONE 0
|
||||
#define PROT_READ 0x1
|
||||
#define PROT_WRITE 0x2
|
||||
#define PROT_EXEC 0x4
|
||||
#else
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include <deque>
|
||||
#include <iterator>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
// Forward declaration.
|
||||
struct backtrace_stackinfo_t;
|
||||
|
||||
// Special flag to indicate a map is in /dev/. However, a map in
|
||||
// /dev/ashmem/... does not set this flag.
|
||||
static constexpr int PROT_DEVICE_MAP = 0x8000;
|
||||
// Special flag to indicate that this map represents an elf file
|
||||
// created by ART for use with the gdb jit debug interface.
|
||||
// This should only ever appear in offline maps data.
|
||||
static constexpr int PROT_JIT_SYMFILE_MAP = 0x4000;
|
||||
|
||||
struct backtrace_map_t {
|
||||
uint64_t start = 0;
|
||||
uint64_t end = 0;
|
||||
uint64_t offset = 0;
|
||||
uint64_t load_bias = 0;
|
||||
int flags = 0;
|
||||
std::string name;
|
||||
|
||||
// Returns `name` if non-empty, or `<anonymous:0x...>` otherwise.
|
||||
std::string Name() const;
|
||||
};
|
||||
|
||||
namespace unwindstack {
|
||||
class Memory;
|
||||
}
|
||||
|
||||
class BacktraceMap {
|
||||
public:
|
||||
// If uncached is true, then parse the current process map as of the call.
|
||||
// Passing a map created with uncached set to true to Backtrace::Create()
|
||||
// is unsupported.
|
||||
static BacktraceMap* Create(pid_t pid, bool uncached = false);
|
||||
|
||||
virtual ~BacktraceMap();
|
||||
|
||||
class iterator : public std::iterator<std::bidirectional_iterator_tag, backtrace_map_t*> {
|
||||
public:
|
||||
iterator(BacktraceMap* map, size_t index) : map_(map), index_(index) {}
|
||||
|
||||
iterator& operator++() {
|
||||
index_++;
|
||||
return *this;
|
||||
}
|
||||
const iterator operator++(int increment) {
|
||||
index_ += increment;
|
||||
return *this;
|
||||
}
|
||||
iterator& operator--() {
|
||||
index_--;
|
||||
return *this;
|
||||
}
|
||||
const iterator operator--(int decrement) {
|
||||
index_ -= decrement;
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool operator==(const iterator& rhs) { return this->index_ == rhs.index_; }
|
||||
bool operator!=(const iterator& rhs) { return this->index_ != rhs.index_; }
|
||||
|
||||
const backtrace_map_t* operator*() {
|
||||
if (index_ >= map_->size()) {
|
||||
return nullptr;
|
||||
}
|
||||
backtrace_map_t* map = &map_->maps_[index_];
|
||||
if (map->load_bias == static_cast<uint64_t>(-1)) {
|
||||
map->load_bias = map_->GetLoadBias(index_);
|
||||
}
|
||||
return map;
|
||||
}
|
||||
|
||||
private:
|
||||
BacktraceMap* map_ = nullptr;
|
||||
size_t index_ = 0;
|
||||
};
|
||||
|
||||
iterator begin() { return iterator(this, 0); }
|
||||
iterator end() { return iterator(this, maps_.size()); }
|
||||
|
||||
// Fill in the map data structure for the given address.
|
||||
virtual void FillIn(uint64_t addr, backtrace_map_t* map);
|
||||
|
||||
// Only supported with the new unwinder.
|
||||
virtual std::string GetFunctionName(uint64_t /*pc*/, uint64_t* /*offset*/) { return ""; }
|
||||
virtual std::shared_ptr<unwindstack::Memory> GetProcessMemory() { return nullptr; }
|
||||
|
||||
// The flags returned are the same flags as used by the mmap call.
|
||||
// The values are PROT_*.
|
||||
int GetFlags(uint64_t pc) {
|
||||
backtrace_map_t map;
|
||||
FillIn(pc, &map);
|
||||
if (IsValid(map)) {
|
||||
return map.flags;
|
||||
}
|
||||
return PROT_NONE;
|
||||
}
|
||||
|
||||
bool IsReadable(uint64_t pc) { return GetFlags(pc) & PROT_READ; }
|
||||
bool IsWritable(uint64_t pc) { return GetFlags(pc) & PROT_WRITE; }
|
||||
bool IsExecutable(uint64_t pc) { return GetFlags(pc) & PROT_EXEC; }
|
||||
|
||||
// In order to use the iterators on this object, a caller must
|
||||
// call the LockIterator and UnlockIterator function to guarantee
|
||||
// that the data does not change while it's being used.
|
||||
virtual void LockIterator() {}
|
||||
virtual void UnlockIterator() {}
|
||||
|
||||
size_t size() const { return maps_.size(); }
|
||||
|
||||
virtual bool Build();
|
||||
|
||||
static inline bool IsValid(const backtrace_map_t& map) {
|
||||
return map.end > 0;
|
||||
}
|
||||
|
||||
void SetSuffixesToIgnore(std::vector<std::string> suffixes) {
|
||||
suffixes_to_ignore_.insert(suffixes_to_ignore_.end(), suffixes.begin(), suffixes.end());
|
||||
}
|
||||
|
||||
const std::vector<std::string>& GetSuffixesToIgnore() { return suffixes_to_ignore_; }
|
||||
|
||||
// Disabling the resolving of names results in the function name being
|
||||
// set to an empty string and the function offset being set to zero
|
||||
// in the frame data when unwinding.
|
||||
void SetResolveNames(bool resolve) { resolve_names_ = resolve; }
|
||||
|
||||
bool ResolveNames() { return resolve_names_; }
|
||||
|
||||
protected:
|
||||
BacktraceMap(pid_t pid);
|
||||
|
||||
virtual uint64_t GetLoadBias(size_t /* index */) { return 0; }
|
||||
|
||||
pid_t pid_;
|
||||
std::deque<backtrace_map_t> maps_;
|
||||
std::vector<std::string> suffixes_to_ignore_;
|
||||
bool resolve_names_ = true;
|
||||
};
|
||||
|
||||
class ScopedBacktraceMapIteratorLock {
|
||||
public:
|
||||
explicit ScopedBacktraceMapIteratorLock(BacktraceMap* map) : map_(map) {
|
||||
map->LockIterator();
|
||||
}
|
||||
|
||||
~ScopedBacktraceMapIteratorLock() {
|
||||
map_->UnlockIterator();
|
||||
}
|
||||
|
||||
private:
|
||||
BacktraceMap* map_;
|
||||
};
|
||||
|
||||
#endif // _BACKTRACE_BACKTRACE_MAP_H
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _BACKTRACE_BACKTRACE_CONSTANTS_H
|
||||
#define _BACKTRACE_BACKTRACE_CONSTANTS_H
|
||||
|
||||
// When the pid to be traced is set to this value, then trace the current
|
||||
// process. If the tid value is not BACKTRACE_NO_TID, then the specified
|
||||
// thread from the current process will be traced.
|
||||
#define BACKTRACE_CURRENT_PROCESS (-1)
|
||||
// When the tid to be traced is set to this value, then trace the specified
|
||||
// current thread of the specified pid.
|
||||
#define BACKTRACE_CURRENT_THREAD (-1)
|
||||
|
||||
#define MAX_BACKTRACE_FRAMES 256
|
||||
|
||||
#endif // _BACKTRACE_BACKTRACE_CONSTANTS_H
|
||||
@@ -0,0 +1,44 @@
|
||||
/*
|
||||
* Copyright (C) 2009 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_CUTILS_COMPILER_H
|
||||
#define ANDROID_CUTILS_COMPILER_H
|
||||
|
||||
/*
|
||||
* helps the compiler's optimizer predicting branches
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), true ))
|
||||
# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), false ))
|
||||
#else
|
||||
# define CC_LIKELY( exp ) (__builtin_expect( !!(exp), 1 ))
|
||||
# define CC_UNLIKELY( exp ) (__builtin_expect( !!(exp), 0 ))
|
||||
#endif
|
||||
|
||||
/**
|
||||
* exports marked symbols
|
||||
*
|
||||
* if used on a C++ class declaration, this macro must be inserted
|
||||
* after the "class" keyword. For instance:
|
||||
*
|
||||
* template <typename TYPE>
|
||||
* class ANDROID_API Singleton { }
|
||||
*/
|
||||
|
||||
#define ANDROID_API __attribute__((visibility("default")))
|
||||
|
||||
#endif // ANDROID_CUTILS_COMPILER_H
|
||||
@@ -0,0 +1 @@
|
||||
#include <log/log.h>
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright (C) 2009 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef NATIVE_HANDLE_H_
|
||||
#define NATIVE_HANDLE_H_
|
||||
|
||||
#include <stdalign.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define NATIVE_HANDLE_MAX_FDS 1024
|
||||
#define NATIVE_HANDLE_MAX_INTS 1024
|
||||
|
||||
/* Declare a char array for use with native_handle_init */
|
||||
#define NATIVE_HANDLE_DECLARE_STORAGE(name, maxFds, maxInts) \
|
||||
alignas(native_handle_t) char (name)[ \
|
||||
sizeof(native_handle_t) + sizeof(int) * ((maxFds) + (maxInts))]
|
||||
|
||||
typedef struct native_handle
|
||||
{
|
||||
int version; /* sizeof(native_handle_t) */
|
||||
int numFds; /* number of file-descriptors at &data[0] */
|
||||
int numInts; /* number of ints at &data[numFds] */
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wzero-length-array"
|
||||
#endif
|
||||
int data[0]; /* numFds + numInts ints */
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
} native_handle_t;
|
||||
|
||||
typedef const native_handle_t* buffer_handle_t;
|
||||
|
||||
/*
|
||||
* native_handle_close
|
||||
*
|
||||
* closes the file descriptors contained in this native_handle_t
|
||||
*
|
||||
* return 0 on success, or a negative error code on failure
|
||||
*
|
||||
*/
|
||||
int native_handle_close(const native_handle_t* h);
|
||||
|
||||
/*
|
||||
* native_handle_init
|
||||
*
|
||||
* Initializes a native_handle_t from storage. storage must be declared with
|
||||
* NATIVE_HANDLE_DECLARE_STORAGE. numFds and numInts must not respectively
|
||||
* exceed maxFds and maxInts used to declare the storage.
|
||||
*/
|
||||
native_handle_t* native_handle_init(char* storage, int numFds, int numInts);
|
||||
|
||||
/*
|
||||
* native_handle_create
|
||||
*
|
||||
* creates a native_handle_t and initializes it. must be destroyed with
|
||||
* native_handle_delete(). Note that numFds must be <= NATIVE_HANDLE_MAX_FDS,
|
||||
* numInts must be <= NATIVE_HANDLE_MAX_INTS, and both must be >= 0.
|
||||
*
|
||||
*/
|
||||
native_handle_t* native_handle_create(int numFds, int numInts);
|
||||
|
||||
/*
|
||||
* native_handle_clone
|
||||
*
|
||||
* creates a native_handle_t and initializes it from another native_handle_t.
|
||||
* Must be destroyed with native_handle_delete().
|
||||
*
|
||||
*/
|
||||
native_handle_t* native_handle_clone(const native_handle_t* handle);
|
||||
|
||||
/*
|
||||
* native_handle_delete
|
||||
*
|
||||
* frees a native_handle_t allocated with native_handle_create().
|
||||
* This ONLY frees the memory allocated for the native_handle_t, but doesn't
|
||||
* close the file descriptors; which can be achieved with native_handle_close().
|
||||
*
|
||||
* return 0 on success, or a negative error code on failure
|
||||
*
|
||||
*/
|
||||
int native_handle_delete(native_handle_t* h);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* NATIVE_HANDLE_H_ */
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (C) 2006 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#if __has_include(<sys/system_properties.h>)
|
||||
#include <sys/system_properties.h>
|
||||
#else
|
||||
#define PROP_VALUE_MAX 92
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
//
|
||||
// Deprecated.
|
||||
//
|
||||
// See <android-base/properties.h> for better API.
|
||||
//
|
||||
|
||||
#define PROPERTY_KEY_MAX PROP_NAME_MAX
|
||||
#define PROPERTY_VALUE_MAX PROP_VALUE_MAX
|
||||
|
||||
/* property_get: returns the length of the value which will never be
|
||||
** greater than PROPERTY_VALUE_MAX - 1 and will always be zero terminated.
|
||||
** (the length does not include the terminating zero).
|
||||
**
|
||||
** If the property read fails or returns an empty value, the default
|
||||
** value is used (if nonnull).
|
||||
*/
|
||||
int property_get(const char* key, char* value, const char* default_value);
|
||||
|
||||
/* property_get_bool: returns the value of key coerced into a
|
||||
** boolean. If the property is not set, then the default value is returned.
|
||||
**
|
||||
* The following is considered to be true (1):
|
||||
** "1", "true", "y", "yes", "on"
|
||||
**
|
||||
** The following is considered to be false (0):
|
||||
** "0", "false", "n", "no", "off"
|
||||
**
|
||||
** The conversion is whitespace-sensitive (e.g. " off" will not be false).
|
||||
**
|
||||
** If no property with this key is set (or the key is NULL) or the boolean
|
||||
** conversion fails, the default value is returned.
|
||||
**/
|
||||
int8_t property_get_bool(const char *key, int8_t default_value);
|
||||
|
||||
/* property_get_int64: returns the value of key truncated and coerced into a
|
||||
** int64_t. If the property is not set, then the default value is used.
|
||||
**
|
||||
** The numeric conversion is identical to strtoimax with the base inferred:
|
||||
** - All digits up to the first non-digit characters are read
|
||||
** - The longest consecutive prefix of digits is converted to a long
|
||||
**
|
||||
** Valid strings of digits are:
|
||||
** - An optional sign character + or -
|
||||
** - An optional prefix indicating the base (otherwise base 10 is assumed)
|
||||
** -- 0 prefix is octal
|
||||
** -- 0x / 0X prefix is hex
|
||||
**
|
||||
** Leading/trailing whitespace is ignored. Overflow/underflow will cause
|
||||
** numeric conversion to fail.
|
||||
**
|
||||
** If no property with this key is set (or the key is NULL) or the numeric
|
||||
** conversion fails, the default value is returned.
|
||||
**/
|
||||
int64_t property_get_int64(const char *key, int64_t default_value);
|
||||
|
||||
/* property_get_int32: returns the value of key truncated and coerced into an
|
||||
** int32_t. If the property is not set, then the default value is used.
|
||||
**
|
||||
** The numeric conversion is identical to strtoimax with the base inferred:
|
||||
** - All digits up to the first non-digit characters are read
|
||||
** - The longest consecutive prefix of digits is converted to a long
|
||||
**
|
||||
** Valid strings of digits are:
|
||||
** - An optional sign character + or -
|
||||
** - An optional prefix indicating the base (otherwise base 10 is assumed)
|
||||
** -- 0 prefix is octal
|
||||
** -- 0x / 0X prefix is hex
|
||||
**
|
||||
** Leading/trailing whitespace is ignored. Overflow/underflow will cause
|
||||
** numeric conversion to fail.
|
||||
**
|
||||
** If no property with this key is set (or the key is NULL) or the numeric
|
||||
** conversion fails, the default value is returned.
|
||||
**/
|
||||
int32_t property_get_int32(const char *key, int32_t default_value);
|
||||
|
||||
/* property_set: returns 0 on success, < 0 on failure
|
||||
*/
|
||||
int property_set(const char *key, const char *value);
|
||||
|
||||
int property_list(void (*propfn)(const char *key, const char *value, void *cookie), void *cookie);
|
||||
|
||||
#if defined(__BIONIC_FORTIFY)
|
||||
#define __property_get_err_str "property_get() called with too small of a buffer"
|
||||
|
||||
#if defined(__clang__)
|
||||
|
||||
/* Some projects use -Weverything; diagnose_if is clang-specific. */
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgcc-compat"
|
||||
int property_get(const char* key, char* value, const char* default_value)
|
||||
__clang_error_if(__bos(value) != __BIONIC_FORTIFY_UNKNOWN_SIZE &&
|
||||
__bos(value) < PROPERTY_VALUE_MAX,
|
||||
__property_get_err_str);
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#else /* defined(__clang__) */
|
||||
|
||||
extern int __property_get_real(const char *, char *, const char *)
|
||||
__asm__(__USER_LABEL_PREFIX__ "property_get");
|
||||
__errordecl(__property_get_too_small_error, __property_get_err_str);
|
||||
|
||||
__BIONIC_FORTIFY_INLINE
|
||||
int property_get(const char *key, char *value, const char *default_value) {
|
||||
size_t bos = __bos(value);
|
||||
if (bos < PROPERTY_VALUE_MAX) {
|
||||
__property_get_too_small_error();
|
||||
}
|
||||
return __property_get_real(key, value, default_value);
|
||||
}
|
||||
|
||||
#endif /* defined(__clang__) */
|
||||
|
||||
#undef __property_get_err_str
|
||||
#endif /* defined(__BIONIC_FORTIFY) */
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,325 @@
|
||||
/*
|
||||
* Copyright (C) 2012 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef _LIBS_CUTILS_TRACE_H
|
||||
#define _LIBS_CUTILS_TRACE_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdatomic.h>
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <unistd.h>
|
||||
#include <cutils/compiler.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* The ATRACE_TAG macro can be defined before including this header to trace
|
||||
* using one of the tags defined below. It must be defined to one of the
|
||||
* following ATRACE_TAG_* macros. The trace tag is used to filter tracing in
|
||||
* userland to avoid some of the runtime cost of tracing when it is not desired.
|
||||
*
|
||||
* Defining ATRACE_TAG to be ATRACE_TAG_ALWAYS will result in the tracing always
|
||||
* being enabled - this should ONLY be done for debug code, as userland tracing
|
||||
* has a performance cost even when the trace is not being recorded. Defining
|
||||
* ATRACE_TAG to be ATRACE_TAG_NEVER or leaving ATRACE_TAG undefined will result
|
||||
* in the tracing always being disabled.
|
||||
*
|
||||
* ATRACE_TAG_HAL should be bitwise ORed with the relevant tags for tracing
|
||||
* within a hardware module. For example a camera hardware module would set:
|
||||
* #define ATRACE_TAG (ATRACE_TAG_CAMERA | ATRACE_TAG_HAL)
|
||||
*
|
||||
* Keep these in sync with frameworks/base/core/java/android/os/Trace.java.
|
||||
*/
|
||||
#define ATRACE_TAG_NEVER 0 // This tag is never enabled.
|
||||
#define ATRACE_TAG_ALWAYS (1<<0) // This tag is always enabled.
|
||||
#define ATRACE_TAG_GRAPHICS (1<<1)
|
||||
#define ATRACE_TAG_INPUT (1<<2)
|
||||
#define ATRACE_TAG_VIEW (1<<3)
|
||||
#define ATRACE_TAG_WEBVIEW (1<<4)
|
||||
#define ATRACE_TAG_WINDOW_MANAGER (1<<5)
|
||||
#define ATRACE_TAG_ACTIVITY_MANAGER (1<<6)
|
||||
#define ATRACE_TAG_SYNC_MANAGER (1<<7)
|
||||
#define ATRACE_TAG_AUDIO (1<<8)
|
||||
#define ATRACE_TAG_VIDEO (1<<9)
|
||||
#define ATRACE_TAG_CAMERA (1<<10)
|
||||
#define ATRACE_TAG_HAL (1<<11)
|
||||
#define ATRACE_TAG_APP (1<<12)
|
||||
#define ATRACE_TAG_RESOURCES (1<<13)
|
||||
#define ATRACE_TAG_DALVIK (1<<14)
|
||||
#define ATRACE_TAG_RS (1<<15)
|
||||
#define ATRACE_TAG_BIONIC (1<<16)
|
||||
#define ATRACE_TAG_POWER (1<<17)
|
||||
#define ATRACE_TAG_PACKAGE_MANAGER (1<<18)
|
||||
#define ATRACE_TAG_SYSTEM_SERVER (1<<19)
|
||||
#define ATRACE_TAG_DATABASE (1<<20)
|
||||
#define ATRACE_TAG_NETWORK (1<<21)
|
||||
#define ATRACE_TAG_ADB (1<<22)
|
||||
#define ATRACE_TAG_VIBRATOR (1<<23)
|
||||
#define ATRACE_TAG_AIDL (1<<24)
|
||||
#define ATRACE_TAG_NNAPI (1<<25)
|
||||
#define ATRACE_TAG_RRO (1<<26)
|
||||
#define ATRACE_TAG_THERMAL (1 << 27)
|
||||
#define ATRACE_TAG_LAST ATRACE_TAG_THERMAL
|
||||
|
||||
// Reserved for initialization.
|
||||
#define ATRACE_TAG_NOT_READY (1ULL<<63)
|
||||
|
||||
#define ATRACE_TAG_VALID_MASK ((ATRACE_TAG_LAST - 1) | ATRACE_TAG_LAST)
|
||||
|
||||
#ifndef ATRACE_TAG
|
||||
#define ATRACE_TAG ATRACE_TAG_NEVER
|
||||
#elif ATRACE_TAG > ATRACE_TAG_VALID_MASK
|
||||
#error ATRACE_TAG must be defined to be one of the tags defined in cutils/trace.h
|
||||
#endif
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_begin_body(const char*);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_end_body();
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_async_begin_body(const char*, int32_t);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_async_end_body(const char*, int32_t);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_async_for_track_begin_body(const char*, const char*, int32_t);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_async_for_track_end_body(const char*, int32_t);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_instant_body(const char*);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_instant_for_track_body(const char*, const char*);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_int_body(const char*, int32_t);
|
||||
|
||||
/** Internal implementation detail. Do not use. */
|
||||
void atrace_int64_body(const char*, int64_t);
|
||||
|
||||
/**
|
||||
* Opens the trace file for writing and reads the property for initial tags.
|
||||
* The atrace.tags.enableflags property sets the tags to trace.
|
||||
* This function should not be explicitly called, the first call to any normal
|
||||
* trace function will cause it to be run safely.
|
||||
*/
|
||||
void atrace_setup();
|
||||
|
||||
/**
|
||||
* If tracing is ready, set atrace_enabled_tags to the system property
|
||||
* debug.atrace.tags.enableflags. Can be used as a sysprop change callback.
|
||||
*/
|
||||
void atrace_update_tags();
|
||||
|
||||
/**
|
||||
* Set whether tracing is enabled for the current process. This is used to
|
||||
* prevent tracing within the Zygote process.
|
||||
*/
|
||||
void atrace_set_tracing_enabled(bool enabled);
|
||||
|
||||
/**
|
||||
* This is always set to false. This forces code that uses an old version
|
||||
* of this header to always call into atrace_setup, in which we call
|
||||
* atrace_init unconditionally.
|
||||
*/
|
||||
extern atomic_bool atrace_is_ready;
|
||||
|
||||
/**
|
||||
* Set of ATRACE_TAG flags to trace for, initialized to ATRACE_TAG_NOT_READY.
|
||||
* A value of zero indicates setup has failed.
|
||||
* Any other nonzero value indicates setup has succeeded, and tracing is on.
|
||||
*/
|
||||
extern uint64_t atrace_enabled_tags;
|
||||
|
||||
/**
|
||||
* Handle to the kernel's trace buffer, initialized to -1.
|
||||
* Any other value indicates setup has succeeded, and is a valid fd for tracing.
|
||||
*/
|
||||
extern int atrace_marker_fd;
|
||||
|
||||
/**
|
||||
* atrace_init readies the process for tracing by opening the trace_marker file.
|
||||
* Calling any trace function causes this to be run, so calling it is optional.
|
||||
* This can be explicitly run to avoid setup delay on first trace function.
|
||||
*/
|
||||
#define ATRACE_INIT() atrace_init()
|
||||
#define ATRACE_GET_ENABLED_TAGS() atrace_get_enabled_tags()
|
||||
|
||||
void atrace_init();
|
||||
uint64_t atrace_get_enabled_tags();
|
||||
|
||||
/**
|
||||
* Test if a given tag is currently enabled.
|
||||
* Returns nonzero if the tag is enabled, otherwise zero.
|
||||
* It can be used as a guard condition around more expensive trace calculations.
|
||||
*/
|
||||
#define ATRACE_ENABLED() atrace_is_tag_enabled(ATRACE_TAG)
|
||||
static inline uint64_t atrace_is_tag_enabled(uint64_t tag)
|
||||
{
|
||||
return atrace_get_enabled_tags() & tag;
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the beginning of a context. name is used to identify the context.
|
||||
* This is often used to time function execution.
|
||||
*/
|
||||
#define ATRACE_BEGIN(name) atrace_begin(ATRACE_TAG, name)
|
||||
static inline void atrace_begin(uint64_t tag, const char* name)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_begin_body(name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the end of a context.
|
||||
* This should match up (and occur after) a corresponding ATRACE_BEGIN.
|
||||
*/
|
||||
#define ATRACE_END() atrace_end(ATRACE_TAG)
|
||||
static inline void atrace_end(uint64_t tag)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_end_body();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the beginning of an asynchronous event. Unlike ATRACE_BEGIN/ATRACE_END
|
||||
* contexts, asynchronous events do not need to be nested. The name describes
|
||||
* the event, and the cookie provides a unique identifier for distinguishing
|
||||
* simultaneous events. The name and cookie used to begin an event must be
|
||||
* used to end it.
|
||||
*/
|
||||
#define ATRACE_ASYNC_BEGIN(name, cookie) \
|
||||
atrace_async_begin(ATRACE_TAG, name, cookie)
|
||||
static inline void atrace_async_begin(uint64_t tag, const char* name,
|
||||
int32_t cookie)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_async_begin_body(name, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the end of an asynchronous event.
|
||||
* This should have a corresponding ATRACE_ASYNC_BEGIN.
|
||||
*/
|
||||
#define ATRACE_ASYNC_END(name, cookie) atrace_async_end(ATRACE_TAG, name, cookie)
|
||||
static inline void atrace_async_end(uint64_t tag, const char* name, int32_t cookie)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_async_end_body(name, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the beginning of an asynchronous event. In addition to the name and a
|
||||
* cookie as in ATRACE_ASYNC_BEGIN/ATRACE_ASYNC_END, a track name argument is
|
||||
* provided, which is the name of the row where this async event should be
|
||||
* recorded. The track name, name, and cookie used to begin an event must be
|
||||
* used to end it.
|
||||
* The cookie here must be unique on the track_name level, not the name level.
|
||||
*/
|
||||
#define ATRACE_ASYNC_FOR_TRACK_BEGIN(track_name, name, cookie) \
|
||||
atrace_async_for_track_begin(ATRACE_TAG, track_name, name, cookie)
|
||||
static inline void atrace_async_for_track_begin(uint64_t tag, const char* track_name,
|
||||
const char* name, int32_t cookie) {
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_async_for_track_begin_body(track_name, name, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace the end of an asynchronous event.
|
||||
* This should correspond to a previous ATRACE_ASYNC_FOR_TRACK_BEGIN.
|
||||
*/
|
||||
#define ATRACE_ASYNC_FOR_TRACK_END(track_name, cookie) \
|
||||
atrace_async_for_track_end(ATRACE_TAG, track_name, cookie)
|
||||
static inline void atrace_async_for_track_end(uint64_t tag, const char* track_name,
|
||||
int32_t cookie) {
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_async_for_track_end_body(track_name, cookie);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace an instantaneous context. name is used to identify the context.
|
||||
*
|
||||
* An "instant" is an event with no defined duration. Visually is displayed like a single marker
|
||||
* in the timeline (rather than a span, in the case of begin/end events).
|
||||
*
|
||||
* By default, instant events are added into a dedicated track that has the same name of the event.
|
||||
* Use atrace_instant_for_track to put different instant events into the same timeline track/row.
|
||||
*/
|
||||
#define ATRACE_INSTANT(name) atrace_instant(ATRACE_TAG, name)
|
||||
static inline void atrace_instant(uint64_t tag, const char* name) {
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_instant_body(name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Trace an instantaneous context. name is used to identify the context.
|
||||
* track_name is the name of the row where the event should be recorded.
|
||||
*
|
||||
* An "instant" is an event with no defined duration. Visually is displayed like a single marker
|
||||
* in the timeline (rather than a span, in the case of begin/end events).
|
||||
*/
|
||||
#define ATRACE_INSTANT_FOR_TRACK(trackName, name) \
|
||||
atrace_instant_for_track(ATRACE_TAG, trackName, name)
|
||||
static inline void atrace_instant_for_track(uint64_t tag, const char* track_name,
|
||||
const char* name) {
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_instant_for_track_body(track_name, name);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces an integer counter value. name is used to identify the counter.
|
||||
* This can be used to track how a value changes over time.
|
||||
*/
|
||||
#define ATRACE_INT(name, value) atrace_int(ATRACE_TAG, name, value)
|
||||
static inline void atrace_int(uint64_t tag, const char* name, int32_t value)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_int_body(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Traces a 64-bit integer counter value. name is used to identify the
|
||||
* counter. This can be used to track how a value changes over time.
|
||||
*/
|
||||
#define ATRACE_INT64(name, value) atrace_int64(ATRACE_TAG, name, value)
|
||||
static inline void atrace_int64(uint64_t tag, const char* name, int64_t value)
|
||||
{
|
||||
if (CC_UNLIKELY(atrace_is_tag_enabled(tag))) {
|
||||
atrace_int64_body(name, value);
|
||||
}
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // _LIBS_CUTILS_TRACE_H
|
||||
@@ -0,0 +1,173 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_FB_INTERFACE_H
|
||||
#define ANDROID_FB_INTERFACE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define GRALLOC_HARDWARE_FB0 "fb0"
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
typedef struct framebuffer_device_t {
|
||||
/**
|
||||
* Common methods of the framebuffer device. This *must* be the first member of
|
||||
* framebuffer_device_t as users of this structure will cast a hw_device_t to
|
||||
* framebuffer_device_t pointer in contexts where it's known the hw_device_t references a
|
||||
* framebuffer_device_t.
|
||||
*/
|
||||
struct hw_device_t common;
|
||||
|
||||
/* flags describing some attributes of the framebuffer */
|
||||
const uint32_t flags;
|
||||
|
||||
/* dimensions of the framebuffer in pixels */
|
||||
const uint32_t width;
|
||||
const uint32_t height;
|
||||
|
||||
/* frambuffer stride in pixels */
|
||||
const int stride;
|
||||
|
||||
/* framebuffer pixel format */
|
||||
const int format;
|
||||
|
||||
/* resolution of the framebuffer's display panel in pixel per inch*/
|
||||
const float xdpi;
|
||||
const float ydpi;
|
||||
|
||||
/* framebuffer's display panel refresh rate in frames per second */
|
||||
const float fps;
|
||||
|
||||
/* min swap interval supported by this framebuffer */
|
||||
const int minSwapInterval;
|
||||
|
||||
/* max swap interval supported by this framebuffer */
|
||||
const int maxSwapInterval;
|
||||
|
||||
/* Number of framebuffers supported*/
|
||||
const int numFramebuffers;
|
||||
|
||||
int reserved[7];
|
||||
|
||||
/*
|
||||
* requests a specific swap-interval (same definition than EGL)
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*setSwapInterval)(struct framebuffer_device_t* window,
|
||||
int interval);
|
||||
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* It is non NULL If the framebuffer driver supports "update-on-demand"
|
||||
* and the given rectangle is the area of the screen that gets
|
||||
* updated during (*post)().
|
||||
*
|
||||
* This is useful on devices that are able to DMA only a portion of
|
||||
* the screen to the display panel, upon demand -- as opposed to
|
||||
* constantly refreshing the panel 60 times per second, for instance.
|
||||
*
|
||||
* Only the area defined by this rectangle is guaranteed to be valid, that
|
||||
* is, the driver is not allowed to post anything outside of this
|
||||
* rectangle.
|
||||
*
|
||||
* The rectangle evaluated during (*post)() and specifies which area
|
||||
* of the buffer passed in (*post)() shall to be posted.
|
||||
*
|
||||
* return -EINVAL if width or height <=0, or if left or top < 0
|
||||
*/
|
||||
int (*setUpdateRect)(struct framebuffer_device_t* window,
|
||||
int left, int top, int width, int height);
|
||||
|
||||
/*
|
||||
* Post <buffer> to the display (display it on the screen)
|
||||
* The buffer must have been allocated with the
|
||||
* GRALLOC_USAGE_HW_FB usage flag.
|
||||
* buffer must be the same width and height as the display and must NOT
|
||||
* be locked.
|
||||
*
|
||||
* The buffer is shown during the next VSYNC.
|
||||
*
|
||||
* If the same buffer is posted again (possibly after some other buffer),
|
||||
* post() will block until the the first post is completed.
|
||||
*
|
||||
* Internally, post() is expected to lock the buffer so that a
|
||||
* subsequent call to gralloc_module_t::(*lock)() with USAGE_RENDER or
|
||||
* USAGE_*_WRITE will block until it is safe; that is typically once this
|
||||
* buffer is shown and another buffer has been posted.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*post)(struct framebuffer_device_t* dev, buffer_handle_t buffer);
|
||||
|
||||
|
||||
/*
|
||||
* The (*compositionComplete)() method must be called after the
|
||||
* compositor has finished issuing GL commands for client buffers.
|
||||
*/
|
||||
|
||||
int (*compositionComplete)(struct framebuffer_device_t* dev);
|
||||
|
||||
/*
|
||||
* This hook is OPTIONAL.
|
||||
*
|
||||
* If non NULL it will be caused by SurfaceFlinger on dumpsys
|
||||
*/
|
||||
void (*dump)(struct framebuffer_device_t* dev, char *buff, int buff_len);
|
||||
|
||||
/*
|
||||
* (*enableScreen)() is used to either blank (enable=0) or
|
||||
* unblank (enable=1) the screen this framebuffer is attached to.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*enableScreen)(struct framebuffer_device_t* dev, int enable);
|
||||
|
||||
void* reserved_proc[6];
|
||||
|
||||
} framebuffer_device_t;
|
||||
|
||||
|
||||
/** convenience API for opening and closing a supported device */
|
||||
|
||||
static inline int framebuffer_open(const struct hw_module_t* module,
|
||||
struct framebuffer_device_t** device) {
|
||||
return module->methods->open(module,
|
||||
GRALLOC_HARDWARE_FB0, TO_HW_DEVICE_T_OPEN(device));
|
||||
}
|
||||
|
||||
static inline int framebuffer_close(struct framebuffer_device_t* device) {
|
||||
return device->common.close(&device->common);
|
||||
}
|
||||
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_FB_INTERFACE_H
|
||||
@@ -0,0 +1,448 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
|
||||
#ifndef ANDROID_GRALLOC_INTERFACE_H
|
||||
#define ANDROID_GRALLOC_INTERFACE_H
|
||||
|
||||
#include <system/graphics.h>
|
||||
#include <hardware/hardware.h>
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/fb.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* Module versioning information for the Gralloc hardware module, based on
|
||||
* gralloc_module_t.common.module_api_version.
|
||||
*
|
||||
* Version History:
|
||||
*
|
||||
* GRALLOC_MODULE_API_VERSION_0_1:
|
||||
* Initial Gralloc hardware module API.
|
||||
*
|
||||
* GRALLOC_MODULE_API_VERSION_0_2:
|
||||
* Add support for flexible YCbCr format with (*lock_ycbcr)() method.
|
||||
*
|
||||
* GRALLOC_MODULE_API_VERSION_0_3:
|
||||
* Add support for fence passing to/from lock/unlock.
|
||||
*/
|
||||
|
||||
#define GRALLOC_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
|
||||
#define GRALLOC_MODULE_API_VERSION_0_2 HARDWARE_MODULE_API_VERSION(0, 2)
|
||||
#define GRALLOC_MODULE_API_VERSION_0_3 HARDWARE_MODULE_API_VERSION(0, 3)
|
||||
|
||||
#define GRALLOC_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION(0, 1)
|
||||
|
||||
/**
|
||||
* The id of this module
|
||||
*/
|
||||
#define GRALLOC_HARDWARE_MODULE_ID "gralloc"
|
||||
|
||||
/**
|
||||
* Name of the graphics device to open
|
||||
*/
|
||||
|
||||
#define GRALLOC_HARDWARE_GPU0 "gpu0"
|
||||
|
||||
enum {
|
||||
/* buffer is never read in software */
|
||||
GRALLOC_USAGE_SW_READ_NEVER = 0x00000000U,
|
||||
/* buffer is rarely read in software */
|
||||
GRALLOC_USAGE_SW_READ_RARELY = 0x00000002U,
|
||||
/* buffer is often read in software */
|
||||
GRALLOC_USAGE_SW_READ_OFTEN = 0x00000003U,
|
||||
/* mask for the software read values */
|
||||
GRALLOC_USAGE_SW_READ_MASK = 0x0000000FU,
|
||||
|
||||
/* buffer is never written in software */
|
||||
GRALLOC_USAGE_SW_WRITE_NEVER = 0x00000000U,
|
||||
/* buffer is rarely written in software */
|
||||
GRALLOC_USAGE_SW_WRITE_RARELY = 0x00000020U,
|
||||
/* buffer is often written in software */
|
||||
GRALLOC_USAGE_SW_WRITE_OFTEN = 0x00000030U,
|
||||
/* mask for the software write values */
|
||||
GRALLOC_USAGE_SW_WRITE_MASK = 0x000000F0U,
|
||||
|
||||
/* buffer will be used as an OpenGL ES texture */
|
||||
GRALLOC_USAGE_HW_TEXTURE = 0x00000100U,
|
||||
/* buffer will be used as an OpenGL ES render target */
|
||||
GRALLOC_USAGE_HW_RENDER = 0x00000200U,
|
||||
/* buffer will be used by the 2D hardware blitter */
|
||||
GRALLOC_USAGE_HW_2D = 0x00000400U,
|
||||
/* buffer will be used by the HWComposer HAL module */
|
||||
GRALLOC_USAGE_HW_COMPOSER = 0x00000800U,
|
||||
/* buffer will be used with the framebuffer device */
|
||||
GRALLOC_USAGE_HW_FB = 0x00001000U,
|
||||
|
||||
/* buffer should be displayed full-screen on an external display when
|
||||
* possible */
|
||||
GRALLOC_USAGE_EXTERNAL_DISP = 0x00002000U,
|
||||
|
||||
/* Must have a hardware-protected path to external display sink for
|
||||
* this buffer. If a hardware-protected path is not available, then
|
||||
* either don't composite only this buffer (preferred) to the
|
||||
* external sink, or (less desirable) do not route the entire
|
||||
* composition to the external sink. */
|
||||
GRALLOC_USAGE_PROTECTED = 0x00004000U,
|
||||
|
||||
/* buffer may be used as a cursor */
|
||||
GRALLOC_USAGE_CURSOR = 0x00008000U,
|
||||
|
||||
/* buffer will be used with the HW video encoder */
|
||||
GRALLOC_USAGE_HW_VIDEO_ENCODER = 0x00010000U,
|
||||
/* buffer will be written by the HW camera pipeline */
|
||||
GRALLOC_USAGE_HW_CAMERA_WRITE = 0x00020000U,
|
||||
/* buffer will be read by the HW camera pipeline */
|
||||
GRALLOC_USAGE_HW_CAMERA_READ = 0x00040000U,
|
||||
/* buffer will be used as part of zero-shutter-lag queue */
|
||||
GRALLOC_USAGE_HW_CAMERA_ZSL = 0x00060000U,
|
||||
/* mask for the camera access values */
|
||||
GRALLOC_USAGE_HW_CAMERA_MASK = 0x00060000U,
|
||||
/* mask for the software usage bit-mask */
|
||||
GRALLOC_USAGE_HW_MASK = 0x00071F00U,
|
||||
|
||||
/* buffer will be used as a RenderScript Allocation */
|
||||
GRALLOC_USAGE_RENDERSCRIPT = 0x00100000U,
|
||||
|
||||
/* Set by the consumer to indicate to the producer that they may attach a
|
||||
* buffer that they did not detach from the BufferQueue. Will be filtered
|
||||
* out by GRALLOC_USAGE_ALLOC_MASK, so gralloc modules will not need to
|
||||
* handle this flag. */
|
||||
GRALLOC_USAGE_FOREIGN_BUFFERS = 0x00200000U,
|
||||
|
||||
/* buffer will be used as input to HW HEIC image encoder */
|
||||
GRALLOC_USAGE_HW_IMAGE_ENCODER = 0x08000000U,
|
||||
|
||||
/* Mask of all flags which could be passed to a gralloc module for buffer
|
||||
* allocation. Any flags not in this mask do not need to be handled by
|
||||
* gralloc modules. */
|
||||
GRALLOC_USAGE_ALLOC_MASK = ~(GRALLOC_USAGE_FOREIGN_BUFFERS),
|
||||
|
||||
/* implementation-specific private usage flags */
|
||||
GRALLOC_USAGE_PRIVATE_0 = 0x10000000U,
|
||||
GRALLOC_USAGE_PRIVATE_1 = 0x20000000U,
|
||||
GRALLOC_USAGE_PRIVATE_2 = 0x40000000U,
|
||||
GRALLOC_USAGE_PRIVATE_3 = 0x80000000U,
|
||||
GRALLOC_USAGE_PRIVATE_MASK = 0xF0000000U,
|
||||
};
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
|
||||
* and the fields of this data structure must begin with hw_module_t
|
||||
* followed by module specific information.
|
||||
*/
|
||||
typedef struct gralloc_module_t {
|
||||
struct hw_module_t common;
|
||||
|
||||
/*
|
||||
* (*registerBuffer)() must be called before a buffer_handle_t that has not
|
||||
* been created with (*alloc_device_t::alloc)() can be used.
|
||||
*
|
||||
* This is intended to be used with buffer_handle_t's that have been
|
||||
* received in this process through IPC.
|
||||
*
|
||||
* This function checks that the handle is indeed a valid one and prepares
|
||||
* it for use with (*lock)() and (*unlock)().
|
||||
*
|
||||
* It is not necessary to call (*registerBuffer)() on a handle created
|
||||
* with (*alloc_device_t::alloc)().
|
||||
*
|
||||
* returns an error if this buffer_handle_t is not valid.
|
||||
*/
|
||||
int (*registerBuffer)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle);
|
||||
|
||||
/*
|
||||
* (*unregisterBuffer)() is called once this handle is no longer needed in
|
||||
* this process. After this call, it is an error to call (*lock)(),
|
||||
* (*unlock)(), or (*registerBuffer)().
|
||||
*
|
||||
* This function doesn't close or free the handle itself; this is done
|
||||
* by other means, usually through libcutils's native_handle_close() and
|
||||
* native_handle_free().
|
||||
*
|
||||
* It is an error to call (*unregisterBuffer)() on a buffer that wasn't
|
||||
* explicitly registered first.
|
||||
*/
|
||||
int (*unregisterBuffer)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle);
|
||||
|
||||
/*
|
||||
* The (*lock)() method is called before a buffer is accessed for the
|
||||
* specified usage. This call may block, for instance if the h/w needs
|
||||
* to finish rendering or if CPU caches need to be synchronized.
|
||||
*
|
||||
* The caller promises to modify only pixels in the area specified
|
||||
* by (l,t,w,h).
|
||||
*
|
||||
* The content of the buffer outside of the specified area is NOT modified
|
||||
* by this call.
|
||||
*
|
||||
* If usage specifies GRALLOC_USAGE_SW_*, vaddr is filled with the address
|
||||
* of the buffer in virtual memory.
|
||||
*
|
||||
* Note calling (*lock)() on HAL_PIXEL_FORMAT_YCbCr_*_888 buffers will fail
|
||||
* and return -EINVAL. These buffers must be locked with (*lock_ycbcr)()
|
||||
* instead.
|
||||
*
|
||||
* THREADING CONSIDERATIONS:
|
||||
*
|
||||
* It is legal for several different threads to lock a buffer from
|
||||
* read access, none of the threads are blocked.
|
||||
*
|
||||
* However, locking a buffer simultaneously for write or read/write is
|
||||
* undefined, but:
|
||||
* - shall not result in termination of the process
|
||||
* - shall not block the caller
|
||||
* It is acceptable to return an error or to leave the buffer's content
|
||||
* into an indeterminate state.
|
||||
*
|
||||
* If the buffer was created with a usage mask incompatible with the
|
||||
* requested usage flags here, -EINVAL is returned.
|
||||
*
|
||||
*/
|
||||
|
||||
int (*lock)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int usage,
|
||||
int l, int t, int w, int h,
|
||||
void** vaddr);
|
||||
|
||||
|
||||
/*
|
||||
* The (*unlock)() method must be called after all changes to the buffer
|
||||
* are completed.
|
||||
*/
|
||||
|
||||
int (*unlock)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle);
|
||||
|
||||
|
||||
/* reserved for future use */
|
||||
int (*perform)(struct gralloc_module_t const* module,
|
||||
int operation, ... );
|
||||
|
||||
/*
|
||||
* The (*lock_ycbcr)() method is like the (*lock)() method, with the
|
||||
* difference that it fills a struct ycbcr with a description of the buffer
|
||||
* layout, and zeroes out the reserved fields.
|
||||
*
|
||||
* If the buffer format is not compatible with a flexible YUV format (e.g.
|
||||
* the buffer layout cannot be represented with the ycbcr struct), it
|
||||
* will return -EINVAL.
|
||||
*
|
||||
* This method must work on buffers with HAL_PIXEL_FORMAT_YCbCr_*_888
|
||||
* if supported by the device, as well as with any other format that is
|
||||
* requested by the multimedia codecs when they are configured with a
|
||||
* flexible-YUV-compatible color-format with android native buffers.
|
||||
*
|
||||
* Note that this method may also be called on buffers of other formats,
|
||||
* including non-YUV formats.
|
||||
*
|
||||
* Added in GRALLOC_MODULE_API_VERSION_0_2.
|
||||
*/
|
||||
|
||||
int (*lock_ycbcr)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int usage,
|
||||
int l, int t, int w, int h,
|
||||
struct android_ycbcr *ycbcr);
|
||||
|
||||
/*
|
||||
* The (*lockAsync)() method is like the (*lock)() method except
|
||||
* that the buffer's sync fence object is passed into the lock
|
||||
* call instead of requiring the caller to wait for completion.
|
||||
*
|
||||
* The gralloc implementation takes ownership of the fenceFd and
|
||||
* is responsible for closing it when no longer needed.
|
||||
*
|
||||
* Added in GRALLOC_MODULE_API_VERSION_0_3.
|
||||
*/
|
||||
int (*lockAsync)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int usage,
|
||||
int l, int t, int w, int h,
|
||||
void** vaddr, int fenceFd);
|
||||
|
||||
/*
|
||||
* The (*unlockAsync)() method is like the (*unlock)() method
|
||||
* except that a buffer sync fence object is returned from the
|
||||
* lock call, representing the completion of any pending work
|
||||
* performed by the gralloc implementation.
|
||||
*
|
||||
* The caller takes ownership of the fenceFd and is responsible
|
||||
* for closing it when no longer needed.
|
||||
*
|
||||
* Added in GRALLOC_MODULE_API_VERSION_0_3.
|
||||
*/
|
||||
int (*unlockAsync)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int* fenceFd);
|
||||
|
||||
/*
|
||||
* The (*lockAsync_ycbcr)() method is like the (*lock_ycbcr)()
|
||||
* method except that the buffer's sync fence object is passed
|
||||
* into the lock call instead of requiring the caller to wait for
|
||||
* completion.
|
||||
*
|
||||
* The gralloc implementation takes ownership of the fenceFd and
|
||||
* is responsible for closing it when no longer needed.
|
||||
*
|
||||
* Added in GRALLOC_MODULE_API_VERSION_0_3.
|
||||
*/
|
||||
int (*lockAsync_ycbcr)(struct gralloc_module_t const* module,
|
||||
buffer_handle_t handle, int usage,
|
||||
int l, int t, int w, int h,
|
||||
struct android_ycbcr *ycbcr, int fenceFd);
|
||||
|
||||
/* getTransportSize(..., outNumFds, outNumInts)
|
||||
* This function is mandatory on devices running IMapper2.1 or higher.
|
||||
*
|
||||
* Get the transport size of a buffer. An imported buffer handle is a raw
|
||||
* buffer handle with the process-local runtime data appended. This
|
||||
* function, for example, allows a caller to omit the process-local
|
||||
* runtime data at the tail when serializing the imported buffer handle.
|
||||
*
|
||||
* Note that a client might or might not omit the process-local runtime
|
||||
* data when sending an imported buffer handle. The mapper must support
|
||||
* both cases on the receiving end.
|
||||
*/
|
||||
int32_t (*getTransportSize)(
|
||||
struct gralloc_module_t const* module, buffer_handle_t handle, uint32_t *outNumFds,
|
||||
uint32_t *outNumInts);
|
||||
|
||||
/* validateBufferSize(..., w, h, format, usage, stride)
|
||||
* This function is mandatory on devices running IMapper2.1 or higher.
|
||||
*
|
||||
* Validate that the buffer can be safely accessed by a caller who assumes
|
||||
* the specified width, height, format, usage, and stride. This must at least validate
|
||||
* that the buffer size is large enough. Validating the buffer against
|
||||
* individual buffer attributes is optional.
|
||||
*/
|
||||
int32_t (*validateBufferSize)(
|
||||
struct gralloc_module_t const* device, buffer_handle_t handle,
|
||||
uint32_t w, uint32_t h, int32_t format, int usage,
|
||||
uint32_t stride);
|
||||
|
||||
/* reserved for future use */
|
||||
void* reserved_proc[1];
|
||||
|
||||
} gralloc_module_t;
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/**
|
||||
* Every device data structure must begin with hw_device_t
|
||||
* followed by module specific public methods and attributes.
|
||||
*/
|
||||
|
||||
typedef struct alloc_device_t {
|
||||
struct hw_device_t common;
|
||||
|
||||
/*
|
||||
* (*alloc)() Allocates a buffer in graphic memory with the requested
|
||||
* parameters and returns a buffer_handle_t and the stride in pixels to
|
||||
* allow the implementation to satisfy hardware constraints on the width
|
||||
* of a pixmap (eg: it may have to be multiple of 8 pixels).
|
||||
* The CALLER TAKES OWNERSHIP of the buffer_handle_t.
|
||||
*
|
||||
* If format is HAL_PIXEL_FORMAT_YCbCr_420_888, the returned stride must be
|
||||
* 0, since the actual strides are available from the android_ycbcr
|
||||
* structure.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
|
||||
int (*alloc)(struct alloc_device_t* dev,
|
||||
int w, int h, int format, int usage,
|
||||
buffer_handle_t* handle, int* stride);
|
||||
|
||||
/*
|
||||
* (*free)() Frees a previously allocated buffer.
|
||||
* Behavior is undefined if the buffer is still mapped in any process,
|
||||
* but shall not result in termination of the program or security breaches
|
||||
* (allowing a process to get access to another process' buffers).
|
||||
* THIS FUNCTION TAKES OWNERSHIP of the buffer_handle_t which becomes
|
||||
* invalid after the call.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*free)(struct alloc_device_t* dev,
|
||||
buffer_handle_t handle);
|
||||
|
||||
/* This hook is OPTIONAL.
|
||||
*
|
||||
* If non NULL it will be caused by SurfaceFlinger on dumpsys
|
||||
*/
|
||||
void (*dump)(struct alloc_device_t *dev, char *buff, int buff_len);
|
||||
|
||||
void* reserved_proc[7];
|
||||
} alloc_device_t;
|
||||
|
||||
|
||||
/** convenience API for opening and closing a supported device */
|
||||
|
||||
static inline int gralloc_open(const struct hw_module_t* module,
|
||||
struct alloc_device_t** device) {
|
||||
return module->methods->open(module,
|
||||
GRALLOC_HARDWARE_GPU0, TO_HW_DEVICE_T_OPEN(device));
|
||||
}
|
||||
|
||||
static inline int gralloc_close(struct alloc_device_t* device) {
|
||||
return device->common.close(&device->common);
|
||||
}
|
||||
|
||||
/**
|
||||
* map_usage_to_memtrack should be called after allocating a gralloc buffer.
|
||||
*
|
||||
* @param usage - it is the flag used when alloc function is called.
|
||||
*
|
||||
* This function maps the gralloc usage flags to appropriate memtrack bucket.
|
||||
* GrallocHAL implementers and users should make an additional ION_IOCTL_TAG
|
||||
* call using the memtrack tag returned by this function. This will help the
|
||||
* in-kernel memtack to categorize the memory allocated by different processes
|
||||
* according to their usage.
|
||||
*
|
||||
*/
|
||||
static inline const char* map_usage_to_memtrack(uint32_t usage) {
|
||||
usage &= GRALLOC_USAGE_ALLOC_MASK;
|
||||
|
||||
if ((usage & GRALLOC_USAGE_HW_CAMERA_WRITE) != 0) {
|
||||
return "camera";
|
||||
} else if ((usage & GRALLOC_USAGE_HW_VIDEO_ENCODER) != 0 ||
|
||||
(usage & GRALLOC_USAGE_EXTERNAL_DISP) != 0) {
|
||||
return "video";
|
||||
} else if ((usage & GRALLOC_USAGE_HW_RENDER) != 0 ||
|
||||
(usage & GRALLOC_USAGE_HW_TEXTURE) != 0) {
|
||||
return "gl";
|
||||
} else if ((usage & GRALLOC_USAGE_HW_CAMERA_READ) != 0) {
|
||||
return "camera";
|
||||
} else if ((usage & GRALLOC_USAGE_SW_READ_MASK) != 0 ||
|
||||
(usage & GRALLOC_USAGE_SW_WRITE_MASK) != 0) {
|
||||
return "cpu";
|
||||
}
|
||||
return "graphics";
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_GRALLOC_INTERFACE_H
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,244 @@
|
||||
/*
|
||||
* Copyright (C) 2008 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_INCLUDE_HARDWARE_HARDWARE_H
|
||||
#define ANDROID_INCLUDE_HARDWARE_HARDWARE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
#include <system/graphics.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Value for the hw_module_t.tag field
|
||||
*/
|
||||
|
||||
#define MAKE_TAG_CONSTANT(A,B,C,D) (((A) << 24) | ((B) << 16) | ((C) << 8) | (D))
|
||||
|
||||
#define HARDWARE_MODULE_TAG MAKE_TAG_CONSTANT('H', 'W', 'M', 'T')
|
||||
#define HARDWARE_DEVICE_TAG MAKE_TAG_CONSTANT('H', 'W', 'D', 'T')
|
||||
|
||||
#define HARDWARE_MAKE_API_VERSION(maj,min) \
|
||||
((((maj) & 0xff) << 8) | ((min) & 0xff))
|
||||
|
||||
#define HARDWARE_MAKE_API_VERSION_2(maj,min,hdr) \
|
||||
((((maj) & 0xff) << 24) | (((min) & 0xff) << 16) | ((hdr) & 0xffff))
|
||||
#define HARDWARE_API_VERSION_2_MAJ_MIN_MASK 0xffff0000
|
||||
#define HARDWARE_API_VERSION_2_HEADER_MASK 0x0000ffff
|
||||
|
||||
|
||||
/*
|
||||
* The current HAL API version.
|
||||
*
|
||||
* All module implementations must set the hw_module_t.hal_api_version field
|
||||
* to this value when declaring the module with HAL_MODULE_INFO_SYM.
|
||||
*
|
||||
* Note that previous implementations have always set this field to 0.
|
||||
* Therefore, libhardware HAL API will always consider versions 0.0 and 1.0
|
||||
* to be 100% binary compatible.
|
||||
*
|
||||
*/
|
||||
#define HARDWARE_HAL_API_VERSION HARDWARE_MAKE_API_VERSION(1, 0)
|
||||
|
||||
/*
|
||||
* Helper macros for module implementors.
|
||||
*
|
||||
* The derived modules should provide convenience macros for supported
|
||||
* versions so that implementations can explicitly specify module/device
|
||||
* versions at definition time.
|
||||
*
|
||||
* Use this macro to set the hw_module_t.module_api_version field.
|
||||
*/
|
||||
#define HARDWARE_MODULE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
|
||||
#define HARDWARE_MODULE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
|
||||
|
||||
/*
|
||||
* Use this macro to set the hw_device_t.version field
|
||||
*/
|
||||
#define HARDWARE_DEVICE_API_VERSION(maj,min) HARDWARE_MAKE_API_VERSION(maj,min)
|
||||
#define HARDWARE_DEVICE_API_VERSION_2(maj,min,hdr) HARDWARE_MAKE_API_VERSION_2(maj,min,hdr)
|
||||
|
||||
struct hw_module_t;
|
||||
struct hw_module_methods_t;
|
||||
struct hw_device_t;
|
||||
|
||||
/**
|
||||
* Every hardware module must have a data structure named HAL_MODULE_INFO_SYM
|
||||
* and the fields of this data structure must begin with hw_module_t
|
||||
* followed by module specific information.
|
||||
*/
|
||||
typedef struct hw_module_t {
|
||||
/** tag must be initialized to HARDWARE_MODULE_TAG */
|
||||
uint32_t tag;
|
||||
|
||||
/**
|
||||
* The API version of the implemented module. The module owner is
|
||||
* responsible for updating the version when a module interface has
|
||||
* changed.
|
||||
*
|
||||
* The derived modules such as gralloc and audio own and manage this field.
|
||||
* The module user must interpret the version field to decide whether or
|
||||
* not to inter-operate with the supplied module implementation.
|
||||
* For example, SurfaceFlinger is responsible for making sure that
|
||||
* it knows how to manage different versions of the gralloc-module API,
|
||||
* and AudioFlinger must know how to do the same for audio-module API.
|
||||
*
|
||||
* The module API version should include a major and a minor component.
|
||||
* For example, version 1.0 could be represented as 0x0100. This format
|
||||
* implies that versions 0x0100-0x01ff are all API-compatible.
|
||||
*
|
||||
* In the future, libhardware will expose a hw_get_module_version()
|
||||
* (or equivalent) function that will take minimum/maximum supported
|
||||
* versions as arguments and would be able to reject modules with
|
||||
* versions outside of the supplied range.
|
||||
*/
|
||||
uint16_t module_api_version;
|
||||
#define version_major module_api_version
|
||||
/**
|
||||
* version_major/version_minor defines are supplied here for temporary
|
||||
* source code compatibility. They will be removed in the next version.
|
||||
* ALL clients must convert to the new version format.
|
||||
*/
|
||||
|
||||
/**
|
||||
* The API version of the HAL module interface. This is meant to
|
||||
* version the hw_module_t, hw_module_methods_t, and hw_device_t
|
||||
* structures and definitions.
|
||||
*
|
||||
* The HAL interface owns this field. Module users/implementations
|
||||
* must NOT rely on this value for version information.
|
||||
*
|
||||
* Presently, 0 is the only valid value.
|
||||
*/
|
||||
uint16_t hal_api_version;
|
||||
#define version_minor hal_api_version
|
||||
|
||||
/** Identifier of module */
|
||||
const char *id;
|
||||
|
||||
/** Name of this module */
|
||||
const char *name;
|
||||
|
||||
/** Author/owner/implementor of the module */
|
||||
const char *author;
|
||||
|
||||
/** Modules methods */
|
||||
struct hw_module_methods_t* methods;
|
||||
|
||||
/** module's dso */
|
||||
void* dso;
|
||||
|
||||
#ifdef __LP64__
|
||||
uint64_t reserved[32-7];
|
||||
#else
|
||||
/** padding to 128 bytes, reserved for future use */
|
||||
uint32_t reserved[32-7];
|
||||
#endif
|
||||
|
||||
} hw_module_t;
|
||||
|
||||
typedef struct hw_module_methods_t {
|
||||
/** Open a specific device */
|
||||
int (*open)(const struct hw_module_t* module, const char* id,
|
||||
struct hw_device_t** device);
|
||||
|
||||
} hw_module_methods_t;
|
||||
|
||||
/**
|
||||
* Every device data structure must begin with hw_device_t
|
||||
* followed by module specific public methods and attributes.
|
||||
*/
|
||||
typedef struct hw_device_t {
|
||||
/** tag must be initialized to HARDWARE_DEVICE_TAG */
|
||||
uint32_t tag;
|
||||
|
||||
/**
|
||||
* Version of the module-specific device API. This value is used by
|
||||
* the derived-module user to manage different device implementations.
|
||||
*
|
||||
* The module user is responsible for checking the module_api_version
|
||||
* and device version fields to ensure that the user is capable of
|
||||
* communicating with the specific module implementation.
|
||||
*
|
||||
* One module can support multiple devices with different versions. This
|
||||
* can be useful when a device interface changes in an incompatible way
|
||||
* but it is still necessary to support older implementations at the same
|
||||
* time. One such example is the Camera 2.0 API.
|
||||
*
|
||||
* This field is interpreted by the module user and is ignored by the
|
||||
* HAL interface itself.
|
||||
*/
|
||||
uint32_t version;
|
||||
|
||||
/** reference to the module this device belongs to */
|
||||
struct hw_module_t* module;
|
||||
|
||||
/** padding reserved for future use */
|
||||
#ifdef __LP64__
|
||||
uint64_t reserved[12];
|
||||
#else
|
||||
uint32_t reserved[12];
|
||||
#endif
|
||||
|
||||
/** Close this device */
|
||||
int (*close)(struct hw_device_t* device);
|
||||
|
||||
} hw_device_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define TO_HW_DEVICE_T_OPEN(x) reinterpret_cast<struct hw_device_t**>(x)
|
||||
#else
|
||||
#define TO_HW_DEVICE_T_OPEN(x) (struct hw_device_t**)(x)
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Name of the hal_module_info
|
||||
*/
|
||||
#define HAL_MODULE_INFO_SYM HMI
|
||||
|
||||
/**
|
||||
* Name of the hal_module_info as a string
|
||||
*/
|
||||
#define HAL_MODULE_INFO_SYM_AS_STR "HMI"
|
||||
|
||||
/**
|
||||
* Get the module info associated with a module by id.
|
||||
*
|
||||
* @return: 0 == success, <0 == error and *module == NULL
|
||||
*/
|
||||
int hw_get_module(const char *id, const struct hw_module_t **module);
|
||||
|
||||
/**
|
||||
* Get the module info associated with a module instance by class 'class_id'
|
||||
* and instance 'inst'.
|
||||
*
|
||||
* Some modules types necessitate multiple instances. For example audio supports
|
||||
* multiple concurrent interfaces and thus 'audio' is the module class
|
||||
* and 'primary' or 'a2dp' are module interfaces. This implies that the files
|
||||
* providing these modules would be named audio.primary.<variant>.so and
|
||||
* audio.a2dp.<variant>.so
|
||||
*
|
||||
* @return: 0 == success, <0 == error and *module == NULL
|
||||
*/
|
||||
int hw_get_module_by_class(const char *class_id, const char *inst,
|
||||
const struct hw_module_t **module);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_INCLUDE_HARDWARE_HARDWARE_H */
|
||||
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
* Copyright 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_HWVULKAN_H
|
||||
#define ANDROID_HWVULKAN_H
|
||||
|
||||
#include <hardware/hardware.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define HWVULKAN_HARDWARE_MODULE_ID "vulkan"
|
||||
|
||||
#define HWVULKAN_MODULE_API_VERSION_0_1 HARDWARE_MODULE_API_VERSION(0, 1)
|
||||
#define HWVULKAN_DEVICE_API_VERSION_0_1 HARDWARE_DEVICE_API_VERSION_2(0, 1, 0)
|
||||
|
||||
#define HWVULKAN_DEVICE_0 "vk0"
|
||||
|
||||
typedef struct hwvulkan_module_t {
|
||||
struct hw_module_t common;
|
||||
} hwvulkan_module_t;
|
||||
|
||||
/* Dispatchable Vulkan object handles must be pointers, which must point to
|
||||
* instances of hwvulkan_dispatch_t (potentially followed by additional
|
||||
* implementation-defined data). On return from the creation function, the
|
||||
* 'magic' field must contain HWVULKAN_DISPATCH_MAGIC; the loader will overwrite
|
||||
* the 'vtbl' field.
|
||||
*
|
||||
* NOTE: The magic value and the layout of hwvulkan_dispatch_t match the LunarG
|
||||
* loader used on platforms, to avoid pointless annoying differences for
|
||||
* multi-platform drivers. Don't change them without a good reason. If there is
|
||||
* an opportunity to change it, using a magic value that doesn't leave the
|
||||
* upper 32-bits zero on 64-bit platforms would be nice.
|
||||
*/
|
||||
#define HWVULKAN_DISPATCH_MAGIC 0x01CDC0DE
|
||||
typedef union {
|
||||
uintptr_t magic;
|
||||
const void* vtbl;
|
||||
} hwvulkan_dispatch_t;
|
||||
|
||||
/* A hwvulkan_device_t corresponds to an ICD on other systems. Currently there
|
||||
* can only be one on a system (HWVULKAN_DEVICE_0). It is opened once per
|
||||
* process when the Vulkan API is first used; the hw_device_t::close() function
|
||||
* is never called. Any non-trivial resource allocation should be done when
|
||||
* the VkInstance is created rather than when the hwvulkan_device_t is opened.
|
||||
*/
|
||||
typedef struct hwvulkan_device_t {
|
||||
struct hw_device_t common;
|
||||
|
||||
PFN_vkEnumerateInstanceExtensionProperties
|
||||
EnumerateInstanceExtensionProperties;
|
||||
PFN_vkCreateInstance CreateInstance;
|
||||
PFN_vkGetInstanceProcAddr GetInstanceProcAddr;
|
||||
} hwvulkan_device_t;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif // ANDROID_HWVULKAN_H
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2007 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stddef.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define EVENT_TAG_MAP_FILE "/system/etc/event-log-tags"
|
||||
|
||||
struct EventTagMap;
|
||||
typedef struct EventTagMap EventTagMap;
|
||||
|
||||
/*
|
||||
* Open the specified file as an event log tag map.
|
||||
*
|
||||
* Returns NULL on failure.
|
||||
*/
|
||||
EventTagMap* android_openEventTagMap(const char* fileName);
|
||||
|
||||
/*
|
||||
* Close the map.
|
||||
*/
|
||||
void android_closeEventTagMap(EventTagMap* map);
|
||||
|
||||
/*
|
||||
* Look up a tag by index. Returns the tag string & string length, or NULL if
|
||||
* not found. Returned string is not guaranteed to be nul terminated.
|
||||
*/
|
||||
const char* android_lookupEventTag_len(const EventTagMap* map, size_t* len,
|
||||
unsigned int tag);
|
||||
|
||||
/*
|
||||
* Look up a format by index. Returns the format string & string length,
|
||||
* or NULL if not found. Returned string is not guaranteed to be nul terminated.
|
||||
*/
|
||||
const char* android_lookupEventFormat_len(const EventTagMap* map, size_t* len,
|
||||
unsigned int tag);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,151 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
/* Too many in the ecosystem assume these are included */
|
||||
#if !defined(_WIN32)
|
||||
#include <pthread.h>
|
||||
#endif
|
||||
#include <stdint.h> /* uint16_t, int32_t */
|
||||
#include <stdio.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
#include <android/log.h>
|
||||
#include <log/log_id.h>
|
||||
#include <log/log_main.h>
|
||||
#include <log/log_radio.h>
|
||||
#include <log/log_safetynet.h>
|
||||
#include <log/log_system.h>
|
||||
#include <log/log_time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* LOG_TAG is the local tag used for the following simplified
|
||||
* logging macros. You can change this preprocessor definition
|
||||
* before using the other macros to change the tag.
|
||||
*/
|
||||
|
||||
#ifndef LOG_TAG
|
||||
#define LOG_TAG NULL
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Normally we strip the effects of ALOGV (VERBOSE messages),
|
||||
* LOG_FATAL and LOG_FATAL_IF (FATAL assert messages) from the
|
||||
* release builds be defining NDEBUG. You can modify this (for
|
||||
* example with "#define LOG_NDEBUG 0" at the top of your source
|
||||
* file) to change that behavior.
|
||||
*/
|
||||
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* The maximum size of the log entry payload that can be
|
||||
* written to the logger. An attempt to write more than
|
||||
* this amount will result in a truncated log entry.
|
||||
*/
|
||||
#define LOGGER_ENTRY_MAX_PAYLOAD 4068
|
||||
|
||||
/*
|
||||
* Event logging.
|
||||
*/
|
||||
|
||||
/*
|
||||
* The following should not be used directly.
|
||||
*/
|
||||
|
||||
int __android_log_bwrite(int32_t tag, const void* payload, size_t len);
|
||||
int __android_log_btwrite(int32_t tag, char type, const void* payload,
|
||||
size_t len);
|
||||
int __android_log_bswrite(int32_t tag, const char* payload);
|
||||
|
||||
int __android_log_stats_bwrite(int32_t tag, const void* payload, size_t len);
|
||||
|
||||
#define android_bWriteLog(tag, payload, len) \
|
||||
__android_log_bwrite(tag, payload, len)
|
||||
#define android_btWriteLog(tag, type, payload, len) \
|
||||
__android_log_btwrite(tag, type, payload, len)
|
||||
|
||||
/*
|
||||
* Event log entry types.
|
||||
*/
|
||||
typedef enum {
|
||||
/* Special markers for android_log_list_element type */
|
||||
EVENT_TYPE_LIST_STOP = '\n', /* declare end of list */
|
||||
EVENT_TYPE_UNKNOWN = '?', /* protocol error */
|
||||
|
||||
/* must match with declaration in java/android/android/util/EventLog.java */
|
||||
EVENT_TYPE_INT = 0, /* int32_t */
|
||||
EVENT_TYPE_LONG = 1, /* int64_t */
|
||||
EVENT_TYPE_STRING = 2,
|
||||
EVENT_TYPE_LIST = 3,
|
||||
EVENT_TYPE_FLOAT = 4,
|
||||
} AndroidEventLogType;
|
||||
|
||||
#ifndef LOG_EVENT_INT
|
||||
#define LOG_EVENT_INT(_tag, _value) \
|
||||
{ \
|
||||
int intBuf = _value; \
|
||||
(void)android_btWriteLog(_tag, EVENT_TYPE_INT, &intBuf, sizeof(intBuf)); \
|
||||
}
|
||||
#endif
|
||||
#ifndef LOG_EVENT_LONG
|
||||
#define LOG_EVENT_LONG(_tag, _value) \
|
||||
{ \
|
||||
long long longBuf = _value; \
|
||||
(void)android_btWriteLog(_tag, EVENT_TYPE_LONG, &longBuf, sizeof(longBuf)); \
|
||||
}
|
||||
#endif
|
||||
#ifndef LOG_EVENT_FLOAT
|
||||
#define LOG_EVENT_FLOAT(_tag, _value) \
|
||||
{ \
|
||||
float floatBuf = _value; \
|
||||
(void)android_btWriteLog(_tag, EVENT_TYPE_FLOAT, &floatBuf, \
|
||||
sizeof(floatBuf)); \
|
||||
}
|
||||
#endif
|
||||
#ifndef LOG_EVENT_STRING
|
||||
#define LOG_EVENT_STRING(_tag, _value) \
|
||||
(void)__android_log_bswrite(_tag, _value);
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Release any logger resources (a new log write will immediately re-acquire)
|
||||
*
|
||||
* This is specifically meant to be used by Zygote to close open file descriptors after fork()
|
||||
* and before specialization. O_CLOEXEC is used on file descriptors, so they will be closed upon
|
||||
* exec() in normal use cases.
|
||||
*
|
||||
* Note that this is not safe to call from a multi-threaded program.
|
||||
*/
|
||||
void __android_log_close(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,278 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2016 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <errno.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
#include <string>
|
||||
#endif
|
||||
|
||||
#include <log/log.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* For manipulating lists of events. */
|
||||
|
||||
#define ANDROID_MAX_LIST_NEST_DEPTH 8
|
||||
|
||||
/*
|
||||
* The opaque context used to manipulate lists of events.
|
||||
*/
|
||||
typedef struct android_log_context_internal* android_log_context;
|
||||
|
||||
/*
|
||||
* Elements returned when reading a list of events.
|
||||
*/
|
||||
typedef struct {
|
||||
AndroidEventLogType type;
|
||||
uint16_t complete;
|
||||
uint16_t len;
|
||||
union {
|
||||
int32_t int32;
|
||||
int64_t int64;
|
||||
char* string;
|
||||
float float32;
|
||||
} data;
|
||||
} android_log_list_element;
|
||||
|
||||
/*
|
||||
* Creates a context associated with an event tag to write elements to
|
||||
* the list of events.
|
||||
*/
|
||||
android_log_context create_android_logger(uint32_t tag);
|
||||
|
||||
/* All lists must be braced by a begin and end call */
|
||||
/*
|
||||
* NB: If the first level braces are missing when specifying multiple
|
||||
* elements, we will manufacturer a list to embrace it for your API
|
||||
* convenience. For a single element, it will remain solitary.
|
||||
*/
|
||||
int android_log_write_list_begin(android_log_context ctx);
|
||||
int android_log_write_list_end(android_log_context ctx);
|
||||
|
||||
int android_log_write_int32(android_log_context ctx, int32_t value);
|
||||
int android_log_write_int64(android_log_context ctx, int64_t value);
|
||||
int android_log_write_string8(android_log_context ctx, const char* value);
|
||||
int android_log_write_string8_len(android_log_context ctx, const char* value,
|
||||
size_t maxlen);
|
||||
int android_log_write_float32(android_log_context ctx, float value);
|
||||
|
||||
/* Submit the composed list context to the specified logger id */
|
||||
/* NB: LOG_ID_EVENTS and LOG_ID_SECURITY only valid binary buffers */
|
||||
int android_log_write_list(android_log_context ctx, log_id_t id);
|
||||
|
||||
/*
|
||||
* Creates a context from a raw buffer representing a list of events to be read.
|
||||
*/
|
||||
android_log_context create_android_log_parser(const char* msg, size_t len);
|
||||
|
||||
android_log_list_element android_log_read_next(android_log_context ctx);
|
||||
android_log_list_element android_log_peek_next(android_log_context ctx);
|
||||
|
||||
/* Reset writer context */
|
||||
int android_log_reset(android_log_context ctx);
|
||||
|
||||
/* Reset reader context */
|
||||
int android_log_parser_reset(android_log_context ctx,
|
||||
const char* msg, size_t len);
|
||||
|
||||
/* Finished with reader or writer context */
|
||||
int android_log_destroy(android_log_context* ctx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* android_log_list C++ helpers */
|
||||
extern "C++" {
|
||||
class android_log_event_list {
|
||||
private:
|
||||
android_log_context ctx;
|
||||
int ret;
|
||||
|
||||
android_log_event_list(const android_log_event_list&) = delete;
|
||||
void operator=(const android_log_event_list&) = delete;
|
||||
|
||||
public:
|
||||
explicit android_log_event_list(int tag) : ret(0) {
|
||||
ctx = create_android_logger(static_cast<uint32_t>(tag));
|
||||
}
|
||||
~android_log_event_list() {
|
||||
android_log_destroy(&ctx);
|
||||
}
|
||||
|
||||
int close() {
|
||||
int retval = android_log_destroy(&ctx);
|
||||
if (retval < 0) ret = retval;
|
||||
return retval;
|
||||
}
|
||||
|
||||
/* To allow above C calls to use this class as parameter */
|
||||
operator android_log_context() const {
|
||||
return ctx;
|
||||
}
|
||||
|
||||
/* return errors or transmit status */
|
||||
int status() const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int begin() {
|
||||
int retval = android_log_write_list_begin(ctx);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret;
|
||||
}
|
||||
int end() {
|
||||
int retval = android_log_write_list_end(ctx);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(int32_t value) {
|
||||
int retval = android_log_write_int32(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(uint32_t value) {
|
||||
int retval = android_log_write_int32(ctx, static_cast<int32_t>(value));
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(bool value) {
|
||||
int retval = android_log_write_int32(ctx, value ? 1 : 0);
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(int64_t value) {
|
||||
int retval = android_log_write_int64(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(uint64_t value) {
|
||||
int retval = android_log_write_int64(ctx, static_cast<int64_t>(value));
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(const char* value) {
|
||||
int retval = android_log_write_string8(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(const std::string& value) {
|
||||
int retval =
|
||||
android_log_write_string8_len(ctx, value.data(), value.length());
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
android_log_event_list& operator<<(float value) {
|
||||
int retval = android_log_write_float32(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return *this;
|
||||
}
|
||||
|
||||
int write(log_id_t id = LOG_ID_EVENTS) {
|
||||
/* facilitate -EBUSY retry */
|
||||
if ((ret == -EBUSY) || (ret > 0)) ret = 0;
|
||||
int retval = android_log_write_list(ctx, id);
|
||||
/* existing errors trump transmission errors */
|
||||
if (!ret) ret = retval;
|
||||
return ret;
|
||||
}
|
||||
|
||||
int operator<<(log_id_t id) {
|
||||
write(id);
|
||||
android_log_destroy(&ctx);
|
||||
return ret;
|
||||
}
|
||||
|
||||
/*
|
||||
* Append<Type> methods removes any integer promotion
|
||||
* confusion, and adds access to string with length.
|
||||
* Append methods are also added for all types for
|
||||
* convenience.
|
||||
*/
|
||||
|
||||
bool AppendInt(int32_t value) {
|
||||
int retval = android_log_write_int32(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
bool AppendLong(int64_t value) {
|
||||
int retval = android_log_write_int64(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
bool AppendString(const char* value) {
|
||||
int retval = android_log_write_string8(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
bool AppendString(const char* value, size_t len) {
|
||||
int retval = android_log_write_string8_len(ctx, value, len);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
bool AppendString(const std::string& value) {
|
||||
int retval =
|
||||
android_log_write_string8_len(ctx, value.data(), value.length());
|
||||
if (retval < 0) ret = retval;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool Append(const std::string& value) {
|
||||
int retval =
|
||||
android_log_write_string8_len(ctx, value.data(), value.length());
|
||||
if (retval < 0) ret = retval;
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool AppendFloat(float value) {
|
||||
int retval = android_log_write_float32(ctx, value);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
template <typename Tvalue>
|
||||
bool Append(Tvalue value) {
|
||||
*this << value;
|
||||
return ret >= 0;
|
||||
}
|
||||
|
||||
bool Append(const char* value, size_t len) {
|
||||
int retval = android_log_write_string8_len(ctx, value, len);
|
||||
if (retval < 0) ret = retval;
|
||||
return ret >= 0;
|
||||
}
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*
|
||||
* log_id_t helpers
|
||||
*/
|
||||
log_id_t android_name_to_log_id(const char* logName);
|
||||
const char* android_log_id_to_name(log_id_t log_id);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,378 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Normally we strip the effects of ALOGV (VERBOSE messages),
|
||||
* LOG_FATAL and LOG_FATAL_IF (FATAL assert messages) from the
|
||||
* release builds be defining NDEBUG. You can modify this (for
|
||||
* example with "#define LOG_NDEBUG 0" at the top of your source
|
||||
* file) to change that behavior.
|
||||
*/
|
||||
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* This file uses ", ## __VA_ARGS__" zero-argument token pasting to
|
||||
* work around issues with debug-only syntax errors in assertions
|
||||
* that are missing format strings. See commit
|
||||
* 19299904343daf191267564fe32e6cd5c165cd42
|
||||
*/
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wgnu-zero-variadic-macro-arguments"
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Use __VA_ARGS__ if running a static analyzer,
|
||||
* to avoid warnings of unused variables in __VA_ARGS__.
|
||||
* Use constexpr function in C++ mode, so these macros can be used
|
||||
* in other constexpr functions without warning.
|
||||
*/
|
||||
#ifdef __clang_analyzer__
|
||||
#ifdef __cplusplus
|
||||
extern "C++" {
|
||||
template <typename... Ts>
|
||||
constexpr int __fake_use_va_args(Ts...) {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
#else
|
||||
extern int __fake_use_va_args(int, ...);
|
||||
#endif /* __cplusplus */
|
||||
#define __FAKE_USE_VA_ARGS(...) ((void)__fake_use_va_args(0, ##__VA_ARGS__))
|
||||
#else
|
||||
#define __FAKE_USE_VA_ARGS(...) ((void)(0))
|
||||
#endif /* __clang_analyzer__ */
|
||||
|
||||
#ifndef __predict_false
|
||||
#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
|
||||
#endif
|
||||
|
||||
#define android_writeLog(prio, tag, text) __android_log_write(prio, tag, text)
|
||||
|
||||
#define android_printLog(prio, tag, ...) \
|
||||
__android_log_print(prio, tag, __VA_ARGS__)
|
||||
|
||||
#define android_vprintLog(prio, cond, tag, ...) \
|
||||
__android_log_vprint(prio, tag, __VA_ARGS__)
|
||||
|
||||
/*
|
||||
* Log macro that allows you to specify a number for the priority.
|
||||
*/
|
||||
#ifndef LOG_PRI
|
||||
#define LOG_PRI(priority, tag, ...) android_printLog(priority, tag, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Log macro that allows you to pass in a varargs ("args" is a va_list).
|
||||
*/
|
||||
#ifndef LOG_PRI_VA
|
||||
#define LOG_PRI_VA(priority, tag, fmt, args) \
|
||||
android_vprintLog(priority, NULL, tag, fmt, args)
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/* XXX Macros to work around syntax errors in places where format string
|
||||
* arg is not passed to ALOG_ASSERT, LOG_ALWAYS_FATAL or LOG_ALWAYS_FATAL_IF
|
||||
* (happens only in debug builds).
|
||||
*/
|
||||
|
||||
/* Returns 2nd arg. Used to substitute default value if caller's vararg list
|
||||
* is empty.
|
||||
*/
|
||||
#define __android_second(dummy, second, ...) second
|
||||
|
||||
/* If passed multiple args, returns ',' followed by all but 1st arg, otherwise
|
||||
* returns nothing.
|
||||
*/
|
||||
#define __android_rest(first, ...) , ##__VA_ARGS__
|
||||
|
||||
#define android_printAssert(cond, tag, ...) \
|
||||
__android_log_assert(cond, tag, \
|
||||
__android_second(0, ##__VA_ARGS__, NULL) \
|
||||
__android_rest(__VA_ARGS__))
|
||||
|
||||
/*
|
||||
* Log a fatal error. If the given condition fails, this stops program
|
||||
* execution like a normal assertion, but also generating the given message.
|
||||
* It is NOT stripped from release builds. Note that the condition test
|
||||
* is -inverted- from the normal assert() semantics.
|
||||
*/
|
||||
#ifndef LOG_ALWAYS_FATAL_IF
|
||||
#define LOG_ALWAYS_FATAL_IF(cond, ...) \
|
||||
((__predict_false(cond)) ? (__FAKE_USE_VA_ARGS(__VA_ARGS__), \
|
||||
((void)android_printAssert(#cond, LOG_TAG, ##__VA_ARGS__))) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
|
||||
#ifndef LOG_ALWAYS_FATAL
|
||||
#define LOG_ALWAYS_FATAL(...) \
|
||||
(((void)android_printAssert(NULL, LOG_TAG, ##__VA_ARGS__)))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Versions of LOG_ALWAYS_FATAL_IF and LOG_ALWAYS_FATAL that
|
||||
* are stripped out of release builds.
|
||||
*/
|
||||
|
||||
#if LOG_NDEBUG
|
||||
|
||||
#ifndef LOG_FATAL_IF
|
||||
#define LOG_FATAL_IF(cond, ...) __FAKE_USE_VA_ARGS(__VA_ARGS__)
|
||||
#endif
|
||||
#ifndef LOG_FATAL
|
||||
#define LOG_FATAL(...) __FAKE_USE_VA_ARGS(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#else
|
||||
|
||||
#ifndef LOG_FATAL_IF
|
||||
#define LOG_FATAL_IF(cond, ...) LOG_ALWAYS_FATAL_IF(cond, ##__VA_ARGS__)
|
||||
#endif
|
||||
#ifndef LOG_FATAL
|
||||
#define LOG_FATAL(...) LOG_ALWAYS_FATAL(__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Assertion that generates a log message when the assertion fails.
|
||||
* Stripped out of release builds. Uses the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOG_ASSERT
|
||||
#define ALOG_ASSERT(cond, ...) LOG_FATAL_IF(!(cond), ##__VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* C/C++ logging functions. See the logging documentation for API details.
|
||||
*
|
||||
* We'd like these to be available from C code (in case we import some from
|
||||
* somewhere), so this has a C interface.
|
||||
*
|
||||
* The output will be correct when the log file is shared between multiple
|
||||
* threads and/or multiple processes so long as the operating system
|
||||
* supports O_APPEND. These calls have mutex-protected data structures
|
||||
* and so are NOT reentrant. Do not use LOG in a signal handler.
|
||||
*/
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Simplified macro to send a verbose log message using the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOGV
|
||||
#define __ALOGV(...) ((void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__))
|
||||
#if LOG_NDEBUG
|
||||
#define ALOGV(...) \
|
||||
do { \
|
||||
__FAKE_USE_VA_ARGS(__VA_ARGS__); \
|
||||
if (false) { \
|
||||
__ALOGV(__VA_ARGS__); \
|
||||
} \
|
||||
} while (false)
|
||||
#else
|
||||
#define ALOGV(...) __ALOGV(__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef ALOGV_IF
|
||||
#if LOG_NDEBUG
|
||||
#define ALOGV_IF(cond, ...) __FAKE_USE_VA_ARGS(__VA_ARGS__)
|
||||
#else
|
||||
#define ALOGV_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_VERBOSE, LOG_TAG, __VA_ARGS__)) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a debug log message using the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOGD
|
||||
#define ALOGD(...) ((void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef ALOGD_IF
|
||||
#define ALOGD_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_DEBUG, LOG_TAG, __VA_ARGS__)) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an info log message using the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOGI
|
||||
#define ALOGI(...) ((void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef ALOGI_IF
|
||||
#define ALOGI_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_INFO, LOG_TAG, __VA_ARGS__)) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a warning log message using the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOGW
|
||||
#define ALOGW(...) ((void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef ALOGW_IF
|
||||
#define ALOGW_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_WARN, LOG_TAG, __VA_ARGS__)) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an error log message using the current LOG_TAG.
|
||||
*/
|
||||
#ifndef ALOGE
|
||||
#define ALOGE(...) ((void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef ALOGE_IF
|
||||
#define ALOGE_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? (__FAKE_USE_VA_ARGS(__VA_ARGS__), (void)ALOG(LOG_ERROR, LOG_TAG, __VA_ARGS__)) \
|
||||
: ((void)0))
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Conditional based on whether the current LOG_TAG is enabled at
|
||||
* verbose priority.
|
||||
*/
|
||||
#ifndef IF_ALOGV
|
||||
#if LOG_NDEBUG
|
||||
#define IF_ALOGV() if (false)
|
||||
#else
|
||||
#define IF_ALOGV() IF_ALOG(LOG_VERBOSE, LOG_TAG)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Conditional based on whether the current LOG_TAG is enabled at
|
||||
* debug priority.
|
||||
*/
|
||||
#ifndef IF_ALOGD
|
||||
#define IF_ALOGD() IF_ALOG(LOG_DEBUG, LOG_TAG)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Conditional based on whether the current LOG_TAG is enabled at
|
||||
* info priority.
|
||||
*/
|
||||
#ifndef IF_ALOGI
|
||||
#define IF_ALOGI() IF_ALOG(LOG_INFO, LOG_TAG)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Conditional based on whether the current LOG_TAG is enabled at
|
||||
* warn priority.
|
||||
*/
|
||||
#ifndef IF_ALOGW
|
||||
#define IF_ALOGW() IF_ALOG(LOG_WARN, LOG_TAG)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Conditional based on whether the current LOG_TAG is enabled at
|
||||
* error priority.
|
||||
*/
|
||||
#ifndef IF_ALOGE
|
||||
#define IF_ALOGE() IF_ALOG(LOG_ERROR, LOG_TAG)
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* Basic log message macro.
|
||||
*
|
||||
* Example:
|
||||
* ALOG(LOG_WARN, NULL, "Failed with error %d", errno);
|
||||
*
|
||||
* The second argument may be NULL or "" to indicate the "global" tag.
|
||||
*/
|
||||
#ifndef ALOG
|
||||
#define ALOG(priority, tag, ...) LOG_PRI(ANDROID_##priority, tag, __VA_ARGS__)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Conditional given a desired logging priority and tag.
|
||||
*/
|
||||
#ifndef IF_ALOG
|
||||
#define IF_ALOG(priority, tag) if (android_testLog(ANDROID_##priority, tag))
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
/*
|
||||
* IF_ALOG uses android_testLog, but IF_ALOG can be overridden.
|
||||
* android_testLog will remain constant in its purpose as a wrapper
|
||||
* for Android logging filter policy, and can be subject to
|
||||
* change. It can be reused by the developers that override
|
||||
* IF_ALOG as a convenient means to reimplement their policy
|
||||
* over Android.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Use the per-tag properties "log.tag.<tagname>" to generate a runtime
|
||||
* result of non-zero to expose a log. prio is ANDROID_LOG_VERBOSE to
|
||||
* ANDROID_LOG_FATAL. default_prio if no property. Undefined behavior if
|
||||
* any other value.
|
||||
*/
|
||||
int __android_log_is_loggable(int prio, const char* tag, int default_prio);
|
||||
int __android_log_is_loggable_len(int prio, const char* tag, size_t len, int default_prio);
|
||||
|
||||
#if LOG_NDEBUG /* Production */
|
||||
#define android_testLog(prio, tag) \
|
||||
(__android_log_is_loggable_len(prio, tag, (tag) ? strlen(tag) : 0, ANDROID_LOG_DEBUG) != 0)
|
||||
#else
|
||||
#define android_testLog(prio, tag) \
|
||||
(__android_log_is_loggable_len(prio, tag, (tag) ? strlen(tag) : 0, ANDROID_LOG_VERBOSE) != 0)
|
||||
#endif
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
__END_DECLS
|
||||
@@ -0,0 +1,28 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* Returns `1` if the device is debuggable or `0` if not. */
|
||||
int __android_log_is_debuggable();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,140 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
/*
|
||||
* Normally we strip the effects of ALOGV (VERBOSE messages),
|
||||
* LOG_FATAL and LOG_FATAL_IF (FATAL assert messages) from the
|
||||
* release builds be defining NDEBUG. You can modify this (for
|
||||
* example with "#define LOG_NDEBUG 0" at the top of your source
|
||||
* file) to change that behavior.
|
||||
*/
|
||||
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* --------------------------------------------------------------------- */
|
||||
|
||||
#ifndef __predict_false
|
||||
#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a verbose radio log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef RLOGV
|
||||
#define __RLOGV(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#if LOG_NDEBUG
|
||||
#define RLOGV(...) \
|
||||
do { \
|
||||
if (0) { \
|
||||
__RLOGV(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define RLOGV(...) __RLOGV(__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef RLOGV_IF
|
||||
#if LOG_NDEBUG
|
||||
#define RLOGV_IF(cond, ...) ((void)0)
|
||||
#else
|
||||
#define RLOGV_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_VERBOSE, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a debug radio log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef RLOGD
|
||||
#define RLOGD(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef RLOGD_IF
|
||||
#define RLOGD_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_DEBUG, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an info radio log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef RLOGI
|
||||
#define RLOGI(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef RLOGI_IF
|
||||
#define RLOGI_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_INFO, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a warning radio log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef RLOGW
|
||||
#define RLOGW(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef RLOGW_IF
|
||||
#define RLOGW_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_WARN, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an error radio log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef RLOGE
|
||||
#define RLOGE(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef RLOGE_IF
|
||||
#define RLOGE_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_RADIO, ANDROID_LOG_ERROR, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
@@ -0,0 +1,129 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <android/log.h>
|
||||
#include <log/log_time.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define ANDROID_LOG_WRAP_DEFAULT_TIMEOUT 7200 /* 2 hour default */
|
||||
|
||||
/*
|
||||
* Native log reading interface section. See logcat for sample code.
|
||||
*
|
||||
* The preferred API is an exec of logcat. Likely uses of this interface
|
||||
* are if native code suffers from exec or filtration being too costly,
|
||||
* access to raw information, or parsing is an issue.
|
||||
*/
|
||||
|
||||
struct logger_entry {
|
||||
uint16_t len; /* length of the payload */
|
||||
uint16_t hdr_size; /* sizeof(struct logger_entry) */
|
||||
int32_t pid; /* generating process's pid */
|
||||
uint32_t tid; /* generating process's tid */
|
||||
uint32_t sec; /* seconds since Epoch */
|
||||
uint32_t nsec; /* nanoseconds */
|
||||
uint32_t lid; /* log id of the payload, bottom 4 bits currently */
|
||||
uint32_t uid; /* generating process's uid */
|
||||
};
|
||||
|
||||
/*
|
||||
* The maximum size of a log entry which can be read.
|
||||
* An attempt to read less than this amount may result
|
||||
* in read() returning EINVAL.
|
||||
*/
|
||||
#define LOGGER_ENTRY_MAX_LEN (5 * 1024)
|
||||
|
||||
struct log_msg {
|
||||
union {
|
||||
unsigned char buf[LOGGER_ENTRY_MAX_LEN + 1];
|
||||
struct logger_entry entry;
|
||||
} __attribute__((aligned(4)));
|
||||
#ifdef __cplusplus
|
||||
uint64_t nsec() const {
|
||||
return static_cast<uint64_t>(entry.sec) * NS_PER_SEC + entry.nsec;
|
||||
}
|
||||
log_id_t id() {
|
||||
return static_cast<log_id_t>(entry.lid);
|
||||
}
|
||||
char* msg() {
|
||||
unsigned short hdr_size = entry.hdr_size;
|
||||
if (hdr_size >= sizeof(struct log_msg) - sizeof(entry)) {
|
||||
return nullptr;
|
||||
}
|
||||
return reinterpret_cast<char*>(buf) + hdr_size;
|
||||
}
|
||||
unsigned int len() { return entry.hdr_size + entry.len; }
|
||||
#endif
|
||||
};
|
||||
|
||||
struct logger;
|
||||
|
||||
log_id_t android_logger_get_id(struct logger* logger);
|
||||
|
||||
/* Clears the given log buffer. */
|
||||
int android_logger_clear(struct logger* logger);
|
||||
/* Return the allotted size for the given log buffer. */
|
||||
long android_logger_get_log_size(struct logger* logger);
|
||||
/* Set the allotted size for the given log buffer. */
|
||||
int android_logger_set_log_size(struct logger* logger, unsigned long size);
|
||||
/* Return the actual, uncompressed size that can be read from the given log buffer. */
|
||||
long android_logger_get_log_readable_size(struct logger* logger);
|
||||
/* Return the actual, compressed size that the given log buffer is consuming. */
|
||||
long android_logger_get_log_consumed_size(struct logger* logger);
|
||||
/* Deprecated. Always returns '4' regardless of input. */
|
||||
int android_logger_get_log_version(struct logger* logger);
|
||||
|
||||
struct logger_list;
|
||||
|
||||
ssize_t android_logger_get_statistics(struct logger_list* logger_list,
|
||||
char* buf, size_t len);
|
||||
ssize_t android_logger_get_prune_list(struct logger_list* logger_list,
|
||||
char* buf, size_t len);
|
||||
int android_logger_set_prune_list(struct logger_list* logger_list, const char* buf, size_t len);
|
||||
|
||||
/* The below values are used for the `mode` argument of the below functions. */
|
||||
/* Note that 0x00000003 were previously used and should be considered reserved. */
|
||||
#define ANDROID_LOG_NONBLOCK 0x00000800
|
||||
#define ANDROID_LOG_WRAP 0x40000000 /* Block until buffer about to wrap */
|
||||
#define ANDROID_LOG_PSTORE 0x80000000
|
||||
|
||||
struct logger_list* android_logger_list_alloc(int mode, unsigned int tail,
|
||||
pid_t pid);
|
||||
struct logger_list* android_logger_list_alloc_time(int mode, log_time start,
|
||||
pid_t pid);
|
||||
void android_logger_list_free(struct logger_list* logger_list);
|
||||
/* In the purest sense, the following two are orthogonal interfaces */
|
||||
int android_logger_list_read(struct logger_list* logger_list,
|
||||
struct log_msg* log_msg);
|
||||
|
||||
/* Multiple log_id_t opens */
|
||||
struct logger* android_logger_open(struct logger_list* logger_list, log_id_t id);
|
||||
/* Single log_id_t open */
|
||||
struct logger_list* android_logger_list_open(log_id_t id, int mode,
|
||||
unsigned int tail, pid_t pid);
|
||||
#define android_logger_list_close android_logger_list_free
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define android_errorWriteLog(tag, subTag) \
|
||||
__android_log_error_write(tag, subTag, -1, NULL, 0)
|
||||
|
||||
#define android_errorWriteWithInfoLog(tag, subTag, uid, data, dataLen) \
|
||||
__android_log_error_write(tag, subTag, uid, data, dataLen)
|
||||
|
||||
int __android_log_error_write(int tag, const char* subTag, int32_t uid,
|
||||
const char* data, uint32_t dataLen);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,138 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <android/log.h>
|
||||
|
||||
/*
|
||||
* Normally we strip the effects of ALOGV (VERBOSE messages),
|
||||
* LOG_FATAL and LOG_FATAL_IF (FATAL assert messages) from the
|
||||
* release builds be defining NDEBUG. You can modify this (for
|
||||
* example with "#define LOG_NDEBUG 0" at the top of your source
|
||||
* file) to change that behavior.
|
||||
*/
|
||||
|
||||
#ifndef LOG_NDEBUG
|
||||
#ifdef NDEBUG
|
||||
#define LOG_NDEBUG 1
|
||||
#else
|
||||
#define LOG_NDEBUG 0
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef __predict_false
|
||||
#define __predict_false(exp) __builtin_expect((exp) != 0, 0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a verbose system log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef SLOGV
|
||||
#define __SLOGV(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#if LOG_NDEBUG
|
||||
#define SLOGV(...) \
|
||||
do { \
|
||||
if (0) { \
|
||||
__SLOGV(__VA_ARGS__); \
|
||||
} \
|
||||
} while (0)
|
||||
#else
|
||||
#define SLOGV(...) __SLOGV(__VA_ARGS__)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef SLOGV_IF
|
||||
#if LOG_NDEBUG
|
||||
#define SLOGV_IF(cond, ...) ((void)0)
|
||||
#else
|
||||
#define SLOGV_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_VERBOSE, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a debug system log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef SLOGD
|
||||
#define SLOGD(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef SLOGD_IF
|
||||
#define SLOGD_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_DEBUG, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an info system log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef SLOGI
|
||||
#define SLOGI(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef SLOGI_IF
|
||||
#define SLOGI_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_INFO, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send a warning system log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef SLOGW
|
||||
#define SLOGW(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef SLOGW_IF
|
||||
#define SLOGW_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_WARN, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Simplified macro to send an error system log message using current LOG_TAG.
|
||||
*/
|
||||
#ifndef SLOGE
|
||||
#define SLOGE(...) \
|
||||
((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, LOG_TAG, \
|
||||
__VA_ARGS__))
|
||||
#endif
|
||||
|
||||
#ifndef SLOGE_IF
|
||||
#define SLOGE_IF(cond, ...) \
|
||||
((__predict_false(cond)) \
|
||||
? ((void)__android_log_buf_print(LOG_ID_SYSTEM, ANDROID_LOG_ERROR, \
|
||||
LOG_TAG, __VA_ARGS__)) \
|
||||
: (void)0)
|
||||
#endif
|
||||
@@ -0,0 +1,162 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <time.h>
|
||||
|
||||
/* struct log_time is a wire-format variant of struct timespec */
|
||||
#define NS_PER_SEC 1000000000ULL
|
||||
#define US_PER_SEC 1000000ULL
|
||||
#define MS_PER_SEC 1000ULL
|
||||
|
||||
#define LOG_TIME_SEC(t) ((t)->tv_sec)
|
||||
/* next power of two after NS_PER_SEC */
|
||||
#define LOG_TIME_NSEC(t) ((t)->tv_nsec & (UINT32_MAX >> 2))
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
extern "C" {
|
||||
|
||||
struct log_time {
|
||||
public:
|
||||
uint32_t tv_sec = 0; /* good to Feb 5 2106 */
|
||||
uint32_t tv_nsec = 0;
|
||||
|
||||
static constexpr timespec EPOCH = {0, 0};
|
||||
|
||||
log_time() {}
|
||||
explicit log_time(const timespec& T)
|
||||
: tv_sec(static_cast<uint32_t>(T.tv_sec)), tv_nsec(static_cast<uint32_t>(T.tv_nsec)) {}
|
||||
explicit log_time(uint32_t sec, uint32_t nsec = 0)
|
||||
: tv_sec(sec), tv_nsec(nsec) {
|
||||
}
|
||||
#ifdef __linux__
|
||||
explicit log_time(clockid_t id) {
|
||||
timespec T;
|
||||
clock_gettime(id, &T);
|
||||
tv_sec = static_cast<uint32_t>(T.tv_sec);
|
||||
tv_nsec = static_cast<uint32_t>(T.tv_nsec);
|
||||
}
|
||||
#endif
|
||||
/* timespec */
|
||||
bool operator==(const timespec& T) const {
|
||||
return (tv_sec == static_cast<uint32_t>(T.tv_sec)) &&
|
||||
(tv_nsec == static_cast<uint32_t>(T.tv_nsec));
|
||||
}
|
||||
bool operator!=(const timespec& T) const {
|
||||
return !(*this == T);
|
||||
}
|
||||
bool operator<(const timespec& T) const {
|
||||
return (tv_sec < static_cast<uint32_t>(T.tv_sec)) ||
|
||||
((tv_sec == static_cast<uint32_t>(T.tv_sec)) &&
|
||||
(tv_nsec < static_cast<uint32_t>(T.tv_nsec)));
|
||||
}
|
||||
bool operator>=(const timespec& T) const {
|
||||
return !(*this < T);
|
||||
}
|
||||
bool operator>(const timespec& T) const {
|
||||
return (tv_sec > static_cast<uint32_t>(T.tv_sec)) ||
|
||||
((tv_sec == static_cast<uint32_t>(T.tv_sec)) &&
|
||||
(tv_nsec > static_cast<uint32_t>(T.tv_nsec)));
|
||||
}
|
||||
bool operator<=(const timespec& T) const {
|
||||
return !(*this > T);
|
||||
}
|
||||
|
||||
/* log_time */
|
||||
bool operator==(const log_time& T) const {
|
||||
return (tv_sec == T.tv_sec) && (tv_nsec == T.tv_nsec);
|
||||
}
|
||||
bool operator!=(const log_time& T) const {
|
||||
return !(*this == T);
|
||||
}
|
||||
bool operator<(const log_time& T) const {
|
||||
return (tv_sec < T.tv_sec) ||
|
||||
((tv_sec == T.tv_sec) && (tv_nsec < T.tv_nsec));
|
||||
}
|
||||
bool operator>=(const log_time& T) const {
|
||||
return !(*this < T);
|
||||
}
|
||||
bool operator>(const log_time& T) const {
|
||||
return (tv_sec > T.tv_sec) ||
|
||||
((tv_sec == T.tv_sec) && (tv_nsec > T.tv_nsec));
|
||||
}
|
||||
bool operator<=(const log_time& T) const {
|
||||
return !(*this > T);
|
||||
}
|
||||
|
||||
log_time operator-=(const log_time& T) {
|
||||
// No concept of negative time, clamp to EPOCH
|
||||
if (*this <= T) {
|
||||
return *this = log_time(EPOCH);
|
||||
}
|
||||
|
||||
if (this->tv_nsec < T.tv_nsec) {
|
||||
--this->tv_sec;
|
||||
this->tv_nsec = NS_PER_SEC + this->tv_nsec - T.tv_nsec;
|
||||
} else {
|
||||
this->tv_nsec -= T.tv_nsec;
|
||||
}
|
||||
this->tv_sec -= T.tv_sec;
|
||||
|
||||
return *this;
|
||||
}
|
||||
log_time operator-(const log_time& T) const {
|
||||
log_time local(*this);
|
||||
return local -= T;
|
||||
}
|
||||
log_time operator+=(const log_time& T) {
|
||||
this->tv_nsec += T.tv_nsec;
|
||||
if (this->tv_nsec >= NS_PER_SEC) {
|
||||
this->tv_nsec -= NS_PER_SEC;
|
||||
++this->tv_sec;
|
||||
}
|
||||
this->tv_sec += T.tv_sec;
|
||||
|
||||
return *this;
|
||||
}
|
||||
log_time operator+(const log_time& T) const {
|
||||
log_time local(*this);
|
||||
return local += T;
|
||||
}
|
||||
|
||||
uint64_t nsec() const {
|
||||
return static_cast<uint64_t>(tv_sec) * NS_PER_SEC + tv_nsec;
|
||||
}
|
||||
uint64_t usec() const {
|
||||
return static_cast<uint64_t>(tv_sec) * US_PER_SEC +
|
||||
tv_nsec / (NS_PER_SEC / US_PER_SEC);
|
||||
}
|
||||
uint64_t msec() const {
|
||||
return static_cast<uint64_t>(tv_sec) * MS_PER_SEC +
|
||||
tv_nsec / (NS_PER_SEC / MS_PER_SEC);
|
||||
}
|
||||
|
||||
/* Add %#q for the fraction of a second to the standard library functions */
|
||||
char* strptime(const char* s, const char* format);
|
||||
} __attribute__((__packed__));
|
||||
}
|
||||
|
||||
#else /* __cplusplus */
|
||||
|
||||
typedef struct log_time {
|
||||
uint32_t tv_sec;
|
||||
uint32_t tv_nsec;
|
||||
} __attribute__((__packed__)) log_time;
|
||||
|
||||
#endif /* __cplusplus */
|
||||
@@ -0,0 +1,160 @@
|
||||
/*
|
||||
* Copyright (C) 2006 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
#include <android/log.h>
|
||||
#include <log/event_tag_map.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
/* Verbs */
|
||||
FORMAT_OFF = 0,
|
||||
FORMAT_BRIEF,
|
||||
FORMAT_PROCESS,
|
||||
FORMAT_TAG,
|
||||
FORMAT_THREAD,
|
||||
FORMAT_RAW,
|
||||
FORMAT_TIME,
|
||||
FORMAT_THREADTIME,
|
||||
FORMAT_LONG,
|
||||
/* Adverbs. The following are modifiers to above format verbs */
|
||||
FORMAT_MODIFIER_COLOR, /* converts priority to color */
|
||||
FORMAT_MODIFIER_TIME_USEC, /* switches from msec to usec time precision */
|
||||
FORMAT_MODIFIER_PRINTABLE, /* converts non-printable to printable escapes */
|
||||
FORMAT_MODIFIER_YEAR, /* Adds year to date */
|
||||
FORMAT_MODIFIER_ZONE, /* Adds zone to date, + UTC */
|
||||
FORMAT_MODIFIER_EPOCH, /* Print time as seconds since Jan 1 1970 */
|
||||
FORMAT_MODIFIER_MONOTONIC, /* Print cpu time as seconds since start */
|
||||
FORMAT_MODIFIER_UID, /* Adds uid */
|
||||
FORMAT_MODIFIER_DESCRIPT, /* Adds descriptive */
|
||||
/* private, undocumented */
|
||||
FORMAT_MODIFIER_TIME_NSEC, /* switches from msec to nsec time precision */
|
||||
} AndroidLogPrintFormat;
|
||||
|
||||
typedef struct AndroidLogFormat_t AndroidLogFormat;
|
||||
|
||||
typedef struct AndroidLogEntry_t {
|
||||
time_t tv_sec;
|
||||
long tv_nsec;
|
||||
android_LogPriority priority;
|
||||
int32_t uid;
|
||||
int32_t pid;
|
||||
int32_t tid;
|
||||
const char* tag;
|
||||
size_t tagLen;
|
||||
size_t messageLen;
|
||||
const char* message;
|
||||
} AndroidLogEntry;
|
||||
|
||||
AndroidLogFormat* android_log_format_new();
|
||||
|
||||
void android_log_format_free(AndroidLogFormat* p_format);
|
||||
|
||||
/* currently returns 0 if format is a modifier, 1 if not */
|
||||
int android_log_setPrintFormat(AndroidLogFormat* p_format,
|
||||
AndroidLogPrintFormat format);
|
||||
|
||||
/**
|
||||
* Returns FORMAT_OFF on invalid string
|
||||
*/
|
||||
AndroidLogPrintFormat android_log_formatFromString(const char* s);
|
||||
|
||||
/**
|
||||
* filterExpression: a single filter expression
|
||||
* eg "AT:d"
|
||||
*
|
||||
* returns 0 on success and -1 on invalid expression
|
||||
*
|
||||
* Assumes single threaded execution
|
||||
*
|
||||
*/
|
||||
|
||||
int android_log_addFilterRule(AndroidLogFormat* p_format,
|
||||
const char* filterExpression);
|
||||
|
||||
/**
|
||||
* filterString: a whitespace-separated set of filter expressions
|
||||
* eg "AT:d *:i"
|
||||
*
|
||||
* returns 0 on success and -1 on invalid expression
|
||||
*
|
||||
* Assumes single threaded execution
|
||||
*
|
||||
*/
|
||||
|
||||
int android_log_addFilterString(AndroidLogFormat* p_format,
|
||||
const char* filterString);
|
||||
|
||||
/**
|
||||
* returns 1 if this log line should be printed based on its priority
|
||||
* and tag, and 0 if it should not
|
||||
*/
|
||||
int android_log_shouldPrintLine(AndroidLogFormat* p_format, const char* tag,
|
||||
android_LogPriority pri);
|
||||
|
||||
/**
|
||||
* Splits a wire-format buffer into an AndroidLogEntry
|
||||
* entry allocated by caller. Pointers will point directly into buf
|
||||
*
|
||||
* Returns 0 on success and -1 on invalid wire format (entry will be
|
||||
* in unspecified state)
|
||||
*/
|
||||
int android_log_processLogBuffer(struct logger_entry* buf,
|
||||
AndroidLogEntry* entry);
|
||||
|
||||
/**
|
||||
* Like android_log_processLogBuffer, but for binary logs.
|
||||
*
|
||||
* If "map" is non-NULL, it will be used to convert the log tag number
|
||||
* into a string.
|
||||
*/
|
||||
int android_log_processBinaryLogBuffer(struct logger_entry* buf,
|
||||
AndroidLogEntry* entry,
|
||||
const EventTagMap* map, char* messageBuf,
|
||||
int messageBufLen);
|
||||
|
||||
/**
|
||||
* Formats a log message into a buffer
|
||||
*
|
||||
* Uses defaultBuffer if it can, otherwise malloc()'s a new buffer
|
||||
* If return value != defaultBuffer, caller must call free()
|
||||
* Returns NULL on malloc error
|
||||
*/
|
||||
|
||||
char* android_log_formatLogLine(AndroidLogFormat* p_format, char* defaultBuffer,
|
||||
size_t defaultBufferSize,
|
||||
const AndroidLogEntry* p_line,
|
||||
size_t* p_outLength);
|
||||
|
||||
/**
|
||||
* Either print or do not print log line, based on filter
|
||||
*
|
||||
* Assumes single threaded execution
|
||||
*
|
||||
*/
|
||||
int android_log_printLogLine(AndroidLogFormat* p_format, int fd,
|
||||
const AndroidLogEntry* entry);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,110 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <string.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <system/graphics-base.h>
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#ifdef __cplusplus
|
||||
#define ANDROID_NATIVE_UNSIGNED_CAST(x) static_cast<unsigned int>(x)
|
||||
#else
|
||||
#define ANDROID_NATIVE_UNSIGNED_CAST(x) ((unsigned int)(x))
|
||||
#endif
|
||||
|
||||
#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \
|
||||
((ANDROID_NATIVE_UNSIGNED_CAST(a) << 24) | \
|
||||
(ANDROID_NATIVE_UNSIGNED_CAST(b) << 16) | \
|
||||
(ANDROID_NATIVE_UNSIGNED_CAST(c) << 8) | \
|
||||
(ANDROID_NATIVE_UNSIGNED_CAST(d)))
|
||||
|
||||
#define ANDROID_NATIVE_BUFFER_MAGIC ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r')
|
||||
|
||||
|
||||
typedef struct android_native_base_t
|
||||
{
|
||||
/* a magic value defined by the actual EGL native type */
|
||||
int magic;
|
||||
|
||||
/* the sizeof() of the actual EGL native type */
|
||||
int version;
|
||||
|
||||
void* reserved[4];
|
||||
|
||||
/* reference-counting interface */
|
||||
void (*incRef)(struct android_native_base_t* base);
|
||||
void (*decRef)(struct android_native_base_t* base);
|
||||
} android_native_base_t;
|
||||
|
||||
typedef struct android_native_rect_t
|
||||
{
|
||||
int32_t left;
|
||||
int32_t top;
|
||||
int32_t right;
|
||||
int32_t bottom;
|
||||
} android_native_rect_t;
|
||||
|
||||
typedef struct ANativeWindowBuffer
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
ANativeWindowBuffer() {
|
||||
common.magic = ANDROID_NATIVE_BUFFER_MAGIC;
|
||||
common.version = sizeof(ANativeWindowBuffer);
|
||||
memset(common.reserved, 0, sizeof(common.reserved));
|
||||
}
|
||||
|
||||
// Implement the methods that sp<ANativeWindowBuffer> expects so that it
|
||||
// can be used to automatically refcount ANativeWindowBuffer's.
|
||||
void incStrong(const void* /*id*/) const {
|
||||
common.incRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
void decStrong(const void* /*id*/) const {
|
||||
common.decRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
#endif
|
||||
|
||||
struct android_native_base_t common;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int stride;
|
||||
int format;
|
||||
int usage_deprecated;
|
||||
uintptr_t layerCount;
|
||||
|
||||
void* reserved[1];
|
||||
|
||||
const native_handle_t* handle;
|
||||
uint64_t usage;
|
||||
|
||||
// we needed extra space for storing the 64-bits usage flags
|
||||
// the number of slots to use from reserved_proc depends on the
|
||||
// architecture.
|
||||
void* reserved_proc[8 - (sizeof(uint64_t) / sizeof(void*))];
|
||||
} ANativeWindowBuffer_t;
|
||||
|
||||
typedef struct ANativeWindowBuffer ANativeWindowBuffer;
|
||||
|
||||
// Old typedef for backwards compatibility.
|
||||
typedef ANativeWindowBuffer_t android_native_buffer_t;
|
||||
|
||||
__END_DECLS
|
||||
@@ -0,0 +1,106 @@
|
||||
/*
|
||||
* Copyright 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/**
|
||||
* @addtogroup Sync
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file sync.h
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_SYNC_H
|
||||
#define ANDROID_SYNC_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
|
||||
#include <linux/sync_file.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/* Fences indicate the status of an asynchronous task. They are initially
|
||||
* in unsignaled state (0), and make a one-time transition to either signaled
|
||||
* (1) or error (< 0) state. A sync file is a collection of one or more fences;
|
||||
* the sync file's status is error if any of its fences are in error state,
|
||||
* signaled if all of the child fences are signaled, or unsignaled otherwise.
|
||||
*
|
||||
* Sync files are created by various device APIs in response to submitting
|
||||
* tasks to the device. Standard file descriptor lifetime syscalls like dup()
|
||||
* and close() are used to manage sync file lifetime.
|
||||
*
|
||||
* The poll(), ppoll(), or select() syscalls can be used to wait for the sync
|
||||
* file to change status, or (with a timeout of zero) to check its status.
|
||||
*
|
||||
* The functions below provide a few additional sync-specific operations.
|
||||
*/
|
||||
|
||||
/**
|
||||
* Merge two sync files.
|
||||
*
|
||||
* This produces a new sync file with the given name which has the union of the
|
||||
* two original sync file's fences; redundant fences may be removed.
|
||||
*
|
||||
* If one of the input sync files is signaled or invalid, then this function
|
||||
* may behave like dup(): the new file descriptor refers to the valid/unsignaled
|
||||
* sync file with its original name, rather than a new sync file.
|
||||
*
|
||||
* The original fences remain valid, and the caller is responsible for closing
|
||||
* them.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
int32_t sync_merge(const char* name, int32_t fd1, int32_t fd2) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Retrieve detailed information about a sync file and its fences.
|
||||
*
|
||||
* The returned sync_file_info must be freed by calling sync_file_info_free().
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
struct sync_file_info* sync_file_info(int32_t fd) __INTRODUCED_IN(26);
|
||||
|
||||
/**
|
||||
* Get the array of fence infos from the sync file's info.
|
||||
*
|
||||
* The returned array is owned by the parent sync file info, and has
|
||||
* info->num_fences entries.
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
static inline struct sync_fence_info* sync_get_fence_info(const struct sync_file_info* info) {
|
||||
// This header should compile in C, but some C++ projects enable
|
||||
// warnings-as-error for C-style casts.
|
||||
#pragma GCC diagnostic push
|
||||
#pragma GCC diagnostic ignored "-Wold-style-cast"
|
||||
return (struct sync_fence_info *)(uintptr_t)(info->sync_fence_info);
|
||||
#pragma GCC diagnostic pop
|
||||
}
|
||||
|
||||
/**
|
||||
* Free a struct sync_file_info structure
|
||||
*
|
||||
* Available since API level 26.
|
||||
*/
|
||||
void sync_file_info_free(struct sync_file_info* info) __INTRODUCED_IN(26);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_SYNC_H */
|
||||
|
||||
/** @} */
|
||||
@@ -0,0 +1 @@
|
||||
../android/sync.h
|
||||
@@ -0,0 +1,307 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H
|
||||
#define SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
#include <cutils/native_handle.h>
|
||||
#include <hardware/hardware.h>
|
||||
#include <hardware/gralloc.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/**
|
||||
* A set of bit masks for specifying how the received preview frames are
|
||||
* handled before the previewCallback() call.
|
||||
*
|
||||
* The least significant 3 bits of an "int" value are used for this purpose:
|
||||
*
|
||||
* ..... 0 0 0
|
||||
* ^ ^ ^
|
||||
* | | |---------> determine whether the callback is enabled or not
|
||||
* | |-----------> determine whether the callback is one-shot or not
|
||||
* |-------------> determine whether the frame is copied out or not
|
||||
*
|
||||
* WARNING: When a frame is sent directly without copying, it is the frame
|
||||
* receiver's responsiblity to make sure that the frame data won't get
|
||||
* corrupted by subsequent preview frames filled by the camera. This flag is
|
||||
* recommended only when copying out data brings significant performance price
|
||||
* and the handling/processing of the received frame data is always faster than
|
||||
* the preview frame rate so that data corruption won't occur.
|
||||
*
|
||||
* For instance,
|
||||
* 1. 0x00 disables the callback. In this case, copy out and one shot bits
|
||||
* are ignored.
|
||||
* 2. 0x01 enables a callback without copying out the received frames. A
|
||||
* typical use case is the Camcorder application to avoid making costly
|
||||
* frame copies.
|
||||
* 3. 0x05 is enabling a callback with frame copied out repeatedly. A typical
|
||||
* use case is the Camera application.
|
||||
* 4. 0x07 is enabling a callback with frame copied out only once. A typical
|
||||
* use case is the Barcode scanner application.
|
||||
*/
|
||||
|
||||
enum {
|
||||
CAMERA_FRAME_CALLBACK_FLAG_ENABLE_MASK = 0x01,
|
||||
CAMERA_FRAME_CALLBACK_FLAG_ONE_SHOT_MASK = 0x02,
|
||||
CAMERA_FRAME_CALLBACK_FLAG_COPY_OUT_MASK = 0x04,
|
||||
/** Typical use cases */
|
||||
CAMERA_FRAME_CALLBACK_FLAG_NOOP = 0x00,
|
||||
CAMERA_FRAME_CALLBACK_FLAG_CAMCORDER = 0x01,
|
||||
CAMERA_FRAME_CALLBACK_FLAG_CAMERA = 0x05,
|
||||
CAMERA_FRAME_CALLBACK_FLAG_BARCODE_SCANNER = 0x07
|
||||
};
|
||||
|
||||
/** msgType in notifyCallback and dataCallback functions */
|
||||
enum {
|
||||
CAMERA_MSG_ERROR = 0x0001, // notifyCallback
|
||||
CAMERA_MSG_SHUTTER = 0x0002, // notifyCallback
|
||||
CAMERA_MSG_FOCUS = 0x0004, // notifyCallback
|
||||
CAMERA_MSG_ZOOM = 0x0008, // notifyCallback
|
||||
CAMERA_MSG_PREVIEW_FRAME = 0x0010, // dataCallback
|
||||
CAMERA_MSG_VIDEO_FRAME = 0x0020, // data_timestamp_callback
|
||||
CAMERA_MSG_POSTVIEW_FRAME = 0x0040, // dataCallback
|
||||
CAMERA_MSG_RAW_IMAGE = 0x0080, // dataCallback
|
||||
CAMERA_MSG_COMPRESSED_IMAGE = 0x0100, // dataCallback
|
||||
CAMERA_MSG_RAW_IMAGE_NOTIFY = 0x0200, // dataCallback
|
||||
// Preview frame metadata. This can be combined with
|
||||
// CAMERA_MSG_PREVIEW_FRAME in dataCallback. For example, the apps can
|
||||
// request FRAME and METADATA. Or the apps can request only FRAME or only
|
||||
// METADATA.
|
||||
CAMERA_MSG_PREVIEW_METADATA = 0x0400, // dataCallback
|
||||
// Notify on autofocus start and stop. This is useful in continuous
|
||||
// autofocus - FOCUS_MODE_CONTINUOUS_VIDEO and FOCUS_MODE_CONTINUOUS_PICTURE.
|
||||
CAMERA_MSG_FOCUS_MOVE = 0x0800, // notifyCallback
|
||||
CAMERA_MSG_ALL_MSGS = 0xFFFF
|
||||
};
|
||||
|
||||
/** cmdType in sendCommand functions */
|
||||
enum {
|
||||
CAMERA_CMD_START_SMOOTH_ZOOM = 1,
|
||||
CAMERA_CMD_STOP_SMOOTH_ZOOM = 2,
|
||||
|
||||
/**
|
||||
* Set the clockwise rotation of preview display (setPreviewDisplay) in
|
||||
* degrees. This affects the preview frames and the picture displayed after
|
||||
* snapshot. This method is useful for portrait mode applications. Note
|
||||
* that preview display of front-facing cameras is flipped horizontally
|
||||
* before the rotation, that is, the image is reflected along the central
|
||||
* vertical axis of the camera sensor. So the users can see themselves as
|
||||
* looking into a mirror.
|
||||
*
|
||||
* This does not affect the order of byte array of
|
||||
* CAMERA_MSG_PREVIEW_FRAME, CAMERA_MSG_VIDEO_FRAME,
|
||||
* CAMERA_MSG_POSTVIEW_FRAME, CAMERA_MSG_RAW_IMAGE, or
|
||||
* CAMERA_MSG_COMPRESSED_IMAGE. This is allowed to be set during preview
|
||||
* since API level 14.
|
||||
*/
|
||||
CAMERA_CMD_SET_DISPLAY_ORIENTATION = 3,
|
||||
|
||||
/**
|
||||
* cmdType to disable/enable shutter sound. In sendCommand passing arg1 =
|
||||
* 0 will disable, while passing arg1 = 1 will enable the shutter sound.
|
||||
*/
|
||||
CAMERA_CMD_ENABLE_SHUTTER_SOUND = 4,
|
||||
|
||||
/* cmdType to play recording sound */
|
||||
CAMERA_CMD_PLAY_RECORDING_SOUND = 5,
|
||||
|
||||
/**
|
||||
* Start the face detection. This should be called after preview is started.
|
||||
* The camera will notify the listener of CAMERA_MSG_FACE and the detected
|
||||
* faces in the preview frame. The detected faces may be the same as the
|
||||
* previous ones. Apps should call CAMERA_CMD_STOP_FACE_DETECTION to stop
|
||||
* the face detection. This method is supported if CameraParameters
|
||||
* KEY_MAX_NUM_HW_DETECTED_FACES or KEY_MAX_NUM_SW_DETECTED_FACES is
|
||||
* bigger than 0. Hardware and software face detection should not be running
|
||||
* at the same time. If the face detection has started, apps should not send
|
||||
* this again.
|
||||
*
|
||||
* In hardware face detection mode, CameraParameters KEY_WHITE_BALANCE,
|
||||
* KEY_FOCUS_AREAS and KEY_METERING_AREAS have no effect.
|
||||
*
|
||||
* arg1 is the face detection type. It can be CAMERA_FACE_DETECTION_HW or
|
||||
* CAMERA_FACE_DETECTION_SW. If the type of face detection requested is not
|
||||
* supported, the HAL must return BAD_VALUE.
|
||||
*/
|
||||
CAMERA_CMD_START_FACE_DETECTION = 6,
|
||||
|
||||
/**
|
||||
* Stop the face detection.
|
||||
*/
|
||||
CAMERA_CMD_STOP_FACE_DETECTION = 7,
|
||||
|
||||
/**
|
||||
* Enable/disable focus move callback (CAMERA_MSG_FOCUS_MOVE). Passing
|
||||
* arg1 = 0 will disable, while passing arg1 = 1 will enable the callback.
|
||||
*/
|
||||
CAMERA_CMD_ENABLE_FOCUS_MOVE_MSG = 8,
|
||||
|
||||
/**
|
||||
* Ping camera service to see if camera hardware is released.
|
||||
*
|
||||
* When any camera method returns error, the client can use ping command
|
||||
* to see if the camera has been taken away by other clients. If the result
|
||||
* is OK, it means the camera hardware is not released. If the result
|
||||
* is not OK, the camera has been released and the existing client
|
||||
* can silently finish itself or show a dialog.
|
||||
*/
|
||||
CAMERA_CMD_PING = 9,
|
||||
|
||||
/**
|
||||
* Configure the number of video buffers used for recording. The intended
|
||||
* video buffer count for recording is passed as arg1, which must be
|
||||
* greater than 0. This command must be sent before recording is started.
|
||||
* This command returns INVALID_OPERATION error if it is sent after video
|
||||
* recording is started, or the command is not supported at all. This
|
||||
* command also returns a BAD_VALUE error if the intended video buffer
|
||||
* count is non-positive or too big to be realized.
|
||||
*/
|
||||
CAMERA_CMD_SET_VIDEO_BUFFER_COUNT = 10,
|
||||
|
||||
/**
|
||||
* Configure an explicit format to use for video recording metadata mode.
|
||||
* This can be used to switch the format from the
|
||||
* default IMPLEMENTATION_DEFINED gralloc format to some other
|
||||
* device-supported format, and the default dataspace from the BT_709 color
|
||||
* space to some other device-supported dataspace. arg1 is the HAL pixel
|
||||
* format, and arg2 is the HAL dataSpace. This command returns
|
||||
* INVALID_OPERATION error if it is sent after video recording is started,
|
||||
* or the command is not supported at all.
|
||||
*
|
||||
* If the gralloc format is set to a format other than
|
||||
* IMPLEMENTATION_DEFINED, then HALv3 devices will use gralloc usage flags
|
||||
* of SW_READ_OFTEN.
|
||||
*/
|
||||
CAMERA_CMD_SET_VIDEO_FORMAT = 11
|
||||
};
|
||||
|
||||
/** camera fatal errors */
|
||||
enum {
|
||||
CAMERA_ERROR_UNKNOWN = 1,
|
||||
/**
|
||||
* Camera was released because another client has connected to the camera.
|
||||
* The original client should call Camera::disconnect immediately after
|
||||
* getting this notification. Otherwise, the camera will be released by
|
||||
* camera service in a short time. The client should not call any method
|
||||
* (except disconnect and sending CAMERA_CMD_PING) after getting this.
|
||||
*/
|
||||
CAMERA_ERROR_RELEASED = 2,
|
||||
|
||||
/**
|
||||
* Camera was released because device policy change or the client application
|
||||
* is going to background. The client should call Camera::disconnect
|
||||
* immediately after getting this notification. Otherwise, the camera will be
|
||||
* released by camera service in a short time. The client should not call any
|
||||
* method (except disconnect and sending CAMERA_CMD_PING) after getting this.
|
||||
*/
|
||||
CAMERA_ERROR_DISABLED = 3,
|
||||
CAMERA_ERROR_SERVER_DIED = 100
|
||||
};
|
||||
|
||||
enum {
|
||||
/** The facing of the camera is opposite to that of the screen. */
|
||||
CAMERA_FACING_BACK = 0,
|
||||
/** The facing of the camera is the same as that of the screen. */
|
||||
CAMERA_FACING_FRONT = 1,
|
||||
/**
|
||||
* The facing of the camera is not fixed relative to the screen.
|
||||
* The cameras with this facing are external cameras, e.g. USB cameras.
|
||||
*/
|
||||
CAMERA_FACING_EXTERNAL = 2
|
||||
};
|
||||
|
||||
enum {
|
||||
/** Hardware face detection. It does not use much CPU. */
|
||||
CAMERA_FACE_DETECTION_HW = 0,
|
||||
/**
|
||||
* Software face detection. It uses some CPU. Applications must use
|
||||
* Camera.setPreviewTexture for preview in this mode.
|
||||
*/
|
||||
CAMERA_FACE_DETECTION_SW = 1
|
||||
};
|
||||
|
||||
/**
|
||||
* The information of a face from camera face detection.
|
||||
*/
|
||||
typedef struct camera_face {
|
||||
/**
|
||||
* Bounds of the face [left, top, right, bottom]. (-1000, -1000) represents
|
||||
* the top-left of the camera field of view, and (1000, 1000) represents the
|
||||
* bottom-right of the field of view. The width and height cannot be 0 or
|
||||
* negative. This is supported by both hardware and software face detection.
|
||||
*
|
||||
* The direction is relative to the sensor orientation, that is, what the
|
||||
* sensor sees. The direction is not affected by the rotation or mirroring
|
||||
* of CAMERA_CMD_SET_DISPLAY_ORIENTATION.
|
||||
*/
|
||||
int32_t rect[4];
|
||||
|
||||
/**
|
||||
* The confidence level of the face. The range is 1 to 100. 100 is the
|
||||
* highest confidence. This is supported by both hardware and software
|
||||
* face detection.
|
||||
*/
|
||||
int32_t score;
|
||||
|
||||
/**
|
||||
* An unique id per face while the face is visible to the tracker. If
|
||||
* the face leaves the field-of-view and comes back, it will get a new
|
||||
* id. If the value is 0, id is not supported.
|
||||
*/
|
||||
int32_t id;
|
||||
|
||||
/**
|
||||
* The coordinates of the center of the left eye. The range is -1000 to
|
||||
* 1000. -2000, -2000 if this is not supported.
|
||||
*/
|
||||
int32_t left_eye[2];
|
||||
|
||||
/**
|
||||
* The coordinates of the center of the right eye. The range is -1000 to
|
||||
* 1000. -2000, -2000 if this is not supported.
|
||||
*/
|
||||
int32_t right_eye[2];
|
||||
|
||||
/**
|
||||
* The coordinates of the center of the mouth. The range is -1000 to 1000.
|
||||
* -2000, -2000 if this is not supported.
|
||||
*/
|
||||
int32_t mouth[2];
|
||||
|
||||
} camera_face_t;
|
||||
|
||||
/**
|
||||
* The metadata of the frame data.
|
||||
*/
|
||||
typedef struct camera_frame_metadata {
|
||||
/**
|
||||
* The number of detected faces in the frame.
|
||||
*/
|
||||
int32_t number_of_faces;
|
||||
|
||||
/**
|
||||
* An array of the detected faces. The length is number_of_faces.
|
||||
*/
|
||||
camera_face_t *faces;
|
||||
} camera_frame_metadata_t;
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* SYSTEM_CORE_INCLUDE_ANDROID_CAMERA_H */
|
||||
@@ -0,0 +1,140 @@
|
||||
// This file is autogenerated by hidl-gen. Do not edit manually.
|
||||
// Source: android.hardware.graphics.common@1.0
|
||||
// Location: hardware/interfaces/graphics/common/1.0/
|
||||
|
||||
#ifndef HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_0_EXPORTED_CONSTANTS_H_
|
||||
#define HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_0_EXPORTED_CONSTANTS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
HAL_PIXEL_FORMAT_RGBA_8888 = 1,
|
||||
HAL_PIXEL_FORMAT_RGBX_8888 = 2,
|
||||
HAL_PIXEL_FORMAT_RGB_888 = 3,
|
||||
HAL_PIXEL_FORMAT_RGB_565 = 4,
|
||||
HAL_PIXEL_FORMAT_BGRA_8888 = 5,
|
||||
HAL_PIXEL_FORMAT_YCBCR_422_SP = 16,
|
||||
HAL_PIXEL_FORMAT_YCRCB_420_SP = 17,
|
||||
HAL_PIXEL_FORMAT_YCBCR_422_I = 20,
|
||||
HAL_PIXEL_FORMAT_RGBA_FP16 = 22,
|
||||
HAL_PIXEL_FORMAT_RAW16 = 32,
|
||||
HAL_PIXEL_FORMAT_BLOB = 33,
|
||||
HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED = 34,
|
||||
HAL_PIXEL_FORMAT_YCBCR_420_888 = 35,
|
||||
HAL_PIXEL_FORMAT_RAW_OPAQUE = 36,
|
||||
HAL_PIXEL_FORMAT_RAW10 = 37,
|
||||
HAL_PIXEL_FORMAT_RAW12 = 38,
|
||||
HAL_PIXEL_FORMAT_RGBA_1010102 = 43,
|
||||
HAL_PIXEL_FORMAT_Y8 = 538982489,
|
||||
HAL_PIXEL_FORMAT_Y16 = 540422489,
|
||||
HAL_PIXEL_FORMAT_YV12 = 842094169,
|
||||
} android_pixel_format_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_TRANSFORM_FLIP_H = 1, // (1 << 0)
|
||||
HAL_TRANSFORM_FLIP_V = 2, // (1 << 1)
|
||||
HAL_TRANSFORM_ROT_90 = 4, // (1 << 2)
|
||||
HAL_TRANSFORM_ROT_180 = 3, // (FLIP_H | FLIP_V)
|
||||
HAL_TRANSFORM_ROT_270 = 7, // ((FLIP_H | FLIP_V) | ROT_90)
|
||||
} android_transform_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_DATASPACE_UNKNOWN = 0,
|
||||
HAL_DATASPACE_ARBITRARY = 1,
|
||||
HAL_DATASPACE_STANDARD_SHIFT = 16,
|
||||
HAL_DATASPACE_STANDARD_MASK = 4128768, // (63 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_UNSPECIFIED = 0, // (0 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT709 = 65536, // (1 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT601_625 = 131072, // (2 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT601_625_UNADJUSTED = 196608, // (3 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT601_525 = 262144, // (4 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT601_525_UNADJUSTED = 327680, // (5 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT2020 = 393216, // (6 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT2020_CONSTANT_LUMINANCE = 458752, // (7 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_BT470M = 524288, // (8 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_FILM = 589824, // (9 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_DCI_P3 = 655360, // (10 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_STANDARD_ADOBE_RGB = 720896, // (11 << STANDARD_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_SHIFT = 22,
|
||||
HAL_DATASPACE_TRANSFER_MASK = 130023424, // (31 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_UNSPECIFIED = 0, // (0 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_LINEAR = 4194304, // (1 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_SRGB = 8388608, // (2 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_SMPTE_170M = 12582912, // (3 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_GAMMA2_2 = 16777216, // (4 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_GAMMA2_6 = 20971520, // (5 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_GAMMA2_8 = 25165824, // (6 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_ST2084 = 29360128, // (7 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_TRANSFER_HLG = 33554432, // (8 << TRANSFER_SHIFT)
|
||||
HAL_DATASPACE_RANGE_SHIFT = 27,
|
||||
HAL_DATASPACE_RANGE_MASK = 939524096, // (7 << RANGE_SHIFT)
|
||||
HAL_DATASPACE_RANGE_UNSPECIFIED = 0, // (0 << RANGE_SHIFT)
|
||||
HAL_DATASPACE_RANGE_FULL = 134217728, // (1 << RANGE_SHIFT)
|
||||
HAL_DATASPACE_RANGE_LIMITED = 268435456, // (2 << RANGE_SHIFT)
|
||||
HAL_DATASPACE_RANGE_EXTENDED = 402653184, // (3 << RANGE_SHIFT)
|
||||
HAL_DATASPACE_SRGB_LINEAR = 512,
|
||||
HAL_DATASPACE_V0_SRGB_LINEAR = 138477568, // ((STANDARD_BT709 | TRANSFER_LINEAR) | RANGE_FULL)
|
||||
HAL_DATASPACE_V0_SCRGB_LINEAR =
|
||||
406913024, // ((STANDARD_BT709 | TRANSFER_LINEAR) | RANGE_EXTENDED)
|
||||
HAL_DATASPACE_SRGB = 513,
|
||||
HAL_DATASPACE_V0_SRGB = 142671872, // ((STANDARD_BT709 | TRANSFER_SRGB) | RANGE_FULL)
|
||||
HAL_DATASPACE_V0_SCRGB = 411107328, // ((STANDARD_BT709 | TRANSFER_SRGB) | RANGE_EXTENDED)
|
||||
HAL_DATASPACE_JFIF = 257,
|
||||
HAL_DATASPACE_V0_JFIF = 146931712, // ((STANDARD_BT601_625 | TRANSFER_SMPTE_170M) | RANGE_FULL)
|
||||
HAL_DATASPACE_BT601_625 = 258,
|
||||
HAL_DATASPACE_V0_BT601_625 =
|
||||
281149440, // ((STANDARD_BT601_625 | TRANSFER_SMPTE_170M) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_BT601_525 = 259,
|
||||
HAL_DATASPACE_V0_BT601_525 =
|
||||
281280512, // ((STANDARD_BT601_525 | TRANSFER_SMPTE_170M) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_BT709 = 260,
|
||||
HAL_DATASPACE_V0_BT709 = 281083904, // ((STANDARD_BT709 | TRANSFER_SMPTE_170M) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_DCI_P3_LINEAR = 139067392, // ((STANDARD_DCI_P3 | TRANSFER_LINEAR) | RANGE_FULL)
|
||||
HAL_DATASPACE_DCI_P3 = 155844608, // ((STANDARD_DCI_P3 | TRANSFER_GAMMA2_6) | RANGE_FULL)
|
||||
HAL_DATASPACE_DISPLAY_P3_LINEAR =
|
||||
139067392, // ((STANDARD_DCI_P3 | TRANSFER_LINEAR) | RANGE_FULL)
|
||||
HAL_DATASPACE_DISPLAY_P3 = 143261696, // ((STANDARD_DCI_P3 | TRANSFER_SRGB) | RANGE_FULL)
|
||||
HAL_DATASPACE_ADOBE_RGB = 151715840, // ((STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2) | RANGE_FULL)
|
||||
HAL_DATASPACE_BT2020_LINEAR = 138805248, // ((STANDARD_BT2020 | TRANSFER_LINEAR) | RANGE_FULL)
|
||||
HAL_DATASPACE_BT2020 = 147193856, // ((STANDARD_BT2020 | TRANSFER_SMPTE_170M) | RANGE_FULL)
|
||||
HAL_DATASPACE_BT2020_PQ = 163971072, // ((STANDARD_BT2020 | TRANSFER_ST2084) | RANGE_FULL)
|
||||
HAL_DATASPACE_DEPTH = 4096,
|
||||
HAL_DATASPACE_SENSOR = 4097,
|
||||
} android_dataspace_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_COLOR_MODE_NATIVE = 0,
|
||||
HAL_COLOR_MODE_STANDARD_BT601_625 = 1,
|
||||
HAL_COLOR_MODE_STANDARD_BT601_625_UNADJUSTED = 2,
|
||||
HAL_COLOR_MODE_STANDARD_BT601_525 = 3,
|
||||
HAL_COLOR_MODE_STANDARD_BT601_525_UNADJUSTED = 4,
|
||||
HAL_COLOR_MODE_STANDARD_BT709 = 5,
|
||||
HAL_COLOR_MODE_DCI_P3 = 6,
|
||||
HAL_COLOR_MODE_SRGB = 7,
|
||||
HAL_COLOR_MODE_ADOBE_RGB = 8,
|
||||
HAL_COLOR_MODE_DISPLAY_P3 = 9,
|
||||
} android_color_mode_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_COLOR_TRANSFORM_IDENTITY = 0,
|
||||
HAL_COLOR_TRANSFORM_ARBITRARY_MATRIX = 1,
|
||||
HAL_COLOR_TRANSFORM_VALUE_INVERSE = 2,
|
||||
HAL_COLOR_TRANSFORM_GRAYSCALE = 3,
|
||||
HAL_COLOR_TRANSFORM_CORRECT_PROTANOPIA = 4,
|
||||
HAL_COLOR_TRANSFORM_CORRECT_DEUTERANOPIA = 5,
|
||||
HAL_COLOR_TRANSFORM_CORRECT_TRITANOPIA = 6,
|
||||
} android_color_transform_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_HDR_DOLBY_VISION = 1,
|
||||
HAL_HDR_HDR10 = 2,
|
||||
HAL_HDR_HLG = 3,
|
||||
} android_hdr_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_0_EXPORTED_CONSTANTS_H_
|
||||
@@ -0,0 +1,48 @@
|
||||
// This file is autogenerated by hidl-gen. Do not edit manually.
|
||||
// Source: android.hardware.graphics.common@1.1
|
||||
// Location: hardware/interfaces/graphics/common/1.1/
|
||||
|
||||
#ifndef HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_1_EXPORTED_CONSTANTS_H_
|
||||
#define HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_1_EXPORTED_CONSTANTS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
HAL_PIXEL_FORMAT_DEPTH_16 = 48,
|
||||
HAL_PIXEL_FORMAT_DEPTH_24 = 49,
|
||||
HAL_PIXEL_FORMAT_DEPTH_24_STENCIL_8 = 50,
|
||||
HAL_PIXEL_FORMAT_DEPTH_32F = 51,
|
||||
HAL_PIXEL_FORMAT_DEPTH_32F_STENCIL_8 = 52,
|
||||
HAL_PIXEL_FORMAT_STENCIL_8 = 53,
|
||||
HAL_PIXEL_FORMAT_YCBCR_P010 = 54,
|
||||
} android_pixel_format_v1_1_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_DATASPACE_BT2020_ITU =
|
||||
281411584, // ((STANDARD_BT2020 | TRANSFER_SMPTE_170M) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_BT2020_ITU_PQ =
|
||||
298188800, // ((STANDARD_BT2020 | TRANSFER_ST2084) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_BT2020_ITU_HLG = 302383104, // ((STANDARD_BT2020 | TRANSFER_HLG) | RANGE_LIMITED)
|
||||
HAL_DATASPACE_BT2020_HLG = 168165376, // ((STANDARD_BT2020 | TRANSFER_HLG) | RANGE_FULL)
|
||||
} android_dataspace_v1_1_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_COLOR_MODE_BT2020 = 10,
|
||||
HAL_COLOR_MODE_BT2100_PQ = 11,
|
||||
HAL_COLOR_MODE_BT2100_HLG = 12,
|
||||
} android_color_mode_v1_1_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_RENDER_INTENT_COLORIMETRIC = 0,
|
||||
HAL_RENDER_INTENT_ENHANCE = 1,
|
||||
HAL_RENDER_INTENT_TONE_MAP_COLORIMETRIC = 2,
|
||||
HAL_RENDER_INTENT_TONE_MAP_ENHANCE = 3,
|
||||
} android_render_intent_v1_1_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_1_EXPORTED_CONSTANTS_H_
|
||||
@@ -0,0 +1,31 @@
|
||||
// This file is autogenerated by hidl-gen. Do not edit manually.
|
||||
// Source: android.hardware.graphics.common@1.2
|
||||
// Location: hardware/interfaces/graphics/common/1.2/
|
||||
|
||||
#ifndef HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_2_EXPORTED_CONSTANTS_H_
|
||||
#define HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_2_EXPORTED_CONSTANTS_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
typedef enum {
|
||||
HAL_HDR_HDR10_PLUS = 4,
|
||||
} android_hdr_v1_2_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_DATASPACE_DISPLAY_BT2020 = 142999552 /* ((STANDARD_BT2020 | TRANSFER_SRGB) | RANGE_FULL) */,
|
||||
HAL_DATASPACE_DYNAMIC_DEPTH = 4098 /* 0x1002 */,
|
||||
HAL_DATASPACE_JPEG_APP_SEGMENTS = 4099 /* 0x1003 */,
|
||||
HAL_DATASPACE_HEIF = 4100 /* 0x1004 */,
|
||||
} android_dataspace_v1_2_t;
|
||||
|
||||
typedef enum {
|
||||
HAL_PIXEL_FORMAT_HSV_888 = 55 /* 0x37 */,
|
||||
} android_pixel_format_v1_2_t;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif // HIDL_GENERATED_ANDROID_HARDWARE_GRAPHICS_COMMON_V1_2_EXPORTED_CONSTANTS_H_
|
||||
@@ -0,0 +1,8 @@
|
||||
#ifndef SYSTEM_CORE_GRAPHICS_BASE_H_
|
||||
#define SYSTEM_CORE_GRAPHICS_BASE_H_
|
||||
|
||||
#include "graphics-base-v1.0.h"
|
||||
#include "graphics-base-v1.1.h"
|
||||
#include "graphics-base-v1.2.h"
|
||||
|
||||
#endif // SYSTEM_CORE_GRAPHICS_BASE_H_
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef SYSTEM_CORE_GRAPHICS_SW_H_
|
||||
#define SYSTEM_CORE_GRAPHICS_SW_H_
|
||||
|
||||
/* Software formats not in the HAL definitions. */
|
||||
typedef enum {
|
||||
HAL_PIXEL_FORMAT_YCBCR_422_888 = 39, // 0x27
|
||||
HAL_PIXEL_FORMAT_YCBCR_444_888 = 40, // 0x28
|
||||
HAL_PIXEL_FORMAT_FLEX_RGB_888 = 41, // 0x29
|
||||
HAL_PIXEL_FORMAT_FLEX_RGBA_8888 = 42, // 0x2A
|
||||
} android_pixel_format_sw_t;
|
||||
|
||||
/* for compatibility */
|
||||
#define HAL_PIXEL_FORMAT_YCbCr_422_888 HAL_PIXEL_FORMAT_YCBCR_422_888
|
||||
#define HAL_PIXEL_FORMAT_YCbCr_444_888 HAL_PIXEL_FORMAT_YCBCR_444_888
|
||||
|
||||
#endif // SYSTEM_CORE_GRAPHICS_SW_H_
|
||||
@@ -0,0 +1,268 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H
|
||||
#define SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
/*
|
||||
* Some of the enums are now defined in HIDL in hardware/interfaces and are
|
||||
* generated.
|
||||
*/
|
||||
#include "graphics-base.h"
|
||||
#include "graphics-sw.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/* for compatibility */
|
||||
#define HAL_PIXEL_FORMAT_YCbCr_420_888 HAL_PIXEL_FORMAT_YCBCR_420_888
|
||||
#define HAL_PIXEL_FORMAT_YCbCr_422_SP HAL_PIXEL_FORMAT_YCBCR_422_SP
|
||||
#define HAL_PIXEL_FORMAT_YCrCb_420_SP HAL_PIXEL_FORMAT_YCRCB_420_SP
|
||||
#define HAL_PIXEL_FORMAT_YCbCr_422_I HAL_PIXEL_FORMAT_YCBCR_422_I
|
||||
typedef android_pixel_format_t android_pixel_format;
|
||||
typedef android_transform_t android_transform;
|
||||
typedef android_dataspace_t android_dataspace;
|
||||
typedef android_color_mode_t android_color_mode;
|
||||
typedef android_color_transform_t android_color_transform;
|
||||
typedef android_hdr_t android_hdr;
|
||||
|
||||
/*
|
||||
* If the HAL needs to create service threads to handle graphics related
|
||||
* tasks, these threads need to run at HAL_PRIORITY_URGENT_DISPLAY priority
|
||||
* if they can block the main rendering thread in any way.
|
||||
*
|
||||
* the priority of the current thread can be set with:
|
||||
*
|
||||
* #include <sys/resource.h>
|
||||
* setpriority(PRIO_PROCESS, 0, HAL_PRIORITY_URGENT_DISPLAY);
|
||||
*
|
||||
*/
|
||||
|
||||
#define HAL_PRIORITY_URGENT_DISPLAY (-8)
|
||||
|
||||
/*
|
||||
* Structure for describing YCbCr formats for consumption by applications.
|
||||
* This is used with HAL_PIXEL_FORMAT_YCbCr_*_888.
|
||||
*
|
||||
* Buffer chroma subsampling is defined in the format.
|
||||
* e.g. HAL_PIXEL_FORMAT_YCbCr_420_888 has subsampling 4:2:0.
|
||||
*
|
||||
* Buffers must have a 8 bit depth.
|
||||
*
|
||||
* y, cb, and cr point to the first byte of their respective planes.
|
||||
*
|
||||
* Stride describes the distance in bytes from the first value of one row of
|
||||
* the image to the first value of the next row. It includes the width of the
|
||||
* image plus padding.
|
||||
* ystride is the stride of the luma plane.
|
||||
* cstride is the stride of the chroma planes.
|
||||
*
|
||||
* chroma_step is the distance in bytes from one chroma pixel value to the
|
||||
* next. This is 2 bytes for semiplanar (because chroma values are interleaved
|
||||
* and each chroma value is one byte) and 1 for planar.
|
||||
*/
|
||||
|
||||
struct android_ycbcr {
|
||||
void *y;
|
||||
void *cb;
|
||||
void *cr;
|
||||
size_t ystride;
|
||||
size_t cstride;
|
||||
size_t chroma_step;
|
||||
|
||||
/** reserved for future use, set to 0 by gralloc's (*lock_ycbcr)() */
|
||||
uint32_t reserved[8];
|
||||
};
|
||||
|
||||
/*
|
||||
* Structures for describing flexible YUVA/RGBA formats for consumption by
|
||||
* applications. Such flexible formats contain a plane for each component (e.g.
|
||||
* red, green, blue), where each plane is laid out in a grid-like pattern
|
||||
* occupying unique byte addresses and with consistent byte offsets between
|
||||
* neighboring pixels.
|
||||
*
|
||||
* The android_flex_layout structure is used with any pixel format that can be
|
||||
* represented by it, such as:
|
||||
* - HAL_PIXEL_FORMAT_YCbCr_*_888
|
||||
* - HAL_PIXEL_FORMAT_FLEX_RGB*_888
|
||||
* - HAL_PIXEL_FORMAT_RGB[AX]_888[8],BGRA_8888,RGB_888
|
||||
* - HAL_PIXEL_FORMAT_YV12,Y8,Y16,YCbCr_422_SP/I,YCrCb_420_SP
|
||||
* - even implementation defined formats that can be represented by
|
||||
* the structures
|
||||
*
|
||||
* Vertical increment (aka. row increment or stride) describes the distance in
|
||||
* bytes from the first pixel of one row to the first pixel of the next row
|
||||
* (below) for the component plane. This can be negative.
|
||||
*
|
||||
* Horizontal increment (aka. column or pixel increment) describes the distance
|
||||
* in bytes from one pixel to the next pixel (to the right) on the same row for
|
||||
* the component plane. This can be negative.
|
||||
*
|
||||
* Each plane can be subsampled either vertically or horizontally by
|
||||
* a power-of-two factor.
|
||||
*
|
||||
* The bit-depth of each component can be arbitrary, as long as the pixels are
|
||||
* laid out on whole bytes, in native byte-order, using the most significant
|
||||
* bits of each unit.
|
||||
*/
|
||||
|
||||
typedef enum android_flex_component {
|
||||
/* luma */
|
||||
FLEX_COMPONENT_Y = 1 << 0,
|
||||
/* chroma blue */
|
||||
FLEX_COMPONENT_Cb = 1 << 1,
|
||||
/* chroma red */
|
||||
FLEX_COMPONENT_Cr = 1 << 2,
|
||||
|
||||
/* red */
|
||||
FLEX_COMPONENT_R = 1 << 10,
|
||||
/* green */
|
||||
FLEX_COMPONENT_G = 1 << 11,
|
||||
/* blue */
|
||||
FLEX_COMPONENT_B = 1 << 12,
|
||||
|
||||
/* alpha */
|
||||
FLEX_COMPONENT_A = 1 << 30,
|
||||
} android_flex_component_t;
|
||||
|
||||
typedef struct android_flex_plane {
|
||||
/* pointer to the first byte of the top-left pixel of the plane. */
|
||||
uint8_t *top_left;
|
||||
|
||||
android_flex_component_t component;
|
||||
|
||||
/* bits allocated for the component in each pixel. Must be a positive
|
||||
multiple of 8. */
|
||||
int32_t bits_per_component;
|
||||
/* number of the most significant bits used in the format for this
|
||||
component. Must be between 1 and bits_per_component, inclusive. */
|
||||
int32_t bits_used;
|
||||
|
||||
/* horizontal increment */
|
||||
int32_t h_increment;
|
||||
/* vertical increment */
|
||||
int32_t v_increment;
|
||||
/* horizontal subsampling. Must be a positive power of 2. */
|
||||
int32_t h_subsampling;
|
||||
/* vertical subsampling. Must be a positive power of 2. */
|
||||
int32_t v_subsampling;
|
||||
} android_flex_plane_t;
|
||||
|
||||
typedef enum android_flex_format {
|
||||
/* not a flexible format */
|
||||
FLEX_FORMAT_INVALID = 0x0,
|
||||
FLEX_FORMAT_Y = FLEX_COMPONENT_Y,
|
||||
FLEX_FORMAT_YCbCr = FLEX_COMPONENT_Y | FLEX_COMPONENT_Cb | FLEX_COMPONENT_Cr,
|
||||
FLEX_FORMAT_YCbCrA = FLEX_FORMAT_YCbCr | FLEX_COMPONENT_A,
|
||||
FLEX_FORMAT_RGB = FLEX_COMPONENT_R | FLEX_COMPONENT_G | FLEX_COMPONENT_B,
|
||||
FLEX_FORMAT_RGBA = FLEX_FORMAT_RGB | FLEX_COMPONENT_A,
|
||||
} android_flex_format_t;
|
||||
|
||||
typedef struct android_flex_layout {
|
||||
/* the kind of flexible format */
|
||||
android_flex_format_t format;
|
||||
|
||||
/* number of planes; 0 for FLEX_FORMAT_INVALID */
|
||||
uint32_t num_planes;
|
||||
/* a plane for each component; ordered in increasing component value order.
|
||||
E.g. FLEX_FORMAT_RGBA maps 0 -> R, 1 -> G, etc.
|
||||
Can be NULL for FLEX_FORMAT_INVALID */
|
||||
android_flex_plane_t *planes;
|
||||
} android_flex_layout_t;
|
||||
|
||||
/**
|
||||
* Structure used to define depth point clouds for format HAL_PIXEL_FORMAT_BLOB
|
||||
* with dataSpace value of HAL_DATASPACE_DEPTH.
|
||||
* When locking a native buffer of the above format and dataSpace value,
|
||||
* the vaddr pointer can be cast to this structure.
|
||||
*
|
||||
* A variable-length list of (x,y,z, confidence) 3D points, as floats. (x, y,
|
||||
* z) represents a measured point's position, with the coordinate system defined
|
||||
* by the data source. Confidence represents the estimated likelihood that this
|
||||
* measurement is correct. It is between 0.f and 1.f, inclusive, with 1.f ==
|
||||
* 100% confidence.
|
||||
*
|
||||
* num_points is the number of points in the list
|
||||
*
|
||||
* xyz_points is the flexible array of floating-point values.
|
||||
* It contains (num_points) * 4 floats.
|
||||
*
|
||||
* For example:
|
||||
* android_depth_points d = get_depth_buffer();
|
||||
* struct {
|
||||
* float x; float y; float z; float confidence;
|
||||
* } firstPoint, lastPoint;
|
||||
*
|
||||
* firstPoint.x = d.xyzc_points[0];
|
||||
* firstPoint.y = d.xyzc_points[1];
|
||||
* firstPoint.z = d.xyzc_points[2];
|
||||
* firstPoint.confidence = d.xyzc_points[3];
|
||||
* lastPoint.x = d.xyzc_points[(d.num_points - 1) * 4 + 0];
|
||||
* lastPoint.y = d.xyzc_points[(d.num_points - 1) * 4 + 1];
|
||||
* lastPoint.z = d.xyzc_points[(d.num_points - 1) * 4 + 2];
|
||||
* lastPoint.confidence = d.xyzc_points[(d.num_points - 1) * 4 + 3];
|
||||
*/
|
||||
|
||||
struct android_depth_points {
|
||||
uint32_t num_points;
|
||||
|
||||
/** reserved for future use, set to 0 by gralloc's (*lock)() */
|
||||
uint32_t reserved[8];
|
||||
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wc99-extensions"
|
||||
#endif
|
||||
float xyzc_points[];
|
||||
#if defined(__clang__)
|
||||
#pragma clang diagnostic pop
|
||||
#endif
|
||||
};
|
||||
|
||||
/**
|
||||
* These structures are used to define the reference display's
|
||||
* capabilities for HDR content. Display engine can use this
|
||||
* to better tone map content to user's display.
|
||||
* Color is defined in CIE XYZ coordinates
|
||||
*/
|
||||
struct android_xy_color {
|
||||
float x;
|
||||
float y;
|
||||
};
|
||||
|
||||
struct android_smpte2086_metadata {
|
||||
struct android_xy_color displayPrimaryRed;
|
||||
struct android_xy_color displayPrimaryGreen;
|
||||
struct android_xy_color displayPrimaryBlue;
|
||||
struct android_xy_color whitePoint;
|
||||
float maxLuminance;
|
||||
float minLuminance;
|
||||
};
|
||||
|
||||
struct android_cta861_3_metadata {
|
||||
float maxContentLightLevel;
|
||||
float maxFrameAverageLightLevel;
|
||||
};
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* SYSTEM_CORE_INCLUDE_ANDROID_GRAPHICS_H */
|
||||
@@ -0,0 +1,254 @@
|
||||
/*
|
||||
* Copyright (C) 2015 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_RADIO_H
|
||||
#define ANDROID_RADIO_H
|
||||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
|
||||
#define RADIO_NUM_BANDS_MAX 16
|
||||
#define RADIO_NUM_SPACINGS_MAX 16
|
||||
#define RADIO_STRING_LEN_MAX 128
|
||||
|
||||
/*
|
||||
* Radio hardware module class. A given radio hardware module HAL is of one class
|
||||
* only. The platform can not have more than one hardware module of each class.
|
||||
* Current version of the framework only supports RADIO_CLASS_AM_FM.
|
||||
*/
|
||||
typedef enum {
|
||||
RADIO_CLASS_AM_FM = 0, /* FM (including HD radio) and AM */
|
||||
RADIO_CLASS_SAT = 1, /* Satellite Radio */
|
||||
RADIO_CLASS_DT = 2, /* Digital Radio (DAB) */
|
||||
} radio_class_t;
|
||||
|
||||
/* value for field "type" of radio band described in struct radio_hal_band_config */
|
||||
typedef enum {
|
||||
RADIO_BAND_AM = 0, /* Amplitude Modulation band: LW, MW, SW */
|
||||
RADIO_BAND_FM = 1, /* Frequency Modulation band: FM */
|
||||
RADIO_BAND_FM_HD = 2, /* FM HD Radio / DRM (IBOC) */
|
||||
RADIO_BAND_AM_HD = 3, /* AM HD Radio / DRM (IBOC) */
|
||||
} radio_band_t;
|
||||
|
||||
/* RDS variant implemented. A struct radio_hal_fm_band_config can list none or several. */
|
||||
enum {
|
||||
RADIO_RDS_NONE = 0x0,
|
||||
RADIO_RDS_WORLD = 0x01,
|
||||
RADIO_RDS_US = 0x02,
|
||||
};
|
||||
typedef unsigned int radio_rds_t;
|
||||
|
||||
/* FM deemphasis variant implemented. A struct radio_hal_fm_band_config can list one or more. */
|
||||
enum {
|
||||
RADIO_DEEMPHASIS_50 = 0x1,
|
||||
RADIO_DEEMPHASIS_75 = 0x2,
|
||||
};
|
||||
typedef unsigned int radio_deemphasis_t;
|
||||
|
||||
/* Region a particular radio band configuration corresponds to. Not used at the HAL.
|
||||
* Derived by the framework when converting the band descriptors retrieved from the HAL to
|
||||
* individual band descriptors for each supported region. */
|
||||
typedef enum {
|
||||
RADIO_REGION_NONE = -1,
|
||||
RADIO_REGION_ITU_1 = 0,
|
||||
RADIO_REGION_ITU_2 = 1,
|
||||
RADIO_REGION_OIRT = 2,
|
||||
RADIO_REGION_JAPAN = 3,
|
||||
RADIO_REGION_KOREA = 4,
|
||||
} radio_region_t;
|
||||
|
||||
/* scanning direction for scan() and step() tuner APIs */
|
||||
typedef enum {
|
||||
RADIO_DIRECTION_UP,
|
||||
RADIO_DIRECTION_DOWN
|
||||
} radio_direction_t;
|
||||
|
||||
/* unique handle allocated to a radio module */
|
||||
typedef uint32_t radio_handle_t;
|
||||
|
||||
/* Opaque meta data structure used by radio meta data API (see system/radio_metadata.h) */
|
||||
typedef struct radio_metadata radio_metadata_t;
|
||||
|
||||
|
||||
/* Additional attributes for an FM band configuration */
|
||||
typedef struct radio_hal_fm_band_config {
|
||||
radio_deemphasis_t deemphasis; /* deemphasis variant */
|
||||
bool stereo; /* stereo supported */
|
||||
radio_rds_t rds; /* RDS variants supported */
|
||||
bool ta; /* Traffic Announcement supported */
|
||||
bool af; /* Alternate Frequency supported */
|
||||
bool ea; /* Emergency announcements supported */
|
||||
} radio_hal_fm_band_config_t;
|
||||
|
||||
/* Additional attributes for an AM band configuration */
|
||||
typedef struct radio_hal_am_band_config {
|
||||
bool stereo; /* stereo supported */
|
||||
} radio_hal_am_band_config_t;
|
||||
|
||||
/* Radio band configuration. Describes a given band supported by the radio module.
|
||||
* The HAL can expose only one band per type with the the maximum range supported and all options.
|
||||
* THe framework will derive the actual regions were this module can operate and expose separate
|
||||
* band configurations for applications to chose from. */
|
||||
typedef struct radio_hal_band_config {
|
||||
radio_band_t type;
|
||||
bool antenna_connected;
|
||||
uint32_t lower_limit;
|
||||
uint32_t upper_limit;
|
||||
uint32_t num_spacings;
|
||||
uint32_t spacings[RADIO_NUM_SPACINGS_MAX];
|
||||
union {
|
||||
radio_hal_fm_band_config_t fm;
|
||||
radio_hal_am_band_config_t am;
|
||||
};
|
||||
} radio_hal_band_config_t;
|
||||
|
||||
/* Used internally by the framework to represent a band for s specific region */
|
||||
typedef struct radio_band_config {
|
||||
radio_region_t region;
|
||||
radio_hal_band_config_t band;
|
||||
} radio_band_config_t;
|
||||
|
||||
|
||||
/* Exposes properties of a given hardware radio module.
|
||||
* NOTE: current framework implementation supports only one audio source (num_audio_sources = 1).
|
||||
* The source corresponds to AUDIO_DEVICE_IN_FM_TUNER.
|
||||
* If more than one tuner is supported (num_tuners > 1), only one can be connected to the audio
|
||||
* source. */
|
||||
typedef struct radio_hal_properties {
|
||||
radio_class_t class_id; /* Class of this module. E.g RADIO_CLASS_AM_FM */
|
||||
char implementor[RADIO_STRING_LEN_MAX]; /* implementor name */
|
||||
char product[RADIO_STRING_LEN_MAX]; /* product name */
|
||||
char version[RADIO_STRING_LEN_MAX]; /* product version */
|
||||
char serial[RADIO_STRING_LEN_MAX]; /* serial number (for subscription services) */
|
||||
uint32_t num_tuners; /* number of tuners controllable independently */
|
||||
uint32_t num_audio_sources; /* number of audio sources driven simultaneously */
|
||||
bool supports_capture; /* the hardware supports capture of audio source audio HAL */
|
||||
uint32_t num_bands; /* number of band descriptors */
|
||||
radio_hal_band_config_t bands[RADIO_NUM_BANDS_MAX]; /* band descriptors */
|
||||
} radio_hal_properties_t;
|
||||
|
||||
/* Used internally by the framework. Same information as in struct radio_hal_properties plus a
|
||||
* unique handle and one band configuration per region. */
|
||||
typedef struct radio_properties {
|
||||
radio_handle_t handle;
|
||||
radio_class_t class_id;
|
||||
char implementor[RADIO_STRING_LEN_MAX];
|
||||
char product[RADIO_STRING_LEN_MAX];
|
||||
char version[RADIO_STRING_LEN_MAX];
|
||||
char serial[RADIO_STRING_LEN_MAX];
|
||||
uint32_t num_tuners;
|
||||
uint32_t num_audio_sources;
|
||||
bool supports_capture;
|
||||
uint32_t num_bands;
|
||||
radio_band_config_t bands[RADIO_NUM_BANDS_MAX];
|
||||
} radio_properties_t;
|
||||
|
||||
/* Radio program information. Returned by the HAL with event RADIO_EVENT_TUNED.
|
||||
* Contains information on currently tuned channel.
|
||||
*/
|
||||
typedef struct radio_program_info {
|
||||
uint32_t channel; /* current channel. (e.g kHz for band type RADIO_BAND_FM) */
|
||||
uint32_t sub_channel; /* current sub channel. (used for RADIO_BAND_FM_HD) */
|
||||
bool tuned; /* tuned to a program or not */
|
||||
bool stereo; /* program is stereo or not */
|
||||
bool digital; /* digital program or not (e.g HD Radio program) */
|
||||
uint32_t signal_strength; /* signal strength from 0 to 100 */
|
||||
/* meta data (e.g PTY, song title ...), must not be NULL */
|
||||
__attribute__((aligned(8))) radio_metadata_t *metadata;
|
||||
} radio_program_info_t;
|
||||
|
||||
|
||||
/* Events sent to the framework via the HAL callback. An event can notify the completion of an
|
||||
* asynchronous command (configuration, tune, scan ...) or a spontaneous change (antenna connection,
|
||||
* failure, AF switching, meta data reception... */
|
||||
enum {
|
||||
RADIO_EVENT_HW_FAILURE = 0, /* hardware module failure. Requires reopening the tuner */
|
||||
RADIO_EVENT_CONFIG = 1, /* configuration change completed */
|
||||
RADIO_EVENT_ANTENNA = 2, /* Antenna connected, disconnected */
|
||||
RADIO_EVENT_TUNED = 3, /* tune, step, scan completed */
|
||||
RADIO_EVENT_METADATA = 4, /* New meta data received */
|
||||
RADIO_EVENT_TA = 5, /* Traffic announcement start or stop */
|
||||
RADIO_EVENT_AF_SWITCH = 6, /* Switch to Alternate Frequency */
|
||||
RADIO_EVENT_EA = 7, /* Emergency announcement start or stop */
|
||||
// begin framework only events
|
||||
RADIO_EVENT_CONTROL = 100, /* loss/gain of tuner control */
|
||||
RADIO_EVENT_SERVER_DIED = 101, /* radio service died */
|
||||
};
|
||||
typedef unsigned int radio_event_type_t;
|
||||
|
||||
/* Event passed to the framework by the HAL callback */
|
||||
typedef struct radio_hal_event {
|
||||
radio_event_type_t type; /* event type */
|
||||
int32_t status; /* used by RADIO_EVENT_CONFIG, RADIO_EVENT_TUNED */
|
||||
union {
|
||||
/* RADIO_EVENT_ANTENNA, RADIO_EVENT_TA, RADIO_EVENT_EA */
|
||||
bool on;
|
||||
radio_hal_band_config_t config; /* RADIO_EVENT_CONFIG */
|
||||
radio_program_info_t info; /* RADIO_EVENT_TUNED, RADIO_EVENT_AF_SWITCH */
|
||||
radio_metadata_t *metadata; /* RADIO_EVENT_METADATA */
|
||||
};
|
||||
} radio_hal_event_t;
|
||||
|
||||
/* Used internally by the framework. Same information as in struct radio_hal_event */
|
||||
typedef struct radio_event {
|
||||
radio_event_type_t type;
|
||||
int32_t status;
|
||||
union {
|
||||
bool on;
|
||||
radio_band_config_t config;
|
||||
radio_program_info_t info;
|
||||
/* meta data (e.g PTY, song title ...), must not be NULL */
|
||||
__attribute__((aligned(8))) radio_metadata_t *metadata;
|
||||
};
|
||||
} radio_event_t;
|
||||
|
||||
|
||||
static inline
|
||||
radio_rds_t radio_rds_for_region(bool rds, radio_region_t region) {
|
||||
if (!rds)
|
||||
return RADIO_RDS_NONE;
|
||||
switch(region) {
|
||||
case RADIO_REGION_ITU_1:
|
||||
case RADIO_REGION_OIRT:
|
||||
case RADIO_REGION_JAPAN:
|
||||
case RADIO_REGION_KOREA:
|
||||
return RADIO_RDS_WORLD;
|
||||
case RADIO_REGION_ITU_2:
|
||||
return RADIO_RDS_US;
|
||||
default:
|
||||
return RADIO_REGION_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
static inline
|
||||
radio_deemphasis_t radio_demephasis_for_region(radio_region_t region) {
|
||||
switch(region) {
|
||||
case RADIO_REGION_KOREA:
|
||||
case RADIO_REGION_ITU_2:
|
||||
return RADIO_DEEMPHASIS_75;
|
||||
case RADIO_REGION_ITU_1:
|
||||
case RADIO_REGION_OIRT:
|
||||
case RADIO_REGION_JAPAN:
|
||||
default:
|
||||
return RADIO_DEEMPHASIS_50;
|
||||
}
|
||||
}
|
||||
|
||||
#endif // ANDROID_RADIO_H
|
||||
@@ -0,0 +1,80 @@
|
||||
/*
|
||||
* Copyright (C) 2013 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_THREAD_DEFS_H
|
||||
#define ANDROID_THREAD_DEFS_H
|
||||
|
||||
#include "graphics.h"
|
||||
|
||||
#if defined(__cplusplus)
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
enum {
|
||||
/*
|
||||
* ***********************************************
|
||||
* ** Keep in sync with android.os.Process.java **
|
||||
* ***********************************************
|
||||
*
|
||||
* This maps directly to the "nice" priorities we use in Android.
|
||||
* A thread priority should be chosen inverse-proportionally to
|
||||
* the amount of work the thread is expected to do. The more work
|
||||
* a thread will do, the less favorable priority it should get so that
|
||||
* it doesn't starve the system. Threads not behaving properly might
|
||||
* be "punished" by the kernel.
|
||||
* Use the levels below when appropriate. Intermediate values are
|
||||
* acceptable, preferably use the {MORE|LESS}_FAVORABLE constants below.
|
||||
*/
|
||||
ANDROID_PRIORITY_LOWEST = 19,
|
||||
|
||||
/* use for background tasks */
|
||||
ANDROID_PRIORITY_BACKGROUND = 10,
|
||||
|
||||
/* most threads run at normal priority */
|
||||
ANDROID_PRIORITY_NORMAL = 0,
|
||||
|
||||
/* threads currently running a UI that the user is interacting with */
|
||||
ANDROID_PRIORITY_FOREGROUND = -2,
|
||||
|
||||
/* the main UI thread has a slightly more favorable priority */
|
||||
ANDROID_PRIORITY_DISPLAY = -4,
|
||||
|
||||
/* ui service treads might want to run at a urgent display (uncommon) */
|
||||
ANDROID_PRIORITY_URGENT_DISPLAY = HAL_PRIORITY_URGENT_DISPLAY,
|
||||
|
||||
/* all normal video threads */
|
||||
ANDROID_PRIORITY_VIDEO = -10,
|
||||
|
||||
/* all normal audio threads */
|
||||
ANDROID_PRIORITY_AUDIO = -16,
|
||||
|
||||
/* service audio threads (uncommon) */
|
||||
ANDROID_PRIORITY_URGENT_AUDIO = -19,
|
||||
|
||||
/* should never be used in practice. regular process might not
|
||||
* be allowed to use this level */
|
||||
ANDROID_PRIORITY_HIGHEST = -20,
|
||||
|
||||
ANDROID_PRIORITY_DEFAULT = ANDROID_PRIORITY_NORMAL,
|
||||
ANDROID_PRIORITY_MORE_FAVORABLE = -1,
|
||||
ANDROID_PRIORITY_LESS_FAVORABLE = +1,
|
||||
};
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* ANDROID_THREAD_DEFS_H */
|
||||
@@ -0,0 +1,993 @@
|
||||
/*
|
||||
* Copyright (C) 2011 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/*****************************************************************************
|
||||
*****************************************************************************
|
||||
**** ****
|
||||
**** FOR BUILDING WITH ANDROID NOUGAT (7.0, 7.1) AND BELOW. ****
|
||||
**** ****
|
||||
**** THIS FILE EXISTS ONLY FOR BACKWARD SOURCE COMPATIBILITY. ****
|
||||
**** ****
|
||||
**** DO NOT ADD TO THIS FILE. ****
|
||||
**** ****
|
||||
*****************************************************************************
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
|
||||
#define SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <stdint.h>
|
||||
#include <string.h>
|
||||
#include <sys/cdefs.h>
|
||||
#include <system/graphics.h>
|
||||
#include <unistd.h>
|
||||
#include <stdbool.h>
|
||||
|
||||
#ifndef __UNUSED
|
||||
#define __UNUSED __attribute__((__unused__))
|
||||
#endif
|
||||
#ifndef __deprecated
|
||||
#define __deprecated __attribute__((__deprecated__))
|
||||
#endif
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
#define ANDROID_NATIVE_MAKE_CONSTANT(a,b,c,d) \
|
||||
(((unsigned)(a)<<24)|((unsigned)(b)<<16)|((unsigned)(c)<<8)|(unsigned)(d))
|
||||
|
||||
#define ANDROID_NATIVE_WINDOW_MAGIC \
|
||||
ANDROID_NATIVE_MAKE_CONSTANT('_','w','n','d')
|
||||
|
||||
#define ANDROID_NATIVE_BUFFER_MAGIC \
|
||||
ANDROID_NATIVE_MAKE_CONSTANT('_','b','f','r')
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
// This #define may be used to conditionally compile device-specific code to
|
||||
// support either the prior ANativeWindow interface, which did not pass libsync
|
||||
// fences around, or the new interface that does. This #define is only present
|
||||
// when the ANativeWindow interface does include libsync support.
|
||||
#define ANDROID_NATIVE_WINDOW_HAS_SYNC 1
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef const native_handle_t* buffer_handle_t;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef struct android_native_rect_t
|
||||
{
|
||||
int32_t left;
|
||||
int32_t top;
|
||||
int32_t right;
|
||||
int32_t bottom;
|
||||
} android_native_rect_t;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
typedef struct android_native_base_t
|
||||
{
|
||||
/* a magic value defined by the actual EGL native type */
|
||||
int magic;
|
||||
|
||||
/* the sizeof() of the actual EGL native type */
|
||||
int version;
|
||||
|
||||
void* reserved[4];
|
||||
|
||||
/* reference-counting interface */
|
||||
void (*incRef)(struct android_native_base_t* base);
|
||||
void (*decRef)(struct android_native_base_t* base);
|
||||
} android_native_base_t;
|
||||
|
||||
typedef struct ANativeWindowBuffer
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
ANativeWindowBuffer() {
|
||||
common.magic = ANDROID_NATIVE_BUFFER_MAGIC;
|
||||
common.version = sizeof(ANativeWindowBuffer);
|
||||
memset(common.reserved, 0, sizeof(common.reserved));
|
||||
}
|
||||
|
||||
// Implement the methods that sp<ANativeWindowBuffer> expects so that it
|
||||
// can be used to automatically refcount ANativeWindowBuffer's.
|
||||
void incStrong(const void* /*id*/) const {
|
||||
common.incRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
void decStrong(const void* /*id*/) const {
|
||||
common.decRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
#endif
|
||||
|
||||
struct android_native_base_t common;
|
||||
|
||||
int width;
|
||||
int height;
|
||||
int stride;
|
||||
int format;
|
||||
int usage;
|
||||
|
||||
void* reserved[2];
|
||||
|
||||
buffer_handle_t handle;
|
||||
|
||||
void* reserved_proc[8];
|
||||
} ANativeWindowBuffer_t;
|
||||
|
||||
// Old typedef for backwards compatibility.
|
||||
typedef ANativeWindowBuffer_t android_native_buffer_t;
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
/* attributes queriable with query() */
|
||||
enum {
|
||||
NATIVE_WINDOW_WIDTH = 0,
|
||||
NATIVE_WINDOW_HEIGHT = 1,
|
||||
NATIVE_WINDOW_FORMAT = 2,
|
||||
|
||||
/* The minimum number of buffers that must remain un-dequeued after a buffer
|
||||
* has been queued. This value applies only if set_buffer_count was used to
|
||||
* override the number of buffers and if a buffer has since been queued.
|
||||
* Users of the set_buffer_count ANativeWindow method should query this
|
||||
* value before calling set_buffer_count. If it is necessary to have N
|
||||
* buffers simultaneously dequeued as part of the steady-state operation,
|
||||
* and this query returns M then N+M buffers should be requested via
|
||||
* native_window_set_buffer_count.
|
||||
*
|
||||
* Note that this value does NOT apply until a single buffer has been
|
||||
* queued. In particular this means that it is possible to:
|
||||
*
|
||||
* 1. Query M = min undequeued buffers
|
||||
* 2. Set the buffer count to N + M
|
||||
* 3. Dequeue all N + M buffers
|
||||
* 4. Cancel M buffers
|
||||
* 5. Queue, dequeue, queue, dequeue, ad infinitum
|
||||
*/
|
||||
NATIVE_WINDOW_MIN_UNDEQUEUED_BUFFERS = 3,
|
||||
|
||||
/* Check whether queueBuffer operations on the ANativeWindow send the buffer
|
||||
* to the window compositor. The query sets the returned 'value' argument
|
||||
* to 1 if the ANativeWindow DOES send queued buffers directly to the window
|
||||
* compositor and 0 if the buffers do not go directly to the window
|
||||
* compositor.
|
||||
*
|
||||
* This can be used to determine whether protected buffer content should be
|
||||
* sent to the ANativeWindow. Note, however, that a result of 1 does NOT
|
||||
* indicate that queued buffers will be protected from applications or users
|
||||
* capturing their contents. If that behavior is desired then some other
|
||||
* mechanism (e.g. the GRALLOC_USAGE_PROTECTED flag) should be used in
|
||||
* conjunction with this query.
|
||||
*/
|
||||
NATIVE_WINDOW_QUEUES_TO_WINDOW_COMPOSER = 4,
|
||||
|
||||
/* Get the concrete type of a ANativeWindow. See below for the list of
|
||||
* possible return values.
|
||||
*
|
||||
* This query should not be used outside the Android framework and will
|
||||
* likely be removed in the near future.
|
||||
*/
|
||||
NATIVE_WINDOW_CONCRETE_TYPE = 5,
|
||||
|
||||
|
||||
/*
|
||||
* Default width and height of ANativeWindow buffers, these are the
|
||||
* dimensions of the window buffers irrespective of the
|
||||
* NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS call and match the native window
|
||||
* size unless overridden by NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS.
|
||||
*/
|
||||
NATIVE_WINDOW_DEFAULT_WIDTH = 6,
|
||||
NATIVE_WINDOW_DEFAULT_HEIGHT = 7,
|
||||
|
||||
/*
|
||||
* transformation that will most-likely be applied to buffers. This is only
|
||||
* a hint, the actual transformation applied might be different.
|
||||
*
|
||||
* INTENDED USE:
|
||||
*
|
||||
* The transform hint can be used by a producer, for instance the GLES
|
||||
* driver, to pre-rotate the rendering such that the final transformation
|
||||
* in the composer is identity. This can be very useful when used in
|
||||
* conjunction with the h/w composer HAL, in situations where it
|
||||
* cannot handle arbitrary rotations.
|
||||
*
|
||||
* 1. Before dequeuing a buffer, the GL driver (or any other ANW client)
|
||||
* queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT.
|
||||
*
|
||||
* 2. The GL driver overrides the width and height of the ANW to
|
||||
* account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying
|
||||
* NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions
|
||||
* according to NATIVE_WINDOW_TRANSFORM_HINT and calling
|
||||
* native_window_set_buffers_dimensions().
|
||||
*
|
||||
* 3. The GL driver dequeues a buffer of the new pre-rotated size.
|
||||
*
|
||||
* 4. The GL driver renders to the buffer such that the image is
|
||||
* already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT
|
||||
* to the rendering.
|
||||
*
|
||||
* 5. The GL driver calls native_window_set_transform to apply
|
||||
* inverse transformation to the buffer it just rendered.
|
||||
* In order to do this, the GL driver needs
|
||||
* to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is
|
||||
* done easily:
|
||||
*
|
||||
* int hintTransform, inverseTransform;
|
||||
* query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform);
|
||||
* inverseTransform = hintTransform;
|
||||
* if (hintTransform & HAL_TRANSFORM_ROT_90)
|
||||
* inverseTransform ^= HAL_TRANSFORM_ROT_180;
|
||||
*
|
||||
*
|
||||
* 6. The GL driver queues the pre-transformed buffer.
|
||||
*
|
||||
* 7. The composer combines the buffer transform with the display
|
||||
* transform. If the buffer transform happens to cancel out the
|
||||
* display transform then no rotation is needed.
|
||||
*
|
||||
*/
|
||||
NATIVE_WINDOW_TRANSFORM_HINT = 8,
|
||||
|
||||
/*
|
||||
* Boolean that indicates whether the consumer is running more than
|
||||
* one buffer behind the producer.
|
||||
*/
|
||||
NATIVE_WINDOW_CONSUMER_RUNNING_BEHIND = 9,
|
||||
|
||||
/*
|
||||
* The consumer gralloc usage bits currently set by the consumer.
|
||||
* The values are defined in hardware/libhardware/include/gralloc.h.
|
||||
*/
|
||||
NATIVE_WINDOW_CONSUMER_USAGE_BITS = 10,
|
||||
|
||||
/**
|
||||
* Transformation that will by applied to buffers by the hwcomposer.
|
||||
* This must not be set or checked by producer endpoints, and will
|
||||
* disable the transform hint set in SurfaceFlinger (see
|
||||
* NATIVE_WINDOW_TRANSFORM_HINT).
|
||||
*
|
||||
* INTENDED USE:
|
||||
* Temporary - Please do not use this. This is intended only to be used
|
||||
* by the camera's LEGACY mode.
|
||||
*
|
||||
* In situations where a SurfaceFlinger client wishes to set a transform
|
||||
* that is not visible to the producer, and will always be applied in the
|
||||
* hardware composer, the client can set this flag with
|
||||
* native_window_set_buffers_sticky_transform. This can be used to rotate
|
||||
* and flip buffers consumed by hardware composer without actually changing
|
||||
* the aspect ratio of the buffers produced.
|
||||
*/
|
||||
NATIVE_WINDOW_STICKY_TRANSFORM = 11,
|
||||
|
||||
/**
|
||||
* The default data space for the buffers as set by the consumer.
|
||||
* The values are defined in graphics.h.
|
||||
*/
|
||||
NATIVE_WINDOW_DEFAULT_DATASPACE = 12,
|
||||
|
||||
/*
|
||||
* Returns the age of the contents of the most recently dequeued buffer as
|
||||
* the number of frames that have elapsed since it was last queued. For
|
||||
* example, if the window is double-buffered, the age of any given buffer in
|
||||
* steady state will be 2. If the dequeued buffer has never been queued, its
|
||||
* age will be 0.
|
||||
*/
|
||||
NATIVE_WINDOW_BUFFER_AGE = 13,
|
||||
};
|
||||
|
||||
/* Valid operations for the (*perform)() hook.
|
||||
*
|
||||
* Values marked as 'deprecated' are supported, but have been superceded by
|
||||
* other functionality.
|
||||
*
|
||||
* Values marked as 'private' should be considered private to the framework.
|
||||
* HAL implementation code with access to an ANativeWindow should not use these,
|
||||
* as it may not interact properly with the framework's use of the
|
||||
* ANativeWindow.
|
||||
*/
|
||||
enum {
|
||||
NATIVE_WINDOW_SET_USAGE = 0,
|
||||
NATIVE_WINDOW_CONNECT = 1, /* deprecated */
|
||||
NATIVE_WINDOW_DISCONNECT = 2, /* deprecated */
|
||||
NATIVE_WINDOW_SET_CROP = 3, /* private */
|
||||
NATIVE_WINDOW_SET_BUFFER_COUNT = 4,
|
||||
NATIVE_WINDOW_SET_BUFFERS_GEOMETRY = 5, /* deprecated */
|
||||
NATIVE_WINDOW_SET_BUFFERS_TRANSFORM = 6,
|
||||
NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP = 7,
|
||||
NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS = 8,
|
||||
NATIVE_WINDOW_SET_BUFFERS_FORMAT = 9,
|
||||
NATIVE_WINDOW_SET_SCALING_MODE = 10, /* private */
|
||||
NATIVE_WINDOW_LOCK = 11, /* private */
|
||||
NATIVE_WINDOW_UNLOCK_AND_POST = 12, /* private */
|
||||
NATIVE_WINDOW_API_CONNECT = 13, /* private */
|
||||
NATIVE_WINDOW_API_DISCONNECT = 14, /* private */
|
||||
NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS = 15, /* private */
|
||||
NATIVE_WINDOW_SET_POST_TRANSFORM_CROP = 16, /* private */
|
||||
NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM = 17,/* private */
|
||||
NATIVE_WINDOW_SET_SIDEBAND_STREAM = 18,
|
||||
NATIVE_WINDOW_SET_BUFFERS_DATASPACE = 19,
|
||||
NATIVE_WINDOW_SET_SURFACE_DAMAGE = 20, /* private */
|
||||
NATIVE_WINDOW_SET_SHARED_BUFFER_MODE = 21,
|
||||
NATIVE_WINDOW_SET_AUTO_REFRESH = 22,
|
||||
};
|
||||
|
||||
/* parameter for NATIVE_WINDOW_[API_][DIS]CONNECT */
|
||||
enum {
|
||||
/* Buffers will be queued by EGL via eglSwapBuffers after being filled using
|
||||
* OpenGL ES.
|
||||
*/
|
||||
NATIVE_WINDOW_API_EGL = 1,
|
||||
|
||||
/* Buffers will be queued after being filled using the CPU
|
||||
*/
|
||||
NATIVE_WINDOW_API_CPU = 2,
|
||||
|
||||
/* Buffers will be queued by Stagefright after being filled by a video
|
||||
* decoder. The video decoder can either be a software or hardware decoder.
|
||||
*/
|
||||
NATIVE_WINDOW_API_MEDIA = 3,
|
||||
|
||||
/* Buffers will be queued by the the camera HAL.
|
||||
*/
|
||||
NATIVE_WINDOW_API_CAMERA = 4,
|
||||
};
|
||||
|
||||
/* parameter for NATIVE_WINDOW_SET_BUFFERS_TRANSFORM */
|
||||
enum {
|
||||
/* flip source image horizontally */
|
||||
NATIVE_WINDOW_TRANSFORM_FLIP_H = HAL_TRANSFORM_FLIP_H ,
|
||||
/* flip source image vertically */
|
||||
NATIVE_WINDOW_TRANSFORM_FLIP_V = HAL_TRANSFORM_FLIP_V,
|
||||
/* rotate source image 90 degrees clock-wise, and is applied after TRANSFORM_FLIP_{H|V} */
|
||||
NATIVE_WINDOW_TRANSFORM_ROT_90 = HAL_TRANSFORM_ROT_90,
|
||||
/* rotate source image 180 degrees */
|
||||
NATIVE_WINDOW_TRANSFORM_ROT_180 = HAL_TRANSFORM_ROT_180,
|
||||
/* rotate source image 270 degrees clock-wise */
|
||||
NATIVE_WINDOW_TRANSFORM_ROT_270 = HAL_TRANSFORM_ROT_270,
|
||||
/* transforms source by the inverse transform of the screen it is displayed onto. This
|
||||
* transform is applied last */
|
||||
NATIVE_WINDOW_TRANSFORM_INVERSE_DISPLAY = 0x08
|
||||
};
|
||||
|
||||
/* parameter for NATIVE_WINDOW_SET_SCALING_MODE
|
||||
* keep in sync with Surface.java in frameworks/base */
|
||||
enum {
|
||||
/* the window content is not updated (frozen) until a buffer of
|
||||
* the window size is received (enqueued)
|
||||
*/
|
||||
NATIVE_WINDOW_SCALING_MODE_FREEZE = 0,
|
||||
/* the buffer is scaled in both dimensions to match the window size */
|
||||
NATIVE_WINDOW_SCALING_MODE_SCALE_TO_WINDOW = 1,
|
||||
/* the buffer is scaled uniformly such that the smaller dimension
|
||||
* of the buffer matches the window size (cropping in the process)
|
||||
*/
|
||||
NATIVE_WINDOW_SCALING_MODE_SCALE_CROP = 2,
|
||||
/* the window is clipped to the size of the buffer's crop rectangle; pixels
|
||||
* outside the crop rectangle are treated as if they are completely
|
||||
* transparent.
|
||||
*/
|
||||
NATIVE_WINDOW_SCALING_MODE_NO_SCALE_CROP = 3,
|
||||
};
|
||||
|
||||
/* values returned by the NATIVE_WINDOW_CONCRETE_TYPE query */
|
||||
enum {
|
||||
NATIVE_WINDOW_FRAMEBUFFER = 0, /* FramebufferNativeWindow */
|
||||
NATIVE_WINDOW_SURFACE = 1, /* Surface */
|
||||
};
|
||||
|
||||
/* parameter for NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP
|
||||
*
|
||||
* Special timestamp value to indicate that timestamps should be auto-generated
|
||||
* by the native window when queueBuffer is called. This is equal to INT64_MIN,
|
||||
* defined directly to avoid problems with C99/C++ inclusion of stdint.h.
|
||||
*/
|
||||
static const int64_t NATIVE_WINDOW_TIMESTAMP_AUTO = (-9223372036854775807LL-1);
|
||||
|
||||
struct ANativeWindow
|
||||
{
|
||||
#ifdef __cplusplus
|
||||
ANativeWindow()
|
||||
: flags(0), minSwapInterval(0), maxSwapInterval(0), xdpi(0), ydpi(0)
|
||||
{
|
||||
common.magic = ANDROID_NATIVE_WINDOW_MAGIC;
|
||||
common.version = sizeof(ANativeWindow);
|
||||
memset(common.reserved, 0, sizeof(common.reserved));
|
||||
}
|
||||
|
||||
/* Implement the methods that sp<ANativeWindow> expects so that it
|
||||
can be used to automatically refcount ANativeWindow's. */
|
||||
void incStrong(const void* /*id*/) const {
|
||||
common.incRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
void decStrong(const void* /*id*/) const {
|
||||
common.decRef(const_cast<android_native_base_t*>(&common));
|
||||
}
|
||||
#endif
|
||||
|
||||
struct android_native_base_t common;
|
||||
|
||||
/* flags describing some attributes of this surface or its updater */
|
||||
const uint32_t flags;
|
||||
|
||||
/* min swap interval supported by this updated */
|
||||
const int minSwapInterval;
|
||||
|
||||
/* max swap interval supported by this updated */
|
||||
const int maxSwapInterval;
|
||||
|
||||
/* horizontal and vertical resolution in DPI */
|
||||
const float xdpi;
|
||||
const float ydpi;
|
||||
|
||||
/* Some storage reserved for the OEM's driver. */
|
||||
intptr_t oem[4];
|
||||
|
||||
/*
|
||||
* Set the swap interval for this surface.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*setSwapInterval)(struct ANativeWindow* window,
|
||||
int interval);
|
||||
|
||||
/*
|
||||
* Hook called by EGL to acquire a buffer. After this call, the buffer
|
||||
* is not locked, so its content cannot be modified. This call may block if
|
||||
* no buffers are available.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*
|
||||
* XXX: This function is deprecated. It will continue to work for some
|
||||
* time for binary compatibility, but the new dequeueBuffer function that
|
||||
* outputs a fence file descriptor should be used in its place.
|
||||
*/
|
||||
int (*dequeueBuffer_DEPRECATED)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer** buffer);
|
||||
|
||||
/*
|
||||
* hook called by EGL to lock a buffer. This MUST be called before modifying
|
||||
* the content of a buffer. The buffer must have been acquired with
|
||||
* dequeueBuffer first.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*
|
||||
* XXX: This function is deprecated. It will continue to work for some
|
||||
* time for binary compatibility, but it is essentially a no-op, and calls
|
||||
* to it should be removed.
|
||||
*/
|
||||
int (*lockBuffer_DEPRECATED)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer* buffer);
|
||||
|
||||
/*
|
||||
* Hook called by EGL when modifications to the render buffer are done.
|
||||
* This unlocks and post the buffer.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* Buffers MUST be queued in the same order than they were dequeued.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*
|
||||
* XXX: This function is deprecated. It will continue to work for some
|
||||
* time for binary compatibility, but the new queueBuffer function that
|
||||
* takes a fence file descriptor should be used in its place (pass a value
|
||||
* of -1 for the fence file descriptor if there is no valid one to pass).
|
||||
*/
|
||||
int (*queueBuffer_DEPRECATED)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer* buffer);
|
||||
|
||||
/*
|
||||
* hook used to retrieve information about the native window.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*query)(const struct ANativeWindow* window,
|
||||
int what, int* value);
|
||||
|
||||
/*
|
||||
* hook used to perform various operations on the surface.
|
||||
* (*perform)() is a generic mechanism to add functionality to
|
||||
* ANativeWindow while keeping backward binary compatibility.
|
||||
*
|
||||
* DO NOT CALL THIS HOOK DIRECTLY. Instead, use the helper functions
|
||||
* defined below.
|
||||
*
|
||||
* (*perform)() returns -ENOENT if the 'what' parameter is not supported
|
||||
* by the surface's implementation.
|
||||
*
|
||||
* See above for a list of valid operations, such as
|
||||
* NATIVE_WINDOW_SET_USAGE or NATIVE_WINDOW_CONNECT
|
||||
*/
|
||||
int (*perform)(struct ANativeWindow* window,
|
||||
int operation, ... );
|
||||
|
||||
/*
|
||||
* Hook used to cancel a buffer that has been dequeued.
|
||||
* No synchronization is performed between dequeue() and cancel(), so
|
||||
* either external synchronization is needed, or these functions must be
|
||||
* called from the same thread.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* XXX: This function is deprecated. It will continue to work for some
|
||||
* time for binary compatibility, but the new cancelBuffer function that
|
||||
* takes a fence file descriptor should be used in its place (pass a value
|
||||
* of -1 for the fence file descriptor if there is no valid one to pass).
|
||||
*/
|
||||
int (*cancelBuffer_DEPRECATED)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer* buffer);
|
||||
|
||||
/*
|
||||
* Hook called by EGL to acquire a buffer. This call may block if no
|
||||
* buffers are available.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The libsync fence file descriptor returned in the int pointed to by the
|
||||
* fenceFd argument will refer to the fence that must signal before the
|
||||
* dequeued buffer may be written to. A value of -1 indicates that the
|
||||
* caller may access the buffer immediately without waiting on a fence. If
|
||||
* a valid file descriptor is returned (i.e. any value except -1) then the
|
||||
* caller is responsible for closing the file descriptor.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*dequeueBuffer)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer** buffer, int* fenceFd);
|
||||
|
||||
/*
|
||||
* Hook called by EGL when modifications to the render buffer are done.
|
||||
* This unlocks and post the buffer.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The fenceFd argument specifies a libsync fence file descriptor for a
|
||||
* fence that must signal before the buffer can be accessed. If the buffer
|
||||
* can be accessed immediately then a value of -1 should be used. The
|
||||
* caller must not use the file descriptor after it is passed to
|
||||
* queueBuffer, and the ANativeWindow implementation is responsible for
|
||||
* closing it.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*queueBuffer)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer* buffer, int fenceFd);
|
||||
|
||||
/*
|
||||
* Hook used to cancel a buffer that has been dequeued.
|
||||
* No synchronization is performed between dequeue() and cancel(), so
|
||||
* either external synchronization is needed, or these functions must be
|
||||
* called from the same thread.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The fenceFd argument specifies a libsync fence file decsriptor for a
|
||||
* fence that must signal before the buffer can be accessed. If the buffer
|
||||
* can be accessed immediately then a value of -1 should be used.
|
||||
*
|
||||
* Note that if the client has not waited on the fence that was returned
|
||||
* from dequeueBuffer, that same fence should be passed to cancelBuffer to
|
||||
* ensure that future uses of the buffer are preceded by a wait on that
|
||||
* fence. The caller must not use the file descriptor after it is passed
|
||||
* to cancelBuffer, and the ANativeWindow implementation is responsible for
|
||||
* closing it.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int (*cancelBuffer)(struct ANativeWindow* window,
|
||||
struct ANativeWindowBuffer* buffer, int fenceFd);
|
||||
};
|
||||
|
||||
/* Backwards compatibility: use ANativeWindow (struct ANativeWindow in C).
|
||||
* android_native_window_t is deprecated.
|
||||
*/
|
||||
typedef struct ANativeWindow ANativeWindow;
|
||||
typedef struct ANativeWindow android_native_window_t __deprecated;
|
||||
|
||||
/*
|
||||
* native_window_set_usage(..., usage)
|
||||
* Sets the intended usage flags for the next buffers
|
||||
* acquired with (*lockBuffer)() and on.
|
||||
* By default (if this function is never called), a usage of
|
||||
* GRALLOC_USAGE_HW_RENDER | GRALLOC_USAGE_HW_TEXTURE
|
||||
* is assumed.
|
||||
* Calling this function will usually cause following buffers to be
|
||||
* reallocated.
|
||||
*/
|
||||
|
||||
static inline int native_window_set_usage(
|
||||
struct ANativeWindow* window, int usage)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_USAGE, usage);
|
||||
}
|
||||
|
||||
/* deprecated. Always returns 0. Don't call. */
|
||||
static inline int native_window_connect(
|
||||
struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
|
||||
|
||||
static inline int native_window_connect(
|
||||
struct ANativeWindow* window __UNUSED, int api __UNUSED) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* deprecated. Always returns 0. Don't call. */
|
||||
static inline int native_window_disconnect(
|
||||
struct ANativeWindow* window __UNUSED, int api __UNUSED) __deprecated;
|
||||
|
||||
static inline int native_window_disconnect(
|
||||
struct ANativeWindow* window __UNUSED, int api __UNUSED) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_crop(..., crop)
|
||||
* Sets which region of the next queued buffers needs to be considered.
|
||||
* Depending on the scaling mode, a buffer's crop region is scaled and/or
|
||||
* cropped to match the surface's size. This function sets the crop in
|
||||
* pre-transformed buffer pixel coordinates.
|
||||
*
|
||||
* The specified crop region applies to all buffers queued after it is called.
|
||||
*
|
||||
* If 'crop' is NULL, subsequently queued buffers won't be cropped.
|
||||
*
|
||||
* An error is returned if for instance the crop region is invalid, out of the
|
||||
* buffer's bound or if the window is invalid.
|
||||
*/
|
||||
static inline int native_window_set_crop(
|
||||
struct ANativeWindow* window,
|
||||
android_native_rect_t const * crop)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_CROP, crop);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_post_transform_crop(..., crop)
|
||||
* Sets which region of the next queued buffers needs to be considered.
|
||||
* Depending on the scaling mode, a buffer's crop region is scaled and/or
|
||||
* cropped to match the surface's size. This function sets the crop in
|
||||
* post-transformed pixel coordinates.
|
||||
*
|
||||
* The specified crop region applies to all buffers queued after it is called.
|
||||
*
|
||||
* If 'crop' is NULL, subsequently queued buffers won't be cropped.
|
||||
*
|
||||
* An error is returned if for instance the crop region is invalid, out of the
|
||||
* buffer's bound or if the window is invalid.
|
||||
*/
|
||||
static inline int native_window_set_post_transform_crop(
|
||||
struct ANativeWindow* window,
|
||||
android_native_rect_t const * crop)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_POST_TRANSFORM_CROP, crop);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_active_rect(..., active_rect)
|
||||
*
|
||||
* This function is deprecated and will be removed soon. For now it simply
|
||||
* sets the post-transform crop for compatibility while multi-project commits
|
||||
* get checked.
|
||||
*/
|
||||
static inline int native_window_set_active_rect(
|
||||
struct ANativeWindow* window,
|
||||
android_native_rect_t const * active_rect) __deprecated;
|
||||
|
||||
static inline int native_window_set_active_rect(
|
||||
struct ANativeWindow* window,
|
||||
android_native_rect_t const * active_rect)
|
||||
{
|
||||
return native_window_set_post_transform_crop(window, active_rect);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffer_count(..., count)
|
||||
* Sets the number of buffers associated with this native window.
|
||||
*/
|
||||
static inline int native_window_set_buffer_count(
|
||||
struct ANativeWindow* window,
|
||||
size_t bufferCount)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFER_COUNT, bufferCount);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_geometry(..., int w, int h, int format)
|
||||
* All buffers dequeued after this call will have the dimensions and format
|
||||
* specified. A successful call to this function has the same effect as calling
|
||||
* native_window_set_buffers_size and native_window_set_buffers_format.
|
||||
*
|
||||
* XXX: This function is deprecated. The native_window_set_buffers_dimensions
|
||||
* and native_window_set_buffers_format functions should be used instead.
|
||||
*/
|
||||
static inline int native_window_set_buffers_geometry(
|
||||
struct ANativeWindow* window,
|
||||
int w, int h, int format) __deprecated;
|
||||
|
||||
static inline int native_window_set_buffers_geometry(
|
||||
struct ANativeWindow* window,
|
||||
int w, int h, int format)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_GEOMETRY,
|
||||
w, h, format);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_dimensions(..., int w, int h)
|
||||
* All buffers dequeued after this call will have the dimensions specified.
|
||||
* In particular, all buffers will have a fixed-size, independent from the
|
||||
* native-window size. They will be scaled according to the scaling mode
|
||||
* (see native_window_set_scaling_mode) upon window composition.
|
||||
*
|
||||
* If w and h are 0, the normal behavior is restored. That is, dequeued buffers
|
||||
* following this call will be sized to match the window's size.
|
||||
*
|
||||
* Calling this function will reset the window crop to a NULL value, which
|
||||
* disables cropping of the buffers.
|
||||
*/
|
||||
static inline int native_window_set_buffers_dimensions(
|
||||
struct ANativeWindow* window,
|
||||
int w, int h)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DIMENSIONS,
|
||||
w, h);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_user_dimensions(..., int w, int h)
|
||||
*
|
||||
* Sets the user buffer size for the window, which overrides the
|
||||
* window's size. All buffers dequeued after this call will have the
|
||||
* dimensions specified unless overridden by
|
||||
* native_window_set_buffers_dimensions. All buffers will have a
|
||||
* fixed-size, independent from the native-window size. They will be
|
||||
* scaled according to the scaling mode (see
|
||||
* native_window_set_scaling_mode) upon window composition.
|
||||
*
|
||||
* If w and h are 0, the normal behavior is restored. That is, the
|
||||
* default buffer size will match the windows's size.
|
||||
*
|
||||
* Calling this function will reset the window crop to a NULL value, which
|
||||
* disables cropping of the buffers.
|
||||
*/
|
||||
static inline int native_window_set_buffers_user_dimensions(
|
||||
struct ANativeWindow* window,
|
||||
int w, int h)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_USER_DIMENSIONS,
|
||||
w, h);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_format(..., int format)
|
||||
* All buffers dequeued after this call will have the format specified.
|
||||
*
|
||||
* If the specified format is 0, the default buffer format will be used.
|
||||
*/
|
||||
static inline int native_window_set_buffers_format(
|
||||
struct ANativeWindow* window,
|
||||
int format)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_FORMAT, format);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_data_space(..., int dataSpace)
|
||||
* All buffers queued after this call will be associated with the dataSpace
|
||||
* parameter specified.
|
||||
*
|
||||
* dataSpace specifies additional information about the buffer that's dependent
|
||||
* on the buffer format and the endpoints. For example, it can be used to convey
|
||||
* the color space of the image data in the buffer, or it can be used to
|
||||
* indicate that the buffers contain depth measurement data instead of color
|
||||
* images. The default dataSpace is 0, HAL_DATASPACE_UNKNOWN, unless it has been
|
||||
* overridden by the consumer.
|
||||
*/
|
||||
static inline int native_window_set_buffers_data_space(
|
||||
struct ANativeWindow* window,
|
||||
android_dataspace_t dataSpace)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_DATASPACE,
|
||||
dataSpace);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_transform(..., int transform)
|
||||
* All buffers queued after this call will be displayed transformed according
|
||||
* to the transform parameter specified.
|
||||
*/
|
||||
static inline int native_window_set_buffers_transform(
|
||||
struct ANativeWindow* window,
|
||||
int transform)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TRANSFORM,
|
||||
transform);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_sticky_transform(..., int transform)
|
||||
* All buffers queued after this call will be displayed transformed according
|
||||
* to the transform parameter specified applied on top of the regular buffer
|
||||
* transform. Setting this transform will disable the transform hint.
|
||||
*
|
||||
* Temporary - This is only intended to be used by the LEGACY camera mode, do
|
||||
* not use this for anything else.
|
||||
*/
|
||||
static inline int native_window_set_buffers_sticky_transform(
|
||||
struct ANativeWindow* window,
|
||||
int transform)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_STICKY_TRANSFORM,
|
||||
transform);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_buffers_timestamp(..., int64_t timestamp)
|
||||
* All buffers queued after this call will be associated with the timestamp
|
||||
* parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO
|
||||
* (the default), timestamps will be generated automatically when queueBuffer is
|
||||
* called. The timestamp is measured in nanoseconds, and is normally monotonically
|
||||
* increasing. The timestamp should be unaffected by time-of-day adjustments,
|
||||
* and for a camera should be strictly monotonic but for a media player may be
|
||||
* reset when the position is set.
|
||||
*/
|
||||
static inline int native_window_set_buffers_timestamp(
|
||||
struct ANativeWindow* window,
|
||||
int64_t timestamp)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_BUFFERS_TIMESTAMP,
|
||||
timestamp);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_scaling_mode(..., int mode)
|
||||
* All buffers queued after this call will be associated with the scaling mode
|
||||
* specified.
|
||||
*/
|
||||
static inline int native_window_set_scaling_mode(
|
||||
struct ANativeWindow* window,
|
||||
int mode)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_SCALING_MODE,
|
||||
mode);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_api_connect(..., int api)
|
||||
* connects an API to this window. only one API can be connected at a time.
|
||||
* Returns -EINVAL if for some reason the window cannot be connected, which
|
||||
* can happen if it's connected to some other API.
|
||||
*/
|
||||
static inline int native_window_api_connect(
|
||||
struct ANativeWindow* window, int api)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_API_CONNECT, api);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_api_disconnect(..., int api)
|
||||
* disconnect the API from this window.
|
||||
* An error is returned if for instance the window wasn't connected in the
|
||||
* first place.
|
||||
*/
|
||||
static inline int native_window_api_disconnect(
|
||||
struct ANativeWindow* window, int api)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_API_DISCONNECT, api);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_dequeue_buffer_and_wait(...)
|
||||
* Dequeue a buffer and wait on the fence associated with that buffer. The
|
||||
* buffer may safely be accessed immediately upon this function returning. An
|
||||
* error is returned if either of the dequeue or the wait operations fail.
|
||||
*/
|
||||
static inline int native_window_dequeue_buffer_and_wait(ANativeWindow *anw,
|
||||
struct ANativeWindowBuffer** anb) {
|
||||
return anw->dequeueBuffer_DEPRECATED(anw, anb);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_sideband_stream(..., native_handle_t*)
|
||||
* Attach a sideband buffer stream to a native window.
|
||||
*/
|
||||
static inline int native_window_set_sideband_stream(
|
||||
struct ANativeWindow* window,
|
||||
native_handle_t* sidebandHandle)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_SIDEBAND_STREAM,
|
||||
sidebandHandle);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_surface_damage(..., android_native_rect_t* rects, int numRects)
|
||||
* Set the surface damage (i.e., the region of the surface that has changed
|
||||
* since the previous frame). The damage set by this call will be reset (to the
|
||||
* default of full-surface damage) after calling queue, so this must be called
|
||||
* prior to every frame with damage that does not cover the whole surface if the
|
||||
* caller desires downstream consumers to use this optimization.
|
||||
*
|
||||
* The damage region is specified as an array of rectangles, with the important
|
||||
* caveat that the origin of the surface is considered to be the bottom-left
|
||||
* corner, as in OpenGL ES.
|
||||
*
|
||||
* If numRects is set to 0, rects may be NULL, and the surface damage will be
|
||||
* set to the full surface (the same as if this function had not been called for
|
||||
* this frame).
|
||||
*/
|
||||
static inline int native_window_set_surface_damage(
|
||||
struct ANativeWindow* window,
|
||||
const android_native_rect_t* rects, size_t numRects)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_SURFACE_DAMAGE,
|
||||
rects, numRects);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_shared_buffer_mode(..., bool sharedBufferMode)
|
||||
* Enable/disable shared buffer mode
|
||||
*/
|
||||
static inline int native_window_set_shared_buffer_mode(
|
||||
struct ANativeWindow* window,
|
||||
bool sharedBufferMode)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_SHARED_BUFFER_MODE,
|
||||
sharedBufferMode);
|
||||
}
|
||||
|
||||
/*
|
||||
* native_window_set_auto_refresh(..., autoRefresh)
|
||||
* Enable/disable auto refresh when in shared buffer mode
|
||||
*/
|
||||
static inline int native_window_set_auto_refresh(
|
||||
struct ANativeWindow* window,
|
||||
bool autoRefresh)
|
||||
{
|
||||
return window->perform(window, NATIVE_WINDOW_SET_AUTO_REFRESH, autoRefresh);
|
||||
}
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* SYSTEM_CORE_INCLUDE_ANDROID_WINDOW_H */
|
||||
@@ -0,0 +1,100 @@
|
||||
/*
|
||||
* Copyright 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
|
||||
#define ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H
|
||||
|
||||
// vndk is a superset of the NDK
|
||||
#include <android/hardware_buffer.h>
|
||||
|
||||
#include <cutils/native_handle.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
const native_handle_t* AHardwareBuffer_getNativeHandle(const AHardwareBuffer* buffer);
|
||||
|
||||
enum CreateFromHandleMethod {
|
||||
// enum values chosen to match internal GraphicBuffer::HandleWrapMethod
|
||||
AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_REGISTER = 2,
|
||||
AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE = 3,
|
||||
};
|
||||
|
||||
/**
|
||||
* Create a AHardwareBuffer from a native handle.
|
||||
*
|
||||
* This function wraps a native handle in a AHardwareBuffer suitable for use by applications or
|
||||
* other parts of the system. The contents of desc will be returned by AHardwareBuffer_describe().
|
||||
*
|
||||
* If method is AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_REGISTER, the handle is assumed to be
|
||||
* unregistered, and it will be registered/imported before being wrapped in the AHardwareBuffer.
|
||||
* If successful, the AHardwareBuffer will own the handle.
|
||||
*
|
||||
* If method is AHARDWAREBUFFER_CREATE_FROM_HANDLE_METHOD_CLONE, the handle will be cloned and the
|
||||
* clone registered. The AHardwareBuffer will own the cloned handle but not the original.
|
||||
*/
|
||||
int AHardwareBuffer_createFromHandle(const AHardwareBuffer_Desc* desc,
|
||||
const native_handle_t* handle, int32_t method,
|
||||
AHardwareBuffer** outBuffer);
|
||||
|
||||
/**
|
||||
* Buffer pixel formats.
|
||||
*/
|
||||
enum {
|
||||
/* for future proofing, keep these in sync with system/graphics-base.h */
|
||||
|
||||
/* same as HAL_PIXEL_FORMAT_BGRA_8888 */
|
||||
AHARDWAREBUFFER_FORMAT_B8G8R8A8_UNORM = 5,
|
||||
/* same as HAL_PIXEL_FORMAT_YV12 */
|
||||
AHARDWAREBUFFER_FORMAT_YV12 = 0x32315659,
|
||||
/* same as HAL_PIXEL_FORMAT_Y8 */
|
||||
AHARDWAREBUFFER_FORMAT_Y8 = 0x20203859,
|
||||
/* same as HAL_PIXEL_FORMAT_Y16 */
|
||||
AHARDWAREBUFFER_FORMAT_Y16 = 0x20363159,
|
||||
/* same as HAL_PIXEL_FORMAT_RAW16 */
|
||||
AHARDWAREBUFFER_FORMAT_RAW16 = 0x20,
|
||||
/* same as HAL_PIXEL_FORMAT_RAW10 */
|
||||
AHARDWAREBUFFER_FORMAT_RAW10 = 0x25,
|
||||
/* same as HAL_PIXEL_FORMAT_RAW12 */
|
||||
AHARDWAREBUFFER_FORMAT_RAW12 = 0x26,
|
||||
/* same as HAL_PIXEL_FORMAT_RAW_OPAQUE */
|
||||
AHARDWAREBUFFER_FORMAT_RAW_OPAQUE = 0x24,
|
||||
/* same as HAL_PIXEL_FORMAT_IMPLEMENTATION_DEFINED */
|
||||
AHARDWAREBUFFER_FORMAT_IMPLEMENTATION_DEFINED = 0x22,
|
||||
/* same as HAL_PIXEL_FORMAT_YCBCR_422_SP */
|
||||
AHARDWAREBUFFER_FORMAT_YCbCr_422_SP = 0x10,
|
||||
/* same as HAL_PIXEL_FORMAT_YCRCB_420_SP */
|
||||
AHARDWAREBUFFER_FORMAT_YCrCb_420_SP = 0x11,
|
||||
/* same as HAL_PIXEL_FORMAT_YCBCR_422_I */
|
||||
AHARDWAREBUFFER_FORMAT_YCbCr_422_I = 0x14,
|
||||
};
|
||||
|
||||
/**
|
||||
* Buffer usage flags.
|
||||
*/
|
||||
enum {
|
||||
/* for future proofing, keep these in sync with hardware/gralloc.h */
|
||||
|
||||
/* The buffer will be written by the HW camera pipeline. */
|
||||
AHARDWAREBUFFER_USAGE_CAMERA_WRITE = 2UL << 16,
|
||||
/* The buffer will be read by the HW camera pipeline. */
|
||||
AHARDWAREBUFFER_USAGE_CAMERA_READ = 4UL << 16,
|
||||
/* Mask for the camera access values. */
|
||||
AHARDWAREBUFFER_USAGE_CAMERA_MASK = 6UL << 16,
|
||||
};
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_VNDK_NATIVEWINDOW_AHARDWAREBUFFER_H */
|
||||
@@ -0,0 +1,333 @@
|
||||
/*
|
||||
* Copyright (C) 2017 The Android Open Source Project
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#ifndef ANDROID_VNDK_NATIVEWINDOW_ANATIVEWINDOW_H
|
||||
#define ANDROID_VNDK_NATIVEWINDOW_ANATIVEWINDOW_H
|
||||
|
||||
#include <nativebase/nativebase.h>
|
||||
|
||||
// vndk is a superset of the NDK
|
||||
#include <android/native_window.h>
|
||||
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
/*
|
||||
* Convert this ANativeWindowBuffer into a AHardwareBuffer
|
||||
*/
|
||||
AHardwareBuffer* ANativeWindowBuffer_getHardwareBuffer(ANativeWindowBuffer* anwb);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Stores a value into one of the 4 available slots
|
||||
* Retrieve the value with ANativeWindow_OemStorageGet()
|
||||
*
|
||||
* slot: 0 to 3
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_OemStorageSet(ANativeWindow* window, uint32_t slot, intptr_t value);
|
||||
|
||||
|
||||
/*
|
||||
* Retrieves a value from one of the 4 available slots
|
||||
* By default the returned value is 0 if it wasn't set by ANativeWindow_OemStorageSet()
|
||||
*
|
||||
* slot: 0 to 3
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_OemStorageGet(ANativeWindow* window, uint32_t slot, intptr_t* value);
|
||||
|
||||
|
||||
/*
|
||||
* Set the swap interval for this surface.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_setSwapInterval(ANativeWindow* window, int interval);
|
||||
|
||||
|
||||
/*
|
||||
* queries that can be used with ANativeWindow_query() and ANativeWindow_queryf()
|
||||
*/
|
||||
enum ANativeWindowQuery {
|
||||
/* The minimum number of buffers that must remain un-dequeued after a buffer
|
||||
* has been queued. This value applies only if set_buffer_count was used to
|
||||
* override the number of buffers and if a buffer has since been queued.
|
||||
* Users of the set_buffer_count ANativeWindow method should query this
|
||||
* value before calling set_buffer_count. If it is necessary to have N
|
||||
* buffers simultaneously dequeued as part of the steady-state operation,
|
||||
* and this query returns M then N+M buffers should be requested via
|
||||
* native_window_set_buffer_count.
|
||||
*
|
||||
* Note that this value does NOT apply until a single buffer has been
|
||||
* queued. In particular this means that it is possible to:
|
||||
*
|
||||
* 1. Query M = min undequeued buffers
|
||||
* 2. Set the buffer count to N + M
|
||||
* 3. Dequeue all N + M buffers
|
||||
* 4. Cancel M buffers
|
||||
* 5. Queue, dequeue, queue, dequeue, ad infinitum
|
||||
*/
|
||||
ANATIVEWINDOW_QUERY_MIN_UNDEQUEUED_BUFFERS = 3,
|
||||
|
||||
/*
|
||||
* Default width of ANativeWindow buffers, these are the
|
||||
* dimensions of the window buffers irrespective of the
|
||||
* ANativeWindow_setBuffersDimensions() call and match the native window
|
||||
* size.
|
||||
*/
|
||||
ANATIVEWINDOW_QUERY_DEFAULT_WIDTH = 6,
|
||||
ANATIVEWINDOW_QUERY_DEFAULT_HEIGHT = 7,
|
||||
|
||||
/*
|
||||
* transformation that will most-likely be applied to buffers. This is only
|
||||
* a hint, the actual transformation applied might be different.
|
||||
*
|
||||
* INTENDED USE:
|
||||
*
|
||||
* The transform hint can be used by a producer, for instance the GLES
|
||||
* driver, to pre-rotate the rendering such that the final transformation
|
||||
* in the composer is identity. This can be very useful when used in
|
||||
* conjunction with the h/w composer HAL, in situations where it
|
||||
* cannot handle arbitrary rotations.
|
||||
*
|
||||
* 1. Before dequeuing a buffer, the GL driver (or any other ANW client)
|
||||
* queries the ANW for NATIVE_WINDOW_TRANSFORM_HINT.
|
||||
*
|
||||
* 2. The GL driver overrides the width and height of the ANW to
|
||||
* account for NATIVE_WINDOW_TRANSFORM_HINT. This is done by querying
|
||||
* NATIVE_WINDOW_DEFAULT_{WIDTH | HEIGHT}, swapping the dimensions
|
||||
* according to NATIVE_WINDOW_TRANSFORM_HINT and calling
|
||||
* native_window_set_buffers_dimensions().
|
||||
*
|
||||
* 3. The GL driver dequeues a buffer of the new pre-rotated size.
|
||||
*
|
||||
* 4. The GL driver renders to the buffer such that the image is
|
||||
* already transformed, that is applying NATIVE_WINDOW_TRANSFORM_HINT
|
||||
* to the rendering.
|
||||
*
|
||||
* 5. The GL driver calls native_window_set_transform to apply
|
||||
* inverse transformation to the buffer it just rendered.
|
||||
* In order to do this, the GL driver needs
|
||||
* to calculate the inverse of NATIVE_WINDOW_TRANSFORM_HINT, this is
|
||||
* done easily:
|
||||
*
|
||||
* int hintTransform, inverseTransform;
|
||||
* query(..., NATIVE_WINDOW_TRANSFORM_HINT, &hintTransform);
|
||||
* inverseTransform = hintTransform;
|
||||
* if (hintTransform & HAL_TRANSFORM_ROT_90)
|
||||
* inverseTransform ^= HAL_TRANSFORM_ROT_180;
|
||||
*
|
||||
*
|
||||
* 6. The GL driver queues the pre-transformed buffer.
|
||||
*
|
||||
* 7. The composer combines the buffer transform with the display
|
||||
* transform. If the buffer transform happens to cancel out the
|
||||
* display transform then no rotation is needed.
|
||||
*
|
||||
*/
|
||||
ANATIVEWINDOW_QUERY_TRANSFORM_HINT = 8,
|
||||
|
||||
/*
|
||||
* Returns the age of the contents of the most recently dequeued buffer as
|
||||
* the number of frames that have elapsed since it was last queued. For
|
||||
* example, if the window is double-buffered, the age of any given buffer in
|
||||
* steady state will be 2. If the dequeued buffer has never been queued, its
|
||||
* age will be 0.
|
||||
*/
|
||||
ANATIVEWINDOW_QUERY_BUFFER_AGE = 13,
|
||||
|
||||
/* min swap interval supported by this compositor */
|
||||
ANATIVEWINDOW_QUERY_MIN_SWAP_INTERVAL = 0x10000,
|
||||
|
||||
/* max swap interval supported by this compositor */
|
||||
ANATIVEWINDOW_QUERY_MAX_SWAP_INTERVAL = 0x10001,
|
||||
|
||||
/* horizontal resolution in DPI. value is float, use queryf() */
|
||||
ANATIVEWINDOW_QUERY_XDPI = 0x10002,
|
||||
|
||||
/* vertical resolution in DPI. value is float, use queryf() */
|
||||
ANATIVEWINDOW_QUERY_YDPI = 0x10003,
|
||||
};
|
||||
|
||||
typedef enum ANativeWindowQuery ANativeWindowQuery;
|
||||
|
||||
/*
|
||||
* hook used to retrieve information about the native window.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_query(const ANativeWindow* window, ANativeWindowQuery query, int* value);
|
||||
int ANativeWindow_queryf(const ANativeWindow* window, ANativeWindowQuery query, float* value);
|
||||
|
||||
|
||||
/*
|
||||
* Hook called by EGL to acquire a buffer. This call may block if no
|
||||
* buffers are available.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The libsync fence file descriptor returned in the int pointed to by the
|
||||
* fenceFd argument will refer to the fence that must signal before the
|
||||
* dequeued buffer may be written to. A value of -1 indicates that the
|
||||
* caller may access the buffer immediately without waiting on a fence. If
|
||||
* a valid file descriptor is returned (i.e. any value except -1) then the
|
||||
* caller is responsible for closing the file descriptor.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_dequeueBuffer(ANativeWindow* window, ANativeWindowBuffer** buffer, int* fenceFd);
|
||||
|
||||
|
||||
/*
|
||||
* Hook called by EGL when modifications to the render buffer are done.
|
||||
* This unlocks and post the buffer.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The fenceFd argument specifies a libsync fence file descriptor for a
|
||||
* fence that must signal before the buffer can be accessed. If the buffer
|
||||
* can be accessed immediately then a value of -1 should be used. The
|
||||
* caller must not use the file descriptor after it is passed to
|
||||
* queueBuffer, and the ANativeWindow implementation is responsible for
|
||||
* closing it.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_queueBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd);
|
||||
|
||||
|
||||
/*
|
||||
* Hook used to cancel a buffer that has been dequeued.
|
||||
* No synchronization is performed between dequeue() and cancel(), so
|
||||
* either external synchronization is needed, or these functions must be
|
||||
* called from the same thread.
|
||||
*
|
||||
* The window holds a reference to the buffer between dequeueBuffer and
|
||||
* either queueBuffer or cancelBuffer, so clients only need their own
|
||||
* reference if they might use the buffer after queueing or canceling it.
|
||||
* Holding a reference to a buffer after queueing or canceling it is only
|
||||
* allowed if a specific buffer count has been set.
|
||||
*
|
||||
* The fenceFd argument specifies a libsync fence file decsriptor for a
|
||||
* fence that must signal before the buffer can be accessed. If the buffer
|
||||
* can be accessed immediately then a value of -1 should be used.
|
||||
*
|
||||
* Note that if the client has not waited on the fence that was returned
|
||||
* from dequeueBuffer, that same fence should be passed to cancelBuffer to
|
||||
* ensure that future uses of the buffer are preceded by a wait on that
|
||||
* fence. The caller must not use the file descriptor after it is passed
|
||||
* to cancelBuffer, and the ANativeWindow implementation is responsible for
|
||||
* closing it.
|
||||
*
|
||||
* Returns 0 on success or -errno on error.
|
||||
*/
|
||||
int ANativeWindow_cancelBuffer(ANativeWindow* window, ANativeWindowBuffer* buffer, int fenceFd);
|
||||
|
||||
/*
|
||||
* Sets the intended usage flags for the next buffers.
|
||||
*
|
||||
* usage: one of AHARDWAREBUFFER_USAGE_* constant
|
||||
*
|
||||
* By default (if this function is never called), a usage of
|
||||
* AHARDWAREBUFFER_USAGE_GPU_SAMPLED_IMAGE | AHARDWAREBUFFER_USAGE_GPU_COLOR_OUTPUT
|
||||
* is assumed.
|
||||
*
|
||||
* Calling this function will usually cause following buffers to be
|
||||
* reallocated.
|
||||
*/
|
||||
int ANativeWindow_setUsage(ANativeWindow* window, uint64_t usage);
|
||||
|
||||
|
||||
/*
|
||||
* Sets the number of buffers associated with this native window.
|
||||
*/
|
||||
int ANativeWindow_setBufferCount(ANativeWindow* window, size_t bufferCount);
|
||||
|
||||
|
||||
/*
|
||||
* All buffers dequeued after this call will have the dimensions specified.
|
||||
* In particular, all buffers will have a fixed-size, independent from the
|
||||
* native-window size. They will be scaled according to the scaling mode
|
||||
* (see native_window_set_scaling_mode) upon window composition.
|
||||
*
|
||||
* If w and h are 0, the normal behavior is restored. That is, dequeued buffers
|
||||
* following this call will be sized to match the window's size.
|
||||
*
|
||||
* Calling this function will reset the window crop to a NULL value, which
|
||||
* disables cropping of the buffers.
|
||||
*/
|
||||
int ANativeWindow_setBuffersDimensions(ANativeWindow* window, uint32_t w, uint32_t h);
|
||||
|
||||
|
||||
/*
|
||||
* All buffers dequeued after this call will have the format specified.
|
||||
* format: one of AHARDWAREBUFFER_FORMAT_* constant
|
||||
*
|
||||
* If the specified format is 0, the default buffer format will be used.
|
||||
*/
|
||||
int ANativeWindow_setBuffersFormat(ANativeWindow* window, int format);
|
||||
|
||||
|
||||
/*
|
||||
* All buffers queued after this call will be associated with the timestamp in nanosecond
|
||||
* parameter specified. If the timestamp is set to NATIVE_WINDOW_TIMESTAMP_AUTO
|
||||
* (the default), timestamps will be generated automatically when queueBuffer is
|
||||
* called. The timestamp is measured in nanoseconds, and is normally monotonically
|
||||
* increasing. The timestamp should be unaffected by time-of-day adjustments,
|
||||
* and for a camera should be strictly monotonic but for a media player may be
|
||||
* reset when the position is set.
|
||||
*/
|
||||
int ANativeWindow_setBuffersTimestamp(ANativeWindow* window, int64_t timestamp);
|
||||
|
||||
|
||||
/*
|
||||
* Enable/disable shared buffer mode
|
||||
*/
|
||||
int ANativeWindow_setSharedBufferMode(ANativeWindow* window, bool sharedBufferMode);
|
||||
|
||||
|
||||
/*
|
||||
* Enable/disable auto refresh when in shared buffer mode
|
||||
*/
|
||||
int ANativeWindow_setAutoRefresh(ANativeWindow* window, bool autoRefresh);
|
||||
|
||||
/*
|
||||
* Enable/disable the auto prerotation at buffer allocation when the buffer size
|
||||
* is driven by the consumer.
|
||||
*
|
||||
* When buffer size is driven by the consumer and the transform hint specifies
|
||||
* a 90 or 270 degree rotation, if auto prerotation is enabled, the width and
|
||||
* height used for dequeueBuffer will be additionally swapped.
|
||||
*/
|
||||
int ANativeWindow_setAutoPrerotation(ANativeWindow* window, bool autoPrerotation);
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
__END_DECLS
|
||||
|
||||
#endif /* ANDROID_VNDK_NATIVEWINDOW_ANATIVEWINDOW_H */
|
||||
@@ -0,0 +1,49 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2015 VMware, 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 NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 _C99_ALLOCA_H_
|
||||
#define _C99_ALLOCA_H_
|
||||
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
# include <malloc.h>
|
||||
|
||||
# define alloca _alloca
|
||||
|
||||
#elif defined(__sun) || defined(__CYGWIN__)
|
||||
|
||||
# include <alloca.h>
|
||||
|
||||
#else /* !defined(_MSC_VER) */
|
||||
|
||||
# include <stdlib.h>
|
||||
|
||||
#endif /* !defined(_MSC_VER) */
|
||||
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,88 @@
|
||||
/**************************************************************************
|
||||
*
|
||||
* Copyright 2007-2013 VMware, 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 NON-INFRINGEMENT.
|
||||
* IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS 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 "no_extern_c.h"
|
||||
|
||||
#ifndef _C99_COMPAT_H_
|
||||
#define _C99_COMPAT_H_
|
||||
|
||||
|
||||
/*
|
||||
* MSVC hacks.
|
||||
*/
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
# if _MSC_VER < 1900
|
||||
# error "Microsoft Visual Studio 2015 or higher required"
|
||||
# endif
|
||||
|
||||
/*
|
||||
* XXX: MSVC has a `__restrict` keyword, but it also has a
|
||||
* `__declspec(restrict)` modifier, so it is impossible to define a
|
||||
* `restrict` macro without interfering with the latter. Furthermore the
|
||||
* MSVC standard library uses __declspec(restrict) under the _CRTRESTRICT
|
||||
* macro. For now resolve this issue by redefining _CRTRESTRICT, but going
|
||||
* forward we should probably should stop using restrict, especially
|
||||
* considering that our code does not obbey strict aliasing rules any way.
|
||||
*/
|
||||
# include <crtdefs.h>
|
||||
# undef _CRTRESTRICT
|
||||
# define _CRTRESTRICT
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* C99 restrict keyword
|
||||
*
|
||||
* See also:
|
||||
* - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html
|
||||
*/
|
||||
#ifndef restrict
|
||||
# ifndef __cplusplus
|
||||
/* Use C99 restrict keyword */
|
||||
# elif defined(__GNUC__)
|
||||
# define restrict __restrict__
|
||||
# elif defined(_MSC_VER)
|
||||
# define restrict __restrict
|
||||
# else
|
||||
# define restrict /* */
|
||||
# endif
|
||||
#endif
|
||||
|
||||
|
||||
/* Simple test case for debugging */
|
||||
#if 0
|
||||
static inline const char *
|
||||
test_c99_compat_h(const void * restrict a,
|
||||
const void * restrict b)
|
||||
{
|
||||
return __func__;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* _C99_COMPAT_H_ */
|
||||
@@ -0,0 +1,41 @@
|
||||
This directory contains a copy of the installed kernel headers
|
||||
required by several drivers to communicate with the kernel.
|
||||
Whenever one of those driver needs new definitions for new kernel
|
||||
APIs, these files should be updated.
|
||||
|
||||
These files in upstream Mesa should only be updated once the changes
|
||||
have landed in the drm-next branch of the drm repository.
|
||||
|
||||
The drm repository is currently located at:
|
||||
|
||||
* https://gitlab.freedesktop.org/drm/kernel
|
||||
|
||||
* git url: https://gitlab.freedesktop.org/drm/kernel.git
|
||||
|
||||
Tagged Linux kernel releases can also be used.
|
||||
|
||||
When using the drm repository, it is recommended that the headers are
|
||||
generated using a *merge commit* in the drm-next branch. After
|
||||
checking out the commit in the drm (or tagged Linux release) tree, the
|
||||
drm-uapi files can be generated by running this from the drm tree:
|
||||
|
||||
$ make headers_install INSTALL_HDR_PATH=/path/to/install
|
||||
|
||||
This will generate files under /path/to/install/include/drm which can
|
||||
be copied into the Mesa include/drm-uapi directory. It is not required
|
||||
to copy/update all kernel header files.
|
||||
|
||||
The commit message for the Mesa drm-uapi update should include the
|
||||
full commit version of the drm kernel tree. An easy way to generate
|
||||
this is with the following command in the drm tree:
|
||||
|
||||
$ git log -1 --pretty=short --no-decorate
|
||||
|
||||
Which would produce output similar to this to include in the Mesa
|
||||
commit:
|
||||
|
||||
commit a78313bb206e0c456a989f380c4cbd8af8af7c76
|
||||
Merge: 365aa9f57399 79655e867ad6
|
||||
Author: Dave Airlie <airlied@redhat.com>
|
||||
|
||||
Merge tag 'drm-intel-gt-next-2024-06-12' of https://gitlab.freedesktop.org/drm/i915/kernel into drm-next
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,200 @@
|
||||
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
|
||||
/*
|
||||
* Framework for buffer objects that can be shared across devices/subsystems.
|
||||
*
|
||||
* Copyright(C) 2015 Intel Ltd
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify it
|
||||
* under the terms of the GNU General Public License version 2 as published by
|
||||
* the Free Software Foundation.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License along with
|
||||
* this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef _DMA_BUF_UAPI_H_
|
||||
#define _DMA_BUF_UAPI_H_
|
||||
|
||||
#if defined(__linux__) || defined(__managarm__)
|
||||
|
||||
#include <linux/types.h>
|
||||
|
||||
#else /* One of the BSDs */
|
||||
|
||||
#include <stdint.h>
|
||||
#include <sys/types.h>
|
||||
|
||||
typedef int8_t __s8;
|
||||
typedef uint8_t __u8;
|
||||
typedef int16_t __s16;
|
||||
typedef uint16_t __u16;
|
||||
typedef int32_t __s32;
|
||||
typedef uint32_t __u32;
|
||||
typedef int64_t __s64;
|
||||
typedef uint64_t __u64;
|
||||
|
||||
#endif
|
||||
|
||||
/**
|
||||
* struct dma_buf_sync - Synchronize with CPU access.
|
||||
*
|
||||
* When a DMA buffer is accessed from the CPU via mmap, it is not always
|
||||
* possible to guarantee coherency between the CPU-visible map and underlying
|
||||
* memory. To manage coherency, DMA_BUF_IOCTL_SYNC must be used to bracket
|
||||
* any CPU access to give the kernel the chance to shuffle memory around if
|
||||
* needed.
|
||||
*
|
||||
* Prior to accessing the map, the client must call DMA_BUF_IOCTL_SYNC
|
||||
* with DMA_BUF_SYNC_START and the appropriate read/write flags. Once the
|
||||
* access is complete, the client should call DMA_BUF_IOCTL_SYNC with
|
||||
* DMA_BUF_SYNC_END and the same read/write flags.
|
||||
*
|
||||
* The synchronization provided via DMA_BUF_IOCTL_SYNC only provides cache
|
||||
* coherency. It does not prevent other processes or devices from
|
||||
* accessing the memory at the same time. If synchronization with a GPU or
|
||||
* other device driver is required, it is the client's responsibility to
|
||||
* wait for buffer to be ready for reading or writing before calling this
|
||||
* ioctl with DMA_BUF_SYNC_START. Likewise, the client must ensure that
|
||||
* follow-up work is not submitted to GPU or other device driver until
|
||||
* after this ioctl has been called with DMA_BUF_SYNC_END?
|
||||
*
|
||||
* If the driver or API with which the client is interacting uses implicit
|
||||
* synchronization, waiting for prior work to complete can be done via
|
||||
* poll() on the DMA buffer file descriptor. If the driver or API requires
|
||||
* explicit synchronization, the client may have to wait on a sync_file or
|
||||
* other synchronization primitive outside the scope of the DMA buffer API.
|
||||
*/
|
||||
struct dma_buf_sync {
|
||||
/**
|
||||
* @flags: Set of access flags
|
||||
*
|
||||
* DMA_BUF_SYNC_START:
|
||||
* Indicates the start of a map access session.
|
||||
*
|
||||
* DMA_BUF_SYNC_END:
|
||||
* Indicates the end of a map access session.
|
||||
*
|
||||
* DMA_BUF_SYNC_READ:
|
||||
* Indicates that the mapped DMA buffer will be read by the
|
||||
* client via the CPU map.
|
||||
*
|
||||
* DMA_BUF_SYNC_WRITE:
|
||||
* Indicates that the mapped DMA buffer will be written by the
|
||||
* client via the CPU map.
|
||||
*
|
||||
* DMA_BUF_SYNC_RW:
|
||||
* An alias for DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE.
|
||||
*/
|
||||
__u64 flags;
|
||||
};
|
||||
|
||||
#define DMA_BUF_SYNC_READ (1 << 0)
|
||||
#define DMA_BUF_SYNC_WRITE (2 << 0)
|
||||
#define DMA_BUF_SYNC_RW (DMA_BUF_SYNC_READ | DMA_BUF_SYNC_WRITE)
|
||||
#define DMA_BUF_SYNC_START (0 << 2)
|
||||
#define DMA_BUF_SYNC_END (1 << 2)
|
||||
#define DMA_BUF_SYNC_VALID_FLAGS_MASK \
|
||||
(DMA_BUF_SYNC_RW | DMA_BUF_SYNC_END)
|
||||
|
||||
#define DMA_BUF_NAME_LEN 32
|
||||
|
||||
/**
|
||||
* struct dma_buf_export_sync_file - Get a sync_file from a dma-buf
|
||||
*
|
||||
* Userspace can perform a DMA_BUF_IOCTL_EXPORT_SYNC_FILE to retrieve the
|
||||
* current set of fences on a dma-buf file descriptor as a sync_file. CPU
|
||||
* waits via poll() or other driver-specific mechanisms typically wait on
|
||||
* whatever fences are on the dma-buf at the time the wait begins. This
|
||||
* is similar except that it takes a snapshot of the current fences on the
|
||||
* dma-buf for waiting later instead of waiting immediately. This is
|
||||
* useful for modern graphics APIs such as Vulkan which assume an explicit
|
||||
* synchronization model but still need to inter-operate with dma-buf.
|
||||
*
|
||||
* The intended usage pattern is the following:
|
||||
*
|
||||
* 1. Export a sync_file with flags corresponding to the expected GPU usage
|
||||
* via DMA_BUF_IOCTL_EXPORT_SYNC_FILE.
|
||||
*
|
||||
* 2. Submit rendering work which uses the dma-buf. The work should wait on
|
||||
* the exported sync file before rendering and produce another sync_file
|
||||
* when complete.
|
||||
*
|
||||
* 3. Import the rendering-complete sync_file into the dma-buf with flags
|
||||
* corresponding to the GPU usage via DMA_BUF_IOCTL_IMPORT_SYNC_FILE.
|
||||
*
|
||||
* Unlike doing implicit synchronization via a GPU kernel driver's exec ioctl,
|
||||
* the above is not a single atomic operation. If userspace wants to ensure
|
||||
* ordering via these fences, it is the respnosibility of userspace to use
|
||||
* locks or other mechanisms to ensure that no other context adds fences or
|
||||
* submits work between steps 1 and 3 above.
|
||||
*/
|
||||
struct dma_buf_export_sync_file {
|
||||
/**
|
||||
* @flags: Read/write flags
|
||||
*
|
||||
* Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
|
||||
*
|
||||
* If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
|
||||
* the returned sync file waits on any writers of the dma-buf to
|
||||
* complete. Waiting on the returned sync file is equivalent to
|
||||
* poll() with POLLIN.
|
||||
*
|
||||
* If DMA_BUF_SYNC_WRITE is set, the returned sync file waits on
|
||||
* any users of the dma-buf (read or write) to complete. Waiting
|
||||
* on the returned sync file is equivalent to poll() with POLLOUT.
|
||||
* If both DMA_BUF_SYNC_WRITE and DMA_BUF_SYNC_READ are set, this
|
||||
* is equivalent to just DMA_BUF_SYNC_WRITE.
|
||||
*/
|
||||
__u32 flags;
|
||||
/** @fd: Returned sync file descriptor */
|
||||
__s32 fd;
|
||||
};
|
||||
|
||||
/**
|
||||
* struct dma_buf_import_sync_file - Insert a sync_file into a dma-buf
|
||||
*
|
||||
* Userspace can perform a DMA_BUF_IOCTL_IMPORT_SYNC_FILE to insert a
|
||||
* sync_file into a dma-buf for the purposes of implicit synchronization
|
||||
* with other dma-buf consumers. This allows clients using explicitly
|
||||
* synchronized APIs such as Vulkan to inter-op with dma-buf consumers
|
||||
* which expect implicit synchronization such as OpenGL or most media
|
||||
* drivers/video.
|
||||
*/
|
||||
struct dma_buf_import_sync_file {
|
||||
/**
|
||||
* @flags: Read/write flags
|
||||
*
|
||||
* Must be DMA_BUF_SYNC_READ, DMA_BUF_SYNC_WRITE, or both.
|
||||
*
|
||||
* If DMA_BUF_SYNC_READ is set and DMA_BUF_SYNC_WRITE is not set,
|
||||
* this inserts the sync_file as a read-only fence. Any subsequent
|
||||
* implicitly synchronized writes to this dma-buf will wait on this
|
||||
* fence but reads will not.
|
||||
*
|
||||
* If DMA_BUF_SYNC_WRITE is set, this inserts the sync_file as a
|
||||
* write fence. All subsequent implicitly synchronized access to
|
||||
* this dma-buf will wait on this fence.
|
||||
*/
|
||||
__u32 flags;
|
||||
/** @fd: Sync file descriptor */
|
||||
__s32 fd;
|
||||
};
|
||||
|
||||
#define DMA_BUF_BASE 'b'
|
||||
#define DMA_BUF_IOCTL_SYNC _IOW(DMA_BUF_BASE, 0, struct dma_buf_sync)
|
||||
|
||||
/* 32/64bitness of this uapi was botched in android, there's no difference
|
||||
* between them in actual uapi, they're just different numbers.
|
||||
*/
|
||||
#define DMA_BUF_SET_NAME _IOW(DMA_BUF_BASE, 1, const char *)
|
||||
#define DMA_BUF_SET_NAME_A _IOW(DMA_BUF_BASE, 1, __u32)
|
||||
#define DMA_BUF_SET_NAME_B _IOW(DMA_BUF_BASE, 1, __u64)
|
||||
#define DMA_BUF_IOCTL_EXPORT_SYNC_FILE _IOWR(DMA_BUF_BASE, 2, struct dma_buf_export_sync_file)
|
||||
#define DMA_BUF_IOCTL_IMPORT_SYNC_FILE _IOW(DMA_BUF_BASE, 3, struct dma_buf_import_sync_file)
|
||||
|
||||
#endif
|
||||
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user