From c33e19116afd09976bdc39e48a6534f9465f3d38 Mon Sep 17 00:00:00 2001 From: Mark Lobodzinski Date: Fri, 9 Jan 2015 15:12:03 -0600 Subject: [PATCH] xgl: Add xgl header changes for rev30 and 31. Switched EnumerateLayer parameter order, added conditional definition of xgl function prototypes, and prepended 'xgl' to all function prototypes. This included fixes for bugs #13173 and #13180. --- demos/CMakeLists.txt | 2 + glave-generate.py | 4 +- include/xgl.h | 224 ++++++++++++++++++------------------- include/xglDbg.h | 18 +-- include/xglLayer.h | 244 ++++++++++++++++++++--------------------- include/xglWsiX11Ext.h | 8 +- layers/CMakeLists.txt | 2 + layers/basic.cpp | 10 +- layers/draw_state.c | 8 +- layers/mem_tracker.c | 8 +- layers/multi.cpp | 14 +-- loader/CMakeLists.txt | 2 + loader/loader.c | 22 ++-- xgl-generate.py | 4 +- xgl-layer-generate.py | 2 +- xgl.py | 2 +- 16 files changed, 292 insertions(+), 282 deletions(-) diff --git a/demos/CMakeLists.txt b/demos/CMakeLists.txt index 40488f29..582e8f2b 100644 --- a/demos/CMakeLists.txt +++ b/demos/CMakeLists.txt @@ -14,6 +14,8 @@ file(GLOB TEXTURES ) file(COPY ${TEXTURES} DESTINATION ${CMAKE_BINARY_DIR}/demos) +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES") + add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/demos/cube-vert.bil COMMAND ${GLSLANG_PREFIX}/build/install/bin/glslangValidator -s -b ${PROJECT_SOURCE_DIR}/demos/cube.vert COMMAND mv vert.bil ${CMAKE_BINARY_DIR}/demos/cube-vert.bil diff --git a/glave-generate.py b/glave-generate.py index 4a6ac3bb..f93f27e4 100755 --- a/glave-generate.py +++ b/glave-generate.py @@ -499,12 +499,12 @@ class Subcommand(object): func_body.append(' pPacket->gpu = gpu;') func_body.append(' pPacket->maxLayerCount = maxLayerCount;') func_body.append(' pPacket->maxStringSize = maxStringSize;') + func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pOutLayerCount), sizeof(XGL_SIZE), pOutLayerCount);') + func_body.append(' glv_finalize_buffer_address(pHeader, (void**)&(pPacket->pOutLayerCount));') func_body.append(' for (i = 0; i < *pOutLayerCount; i++) {') func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pOutLayers[i]), ((pOutLayers[i] != NULL) ? strlen(pOutLayers[i]) + 1 : 0), pOutLayers[i]);') func_body.append(' glv_finalize_buffer_address(pHeader, (void**)&(pPacket->pOutLayers[i]));') func_body.append(' }') - func_body.append(' glv_add_buffer_to_trace_packet(pHeader, (void**)&(pPacket->pOutLayerCount), sizeof(XGL_SIZE), pOutLayerCount);') - func_body.append(' glv_finalize_buffer_address(pHeader, (void**)&(pPacket->pOutLayerCount));') func_body.append(' pPacket->pReserved = pReserved;') func_body.append(' pPacket->result = result;') diff --git a/include/xgl.h b/include/xgl.h index 5ccafd04..fb2d2771 100644 --- a/include/xgl.h +++ b/include/xgl.h @@ -55,7 +55,7 @@ ((major << 22) | (minor << 12) | patch) // XGL API version supported by this file -#define XGL_API_VERSION XGL_MAKE_VERSION(0, 22, 0) +#define XGL_API_VERSION XGL_MAKE_VERSION(0, 30, 0) #ifndef XGLAPI #define XGLAPI @@ -1761,114 +1761,116 @@ typedef struct _XGL_DISPATCH_INDIRECT_CMD // ------------------------------------------------------------------------------------------------ // API functions -typedef XGL_RESULT (XGLAPI *InitAndEnumerateGpusType)(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, XGL_UINT maxGpus, XGL_UINT* pGpuCount, XGL_PHYSICAL_GPU* pGpus); -typedef XGL_RESULT (XGLAPI *GetGpuInfoType)(XGL_PHYSICAL_GPU gpu, XGL_PHYSICAL_GPU_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_VOID * (XGLAPI *GetProcAddrType)(XGL_PHYSICAL_GPU gpu, const XGL_CHAR * pName); -typedef XGL_RESULT (XGLAPI *CreateDeviceType)(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice); -typedef XGL_RESULT (XGLAPI *DestroyDeviceType)(XGL_DEVICE device); -typedef XGL_RESULT (XGLAPI *GetExtensionSupportType)(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName); -typedef XGL_RESULT (XGLAPI *EnumerateLayersType)(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE* pOutLayerCount, XGL_VOID* pReserved); -typedef XGL_RESULT (XGLAPI *GetDeviceQueueType)(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, XGL_UINT queueIndex, XGL_QUEUE* pQueue); -typedef XGL_RESULT (XGLAPI *QueueSubmitType)(XGL_QUEUE queue, XGL_UINT cmdBufferCount, const XGL_CMD_BUFFER* pCmdBuffers, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs, XGL_FENCE fence); -typedef XGL_RESULT (XGLAPI *QueueSetGlobalMemReferencesType)(XGL_QUEUE queue, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs); -typedef XGL_RESULT (XGLAPI *QueueWaitIdleType)(XGL_QUEUE queue); -typedef XGL_RESULT (XGLAPI *DeviceWaitIdleType)(XGL_DEVICE device); -typedef XGL_RESULT (XGLAPI *GetMemoryHeapCountType)(XGL_DEVICE device, XGL_UINT* pCount); -typedef XGL_RESULT (XGLAPI *GetMemoryHeapInfoType)(XGL_DEVICE device, XGL_UINT heapId, XGL_MEMORY_HEAP_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *AllocMemoryType)(XGL_DEVICE device, const XGL_MEMORY_ALLOC_INFO* pAllocInfo, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *FreeMemoryType)(XGL_GPU_MEMORY mem); -typedef XGL_RESULT (XGLAPI *SetMemoryPriorityType)(XGL_GPU_MEMORY mem, XGL_MEMORY_PRIORITY priority); -typedef XGL_RESULT (XGLAPI *MapMemoryType)(XGL_GPU_MEMORY mem, XGL_FLAGS flags, XGL_VOID** ppData); -typedef XGL_RESULT (XGLAPI *UnmapMemoryType)(XGL_GPU_MEMORY mem); -typedef XGL_RESULT (XGLAPI *PinSystemMemoryType)(XGL_DEVICE device, const XGL_VOID* pSysMem, XGL_SIZE memSize, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *RemapVirtualMemoryPagesType)(XGL_DEVICE device, XGL_UINT rangeCount, const XGL_VIRTUAL_MEMORY_REMAP_RANGE* pRanges, XGL_UINT preWaitSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPreWaitSemaphores, XGL_UINT postSignalSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPostSignalSemaphores); -typedef XGL_RESULT (XGLAPI *GetMultiGpuCompatibilityType)(XGL_PHYSICAL_GPU gpu0, XGL_PHYSICAL_GPU gpu1, XGL_GPU_COMPATIBILITY_INFO* pInfo); -typedef XGL_RESULT (XGLAPI *OpenSharedMemoryType)(XGL_DEVICE device, const XGL_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *OpenSharedQueueSemaphoreType)(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, XGL_QUEUE_SEMAPHORE* pSemaphore); -typedef XGL_RESULT (XGLAPI *OpenPeerMemoryType)(XGL_DEVICE device, const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *OpenPeerImageType)(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *DestroyObjectType)(XGL_OBJECT object); -typedef XGL_RESULT (XGLAPI *GetObjectInfoType)(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *BindObjectMemoryType)(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset); -typedef XGL_RESULT (XGLAPI *CreateFenceType)(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence); -typedef XGL_RESULT (XGLAPI *GetFenceStatusType)(XGL_FENCE fence); -typedef XGL_RESULT (XGLAPI *WaitForFencesType)(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout); -typedef XGL_RESULT (XGLAPI *CreateQueueSemaphoreType)(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, XGL_QUEUE_SEMAPHORE* pSemaphore); -typedef XGL_RESULT (XGLAPI *SignalQueueSemaphoreType)(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore); -typedef XGL_RESULT (XGLAPI *WaitQueueSemaphoreType)(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore); -typedef XGL_RESULT (XGLAPI *CreateEventType)(XGL_DEVICE device, const XGL_EVENT_CREATE_INFO* pCreateInfo, XGL_EVENT* pEvent); -typedef XGL_RESULT (XGLAPI *GetEventStatusType)(XGL_EVENT event); -typedef XGL_RESULT (XGLAPI *SetEventType)(XGL_EVENT event); -typedef XGL_RESULT (XGLAPI *ResetEventType)(XGL_EVENT event); -typedef XGL_RESULT (XGLAPI *CreateQueryPoolType)(XGL_DEVICE device, const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, XGL_QUERY_POOL* pQueryPool); -typedef XGL_RESULT (XGLAPI *GetQueryPoolResultsType)(XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *GetFormatInfoType)(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *CreateImageType)(XGL_DEVICE device, const XGL_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage); -typedef XGL_RESULT (XGLAPI *GetImageSubresourceInfoType)(XGL_IMAGE image, const XGL_IMAGE_SUBRESOURCE* pSubresource, XGL_SUBRESOURCE_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *CreateImageViewType)(XGL_DEVICE device, const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, XGL_IMAGE_VIEW* pView); -typedef XGL_RESULT (XGLAPI *CreateColorAttachmentViewType)(XGL_DEVICE device, const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, XGL_COLOR_ATTACHMENT_VIEW* pView); -typedef XGL_RESULT (XGLAPI *CreateDepthStencilViewType)(XGL_DEVICE device, const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_VIEW* pView); -typedef XGL_RESULT (XGLAPI *CreateShaderType)(XGL_DEVICE device, const XGL_SHADER_CREATE_INFO* pCreateInfo, XGL_SHADER* pShader); -typedef XGL_RESULT (XGLAPI *CreateGraphicsPipelineType)(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline); -typedef XGL_RESULT (XGLAPI *CreateComputePipelineType)(XGL_DEVICE device, const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline); -typedef XGL_RESULT (XGLAPI *StorePipelineType)(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *LoadPipelineType)(XGL_DEVICE device, XGL_SIZE dataSize, const XGL_VOID* pData, XGL_PIPELINE* pPipeline); -typedef XGL_RESULT (XGLAPI *CreatePipelineDeltaType)(XGL_DEVICE device, XGL_PIPELINE p1, XGL_PIPELINE p2, XGL_PIPELINE_DELTA* delta); -typedef XGL_RESULT (XGLAPI *CreateSamplerType)(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler); -typedef XGL_RESULT (XGLAPI *CreateDescriptorSetType)(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET* pDescriptorSet); -typedef XGL_VOID (XGLAPI *BeginDescriptorSetUpdateType)(XGL_DESCRIPTOR_SET descriptorSet); -typedef XGL_VOID (XGLAPI *EndDescriptorSetUpdateType)(XGL_DESCRIPTOR_SET descriptorSet); -typedef XGL_VOID (XGLAPI *AttachSamplerDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers); -typedef XGL_VOID (XGLAPI *AttachImageViewDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews); -typedef XGL_VOID (XGLAPI *AttachMemoryViewDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews); -typedef XGL_VOID (XGLAPI *AttachNestedDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_DESCRIPTOR_SET_ATTACH_INFO* pNestedDescriptorSets); -typedef XGL_VOID (XGLAPI *ClearDescriptorSetSlotsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount); -typedef XGL_RESULT (XGLAPI *CreateViewportStateType)(XGL_DEVICE device, const XGL_VIEWPORT_STATE_CREATE_INFO* pCreateInfo, XGL_VIEWPORT_STATE_OBJECT* pState); -typedef XGL_RESULT (XGLAPI *CreateRasterStateType)(XGL_DEVICE device, const XGL_RASTER_STATE_CREATE_INFO* pCreateInfo, XGL_RASTER_STATE_OBJECT* pState); -typedef XGL_RESULT (XGLAPI *CreateMsaaStateType)(XGL_DEVICE device, const XGL_MSAA_STATE_CREATE_INFO* pCreateInfo, XGL_MSAA_STATE_OBJECT* pState); -typedef XGL_RESULT (XGLAPI *CreateColorBlendStateType)(XGL_DEVICE device, const XGL_COLOR_BLEND_STATE_CREATE_INFO* pCreateInfo, XGL_COLOR_BLEND_STATE_OBJECT* pState); -typedef XGL_RESULT (XGLAPI *CreateDepthStencilStateType)(XGL_DEVICE device, const XGL_DEPTH_STENCIL_STATE_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_STATE_OBJECT* pState); -typedef XGL_RESULT (XGLAPI *CreateCommandBufferType)(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, XGL_CMD_BUFFER* pCmdBuffer); -typedef XGL_RESULT (XGLAPI *BeginCommandBufferType)(XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags); -typedef XGL_RESULT (XGLAPI *EndCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); -typedef XGL_RESULT (XGLAPI *ResetCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); -typedef XGL_VOID (XGLAPI *CmdBindPipelineType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline); -typedef XGL_VOID (XGLAPI *CmdBindPipelineDeltaType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE_DELTA delta); -typedef XGL_VOID (XGLAPI *CmdBindStateObjectType)(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_STATE_OBJECT state); -typedef XGL_VOID (XGLAPI *CmdBindDescriptorSetType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT index, XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT slotOffset); -typedef XGL_VOID (XGLAPI *CmdBindDynamicMemoryViewType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView); -typedef XGL_VOID (XGLAPI *CmdBindVertexDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding); -typedef XGL_VOID (XGLAPI *CmdBindIndexDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType); -typedef XGL_VOID (XGLAPI *CmdBindAttachmentsType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT colorAttachmentCount, const XGL_COLOR_ATTACHMENT_BIND_INFO* pColorAttachments, const XGL_DEPTH_STENCIL_BIND_INFO* pDepthStencilAttachment); -typedef XGL_VOID (XGLAPI *CmdPrepareMemoryRegionsType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_MEMORY_STATE_TRANSITION* pStateTransitions); -typedef XGL_VOID (XGLAPI *CmdPrepareImagesType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_IMAGE_STATE_TRANSITION* pStateTransitions); -typedef XGL_VOID (XGLAPI *CmdDrawType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstVertex, XGL_UINT vertexCount, XGL_UINT firstInstance, XGL_UINT instanceCount); -typedef XGL_VOID (XGLAPI *CmdDrawIndexedType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstIndex, XGL_UINT indexCount, XGL_INT vertexOffset, XGL_UINT firstInstance, XGL_UINT instanceCount); -typedef XGL_VOID (XGLAPI *CmdDrawIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride); -typedef XGL_VOID (XGLAPI *CmdDrawIndexedIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride); -typedef XGL_VOID (XGLAPI *CmdDispatchType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT x, XGL_UINT y, XGL_UINT z); -typedef XGL_VOID (XGLAPI *CmdDispatchIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset); -typedef XGL_VOID (XGLAPI *CmdCopyMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_COPY* pRegions); -typedef XGL_VOID (XGLAPI *CmdCopyImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_IMAGE_COPY* pRegions); -typedef XGL_VOID (XGLAPI *CmdCopyMemoryToImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions); -typedef XGL_VOID (XGLAPI *CmdCopyImageToMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions); -typedef XGL_VOID (XGLAPI *CmdCloneImageDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_STATE srcImageState, XGL_IMAGE destImage, XGL_IMAGE_STATE destImageState); -typedef XGL_VOID (XGLAPI *CmdUpdateMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE dataSize, const XGL_UINT32* pData); -typedef XGL_VOID (XGLAPI *CmdFillMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE fillSize, XGL_UINT32 data); -typedef XGL_VOID (XGLAPI *CmdClearColorImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_FLOAT color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); -typedef XGL_VOID (XGLAPI *CmdClearColorImageRawType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_UINT32 color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); -typedef XGL_VOID (XGLAPI *CmdClearDepthStencilType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, XGL_FLOAT depth, XGL_UINT32 stencil, XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); -typedef XGL_VOID (XGLAPI *CmdResolveImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT rectCount, const XGL_IMAGE_RESOLVE* pRects); -typedef XGL_VOID (XGLAPI *CmdSetEventType)(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event); -typedef XGL_VOID (XGLAPI *CmdResetEventType)(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event); -typedef XGL_VOID (XGLAPI *CmdMemoryAtomicType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_UINT64 srcData, XGL_ATOMIC_OP atomicOp); -typedef XGL_VOID (XGLAPI *CmdBeginQueryType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot, XGL_FLAGS flags); -typedef XGL_VOID (XGLAPI *CmdEndQueryType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot); -typedef XGL_VOID (XGLAPI *CmdResetQueryPoolType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount); -typedef XGL_VOID (XGLAPI *CmdWriteTimestampType)(XGL_CMD_BUFFER cmdBuffer, XGL_TIMESTAMP_TYPE timestampType, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset); -typedef XGL_VOID (XGLAPI *CmdInitAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, const XGL_UINT32* pData); -typedef XGL_VOID (XGLAPI *CmdLoadAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY srcMem, XGL_GPU_SIZE srcOffset); -typedef XGL_VOID (XGLAPI *CmdSaveAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset); +typedef XGL_RESULT (XGLAPI *xglInitAndEnumerateGpusType)(const XGL_APPLICATION_INFO* pAppInfo, const XGL_ALLOC_CALLBACKS* pAllocCb, XGL_UINT maxGpus, XGL_UINT* pGpuCount, XGL_PHYSICAL_GPU* pGpus); +typedef XGL_RESULT (XGLAPI *xglGetGpuInfoType)(XGL_PHYSICAL_GPU gpu, XGL_PHYSICAL_GPU_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_VOID * (XGLAPI *xglGetProcAddrType)(XGL_PHYSICAL_GPU gpu, const XGL_CHAR * pName); +typedef XGL_RESULT (XGLAPI *xglCreateDeviceType)(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CREATE_INFO* pCreateInfo, XGL_DEVICE* pDevice); +typedef XGL_RESULT (XGLAPI *xglDestroyDeviceType)(XGL_DEVICE device); +typedef XGL_RESULT (XGLAPI *xglGetExtensionSupportType)(XGL_PHYSICAL_GPU gpu, const XGL_CHAR* pExtName); +typedef XGL_RESULT (XGLAPI *xglEnumerateLayersType)(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved); +typedef XGL_RESULT (XGLAPI *xglGetDeviceQueueType)(XGL_DEVICE device, XGL_QUEUE_TYPE queueType, XGL_UINT queueIndex, XGL_QUEUE* pQueue); +typedef XGL_RESULT (XGLAPI *xglQueueSubmitType)(XGL_QUEUE queue, XGL_UINT cmdBufferCount, const XGL_CMD_BUFFER* pCmdBuffers, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs, XGL_FENCE fence); +typedef XGL_RESULT (XGLAPI *xglQueueSetGlobalMemReferencesType)(XGL_QUEUE queue, XGL_UINT memRefCount, const XGL_MEMORY_REF* pMemRefs); +typedef XGL_RESULT (XGLAPI *xglQueueWaitIdleType)(XGL_QUEUE queue); +typedef XGL_RESULT (XGLAPI *xglDeviceWaitIdleType)(XGL_DEVICE device); +typedef XGL_RESULT (XGLAPI *xglGetMemoryHeapCountType)(XGL_DEVICE device, XGL_UINT* pCount); +typedef XGL_RESULT (XGLAPI *xglGetMemoryHeapInfoType)(XGL_DEVICE device, XGL_UINT heapId, XGL_MEMORY_HEAP_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglAllocMemoryType)(XGL_DEVICE device, const XGL_MEMORY_ALLOC_INFO* pAllocInfo, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglFreeMemoryType)(XGL_GPU_MEMORY mem); +typedef XGL_RESULT (XGLAPI *xglSetMemoryPriorityType)(XGL_GPU_MEMORY mem, XGL_MEMORY_PRIORITY priority); +typedef XGL_RESULT (XGLAPI *xglMapMemoryType)(XGL_GPU_MEMORY mem, XGL_FLAGS flags, XGL_VOID** ppData); +typedef XGL_RESULT (XGLAPI *xglUnmapMemoryType)(XGL_GPU_MEMORY mem); +typedef XGL_RESULT (XGLAPI *xglPinSystemMemoryType)(XGL_DEVICE device, const XGL_VOID* pSysMem, XGL_SIZE memSize, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglRemapVirtualMemoryPagesType)(XGL_DEVICE device, XGL_UINT rangeCount, const XGL_VIRTUAL_MEMORY_REMAP_RANGE* pRanges, XGL_UINT preWaitSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPreWaitSemaphores, XGL_UINT postSignalSemaphoreCount, const XGL_QUEUE_SEMAPHORE* pPostSignalSemaphores); +typedef XGL_RESULT (XGLAPI *xglGetMultiGpuCompatibilityType)(XGL_PHYSICAL_GPU gpu0, XGL_PHYSICAL_GPU gpu1, XGL_GPU_COMPATIBILITY_INFO* pInfo); +typedef XGL_RESULT (XGLAPI *xglOpenSharedMemoryType)(XGL_DEVICE device, const XGL_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglOpenSharedQueueSemaphoreType)(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_OPEN_INFO* pOpenInfo, XGL_QUEUE_SEMAPHORE* pSemaphore); +typedef XGL_RESULT (XGLAPI *xglOpenPeerMemoryType)(XGL_DEVICE device, const XGL_PEER_MEMORY_OPEN_INFO* pOpenInfo, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglOpenPeerImageType)(XGL_DEVICE device, const XGL_PEER_IMAGE_OPEN_INFO* pOpenInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglDestroyObjectType)(XGL_OBJECT object); +typedef XGL_RESULT (XGLAPI *xglGetObjectInfoType)(XGL_BASE_OBJECT object, XGL_OBJECT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglBindObjectMemoryType)(XGL_OBJECT object, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset); +typedef XGL_RESULT (XGLAPI *xglCreateFenceType)(XGL_DEVICE device, const XGL_FENCE_CREATE_INFO* pCreateInfo, XGL_FENCE* pFence); +typedef XGL_RESULT (XGLAPI *xglGetFenceStatusType)(XGL_FENCE fence); +typedef XGL_RESULT (XGLAPI *xglWaitForFencesType)(XGL_DEVICE device, XGL_UINT fenceCount, const XGL_FENCE* pFences, XGL_BOOL waitAll, XGL_UINT64 timeout); +typedef XGL_RESULT (XGLAPI *xglCreateQueueSemaphoreType)(XGL_DEVICE device, const XGL_QUEUE_SEMAPHORE_CREATE_INFO* pCreateInfo, XGL_QUEUE_SEMAPHORE* pSemaphore); +typedef XGL_RESULT (XGLAPI *xglSignalQueueSemaphoreType)(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore); +typedef XGL_RESULT (XGLAPI *xglWaitQueueSemaphoreType)(XGL_QUEUE queue, XGL_QUEUE_SEMAPHORE semaphore); +typedef XGL_RESULT (XGLAPI *xglCreateEventType)(XGL_DEVICE device, const XGL_EVENT_CREATE_INFO* pCreateInfo, XGL_EVENT* pEvent); +typedef XGL_RESULT (XGLAPI *xglGetEventStatusType)(XGL_EVENT event); +typedef XGL_RESULT (XGLAPI *xglSetEventType)(XGL_EVENT event); +typedef XGL_RESULT (XGLAPI *xglResetEventType)(XGL_EVENT event); +typedef XGL_RESULT (XGLAPI *xglCreateQueryPoolType)(XGL_DEVICE device, const XGL_QUERY_POOL_CREATE_INFO* pCreateInfo, XGL_QUERY_POOL* pQueryPool); +typedef XGL_RESULT (XGLAPI *xglGetQueryPoolResultsType)(XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglGetFormatInfoType)(XGL_DEVICE device, XGL_FORMAT format, XGL_FORMAT_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglCreateImageType)(XGL_DEVICE device, const XGL_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage); +typedef XGL_RESULT (XGLAPI *xglGetImageSubresourceInfoType)(XGL_IMAGE image, const XGL_IMAGE_SUBRESOURCE* pSubresource, XGL_SUBRESOURCE_INFO_TYPE infoType, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglCreateImageViewType)(XGL_DEVICE device, const XGL_IMAGE_VIEW_CREATE_INFO* pCreateInfo, XGL_IMAGE_VIEW* pView); +typedef XGL_RESULT (XGLAPI *xglCreateColorAttachmentViewType)(XGL_DEVICE device, const XGL_COLOR_ATTACHMENT_VIEW_CREATE_INFO* pCreateInfo, XGL_COLOR_ATTACHMENT_VIEW* pView); +typedef XGL_RESULT (XGLAPI *xglCreateDepthStencilViewType)(XGL_DEVICE device, const XGL_DEPTH_STENCIL_VIEW_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_VIEW* pView); +typedef XGL_RESULT (XGLAPI *xglCreateShaderType)(XGL_DEVICE device, const XGL_SHADER_CREATE_INFO* pCreateInfo, XGL_SHADER* pShader); +typedef XGL_RESULT (XGLAPI *xglCreateGraphicsPipelineType)(XGL_DEVICE device, const XGL_GRAPHICS_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline); +typedef XGL_RESULT (XGLAPI *xglCreateComputePipelineType)(XGL_DEVICE device, const XGL_COMPUTE_PIPELINE_CREATE_INFO* pCreateInfo, XGL_PIPELINE* pPipeline); +typedef XGL_RESULT (XGLAPI *xglStorePipelineType)(XGL_PIPELINE pipeline, XGL_SIZE* pDataSize, XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglLoadPipelineType)(XGL_DEVICE device, XGL_SIZE dataSize, const XGL_VOID* pData, XGL_PIPELINE* pPipeline); +typedef XGL_RESULT (XGLAPI *xglCreatePipelineDeltaType)(XGL_DEVICE device, XGL_PIPELINE p1, XGL_PIPELINE p2, XGL_PIPELINE_DELTA* delta); +typedef XGL_RESULT (XGLAPI *xglCreateSamplerType)(XGL_DEVICE device, const XGL_SAMPLER_CREATE_INFO* pCreateInfo, XGL_SAMPLER* pSampler); +typedef XGL_RESULT (XGLAPI *xglCreateDescriptorSetType)(XGL_DEVICE device, const XGL_DESCRIPTOR_SET_CREATE_INFO* pCreateInfo, XGL_DESCRIPTOR_SET* pDescriptorSet); +typedef XGL_VOID (XGLAPI *xglBeginDescriptorSetUpdateType)(XGL_DESCRIPTOR_SET descriptorSet); +typedef XGL_VOID (XGLAPI *xglEndDescriptorSetUpdateType)(XGL_DESCRIPTOR_SET descriptorSet); +typedef XGL_VOID (XGLAPI *xglAttachSamplerDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_SAMPLER* pSamplers); +typedef XGL_VOID (XGLAPI *xglAttachImageViewDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_IMAGE_VIEW_ATTACH_INFO* pImageViews); +typedef XGL_VOID (XGLAPI *xglAttachMemoryViewDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemViews); +typedef XGL_VOID (XGLAPI *xglAttachNestedDescriptorsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount, const XGL_DESCRIPTOR_SET_ATTACH_INFO* pNestedDescriptorSets); +typedef XGL_VOID (XGLAPI *xglClearDescriptorSetSlotsType)(XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT startSlot, XGL_UINT slotCount); +typedef XGL_RESULT (XGLAPI *xglCreateViewportStateType)(XGL_DEVICE device, const XGL_VIEWPORT_STATE_CREATE_INFO* pCreateInfo, XGL_VIEWPORT_STATE_OBJECT* pState); +typedef XGL_RESULT (XGLAPI *xglCreateRasterStateType)(XGL_DEVICE device, const XGL_RASTER_STATE_CREATE_INFO* pCreateInfo, XGL_RASTER_STATE_OBJECT* pState); +typedef XGL_RESULT (XGLAPI *xglCreateMsaaStateType)(XGL_DEVICE device, const XGL_MSAA_STATE_CREATE_INFO* pCreateInfo, XGL_MSAA_STATE_OBJECT* pState); +typedef XGL_RESULT (XGLAPI *xglCreateColorBlendStateType)(XGL_DEVICE device, const XGL_COLOR_BLEND_STATE_CREATE_INFO* pCreateInfo, XGL_COLOR_BLEND_STATE_OBJECT* pState); +typedef XGL_RESULT (XGLAPI *xglCreateDepthStencilStateType)(XGL_DEVICE device, const XGL_DEPTH_STENCIL_STATE_CREATE_INFO* pCreateInfo, XGL_DEPTH_STENCIL_STATE_OBJECT* pState); +typedef XGL_RESULT (XGLAPI *xglCreateCommandBufferType)(XGL_DEVICE device, const XGL_CMD_BUFFER_CREATE_INFO* pCreateInfo, XGL_CMD_BUFFER* pCmdBuffer); +typedef XGL_RESULT (XGLAPI *xglBeginCommandBufferType)(XGL_CMD_BUFFER cmdBuffer, XGL_FLAGS flags); +typedef XGL_RESULT (XGLAPI *xglEndCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); +typedef XGL_RESULT (XGLAPI *xglResetCommandBufferType)(XGL_CMD_BUFFER cmdBuffer); +typedef XGL_VOID (XGLAPI *xglCmdBindPipelineType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE pipeline); +typedef XGL_VOID (XGLAPI *xglCmdBindPipelineDeltaType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_PIPELINE_DELTA delta); +typedef XGL_VOID (XGLAPI *xglCmdBindStateObjectType)(XGL_CMD_BUFFER cmdBuffer, XGL_STATE_BIND_POINT stateBindPoint, XGL_STATE_OBJECT state); +typedef XGL_VOID (XGLAPI *xglCmdBindDescriptorSetType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT index, XGL_DESCRIPTOR_SET descriptorSet, XGL_UINT slotOffset); +typedef XGL_VOID (XGLAPI *xglCmdBindDynamicMemoryViewType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, const XGL_MEMORY_VIEW_ATTACH_INFO* pMemView); +typedef XGL_VOID (XGLAPI *xglCmdBindVertexDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT binding); +typedef XGL_VOID (XGLAPI *xglCmdBindIndexDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_INDEX_TYPE indexType); +typedef XGL_VOID (XGLAPI *xglCmdBindAttachmentsType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT colorAttachmentCount, const XGL_COLOR_ATTACHMENT_BIND_INFO* pColorAttachments, const XGL_DEPTH_STENCIL_BIND_INFO* pDepthStencilAttachment); +typedef XGL_VOID (XGLAPI *xglCmdPrepareMemoryRegionsType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_MEMORY_STATE_TRANSITION* pStateTransitions); +typedef XGL_VOID (XGLAPI *xglCmdPrepareImagesType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT transitionCount, const XGL_IMAGE_STATE_TRANSITION* pStateTransitions); +typedef XGL_VOID (XGLAPI *xglCmdDrawType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstVertex, XGL_UINT vertexCount, XGL_UINT firstInstance, XGL_UINT instanceCount); +typedef XGL_VOID (XGLAPI *xglCmdDrawIndexedType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT firstIndex, XGL_UINT indexCount, XGL_INT vertexOffset, XGL_UINT firstInstance, XGL_UINT instanceCount); +typedef XGL_VOID (XGLAPI *xglCmdDrawIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride); +typedef XGL_VOID (XGLAPI *xglCmdDrawIndexedIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset, XGL_UINT32 count, XGL_UINT32 stride); +typedef XGL_VOID (XGLAPI *xglCmdDispatchType)(XGL_CMD_BUFFER cmdBuffer, XGL_UINT x, XGL_UINT y, XGL_UINT z); +typedef XGL_VOID (XGLAPI *xglCmdDispatchIndirectType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY mem, XGL_GPU_SIZE offset); +typedef XGL_VOID (XGLAPI *xglCmdCopyMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_COPY* pRegions); +typedef XGL_VOID (XGLAPI *xglCmdCopyImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_IMAGE_COPY* pRegions); +typedef XGL_VOID (XGLAPI *xglCmdCopyMemoryToImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY srcMem, XGL_IMAGE destImage, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions); +typedef XGL_VOID (XGLAPI *xglCmdCopyImageToMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_GPU_MEMORY destMem, XGL_UINT regionCount, const XGL_MEMORY_IMAGE_COPY* pRegions); +typedef XGL_VOID (XGLAPI *xglCmdCloneImageDataType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE_STATE srcImageState, XGL_IMAGE destImage, XGL_IMAGE_STATE destImageState); +typedef XGL_VOID (XGLAPI *xglCmdUpdateMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE dataSize, const XGL_UINT32* pData); +typedef XGL_VOID (XGLAPI *xglCmdFillMemoryType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_GPU_SIZE fillSize, XGL_UINT32 data); +typedef XGL_VOID (XGLAPI *xglCmdClearColorImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_FLOAT color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); +typedef XGL_VOID (XGLAPI *xglCmdClearColorImageRawType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, const XGL_UINT32 color[4], XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); +typedef XGL_VOID (XGLAPI *xglCmdClearDepthStencilType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE image, XGL_FLOAT depth, XGL_UINT32 stencil, XGL_UINT rangeCount, const XGL_IMAGE_SUBRESOURCE_RANGE* pRanges); +typedef XGL_VOID (XGLAPI *xglCmdResolveImageType)(XGL_CMD_BUFFER cmdBuffer, XGL_IMAGE srcImage, XGL_IMAGE destImage, XGL_UINT rectCount, const XGL_IMAGE_RESOLVE* pRects); +typedef XGL_VOID (XGLAPI *xglCmdSetEventType)(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event); +typedef XGL_VOID (XGLAPI *xglCmdResetEventType)(XGL_CMD_BUFFER cmdBuffer, XGL_EVENT event); +typedef XGL_VOID (XGLAPI *xglCmdMemoryAtomicType)(XGL_CMD_BUFFER cmdBuffer, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset, XGL_UINT64 srcData, XGL_ATOMIC_OP atomicOp); +typedef XGL_VOID (XGLAPI *xglCmdBeginQueryType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot, XGL_FLAGS flags); +typedef XGL_VOID (XGLAPI *xglCmdEndQueryType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT slot); +typedef XGL_VOID (XGLAPI *xglCmdResetQueryPoolType)(XGL_CMD_BUFFER cmdBuffer, XGL_QUERY_POOL queryPool, XGL_UINT startQuery, XGL_UINT queryCount); +typedef XGL_VOID (XGLAPI *xglCmdWriteTimestampType)(XGL_CMD_BUFFER cmdBuffer, XGL_TIMESTAMP_TYPE timestampType, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset); +typedef XGL_VOID (XGLAPI *xglCmdInitAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, const XGL_UINT32* pData); +typedef XGL_VOID (XGLAPI *xglCmdLoadAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY srcMem, XGL_GPU_SIZE srcOffset); +typedef XGL_VOID (XGLAPI *xglCmdSaveAtomicCountersType)(XGL_CMD_BUFFER cmdBuffer, XGL_PIPELINE_BIND_POINT pipelineBindPoint, XGL_UINT startCounter, XGL_UINT counterCount, XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset); + +#ifdef XGL_PROTOTYPES // GPU initialization @@ -1910,8 +1912,8 @@ XGL_RESULT XGLAPI xglEnumerateLayers( XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, - XGL_CHAR* const* pOutLayers, XGL_SIZE* pOutLayerCount, + XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved); // Queue functions @@ -2502,6 +2504,8 @@ XGL_VOID XGLAPI xglCmdSaveAtomicCounters( XGL_GPU_MEMORY destMem, XGL_GPU_SIZE destOffset); +#endif /* XGL_PROTOTYPES */ + #ifdef __cplusplus } // extern "C" #endif // __cplusplus diff --git a/include/xglDbg.h b/include/xglDbg.h index 77695a01..7a5728a1 100644 --- a/include/xglDbg.h +++ b/include/xglDbg.h @@ -100,15 +100,15 @@ typedef XGL_VOID (XGLAPI *XGL_DBG_MSG_CALLBACK_FUNCTION)( XGL_VOID* pUserData); // Debug functions -typedef XGL_RESULT (XGLAPI *DbgSetValidationLevelType)(XGL_DEVICE device, XGL_VALIDATION_LEVEL validationLevel); -typedef XGL_RESULT (XGLAPI *DbgRegisterMsgCallbackType)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData); -typedef XGL_RESULT (XGLAPI *DbgUnregisterMsgCallbackType)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback); -typedef XGL_RESULT (XGLAPI *DbgSetMessageFilterType)(XGL_DEVICE device, XGL_INT msgCode, XGL_DBG_MSG_FILTER filter); -typedef XGL_RESULT (XGLAPI *DbgSetObjectTagType)(XGL_BASE_OBJECT object, XGL_SIZE tagSize, const XGL_VOID* pTag); -typedef XGL_RESULT (XGLAPI *DbgSetGlobalOptionType)(XGL_DBG_GLOBAL_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData); -typedef XGL_RESULT (XGLAPI *DbgSetDeviceOptionType)(XGL_DEVICE device, XGL_DBG_DEVICE_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData); -typedef XGL_VOID (XGLAPI *CmdDbgMarkerBeginType)(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker); -typedef XGL_VOID (XGLAPI *CmdDbgMarkerEndType)(XGL_CMD_BUFFER cmdBuffer); +typedef XGL_RESULT (XGLAPI *xglDbgSetValidationLevelType)(XGL_DEVICE device, XGL_VALIDATION_LEVEL validationLevel); +typedef XGL_RESULT (XGLAPI *xglDbgRegisterMsgCallbackType)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback, XGL_VOID* pUserData); +typedef XGL_RESULT (XGLAPI *xglDbgUnregisterMsgCallbackType)(XGL_DBG_MSG_CALLBACK_FUNCTION pfnMsgCallback); +typedef XGL_RESULT (XGLAPI *xglDbgSetMessageFilterType)(XGL_DEVICE device, XGL_INT msgCode, XGL_DBG_MSG_FILTER filter); +typedef XGL_RESULT (XGLAPI *xglDbgSetObjectTagType)(XGL_BASE_OBJECT object, XGL_SIZE tagSize, const XGL_VOID* pTag); +typedef XGL_RESULT (XGLAPI *xglDbgSetGlobalOptionType)(XGL_DBG_GLOBAL_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData); +typedef XGL_RESULT (XGLAPI *xglDbgSetDeviceOptionType)(XGL_DEVICE device, XGL_DBG_DEVICE_OPTION dbgOption, XGL_SIZE dataSize, const XGL_VOID* pData); +typedef XGL_VOID (XGLAPI *xglCmdDbgMarkerBeginType)(XGL_CMD_BUFFER cmdBuffer, const XGL_CHAR* pMarker); +typedef XGL_VOID (XGLAPI *xglCmdDbgMarkerEndType)(XGL_CMD_BUFFER cmdBuffer); XGL_RESULT XGLAPI xglDbgSetValidationLevel( XGL_DEVICE device, diff --git a/include/xglLayer.h b/include/xglLayer.h index 6a0339c4..3b462b68 100644 --- a/include/xglLayer.h +++ b/include/xglLayer.h @@ -18,134 +18,134 @@ typedef struct _XGL_BASE_LAYER_OBJECT { - GetProcAddrType pGPA; + xglGetProcAddrType pGPA; XGL_BASE_OBJECT nextObject; XGL_BASE_OBJECT baseObject; } XGL_BASE_LAYER_OBJECT; typedef struct _XGL_LAYER_DISPATCH_TABLE { - GetProcAddrType GetProcAddr; - InitAndEnumerateGpusType InitAndEnumerateGpus; - GetGpuInfoType GetGpuInfo; - CreateDeviceType CreateDevice; - DestroyDeviceType DestroyDevice; - GetExtensionSupportType GetExtensionSupport; - EnumerateLayersType EnumerateLayers; - GetDeviceQueueType GetDeviceQueue; - QueueSubmitType QueueSubmit; - QueueSetGlobalMemReferencesType QueueSetGlobalMemReferences; - QueueWaitIdleType QueueWaitIdle; - DeviceWaitIdleType DeviceWaitIdle; - GetMemoryHeapCountType GetMemoryHeapCount; - GetMemoryHeapInfoType GetMemoryHeapInfo; - AllocMemoryType AllocMemory; - FreeMemoryType FreeMemory; - SetMemoryPriorityType SetMemoryPriority; - MapMemoryType MapMemory; - UnmapMemoryType UnmapMemory; - PinSystemMemoryType PinSystemMemory; - RemapVirtualMemoryPagesType RemapVirtualMemoryPages; - GetMultiGpuCompatibilityType GetMultiGpuCompatibility; - OpenSharedMemoryType OpenSharedMemory; - OpenSharedQueueSemaphoreType OpenSharedQueueSemaphore; - OpenPeerMemoryType OpenPeerMemory; - OpenPeerImageType OpenPeerImage; - DestroyObjectType DestroyObject; - GetObjectInfoType GetObjectInfo; - BindObjectMemoryType BindObjectMemory; - CreateFenceType CreateFence; - GetFenceStatusType GetFenceStatus; - WaitForFencesType WaitForFences; - CreateQueueSemaphoreType CreateQueueSemaphore; - SignalQueueSemaphoreType SignalQueueSemaphore; - WaitQueueSemaphoreType WaitQueueSemaphore; - CreateEventType CreateEvent; - GetEventStatusType GetEventStatus; - SetEventType SetEvent; - ResetEventType ResetEvent; - CreateQueryPoolType CreateQueryPool; - GetQueryPoolResultsType GetQueryPoolResults; - GetFormatInfoType GetFormatInfo; - CreateImageType CreateImage; - GetImageSubresourceInfoType GetImageSubresourceInfo; - CreateImageViewType CreateImageView; - CreateColorAttachmentViewType CreateColorAttachmentView; - CreateDepthStencilViewType CreateDepthStencilView; - CreateShaderType CreateShader; - CreateGraphicsPipelineType CreateGraphicsPipeline; - CreateComputePipelineType CreateComputePipeline; - StorePipelineType StorePipeline; - LoadPipelineType LoadPipeline; - CreatePipelineDeltaType CreatePipelineDelta; - CreateSamplerType CreateSampler; - CreateDescriptorSetType CreateDescriptorSet; - BeginDescriptorSetUpdateType BeginDescriptorSetUpdate; - EndDescriptorSetUpdateType EndDescriptorSetUpdate; - AttachSamplerDescriptorsType AttachSamplerDescriptors; - AttachImageViewDescriptorsType AttachImageViewDescriptors; - AttachMemoryViewDescriptorsType AttachMemoryViewDescriptors; - AttachNestedDescriptorsType AttachNestedDescriptors; - ClearDescriptorSetSlotsType ClearDescriptorSetSlots; - CreateViewportStateType CreateViewportState; - CreateRasterStateType CreateRasterState; - CreateMsaaStateType CreateMsaaState; - CreateColorBlendStateType CreateColorBlendState; - CreateDepthStencilStateType CreateDepthStencilState; - CreateCommandBufferType CreateCommandBuffer; - BeginCommandBufferType BeginCommandBuffer; - EndCommandBufferType EndCommandBuffer; - ResetCommandBufferType ResetCommandBuffer; - CmdBindPipelineType CmdBindPipeline; - CmdBindPipelineDeltaType CmdBindPipelineDelta; - CmdBindStateObjectType CmdBindStateObject; - CmdBindDescriptorSetType CmdBindDescriptorSet; - CmdBindDynamicMemoryViewType CmdBindDynamicMemoryView; - CmdBindVertexDataType CmdBindVertexData; - CmdBindIndexDataType CmdBindIndexData; - CmdBindAttachmentsType CmdBindAttachments; - CmdPrepareMemoryRegionsType CmdPrepareMemoryRegions; - CmdPrepareImagesType CmdPrepareImages; - CmdDrawType CmdDraw; - CmdDrawIndexedType CmdDrawIndexed; - CmdDrawIndirectType CmdDrawIndirect; - CmdDrawIndexedIndirectType CmdDrawIndexedIndirect; - CmdDispatchType CmdDispatch; - CmdDispatchIndirectType CmdDispatchIndirect; - CmdCopyMemoryType CmdCopyMemory; - CmdCopyImageType CmdCopyImage; - CmdCopyMemoryToImageType CmdCopyMemoryToImage; - CmdCopyImageToMemoryType CmdCopyImageToMemory; - CmdCloneImageDataType CmdCloneImageData; - CmdUpdateMemoryType CmdUpdateMemory; - CmdFillMemoryType CmdFillMemory; - CmdClearColorImageType CmdClearColorImage; - CmdClearColorImageRawType CmdClearColorImageRaw; - CmdClearDepthStencilType CmdClearDepthStencil; - CmdResolveImageType CmdResolveImage; - CmdSetEventType CmdSetEvent; - CmdResetEventType CmdResetEvent; - CmdMemoryAtomicType CmdMemoryAtomic; - CmdBeginQueryType CmdBeginQuery; - CmdEndQueryType CmdEndQuery; - CmdResetQueryPoolType CmdResetQueryPool; - CmdWriteTimestampType CmdWriteTimestamp; - CmdInitAtomicCountersType CmdInitAtomicCounters; - CmdLoadAtomicCountersType CmdLoadAtomicCounters; - CmdSaveAtomicCountersType CmdSaveAtomicCounters; - DbgSetValidationLevelType DbgSetValidationLevel; - DbgRegisterMsgCallbackType DbgRegisterMsgCallback; - DbgUnregisterMsgCallbackType DbgUnregisterMsgCallback; - DbgSetMessageFilterType DbgSetMessageFilter; - DbgSetObjectTagType DbgSetObjectTag; - DbgSetGlobalOptionType DbgSetGlobalOption; - DbgSetDeviceOptionType DbgSetDeviceOption; - CmdDbgMarkerBeginType CmdDbgMarkerBegin; - CmdDbgMarkerEndType CmdDbgMarkerEnd; - WsiX11AssociateConnectionType WsiX11AssociateConnection; - WsiX11GetMSCType WsiX11GetMSC; - WsiX11CreatePresentableImageType WsiX11CreatePresentableImage; - WsiX11QueuePresentType WsiX11QueuePresent; + xglGetProcAddrType GetProcAddr; + xglInitAndEnumerateGpusType InitAndEnumerateGpus; + xglGetGpuInfoType GetGpuInfo; + xglCreateDeviceType CreateDevice; + xglDestroyDeviceType DestroyDevice; + xglGetExtensionSupportType GetExtensionSupport; + xglEnumerateLayersType EnumerateLayers; + xglGetDeviceQueueType GetDeviceQueue; + xglQueueSubmitType QueueSubmit; + xglQueueSetGlobalMemReferencesType QueueSetGlobalMemReferences; + xglQueueWaitIdleType QueueWaitIdle; + xglDeviceWaitIdleType DeviceWaitIdle; + xglGetMemoryHeapCountType GetMemoryHeapCount; + xglGetMemoryHeapInfoType GetMemoryHeapInfo; + xglAllocMemoryType AllocMemory; + xglFreeMemoryType FreeMemory; + xglSetMemoryPriorityType SetMemoryPriority; + xglMapMemoryType MapMemory; + xglUnmapMemoryType UnmapMemory; + xglPinSystemMemoryType PinSystemMemory; + xglRemapVirtualMemoryPagesType RemapVirtualMemoryPages; + xglGetMultiGpuCompatibilityType GetMultiGpuCompatibility; + xglOpenSharedMemoryType OpenSharedMemory; + xglOpenSharedQueueSemaphoreType OpenSharedQueueSemaphore; + xglOpenPeerMemoryType OpenPeerMemory; + xglOpenPeerImageType OpenPeerImage; + xglDestroyObjectType DestroyObject; + xglGetObjectInfoType GetObjectInfo; + xglBindObjectMemoryType BindObjectMemory; + xglCreateFenceType CreateFence; + xglGetFenceStatusType GetFenceStatus; + xglWaitForFencesType WaitForFences; + xglCreateQueueSemaphoreType CreateQueueSemaphore; + xglSignalQueueSemaphoreType SignalQueueSemaphore; + xglWaitQueueSemaphoreType WaitQueueSemaphore; + xglCreateEventType CreateEvent; + xglGetEventStatusType GetEventStatus; + xglSetEventType SetEvent; + xglResetEventType ResetEvent; + xglCreateQueryPoolType CreateQueryPool; + xglGetQueryPoolResultsType GetQueryPoolResults; + xglGetFormatInfoType GetFormatInfo; + xglCreateImageType CreateImage; + xglGetImageSubresourceInfoType GetImageSubresourceInfo; + xglCreateImageViewType CreateImageView; + xglCreateColorAttachmentViewType CreateColorAttachmentView; + xglCreateDepthStencilViewType CreateDepthStencilView; + xglCreateShaderType CreateShader; + xglCreateGraphicsPipelineType CreateGraphicsPipeline; + xglCreateComputePipelineType CreateComputePipeline; + xglStorePipelineType StorePipeline; + xglLoadPipelineType LoadPipeline; + xglCreatePipelineDeltaType CreatePipelineDelta; + xglCreateSamplerType CreateSampler; + xglCreateDescriptorSetType CreateDescriptorSet; + xglBeginDescriptorSetUpdateType BeginDescriptorSetUpdate; + xglEndDescriptorSetUpdateType EndDescriptorSetUpdate; + xglAttachSamplerDescriptorsType AttachSamplerDescriptors; + xglAttachImageViewDescriptorsType AttachImageViewDescriptors; + xglAttachMemoryViewDescriptorsType AttachMemoryViewDescriptors; + xglAttachNestedDescriptorsType AttachNestedDescriptors; + xglClearDescriptorSetSlotsType ClearDescriptorSetSlots; + xglCreateViewportStateType CreateViewportState; + xglCreateRasterStateType CreateRasterState; + xglCreateMsaaStateType CreateMsaaState; + xglCreateColorBlendStateType CreateColorBlendState; + xglCreateDepthStencilStateType CreateDepthStencilState; + xglCreateCommandBufferType CreateCommandBuffer; + xglBeginCommandBufferType BeginCommandBuffer; + xglEndCommandBufferType EndCommandBuffer; + xglResetCommandBufferType ResetCommandBuffer; + xglCmdBindPipelineType CmdBindPipeline; + xglCmdBindPipelineDeltaType CmdBindPipelineDelta; + xglCmdBindStateObjectType CmdBindStateObject; + xglCmdBindDescriptorSetType CmdBindDescriptorSet; + xglCmdBindDynamicMemoryViewType CmdBindDynamicMemoryView; + xglCmdBindVertexDataType CmdBindVertexData; + xglCmdBindIndexDataType CmdBindIndexData; + xglCmdBindAttachmentsType CmdBindAttachments; + xglCmdPrepareMemoryRegionsType CmdPrepareMemoryRegions; + xglCmdPrepareImagesType CmdPrepareImages; + xglCmdDrawType CmdDraw; + xglCmdDrawIndexedType CmdDrawIndexed; + xglCmdDrawIndirectType CmdDrawIndirect; + xglCmdDrawIndexedIndirectType CmdDrawIndexedIndirect; + xglCmdDispatchType CmdDispatch; + xglCmdDispatchIndirectType CmdDispatchIndirect; + xglCmdCopyMemoryType CmdCopyMemory; + xglCmdCopyImageType CmdCopyImage; + xglCmdCopyMemoryToImageType CmdCopyMemoryToImage; + xglCmdCopyImageToMemoryType CmdCopyImageToMemory; + xglCmdCloneImageDataType CmdCloneImageData; + xglCmdUpdateMemoryType CmdUpdateMemory; + xglCmdFillMemoryType CmdFillMemory; + xglCmdClearColorImageType CmdClearColorImage; + xglCmdClearColorImageRawType CmdClearColorImageRaw; + xglCmdClearDepthStencilType CmdClearDepthStencil; + xglCmdResolveImageType CmdResolveImage; + xglCmdSetEventType CmdSetEvent; + xglCmdResetEventType CmdResetEvent; + xglCmdMemoryAtomicType CmdMemoryAtomic; + xglCmdBeginQueryType CmdBeginQuery; + xglCmdEndQueryType CmdEndQuery; + xglCmdResetQueryPoolType CmdResetQueryPool; + xglCmdWriteTimestampType CmdWriteTimestamp; + xglCmdInitAtomicCountersType CmdInitAtomicCounters; + xglCmdLoadAtomicCountersType CmdLoadAtomicCounters; + xglCmdSaveAtomicCountersType CmdSaveAtomicCounters; + xglDbgSetValidationLevelType DbgSetValidationLevel; + xglDbgRegisterMsgCallbackType DbgRegisterMsgCallback; + xglDbgUnregisterMsgCallbackType DbgUnregisterMsgCallback; + xglDbgSetMessageFilterType DbgSetMessageFilter; + xglDbgSetObjectTagType DbgSetObjectTag; + xglDbgSetGlobalOptionType DbgSetGlobalOption; + xglDbgSetDeviceOptionType DbgSetDeviceOption; + xglCmdDbgMarkerBeginType CmdDbgMarkerBegin; + xglCmdDbgMarkerEndType CmdDbgMarkerEnd; + xglWsiX11AssociateConnectionType WsiX11AssociateConnection; + xglWsiX11GetMSCType WsiX11GetMSC; + xglWsiX11CreatePresentableImageType WsiX11CreatePresentableImage; + xglWsiX11QueuePresentType WsiX11QueuePresent; } XGL_LAYER_DISPATCH_TABLE; // LL node for tree of dbg callback functions diff --git a/include/xglWsiX11Ext.h b/include/xglWsiX11Ext.h index da9cb270..d475255c 100644 --- a/include/xglWsiX11Ext.h +++ b/include/xglWsiX11Ext.h @@ -80,10 +80,10 @@ typedef struct _XGL_WSI_X11_PRESENT_INFO XGL_BOOL flip; } XGL_WSI_X11_PRESENT_INFO; -typedef XGL_RESULT (XGLAPI *WsiX11AssociateConnectionType)(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo); -typedef XGL_RESULT (XGLAPI *WsiX11GetMSCType)(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc); -typedef XGL_RESULT (XGLAPI *WsiX11CreatePresentableImageType)(XGL_DEVICE device, const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem); -typedef XGL_RESULT (XGLAPI *WsiX11QueuePresentType)(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence); +typedef XGL_RESULT (XGLAPI *xglWsiX11AssociateConnectionType)(XGL_PHYSICAL_GPU gpu, const XGL_WSI_X11_CONNECTION_INFO* pConnectionInfo); +typedef XGL_RESULT (XGLAPI *xglWsiX11GetMSCType)(XGL_DEVICE device, xcb_window_t window, xcb_randr_crtc_t crtc, XGL_UINT64* pMsc); +typedef XGL_RESULT (XGLAPI *xglWsiX11CreatePresentableImageType)(XGL_DEVICE device, const XGL_WSI_X11_PRESENTABLE_IMAGE_CREATE_INFO* pCreateInfo, XGL_IMAGE* pImage, XGL_GPU_MEMORY* pMem); +typedef XGL_RESULT (XGLAPI *xglWsiX11QueuePresentType)(XGL_QUEUE queue, const XGL_WSI_X11_PRESENT_INFO* pPresentInfo, XGL_FENCE fence); /** * Associate an X11 connection with a GPU. This should be done before device diff --git a/layers/CMakeLists.txt b/layers/CMakeLists.txt index b733742e..86fc0311 100644 --- a/layers/CMakeLists.txt +++ b/layers/CMakeLists.txt @@ -25,6 +25,8 @@ include_directories( ) set (CMAKE_CXX_FLAGS "-std=c++11") +set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DXGL_PROTOTYPES") +set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES") add_custom_command(OUTPUT xgl_dispatch_table_helper.h COMMAND ${PROJECT_SOURCE_DIR}/xgl-generate.py dispatch-table-ops layer > xgl_dispatch_table_helper.h diff --git a/layers/basic.cpp b/layers/basic.cpp index 9a71e615..5b2bb580 100644 --- a/layers/basic.cpp +++ b/layers/basic.cpp @@ -32,7 +32,7 @@ static std::unordered_map tableMap; static XGL_LAYER_DISPATCH_TABLE * initLayerTable(const XGL_BASE_LAYER_OBJECT *gpuw) { - GetProcAddrType fpGPA; + xglGetProcAddrType fpGPA; XGL_LAYER_DISPATCH_TABLE *pTable; assert(gpuw); @@ -95,7 +95,7 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetFormatInfo(XGL_DEVICE device, XGL_FORMA return result; } -XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, XGL_VOID* pReserved) +XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (gpu != NULL) { @@ -103,7 +103,7 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_ XGL_LAYER_DISPATCH_TABLE* pTable = initLayerTable(gpuw); printf("At start of wrapped xglEnumerateLayers() call w/ gpu: %p\n", gpu); - XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; } else { @@ -112,10 +112,10 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_ // Example of a layer that is only compatible with Intel's GPUs XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT*) pReserved; - GetGpuInfoType fpGetGpuInfo; + xglGetGpuInfoType fpGetGpuInfo; XGL_PHYSICAL_GPU_PROPERTIES gpuProps; XGL_SIZE dataSize = sizeof(XGL_PHYSICAL_GPU_PROPERTIES); - fpGetGpuInfo = (GetGpuInfoType) gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, "xglGetGpuInfo"); + fpGetGpuInfo = (xglGetGpuInfoType) gpuw->pGPA((XGL_PHYSICAL_GPU) gpuw->nextObject, "xglGetGpuInfo"); fpGetGpuInfo((XGL_PHYSICAL_GPU) gpuw->nextObject, XGL_INFO_TYPE_PHYSICAL_GPU_PROPERTIES, &dataSize, &gpuProps); if (gpuProps.vendorId == 0x8086) { diff --git a/layers/draw_state.c b/layers/draw_state.c index b4f303e8..0c4efc09 100644 --- a/layers/draw_state.c +++ b/layers/draw_state.c @@ -944,13 +944,13 @@ static void initDrawState() // initialize Layer dispatch table // TODO handle multiple GPUs - GetProcAddrType fpNextGPA; + xglGetProcAddrType fpNextGPA; fpNextGPA = pCurObj->pGPA; assert(fpNextGPA); layer_initialize_dispatch_table(&nextTable, fpNextGPA, (XGL_PHYSICAL_GPU) pCurObj->nextObject); - GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); + xglGetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); nextTable.GetProcAddr = fpGetProcAddr; } @@ -988,14 +988,14 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, return result; } -XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, XGL_VOID* pReserved) +XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (gpu != NULL) { XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; pCurObj = gpuw; pthread_once(&g_initOnce, initDrawState); - XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; } else { diff --git a/layers/mem_tracker.c b/layers/mem_tracker.c index 55b7be83..3876edd6 100644 --- a/layers/mem_tracker.c +++ b/layers/mem_tracker.c @@ -856,13 +856,13 @@ static void initMemTracker() // initialize Layer dispatch table // TODO handle multiple GPUs - GetProcAddrType fpNextGPA; + xglGetProcAddrType fpNextGPA; fpNextGPA = pCurObj->pGPA; assert(fpNextGPA); layer_initialize_dispatch_table(&nextTable, fpNextGPA, (XGL_PHYSICAL_GPU) pCurObj->nextObject); - GetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); + xglGetProcAddrType fpGetProcAddr = fpNextGPA((XGL_PHYSICAL_GPU) pCurObj->nextObject, (XGL_CHAR *) "xglGetProcAddr"); nextTable.GetProcAddr = fpGetProcAddr; } @@ -919,14 +919,14 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglGetExtensionSupport(XGL_PHYSICAL_GPU gpu, return result; } -XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, XGL_VOID* pReserved) +XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (gpu != NULL) { XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; pCurObj = gpuw; pthread_once(&g_initOnce, initMemTracker); - XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + XGL_RESULT result = nextTable.EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); return result; } else { diff --git a/layers/multi.cpp b/layers/multi.cpp index b1aa6195..55e1bff9 100644 --- a/layers/multi.cpp +++ b/layers/multi.cpp @@ -96,17 +96,17 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1StorePipeline(XGL_PIPELINE pipeline, XG } XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi1EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, - XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, + XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (gpu == NULL) - return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; XGL_LAYER_DISPATCH_TABLE* pTable = getLayer1Table(gpuw); printf("At start of multi1 layer xglEnumerateLayers()\n"); - XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); printf("Completed multi1 layer xglEnumerateLayers()\n"); return result; } @@ -196,17 +196,17 @@ XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2BeginCommandBuffer( XGL_CMD_BUFFER cmdB } XGL_LAYER_EXPORT XGL_RESULT XGLAPI multi2EnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, - XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, + XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (gpu == NULL) - return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + return xglEnumerateLayers(gpu, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); XGL_BASE_LAYER_OBJECT* gpuw = (XGL_BASE_LAYER_OBJECT *) gpu; XGL_LAYER_DISPATCH_TABLE* pTable = getLayer2Table(gpuw); printf("At start of multi2 layer xglEnumerateLayers()\n"); - XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayers, pOutLayerCount, pReserved); + XGL_RESULT result = pTable->EnumerateLayers((XGL_PHYSICAL_GPU)gpuw->nextObject, maxLayerCount, maxStringSize, pOutLayerCount, pOutLayers, pReserved); printf("Completed multi2 layer xglEnumerateLayers()\n"); return result; } @@ -237,7 +237,7 @@ XGL_LAYER_EXPORT XGL_VOID * XGLAPI multi2GetProcAddr(XGL_PHYSICAL_GPU gpu, const /********************************* Common functions ********************************/ XGL_LAYER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, - XGL_CHAR* const* pOutLayers, XGL_SIZE * pOutLayerCount, + XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { if (pOutLayerCount == NULL || pOutLayers == NULL || pOutLayers[0] == NULL || pOutLayers[1] == NULL || pReserved == NULL) diff --git a/loader/CMakeLists.txt b/loader/CMakeLists.txt index 1877ffbd..b2250ad0 100644 --- a/loader/CMakeLists.txt +++ b/loader/CMakeLists.txt @@ -11,6 +11,8 @@ include_directories( ${CMAKE_CURRENT_BINARY_DIR} ) +set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DXGL_PROTOTYPES") + add_library(XGL SHARED loader.c dispatch.c table_ops.h) set_target_properties(XGL PROPERTIES SOVERSION 0) target_link_libraries(XGL -ldl -lpthread) diff --git a/loader/loader.c b/loader/loader.c index c4e8a148..8a0b3eb9 100644 --- a/loader/loader.c +++ b/loader/loader.c @@ -62,8 +62,8 @@ struct loader_icd { XGL_UINT gpu_count; XGL_BASE_LAYER_OBJECT *gpus; - GetProcAddrType GetProcAddr; - InitAndEnumerateGpusType InitAndEnumerateGpus; + xglGetProcAddrType GetProcAddr; + xglInitAndEnumerateGpusType InitAndEnumerateGpus; struct loader_icd *next; }; @@ -215,7 +215,7 @@ loader_icd_create(const char *filename) } #define LOOKUP(icd, func) do { \ - icd->func = (func## Type) dlsym(icd->handle, "xgl" #func); \ + icd->func = (xgl ##func## Type) dlsym(icd->handle, "xgl" #func); \ if (!icd->func) { \ loader_log(XGL_DBG_MSG_WARNING, 0, dlerror()); \ loader_icd_destroy(icd); \ @@ -459,7 +459,7 @@ static void layer_lib_scan(const char * libInPaths) loader.layer_scanned = true; } -static void loader_init_dispatch_table(XGL_LAYER_DISPATCH_TABLE *tab, GetProcAddrType fpGPA, XGL_PHYSICAL_GPU gpu) +static void loader_init_dispatch_table(XGL_LAYER_DISPATCH_TABLE *tab, xglGetProcAddrType fpGPA, XGL_PHYSICAL_GPU gpu) { loader_initialize_dispatch_table(tab, fpGPA, gpu); @@ -521,7 +521,7 @@ static void loader_init_layer_libs(struct loader_icd *icd, XGL_UINT gpu_index, s static bool find_layer_name(struct loader_icd *icd, XGL_UINT gpu_index, const char * layer_name, const char **lib_name) { void *handle; - EnumerateLayersType fpEnumerateLayers; + xglEnumerateLayersType fpEnumerateLayers; XGL_CHAR layer_buf[16][256]; XGL_CHAR * layers[16]; @@ -548,7 +548,7 @@ static bool find_layer_name(struct loader_icd *icd, XGL_UINT gpu_index, const ch } else { XGL_SIZE cnt; - fpEnumerateLayers(NULL, 16, 256, layers, &cnt, (XGL_VOID *) icd->gpus + gpu_index); + fpEnumerateLayers(NULL, 16, 256, &cnt, layers, (XGL_VOID *) icd->gpus + gpu_index); for (unsigned int i = 0; i < cnt; i++) { if (!strcmp((char *) layers[i], layer_name)) { dlclose(handle); @@ -693,7 +693,7 @@ extern XGL_UINT loader_activate_layers(XGL_PHYSICAL_GPU gpu, const XGL_DEVICE_CR if (!loader_layers_activated(icd, gpu_index)) { XGL_BASE_LAYER_OBJECT *gpuObj = (XGL_BASE_LAYER_OBJECT *) gpu; XGL_BASE_LAYER_OBJECT *nextGpuObj, *baseObj = gpuObj->baseObject; - GetProcAddrType nextGPA = xglGetProcAddr; + xglGetProcAddrType nextGPA = xglGetProcAddr; count = loader_get_layer_libs(icd, gpu_index, pCreateInfo, &pLayerNames); if (!count) @@ -787,7 +787,7 @@ LOADER_EXPORT XGL_RESULT XGLAPI xglInitAndEnumerateGpus(const XGL_APPLICATION_IN while (icd) { XGL_PHYSICAL_GPU gpus[XGL_MAX_PHYSICAL_GPUS]; XGL_BASE_LAYER_OBJECT * wrappedGpus; - GetProcAddrType getProcAddr = icd->GetProcAddr; + xglGetProcAddrType getProcAddr = icd->GetProcAddr; XGL_UINT n, max = maxGpus - count; if (max > XGL_MAX_PHYSICAL_GPUS) { @@ -838,14 +838,14 @@ LOADER_EXPORT XGL_RESULT XGLAPI xglInitAndEnumerateGpus(const XGL_APPLICATION_IN return (count > 0) ? XGL_SUCCESS : res; } -LOADER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_CHAR* const* pOutLayers, XGL_SIZE* pOutLayerCount, XGL_VOID* pReserved) +LOADER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZE maxLayerCount, XGL_SIZE maxStringSize, XGL_SIZE* pOutLayerCount, XGL_CHAR* const* pOutLayers, XGL_VOID* pReserved) { XGL_UINT gpu_index; XGL_UINT count = 0; char *lib_name; struct loader_icd *icd = loader_get_icd((const XGL_BASE_LAYER_OBJECT *) gpu, &gpu_index); void *handle; - EnumerateLayersType fpEnumerateLayers; + xglEnumerateLayersType fpEnumerateLayers; XGL_CHAR layer_buf[16][256]; XGL_CHAR * layers[16]; @@ -888,7 +888,7 @@ LOADER_EXPORT XGL_RESULT XGLAPI xglEnumerateLayers(XGL_PHYSICAL_GPU gpu, XGL_SIZ XGL_UINT n; XGL_RESULT res; n = (maxStringSize < 256) ? maxStringSize : 256; - res = fpEnumerateLayers(NULL, 16, n, layers, &cnt, (XGL_VOID *) icd->gpus + gpu_index); + res = fpEnumerateLayers(NULL, 16, n, &cnt, layers, (XGL_VOID *) icd->gpus + gpu_index); dlclose(handle); if (res != XGL_SUCCESS) continue; diff --git a/xgl-generate.py b/xgl-generate.py index 513438c7..f36f9a42 100755 --- a/xgl-generate.py +++ b/xgl-generate.py @@ -213,13 +213,13 @@ class DispatchTableOpsSubcommand(Subcommand): stmts.append("table->%s = gpa; /* direct assignment */" % proto.name) else: - stmts.append("table->%s = (%sType) gpa(gpu, \"xgl%s\");" % + stmts.append("table->%s = (xgl%sType) gpa(gpu, \"xgl%s\");" % (proto.name, proto.name, proto.name)) func = [] func.append("static inline void %s_initialize_dispatch_table(XGL_LAYER_DISPATCH_TABLE *table," % self.prefix) - func.append("%s GetProcAddrType gpa," + func.append("%s xglGetProcAddrType gpa," % (" " * len(self.prefix))) func.append("%s XGL_PHYSICAL_GPU gpu)" % (" " * len(self.prefix))) diff --git a/xgl-layer-generate.py b/xgl-layer-generate.py index c2615285..d19a63f8 100755 --- a/xgl-layer-generate.py +++ b/xgl-layer-generate.py @@ -699,7 +699,7 @@ class Subcommand(object): func_body = ["#include \"xgl_dispatch_table_helper.h\""] func_body.append('static void initLayerTable()\n' '{\n' - ' GetProcAddrType fpNextGPA;\n' + ' xglGetProcAddrType fpNextGPA;\n' ' fpNextGPA = pCurObj->pGPA;\n' ' assert(fpNextGPA);\n'); diff --git a/xgl.py b/xgl.py index ce08278b..d84e4af2 100644 --- a/xgl.py +++ b/xgl.py @@ -244,8 +244,8 @@ core = Extension( [Param("XGL_PHYSICAL_GPU", "gpu"), Param("XGL_SIZE", "maxLayerCount"), Param("XGL_SIZE", "maxStringSize"), - Param("XGL_CHAR* const*", "pOutLayers"), Param("XGL_SIZE*", "pOutLayerCount"), + Param("XGL_CHAR* const*", "pOutLayers"), Param("XGL_VOID*", "pReserved")]), Proto("XGL_RESULT", "GetDeviceQueue", -- 2.34.1