blob: 0be8d71debbb4efed5ee625ec8b37e97035cc2dd [file] [log] [blame]
daniel@transgaming.com621ce052012-10-31 17:52:29 +00001//
Geoff Langeeba6e12014-02-03 13:12:30 -05002// Copyright (c) 2012-2014 The ANGLE Project Authors. All rights reserved.
daniel@transgaming.com621ce052012-10-31 17:52:29 +00003// Use of this source code is governed by a BSD-style license that can be
4// found in the LICENSE file.
5//
6
7// Renderer.h: Defines a back-end specific class that hides the details of the
8// implementation-specific renderer.
9
10#ifndef LIBGLESV2_RENDERER_RENDERER_H_
11#define LIBGLESV2_RENDERER_RENDERER_H_
12
daniel@transgaming.comab1c1462012-12-20 21:08:30 +000013#include "libGLESv2/Uniform.h"
daniel@transgaming.comef19da52012-11-28 19:35:08 +000014#include "libGLESv2/angletypes.h"
daniel@transgaming.come4733d72012-10-31 18:07:01 +000015
shannonwoods@chromium.orgf97a0842013-05-30 00:10:33 +000016#if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL)
17#define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL3
18#endif
19
daniel@transgaming.com621ce052012-10-31 17:52:29 +000020const int versionWindowsVista = MAKEWORD(0x00, 0x06);
21const int versionWindows7 = MAKEWORD(0x01, 0x06);
22
23// Return the version of the operating system in a format suitable for ordering
24// comparison.
25inline int getComparableOSVersion()
26{
27 DWORD version = GetVersion();
28 int majorVersion = LOBYTE(LOWORD(version));
29 int minorVersion = HIBYTE(LOWORD(version));
30 return MAKEWORD(minorVersion, majorVersion);
31}
32
daniel@transgaming.comef21ab22012-10-31 17:52:47 +000033namespace egl
34{
35class Display;
36}
37
daniel@transgaming.com83e80ee2012-11-28 19:40:53 +000038namespace gl
39{
daniel@transgaming.coma9c71422012-11-28 20:58:45 +000040class InfoLog;
daniel@transgaming.com83e80ee2012-11-28 19:40:53 +000041class ProgramBinary;
Geoff Lang48dcae72014-02-05 16:28:24 -050042struct LinkedVarying;
daniel@transgaming.com67094ee2012-11-28 20:53:04 +000043class VertexAttribute;
daniel@transgaming.com91207b72012-11-28 20:56:43 +000044class Buffer;
shannon.woods@transgaming.comd2811d62013-02-28 23:11:19 +000045class Texture;
46class Framebuffer;
Jamie Madilla857c362013-07-02 11:57:02 -040047struct VertexAttribCurrentValueData;
daniel@transgaming.com83e80ee2012-11-28 19:40:53 +000048}
49
daniel@transgaming.com31b13e12012-11-28 19:34:30 +000050namespace rx
daniel@transgaming.com1d80eee2012-11-28 19:33:31 +000051{
daniel@transgaming.com87705f82012-12-20 21:10:45 +000052class TextureStorageInterface2D;
53class TextureStorageInterfaceCube;
shannon.woods%transgaming.com@gtempaccount.com414e82a2013-04-13 03:44:05 +000054class TextureStorageInterface3D;
shannon.woods%transgaming.com@gtempaccount.com6c86bd52013-04-13 03:45:45 +000055class TextureStorageInterface2DArray;
daniel@transgaming.com3f255b42012-12-20 21:07:35 +000056class VertexBuffer;
daniel@transgaming.com0b6d7742012-12-20 21:09:47 +000057class IndexBuffer;
shannon.woods@transgaming.com50df6c52013-02-28 23:02:49 +000058class QueryImpl;
shannon.woods@transgaming.comcfe787e2013-02-28 23:03:35 +000059class FenceImpl;
shannon.woods@transgaming.com4e52b632013-02-28 23:08:01 +000060class BufferStorage;
daniel@transgaming.com31240482012-11-28 21:06:41 +000061struct TranslatedIndexData;
shannon.woods@transgaming.comd2811d62013-02-28 23:11:19 +000062class ShaderExecutable;
63class SwapChain;
64class RenderTarget;
65class Image;
66class TextureStorage;
Jamie Madill8ff21ae2014-02-04 16:04:05 -050067class UniformStorage;
daniel@transgaming.comde8a7ff2012-11-28 19:34:13 +000068
daniel@transgaming.com3281f972012-10-31 18:38:51 +000069struct ConfigDesc
70{
71 GLenum renderTargetFormat;
72 GLenum depthStencilFormat;
73 GLint multiSample;
74 bool fastConfig;
shannon.woods%transgaming.com@gtempaccount.comdcf33d52013-04-13 03:33:11 +000075 bool es3Capable;
daniel@transgaming.com3281f972012-10-31 18:38:51 +000076};
77
daniel@transgaming.coma390e1e2013-01-11 04:09:39 +000078struct dx_VertexConstants
79{
80 float depthRange[4];
shannon.woods@transgaming.com42832a62013-02-28 23:18:38 +000081 float viewAdjust[4];
daniel@transgaming.coma390e1e2013-01-11 04:09:39 +000082};
83
84struct dx_PixelConstants
85{
86 float depthRange[4];
shannon.woods@transgaming.coma14ecf32013-02-28 23:09:42 +000087 float viewCoords[4];
daniel@transgaming.coma390e1e2013-01-11 04:09:39 +000088 float depthFront[4];
89};
90
shannon.woods@transgaming.com69ff7762013-01-25 21:55:24 +000091enum ShaderType
92{
93 SHADER_VERTEX,
shannon.woods@transgaming.com3e773bb2013-01-25 21:55:47 +000094 SHADER_PIXEL,
95 SHADER_GEOMETRY
shannon.woods@transgaming.com69ff7762013-01-25 21:55:24 +000096};
97
daniel@transgaming.com621ce052012-10-31 17:52:29 +000098class Renderer
99{
100 public:
daniel@transgaming.com25e16af2012-11-28 21:05:57 +0000101 explicit Renderer(egl::Display *display);
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000102
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000103 virtual EGLint initialize() = 0;
104 virtual bool resetDevice() = 0;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000105
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000106 virtual int generateConfigs(ConfigDesc **configDescList) = 0;
107 virtual void deleteConfigs(ConfigDesc *configDescList) = 0;
daniel@transgaming.com3281f972012-10-31 18:38:51 +0000108
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000109 virtual void sync(bool block) = 0;
daniel@transgaming.comef21ab22012-10-31 17:52:47 +0000110
daniel@transgaming.comb9bb2792012-11-28 19:36:49 +0000111 virtual SwapChain *createSwapChain(HWND window, HANDLE shareHandle, GLenum backBufferFormat, GLenum depthBufferFormat) = 0;
112
Geoff Lange2e0ce02013-09-17 17:05:08 -0400113 virtual void generateSwizzle(gl::Texture *texture) = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000114 virtual void setSamplerState(gl::SamplerType type, int index, const gl::SamplerState &sampler) = 0;
115 virtual void setTexture(gl::SamplerType type, int index, gl::Texture *texture) = 0;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000116
shannonwoods@chromium.org1bddfb92013-05-30 00:11:29 +0000117 virtual bool setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], const gl::Buffer *fragmentUniformBuffers[]) = 0;
118
daniel@transgaming.com237bc7e2012-11-28 21:01:06 +0000119 virtual void setRasterizerState(const gl::RasterizerState &rasterState) = 0;
Geoff Langc142e9d2013-09-30 15:19:47 -0400120 virtual void setBlendState(gl::Framebuffer *framebuffer, const gl::BlendState &blendState, const gl::ColorF &blendColor,
daniel@transgaming.com493d4f82012-11-28 19:35:45 +0000121 unsigned int sampleMask) = 0;
daniel@transgaming.com08c331d2012-11-28 19:38:39 +0000122 virtual void setDepthStencilState(const gl::DepthStencilState &depthStencilState, int stencilRef,
daniel@transgaming.com3a0ef482012-11-28 21:01:20 +0000123 int stencilBackRef, bool frontFaceCCW) = 0;
daniel@transgaming.com493d4f82012-11-28 19:35:45 +0000124
daniel@transgaming.comd55e8c12012-11-28 21:07:02 +0000125 virtual void setScissorRectangle(const gl::Rectangle &scissor, bool enabled) = 0;
daniel@transgaming.com12985182012-12-20 20:56:31 +0000126 virtual bool setViewport(const gl::Rectangle &viewport, float zNear, float zFar, GLenum drawMode, GLenum frontFace,
shannon.woods@transgaming.com0b236e22013-01-25 21:57:07 +0000127 bool ignoreViewport) = 0;
daniel@transgaming.com493d4f82012-11-28 19:35:45 +0000128
daniel@transgaming.comae39ee22012-11-28 19:42:02 +0000129 virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer) = 0;
Geoff Lang4c5c6bb2014-02-05 16:32:46 -0500130 virtual void applyShaders(gl::ProgramBinary *programBinary, bool rasterizerDiscard, bool transformFeedbackActive, const gl::VertexFormat inputLayout[]) = 0;
Jamie Madill8ff21ae2014-02-04 16:04:05 -0500131 virtual void applyUniforms(const gl::ProgramBinary &programBinary) = 0;
daniel@transgaming.com91207b72012-11-28 20:56:43 +0000132 virtual bool applyPrimitiveType(GLenum primitiveType, GLsizei elementCount) = 0;
Jamie Madill57a89722013-07-02 11:57:03 -0400133 virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, const gl::VertexAttribute vertexAttributes[], gl::VertexAttribCurrentValueData currentValues[],
Jamie Madilla857c362013-07-02 11:57:02 -0400134 GLint first, GLsizei count, GLsizei instances) = 0;
daniel@transgaming.com31240482012-11-28 21:06:41 +0000135 virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo) = 0;
Geoff Langeeba6e12014-02-03 13:12:30 -0500136 virtual void applyTransformFeedbackBuffers(gl::Buffer *transformFeedbackBuffers[], GLintptr offsets[]) = 0;
daniel@transgaming.com493d4f82012-11-28 19:35:45 +0000137
Geoff Lang4c5c6bb2014-02-05 16:32:46 -0500138 virtual void drawArrays(GLenum mode, GLsizei count, GLsizei instances, bool transformFeedbackActive) = 0;
139 virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices,
140 gl::Buffer *elementArrayBuffer, const TranslatedIndexData &indexInfo, GLsizei instances) = 0;
daniel@transgaming.com67094ee2012-11-28 20:53:04 +0000141
daniel@transgaming.com084a2572012-11-28 20:55:17 +0000142 virtual void clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer) = 0;
daniel@transgaming.comd084c622012-11-28 19:36:05 +0000143
daniel@transgaming.comc43a6052012-11-28 19:41:51 +0000144 virtual void markAllStateDirty() = 0;
145
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000146 // lost device
shannon.woods@transgaming.comeb049e22013-02-28 23:04:49 +0000147 virtual void notifyDeviceLost() = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000148 virtual bool isDeviceLost() = 0;
149 virtual bool testDeviceLost(bool notify) = 0;
150 virtual bool testDeviceResettable() = 0;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000151
152 // Renderer capabilities
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000153 virtual DWORD getAdapterVendor() const = 0;
daniel@transgaming.comca1ac1f2013-01-11 04:13:05 +0000154 virtual std::string getRendererDescription() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000155 virtual GUID getAdapterIdentifier() const = 0;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000156
shannon.woods@transgaming.combec04bf2013-01-25 21:53:52 +0000157 virtual bool getBGRATextureSupport() const = 0;
shannonwoods@chromium.org89200d92013-05-30 00:07:50 +0000158 virtual bool getDXT1TextureSupport() const = 0;
159 virtual bool getDXT3TextureSupport() const = 0;
160 virtual bool getDXT5TextureSupport() const = 0;
161 virtual bool getEventQuerySupport() const = 0;
162 virtual bool getFloat32TextureSupport() const = 0;
163 virtual bool getFloat32TextureFilteringSupport() const= 0;
164 virtual bool getFloat32TextureRenderingSupport() const= 0;
165 virtual bool getFloat16TextureSupport() const= 0;
166 virtual bool getFloat16TextureFilteringSupport() const= 0;
167 virtual bool getFloat16TextureRenderingSupport() const = 0;
Geoff Langd42cf4e2013-06-05 16:09:17 -0400168 virtual bool getRGB565TextureSupport() const = 0;
shannonwoods@chromium.org89200d92013-05-30 00:07:50 +0000169 virtual bool getLuminanceTextureSupport() const = 0;
170 virtual bool getLuminanceAlphaTextureSupport() const = 0;
Geoff Lang632192d2013-10-04 13:40:46 -0400171 virtual bool getRGTextureSupport() const = 0;
shannon.woods@transgaming.com233fe952013-01-25 21:51:57 +0000172 bool getVertexTextureSupport() const { return getMaxVertexTextureImageUnits() > 0; }
173 virtual unsigned int getMaxVertexTextureImageUnits() const = 0;
shannon.woods@transgaming.com76cd88c2013-01-25 21:54:36 +0000174 virtual unsigned int getMaxCombinedTextureImageUnits() const = 0;
shannon.woods@transgaming.comd8136cb2013-02-28 23:14:44 +0000175 virtual unsigned int getReservedVertexUniformVectors() const = 0;
176 virtual unsigned int getReservedFragmentUniformVectors() const = 0;
177 virtual unsigned int getMaxVertexUniformVectors() const = 0;
178 virtual unsigned int getMaxFragmentUniformVectors() const = 0;
179 virtual unsigned int getMaxVaryingVectors() const = 0;
shannon.woods%transgaming.com@gtempaccount.com3f72ce32013-04-13 03:36:43 +0000180 virtual unsigned int getMaxVertexShaderUniformBuffers() const = 0;
181 virtual unsigned int getMaxFragmentShaderUniformBuffers() const = 0;
shannonwoods@chromium.org2b544222013-05-30 00:11:12 +0000182 virtual unsigned int getReservedVertexUniformBuffers() const = 0;
183 virtual unsigned int getReservedFragmentUniformBuffers() const = 0;
shannon.woods%transgaming.com@gtempaccount.com3f72ce32013-04-13 03:36:43 +0000184 virtual unsigned int getMaxTransformFeedbackBuffers() const = 0;
Geoff Lang1b6edcb2014-02-03 14:27:56 -0500185 virtual unsigned int getMaxTransformFeedbackSeparateComponents() const = 0;
186 virtual unsigned int getMaxTransformFeedbackInterleavedComponents() const = 0;
shannonwoods@chromium.org33e798f2013-05-30 00:05:05 +0000187 virtual unsigned int getMaxUniformBufferSize() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000188 virtual bool getNonPower2TextureSupport() const = 0;
189 virtual bool getDepthTextureSupport() const = 0;
190 virtual bool getOcclusionQuerySupport() const = 0;
191 virtual bool getInstancingSupport() const = 0;
192 virtual bool getTextureFilterAnisotropySupport() const = 0;
Shannon Woodsb3801742014-03-27 14:59:19 -0400193 virtual bool getPBOSupport() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000194 virtual float getTextureMaxAnisotropy() const = 0;
195 virtual bool getShareHandleSupport() const = 0;
daniel@transgaming.com7629bb62013-01-11 04:12:28 +0000196 virtual bool getDerivativeInstructionSupport() const = 0;
shannon.woods@transgaming.com8d2f0862013-02-28 23:09:19 +0000197 virtual bool getPostSubBufferSupport() const = 0;
Jamie Madill13a2f852013-12-11 16:35:08 -0500198 virtual int getMaxRecommendedElementsIndices() const = 0;
199 virtual int getMaxRecommendedElementsVertices() const = 0;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000200
daniel@transgaming.com9549bea2012-11-28 20:57:23 +0000201 virtual int getMajorShaderModel() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000202 virtual float getMaxPointSize() const = 0;
shannon.woods@transgaming.com8ce2f8f2013-02-28 23:07:10 +0000203 virtual int getMaxViewportDimension() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000204 virtual int getMaxTextureWidth() const = 0;
205 virtual int getMaxTextureHeight() const = 0;
shannon.woods%transgaming.com@gtempaccount.comc1fdf6b2013-04-13 03:44:41 +0000206 virtual int getMaxTextureDepth() const = 0;
shannon.woods%transgaming.com@gtempaccount.coma98a8112013-04-13 03:45:57 +0000207 virtual int getMaxTextureArrayLayers() const = 0;
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000208 virtual bool get32BitIndexSupport() const = 0;
209 virtual int getMinSwapInterval() const = 0;
210 virtual int getMaxSwapInterval() const = 0;
daniel@transgaming.com5f4c1362012-10-31 18:29:00 +0000211
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000212 virtual GLsizei getMaxSupportedSamples() const = 0;
Geoff Lang005df412013-10-16 14:12:50 -0400213 virtual GLsizei getMaxSupportedFormatSamples(GLenum internalFormat) const = 0;
214 virtual GLsizei getNumSampleCounts(GLenum internalFormat) const = 0;
215 virtual void getSampleCounts(GLenum internalFormat, GLsizei bufSize, GLint *params) const = 0;
daniel@transgaming.comb7833982012-10-31 18:31:46 +0000216
shannon.woods%transgaming.com@gtempaccount.comb290ac12013-04-13 03:28:15 +0000217 virtual unsigned int getMaxRenderTargets() const = 0;
218
daniel@transgaming.coma9c71422012-11-28 20:58:45 +0000219 // Pixel operations
daniel@transgaming.com87705f82012-12-20 21:10:45 +0000220 virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0;
221 virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0;
shannon.woods%transgaming.com@gtempaccount.com414e82a2013-04-13 03:44:05 +0000222 virtual bool copyToRenderTarget(TextureStorageInterface3D *dest, TextureStorageInterface3D *source) = 0;
shannon.woods%transgaming.com@gtempaccount.com6c86bd52013-04-13 03:45:45 +0000223 virtual bool copyToRenderTarget(TextureStorageInterface2DArray *dest, TextureStorageInterface2DArray *source) = 0;
daniel@transgaming.com1d80eee2012-11-28 19:33:31 +0000224
shannon.woods@transgaming.com664916b2013-01-25 21:50:32 +0000225 virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
daniel@transgaming.com87705f82012-12-20 21:10:45 +0000226 GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) = 0;
shannon.woods@transgaming.com664916b2013-01-25 21:50:32 +0000227 virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
daniel@transgaming.com87705f82012-12-20 21:10:45 +0000228 GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) = 0;
shannon.woods%transgaming.com@gtempaccount.com414e82a2013-04-13 03:44:05 +0000229 virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
230 GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface3D *storage, GLint level) = 0;
shannon.woods%transgaming.com@gtempaccount.com6c86bd52013-04-13 03:45:45 +0000231 virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
232 GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface2DArray *storage, GLint level) = 0;
daniel@transgaming.comde8a7ff2012-11-28 19:34:13 +0000233
shannon.woods@transgaming.comea4a0c62013-02-28 23:06:29 +0000234 virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect,
Geoff Lang125deab2013-08-09 13:34:16 -0400235 const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) = 0;
daniel@transgaming.com6c872172012-11-28 19:39:33 +0000236 virtual void readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type,
237 GLsizei outputPitch, bool packReverseRowOrder, GLint packAlignment, void* pixels) = 0;
238
daniel@transgaming.coma9c71422012-11-28 20:58:45 +0000239 // RenderTarget creation
daniel@transgaming.comf2423652012-11-28 20:53:50 +0000240 virtual RenderTarget *createRenderTarget(SwapChain *swapChain, bool depth) = 0;
Geoff Langa2d97f12013-06-11 11:44:02 -0400241 virtual RenderTarget *createRenderTarget(int width, int height, GLenum format, GLsizei samples) = 0;
daniel@transgaming.comf2423652012-11-28 20:53:50 +0000242
daniel@transgaming.coma9c71422012-11-28 20:58:45 +0000243 // Shader operations
Geoff Lang48dcae72014-02-05 16:28:24 -0500244 virtual ShaderExecutable *loadExecutable(const void *function, size_t length, rx::ShaderType type,
245 const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
246 bool separatedOutputBuffers) = 0;
247 virtual ShaderExecutable *compileToExecutable(gl::InfoLog &infoLog, const char *shaderHLSL, rx::ShaderType type,
248 const std::vector<gl::LinkedVarying> &transformFeedbackVaryings,
249 bool separatedOutputBuffers, D3DWorkaroundType workaround) = 0;
Jamie Madill8ff21ae2014-02-04 16:04:05 -0500250 virtual UniformStorage *createUniformStorage(size_t storageSize) = 0;
daniel@transgaming.coma9c71422012-11-28 20:58:45 +0000251
daniel@transgaming.comf721fdb2012-12-20 20:53:11 +0000252 // Image operations
daniel@transgaming.com244e1832012-12-20 20:52:35 +0000253 virtual Image *createImage() = 0;
daniel@transgaming.comf721fdb2012-12-20 20:53:11 +0000254 virtual void generateMipmap(Image *dest, Image *source) = 0;
daniel@transgaming.com413d2712012-12-20 21:11:04 +0000255 virtual TextureStorage *createTextureStorage2D(SwapChain *swapChain) = 0;
Jamie Madill4cfff5f2013-10-24 17:49:46 -0400256 virtual TextureStorage *createTextureStorage2D(int baseLevel, int maxLevel, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height) = 0;
257 virtual TextureStorage *createTextureStorageCube(int baseLevel, int maxLevel, GLenum internalformat, bool renderTarget, int size) = 0;
258 virtual TextureStorage *createTextureStorage3D(int baseLevel, int maxLevel, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, GLsizei depth) = 0;
259 virtual TextureStorage *createTextureStorage2DArray(int baseLevel, int maxLevel, GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, GLsizei depth) = 0;
daniel@transgaming.com244e1832012-12-20 20:52:35 +0000260
daniel@transgaming.com3f255b42012-12-20 21:07:35 +0000261 // Buffer creation
262 virtual VertexBuffer *createVertexBuffer() = 0;
daniel@transgaming.com0b6d7742012-12-20 21:09:47 +0000263 virtual IndexBuffer *createIndexBuffer() = 0;
shannon.woods@transgaming.com4e52b632013-02-28 23:08:01 +0000264 virtual BufferStorage *createBufferStorage() = 0;
daniel@transgaming.com3f255b42012-12-20 21:07:35 +0000265
shannon.woods@transgaming.comcfe787e2013-02-28 23:03:35 +0000266 // Query and Fence creation
shannon.woods@transgaming.com50df6c52013-02-28 23:02:49 +0000267 virtual QueryImpl *createQuery(GLenum type) = 0;
shannon.woods@transgaming.comcfe787e2013-02-28 23:03:35 +0000268 virtual FenceImpl *createFence() = 0;
shannon.woods@transgaming.com50df6c52013-02-28 23:02:49 +0000269
shannon.woods%transgaming.com@gtempaccount.com785f1962013-04-13 03:34:45 +0000270 // Current GLES client version
271 void setCurrentClientVersion(int clientVersion) { mCurrentClientVersion = clientVersion; }
272 int getCurrentClientVersion() const { return mCurrentClientVersion; }
273
Jamie Madilla21eea32013-09-18 14:36:25 -0400274 // Buffer-to-texture and Texture-to-buffer copies
Geoff Lang005df412013-10-16 14:12:50 -0400275 virtual bool supportsFastCopyBufferToTexture(GLenum internalFormat) const = 0;
Jamie Madilla21eea32013-09-18 14:36:25 -0400276 virtual bool fastCopyBufferToTexture(const gl::PixelUnpackState &unpack, unsigned int offset, RenderTarget *destRenderTarget,
277 GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea) = 0;
278
shannonwoods@chromium.org6e4f2a62013-05-30 00:15:19 +0000279 virtual bool getLUID(LUID *adapterLuid) const = 0;
Geoff Lang005df412013-10-16 14:12:50 -0400280 virtual GLenum getNativeTextureFormat(GLenum internalFormat) const = 0;
Jamie Madill95ffb862014-01-29 09:26:59 -0500281 virtual rx::VertexConversionType getVertexConversionType(const gl::VertexFormat &vertexFormat) const = 0;
282 virtual GLenum getVertexComponentType(const gl::VertexFormat &vertexFormat) const = 0;
shannonwoods@chromium.org6e4f2a62013-05-30 00:15:19 +0000283
daniel@transgaming.com2507f412012-10-31 18:46:48 +0000284 protected:
daniel@transgaming.comef21ab22012-10-31 17:52:47 +0000285 egl::Display *mDisplay;
daniel@transgaming.com4f0af572012-10-31 19:55:46 +0000286
287 private:
288 DISALLOW_COPY_AND_ASSIGN(Renderer);
289
shannon.woods%transgaming.com@gtempaccount.com785f1962013-04-13 03:34:45 +0000290 int mCurrentClientVersion;
daniel@transgaming.com621ce052012-10-31 17:52:29 +0000291};
292
293}
294#endif // LIBGLESV2_RENDERER_RENDERER_H_