xref: /aosp_15_r20/external/angle/src/libANGLE/renderer/null/TextureNULL.cpp (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
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 // TextureNULL.cpp:
7 //    Implements the class methods for TextureNULL.
8 //
9 
10 #include "libANGLE/renderer/null/TextureNULL.h"
11 
12 #include "common/debug.h"
13 
14 namespace rx
15 {
16 
TextureNULL(const gl::TextureState & state)17 TextureNULL::TextureNULL(const gl::TextureState &state) : TextureImpl(state) {}
18 
~TextureNULL()19 TextureNULL::~TextureNULL() {}
20 
setImage(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,const gl::Extents & size,GLenum format,GLenum type,const gl::PixelUnpackState & unpack,gl::Buffer * unpackBuffer,const uint8_t * pixels)21 angle::Result TextureNULL::setImage(const gl::Context *context,
22                                     const gl::ImageIndex &index,
23                                     GLenum internalFormat,
24                                     const gl::Extents &size,
25                                     GLenum format,
26                                     GLenum type,
27                                     const gl::PixelUnpackState &unpack,
28                                     gl::Buffer *unpackBuffer,
29                                     const uint8_t *pixels)
30 {
31     // TODO(geofflang): Read all incoming pixel data (maybe hash it?) to make sure we don't read out
32     // of bounds due to validation bugs.
33     return angle::Result::Continue;
34 }
35 
setSubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Box & area,GLenum format,GLenum type,const gl::PixelUnpackState & unpack,gl::Buffer * unpackBuffer,const uint8_t * pixels)36 angle::Result TextureNULL::setSubImage(const gl::Context *context,
37                                        const gl::ImageIndex &index,
38                                        const gl::Box &area,
39                                        GLenum format,
40                                        GLenum type,
41                                        const gl::PixelUnpackState &unpack,
42                                        gl::Buffer *unpackBuffer,
43                                        const uint8_t *pixels)
44 {
45     return angle::Result::Continue;
46 }
47 
setCompressedImage(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,const gl::Extents & size,const gl::PixelUnpackState & unpack,size_t imageSize,const uint8_t * pixels)48 angle::Result TextureNULL::setCompressedImage(const gl::Context *context,
49                                               const gl::ImageIndex &index,
50                                               GLenum internalFormat,
51                                               const gl::Extents &size,
52                                               const gl::PixelUnpackState &unpack,
53                                               size_t imageSize,
54                                               const uint8_t *pixels)
55 {
56     return angle::Result::Continue;
57 }
58 
setCompressedSubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Box & area,GLenum format,const gl::PixelUnpackState & unpack,size_t imageSize,const uint8_t * pixels)59 angle::Result TextureNULL::setCompressedSubImage(const gl::Context *context,
60                                                  const gl::ImageIndex &index,
61                                                  const gl::Box &area,
62                                                  GLenum format,
63                                                  const gl::PixelUnpackState &unpack,
64                                                  size_t imageSize,
65                                                  const uint8_t *pixels)
66 {
67     return angle::Result::Continue;
68 }
69 
copyImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Rectangle & sourceArea,GLenum internalFormat,gl::Framebuffer * source)70 angle::Result TextureNULL::copyImage(const gl::Context *context,
71                                      const gl::ImageIndex &index,
72                                      const gl::Rectangle &sourceArea,
73                                      GLenum internalFormat,
74                                      gl::Framebuffer *source)
75 {
76     return angle::Result::Continue;
77 }
78 
copySubImage(const gl::Context * context,const gl::ImageIndex & index,const gl::Offset & destOffset,const gl::Rectangle & sourceArea,gl::Framebuffer * source)79 angle::Result TextureNULL::copySubImage(const gl::Context *context,
80                                         const gl::ImageIndex &index,
81                                         const gl::Offset &destOffset,
82                                         const gl::Rectangle &sourceArea,
83                                         gl::Framebuffer *source)
84 {
85     return angle::Result::Continue;
86 }
87 
copyTexture(const gl::Context * context,const gl::ImageIndex & index,GLenum internalFormat,GLenum type,GLint sourceLevel,bool unpackFlipY,bool unpackPremultiplyAlpha,bool unpackUnmultiplyAlpha,const gl::Texture * source)88 angle::Result TextureNULL::copyTexture(const gl::Context *context,
89                                        const gl::ImageIndex &index,
90                                        GLenum internalFormat,
91                                        GLenum type,
92                                        GLint sourceLevel,
93                                        bool unpackFlipY,
94                                        bool unpackPremultiplyAlpha,
95                                        bool unpackUnmultiplyAlpha,
96                                        const gl::Texture *source)
97 {
98     return angle::Result::Continue;
99 }
100 
copySubTexture(const gl::Context * context,const gl::ImageIndex & index,const gl::Offset & destOffset,GLint sourceLevel,const gl::Box & sourceBox,bool unpackFlipY,bool unpackPremultiplyAlpha,bool unpackUnmultiplyAlpha,const gl::Texture * source)101 angle::Result TextureNULL::copySubTexture(const gl::Context *context,
102                                           const gl::ImageIndex &index,
103                                           const gl::Offset &destOffset,
104                                           GLint sourceLevel,
105                                           const gl::Box &sourceBox,
106                                           bool unpackFlipY,
107                                           bool unpackPremultiplyAlpha,
108                                           bool unpackUnmultiplyAlpha,
109                                           const gl::Texture *source)
110 {
111     return angle::Result::Continue;
112 }
113 
copyRenderbufferSubData(const gl::Context * context,const gl::Renderbuffer * srcBuffer,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)114 angle::Result TextureNULL::copyRenderbufferSubData(const gl::Context *context,
115                                                    const gl::Renderbuffer *srcBuffer,
116                                                    GLint srcLevel,
117                                                    GLint srcX,
118                                                    GLint srcY,
119                                                    GLint srcZ,
120                                                    GLint dstLevel,
121                                                    GLint dstX,
122                                                    GLint dstY,
123                                                    GLint dstZ,
124                                                    GLsizei srcWidth,
125                                                    GLsizei srcHeight,
126                                                    GLsizei srcDepth)
127 {
128     return angle::Result::Continue;
129 }
130 
copyTextureSubData(const gl::Context * context,const gl::Texture * srcTexture,GLint srcLevel,GLint srcX,GLint srcY,GLint srcZ,GLint dstLevel,GLint dstX,GLint dstY,GLint dstZ,GLsizei srcWidth,GLsizei srcHeight,GLsizei srcDepth)131 angle::Result TextureNULL::copyTextureSubData(const gl::Context *context,
132                                               const gl::Texture *srcTexture,
133                                               GLint srcLevel,
134                                               GLint srcX,
135                                               GLint srcY,
136                                               GLint srcZ,
137                                               GLint dstLevel,
138                                               GLint dstX,
139                                               GLint dstY,
140                                               GLint dstZ,
141                                               GLsizei srcWidth,
142                                               GLsizei srcHeight,
143                                               GLsizei srcDepth)
144 {
145     return angle::Result::Continue;
146 }
147 
copyCompressedTexture(const gl::Context * context,const gl::Texture * source)148 angle::Result TextureNULL::copyCompressedTexture(const gl::Context *context,
149                                                  const gl::Texture *source)
150 {
151     return angle::Result::Continue;
152 }
153 
setStorage(const gl::Context * context,gl::TextureType type,size_t levels,GLenum internalFormat,const gl::Extents & size)154 angle::Result TextureNULL::setStorage(const gl::Context *context,
155                                       gl::TextureType type,
156                                       size_t levels,
157                                       GLenum internalFormat,
158                                       const gl::Extents &size)
159 {
160     return angle::Result::Continue;
161 }
162 
setStorageExternalMemory(const gl::Context * context,gl::TextureType type,size_t levels,GLenum internalFormat,const gl::Extents & size,gl::MemoryObject * memoryObject,GLuint64 offset,GLbitfield createFlags,GLbitfield usageFlags,const void * imageCreateInfoPNext)163 angle::Result TextureNULL::setStorageExternalMemory(const gl::Context *context,
164                                                     gl::TextureType type,
165                                                     size_t levels,
166                                                     GLenum internalFormat,
167                                                     const gl::Extents &size,
168                                                     gl::MemoryObject *memoryObject,
169                                                     GLuint64 offset,
170                                                     GLbitfield createFlags,
171                                                     GLbitfield usageFlags,
172                                                     const void *imageCreateInfoPNext)
173 {
174     return angle::Result::Continue;
175 }
176 
setEGLImageTarget(const gl::Context * context,gl::TextureType type,egl::Image * image)177 angle::Result TextureNULL::setEGLImageTarget(const gl::Context *context,
178                                              gl::TextureType type,
179                                              egl::Image *image)
180 {
181     return angle::Result::Continue;
182 }
183 
setImageExternal(const gl::Context * context,gl::TextureType type,egl::Stream * stream,const egl::Stream::GLTextureDescription & desc)184 angle::Result TextureNULL::setImageExternal(const gl::Context *context,
185                                             gl::TextureType type,
186                                             egl::Stream *stream,
187                                             const egl::Stream::GLTextureDescription &desc)
188 {
189     return angle::Result::Continue;
190 }
191 
generateMipmap(const gl::Context * context)192 angle::Result TextureNULL::generateMipmap(const gl::Context *context)
193 {
194     return angle::Result::Continue;
195 }
196 
setBaseLevel(const gl::Context * context,GLuint baseLevel)197 angle::Result TextureNULL::setBaseLevel(const gl::Context *context, GLuint baseLevel)
198 {
199     return angle::Result::Continue;
200 }
201 
bindTexImage(const gl::Context * context,egl::Surface * surface)202 angle::Result TextureNULL::bindTexImage(const gl::Context *context, egl::Surface *surface)
203 {
204     return angle::Result::Continue;
205 }
206 
releaseTexImage(const gl::Context * context)207 angle::Result TextureNULL::releaseTexImage(const gl::Context *context)
208 {
209     return angle::Result::Continue;
210 }
211 
syncState(const gl::Context * context,const gl::Texture::DirtyBits & dirtyBits,gl::Command source)212 angle::Result TextureNULL::syncState(const gl::Context *context,
213                                      const gl::Texture::DirtyBits &dirtyBits,
214                                      gl::Command source)
215 {
216     return angle::Result::Continue;
217 }
218 
setStorageMultisample(const gl::Context * context,gl::TextureType type,GLsizei samples,GLint internalformat,const gl::Extents & size,bool fixedSampleLocations)219 angle::Result TextureNULL::setStorageMultisample(const gl::Context *context,
220                                                  gl::TextureType type,
221                                                  GLsizei samples,
222                                                  GLint internalformat,
223                                                  const gl::Extents &size,
224                                                  bool fixedSampleLocations)
225 {
226     return angle::Result::Continue;
227 }
228 
initializeContents(const gl::Context * context,GLenum binding,const gl::ImageIndex & imageIndex)229 angle::Result TextureNULL::initializeContents(const gl::Context *context,
230                                               GLenum binding,
231                                               const gl::ImageIndex &imageIndex)
232 {
233     return angle::Result::Continue;
234 }
235 
236 }  // namespace rx
237