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