diff options
Diffstat (limited to 'src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h')
-rw-r--r-- | src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h | 126 |
1 files changed, 56 insertions, 70 deletions
diff --git a/src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h b/src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h index f1e0fd2d99..b2249741ab 100644 --- a/src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h +++ b/src/3rdparty/angle/src/libGLESv2/renderer/Renderer.h @@ -13,9 +13,13 @@ #include "libGLESv2/Uniform.h" #include "libGLESv2/angletypes.h" #include "libGLESv2/Caps.h" +#include "libGLESv2/Error.h" + +#include <cstdint> + +#include <EGL/egl.h> #if !defined(ANGLE_COMPILE_OPTIMIZATION_LEVEL) -#include <d3dcompiler.h> // WARNING: D3DCOMPILE_OPTIMIZATION_LEVEL3 may lead to a DX9 shader compiler hang. // It should only be used selectively to work around specific bugs. #define ANGLE_COMPILE_OPTIMIZATION_LEVEL D3DCOMPILE_OPTIMIZATION_LEVEL1 @@ -40,10 +44,7 @@ struct VertexAttribCurrentValueData; namespace rx { -class TextureStorageInterface2D; -class TextureStorageInterfaceCube; -class TextureStorageInterface3D; -class TextureStorageInterface2DArray; +class TextureStorage; class VertexBuffer; class IndexBuffer; class QueryImpl; @@ -52,16 +53,16 @@ class BufferImpl; class VertexArrayImpl; class BufferStorage; struct TranslatedIndexData; +class ShaderImpl; +class ProgramImpl; class ShaderExecutable; class SwapChain; class RenderTarget; class Image; class TextureStorage; class UniformStorage; -class Texture2DImpl; -class TextureCubeImpl; -class Texture3DImpl; -class Texture2DArrayImpl; +class TextureImpl; +class TransformFeedbackImpl; struct ConfigDesc { @@ -108,37 +109,37 @@ class Renderer virtual SwapChain *createSwapChain(EGLNativeWindowType window, HANDLE shareHandle, GLenum backBufferFormat, GLenum depthBufferFormat) = 0; - virtual void generateSwizzle(gl::Texture *texture) = 0; - virtual void setSamplerState(gl::SamplerType type, int index, const gl::SamplerState &sampler) = 0; - virtual void setTexture(gl::SamplerType type, int index, gl::Texture *texture) = 0; + virtual gl::Error generateSwizzle(gl::Texture *texture) = 0; + virtual gl::Error setSamplerState(gl::SamplerType type, int index, const gl::SamplerState &sampler) = 0; + virtual gl::Error setTexture(gl::SamplerType type, int index, gl::Texture *texture) = 0; - virtual bool setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], const gl::Buffer *fragmentUniformBuffers[]) = 0; + virtual gl::Error setUniformBuffers(const gl::Buffer *vertexUniformBuffers[], const gl::Buffer *fragmentUniformBuffers[]) = 0; - virtual void setRasterizerState(const gl::RasterizerState &rasterState) = 0; - virtual void setBlendState(gl::Framebuffer *framebuffer, const gl::BlendState &blendState, const gl::ColorF &blendColor, - unsigned int sampleMask) = 0; - virtual void setDepthStencilState(const gl::DepthStencilState &depthStencilState, int stencilRef, - int stencilBackRef, bool frontFaceCCW) = 0; + virtual gl::Error setRasterizerState(const gl::RasterizerState &rasterState) = 0; + virtual gl::Error setBlendState(gl::Framebuffer *framebuffer, const gl::BlendState &blendState, const gl::ColorF &blendColor, + unsigned int sampleMask) = 0; + virtual gl::Error setDepthStencilState(const gl::DepthStencilState &depthStencilState, int stencilRef, + int stencilBackRef, bool frontFaceCCW) = 0; virtual void setScissorRectangle(const gl::Rectangle &scissor, bool enabled) = 0; - virtual bool setViewport(const gl::Rectangle &viewport, float zNear, float zFar, GLenum drawMode, GLenum frontFace, + virtual void setViewport(const gl::Rectangle &viewport, float zNear, float zFar, GLenum drawMode, GLenum frontFace, bool ignoreViewport) = 0; - virtual bool applyRenderTarget(gl::Framebuffer *frameBuffer) = 0; - virtual void applyShaders(gl::ProgramBinary *programBinary, const gl::VertexFormat inputLayout[], const gl::Framebuffer *framebuffer, - bool rasterizerDiscard, bool transformFeedbackActive) = 0; - virtual void applyUniforms(const gl::ProgramBinary &programBinary) = 0; + virtual gl::Error applyRenderTarget(gl::Framebuffer *frameBuffer) = 0; + virtual gl::Error applyShaders(gl::ProgramBinary *programBinary, const gl::VertexFormat inputLayout[], const gl::Framebuffer *framebuffer, + bool rasterizerDiscard, bool transformFeedbackActive) = 0; + virtual gl::Error applyUniforms(const gl::ProgramBinary &programBinary) = 0; virtual bool applyPrimitiveType(GLenum primitiveType, GLsizei elementCount) = 0; - virtual GLenum applyVertexBuffer(gl::ProgramBinary *programBinary, const gl::VertexAttribute vertexAttributes[], const gl::VertexAttribCurrentValueData currentValues[], - GLint first, GLsizei count, GLsizei instances) = 0; - virtual GLenum applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo) = 0; + virtual gl::Error applyVertexBuffer(gl::ProgramBinary *programBinary, const gl::VertexAttribute vertexAttributes[], const gl::VertexAttribCurrentValueData currentValues[], + GLint first, GLsizei count, GLsizei instances) = 0; + virtual gl::Error applyIndexBuffer(const GLvoid *indices, gl::Buffer *elementArrayBuffer, GLsizei count, GLenum mode, GLenum type, TranslatedIndexData *indexInfo) = 0; virtual void applyTransformFeedbackBuffers(gl::Buffer *transformFeedbackBuffers[], GLintptr offsets[]) = 0; - virtual void drawArrays(GLenum mode, GLsizei count, GLsizei instances, bool transformFeedbackActive) = 0; - virtual void drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, - gl::Buffer *elementArrayBuffer, const TranslatedIndexData &indexInfo, GLsizei instances) = 0; + virtual gl::Error drawArrays(GLenum mode, GLsizei count, GLsizei instances, bool transformFeedbackActive) = 0; + virtual gl::Error drawElements(GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, + gl::Buffer *elementArrayBuffer, const TranslatedIndexData &indexInfo, GLsizei instances) = 0; - virtual void clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer) = 0; + virtual gl::Error clear(const gl::ClearParameters &clearParams, gl::Framebuffer *frameBuffer) = 0; virtual void markAllStateDirty() = 0; @@ -157,62 +158,48 @@ class Renderer virtual std::string getRendererDescription() const = 0; virtual GUID getAdapterIdentifier() const = 0; - bool getVertexTextureSupport() const { return getMaxVertexTextureImageUnits() > 0; } - virtual unsigned int getMaxVertexTextureImageUnits() const = 0; - virtual unsigned int getMaxCombinedTextureImageUnits() const = 0; virtual unsigned int getReservedVertexUniformVectors() const = 0; virtual unsigned int getReservedFragmentUniformVectors() const = 0; - virtual unsigned int getMaxVertexUniformVectors() const = 0; - virtual unsigned int getMaxFragmentUniformVectors() const = 0; - virtual unsigned int getMaxVaryingVectors() const = 0; - virtual unsigned int getMaxVertexShaderUniformBuffers() const = 0; - virtual unsigned int getMaxFragmentShaderUniformBuffers() const = 0; virtual unsigned int getReservedVertexUniformBuffers() const = 0; virtual unsigned int getReservedFragmentUniformBuffers() const = 0; - virtual unsigned int getMaxTransformFeedbackBuffers() const = 0; - virtual unsigned int getMaxTransformFeedbackSeparateComponents() const = 0; - virtual unsigned int getMaxTransformFeedbackInterleavedComponents() const = 0; - virtual unsigned int getMaxUniformBufferSize() const = 0; virtual bool getShareHandleSupport() const = 0; virtual bool getPostSubBufferSupport() const = 0; - virtual int getMaxRecommendedElementsIndices() const = 0; - virtual int getMaxRecommendedElementsVertices() const = 0; - virtual bool getSRGBTextureSupport() const = 0; virtual int getMajorShaderModel() const = 0; virtual int getMinSwapInterval() const = 0; virtual int getMaxSwapInterval() const = 0; - virtual GLsizei getMaxSupportedSamples() const = 0; - virtual GLsizei getMaxSupportedFormatSamples(GLenum internalFormat) const = 0; - virtual GLsizei getNumSampleCounts(GLenum internalFormat) const = 0; - virtual void getSampleCounts(GLenum internalFormat, GLsizei bufSize, GLint *params) const = 0; - // Pixel operations - virtual bool copyToRenderTarget(TextureStorageInterface2D *dest, TextureStorageInterface2D *source) = 0; - virtual bool copyToRenderTarget(TextureStorageInterfaceCube *dest, TextureStorageInterfaceCube *source) = 0; - virtual bool copyToRenderTarget(TextureStorageInterface3D *dest, TextureStorageInterface3D *source) = 0; - virtual bool copyToRenderTarget(TextureStorageInterface2DArray *dest, TextureStorageInterface2DArray *source) = 0; - - virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, - GLint xoffset, GLint yoffset, TextureStorageInterface2D *storage, GLint level) = 0; - virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, - GLint xoffset, GLint yoffset, TextureStorageInterfaceCube *storage, GLenum target, GLint level) = 0; - virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, - GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface3D *storage, GLint level) = 0; - virtual bool copyImage(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, - GLint xoffset, GLint yoffset, GLint zOffset, TextureStorageInterface2DArray *storage, GLint level) = 0; + virtual bool copyToRenderTarget2D(TextureStorage *dest, TextureStorage *source) = 0; + virtual bool copyToRenderTargetCube(TextureStorage *dest, TextureStorage *source) = 0; + virtual bool copyToRenderTarget3D(TextureStorage *dest, TextureStorage *source) = 0; + virtual bool copyToRenderTarget2DArray(TextureStorage *dest, TextureStorage *source) = 0; + + virtual bool copyImage2D(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, + GLint xoffset, GLint yoffset, TextureStorage *storage, GLint level) = 0; + virtual bool copyImageCube(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, + GLint xoffset, GLint yoffset, TextureStorage *storage, GLenum target, GLint level) = 0; + virtual bool copyImage3D(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, + GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level) = 0; + virtual bool copyImage2DArray(gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, + GLint xoffset, GLint yoffset, GLint zOffset, TextureStorage *storage, GLint level) = 0; virtual bool blitRect(gl::Framebuffer *readTarget, const gl::Rectangle &readRect, gl::Framebuffer *drawTarget, const gl::Rectangle &drawRect, const gl::Rectangle *scissor, bool blitRenderTarget, bool blitDepth, bool blitStencil, GLenum filter) = 0; - virtual void readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, - GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, void* pixels) = 0; + + virtual gl::Error readPixels(gl::Framebuffer *framebuffer, GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, + GLenum type, GLuint outputPitch, const gl::PixelPackState &pack, uint8_t *pixels) = 0; // RenderTarget creation virtual RenderTarget *createRenderTarget(SwapChain *swapChain, bool depth) = 0; virtual RenderTarget *createRenderTarget(int width, int height, GLenum format, GLsizei samples) = 0; + // Shader creation + virtual ShaderImpl *createShader(GLenum type) = 0; + virtual ProgramImpl *createProgram() = 0; + // Shader operations + virtual void releaseShaderCompiler() = 0; virtual ShaderExecutable *loadExecutable(const void *function, size_t length, rx::ShaderType type, const std::vector<gl::LinkedVarying> &transformFeedbackVaryings, bool separatedOutputBuffers) = 0; @@ -231,10 +218,7 @@ class Renderer virtual TextureStorage *createTextureStorage2DArray(GLenum internalformat, bool renderTarget, GLsizei width, GLsizei height, GLsizei depth, int levels) = 0; // Texture creation - virtual Texture2DImpl *createTexture2D() = 0; - virtual TextureCubeImpl *createTextureCube() = 0; - virtual Texture3DImpl *createTexture3D() = 0; - virtual Texture2DArrayImpl *createTexture2DArray() = 0; + virtual TextureImpl *createTexture(GLenum target) = 0; // Buffer creation virtual BufferImpl *createBuffer() = 0; @@ -248,6 +232,9 @@ class Renderer virtual QueryImpl *createQuery(GLenum type) = 0; virtual FenceImpl *createFence() = 0; + // Transform Feedback creation + virtual TransformFeedbackImpl* createTransformFeedback() = 0; + // Current GLES client version void setCurrentClientVersion(int clientVersion) { mCurrentClientVersion = clientVersion; } int getCurrentClientVersion() const { return mCurrentClientVersion; } @@ -258,7 +245,6 @@ class Renderer GLenum destinationFormat, GLenum sourcePixelsType, const gl::Box &destArea) = 0; virtual bool getLUID(LUID *adapterLuid) const = 0; - virtual GLenum getNativeTextureFormat(GLenum internalFormat) const = 0; virtual rx::VertexConversionType getVertexConversionType(const gl::VertexFormat &vertexFormat) const = 0; virtual GLenum getVertexComponentType(const gl::VertexFormat &vertexFormat) const = 0; |