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 | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 78 | ///// TextureAttachment Implementation //////// |
| 79 | |
| 80 | rx::TextureStorage *TextureAttachment::getTextureStorage() |
| 81 | { |
| 82 | return getTexture()->getNativeTexture()->getStorageInstance(); |
| 83 | } |
| 84 | |
| 85 | GLsizei TextureAttachment::getSamples() const |
| 86 | { |
| 87 | return 0; |
| 88 | } |
| 89 | |
| 90 | GLuint TextureAttachment::id() const |
| 91 | { |
| 92 | return getTexture()->id(); |
| 93 | } |
| 94 | |
| 95 | unsigned int TextureAttachment::getTextureSerial() const |
| 96 | { |
| 97 | return getTexture()->getTextureSerial(); |
| 98 | } |
| 99 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 100 | ///// Texture2DAttachment Implementation //////// |
| 101 | |
| 102 | Texture2DAttachment::Texture2DAttachment(Texture2D *texture, GLint level) : mLevel(level) |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 103 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 104 | mTexture2D.set(texture); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 105 | } |
| 106 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 107 | Texture2DAttachment::~Texture2DAttachment() |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 108 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 109 | mTexture2D.set(NULL); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 110 | } |
| 111 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 112 | rx::RenderTarget *Texture2DAttachment::getRenderTarget() |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 113 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 114 | return mTexture2D->getRenderTarget(mLevel); |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 115 | } |
| 116 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 117 | GLsizei Texture2DAttachment::getWidth() const |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 118 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 119 | return mTexture2D->getWidth(mLevel); |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 120 | } |
| 121 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 122 | GLsizei Texture2DAttachment::getHeight() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 123 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 124 | return mTexture2D->getHeight(mLevel); |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 125 | } |
| 126 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 127 | GLenum Texture2DAttachment::getInternalFormat() const |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 128 | { |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 129 | return mTexture2D->getInternalFormat(mLevel); |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 130 | } |
| 131 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 132 | GLenum Texture2DAttachment::getActualFormat() const |
| 133 | { |
| 134 | return mTexture2D->getActualFormat(mLevel); |
| 135 | } |
| 136 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 137 | unsigned int Texture2DAttachment::getSerial() const |
| 138 | { |
| 139 | return mTexture2D->getRenderTargetSerial(mLevel); |
| 140 | } |
| 141 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 142 | GLenum Texture2DAttachment::type() const |
| 143 | { |
| 144 | return GL_TEXTURE_2D; |
| 145 | } |
| 146 | |
| 147 | GLint Texture2DAttachment::mipLevel() const |
| 148 | { |
| 149 | return mLevel; |
| 150 | } |
| 151 | |
| 152 | GLint Texture2DAttachment::layer() const |
| 153 | { |
| 154 | return 0; |
| 155 | } |
| 156 | |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 157 | Texture *Texture2DAttachment::getTexture() const |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 158 | { |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 159 | return mTexture2D.get(); |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 160 | } |
| 161 | |
| 162 | ///// TextureCubeMapAttachment Implementation //////// |
| 163 | |
| 164 | TextureCubeMapAttachment::TextureCubeMapAttachment(TextureCubeMap *texture, GLenum faceTarget, GLint level) |
| 165 | : mFaceTarget(faceTarget), mLevel(level) |
| 166 | { |
| 167 | mTextureCubeMap.set(texture); |
| 168 | } |
| 169 | |
| 170 | TextureCubeMapAttachment::~TextureCubeMapAttachment() |
| 171 | { |
| 172 | mTextureCubeMap.set(NULL); |
| 173 | } |
| 174 | |
| 175 | rx::RenderTarget *TextureCubeMapAttachment::getRenderTarget() |
| 176 | { |
| 177 | return mTextureCubeMap->getRenderTarget(mFaceTarget, mLevel); |
| 178 | } |
| 179 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 180 | GLsizei TextureCubeMapAttachment::getWidth() const |
| 181 | { |
| 182 | return mTextureCubeMap->getWidth(mFaceTarget, mLevel); |
| 183 | } |
| 184 | |
| 185 | GLsizei TextureCubeMapAttachment::getHeight() const |
| 186 | { |
| 187 | return mTextureCubeMap->getHeight(mFaceTarget, mLevel); |
| 188 | } |
| 189 | |
| 190 | GLenum TextureCubeMapAttachment::getInternalFormat() const |
| 191 | { |
| 192 | return mTextureCubeMap->getInternalFormat(mFaceTarget, mLevel); |
| 193 | } |
| 194 | |
| 195 | GLenum TextureCubeMapAttachment::getActualFormat() const |
| 196 | { |
| 197 | return mTextureCubeMap->getActualFormat(mFaceTarget, mLevel); |
| 198 | } |
| 199 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 200 | unsigned int TextureCubeMapAttachment::getSerial() const |
| 201 | { |
| 202 | return mTextureCubeMap->getRenderTargetSerial(mFaceTarget, mLevel); |
| 203 | } |
| 204 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 205 | GLenum TextureCubeMapAttachment::type() const |
| 206 | { |
| 207 | return mFaceTarget; |
| 208 | } |
| 209 | |
| 210 | GLint TextureCubeMapAttachment::mipLevel() const |
| 211 | { |
| 212 | return mLevel; |
| 213 | } |
| 214 | |
| 215 | GLint TextureCubeMapAttachment::layer() const |
| 216 | { |
| 217 | return 0; |
| 218 | } |
| 219 | |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 220 | Texture *TextureCubeMapAttachment::getTexture() const |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 221 | { |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 222 | return mTextureCubeMap.get(); |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 223 | } |
| 224 | |
| 225 | ///// Texture3DAttachment Implementation //////// |
| 226 | |
| 227 | Texture3DAttachment::Texture3DAttachment(Texture3D *texture, GLint level, GLint layer) |
| 228 | : mLevel(level), mLayer(layer) |
| 229 | { |
| 230 | mTexture3D.set(texture); |
| 231 | } |
| 232 | |
| 233 | Texture3DAttachment::~Texture3DAttachment() |
| 234 | { |
| 235 | mTexture3D.set(NULL); |
| 236 | } |
| 237 | |
| 238 | rx::RenderTarget *Texture3DAttachment::getRenderTarget() |
| 239 | { |
| 240 | return mTexture3D->getRenderTarget(mLevel, mLayer); |
| 241 | } |
| 242 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 243 | GLsizei Texture3DAttachment::getWidth() const |
| 244 | { |
| 245 | return mTexture3D->getWidth(mLevel); |
| 246 | } |
| 247 | |
| 248 | GLsizei Texture3DAttachment::getHeight() const |
| 249 | { |
| 250 | return mTexture3D->getHeight(mLevel); |
| 251 | } |
| 252 | |
| 253 | GLenum Texture3DAttachment::getInternalFormat() const |
| 254 | { |
| 255 | return mTexture3D->getInternalFormat(mLevel); |
| 256 | } |
| 257 | |
| 258 | GLenum Texture3DAttachment::getActualFormat() const |
| 259 | { |
| 260 | return mTexture3D->getActualFormat(mLevel); |
| 261 | } |
| 262 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 263 | unsigned int Texture3DAttachment::getSerial() const |
| 264 | { |
| 265 | return mTexture3D->getRenderTargetSerial(mLevel, mLayer); |
| 266 | } |
| 267 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 268 | GLenum Texture3DAttachment::type() const |
| 269 | { |
| 270 | return GL_TEXTURE_3D; |
| 271 | } |
| 272 | |
| 273 | GLint Texture3DAttachment::mipLevel() const |
| 274 | { |
| 275 | return mLevel; |
| 276 | } |
| 277 | |
| 278 | GLint Texture3DAttachment::layer() const |
| 279 | { |
| 280 | return mLayer; |
| 281 | } |
| 282 | |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 283 | Texture *Texture3DAttachment::getTexture() const |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 284 | { |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 285 | return mTexture3D.get(); |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 286 | } |
| 287 | |
| 288 | ////// Texture2DArrayAttachment Implementation ////// |
| 289 | |
| 290 | Texture2DArrayAttachment::Texture2DArrayAttachment(Texture2DArray *texture, GLint level, GLint layer) |
| 291 | : mLevel(level), mLayer(layer) |
| 292 | { |
| 293 | mTexture2DArray.set(texture); |
| 294 | } |
| 295 | |
| 296 | Texture2DArrayAttachment::~Texture2DArrayAttachment() |
| 297 | { |
| 298 | mTexture2DArray.set(NULL); |
| 299 | } |
| 300 | |
| 301 | rx::RenderTarget *Texture2DArrayAttachment::getRenderTarget() |
| 302 | { |
| 303 | return mTexture2DArray->getRenderTarget(mLevel, mLayer); |
| 304 | } |
| 305 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 306 | GLsizei Texture2DArrayAttachment::getWidth() const |
| 307 | { |
| 308 | return mTexture2DArray->getWidth(mLevel); |
| 309 | } |
| 310 | |
| 311 | GLsizei Texture2DArrayAttachment::getHeight() const |
| 312 | { |
| 313 | return mTexture2DArray->getHeight(mLevel); |
| 314 | } |
| 315 | |
| 316 | GLenum Texture2DArrayAttachment::getInternalFormat() const |
| 317 | { |
| 318 | return mTexture2DArray->getInternalFormat(mLevel); |
| 319 | } |
| 320 | |
| 321 | GLenum Texture2DArrayAttachment::getActualFormat() const |
| 322 | { |
| 323 | return mTexture2DArray->getActualFormat(mLevel); |
| 324 | } |
| 325 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 326 | unsigned int Texture2DArrayAttachment::getSerial() const |
| 327 | { |
| 328 | return mTexture2DArray->getRenderTargetSerial(mLevel, mLayer); |
| 329 | } |
| 330 | |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 331 | GLenum Texture2DArrayAttachment::type() const |
| 332 | { |
| 333 | return GL_TEXTURE_2D_ARRAY; |
| 334 | } |
| 335 | |
| 336 | GLint Texture2DArrayAttachment::mipLevel() const |
| 337 | { |
| 338 | return mLevel; |
| 339 | } |
| 340 | |
| 341 | GLint Texture2DArrayAttachment::layer() const |
| 342 | { |
| 343 | return mLayer; |
| 344 | } |
| 345 | |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 346 | Texture *Texture2DArrayAttachment::getTexture() const |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 347 | { |
Jamie Madill | 3592a33 | 2014-09-03 15:07:15 -0400 | [diff] [blame^] | 348 | return mTexture2DArray.get(); |
Jamie Madill | e261b44 | 2014-06-25 12:42:21 -0400 | [diff] [blame] | 349 | } |
| 350 | |
| 351 | ////// RenderbufferAttachment Implementation ////// |
| 352 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 353 | RenderbufferAttachment::RenderbufferAttachment(Renderbuffer *renderbuffer) |
| 354 | { |
| 355 | ASSERT(renderbuffer); |
| 356 | mRenderbuffer.set(renderbuffer); |
| 357 | } |
| 358 | |
| 359 | RenderbufferAttachment::~RenderbufferAttachment() |
| 360 | { |
| 361 | mRenderbuffer.set(NULL); |
| 362 | } |
| 363 | |
| 364 | rx::RenderTarget *RenderbufferAttachment::getRenderTarget() |
| 365 | { |
| 366 | return mRenderbuffer->getStorage()->getRenderTarget(); |
| 367 | } |
| 368 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 369 | rx::TextureStorage *RenderbufferAttachment::getTextureStorage() |
| 370 | { |
| 371 | UNREACHABLE(); |
| 372 | return NULL; |
| 373 | } |
| 374 | |
| 375 | GLsizei RenderbufferAttachment::getWidth() const |
| 376 | { |
| 377 | return mRenderbuffer->getWidth(); |
| 378 | } |
| 379 | |
| 380 | GLsizei RenderbufferAttachment::getHeight() const |
| 381 | { |
| 382 | return mRenderbuffer->getHeight(); |
| 383 | } |
| 384 | |
| 385 | GLenum RenderbufferAttachment::getInternalFormat() const |
| 386 | { |
| 387 | return mRenderbuffer->getInternalFormat(); |
| 388 | } |
| 389 | |
| 390 | GLenum RenderbufferAttachment::getActualFormat() const |
| 391 | { |
| 392 | return mRenderbuffer->getActualFormat(); |
| 393 | } |
| 394 | |
| 395 | GLsizei RenderbufferAttachment::getSamples() const |
| 396 | { |
| 397 | return mRenderbuffer->getStorage()->getSamples(); |
| 398 | } |
| 399 | |
| 400 | unsigned int RenderbufferAttachment::getSerial() const |
| 401 | { |
| 402 | return mRenderbuffer->getStorage()->getSerial(); |
| 403 | } |
| 404 | |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 405 | GLuint RenderbufferAttachment::id() const |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 406 | { |
Jamie Madill | 218b6ed | 2014-06-16 10:34:01 -0400 | [diff] [blame] | 407 | return mRenderbuffer->id(); |
| 408 | } |
| 409 | |
| 410 | GLenum RenderbufferAttachment::type() const |
| 411 | { |
| 412 | return GL_RENDERBUFFER; |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 413 | } |
| 414 | |
Jamie Madill | 9c074a3 | 2014-06-16 10:34:02 -0400 | [diff] [blame] | 415 | GLint RenderbufferAttachment::mipLevel() const |
| 416 | { |
| 417 | return 0; |
| 418 | } |
| 419 | |
| 420 | GLint RenderbufferAttachment::layer() const |
| 421 | { |
| 422 | return 0; |
| 423 | } |
| 424 | |
Jamie Madill | 6c7b4ad | 2014-06-16 10:33:59 -0400 | [diff] [blame] | 425 | unsigned int RenderbufferAttachment::getTextureSerial() const |
| 426 | { |
| 427 | UNREACHABLE(); |
| 428 | return 0; |
Jamie Madill | afc21c0 | 2014-06-04 15:29:47 -0400 | [diff] [blame] | 429 | } |
| 430 | |
| 431 | } |