Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright (c) 2014 The ANGLE Project Authors. All rights reserved. |
| 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 | // FramebufferAttachment.cpp: the gl::FramebufferAttachment class and its derived classes |
| 8 | // objects and related functionality. [OpenGL ES 2.0.24] section 4.4.3 page 108. |
| 9 | |
| 10 | #include "libGLESv2/FramebufferAttachment.h" |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 11 | #include "libGLESv2/Texture.h" |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 12 | #include "libGLESv2/formatutils.h" |
| 13 | #include "libGLESv2/Renderbuffer.h" |
Geoff Lang | 0b7eef7 | 2014-06-12 14:10:47 -0400 | [diff] [blame] | 14 | #include "libGLESv2/renderer/RenderTarget.h" |
| 15 | #include "libGLESv2/renderer/Renderer.h" |
| 16 | #include "libGLESv2/renderer/d3d/TextureStorage.h" |
| 17 | |
| 18 | #include "common/utilities.h" |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 19 | |
| 20 | namespace gl |
| 21 | { |
| 22 | |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 23 | ////// FramebufferAttachment Implementation ////// |
| 24 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 25 | FramebufferAttachment::FramebufferAttachment() |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 26 | { |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 27 | } |
| 28 | |
| 29 | FramebufferAttachment::~FramebufferAttachment() |
| 30 | { |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 31 | } |
| 32 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 33 | GLuint FramebufferAttachment::getRedSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 34 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 35 | return (GetInternalFormatInfo(getInternalFormat()).redBits > 0) ? GetInternalFormatInfo(getActualFormat()).redBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 36 | } |
| 37 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 38 | GLuint FramebufferAttachment::getGreenSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 39 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 40 | return (GetInternalFormatInfo(getInternalFormat()).greenBits > 0) ? GetInternalFormatInfo(getActualFormat()).greenBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 41 | } |
| 42 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 43 | GLuint FramebufferAttachment::getBlueSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 44 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 45 | return (GetInternalFormatInfo(getInternalFormat()).blueBits > 0) ? GetInternalFormatInfo(getActualFormat()).blueBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 46 | } |
| 47 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 48 | GLuint FramebufferAttachment::getAlphaSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 49 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 50 | return (GetInternalFormatInfo(getInternalFormat()).alphaBits > 0) ? GetInternalFormatInfo(getActualFormat()).alphaBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 51 | } |
| 52 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 53 | GLuint FramebufferAttachment::getDepthSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 54 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 55 | return (GetInternalFormatInfo(getInternalFormat()).depthBits > 0) ? GetInternalFormatInfo(getActualFormat()).depthBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 56 | } |
| 57 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 58 | GLuint FramebufferAttachment::getStencilSize() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 59 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 60 | return (GetInternalFormatInfo(getInternalFormat()).stencilBits > 0) ? GetInternalFormatInfo(getActualFormat()).stencilBits : 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 61 | } |
| 62 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 63 | GLenum FramebufferAttachment::getComponentType() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 64 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 65 | return GetInternalFormatInfo(getActualFormat()).componentType; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 66 | } |
| 67 | |
Geoff Lang | e4a492b | 2014-06-19 14:14:41 -0400 | [diff] [blame] | 68 | GLenum FramebufferAttachment::getColorEncoding() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 69 | { |
Geoff Lang | 5d60138 | 2014-07-22 15:14:06 -0400 | [diff] [blame] | 70 | return GetInternalFormatInfo(getActualFormat()).colorEncoding; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 71 | } |
| 72 | |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 73 | bool FramebufferAttachment::isTexture() const |
| 74 | { |
| 75 | return (type() != GL_RENDERBUFFER); |
| 76 | } |
| 77 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 78 | ///// Texture2DAttachment Implementation //////// |
| 79 | |
| 80 | Texture2DAttachment::Texture2DAttachment(Texture2D *texture, GLint level) : mLevel(level) |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 81 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 82 | mTexture2D.set(texture); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 83 | } |
| 84 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 85 | Texture2DAttachment::~Texture2DAttachment() |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 86 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 87 | mTexture2D.set(NULL); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 88 | } |
| 89 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 90 | rx::RenderTarget *Texture2DAttachment::getRenderTarget() |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 91 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 92 | return mTexture2D->getRenderTarget(mLevel); |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 93 | } |
| 94 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 95 | rx::TextureStorage *Texture2DAttachment::getTextureStorage() |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 96 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 97 | return mTexture2D->getNativeTexture()->getStorageInstance(); |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 98 | } |
| 99 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 100 | GLsizei Texture2DAttachment::getWidth() const |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 101 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 102 | return mTexture2D->getWidth(mLevel); |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 103 | } |
| 104 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 105 | GLsizei Texture2DAttachment::getHeight() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 106 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 107 | return mTexture2D->getHeight(mLevel); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 108 | } |
| 109 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 110 | GLenum Texture2DAttachment::getInternalFormat() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 111 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 112 | return mTexture2D->getInternalFormat(mLevel); |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 113 | } |
| 114 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 115 | GLenum Texture2DAttachment::getActualFormat() const |
| 116 | { |
| 117 | return mTexture2D->getActualFormat(mLevel); |
| 118 | } |
| 119 | |
| 120 | GLsizei Texture2DAttachment::getSamples() const |
| 121 | { |
| 122 | return 0; |
| 123 | } |
| 124 | |
| 125 | unsigned int Texture2DAttachment::getSerial() const |
| 126 | { |
| 127 | return mTexture2D->getRenderTargetSerial(mLevel); |
| 128 | } |
| 129 | |
| 130 | GLuint Texture2DAttachment::id() const |
| 131 | { |
| 132 | return mTexture2D->id(); |
| 133 | } |
| 134 | |
| 135 | GLenum Texture2DAttachment::type() const |
| 136 | { |
| 137 | return GL_TEXTURE_2D; |
| 138 | } |
| 139 | |
| 140 | GLint Texture2DAttachment::mipLevel() const |
| 141 | { |
| 142 | return mLevel; |
| 143 | } |
| 144 | |
| 145 | GLint Texture2DAttachment::layer() const |
| 146 | { |
| 147 | return 0; |
| 148 | } |
| 149 | |
| 150 | unsigned int Texture2DAttachment::getTextureSerial() const |
| 151 | { |
| 152 | return mTexture2D->getTextureSerial(); |
| 153 | } |
| 154 | |
| 155 | ///// TextureCubeMapAttachment Implementation //////// |
| 156 | |
| 157 | TextureCubeMapAttachment::TextureCubeMapAttachment(TextureCubeMap *texture, GLenum faceTarget, GLint level) |
| 158 | : mFaceTarget(faceTarget), mLevel(level) |
| 159 | { |
| 160 | mTextureCubeMap.set(texture); |
| 161 | } |
| 162 | |
| 163 | TextureCubeMapAttachment::~TextureCubeMapAttachment() |
| 164 | { |
| 165 | mTextureCubeMap.set(NULL); |
| 166 | } |
| 167 | |
| 168 | rx::RenderTarget *TextureCubeMapAttachment::getRenderTarget() |
| 169 | { |
| 170 | return mTextureCubeMap->getRenderTarget(mFaceTarget, mLevel); |
| 171 | } |
| 172 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 173 | rx::TextureStorage *TextureCubeMapAttachment::getTextureStorage() |
| 174 | { |
| 175 | return mTextureCubeMap->getNativeTexture()->getStorageInstance(); |
| 176 | } |
| 177 | |
| 178 | GLsizei TextureCubeMapAttachment::getWidth() const |
| 179 | { |
| 180 | return mTextureCubeMap->getWidth(mFaceTarget, mLevel); |
| 181 | } |
| 182 | |
| 183 | GLsizei TextureCubeMapAttachment::getHeight() const |
| 184 | { |
| 185 | return mTextureCubeMap->getHeight(mFaceTarget, mLevel); |
| 186 | } |
| 187 | |
| 188 | GLenum TextureCubeMapAttachment::getInternalFormat() const |
| 189 | { |
| 190 | return mTextureCubeMap->getInternalFormat(mFaceTarget, mLevel); |
| 191 | } |
| 192 | |
| 193 | GLenum TextureCubeMapAttachment::getActualFormat() const |
| 194 | { |
| 195 | return mTextureCubeMap->getActualFormat(mFaceTarget, mLevel); |
| 196 | } |
| 197 | |
| 198 | GLsizei TextureCubeMapAttachment::getSamples() const |
| 199 | { |
| 200 | return 0; |
| 201 | } |
| 202 | |
| 203 | unsigned int TextureCubeMapAttachment::getSerial() const |
| 204 | { |
| 205 | return mTextureCubeMap->getRenderTargetSerial(mFaceTarget, mLevel); |
| 206 | } |
| 207 | |
| 208 | GLuint TextureCubeMapAttachment::id() const |
| 209 | { |
| 210 | return mTextureCubeMap->id(); |
| 211 | } |
| 212 | |
| 213 | GLenum TextureCubeMapAttachment::type() const |
| 214 | { |
| 215 | return mFaceTarget; |
| 216 | } |
| 217 | |
| 218 | GLint TextureCubeMapAttachment::mipLevel() const |
| 219 | { |
| 220 | return mLevel; |
| 221 | } |
| 222 | |
| 223 | GLint TextureCubeMapAttachment::layer() const |
| 224 | { |
| 225 | return 0; |
| 226 | } |
| 227 | |
| 228 | unsigned int TextureCubeMapAttachment::getTextureSerial() const |
| 229 | { |
| 230 | return mTextureCubeMap->getTextureSerial(); |
| 231 | } |
| 232 | |
| 233 | ///// Texture3DAttachment Implementation //////// |
| 234 | |
| 235 | Texture3DAttachment::Texture3DAttachment(Texture3D *texture, GLint level, GLint layer) |
| 236 | : mLevel(level), mLayer(layer) |
| 237 | { |
| 238 | mTexture3D.set(texture); |
| 239 | } |
| 240 | |
| 241 | Texture3DAttachment::~Texture3DAttachment() |
| 242 | { |
| 243 | mTexture3D.set(NULL); |
| 244 | } |
| 245 | |
| 246 | rx::RenderTarget *Texture3DAttachment::getRenderTarget() |
| 247 | { |
| 248 | return mTexture3D->getRenderTarget(mLevel, mLayer); |
| 249 | } |
| 250 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 251 | rx::TextureStorage *Texture3DAttachment::getTextureStorage() |
| 252 | { |
| 253 | return mTexture3D->getNativeTexture()->getStorageInstance(); |
| 254 | } |
| 255 | |
| 256 | GLsizei Texture3DAttachment::getWidth() const |
| 257 | { |
| 258 | return mTexture3D->getWidth(mLevel); |
| 259 | } |
| 260 | |
| 261 | GLsizei Texture3DAttachment::getHeight() const |
| 262 | { |
| 263 | return mTexture3D->getHeight(mLevel); |
| 264 | } |
| 265 | |
| 266 | GLenum Texture3DAttachment::getInternalFormat() const |
| 267 | { |
| 268 | return mTexture3D->getInternalFormat(mLevel); |
| 269 | } |
| 270 | |
| 271 | GLenum Texture3DAttachment::getActualFormat() const |
| 272 | { |
| 273 | return mTexture3D->getActualFormat(mLevel); |
| 274 | } |
| 275 | |
| 276 | GLsizei Texture3DAttachment::getSamples() const |
| 277 | { |
| 278 | return 0; |
| 279 | } |
| 280 | |
| 281 | unsigned int Texture3DAttachment::getSerial() const |
| 282 | { |
| 283 | return mTexture3D->getRenderTargetSerial(mLevel, mLayer); |
| 284 | } |
| 285 | |
| 286 | GLuint Texture3DAttachment::id() const |
| 287 | { |
| 288 | return mTexture3D->id(); |
| 289 | } |
| 290 | |
| 291 | GLenum Texture3DAttachment::type() const |
| 292 | { |
| 293 | return GL_TEXTURE_3D; |
| 294 | } |
| 295 | |
| 296 | GLint Texture3DAttachment::mipLevel() const |
| 297 | { |
| 298 | return mLevel; |
| 299 | } |
| 300 | |
| 301 | GLint Texture3DAttachment::layer() const |
| 302 | { |
| 303 | return mLayer; |
| 304 | } |
| 305 | |
| 306 | unsigned int Texture3DAttachment::getTextureSerial() const |
| 307 | { |
| 308 | return mTexture3D->getTextureSerial(); |
| 309 | } |
| 310 | |
| 311 | ////// Texture2DArrayAttachment Implementation ////// |
| 312 | |
| 313 | Texture2DArrayAttachment::Texture2DArrayAttachment(Texture2DArray *texture, GLint level, GLint layer) |
| 314 | : mLevel(level), mLayer(layer) |
| 315 | { |
| 316 | mTexture2DArray.set(texture); |
| 317 | } |
| 318 | |
| 319 | Texture2DArrayAttachment::~Texture2DArrayAttachment() |
| 320 | { |
| 321 | mTexture2DArray.set(NULL); |
| 322 | } |
| 323 | |
| 324 | rx::RenderTarget *Texture2DArrayAttachment::getRenderTarget() |
| 325 | { |
| 326 | return mTexture2DArray->getRenderTarget(mLevel, mLayer); |
| 327 | } |
| 328 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 329 | rx::TextureStorage *Texture2DArrayAttachment::getTextureStorage() |
| 330 | { |
| 331 | return mTexture2DArray->getNativeTexture()->getStorageInstance(); |
| 332 | } |
| 333 | |
| 334 | GLsizei Texture2DArrayAttachment::getWidth() const |
| 335 | { |
| 336 | return mTexture2DArray->getWidth(mLevel); |
| 337 | } |
| 338 | |
| 339 | GLsizei Texture2DArrayAttachment::getHeight() const |
| 340 | { |
| 341 | return mTexture2DArray->getHeight(mLevel); |
| 342 | } |
| 343 | |
| 344 | GLenum Texture2DArrayAttachment::getInternalFormat() const |
| 345 | { |
| 346 | return mTexture2DArray->getInternalFormat(mLevel); |
| 347 | } |
| 348 | |
| 349 | GLenum Texture2DArrayAttachment::getActualFormat() const |
| 350 | { |
| 351 | return mTexture2DArray->getActualFormat(mLevel); |
| 352 | } |
| 353 | |
| 354 | GLsizei Texture2DArrayAttachment::getSamples() const |
| 355 | { |
| 356 | return 0; |
| 357 | } |
| 358 | |
| 359 | unsigned int Texture2DArrayAttachment::getSerial() const |
| 360 | { |
| 361 | return mTexture2DArray->getRenderTargetSerial(mLevel, mLayer); |
| 362 | } |
| 363 | |
| 364 | GLuint Texture2DArrayAttachment::id() const |
| 365 | { |
| 366 | return mTexture2DArray->id(); |
| 367 | } |
| 368 | |
| 369 | GLenum Texture2DArrayAttachment::type() const |
| 370 | { |
| 371 | return GL_TEXTURE_2D_ARRAY; |
| 372 | } |
| 373 | |
| 374 | GLint Texture2DArrayAttachment::mipLevel() const |
| 375 | { |
| 376 | return mLevel; |
| 377 | } |
| 378 | |
| 379 | GLint Texture2DArrayAttachment::layer() const |
| 380 | { |
| 381 | return mLayer; |
| 382 | } |
| 383 | |
| 384 | unsigned int Texture2DArrayAttachment::getTextureSerial() const |
| 385 | { |
| 386 | return mTexture2DArray->getTextureSerial(); |
| 387 | } |
| 388 | |
| 389 | ////// RenderbufferAttachment Implementation ////// |
| 390 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 391 | RenderbufferAttachment::RenderbufferAttachment(Renderbuffer *renderbuffer) |
| 392 | { |
| 393 | ASSERT(renderbuffer); |
| 394 | mRenderbuffer.set(renderbuffer); |
| 395 | } |
| 396 | |
| 397 | RenderbufferAttachment::~RenderbufferAttachment() |
| 398 | { |
| 399 | mRenderbuffer.set(NULL); |
| 400 | } |
| 401 | |
| 402 | rx::RenderTarget *RenderbufferAttachment::getRenderTarget() |
| 403 | { |
| 404 | return mRenderbuffer->getStorage()->getRenderTarget(); |
| 405 | } |
| 406 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 407 | rx::TextureStorage *RenderbufferAttachment::getTextureStorage() |
| 408 | { |
| 409 | UNREACHABLE(); |
| 410 | return NULL; |
| 411 | } |
| 412 | |
| 413 | GLsizei RenderbufferAttachment::getWidth() const |
| 414 | { |
| 415 | return mRenderbuffer->getWidth(); |
| 416 | } |
| 417 | |
| 418 | GLsizei RenderbufferAttachment::getHeight() const |
| 419 | { |
| 420 | return mRenderbuffer->getHeight(); |
| 421 | } |
| 422 | |
| 423 | GLenum RenderbufferAttachment::getInternalFormat() const |
| 424 | { |
| 425 | return mRenderbuffer->getInternalFormat(); |
| 426 | } |
| 427 | |
| 428 | GLenum RenderbufferAttachment::getActualFormat() const |
| 429 | { |
| 430 | return mRenderbuffer->getActualFormat(); |
| 431 | } |
| 432 | |
| 433 | GLsizei RenderbufferAttachment::getSamples() const |
| 434 | { |
| 435 | return mRenderbuffer->getStorage()->getSamples(); |
| 436 | } |
| 437 | |
| 438 | unsigned int RenderbufferAttachment::getSerial() const |
| 439 | { |
| 440 | return mRenderbuffer->getStorage()->getSerial(); |
| 441 | } |
| 442 | |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 443 | GLuint RenderbufferAttachment::id() const |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 444 | { |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 445 | return mRenderbuffer->id(); |
| 446 | } |
| 447 | |
| 448 | GLenum RenderbufferAttachment::type() const |
| 449 | { |
| 450 | return GL_RENDERBUFFER; |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 451 | } |
| 452 | |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 453 | GLint RenderbufferAttachment::mipLevel() const |
| 454 | { |
| 455 | return 0; |
| 456 | } |
| 457 | |
| 458 | GLint RenderbufferAttachment::layer() const |
| 459 | { |
| 460 | return 0; |
| 461 | } |
| 462 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 463 | unsigned int RenderbufferAttachment::getTextureSerial() const |
| 464 | { |
| 465 | UNREACHABLE(); |
| 466 | return 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 467 | } |
| 468 | |
| 469 | } |