XGL: Move to svn r28460.
authorJeremy Hayes <jeremy@lunarg.com>
Wed, 14 Jan 2015 21:58:37 +0000 (14:58 -0700)
committerCourtney Goeltzenleuchter <courtney@LunarG.com>
Thu, 5 Feb 2015 00:58:07 +0000 (17:58 -0700)
icd/common/icd-format.h
include/xgl.h
include/xglPlatform.h [new file with mode: 0644]

index 963eb61ac06fcd7d4a5aa25da325f6cfcb49bf29..1292577d426dff053459d03fd0feccd01b3ddf05 100644 (file)
@@ -99,7 +99,7 @@ static inline int icd_format_get_block_width(XGL_FORMAT format)
 
 size_t icd_format_get_size(XGL_FORMAT format);
 
-XGL_UINT icd_format_get_channel_count(XGL_FORMAT format);
+unsigned int icd_format_get_channel_count(XGL_FORMAT format);
 
 void icd_format_get_raw_value(XGL_FORMAT format,
                               const XGL_UINT32 color[4],
index d48a0f50749acac9974871e9b0189e031b4a2e30..12cd4b884239fcd6a5473ad4f15d4ca51a762454 100644 (file)
 #ifndef __XGL_H__
 #define __XGL_H__
 
-#include <stddef.h>
-#include <stdint.h>
-
 #define XGL_MAKE_VERSION(major, minor, patch) \
     ((major << 22) | (minor << 12) | patch)
 
+#include "xglPlatform.h"
+
 // XGL API version supported by this file
 #define XGL_API_VERSION XGL_MAKE_VERSION(0, 22, 1)
 
-#ifndef XGLAPI
-   #define XGLAPI
-#endif
-
 #ifdef __cplusplus
 extern "C"
 {
 #endif // __cplusplus
 
-/*
- * Datatypes
- */
-typedef uint32_t        XGL_BOOL;
-typedef void            XGL_VOID;
-typedef char            XGL_CHAR;       /* 1-byte signed */
-typedef int32_t         XGL_INT;        /* 4-byte signed */
-typedef int32_t         XGL_INT32;      /* 4-byte signed */
-typedef uint32_t        XGL_UINT;       /* 4-byte unsigned */
-typedef uint32_t        XGL_UINT32;     /* 4-byte unsigned */
-typedef uint64_t        XGL_UINT64;     /* 8-byte unsigned */
-typedef size_t          XGL_SIZE;       /* 4-byte unsigned */
-typedef uint64_t        XGL_GPU_SIZE;   /* 4-byte unsigned */
-typedef uint32_t        XGL_FLAGS;      /* 4-byte unsigned */
-typedef uint32_t        XGL_SAMPLE_MASK; /* 4-byte unsigned */
-typedef uint8_t         XGL_UINT8;      /* 1-byte unsigned */
-typedef float           XGL_FLOAT;      /* single precision float */
-typedef double          XGL_DOUBLE;       /* double precision float in [0,1] */
-
 /*
 ***************************************************************************************************
 *   Core XGL API
@@ -441,12 +417,12 @@ typedef enum _XGL_COMPARE_FUNC
 
 typedef enum _XGL_FILL_MODE
 {
-    XFL_FILL_POINTS                                         = 0x00000000,
+    XGL_FILL_POINTS                                         = 0x00000000,
     XGL_FILL_WIREFRAME                                      = 0x00000001,
     XGL_FILL_SOLID                                          = 0x00000002,
 
-    XGL_FILL_MODE_BEGIN_RANGE                               = XGL_FILL_SOLID,
-    XGL_FILL_MODE_END_RANGE                                 = XFL_FILL_POINTS,
+    XGL_FILL_MODE_BEGIN_RANGE                               = XGL_FILL_POINTS,
+    XGL_FILL_MODE_END_RANGE                                 = XGL_FILL_SOLID,
     XGL_NUM_FILL_MODE                                       = (XGL_FILL_MODE_END_RANGE - XGL_FILL_MODE_BEGIN_RANGE + 1),
     XGL_MAX_ENUM(_XGL_FILL_MODE)
 } XGL_FILL_MODE;
@@ -2507,7 +2483,7 @@ XGL_VOID XGLAPI xglCmdSaveAtomicCounters(
 #endif /* XGL_PROTOTYPES */
 
 #ifdef __cplusplus
-} // extern "C"
+}; // extern "C"
 #endif // __cplusplus
 
 #endif // __XGL_H__
diff --git a/include/xglPlatform.h b/include/xglPlatform.h
new file mode 100644 (file)
index 0000000..3ec3f9f
--- /dev/null
@@ -0,0 +1,113 @@
+//
+// File: xglPlatform.h
+//
+// Copyright 2014 ADVANCED MICRO DEVICES, INC.  All Rights Reserved.
+//
+// AMD is granting you permission to use this software for reference
+// purposes only and not for use in any software product.
+//
+// You agree that you will not reverse engineer or decompile the Materials,
+// in whole or in part, except as allowed by applicable law.
+//
+// WARRANTY DISCLAIMER: THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF
+// ANY KIND.  AMD DISCLAIMS ALL WARRANTIES, EXPRESS, IMPLIED, OR STATUTORY,
+// INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY,
+// FITNESS FOR A PARTICULAR PURPOSE, TITLE, NON-INFRINGEMENT, THAT THE SOFTWARE
+// WILL RUN UNINTERRUPTED OR ERROR-FREE OR WARRANTIES ARISING FROM CUSTOM OF
+// TRADE OR COURSE OF USAGE.  THE ENTIRE RISK ASSOCIATED WITH THE USE OF THE
+// SOFTWARE IS ASSUMED BY YOU.
+// Some jurisdictions do not allow the exclusion of implied warranties, so
+// the above exclusion may not apply to You.
+//
+// LIMITATION OF LIABILITY AND INDEMNIFICATION:  AMD AND ITS LICENSORS WILL
+// NOT, UNDER ANY CIRCUMSTANCES BE LIABLE TO YOU FOR ANY PUNITIVE, DIRECT,
+// INCIDENTAL, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING FROM USE OF
+// THE SOFTWARE OR THIS AGREEMENT EVEN IF AMD AND ITS LICENSORS HAVE BEEN
+// ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+// In no event shall AMD's total liability to You for all damages, losses,
+// and causes of action (whether in contract, tort (including negligence) or
+// otherwise) exceed the amount of $100 USD.  You agree to defend, indemnify
+// and hold harmless AMD and its licensors, and any of their directors,
+// officers, employees, affiliates or agents from and against any and all
+// loss, damage, liability and other expenses (including reasonable attorneys'
+// fees), resulting from Your use of the Software or violation of the terms and
+// conditions of this Agreement.
+//
+// U.S. GOVERNMENT RESTRICTED RIGHTS: The Materials are provided with "RESTRICTED
+// RIGHTS." Use, duplication, or disclosure by the Government is subject to the
+// restrictions as set forth in FAR 52.227-14 and DFAR252.227-7013, et seq., or
+// its successor.  Use of the Materials by the Government constitutes
+// acknowledgement of AMD's proprietary rights in them.
+//
+// EXPORT RESTRICTIONS: The Materials may be subject to export restrictions as
+// stated in the Software License Agreement.
+//
+
+
+#ifndef __XGLPLATFORM_H__
+#define __XGLPLATFORM_H__
+
+#ifdef __cplusplus
+extern "C"
+{
+#endif // __cplusplus
+
+/*
+***************************************************************************************************
+*   Platform-specific directives and type declarations
+***************************************************************************************************
+*/
+
+#if defined(_WIN32)
+    // On Windows, XGLAPI should equate to the __stdcall convention
+    #define XGLAPI   __stdcall
+#elif defined(__GNUC__)
+    // On other platforms using GCC, XGLAPI stays undefined
+    #define XGLAPI
+#else
+    // Unsupported Platform!
+    #error "Unsupported OS Platform detected!"
+#endif
+
+#if defined(__GNUC__)
+    #include <stddef.h>
+    #include <stdint.h>
+#endif
+
+#if defined(_WIN32)
+    // Windows platform
+    typedef unsigned __int8  XGL_UINT8;
+    typedef signed   __int32 XGL_INT32;
+    typedef unsigned __int32 XGL_UINT32;
+    typedef signed   __int64 XGL_INT64;
+    typedef unsigned __int64 XGL_UINT64;
+#elif defined(__GNUC__)
+    // Other platforms
+    typedef uint8_t          XGL_UINT8;
+    typedef int32_t          XGL_INT32;
+    typedef uint32_t         XGL_UINT32;
+    typedef int64_t          XGL_INT64;
+    typedef uint64_t         XGL_UINT64;
+#endif
+
+typedef size_t     XGL_SIZE;
+typedef XGL_UINT64 XGL_GPU_SIZE;
+typedef XGL_UINT8  XGL_BYTE;
+typedef XGL_INT32  XGL_INT;
+typedef XGL_UINT32 XGL_UINT;
+typedef char       XGL_CHAR;
+typedef float      XGL_FLOAT;
+typedef double     XGL_DOUBLE;
+typedef XGL_UINT32 XGL_BOOL;
+typedef void       XGL_VOID;
+
+typedef XGL_UINT32 XGL_SAMPLE_MASK;
+typedef XGL_UINT32 XGL_FLAGS;
+typedef XGL_INT32  XGL_ENUM;
+// typedef XGL_INT32  XGL_RESULT; // TODO: Resolve 13314.
+
+#ifdef __cplusplus
+}; // extern "C"
+#endif // __cplusplus
+
+#endif // __XGLPLATFORM_H__