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