Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 1 | // |
| 2 | // Copyright 2016 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 | // FramebufferNULL.cpp: |
| 7 | // Implements the class methods for FramebufferNULL. |
| 8 | // |
| 9 | |
| 10 | #include "libANGLE/renderer/null/FramebufferNULL.h" |
| 11 | |
Geoff Lang | 2291c93 | 2016-11-18 14:10:17 -0500 | [diff] [blame] | 12 | #include "libANGLE/formatutils.h" |
| 13 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 14 | #include "common/debug.h" |
| 15 | |
| 16 | namespace rx |
| 17 | { |
| 18 | |
| 19 | FramebufferNULL::FramebufferNULL(const gl::FramebufferState &state) : FramebufferImpl(state) |
| 20 | { |
| 21 | } |
| 22 | |
| 23 | FramebufferNULL::~FramebufferNULL() |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | gl::Error FramebufferNULL::discard(size_t count, const GLenum *attachments) |
| 28 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 29 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 30 | } |
| 31 | |
| 32 | gl::Error FramebufferNULL::invalidate(size_t count, const GLenum *attachments) |
| 33 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 34 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 35 | } |
| 36 | |
| 37 | gl::Error FramebufferNULL::invalidateSub(size_t count, |
| 38 | const GLenum *attachments, |
| 39 | const gl::Rectangle &area) |
| 40 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 41 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 42 | } |
| 43 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 44 | gl::Error FramebufferNULL::clear(const gl::Context *context, GLbitfield mask) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 45 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 46 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 47 | } |
| 48 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 49 | gl::Error FramebufferNULL::clearBufferfv(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 50 | GLenum buffer, |
| 51 | GLint drawbuffer, |
| 52 | const GLfloat *values) |
| 53 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 54 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 55 | } |
| 56 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 57 | gl::Error FramebufferNULL::clearBufferuiv(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 58 | GLenum buffer, |
| 59 | GLint drawbuffer, |
| 60 | const GLuint *values) |
| 61 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 62 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 63 | } |
| 64 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 65 | gl::Error FramebufferNULL::clearBufferiv(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 66 | GLenum buffer, |
| 67 | GLint drawbuffer, |
| 68 | const GLint *values) |
| 69 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 70 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 71 | } |
| 72 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 73 | gl::Error FramebufferNULL::clearBufferfi(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 74 | GLenum buffer, |
| 75 | GLint drawbuffer, |
| 76 | GLfloat depth, |
| 77 | GLint stencil) |
| 78 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 79 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 80 | } |
| 81 | |
| 82 | GLenum FramebufferNULL::getImplementationColorReadFormat() const |
| 83 | { |
Geoff Lang | 2291c93 | 2016-11-18 14:10:17 -0500 | [diff] [blame] | 84 | const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment(); |
| 85 | if (readAttachment == nullptr) |
| 86 | { |
| 87 | return GL_NONE; |
| 88 | } |
| 89 | |
| 90 | const gl::Format &format = readAttachment->getFormat(); |
| 91 | ASSERT(format.info != nullptr); |
| 92 | return format.info->getReadPixelsFormat(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 93 | } |
| 94 | |
| 95 | GLenum FramebufferNULL::getImplementationColorReadType() const |
| 96 | { |
Geoff Lang | 2291c93 | 2016-11-18 14:10:17 -0500 | [diff] [blame] | 97 | const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment(); |
| 98 | if (readAttachment == nullptr) |
| 99 | { |
| 100 | return GL_NONE; |
| 101 | } |
| 102 | |
| 103 | const gl::Format &format = readAttachment->getFormat(); |
| 104 | ASSERT(format.info != nullptr); |
| 105 | return format.info->getReadPixelsType(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 106 | } |
| 107 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 108 | gl::Error FramebufferNULL::readPixels(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 109 | const gl::Rectangle &area, |
| 110 | GLenum format, |
| 111 | GLenum type, |
Jamie Madill | 876429b | 2017-04-20 15:46:24 -0400 | [diff] [blame] | 112 | void *pixels) const |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 113 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 114 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 115 | } |
| 116 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 117 | gl::Error FramebufferNULL::blit(const gl::Context *context, |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 118 | const gl::Rectangle &sourceArea, |
| 119 | const gl::Rectangle &destArea, |
| 120 | GLbitfield mask, |
| 121 | GLenum filter) |
| 122 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 123 | return gl::NoError(); |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 124 | } |
| 125 | |
| 126 | bool FramebufferNULL::checkStatus() const |
| 127 | { |
Geoff Lang | 76cdbd5 | 2016-09-23 16:51:04 -0400 | [diff] [blame] | 128 | return true; |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 129 | } |
| 130 | |
Jamie Madill | c564c07 | 2017-06-01 12:45:42 -0400 | [diff] [blame] | 131 | void FramebufferNULL::syncState(const gl::Context *context, |
Jamie Madill | dd43e6c | 2017-03-24 14:18:49 -0400 | [diff] [blame] | 132 | const gl::Framebuffer::DirtyBits &dirtyBits) |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 133 | { |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 134 | } |
| 135 | |
JiangYizhou | bddc46b | 2016-12-09 09:50:51 +0800 | [diff] [blame] | 136 | gl::Error FramebufferNULL::getSamplePosition(size_t index, GLfloat *xy) const |
| 137 | { |
| 138 | return gl::NoError(); |
| 139 | } |
| 140 | |
Geoff Lang | d08f3b3 | 2016-09-23 15:56:30 -0400 | [diff] [blame] | 141 | } // namespace rx |