daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 1 | // |
daniel@transgaming.com | ed36abd | 2013-01-11 21:15:58 +0000 | [diff] [blame] | 2 | // Copyright (c) 2012-2013 The ANGLE Project Authors. All rights reserved. |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 3 | // Use of this source code is governed by a BSD-style license that can be |
| 4 | // found in the LICENSE file. |
| 5 | // |
| 6 | |
| 7 | // SwapChain11.cpp: Implements a back-end specific class for the D3D11 swap chain. |
| 8 | |
| 9 | #include "libGLESv2/renderer/SwapChain11.h" |
| 10 | |
| 11 | #include "common/debug.h" |
| 12 | #include "libGLESv2/utilities.h" |
| 13 | #include "libGLESv2/renderer/renderer11_utils.h" |
| 14 | #include "libGLESv2/renderer/Renderer11.h" |
| 15 | #include "libGLESv2/Context.h" |
| 16 | #include "libGLESv2/main.h" |
| 17 | |
daniel@transgaming.com | 8dc8e27 | 2013-01-11 04:10:45 +0000 | [diff] [blame] | 18 | #include "libGLESv2/renderer/shaders/compiled/passthrough11vs.h" |
shannon.woods@transgaming.com | 2570c34 | 2013-01-25 21:50:22 +0000 | [diff] [blame] | 19 | #include "libGLESv2/renderer/shaders/compiled/passthroughrgba11ps.h" |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 20 | |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 21 | namespace rx |
| 22 | { |
| 23 | |
| 24 | SwapChain11::SwapChain11(Renderer11 *renderer, HWND window, HANDLE shareHandle, |
| 25 | GLenum backBufferFormat, GLenum depthBufferFormat) |
| 26 | : mRenderer(renderer), SwapChain(window, shareHandle, backBufferFormat, depthBufferFormat) |
| 27 | { |
| 28 | mSwapChain = NULL; |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 29 | mBackBufferTexture = NULL; |
| 30 | mBackBufferRTView = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 31 | mOffscreenTexture = NULL; |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 32 | mOffscreenRTView = NULL; |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 33 | mOffscreenSRView = NULL; |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 34 | mDepthStencilTexture = NULL; |
| 35 | mDepthStencilDSView = NULL; |
daniel@transgaming.com | f06e539 | 2013-01-11 21:15:50 +0000 | [diff] [blame] | 36 | mQuadVB = NULL; |
| 37 | mPassThroughSampler = NULL; |
| 38 | mPassThroughIL = NULL; |
| 39 | mPassThroughVS = NULL; |
| 40 | mPassThroughPS = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 41 | mWidth = -1; |
| 42 | mHeight = -1; |
shannon.woods@transgaming.com | ad74a4b | 2013-02-28 23:04:09 +0000 | [diff] [blame] | 43 | mSwapInterval = 0; |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 44 | mAppCreatedShareHandle = mShareHandle != NULL; |
shannon.woods@transgaming.com | 211fa2e | 2013-02-28 23:05:23 +0000 | [diff] [blame] | 45 | mPassThroughResourcesInit = false; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 46 | } |
| 47 | |
| 48 | SwapChain11::~SwapChain11() |
| 49 | { |
| 50 | release(); |
| 51 | } |
| 52 | |
| 53 | void SwapChain11::release() |
| 54 | { |
| 55 | if (mSwapChain) |
| 56 | { |
| 57 | mSwapChain->Release(); |
| 58 | mSwapChain = NULL; |
| 59 | } |
| 60 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 61 | if (mBackBufferTexture) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 62 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 63 | mBackBufferTexture->Release(); |
| 64 | mBackBufferTexture = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 65 | } |
| 66 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 67 | if (mBackBufferRTView) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 68 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 69 | mBackBufferRTView->Release(); |
| 70 | mBackBufferRTView = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 71 | } |
| 72 | |
| 73 | if (mOffscreenTexture) |
| 74 | { |
| 75 | mOffscreenTexture->Release(); |
| 76 | mOffscreenTexture = NULL; |
| 77 | } |
| 78 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 79 | if (mOffscreenRTView) |
| 80 | { |
| 81 | mOffscreenRTView->Release(); |
| 82 | mOffscreenRTView = NULL; |
| 83 | } |
| 84 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 85 | if (mOffscreenSRView) |
| 86 | { |
| 87 | mOffscreenSRView->Release(); |
| 88 | mOffscreenSRView = NULL; |
| 89 | } |
| 90 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 91 | if (mDepthStencilTexture) |
| 92 | { |
| 93 | mDepthStencilTexture->Release(); |
| 94 | mDepthStencilTexture = NULL; |
| 95 | } |
| 96 | |
| 97 | if (mDepthStencilDSView) |
| 98 | { |
| 99 | mDepthStencilDSView->Release(); |
| 100 | mDepthStencilDSView = NULL; |
| 101 | } |
| 102 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 103 | if (mQuadVB) |
| 104 | { |
| 105 | mQuadVB->Release(); |
| 106 | mQuadVB = NULL; |
| 107 | } |
| 108 | |
| 109 | if (mPassThroughSampler) |
| 110 | { |
| 111 | mPassThroughSampler->Release(); |
| 112 | mPassThroughSampler = NULL; |
| 113 | } |
| 114 | |
| 115 | if (mPassThroughIL) |
| 116 | { |
| 117 | mPassThroughIL->Release(); |
| 118 | mPassThroughIL = NULL; |
| 119 | } |
| 120 | |
| 121 | if (mPassThroughVS) |
| 122 | { |
| 123 | mPassThroughVS->Release(); |
| 124 | mPassThroughVS = NULL; |
| 125 | } |
| 126 | |
| 127 | if (mPassThroughPS) |
| 128 | { |
| 129 | mPassThroughPS->Release(); |
| 130 | mPassThroughPS = NULL; |
| 131 | } |
| 132 | |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 133 | if (!mAppCreatedShareHandle) |
| 134 | { |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 135 | mShareHandle = NULL; |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 136 | } |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 137 | } |
| 138 | |
shannon.woods@transgaming.com | 30f52c6 | 2013-02-28 23:05:34 +0000 | [diff] [blame] | 139 | void SwapChain11::releaseOffscreenTexture() |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 140 | { |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 141 | if (mOffscreenTexture) |
| 142 | { |
| 143 | mOffscreenTexture->Release(); |
| 144 | mOffscreenTexture = NULL; |
| 145 | } |
| 146 | |
shannon.woods@transgaming.com | 30f52c6 | 2013-02-28 23:05:34 +0000 | [diff] [blame] | 147 | if (mOffscreenRTView) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 148 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 149 | mOffscreenRTView->Release(); |
| 150 | mOffscreenRTView = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 151 | } |
| 152 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 153 | if (mOffscreenSRView) |
| 154 | { |
| 155 | mOffscreenSRView->Release(); |
| 156 | mOffscreenSRView = NULL; |
| 157 | } |
| 158 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 159 | if (mDepthStencilTexture) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 160 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 161 | mDepthStencilTexture->Release(); |
| 162 | mDepthStencilTexture = NULL; |
| 163 | } |
| 164 | |
| 165 | if (mDepthStencilDSView) |
| 166 | { |
| 167 | mDepthStencilDSView->Release(); |
| 168 | mDepthStencilDSView = NULL; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 169 | } |
shannon.woods@transgaming.com | 30f52c6 | 2013-02-28 23:05:34 +0000 | [diff] [blame] | 170 | } |
| 171 | |
| 172 | EGLint SwapChain11::resetOffscreenTexture(int backbufferWidth, int backbufferHeight) |
| 173 | { |
| 174 | ID3D11Device *device = mRenderer->getDevice(); |
| 175 | |
| 176 | ASSERT(device != NULL); |
| 177 | |
| 178 | // D3D11 does not allow zero size textures |
| 179 | ASSERT(backbufferWidth >= 1); |
| 180 | ASSERT(backbufferHeight >= 1); |
| 181 | |
| 182 | // Preserve the render target content |
| 183 | ID3D11Texture2D *previousOffscreenTexture = mOffscreenTexture; |
| 184 | if (previousOffscreenTexture) |
| 185 | { |
| 186 | previousOffscreenTexture->AddRef(); |
| 187 | } |
| 188 | const int previousWidth = mWidth; |
| 189 | const int previousHeight = mHeight; |
| 190 | |
| 191 | releaseOffscreenTexture(); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 192 | |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 193 | // If the app passed in a share handle, open the resource |
| 194 | // See EGL_ANGLE_d3d_share_handle_client_buffer |
| 195 | if (mAppCreatedShareHandle) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 196 | { |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 197 | ID3D11Resource *tempResource11; |
| 198 | HRESULT result = device->OpenSharedResource(mShareHandle, __uuidof(ID3D11Resource), (void**)&tempResource11); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 199 | |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 200 | if (FAILED(result)) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 201 | { |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 202 | ERR("Failed to open the swap chain pbuffer share handle: %08lX", result); |
| 203 | release(); |
| 204 | return EGL_BAD_PARAMETER; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 205 | } |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 206 | |
| 207 | result = tempResource11->QueryInterface(__uuidof(ID3D11Texture2D), (void**)&mOffscreenTexture); |
| 208 | tempResource11->Release(); |
| 209 | |
| 210 | if (FAILED(result)) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 211 | { |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 212 | ERR("Failed to query texture2d interface in pbuffer share handle: %08lX", result); |
| 213 | release(); |
| 214 | return EGL_BAD_PARAMETER; |
| 215 | } |
| 216 | |
| 217 | // Validate offscreen texture parameters |
| 218 | D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0}; |
| 219 | mOffscreenTexture->GetDesc(&offscreenTextureDesc); |
| 220 | |
| 221 | if (offscreenTextureDesc.Width != (UINT)backbufferWidth |
| 222 | || offscreenTextureDesc.Height != (UINT)backbufferHeight |
| 223 | || offscreenTextureDesc.Format != gl_d3d11::ConvertRenderbufferFormat(mBackBufferFormat) |
| 224 | || offscreenTextureDesc.MipLevels != 1 |
| 225 | || offscreenTextureDesc.ArraySize != 1) |
| 226 | { |
| 227 | ERR("Invalid texture parameters in the shared offscreen texture pbuffer"); |
| 228 | release(); |
| 229 | return EGL_BAD_PARAMETER; |
| 230 | } |
| 231 | } |
| 232 | else |
| 233 | { |
| 234 | const bool useSharedResource = !mWindow && mRenderer->getShareHandleSupport(); |
| 235 | |
| 236 | D3D11_TEXTURE2D_DESC offscreenTextureDesc = {0}; |
| 237 | offscreenTextureDesc.Width = backbufferWidth; |
| 238 | offscreenTextureDesc.Height = backbufferHeight; |
| 239 | offscreenTextureDesc.Format = gl_d3d11::ConvertRenderbufferFormat(mBackBufferFormat); |
| 240 | offscreenTextureDesc.MipLevels = 1; |
| 241 | offscreenTextureDesc.ArraySize = 1; |
| 242 | offscreenTextureDesc.SampleDesc.Count = 1; |
| 243 | offscreenTextureDesc.SampleDesc.Quality = 0; |
| 244 | offscreenTextureDesc.Usage = D3D11_USAGE_DEFAULT; |
| 245 | offscreenTextureDesc.BindFlags = D3D11_BIND_RENDER_TARGET | D3D11_BIND_SHADER_RESOURCE; |
| 246 | offscreenTextureDesc.CPUAccessFlags = 0; |
| 247 | offscreenTextureDesc.MiscFlags = useSharedResource ? D3D11_RESOURCE_MISC_SHARED : 0; |
| 248 | |
| 249 | HRESULT result = device->CreateTexture2D(&offscreenTextureDesc, NULL, &mOffscreenTexture); |
| 250 | |
| 251 | if (FAILED(result)) |
| 252 | { |
| 253 | ERR("Could not create offscreen texture: %08lX", result); |
| 254 | release(); |
| 255 | |
shannon.woods@transgaming.com | f5f5949 | 2013-02-28 23:04:40 +0000 | [diff] [blame] | 256 | if (d3d11::isDeviceLostError(result)) |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 257 | { |
| 258 | return EGL_CONTEXT_LOST; |
| 259 | } |
| 260 | else |
| 261 | { |
| 262 | return EGL_BAD_ALLOC; |
| 263 | } |
| 264 | } |
| 265 | |
| 266 | d3d11::SetDebugName(mOffscreenTexture, "Offscreen texture"); |
| 267 | |
| 268 | // EGL_ANGLE_surface_d3d_texture_2d_share_handle requires that we store a share handle for the client |
| 269 | if (useSharedResource) |
| 270 | { |
| 271 | IDXGIResource *offscreenTextureResource = NULL; |
| 272 | result = mOffscreenTexture->QueryInterface(__uuidof(IDXGIResource), (void**)&offscreenTextureResource); |
| 273 | |
| 274 | // Fall back to no share handle on failure |
| 275 | if (FAILED(result)) |
| 276 | { |
| 277 | ERR("Could not query offscreen texture resource: %08lX", result); |
| 278 | } |
| 279 | else |
| 280 | { |
| 281 | result = offscreenTextureResource->GetSharedHandle(&mShareHandle); |
| 282 | |
| 283 | if (FAILED(result)) |
| 284 | { |
| 285 | mShareHandle = NULL; |
| 286 | ERR("Could not get offscreen texture shared handle: %08lX", result); |
| 287 | } |
| 288 | } |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 289 | } |
| 290 | } |
| 291 | |
shannon.woods@transgaming.com | c60c521 | 2013-01-25 21:54:01 +0000 | [diff] [blame] | 292 | HRESULT result = device->CreateRenderTargetView(mOffscreenTexture, NULL, &mOffscreenRTView); |
| 293 | |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 294 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 295 | d3d11::SetDebugName(mOffscreenRTView, "Offscreen render target"); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 296 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 297 | result = device->CreateShaderResourceView(mOffscreenTexture, NULL, &mOffscreenSRView); |
| 298 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 299 | d3d11::SetDebugName(mOffscreenSRView, "Offscreen shader resource"); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 300 | |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 301 | if (mDepthBufferFormat != GL_NONE) |
| 302 | { |
| 303 | D3D11_TEXTURE2D_DESC depthStencilDesc = {0}; |
| 304 | depthStencilDesc.Width = backbufferWidth; |
| 305 | depthStencilDesc.Height = backbufferHeight; |
| 306 | depthStencilDesc.Format = gl_d3d11::ConvertRenderbufferFormat(mDepthBufferFormat); |
| 307 | depthStencilDesc.MipLevels = 1; |
| 308 | depthStencilDesc.ArraySize = 1; |
| 309 | depthStencilDesc.SampleDesc.Count = 1; |
| 310 | depthStencilDesc.SampleDesc.Quality = 0; |
| 311 | depthStencilDesc.Usage = D3D11_USAGE_DEFAULT; |
| 312 | depthStencilDesc.BindFlags = D3D11_BIND_DEPTH_STENCIL; |
| 313 | depthStencilDesc.CPUAccessFlags = 0; |
| 314 | depthStencilDesc.MiscFlags = 0; |
| 315 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 316 | result = device->CreateTexture2D(&depthStencilDesc, NULL, &mDepthStencilTexture); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 317 | if (FAILED(result)) |
| 318 | { |
| 319 | ERR("Could not create depthstencil surface for new swap chain: 0x%08X", result); |
| 320 | release(); |
| 321 | |
shannon.woods@transgaming.com | f5f5949 | 2013-02-28 23:04:40 +0000 | [diff] [blame] | 322 | if (d3d11::isDeviceLostError(result)) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 323 | { |
| 324 | return EGL_CONTEXT_LOST; |
| 325 | } |
| 326 | else |
| 327 | { |
| 328 | return EGL_BAD_ALLOC; |
| 329 | } |
| 330 | } |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 331 | d3d11::SetDebugName(mDepthStencilTexture, "Depth stencil texture"); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 332 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 333 | result = device->CreateDepthStencilView(mDepthStencilTexture, NULL, &mDepthStencilDSView); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 334 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 335 | d3d11::SetDebugName(mDepthStencilDSView, "Depth stencil view"); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 336 | } |
| 337 | |
shannon.woods@transgaming.com | ae81383 | 2013-02-28 23:05:28 +0000 | [diff] [blame] | 338 | mWidth = backbufferWidth; |
| 339 | mHeight = backbufferHeight; |
| 340 | |
shannon.woods@transgaming.com | 30f52c6 | 2013-02-28 23:05:34 +0000 | [diff] [blame] | 341 | if (previousOffscreenTexture != NULL) |
| 342 | { |
| 343 | D3D11_BOX sourceBox = {0}; |
| 344 | sourceBox.left = 0; |
| 345 | sourceBox.right = std::min(previousWidth, mWidth); |
| 346 | sourceBox.top = std::max(previousHeight - mHeight, 0); |
| 347 | sourceBox.bottom = previousHeight; |
| 348 | sourceBox.front = 0; |
| 349 | sourceBox.back = 1; |
| 350 | |
| 351 | ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); |
| 352 | const int yoffset = std::max(mHeight - previousHeight, 0); |
| 353 | deviceContext->CopySubresourceRegion(mOffscreenTexture, 0, 0, yoffset, 0, previousOffscreenTexture, 0, &sourceBox); |
| 354 | |
| 355 | previousOffscreenTexture->Release(); |
| 356 | |
| 357 | if (mSwapChain) |
| 358 | { |
| 359 | swapRect(0, 0, mWidth, mHeight); |
| 360 | } |
| 361 | } |
| 362 | |
shannon.woods@transgaming.com | ae81383 | 2013-02-28 23:05:28 +0000 | [diff] [blame] | 363 | return EGL_SUCCESS; |
| 364 | } |
| 365 | |
| 366 | EGLint SwapChain11::reset(int backbufferWidth, int backbufferHeight, EGLint swapInterval) |
| 367 | { |
| 368 | ID3D11Device *device = mRenderer->getDevice(); |
| 369 | |
| 370 | if (device == NULL) |
| 371 | { |
| 372 | return EGL_BAD_ACCESS; |
| 373 | } |
| 374 | |
| 375 | // Release specific resources to free up memory for the new render target, while the |
| 376 | // old render target still exists for the purpose of preserving its contents. |
| 377 | if (mSwapChain) |
| 378 | { |
| 379 | mSwapChain->Release(); |
| 380 | mSwapChain = NULL; |
| 381 | } |
| 382 | |
| 383 | if (mBackBufferTexture) |
| 384 | { |
| 385 | mBackBufferTexture->Release(); |
| 386 | mBackBufferTexture = NULL; |
| 387 | } |
| 388 | |
| 389 | if (mBackBufferRTView) |
| 390 | { |
| 391 | mBackBufferRTView->Release(); |
| 392 | mBackBufferRTView = NULL; |
| 393 | } |
| 394 | |
| 395 | mSwapInterval = static_cast<unsigned int>(swapInterval); |
| 396 | if (mSwapInterval > 4) |
| 397 | { |
| 398 | // IDXGISwapChain::Present documentation states that valid sync intervals are in the [0,4] range |
| 399 | return EGL_BAD_PARAMETER; |
| 400 | } |
| 401 | |
| 402 | if (mWindow) |
| 403 | { |
| 404 | // We cannot create a swap chain for an HWND that is owned by a different process |
| 405 | DWORD currentProcessId = GetCurrentProcessId(); |
| 406 | DWORD wndProcessId; |
| 407 | GetWindowThreadProcessId(mWindow, &wndProcessId); |
| 408 | |
| 409 | if (currentProcessId != wndProcessId) |
| 410 | { |
| 411 | ERR("Could not create swap chain, window owned by different process"); |
| 412 | release(); |
| 413 | return EGL_BAD_NATIVE_WINDOW; |
| 414 | } |
| 415 | |
| 416 | IDXGIFactory *factory = mRenderer->getDxgiFactory(); |
| 417 | |
| 418 | DXGI_SWAP_CHAIN_DESC swapChainDesc = {0}; |
| 419 | swapChainDesc.BufferCount = 2; |
| 420 | swapChainDesc.BufferDesc.Format = gl_d3d11::ConvertRenderbufferFormat(mBackBufferFormat); |
| 421 | swapChainDesc.BufferDesc.Width = backbufferWidth; |
| 422 | swapChainDesc.BufferDesc.Height = backbufferHeight; |
| 423 | swapChainDesc.BufferDesc.Scaling = DXGI_MODE_SCALING_UNSPECIFIED; |
| 424 | swapChainDesc.BufferDesc.ScanlineOrdering = DXGI_MODE_SCANLINE_ORDER_UNSPECIFIED; |
| 425 | swapChainDesc.BufferDesc.RefreshRate.Numerator = 0; |
| 426 | swapChainDesc.BufferDesc.RefreshRate.Denominator = 1; |
| 427 | swapChainDesc.BufferUsage = DXGI_USAGE_RENDER_TARGET_OUTPUT; |
| 428 | swapChainDesc.Flags = 0; |
| 429 | swapChainDesc.OutputWindow = mWindow; |
| 430 | swapChainDesc.SampleDesc.Count = 1; |
| 431 | swapChainDesc.SampleDesc.Quality = 0; |
| 432 | swapChainDesc.Windowed = TRUE; |
| 433 | |
| 434 | HRESULT result = factory->CreateSwapChain(device, &swapChainDesc, &mSwapChain); |
| 435 | |
| 436 | if (FAILED(result)) |
| 437 | { |
| 438 | ERR("Could not create additional swap chains or offscreen surfaces: %08lX", result); |
| 439 | release(); |
| 440 | |
| 441 | if (d3d11::isDeviceLostError(result)) |
| 442 | { |
| 443 | return EGL_CONTEXT_LOST; |
| 444 | } |
| 445 | else |
| 446 | { |
| 447 | return EGL_BAD_ALLOC; |
| 448 | } |
| 449 | } |
| 450 | |
| 451 | result = mSwapChain->GetBuffer(0, __uuidof(ID3D11Texture2D), (LPVOID*)&mBackBufferTexture); |
| 452 | ASSERT(SUCCEEDED(result)); |
| 453 | d3d11::SetDebugName(mBackBufferTexture, "Back buffer texture"); |
| 454 | |
| 455 | result = device->CreateRenderTargetView(mBackBufferTexture, NULL, &mBackBufferRTView); |
| 456 | ASSERT(SUCCEEDED(result)); |
| 457 | d3d11::SetDebugName(mBackBufferRTView, "Back buffer render target"); |
| 458 | } |
| 459 | |
shannon.woods@transgaming.com | 211fa2e | 2013-02-28 23:05:23 +0000 | [diff] [blame] | 460 | // If we are resizing the swap chain, we don't wish to recreate all the static resources |
| 461 | if (!mPassThroughResourcesInit) |
| 462 | { |
| 463 | mPassThroughResourcesInit = true; |
| 464 | initPassThroughResources(); |
| 465 | } |
| 466 | |
shannon.woods@transgaming.com | ae81383 | 2013-02-28 23:05:28 +0000 | [diff] [blame] | 467 | return resetOffscreenTexture(backbufferWidth, backbufferHeight); |
shannon.woods@transgaming.com | 211fa2e | 2013-02-28 23:05:23 +0000 | [diff] [blame] | 468 | } |
| 469 | |
| 470 | void SwapChain11::initPassThroughResources() |
| 471 | { |
| 472 | ID3D11Device *device = mRenderer->getDevice(); |
| 473 | |
| 474 | ASSERT(device != NULL); |
| 475 | |
| 476 | // Make sure our resources are all not allocated, when we create |
| 477 | ASSERT(mQuadVB == NULL && mPassThroughSampler == NULL); |
| 478 | ASSERT(mPassThroughIL == NULL && mPassThroughVS == NULL && mPassThroughPS == NULL); |
| 479 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 480 | D3D11_BUFFER_DESC vbDesc; |
shannon.woods@transgaming.com | f3d8207 | 2013-01-25 21:50:43 +0000 | [diff] [blame] | 481 | vbDesc.ByteWidth = sizeof(d3d11::PositionTexCoordVertex) * 4; |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 482 | vbDesc.Usage = D3D11_USAGE_DYNAMIC; |
| 483 | vbDesc.BindFlags = D3D11_BIND_VERTEX_BUFFER; |
| 484 | vbDesc.CPUAccessFlags = D3D11_CPU_ACCESS_WRITE; |
| 485 | vbDesc.MiscFlags = 0; |
| 486 | vbDesc.StructureByteStride = 0; |
| 487 | |
shannon.woods@transgaming.com | 211fa2e | 2013-02-28 23:05:23 +0000 | [diff] [blame] | 488 | HRESULT result = device->CreateBuffer(&vbDesc, NULL, &mQuadVB); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 489 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 490 | d3d11::SetDebugName(mQuadVB, "Swap chain quad vertex buffer"); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 491 | |
| 492 | D3D11_SAMPLER_DESC samplerDesc; |
| 493 | samplerDesc.Filter = D3D11_FILTER_MIN_MAG_MIP_POINT; |
| 494 | samplerDesc.AddressU = D3D11_TEXTURE_ADDRESS_CLAMP; |
| 495 | samplerDesc.AddressV = D3D11_TEXTURE_ADDRESS_CLAMP; |
| 496 | samplerDesc.AddressW = D3D11_TEXTURE_ADDRESS_CLAMP; |
| 497 | samplerDesc.MipLODBias = 0.0f; |
| 498 | samplerDesc.MaxAnisotropy = 0; |
| 499 | samplerDesc.ComparisonFunc = D3D11_COMPARISON_NEVER; |
| 500 | samplerDesc.BorderColor[0] = 0.0f; |
| 501 | samplerDesc.BorderColor[1] = 0.0f; |
| 502 | samplerDesc.BorderColor[2] = 0.0f; |
| 503 | samplerDesc.BorderColor[3] = 0.0f; |
| 504 | samplerDesc.MinLOD = 0; |
| 505 | samplerDesc.MaxLOD = D3D11_FLOAT32_MAX; |
| 506 | |
| 507 | result = device->CreateSamplerState(&samplerDesc, &mPassThroughSampler); |
| 508 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 509 | d3d11::SetDebugName(mPassThroughSampler, "Swap chain pass through sampler"); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 510 | |
| 511 | D3D11_INPUT_ELEMENT_DESC quadLayout[] = |
| 512 | { |
| 513 | { "POSITION", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 0, D3D11_INPUT_PER_VERTEX_DATA, 0 }, |
| 514 | { "TEXCOORD", 0, DXGI_FORMAT_R32G32_FLOAT, 0, 8, D3D11_INPUT_PER_VERTEX_DATA, 0 }, |
| 515 | }; |
| 516 | |
| 517 | result = device->CreateInputLayout(quadLayout, 2, g_VS_Passthrough, sizeof(g_VS_Passthrough), &mPassThroughIL); |
| 518 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 519 | d3d11::SetDebugName(mPassThroughIL, "Swap chain pass through layout"); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 520 | |
| 521 | result = device->CreateVertexShader(g_VS_Passthrough, sizeof(g_VS_Passthrough), NULL, &mPassThroughVS); |
| 522 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 523 | d3d11::SetDebugName(mPassThroughVS, "Swap chain pass through vertex shader"); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 524 | |
shannon.woods@transgaming.com | 2570c34 | 2013-01-25 21:50:22 +0000 | [diff] [blame] | 525 | result = device->CreatePixelShader(g_PS_PassthroughRGBA, sizeof(g_PS_PassthroughRGBA), NULL, &mPassThroughPS); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 526 | ASSERT(SUCCEEDED(result)); |
daniel@transgaming.com | ad3d827 | 2013-01-11 04:11:14 +0000 | [diff] [blame] | 527 | d3d11::SetDebugName(mPassThroughPS, "Swap chain pass through pixel shader"); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 528 | } |
| 529 | |
| 530 | // parameters should be validated/clamped by caller |
| 531 | EGLint SwapChain11::swapRect(EGLint x, EGLint y, EGLint width, EGLint height) |
| 532 | { |
| 533 | if (!mSwapChain) |
| 534 | { |
| 535 | return EGL_SUCCESS; |
| 536 | } |
| 537 | |
| 538 | ID3D11Device *device = mRenderer->getDevice(); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 539 | ID3D11DeviceContext *deviceContext = mRenderer->getDeviceContext(); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 540 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 541 | // Set vertices |
| 542 | D3D11_MAPPED_SUBRESOURCE mappedResource; |
| 543 | HRESULT result = deviceContext->Map(mQuadVB, 0, D3D11_MAP_WRITE_DISCARD, 0, &mappedResource); |
| 544 | if (FAILED(result)) |
| 545 | { |
| 546 | return EGL_BAD_ACCESS; |
| 547 | } |
| 548 | |
shannon.woods@transgaming.com | f3d8207 | 2013-01-25 21:50:43 +0000 | [diff] [blame] | 549 | d3d11::PositionTexCoordVertex *vertices = static_cast<d3d11::PositionTexCoordVertex*>(mappedResource.pData); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 550 | |
| 551 | // Create a quad in homogeneous coordinates |
shannon.woods@transgaming.com | 2ac02d5 | 2013-01-25 21:56:54 +0000 | [diff] [blame] | 552 | float x1 = (x / float(mWidth)) * 2.0f - 1.0f; |
| 553 | float y1 = ((mHeight - y - height) / float(mHeight)) * 2.0f - 1.0f; |
| 554 | float x2 = ((x + width) / float(mWidth)) * 2.0f - 1.0f; |
| 555 | float y2 = ((mHeight - y) / float(mHeight)) * 2.0f - 1.0f; |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 556 | |
| 557 | float u1 = x / float(mWidth); |
| 558 | float v1 = y / float(mHeight); |
| 559 | float u2 = (x + width) / float(mWidth); |
| 560 | float v2 = (y + height) / float(mHeight); |
| 561 | |
shannon.woods@transgaming.com | f3d8207 | 2013-01-25 21:50:43 +0000 | [diff] [blame] | 562 | d3d11::SetPositionTexCoordVertex(&vertices[0], x1, y1, u1, v1); |
| 563 | d3d11::SetPositionTexCoordVertex(&vertices[1], x1, y2, u1, v2); |
| 564 | d3d11::SetPositionTexCoordVertex(&vertices[2], x2, y1, u2, v1); |
| 565 | d3d11::SetPositionTexCoordVertex(&vertices[3], x2, y2, u2, v2); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 566 | |
| 567 | deviceContext->Unmap(mQuadVB, 0); |
| 568 | |
shannon.woods@transgaming.com | f3d8207 | 2013-01-25 21:50:43 +0000 | [diff] [blame] | 569 | static UINT stride = sizeof(d3d11::PositionTexCoordVertex); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 570 | static UINT startIdx = 0; |
| 571 | deviceContext->IASetVertexBuffers(0, 1, &mQuadVB, &stride, &startIdx); |
| 572 | |
| 573 | // Apply state |
| 574 | deviceContext->OMSetDepthStencilState(NULL, 0xFFFFFFFF); |
| 575 | |
| 576 | static const float blendFactor[4] = { 1.0f, 1.0f, 1.0f, 1.0f }; |
| 577 | deviceContext->OMSetBlendState(NULL, blendFactor, 0xFFFFFFF); |
| 578 | |
| 579 | deviceContext->RSSetState(NULL); |
| 580 | |
| 581 | // Apply shaders |
| 582 | deviceContext->IASetInputLayout(mPassThroughIL); |
| 583 | deviceContext->IASetPrimitiveTopology(D3D_PRIMITIVE_TOPOLOGY_TRIANGLESTRIP); |
| 584 | deviceContext->VSSetShader(mPassThroughVS, NULL, 0); |
| 585 | deviceContext->PSSetShader(mPassThroughPS, NULL, 0); |
shannon.woods@transgaming.com | 3e773bb | 2013-01-25 21:55:47 +0000 | [diff] [blame] | 586 | deviceContext->GSSetShader(NULL, NULL, 0); |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 587 | |
| 588 | // Apply render targets |
| 589 | deviceContext->OMSetRenderTargets(1, &mBackBufferRTView, NULL); |
| 590 | |
daniel@transgaming.com | 9799a2f | 2013-01-11 04:09:27 +0000 | [diff] [blame] | 591 | // Set the viewport |
| 592 | D3D11_VIEWPORT viewport; |
| 593 | viewport.TopLeftX = 0; |
| 594 | viewport.TopLeftY = 0; |
| 595 | viewport.Width = mWidth; |
| 596 | viewport.Height = mHeight; |
| 597 | viewport.MinDepth = 0.0f; |
| 598 | viewport.MaxDepth = 1.0f; |
| 599 | deviceContext->RSSetViewports(1, &viewport); |
| 600 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 601 | // Apply textures |
| 602 | deviceContext->PSSetShaderResources(0, 1, &mOffscreenSRView); |
| 603 | deviceContext->PSSetSamplers(0, 1, &mPassThroughSampler); |
| 604 | |
| 605 | // Draw |
| 606 | deviceContext->Draw(4, 0); |
shannon.woods@transgaming.com | ddd6c80 | 2013-02-28 23:05:14 +0000 | [diff] [blame] | 607 | result = mSwapChain->Present(mSwapInterval, 0); |
| 608 | |
| 609 | if (result == DXGI_ERROR_DEVICE_REMOVED) |
| 610 | { |
| 611 | HRESULT removedReason = device->GetDeviceRemovedReason(); |
| 612 | ERR("Present failed: the D3D11 device was removed: 0x%08X", removedReason); |
| 613 | return EGL_CONTEXT_LOST; |
| 614 | } |
| 615 | else if (result == DXGI_ERROR_DEVICE_RESET) |
| 616 | { |
| 617 | ERR("Present failed: the D3D11 device was reset from a bad command."); |
| 618 | return EGL_CONTEXT_LOST; |
| 619 | } |
| 620 | else if (FAILED(result)) |
| 621 | { |
| 622 | ERR("Present failed with error code 0x%08X", result); |
| 623 | } |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 624 | |
| 625 | // Unbind |
| 626 | static ID3D11ShaderResourceView *const nullSRV = NULL; |
| 627 | deviceContext->PSSetShaderResources(0, 1, &nullSRV); |
| 628 | |
| 629 | static ID3D11RenderTargetView *const nullRTV = NULL; |
| 630 | deviceContext->OMSetRenderTargets(1, &nullRTV, NULL); |
| 631 | |
daniel@transgaming.com | e097047 | 2012-11-28 21:05:07 +0000 | [diff] [blame] | 632 | mRenderer->markAllStateDirty(); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 633 | |
| 634 | return EGL_SUCCESS; |
| 635 | } |
| 636 | |
shannon.woods@transgaming.com | 5c25ed2 | 2013-01-25 21:49:51 +0000 | [diff] [blame] | 637 | // Increments refcount on texture. |
| 638 | // caller must Release() the returned texture |
| 639 | ID3D11Texture2D *SwapChain11::getOffscreenTexture() |
| 640 | { |
| 641 | if (mOffscreenTexture) |
| 642 | { |
| 643 | mOffscreenTexture->AddRef(); |
| 644 | } |
| 645 | |
| 646 | return mOffscreenTexture; |
| 647 | } |
| 648 | |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 649 | // Increments refcount on view. |
| 650 | // caller must Release() the returned view |
| 651 | ID3D11RenderTargetView *SwapChain11::getRenderTarget() |
| 652 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 653 | if (mOffscreenRTView) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 654 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 655 | mOffscreenRTView->AddRef(); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 656 | } |
| 657 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 658 | return mOffscreenRTView; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 659 | } |
| 660 | |
| 661 | // Increments refcount on view. |
| 662 | // caller must Release() the returned view |
shannon.woods@transgaming.com | 5c25ed2 | 2013-01-25 21:49:51 +0000 | [diff] [blame] | 663 | ID3D11ShaderResourceView *SwapChain11::getRenderTargetShaderResource() |
| 664 | { |
| 665 | if (mOffscreenSRView) |
| 666 | { |
| 667 | mOffscreenSRView->AddRef(); |
| 668 | } |
| 669 | |
| 670 | return mOffscreenSRView; |
| 671 | } |
| 672 | |
| 673 | // Increments refcount on view. |
| 674 | // caller must Release() the returned view |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 675 | ID3D11DepthStencilView *SwapChain11::getDepthStencil() |
| 676 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 677 | if (mDepthStencilDSView) |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 678 | { |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 679 | mDepthStencilDSView->AddRef(); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 680 | } |
| 681 | |
daniel@transgaming.com | c8c70ad | 2012-11-28 21:04:37 +0000 | [diff] [blame] | 682 | return mDepthStencilDSView; |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 683 | } |
| 684 | |
daniel@transgaming.com | d733bb8 | 2012-11-28 20:53:40 +0000 | [diff] [blame] | 685 | SwapChain11 *SwapChain11::makeSwapChain11(SwapChain *swapChain) |
| 686 | { |
apatrick@chromium.org | 8b400b1 | 2013-01-30 21:53:40 +0000 | [diff] [blame] | 687 | ASSERT(HAS_DYNAMIC_TYPE(rx::SwapChain11*, swapChain)); |
daniel@transgaming.com | d733bb8 | 2012-11-28 20:53:40 +0000 | [diff] [blame] | 688 | return static_cast<rx::SwapChain11*>(swapChain); |
daniel@transgaming.com | 32fdf82 | 2012-11-28 20:53:30 +0000 | [diff] [blame] | 689 | } |
daniel@transgaming.com | d733bb8 | 2012-11-28 20:53:40 +0000 | [diff] [blame] | 690 | |
| 691 | } |