Bug 1305873 - Upgrade Oculus SDK to 1.10.1; r?kip draft
authorDaosheng Mu <daoshengmu@gmail.com>
Tue, 03 Jan 2017 17:01:49 +0800
changeset 455253 effb6bf717212d9d28d63df4a12908ac8a46a768
parent 455176 c91249f41e3766274131a84f9157a4d9d9949520
child 540929 d3c250c850ec1afba20927331d976ea15a3f9a9b
push id40174
push userbmo:dmu@mozilla.com
push dateTue, 03 Jan 2017 09:32:20 +0000
reviewerskip
bugs1305873
milestone53.0a1
Bug 1305873 - Upgrade Oculus SDK to 1.10.1; r?kip MozReview-Commit-ID: 9eu2G2elvYM
gfx/vr/gfxVROculus.cpp
gfx/vr/ovr_capi_dynamic.h
--- a/gfx/vr/gfxVROculus.cpp
+++ b/gfx/vr/gfxVROculus.cpp
@@ -109,18 +109,18 @@ static pfn_ovr_GetMirrorTextureBufferGL 
 
 #ifdef HAVE_64BIT_BUILD
 #define BUILD_BITS 64
 #else
 #define BUILD_BITS 32
 #endif
 
 #define OVR_PRODUCT_VERSION 1
-#define OVR_MAJOR_VERSION   3
-#define OVR_MINOR_VERSION   1
+#define OVR_MAJOR_VERSION   1
+#define OVR_MINOR_VERSION   10
 
 static bool
 InitializeOculusCAPI()
 {
   static PRLibrary *ovrlib = nullptr;
 
   if (!ovrlib) {
     nsTArray<nsCString> libSearchPaths;
--- a/gfx/vr/ovr_capi_dynamic.h
+++ b/gfx/vr/ovr_capi_dynamic.h
@@ -248,52 +248,61 @@ typedef enum {
   OVR_FORMAT_B8G8R8A8_UNORM_SRGB,
   OVR_FORMAT_B8G8R8X8_UNORM,
   OVR_FORMAT_B8G8R8X8_UNORM_SRGB,
   OVR_FORMAT_R16G16B16A16_FLOAT,
   OVR_FORMAT_D16_UNORM,
   OVR_FORMAT_D24_UNORM_S8_UINT,
   OVR_FORMAT_D32_FLOAT,
   OVR_FORMAT_D32_FLOAT_S8X24_UINT,
+  OVR_FORMAT_BC1_UNORM,
+  OVR_FORMAT_BC1_UNORM_SRGB,
+  OVR_FORMAT_BC2_UNORM,
+  OVR_FORMAT_BC2_UNORM_SRGB,
+  OVR_FORMAT_BC3_UNORM,
+  OVR_FORMAT_BC3_UNORM_SRGB,
+  OVR_FORMAT_BC6H_UF16,
+  OVR_FORMAT_BC6H_SF16,
+  OVR_FORMAT_BC7_UNORM,
+  OVR_FORMAT_BC7_UNORM_SRGB,
+  OVR_FORMAT_R11G11B10_FLOAT,
   OVR_FORMAT_ENUMSIZE = 0x7fffffff
 } ovrTextureFormat;
 
 typedef enum {
   ovrTextureMisc_None,
   ovrTextureMisc_DX_Typeless = 0x0001,
   ovrTextureMisc_AllowGenerateMips = 0x0002,
+  ovrTextureMisc_ProtectedContent = 0x0004,
   ovrTextureMisc_EnumSize = 0x7fffffff
 } ovrTextureFlags;
 
 typedef struct {
   ovrTextureType Type;
   ovrTextureFormat Format;
   int ArraySize;
   int Width;
   int Height;
   int MipLevels;
   int SampleCount;
   ovrBool StaticImage;
   unsigned int MiscFlags;
   unsigned int BindFlags;
 } ovrTextureSwapChainDesc;
 
-typedef struct
-{
+typedef struct {
   ovrTextureFormat Format;
   int Width;
   int Height;
   unsigned int MiscFlags;
 } ovrMirrorTextureDesc;
 
 typedef void* ovrTextureSwapChain;
 typedef struct ovrMirrorTextureData* ovrMirrorTexture;
 
-
-
 typedef enum {
   ovrButton_A = 0x00000001,
   ovrButton_B = 0x00000002,
   ovrButton_RThumb = 0x00000004,
   ovrButton_RShoulder = 0x00000008,
   ovrButton_RMask = ovrButton_A | ovrButton_B | ovrButton_RThumb | ovrButton_RShoulder,
   ovrButton_X = 0x00000100,
   ovrButton_Y = 0x00000200,
@@ -312,58 +321,95 @@ typedef enum {
   ovrButton_Private = ovrButton_VolUp | ovrButton_VolDown | ovrButton_Home,
   ovrButton_EnumSize = 0x7fffffff
 } ovrButton;
 
 typedef enum {
   ovrTouch_A = ovrButton_A,
   ovrTouch_B = ovrButton_B,
   ovrTouch_RThumb = ovrButton_RThumb,
+  ovrTouch_RThumbRest = 0x00000008,
   ovrTouch_RIndexTrigger = 0x00000010,
-  ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RIndexTrigger,
+  ovrTouch_RButtonMask = ovrTouch_A | ovrTouch_B | ovrTouch_RThumb | ovrTouch_RThumbRest | ovrTouch_RIndexTrigger,
   ovrTouch_X = ovrButton_X,
   ovrTouch_Y = ovrButton_Y,
   ovrTouch_LThumb = ovrButton_LThumb,
+  ovrTouch_LThumbRest = 0x00000800,
   ovrTouch_LIndexTrigger = 0x00001000,
-  ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LIndexTrigger,
+  ovrTouch_LButtonMask = ovrTouch_X | ovrTouch_Y | ovrTouch_LThumb | ovrTouch_LThumbRest | ovrTouch_LIndexTrigger,
   ovrTouch_RIndexPointing = 0x00000020,
   ovrTouch_RThumbUp = 0x00000040,
   ovrTouch_RPoseMask = ovrTouch_RIndexPointing | ovrTouch_RThumbUp,
   ovrTouch_LIndexPointing = 0x00002000,
   ovrTouch_LThumbUp = 0x00004000,
   ovrTouch_LPoseMask = ovrTouch_LIndexPointing | ovrTouch_LThumbUp,
   ovrTouch_EnumSize = 0x7fffffff
 } ovrTouch;
 
+typedef struct OVR_ALIGNAS(OVR_PTR_SIZE) {
+  int SampleRateHz;
+  int SampleSizeInBytes;
+  int QueueMinSizeToAvoidStarvation;
+  int SubmitMinSamples;
+  int SubmitMaxSamples;
+  int SubmitOptimalSamples;
+} ovrTouchHapticsDesc;
+
 typedef enum {
   ovrControllerType_None = 0x00,
   ovrControllerType_LTouch = 0x01,
   ovrControllerType_RTouch = 0x02,
   ovrControllerType_Touch = 0x03,
   ovrControllerType_Remote = 0x04,
   ovrControllerType_XBox = 0x10,
   ovrControllerType_Active = 0xff,
   ovrControllerType_EnumSize = 0x7fffffff
 } ovrControllerType;
 
 typedef enum {
+  ovrHapticsBufferSubmit_Enqueue
+} ovrHapticsBufferSubmitMode;
+
+typedef struct {
+  const void* Samples;
+  int SamplesCount;
+  ovrHapticsBufferSubmitMode SubmitMode;
+} ovrHapticsBuffer;
+
+typedef struct {
+  int RemainingQueueSpace;
+  int SamplesQueued;
+} ovrHapticsPlaybackState;
+
+typedef enum {
+  ovrTrackedDevice_HMD = 0x0001,
+  ovrTrackedDevice_LTouch = 0x0002,
+  ovrTrackedDevice_RTouch = 0x0004,
+  ovrTrackedDevice_Touch = 0x0006,
+  ovrTrackedDevice_All = 0xFFFF,
+} ovrTrackedDeviceType;
+
+typedef enum {
   ovrHand_Left = 0,
   ovrHand_Right = 1,
   ovrHand_Count = 2,
   ovrHand_EnumSize = 0x7fffffff
 } ovrHandType;
 
 typedef struct {
   double TimeInSeconds;
   unsigned int Buttons;
   unsigned int Touches;
   float IndexTrigger[ovrHand_Count];
   float HandTrigger[ovrHand_Count];
   ovrVector2f Thumbstick[ovrHand_Count];
   ovrControllerType ControllerType;
+  float IndexTriggerNoDeadzone[ovrHand_Count];
+  float HandTriggerNoDeadzone[ovrHand_Count];
+  ovrVector2f ThumbstickNoDeadzone[ovrHand_Count];
 } ovrInputState;
 
 typedef enum {
   ovrInit_Debug          = 0x00000001,
   ovrInit_RequestVersion = 0x00000004,
   ovrinit_WritableBits   = 0x00ffffff,
   ovrInit_EnumSize       = 0x7fffffff
 } ovrInitFlags;