RetroArch
image.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2017 ARM Limited
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef SPIRV_CROSS_IMAGE_HPP
18 #define SPIRV_CROSS_IMAGE_HPP
19 
20 #ifndef GLM_SWIZZLE
21 #define GLM_SWIZZLE
22 #endif
23 
24 #ifndef GLM_FORCE_RADIANS
25 #define GLM_FORCE_RADIANS
26 #endif
27 
28 #include <glm/glm.hpp>
29 
30 namespace spirv_cross
31 {
32 template <typename T>
34 {
35  virtual ~image2DBase() = default;
36  inline virtual T load(glm::ivec2 coord) const
37  {
38  return T(0, 0, 0, 1);
39  }
40  inline virtual void store(glm::ivec2 coord, const T &v)
41  {
42  }
43 };
44 
48 
49 template <typename T>
50 inline T imageLoad(const image2DBase<T> &image, glm::ivec2 coord)
51 {
52  return image.load(coord);
53 }
54 
55 template <typename T>
56 void imageStore(image2DBase<T> &image, glm::ivec2 coord, const T &value)
57 {
58  image.store(coord, value);
59 }
60 }
61 
62 #endif
Definition: image.hpp:33
#define T(x)
void imageStore(image2DBase< T > &image, glm::ivec2 coord, const T &value)
Definition: image.hpp:56
Definition: barrier.hpp:23
virtual ~image2DBase()=default
GLuint coord
Definition: glext.h:10418
image2DBase< glm::uvec4 > uimage2D
Definition: image.hpp:47
image2DBase< glm::vec4 > image2D
Definition: image.hpp:45
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glext.h:6305
virtual void store(glm::ivec2 coord, const T &v)
Definition: image.hpp:40
const GLdouble * v
Definition: glext.h:6391
virtual T load(glm::ivec2 coord) const
Definition: image.hpp:36
image2DBase< glm::ivec4 > iimage2D
Definition: image.hpp:46
GLsizei const GLfloat * value
Definition: glext.h:6709
T imageLoad(const image2DBase< T > &image, glm::ivec2 coord)
Definition: image.hpp:50