blob: cedea8e115f57f920bae643e17dec2ebcfd6da33 [file] [log] [blame]
Geoff Langd08f3b32016-09-23 15:56:30 -04001//
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 Lang2291c932016-11-18 14:10:17 -050012#include "libANGLE/formatutils.h"
13
Geoff Langd08f3b32016-09-23 15:56:30 -040014#include "common/debug.h"
15
16namespace rx
17{
18
19FramebufferNULL::FramebufferNULL(const gl::FramebufferState &state) : FramebufferImpl(state)
20{
21}
22
23FramebufferNULL::~FramebufferNULL()
24{
25}
26
27gl::Error FramebufferNULL::discard(size_t count, const GLenum *attachments)
28{
29 UNIMPLEMENTED();
30 return gl::Error(GL_INVALID_OPERATION);
31}
32
33gl::Error FramebufferNULL::invalidate(size_t count, const GLenum *attachments)
34{
35 UNIMPLEMENTED();
36 return gl::Error(GL_INVALID_OPERATION);
37}
38
39gl::Error FramebufferNULL::invalidateSub(size_t count,
40 const GLenum *attachments,
41 const gl::Rectangle &area)
42{
43 UNIMPLEMENTED();
44 return gl::Error(GL_INVALID_OPERATION);
45}
46
47gl::Error FramebufferNULL::clear(ContextImpl *context, GLbitfield mask)
48{
49 UNIMPLEMENTED();
50 return gl::Error(GL_INVALID_OPERATION);
51}
52
53gl::Error FramebufferNULL::clearBufferfv(ContextImpl *context,
54 GLenum buffer,
55 GLint drawbuffer,
56 const GLfloat *values)
57{
58 UNIMPLEMENTED();
59 return gl::Error(GL_INVALID_OPERATION);
60}
61
62gl::Error FramebufferNULL::clearBufferuiv(ContextImpl *context,
63 GLenum buffer,
64 GLint drawbuffer,
65 const GLuint *values)
66{
67 UNIMPLEMENTED();
68 return gl::Error(GL_INVALID_OPERATION);
69}
70
71gl::Error FramebufferNULL::clearBufferiv(ContextImpl *context,
72 GLenum buffer,
73 GLint drawbuffer,
74 const GLint *values)
75{
76 UNIMPLEMENTED();
77 return gl::Error(GL_INVALID_OPERATION);
78}
79
80gl::Error FramebufferNULL::clearBufferfi(ContextImpl *context,
81 GLenum buffer,
82 GLint drawbuffer,
83 GLfloat depth,
84 GLint stencil)
85{
86 UNIMPLEMENTED();
87 return gl::Error(GL_INVALID_OPERATION);
88}
89
90GLenum FramebufferNULL::getImplementationColorReadFormat() const
91{
Geoff Lang2291c932016-11-18 14:10:17 -050092 const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment();
93 if (readAttachment == nullptr)
94 {
95 return GL_NONE;
96 }
97
98 const gl::Format &format = readAttachment->getFormat();
99 ASSERT(format.info != nullptr);
100 return format.info->getReadPixelsFormat();
Geoff Langd08f3b32016-09-23 15:56:30 -0400101}
102
103GLenum FramebufferNULL::getImplementationColorReadType() const
104{
Geoff Lang2291c932016-11-18 14:10:17 -0500105 const gl::FramebufferAttachment *readAttachment = mState.getReadAttachment();
106 if (readAttachment == nullptr)
107 {
108 return GL_NONE;
109 }
110
111 const gl::Format &format = readAttachment->getFormat();
112 ASSERT(format.info != nullptr);
113 return format.info->getReadPixelsType();
Geoff Langd08f3b32016-09-23 15:56:30 -0400114}
115
116gl::Error FramebufferNULL::readPixels(ContextImpl *context,
117 const gl::Rectangle &area,
118 GLenum format,
119 GLenum type,
120 GLvoid *pixels) const
121{
122 UNIMPLEMENTED();
123 return gl::Error(GL_INVALID_OPERATION);
124}
125
126gl::Error FramebufferNULL::blit(ContextImpl *context,
127 const gl::Rectangle &sourceArea,
128 const gl::Rectangle &destArea,
129 GLbitfield mask,
130 GLenum filter)
131{
132 UNIMPLEMENTED();
133 return gl::Error(GL_INVALID_OPERATION);
134}
135
136bool FramebufferNULL::checkStatus() const
137{
138 UNIMPLEMENTED();
139 return bool();
140}
141
142void FramebufferNULL::syncState(const gl::Framebuffer::DirtyBits &dirtyBits)
143{
144 UNIMPLEMENTED();
145}
146
147} // namespace rx