summaryrefslogtreecommitdiffstats
path: root/LibOVR/Src/CAPI/D3D1X
diff options
context:
space:
mode:
Diffstat (limited to 'LibOVR/Src/CAPI/D3D1X')
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.cpp29
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.h34
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.cpp35
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.h41
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.cpp1707
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.h240
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.cpp567
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.h113
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.cpp758
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.h (renamed from LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.h)1072
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp1414
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.h202
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp595
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.h84
-rw-r--r--LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.cpp533
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2.h887
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2_refl.h16
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.h256
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.psh29
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps_refl.h9
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs.h101
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs_refl.h9
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.h214
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.vsh70
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs_refl.h11
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.h167
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.vsh63
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs_refl.h11
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps.h65
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps_refl.h1
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.h82
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.vsh41
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs_refl.h9
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps.h51
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps_refl.h8
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs.h64
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs_refl.h9
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps.h77
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps_refl.h8
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs.h82
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs_refl.h9
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/genComputeShaderHeader.bat5
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/genPixelShaderHeader.bat7
-rw-r--r--LibOVR/Src/CAPI/D3D1X/Shaders/genVertexShaderHeader.bat7
44 files changed, 3835 insertions, 5957 deletions
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.cpp
deleted file mode 100644
index 6439b57..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.cpp
+++ /dev/null
@@ -1,29 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D10_DistortionRenderer.cpp
-Content : Distortion renderer instantiation for D3D10
-Created : November 11, 2013
-Authors : Volga Aksoy, Michael Antonov
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-#define OVR_D3D_VERSION 10
-#include "CAPI_D3D1X_Util.cpp"
-#include "CAPI_D3D1X_DistortionRenderer.cpp"
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.h
deleted file mode 100644
index a6750f5..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_DistortionRenderer.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D10_DistortionRenderer.h
-Content : Distortion renderer header for D3D10
-Created : November 11, 2013
-Authors : Michael Antonov
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 INC_CAPI_D3D10_DistortionRenderer_h
-#define INC_CAPI_D3D10_DistortionRenderer_h
-
-#define OVR_D3D_VERSION 10
-#include "CAPI_D3D1X_DistortionRenderer.h"
-#undef OVR_D3D_VERSION
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.cpp
deleted file mode 100644
index 33deffa..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.cpp
+++ /dev/null
@@ -1,35 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D10_HSWDisplay.cpp
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-#define OVR_D3D_VERSION 10
-#include "CAPI_D3D1X_HSWDisplay.cpp"
-#undef OVR_D3D_VERSION
-
-
-
-
-
-
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.h
deleted file mode 100644
index c681c73..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D10_HSWDisplay.h
+++ /dev/null
@@ -1,41 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D10_HSWDisplay.h
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 OVR_CAPI_D3D10_HSWDisplay_h
-#define OVR_CAPI_D3D10_HSWDisplay_h
-
-#if !defined(OVR_D3D_VERSION) || ((OVR_D3D_VERSION != 10) && (OVR_D3D_VERSION != 11))
- #error This header expects OVR_D3D_VERSION to be defined, to 10 or 11.
-#endif
-
-// Due to the similarities between DX10 and DX11, there is a shared implementation of the headers and source
-// which is differentiated only by the OVR_D3D_VERSION define. This define causes D3D_NS (D3D namespace) to
-// be defined to either D3D10 or D3D11, as well as other similar effects.
-#include "CAPI_D3D1X_HSWDisplay.h"
-
-
-#endif // OVR_CAPI_D3D10_HSWDisplay_h
-
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.cpp
index 2ba9ccc..334869c 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.cpp
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.cpp
@@ -1,30 +1,1677 @@
-/************************************************************************************
-
-Filename : CAPI_D3D11_DistortionRenderer.cpp
-Content : Distortion renderer instantiation for D3D11
-Created : November 11, 2013
-Authors : Volga Aksoy, Michael Antonov
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-#define OVR_D3D_VERSION 11
-#include "CAPI_D3D1X_Util.cpp"
-#include "CAPI_D3D1X_DistortionRenderer.cpp"
-
+/************************************************************************************
+
+Filename : CAPI_D3D11_DistortionRenderer.cpp
+Content : Experimental distortion renderer
+Created : November 11, 2013
+Authors : Volga Aksoy, Michael Antonov, Shariq Hashme
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 "CAPI_D3D11_DistortionRenderer.h"
+
+#include "OVR_CAPI_D3D.h"
+#include "../CAPI_HMDState.h"
+#include "Kernel/OVR_Color.h"
+#include "../Textures/overdriveLut_dk2.h"
+
+#include "../../Displays/OVR_Win32_Dxgi_Display.h" // Display driver timing info
+
+
+namespace OVR { namespace CAPI { namespace D3D11 {
+
+#include "Shaders/Distortion_ps.h"
+#include "Shaders/DistortionChroma_vs.h"
+#include "Shaders/DistortionChroma_ps.h"
+#include "Shaders/DistortionTimewarpChroma_vs.h"
+#include "Shaders/DistortionCS2x2.h"
+
+#include "Shaders/SimpleQuad_vs.h"
+#include "Shaders/SimpleQuad_ps.h"
+
+#include "Tracing/Tracing.h"
+
+#include <initguid.h>
+DEFINE_GUID(IID_OVRDXGISwapchain, 0x868f9b4f, 0xe427, 0x46ed, 0xb0, 0x94, 0x66, 0xd1, 0x3b, 0xb, 0x48, 0xf7);
+
+[uuid(E741B60E-3AC8-418A-AB3C-26C1D4EDD33B)]
+interface IOVRDXGISwapChain : IUnknown
+{
+ virtual HRESULT GetDirectBuffer(REFIID riid, void** ppv) = 0;
+};
+
+#include <VersionHelpers.h>
+
+// Distortion pixel shader lookup.
+// Bit 0: Chroma Correction
+// Bit 1: Timewarp
+
+enum {
+ DistortionVertexShaderBitMask = 3,
+ DistortionVertexShaderCount = DistortionVertexShaderBitMask + 1,
+ DistortionPixelShaderBitMask = 0,
+ DistortionPixelShaderCount = DistortionPixelShaderBitMask + 1,
+};
+
+struct PrecompiledShader
+{
+ const unsigned char* ShaderData;
+ size_t ShaderSize;
+ const ShaderBase::Uniform* ReflectionData;
+ size_t ReflectionSize;
+};
+
+// To add a new distortion shader use these macros (with or w/o reflection)
+#define PCS_NOREFL(shader) { shader, sizeof(shader), NULL, 0 }
+#define PCS_REFL__(shader) { shader, sizeof(shader), shader ## _refl, sizeof( shader ## _refl )/sizeof(*(shader ## _refl)) }
+
+
+static PrecompiledShader DistortionVertexShaderLookup[DistortionVertexShaderCount] =
+{
+ PCS_REFL__(DistortionChroma_vs),
+ PCS_REFL__(DistortionTimewarpChroma_vs),
+ PCS_REFL__(DistortionTimewarpChroma_vs),
+ { NULL, 0, NULL, 0 },
+};
+
+static PrecompiledShader DistortionPixelShaderLookup[DistortionPixelShaderCount] =
+{
+ PCS_REFL__(DistortionChroma_ps)
+};
+
+enum
+{
+ DistortionComputeShader2x2 = 0,
+ DistortionComputeShaderCount
+};
+static PrecompiledShader DistortionComputeShaderLookup[DistortionComputeShaderCount] =
+{
+ PCS_REFL__(DistortionCS2x2)
+};
+
+
+
+void DistortionShaderBitIndexCheck()
+{
+ OVR_COMPILER_ASSERT(ovrDistortionCap_TimeWarp == 2);
+}
+
+
+
+struct DistortionVertex // Must match the VB description DistortionMeshVertexDesc
+{
+ Vector2f ScreenPosNDC;
+ Vector2f TanEyeAnglesR;
+ Vector2f TanEyeAnglesG;
+ Vector2f TanEyeAnglesB;
+ Color Col;
+};
+
+struct DistortionComputePin // Must match the ones declared in DistortionCS*.csh
+{
+ Vector2f TanEyeAnglesR;
+ Vector2f TanEyeAnglesG;
+ Vector2f TanEyeAnglesB;
+ Color Col;
+ int padding[1]; // Aligns to power-of-two boundary, increases performance significantly.
+};
+
+
+// Vertex type; same format is used for all shapes for simplicity.
+// Shapes are built by adding vertices to Model.
+struct Vertex
+{
+ Vector3f Pos;
+ Color C;
+ float U, V;
+ Vector3f Norm;
+
+ Vertex(const Vector3f& p, const Color& c = Color(64, 0, 0, 255),
+ float u = 0, float v = 0, Vector3f n = Vector3f(1, 0, 0))
+ : Pos(p), C(c), U(u), V(v), Norm(n)
+ {}
+ Vertex(float x, float y, float z, const Color& c = Color(64, 0, 0, 255),
+ float u = 0, float v = 0) : Pos(x, y, z), C(c), U(u), V(v)
+ { }
+
+ bool operator==(const Vertex& b) const
+ {
+ return Pos == b.Pos && C == b.C && U == b.U && V == b.V;
+ }
+};
+
+
+//----------------------------------------------------------------------------
+// ***** D3D11::DistortionRenderer
+
+DistortionRenderer::DistortionRenderer()
+{
+ SrgbBackBuffer = false;
+
+ EyeTextureSize[0] = Sizei(0);
+ EyeRenderViewport[0] = Recti();
+ EyeTextureSize[1] = Sizei(0);
+ EyeRenderViewport[1] = Recti();
+}
+
+DistortionRenderer::~DistortionRenderer()
+{
+ destroy();
+}
+
+// static
+CAPI::DistortionRenderer* DistortionRenderer::Create()
+{
+ return new DistortionRenderer;
+}
+
+
+bool DistortionRenderer::initializeRenderer(const ovrRenderAPIConfig* apiConfig)
+{
+ const ovrD3D11Config* config = (const ovrD3D11Config*)apiConfig;
+
+ // Reset the frame index read failure count, as this function is called when
+ // switching between windowed and fullscreen mode.
+ FrameIndexFailureCount = 0;
+
+ if (!config)
+ {
+ // Cleanup
+ pEyeTextures[0].Clear();
+ pEyeTextures[1].Clear();
+ pEyeDepthTextures[0].Clear();
+ pEyeDepthTextures[1].Clear();
+ memset(&RParams, 0, sizeof(RParams));
+ return true;
+ }
+
+ if (!config->D3D11.pDevice || !config->D3D11.pBackBufferRT)
+ return false;
+
+ if (Display::GetDirectDisplayInitialized())
+ {
+ Ptr<IUnknown> ovrSwapChain;
+ if (config->D3D11.pSwapChain->QueryInterface(IID_OVRDXGISwapchain, (void**)&ovrSwapChain.GetRawRef()) == E_NOINTERFACE)
+ {
+ OVR_DEBUG_LOG_TEXT(("ovr_Initialize() or ovr_InitializeRenderingShim() wasn't called before DXGISwapChain was created."));
+ }
+ }
+
+ RParams.pDevice = config->D3D11.pDevice;
+ RParams.pContext = config->D3D11.pDeviceContext;
+ RParams.pBackBufferRT = config->D3D11.pBackBufferRT;
+ RParams.pBackBufferUAV = config->D3D11.pBackBufferUAV;
+ RParams.pSwapChain = config->D3D11.pSwapChain;
+ RParams.BackBufferSize = config->D3D11.Header.BackBufferSize;
+ RParams.Multisample = config->D3D11.Header.Multisample;
+ RParams.VidPnTargetId = 0;
+
+ // set RParams.VidPnTargetId to the display target id for ETW tracing in order
+ // to match Microsoft-Windows-DxgKrnl's VSync event
+ IDXGIOutput *pOutput = NULL;
+ RParams.pSwapChain->GetContainingOutput(&pOutput);
+ if (pOutput)
+ {
+ // get the swapchain's DeviceName
+ DXGI_OUTPUT_DESC desc;
+ pOutput->GetDesc(&desc);
+
+ // allocate the required buffers for QueryDisplayConfig (we don't need pModeInfoArray but it can't be NULL or less than needed)
+ UINT32 NumPathArrayElements = 0, NumModeInfoArrayElements = 0;
+ DISPLAYCONFIG_PATH_INFO *pPathInfoArray = NULL;
+ DISPLAYCONFIG_MODE_INFO *pModeInfoArray = NULL;
+ LONG st = ERROR_INSUFFICIENT_BUFFER;
+ while (ERROR_INSUFFICIENT_BUFFER == st)
+ {
+ st = GetDisplayConfigBufferSizes(QDC_ONLY_ACTIVE_PATHS, &NumPathArrayElements, &NumModeInfoArrayElements);
+ if (ERROR_SUCCESS != st)
+ {
+ OVR_DEBUG_LOG_TEXT(("Error: GetDisplayConfigBufferSizes failed with %ld\n", st));
+ break;
+ }
+
+ pPathInfoArray = new DISPLAYCONFIG_PATH_INFO[NumPathArrayElements];
+ pModeInfoArray = new DISPLAYCONFIG_MODE_INFO[NumModeInfoArrayElements];
+
+ st = QueryDisplayConfig(QDC_ONLY_ACTIVE_PATHS, &NumPathArrayElements, pPathInfoArray, &NumModeInfoArrayElements, pModeInfoArray, NULL);
+ if (ERROR_SUCCESS != st) OVR_DEBUG_LOG_TEXT(("Error: QueryDisplayConfig failed with %ld\n", st));
+ }
+
+ // search for matching display targets for the SwapChain's display source
+ if (ERROR_SUCCESS == st)
+ {
+ for (UINT32 i = 0; i < NumPathArrayElements; ++i)
+ {
+ DISPLAYCONFIG_PATH_INFO *p = &pPathInfoArray[i];
+
+ DISPLAYCONFIG_SOURCE_DEVICE_NAME sdn;
+ sdn.header.size = sizeof(sdn);
+ sdn.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_SOURCE_NAME;
+ sdn.header.adapterId = p->sourceInfo.adapterId;
+ sdn.header.id = p->sourceInfo.id;
+ st = DisplayConfigGetDeviceInfo(&sdn.header);
+
+ DISPLAYCONFIG_TARGET_DEVICE_NAME tdn;
+ tdn.header.size = sizeof(tdn);
+ tdn.header.type = DISPLAYCONFIG_DEVICE_INFO_GET_TARGET_NAME;
+ tdn.header.adapterId = p->targetInfo.adapterId;
+ tdn.header.id = p->targetInfo.id;
+ st = DisplayConfigGetDeviceInfo(&tdn.header);
+
+ if (wcsncmp(sdn.viewGdiDeviceName, desc.DeviceName, sizeof(desc.DeviceName)) == 0)
+ {
+ // pick anything if nothing was found yet, else give precedence to "Rift" monitors on this display device
+ static const wchar_t Rift[] = { L'R', L'i', L'f', L't' };
+ if (!RParams.VidPnTargetId || (wcsncmp(tdn.monitorFriendlyDeviceName, Rift, sizeof(Rift)) == 0))
+ {
+ RParams.VidPnTargetId = p->targetInfo.id;
+ OVR_DEBUG_LOG_TEXT(("Debug: Found VidPnTargetId=%d for display %d name=\"%ls\"\n", RParams.VidPnTargetId, p->sourceInfo.id, tdn.monitorFriendlyDeviceName));
+ }
+ }
+ }
+ }
+
+ delete [] pPathInfoArray;
+ delete [] pModeInfoArray;
+
+ pOutput->Release();
+ }
+
+ GfxState = *new GraphicsState(RParams.pContext);
+
+ D3D11_RENDER_TARGET_VIEW_DESC backBufferDesc;
+ RParams.pBackBufferRT->GetDesc(&backBufferDesc);
+ SrgbBackBuffer = (backBufferDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB) ||
+ (backBufferDesc.Format == DXGI_FORMAT_B8G8R8A8_UNORM_SRGB) ||
+ (backBufferDesc.Format == DXGI_FORMAT_B8G8R8X8_UNORM_SRGB);
+
+
+#if 0 // enable related section in DistortionChroma.psh shader
+ // aniso requires proper sRGB sampling
+ SampleMode hqFilter = (RenderState->DistortionCaps & ovrDistortionCap_HqDistortion) ? Sample_Anisotropic : Sample_Linear;
+#else
+ SampleMode hqFilter = Sample_Linear;
+#endif
+
+ pEyeTextures[0] = *new Texture(&RParams, Texture_RGBA, Sizei(0),
+ getSamplerState(hqFilter | Sample_ClampBorder));
+ pEyeTextures[1] = *new Texture(&RParams, Texture_RGBA, Sizei(0),
+ getSamplerState(hqFilter | Sample_ClampBorder));
+
+ pEyeDepthTextures[0] = *new Texture(&RParams, Texture_Depth, Sizei(0),
+ getSamplerState(hqFilter | Sample_ClampBorder));
+ pEyeDepthTextures[1] = *new Texture(&RParams, Texture_Depth, Sizei(0),
+ getSamplerState(hqFilter | Sample_ClampBorder));
+
+ if (!initBuffersAndShaders())
+ {
+ return false;
+ }
+
+ // Rasterizer state
+ D3D11_RASTERIZER_DESC rs;
+ memset(&rs, 0, sizeof(rs));
+ rs.AntialiasedLineEnable = true;
+ rs.CullMode = D3D11_CULL_BACK;
+ rs.DepthClipEnable = true;
+ rs.FillMode = D3D11_FILL_SOLID;
+ Rasterizer = NULL;
+ RParams.pDevice->CreateRasterizerState(&rs, &Rasterizer.GetRawRef());
+
+ initOverdrive();
+
+ // TBD: Blend state.. not used?
+ // We'll want to turn off blending
+
+ GpuProfiler.Init(RParams.pDevice, RParams.pContext);
+
+ return true;
+}
+
+void DistortionRenderer::initOverdrive()
+{
+ if (RenderState->DistortionCaps & ovrDistortionCap_Overdrive)
+ {
+ LastUsedOverdriveTextureIndex = 0;
+
+ D3D11_RENDER_TARGET_VIEW_DESC backBufferDesc;
+ RParams.pBackBufferRT->GetDesc(&backBufferDesc);
+
+ for (int i = 0; i < NumOverdriveTextures; i++)
+ {
+ pOverdriveTextures[i] = *new Texture(&RParams, Texture_RGBA, RParams.BackBufferSize,
+ getSamplerState(Sample_Linear | Sample_ClampBorder));
+
+ D3D11_TEXTURE2D_DESC dsDesc;
+ dsDesc.Width = RParams.BackBufferSize.w;
+ dsDesc.Height = RParams.BackBufferSize.h;
+ dsDesc.MipLevels = 1;
+ dsDesc.ArraySize = 1;
+ dsDesc.Format = backBufferDesc.Format;
+ dsDesc.SampleDesc.Count = 1;
+ dsDesc.SampleDesc.Quality = 0;
+ dsDesc.Usage = D3D11_USAGE_DEFAULT;
+ dsDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE | D3D11_BIND_RENDER_TARGET;
+ dsDesc.CPUAccessFlags = 0;
+ dsDesc.MiscFlags = 0;
+
+ HRESULT hr = RParams.pDevice->CreateTexture2D(&dsDesc, NULL, &pOverdriveTextures[i]->Tex.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_DEBUG_LOG_TEXT(("Failed to create overdrive texture."));
+ // Remove overdrive flag since we failed to create the texture
+ LastUsedOverdriveTextureIndex = -1; // disables feature
+ break;
+ }
+
+ RParams.pDevice->CreateShaderResourceView(pOverdriveTextures[i]->Tex, NULL, &pOverdriveTextures[i]->TexSv.GetRawRef());
+ RParams.pDevice->CreateRenderTargetView(pOverdriveTextures[i]->Tex, NULL, &pOverdriveTextures[i]->TexRtv.GetRawRef());
+ }
+
+ const int dimSize = 256;
+ OVR_COMPILER_ASSERT(dimSize * dimSize * 4 == sizeof(overdriveLut_dk2));
+ OverdriveLutTexture = *new Texture(&RParams, Texture_RGBA, Sizei(dimSize, dimSize),
+ getSamplerState(Sample_Linear | Sample_Clamp), overdriveLut_dk2, 1);
+ }
+ else
+ {
+ LastUsedOverdriveTextureIndex = -1;
+ }
+}
+
+void DistortionRenderer::SubmitEye(int eyeId, const ovrTexture* eyeTexture)
+{
+ if (eyeTexture)
+ {
+ const ovrD3D11Texture* tex = (const ovrD3D11Texture*)eyeTexture;
+
+ // Use tex->D3D11.Header.RenderViewport to update UVs for rendering in case they changed.
+ // TBD: This may be optimized through some caching.
+ EyeTextureSize[eyeId] = tex->D3D11.Header.TextureSize;
+ EyeRenderViewport[eyeId] = tex->D3D11.Header.RenderViewport;
+
+ const ovrEyeRenderDesc& erd = RenderState->EyeRenderDesc[eyeId];
+
+ ovrHmd_GetRenderScaleAndOffset(erd.Fov,
+ EyeTextureSize[eyeId], EyeRenderViewport[eyeId],
+ UVScaleOffset[eyeId]);
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_FlipInput)
+ {
+ UVScaleOffset[eyeId][0].y = -UVScaleOffset[eyeId][0].y;
+ UVScaleOffset[eyeId][1].y = 1.0f - UVScaleOffset[eyeId][1].y;
+ }
+
+ // Get multisample count from texture
+ D3D11_TEXTURE2D_DESC desc;
+ tex->D3D11.pTexture->GetDesc(&desc);
+
+ pEyeTextures[eyeId]->UpdatePlaceholderTexture(tex->D3D11.pTexture, tex->D3D11.pSRView,
+ tex->D3D11.Header.TextureSize, desc.SampleDesc.Count);
+ }
+}
+
+void DistortionRenderer::SubmitEyeWithDepth(int eyeId, const ovrTexture* eyeColorTexture, const ovrTexture* eyeDepthTexture)
+{
+ SubmitEye(eyeId, eyeColorTexture);
+
+ if (eyeDepthTexture)
+ {
+ const ovrD3D11Texture* depthTex = (const ovrD3D11Texture*)eyeDepthTexture;
+
+ // Use tex->D3D11.Header.RenderViewport to update UVs for rendering in case they changed.
+ // TBD: This may be optimized through some caching.
+ EyeTextureSize[eyeId] = depthTex->D3D11.Header.TextureSize;
+ EyeRenderViewport[eyeId] = depthTex->D3D11.Header.RenderViewport;
+
+ const ovrEyeRenderDesc& erd = RenderState->EyeRenderDesc[eyeId];
+
+ ovrHmd_GetRenderScaleAndOffset(erd.Fov,
+ EyeTextureSize[eyeId], EyeRenderViewport[eyeId],
+ UVScaleOffset[eyeId]);
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_FlipInput)
+ {
+ UVScaleOffset[eyeId][0].y = -UVScaleOffset[eyeId][0].y;
+ UVScaleOffset[eyeId][1].y = 1.0f - UVScaleOffset[eyeId][1].y;
+ }
+
+ // Get multisample count from texture
+ D3D11_TEXTURE2D_DESC desc;
+ depthTex->D3D11.pTexture->GetDesc(&desc);
+
+ pEyeDepthTextures[eyeId]->UpdatePlaceholderTexture(depthTex->D3D11.pTexture, depthTex->D3D11.pSRView,
+ depthTex->D3D11.Header.TextureSize, desc.SampleDesc.Count);
+ }
+}
+
+void DistortionRenderer::renderEndFrame()
+{
+ renderDistortion();
+
+ if (RegisteredPostDistortionCallback)
+ RegisteredPostDistortionCallback(RParams.pContext);
+
+ if (LatencyTest2Active)
+ {
+ renderLatencyPixel(LatencyTest2DrawColor);
+ }
+}
+
+/******************************************************************/
+// Attempt to use DXGI for getting a previous vsync
+double DistortionRenderer::getDXGILastVsyncTime()
+{
+ OVR_ASSERT(RParams.pSwapChain != nullptr);
+
+ // If in driver mode,
+ if (!RenderState->OurHMDInfo.InCompatibilityMode)
+ {
+ // Prefer the driver mode
+ return 0.;
+ }
+
+ // If failure count is exceeded,
+ if (FrameIndexFailureCount >= FrameIndexFailureLimit)
+ {
+ if (FrameIndexFailureCount == FrameIndexFailureLimit)
+ {
+ LogError("[D3D11DistortionRenderer] Performance Warning: DXGI GetFrameStatistics could not get Vsync timing. The game should be running in fullscreen mode on the Rift to get adequate timing information.");
+ ++FrameIndexFailureCount;
+ }
+
+ return 0.;
+ }
+
+ // Get frame statistics from the D3D11 renderer
+ DXGI_FRAME_STATISTICS stats;
+ HRESULT hr = RParams.pSwapChain->GetFrameStatistics(&stats);
+ if (SUCCEEDED(hr))
+ {
+ FrameIndexFailureCount = 0; // Reset failure count
+
+ // Return Vsync time in seconds
+ return stats.SyncQPCTime.QuadPart * Timer::GetPerfFrequencyInverse();
+ }
+
+ FrameIndexFailureCount++; // Increment failure count
+ return 0.;
+}
+
+void DistortionRenderer::EndFrame(uint32_t frameIndex, bool swapBuffers)
+{
+ // Calculate the display frame index from the last known vsync time and
+ // corresponding display frame index
+ Timing->CalculateTimewarpTiming(frameIndex, getDXGILastVsyncTime());
+
+ // Don't spin if we are explicitly asked not to
+ if ( (RenderState->DistortionCaps & ovrDistortionCap_TimeWarp) &&
+ (RenderState->DistortionCaps & ovrDistortionCap_TimewarpJitDelay) &&
+ !(RenderState->DistortionCaps & ovrDistortionCap_ProfileNoSpinWaits))
+ {
+ if (!Timing->NeedDistortionTimeMeasurement())
+ {
+ // Wait for timewarp distortion if it is time and Gpu idle
+ FlushGpuAndWaitTillTime(Timing->GetTimewarpTiming()->JIT_TimewarpTime);
+
+ renderEndFrame();
+ }
+ else
+ {
+ // If needed, measure distortion time so that TimeManager can better estimate
+ // latency-reducing time-warp wait timing.
+ WaitUntilGpuIdle();
+ double distortionStartTime = ovr_GetTimeInSeconds();
+
+ renderEndFrame();
+
+ WaitUntilGpuIdle();
+ Timing->AddDistortionTimeMeasurement(ovr_GetTimeInSeconds() - distortionStartTime);
+ }
+ }
+ else
+ {
+ renderEndFrame();
+ }
+
+ if (LatencyTestActive)
+ {
+ renderLatencyQuad(LatencyTestDrawColor);
+ }
+
+ if (swapBuffers)
+ {
+ if (RParams.pSwapChain)
+ {
+ TraceDistortionPresent(RParams.VidPnTargetId, 0);
+
+ UINT swapInterval = (RenderState->EnabledHmdCaps & ovrHmdCap_NoVSync) ? 0 : 1;
+ RParams.pSwapChain->Present(swapInterval, 0);
+
+ // Force GPU to flush the scene, resulting in the lowest possible latency.
+ // It's critical that this flush is *after* present.
+ // With the display driver this flush is obsolete and theoretically should
+ // be a no-op.
+ // Doesn't need to be done if running through the Oculus driver.
+ if (RenderState->OurHMDInfo.InCompatibilityMode &&
+ !(RenderState->DistortionCaps & ovrDistortionCap_ProfileNoSpinWaits))
+ {
+ WaitUntilGpuIdle();
+ }
+ }
+ else
+ {
+ // TBD: Generate error - swapbuffer option used with null swapchain.
+ }
+ }
+
+ TraceDistortionEnd(RParams.VidPnTargetId, 0);
+}
+
+
+void DistortionRenderer::WaitUntilGpuIdle()
+{
+ HRESULT hr;
+
+ TraceDistortionWaitGPU(RParams.VidPnTargetId, 0);
+
+ // Flush and Stall CPU while waiting for GPU to complete rendering all of the queued draw calls
+ D3D11_QUERY_DESC queryDesc = { D3D11_QUERY_EVENT, 0 };
+ Ptr<ID3D11Query> query;
+ hr = RParams.pDevice->CreateQuery(&queryDesc, &query.GetRawRef());
+
+ if (SUCCEEDED(hr))
+ {
+ RParams.pContext->End(query);
+
+ // This flush is very important to measure Present() time in practice and prevent the
+ // GPU from allowing us to queue ahead unintentionally in extended mode.
+ RParams.pContext->Flush();
+
+ for (;;)
+ {
+ BOOL done = FALSE;
+ hr = RParams.pContext->GetData(query, &done, sizeof(done), 0);
+
+ // Exit on failure to avoid infinite loop.
+ if (FAILED(hr))
+ {
+ break;
+ }
+
+ // If event succeeded and it's done,
+ if (SUCCEEDED(hr) && done)
+ {
+ break;
+ }
+ }
+ }
+}
+
+double DistortionRenderer::FlushGpuAndWaitTillTime(double absTime)
+{
+ RParams.pContext->Flush();
+ return WaitTillTime(absTime);
+}
+
+bool DistortionRenderer::initBuffersAndShaders()
+{
+ if (RenderState->DistortionCaps & ovrDistortionCap_ComputeShader)
+ {
+ // Compute shader distortion grid.
+ // TODO - only do this if the CS is actually enabled?
+ for (int eyeNum = 0; eyeNum < 2; eyeNum++)
+ {
+ // Compute shader setup of regular grid.
+ DistortionMeshVBs[eyeNum] = NULL;
+ DistortionMeshIBs[eyeNum] = NULL;
+
+ // These constants need to match those declared in the shader in DistortionCS*.csh
+ const int gridSizeInPixels = 16;
+ const int pinsPerEdge = 128;
+
+
+ // TODO: clean up this mess!
+ ovrEyeType eyeType = RenderState->EyeRenderDesc[eyeNum].Eye;
+ ovrFovPort fov = RenderState->EyeRenderDesc[eyeNum].Fov;
+
+ HmdRenderInfo const & hmdri = RenderState->RenderInfo;
+ DistortionRenderDesc const & distortion = RenderState->Distortion[eyeType];
+
+
+ // Find the mapping from TanAngle space to target NDC space.
+ ScaleAndOffset2D eyeToSourceNDC = CreateNDCScaleAndOffsetFromFov(fov);
+
+ //const StereoEyeParams &stereoParams = ( eyeNum == 0 ) ? stereoParamsLeft : stereoParamsRight;
+ OVR_ASSERT(gridSizeInPixels * (pinsPerEdge - 1) > hmdri.ResolutionInPixels.w / 2);
+ OVR_ASSERT(gridSizeInPixels * (pinsPerEdge - 1) > hmdri.ResolutionInPixels.h);
+ DistortionComputePin Verts[pinsPerEdge*pinsPerEdge];
+ // Vertices are laid out in a vertical scanline pattern,
+ // scanning right to left, then within each scan going top to bottom, like DK2.
+ // If we move to a different panel orientation, we may need to flip this around.
+ int vertexNum = 0;
+ for (int x = 0; x < pinsPerEdge; x++)
+ {
+ for (int y = 0; y < pinsPerEdge; y++)
+ {
+ int pixX = x * gridSizeInPixels;
+ int pixY = y * gridSizeInPixels;
+#if 0
+ // Simple version, ignoring pentile offsets
+ Vector2f screenPosNdc;
+ screenPosNdc.x = 2.0f * (0.5f - ((float)pixX / (hmdri.ResolutionInPixels.w / 2))); // Note signs!
+ screenPosNdc.y = 2.0f * (-0.5f + ((float)pixY / hmdri.ResolutionInPixels.h)); // Note signs!
+
+ DistortionMeshVertexData vertex = DistortionMeshMakeVertex(screenPosNdc,
+ (eyeNum == 1),
+ hmdri,
+ distortion,
+ eyeToSourceNDC);
+ DistortionComputePin *pCurVert = &(Verts[vertexNum]);
+ pCurVert->TanEyeAnglesR = vertex.TanEyeAnglesR;
+ pCurVert->TanEyeAnglesG = vertex.TanEyeAnglesG;
+ pCurVert->TanEyeAnglesB = vertex.TanEyeAnglesB;
+#else
+ // Pentile offsets are messy.
+ Vector2f screenPos[3]; // R=0, G=1, B=2
+ DistortionMeshVertexData vertexRGB[3];
+ screenPos[1] = Vector2f((float)pixX, (float)pixY);
+ screenPos[0] = screenPos[1];
+ screenPos[2] = screenPos[1];
+
+
+ for (int i = 0; i < 3; i++)
+ {
+ Vector2f screenPosNdc;
+ screenPosNdc.x = 2.0f * (0.5f - (screenPos[i].x / (hmdri.ResolutionInPixels.w / 2))); // Note signs!
+ screenPosNdc.y = 2.0f * (-0.5f + (screenPos[i].y / hmdri.ResolutionInPixels.h)); // Note signs!
+ vertexRGB[i] = DistortionMeshMakeVertex(screenPosNdc,
+ (eyeNum == 1),
+ hmdri,
+ distortion,
+ eyeToSourceNDC);
+ }
+ // Most data (fade, TW interpolate, etc) comes from the green channel.
+ DistortionMeshVertexData vertex = vertexRGB[1];
+ DistortionComputePin *pCurVert = &(Verts[vertexNum]);
+ pCurVert->TanEyeAnglesR = vertexRGB[0].TanEyeAnglesR;
+ pCurVert->TanEyeAnglesG = vertexRGB[1].TanEyeAnglesG;
+ pCurVert->TanEyeAnglesB = vertexRGB[2].TanEyeAnglesB;
+#endif
+
+ // vertex.Shade will go negative beyond the edges to produce correct intercept with the 0.0 plane.
+ // We want to preserve this, so bias and offset to fit [-1,+1] in a byte.
+ // The reverse wll be done in the shader.
+ float shade = Alg::Clamp(vertex.Shade * 0.5f + 0.5f, 0.0f, 1.0f);
+ pCurVert->Col.R = (OVR::UByte)(floorf(shade * 255.999f));
+ pCurVert->Col.G = pCurVert->Col.R;
+ pCurVert->Col.B = pCurVert->Col.R;
+ pCurVert->Col.A = (OVR::UByte)(floorf(vertex.TimewarpLerp * 255.999f));
+
+ vertexNum++;
+ }
+ }
+ DistortionPinBuffer[eyeNum] = *new Buffer(&RParams);
+ DistortionPinBuffer[eyeNum]->Data(Buffer_Compute, Verts, vertexNum * sizeof(Verts[0]), sizeof(Verts[0]));
+ }
+
+ }
+ else
+ {
+ for (int eyeNum = 0; eyeNum < 2; eyeNum++)
+ {
+ // Allocate & generate distortion mesh vertices.
+ DistortionPinBuffer[eyeNum] = NULL;
+
+ ovrDistortionMesh meshData;
+
+ // double startT = ovr_GetTimeInSeconds();
+
+ if (!CalculateDistortionMeshFromFOV(RenderState->RenderInfo,
+ RenderState->Distortion[eyeNum],
+ (RenderState->EyeRenderDesc[eyeNum].Eye == ovrEye_Left ? StereoEye_Left : StereoEye_Right),
+ RenderState->EyeRenderDesc[eyeNum].Fov,
+ RenderState->DistortionCaps,
+ &meshData))
+ {
+ OVR_ASSERT(false);
+ return false;
+ }
+
+ // double deltaT = ovr_GetTimeInSeconds() - startT;
+ // LogText("GenerateDistortion time = %f\n", deltaT);
+
+ // Now parse the vertex data and create a render ready vertex buffer from it
+ DistortionVertex * pVBVerts = (DistortionVertex*)OVR_ALLOC(sizeof(DistortionVertex) * meshData.VertexCount);
+ DistortionVertex * pCurVBVert = pVBVerts;
+ ovrDistortionVertex* pCurOvrVert = meshData.pVertexData;
+
+ for (unsigned vertNum = 0; vertNum < meshData.VertexCount; vertNum++)
+ {
+ pCurVBVert->ScreenPosNDC.x = pCurOvrVert->ScreenPosNDC.x;
+ pCurVBVert->ScreenPosNDC.y = pCurOvrVert->ScreenPosNDC.y;
+ pCurVBVert->TanEyeAnglesR = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesR);
+ pCurVBVert->TanEyeAnglesG = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesG);
+ pCurVBVert->TanEyeAnglesB = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesB);
+
+ // Convert [0.0f,1.0f] to [0,255]
+ if (RenderState->DistortionCaps & ovrDistortionCap_Vignette)
+ pCurVBVert->Col.R = (uint8_t)(Alg::Max(pCurOvrVert->VignetteFactor, 0.0f) * 255.99f);
+ else
+ pCurVBVert->Col.R = 255;
+
+ pCurVBVert->Col.G = pCurVBVert->Col.R;
+ pCurVBVert->Col.B = pCurVBVert->Col.R;
+ pCurVBVert->Col.A = (uint8_t)(pCurOvrVert->TimeWarpFactor * 255.99f);
+ pCurOvrVert++;
+ pCurVBVert++;
+ }
+
+ DistortionMeshVBs[eyeNum] = *new Buffer(&RParams);
+ DistortionMeshVBs[eyeNum]->Data(Buffer_Vertex | Buffer_ReadOnly, pVBVerts, sizeof(DistortionVertex)* meshData.VertexCount);
+ DistortionMeshIBs[eyeNum] = *new Buffer(&RParams);
+ DistortionMeshIBs[eyeNum]->Data(Buffer_Index | Buffer_ReadOnly, meshData.pIndexData, (sizeof(INT16)* meshData.IndexCount));
+
+ OVR_FREE(pVBVerts);
+ ovrHmd_DestroyDistortionMesh(&meshData);
+ }
+ }
+
+
+ // Uniform buffers
+ for (int i = 0; i < Shader_Count; i++)
+ {
+ UniformBuffers[i] = *new Buffer(&RParams);
+ //MaxTextureSet[i] = 0;
+ }
+
+ initShaders();
+
+ return true;
+}
+
+
+
+void DistortionRenderer::renderDistortion()
+{
+ // XXX takes a frameIndex second parameter, how do we get that here?
+ TraceDistortionBegin(RParams.VidPnTargetId, 0);
+
+ Ptr<IOVRDXGISwapChain> ovrSwap;
+ HRESULT hr = RParams.pSwapChain->QueryInterface(IID_PPV_ARGS(&ovrSwap.GetRawRef()));
+ if (SUCCEEDED(hr))
+ {
+ Ptr<ID3D11Texture2D> texture;
+ hr = ovrSwap->GetDirectBuffer(IID_PPV_ARGS(&texture.GetRawRef()));
+ if (SUCCEEDED(hr))
+ {
+ Ptr<ID3D11RenderTargetView> rtv;
+ auto it = RenderTargetMap.Find(texture.GetPtr());
+ if (it == RenderTargetMap.End())
+ {
+ hr = RParams.pDevice->CreateRenderTargetView(texture, nullptr, &rtv.GetRawRef());
+ if (SUCCEEDED(hr))
+ {
+ RenderTargetMap.Add(texture.GetPtr(), rtv);
+ }
+ }
+ else
+ {
+ rtv = it->Second;
+ }
+
+ if (rtv)
+ {
+ // The RenderTargets map holds the ref count on this for us
+ RParams.pBackBufferRT = rtv;
+ }
+ }
+ }
+
+ RParams.pContext->HSSetShader(NULL, NULL, 0);
+ RParams.pContext->DSSetShader(NULL, NULL, 0);
+ RParams.pContext->GSSetShader(NULL, NULL, 0);
+
+ RParams.pContext->RSSetState(Rasterizer);
+
+ bool overdriveActive = IsOverdriveActive();
+ int currOverdriveTextureIndex = -1;
+
+ if (overdriveActive)
+ {
+ currOverdriveTextureIndex = (LastUsedOverdriveTextureIndex + 1) % NumOverdriveTextures;
+ ID3D11RenderTargetView* distortionRtv = pOverdriveTextures[currOverdriveTextureIndex]->TexRtv.GetRawRef();
+ ID3D11RenderTargetView* mrtRtv[2] = { distortionRtv, RParams.pBackBufferRT };
+ RParams.pContext->OMSetRenderTargets(2, mrtRtv, 0);
+
+ RParams.pContext->ClearRenderTargetView(distortionRtv, RenderState->ClearColor);
+ }
+ else
+ {
+ RParams.pContext->OMSetRenderTargets(1, &RParams.pBackBufferRT, 0);
+ }
+
+ // Not affected by viewport.
+ RParams.pContext->ClearRenderTargetView(RParams.pBackBufferRT, RenderState->ClearColor);
+
+ setViewport(Recti(0, 0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
+
+
+ for (int eyeNum = 0; eyeNum < 2; eyeNum++)
+ {
+ ShaderFill distortionShaderFill(DistortionShader);
+ distortionShaderFill.SetTexture(0, pEyeTextures[eyeNum], Shader_Pixel);
+
+ if (pEyeDepthTextures[eyeNum]->Tex != NULL)
+ {
+ OVR_ASSERT(pEyeDepthTextures[eyeNum]->GetSamples() <= 4);
+ DistortionShader->SetUniform1f("depthMsaaSamples", (float)pEyeDepthTextures[eyeNum]->GetSamples());
+
+ // the shader will select the right version
+ distortionShaderFill.SetTexture(2, pEyeDepthTextures[eyeNum], Shader_Vertex); // DepthTexture4x
+ switch (pEyeDepthTextures[eyeNum]->GetSamples())
+ {
+ case 1: distortionShaderFill.SetTexture(0, pEyeDepthTextures[eyeNum], Shader_Vertex); break; // Set DepthTexture1x
+ case 2: distortionShaderFill.SetTexture(1, pEyeDepthTextures[eyeNum], Shader_Vertex); break; // Set DepthTexture2x
+ case 4: distortionShaderFill.SetTexture(2, pEyeDepthTextures[eyeNum], Shader_Vertex); break; // Set DepthTexture4x
+
+ default:
+ OVR_ASSERT(false); // unsupported MSAA sample count (requires shader update)
+ LogError("{ERR-105} [D3D1x] Unsupported MSAA sample count (requires D3D shader update)");
+ }
+
+ if (PositionTimewarpDesc.NearClip >= 0.0f && PositionTimewarpDesc.FarClip >= 0.0f)
+ {
+ float NearClip = PositionTimewarpDesc.NearClip;
+ float FarClip = PositionTimewarpDesc.FarClip;
+
+ float DepthProjectorX = FarClip / (FarClip - NearClip);
+ float DepthProjectorY = (-FarClip * NearClip) / (FarClip - NearClip);
+ DistortionShader->SetUniform2f("DepthProjector", DepthProjectorX, DepthProjectorY);
+ }
+ else
+ {
+ OVR_ASSERT(false);
+ LogError("{ERR-101} [D3D1x] Invalid ovrPositionTimewarpDesc data provided by client.");
+
+ DistortionShader->SetUniform2f("DepthProjector", 1.0f, 1.0f);
+ }
+
+ // DepthProjector values can also be calculated as:
+ //float DepthProjectorX = FarClip / (FarClip - NearClip);
+ //float DepthProjectorY = (-FarClip * NearClip) / (FarClip - NearClip);
+ //DistortionShader->SetUniform2f("DepthProjector", -eyeProj[eyeNum].M[2][2], eyeProj[eyeNum].M[2][3]);
+ DistortionShader->SetUniform2f("DepthDimSize", (float)pEyeDepthTextures[eyeNum]->TextureSize.w,
+ (float)pEyeDepthTextures[eyeNum]->TextureSize.h);
+ }
+ else
+ {
+ // -1.0 disables the use of the depth buffer
+ DistortionShader->SetUniform1f("depthMsaaSamples", -1.0f);
+ }
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_HqDistortion)
+ {
+ static float aaDerivMult = 1.0f;
+ DistortionShader->SetUniform1f("AaDerivativeMult", aaDerivMult);
+ }
+ else
+ {
+ // 0.0 disables high quality anti-aliasing
+ DistortionShader->SetUniform1f("AaDerivativeMult", -1.0f);
+ }
+
+ if (overdriveActive)
+ {
+ distortionShaderFill.SetTexture(1, pOverdriveTextures[LastUsedOverdriveTextureIndex], Shader_Pixel);
+ distortionShaderFill.SetTexture(2, OverdriveLutTexture, Shader_Pixel);
+
+ // Toggle this to compare LUTs vs analytical values for overdrive
+ static bool enableLut = false;
+
+ float overdriveScaleRegularRise;
+ float overdriveScaleRegularFall;
+ GetOverdriveScales(overdriveScaleRegularRise, overdriveScaleRegularFall);
+ DistortionShader->SetUniform3f("OverdriveScales", enableLut ? 2.0f : 1.0f,
+ overdriveScaleRegularRise, overdriveScaleRegularFall);
+ }
+ else
+ {
+ // -1.0f disables PLO
+ DistortionShader->SetUniform3f("OverdriveScales", -1.0f, -1.0f, -1.0f);
+ }
+
+ distortionShaderFill.SetInputLayout(DistortionVertexIL);
+
+ DistortionShader->SetUniform2f("EyeToSourceUVScale", UVScaleOffset[eyeNum][0].x, UVScaleOffset[eyeNum][0].y);
+ DistortionShader->SetUniform2f("EyeToSourceUVOffset", UVScaleOffset[eyeNum][1].x, UVScaleOffset[eyeNum][1].y);
+
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_TimeWarp)
+ {
+ Matrix4f startEndMatrices[2];
+ double timewarpIMUTime = 0.;
+ // TODO: if (pEyeDepthTextures[eyeNum]->Tex != NULL), need to use CalculateTimewarpFromSensors instead.
+ CalculateOrientationTimewarpFromSensors(
+ RenderState->EyeRenderPoses[eyeNum].Orientation,
+ SensorReader, Timing->GetTimewarpTiming()->EyeStartEndTimes[eyeNum],
+ startEndMatrices, timewarpIMUTime);
+ Timing->SetTimewarpIMUTime(timewarpIMUTime);
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_ComputeShader)
+ {
+ DistortionShader->SetUniform3x3f("EyeRotationStart", startEndMatrices[0]);
+ DistortionShader->SetUniform3x3f("EyeRotationEnd", startEndMatrices[1]);
+ }
+ else
+ {
+ // Can feed identity like matrices incase of concern over timewarp calculations
+ DistortionShader->SetUniform4x4f("EyeRotationStart", startEndMatrices[0]);
+ DistortionShader->SetUniform4x4f("EyeRotationEnd", startEndMatrices[1]);
+ }
+ }
+
+
+ if (RenderState->DistortionCaps & ovrDistortionCap_ComputeShader)
+ {
+ //RParams.pContext->CSCSSetShaderResources
+ //RParams.pContext->CSSetUnorderedAccessViews
+ //RParams.pContext->CSSetShader
+ //RParams.pContext->CSSetSamplers
+ //RParams.pContext->CSSetConstantBuffers
+
+
+ // These need to match the values used in the compiled shader
+ //const int gridSizeInPixels = 16; // GRID_SIZE_IN_PIXELS
+ //const int pinsPerEdge = 128; // PINS_PER_EDGE
+ const int nxnBlockSizeInPixels = 2; // NXN_BLOCK_SIZE_PIXELS
+ const int simdSquareSize = 16; // SIMD_SQUARE_SIZE
+
+ const int invocationSizeInPixels = nxnBlockSizeInPixels * simdSquareSize;
+
+ distortionShaderFill.SetTexture(0, pEyeTextures[eyeNum], Shader_Compute);
+
+ DistortionShader->SetUniform1f("RightEye", (float)eyeNum);
+ DistortionShader->SetUniform1f("UseOverlay", 0.0f); // No overlay supported here.
+ DistortionShader->SetUniform1f("FbSizePixelsX", (float)RParams.BackBufferSize.w);
+
+
+ ShaderSet* shaders = distortionShaderFill.GetShaders();
+ ShaderBase* cshader = ((ShaderBase*)shaders->GetShader(Shader_Compute));
+
+ ID3D11UnorderedAccessView *uavRendertarget = RParams.pBackBufferUAV;
+ int SizeX = RParams.BackBufferSize.w / 2;
+ int SizeY = RParams.BackBufferSize.h;
+
+ int TileNumX = (SizeX + (invocationSizeInPixels - 1)) / invocationSizeInPixels;
+ int TileNumY = (SizeY + (invocationSizeInPixels - 1)) / invocationSizeInPixels;
+
+ RParams.pContext->CSSetUnorderedAccessViews(0, 1, &uavRendertarget, NULL);
+
+
+ // Incoming eye-buffer textures start at t0 onwards, so set this in slot #4
+ // Subtlety - can't put this in slot 0 because fill->Set stops at the first NULL texture.
+ ID3D11ShaderResourceView *d3dSrv = DistortionPinBuffer[eyeNum]->GetSrv();
+ RParams.pContext->CSSetShaderResources(4, 1, &d3dSrv);
+
+ // TODO: uniform/constant buffers
+ cshader->UpdateBuffer(UniformBuffers[Shader_Compute]);
+ cshader->SetUniformBuffer(UniformBuffers[Shader_Compute]);
+
+ // Primitive type is ignored for CS.
+ // This call actually sets the textures and does pContext->CSSetShader(). Primitive type is ignored.
+ distortionShaderFill.Set(Prim_Unknown);
+
+ RParams.pContext->Dispatch(TileNumX, TileNumY, 1);
+ }
+ else
+ {
+ renderPrimitives(&distortionShaderFill, DistortionMeshVBs[eyeNum], DistortionMeshIBs[eyeNum],
+ NULL, 0, (int)DistortionMeshIBs[eyeNum]->GetSize() / 2, Prim_Triangles);
+ }
+ }
+
+ LastUsedOverdriveTextureIndex = currOverdriveTextureIndex;
+
+ // Re-activate to only draw on back buffer
+ if (overdriveActive)
+ {
+ RParams.pContext->OMSetRenderTargets(1, &RParams.pBackBufferRT, 0);
+ }
+}
+
+void DistortionRenderer::createDrawQuad()
+{
+ const int numQuadVerts = 4;
+ LatencyTesterQuadVB = *new Buffer(&RParams);
+ if (!LatencyTesterQuadVB)
+ {
+ return;
+ }
+
+ LatencyTesterQuadVB->Data(Buffer_Vertex, NULL, numQuadVerts * sizeof(Vertex));
+ Vertex* vertices = (Vertex*)LatencyTesterQuadVB->Map(0, numQuadVerts * sizeof(Vertex), Map_Discard);
+ if (!vertices)
+ {
+ OVR_ASSERT(false); // failed to lock vertex buffer
+ return;
+ }
+
+ const float left = -1.0f;
+ const float top = -1.0f;
+ const float right = 1.0f;
+ const float bottom = 1.0f;
+
+ vertices[0] = Vertex(Vector3f(left, top, 0.0f), Color(255, 255, 255, 255));
+ vertices[1] = Vertex(Vector3f(left, bottom, 0.0f), Color(255, 255, 255, 255));
+ vertices[2] = Vertex(Vector3f(right, top, 0.0f), Color(255, 255, 255, 255));
+ vertices[3] = Vertex(Vector3f(right, bottom, 0.0f), Color(255, 255, 255, 255));
+
+ LatencyTesterQuadVB->Unmap(vertices);
+}
+
+void DistortionRenderer::renderLatencyQuad(unsigned char* latencyTesterDrawColor)
+{
+ const int numQuadVerts = 4;
+
+ if (!LatencyTesterQuadVB)
+ {
+ createDrawQuad();
+ }
+
+ ShaderFill quadFill(SimpleQuadShader);
+ quadFill.SetInputLayout(SimpleQuadVertexIL);
+
+ setViewport(Recti(0, 0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
+
+ float testerLuminance = (float)latencyTesterDrawColor[0] / 255.99f;
+ if (SrgbBackBuffer)
+ {
+ testerLuminance = pow(testerLuminance, 2.2f);
+ }
+
+ SimpleQuadShader->SetUniform2f("Scale", 0.3f, 0.3f);
+ SimpleQuadShader->SetUniform4f("Color", testerLuminance, testerLuminance, testerLuminance, 1.0f);
+
+ for (int eyeNum = 0; eyeNum < 2; eyeNum++)
+ {
+ SimpleQuadShader->SetUniform2f("PositionOffset", eyeNum == 0 ? -0.5f : 0.5f, 0.0f);
+ renderPrimitives(&quadFill, LatencyTesterQuadVB, NULL, NULL, 0, numQuadVerts, Prim_TriangleStrip);
+ }
+}
+
+void DistortionRenderer::renderLatencyPixel(unsigned char* latencyTesterPixelColor)
+{
+ const int numQuadVerts = 4;
+
+ if (!LatencyTesterQuadVB)
+ {
+ createDrawQuad();
+ }
+
+ ShaderFill quadFill(SimpleQuadShader);
+ quadFill.SetInputLayout(SimpleQuadVertexIL);
+
+ setViewport(Recti(0, 0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
+
+ Vector3f testerColor = Vector3f((float)latencyTesterPixelColor[0] / 255.99f,
+ (float)latencyTesterPixelColor[1] / 255.99f,
+ (float)latencyTesterPixelColor[2] / 255.99f);
+ if (SrgbBackBuffer)
+ {
+ // 2.2 gamma is close enough for our purposes of matching sRGB
+ testerColor.x = pow(testerColor.x, 2.2f);
+ testerColor.y = pow(testerColor.y, 2.2f);
+ testerColor.z = pow(testerColor.z, 2.2f);
+ }
+
+#ifdef OVR_BUILD_DEBUG
+ SimpleQuadShader->SetUniform4f("Color", testerColor.x, testerColor.y, testerColor.z, 1.0f);
+
+ Vector2f scale(20.0f / RParams.BackBufferSize.w, 20.0f / RParams.BackBufferSize.h);
+#else
+ // sending in as gray scale
+ SimpleQuadShader->SetUniform4f("Color", testerColor.x, testerColor.x, testerColor.x, 1.0f);
+
+ Vector2f scale(1.0f / RParams.BackBufferSize.w, 1.0f / RParams.BackBufferSize.h);
+#endif
+ SimpleQuadShader->SetUniform2f("Scale", scale.x, scale.y);
+
+ float xOffset = RenderState->RenderInfo.OffsetLatencyTester ? -0.5f * scale.x : 1.0f - scale.x;
+ float yOffset = 1.0f - scale.y;
+
+ // Render the latency tester quad in the correct location.
+ if (RenderState->RenderInfo.Rotation == 270)
+ {
+ xOffset = -xOffset;
+ }
+ else if (RenderState->RenderInfo.Rotation == 180)
+ {
+ xOffset = -xOffset;
+ yOffset = -yOffset;
+ }
+ else if (RenderState->RenderInfo.Rotation == 90)
+ {
+ yOffset = -yOffset;
+ }
+
+ SimpleQuadShader->SetUniform2f("PositionOffset", xOffset, yOffset);
+
+ renderPrimitives(&quadFill, LatencyTesterQuadVB, NULL, NULL, 0, numQuadVerts, Prim_TriangleStrip);
+}
+
+void DistortionRenderer::renderPrimitives(
+ const ShaderFill* fill,
+ Buffer* vertices, Buffer* indices,
+ Matrix4f* viewMatrix, int offset, int count,
+ PrimitiveType rprim)
+{
+ OVR_ASSERT(fill->GetInputLayout() != 0);
+ RParams.pContext->IASetInputLayout((ID3D11InputLayout*)fill->GetInputLayout());
+
+ if (indices)
+ {
+ RParams.pContext->IASetIndexBuffer(indices->GetBuffer(), DXGI_FORMAT_R16_UINT, 0);
+ }
+
+ ID3D11Buffer* vertexBuffer = vertices->GetBuffer();
+ UINT vertexStride = sizeof(Vertex);
+ UINT vertexOffset = offset;
+ RParams.pContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
+
+ ShaderSet* shaders = ((ShaderFill*)fill)->GetShaders();
+
+ ShaderBase* vshader = ((ShaderBase*)shaders->GetShader(Shader_Vertex));
+ unsigned char* vertexData = vshader->UniformData;
+ if (vertexData)
+ {
+ // TODO: some VSes don't start with StandardUniformData!
+ if (viewMatrix)
+ {
+ StandardUniformData* stdUniforms = (StandardUniformData*)vertexData;
+ stdUniforms->View = viewMatrix->Transposed();
+ stdUniforms->Proj = StdUniforms.Proj;
+ }
+ UniformBuffers[Shader_Vertex]->Data(Buffer_Uniform, vertexData, vshader->UniformsSize);
+ vshader->SetUniformBuffer(UniformBuffers[Shader_Vertex]);
+ }
+
+ for (int i = Shader_Vertex + 1; i < Shader_Count; i++)
+ {
+ if (shaders->GetShader(i))
+ {
+ ((ShaderBase*)shaders->GetShader(i))->UpdateBuffer(UniformBuffers[i]);
+ ((ShaderBase*)shaders->GetShader(i))->SetUniformBuffer(UniformBuffers[i]);
+ }
+ }
+
+ D3D11_PRIMITIVE_TOPOLOGY prim;
+ switch (rprim)
+ {
+ case Prim_Triangles:
+ prim = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLELIST;
+ break;
+ case Prim_Lines:
+ prim = D3D11_PRIMITIVE_TOPOLOGY_LINELIST;
+ break;
+ case Prim_TriangleStrip:
+ prim = D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP;
+ break;
+ default:
+ OVR_ASSERT(0);
+ return;
+ }
+ RParams.pContext->IASetPrimitiveTopology(prim);
+
+ fill->Set(rprim);
+
+ if (indices)
+ {
+ RParams.pContext->DrawIndexed(count, 0, 0);
+ }
+ else
+ {
+ RParams.pContext->Draw(count, 0);
+ }
+}
+
+void DistortionRenderer::setViewport(const Recti& vp)
+{
+ D3D11_VIEWPORT d3dvp;
+
+ d3dvp.Width = (float)vp.w;
+ d3dvp.Height = (float)vp.h;
+ d3dvp.TopLeftX = (float)vp.x;
+ d3dvp.TopLeftY = (float)vp.y;
+ d3dvp.MinDepth = 0;
+ d3dvp.MaxDepth = 1;
+ RParams.pContext->RSSetViewports(1, &d3dvp);
+}
+
+
+
+// Must match struct DistortionVertex
+static D3D11_INPUT_ELEMENT_DESC DistortionMeshVertexDesc[] =
+{
+ { "Position", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TexCoord", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TexCoord", 1, DXGI_FORMAT_R32G32_FLOAT, 0, 16, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TexCoord", 2, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "Color", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 32, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+};
+
+static D3D11_INPUT_ELEMENT_DESC SimpleQuadMeshVertexDesc[] =
+{
+ { "Position", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 },
+};
+
+
+void DistortionRenderer::initShaders()
+{
+ if ((RenderState->DistortionCaps & ovrDistortionCap_ComputeShader) != 0)
+ {
+ // Compute shader
+ DistortionShader = *new ShaderSet;
+
+ int shaderNum = DistortionComputeShader2x2;
+
+ PrecompiledShader psShaderByteCode = DistortionComputeShaderLookup[shaderNum];
+ Ptr<D3D11::ComputeShader> cs = *new D3D11::ComputeShader(
+ &RParams,
+ (void*)psShaderByteCode.ShaderData, psShaderByteCode.ShaderSize,
+ psShaderByteCode.ReflectionData, psShaderByteCode.ReflectionSize);
+
+ DistortionShader->SetShader(cs);
+ }
+ else
+ {
+ // Vertex + pixel distortion shader.
+ PrecompiledShader& vsShaderByteCode = DistortionVertexShaderLookup[DistortionVertexShaderBitMask & RenderState->DistortionCaps];
+ if (vsShaderByteCode.ShaderData != NULL)
+ {
+ Ptr<D3D11::VertexShader> vtxShader = *new D3D11::VertexShader(
+ &RParams,
+ (void*)vsShaderByteCode.ShaderData, vsShaderByteCode.ShaderSize,
+ vsShaderByteCode.ReflectionData, vsShaderByteCode.ReflectionSize);
+
+ DistortionVertexIL = NULL;
+ ID3D11InputLayout** objRef = &DistortionVertexIL.GetRawRef();
+
+ HRESULT validate = RParams.pDevice->CreateInputLayout(
+ DistortionMeshVertexDesc, sizeof(DistortionMeshVertexDesc) / sizeof(DistortionMeshVertexDesc[0]),
+ vsShaderByteCode.ShaderData, vsShaderByteCode.ShaderSize, objRef);
+ OVR_UNUSED(validate);
+
+ DistortionShader = *new ShaderSet;
+ DistortionShader->SetShader(vtxShader);
+ }
+ else
+ {
+ OVR_ASSERT_M(false, "Unsupported distortion feature used\n");
+ }
+
+ PrecompiledShader& psShaderByteCode = DistortionPixelShaderLookup[DistortionPixelShaderBitMask & RenderState->DistortionCaps];
+ if (psShaderByteCode.ShaderData)
+ {
+ Ptr<D3D11::PixelShader> ps = *new D3D11::PixelShader(
+ &RParams,
+ (void*)psShaderByteCode.ShaderData, psShaderByteCode.ShaderSize,
+ psShaderByteCode.ReflectionData, psShaderByteCode.ReflectionSize);
+
+ DistortionShader->SetShader(ps);
+ }
+ else
+ {
+ OVR_ASSERT_M(false, "Unsupported distortion feature used\n");
+ }
+ }
+
+ {
+ Ptr<D3D11::VertexShader> vtxShader = *new D3D11::VertexShader(
+ &RParams,
+ (void*)SimpleQuad_vs, sizeof(SimpleQuad_vs),
+ SimpleQuad_vs_refl, sizeof(SimpleQuad_vs_refl) / sizeof(SimpleQuad_vs_refl[0]));
+ //NULL, 0);
+
+ SimpleQuadVertexIL = NULL;
+ ID3D11InputLayout** objRef = &SimpleQuadVertexIL.GetRawRef();
+
+ HRESULT validate = RParams.pDevice->CreateInputLayout(
+ SimpleQuadMeshVertexDesc, sizeof(SimpleQuadMeshVertexDesc) / sizeof(SimpleQuadMeshVertexDesc[0]),
+ (void*)SimpleQuad_vs, sizeof(SimpleQuad_vs), objRef);
+ OVR_UNUSED(validate);
+
+ SimpleQuadShader = *new ShaderSet;
+ SimpleQuadShader->SetShader(vtxShader);
+
+ Ptr<D3D11::PixelShader> ps = *new D3D11::PixelShader(
+ &RParams,
+ (void*)SimpleQuad_ps, sizeof(SimpleQuad_ps),
+ SimpleQuad_ps_refl, sizeof(SimpleQuad_ps_refl) / sizeof(SimpleQuad_ps_refl[0]));
+
+ SimpleQuadShader->SetShader(ps);
+ }
+}
+
+
+
+ID3D11SamplerState* DistortionRenderer::getSamplerState(int sm)
+{
+ if (SamplerStates[sm])
+ return SamplerStates[sm];
+
+ D3D11_SAMPLER_DESC ss;
+ memset(&ss, 0, sizeof(ss));
+ switch(sm & Sample_AddressMask)
+ {
+ case Sample_Clamp: ss.AddressU = ss.AddressV = ss.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; break;
+ case Sample_ClampBorder: ss.AddressU = ss.AddressV = ss.AddressW = D3D11_TEXTURE_ADDRESS_BORDER; break;
+ case Sample_Repeat: ss.AddressU = ss.AddressV = ss.AddressW = D3D11_TEXTURE_ADDRESS_WRAP; break;
+ case Sample_Mirror: ss.AddressU = ss.AddressV = ss.AddressW = D3D11_TEXTURE_ADDRESS_MIRROR; break;
+ default: OVR_ASSERT(false);
+ }
+
+ switch(sm & Sample_FilterMask)
+ {
+ case Sample_Linear:
+ ss.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
+ break;
+
+ case Sample_Nearest:
+ ss.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT;
+ break;
+
+ case Sample_Anisotropic:
+ ss.Filter = D3D11_FILTER_ANISOTROPIC;
+ ss.MaxAnisotropy = 4;
+ break;
+
+ default: OVR_ASSERT(false);
+ }
+
+ ss.MaxLOD = 15;
+ RParams.pDevice->CreateSamplerState(&ss, &SamplerStates[sm].GetRawRef());
+ return SamplerStates[sm];
+}
+
+
+void DistortionRenderer::destroy()
+{
+ for (int eyeNum = 0; eyeNum < 2; eyeNum++)
+ {
+ DistortionMeshVBs[eyeNum].Clear();
+ DistortionMeshIBs[eyeNum].Clear();
+ DistortionPinBuffer[eyeNum].Clear();
+ }
+
+ DistortionVertexIL.Clear();
+
+ if (DistortionShader)
+ {
+ DistortionShader->UnsetShader(Shader_Vertex);
+ DistortionShader->UnsetShader(Shader_Pixel);
+ DistortionShader->UnsetShader(Shader_Compute);
+ DistortionShader.Clear();
+ }
+
+ LatencyTesterQuadVB.Clear();
+}
+
+
+DistortionRenderer::GraphicsState::GraphicsState(ID3D11DeviceContext* c)
+ : context(c)
+ , memoryCleared(TRUE)
+ , rasterizerState(NULL)
+ //samplerStates[]
+ , inputLayoutState(NULL)
+ //psShaderResourceState[]
+ //vsShaderResourceState[]
+ //psConstantBuffersState[]
+ //vsConstantBuffersState[]
+ //renderTargetViewState[]
+ , depthStencilViewState(NULL)
+ , omBlendState(NULL)
+ //omBlendFactorState[]
+ , omSampleMaskState(0xffffffff)
+ , primitiveTopologyState(D3D_PRIMITIVE_TOPOLOGY_UNDEFINED)
+ , iaIndexBufferPointerState(NULL)
+ , iaIndexBufferFormatState(DXGI_FORMAT_UNKNOWN)
+ , iaIndexBufferOffsetState(0)
+ //iaVertexBufferPointersState[]
+ //iaVertexBufferStridesState[]
+ //iaVertexBufferOffsetsState[]
+ , currentPixelShader(NULL)
+ , currentVertexShader(NULL)
+ , currentGeometryShader(NULL)
+ , currentHullShader(NULL)
+ , currentDomainShader(NULL)
+ , currentComputeShader(NULL)
+{
+ for (int i = 0; i < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
+ {
+ psSamplerStates[i] = NULL;
+ vsSamplerStates[i] = NULL;
+ csSamplerStates[i] = NULL;
+ }
+
+ for (int i = 0; i < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; i++)
+ {
+ psShaderResourceState[i] = NULL;
+ vsShaderResourceState[i] = NULL;
+ csShaderResourceState[i] = NULL;
+ }
+
+ for (int i = 0; i < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; i++)
+ {
+ psConstantBuffersState[i] = NULL;
+ vsConstantBuffersState[i] = NULL;
+ csConstantBuffersState[i] = NULL;
+ }
+
+ for (int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
+ {
+ renderTargetViewState[i] = NULL;
+ csUnorderedAccessViewState[i] = NULL;
+ }
+
+ for (int i = 0; i < 4; i++)
+ omBlendFactorState[i] = NULL;
+
+ for (int i = 0; i < D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; i++)
+ {
+ iaVertexBufferPointersState[i] = NULL;
+ iaVertexBufferStridesState[i] = NULL;
+ iaVertexBufferOffsetsState[i] = NULL;
+ }
+}
+
+#define SAFE_RELEASE(x) if ( (x) != NULL ) { (x)->Release(); (x)=NULL; }
+
+void DistortionRenderer::GraphicsState::clearMemory()
+{
+ SAFE_RELEASE(rasterizerState);
+
+ for (int i = 0; i < D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
+ {
+ SAFE_RELEASE(psSamplerStates[i]);
+ SAFE_RELEASE(vsSamplerStates[i]);
+ SAFE_RELEASE(csSamplerStates[i]);
+ }
+
+ SAFE_RELEASE(inputLayoutState);
+
+ for (int i = 0; i < D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; i++)
+ {
+ SAFE_RELEASE(psShaderResourceState[i]);
+ SAFE_RELEASE(vsShaderResourceState[i]);
+ SAFE_RELEASE(csShaderResourceState[i]);
+ }
+
+ for (int i = 0; i < D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; i++)
+ {
+ SAFE_RELEASE(psConstantBuffersState[i]);
+ SAFE_RELEASE(vsConstantBuffersState[i]);
+ SAFE_RELEASE(csConstantBuffersState[i]);
+ }
+
+ for (int i = 0; i < D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
+ {
+ SAFE_RELEASE(renderTargetViewState[i]);
+ SAFE_RELEASE(csUnorderedAccessViewState[i]);
+ }
+
+ SAFE_RELEASE(depthStencilViewState);
+ SAFE_RELEASE(omBlendState);
+ SAFE_RELEASE(iaIndexBufferPointerState);
+
+ for (int i = 0; i < D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; i++)
+ {
+ SAFE_RELEASE(iaVertexBufferPointersState[i]);
+ }
+
+ SAFE_RELEASE(currentPixelShader);
+ SAFE_RELEASE(currentVertexShader);
+ SAFE_RELEASE(currentGeometryShader);
+
+ SAFE_RELEASE(currentHullShader);
+ SAFE_RELEASE(currentDomainShader);
+ SAFE_RELEASE(currentComputeShader);
+
+ memoryCleared = TRUE;
+}
+
+#undef SAFE_RELEASE
+
+DistortionRenderer::GraphicsState::~GraphicsState()
+{
+ clearMemory();
+}
+
+
+void DistortionRenderer::GraphicsState::Save()
+{
+ if (!memoryCleared)
+ clearMemory();
+
+ memoryCleared = FALSE;
+
+ context->RSGetState(&rasterizerState);
+ context->IAGetInputLayout(&inputLayoutState);
+
+ context->PSGetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, psShaderResourceState);
+ context->PSGetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, psSamplerStates);
+ context->PSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, psConstantBuffersState);
+
+ context->VSGetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, vsShaderResourceState);
+ context->VSGetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, vsSamplerStates);
+ context->VSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, vsConstantBuffersState);
+
+ context->CSGetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, csShaderResourceState);
+ context->CSGetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, csSamplerStates);
+ context->CSGetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, csConstantBuffersState);
+ context->CSGetUnorderedAccessViews(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, csUnorderedAccessViewState);
+
+ context->OMGetRenderTargets(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, renderTargetViewState, &depthStencilViewState);
+
+ context->OMGetBlendState(&omBlendState, omBlendFactorState, &omSampleMaskState);
+
+ context->IAGetPrimitiveTopology(&primitiveTopologyState);
+
+ context->IAGetIndexBuffer(&iaIndexBufferPointerState, &iaIndexBufferFormatState, &iaIndexBufferOffsetState);
+
+ context->IAGetVertexBuffers(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, iaVertexBufferPointersState, iaVertexBufferStridesState, iaVertexBufferOffsetsState);
+
+ context->PSGetShader(&currentPixelShader, NULL, NULL);
+ context->VSGetShader(&currentVertexShader, NULL, NULL);
+ context->GSGetShader(&currentGeometryShader, NULL, NULL);
+ context->HSGetShader(&currentHullShader, NULL, NULL);
+ context->DSGetShader(&currentDomainShader, NULL, NULL);
+ context->CSGetShader(&currentComputeShader, NULL, NULL);
+ /* maybe above doesn't work; then do something with this (must test on dx11)
+ ID3D11ClassInstance* blank_array[0];
+ UINT blank_uint = 0;
+ context->PSGetShader(&currentPixelShader, blank_array, blank_uint);
+ context->VSGetShader(&currentVertexShader, blank_array, blank_uint);
+ context->GSGetShader(&currentGeometryShader, blank_array, blank_uint);
+ context->HSGetShader(&currentHullShader, blank_array, blank_uint);
+ context->DSGetShader(&currentDomainShader, blank_array, blank_uint);
+ context->CSGetShader(&currentComputeShader, blank_array, blank_uint);
+ */
+}
+
+
+void DistortionRenderer::GraphicsState::Restore()
+{
+ if (rasterizerState != NULL)
+ context->RSSetState(rasterizerState);
+
+ if (inputLayoutState != NULL)
+ context->IASetInputLayout(inputLayoutState);
+
+ context->PSSetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, psSamplerStates);
+ if (psShaderResourceState != NULL)
+ context->PSSetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, psShaderResourceState);
+ if (psConstantBuffersState != NULL)
+ context->PSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, psConstantBuffersState);
+
+ context->VSSetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, vsSamplerStates);
+ if (vsShaderResourceState != NULL)
+ context->VSSetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, vsShaderResourceState);
+ if (vsConstantBuffersState != NULL)
+ context->VSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, vsConstantBuffersState);
+
+ context->CSSetSamplers(0, D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT, csSamplerStates);
+ if (csShaderResourceState != NULL)
+ context->CSSetShaderResources(0, D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, csShaderResourceState);
+ if (csConstantBuffersState != NULL)
+ context->CSSetConstantBuffers(0, D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, csConstantBuffersState);
+ if (csUnorderedAccessViewState != NULL)
+ context->CSSetUnorderedAccessViews(0, D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, csUnorderedAccessViewState, NULL);
+
+ if (depthStencilViewState != NULL || renderTargetViewState != NULL)
+ context->OMSetRenderTargets(D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT, renderTargetViewState, depthStencilViewState);
+
+ if (omBlendState != NULL)
+ context->OMSetBlendState(omBlendState, omBlendFactorState, omSampleMaskState);
+
+ context->IASetPrimitiveTopology(primitiveTopologyState);
+
+ if (iaIndexBufferPointerState != NULL)
+ context->IASetIndexBuffer(iaIndexBufferPointerState, iaIndexBufferFormatState, iaIndexBufferOffsetState);
+
+ if (iaVertexBufferPointersState != NULL)
+ context->IASetVertexBuffers(0, D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, iaVertexBufferPointersState, iaVertexBufferStridesState, iaVertexBufferOffsetsState);
+
+ if (currentPixelShader != NULL)
+ context->PSSetShader(currentPixelShader, NULL, 0);
+ if (currentVertexShader != NULL)
+ context->VSSetShader(currentVertexShader, NULL, 0);
+ if (currentGeometryShader != NULL)
+ context->GSSetShader(currentGeometryShader, NULL, 0);
+ if (currentHullShader != NULL)
+ context->HSSetShader(currentHullShader, NULL, 0);
+ if (currentDomainShader != NULL)
+ context->DSSetShader(currentDomainShader, NULL, 0);
+ if (currentComputeShader != NULL)
+ context->CSSetShader(currentComputeShader, NULL, 0);
+
+ clearMemory();
+}
+
+}}} // OVR::CAPI::D3D11
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.h
index 0216232..4282074 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.h
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_DistortionRenderer.h
@@ -1,34 +1,206 @@
-/************************************************************************************
-
-Filename : CAPI_D3D11_DistortionRenderer.h
-Content : Distortion renderer header for D3D11
-Created : November 11, 2013
-Authors : Michael Antonov
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 INC_CAPI_D3D11_DistortionRenderer_h
-#define INC_CAPI_D3D11_DistortionRenderer_h
-
-#define OVR_D3D_VERSION 11
-#include "CAPI_D3D1X_DistortionRenderer.h"
-#undef OVR_D3D_VERSION
-
-#endif
+/************************************************************************************
+
+Filename : CAPI_D3D11_DistortionRenderer.h
+Content : Experimental distortion renderer
+Created : November 11, 2013
+Authors : Volga Aksoy
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 OVR_CAPI_D3D11_DistortionRenderer_h
+#define OVR_CAPI_D3D11_DistortionRenderer_h
+
+#include "CAPI_D3D11_Util.h"
+#include "../CAPI_DistortionRenderer.h"
+
+#include "Kernel/OVR_Log.h"
+
+namespace OVR { namespace CAPI { namespace D3D11 {
+
+
+// ***** D3D11::DistortionRenderer
+
+// Implementation of DistortionRenderer for D3D11.
+
+class DistortionRenderer : public CAPI::DistortionRenderer
+{
+public:
+ DistortionRenderer();
+ ~DistortionRenderer();
+
+
+ // Creation function for the device.
+ static CAPI::DistortionRenderer* Create();
+
+
+ // ***** Public DistortionRenderer interface
+
+ virtual void SubmitEye(int eyeId, const ovrTexture* eyeTexture) OVR_OVERRIDE;
+ virtual void SubmitEyeWithDepth(int eyeId, const ovrTexture* eyeColorTexture, const ovrTexture* eyeDepthTexture) OVR_OVERRIDE;
+
+ virtual void EndFrame(uint32_t frameIndex, bool swapBuffers);
+
+ // TBD: Make public?
+ void WaitUntilGpuIdle();
+
+ // Similar to ovr_WaitTillTime but it also flushes GPU.
+ // Note, it exits when time expires, even if GPU is not in idle state yet.
+ double FlushGpuAndWaitTillTime(double absTime);
+
+protected:
+ virtual bool initializeRenderer(const ovrRenderAPIConfig* apiConfig) OVR_OVERRIDE;
+
+ class GraphicsState : public CAPI::DistortionRenderer::GraphicsState
+ {
+ public:
+ GraphicsState(ID3D11DeviceContext* context);
+ virtual ~GraphicsState();
+ virtual void clearMemory();
+ virtual void Save();
+ virtual void Restore();
+
+ protected:
+ ID3D11DeviceContext* context;
+ BOOL memoryCleared;
+
+ ID3D11RasterizerState* rasterizerState;
+ ID3D11InputLayout* inputLayoutState;
+
+ ID3D11ShaderResourceView* psShaderResourceState[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
+ ID3D11SamplerState* psSamplerStates[D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT];
+ ID3D11Buffer* psConstantBuffersState[D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
+
+ ID3D11ShaderResourceView* vsShaderResourceState[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
+ ID3D11SamplerState* vsSamplerStates[D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT];
+ ID3D11Buffer* vsConstantBuffersState[D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
+
+ ID3D11ShaderResourceView* csShaderResourceState[D3D11_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
+ ID3D11SamplerState* csSamplerStates[D3D11_COMMONSHADER_SAMPLER_SLOT_COUNT];
+ ID3D11Buffer* csConstantBuffersState[D3D11_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
+ ID3D11UnorderedAccessView* csUnorderedAccessViewState[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT];
+
+ ID3D11RenderTargetView* renderTargetViewState[D3D11_SIMULTANEOUS_RENDER_TARGET_COUNT];
+ ID3D11DepthStencilView* depthStencilViewState;
+
+ ID3D11BlendState* omBlendState;
+ FLOAT omBlendFactorState[4];
+ UINT omSampleMaskState;
+
+ D3D11_PRIMITIVE_TOPOLOGY primitiveTopologyState;
+
+ ID3D11Buffer* iaIndexBufferPointerState;
+ DXGI_FORMAT iaIndexBufferFormatState;
+ UINT iaIndexBufferOffsetState;
+
+ ID3D11Buffer* iaVertexBufferPointersState[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ UINT iaVertexBufferStridesState[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+ UINT iaVertexBufferOffsetsState[D3D11_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
+
+ ID3D11PixelShader* currentPixelShader;
+ ID3D11VertexShader* currentVertexShader;
+ ID3D11GeometryShader* currentGeometryShader;
+ ID3D11HullShader* currentHullShader;
+ ID3D11DomainShader* currentDomainShader;
+ ID3D11ComputeShader* currentComputeShader;
+ };
+
+private:
+ // Helpers
+ bool initBuffersAndShaders();
+ void initShaders();
+ void initFullscreenQuad();
+ void initOverdrive();
+ void destroy();
+
+ void setViewport(const Recti& vp);
+
+ void renderDistortion();
+
+ void renderPrimitives(const ShaderFill* fill, Buffer* vertices, Buffer* indices,
+ Matrix4f* viewMatrix, int offset, int count,
+ PrimitiveType rprim);
+
+ void renderEndFrame();
+
+ void createDrawQuad();
+ void renderLatencyQuad(unsigned char* latencyTesterDrawColor);
+ void renderLatencyPixel(unsigned char* latencyTesterPixelColor);
+
+ // Attempt to use DXGI GetFrameStatistics for getting a previous vsync
+ // Returns 0 if no Vsync timing information is available.
+ double getDXGILastVsyncTime();
+
+ // Create or get cached D3D sampler based on flags.
+ ID3D11SamplerState* getSamplerState(int sm);
+
+
+ //// TBD: Should we be using oe from RState instead?
+ //unsigned DistortionCaps;
+
+ // Back buffer is properly set as an SRGB format?
+ bool SrgbBackBuffer;
+
+ // Failures retrieving the frame index from renderer
+ int FrameIndexFailureCount;
+ static const int FrameIndexFailureLimit = 5; // After a few failures stop trying.
+
+ // D3DX device and utility variables.
+ RenderParams RParams;
+ Ptr<Texture> pEyeTextures[2];
+ Ptr<Texture> pEyeDepthTextures[2];
+
+ // U,V scale and offset needed for timewarp.
+ ovrVector2f UVScaleOffset[2][2];
+ ovrSizei EyeTextureSize[2];
+ ovrRecti EyeRenderViewport[2];
+
+ Ptr<Texture> pOverdriveTextures[NumOverdriveTextures];
+ Ptr<Texture> OverdriveLutTexture;
+
+ //Ptr<Buffer> mpFullScreenVertexBuffer;
+
+ Ptr<Buffer> DistortionMeshVBs[2]; // one per-eye
+ Ptr<Buffer> DistortionMeshIBs[2]; // one per-eye
+ Ptr<Buffer> DistortionPinBuffer[2]; // one per-eye
+
+ Ptr<ShaderSet> DistortionShader;
+ Ptr<ID3D11InputLayout> DistortionVertexIL;
+
+ struct StandardUniformData
+ {
+ Matrix4f Proj;
+ Matrix4f View;
+ } StdUniforms;
+ Ptr<Buffer> UniformBuffers[Shader_Count];
+
+ Ptr<ID3D11SamplerState> SamplerStates[Sample_Count];
+ Ptr<ID3D11RasterizerState> Rasterizer;
+
+ Ptr<Buffer> LatencyTesterQuadVB;
+ Ptr<ShaderSet> SimpleQuadShader;
+ Ptr<ID3D11InputLayout> SimpleQuadVertexIL;
+
+ GpuTimer GpuProfiler;
+ Hash<ID3D11Texture2D*, Ptr<ID3D11RenderTargetView>> RenderTargetMap;
+};
+
+}}} // OVR::CAPI::D3D11
+
+#endif // OVR_CAPI_D3D11_DistortionRenderer_h
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.cpp
index 2177815..44479cb 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.cpp
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.cpp
@@ -1,35 +1,532 @@
-/************************************************************************************
-
-Filename : CAPI_D3D11_HSWDisplay.cpp
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-#define OVR_D3D_VERSION 11
-#include "CAPI_D3D1X_HSWDisplay.cpp"
-#undef OVR_D3D_VERSION
-
-
-
-
-
-
+/************************************************************************************
+
+Filename : CAPI_D3D11_HSWDisplay.cpp
+Content : Implements Health and Safety Warning system.
+Created : July 7, 2014
+Authors : Paul Pedriana
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 "Util/Util_Direct3D.h"
+#include "OVR_CAPI_D3D.h"
+#include "CAPI_D3D11_HSWDisplay.h"
+#include "Kernel/OVR_File.h"
+#include "Kernel/OVR_SysFile.h"
+#include "Kernel/OVR_Allocator.h"
+#include "Kernel/OVR_Color.h"
+#include "Extras/OVR_Math.h"
+
+// We currently borrow the SimpleQuad shaders
+#include "Shaders/SimpleTexturedQuad_vs.h"
+#include "Shaders/SimpleTexturedQuad_ps.h"
+
+// For a given DXGI format: if the format is a typeless one then this function returns a
+// suitable typed one. If the format is a typed one then this function returns it as-is.
+static DXGI_FORMAT GetFullyTypedDXGIFormat(DXGI_FORMAT textureFormat)
+{
+ // http://msdn.microsoft.com/en-us/library/windows/desktop/bb173059%28v=vs.85%29.aspx
+
+ DXGI_FORMAT fullyTypedFormat = textureFormat;
+
+ switch (textureFormat)
+ {
+ case DXGI_FORMAT_R32G32B32A32_TYPELESS:
+ return DXGI_FORMAT_R32G32B32A32_FLOAT; // or DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_SINT
+
+ case DXGI_FORMAT_R32G32B32_TYPELESS:
+ return DXGI_FORMAT_R32G32B32_FLOAT; // or DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_SINT
+
+ case DXGI_FORMAT_R16G16B16A16_TYPELESS:
+ return DXGI_FORMAT_R16G16B16A16_UNORM; // or DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SINT
+
+ case DXGI_FORMAT_R8G8B8A8_TYPELESS:
+ return DXGI_FORMAT_R8G8B8A8_UNORM; // or DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SINT
+
+ case DXGI_FORMAT_B8G8R8A8_TYPELESS:
+ return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
+
+ case DXGI_FORMAT_B8G8R8X8_TYPELESS:
+ return DXGI_FORMAT_B8G8R8X8_UNORM_SRGB;
+
+ // Others which we don't currently support:
+ //case DXGI_FORMAT_R32G32_TYPELESS:
+ //case DXGI_FORMAT_R32G8X24_TYPELESS:
+ //case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
+ //case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
+ //case DXGI_FORMAT_R10G10B10A2_TYPELESS:
+ //case DXGI_FORMAT_R16G16_TYPELESS:
+ //case DXGI_FORMAT_R32_TYPELESS:
+ //case DXGI_FORMAT_R24G8_TYPELESS:
+ //case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
+ //case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
+ //case DXGI_FORMAT_R8G8_TYPELESS:
+ //case DXGI_FORMAT_R16_TYPELESS:
+ //case DXGI_FORMAT_R8_TYPELESS:
+ //case DXGI_FORMAT_BC1_TYPELESS:
+ //case DXGI_FORMAT_BC2_TYPELESS:
+ //case DXGI_FORMAT_BC3_TYPELESS:
+ //case DXGI_FORMAT_BC4_TYPELESS:
+ //case DXGI_FORMAT_BC5_TYPELESS:
+ //case DXGI_FORMAT_BC6H_TYPELESS:
+ //case DXGI_FORMAT_BC7_TYPELESS:
+ }
+
+ return fullyTypedFormat;
+}
+
+
+
+namespace OVR { namespace CAPI {
+
+// To do Need to move LoadTextureTgaData to a shared location.
+uint8_t* LoadTextureTgaData(OVR::File* f, uint8_t alpha, int& width, int& height);
+
+namespace D3D11 {
+
+// This is a temporary function implementation, and it functionality needs to be implemented in a more generic way.
+Texture* LoadTextureTga(RenderParams& rParams, ID3D11SamplerState* pSamplerState, OVR::File* f, uint8_t alpha)
+{
+ Texture* pTexture = NULL;
+
+ int width, height;
+ const uint8_t* pRGBA = LoadTextureTgaData(f, alpha, width, height);
+
+ if (pRGBA)
+ {
+ pTexture = new Texture(&rParams, Texture_RGBA, OVR::Sizei(0, 0), pSamplerState, 1);
+
+ // Create the D3D texture
+ D3D11_TEXTURE2D_DESC dsDesc;
+ dsDesc.Width = width;
+ dsDesc.Height = height;
+ dsDesc.MipLevels = 1;
+ dsDesc.ArraySize = 1;
+ dsDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
+ dsDesc.SampleDesc.Count = 1;
+ dsDesc.SampleDesc.Quality = 0;
+ dsDesc.Usage = D3D11_USAGE_DEFAULT;
+ dsDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ dsDesc.CPUAccessFlags = 0;
+ dsDesc.MiscFlags = 0;
+
+ HRESULT hr = rParams.pDevice->CreateTexture2D(&dsDesc, NULL, &pTexture->Tex.GetRawRef());
+
+ if (SUCCEEDED(hr))
+ {
+ if (dsDesc.BindFlags & D3D11_BIND_SHADER_RESOURCE)
+ rParams.pDevice->CreateShaderResourceView(pTexture->Tex, NULL, &pTexture->TexSv.GetRawRef());
+
+ rParams.pContext->UpdateSubresource(pTexture->Tex, 0, NULL, pRGBA, width * 4, width * height * 4);
+ }
+ else
+ {
+ OVR_DEBUG_LOG_TEXT(("[LoadTextureTga] CreateTexture2D failed"));
+ pTexture->Release();
+ }
+
+ OVR_FREE(const_cast<uint8_t*>(pRGBA));
+ }
+
+ return pTexture;
+}
+
+
+// Loads a texture from a memory image of a TGA file.
+Texture* LoadTextureTga(RenderParams& rParams, ID3D11SamplerState* pSamplerState, const uint8_t* pData, int dataSize, uint8_t alpha)
+{
+ MemoryFile memoryFile("", pData, dataSize);
+
+ return LoadTextureTga(rParams, pSamplerState, &memoryFile, alpha);
+}
+
+
+// Loads a texture from a disk TGA file.
+Texture* LoadTextureTga(RenderParams& rParams, ID3D11SamplerState* pSamplerState, const char* pFilePath, uint8_t alpha)
+{
+ SysFile sysFile;
+
+ if (sysFile.Open(pFilePath, FileConstants::Open_Read | FileConstants::Open_Buffered))
+ return LoadTextureTga(rParams, pSamplerState, &sysFile, alpha);
+
+ return NULL;
+}
+
+
+
+// To do: This needs to be promoted to a central version, possibly in CAPI_HSWDisplay.h
+struct HASWVertex
+{
+ Vector3f Pos;
+ Color C;
+ float U, V;
+
+ HASWVertex(const Vector3f& p, const Color& c = Color(64, 0, 0, 255), float u = 0, float v = 0)
+ : Pos(p), C(c), U(u), V(v)
+ {}
+
+ HASWVertex(float x, float y, float z, const Color& c = Color(64, 0, 0, 255), float u = 0, float v = 0)
+ : Pos(x, y, z), C(c), U(u), V(v)
+ {}
+
+ bool operator==(const HASWVertex& b) const
+ {
+ return (Pos == b.Pos) && (C == b.C) && (U == b.U) && (V == b.V);
+ }
+};
+
+
+
+// The texture below may conceivably be shared between HSWDisplay instances. However,
+// beware that sharing may not be possible if two HMDs are using different locales
+// simultaneously. As of this writing it's not clear if that can occur in practice.
+
+HSWDisplay::HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState)
+ : OVR::CAPI::HSWDisplay(api, hmd, renderState),
+ RenderParams()
+{
+}
+
+bool HSWDisplay::Initialize(const ovrRenderAPIConfig* apiConfig)
+{
+ const ovrD3D11Config* config = reinterpret_cast<const ovrD3D11Config*>(apiConfig);
+
+ if (config)
+ {
+ RenderParams.pDevice = config->D3D11.pDevice;
+ RenderParams.pContext = config->D3D11.pDeviceContext;
+ RenderParams.pBackBufferUAV = config->D3D11.pBackBufferUAV;
+ RenderParams.pBackBufferRT = config->D3D11.pBackBufferRT;
+ RenderParams.pSwapChain = config->D3D11.pSwapChain;
+ RenderParams.BackBufferSize = config->D3D11.Header.BackBufferSize;
+ RenderParams.Multisample = config->D3D11.Header.Multisample;
+ RenderParams.VidPnTargetId = 0;
+
+ // We may want to create RasterizerState, or alternatively let the DistortionRenderer handle it.
+ }
+ // else do any necessary cleanup
+
+ return true;
+}
+
+void HSWDisplay::Shutdown()
+{
+ UnloadGraphics();
+}
+
+
+void HSWDisplay::DisplayInternal()
+{
+ HSWDISPLAY_LOG(("[HSWDisplay D3D11] DisplayInternal()"));
+ // We may want to call LoadGraphics here instead of within Render.
+}
+
+
+void HSWDisplay::DismissInternal()
+{
+ HSWDISPLAY_LOG(("[HSWDisplay D3D11] DismissInternal()"));
+ UnloadGraphics();
+}
+
+
+void HSWDisplay::UnloadGraphics()
+{
+ //RenderParams: nothing to do.
+ pSamplerState.Clear();
+ pTexture.Clear();
+ pVB.Clear();
+ for (size_t i = 0; i < OVR_ARRAY_COUNT(UniformBufferArray); i++)
+ UniformBufferArray[i].Clear();
+ pShaderSet.Clear();
+ pVertexInputLayout.Clear();
+ pBlendState.Clear();
+ pRasterizerState.Clear();
+ // OrthoProjection: No need to clear.
+}
+
+void HSWDisplay::LoadGraphics()
+{
+ // Load the graphics if not loaded already.
+ if (!pSamplerState)
+ {
+ D3D11_SAMPLER_DESC sDesc;
+
+ memset(&sDesc, 0, sizeof(sDesc));
+ sDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_LINEAR;
+ sDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP;
+ sDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP;
+ sDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP;
+
+ RenderParams.pDevice->CreateSamplerState(&sDesc, &pSamplerState.GetRawRef());
+ }
+
+#if defined(OVR_BUILD_DEBUG)
+ if (!pTexture)
+ pTexture = *LoadTextureTga(RenderParams, pSamplerState, "C:\\TestPath\\TestFile.tga", 255);
+#endif
+
+ if (!pTexture) // To do: Add support for .dds files, which would be significantly smaller than the size of the tga.
+ {
+ size_t textureSize;
+ const uint8_t* TextureData = GetDefaultTexture(textureSize);
+ pTexture = *LoadTextureTga(RenderParams, pSamplerState, TextureData, (int)textureSize, 255);
+ }
+
+ if (!UniformBufferArray[0])
+ {
+ for (size_t i = 0; i < OVR_ARRAY_COUNT(UniformBufferArray); i++)
+ UniformBufferArray[i] = *new Buffer(&RenderParams);
+ }
+
+ if (!pShaderSet)
+ {
+ pShaderSet = *new ShaderSet;
+
+ // Setup the vertex shader
+ const D3D11_INPUT_ELEMENT_DESC VertexDescription[] = {
+ { "Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(HASWVertex, Pos), D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "Color", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, offsetof(HASWVertex, C), D3D11_INPUT_PER_VERTEX_DATA, 0 },
+ { "TexCoord", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(HASWVertex, U), D3D11_INPUT_PER_VERTEX_DATA, 0 }
+ };
+
+ Ptr<VertexShader> vs = *new VertexShader(&RenderParams, (void*)SimpleTexturedQuad_vs, sizeof(SimpleTexturedQuad_vs), SimpleTexturedQuad_vs_refl, OVR_ARRAY_COUNT(SimpleTexturedQuad_vs_refl));
+ pVertexInputLayout = NULL; // Make sure it's cleared in case it wasn't.
+ ID3D11InputLayout** ppD3DInputLayout = &pVertexInputLayout.GetRawRef();
+ HRESULT hResult = RenderParams.pDevice->CreateInputLayout(VertexDescription, OVR_ARRAY_COUNT(VertexDescription), SimpleTexturedQuad_vs, sizeof(SimpleTexturedQuad_vs), ppD3DInputLayout);
+ OVR_ASSERT(SUCCEEDED(hResult));
+ if (SUCCEEDED(hResult))
+ pShaderSet->SetShader(vs);
+
+ // Setup the pixel shader
+ Ptr<PixelShader> ps = *new PixelShader(&RenderParams, (void*)SimpleTexturedQuad_ps, sizeof(SimpleTexturedQuad_ps), SimpleTexturedQuad_ps_refl, OVR_ARRAY_COUNT(SimpleTexturedQuad_ps_refl));
+ pShaderSet->SetShader(ps);
+
+ if (!pBlendState)
+ {
+ D3D11_BLEND_DESC bm;
+ memset(&bm, 0, sizeof(bm));
+ bm.RenderTarget[0].BlendEnable = TRUE;
+ bm.RenderTarget[0].BlendOp = bm.RenderTarget[0].BlendOpAlpha = D3D11_BLEND_OP_ADD;
+ bm.RenderTarget[0].SrcBlend = bm.RenderTarget[0].SrcBlendAlpha = D3D11_BLEND_SRC_ALPHA;
+ bm.RenderTarget[0].DestBlend = bm.RenderTarget[0].DestBlendAlpha = D3D11_BLEND_INV_SRC_ALPHA;
+ bm.RenderTarget[0].RenderTargetWriteMask = D3D11_COLOR_WRITE_ENABLE_ALL;
+
+ RenderParams.pDevice->CreateBlendState(&bm, &pBlendState.GetRawRef());
+ }
+
+ if (!pRasterizerState)
+ {
+ D3D11_RASTERIZER_DESC rs;
+ memset(&rs, 0, sizeof(rs));
+ rs.AntialiasedLineEnable = true;
+ rs.CullMode = D3D11_CULL_BACK;
+ rs.DepthClipEnable = true;
+ rs.FillMode = D3D11_FILL_SOLID;
+
+ RenderParams.pDevice->CreateRasterizerState(&rs, &pRasterizerState.GetRawRef());
+ }
+ }
+
+ if (!pVB)
+ {
+ pVB = *new Buffer(&RenderParams);
+
+ if (pVB)
+ {
+ const size_t vertexCount = 4;
+
+ pVB->Data(Buffer_Vertex, NULL, vertexCount * sizeof(HASWVertex));
+ HASWVertex* pVertices = (HASWVertex*)pVB->Map(0, vertexCount * sizeof(HASWVertex), Map_Discard);
+ OVR_ASSERT(pVertices);
+
+ if (pVertices)
+ {
+ const bool flip = ((RenderState.DistortionCaps & ovrDistortionCap_FlipInput) != 0);
+ const float left = -1.0f; // We currently draw this in normalized device coordinates with an stereo translation
+ const float top = -1.1f; // applied as a vertex shader uniform. In the future when we have a more formal graphics
+ const float right = 1.0f; // API abstraction we may move this draw to an overlay layer or to a more formal
+ const float bottom = 0.9f; // model/mesh scheme with a perspective projection.
+
+ // See warning in LoadTextureTgaData() about this TGA being loaded "upside down", i.e. UV origin is at bottom-left.
+ pVertices[0] = HASWVertex(left, top, 0.f, Color(255, 255, 255, 255), 0.f, flip ? 1.f : 0.f);
+ pVertices[1] = HASWVertex(left, bottom, 0.f, Color(255, 255, 255, 255), 0.f, flip ? 0.f : 1.f);
+ pVertices[2] = HASWVertex(right, top, 0.f, Color(255, 255, 255, 255), 1.f, flip ? 1.f : 0.f);
+ pVertices[3] = HASWVertex(right, bottom, 0.f, Color(255, 255, 255, 255), 1.f, flip ? 0.f : 1.f);
+
+ pVB->Unmap(pVertices);
+ }
+ }
+ }
+}
+
+
+// Note: If we are drawing this warning onto the eye texture before distortion, the "time warp" functionality
+// will cause the warning to shake on the screen when the user moves their head. One solution is to disable
+// time warping while the warning or any screen-static GUI elements are present.
+
+void HSWDisplay::RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture)
+{
+ if (RenderEnabled && eyeTexture)
+ {
+ // We need to render to the eyeTexture with the texture viewport.
+ // Setup rendering to the texture.
+ ovrD3D11Texture* eyeTextureD3D = const_cast<ovrD3D11Texture*>(reinterpret_cast<const ovrD3D11Texture*>(eyeTexture));
+ OVR_ASSERT(eyeTextureD3D->Texture.Header.API == ovrRenderAPI_D3D11);
+
+ // Load the graphics if not loaded already.
+ if (!pVB)
+ LoadGraphics();
+
+ // Calculate ortho projection.
+ GetOrthoProjection(RenderState, OrthoProjection);
+
+ // Save settings
+ // To do: Merge this saved state with that done by DistortionRenderer::GraphicsState::Save(), and put them in a shared location.
+ Ptr<ID3D11BlendState> pBlendStateSaved;
+ FLOAT blendFactorSaved[4];
+ UINT blendSampleMaskSaved;
+ RenderParams.pContext->OMGetBlendState(&pBlendStateSaved.GetRawRef(), blendFactorSaved, &blendSampleMaskSaved);
+
+ Ptr<ID3D11RasterizerState> pRasterizerStateSaved;
+ RenderParams.pContext->RSGetState(&pRasterizerStateSaved.GetRawRef());
+
+ Ptr<ID3D11RenderTargetView> pTextureRenderTargetViewSaved;
+ Ptr<ID3D11DepthStencilView> pDepthStencilViewSaved;
+ RenderParams.pContext->OMGetRenderTargets(1, &pTextureRenderTargetViewSaved.GetRawRef(), &pDepthStencilViewSaved.GetRawRef());
+
+ D3D11_VIEWPORT d3dViewportSaved[D3D11_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE];
+ UINT viewportCountSaved = OVR_ARRAY_COUNT(d3dViewportSaved);
+ RenderParams.pContext->RSGetViewports(&viewportCountSaved, d3dViewportSaved);
+
+ UINT stencilRefSaved;
+ Ptr<ID3D11DepthStencilState> pDepthStencilStateSaved;
+ RenderParams.pContext->OMGetDepthStencilState(&pDepthStencilStateSaved.GetRawRef(), &stencilRefSaved);
+
+ Ptr<ID3D11InputLayout> pInputLayoutSaved;
+ RenderParams.pContext->IAGetInputLayout(&pInputLayoutSaved.GetRawRef());
+
+ Ptr<ID3D11Buffer> pVertexBufferSaved;
+ UINT vertexStrideSaved[1];
+ UINT vertexOffsetSaved[1];
+ RenderParams.pContext->IAGetVertexBuffers(0, 1, &pVertexBufferSaved.GetRawRef(), vertexStrideSaved, vertexOffsetSaved);
+
+ D3D11_PRIMITIVE_TOPOLOGY topologySaved;
+ RenderParams.pContext->IAGetPrimitiveTopology(&topologySaved);
+
+
+ // Set our settings
+ RenderParams.pContext->OMSetBlendState(pBlendState, NULL, 0xffffffff);
+ RenderParams.pContext->RSSetState(pRasterizerState);
+
+ // We can't necessarily use a NULL D3D11_RENDER_TARGET_VIEW_DESC argument to CreateRenderTargetView, because we are rendering to
+ // a texture that somebody else created and which may have been created in a typeless format (e.g. DXGI_FORMAT_R8G8B8A8_TYPELESS).
+ // So what we do is check to see if the texture format is a typeless format and if see we pass a suitable D3D11_RENDER_TARGET_VIEW_DESC
+ // to CreateRenderTargetView instead of NULL.
+ D3D11_TEXTURE2D_DESC texture2DDesc;
+ eyeTextureD3D->D3D11.pTexture->GetDesc(&texture2DDesc);
+
+ D3D11_RENDER_TARGET_VIEW_DESC renderTargetViewDesc;
+ memset(&renderTargetViewDesc, 0, sizeof(renderTargetViewDesc));
+ renderTargetViewDesc.Format = GetFullyTypedDXGIFormat(texture2DDesc.Format); // DXGI_FORMAT. If this is a typeless format then GetFullyTypedFormat converts it to a fully typed format.
+ renderTargetViewDesc.ViewDimension = (texture2DDesc.SampleDesc.Count > 1) ? D3D11_RTV_DIMENSION_TEXTURE2DMS : D3D11_RTV_DIMENSION_TEXTURE2D;
+ renderTargetViewDesc.Texture2D.MipSlice = 0;
+ Ptr<ID3D11RenderTargetView> pTextureRenderTargetView;
+ HRESULT hResult = RenderParams.pDevice->CreateRenderTargetView(eyeTextureD3D->D3D11.pTexture, (renderTargetViewDesc.Format == texture2DDesc.Format) ? NULL : &renderTargetViewDesc, &pTextureRenderTargetView.GetRawRef());
+
+ if (SUCCEEDED(hResult))
+ {
+ RenderParams.pContext->OMSetRenderTargets(1, &pTextureRenderTargetView.GetRawRef(), NULL); // We currently don't bind a depth buffer.
+
+ D3D11_VIEWPORT D3DViewport;
+
+ OVR_DISABLE_MSVC_WARNING(4244) // conversion from int to float
+ D3DViewport.TopLeftX = eyeTextureD3D->Texture.Header.RenderViewport.Pos.x;
+ D3DViewport.TopLeftY = eyeTextureD3D->Texture.Header.RenderViewport.Pos.y;
+ D3DViewport.Width = eyeTextureD3D->Texture.Header.RenderViewport.Size.w;
+ D3DViewport.Height = eyeTextureD3D->Texture.Header.RenderViewport.Size.h;
+ D3DViewport.MinDepth = 0;
+ D3DViewport.MaxDepth = 1;
+ RenderParams.pContext->RSSetViewports(1, &D3DViewport);
+ OVR_RESTORE_MSVC_WARNING()
+
+ // We don't set up a world/view/projection matrix because we are using
+ // normalized device coordinates below.
+
+ // We don't set the depth state because we aren't using it.
+ // RenderParams.pContext->OMSetDepthStencilState(<depth state>, 0);
+
+ ShaderFill fill(pShaderSet);
+ fill.SetInputLayout(pVertexInputLayout);
+ if (pTexture)
+ fill.SetTexture(0, pTexture, Shader_Pixel);
+
+ const float scale = HSWDISPLAY_SCALE * ((RenderState.OurHMDInfo.HmdType == HmdType_DK1) ? 0.70f : 1.f);
+ pShaderSet->SetUniform2f("Scale", scale, scale / 2.f); // X and Y scale. Y is a fixed proportion to X in order to give a certain aspect ratio.
+ pShaderSet->SetUniform4f("Color", 1.f, 1.f, 1.f, 1.f);
+ pShaderSet->SetUniform2f("PositionOffset", OrthoProjection[eye].GetTranslation().x, 0.0f);
+
+ RenderParams.pContext->IASetInputLayout((ID3D11InputLayout*)fill.GetInputLayout());
+
+ ID3D11Buffer* vertexBuffer = pVB->GetBuffer();
+ UINT vertexStride = sizeof(HASWVertex);
+ UINT vertexOffset = 0;
+ RenderParams.pContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
+
+ ShaderBase* vShaderBase = (ShaderBase*)pShaderSet->GetShader(OVR::CAPI::D3D11::Shader_Vertex);
+ unsigned char* vertexData = vShaderBase->UniformData;
+
+ if (vertexData)
+ {
+ UniformBufferArray[OVR::CAPI::D3D11::Shader_Vertex]->Data(OVR::CAPI::D3D11::Buffer_Uniform, vertexData, vShaderBase->UniformsSize);
+ vShaderBase->SetUniformBuffer(UniformBufferArray[OVR::CAPI::D3D11::Shader_Vertex]);
+ }
+
+ for (int i = (OVR::CAPI::D3D11::Shader_Vertex + 1); i < OVR::CAPI::D3D11::Shader_Count; i++)
+ {
+ if (pShaderSet->GetShader(i))
+ {
+ ((ShaderBase*)pShaderSet->GetShader(i))->UpdateBuffer(UniformBufferArray[i]);
+ ((ShaderBase*)pShaderSet->GetShader(i))->SetUniformBuffer(UniformBufferArray[i]);
+ }
+ }
+
+ RenderParams.pContext->IASetPrimitiveTopology(D3D11_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
+ fill.Set(Prim_TriangleStrip);
+
+ RenderParams.pContext->Draw(4, 0);
+ }
+ else
+ {
+ HSWDISPLAY_LOG(("[HSWDisplay D3D11] CreateRenderTargetView() failed"));
+ }
+
+
+ // Restore settings
+ RenderParams.pContext->IASetPrimitiveTopology(topologySaved);
+ RenderParams.pContext->IASetVertexBuffers(0, 1, &pVertexBufferSaved.GetRawRef(), &vertexStrideSaved[0], &vertexOffsetSaved[0]);
+ RenderParams.pContext->IASetInputLayout(pInputLayoutSaved);
+ RenderParams.pContext->OMSetDepthStencilState(pDepthStencilStateSaved, stencilRefSaved);
+ RenderParams.pContext->RSSetViewports(viewportCountSaved, d3dViewportSaved);
+ RenderParams.pContext->OMSetRenderTargets(1, &pTextureRenderTargetViewSaved.GetRawRef(), pDepthStencilViewSaved);
+ RenderParams.pContext->RSSetState(pRasterizerStateSaved);
+ RenderParams.pContext->OMSetBlendState(pBlendStateSaved, blendFactorSaved, blendSampleMaskSaved);
+ }
+}
+
+}}} // namespace OVR::CAPI::D3D11
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.h
index ca896b0..f25827b 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.h
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_HSWDisplay.h
@@ -1,41 +1,72 @@
-/************************************************************************************
-
-Filename : CAPI_D3D11_HSWDisplay.h
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 OVR_CAPI_D3D11_HSWDisplay_h
-#define OVR_CAPI_D3D11_HSWDisplay_h
-
-#if !defined(OVR_D3D_VERSION) || ((OVR_D3D_VERSION != 10) && (OVR_D3D_VERSION != 11))
- #error This header expects OVR_D3D_VERSION to be defined, to 10 or 11.
-#endif
-
-// Due to the similarities between DX10 and DX11, there is a shared implementation of the headers and source
-// which is differentiated only by the OVR_D3D_VERSION define. This define causes D3D_NS (D3D namespace) to
-// be defined to either D3D10 or D3D11, as well as other similar effects.
-#include "CAPI_D3D1X_HSWDisplay.h"
-
-
-#endif // OVR_CAPI_D3D11_HSWDisplay_h
-
+/************************************************************************************
+
+Filename : CAPI_D3D11_HSWDisplay.h
+Content : Implements Health and Safety Warning system.
+Created : July 7, 2014
+Authors : Paul Pedriana
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 OVR_CAPI_D3D11_HSWDisplay_h
+#define OVR_CAPI_D3D11_HSWDisplay_h
+
+#include "../CAPI_HSWDisplay.h"
+#include "CAPI_D3D11_Util.h"
+
+namespace OVR { namespace CAPI { namespace D3D11 {
+
+class HSWDisplay : public CAPI::HSWDisplay
+{
+public:
+ HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState);
+
+ // Must be called before use. apiConfig is such that:
+ // const ovrD3D11Config* config = (const ovrD3D11Config*)apiConfig; or
+ bool Initialize(const ovrRenderAPIConfig* apiConfig);
+ void Shutdown();
+ void DisplayInternal();
+ void DismissInternal();
+
+ // Draws the warning to the eye texture(s). This must be done at the end of a
+ // frame but prior to executing the distortion rendering of the eye textures.
+ void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture);
+
+protected:
+ void LoadGraphics();
+ void UnloadGraphics();
+
+ RenderParams RenderParams;
+ Ptr<ID3D11SamplerState> pSamplerState;
+ Ptr<Texture> pTexture;
+ Ptr<Buffer> pVB;
+ Ptr<Buffer> UniformBufferArray[Shader_Count];
+ Ptr<ShaderSet> pShaderSet;
+ Ptr<ID3D11InputLayout> pVertexInputLayout;
+ Ptr<ID3D11BlendState> pBlendState;
+ Ptr<ID3D11RasterizerState> pRasterizerState;
+ Matrix4f OrthoProjection[ovrEye_Count];
+
+private:
+ OVR_NON_COPYABLE(HSWDisplay)
+};
+
+}}} // namespace OVR::CAPI::D3D11
+
+#endif // OVR_CAPI_D3D11_HSWDisplay_h
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.cpp
new file mode 100644
index 0000000..36f1de0
--- /dev/null
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.cpp
@@ -0,0 +1,758 @@
+/************************************************************************************
+
+Filename : CAPI_D3D11_Util.cpp
+Content : D3DX11 utility classes for rendering
+Created : September 10, 2012
+Authors : Andrew Reisse
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 "CAPI_D3D11_Util.h"
+
+namespace OVR { namespace CAPI { namespace D3D11 {
+
+
+//-------------------------------------------------------------------------------------
+// ***** ShaderFill
+
+void ShaderFill::Set(PrimitiveType prim) const
+{
+ Shaders->Set(prim);
+
+ for(int i = 0; i < 8; ++i)
+ {
+ if ( VsTextures[i] != NULL )
+ {
+ VsTextures[i]->Set(i, Shader_Vertex);
+ }
+ }
+
+ for(int i = 0; i < 8; ++i)
+ {
+ if ( CsTextures[i] != NULL )
+ {
+ CsTextures[i]->Set(i, Shader_Compute);
+ }
+ }
+
+ for(int i = 0; i < 8; ++i)
+ {
+ if ( PsTextures[i] != NULL )
+ {
+ PsTextures[i]->Set(i, Shader_Fragment);
+ }
+ }
+}
+
+
+//-------------------------------------------------------------------------------------
+// ***** Buffer
+
+Buffer::~Buffer()
+{
+}
+
+bool Buffer::Data(int use, const void *buffer, size_t size, int computeBufferStride /*=-1*/)
+{
+ HRESULT hr;
+
+ if (D3DBuffer && Size >= size)
+ {
+ if (Dynamic)
+ {
+ if (!buffer)
+ return true;
+
+ void* v = Map(0, size, Map_Discard);
+ if (v)
+ {
+ memcpy(v, buffer, size);
+ Unmap(v);
+ return true;
+ }
+ }
+ else
+ {
+ OVR_ASSERT (!(use & Buffer_ReadOnly));
+ pParams->pContext->UpdateSubresource(D3DBuffer, 0, NULL, buffer, 0, 0);
+ return true;
+ }
+ }
+ if (D3DBuffer)
+ {
+ D3DBuffer = NULL;
+ Size = 0;
+ Use = 0;
+ Dynamic = false;
+ }
+ D3DSrv = NULL;
+ D3DUav = NULL;
+
+ D3D11_BUFFER_DESC desc;
+ memset(&desc, 0, sizeof(desc));
+ if (use & Buffer_ReadOnly)
+ {
+ desc.Usage = D3D11_USAGE_IMMUTABLE;
+ desc.CPUAccessFlags = 0;
+ }
+ else
+ {
+ desc.Usage = D3D11_USAGE_DYNAMIC;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ Dynamic = true;
+ }
+
+ switch(use & Buffer_TypeMask)
+ {
+ case Buffer_Vertex: desc.BindFlags = D3D11_BIND_VERTEX_BUFFER; break;
+ case Buffer_Index: desc.BindFlags = D3D11_BIND_INDEX_BUFFER; break;
+ case Buffer_Uniform:
+ desc.BindFlags = D3D11_BIND_CONSTANT_BUFFER;
+ size = ((size + 15) & ~15);
+ break;
+ case Buffer_Compute:
+ // There's actually a bunch of options for buffers bound to a CS.
+ // Right now this is the most appropriate general-purpose one. Add more as needed.
+
+ // NOTE - if you want D3D11_(CPU_ACCESS_WRITE), it MUST be either D3D11_(USAGE_DYNAMIC) or D3D11_(USAGE_STAGING).
+ // TODO: we want a resource that is rarely written to, in which case we'd need two surfaces - one a STAGING
+ // that the CPU writes to, and one a DEFAULT, and we CopyResource from one to the other. Hassle!
+ // Setting it as D3D11_(USAGE_DYNAMIC) will get the job done for now.
+ // Also for fun - you can't have a D3D11_(USAGE_DYNAMIC) buffer that is also a D3D11_(BIND_UNORDERED_ACCESS).
+ OVR_ASSERT ( !(use & Buffer_ReadOnly) );
+ desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ desc.Usage = D3D11_USAGE_DYNAMIC;
+ desc.MiscFlags = D3D11_RESOURCE_MISC_BUFFER_STRUCTURED;
+ desc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE;
+ OVR_ASSERT ( computeBufferStride > 0 );
+ desc.StructureByteStride = computeBufferStride; // sizeof(DistortionComputePin);
+
+ Dynamic = true;
+ size = ((size + 15) & ~15);
+ break;
+ }
+
+ desc.ByteWidth = (unsigned)size;
+
+ D3D11_SUBRESOURCE_DATA sr;
+ sr.pSysMem = buffer;
+ sr.SysMemPitch = 0;
+ sr.SysMemSlicePitch = 0;
+
+ D3DBuffer = NULL;
+ hr = pParams->pDevice->CreateBuffer(&desc, buffer ? &sr : NULL, &D3DBuffer.GetRawRef());
+ OVR_D3D_CHECK_RET_FALSE(hr);
+
+ Use = 0;
+ Size = 0;
+
+ if ( ( use & Buffer_TypeMask ) == Buffer_Compute )
+ {
+ hr = pParams->pDevice->CreateShaderResourceView ( D3DBuffer, NULL, &D3DSrv.GetRawRef() );
+ OVR_D3D_CHECK_RET_FALSE(hr);
+
+#if 0 // Right now we do NOT ask for UAV access (see flags above).
+ hr = Ren->Device->CreateUnorderedAccessView ( D3DBuffer, NULL, &D3DUav.GetRawRef() );
+ OVR_D3D_CHECK_RET_FALSE(hr);
+#endif
+ }
+
+ Use = use;
+ Size = desc.ByteWidth;
+
+ return true;
+
+}
+
+void* Buffer::Map(size_t start, size_t size, int flags)
+{
+ OVR_UNUSED(size);
+
+ D3D11_MAP mapFlags = D3D11_MAP_WRITE;
+ if (flags & Map_Discard)
+ mapFlags = D3D11_MAP_WRITE_DISCARD;
+ if (flags & Map_Unsynchronized)
+ mapFlags = D3D11_MAP_WRITE_NO_OVERWRITE;
+
+ D3D11_MAPPED_SUBRESOURCE map;
+ if (SUCCEEDED(pParams->pContext->Map(D3DBuffer, 0, mapFlags, 0, &map)))
+ return ((char*)map.pData) + start;
+
+ return NULL;
+}
+
+bool Buffer::Unmap(void *m)
+{
+ OVR_UNUSED(m);
+
+ pParams->pContext->Unmap(D3DBuffer, 0);
+ return true;
+}
+
+
+//-------------------------------------------------------------------------------------
+// Shaders
+
+template<> bool ShaderImpl<Shader_Vertex, ID3D11VertexShader>::Load(void* shader, size_t size)
+{
+ HRESULT hr = pParams->pDevice->CreateVertexShader(shader, size, nullptr, &D3DShader);
+ OVR_D3D_CHECK_RET_FALSE(hr);
+ return true;
+}
+template<> bool ShaderImpl<Shader_Pixel, ID3D11PixelShader>::Load(void* shader, size_t size)
+{
+ HRESULT hr = pParams->pDevice->CreatePixelShader(shader, size, nullptr, &D3DShader);
+ OVR_D3D_CHECK_RET_FALSE(hr);
+ return true;
+}
+template<> bool ShaderImpl<Shader_Compute, ID3D11ComputeShader>::Load(void* shader, size_t size)
+{
+ HRESULT hr = pParams->pDevice->CreateComputeShader(shader, size, nullptr, &D3DShader);
+ OVR_D3D_CHECK_RET_FALSE(hr);
+ return true;
+}
+
+template<> void ShaderImpl<Shader_Vertex, ID3D11VertexShader>::Set(PrimitiveType) const
+{
+ pParams->pContext->VSSetShader(D3DShader, nullptr, 0);
+}
+template<> void ShaderImpl<Shader_Pixel, ID3D11PixelShader>::Set(PrimitiveType) const
+{
+ pParams->pContext->PSSetShader(D3DShader, nullptr, 0);
+}
+template<> void ShaderImpl<Shader_Compute, ID3D11ComputeShader>::Set(PrimitiveType) const
+{
+ pParams->pContext->CSSetShader(D3DShader, nullptr, 0);
+}
+
+template<> void ShaderImpl<Shader_Vertex, ID3D11VertexShader>::SetUniformBuffer(Buffer* buffer, int i)
+{
+ pParams->pContext->VSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
+}
+template<> void ShaderImpl<Shader_Pixel, ID3D11PixelShader>::SetUniformBuffer(Buffer* buffer, int i)
+{
+ pParams->pContext->PSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
+}
+template<> void ShaderImpl<Shader_Compute, ID3D11ComputeShader>::SetUniformBuffer(Buffer* buffer, int i)
+{
+ pParams->pContext->CSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
+}
+
+//-------------------------------------------------------------------------------------
+// ***** Shader Base
+
+ShaderBase::ShaderBase(RenderParams* rp, ShaderStage stage) :
+ Shader(stage),
+ pParams(rp),
+ UniformData(NULL),
+ UniformsSize(0),
+ UniformRefl(NULL),
+ UniformReflSize(0)
+{
+}
+
+ShaderBase::~ShaderBase()
+{
+ if (UniformData)
+ {
+ OVR_FREE(UniformData);
+ UniformData = NULL;
+ }
+
+ // UniformRefl does not need to be freed
+ UniformRefl = NULL;
+}
+
+bool ShaderBase::SetUniform(const char* name, int n, const float* v)
+{
+ for(unsigned i = 0; i < UniformReflSize; i++)
+ {
+ if (!strcmp(UniformRefl[i].Name, name))
+ {
+ memcpy(UniformData + UniformRefl[i].Offset, v, n * sizeof(float));
+ return 1;
+ }
+ }
+ return 0;
+}
+
+bool ShaderBase::SetUniformBool(const char* name, int n, const bool* v)
+{
+ OVR_UNUSED(n);
+ for(unsigned i = 0; i < UniformReflSize; i++)
+ {
+ if (!strcmp(UniformRefl[i].Name, name))
+ {
+ memcpy(UniformData + UniformRefl[i].Offset, v, UniformRefl[i].Size);
+ return 1;
+ }
+ }
+ return 0;
+}
+
+void ShaderBase::InitUniforms(const Uniform* refl, size_t reflSize)
+{
+ UniformsSize = 0;
+ if (UniformData)
+ {
+ OVR_FREE(UniformData);
+ UniformData = 0;
+ }
+
+ if (!refl)
+ {
+ UniformRefl = NULL;
+ UniformReflSize = 0;
+ return; // no reflection data
+ }
+
+ UniformRefl = refl;
+ UniformReflSize = reflSize;
+
+ UniformsSize = UniformRefl[UniformReflSize-1].Offset + UniformRefl[UniformReflSize-1].Size;
+ UniformData = (unsigned char*)OVR_ALLOC(UniformsSize);
+}
+
+void ShaderBase::UpdateBuffer(Buffer* buf)
+{
+ if (UniformsSize)
+ {
+ buf->Data(Buffer_Uniform, UniformData, UniformsSize);
+ }
+}
+
+
+//-------------------------------------------------------------------------------------
+// ***** Texture
+//
+Texture::Texture(RenderParams* rp, int fmt, const Sizei texSize,
+ ID3D11SamplerState* sampler, int samples)
+ : pParams(rp), Tex(NULL), TexSv(NULL), TexRtv(NULL), TexDsv(NULL),
+ TextureSize(texSize),
+ Sampler(sampler),
+ Samples(samples)
+{
+ OVR_UNUSED(fmt);
+}
+
+
+Texture::Texture(RenderParams* rp, int format, const Sizei texSize,
+ ID3D11SamplerState* sampler, const void* data, int mipcount)
+ : pParams(rp), Tex(NULL), TexSv(NULL), TexRtv(NULL), TexDsv(NULL),
+ TextureSize(texSize),
+ Sampler(sampler),
+ Samples(1)
+{
+ OVR_ASSERT(rp->pDevice != NULL);
+
+ OVR_UNUSED(mipcount);
+
+ //if (format == Texture_DXT1 || format == Texture_DXT3 || format == Texture_DXT5)
+ //{
+ // int convertedFormat;
+ // switch (format)
+ // {
+ // case Texture_DXT1: convertedFormat = DXGI_FORMAT_BC1_UNORM; break;
+ // case Texture_DXT3: convertedFormat = DXGI_FORMAT_BC2_UNORM; break;
+ // case Texture_DXT5:
+ // default: convertedFormat = DXGI_FORMAT_BC3_UNORM; break;
+ // }
+ // unsigned largestMipWidth = 0;
+ // unsigned largestMipHeight = 0;
+ // unsigned effectiveMipCount = mipcount;
+ // unsigned textureSize = 0;
+
+ // D3D11_SUBRESOURCE_DATA* subresData =
+ // (D3D11_SUBRESOURCE_DATA*) OVR_ALLOC(sizeof(D3D11_SUBRESOURCE_DATA) * mipcount);
+ // GenerateSubresourceData(width, height, convertedFormat, imageDimUpperLimit, data, subresData, largestMipWidth,
+ // largestMipHeight, textureSize, effectiveMipCount);
+ // TotalTextureMemoryUsage += textureSize;
+
+ // if (!Device || !subresData)
+ // {
+ // return NULL;
+ // }
+
+ // Texture* NewTex = new Texture(this, format, largestMipWidth, largestMipHeight);
+ // // BCn/DXTn - no AA.
+ // Samples = 1;
+
+ // D3D11_TEXTURE2D_DESC desc;
+ // desc.Width = largestMipWidth;
+ // desc.Height = largestMipHeight;
+ // desc.MipLevels = effectiveMipCount;
+ // desc.ArraySize = 1;
+ // desc.Format = static_cast<DXGI_FORMAT>(convertedFormat);
+ // desc.SampleDesc.Count = 1;
+ // desc.SampleDesc.Quality = 0;
+ // desc.Usage = D3D11_USAGE_DEFAULT;
+ // desc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ // desc.CPUAccessFlags = 0;
+ // desc.MiscFlags = 0;
+
+ // Tex = NULL;
+ // HRESULT hr = Device->CreateTexture2D(&desc, static_cast<D3D11_SUBRESOURCE_DATA*>(subresData),
+ // &Tex.GetRawRef());
+ // OVR_FREE(subresData);
+ // if (FAILED(hr))
+ // {
+ // OVR_LOG_COM_ERROR(hr);
+ // }
+
+ // if (SUCCEEDED(hr) && NewTex != 0)
+ // {
+ // D3D11_SHADER_RESOURCE_VIEW_DESC SRVDesc;
+ // memset(&SRVDesc, 0, sizeof(SRVDesc));
+ // SRVDesc.Format = static_cast<DXGI_FORMAT>(format);
+ // SRVDesc.ViewDimension = D3D_SRV_DIMENSION_TEXTURE2D;
+ // SRVDesc.Texture2D.MipLevels = desc.MipLevels;
+
+ // TexSv = NULL;
+ // hr = Device->CreateShaderResourceView(Tex, NULL, &TexSv.GetRawRef());
+
+ // if (FAILED(hr))
+ // {
+ // OVR_LOG_COM_ERROR(hr);
+ // Release();
+ // return NULL;
+ // }
+ // return NewTex;
+ // }
+
+ // return NULL;
+ //}
+ //else
+ {
+ int samples = (format & Texture_SamplesMask);
+ if (samples < 1)
+ {
+ samples = 1;
+ }
+
+ bool createDepthSrv = (format & Texture_SampleDepth) > 0;
+
+ DXGI_FORMAT d3dformat;
+ int bpp;
+ switch(format & Texture_TypeMask)
+ {
+ //case Texture_BGRA:
+ // bpp = 4;
+ // d3dformat = (format & Texture_SRGB) ? DXGI_FORMAT_B8G8R8A8_UNORM_SRGB : DXGI_FORMAT_B8G8R8A8_UNORM;
+ // break;
+ case Texture_RGBA:
+ bpp = 4;
+ //d3dformat = (format & Texture_SRGB) ? DXGI_FORMAT_R8G8B8A8_UNORM_SRGB : DXGI_FORMAT_R8G8B8A8_UNORM;
+ d3dformat = DXGI_FORMAT_R8G8B8A8_UNORM;
+ break;
+ //case Texture_R:
+ // bpp = 1;
+ // d3dformat = DXGI_FORMAT_R8_UNORM;
+ // break;
+ //case Texture_A:
+ // bpp = 1;
+ // d3dformat = DXGI_FORMAT_A8_UNORM;
+ // break;
+ case Texture_Depth:
+ bpp = 0;
+ d3dformat = createDepthSrv ? DXGI_FORMAT_R32_TYPELESS : DXGI_FORMAT_D32_FLOAT;
+ break;
+ default:
+ bpp = 4;
+ d3dformat = DXGI_FORMAT_R8G8B8A8_UNORM;
+ OVR_ASSERT(0);
+ }
+
+ D3D11_TEXTURE2D_DESC dsDesc;
+ dsDesc.Width = texSize.w;
+ dsDesc.Height = texSize.h;
+ dsDesc.MipLevels = (format == (Texture_RGBA | Texture_GenMipmaps) && data) ? GetNumMipLevels(texSize.w, texSize.h) : 1;
+ dsDesc.ArraySize = 1;
+ dsDesc.Format = d3dformat;
+ dsDesc.SampleDesc.Count = samples;
+ dsDesc.SampleDesc.Quality = 0;
+ dsDesc.Usage = D3D11_USAGE_DEFAULT;
+ dsDesc.BindFlags = D3D11_BIND_SHADER_RESOURCE;
+ dsDesc.CPUAccessFlags = 0;
+ dsDesc.MiscFlags = 0;
+
+ if (format & Texture_RenderTarget)
+ {
+ if ((format & Texture_TypeMask) == Texture_Depth)
+ {
+ dsDesc.BindFlags = createDepthSrv ? (dsDesc.BindFlags | D3D11_BIND_DEPTH_STENCIL) : D3D11_BIND_DEPTH_STENCIL;
+ }
+ else
+ {
+ dsDesc.BindFlags |= D3D11_BIND_RENDER_TARGET;
+ }
+ }
+
+ Tex = NULL;
+ HRESULT hr = rp->pDevice->CreateTexture2D(&dsDesc, NULL, &Tex.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_ASSERT(0);
+ //OVR_DEBUG_LOG_TEXT(("Failed to create 2D D3D texture."));
+ Release();
+ return;
+ }
+ if (dsDesc.BindFlags & D3D11_BIND_SHADER_RESOURCE)
+ {
+ if((dsDesc.BindFlags & D3D11_BIND_DEPTH_STENCIL) > 0 && createDepthSrv)
+ {
+ D3D11_SHADER_RESOURCE_VIEW_DESC depthSrv;
+ depthSrv.Format = DXGI_FORMAT_R32_FLOAT;
+ depthSrv.ViewDimension = samples > 1 ? D3D11_SRV_DIMENSION_TEXTURE2DMS : D3D11_SRV_DIMENSION_TEXTURE2D;
+ depthSrv.Texture2D.MostDetailedMip = 0;
+ depthSrv.Texture2D.MipLevels = dsDesc.MipLevels;
+ TexSv = NULL;
+ hr = rp->pDevice->CreateShaderResourceView(Tex, &depthSrv, &TexSv.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_ASSERT(0);
+ }
+ }
+ else
+ {
+ TexSv = NULL;
+ hr = rp->pDevice->CreateShaderResourceView(Tex, NULL, &TexSv.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_ASSERT(0);
+ }
+ }
+ }
+
+ if (data)
+ {
+ rp->pContext->UpdateSubresource(Tex, 0, NULL, data, texSize.w * bpp, texSize.w * texSize.h * bpp);
+ if (format == (Texture_RGBA | Texture_GenMipmaps))
+ {
+ int srcw = texSize.w, srch = texSize.h;
+ int level = 0;
+ uint8_t* mipmaps = NULL;
+ do
+ {
+ level++;
+ int mipw = srcw >> 1;
+ if (mipw < 1)
+ {
+ mipw = 1;
+ }
+ int miph = srch >> 1;
+ if (miph < 1)
+ {
+ miph = 1;
+ }
+ if (mipmaps == NULL)
+ {
+ mipmaps = (uint8_t*)OVR_ALLOC(mipw * miph * 4);
+ }
+ FilterRgba2x2(level == 1 ? (const uint8_t*)data : mipmaps, srcw, srch, mipmaps);
+ rp->pContext->UpdateSubresource(Tex, level, NULL, mipmaps, mipw * bpp, miph * bpp);
+ srcw = mipw;
+ srch = miph;
+ }
+ while(srcw > 1 || srch > 1);
+
+ if (mipmaps != NULL)
+ {
+ OVR_FREE(mipmaps);
+ }
+ }
+ }
+
+ if (format & Texture_RenderTarget)
+ {
+ if ((format & Texture_TypeMask) == Texture_Depth)
+ {
+ D3D11_DEPTH_STENCIL_VIEW_DESC depthDsv;
+ ZeroMemory(&depthDsv, sizeof(depthDsv));
+ depthDsv.Format = DXGI_FORMAT_D32_FLOAT;
+ depthDsv.ViewDimension = samples > 1 ? D3D11_DSV_DIMENSION_TEXTURE2DMS : D3D11_DSV_DIMENSION_TEXTURE2D;
+ depthDsv.Texture2D.MipSlice = 0;
+ TexDsv = NULL;
+ hr = rp->pDevice->CreateDepthStencilView(Tex, createDepthSrv ? &depthDsv : NULL, &TexDsv.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_ASSERT(0);
+ }
+ }
+ else
+ {
+ TexRtv = NULL;
+ hr = rp->pDevice->CreateRenderTargetView(Tex, NULL, &TexRtv.GetRawRef());
+ if (FAILED(hr))
+ {
+ OVR_ASSERT(0);
+ }
+ }
+ }
+ }
+}
+
+Texture::~Texture()
+{
+}
+
+void Texture::Set(int slot, ShaderStage stage) const
+{
+ ID3D11ShaderResourceView* texSv = TexSv.GetPtr();
+
+ switch(stage)
+ {
+ case Shader_Fragment:
+ pParams->pContext->PSSetShaderResources(slot, 1, &texSv);
+ pParams->pContext->PSSetSamplers(slot, 1, &Sampler.GetRawRef());
+ break;
+
+ case Shader_Vertex:
+ pParams->pContext->VSSetShaderResources(slot, 1, &texSv);
+ pParams->pContext->VSSetSamplers(slot, 1, &Sampler.GetRawRef());
+ break;
+
+ case Shader_Compute:
+ pParams->pContext->CSSetShaderResources(slot, 1, &texSv);
+ pParams->pContext->CSSetSamplers(slot, 1, &Sampler.GetRawRef());
+ break;
+
+ default: OVR_ASSERT ( false ); break;
+ }
+}
+
+
+//-------------------------------------------------------------------------------------
+// ***** GpuTimer
+//
+#define D3DQUERY_EXEC(_context_, _query_, _command_, ...) _context_->_command_(_query_, __VA_ARGS__)
+
+
+void GpuTimer::Init(ID3D11Device* device, ID3D11DeviceContext* content)
+{
+ D3dDevice = device;
+ Context = content;
+}
+
+void GpuTimer::BeginQuery()
+{
+ HRESULT hr;
+
+ if(GotoNextFrame(LastQueuedFrame) == LastTimedFrame)
+ {
+ OVR_ASSERT(false); // too many queries queued
+ return;
+ }
+
+ LastQueuedFrame = GotoNextFrame(LastQueuedFrame);
+
+ GpuQuerySets& newQuerySet = QuerySets[LastQueuedFrame];
+ if(newQuerySet.DisjointQuery == NULL)
+ {
+ // Create the queries
+ D3D11_QUERY_DESC desc;
+ desc.Query = D3D11_QUERY_TIMESTAMP_DISJOINT;
+ desc.MiscFlags = 0;
+ hr = D3dDevice->CreateQuery(&desc, &newQuerySet.DisjointQuery);
+ OVR_D3D_CHECK_RET(hr);
+
+ desc.Query = D3D11_QUERY_TIMESTAMP;
+ hr = D3dDevice->CreateQuery(&desc, &newQuerySet.TimeStartQuery);
+ OVR_D3D_CHECK_RET(hr);
+ hr = D3dDevice->CreateQuery(&desc, &newQuerySet.TimeEndQuery);
+ OVR_D3D_CHECK_RET(hr);
+ }
+
+ OVR_ASSERT(!newQuerySet.QueryStarted);
+ OVR_ASSERT(!newQuerySet.QueryAwaitingTiming);
+
+
+ D3DQUERY_EXEC(Context, QuerySets[LastQueuedFrame].DisjointQuery, Begin, ); // First start a disjoint query
+ D3DQUERY_EXEC(Context, QuerySets[LastQueuedFrame].TimeStartQuery, End, ); // Insert start timestamp
+
+ newQuerySet.QueryStarted = true;
+ newQuerySet.QueryAwaitingTiming = false;
+ //newQuerySet.QueryTimed = false;
+}
+
+void GpuTimer::EndQuery()
+{
+ if(LastQueuedFrame > 0 && !QuerySets[LastQueuedFrame].QueryStarted)
+ return;
+
+ GpuQuerySets& doneQuerySet = QuerySets[LastQueuedFrame];
+ OVR_ASSERT(doneQuerySet.QueryStarted);
+ OVR_ASSERT(!doneQuerySet.QueryAwaitingTiming);
+
+ // Insert the end timestamp
+ D3DQUERY_EXEC(Context, doneQuerySet.TimeEndQuery, End, );
+
+ // End the disjoint query
+ D3DQUERY_EXEC(Context, doneQuerySet.DisjointQuery, End, );
+
+ doneQuerySet.QueryStarted = false;
+ doneQuerySet.QueryAwaitingTiming = true;
+}
+
+float GpuTimer::GetTiming(bool blockUntilValid)
+{
+ float time = -1.0f;
+
+ // loop until we hit a query that is not ready yet, or we have read all queued queries
+ while(LastTimedFrame != LastQueuedFrame)
+ {
+ int timeTestFrame = GotoNextFrame(LastTimedFrame);
+
+ GpuQuerySets& querySet = QuerySets[timeTestFrame];
+
+ OVR_ASSERT(!querySet.QueryStarted && querySet.QueryAwaitingTiming);
+
+ UINT64 startTime = 0;
+ UINT64 endTime = 0;
+ D3D11_QUERY_DATA_TIMESTAMP_DISJOINT disjointData;
+
+ if(blockUntilValid)
+ {
+ while(D3DQUERY_EXEC(Context, querySet.TimeStartQuery, GetData, &startTime, sizeof(startTime), 0) != S_OK);
+ while(D3DQUERY_EXEC(Context, querySet.TimeEndQuery, GetData, &endTime, sizeof(endTime), 0) != S_OK);
+ while(D3DQUERY_EXEC(Context, querySet.DisjointQuery, GetData, &disjointData, sizeof(disjointData), 0) != S_OK);
+ }
+ else
+ {
+// Early return if we fail to get data for any of these
+ if(D3DQUERY_EXEC(Context, querySet.TimeStartQuery, GetData, &startTime, sizeof(startTime), 0) != S_OK) return time;
+ if(D3DQUERY_EXEC(Context, querySet.TimeEndQuery, GetData, &endTime, sizeof(endTime), 0) != S_OK) return time;
+ if(D3DQUERY_EXEC(Context, querySet.DisjointQuery, GetData, &disjointData, sizeof(disjointData), 0) != S_OK) return time;
+ }
+
+ querySet.QueryAwaitingTiming = false;
+ LastTimedFrame = timeTestFrame; // successfully retrieved the timing data
+
+ if(disjointData.Disjoint == false)
+ {
+ UINT64 delta = endTime - startTime;
+ float frequency = (float)(disjointData.Frequency);
+ time = (delta / frequency);
+ }
+ }
+
+ return time;
+}
+
+}}} // OVR::CAPI::D3D11
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.h
index dc5dc8d..b4e5529 100644
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.h
+++ b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D11_Util.h
@@ -1,572 +1,500 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_Util.h
-Content : D3DX 10/11 utility classes for rendering
-Created : September 10, 2012
-Authors : Andrew Reisse
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-// ***** IMPORTANT:
-// This file can be included twice, once with OVR_D3D_VERSION=10 and
-// once with OVR_D3D_VERSION=11.
-
-
-#ifndef OVR_D3D_VERSION
-#error define OVR_D3D_VERSION to 10 or 11
-#endif
-
-// Custom include guard, allowing one of each D3D10/11.
-#if (OVR_D3D_VERSION == 10 && !defined(INC_OVR_CAPI_D3D10_Util_h)) || \
- (OVR_D3D_VERSION == 11 && !defined(INC_OVR_CAPI_D3D11_Util_h))
-
-#include "../../Kernel/OVR_String.h"
-#include "../../Kernel/OVR_Array.h"
-#include "../../Kernel/OVR_Math.h"
-
-#if defined(OVR_OS_WIN32)
-#define WIN32_LEAN_AND_MEAN
-#include <Windows.h>
-#include <comdef.h> // for _COM_SMARTPTR_TYPEDEF()
-
-#undef D3D_NS // namespace
-#undef D3D1X_
-#undef ID3D1X // interface prefix
-#undef ovrD3D1X // ovrD3D10Config, etc.
-#undef D3D11_COMMA_0 // Injects on ", 0" for D3D11 only
-#undef D3DSELECT_10_11
-#undef IID_ID3D1xShaderReflection
-
-#if (OVR_D3D_VERSION == 10)
-
- #define INC_OVR_CAPI_D3D10_Util_h
- #define D3D_NS D3D10
- #define D3D1X_(x) D3D10_##x
- #define ID3D1X(x) ID3D10##x
- #define ovrD3D1X(x) ovrD3D10##x
- #define D3DSELECT_10_11(a10, a11) a10
- #define D3D11_COMMA_0
- #define IID_ID3D1xShaderReflection IID_ID3D10ShaderReflection
- #include <d3d10_1.h> // avoids warning?
- #include <d3d10.h>
-
-#else // (OVR_D3D_VERSION == 11)
-
- #define INC_OVR_CAPI_D3D11_Util_h
- #define D3D_NS D3D11
- #define D3D1X_(x) D3D11_##x
- #define ID3D1X(x) ID3D11##x
- #define ovrD3D1X(x) ovrD3D11##x
- #define D3DSELECT_10_11(a10, a11) a11
- #define D3D11_COMMA_0 , 0
- #define IID_ID3D1xShaderReflection IID_ID3D11ShaderReflection
- #include <d3d11.h>
- #include <D3D11Shader.h>
-#endif
-#endif
-
-
-namespace OVR { namespace CAPI { namespace D3D_NS {
-
-// D3D Namespace-local types.
-typedef ID3D1X(Device) ID3D1xDevice;
-typedef ID3D1X(RenderTargetView) ID3D1xRenderTargetView;
-typedef ID3D1X(Texture2D) ID3D1xTexture2D;
-typedef ID3D1X(ShaderResourceView) ID3D1xShaderResourceView;
-typedef ID3D1X(DepthStencilView) ID3D1xDepthStencilView;
-typedef ID3D1X(DepthStencilState) ID3D1xDepthStencilState;
-typedef ID3D1X(InputLayout) ID3D1xInputLayout;
-typedef ID3D1X(Buffer) ID3D1xBuffer;
-typedef ID3D1X(VertexShader) ID3D1xVertexShader;
-typedef ID3D1X(PixelShader) ID3D1xPixelShader;
-typedef ID3D1X(GeometryShader) ID3D1xGeometryShader;
-#if (OVR_D3D_VERSION>=11)
-typedef ID3D1X(UnorderedAccessView) ID3D1xUnorderedAccessView;
-typedef ID3D1X(ComputeShader) ID3D1xComputeShader;
-#else
-// Typedeffing as int saves a lot of checking against DX version numbers when just copying around pointers.
-typedef int ID3D1xUnorderedAccessView;
-#endif
-typedef ID3D1X(BlendState) ID3D1xBlendState;
-typedef ID3D1X(RasterizerState) ID3D1xRasterizerState;
-typedef ID3D1X(SamplerState) ID3D1xSamplerState;
-typedef ID3D1X(Query) ID3D1xQuery;
-typedef ID3D1X(ShaderReflection) ID3D1xShaderReflection;
-typedef ID3D1X(ShaderReflectionVariable) ID3D1xShaderReflectionVariable;
-typedef ID3D1X(ShaderReflectionConstantBuffer) ID3D1xShaderReflectionConstantBuffer;
-typedef D3D1X_(VIEWPORT) D3D1x_VIEWPORT;
-typedef D3D1X_(QUERY_DESC) D3D1x_QUERY_DESC;
-typedef D3D1X_(SHADER_BUFFER_DESC) D3D1x_SHADER_BUFFER_DESC;
-typedef D3D1X_(SHADER_VARIABLE_DESC) D3D1x_SHADER_VARIABLE_DESC;
-typedef D3D1X_(PRIMITIVE_TOPOLOGY) D3D1x_PRIMITIVE_TOPOLOGY;
-static const int D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT = D3D1X_(COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT);
-static const int D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT = D3D1X_(COMMONSHADER_SAMPLER_SLOT_COUNT);
-static const int D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT = D3D1X_(SIMULTANEOUS_RENDER_TARGET_COUNT);
-static const int D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT = D3D1X_(IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT);
-static const int D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT = D3D1X_(COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT);
-
-// Blob is the same
-typedef ID3D10Blob ID3D1xBlob;
-
-#if (OVR_D3D_VERSION == 10)
- typedef ID3D10Device ID3D1xDeviceContext;
-#else
- typedef ID3D11DeviceContext ID3D1xDeviceContext;
-#endif
-
-
-// Assert on HRESULT failure
-inline void VERIFY_HRESULT(HRESULT hr)
-{
- if (FAILED(hr))
- OVR_ASSERT(false);
-}
-
-class Buffer;
-
-// Rendering parameters/pointers describing D3DX rendering setup.
-struct RenderParams
-{
- ID3D1xDevice* pDevice;
- ID3D1xDeviceContext* pContext;
- ID3D1xRenderTargetView* pBackBufferRT;
- ID3D1xUnorderedAccessView* pBackBufferUAV;
- IDXGISwapChain* pSwapChain;
- Sizei BackBufferSize;
- int Multisample;
-};
-
-
-// Rendering primitive type used to render Model.
-enum PrimitiveType
-{
- Prim_Triangles,
- Prim_Lines,
- Prim_TriangleStrip,
- Prim_Unknown,
- Prim_Count
-};
-
-// Types of shaders that can be stored together in a ShaderSet.
-enum ShaderStage
-{
- Shader_Vertex = 0,
- Shader_Fragment = 2,
- Shader_Pixel = 2,
- Shader_Compute = 3, // DX11+ only
- Shader_Count = 4,
-};
-
-enum MapFlags
-{
- Map_Discard = 1,
- Map_Read = 2, // do not use
- Map_Unsynchronized = 4, // like D3D11_MAP_NO_OVERWRITE
-};
-
-
-// Buffer types used for uploading geometry & constants.
-enum BufferUsage
-{
- Buffer_Unknown = 0,
- Buffer_Vertex = 1,
- Buffer_Index = 2,
- Buffer_Uniform = 4,
- Buffer_Compute = 8,
- Buffer_TypeMask = 0xff,
- Buffer_ReadOnly = 0x100, // Buffer must be created with Data().
-};
-
-enum TextureFormat
-{
- Texture_RGBA = 0x0100,
- Texture_Depth = 0x8000,
- Texture_TypeMask = 0xff00,
- Texture_SamplesMask = 0x00ff,
- Texture_RenderTarget = 0x10000,
- Texture_GenMipmaps = 0x20000,
-};
-
-// Texture sampling modes.
-enum SampleMode
-{
- Sample_Linear = 0,
- Sample_Nearest = 1,
- Sample_Anisotropic = 2,
- Sample_FilterMask = 3,
-
- Sample_Repeat = 0,
- Sample_Clamp = 4,
- Sample_ClampBorder = 8, // If unsupported Clamp is used instead.
- Sample_AddressMask =12,
-
- Sample_Count =13,
-};
-
-// Base class for vertex and pixel shaders. Stored in ShaderSet.
-class Shader : public RefCountBase<Shader>
-{
- friend class ShaderSet;
-
-protected:
- ShaderStage Stage;
-
-public:
- Shader(ShaderStage s) : Stage(s) {}
- virtual ~Shader() {}
-
- ShaderStage GetStage() const { return Stage; }
-
- virtual void Set(PrimitiveType) const { }
- virtual void SetUniformBuffer(class Buffer* buffers, int i = 0) { OVR_UNUSED2(buffers, i); }
-
-protected:
- virtual bool SetUniform(const char* name, int n, const float* v) { OVR_UNUSED3(name, n, v); return false; }
- virtual bool SetUniformBool(const char* name, int n, const bool* v) { OVR_UNUSED3(name, n, v); return false; }
-};
-
-
-
-// A group of shaders, one per stage.
-// A ShaderSet is applied to a RenderDevice for rendering with a given fill.
-class ShaderSet : public RefCountBase<ShaderSet>
-{
-protected:
- Ptr<Shader> Shaders[Shader_Count];
-
-public:
- ShaderSet() { }
- ~ShaderSet() { }
-
- virtual void SetShader(Shader *s)
- {
- Shaders[s->GetStage()] = s;
- }
- virtual void UnsetShader(int stage)
- {
- Shaders[stage] = NULL;
- }
- Shader* GetShader(int stage) { return Shaders[stage]; }
-
- virtual void Set(PrimitiveType prim) const
- {
- for (int i = 0; i < Shader_Count; i++)
- if (Shaders[i])
- Shaders[i]->Set(prim);
- }
-
- // Set a uniform (other than the standard matrices). It is undefined whether the
- // uniforms from one shader occupy the same space as those in other shaders
- // (unless a buffer is used, then each buffer is independent).
- virtual bool SetUniform(const char* name, int n, const float* v)
- {
- bool result = 0;
- for (int i = 0; i < Shader_Count; i++)
- if (Shaders[i])
- result |= Shaders[i]->SetUniform(name, n, v);
-
- return result;
- }
- bool SetUniform1f(const char* name, float x)
- {
- const float v[] = {x};
- return SetUniform(name, 1, v);
- }
- bool SetUniform2f(const char* name, float x, float y)
- {
- const float v[] = {x,y};
- return SetUniform(name, 2, v);
- }
- bool SetUniform3f(const char* name, float x, float y, float z)
- {
- const float v[] = {x,y,z};
- return SetUniform(name, 3, v);
- }
- bool SetUniform4f(const char* name, float x, float y, float z, float w = 1)
- {
- const float v[] = {x,y,z,w};
- return SetUniform(name, 4, v);
- }
-
- bool SetUniformv(const char* name, const Vector3f& v)
- {
- const float a[] = {v.x,v.y,v.z,1};
- return SetUniform(name, 4, a);
- }
-
- virtual bool SetUniform4x4f(const char* name, const Matrix4f& m)
- {
- Matrix4f mt = m.Transposed();
- return SetUniform(name, 16, &mt.M[0][0]);
- }
- virtual bool SetUniform3x3f(const char* name, const Matrix4f& m)
- {
- // float3x3 is actually stored the same way as float4x3, with the last items ignored by the code.
- Matrix4f mt = m.Transposed();
- return SetUniform(name, 12, &mt.M[0][0]);
- }
-
-};
-
-
-// Fill combines a ShaderSet (vertex, pixel) with textures, if any.
-// Every model has a fill.
-class ShaderFill : public RefCountBase<ShaderFill>
-{
- Ptr<ShaderSet> Shaders;
- Ptr<class Texture> PsTextures[8];
- Ptr<class Texture> VsTextures[8];
- Ptr<class Texture> CsTextures[8];
- void* InputLayout; // HACK this should be abstracted
-
-public:
- ShaderFill(ShaderSet* sh) : Shaders(sh) { InputLayout = NULL; }
- ShaderFill(ShaderSet& sh) : Shaders(sh) { InputLayout = NULL; }
-
- ShaderSet* GetShaders() const { return Shaders; }
- void* GetInputLayout() const { return InputLayout; }
-
- virtual void Set(PrimitiveType prim = Prim_Unknown) const;
-
- virtual void SetTexture(int i, class Texture* tex, ShaderStage stage)
- {
- if (i < 8)
- {
- if(stage == Shader_Pixel) PsTextures[i] = tex;
- else if(stage == Shader_Vertex) VsTextures[i] = tex;
- else if(stage == Shader_Compute) CsTextures[i] = tex;
- else OVR_ASSERT(false);
- }
- }
- void SetInputLayout(void* newIL) { InputLayout = (void*)newIL; }
-};
-
-
-class ShaderBase : public Shader
-{
-public:
- RenderParams* pParams;
- unsigned char* UniformData;
- int UniformsSize;
-
- enum VarType
- {
- VARTYPE_FLOAT,
- VARTYPE_INT,
- VARTYPE_BOOL,
- };
-
- struct Uniform
- {
- const char* Name;
- VarType Type;
- int Offset;
- int Size;
- };
- const Uniform* UniformRefl;
- size_t UniformReflSize;
-
- ShaderBase(RenderParams* rp, ShaderStage stage);
- ~ShaderBase();
-
- ShaderStage GetStage() const { return Stage; }
-
- void InitUniforms(const Uniform* refl, size_t reflSize);
- bool SetUniform(const char* name, int n, const float* v);
- bool SetUniformBool(const char* name, int n, const bool* v);
-
- void UpdateBuffer(Buffer* b);
-};
-
-
-template<ShaderStage SStage, class D3DShaderType>
-class ShaderImpl : public ShaderBase
-{
-public:
- D3DShaderType* D3DShader;
-
- ShaderImpl(RenderParams* rp, void* s, size_t size, const Uniform* refl, size_t reflSize) : ShaderBase(rp, SStage)
- {
- Load(s, size);
- InitUniforms(refl, reflSize);
- }
- ~ShaderImpl()
- {
- if (D3DShader)
- D3DShader->Release();
- }
-
- // These functions have specializations.
- bool Load(void* shader, size_t size);
- void Set(PrimitiveType prim) const;
- void SetUniformBuffer(Buffer* buffers, int i = 0);
-};
-
-typedef ShaderImpl<Shader_Vertex, ID3D1xVertexShader> VertexShader;
-typedef ShaderImpl<Shader_Fragment, ID3D1xPixelShader> PixelShader;
-#if (OVR_D3D_VERSION>=11)
-typedef ShaderImpl<Shader_Compute, ID3D1xComputeShader> ComputeShader;
-#endif
-
-
-class Buffer : public RefCountBase<Buffer>
-{
-public:
- RenderParams* pParams;
- Ptr<ID3D1xBuffer> D3DBuffer;
- Ptr<ID3D1xShaderResourceView> D3DSrv;
-#if (OVR_D3D_VERSION >= 11)
- Ptr<ID3D1xUnorderedAccessView> D3DUav;
-#endif
- size_t Size;
- int Use;
- bool Dynamic;
-
-public:
- Buffer(RenderParams* rp) : pParams(rp), D3DBuffer(), D3DSrv(),
-#if (OVR_D3D_VERSION >= 11)
- D3DUav(),
-#endif
- Size(0), Use(0), Dynamic(false) {}
- ~Buffer();
-
- ID3D1xBuffer* GetBuffer() const
- {
- return D3DBuffer;
- }
-
- ID3D1xShaderResourceView* GetSrv() const
- {
- return D3DSrv;
- }
-
-#if (OVR_D3D_VERSION >= 11)
- ID3D1xUnorderedAccessView* GetUav() const
- {
- return D3DUav;
- }
-#endif
-
- virtual size_t GetSize() { return Size; }
- virtual void* Map(size_t start, size_t size, int flags = 0);
- virtual bool Unmap(void *m);
- virtual bool Data(int use, const void* buffer, size_t size, int computeBufferStride = -1);
-};
-
-
-class Texture : public RefCountBase<Texture>
-{
-public:
- RenderParams* pParams;
- Ptr<ID3D1xTexture2D> Tex;
- Ptr<ID3D1xShaderResourceView> TexSv;
- Ptr<ID3D1xRenderTargetView> TexRtv;
- Ptr<ID3D1xDepthStencilView> TexDsv;
- // TODO: add UAV...
- mutable Ptr<ID3D1xSamplerState> Sampler;
- Sizei TextureSize;
- int Samples;
-
- Texture(RenderParams* rp, int fmt, const Sizei texSize,
- ID3D1xSamplerState* sampler, int samples = 1);
- ~Texture();
-
- virtual Sizei GetSize() const { return TextureSize; }
- virtual int GetSamples() const { return Samples; }
-
- // virtual void SetSampleMode(int sm);
-
- // Updates texture to point to specified resources
- // - used for slave rendering.
- void UpdatePlaceholderTexture(ID3D1xTexture2D* texture,
- ID3D1xShaderResourceView* psrv,
- const Sizei& textureSize)
- {
- Tex = texture;
- TexSv = psrv;
- TexRtv.Clear();
- TexDsv.Clear();
-
- TextureSize = textureSize;
-
-#ifdef OVR_BUILD_DEBUG
- D3D1X_(TEXTURE2D_DESC) desc;
- texture->GetDesc(&desc);
- OVR_ASSERT(TextureSize == Sizei(desc.Width, desc.Height));
-#endif
- }
-
-
- virtual void Set(int slot, ShaderStage stage = Shader_Fragment) const;
-
-};
-
-
-class GpuTimer : public RefCountBase<GpuTimer>
-{
-public:
- GpuTimer()
- : QuerySets(MaxNumQueryFrames)
- , D3dDevice(NULL)
- , Context(NULL)
- , LastQueuedFrame(-1)
- , LastTimedFrame(-1)
- { }
-
- void Init(ID3D1xDevice* device, ID3D1xDeviceContext* content);
-
- void BeginQuery();
- void EndQuery();
-
- // Returns -1 if timing is invalid
- float GetTiming(bool blockUntilValid);
-
-protected:
- static const unsigned MaxNumQueryFrames = 10;
-
- int GotoNextFrame(int frame)
- {
- return (frame + 1) % MaxNumQueryFrames;
- }
-
- _COM_SMARTPTR_TYPEDEF(ID3D1xQuery, __uuidof(ID3D1xQuery));
-
- struct GpuQuerySets
- {
- ID3D1xQueryPtr DisjointQuery;
- ID3D1xQueryPtr TimeStartQuery;
- ID3D1xQueryPtr TimeEndQuery;
- bool QueryStarted;
- bool QueryAwaitingTiming;
-
- GpuQuerySets() : QueryStarted(false), QueryAwaitingTiming(false) {}
- };
- Array<GpuQuerySets> QuerySets;
-
- int LastQueuedFrame;
- int LastTimedFrame;
-
- Ptr<ID3D1xDevice> D3dDevice;
- Ptr<ID3D1xDeviceContext> Context;
-};
-
-}}} // OVR::CAPI::D3D1X
-
-#endif // INC_OVR_CAPI_D3D10/11_Util_h
+/************************************************************************************
+
+Filename : CAPI_D3D11_Util.h
+Content : D3D11 utility classes for rendering
+Created : September 10, 2012
+Authors : Andrew Reisse
+
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+
+Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
+you may not use the Oculus VR Rift SDK except in compliance with the License,
+which is provided at the time of installation or download, or which
+otherwise accompanies this software in either electronic or hard copy form.
+
+You may obtain a copy of the License at
+
+http://www.oculusvr.com/licenses/LICENSE-3.2
+
+Unless required by applicable law or agreed to in writing, the Oculus VR SDK
+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 OVR_CAPI_D3D11_Util_h
+#define OVR_CAPI_D3D11_Util_h
+
+#include "Kernel/OVR_String.h"
+#include "Kernel/OVR_Array.h"
+#include "Kernel/OVR_RefCount.h"
+#include "Extras/OVR_Math.h"
+#include "Util/Util_Direct3D.h"
+#include <comdef.h> // for _COM_SMARTPTR_TYPEDEF()
+
+namespace OVR { namespace CAPI { namespace D3D11 {
+
+class Buffer;
+
+// Rendering parameters/pointers describing D3DX rendering setup.
+struct RenderParams
+{
+ ID3D11Device* pDevice;
+ ID3D11DeviceContext* pContext;
+ ID3D11RenderTargetView* pBackBufferRT;
+ ID3D11UnorderedAccessView* pBackBufferUAV;
+ IDXGISwapChain* pSwapChain;
+ Sizei BackBufferSize;
+ int Multisample;
+ UINT32 VidPnTargetId; // display miniport target id for tracing
+};
+
+
+// Rendering primitive type used to render Model.
+enum PrimitiveType
+{
+ Prim_Triangles,
+ Prim_Lines,
+ Prim_TriangleStrip,
+ Prim_Unknown,
+ Prim_Count
+};
+
+// Types of shaders that can be stored together in a ShaderSet.
+enum ShaderStage
+{
+ Shader_Vertex = 0,
+ Shader_Fragment = 2,
+ Shader_Pixel = 2,
+ Shader_Compute = 3, // DX11+ only
+ Shader_Count = 4,
+};
+
+enum MapFlags
+{
+ Map_Discard = 1,
+ Map_Read = 2, // do not use
+ Map_Unsynchronized = 4, // like D3D11_MAP_NO_OVERWRITE
+};
+
+
+// Buffer types used for uploading geometry & constants.
+enum BufferUsage
+{
+ Buffer_Unknown = 0,
+ Buffer_Vertex = 1,
+ Buffer_Index = 2,
+ Buffer_Uniform = 4,
+ Buffer_Compute = 8,
+ Buffer_TypeMask = 0xff,
+ Buffer_ReadOnly = 0x100, // Buffer must be created with Data().
+};
+
+enum TextureFormat
+{
+ Texture_RGBA = 0x0100,
+ Texture_Depth = 0x8000,
+ Texture_TypeMask = 0xff00,
+ Texture_SamplesMask = 0x00ff,
+ Texture_RenderTarget = 0x10000,
+ Texture_SampleDepth = 0x20000,
+ Texture_GenMipmaps = 0x40000,
+};
+
+// Texture sampling modes.
+enum SampleMode
+{
+ Sample_Linear = 0,
+ Sample_Nearest = 1,
+ Sample_Anisotropic = 2,
+ Sample_FilterMask = 3,
+
+ Sample_Repeat = 0,
+ Sample_Clamp = 4,
+ Sample_ClampBorder = 8, // If unsupported Clamp is used instead.
+ Sample_Mirror =12,
+ Sample_AddressMask =12,
+
+ Sample_Count =16,
+};
+
+// Base class for vertex and pixel shaders. Stored in ShaderSet.
+class Shader : public RefCountBase<Shader>
+{
+ friend class ShaderSet;
+
+protected:
+ ShaderStage Stage;
+
+public:
+ Shader(ShaderStage s) : Stage(s) {}
+ virtual ~Shader() {}
+
+ ShaderStage GetStage() const { return Stage; }
+
+ virtual void Set(PrimitiveType) const { }
+ virtual void SetUniformBuffer(class Buffer* buffers, int i = 0) { OVR_UNUSED2(buffers, i); }
+
+protected:
+ virtual bool SetUniform(const char* name, int n, const float* v) { OVR_UNUSED3(name, n, v); return false; }
+ virtual bool SetUniformBool(const char* name, int n, const bool* v) { OVR_UNUSED3(name, n, v); return false; }
+};
+
+
+
+// A group of shaders, one per stage.
+// A ShaderSet is applied to a RenderDevice for rendering with a given fill.
+class ShaderSet : public RefCountBase<ShaderSet>
+{
+protected:
+ Ptr<Shader> Shaders[Shader_Count];
+
+public:
+ ShaderSet() { }
+ ~ShaderSet() { }
+
+ virtual void SetShader(Shader *s)
+ {
+ Shaders[s->GetStage()] = s;
+ }
+ virtual void UnsetShader(int stage)
+ {
+ Shaders[stage] = NULL;
+ }
+ Shader* GetShader(int stage) { return Shaders[stage]; }
+
+ virtual void Set(PrimitiveType prim) const
+ {
+ for (int i = 0; i < Shader_Count; i++)
+ if (Shaders[i])
+ Shaders[i]->Set(prim);
+ }
+
+ // Set a uniform (other than the standard matrices). It is undefined whether the
+ // uniforms from one shader occupy the same space as those in other shaders
+ // (unless a buffer is used, then each buffer is independent).
+ virtual bool SetUniform(const char* name, int n, const float* v)
+ {
+ bool result = 0;
+ for (int i = 0; i < Shader_Count; i++)
+ if (Shaders[i])
+ result |= Shaders[i]->SetUniform(name, n, v);
+
+ return result;
+ }
+ bool SetUniform1f(const char* name, float x)
+ {
+ const float v[] = {x};
+ return SetUniform(name, 1, v);
+ }
+ bool SetUniform2f(const char* name, float x, float y)
+ {
+ const float v[] = {x,y};
+ return SetUniform(name, 2, v);
+ }
+ bool SetUniform3f(const char* name, float x, float y, float z)
+ {
+ const float v[] = {x,y,z};
+ return SetUniform(name, 3, v);
+ }
+ bool SetUniform4f(const char* name, float x, float y, float z, float w = 1)
+ {
+ const float v[] = {x,y,z,w};
+ return SetUniform(name, 4, v);
+ }
+
+ bool SetUniformv(const char* name, const Vector3f& v)
+ {
+ const float a[] = {v.x,v.y,v.z,1};
+ return SetUniform(name, 4, a);
+ }
+
+ virtual bool SetUniform4x4f(const char* name, const Matrix4f& m)
+ {
+ Matrix4f mt = m.Transposed();
+ return SetUniform(name, 16, &mt.M[0][0]);
+ }
+ virtual bool SetUniform3x3f(const char* name, const Matrix4f& m)
+ {
+ // float3x3 is actually stored the same way as float4x3, with the last items ignored by the code.
+ Matrix4f mt = m.Transposed();
+ return SetUniform(name, 12, &mt.M[0][0]);
+ }
+
+};
+
+
+// Fill combines a ShaderSet (vertex, pixel) with textures, if any.
+// Every model has a fill.
+class ShaderFill : public RefCountBase<ShaderFill>
+{
+ Ptr<ShaderSet> Shaders;
+ Ptr<class Texture> PsTextures[8];
+ Ptr<class Texture> VsTextures[8];
+ Ptr<class Texture> CsTextures[8];
+ void* InputLayout; // HACK this should be abstracted
+
+public:
+ ShaderFill(ShaderSet* sh) : Shaders(sh) { InputLayout = NULL; }
+ ShaderFill(ShaderSet& sh) : Shaders(sh) { InputLayout = NULL; }
+
+ ShaderSet* GetShaders() const { return Shaders; }
+ void* GetInputLayout() const { return InputLayout; }
+
+ virtual void Set(PrimitiveType prim = Prim_Unknown) const;
+
+ virtual void SetTexture(int i, class Texture* tex, ShaderStage stage)
+ {
+ if (i < 8)
+ {
+ if(stage == Shader_Pixel) PsTextures[i] = tex;
+ else if(stage == Shader_Vertex) VsTextures[i] = tex;
+ else if(stage == Shader_Compute) CsTextures[i] = tex;
+ else OVR_ASSERT(false);
+ }
+ }
+ void SetInputLayout(void* newIL) { InputLayout = (void*)newIL; }
+};
+
+
+class ShaderBase : public Shader
+{
+public:
+ RenderParams* pParams;
+ unsigned char* UniformData;
+ int UniformsSize;
+
+ enum VarType
+ {
+ VARTYPE_FLOAT,
+ VARTYPE_INT,
+ VARTYPE_BOOL,
+ };
+
+ struct Uniform
+ {
+ const char* Name;
+ VarType Type;
+ int Offset;
+ int Size;
+ };
+ const Uniform* UniformRefl;
+ size_t UniformReflSize;
+
+ ShaderBase(RenderParams* rp, ShaderStage stage);
+ ~ShaderBase();
+
+ ShaderStage GetStage() const { return Stage; }
+
+ void InitUniforms(const Uniform* refl, size_t reflSize);
+ bool SetUniform(const char* name, int n, const float* v);
+ bool SetUniformBool(const char* name, int n, const bool* v);
+
+ void UpdateBuffer(Buffer* b);
+};
+
+
+template<ShaderStage SStage, class D3DShaderType>
+class ShaderImpl : public ShaderBase
+{
+public:
+ D3DShaderType* D3DShader;
+
+ ShaderImpl(RenderParams* rp, void* s, size_t size, const Uniform* refl, size_t reflSize) : ShaderBase(rp, SStage)
+ {
+ Load(s, size);
+ InitUniforms(refl, reflSize);
+ }
+ ~ShaderImpl()
+ {
+ if (D3DShader)
+ D3DShader->Release();
+ }
+
+ // These functions have specializations.
+ bool Load(void* shader, size_t size);
+ void Set(PrimitiveType prim) const;
+ void SetUniformBuffer(Buffer* buffers, int i = 0);
+};
+
+typedef ShaderImpl<Shader_Vertex, ID3D11VertexShader> VertexShader;
+typedef ShaderImpl<Shader_Fragment, ID3D11PixelShader> PixelShader;
+typedef ShaderImpl<Shader_Compute, ID3D11ComputeShader> ComputeShader;
+
+
+class Buffer : public RefCountBase<Buffer>
+{
+public:
+ RenderParams* pParams;
+ Ptr<ID3D11Buffer> D3DBuffer;
+ Ptr<ID3D11ShaderResourceView> D3DSrv;
+ Ptr<ID3D11UnorderedAccessView> D3DUav;
+ size_t Size;
+ int Use;
+ bool Dynamic;
+
+public:
+ Buffer(RenderParams* rp) : pParams(rp), D3DBuffer(), D3DSrv(),
+ D3DUav(),
+ Size(0), Use(0), Dynamic(false) {}
+ ~Buffer();
+
+ ID3D11Buffer* GetBuffer() const
+ {
+ return D3DBuffer;
+ }
+
+ ID3D11ShaderResourceView* GetSrv() const
+ {
+ return D3DSrv;
+ }
+
+ ID3D11UnorderedAccessView* GetUav() const
+ {
+ return D3DUav;
+ }
+
+ virtual size_t GetSize() { return Size; }
+ virtual void* Map(size_t start, size_t size, int flags = 0);
+ virtual bool Unmap(void *m);
+ virtual bool Data(int use, const void* buffer, size_t size, int computeBufferStride = -1);
+};
+
+
+class Texture : public RefCountBase<Texture>
+{
+public:
+ RenderParams* pParams;
+ Ptr<ID3D11Texture2D> Tex;
+ Ptr<ID3D11ShaderResourceView> TexSv;
+ Ptr<ID3D11RenderTargetView> TexRtv;
+ Ptr<ID3D11DepthStencilView> TexDsv;
+ // TODO: add UAV...
+ mutable Ptr<ID3D11SamplerState> Sampler;
+ Sizei TextureSize;
+ int Samples;
+
+ Texture(RenderParams* rp, int fmt, const Sizei texSize,
+ ID3D11SamplerState* sampler, int samples = 1);
+ Texture(RenderParams* rp, int fmt, const Sizei texSize,
+ ID3D11SamplerState* sampler, const void* data, int mipcount);
+ ~Texture();
+
+ void GenerateSubresourceData(
+ unsigned imageWidth, unsigned imageHeight, int format, unsigned imageDimUpperLimit,
+ const void* rawBytes, D3D11_SUBRESOURCE_DATA* subresData,
+ unsigned& largestMipWidth, unsigned& largestMipHeight, unsigned& byteSize, unsigned& effectiveMipCount);
+
+ virtual Sizei GetSize() const { return TextureSize; }
+ virtual int GetSamples() const { return Samples; }
+
+ // virtual void SetSampleMode(int sm);
+
+ // Updates texture to point to specified resources
+ // - used for slave rendering.
+ void UpdatePlaceholderTexture(ID3D11Texture2D* texture,
+ ID3D11ShaderResourceView* psrv,
+ const Sizei& textureSize, const int sampleCount)
+ {
+ Tex = texture;
+ TexSv = psrv;
+ TexRtv.Clear();
+ TexDsv.Clear();
+
+ TextureSize = textureSize;
+ Samples = sampleCount;
+
+#ifdef OVR_BUILD_DEBUG
+ D3D11_TEXTURE2D_DESC desc;
+ texture->GetDesc(&desc);
+ OVR_ASSERT(TextureSize == Sizei(desc.Width, desc.Height));
+#endif
+ }
+
+
+ virtual void Set(int slot, ShaderStage stage = Shader_Fragment) const;
+
+ int GetNumMipLevels(int w, int h)
+ {
+ int n = 1;
+ while(w > 1 || h > 1)
+ {
+ w >>= 1;
+ h >>= 1;
+ n++;
+ }
+ return n;
+ }
+
+ void FilterRgba2x2(const uint8_t* src, int w, int h, uint8_t* dest)
+ {
+ for(int j = 0; j < (h & ~1); j += 2)
+ {
+ const uint8_t* psrc = src + (w * j * 4);
+ uint8_t* pdest = dest + ((w >> 1) * (j >> 1) * 4);
+
+ for(int i = 0; i < w >> 1; i++, psrc += 8, pdest += 4)
+ {
+ pdest[0] = (((int)psrc[0]) + psrc[4] + psrc[w * 4 + 0] + psrc[w * 4 + 4]) >> 2;
+ pdest[1] = (((int)psrc[1]) + psrc[5] + psrc[w * 4 + 1] + psrc[w * 4 + 5]) >> 2;
+ pdest[2] = (((int)psrc[2]) + psrc[6] + psrc[w * 4 + 2] + psrc[w * 4 + 6]) >> 2;
+ pdest[3] = (((int)psrc[3]) + psrc[7] + psrc[w * 4 + 3] + psrc[w * 4 + 7]) >> 2;
+ }
+ }
+ }
+};
+
+
+class GpuTimer : public RefCountBase<GpuTimer>
+{
+public:
+ GpuTimer()
+ : QuerySets(MaxNumQueryFrames)
+ , D3dDevice(NULL)
+ , Context(NULL)
+ , LastQueuedFrame(-1)
+ , LastTimedFrame(-1)
+ { }
+
+ void Init(ID3D11Device* device, ID3D11DeviceContext* content);
+
+ void BeginQuery();
+ void EndQuery();
+
+ // Returns -1 if timing is invalid
+ float GetTiming(bool blockUntilValid);
+
+protected:
+ static const unsigned MaxNumQueryFrames = 10;
+
+ int GotoNextFrame(int frame)
+ {
+ return (frame + 1) % MaxNumQueryFrames;
+ }
+
+ _COM_SMARTPTR_TYPEDEF(ID3D11Query, __uuidof(ID3D11Query));
+
+ struct GpuQuerySets
+ {
+ ID3D11QueryPtr DisjointQuery;
+ ID3D11QueryPtr TimeStartQuery;
+ ID3D11QueryPtr TimeEndQuery;
+ bool QueryStarted;
+ bool QueryAwaitingTiming;
+
+ GpuQuerySets() : QueryStarted(false), QueryAwaitingTiming(false) {}
+ };
+ Array<GpuQuerySets> QuerySets;
+
+ int LastQueuedFrame;
+ int LastTimedFrame;
+
+ Ptr<ID3D11Device> D3dDevice;
+ Ptr<ID3D11DeviceContext> Context;
+};
+
+}}} // OVR::CAPI::D3D11
+
+#endif // OVR_CAPI_D3D11_Util_h
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp
deleted file mode 100644
index 04cfd07..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.cpp
+++ /dev/null
@@ -1,1414 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_DistortionRenderer.cpp
-Content : Experimental distortion renderer
-Created : November 11, 2013
-Authors : Volga Aksoy, Michael Antonov, Shariq Hashme
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 "CAPI_D3D1X_DistortionRenderer.h"
-
-#include "../../OVR_CAPI_D3D.h"
-#include "../CAPI_HMDState.h"
-#include "../../Kernel/OVR_Color.h"
-
-namespace OVR { namespace CAPI { namespace D3D_NS {
-
-#include "Shaders/Distortion_vs.h"
-#include "Shaders/Distortion_vs_refl.h"
-#include "Shaders/Distortion_ps.h"
-#include "Shaders/Distortion_ps_refl.h"
-#include "Shaders/DistortionChroma_vs.h"
-#include "Shaders/DistortionChroma_vs_refl.h"
-#include "Shaders/DistortionChroma_ps.h"
-#include "Shaders/DistortionChroma_ps_refl.h"
-#include "Shaders/DistortionTimewarp_vs.h"
-#include "Shaders/DistortionTimewarp_vs_refl.h"
-#include "Shaders/DistortionTimewarpChroma_vs.h"
-#include "Shaders/DistortionTimewarpChroma_vs_refl.h"
-#include "Shaders/DistortionCS2x2.h"
-#include "Shaders/DistortionCS2x2_refl.h"
-
-#include "Shaders/SimpleQuad_vs.h"
-#include "Shaders/SimpleQuad_vs_refl.h"
-#include "Shaders/SimpleQuad_ps.h"
-#include "Shaders/SimpleQuad_ps_refl.h"
-
-#include <initguid.h>
-DEFINE_GUID(IID_OVRDXGISwapchain, 0x868f9b4f, 0xe427, 0x46ed, 0xb0, 0x94, 0x66, 0xd1, 0x3b, 0xb, 0x48, 0xf7);
-
-// Distortion pixel shader lookup.
-// Bit 0: Chroma Correction
-// Bit 1: Timewarp
-
-enum {
- DistortionVertexShaderBitMask = 3,
- DistortionVertexShaderCount = DistortionVertexShaderBitMask + 1,
- DistortionPixelShaderBitMask = 1,
- DistortionPixelShaderCount = DistortionPixelShaderBitMask + 1,
-};
-
-struct PrecompiledShader
-{
- const unsigned char* ShaderData;
- size_t ShaderSize;
- const ShaderBase::Uniform* ReflectionData;
- size_t ReflectionSize;
-};
-
-// Do add a new distortion shader use these macros (with or w/o reflection)
-#define PCS_NOREFL(shader) { shader, sizeof(shader), NULL, 0 }
-#define PCS_REFL__(shader) { shader, sizeof(shader), shader ## _refl, sizeof( shader ## _refl )/sizeof(*(shader ## _refl)) }
-
-
-static PrecompiledShader DistortionVertexShaderLookup[DistortionVertexShaderCount] =
-{
- PCS_REFL__(Distortion_vs),
- PCS_REFL__(DistortionChroma_vs),
- PCS_REFL__(DistortionTimewarp_vs),
- PCS_REFL__(DistortionTimewarpChroma_vs),
-};
-
-static PrecompiledShader DistortionPixelShaderLookup[DistortionPixelShaderCount] =
-{
- PCS_NOREFL(Distortion_ps),
- PCS_REFL__(DistortionChroma_ps)
-};
-
-enum
-{
- DistortionComputeShader2x2 = 0,
- DistortionComputeShader2x2Pentile,
- DistortionComputeShaderCount
-};
-static PrecompiledShader DistortionComputeShaderLookup[DistortionComputeShaderCount] =
-{
- PCS_REFL__(DistortionCS2x2)
-};
-
-
-
-void DistortionShaderBitIndexCheck()
-{
- OVR_COMPILER_ASSERT(ovrDistortionCap_Chromatic == 1);
- OVR_COMPILER_ASSERT(ovrDistortionCap_TimeWarp == 2);
-}
-
-
-
-struct DistortionVertex // Must match the VB description DistortionMeshVertexDesc
-{
- Vector2f ScreenPosNDC;
- Vector2f TanEyeAnglesR;
- Vector2f TanEyeAnglesG;
- Vector2f TanEyeAnglesB;
- Color Col;
-};
-
-struct DistortionComputePin // Must match the ones declared in DistortionCS*.csh
-{
- Vector2f TanEyeAnglesR;
- Vector2f TanEyeAnglesG;
- Vector2f TanEyeAnglesB;
- Color Col;
- int padding[1]; // Aligns to power-of-two boundary, increases performance significantly.
-};
-
-
-// Vertex type; same format is used for all shapes for simplicity.
-// Shapes are built by adding vertices to Model.
-struct Vertex
-{
- Vector3f Pos;
- Color C;
- float U, V;
- Vector3f Norm;
-
- Vertex (const Vector3f& p, const Color& c = Color(64,0,0,255),
- float u = 0, float v = 0, Vector3f n = Vector3f(1,0,0))
- : Pos(p), C(c), U(u), V(v), Norm(n)
- {}
- Vertex(float x, float y, float z, const Color& c = Color(64,0,0,255),
- float u = 0, float v = 0) : Pos(x,y,z), C(c), U(u), V(v)
- { }
-
- bool operator==(const Vertex& b) const
- {
- return Pos == b.Pos && C == b.C && U == b.U && V == b.V;
- }
-};
-
-
-//----------------------------------------------------------------------------
-// ***** D3D1X::DistortionRenderer
-
-DistortionRenderer::DistortionRenderer(ovrHmd hmd, FrameTimeManager& timeManager,
- const HMDRenderState& renderState)
- : CAPI::DistortionRenderer(ovrRenderAPI_D3D11, hmd, timeManager, renderState)
-{
- SrgbBackBuffer = false;
-
- EyeTextureSize[0] = Sizei(0);
- EyeRenderViewport[0] = Recti();
- EyeTextureSize[1] = Sizei(0);
- EyeRenderViewport[1] = Recti();
-}
-
-DistortionRenderer::~DistortionRenderer()
-{
- destroy();
-}
-
-// static
-CAPI::DistortionRenderer* DistortionRenderer::Create(ovrHmd hmd,
- FrameTimeManager& timeManager,
- const HMDRenderState& renderState)
-{
- return new DistortionRenderer(hmd, timeManager, renderState);
-}
-
-
-bool DistortionRenderer::Initialize(const ovrRenderAPIConfig* apiConfig)
-{
- const ovrD3D1X(Config)* config = (const ovrD3D1X(Config)*)apiConfig;
-
- if (!config)
- {
- // Cleanup
- pEyeTextures[0].Clear();
- pEyeTextures[1].Clear();
- memset(&RParams, 0, sizeof(RParams));
- return true;
- }
-
- if (!config->D3D_NS.pDevice || !config->D3D_NS.pBackBufferRT)
- return false;
-
- if (System::DirectDisplayEnabled())
- {
- Ptr<IUnknown> ovrSwapChain;
- if (config->D3D_NS.pSwapChain->QueryInterface(IID_OVRDXGISwapchain, (void**)&ovrSwapChain.GetRawRef()) == E_NOINTERFACE)
- {
- OVR_DEBUG_LOG_TEXT(("ovr_Initialize() or ovr_InitializeRenderingShim() wasn't called before DXGISwapChain was created."));
- }
- }
-
- RParams.pDevice = config->D3D_NS.pDevice;
- RParams.pContext = D3DSELECT_10_11(config->D3D_NS.pDevice, config->D3D_NS.pDeviceContext);
- RParams.pBackBufferRT = config->D3D_NS.pBackBufferRT;
-#if (OVR_D3D_VERSION>=11)
- RParams.pBackBufferUAV = config->D3D_NS.pBackBufferUAV;
-#else
- RParams.pBackBufferUAV = NULL;
-#endif
- RParams.pSwapChain = config->D3D_NS.pSwapChain;
- RParams.BackBufferSize = config->D3D_NS.Header.BackBufferSize;
- RParams.Multisample = config->D3D_NS.Header.Multisample;
-
- GfxState = *new GraphicsState(RParams.pContext);
-
- D3D1X_(RENDER_TARGET_VIEW_DESC) backBufferDesc;
- RParams.pBackBufferRT->GetDesc(&backBufferDesc);
- SrgbBackBuffer = (backBufferDesc.Format == DXGI_FORMAT_R8G8B8A8_UNORM_SRGB) ||
- (backBufferDesc.Format == DXGI_FORMAT_B8G8R8A8_UNORM_SRGB) ||
- (backBufferDesc.Format == DXGI_FORMAT_B8G8R8X8_UNORM_SRGB);
-
-
-#if 0 // enable related section in DistortionChroma.psh shader
- // aniso requires proper sRGB sampling
- SampleMode hqFilter = (RState.DistortionCaps & ovrDistortionCap_HqDistortion) ? Sample_Anisotropic : Sample_Linear;
-#else
- SampleMode hqFilter = Sample_Linear;
-#endif
-
- pEyeTextures[0] = *new Texture(&RParams, Texture_RGBA, Sizei(0),
- getSamplerState(hqFilter|Sample_ClampBorder));
- pEyeTextures[1] = *new Texture(&RParams, Texture_RGBA, Sizei(0),
- getSamplerState(hqFilter|Sample_ClampBorder));
-
- initBuffersAndShaders();
-
- // Rasterizer state
- D3D1X_(RASTERIZER_DESC) rs;
- memset(&rs, 0, sizeof(rs));
- rs.AntialiasedLineEnable = true;
- rs.CullMode = D3D1X_(CULL_BACK);
- rs.DepthClipEnable = true;
- rs.FillMode = D3D1X_(FILL_SOLID);
- Rasterizer = NULL;
- RParams.pDevice->CreateRasterizerState(&rs, &Rasterizer.GetRawRef());
-
- initOverdrive();
-
- // TBD: Blend state.. not used?
- // We'll want to turn off blending
-
-#if (OVR_D3D_VERSION == 11)
- GpuProfiler.Init(RParams.pDevice, RParams.pContext);
-#endif
-
- return true;
-}
-
-void DistortionRenderer::initOverdrive()
-{
- if(RState.DistortionCaps & ovrDistortionCap_Overdrive)
- {
- LastUsedOverdriveTextureIndex = 0;
-
- D3D1X_(RENDER_TARGET_VIEW_DESC) backBufferDesc;
- RParams.pBackBufferRT->GetDesc(&backBufferDesc);
-
- for (int i = 0; i < NumOverdriveTextures; i++)
- {
- pOverdriveTextures[i] = *new Texture(&RParams, Texture_RGBA, RParams.BackBufferSize,
- getSamplerState(Sample_Linear|Sample_ClampBorder));
-
- D3D1X_(TEXTURE2D_DESC) dsDesc;
- dsDesc.Width = RParams.BackBufferSize.w;
- dsDesc.Height = RParams.BackBufferSize.h;
- dsDesc.MipLevels = 1;
- dsDesc.ArraySize = 1;
- dsDesc.Format = backBufferDesc.Format;
- dsDesc.SampleDesc.Count = 1;
- dsDesc.SampleDesc.Quality = 0;
- dsDesc.Usage = D3D1X_(USAGE_DEFAULT);
- dsDesc.BindFlags = D3D1X_(BIND_SHADER_RESOURCE) | D3D1X_(BIND_RENDER_TARGET);
- dsDesc.CPUAccessFlags = 0;
- dsDesc.MiscFlags = 0;
-
- HRESULT hr = RParams.pDevice->CreateTexture2D(&dsDesc, NULL, &pOverdriveTextures[i]->Tex.GetRawRef());
- if (FAILED(hr))
- {
- OVR_DEBUG_LOG_TEXT(("Failed to create overdrive texture."));
- // Remove overdrive flag since we failed to create the texture
- LastUsedOverdriveTextureIndex = -1; // disables feature
- break;
- }
-
- RParams.pDevice->CreateShaderResourceView(pOverdriveTextures[i]->Tex, NULL, &pOverdriveTextures[i]->TexSv.GetRawRef());
- RParams.pDevice->CreateRenderTargetView(pOverdriveTextures[i]->Tex, NULL, &pOverdriveTextures[i]->TexRtv.GetRawRef());
- }
- }
- else
- {
- LastUsedOverdriveTextureIndex = -1;
- }
-}
-
-void DistortionRenderer::SubmitEye(int eyeId, const ovrTexture* eyeTexture)
-{
- const ovrD3D1X(Texture)* tex = (const ovrD3D1X(Texture)*)eyeTexture;
-
- if (eyeTexture)
- {
- // Use tex->D3D_NS.Header.RenderViewport to update UVs for rendering in case they changed.
- // TBD: This may be optimized through some caching.
- EyeTextureSize[eyeId] = tex->D3D_NS.Header.TextureSize;
- EyeRenderViewport[eyeId] = tex->D3D_NS.Header.RenderViewport;
-
- const ovrEyeRenderDesc& erd = RState.EyeRenderDesc[eyeId];
-
- ovrHmd_GetRenderScaleAndOffset(erd.Fov,
- EyeTextureSize[eyeId], EyeRenderViewport[eyeId],
- UVScaleOffset[eyeId]);
-
- if (RState.DistortionCaps & ovrDistortionCap_FlipInput)
- {
- UVScaleOffset[eyeId][0].y = -UVScaleOffset[eyeId][0].y;
- UVScaleOffset[eyeId][1].y = 1.0f - UVScaleOffset[eyeId][1].y;
- }
-
- pEyeTextures[eyeId]->UpdatePlaceholderTexture(tex->D3D_NS.pTexture, tex->D3D_NS.pSRView,
- tex->D3D_NS.Header.TextureSize);
- }
-}
-
-void DistortionRenderer::renderEndFrame()
-{
- renderDistortion(pEyeTextures[0], pEyeTextures[1]);
-
- if(RegisteredPostDistortionCallback)
- RegisteredPostDistortionCallback(RParams.pContext);
-
- if(LatencyTest2Active)
- {
- renderLatencyPixel(LatencyTest2DrawColor);
- }
-}
-
-void DistortionRenderer::EndFrame(bool swapBuffers)
-{
- // Don't spin if we are explicitly asked not to
- if ((RState.DistortionCaps & ovrDistortionCap_TimeWarp) &&
- !(RState.DistortionCaps & ovrDistortionCap_ProfileNoTimewarpSpinWaits))
- {
- if (!TimeManager.NeedDistortionTimeMeasurement())
- {
- // Wait for timewarp distortion if it is time and Gpu idle
- FlushGpuAndWaitTillTime(TimeManager.GetFrameTiming().TimewarpPointTime);
-
- renderEndFrame();
- }
- else
- {
- // If needed, measure distortion time so that TimeManager can better estimate
- // latency-reducing time-warp wait timing.
- WaitUntilGpuIdle();
- double distortionStartTime = ovr_GetTimeInSeconds();
-
- renderEndFrame();
-
- WaitUntilGpuIdle();
- TimeManager.AddDistortionTimeMeasurement(ovr_GetTimeInSeconds() - distortionStartTime);
- }
- }
- else
- {
- renderEndFrame();
- }
-
- if(LatencyTestActive)
- {
- renderLatencyQuad(LatencyTestDrawColor);
- }
-
- if (swapBuffers)
- {
- if (RParams.pSwapChain)
- {
- UINT swapInterval = (RState.EnabledHmdCaps & ovrHmdCap_NoVSync) ? 0 : 1;
- RParams.pSwapChain->Present(swapInterval, 0);
-
- // Force GPU to flush the scene, resulting in the lowest possible latency.
- // It's critical that this flush is *after* present.
- // With the display driver this flush is obsolete and theoretically should
- // be a no-op.
- // Doesn't need to be done if running through the Oculus driver.
- if (RState.OurHMDInfo.InCompatibilityMode &&
- !(RState.DistortionCaps & ovrDistortionCap_ProfileNoTimewarpSpinWaits))
- WaitUntilGpuIdle();
- }
- else
- {
- // TBD: Generate error - swapbuffer option used with null swapchain.
- }
- }
-}
-
-
-void DistortionRenderer::WaitUntilGpuIdle()
-{
- // Flush and Stall CPU while waiting for GPU to complete rendering all of the queued draw calls
- D3D1x_QUERY_DESC queryDesc = { D3D1X_(QUERY_EVENT), 0 };
- Ptr<ID3D1xQuery> query;
- BOOL done = FALSE;
-
- if (RParams.pDevice->CreateQuery(&queryDesc, &query.GetRawRef()) == S_OK)
- {
- D3DSELECT_10_11(query->End(),
- RParams.pContext->End(query));
-
- // GetData will returns S_OK for both done == TRUE or FALSE.
- // Exit on failure to avoid infinite loop.
- do { }
- while(!done &&
- !FAILED(D3DSELECT_10_11(query->GetData(&done, sizeof(BOOL), 0),
- RParams.pContext->GetData(query, &done, sizeof(BOOL), 0)))
- );
- }
-}
-
-double DistortionRenderer::FlushGpuAndWaitTillTime(double absTime)
-{
- RParams.pContext->Flush();
- return WaitTillTime(absTime);
-}
-
-void DistortionRenderer::initBuffersAndShaders()
-{
- if ( RState.DistortionCaps & ovrDistortionCap_ComputeShader )
- {
- // Compute shader distortion grid.
- // TODO - only do this if the CS is actually enabled?
- for ( int eyeNum = 0; eyeNum < 2; eyeNum++ )
- {
- // Compute shader setup of regular grid.
- DistortionMeshVBs[eyeNum] = NULL;
- DistortionMeshIBs[eyeNum] = NULL;
-
- // These constants need to match those declared in the shader in DistortionCS*.csh
- const int gridSizeInPixels = 16;
- const int pinsPerEdge = 128;
-
-
- // TODO: clean up this mess!
- HMDState* hmds = (HMDState*)HMD->Handle;
- ovrEyeType eyeType = RState.EyeRenderDesc[eyeNum].Eye;
- ovrFovPort fov = RState.EyeRenderDesc[eyeNum].Fov;
-
- const HmdRenderInfo& hmdri = hmds->RenderState.RenderInfo;
- DistortionRenderDesc& distortion = hmds->RenderState.Distortion[eyeType];
-
-
- // Find the mapping from TanAngle space to target NDC space.
- ScaleAndOffset2D eyeToSourceNDC = CreateNDCScaleAndOffsetFromFov(fov);
-
- //const StereoEyeParams &stereoParams = ( eyeNum == 0 ) ? stereoParamsLeft : stereoParamsRight;
- OVR_ASSERT ( gridSizeInPixels * (pinsPerEdge-1) > hmdri.ResolutionInPixels.w/2 );
- OVR_ASSERT ( gridSizeInPixels * (pinsPerEdge-1) > hmdri.ResolutionInPixels.h );
- DistortionComputePin Verts[pinsPerEdge*pinsPerEdge];
- // Vertices are laid out in a vertical scanline pattern,
- // scanning right to left, then within each scan going top to bottom, like DK2.
- // If we move to a different panel orientation, we may need to flip this around.
- int vertexNum = 0;
- for ( int x = 0; x < pinsPerEdge; x++ )
- {
- for ( int y = 0; y < pinsPerEdge; y++ )
- {
- int pixX = x * gridSizeInPixels;
- int pixY = y * gridSizeInPixels;
- #if 0
- // Simple version, ignoring pentile offsets
- Vector2f screenPosNdc;
- screenPosNdc.x = 2.0f * ( 0.5f - ( (float)pixX / (hmdri.ResolutionInPixels.w/2) ) ); // Note signs!
- screenPosNdc.y = 2.0f * ( -0.5f + ( (float)pixY / hmdri.ResolutionInPixels.h ) ); // Note signs!
-
- DistortionMeshVertexData vertex = DistortionMeshMakeVertex ( screenPosNdc,
- ( eyeNum == 1 ),
- hmdri,
- distortion,
- eyeToSourceNDC );
- DistortionComputePin *pCurVert = &(Verts[vertexNum]);
- pCurVert->TanEyeAnglesR = vertex.TanEyeAnglesR;
- pCurVert->TanEyeAnglesG = vertex.TanEyeAnglesG;
- pCurVert->TanEyeAnglesB = vertex.TanEyeAnglesB;
- #else
- // Pentile offsets are messy.
- Vector2f screenPos[3]; // R=0, G=1, B=2
- DistortionMeshVertexData vertexRGB[3];
- screenPos[1] = Vector2f ( (float)pixX, (float)pixY );
- screenPos[0] = screenPos[1];
- screenPos[2] = screenPos[1];
-
- if ( ( hmds->RenderState.EnabledHmdCaps & ovrHmdCap_DirectPentile ) != 0 )
- {
- // Doing direct display, so enable the pentile offsets.
- screenPos[0] = screenPos[1] + hmdri.PelOffsetR;
- screenPos[2] = screenPos[1] + hmdri.PelOffsetB;
- }
-
- for ( int i = 0; i < 3; i++ )
- {
- Vector2f screenPosNdc;
- screenPosNdc.x = 2.0f * ( 0.5f - ( screenPos[i].x / (hmdri.ResolutionInPixels.w/2) ) ); // Note signs!
- screenPosNdc.y = 2.0f * ( -0.5f + ( screenPos[i].y / hmdri.ResolutionInPixels.h ) ); // Note signs!
- vertexRGB[i] = DistortionMeshMakeVertex ( screenPosNdc,
- ( eyeNum == 1 ),
- hmdri,
- distortion,
- eyeToSourceNDC );
- }
- // Most data (fade, TW interpolate, etc) comes from the green channel.
- DistortionMeshVertexData vertex = vertexRGB[1];
- DistortionComputePin *pCurVert = &(Verts[vertexNum]);
- pCurVert->TanEyeAnglesR = vertexRGB[0].TanEyeAnglesR;
- pCurVert->TanEyeAnglesG = vertexRGB[1].TanEyeAnglesG;
- pCurVert->TanEyeAnglesB = vertexRGB[2].TanEyeAnglesB;
- #endif
-
- // vertex.Shade will go negative beyond the edges to produce correct intercept with the 0.0 plane.
- // We want to preserve this, so bias and offset to fit [-1,+1] in a byte.
- // The reverse wll be done in the shader.
- float shade = Alg::Clamp ( vertex.Shade * 0.5f + 0.5f, 0.0f, 1.0f );
- pCurVert->Col.R = (OVR::UByte)( floorf ( shade * 255.999f ) );
- pCurVert->Col.G = pCurVert->Col.R;
- pCurVert->Col.B = pCurVert->Col.R;
- pCurVert->Col.A = (OVR::UByte)( floorf ( vertex.TimewarpLerp * 255.999f ) );
-
- vertexNum++;
- }
- }
- DistortionPinBuffer[eyeNum] = *new Buffer(&RParams);
- DistortionPinBuffer[eyeNum]->Data ( Buffer_Compute, Verts, vertexNum * sizeof(Verts[0]), sizeof(Verts[0]) );
- }
-
- }
- else
- {
- for ( int eyeNum = 0; eyeNum < 2; eyeNum++ )
- {
- // Allocate & generate distortion mesh vertices.
- DistortionPinBuffer[eyeNum] = NULL;
-
- ovrDistortionMesh meshData;
-
- // double startT = ovr_GetTimeInSeconds();
-
- if (!ovrHmd_CreateDistortionMesh( HMD,
- RState.EyeRenderDesc[eyeNum].Eye,
- RState.EyeRenderDesc[eyeNum].Fov,
- RState.DistortionCaps,
- &meshData) )
- {
- OVR_ASSERT(false);
- continue;
- }
-
- // double deltaT = ovr_GetTimeInSeconds() - startT;
- // LogText("GenerateDistortion time = %f\n", deltaT);
-
- // Now parse the vertex data and create a render ready vertex buffer from it
- DistortionVertex * pVBVerts = (DistortionVertex*)OVR_ALLOC ( sizeof(DistortionVertex) * meshData.VertexCount );
- DistortionVertex * pCurVBVert = pVBVerts;
- ovrDistortionVertex* pCurOvrVert = meshData.pVertexData;
-
- for ( unsigned vertNum = 0; vertNum < meshData.VertexCount; vertNum++ )
- {
- pCurVBVert->ScreenPosNDC.x = pCurOvrVert->ScreenPosNDC.x;
- pCurVBVert->ScreenPosNDC.y = pCurOvrVert->ScreenPosNDC.y;
- pCurVBVert->TanEyeAnglesR = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesR);
- pCurVBVert->TanEyeAnglesG = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesG);
- pCurVBVert->TanEyeAnglesB = (*(Vector2f*)&pCurOvrVert->TanEyeAnglesB);
-
- // Convert [0.0f,1.0f] to [0,255]
- if (RState.DistortionCaps & ovrDistortionCap_Vignette)
- pCurVBVert->Col.R = (uint8_t)( Alg::Max ( pCurOvrVert->VignetteFactor, 0.0f ) * 255.99f );
- else
- pCurVBVert->Col.R = 255;
-
- pCurVBVert->Col.G = pCurVBVert->Col.R;
- pCurVBVert->Col.B = pCurVBVert->Col.R;
- pCurVBVert->Col.A = (uint8_t)( pCurOvrVert->TimeWarpFactor * 255.99f );
- pCurOvrVert++;
- pCurVBVert++;
- }
-
- DistortionMeshVBs[eyeNum] = *new Buffer(&RParams);
- DistortionMeshVBs[eyeNum]->Data(Buffer_Vertex | Buffer_ReadOnly, pVBVerts, sizeof(DistortionVertex)* meshData.VertexCount);
- DistortionMeshIBs[eyeNum] = *new Buffer(&RParams);
- DistortionMeshIBs[eyeNum]->Data(Buffer_Index | Buffer_ReadOnly, meshData.pIndexData, (sizeof(INT16)* meshData.IndexCount));
-
- OVR_FREE ( pVBVerts );
- ovrHmd_DestroyDistortionMesh( &meshData );
- }
- }
-
-
- // Uniform buffers
- for(int i = 0; i < Shader_Count; i++)
- {
- UniformBuffers[i] = *new Buffer(&RParams);
- //MaxTextureSet[i] = 0;
- }
-
- initShaders();
-}
-
-void DistortionRenderer::renderDistortion(Texture* leftEyeTexture, Texture* rightEyeTexture)
-{
-
-#if (OVR_D3D_VERSION == 10)
- RParams.pContext->GSSetShader(NULL);
-#else // d3d 11
- RParams.pContext->HSSetShader(NULL, NULL, 0);
- RParams.pContext->DSSetShader(NULL, NULL, 0);
- RParams.pContext->GSSetShader(NULL, NULL, 0);
-#endif
-
- RParams.pContext->RSSetState(Rasterizer);
-
- bool overdriveActive = IsOverdriveActive();
- int currOverdriveTextureIndex = -1;
-
- if(overdriveActive)
- {
- currOverdriveTextureIndex = (LastUsedOverdriveTextureIndex + 1) % NumOverdriveTextures;
- ID3D1xRenderTargetView* distortionRtv = pOverdriveTextures[currOverdriveTextureIndex]->TexRtv.GetRawRef();
- ID3D1xRenderTargetView* mrtRtv[2] = {distortionRtv, RParams.pBackBufferRT};
- RParams.pContext->OMSetRenderTargets(2, mrtRtv, 0);
-
- RParams.pContext->ClearRenderTargetView(distortionRtv, RState.ClearColor);
- }
- else
- {
- RParams.pContext->OMSetRenderTargets(1, &RParams.pBackBufferRT, 0);
- }
-
- // Not affected by viewport.
- RParams.pContext->ClearRenderTargetView(RParams.pBackBufferRT, RState.ClearColor);
-
- setViewport(Recti(0,0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
-
-
- for(int eyeNum = 0; eyeNum < 2; eyeNum++)
- {
- ShaderFill distortionShaderFill(DistortionShader);
- distortionShaderFill.SetTexture(0, eyeNum == 0 ? leftEyeTexture : rightEyeTexture, Shader_Pixel);
-
- if(RState.DistortionCaps & ovrDistortionCap_HqDistortion)
- {
- static float aaDerivMult = 1.0f;
- DistortionShader->SetUniform1f("AaDerivativeMult", aaDerivMult);
- }
- else
- {
- // 0.0 disables high quality anti-aliasing
- DistortionShader->SetUniform1f("AaDerivativeMult", -1.0f);
- }
-
- if(overdriveActive)
- {
- distortionShaderFill.SetTexture(1, pOverdriveTextures[LastUsedOverdriveTextureIndex], Shader_Pixel);
-
- float overdriveScaleRegularRise;
- float overdriveScaleRegularFall;
- GetOverdriveScales(overdriveScaleRegularRise, overdriveScaleRegularFall);
- DistortionShader->SetUniform2f("OverdriveScales", overdriveScaleRegularRise, overdriveScaleRegularFall);
- }
- else
- {
- // -1.0f disables PLO
- DistortionShader->SetUniform2f("OverdriveScales", -1.0f, -1.0f);
- }
-
- distortionShaderFill.SetInputLayout(DistortionVertexIL);
-
- DistortionShader->SetUniform2f("EyeToSourceUVScale", UVScaleOffset[eyeNum][0].x, UVScaleOffset[eyeNum][0].y);
- DistortionShader->SetUniform2f("EyeToSourceUVOffset", UVScaleOffset[eyeNum][1].x, UVScaleOffset[eyeNum][1].y);
-
-
- if (RState.DistortionCaps & ovrDistortionCap_TimeWarp)
- {
- ovrMatrix4f timeWarpMatrices[2];
- ovrHmd_GetEyeTimewarpMatrices(HMD, (ovrEyeType)eyeNum,
- RState.EyeRenderPoses[eyeNum], timeWarpMatrices);
-
- if (RState.DistortionCaps & ovrDistortionCap_ComputeShader)
- {
- DistortionShader->SetUniform3x3f("EyeRotationStart", Matrix4f(timeWarpMatrices[0]));
- DistortionShader->SetUniform3x3f("EyeRotationEnd", Matrix4f(timeWarpMatrices[1]));
- }
- else
- {
- // Can feed identity like matrices incase of concern over timewarp calculations
- DistortionShader->SetUniform4x4f("EyeRotationStart", Matrix4f(timeWarpMatrices[0]));
- DistortionShader->SetUniform4x4f("EyeRotationEnd", Matrix4f(timeWarpMatrices[1]));
- }
- }
-
-
- if (RState.DistortionCaps & ovrDistortionCap_ComputeShader)
- {
-#if (OVR_D3D_VERSION >= 11)
- //RParams.pContext->CSCSSetShaderResources
- //RParams.pContext->CSSetUnorderedAccessViews
- //RParams.pContext->CSSetShader
- //RParams.pContext->CSSetSamplers
- //RParams.pContext->CSSetConstantBuffers
-
-
- // These need to match the values used in the compiled shader
- //const int gridSizeInPixels = 16; // GRID_SIZE_IN_PIXELS
- //const int pinsPerEdge = 128; // PINS_PER_EDGE
- const int nxnBlockSizeInPixels = 2; // NXN_BLOCK_SIZE_PIXELS
- const int simdSquareSize = 16; // SIMD_SQUARE_SIZE
-
- const int invocationSizeInPixels = nxnBlockSizeInPixels * simdSquareSize;
-
- distortionShaderFill.SetTexture(0, eyeNum == 0 ? leftEyeTexture : rightEyeTexture, Shader_Compute);
-
- DistortionShader->SetUniform1f("RightEye", (float)eyeNum);
- DistortionShader->SetUniform1f("UseOverlay", 0.0f); // No overlay supported here.
- DistortionShader->SetUniform1f("FbSizePixelsX", (float)RParams.BackBufferSize.w);
-
- ShaderSet* shaders = distortionShaderFill.GetShaders();
- ShaderBase* cshader = ((ShaderBase*)shaders->GetShader(Shader_Compute));
-
- ID3D1xUnorderedAccessView *uavRendertarget = RParams.pBackBufferUAV;
- int SizeX = RParams.BackBufferSize.w/2;
- int SizeY = RParams.BackBufferSize.h;
-
- int TileNumX = ( SizeX + (invocationSizeInPixels-1) ) / invocationSizeInPixels;
- int TileNumY = ( SizeY + (invocationSizeInPixels-1) ) / invocationSizeInPixels;
-
- RParams.pContext->CSSetUnorderedAccessViews ( 0, 1, &uavRendertarget, NULL );
-
-
- // Incoming eye-buffer textures start at t0 onwards, so set this in slot #4
- // Subtlety - can't put this in slot 0 because fill->Set stops at the first NULL texture.
- ID3D1xShaderResourceView *d3dSrv = DistortionPinBuffer[eyeNum]->GetSrv();
- RParams.pContext->CSSetShaderResources ( 4, 1, &d3dSrv );
-
- // TODO: uniform/constant buffers
- cshader->UpdateBuffer(UniformBuffers[Shader_Compute]);
- cshader->SetUniformBuffer(UniformBuffers[Shader_Compute]);
-
- // Primitive type is ignored for CS.
- // This call actually sets the textures and does pContext->CSSetShader(). Primitive type is ignored.
- distortionShaderFill.Set ( Prim_Unknown );
-
- RParams.pContext->Dispatch ( TileNumX, TileNumY, 1 );
-#else
- OVR_ASSERT ( !"No compute shaders on DX10" );
-#endif
- }
- else
- {
- renderPrimitives(&distortionShaderFill, DistortionMeshVBs[eyeNum], DistortionMeshIBs[eyeNum],
- NULL, 0, (int)DistortionMeshIBs[eyeNum]->GetSize()/2, Prim_Triangles);
- }
- }
-
- LastUsedOverdriveTextureIndex = currOverdriveTextureIndex;
-
- // Re-activate to only draw on back buffer
- if(overdriveActive)
- {
- RParams.pContext->OMSetRenderTargets(1, &RParams.pBackBufferRT, 0);
- }
-}
-
-void DistortionRenderer::createDrawQuad()
-{
- const int numQuadVerts = 4;
- LatencyTesterQuadVB = *new Buffer(&RParams);
- if(!LatencyTesterQuadVB)
- {
- return;
- }
-
- LatencyTesterQuadVB->Data(Buffer_Vertex, NULL, numQuadVerts * sizeof(Vertex));
- Vertex* vertices = (Vertex*)LatencyTesterQuadVB->Map(0, numQuadVerts * sizeof(Vertex), Map_Discard);
- if(!vertices)
- {
- OVR_ASSERT(false); // failed to lock vertex buffer
- return;
- }
-
- const float left = -1.0f;
- const float top = -1.0f;
- const float right = 1.0f;
- const float bottom = 1.0f;
-
- vertices[0] = Vertex(Vector3f(left, top, 0.0f), Color(255, 255, 255, 255));
- vertices[1] = Vertex(Vector3f(left, bottom, 0.0f), Color(255, 255, 255, 255));
- vertices[2] = Vertex(Vector3f(right, top, 0.0f), Color(255, 255, 255, 255));
- vertices[3] = Vertex(Vector3f(right, bottom, 0.0f), Color(255, 255, 255, 255));
-
- LatencyTesterQuadVB->Unmap(vertices);
-}
-
-void DistortionRenderer::renderLatencyQuad(unsigned char* latencyTesterDrawColor)
-{
- const int numQuadVerts = 4;
-
- if(!LatencyTesterQuadVB)
- {
- createDrawQuad();
- }
-
- ShaderFill quadFill(SimpleQuadShader);
- quadFill.SetInputLayout(SimpleQuadVertexIL);
-
- setViewport(Recti(0,0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
-
- float testerLuminance = (float)latencyTesterDrawColor[0] / 255.99f;
- if(SrgbBackBuffer)
- {
- testerLuminance = pow(testerLuminance, 2.2f);
- }
-
- SimpleQuadShader->SetUniform2f("Scale", 0.3f, 0.3f);
- SimpleQuadShader->SetUniform4f("Color", testerLuminance, testerLuminance, testerLuminance, 1.0f);
-
- for(int eyeNum = 0; eyeNum < 2; eyeNum++)
- {
- SimpleQuadShader->SetUniform2f("PositionOffset", eyeNum == 0 ? -0.5f : 0.5f, 0.0f);
- renderPrimitives(&quadFill, LatencyTesterQuadVB, NULL, NULL, 0, numQuadVerts, Prim_TriangleStrip);
- }
-}
-
-void DistortionRenderer::renderLatencyPixel(unsigned char* latencyTesterPixelColor)
-{
- const int numQuadVerts = 4;
-
- if(!LatencyTesterQuadVB)
- {
- createDrawQuad();
- }
-
- ShaderFill quadFill(SimpleQuadShader);
- quadFill.SetInputLayout(SimpleQuadVertexIL);
-
- setViewport(Recti(0,0, RParams.BackBufferSize.w, RParams.BackBufferSize.h));
-
- Vector3f testerColor = Vector3f((float)latencyTesterPixelColor[0] / 255.99f,
- (float)latencyTesterPixelColor[1] / 255.99f,
- (float)latencyTesterPixelColor[2] / 255.99f);
- if(SrgbBackBuffer)
- {
- // 2.2 gamma is close enough for our purposes of matching sRGB
- testerColor.x = pow(testerColor.x, 2.2f);
- testerColor.y = pow(testerColor.y, 2.2f);
- testerColor.z = pow(testerColor.z, 2.2f);
- }
-
-#ifdef OVR_BUILD_DEBUG
- SimpleQuadShader->SetUniform4f("Color", testerColor.x, testerColor.y, testerColor.z, 1.0f);
-
- Vector2f scale(20.0f / RParams.BackBufferSize.w, 20.0f / RParams.BackBufferSize.h);
-#else
- // sending in as gray scale
- SimpleQuadShader->SetUniform4f("Color", testerColor.x, testerColor.x, testerColor.x, 1.0f);
-
- Vector2f scale(1.0f / RParams.BackBufferSize.w, 1.0f / RParams.BackBufferSize.h);
-#endif
- SimpleQuadShader->SetUniform2f("Scale", scale.x, scale.y);
- SimpleQuadShader->SetUniform2f("PositionOffset", 1.0f-scale.x, 1.0f-scale.y);
- renderPrimitives(&quadFill, LatencyTesterQuadVB, NULL, NULL, 0, numQuadVerts, Prim_TriangleStrip);
-}
-
-void DistortionRenderer::renderPrimitives(
- const ShaderFill* fill,
- Buffer* vertices, Buffer* indices,
- Matrix4f* viewMatrix, int offset, int count,
- PrimitiveType rprim)
-{
- OVR_ASSERT(fill->GetInputLayout() != 0);
- RParams.pContext->IASetInputLayout((ID3D1xInputLayout*)fill->GetInputLayout());
-
- if (indices)
- {
- RParams.pContext->IASetIndexBuffer(indices->GetBuffer(), DXGI_FORMAT_R16_UINT, 0);
- }
-
- ID3D1xBuffer* vertexBuffer = vertices->GetBuffer();
- UINT vertexStride = sizeof(Vertex);
- UINT vertexOffset = offset;
- RParams.pContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
-
- ShaderSet* shaders = ((ShaderFill*)fill)->GetShaders();
-
- ShaderBase* vshader = ((ShaderBase*)shaders->GetShader(Shader_Vertex));
- unsigned char* vertexData = vshader->UniformData;
- if (vertexData)
- {
- // TODO: some VSes don't start with StandardUniformData!
- if ( viewMatrix )
- {
- StandardUniformData* stdUniforms = (StandardUniformData*) vertexData;
- stdUniforms->View = viewMatrix->Transposed();
- stdUniforms->Proj = StdUniforms.Proj;
- }
- UniformBuffers[Shader_Vertex]->Data(Buffer_Uniform, vertexData, vshader->UniformsSize);
- vshader->SetUniformBuffer(UniformBuffers[Shader_Vertex]);
- }
-
- for(int i = Shader_Vertex + 1; i < Shader_Count; i++)
- {
- if (shaders->GetShader(i))
- {
- ((ShaderBase*)shaders->GetShader(i))->UpdateBuffer(UniformBuffers[i]);
- ((ShaderBase*)shaders->GetShader(i))->SetUniformBuffer(UniformBuffers[i]);
- }
- }
-
- D3D1X_(PRIMITIVE_TOPOLOGY) prim;
- switch(rprim)
- {
- case Prim_Triangles:
- prim = D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLELIST);
- break;
- case Prim_Lines:
- prim = D3D1X_(PRIMITIVE_TOPOLOGY_LINELIST);
- break;
- case Prim_TriangleStrip:
- prim = D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLESTRIP);
- break;
- default:
- OVR_ASSERT(0);
- return;
- }
- RParams.pContext->IASetPrimitiveTopology(prim);
-
- fill->Set(rprim);
-
- if (indices)
- {
- RParams.pContext->DrawIndexed(count, 0, 0);
- }
- else
- {
- RParams.pContext->Draw(count, 0);
- }
-}
-
-void DistortionRenderer::setViewport(const Recti& vp)
-{
- D3D1x_VIEWPORT d3dvp;
-
- d3dvp.Width = D3DSELECT_10_11(vp.w, (float)vp.w);
- d3dvp.Height = D3DSELECT_10_11(vp.h, (float)vp.h);
- d3dvp.TopLeftX = D3DSELECT_10_11(vp.x, (float)vp.x);
- d3dvp.TopLeftY = D3DSELECT_10_11(vp.y, (float)vp.y);
- d3dvp.MinDepth = 0;
- d3dvp.MaxDepth = 1;
- RParams.pContext->RSSetViewports(1, &d3dvp);
-}
-
-
-
-// Must match struct DistortionVertex
-static D3D1X_(INPUT_ELEMENT_DESC) DistortionMeshVertexDesc[] =
-{
- {"Position", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
- {"TexCoord", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
- {"TexCoord", 1, DXGI_FORMAT_R32G32_FLOAT, 0, 16, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
- {"TexCoord", 2, DXGI_FORMAT_R32G32_FLOAT, 0, 24, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
- {"Color", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, 32, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
-};
-
-static D3D1X_(INPUT_ELEMENT_DESC) SimpleQuadMeshVertexDesc[] =
-{
- {"Position", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D1X_(INPUT_PER_VERTEX_DATA), 0},
-};
-
-
-
-// TODO: this is D3D specific
-void DistortionRenderer::initShaders()
-{
-#if OVR_D3D_VERSION>=11
- if ( ( RState.DistortionCaps & ovrDistortionCap_ComputeShader ) != 0 )
- {
- // Compute shader
- DistortionShader = *new ShaderSet;
-
- int shaderNum = DistortionComputeShader2x2;
- if ( ( RState.EnabledHmdCaps & ovrHmdCap_DirectPentile ) != 0 )
- {
- shaderNum = DistortionComputeShader2x2Pentile;
- }
-
- PrecompiledShader psShaderByteCode = DistortionComputeShaderLookup[shaderNum];
- Ptr<D3D_NS::ComputeShader> cs = *new D3D_NS::ComputeShader(
- &RParams,
- (void*)psShaderByteCode.ShaderData, psShaderByteCode.ShaderSize,
- psShaderByteCode.ReflectionData, psShaderByteCode.ReflectionSize);
-
- DistortionShader->SetShader(cs);
- }
- else
-#endif
- {
- // Vertex + pixel distortion shader.
- PrecompiledShader vsShaderByteCode = DistortionVertexShaderLookup[DistortionVertexShaderBitMask & RState.DistortionCaps];
- Ptr<D3D_NS::VertexShader> vtxShader = *new D3D_NS::VertexShader(
- &RParams,
- (void*)vsShaderByteCode.ShaderData, vsShaderByteCode.ShaderSize,
- vsShaderByteCode.ReflectionData, vsShaderByteCode.ReflectionSize);
-
- DistortionVertexIL = NULL;
- ID3D1xInputLayout** objRef = &DistortionVertexIL.GetRawRef();
-
- HRESULT validate = RParams.pDevice->CreateInputLayout(
- DistortionMeshVertexDesc, sizeof(DistortionMeshVertexDesc) / sizeof(DistortionMeshVertexDesc[0]),
- vsShaderByteCode.ShaderData, vsShaderByteCode.ShaderSize, objRef);
- OVR_UNUSED(validate);
-
- DistortionShader = *new ShaderSet;
- DistortionShader->SetShader(vtxShader);
-
- PrecompiledShader psShaderByteCode = DistortionPixelShaderLookup[DistortionPixelShaderBitMask & RState.DistortionCaps];
-
- Ptr<D3D_NS::PixelShader> ps = *new D3D_NS::PixelShader(
- &RParams,
- (void*)psShaderByteCode.ShaderData, psShaderByteCode.ShaderSize,
- psShaderByteCode.ReflectionData, psShaderByteCode.ReflectionSize);
-
- DistortionShader->SetShader(ps);
- }
-
- {
- Ptr<D3D_NS::VertexShader> vtxShader = *new D3D_NS::VertexShader(
- &RParams,
- (void*)SimpleQuad_vs, sizeof(SimpleQuad_vs),
- SimpleQuad_vs_refl, sizeof(SimpleQuad_vs_refl) / sizeof(SimpleQuad_vs_refl[0]));
- //NULL, 0);
-
- SimpleQuadVertexIL = NULL;
- ID3D1xInputLayout** objRef = &SimpleQuadVertexIL.GetRawRef();
-
- HRESULT validate = RParams.pDevice->CreateInputLayout(
- SimpleQuadMeshVertexDesc, sizeof(SimpleQuadMeshVertexDesc) / sizeof(SimpleQuadMeshVertexDesc[0]),
- (void*)SimpleQuad_vs, sizeof(SimpleQuad_vs), objRef);
- OVR_UNUSED(validate);
-
- SimpleQuadShader = *new ShaderSet;
- SimpleQuadShader->SetShader(vtxShader);
-
- Ptr<D3D_NS::PixelShader> ps = *new D3D_NS::PixelShader(
- &RParams,
- (void*)SimpleQuad_ps, sizeof(SimpleQuad_ps),
- SimpleQuad_ps_refl, sizeof(SimpleQuad_ps_refl) / sizeof(SimpleQuad_ps_refl[0]));
-
- SimpleQuadShader->SetShader(ps);
- }
-}
-
-
-
-ID3D1xSamplerState* DistortionRenderer::getSamplerState(int sm)
-{
- if (SamplerStates[sm])
- return SamplerStates[sm];
-
- D3D1X_(SAMPLER_DESC) ss;
- memset(&ss, 0, sizeof(ss));
- if (sm & Sample_Clamp)
- ss.AddressU = ss.AddressV = ss.AddressW = D3D1X_(TEXTURE_ADDRESS_CLAMP);
- else if (sm & Sample_ClampBorder)
- ss.AddressU = ss.AddressV = ss.AddressW = D3D1X_(TEXTURE_ADDRESS_BORDER);
- else
- ss.AddressU = ss.AddressV = ss.AddressW = D3D1X_(TEXTURE_ADDRESS_WRAP);
-
- if (sm & Sample_Nearest)
- {
- ss.Filter = D3D1X_(FILTER_MIN_MAG_MIP_POINT);
- }
- else if (sm & Sample_Anisotropic)
- {
- ss.Filter = D3D1X_(FILTER_ANISOTROPIC);
- ss.MaxAnisotropy = 4;
- }
- else
- {
- ss.Filter = D3D1X_(FILTER_MIN_MAG_MIP_LINEAR);
- }
- ss.MaxLOD = 15;
- RParams.pDevice->CreateSamplerState(&ss, &SamplerStates[sm].GetRawRef());
- return SamplerStates[sm];
-}
-
-
-void DistortionRenderer::destroy()
-{
- for(int eyeNum = 0; eyeNum < 2; eyeNum++)
- {
- DistortionMeshVBs[eyeNum].Clear();
- DistortionMeshIBs[eyeNum].Clear();
- DistortionPinBuffer[eyeNum].Clear();
- }
-
- DistortionVertexIL.Clear();
-
- if (DistortionShader)
- {
- DistortionShader->UnsetShader(Shader_Vertex);
- DistortionShader->UnsetShader(Shader_Pixel);
- DistortionShader->UnsetShader(Shader_Compute);
- DistortionShader.Clear();
- }
-
- LatencyTesterQuadVB.Clear();
-}
-
-
-DistortionRenderer::GraphicsState::GraphicsState(ID3D1xDeviceContext* c)
-: context(c)
-, memoryCleared(TRUE)
-, rasterizerState(NULL)
-//samplerStates[]
-, inputLayoutState(NULL)
-//psShaderResourceState[]
-//vsShaderResourceState[]
-//psConstantBuffersState[]
-//vsConstantBuffersState[]
-//renderTargetViewState[]
-, depthStencilViewState(NULL)
-, omBlendState(NULL)
-//omBlendFactorState[]
-, omSampleMaskState(0xffffffff)
-, primitiveTopologyState(D3D_PRIMITIVE_TOPOLOGY_UNDEFINED)
-, iaIndexBufferPointerState(NULL)
-, iaIndexBufferFormatState(DXGI_FORMAT_UNKNOWN)
-, iaIndexBufferOffsetState(0)
-//iaVertexBufferPointersState[]
-//iaVertexBufferStridesState[]
-//iaVertexBufferOffsetsState[]
-, currentPixelShader(NULL)
-, currentVertexShader(NULL)
-, currentGeometryShader(NULL)
-#if (OVR_D3D_VERSION == 11)
-, currentHullShader(NULL)
-, currentDomainShader(NULL)
-, currentComputeShader(NULL)
-#endif
-{
- for (int i = 0; i < D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
- {
- psSamplerStates[i] = NULL;
- vsSamplerStates[i] = NULL;
-#if (OVR_D3D_VERSION == 11)
- csSamplerStates[i] = NULL;
-#endif
- }
-
- for (int i = 0; i < D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; i++)
- {
- psShaderResourceState[i] = NULL;
- vsShaderResourceState[i] = NULL;
-#if (OVR_D3D_VERSION == 11)
- csShaderResourceState[i] = NULL;
-#endif
- }
-
- for (int i = 0; i < D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; i++)
- {
- psConstantBuffersState[i] = NULL;
- vsConstantBuffersState[i] = NULL;
-#if (OVR_D3D_VERSION == 11)
- csConstantBuffersState[i] = NULL;
-#endif
- }
-
- for (int i = 0; i < D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
- {
- renderTargetViewState[i] = NULL;
-#if (OVR_D3D_VERSION == 11)
- csUnorderedAccessViewState[i] = NULL;
-#endif
- }
-
- for (int i = 0; i < 4; i++)
- omBlendFactorState[i] = NULL;
-
- for (int i = 0; i < D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; i++)
- {
- iaVertexBufferPointersState[i] = NULL;
- iaVertexBufferStridesState[i] = NULL;
- iaVertexBufferOffsetsState[i] = NULL;
- }
-}
-
-#define SAFE_RELEASE(x) if ( (x) != NULL ) { (x)->Release(); (x)=NULL; }
-
-void DistortionRenderer::GraphicsState::clearMemory()
-{
- SAFE_RELEASE ( rasterizerState );
-
- for (int i = 0; i < D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT; ++i)
- {
- SAFE_RELEASE ( psSamplerStates[i] );
- SAFE_RELEASE ( vsSamplerStates[i] );
-#if (OVR_D3D_VERSION == 11)
- SAFE_RELEASE ( csSamplerStates[i] );
-#endif
- }
-
- SAFE_RELEASE ( inputLayoutState );
-
- for (int i = 0; i < D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT; i++)
- {
- SAFE_RELEASE ( psShaderResourceState[i] );
- SAFE_RELEASE ( vsShaderResourceState[i] );
-#if (OVR_D3D_VERSION == 11)
- SAFE_RELEASE ( csShaderResourceState[i] );
-#endif
- }
-
- for (int i = 0; i < D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT; i++)
- {
- SAFE_RELEASE ( psConstantBuffersState[i] );
- SAFE_RELEASE ( vsConstantBuffersState[i] );
-#if (OVR_D3D_VERSION == 11)
- SAFE_RELEASE ( csConstantBuffersState[i] );
-#endif
- }
-
- for (int i = 0; i < D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT; i++)
- {
- SAFE_RELEASE ( renderTargetViewState[i] );
-#if (OVR_D3D_VERSION == 11)
- SAFE_RELEASE ( csUnorderedAccessViewState[i] );
-#endif
- }
-
- SAFE_RELEASE ( depthStencilViewState );
- SAFE_RELEASE ( omBlendState );
- SAFE_RELEASE ( iaIndexBufferPointerState );
-
- for (int i = 0; i < D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT; i++)
- {
- SAFE_RELEASE ( iaVertexBufferPointersState[i] );
- }
-
- SAFE_RELEASE ( currentPixelShader );
- SAFE_RELEASE ( currentVertexShader );
- SAFE_RELEASE ( currentGeometryShader );
-
-#if (OVR_D3D_VERSION == 11)
- SAFE_RELEASE ( currentHullShader );
- SAFE_RELEASE ( currentDomainShader );
- SAFE_RELEASE ( currentComputeShader );
-#endif
-
- memoryCleared = TRUE;
-}
-
-#undef SAFE_RELEASE
-
-DistortionRenderer::GraphicsState::~GraphicsState()
-{
- clearMemory();
-}
-
-
-void DistortionRenderer::GraphicsState::Save()
-{
- if (!memoryCleared)
- clearMemory();
-
- memoryCleared = FALSE;
-
- context->RSGetState(&rasterizerState);
- context->IAGetInputLayout(&inputLayoutState);
-
- context->PSGetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, psShaderResourceState);
- context->PSGetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, psSamplerStates);
- context->PSGetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, psConstantBuffersState);
-
- context->VSGetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, vsShaderResourceState);
- context->VSGetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, vsSamplerStates);
- context->VSGetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, vsConstantBuffersState);
-
-#if (OVR_D3D_VERSION == 11)
- context->CSGetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, csShaderResourceState);
- context->CSGetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, csSamplerStates);
- context->CSGetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, csConstantBuffersState);
- context->CSGetUnorderedAccessViews(0, D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT, csUnorderedAccessViewState);
-#endif
-
- context->OMGetRenderTargets(D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT, renderTargetViewState, &depthStencilViewState);
-
- context->OMGetBlendState(&omBlendState, omBlendFactorState, &omSampleMaskState);
-
- context->IAGetPrimitiveTopology(&primitiveTopologyState);
-
- context->IAGetIndexBuffer(&iaIndexBufferPointerState, &iaIndexBufferFormatState, &iaIndexBufferOffsetState);
-
- context->IAGetVertexBuffers(0, D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, iaVertexBufferPointersState, iaVertexBufferStridesState, iaVertexBufferOffsetsState);
-
-#if (OVR_D3D_VERSION == 10)
- context->PSGetShader(&currentPixelShader);
- context->VSGetShader(&currentVertexShader);
- context->GSGetShader(&currentGeometryShader);
-#else // Volga says class instance interfaces are very new and almost no one uses them
- context->PSGetShader(&currentPixelShader, NULL, NULL);
- context->VSGetShader(&currentVertexShader, NULL, NULL);
- context->GSGetShader(&currentGeometryShader, NULL, NULL);
- context->HSGetShader(&currentHullShader, NULL, NULL);
- context->DSGetShader(&currentDomainShader, NULL, NULL);
- context->CSGetShader(&currentComputeShader, NULL, NULL);
- /* maybe above doesn't work; then do something with this (must test on dx11)
- ID3D11ClassInstance* blank_array[0];
- UINT blank_uint = 0;
- context->PSGetShader(&currentPixelShader, blank_array, blank_uint);
- context->VSGetShader(&currentVertexShader, blank_array, blank_uint);
- context->GSGetShader(&currentGeometryShader, blank_array, blank_uint);
- context->HSGetShader(&currentHullShader, blank_array, blank_uint);
- context->DSGetShader(&currentDomainShader, blank_array, blank_uint);
- context->CSGetShader(&currentComputeShader, blank_array, blank_uint);
- */
-#endif
-}
-
-
-void DistortionRenderer::GraphicsState::Restore()
-{
- if (rasterizerState != NULL)
- context->RSSetState(rasterizerState);
-
- if (inputLayoutState != NULL)
- context->IASetInputLayout(inputLayoutState);
-
- context->PSSetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, psSamplerStates);
- if (psShaderResourceState != NULL)
- context->PSSetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, psShaderResourceState);
- if (psConstantBuffersState != NULL)
- context->PSSetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, psConstantBuffersState);
-
- context->VSSetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, vsSamplerStates);
- if (vsShaderResourceState != NULL)
- context->VSSetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, vsShaderResourceState);
- if (vsConstantBuffersState != NULL)
- context->VSSetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, vsConstantBuffersState);
-
-#if (OVR_D3D_VERSION == 11)
- context->CSSetSamplers(0, D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT, csSamplerStates);
- if (csShaderResourceState != NULL)
- context->CSSetShaderResources(0, D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT, csShaderResourceState);
- if (csConstantBuffersState != NULL)
- context->CSSetConstantBuffers(0, D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT, csConstantBuffersState);
- if (csUnorderedAccessViewState != NULL)
- context->CSSetUnorderedAccessViews(0, D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT, csUnorderedAccessViewState, NULL);
-#endif
-
- if (depthStencilViewState != NULL || renderTargetViewState != NULL)
- context->OMSetRenderTargets(D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT, renderTargetViewState, depthStencilViewState);
-
- if (omBlendState != NULL)
- context->OMSetBlendState(omBlendState, omBlendFactorState, omSampleMaskState);
-
- context->IASetPrimitiveTopology(primitiveTopologyState);
-
- if (iaIndexBufferPointerState != NULL)
- context->IASetIndexBuffer(iaIndexBufferPointerState, iaIndexBufferFormatState, iaIndexBufferOffsetState);
-
- if (iaVertexBufferPointersState != NULL)
- context->IASetVertexBuffers(0, D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT, iaVertexBufferPointersState, iaVertexBufferStridesState, iaVertexBufferOffsetsState);
-
-#if (OVR_D3D_VERSION == 10)
- if (currentPixelShader != NULL)
- context->PSSetShader(currentPixelShader);
- if (currentVertexShader != NULL)
- context->VSSetShader(currentVertexShader);
- if (currentGeometryShader != NULL)
- context->GSSetShader(currentGeometryShader);
-#else
- if (currentPixelShader != NULL)
- context->PSSetShader(currentPixelShader, NULL, 0);
- if (currentVertexShader != NULL)
- context->VSSetShader(currentVertexShader, NULL, 0);
- if (currentGeometryShader != NULL)
- context->GSSetShader(currentGeometryShader, NULL, 0);
- if (currentHullShader != NULL)
- context->HSSetShader(currentHullShader, NULL, 0);
- if (currentDomainShader != NULL)
- context->DSSetShader(currentDomainShader, NULL, 0);
- if (currentComputeShader != NULL)
- context->CSSetShader(currentComputeShader, NULL, 0);
-#endif
- clearMemory();
-}
-
-}}} // OVR::CAPI::D3D1X
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.h
deleted file mode 100644
index 0bbf049..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_DistortionRenderer.h
+++ /dev/null
@@ -1,202 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_DistortionRenderer.h
-Content : Experimental distortion renderer
-Created : November 11, 2013
-Authors : Volga Aksoy
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-// No include guard, since this fill will be multiply-included.
-//#ifndef OVR_CAPI_D3D1X_DistortionRenderer_h
-
-#include "CAPI_D3D1X_Util.h"
-#include "../CAPI_DistortionRenderer.h"
-
-#include "../../Kernel/OVR_Log.h"
-
-namespace OVR { namespace CAPI { namespace D3D_NS {
-
-
-// ***** D3D1X::DistortionRenderer
-
-// Implementation of DistortionRenderer for D3D10/11.
-
-class DistortionRenderer : public CAPI::DistortionRenderer
-{
-public:
- DistortionRenderer(ovrHmd hmd,
- FrameTimeManager& timeManager,
- const HMDRenderState& renderState);
- ~DistortionRenderer();
-
-
- // Creation function for the device.
- static CAPI::DistortionRenderer* Create(ovrHmd hmd,
- FrameTimeManager& timeManager,
- const HMDRenderState& renderState);
-
-
- // ***** Public DistortionRenderer interface
-
- virtual bool Initialize(const ovrRenderAPIConfig* apiConfig) OVR_OVERRIDE;
-
- virtual void SubmitEye(int eyeId, const ovrTexture* eyeTexture);
-
- virtual void EndFrame(bool swapBuffers);
-
- // TBD: Make public?
- void WaitUntilGpuIdle();
-
- // Similar to ovr_WaitTillTime but it also flushes GPU.
- // Note, it exits when time expires, even if GPU is not in idle state yet.
- double FlushGpuAndWaitTillTime(double absTime);
-
-protected:
-
- class GraphicsState : public CAPI::DistortionRenderer::GraphicsState
- {
- public:
- GraphicsState(ID3D1xDeviceContext* context);
- virtual ~GraphicsState();
- virtual void clearMemory();
- virtual void Save();
- virtual void Restore();
-
- protected:
- ID3D1xDeviceContext* context;
- BOOL memoryCleared;
-
- ID3D1xRasterizerState* rasterizerState;
- ID3D1xInputLayout* inputLayoutState;
-
- ID3D1xShaderResourceView* psShaderResourceState[D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
- ID3D1xSamplerState* psSamplerStates[D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT];
- ID3D1xBuffer* psConstantBuffersState[D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
-
- ID3D1xShaderResourceView* vsShaderResourceState[D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
- ID3D1xSamplerState* vsSamplerStates[D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT];
- ID3D1xBuffer* vsConstantBuffersState[D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
-
-#if (OVR_D3D_VERSION == 11)
- ID3D1xShaderResourceView* csShaderResourceState[D3D1x_COMMONSHADER_INPUT_RESOURCE_SLOT_COUNT];
- ID3D1xSamplerState* csSamplerStates[D3D1x_COMMONSHADER_SAMPLER_SLOT_COUNT];
- ID3D1xBuffer* csConstantBuffersState[D3D1x_COMMONSHADER_CONSTANT_BUFFER_API_SLOT_COUNT];
- ID3D1xUnorderedAccessView* csUnorderedAccessViewState[D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT];
-#endif
-
- ID3D1xRenderTargetView* renderTargetViewState[D3D1x_SIMULTANEOUS_RENDER_TARGET_COUNT];
- ID3D1xDepthStencilView* depthStencilViewState;
-
- ID3D1xBlendState* omBlendState;
- FLOAT omBlendFactorState[4];
- UINT omSampleMaskState;
-
- D3D1x_PRIMITIVE_TOPOLOGY primitiveTopologyState;
-
- ID3D1xBuffer* iaIndexBufferPointerState;
- DXGI_FORMAT iaIndexBufferFormatState;
- UINT iaIndexBufferOffsetState;
-
- ID3D1xBuffer* iaVertexBufferPointersState[D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
- UINT iaVertexBufferStridesState[D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
- UINT iaVertexBufferOffsetsState[D3D1x_IA_VERTEX_INPUT_RESOURCE_SLOT_COUNT];
-
- ID3D1xPixelShader* currentPixelShader;
- ID3D1xVertexShader* currentVertexShader;
- ID3D1xGeometryShader* currentGeometryShader;
-#if (OVR_D3D_VERSION == 11)
- ID3D11HullShader* currentHullShader;
- ID3D11DomainShader* currentDomainShader;
- ID3D11ComputeShader* currentComputeShader;
-#endif
-
- };
-
-private:
- // Helpers
- void initBuffersAndShaders();
- void initShaders();
- void initFullscreenQuad();
- void initOverdrive();
- void destroy();
-
- void setViewport(const Recti& vp);
-
- void renderDistortion(Texture* leftEyeTexture, Texture* rightEyeTexture);
-
- void renderPrimitives(const ShaderFill* fill, Buffer* vertices, Buffer* indices,
- Matrix4f* viewMatrix, int offset, int count,
- PrimitiveType rprim);
-
- void renderEndFrame();
-
- void createDrawQuad();
- void renderLatencyQuad(unsigned char* latencyTesterDrawColor);
- void renderLatencyPixel(unsigned char* latencyTesterPixelColor);
-
- // Create or get cached D3D sampler based on flags.
- ID3D1xSamplerState* getSamplerState(int sm);
-
-
- //// TBD: Should we be using oe from RState instead?
- //unsigned DistortionCaps;
-
- // Back buffer is properly set as an SRGB format?
- bool SrgbBackBuffer;
-
- // D3DX device and utility variables.
- RenderParams RParams;
- Ptr<Texture> pEyeTextures[2];
-
- // U,V scale and offset needed for timewarp.
- ovrVector2f UVScaleOffset[2][2];
- ovrSizei EyeTextureSize[2];
- ovrRecti EyeRenderViewport[2];
-
- Ptr<Texture> pOverdriveTextures[NumOverdriveTextures];
-
- //Ptr<Buffer> mpFullScreenVertexBuffer;
-
- Ptr<Buffer> DistortionMeshVBs[2]; // one per-eye
- Ptr<Buffer> DistortionMeshIBs[2]; // one per-eye
- Ptr<Buffer> DistortionPinBuffer[2]; // one per-eye
-
- Ptr<ShaderSet> DistortionShader;
- Ptr<ID3D1xInputLayout> DistortionVertexIL;
-
- struct StandardUniformData
- {
- Matrix4f Proj;
- Matrix4f View;
- } StdUniforms;
- Ptr<Buffer> UniformBuffers[Shader_Count];
-
- Ptr<ID3D1xSamplerState> SamplerStates[Sample_Count];
- Ptr<ID3D1xRasterizerState> Rasterizer;
-
- Ptr<Buffer> LatencyTesterQuadVB;
- Ptr<ShaderSet> SimpleQuadShader;
- Ptr<ID3D1xInputLayout> SimpleQuadVertexIL;
-
- GpuTimer GpuProfiler;
-};
-
-}}} // OVR::CAPI::D3D1X
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp
deleted file mode 100644
index 61f915f..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.cpp
+++ /dev/null
@@ -1,595 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_HSWDisplay.cpp
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 file is intended to be #included by CAPI_D3D10_HSWDisplay.cpp or CAPI_D3D11_HSWDisplay.cpp,
-// which define OVR_D3D_VERSION to 10 or 11 respectively.
-#if defined(OVR_D3D_VERSION) && ((OVR_D3D_VERSION == 10) || (OVR_D3D_VERSION == 11))
-
-#define _WINSOCKAPI_ // Prevents <Windows.h> from #including <Winsock.h>, as we need the app to use <Winsock2.h> instead.
-#include "../../Kernel/OVR_Types.h"
-#include "../../OVR_CAPI_D3D.h" // OVR_D3D_VERSION will have been defined by who included us.
-#include "CAPI_D3D1X_HSWDisplay.h"
-#include "../../Kernel/OVR_File.h"
-#include "../../Kernel/OVR_SysFile.h"
-#include "../../Kernel/OVR_Math.h"
-#include "../../Kernel/OVR_Allocator.h"
-#include "../../Kernel/OVR_Color.h"
-
-// We currently borrow the SimpleQuad shaders
-#include "Shaders/SimpleTexturedQuad_vs.h"
-#include "Shaders/SimpleTexturedQuad_vs_refl.h"
-#include "Shaders/SimpleTexturedQuad_ps.h"
-#include "Shaders/SimpleTexturedQuad_ps_refl.h"
-
-
-/*
-#include <d3dcompiler.h>
-
-ID3D10Blob* CompileShader(const char* profile, const char* src, const char* mainName = "main")
-{
- ID3D10Blob* shader = NULL;
- ID3D10Blob* errors = NULL;
- HRESULT hr = D3DCompile(src, strlen(src), NULL, NULL, NULL, mainName, profile, 0, 0, &shader, &errors);
-
- OVR_ASSERT(SUCCEEDED(hr));
- if (FAILED(hr))
- {
- shader = NULL;
- OVR_DEBUG_LOG(("Compiling D3D shader for %s failed\n%s\n\n%s", profile, src, errors->GetBufferPointer()));
- }
-
- if (errors)
- errors->Release();
-
- return shader;
-}
-*/
-
-
-
-// For a given DXGI format: if the format is a typeless one then this function returns a
-// suitable typed one. If the format is a typed one then this function returns it as-is.
-static DXGI_FORMAT GetFullyTypedDXGIFormat(DXGI_FORMAT textureFormat)
-{
- // http://msdn.microsoft.com/en-us/library/windows/desktop/bb173059%28v=vs.85%29.aspx
-
- DXGI_FORMAT fullyTypedFormat = textureFormat;
-
- switch(textureFormat)
- {
- case DXGI_FORMAT_R32G32B32A32_TYPELESS:
- return DXGI_FORMAT_R32G32B32A32_FLOAT; // or DXGI_FORMAT_R32G32B32A32_UINT, DXGI_FORMAT_R32G32B32A32_SINT
-
- case DXGI_FORMAT_R32G32B32_TYPELESS:
- return DXGI_FORMAT_R32G32B32_FLOAT; // or DXGI_FORMAT_R32G32B32_UINT, DXGI_FORMAT_R32G32B32_SINT
-
- case DXGI_FORMAT_R16G16B16A16_TYPELESS:
- return DXGI_FORMAT_R16G16B16A16_UNORM; // or DXGI_FORMAT_R16G16B16A16_FLOAT, DXGI_FORMAT_R16G16B16A16_UINT, DXGI_FORMAT_R16G16B16A16_SNORM, DXGI_FORMAT_R16G16B16A16_SINT
-
- case DXGI_FORMAT_R8G8B8A8_TYPELESS:
- return DXGI_FORMAT_R8G8B8A8_UNORM; // or DXGI_FORMAT_R8G8B8A8_UNORM_SRGB, DXGI_FORMAT_R8G8B8A8_UINT, DXGI_FORMAT_R8G8B8A8_SNORM, DXGI_FORMAT_R8G8B8A8_SINT
-
- case DXGI_FORMAT_B8G8R8A8_TYPELESS:
- return DXGI_FORMAT_B8G8R8A8_UNORM_SRGB;
-
- case DXGI_FORMAT_B8G8R8X8_TYPELESS:
- return DXGI_FORMAT_B8G8R8X8_UNORM_SRGB;
-
- // Others which we don't currently support:
- //case DXGI_FORMAT_R32G32_TYPELESS:
- //case DXGI_FORMAT_R32G8X24_TYPELESS:
- //case DXGI_FORMAT_R32_FLOAT_X8X24_TYPELESS:
- //case DXGI_FORMAT_X32_TYPELESS_G8X24_UINT:
- //case DXGI_FORMAT_R10G10B10A2_TYPELESS:
- //case DXGI_FORMAT_R16G16_TYPELESS:
- //case DXGI_FORMAT_R32_TYPELESS:
- //case DXGI_FORMAT_R24G8_TYPELESS:
- //case DXGI_FORMAT_R24_UNORM_X8_TYPELESS:
- //case DXGI_FORMAT_X24_TYPELESS_G8_UINT:
- //case DXGI_FORMAT_R8G8_TYPELESS:
- //case DXGI_FORMAT_R16_TYPELESS:
- //case DXGI_FORMAT_R8_TYPELESS:
- //case DXGI_FORMAT_BC1_TYPELESS:
- //case DXGI_FORMAT_BC2_TYPELESS:
- //case DXGI_FORMAT_BC3_TYPELESS:
- //case DXGI_FORMAT_BC4_TYPELESS:
- //case DXGI_FORMAT_BC5_TYPELESS:
- //case DXGI_FORMAT_BC6H_TYPELESS:
- //case DXGI_FORMAT_BC7_TYPELESS:
- }
-
- return fullyTypedFormat;
-}
-
-
-
-namespace OVR { namespace CAPI {
-
-// To do Need to move LoadTextureTgaData to a shared location.
-uint8_t* LoadTextureTgaData(OVR::File* f, uint8_t alpha, int& width, int& height);
-
-
-namespace D3D_NS {
-
-// This is a temporary function implementation, and it functionality needs to be implemented in a more generic way.
-Texture* LoadTextureTga(RenderParams& rParams, ID3D1xSamplerState* pSamplerState, OVR::File* f, uint8_t alpha)
-{
- OVR::CAPI::D3D_NS::Texture* pTexture = NULL;
-
- int width, height;
- const uint8_t* pRGBA = LoadTextureTgaData(f, alpha, width, height);
-
- if (pRGBA)
- {
- pTexture = new OVR::CAPI::D3D_NS::Texture(&rParams, OVR::CAPI::D3D_NS::Texture_RGBA, OVR::Sizei(0,0), pSamplerState, 1);
-
- // Create the D3D texture
- D3D1X_(TEXTURE2D_DESC) dsDesc;
- dsDesc.Width = width;
- dsDesc.Height = height;
- dsDesc.MipLevels = 1;
- dsDesc.ArraySize = 1;
- dsDesc.Format = DXGI_FORMAT_R8G8B8A8_UNORM;
- dsDesc.SampleDesc.Count = 1;
- dsDesc.SampleDesc.Quality = 0;
- dsDesc.Usage = D3D1X_(USAGE_DEFAULT);
- dsDesc.BindFlags = D3D1X_(BIND_SHADER_RESOURCE);
- dsDesc.CPUAccessFlags = 0;
- dsDesc.MiscFlags = 0;
-
- HRESULT hr = rParams.pDevice->CreateTexture2D(&dsDesc, NULL, &pTexture->Tex.GetRawRef());
-
- if (SUCCEEDED(hr))
- {
- if (dsDesc.BindFlags & D3D1X_(BIND_SHADER_RESOURCE))
- rParams.pDevice->CreateShaderResourceView(pTexture->Tex, NULL, &pTexture->TexSv.GetRawRef());
-
- rParams.pContext->UpdateSubresource(pTexture->Tex, 0, NULL, pRGBA, width * 4, width * height * 4);
- }
- else
- {
- OVR_DEBUG_LOG_TEXT(("[LoadTextureTga] CreateTexture2D failed"));
- pTexture->Release();
- }
-
- OVR_FREE(const_cast<uint8_t*>(pRGBA));
- }
-
- return pTexture;
-}
-
-
-// Loads a texture from a memory image of a TGA file.
-Texture* LoadTextureTga(RenderParams& rParams, ID3D1xSamplerState* pSamplerState, const uint8_t* pData, int dataSize, uint8_t alpha)
-{
- MemoryFile memoryFile("", pData, dataSize);
-
- return LoadTextureTga(rParams, pSamplerState, &memoryFile, alpha);
-}
-
-
-// Loads a texture from a disk TGA file.
-Texture* LoadTextureTga(RenderParams& rParams, ID3D1xSamplerState* pSamplerState, const char* pFilePath, uint8_t alpha)
-{
- SysFile sysFile;
-
- if(sysFile.Open(pFilePath, FileConstants::Open_Read | FileConstants::Open_Buffered))
- return LoadTextureTga(rParams, pSamplerState, &sysFile, alpha);
-
- return NULL;
-}
-
-
-
-// To do: This needs to be promoted to a central version, possibly in CAPI_HSWDisplay.h
-struct HASWVertex
-{
- Vector3f Pos;
- Color C;
- float U, V;
-
- HASWVertex(const Vector3f& p, const Color& c = Color(64,0,0,255), float u = 0, float v = 0)
- : Pos(p), C(c), U(u), V(v)
- {}
-
- HASWVertex(float x, float y, float z, const Color& c = Color(64,0,0,255), float u = 0, float v = 0)
- : Pos(x,y,z), C(c), U(u), V(v)
- {}
-
- bool operator==(const HASWVertex& b) const
- {
- return (Pos == b.Pos) && (C == b.C) && (U == b.U) && (V == b.V);
- }
-};
-
-
-
-// The texture below may conceivably be shared between HSWDisplay instances. However,
-// beware that sharing may not be possible if two HMDs are using different locales
-// simultaneously. As of this writing it's not clear if that can occur in practice.
-
-HSWDisplay::HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState)
- : OVR::CAPI::HSWDisplay(api, hmd, renderState),
- RenderParams()
-{
-}
-
-bool HSWDisplay::Initialize(const ovrRenderAPIConfig* apiConfig)
-{
- #if (OVR_D3D_VERSION == 10)
- const ovrD3D10Config* config = reinterpret_cast<const ovrD3D10Config*>(apiConfig);
- #else
- const ovrD3D11Config* config = reinterpret_cast<const ovrD3D11Config*>(apiConfig);
- #endif
-
- if(config)
- {
- RenderParams.pDevice = config->D3D_NS.pDevice;
-#if (OVR_D3D_VERSION == 10)
- RenderParams.pContext = config->D3D10.pDevice;
- RenderParams.pBackBufferUAV = NULL;
-#else
- RenderParams.pContext = config->D3D11.pDeviceContext;
- RenderParams.pBackBufferUAV = config->D3D_NS.pBackBufferUAV;
-#endif
- RenderParams.pBackBufferRT = config->D3D_NS.pBackBufferRT;
- RenderParams.pSwapChain = config->D3D_NS.pSwapChain;
- RenderParams.BackBufferSize = config->D3D_NS.Header.BackBufferSize;
- RenderParams.Multisample = config->D3D_NS.Header.Multisample;
-
- // We may want to create RasterizerState, or alternatively let the DistortionRenderer handle it.
- }
- // else do any necessary cleanup
-
- return true;
-}
-
-void HSWDisplay::Shutdown()
-{
- UnloadGraphics();
-}
-
-
-void HSWDisplay::DisplayInternal()
-{
- HSWDISPLAY_LOG(("[HSWDisplay D3D1x] DisplayInternal()"));
- // We may want to call LoadGraphics here instead of within Render.
-}
-
-
-void HSWDisplay::DismissInternal()
-{
- HSWDISPLAY_LOG(("[HSWDisplay D3D1x] DismissInternal()"));
- UnloadGraphics();
-}
-
-
-void HSWDisplay::UnloadGraphics()
-{
- //RenderParams: nothing to do.
- pSamplerState.Clear();
- pTexture.Clear();
- pVB.Clear();
- for(size_t i = 0; i < OVR_ARRAY_COUNT(UniformBufferArray); i++)
- UniformBufferArray[i].Clear();
- pShaderSet.Clear();
- pVertexInputLayout.Clear();
- pBlendState.Clear();
- pRasterizerState.Clear();
- // OrthoProjection: No need to clear.
-}
-
-void HSWDisplay::LoadGraphics()
-{
- // Load the graphics if not loaded already.
- if(!pSamplerState)
- {
- D3D1X_(SAMPLER_DESC) sDesc;
-
- memset(&sDesc, 0, sizeof(sDesc));
- sDesc.Filter = D3D1X_(FILTER_MIN_MAG_MIP_LINEAR);
- sDesc.AddressU = D3D1X_(TEXTURE_ADDRESS_CLAMP);
- sDesc.AddressV = D3D1X_(TEXTURE_ADDRESS_CLAMP);
- sDesc.AddressW = D3D1X_(TEXTURE_ADDRESS_CLAMP);
-
- RenderParams.pDevice->CreateSamplerState(&sDesc, &pSamplerState.GetRawRef());
- }
-
- #if defined(OVR_BUILD_DEBUG)
- if(!pTexture)
- pTexture = *LoadTextureTga(RenderParams, pSamplerState, "C:\\TestPath\\TestFile.tga", 255);
- #endif
-
- if(!pTexture) // To do: Add support for .dds files, which would be significantly smaller than the size of the tga.
- {
- size_t textureSize;
- const uint8_t* TextureData = GetDefaultTexture(textureSize);
- pTexture = *LoadTextureTga(RenderParams, pSamplerState, TextureData, (int)textureSize, 255);
- }
-
- if(!UniformBufferArray[0])
- {
- for(size_t i = 0; i < OVR_ARRAY_COUNT(UniformBufferArray); i++)
- UniformBufferArray[i] = *new Buffer(&RenderParams);
- }
-
- if(!pShaderSet)
- {
- pShaderSet = *new ShaderSet;
-
- // Setup the vertex shader
- const D3D1X_(INPUT_ELEMENT_DESC) VertexDescription[] = {
- { "Position", 0, DXGI_FORMAT_R32G32B32_FLOAT, 0, offsetof(HASWVertex, Pos), D3D1X_(INPUT_PER_VERTEX_DATA), 0 },
- { "Color", 0, DXGI_FORMAT_R8G8B8A8_UNORM, 0, offsetof(HASWVertex, C), D3D1X_(INPUT_PER_VERTEX_DATA), 0 },
- { "TexCoord", 0, DXGI_FORMAT_R32G32_FLOAT, 0, offsetof(HASWVertex, U), D3D1X_(INPUT_PER_VERTEX_DATA), 0 }
- };
-
- Ptr<D3D_NS::VertexShader> vs = *new D3D_NS::VertexShader(&RenderParams, (void*)SimpleTexturedQuad_vs, sizeof(SimpleTexturedQuad_vs), SimpleTexturedQuad_vs_refl, OVR_ARRAY_COUNT(SimpleTexturedQuad_vs_refl));
- pVertexInputLayout = NULL; // Make sure it's cleared in case it wasn't.
- ID3D1xInputLayout** ppD3DInputLayout = &pVertexInputLayout.GetRawRef();
- HRESULT hResult = RenderParams.pDevice->CreateInputLayout(VertexDescription, OVR_ARRAY_COUNT(VertexDescription), SimpleTexturedQuad_vs, sizeof(SimpleTexturedQuad_vs), ppD3DInputLayout);
- OVR_ASSERT(SUCCEEDED(hResult));
- if(SUCCEEDED(hResult))
- pShaderSet->SetShader(vs);
-
- // Setup the pixel shader
- Ptr<D3D_NS::PixelShader> ps = *new D3D_NS::PixelShader(&RenderParams, (void*)SimpleTexturedQuad_ps, sizeof(SimpleTexturedQuad_ps), SimpleTexturedQuad_ps_refl, OVR_ARRAY_COUNT(SimpleTexturedQuad_ps_refl));
- pShaderSet->SetShader(ps);
-
- if(!pBlendState)
- {
- D3D1X_(BLEND_DESC) bm;
- memset(&bm, 0, sizeof(bm));
- #if (OVR_D3D_VERSION == 10)
- bm.BlendEnable[0] = TRUE;
- bm.BlendOp = bm.BlendOpAlpha = D3D1X_(BLEND_OP_ADD);
- bm.SrcBlend = bm.SrcBlendAlpha = D3D1X_(BLEND_SRC_ALPHA);
- bm.DestBlend = bm.DestBlendAlpha = D3D1X_(BLEND_INV_SRC_ALPHA);
- bm.RenderTargetWriteMask[0] = D3D1X_(COLOR_WRITE_ENABLE_ALL);
- #else
- bm.RenderTarget[0].BlendEnable = TRUE;
- bm.RenderTarget[0].BlendOp = bm.RenderTarget[0].BlendOpAlpha = D3D1X_(BLEND_OP_ADD);
- bm.RenderTarget[0].SrcBlend = bm.RenderTarget[0].SrcBlendAlpha = D3D1X_(BLEND_SRC_ALPHA);
- bm.RenderTarget[0].DestBlend = bm.RenderTarget[0].DestBlendAlpha = D3D1X_(BLEND_INV_SRC_ALPHA);
- bm.RenderTarget[0].RenderTargetWriteMask = D3D1X_(COLOR_WRITE_ENABLE_ALL);
- #endif
-
- RenderParams.pDevice->CreateBlendState(&bm, &pBlendState.GetRawRef());
- }
-
- if(!pRasterizerState)
- {
- D3D1X_(RASTERIZER_DESC) rs;
- memset(&rs, 0, sizeof(rs));
- rs.AntialiasedLineEnable = true;
- rs.CullMode = D3D1X_(CULL_BACK);
- rs.DepthClipEnable = true;
- rs.FillMode = D3D1X_(FILL_SOLID);
-
- RenderParams.pDevice->CreateRasterizerState(&rs, &pRasterizerState.GetRawRef());
- }
- }
-
- if(!pVB)
- {
- pVB = *new Buffer(&RenderParams);
-
- if(pVB)
- {
- const size_t vertexCount = 4;
-
- pVB->Data(Buffer_Vertex, NULL, vertexCount * sizeof(HASWVertex));
- HASWVertex* pVertices = (HASWVertex*)pVB->Map(0, vertexCount * sizeof(HASWVertex), Map_Discard);
- OVR_ASSERT(pVertices);
-
- if(pVertices)
- {
- const bool flip = ((RenderState.DistortionCaps & ovrDistortionCap_FlipInput) != 0);
- const float left = -1.0f; // We currently draw this in normalized device coordinates with an stereo translation
- const float top = -1.1f; // applied as a vertex shader uniform. In the future when we have a more formal graphics
- const float right = 1.0f; // API abstraction we may move this draw to an overlay layer or to a more formal
- const float bottom = 0.9f; // model/mesh scheme with a perspective projection.
-
- pVertices[0] = HASWVertex(left, top, 0.f, Color(255, 255, 255, 255), 0.f, flip ? 1.f : 0.f);
- pVertices[1] = HASWVertex(left, bottom, 0.f, Color(255, 255, 255, 255), 0.f, flip ? 0.f : 1.f);
- pVertices[2] = HASWVertex(right, top, 0.f, Color(255, 255, 255, 255), 1.f, flip ? 1.f : 0.f);
- pVertices[3] = HASWVertex(right, bottom, 0.f, Color(255, 255, 255, 255), 1.f, flip ? 0.f : 1.f);
-
- pVB->Unmap(pVertices);
- }
- }
- }
-}
-
-
-// Note: If we are drawing this warning onto the eye texture before distortion, the "time warp" functionality
-// will cause the warning to shake on the screen when the user moves their head. One solution is to disable
-// time warping while the warning or any screen-static GUI elements are present.
-
-void HSWDisplay::RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture)
-{
- if(RenderEnabled && eyeTexture)
- {
- // We need to render to the eyeTexture with the texture viewport.
- // Setup rendering to the texture.
- ovrD3D1X(Texture)* eyeTextureD3D = const_cast<ovrD3D1X(Texture)*>(reinterpret_cast<const ovrD3D1X(Texture)*>(eyeTexture));
- OVR_ASSERT(eyeTextureD3D->Texture.Header.API == ((OVR_D3D_VERSION == 10) ? ovrRenderAPI_D3D10 : ovrRenderAPI_D3D11));
-
- // D3D10 is currently disabled while we track down a bug that results in a black screen.
- //if(eyeTextureD3D->Texture.Header.API == ovrRenderAPI_D3D10)
- // return;
-
- // Load the graphics if not loaded already.
- if(!pVB)
- LoadGraphics();
-
- // Calculate ortho projection.
- GetOrthoProjection(RenderState, OrthoProjection);
-
- // Save settings
- // To do: Merge this saved state with that done by DistortionRenderer::GraphicsState::Save(), and put them in a shared location.
- Ptr<ID3D1xBlendState> pBlendStateSaved;
- FLOAT blendFactorSaved[4];
- UINT blendSampleMaskSaved;
- RenderParams.pContext->OMGetBlendState(&pBlendStateSaved.GetRawRef(), blendFactorSaved, &blendSampleMaskSaved);
-
- Ptr<ID3D1xRasterizerState> pRasterizerStateSaved;
- RenderParams.pContext->RSGetState(&pRasterizerStateSaved.GetRawRef());
-
- Ptr<ID3D1xRenderTargetView> pTextureRenderTargetViewSaved;
- Ptr<ID3D1xDepthStencilView> pDepthStencilViewSaved;
- RenderParams.pContext->OMGetRenderTargets(1, &pTextureRenderTargetViewSaved.GetRawRef(), &pDepthStencilViewSaved.GetRawRef());
-
- #ifndef D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE // D3D10 doesn't define this, so we pretend that it does.
- #define D3D10_VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE 4
- #endif
- D3D1x_VIEWPORT d3dViewportSaved[D3D1X_(VIEWPORT_AND_SCISSORRECT_OBJECT_COUNT_PER_PIPELINE)];
- UINT viewportCountSaved = OVR_ARRAY_COUNT(d3dViewportSaved);
- RenderParams.pContext->RSGetViewports(&viewportCountSaved, d3dViewportSaved);
-
- UINT stencilRefSaved;
- Ptr<ID3D1xDepthStencilState> pDepthStencilStateSaved;
- RenderParams.pContext->OMGetDepthStencilState(&pDepthStencilStateSaved.GetRawRef(), &stencilRefSaved);
-
- Ptr<ID3D1xInputLayout> pInputLayoutSaved;
- RenderParams.pContext->IAGetInputLayout(&pInputLayoutSaved.GetRawRef());
-
- Ptr<ID3D1xBuffer> pVertexBufferSaved;
- UINT vertexStrideSaved[1];
- UINT vertexOffsetSaved[1];
- RenderParams.pContext->IAGetVertexBuffers(0, 1, &pVertexBufferSaved.GetRawRef(), vertexStrideSaved, vertexOffsetSaved);
-
- D3D1X_(PRIMITIVE_TOPOLOGY) topologySaved;
- RenderParams.pContext->IAGetPrimitiveTopology(&topologySaved);
-
-
- // Set our settings
- RenderParams.pContext->OMSetBlendState(pBlendState, NULL, 0xffffffff);
- RenderParams.pContext->RSSetState(pRasterizerState);
-
- // We can't necessarily use a NULL D3D11_RENDER_TARGET_VIEW_DESC argument to CreateRenderTargetView, because we are rendering to
- // a texture that somebody else created and which may have been created in a typeless format (e.g. DXGI_FORMAT_R8G8B8A8_TYPELESS).
- // So what we do is check to see if the texture format is a typeless format and if see we pass a suitable D3D11_RENDER_TARGET_VIEW_DESC
- // to CreateRenderTargetView instead of NULL.
- D3D1X_(TEXTURE2D_DESC) texture2DDesc;
- eyeTextureD3D->D3D_NS.pTexture->GetDesc(&texture2DDesc);
-
- D3D1X_(RENDER_TARGET_VIEW_DESC) renderTargetViewDesc;
- memset(&renderTargetViewDesc, 0, sizeof(renderTargetViewDesc));
- renderTargetViewDesc.Format = GetFullyTypedDXGIFormat(texture2DDesc.Format); // DXGI_FORMAT. If this is a typeless format then GetFullyTypedFormat converts it to a fully typed format.
- renderTargetViewDesc.ViewDimension = (texture2DDesc.SampleDesc.Count > 1) ? D3D1X_(RTV_DIMENSION_TEXTURE2DMS) : D3D1X_(RTV_DIMENSION_TEXTURE2D);
- renderTargetViewDesc.Texture2D.MipSlice = 0;
- Ptr<ID3D1xRenderTargetView> pTextureRenderTargetView;
- HRESULT hResult = RenderParams.pDevice->CreateRenderTargetView(eyeTextureD3D->D3D_NS.pTexture, (renderTargetViewDesc.Format == texture2DDesc.Format) ? NULL : &renderTargetViewDesc, &pTextureRenderTargetView.GetRawRef());
-
- if(SUCCEEDED(hResult))
- {
- RenderParams.pContext->OMSetRenderTargets(1, &pTextureRenderTargetView.GetRawRef(), NULL); // We currently don't bind a depth buffer.
-
- D3D1x_VIEWPORT D3DViewport;
-
- OVR_DISABLE_MSVC_WARNING(4244) // conversion from int to float
- D3DViewport.TopLeftX = eyeTextureD3D->Texture.Header.RenderViewport.Pos.x;
- D3DViewport.TopLeftY = eyeTextureD3D->Texture.Header.RenderViewport.Pos.y;
- D3DViewport.Width = eyeTextureD3D->Texture.Header.RenderViewport.Size.w;
- D3DViewport.Height = eyeTextureD3D->Texture.Header.RenderViewport.Size.h;
- D3DViewport.MinDepth = 0;
- D3DViewport.MaxDepth = 1;
- RenderParams.pContext->RSSetViewports(1, &D3DViewport);
- OVR_RESTORE_MSVC_WARNING()
-
- // We don't set up a world/view/projection matrix because we are using
- // normalized device coordinates below.
-
- // We don't set the depth state because we aren't using it.
- // RenderParams.pContext->OMSetDepthStencilState(<depth state>, 0);
-
- ShaderFill fill(pShaderSet);
- fill.SetInputLayout(pVertexInputLayout);
- if(pTexture)
- fill.SetTexture(0, pTexture, Shader_Pixel);
-
- const float scale = HSWDISPLAY_SCALE * ((RenderState.OurHMDInfo.HmdType == HmdType_DK1) ? 0.70f : 1.f);
- pShaderSet->SetUniform2f("Scale", scale, scale / 2.f); // X and Y scale. Y is a fixed proportion to X in order to give a certain aspect ratio.
- pShaderSet->SetUniform4f("Color", 1.f, 1.f, 1.f, 1.f);
- pShaderSet->SetUniform2f("PositionOffset", OrthoProjection[eye].GetTranslation().x, 0.0f);
-
- RenderParams.pContext->IASetInputLayout((ID3D1xInputLayout*)fill.GetInputLayout());
-
- ID3D1xBuffer* vertexBuffer = pVB->GetBuffer();
- UINT vertexStride = sizeof(HASWVertex);
- UINT vertexOffset = 0;
- RenderParams.pContext->IASetVertexBuffers(0, 1, &vertexBuffer, &vertexStride, &vertexOffset);
-
- ShaderBase* vShaderBase = (ShaderBase*)pShaderSet->GetShader(OVR::CAPI::D3D_NS::Shader_Vertex);
- unsigned char* vertexData = vShaderBase->UniformData;
-
- if (vertexData)
- {
- UniformBufferArray[OVR::CAPI::D3D_NS::Shader_Vertex]->Data(OVR::CAPI::D3D_NS::Buffer_Uniform, vertexData, vShaderBase->UniformsSize);
- vShaderBase->SetUniformBuffer(UniformBufferArray[OVR::CAPI::D3D_NS::Shader_Vertex]);
- }
-
- for (int i = (OVR::CAPI::D3D_NS::Shader_Vertex + 1); i < OVR::CAPI::D3D_NS::Shader_Count; i++)
- {
- if (pShaderSet->GetShader(i))
- {
- ((ShaderBase*)pShaderSet->GetShader(i))->UpdateBuffer(UniformBufferArray[i]);
- ((ShaderBase*)pShaderSet->GetShader(i))->SetUniformBuffer(UniformBufferArray[i]);
- }
- }
-
- RenderParams.pContext->IASetPrimitiveTopology(D3D1X_(PRIMITIVE_TOPOLOGY_TRIANGLESTRIP));
- fill.Set(Prim_TriangleStrip);
-
- RenderParams.pContext->Draw(4, 0);
- }
- else
- {
- HSWDISPLAY_LOG(("[HSWDisplay D3D1x] CreateRenderTargetView() failed"));
- }
-
-
- // Restore settings
- RenderParams.pContext->IASetPrimitiveTopology(topologySaved);
- RenderParams.pContext->IASetVertexBuffers(0, 1, &pVertexBufferSaved.GetRawRef(), &vertexStrideSaved[0], &vertexOffsetSaved[0]);
- RenderParams.pContext->IASetInputLayout(pInputLayoutSaved);
- RenderParams.pContext->OMSetDepthStencilState(pDepthStencilStateSaved, stencilRefSaved);
- RenderParams.pContext->RSSetViewports(viewportCountSaved, d3dViewportSaved);
- RenderParams.pContext->OMSetRenderTargets(1, &pTextureRenderTargetViewSaved.GetRawRef(), pDepthStencilViewSaved);
- RenderParams.pContext->RSSetState(pRasterizerStateSaved);
- RenderParams.pContext->OMSetBlendState(pBlendStateSaved, blendFactorSaved, blendSampleMaskSaved);
- }
-}
-
-}}} // namespace OVR::CAPI::D3D_NS
-
-
-#endif // OVR_D3D_VERSION
-
-
-
-
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.h b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.h
deleted file mode 100644
index 2c5762d..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_HSWDisplay.h
+++ /dev/null
@@ -1,84 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_HSWDisplay.h
-Content : Implements Health and Safety Warning system.
-Created : July 7, 2014
-Authors : Paul Pedriana
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-// Do not use include guards, as this file is #included separately by both
-// CAPI_D3D10_HSWDisplay.h and CAPI_D3D11_HSWDisplay.h with OVR_D3D_VERSION defined
-// to either 10 or 11. Only those two headers should #include this one.
-//#ifndef OVR_CAPI_D3D1X_HSWDisplay_h
-//#define OVR_CAPI_D3D1X_HSWDisplay_h
-
-//#if !defined(OVR_CAPI_D3D10_HSWDisplay_h) && !defined(OVR_CAPI_D3D11_HSWDisplay_h)
-// #error This header is expected to be compiled only by these two headers.
-//#endif
-#if !defined(OVR_D3D_VERSION) || ((OVR_D3D_VERSION != 10) && (OVR_D3D_VERSION != 11))
- #error This header expects OVR_D3D_VERSION to be defined, to 10 or 11.
-#endif
-
-#include "../CAPI_HSWDisplay.h"
-#include "CAPI_D3D1X_Util.h"
-
-
-namespace OVR { namespace CAPI { namespace D3D_NS {
-
- class HSWDisplay : public CAPI::HSWDisplay
- {
- public:
- HSWDisplay(ovrRenderAPIType api, ovrHmd hmd, const HMDRenderState& renderState);
-
- // Must be called before use. apiConfig is such that:
- // const ovrD3D11Config* config = (const ovrD3D11Config*)apiConfig; or
- bool Initialize(const ovrRenderAPIConfig* apiConfig);
- void Shutdown();
- void DisplayInternal();
- void DismissInternal();
-
- // Draws the warning to the eye texture(s). This must be done at the end of a
- // frame but prior to executing the distortion rendering of the eye textures.
- void RenderInternal(ovrEyeType eye, const ovrTexture* eyeTexture);
-
- protected:
- void LoadGraphics();
- void UnloadGraphics();
-
- OVR::CAPI::D3D_NS::RenderParams RenderParams;
- Ptr<ID3D1xSamplerState> pSamplerState;
- Ptr<OVR::CAPI::D3D_NS::Texture> pTexture;
- Ptr<Buffer> pVB;
- Ptr<Buffer> UniformBufferArray[OVR::CAPI::D3D_NS::Shader_Count];
- Ptr<ShaderSet> pShaderSet;
- Ptr<ID3D1xInputLayout> pVertexInputLayout;
- Ptr<ID3D1xBlendState> pBlendState;
- Ptr<ID3D1xRasterizerState> pRasterizerState;
- Matrix4f OrthoProjection[ovrEye_Count];
-
- private:
- OVR_NON_COPYABLE(HSWDisplay)
- };
-
-}}} // namespace OVR::CAPI::D3D_NS
-
-
-
diff --git a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.cpp b/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.cpp
deleted file mode 100644
index f95fb3c..0000000
--- a/LibOVR/Src/CAPI/D3D1X/CAPI_D3D1X_Util.cpp
+++ /dev/null
@@ -1,533 +0,0 @@
-/************************************************************************************
-
-Filename : CAPI_D3D1X_Util.cpp
-Content : D3DX10 utility classes for rendering
-Created : September 10, 2012
-Authors : Andrew Reisse
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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 "CAPI_D3D1X_Util.h"
-
-#include <d3dcompiler.h>
-
-namespace OVR { namespace CAPI { namespace D3D_NS {
-
-
-//-------------------------------------------------------------------------------------
-// ***** ShaderFill
-
-void ShaderFill::Set(PrimitiveType prim) const
-{
- Shaders->Set(prim);
-
- for(int i = 0; i < 8; ++i)
- {
- if ( VsTextures[i] != NULL )
- {
- VsTextures[i]->Set(i, Shader_Vertex);
- }
- }
-
- for(int i = 0; i < 8; ++i)
- {
- if ( CsTextures[i] != NULL )
- {
- CsTextures[i]->Set(i, Shader_Compute);
- }
- }
-
- for(int i = 0; i < 8; ++i)
- {
- if ( PsTextures[i] != NULL )
- {
- PsTextures[i]->Set(i, Shader_Fragment);
- }
- }
-}
-
-
-//-------------------------------------------------------------------------------------
-// ***** Buffer
-
-Buffer::~Buffer()
-{
-}
-
-bool Buffer::Data(int use, const void *buffer, size_t size, int computeBufferStride /*=-1*/)
-{
- if (D3DBuffer && Size >= size)
- {
- if (Dynamic)
- {
- if (!buffer)
- return true;
-
- void* v = Map(0, size, Map_Discard);
- if (v)
- {
- memcpy(v, buffer, size);
- Unmap(v);
- return true;
- }
- }
- else
- {
- OVR_ASSERT (!(use & Buffer_ReadOnly));
- pParams->pContext->UpdateSubresource(D3DBuffer, 0, NULL, buffer, 0, 0);
- return true;
- }
- }
- if (D3DBuffer)
- {
- D3DBuffer = NULL;
- Size = 0;
- Use = 0;
- Dynamic = false;
- }
- D3DSrv = NULL;
-#if (OVR_D3D_VERSION >= 11)
- D3DUav = NULL;
-#endif
-
- D3D1X_(BUFFER_DESC) desc;
- memset(&desc, 0, sizeof(desc));
- if (use & Buffer_ReadOnly)
- {
- desc.Usage = D3D1X_(USAGE_IMMUTABLE);
- desc.CPUAccessFlags = 0;
- }
- else
- {
- desc.Usage = D3D1X_(USAGE_DYNAMIC);
- desc.CPUAccessFlags = D3D1X_(CPU_ACCESS_WRITE);
- Dynamic = true;
- }
-
- switch(use & Buffer_TypeMask)
- {
- case Buffer_Vertex: desc.BindFlags = D3D1X_(BIND_VERTEX_BUFFER); break;
- case Buffer_Index: desc.BindFlags = D3D1X_(BIND_INDEX_BUFFER); break;
- case Buffer_Uniform:
- desc.BindFlags = D3D1X_(BIND_CONSTANT_BUFFER);
- size = ((size + 15) & ~15);
- break;
- case Buffer_Compute:
-#if (OVR_D3D_VERSION >= 11)
- // There's actually a bunch of options for buffers bound to a CS.
- // Right now this is the most appropriate general-purpose one. Add more as needed.
-
- // NOTE - if you want D3D1X_(CPU_ACCESS_WRITE), it MUST be either D3D1X_(USAGE_DYNAMIC) or D3D1X_(USAGE_STAGING).
- // TODO: we want a resource that is rarely written to, in which case we'd need two surfaces - one a STAGING
- // that the CPU writes to, and one a DEFAULT, and we CopyResource from one to the other. Hassle!
- // Setting it as D3D1X_(USAGE_DYNAMIC) will get the job done for now.
- // Also for fun - you can't have a D3D1X_(USAGE_DYNAMIC) buffer that is also a D3D1X_(BIND_UNORDERED_ACCESS).
- OVR_ASSERT ( !(use & Buffer_ReadOnly) );
- desc.BindFlags = D3D1X_(BIND_SHADER_RESOURCE);
- desc.Usage = D3D1X_(USAGE_DYNAMIC);
- desc.MiscFlags = D3D1X_(RESOURCE_MISC_BUFFER_STRUCTURED);
- desc.CPUAccessFlags = D3D1X_(CPU_ACCESS_WRITE);
- OVR_ASSERT ( computeBufferStride > 0 );
- desc.StructureByteStride = computeBufferStride; // sizeof(DistortionComputePin);
-
- Dynamic = true;
- size = ((size + 15) & ~15);
-#else
- OVR_UNUSED ( computeBufferStride );
- OVR_ASSERT ( false ); // No compute shaders in DX10
-#endif
- break;
- }
-
- desc.ByteWidth = (unsigned)size;
-
- D3D1X_(SUBRESOURCE_DATA) sr;
- sr.pSysMem = buffer;
- sr.SysMemPitch = 0;
- sr.SysMemSlicePitch = 0;
-
- D3DBuffer = NULL;
- HRESULT hr = pParams->pDevice->CreateBuffer(&desc, buffer ? &sr : NULL, &D3DBuffer.GetRawRef());
- if (SUCCEEDED(hr))
- {
- Use = use;
- Size = desc.ByteWidth;
- }
- else
- {
- OVR_ASSERT ( false );
- return false;
- }
-
- if ( ( use & Buffer_TypeMask ) == Buffer_Compute )
- {
- HRESULT hres = pParams->pDevice->CreateShaderResourceView ( D3DBuffer, NULL, &D3DSrv.GetRawRef() );
- if ( SUCCEEDED(hres) )
- {
-#if (OVR_D3D_VERSION >= 11)
-#if 0 // Right now we do NOT ask for UAV access (see flags above).
- hres = Ren->Device->CreateUnorderedAccessView ( D3DBuffer, NULL, &D3DUav.GetRawRef() );
- if ( SUCCEEDED(hres) )
- {
- // All went well.
- }
-#endif
-#endif
- }
-
- if ( !SUCCEEDED(hres) )
- {
- OVR_ASSERT ( false );
- Use = 0;
- Size = 0;
- return false;
- }
- }
-
- return true;
-
-}
-
-void* Buffer::Map(size_t start, size_t size, int flags)
-{
- OVR_UNUSED(size);
-
- D3D1X_(MAP) mapFlags = D3D1X_(MAP_WRITE);
- if (flags & Map_Discard)
- mapFlags = D3D1X_(MAP_WRITE_DISCARD);
- if (flags & Map_Unsynchronized)
- mapFlags = D3D1X_(MAP_WRITE_NO_OVERWRITE);
-
-#if (OVR_D3D_VERSION == 10)
- void* map;
- if (SUCCEEDED(D3DBuffer->Map(mapFlags, 0, &map)))
- return ((char*)map) + start;
-#else
- D3D11_MAPPED_SUBRESOURCE map;
- if (SUCCEEDED(pParams->pContext->Map(D3DBuffer, 0, mapFlags, 0, &map)))
- return ((char*)map.pData) + start;
-#endif
-
- return NULL;
-}
-
-bool Buffer::Unmap(void *m)
-{
- OVR_UNUSED(m);
-
- D3DSELECT_10_11( D3DBuffer->Unmap(),
- pParams->pContext->Unmap(D3DBuffer, 0) );
- return true;
-}
-
-
-//-------------------------------------------------------------------------------------
-// Shaders
-
-template<> bool ShaderImpl<Shader_Vertex, ID3D1xVertexShader>::Load(void* shader, size_t size)
-{
- return SUCCEEDED(pParams->pDevice->CreateVertexShader(shader, size D3D11_COMMA_0, &D3DShader));
-}
-template<> bool ShaderImpl<Shader_Pixel, ID3D1xPixelShader>::Load(void* shader, size_t size)
-{
- return SUCCEEDED(pParams->pDevice->CreatePixelShader(shader, size D3D11_COMMA_0, &D3DShader));
-}
-#if (OVR_D3D_VERSION>=11)
-template<> bool ShaderImpl<Shader_Compute, ID3D1xComputeShader>::Load(void* shader, size_t size)
-{
- return SUCCEEDED(pParams->pDevice->CreateComputeShader(shader, size D3D11_COMMA_0, &D3DShader));
-}
-#endif
-
-template<> void ShaderImpl<Shader_Vertex, ID3D1xVertexShader>::Set(PrimitiveType) const
-{
- pParams->pContext->VSSetShader(D3DShader D3D11_COMMA_0 D3D11_COMMA_0 );
-}
-template<> void ShaderImpl<Shader_Pixel, ID3D1xPixelShader>::Set(PrimitiveType) const
-{
- pParams->pContext->PSSetShader(D3DShader D3D11_COMMA_0 D3D11_COMMA_0 ) ;
-}
-#if (OVR_D3D_VERSION>=11)
-template<> void ShaderImpl<Shader_Compute, ID3D1xComputeShader>::Set(PrimitiveType) const
-{
- pParams->pContext->CSSetShader(D3DShader D3D11_COMMA_0 D3D11_COMMA_0 ) ;
-}
-#endif
-
-template<> void ShaderImpl<Shader_Vertex, ID3D1xVertexShader>::SetUniformBuffer(Buffer* buffer, int i)
-{
- pParams->pContext->VSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
-}
-template<> void ShaderImpl<Shader_Pixel, ID3D1xPixelShader>::SetUniformBuffer(Buffer* buffer, int i)
-{
- pParams->pContext->PSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
-}
-#if (OVR_D3D_VERSION>=11)
-template<> void ShaderImpl<Shader_Compute, ID3D1xComputeShader>::SetUniformBuffer(Buffer* buffer, int i)
-{
- pParams->pContext->CSSetConstantBuffers(i, 1, &((Buffer*)buffer)->D3DBuffer.GetRawRef());
-}
-#endif
-
-//-------------------------------------------------------------------------------------
-// ***** Shader Base
-
-ShaderBase::ShaderBase(RenderParams* rp, ShaderStage stage) :
- Shader(stage),
- pParams(rp),
- UniformData(NULL),
- UniformsSize(0),
- UniformRefl(NULL),
- UniformReflSize(0)
-{
-}
-
-ShaderBase::~ShaderBase()
-{
- if (UniformData)
- {
- OVR_FREE(UniformData);
- UniformData = NULL;
- }
-
- // UniformRefl does not need to be freed
- UniformRefl = NULL;
-}
-
-bool ShaderBase::SetUniform(const char* name, int n, const float* v)
-{
- for(unsigned i = 0; i < UniformReflSize; i++)
- {
- if (!strcmp(UniformRefl[i].Name, name))
- {
- memcpy(UniformData + UniformRefl[i].Offset, v, n * sizeof(float));
- return 1;
- }
- }
- return 0;
-}
-
-bool ShaderBase::SetUniformBool(const char* name, int n, const bool* v)
-{
- OVR_UNUSED(n);
- for(unsigned i = 0; i < UniformReflSize; i++)
- {
- if (!strcmp(UniformRefl[i].Name, name))
- {
- memcpy(UniformData + UniformRefl[i].Offset, v, UniformRefl[i].Size);
- return 1;
- }
- }
- return 0;
-}
-
-void ShaderBase::InitUniforms(const Uniform* refl, size_t reflSize)
-{
- if(!refl)
- {
- UniformRefl = NULL;
- UniformReflSize = 0;
-
- UniformsSize = 0;
- if (UniformData)
- {
- OVR_FREE(UniformData);
- UniformData = 0;
- }
- return; // no reflection data
- }
-
- UniformRefl = refl;
- UniformReflSize = reflSize;
-
- UniformsSize = UniformRefl[UniformReflSize-1].Offset + UniformRefl[UniformReflSize-1].Size;
- UniformData = (unsigned char*)OVR_ALLOC(UniformsSize);
-}
-
-void ShaderBase::UpdateBuffer(Buffer* buf)
-{
- if (UniformsSize)
- {
- buf->Data(Buffer_Uniform, UniformData, UniformsSize);
- }
-}
-
-
-//-------------------------------------------------------------------------------------
-// ***** Texture
-//
-Texture::Texture(RenderParams* rp, int fmt, const Sizei texSize,
- ID3D1xSamplerState* sampler, int samples)
- : pParams(rp), Tex(NULL), TexSv(NULL), TexRtv(NULL), TexDsv(NULL),
- TextureSize(texSize),
- Sampler(sampler),
- Samples(samples)
-{
- OVR_UNUSED(fmt);
-}
-
-Texture::~Texture()
-{
-}
-
-void Texture::Set(int slot, ShaderStage stage) const
-{
- ID3D1xShaderResourceView* texSv = TexSv.GetPtr();
-
- switch(stage)
- {
- case Shader_Fragment:
- pParams->pContext->PSSetShaderResources(slot, 1, &texSv);
- pParams->pContext->PSSetSamplers(slot, 1, &Sampler.GetRawRef());
- break;
-
- case Shader_Vertex:
- pParams->pContext->VSSetShaderResources(slot, 1, &texSv);
- pParams->pContext->VSSetSamplers(slot, 1, &Sampler.GetRawRef());
- break;
-
-#if (OVR_D3D_VERSION >= 11)
- case Shader_Compute:
- pParams->pContext->CSSetShaderResources(slot, 1, &texSv);
- pParams->pContext->CSSetSamplers(slot, 1, &Sampler.GetRawRef());
- break;
-#endif
- default: OVR_ASSERT ( false ); break;
- }
-}
-
-
-//-------------------------------------------------------------------------------------
-// ***** GpuTimer
-//
-#if (OVR_D3D_VERSION == 11)
-#define D3DQUERY_EXEC(_context_, _query_, _command_, ...) _context_->_command_(_query_, __VA_ARGS__)
-#else
-#define D3DQUERY_EXEC(_context_, _query_, _command_, ...) _query_->_command_(__VA_ARGS__)
-#endif
-
-
-void GpuTimer::Init(ID3D1xDevice* device, ID3D1xDeviceContext* content)
-{
- D3dDevice = device;
- Context = content;
-}
-
-void GpuTimer::BeginQuery()
-{
- if(GotoNextFrame(LastQueuedFrame) == LastTimedFrame)
- {
- OVR_ASSERT(false); // too many queries queued
- return;
- }
-
- LastQueuedFrame = GotoNextFrame(LastQueuedFrame);
-
- GpuQuerySets& newQuerySet = QuerySets[LastQueuedFrame];
- if(newQuerySet.DisjointQuery == NULL)
- {
- // Create the queries
- D3D1x_QUERY_DESC desc;
- desc.Query = D3D1X_(QUERY_TIMESTAMP_DISJOINT);
- desc.MiscFlags = 0;
- VERIFY_HRESULT(D3dDevice->CreateQuery(&desc, &newQuerySet.DisjointQuery));
-
- desc.Query = D3D1X_(QUERY_TIMESTAMP);
- VERIFY_HRESULT(D3dDevice->CreateQuery(&desc, &newQuerySet.TimeStartQuery));
- VERIFY_HRESULT(D3dDevice->CreateQuery(&desc, &newQuerySet.TimeEndQuery));
- }
-
- OVR_ASSERT(!newQuerySet.QueryStarted);
- OVR_ASSERT(!newQuerySet.QueryAwaitingTiming);
-
-
- D3DQUERY_EXEC(Context, QuerySets[LastQueuedFrame].DisjointQuery, Begin, ); // First start a disjoint query
- D3DQUERY_EXEC(Context, QuerySets[LastQueuedFrame].TimeStartQuery, End, ); // Insert start timestamp
-
- newQuerySet.QueryStarted = true;
- newQuerySet.QueryAwaitingTiming = false;
- //newQuerySet.QueryTimed = false;
-}
-
-void GpuTimer::EndQuery()
-{
- if(LastQueuedFrame > 0 && !QuerySets[LastQueuedFrame].QueryStarted)
- return;
-
- GpuQuerySets& doneQuerySet = QuerySets[LastQueuedFrame];
- OVR_ASSERT(doneQuerySet.QueryStarted);
- OVR_ASSERT(!doneQuerySet.QueryAwaitingTiming);
-
- // Insert the end timestamp
- D3DQUERY_EXEC(Context, doneQuerySet.TimeEndQuery, End, );
-
- // End the disjoint query
- D3DQUERY_EXEC(Context, doneQuerySet.DisjointQuery, End, );
-
- doneQuerySet.QueryStarted = false;
- doneQuerySet.QueryAwaitingTiming = true;
-}
-
-float GpuTimer::GetTiming(bool blockUntilValid)
-{
- float time = -1.0f;
-
- // loop until we hit a query that is not ready yet, or we have read all queued queries
- while(LastTimedFrame != LastQueuedFrame)
- {
- int timeTestFrame = GotoNextFrame(LastTimedFrame);
-
- GpuQuerySets& querySet = QuerySets[timeTestFrame];
-
- OVR_ASSERT(!querySet.QueryStarted && querySet.QueryAwaitingTiming);
-
- UINT64 startTime = 0;
- UINT64 endTime = 0;
- D3D1X_(QUERY_DATA_TIMESTAMP_DISJOINT) disjointData;
-
- if(blockUntilValid)
- {
- while(D3DQUERY_EXEC(Context, querySet.TimeStartQuery, GetData, &startTime, sizeof(startTime), 0) != S_OK);
- while(D3DQUERY_EXEC(Context, querySet.TimeEndQuery, GetData, &endTime, sizeof(endTime), 0) != S_OK);
- while(D3DQUERY_EXEC(Context, querySet.DisjointQuery, GetData, &disjointData, sizeof(disjointData), 0) != S_OK);
- }
- else
- {
-// Early return if we fail to get data for any of these
- if(D3DQUERY_EXEC(Context, querySet.TimeStartQuery, GetData, &startTime, sizeof(startTime), 0) != S_OK) return time;
- if(D3DQUERY_EXEC(Context, querySet.TimeEndQuery, GetData, &endTime, sizeof(endTime), 0) != S_OK) return time;
- if(D3DQUERY_EXEC(Context, querySet.DisjointQuery, GetData, &disjointData, sizeof(disjointData), 0) != S_OK) return time;
- }
-
- querySet.QueryAwaitingTiming = false;
- LastTimedFrame = timeTestFrame; // successfully retrieved the timing data
-
- if(disjointData.Disjoint == false)
- {
- UINT64 delta = endTime - startTime;
- float frequency = (float)(disjointData.Frequency);
- time = (delta / frequency);
- }
- }
-
- return time;
-}
-
-}}} // OVR::CAPI::D3DX
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2.h
deleted file mode 100644
index 78cbb03..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2.h
+++ /dev/null
@@ -1,887 +0,0 @@
-#ifndef DISTORTIONCS2X2_H
-#define DISTORTIONCS2X2_H
-
-static const unsigned char DistortionCS2x2[] = {
- 0x44, 0x58, 0x42, 0x43, 0x08, 0x74, 0x15, 0x37, 0x48, 0x1d, 0x2c, 0xce,
- 0x36, 0x3e, 0x2c, 0x71, 0x9b, 0xf3, 0x13, 0xa6, 0x01, 0x00, 0x00, 0x00,
- 0x34, 0x29, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0xa8, 0x05, 0x00, 0x00, 0xb8, 0x05, 0x00, 0x00, 0xc8, 0x05, 0x00, 0x00,
- 0x98, 0x28, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x6c, 0x05, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x1c, 0x01, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x3c, 0x00, 0x00, 0x00, 0x00, 0x05, 0x53, 0x43, 0x00, 0x01, 0x00, 0x00,
- 0x38, 0x05, 0x00, 0x00, 0x52, 0x44, 0x31, 0x31, 0x3c, 0x00, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x28, 0x00, 0x00, 0x00,
- 0x24, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xdc, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe3, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x07, 0x01, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x13, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x00, 0x48,
- 0x6d, 0x64, 0x53, 0x70, 0x63, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65,
- 0x00, 0x55, 0x6e, 0x74, 0x72, 0x61, 0x6e, 0x73, 0x66, 0x6f, 0x72, 0x6d,
- 0x65, 0x64, 0x47, 0x72, 0x69, 0x64, 0x50, 0x69, 0x6e, 0x73, 0x00, 0x46,
- 0x72, 0x61, 0x6d, 0x65, 0x62, 0x75, 0x66, 0x66, 0x65, 0x72, 0x00, 0x24,
- 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0x13, 0x01, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf1, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xe8, 0x03, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0xb4, 0x02, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xc8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xec, 0x02, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xc8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xf5, 0x02, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x34, 0x03, 0x00, 0x00,
- 0x88, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x10, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x48, 0x03, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x2c, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x64, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0x88, 0x03, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
- 0x2c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x64, 0x03, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x97, 0x03, 0x00, 0x00,
- 0xec, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa8, 0x03, 0x00, 0x00, 0xcc, 0x03, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xd0, 0x03, 0x00, 0x00, 0xf0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa8, 0x03, 0x00, 0x00, 0xcc, 0x03, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff,
- 0x00, 0x00, 0x00, 0x00, 0xd9, 0x03, 0x00, 0x00, 0xf4, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa8, 0x03, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x50, 0x61, 0x64, 0x64,
- 0x69, 0x6e, 0x67, 0x31, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x34, 0x78,
- 0x34, 0x00, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xbd, 0x02, 0x00, 0x00, 0x50, 0x61, 0x64, 0x64, 0x69, 0x6e, 0x67, 0x32,
- 0x00, 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65,
- 0x55, 0x56, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0x66, 0x6c, 0x6f, 0x61,
- 0x74, 0x32, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x03, 0x00, 0x00, 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75,
- 0x72, 0x63, 0x65, 0x55, 0x56, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x00,
- 0x45, 0x79, 0x65, 0x52, 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53,
- 0x74, 0x61, 0x72, 0x74, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x33, 0x78,
- 0x33, 0x00, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00, 0x03, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x59, 0x03, 0x00, 0x00, 0x45, 0x79, 0x65, 0x52, 0x6f, 0x74, 0x61, 0x74,
- 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x00, 0x55, 0x73, 0x65, 0x4f, 0x76,
- 0x65, 0x72, 0x6c, 0x61, 0x79, 0x00, 0x66, 0x6c, 0x6f, 0x61, 0x74, 0x00,
- 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa2, 0x03, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3f, 0x52, 0x69, 0x67, 0x68, 0x74, 0x45, 0x79, 0x65,
- 0x00, 0x46, 0x62, 0x53, 0x69, 0x7a, 0x65, 0x50, 0x69, 0x78, 0x65, 0x6c,
- 0x73, 0x58, 0x00, 0xab, 0x10, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x14, 0x05, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x24, 0x45, 0x6c, 0x65,
- 0x6d, 0x65, 0x6e, 0x74, 0x00, 0x44, 0x69, 0x73, 0x74, 0x6f, 0x72, 0x74,
- 0x69, 0x6f, 0x6e, 0x43, 0x6f, 0x6d, 0x70, 0x75, 0x74, 0x65, 0x50, 0x69,
- 0x6e, 0x00, 0x54, 0x61, 0x6e, 0x45, 0x79, 0x65, 0x41, 0x6e, 0x67, 0x6c,
- 0x65, 0x73, 0x52, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x03, 0x00, 0x00, 0x54, 0x61, 0x6e, 0x45, 0x79, 0x65, 0x41, 0x6e,
- 0x67, 0x6c, 0x65, 0x73, 0x47, 0x00, 0x54, 0x61, 0x6e, 0x45, 0x79, 0x65,
- 0x41, 0x6e, 0x67, 0x6c, 0x65, 0x73, 0x42, 0x00, 0x43, 0x6f, 0x6c, 0x6f,
- 0x72, 0x00, 0x69, 0x6e, 0x74, 0x00, 0xab, 0xab, 0x00, 0x00, 0x02, 0x00,
- 0x01, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x82, 0x04, 0x00, 0x00, 0x50, 0x61, 0x64, 0x64,
- 0x69, 0x6e, 0x67, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x82, 0x04, 0x00, 0x00, 0x2e, 0x04, 0x00, 0x00, 0x3c, 0x04, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x60, 0x04, 0x00, 0x00, 0x3c, 0x04, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x6e, 0x04, 0x00, 0x00, 0x3c, 0x04, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x7c, 0x04, 0x00, 0x00, 0x88, 0x04, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0xac, 0x04, 0x00, 0x00, 0xb4, 0x04, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x00, 0x08, 0x00,
- 0x00, 0x00, 0x05, 0x00, 0xd8, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x19, 0x04, 0x00, 0x00, 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66,
- 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53,
- 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c,
- 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e,
- 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x4f, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x53, 0x48, 0x45, 0x58, 0xc8, 0x22, 0x00, 0x00,
- 0x50, 0x00, 0x05, 0x00, 0xb2, 0x08, 0x00, 0x00, 0x6a, 0x08, 0x00, 0x01,
- 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0xa2, 0x00, 0x00, 0x04,
- 0x00, 0x70, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x9c, 0x18, 0x00, 0x04, 0x00, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x55, 0x55, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x02, 0x32, 0x00, 0x02, 0x00,
- 0x68, 0x00, 0x00, 0x02, 0x19, 0x00, 0x00, 0x00, 0x9b, 0x00, 0x00, 0x04,
- 0x10, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x29, 0x00, 0x48, 0x09, 0x92, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x04, 0x02, 0x00, 0x02, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x2b, 0x00, 0x38, 0x05, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0xc6, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x18, 0x0a,
- 0x32, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x96, 0x05, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3d,
- 0x00, 0x00, 0x80, 0x3d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x41, 0x00, 0x38, 0x05, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x16, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x40, 0x05,
- 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x40, 0x08, 0x82, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
- 0x0e, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x41, 0x00, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x00, 0x00, 0x40, 0x08,
- 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x40, 0x05, 0x82, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x29, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x38, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa7, 0x00, 0x20, 0x8b, 0x02, 0x03, 0x01, 0x80, 0x83, 0x99, 0x19, 0x00,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x72, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
- 0x56, 0x00, 0x40, 0x05, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x43,
- 0x38, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0xa7, 0x00, 0x20, 0x8b,
- 0x02, 0x03, 0x01, 0x80, 0x83, 0x99, 0x19, 0x00, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x46, 0x72, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00, 0x56, 0x00, 0x40, 0x05,
- 0x82, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x43, 0x38, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40,
- 0x00, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0xbf, 0xa7, 0x00, 0x20, 0x8b, 0x02, 0x03, 0x01, 0x80,
- 0x83, 0x99, 0x19, 0x00, 0x72, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x72, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0xff, 0x00, 0x00, 0x00, 0x56, 0x00, 0x40, 0x05, 0x82, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x43, 0x38, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf,
- 0xa7, 0x00, 0x20, 0x8b, 0x02, 0x03, 0x01, 0x80, 0x83, 0x99, 0x19, 0x00,
- 0x72, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x72, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0xff, 0x00, 0x00, 0x00,
- 0x56, 0x00, 0x40, 0x05, 0x82, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x43,
- 0x38, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0xbf, 0x31, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x31, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x31, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x3c, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x31, 0x00, 0x40, 0x07, 0x82, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x40, 0x07,
- 0x82, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x04, 0x03, 0x3a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0d, 0x72, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3d, 0x00, 0x00, 0x80, 0x3d, 0x00, 0x00, 0x80, 0x3d,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x72, 0x00, 0x10, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x70, 0x3f, 0x00, 0x00, 0x00, 0x00,
- 0x31, 0x00, 0x00, 0x08, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x0a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x3f, 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1b, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x09,
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x8b,
- 0x02, 0x03, 0x01, 0x80, 0x83, 0x99, 0x19, 0x00, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x55, 0x00, 0x08, 0x07, 0x12, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x56, 0x00, 0x08, 0x05,
- 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x8b, 0x02, 0x03, 0x01, 0x80,
- 0x83, 0x99, 0x19, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x55, 0x00, 0x20, 0x07, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x56, 0x00, 0x20, 0x05, 0x42, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x28, 0x0a, 0x52, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x06, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x7f, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x43,
- 0x00, 0x00, 0x00, 0x00, 0xa7, 0x00, 0x00, 0x8b, 0x02, 0x03, 0x01, 0x80,
- 0x83, 0x99, 0x19, 0x00, 0xf2, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x55, 0x00, 0x08, 0x07, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x56, 0x00, 0x08, 0x05, 0x12, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0xa7, 0x00, 0x00, 0x8b, 0x02, 0x03, 0x01, 0x80, 0x83, 0x99, 0x19, 0x00,
- 0xf2, 0x00, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x55, 0x00, 0x10, 0x07,
- 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x56, 0x00, 0x10, 0x05, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x18, 0x0a,
- 0x32, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x7f, 0x43,
- 0x00, 0x00, 0x7f, 0x43, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0xb2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x03, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x72, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x81, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05,
- 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0xf6, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x04, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0xb2, 0x00, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x46, 0x03, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0xa6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x81, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05,
- 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x04, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0xf2, 0x00, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0xb2, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x46, 0x03, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x81, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05,
- 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x04, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0xf2, 0x00, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x72, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08,
- 0xb2, 0x00, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x88, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x46, 0x03, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xe2, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x06, 0x89, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x96, 0x07, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x46, 0x82, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x72, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08,
- 0x72, 0x00, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x72, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x81, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05,
- 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x81, 0x00, 0x00, 0x05, 0x42, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x04, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x04, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0xf2, 0x00, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0xe6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x0b, 0xf2, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x06, 0x0a, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x06, 0x0a, 0x10, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x15, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x56, 0x0f, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x06, 0x0a, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0x52, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0xf6, 0x0f, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x07, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x52, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x56, 0x07, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x52, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x56, 0x07, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0x52, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x56, 0x07, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x06, 0x02, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x17, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00, 0x0e, 0x00, 0x00, 0x00,
- 0x56, 0x0f, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x0c, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x09, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0xe6, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0xe6, 0x0e, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00,
- 0x15, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0xe6, 0x0e, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00,
- 0x16, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00,
- 0xe6, 0x0e, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00, 0x11, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80,
- 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x00, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d,
- 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x22, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x18, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00,
- 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x13, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d,
- 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x17, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00,
- 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00,
- 0x18, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80,
- 0x43, 0x55, 0x15, 0x00, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0xe6, 0x0a, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07,
- 0x72, 0x00, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3d, 0x00, 0x00, 0x00, 0x08, 0x22, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x0f, 0x10, 0x00,
- 0x12, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x16, 0x00, 0x00, 0x00, 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x06, 0x0a, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x06, 0x0a, 0x10, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0xd6, 0x05, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x32, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd6, 0x05, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00,
- 0x46, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x32, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xd6, 0x05, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x46, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0x32, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xf6, 0x0f, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0xd6, 0x05, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x46, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x0e, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x15, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x12, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x09, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x16, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x16, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x15, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x12, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d,
- 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x12, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00,
- 0x22, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80,
- 0x43, 0x55, 0x15, 0x00, 0x42, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x46, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x20, 0x00, 0x07,
- 0x72, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00,
- 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0xc6, 0x79, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d, 0xc2, 0x00, 0x00, 0x80,
- 0x43, 0x55, 0x15, 0x00, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0xe6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xc6, 0x79, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x8d,
- 0xc2, 0x00, 0x00, 0x80, 0x43, 0x55, 0x15, 0x00, 0x82, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0xc6, 0x79, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x38, 0x20, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x56, 0x05, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xd6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x1e, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x82, 0x00, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0f, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x13, 0x00, 0x00, 0x00, 0x23, 0x00, 0x00, 0x08,
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x02, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x16, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa4, 0x00, 0x00, 0x07, 0xf2, 0xe0, 0x11, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x26, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x15, 0x00, 0x00, 0x01, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x94, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00,
- 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x79, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x0b, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2_refl.h
deleted file mode 100644
index 27db6d3..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionCS2x2_refl.h
+++ /dev/null
@@ -1,16 +0,0 @@
-#ifndef DistortionCS2x2_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform DistortionCS2x2_refl[] =
-{
- { "Padding1", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 64 },
- { "Padding2", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 64, 64 },
- { "EyeToSourceUVScale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 128, 8 },
- { "EyeToSourceUVOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 136, 8 },
- { "EyeRotationStart", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 144, 44 },
- { "EyeRotationEnd", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 192, 44 },
- { "UseOverlay", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 236, 4 },
- { "RightEye", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 240, 4 },
- { "FbSizePixelsX", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 244, 4 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.h
deleted file mode 100644
index 5bc4599..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.h
+++ /dev/null
@@ -1,256 +0,0 @@
-#ifndef DISTORTIONCHROMA_PS_H
-#define DISTORTIONCHROMA_PS_H
-
-static const unsigned char DistortionChroma_ps[] = {
- 0x44, 0x58, 0x42, 0x43, 0xb7, 0x5b, 0x09, 0xd5, 0x8c, 0xb3, 0xcf, 0xc9,
- 0x86, 0xe0, 0x0c, 0x3b, 0x65, 0x14, 0x61, 0x56, 0x01, 0x00, 0x00, 0x00,
- 0xa4, 0x0b, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0xbc, 0x01, 0x00, 0x00, 0x60, 0x02, 0x00, 0x00, 0xac, 0x02, 0x00, 0x00,
- 0x28, 0x0b, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x80, 0x01, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0x4c, 0x01, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0xa3, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0xab, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0xff, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0d, 0x00, 0x00, 0x00, 0xb7, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x00, 0x54, 0x65, 0x78, 0x74, 0x75,
- 0x72, 0x65, 0x00, 0x4c, 0x61, 0x73, 0x74, 0x54, 0x65, 0x78, 0x74, 0x75,
- 0x72, 0x65, 0x00, 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00,
- 0xb7, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0xd8, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x08, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x18, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x28, 0x01, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x3c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x4f, 0x76, 0x65, 0x72, 0x64, 0x72, 0x69, 0x76, 0x65, 0x53, 0x63, 0x61,
- 0x6c, 0x65, 0x73, 0x00, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x61, 0x44, 0x65,
- 0x72, 0x69, 0x76, 0x61, 0x74, 0x69, 0x76, 0x65, 0x4d, 0x75, 0x6c, 0x74,
- 0x00, 0xab, 0xab, 0xab, 0x00, 0x00, 0x03, 0x00, 0x01, 0x00, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x49, 0x53, 0x47, 0x4e, 0x9c, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x03, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x01, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x06, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x0c, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45,
- 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e,
- 0x44, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0xab, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0x74, 0x08, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x1d, 0x02, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04,
- 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00,
- 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x55, 0x55, 0x00, 0x00, 0x64, 0x20, 0x00, 0x04, 0x32, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0x12, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0x62, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0xc2, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03,
- 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02,
- 0x08, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x0b, 0x32, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x26, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1f, 0x00, 0x04, 0x03, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x05, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x14, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x05,
- 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x14, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x80, 0x81, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0xa6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x96, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0xe6, 0x1a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x22, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0xd2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x06, 0x09, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xab, 0xaa, 0xaa, 0xbe,
- 0xab, 0xaa, 0xaa, 0xbe, 0x00, 0x00, 0x20, 0xbf, 0x00, 0x00, 0x20, 0xbf,
- 0x96, 0x19, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xab, 0xaa, 0xaa, 0xbe,
- 0xab, 0xaa, 0xaa, 0xbe, 0x00, 0x00, 0x20, 0xbf, 0x00, 0x00, 0x20, 0xbf,
- 0x46, 0x14, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0xe6, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0xab, 0xaa, 0xaa, 0xbe,
- 0xab, 0xaa, 0xaa, 0xbe, 0x00, 0x00, 0x20, 0xbf, 0x00, 0x00, 0x20, 0xbf,
- 0xe6, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x12, 0x00, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x46, 0x02, 0x10, 0x00, 0x07, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c, 0xd2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x40, 0x00, 0x00, 0x80, 0x40, 0x06, 0x09, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3f,
- 0x00, 0x00, 0x20, 0x3f, 0xab, 0xaa, 0xaa, 0x3e, 0xab, 0xaa, 0xaa, 0x3e,
- 0x96, 0x19, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3f,
- 0x00, 0x00, 0x20, 0x3f, 0xab, 0xaa, 0xaa, 0x3e, 0xab, 0xaa, 0xaa, 0x3e,
- 0x46, 0x14, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0c,
- 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x20, 0x3f,
- 0x00, 0x00, 0x20, 0x3f, 0xab, 0xaa, 0xaa, 0x3e, 0xab, 0xaa, 0xaa, 0x3e,
- 0xe6, 0x1e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x12, 0x00, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x09, 0xd2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x09, 0x10, 0x00, 0x06, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0xe6, 0x0a, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0xe6, 0x0a, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0xe6, 0x0a, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09, 0xd2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x0e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x0a, 0xd2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x00, 0x3e, 0x4b, 0x00, 0x00, 0x05,
- 0x72, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x01, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x96, 0x15, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0xe6, 0x1a, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x22, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x15, 0x00, 0x00, 0x01, 0x38, 0x00, 0x00, 0x07, 0xd2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x09, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x04, 0x03,
- 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x05,
- 0x32, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x2d, 0x00, 0x00, 0x07, 0xf2, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x07, 0x72, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x0b,
- 0x72, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x06, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x56, 0x85, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x72, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x32, 0x20, 0x00, 0x09,
- 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x82, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3f, 0x12, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05,
- 0x72, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
- 0x15, 0x00, 0x00, 0x01, 0x36, 0x00, 0x00, 0x05, 0x72, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x86, 0x03, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x40, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00,
- 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x12, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1b, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.psh b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.psh
index c69fce0..3232cee 100644
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.psh
+++ b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps.psh
@@ -23,9 +23,12 @@ limitations under the License.
Texture2D Texture : register(t0);
Texture2D LastTexture : register(t1);
+Texture2D OverdriveLut : register(t2);
SamplerState Linear : register(s0);
+// unused - SamplerState Linear2 : register(s1);
+SamplerState OverdriveSampler : register(s2);
-float2 OverdriveScales;
+float3 OverdriveScales;
float AaDerivativeMult;
// Fast approximate gamma to linear conversion when averaging colors
@@ -124,12 +127,24 @@ void main(in float4 oPosition : SV_Position,
{
float3 oldColor = LastTexture.Load(int3(oPosition.xy, 0)).rgb;
- float3 adjustedScales;
- adjustedScales.x = newColor.x > oldColor.x ? OverdriveScales.x : OverdriveScales.y;
- adjustedScales.y = newColor.y > oldColor.y ? OverdriveScales.x : OverdriveScales.y;
- adjustedScales.z = newColor.z > oldColor.z ? OverdriveScales.x : OverdriveScales.y;
-
- float3 overdriveColor = saturate(newColor + (newColor - oldColor) * adjustedScales);
+ float3 overdriveColor;
+
+ // x < 1.5 means "use analytical model instead of LUT"
+ if(OverdriveScales.x < 1.5)
+ {
+ float3 adjustedScales;
+ adjustedScales.x = newColor.x > oldColor.x ? OverdriveScales.y : OverdriveScales.z;
+ adjustedScales.y = newColor.y > oldColor.y ? OverdriveScales.y : OverdriveScales.z;
+ adjustedScales.z = newColor.z > oldColor.z ? OverdriveScales.y : OverdriveScales.z;
+ overdriveColor = saturate(newColor + (newColor - oldColor) * adjustedScales);
+ }
+ else
+ {
+ overdriveColor.r = OverdriveLut.Sample(OverdriveSampler, float2(newColor.r, oldColor.r)).r;
+ overdriveColor.g = OverdriveLut.Sample(OverdriveSampler, float2(newColor.g, oldColor.g)).g;
+ overdriveColor.b = OverdriveLut.Sample(OverdriveSampler, float2(newColor.b, oldColor.b)).b;
+ }
+
outColor1 = float4(overdriveColor, 1.0);
}
}
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps_refl.h
deleted file mode 100644
index fff0da3..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_ps_refl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef DistortionChroma_ps_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform DistortionChroma_ps_refl[] =
-{
- { "OverdriveScales", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "AaDerivativeMult", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 4 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs.h
deleted file mode 100644
index 5ffc945..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs.h
+++ /dev/null
@@ -1,101 +0,0 @@
-#ifndef DISTORTIONCHROMA_VS_H
-#define DISTORTIONCHROMA_VS_H
-
-static const unsigned char DistortionChroma_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0x8e, 0x20, 0x97, 0xab, 0xce, 0xc8, 0x74, 0x3e,
- 0xfe, 0xeb, 0x97, 0xa0, 0xe6, 0xca, 0x72, 0xa1, 0x01, 0x00, 0x00, 0x00,
- 0x64, 0x04, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x38, 0x01, 0x00, 0x00, 0xd8, 0x01, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00,
- 0xe8, 0x03, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xfc, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0xc8, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xb4, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x00, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x49, 0x53, 0x47, 0x4e, 0x98, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x01, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f,
- 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x9c, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0x64, 0x01, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00,
- 0x59, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x12, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08,
- 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x81, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x11, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x8b, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0xc2, 0x20, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x14, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0xa6, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00,
- 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs_refl.h
deleted file mode 100644
index 7feb789..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionChroma_vs_refl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef DistortionChroma_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform DistortionChroma_vs_refl[] =
-{
- { "EyeToSourceUVScale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "EyeToSourceUVOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.h
deleted file mode 100644
index 418b740..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.h
+++ /dev/null
@@ -1,214 +0,0 @@
-#ifndef DISTORTIONTIMEWARPCHROMA_VS_H
-#define DISTORTIONTIMEWARPCHROMA_VS_H
-
-static const unsigned char DistortionTimewarpChroma_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0x46, 0xb0, 0x5a, 0x1b, 0xfd, 0x8c, 0xdb, 0xa9,
- 0x8d, 0x82, 0x83, 0x1f, 0xd6, 0x4f, 0x4a, 0x8f, 0x01, 0x00, 0x00, 0x00,
- 0xac, 0x09, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x98, 0x01, 0x00, 0x00, 0x38, 0x02, 0x00, 0x00, 0xdc, 0x02, 0x00, 0x00,
- 0x30, 0x09, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x5c, 0x01, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0x2b, 0x01, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe4, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x00, 0x45, 0x79, 0x65, 0x52,
- 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x79, 0x65, 0x52,
- 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x00, 0x4d,
- 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29,
- 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72,
- 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e,
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00,
- 0x49, 0x53, 0x47, 0x4e, 0x98, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x89, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x09, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x8f, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f,
- 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x9c, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x8c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0x4c, 0x06, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00,
- 0x93, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x92, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0xc2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x68, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x11, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x32, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x16, 0x85, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x16, 0x85, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x52, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x92, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x56, 0x81, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x56, 0x81, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x82, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x07, 0x22, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x07,
- 0x42, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x96, 0x05, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0xa6, 0x0a, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0x62, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x81, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa6, 0x8b, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08,
- 0xc2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x07,
- 0x22, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x0f, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05, 0x32, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x11, 0x00, 0x00, 0x07,
- 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x11, 0x00, 0x00, 0x07, 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0e, 0x00, 0x00, 0x07,
- 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x0a, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0xc2, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x06, 0x04, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xa6, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00, 0x2e, 0x00, 0x00, 0x00,
- 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
- 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x11, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.vsh b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.vsh
index 7e5512b..1f62785 100644
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.vsh
+++ b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs.vsh
@@ -1,8 +1,8 @@
/************************************************************************************
-Filename : DistortionTimewarpChroma_vs.vsh
+Filename : DistortionPositionTimewarpChroma_vs.vsh
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
+Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
you may not use the Oculus VR Rift SDK except in compliance with the License,
@@ -21,46 +21,84 @@ limitations under the License.
************************************************************************************/
+Texture2DMS<float,1> DepthTexture1x : register(t0);
+Texture2DMS<float,2> DepthTexture2x : register(t1);
+Texture2DMS<float,4> DepthTexture4x : register(t2);
+
+float depthMsaaSamples = -1.0; // -1 means it's disabled
+
float2 EyeToSourceUVScale;
float2 EyeToSourceUVOffset;
float4x4 EyeRotationStart;
float4x4 EyeRotationEnd;
+// DepthProjector values can also be calculated as:
+// float DepthProjectorX = FarClip / (FarClip - NearClip);
+// float DepthProjectorY = (-FarClip * NearClip) / (FarClip - NearClip);
+float2 DepthProjector;
+float2 DepthDimSize;
+
+float4 PositionFromDepth(float2 inTexCoord)
+{
+ float2 eyeToSourceTexCoord = inTexCoord * EyeToSourceUVScale + EyeToSourceUVOffset;
+ float linearDepth = 1.0;
+
+ if(depthMsaaSamples > 0.0)
+ {
+ float depth;
+ if(depthMsaaSamples <= 1.5)
+ depth = DepthTexture1x.Load(int2(eyeToSourceTexCoord * DepthDimSize), 0).x;
+ else if(depthMsaaSamples <= 2.5)
+ depth = DepthTexture2x.Load(int2(eyeToSourceTexCoord * DepthDimSize), 0).x;
+ else
+ depth = DepthTexture4x.Load(int2(eyeToSourceTexCoord * DepthDimSize), 0).x;
+
+ linearDepth = DepthProjector.y / (depth - DepthProjector.x);
+ }
+
+ float4 retVal = float4(inTexCoord, 1, 1);
+ retVal.xyz *= linearDepth;
+ return retVal;
+}
+
float2 TimewarpTexCoordToWarpedPos(float2 inTexCoord, float4x4 rotMat)
{
// Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
// These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
// Apply the 3x3 timewarp rotation to these vectors.
- float3 transformed = float3( mul ( rotMat, float4(inTexCoord.xy, 1, 1) ).xyz);
+ float4 inputPos = PositionFromDepth(inTexCoord);
+ float3 transformed = float3( mul ( rotMat, inputPos ).xyz);
+
// Project them back onto the Z=1 plane of the rendered images.
float2 flattened = transformed.xy / transformed.z;
+
// Scale them into ([0,0.5],[0,1]) or ([0.5,0],[0,1]) UV lookup space (depending on eye)
return flattened * EyeToSourceUVScale + EyeToSourceUVOffset;
}
-void main(in float2 Position : POSITION,
- in float4 Color : COLOR0,
- in float2 TexCoord0 : TEXCOORD0,
- in float2 TexCoord1 : TEXCOORD1,
- in float2 TexCoord2 : TEXCOORD2,
- out float4 oPosition : SV_Position,
- out float1 oColor : COLOR,
- out float2 oTexCoord0 : TEXCOORD0,
- out float2 oTexCoord1 : TEXCOORD1,
- out float2 oTexCoord2 : TEXCOORD2)
+void main( in float2 Position : POSITION,
+ in float4 Color : COLOR0,
+ in float2 TexCoord0 : TEXCOORD0,
+ in float2 TexCoord1 : TEXCOORD1,
+ in float2 TexCoord2 : TEXCOORD2,
+ out float4 oPosition : SV_Position,
+ out float1 oColor : COLOR,
+ out float2 oTexCoord0 : TEXCOORD0,
+ out float2 oTexCoord1 : TEXCOORD1,
+ out float2 oTexCoord2 : TEXCOORD2)
{
oPosition.x = Position.x;
oPosition.y = Position.y;
oPosition.z = 0.5;
oPosition.w = 1.0;
-
+
float timewarpLerpFactor = Color.a;
float4x4 lerpedEyeRot = lerp(EyeRotationStart, EyeRotationEnd, timewarpLerpFactor);
// warped positions are a bit more involved, hence a separate function
- oTexCoord0 = TimewarpTexCoordToWarpedPos(TexCoord0, lerpedEyeRot);
+ oTexCoord0 = TimewarpTexCoordToWarpedPos(TexCoord0, lerpedEyeRot);
oTexCoord1 = TimewarpTexCoordToWarpedPos(TexCoord1, lerpedEyeRot);
oTexCoord2 = TimewarpTexCoordToWarpedPos(TexCoord2, lerpedEyeRot);
- oColor = Color.r; // Used for vignette fade.
+ oColor = Color.r; // Used for vignette fade.
}
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs_refl.h
deleted file mode 100644
index 38a168f..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarpChroma_vs_refl.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef DistortionTimewarpChroma_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform DistortionTimewarpChroma_vs_refl[] =
-{
- { "EyeToSourceUVScale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "EyeToSourceUVOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
- { "EyeRotationStart", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 16, 64 },
- { "EyeRotationEnd", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 80, 64 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.h
deleted file mode 100644
index 26fc0e2..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.h
+++ /dev/null
@@ -1,167 +0,0 @@
-#ifndef DISTORTIONTIMEWARP_VS_H
-#define DISTORTIONTIMEWARP_VS_H
-
-static const unsigned char DistortionTimewarp_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0x96, 0x74, 0x01, 0x0e, 0x69, 0xc5, 0xe0, 0xbd,
- 0x73, 0x27, 0xa6, 0x54, 0x7e, 0xee, 0xb9, 0xb6, 0x01, 0x00, 0x00, 0x00,
- 0x7c, 0x07, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x98, 0x01, 0x00, 0x00, 0x08, 0x02, 0x00, 0x00, 0x7c, 0x02, 0x00, 0x00,
- 0x00, 0x07, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x5c, 0x01, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0x2b, 0x01, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xc0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xe4, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xf8, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1c, 0x01, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x0c, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x00, 0x45, 0x79, 0x65, 0x52,
- 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x53, 0x74, 0x61, 0x72, 0x74,
- 0x00, 0xab, 0xab, 0xab, 0x03, 0x00, 0x03, 0x00, 0x04, 0x00, 0x04, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x79, 0x65, 0x52,
- 0x6f, 0x74, 0x61, 0x74, 0x69, 0x6f, 0x6e, 0x45, 0x6e, 0x64, 0x00, 0x4d,
- 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29,
- 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72,
- 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e,
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00,
- 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x09, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f,
- 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0x7c, 0x04, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00,
- 0x1f, 0x01, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x92, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x68, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x12, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x22, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x42, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0x82, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09,
- 0x82, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x3a, 0x00, 0x10, 0x80,
- 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x2a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf6, 0x1f, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x32, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x00, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x11, 0x00, 0x00, 0x07, 0x12, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x62, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x81, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x06, 0x81, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x12, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x12, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x62, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x22, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x1a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x22, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x52, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x56, 0x84, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x42, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0a, 0x42, 0x00, 0x10, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x2a, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x92, 0x00, 0x10, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x56, 0x81, 0x20, 0x80, 0x41, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x56, 0x81, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a,
- 0x82, 0x00, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x1a, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00,
- 0x11, 0x00, 0x00, 0x07, 0x42, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x0e, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0a, 0x82, 0x00, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x3a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x3a, 0x00, 0x10, 0x00, 0x04, 0x00, 0x00, 0x00, 0x0a, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x11, 0x00, 0x00, 0x07,
- 0x22, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0e, 0x00, 0x00, 0x07, 0x32, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x96, 0x05, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b, 0x62, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x01, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x81, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xa6, 0x8b, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.vsh b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.vsh
deleted file mode 100644
index d594042..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs.vsh
+++ /dev/null
@@ -1,63 +0,0 @@
-/************************************************************************************
-
-Filename : DistortionTimewarp_vs.vsh
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-float2 EyeToSourceUVScale;
-float2 EyeToSourceUVOffset;
-float4x4 EyeRotationStart;
-float4x4 EyeRotationEnd;
-
-float2 TimewarpTexCoordToWarpedPos(float2 inTexCoord, float4x4 rotMat)
-{
- // Vertex inputs are in TanEyeAngle space for the R,G,B channels (i.e. after chromatic aberration and distortion).
- // These are now "real world" vectors in direction (x,y,1) relative to the eye of the HMD.
- // Apply the 3x3 timewarp rotation to these vectors.
- float3 transformed = float3( mul ( rotMat, float4(inTexCoord,1,1) ).xyz);
- // Project them back onto the Z=1 plane of the rendered images.
- float2 flattened = transformed.xy / transformed.z;
- // Scale them into ([0,0.5],[0,1]) or ([0.5,0],[0,1]) UV lookup space (depending on eye)
- return flattened * EyeToSourceUVScale + EyeToSourceUVOffset;
-
-}
-
-void main(in float2 Position : POSITION,
- in float4 Color : COLOR0,
- in float2 TexCoord0 : TEXCOORD0,
- out float4 oPosition : SV_Position,
- out float1 oColor : COLOR,
- out float2 oTexCoord0 : TEXCOORD0)
-{
-
- oPosition.x = Position.x;
- oPosition.y = Position.y;
- oPosition.z = 0.5;
- oPosition.w = 1.0;
-
- float timewarpLerpFactor = Color.a;
- float4x4 lerpedEyeRot = lerp(EyeRotationStart, EyeRotationEnd, timewarpLerpFactor);
-
- // Warped positions are a bit more involved, hence a separate function
- oTexCoord0 = TimewarpTexCoordToWarpedPos(TexCoord0, lerpedEyeRot);
- oColor = Color.r; // Used for vignette fade.
-}
-
-
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs_refl.h
deleted file mode 100644
index eab6baf..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/DistortionTimewarp_vs_refl.h
+++ /dev/null
@@ -1,11 +0,0 @@
-#ifndef DistortionTimewarp_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform DistortionTimewarp_vs_refl[] =
-{
- { "EyeToSourceUVScale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "EyeToSourceUVOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
- { "EyeRotationStart", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 16, 64 },
- { "EyeRotationEnd", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 80, 64 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps.h b/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps.h
deleted file mode 100644
index 8d7867a..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps.h
+++ /dev/null
@@ -1,65 +0,0 @@
-#ifndef DISTORTION_PS_H
-#define DISTORTION_PS_H
-
-static const unsigned char Distortion_ps[] = {
- 0x44, 0x58, 0x42, 0x43, 0x9d, 0x0b, 0x61, 0x6e, 0xd2, 0x1b, 0xc9, 0x8e,
- 0x12, 0xdf, 0xf7, 0xa6, 0xae, 0xfe, 0x1e, 0x39, 0x01, 0x00, 0x00, 0x00,
- 0xac, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0xd8, 0x00, 0x00, 0x00, 0x4c, 0x01, 0x00, 0x00, 0x80, 0x01, 0x00, 0x00,
- 0x30, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x9c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0x6b, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x63, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x4c, 0x69, 0x6e, 0x65,
- 0x61, 0x72, 0x00, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72, 0x65, 0x00, 0x4d,
- 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29,
- 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72,
- 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e,
- 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00,
- 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x01, 0x01, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x06, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50, 0x6f, 0x73, 0x69, 0x74,
- 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45,
- 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab, 0x4f, 0x53, 0x47, 0x4e,
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0xab, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0xa8, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x2a, 0x00, 0x00, 0x00, 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0x12, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03,
- 0x62, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02,
- 0x01, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09, 0xf2, 0x00, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x96, 0x15, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x60, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07, 0x72, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x02, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x05,
- 0x82, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x80, 0x3f, 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54,
- 0x74, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps_refl.h
deleted file mode 100644
index 8a613f5..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_ps_refl.h
+++ /dev/null
@@ -1 +0,0 @@
-// No data available for shader reflection Distortion_ps_refl \ No newline at end of file
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.h
deleted file mode 100644
index 52b9413..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef DISTORTION_VS_H
-#define DISTORTION_VS_H
-
-static const unsigned char Distortion_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0xfd, 0x23, 0xd7, 0xc6, 0x1a, 0x85, 0x42, 0xd8,
- 0xf1, 0xf2, 0x06, 0x88, 0x86, 0xf0, 0xd9, 0xc7, 0x01, 0x00, 0x00, 0x00,
- 0x7c, 0x03, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x38, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00,
- 0x00, 0x03, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xfc, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0xc8, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xb4, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x45, 0x79, 0x65, 0x54, 0x6f, 0x53, 0x6f, 0x75, 0x72, 0x63, 0x65, 0x55,
- 0x56, 0x4f, 0x66, 0x66, 0x73, 0x65, 0x74, 0x00, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x01, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f,
- 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x01, 0x0e, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x06, 0x09, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0xdc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00,
- 0x37, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x12, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x12, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08,
- 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0x12, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0a, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0x62, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x06, 0x81, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x06, 0x11, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0xa6, 0x8b, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.vsh b/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.vsh
deleted file mode 100644
index d947772..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs.vsh
+++ /dev/null
@@ -1,41 +0,0 @@
-/************************************************************************************
-
-Filename : Distortion_vs.vsh
-
-Copyright : Copyright 2014 Oculus VR, LLC All Rights reserved.
-
-Licensed under the Oculus VR Rift SDK License Version 3.2 (the "License");
-you may not use the Oculus VR Rift SDK except in compliance with the License,
-which is provided at the time of installation or download, or which
-otherwise accompanies this software in either electronic or hard copy form.
-
-You may obtain a copy of the License at
-
-http://www.oculusvr.com/licenses/LICENSE-3.2
-
-Unless required by applicable law or agreed to in writing, the Oculus VR SDK
-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.
-
-************************************************************************************/
-
-float2 EyeToSourceUVScale;
-float2 EyeToSourceUVOffset;
-
-void main(in float2 Position : POSITION,
- in float4 Color : COLOR0,
- in float2 TexCoord0 : TEXCOORD0,
- out float4 oPosition : SV_Position,
- out float1 oColor : COLOR,
- out float2 oTexCoord0 : TEXCOORD0)
-{
- oPosition.x = Position.x;
- oPosition.y = Position.y;
- oPosition.z = 0.5;
- oPosition.w = 1.0;
- oTexCoord0 = EyeToSourceUVScale * TexCoord0 + EyeToSourceUVOffset;
- oColor = Color.r; // Used for vignette fade.
-}
-
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs_refl.h
deleted file mode 100644
index b3e86ac..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/Distortion_vs_refl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef Distortion_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform Distortion_vs_refl[] =
-{
- { "EyeToSourceUVScale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "EyeToSourceUVOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps.h
deleted file mode 100644
index 00f928d..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps.h
+++ /dev/null
@@ -1,51 +0,0 @@
-#ifndef SIMPLEQUAD_PS_H
-#define SIMPLEQUAD_PS_H
-
-static const unsigned char SimpleQuad_ps[] = {
- 0x44, 0x58, 0x42, 0x43, 0x8c, 0x53, 0x2f, 0x7c, 0x3d, 0xea, 0xa5, 0xb6,
- 0x05, 0xb7, 0xe0, 0x83, 0x67, 0x16, 0x9c, 0x93, 0x01, 0x00, 0x00, 0x00,
- 0x08, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x00, 0x01, 0x00, 0x00, 0x10, 0x01, 0x00, 0x00, 0x44, 0x01, 0x00, 0x00,
- 0x8c, 0x01, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xc4, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52,
- 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65,
- 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39,
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31,
- 0x00, 0xab, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, 0x08, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x4f, 0x53, 0x47, 0x4e,
- 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00,
- 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65, 0x74, 0x00, 0xab, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0x40, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x06,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps_refl.h
deleted file mode 100644
index 7980b65..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_ps_refl.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef SimpleQuad_ps_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform SimpleQuad_ps_refl[] =
-{
- { "Color", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 16 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs.h
deleted file mode 100644
index e68903f..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs.h
+++ /dev/null
@@ -1,64 +0,0 @@
-#ifndef SIMPLEQUAD_VS_H
-#define SIMPLEQUAD_VS_H
-
-static const unsigned char SimpleQuad_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0xd5, 0x40, 0x5f, 0xa6, 0x2d, 0x0a, 0xd9, 0x2a,
- 0x84, 0x41, 0x9e, 0x1f, 0xab, 0xa5, 0xa9, 0x2c, 0x01, 0x00, 0x00, 0x00,
- 0xa8, 0x02, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x38, 0x01, 0x00, 0x00, 0x6c, 0x01, 0x00, 0x00, 0xa0, 0x01, 0x00, 0x00,
- 0x2c, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xfc, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0xc8, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00,
- 0xb8, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
- 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x66, 0x73,
- 0x65, 0x74, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0xab,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x49, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0xab, 0xab, 0xab, 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x53, 0x48, 0x44, 0x52,
- 0x84, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x21, 0x00, 0x00, 0x00,
- 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04, 0xf2, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x32, 0x00, 0x00, 0x0b,
- 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08, 0xc2, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f, 0x00, 0x00, 0x80, 0x3f,
- 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs_refl.h
deleted file mode 100644
index 23bb021..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleQuad_vs_refl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef SimpleQuad_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform SimpleQuad_vs_refl[] =
-{
- { "PositionOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "Scale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps.h
deleted file mode 100644
index 39fda03..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps.h
+++ /dev/null
@@ -1,77 +0,0 @@
-#ifndef SIMPLETEXTUREDQUAD_PS_H
-#define SIMPLETEXTUREDQUAD_PS_H
-
-static const unsigned char SimpleTexturedQuad_ps[] = {
- 0x44, 0x58, 0x42, 0x43, 0xbe, 0x17, 0xf1, 0xab, 0xc8, 0x62, 0x4c, 0x11,
- 0xe8, 0x29, 0xb0, 0x5b, 0x0b, 0xf8, 0x73, 0x38, 0x01, 0x00, 0x00, 0x00,
- 0x44, 0x03, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x54, 0x01, 0x00, 0x00, 0xc8, 0x01, 0x00, 0x00, 0xfc, 0x01, 0x00, 0x00,
- 0xc8, 0x02, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0x18, 0x01, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x9c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0xe4, 0x00, 0x00, 0x00, 0x7c, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x8a, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0d, 0x00, 0x00, 0x00, 0x92, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x4c, 0x69, 0x6e, 0x65, 0x61, 0x72, 0x53, 0x61,
- 0x6d, 0x70, 0x6c, 0x65, 0x72, 0x00, 0x54, 0x65, 0x78, 0x74, 0x75, 0x72,
- 0x65, 0x00, 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab,
- 0x92, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0xb4, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0xcc, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xd4, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x43, 0x6f, 0x6c, 0x6f, 0x72, 0x00, 0xab, 0xab, 0x01, 0x00, 0x03, 0x00,
- 0x01, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x4d, 0x69, 0x63, 0x72, 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52,
- 0x29, 0x20, 0x48, 0x4c, 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65,
- 0x72, 0x20, 0x43, 0x6f, 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39,
- 0x2e, 0x32, 0x39, 0x2e, 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31,
- 0x00, 0xab, 0xab, 0xab, 0x49, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x0f, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x03, 0x03, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x4f, 0x53, 0x47, 0x4e, 0x2c, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x0f, 0x00, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x54, 0x61, 0x72, 0x67, 0x65,
- 0x74, 0x00, 0xab, 0xab, 0x53, 0x48, 0x44, 0x52, 0xc4, 0x00, 0x00, 0x00,
- 0x40, 0x00, 0x00, 0x00, 0x31, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04,
- 0x46, 0x8e, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x5a, 0x00, 0x00, 0x03, 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x58, 0x18, 0x00, 0x04, 0x00, 0x70, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x55, 0x55, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0xf2, 0x10, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x62, 0x10, 0x00, 0x03, 0x32, 0x10, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x02, 0x02, 0x00, 0x00, 0x00,
- 0x38, 0x00, 0x00, 0x08, 0xf2, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x45, 0x00, 0x00, 0x09,
- 0xf2, 0x00, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x46, 0x10, 0x10, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x46, 0x7e, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x60, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, 0x00, 0x07,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x46, 0x0e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x3e, 0x00, 0x00, 0x01, 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00,
- 0x04, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps_refl.h
deleted file mode 100644
index 578cc45..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_ps_refl.h
+++ /dev/null
@@ -1,8 +0,0 @@
-#ifndef SimpleTexturedQuad_ps_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform SimpleTexturedQuad_ps_refl[] =
-{
- { "Color", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 16 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs.h
deleted file mode 100644
index 8e18f8e..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs.h
+++ /dev/null
@@ -1,82 +0,0 @@
-#ifndef SIMPLETEXTUREDQUAD_VS_H
-#define SIMPLETEXTUREDQUAD_VS_H
-
-static const unsigned char SimpleTexturedQuad_vs[] = {
- 0x44, 0x58, 0x42, 0x43, 0xe3, 0x2d, 0x41, 0xb3, 0xee, 0x4c, 0x7d, 0xb3,
- 0x80, 0x0d, 0x3a, 0x0c, 0xb6, 0x80, 0x5e, 0xb1, 0x01, 0x00, 0x00, 0x00,
- 0x7c, 0x03, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00,
- 0x38, 0x01, 0x00, 0x00, 0xa8, 0x01, 0x00, 0x00, 0x1c, 0x02, 0x00, 0x00,
- 0x00, 0x03, 0x00, 0x00, 0x52, 0x44, 0x45, 0x46, 0xfc, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x48, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x1c, 0x00, 0x00, 0x00, 0x00, 0x04, 0xfe, 0xff, 0x00, 0x01, 0x00, 0x00,
- 0xc8, 0x00, 0x00, 0x00, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x24, 0x47, 0x6c, 0x6f, 0x62, 0x61, 0x6c, 0x73, 0x00, 0xab, 0xab, 0xab,
- 0x3c, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x60, 0x00, 0x00, 0x00,
- 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xb0, 0x00, 0x00, 0x00,
- 0xb8, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0xa0, 0x00, 0x00, 0x00, 0xc0, 0x00, 0x00, 0x00,
- 0x50, 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x4f, 0x66, 0x66, 0x73,
- 0x65, 0x74, 0x00, 0xab, 0x01, 0x00, 0x03, 0x00, 0x01, 0x00, 0x02, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x53, 0x63, 0x61, 0x6c, 0x65, 0x00, 0xab, 0xab,
- 0x00, 0x00, 0x80, 0x3f, 0x00, 0x00, 0x80, 0x3f, 0x4d, 0x69, 0x63, 0x72,
- 0x6f, 0x73, 0x6f, 0x66, 0x74, 0x20, 0x28, 0x52, 0x29, 0x20, 0x48, 0x4c,
- 0x53, 0x4c, 0x20, 0x53, 0x68, 0x61, 0x64, 0x65, 0x72, 0x20, 0x43, 0x6f,
- 0x6d, 0x70, 0x69, 0x6c, 0x65, 0x72, 0x20, 0x39, 0x2e, 0x32, 0x39, 0x2e,
- 0x39, 0x35, 0x32, 0x2e, 0x33, 0x31, 0x31, 0x31, 0x00, 0xab, 0xab, 0xab,
- 0x49, 0x53, 0x47, 0x4e, 0x68, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x07, 0x03, 0x00, 0x00, 0x59, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x0f, 0x0f, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x03, 0x03, 0x00, 0x00, 0x50, 0x4f, 0x53, 0x49, 0x54, 0x49, 0x4f, 0x4e,
- 0x00, 0x43, 0x4f, 0x4c, 0x4f, 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f,
- 0x4f, 0x52, 0x44, 0x00, 0x4f, 0x53, 0x47, 0x4e, 0x6c, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x50, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x5c, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x62, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
- 0x02, 0x00, 0x00, 0x00, 0x03, 0x0c, 0x00, 0x00, 0x53, 0x56, 0x5f, 0x50,
- 0x6f, 0x73, 0x69, 0x74, 0x69, 0x6f, 0x6e, 0x00, 0x43, 0x4f, 0x4c, 0x4f,
- 0x52, 0x00, 0x54, 0x45, 0x58, 0x43, 0x4f, 0x4f, 0x52, 0x44, 0x00, 0xab,
- 0x53, 0x48, 0x44, 0x52, 0xdc, 0x00, 0x00, 0x00, 0x40, 0x00, 0x01, 0x00,
- 0x37, 0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x04, 0x46, 0x8e, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0xf2, 0x10, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00, 0x5f, 0x00, 0x00, 0x03,
- 0x32, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x67, 0x00, 0x00, 0x04,
- 0xf2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0xf2, 0x20, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x65, 0x00, 0x00, 0x03, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x32, 0x00, 0x00, 0x0b, 0x32, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe6, 0x8a, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x46, 0x80, 0x20, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x36, 0x00, 0x00, 0x08,
- 0xc2, 0x20, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3f,
- 0x00, 0x00, 0x80, 0x3f, 0x36, 0x00, 0x00, 0x05, 0xf2, 0x20, 0x10, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x46, 0x1e, 0x10, 0x00, 0x01, 0x00, 0x00, 0x00,
- 0x36, 0x00, 0x00, 0x05, 0x32, 0x20, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00,
- 0x46, 0x10, 0x10, 0x00, 0x02, 0x00, 0x00, 0x00, 0x3e, 0x00, 0x00, 0x01,
- 0x53, 0x54, 0x41, 0x54, 0x74, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs_refl.h b/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs_refl.h
deleted file mode 100644
index 5adb8a0..0000000
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/SimpleTexturedQuad_vs_refl.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#ifndef SimpleTexturedQuad_vs_refl
-
-const OVR::CAPI::D3D_NS::ShaderBase::Uniform SimpleTexturedQuad_vs_refl[] =
-{
- { "PositionOffset", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 0, 8 },
- { "Scale", OVR::CAPI::D3D_NS::ShaderBase::VARTYPE_FLOAT, 8, 8 },
-};
-
-#endif
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/genComputeShaderHeader.bat b/LibOVR/Src/CAPI/D3D1X/Shaders/genComputeShaderHeader.bat
index 784bc86..0a67677 100644
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/genComputeShaderHeader.bat
+++ b/LibOVR/Src/CAPI/D3D1X/Shaders/genComputeShaderHeader.bat
@@ -3,13 +3,16 @@ pushd %~dp0
echo Compiling shader and packing into header: %~2
setlocal
-set PATH=%PATH%;"%DXSDK_DIR%Utilities\bin\x86\"
fxc.exe /nologo /E main /T cs_5_0 /Fo "%1" %2
bin2header.exe "%1"
echo Generating shader reflection data for %1
ShaderReflector "%1" "%1_refl.h"
+echo /* Concatenating shader reflector output:*/ >> "%1.h"
+type "%1_refl.h" >> "%1.h"
+del "%1_refl.h"
+
del "%1"
endlocal
popd
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/genPixelShaderHeader.bat b/LibOVR/Src/CAPI/D3D1X/Shaders/genPixelShaderHeader.bat
index 76f17c2..5b108dc 100644
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/genPixelShaderHeader.bat
+++ b/LibOVR/Src/CAPI/D3D1X/Shaders/genPixelShaderHeader.bat
@@ -3,13 +3,16 @@ pushd %~dp0
echo Compiling shader and packing into header: %~2
setlocal
-set PATH=%PATH%;"%DXSDK_DIR%Utilities\bin\x86\"
-fxc.exe /nologo /E main /T ps_4_0 /Fo "%1" %2
+fxc.exe /nologo /E main /T ps_4_1 /Fo "%1" %2
bin2header.exe "%1"
echo Generating shader reflection data for %1
ShaderReflector "%1" "%1_refl.h"
+echo /* Concatenating shader reflector output:*/ >> "%1.h"
+type "%1_refl.h" >> "%1.h"
+del "%1_refl.h"
+
del "%1"
endlocal
popd
diff --git a/LibOVR/Src/CAPI/D3D1X/Shaders/genVertexShaderHeader.bat b/LibOVR/Src/CAPI/D3D1X/Shaders/genVertexShaderHeader.bat
index 7085775..aa264d9 100644
--- a/LibOVR/Src/CAPI/D3D1X/Shaders/genVertexShaderHeader.bat
+++ b/LibOVR/Src/CAPI/D3D1X/Shaders/genVertexShaderHeader.bat
@@ -3,13 +3,16 @@ pushd %~dp0
echo Compiling shader and packing into header: %~2
setlocal
-set PATH=%PATH%;"%DXSDK_DIR%Utilities\bin\x86\"
-fxc.exe /nologo /E main /T vs_4_0 /Fo "%1" %2
+fxc.exe /nologo /E main /T vs_4_1 /Fo "%1" %2
bin2header.exe "%1"
echo Generating shader reflection data for %1
ShaderReflector "%1" "%1_refl.h"
+echo /* Concatenating shader reflector output:*/ >> "%1.h"
+type "%1_refl.h" >> "%1.h"
+del "%1_refl.h"
+
del "%1"
endlocal
popd