diff options
Diffstat (limited to 'gfx/angle/src/libANGLE/renderer/vulkan')
38 files changed, 2611 insertions, 0 deletions
diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp new file mode 100755 index 000000000..0b1babd5a --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.cpp @@ -0,0 +1,74 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// BufferVk.cpp: +// Implements the class methods for BufferVk. +// + +#include "libANGLE/renderer/vulkan/BufferVk.h" + +#include "common/debug.h" + +namespace rx +{ + +BufferVk::BufferVk(const gl::BufferState &state) : BufferImpl(state) +{ +} + +BufferVk::~BufferVk() +{ +} + +gl::Error BufferVk::setData(GLenum target, const void *data, size_t size, GLenum usage) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::setSubData(GLenum target, const void *data, size_t size, size_t offset) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::copySubData(BufferImpl *source, + GLintptr sourceOffset, + GLintptr destOffset, + GLsizeiptr size) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::map(GLenum access, GLvoid **mapPtr) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::mapRange(size_t offset, size_t length, GLbitfield access, GLvoid **mapPtr) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::unmap(GLboolean *result) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error BufferVk::getIndexRange(GLenum type, + size_t offset, + size_t count, + bool primitiveRestartEnabled, + gl::IndexRange *outRange) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.h new file mode 100755 index 000000000..27792962f --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/BufferVk.h @@ -0,0 +1,43 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// BufferVk.h: +// Defines the class interface for BufferVk, implementing BufferImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_BUFFERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_BUFFERVK_H_ + +#include "libANGLE/renderer/BufferImpl.h" + +namespace rx +{ + +class BufferVk : public BufferImpl +{ + public: + BufferVk(const gl::BufferState &state); + ~BufferVk() override; + + gl::Error setData(GLenum target, const void *data, size_t size, GLenum usage) override; + gl::Error setSubData(GLenum target, const void *data, size_t size, size_t offset) override; + gl::Error copySubData(BufferImpl *source, + GLintptr sourceOffset, + GLintptr destOffset, + GLsizeiptr size) override; + gl::Error map(GLenum access, GLvoid **mapPtr) override; + gl::Error mapRange(size_t offset, size_t length, GLbitfield access, GLvoid **mapPtr) override; + gl::Error unmap(GLboolean *result) override; + + gl::Error getIndexRange(GLenum type, + size_t offset, + size_t count, + bool primitiveRestartEnabled, + gl::IndexRange *outRange) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_BUFFERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.cpp new file mode 100755 index 000000000..d3f31eb0b --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.cpp @@ -0,0 +1,37 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// CompilerVk.cpp: +// Implements the class methods for CompilerVk. +// + +#include "libANGLE/renderer/vulkan/CompilerVk.h" + +#include "common/debug.h" + +namespace rx +{ + +CompilerVk::CompilerVk() : CompilerImpl() +{ +} + +CompilerVk::~CompilerVk() +{ +} + +gl::Error CompilerVk::release() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +ShShaderOutput CompilerVk::getTranslatorOutputType() const +{ + UNIMPLEMENTED(); + return ShShaderOutput(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.h new file mode 100755 index 000000000..2246a2711 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/CompilerVk.h @@ -0,0 +1,32 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// CompilerVk.h: +// Defines the class interface for CompilerVk, implementing CompilerImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_COMPILERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_COMPILERVK_H_ + +#include "libANGLE/renderer/CompilerImpl.h" + +namespace rx +{ + +class CompilerVk : public CompilerImpl +{ + public: + CompilerVk(); + ~CompilerVk() override; + + gl::Error release() override; + + // TODO(jmadill): Expose translator built-in resources init method. + ShShaderOutput getTranslatorOutputType() const override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_COMPILERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp new file mode 100755 index 000000000..d0660bfdc --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.cpp @@ -0,0 +1,254 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ContextVk.cpp: +// Implements the class methods for ContextVk. +// + +#include "libANGLE/renderer/vulkan/ContextVk.h" + +#include "common/debug.h" +#include "libANGLE/renderer/vulkan/BufferVk.h" +#include "libANGLE/renderer/vulkan/CompilerVk.h" +#include "libANGLE/renderer/vulkan/ContextVk.h" +#include "libANGLE/renderer/vulkan/DeviceVk.h" +#include "libANGLE/renderer/vulkan/FenceNVVk.h" +#include "libANGLE/renderer/vulkan/FenceSyncVk.h" +#include "libANGLE/renderer/vulkan/FramebufferVk.h" +#include "libANGLE/renderer/vulkan/ImageVk.h" +#include "libANGLE/renderer/vulkan/ProgramVk.h" +#include "libANGLE/renderer/vulkan/QueryVk.h" +#include "libANGLE/renderer/vulkan/RenderbufferVk.h" +#include "libANGLE/renderer/vulkan/RendererVk.h" +#include "libANGLE/renderer/vulkan/SamplerVk.h" +#include "libANGLE/renderer/vulkan/ShaderVk.h" +#include "libANGLE/renderer/vulkan/TextureVk.h" +#include "libANGLE/renderer/vulkan/TransformFeedbackVk.h" +#include "libANGLE/renderer/vulkan/VertexArrayVk.h" + +namespace rx +{ + +ContextVk::ContextVk(const gl::ContextState &state, RendererVk *renderer) + : ContextImpl(state), mRenderer(renderer) +{ +} + +ContextVk::~ContextVk() +{ +} + +gl::Error ContextVk::initialize() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::flush() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::finish() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::drawArrays(GLenum mode, GLint first, GLsizei count) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::drawArraysInstanced(GLenum mode, + GLint first, + GLsizei count, + GLsizei instanceCount) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::drawElements(GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + const gl::IndexRange &indexRange) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::drawElementsInstanced(GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLsizei instances, + const gl::IndexRange &indexRange) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ContextVk::drawRangeElements(GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices, + const gl::IndexRange &indexRange) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +GLenum ContextVk::getResetStatus() +{ + UNIMPLEMENTED(); + return GL_NO_ERROR; +} + +std::string ContextVk::getVendorString() const +{ + UNIMPLEMENTED(); + return std::string(); +} + +std::string ContextVk::getRendererDescription() const +{ + UNIMPLEMENTED(); + return std::string(); +} + +void ContextVk::insertEventMarker(GLsizei length, const char *marker) +{ + UNIMPLEMENTED(); +} + +void ContextVk::pushGroupMarker(GLsizei length, const char *marker) +{ + UNIMPLEMENTED(); +} + +void ContextVk::popGroupMarker() +{ + UNIMPLEMENTED(); +} + +void ContextVk::syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits) +{ + UNIMPLEMENTED(); +} + +GLint ContextVk::getGPUDisjoint() +{ + UNIMPLEMENTED(); + return GLint(); +} + +GLint64 ContextVk::getTimestamp() +{ + UNIMPLEMENTED(); + return GLint64(); +} + +void ContextVk::onMakeCurrent(const gl::ContextState &data) +{ + UNIMPLEMENTED(); +} + +const gl::Caps &ContextVk::getNativeCaps() const +{ + return mRenderer->getNativeCaps(); +} + +const gl::TextureCapsMap &ContextVk::getNativeTextureCaps() const +{ + return mRenderer->getNativeTextureCaps(); +} + +const gl::Extensions &ContextVk::getNativeExtensions() const +{ + return mRenderer->getNativeExtensions(); +} + +const gl::Limitations &ContextVk::getNativeLimitations() const +{ + return mRenderer->getNativeLimitations(); +} + +CompilerImpl *ContextVk::createCompiler() +{ + return new CompilerVk(); +} + +ShaderImpl *ContextVk::createShader(const gl::ShaderState &state) +{ + return new ShaderVk(state); +} + +ProgramImpl *ContextVk::createProgram(const gl::ProgramState &state) +{ + return new ProgramVk(state); +} + +FramebufferImpl *ContextVk::createFramebuffer(const gl::FramebufferState &state) +{ + return new FramebufferVk(state); +} + +TextureImpl *ContextVk::createTexture(const gl::TextureState &state) +{ + return new TextureVk(state); +} + +RenderbufferImpl *ContextVk::createRenderbuffer() +{ + return new RenderbufferVk(); +} + +BufferImpl *ContextVk::createBuffer(const gl::BufferState &state) +{ + return new BufferVk(state); +} + +VertexArrayImpl *ContextVk::createVertexArray(const gl::VertexArrayState &state) +{ + return new VertexArrayVk(state); +} + +QueryImpl *ContextVk::createQuery(GLenum type) +{ + return new QueryVk(type); +} + +FenceNVImpl *ContextVk::createFenceNV() +{ + return new FenceNVVk(); +} + +FenceSyncImpl *ContextVk::createFenceSync() +{ + return new FenceSyncVk(); +} + +TransformFeedbackImpl *ContextVk::createTransformFeedback(const gl::TransformFeedbackState &state) +{ + return new TransformFeedbackVk(state); +} + +SamplerImpl *ContextVk::createSampler() +{ + return new SamplerVk(); +} + +std::vector<PathImpl *> ContextVk::createPaths(GLsizei) +{ + return std::vector<PathImpl *>(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.h new file mode 100755 index 000000000..64e85c984 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ContextVk.h @@ -0,0 +1,126 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ContextVk.h: +// Defines the class interface for ContextVk, implementing ContextImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_CONTEXTVK_H_ +#define LIBANGLE_RENDERER_VULKAN_CONTEXTVK_H_ + +#include "libANGLE/renderer/ContextImpl.h" + +namespace rx +{ +class RendererVk; + +class ContextVk : public ContextImpl +{ + public: + ContextVk(const gl::ContextState &state, RendererVk *renderer); + ~ContextVk() override; + + gl::Error initialize() override; + + // Flush and finish. + gl::Error flush() override; + gl::Error finish() override; + + // Drawing methods. + gl::Error drawArrays(GLenum mode, GLint first, GLsizei count) override; + gl::Error drawArraysInstanced(GLenum mode, + GLint first, + GLsizei count, + GLsizei instanceCount) override; + + gl::Error drawElements(GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + const gl::IndexRange &indexRange) override; + gl::Error drawElementsInstanced(GLenum mode, + GLsizei count, + GLenum type, + const GLvoid *indices, + GLsizei instances, + const gl::IndexRange &indexRange) override; + gl::Error drawRangeElements(GLenum mode, + GLuint start, + GLuint end, + GLsizei count, + GLenum type, + const GLvoid *indices, + const gl::IndexRange &indexRange) override; + + // Device loss + GLenum getResetStatus() override; + + // Vendor and description strings. + std::string getVendorString() const override; + std::string getRendererDescription() const override; + + // Debug markers. + void insertEventMarker(GLsizei length, const char *marker) override; + void pushGroupMarker(GLsizei length, const char *marker) override; + void popGroupMarker() override; + + // State sync with dirty bits. + void syncState(const gl::State &state, const gl::State::DirtyBits &dirtyBits) override; + + // Disjoint timer queries + GLint getGPUDisjoint() override; + GLint64 getTimestamp() override; + + // Context switching + void onMakeCurrent(const gl::ContextState &data) override; + + // Native capabilities, unmodified by gl::Context. + const gl::Caps &getNativeCaps() const override; + const gl::TextureCapsMap &getNativeTextureCaps() const override; + const gl::Extensions &getNativeExtensions() const override; + const gl::Limitations &getNativeLimitations() const override; + + // Shader creation + CompilerImpl *createCompiler() override; + ShaderImpl *createShader(const gl::ShaderState &state) override; + ProgramImpl *createProgram(const gl::ProgramState &state) override; + + // Framebuffer creation + FramebufferImpl *createFramebuffer(const gl::FramebufferState &state) override; + + // Texture creation + TextureImpl *createTexture(const gl::TextureState &state) override; + + // Renderbuffer creation + RenderbufferImpl *createRenderbuffer() override; + + // Buffer creation + BufferImpl *createBuffer(const gl::BufferState &state) override; + + // Vertex Array creation + VertexArrayImpl *createVertexArray(const gl::VertexArrayState &state) override; + + // Query and Fence creation + QueryImpl *createQuery(GLenum type) override; + FenceNVImpl *createFenceNV() override; + FenceSyncImpl *createFenceSync() override; + + // Transform Feedback creation + TransformFeedbackImpl *createTransformFeedback( + const gl::TransformFeedbackState &state) override; + + // Sampler object creation + SamplerImpl *createSampler() override; + + // Path object creation + std::vector<PathImpl *> createPaths(GLsizei) override; + + private: + RendererVk *mRenderer; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_CONTEXTVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.cpp new file mode 100755 index 000000000..f4f60b90b --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.cpp @@ -0,0 +1,48 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// DeviceVk.cpp: +// Implements the class methods for DeviceVk. +// + +#include "libANGLE/renderer/vulkan/DeviceVk.h" + +#include "common/debug.h" + +namespace rx +{ + +DeviceVk::DeviceVk() : DeviceImpl() +{ +} + +DeviceVk::~DeviceVk() +{ +} + +egl::Error DeviceVk::getDevice(void **outValue) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +EGLint DeviceVk::getType() +{ + UNIMPLEMENTED(); + return EGLint(); +} + +void DeviceVk::generateExtensions(egl::DeviceExtensions *outExtensions) const +{ + UNIMPLEMENTED(); +} + +bool DeviceVk::deviceExternallySourced() +{ + UNIMPLEMENTED(); + return bool(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.h new file mode 100755 index 000000000..4613c1751 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/DeviceVk.h @@ -0,0 +1,32 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// DeviceVk.h: +// Defines the class interface for DeviceVk, implementing DeviceImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_DEVICEVK_H_ +#define LIBANGLE_RENDERER_VULKAN_DEVICEVK_H_ + +#include "libANGLE/renderer/DeviceImpl.h" + +namespace rx +{ + +class DeviceVk : public DeviceImpl +{ + public: + DeviceVk(); + ~DeviceVk() override; + + egl::Error getDevice(void **outValue) override; + EGLint getType() override; + void generateExtensions(egl::DeviceExtensions *outExtensions) const override; + bool deviceExternallySourced() override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_DEVICEVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.cpp new file mode 100755 index 000000000..2c652ce3c --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.cpp @@ -0,0 +1,168 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// DisplayVk.cpp: +// Implements the class methods for DisplayVk. +// + +#include "libANGLE/renderer/vulkan/DisplayVk.h" + +#include "common/debug.h" +#include "libANGLE/renderer/vulkan/ContextVk.h" + +namespace rx +{ + +DisplayVk::DisplayVk() : DisplayImpl(), mRenderer(nullptr) +{ +} + +DisplayVk::~DisplayVk() +{ +} + +egl::Error DisplayVk::initialize(egl::Display *display) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +void DisplayVk::terminate() +{ + UNIMPLEMENTED(); +} + +egl::Error DisplayVk::makeCurrent(egl::Surface *drawSurface, + egl::Surface *readSurface, + gl::Context *context) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::ConfigSet DisplayVk::generateConfigs() +{ + UNIMPLEMENTED(); + return egl::ConfigSet(); +} + +bool DisplayVk::testDeviceLost() +{ + UNIMPLEMENTED(); + return bool(); +} + +egl::Error DisplayVk::restoreLostDevice() +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +bool DisplayVk::isValidNativeWindow(EGLNativeWindowType window) const +{ + UNIMPLEMENTED(); + return bool(); +} + +std::string DisplayVk::getVendorString() const +{ + UNIMPLEMENTED(); + return std::string(); +} + +egl::Error DisplayVk::getDevice(DeviceImpl **device) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error DisplayVk::waitClient() const +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error DisplayVk::waitNative(EGLint engine, + egl::Surface *drawSurface, + egl::Surface *readSurface) const +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +SurfaceImpl *DisplayVk::createWindowSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + EGLNativeWindowType window, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<SurfaceImpl *>(0); +} + +SurfaceImpl *DisplayVk::createPbufferSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<SurfaceImpl *>(0); +} + +SurfaceImpl *DisplayVk::createPbufferFromClientBuffer(const egl::SurfaceState &state, + const egl::Config *configuration, + EGLenum buftype, + EGLClientBuffer clientBuffer, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<SurfaceImpl *>(0); +} + +SurfaceImpl *DisplayVk::createPixmapSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + NativePixmapType nativePixmap, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<SurfaceImpl *>(0); +} + +ImageImpl *DisplayVk::createImage(EGLenum target, + egl::ImageSibling *buffer, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<ImageImpl *>(0); +} + +ContextImpl *DisplayVk::createContext(const gl::ContextState &state) +{ + return new ContextVk(state, mRenderer); +} + +StreamProducerImpl *DisplayVk::createStreamProducerD3DTextureNV12( + egl::Stream::ConsumerType consumerType, + const egl::AttributeMap &attribs) +{ + UNIMPLEMENTED(); + return static_cast<StreamProducerImpl *>(0); +} + +gl::Version DisplayVk::getMaxSupportedESVersion() const +{ + UNIMPLEMENTED(); + return gl::Version(0, 0); +} + +void DisplayVk::generateExtensions(egl::DisplayExtensions *outExtensions) const +{ + UNIMPLEMENTED(); +} + +void DisplayVk::generateCaps(egl::Caps *outCaps) const +{ + UNIMPLEMENTED(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.h new file mode 100755 index 000000000..26eab5139 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/DisplayVk.h @@ -0,0 +1,85 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// DisplayVk.h: +// Defines the class interface for DisplayVk, implementing DisplayImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_DISPLAYVK_H_ +#define LIBANGLE_RENDERER_VULKAN_DISPLAYVK_H_ + +#include "libANGLE/renderer/DisplayImpl.h" + +namespace rx +{ +class RendererVk; + +class DisplayVk : public DisplayImpl +{ + public: + DisplayVk(); + ~DisplayVk() override; + + egl::Error initialize(egl::Display *display) override; + void terminate() override; + + egl::Error makeCurrent(egl::Surface *drawSurface, + egl::Surface *readSurface, + gl::Context *context) override; + + egl::ConfigSet generateConfigs() override; + + bool testDeviceLost() override; + egl::Error restoreLostDevice() override; + + bool isValidNativeWindow(EGLNativeWindowType window) const override; + + std::string getVendorString() const override; + + egl::Error getDevice(DeviceImpl **device) override; + + egl::Error waitClient() const override; + egl::Error waitNative(EGLint engine, + egl::Surface *drawSurface, + egl::Surface *readSurface) const override; + + SurfaceImpl *createWindowSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + EGLNativeWindowType window, + const egl::AttributeMap &attribs) override; + SurfaceImpl *createPbufferSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + const egl::AttributeMap &attribs) override; + SurfaceImpl *createPbufferFromClientBuffer(const egl::SurfaceState &state, + const egl::Config *configuration, + EGLenum buftype, + EGLClientBuffer clientBuffer, + const egl::AttributeMap &attribs) override; + SurfaceImpl *createPixmapSurface(const egl::SurfaceState &state, + const egl::Config *configuration, + NativePixmapType nativePixmap, + const egl::AttributeMap &attribs) override; + + ImageImpl *createImage(EGLenum target, + egl::ImageSibling *buffer, + const egl::AttributeMap &attribs) override; + + ContextImpl *createContext(const gl::ContextState &state) override; + + StreamProducerImpl *createStreamProducerD3DTextureNV12( + egl::Stream::ConsumerType consumerType, + const egl::AttributeMap &attribs) override; + gl::Version getMaxSupportedESVersion() const override; + + private: + void generateExtensions(egl::DisplayExtensions *outExtensions) const override; + void generateCaps(egl::Caps *outCaps) const override; + + RendererVk *mRenderer; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_DISPLAYVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.cpp new file mode 100755 index 000000000..c46bd0121 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.cpp @@ -0,0 +1,43 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FenceNVVk.cpp: +// Implements the class methods for FenceNVVk. +// + +#include "libANGLE/renderer/vulkan/FenceNVVk.h" + +#include "common/debug.h" + +namespace rx +{ + +FenceNVVk::FenceNVVk() : FenceNVImpl() +{ +} + +FenceNVVk::~FenceNVVk() +{ +} + +gl::Error FenceNVVk::set(GLenum condition) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FenceNVVk::test(GLboolean *outFinished) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FenceNVVk::finish() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.h new file mode 100755 index 000000000..be054715c --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FenceNVVk.h @@ -0,0 +1,31 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FenceNVVk.h: +// Defines the class interface for FenceNVVk, implementing FenceNVImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_FENCENVVK_H_ +#define LIBANGLE_RENDERER_VULKAN_FENCENVVK_H_ + +#include "libANGLE/renderer/FenceNVImpl.h" + +namespace rx +{ + +class FenceNVVk : public FenceNVImpl +{ + public: + FenceNVVk(); + ~FenceNVVk() override; + + gl::Error set(GLenum condition) override; + gl::Error test(GLboolean *outFinished) override; + gl::Error finish() override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_FENCENVVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp new file mode 100755 index 000000000..d27f13088 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.cpp @@ -0,0 +1,49 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FenceSyncVk.cpp: +// Implements the class methods for FenceSyncVk. +// + +#include "libANGLE/renderer/vulkan/FenceSyncVk.h" + +#include "common/debug.h" + +namespace rx +{ + +FenceSyncVk::FenceSyncVk() : FenceSyncImpl() +{ +} + +FenceSyncVk::~FenceSyncVk() +{ +} + +gl::Error FenceSyncVk::set(GLenum condition, GLbitfield flags) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FenceSyncVk::clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FenceSyncVk::serverWait(GLbitfield flags, GLuint64 timeout) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FenceSyncVk::getStatus(GLint *outResult) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h new file mode 100755 index 000000000..ab9a10720 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FenceSyncVk.h @@ -0,0 +1,32 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FenceSyncVk.h: +// Defines the class interface for FenceSyncVk, implementing FenceSyncImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_FENCESYNCVK_H_ +#define LIBANGLE_RENDERER_VULKAN_FENCESYNCVK_H_ + +#include "libANGLE/renderer/FenceSyncImpl.h" + +namespace rx +{ + +class FenceSyncVk : public FenceSyncImpl +{ + public: + FenceSyncVk(); + ~FenceSyncVk() override; + + gl::Error set(GLenum condition, GLbitfield flags) override; + gl::Error clientWait(GLbitfield flags, GLuint64 timeout, GLenum *outResult) override; + gl::Error serverWait(GLbitfield flags, GLuint64 timeout) override; + gl::Error getStatus(GLint *outResult) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_FENCESYNCVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp new file mode 100755 index 000000000..e351dea93 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.cpp @@ -0,0 +1,131 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FramebufferVk.cpp: +// Implements the class methods for FramebufferVk. +// + +#include "libANGLE/renderer/vulkan/FramebufferVk.h" + +#include "common/debug.h" + +namespace rx +{ + +FramebufferVk::FramebufferVk(const gl::FramebufferState &state) : FramebufferImpl(state) +{ +} + +FramebufferVk::~FramebufferVk() +{ +} + +gl::Error FramebufferVk::discard(size_t count, const GLenum *attachments) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::invalidate(size_t count, const GLenum *attachments) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::invalidateSub(size_t count, + const GLenum *attachments, + const gl::Rectangle &area) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::clear(ContextImpl *context, GLbitfield mask) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::clearBufferfv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLfloat *values) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::clearBufferuiv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLuint *values) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::clearBufferiv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLint *values) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::clearBufferfi(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + GLfloat depth, + GLint stencil) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +GLenum FramebufferVk::getImplementationColorReadFormat() const +{ + UNIMPLEMENTED(); + return GLenum(); +} + +GLenum FramebufferVk::getImplementationColorReadType() const +{ + UNIMPLEMENTED(); + return GLenum(); +} + +gl::Error FramebufferVk::readPixels(ContextImpl *context, + const gl::Rectangle &area, + GLenum format, + GLenum type, + GLvoid *pixels) const +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error FramebufferVk::blit(ContextImpl *context, + const gl::Rectangle &sourceArea, + const gl::Rectangle &destArea, + GLbitfield mask, + GLenum filter) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +bool FramebufferVk::checkStatus() const +{ + UNIMPLEMENTED(); + return bool(); +} + +void FramebufferVk::syncState(const gl::Framebuffer::DirtyBits &dirtyBits) +{ + UNIMPLEMENTED(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h new file mode 100755 index 000000000..9eb4abf92 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/FramebufferVk.h @@ -0,0 +1,70 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// FramebufferVk.h: +// Defines the class interface for FramebufferVk, implementing FramebufferImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_FRAMEBUFFERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_FRAMEBUFFERVK_H_ + +#include "libANGLE/renderer/FramebufferImpl.h" + +namespace rx +{ + +class FramebufferVk : public FramebufferImpl +{ + public: + FramebufferVk(const gl::FramebufferState &state); + ~FramebufferVk() override; + + gl::Error discard(size_t count, const GLenum *attachments) override; + gl::Error invalidate(size_t count, const GLenum *attachments) override; + gl::Error invalidateSub(size_t count, + const GLenum *attachments, + const gl::Rectangle &area) override; + + gl::Error clear(ContextImpl *context, GLbitfield mask) override; + gl::Error clearBufferfv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLfloat *values) override; + gl::Error clearBufferuiv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLuint *values) override; + gl::Error clearBufferiv(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + const GLint *values) override; + gl::Error clearBufferfi(ContextImpl *context, + GLenum buffer, + GLint drawbuffer, + GLfloat depth, + GLint stencil) override; + + GLenum getImplementationColorReadFormat() const override; + GLenum getImplementationColorReadType() const override; + gl::Error readPixels(ContextImpl *context, + const gl::Rectangle &area, + GLenum format, + GLenum type, + GLvoid *pixels) const override; + + gl::Error blit(ContextImpl *context, + const gl::Rectangle &sourceArea, + const gl::Rectangle &destArea, + GLbitfield mask, + GLenum filter) override; + + bool checkStatus() const override; + + void syncState(const gl::Framebuffer::DirtyBits &dirtyBits) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_FRAMEBUFFERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.cpp new file mode 100755 index 000000000..0956a5efc --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.cpp @@ -0,0 +1,37 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ImageVk.cpp: +// Implements the class methods for ImageVk. +// + +#include "libANGLE/renderer/vulkan/ImageVk.h" + +#include "common/debug.h" + +namespace rx +{ + +ImageVk::ImageVk() : ImageImpl() +{ +} + +ImageVk::~ImageVk() +{ +} + +egl::Error ImageVk::initialize() +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +gl::Error ImageVk::orphan(egl::ImageSibling *sibling) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.h new file mode 100755 index 000000000..bc25e6122 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ImageVk.h @@ -0,0 +1,30 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ImageVk.h: +// Defines the class interface for ImageVk, implementing ImageImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_ +#define LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_ + +#include "libANGLE/renderer/ImageImpl.h" + +namespace rx +{ + +class ImageVk : public ImageImpl +{ + public: + ImageVk(); + ~ImageVk() override; + egl::Error initialize() override; + + gl::Error orphan(egl::ImageSibling *sibling) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_IMAGEVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp new file mode 100755 index 000000000..a83f826e7 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.cpp @@ -0,0 +1,212 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ProgramVk.cpp: +// Implements the class methods for ProgramVk. +// + +#include "libANGLE/renderer/vulkan/ProgramVk.h" + +#include "common/debug.h" + +namespace rx +{ + +ProgramVk::ProgramVk(const gl::ProgramState &state) : ProgramImpl(state) +{ +} + +ProgramVk::~ProgramVk() +{ +} + +LinkResult ProgramVk::load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error ProgramVk::save(gl::BinaryOutputStream *stream) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +void ProgramVk::setBinaryRetrievableHint(bool retrievable) +{ + UNIMPLEMENTED(); +} + +LinkResult ProgramVk::link(const gl::ContextState &data, gl::InfoLog &infoLog) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +GLboolean ProgramVk::validate(const gl::Caps &caps, gl::InfoLog *infoLog) +{ + UNIMPLEMENTED(); + return GLboolean(); +} + +void ProgramVk::setUniform1fv(GLint location, GLsizei count, const GLfloat *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform2fv(GLint location, GLsizei count, const GLfloat *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform3fv(GLint location, GLsizei count, const GLfloat *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform4fv(GLint location, GLsizei count, const GLfloat *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform1iv(GLint location, GLsizei count, const GLint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform2iv(GLint location, GLsizei count, const GLint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform3iv(GLint location, GLsizei count, const GLint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform4iv(GLint location, GLsizei count, const GLint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform1uiv(GLint location, GLsizei count, const GLuint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform2uiv(GLint location, GLsizei count, const GLuint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform3uiv(GLint location, GLsizei count, const GLuint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniform4uiv(GLint location, GLsizei count, const GLuint *v) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix2x3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix3x2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix2x4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix4x2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix3x4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformMatrix4x3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) +{ + UNIMPLEMENTED(); +} + +void ProgramVk::setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) +{ + UNIMPLEMENTED(); +} + +bool ProgramVk::getUniformBlockSize(const std::string &blockName, size_t *sizeOut) const +{ + UNIMPLEMENTED(); + return bool(); +} + +bool ProgramVk::getUniformBlockMemberInfo(const std::string &memberUniformName, + sh::BlockMemberInfo *memberInfoOut) const +{ + UNIMPLEMENTED(); + return bool(); +} + +void ProgramVk::setPathFragmentInputGen(const std::string &inputName, + GLenum genMode, + GLint components, + const GLfloat *coeffs) +{ + UNIMPLEMENTED(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.h new file mode 100755 index 000000000..8d8a1f7ca --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ProgramVk.h @@ -0,0 +1,100 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ProgramVk.h: +// Defines the class interface for ProgramVk, implementing ProgramImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ +#define LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ + +#include "libANGLE/renderer/ProgramImpl.h" + +namespace rx +{ + +class ProgramVk : public ProgramImpl +{ + public: + ProgramVk(const gl::ProgramState &state); + ~ProgramVk() override; + + LinkResult load(gl::InfoLog &infoLog, gl::BinaryInputStream *stream) override; + gl::Error save(gl::BinaryOutputStream *stream) override; + void setBinaryRetrievableHint(bool retrievable) override; + + LinkResult link(const gl::ContextState &data, gl::InfoLog &infoLog) override; + GLboolean validate(const gl::Caps &caps, gl::InfoLog *infoLog) override; + + void setUniform1fv(GLint location, GLsizei count, const GLfloat *v) override; + void setUniform2fv(GLint location, GLsizei count, const GLfloat *v) override; + void setUniform3fv(GLint location, GLsizei count, const GLfloat *v) override; + void setUniform4fv(GLint location, GLsizei count, const GLfloat *v) override; + void setUniform1iv(GLint location, GLsizei count, const GLint *v) override; + void setUniform2iv(GLint location, GLsizei count, const GLint *v) override; + void setUniform3iv(GLint location, GLsizei count, const GLint *v) override; + void setUniform4iv(GLint location, GLsizei count, const GLint *v) override; + void setUniform1uiv(GLint location, GLsizei count, const GLuint *v) override; + void setUniform2uiv(GLint location, GLsizei count, const GLuint *v) override; + void setUniform3uiv(GLint location, GLsizei count, const GLuint *v) override; + void setUniform4uiv(GLint location, GLsizei count, const GLuint *v) override; + void setUniformMatrix2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix2x3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix3x2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix2x4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix4x2fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix3x4fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + void setUniformMatrix4x3fv(GLint location, + GLsizei count, + GLboolean transpose, + const GLfloat *value) override; + + // TODO: synchronize in syncState when dirty bits exist. + void setUniformBlockBinding(GLuint uniformBlockIndex, GLuint uniformBlockBinding) override; + + // May only be called after a successful link operation. + // Return false for inactive blocks. + bool getUniformBlockSize(const std::string &blockName, size_t *sizeOut) const override; + + // May only be called after a successful link operation. + // Returns false for inactive members. + bool getUniformBlockMemberInfo(const std::string &memberUniformName, + sh::BlockMemberInfo *memberInfoOut) const override; + + void setPathFragmentInputGen(const std::string &inputName, + GLenum genMode, + GLint components, + const GLfloat *coeffs) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_PROGRAMVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.cpp new file mode 100755 index 000000000..01fd0c45a --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.cpp @@ -0,0 +1,73 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// QueryVk.cpp: +// Implements the class methods for QueryVk. +// + +#include "libANGLE/renderer/vulkan/QueryVk.h" + +#include "common/debug.h" + +namespace rx +{ + +QueryVk::QueryVk(GLenum type) : QueryImpl(type) +{ +} + +QueryVk::~QueryVk() +{ +} + +gl::Error QueryVk::begin() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::end() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::queryCounter() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::getResult(GLint *params) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::getResult(GLuint *params) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::getResult(GLint64 *params) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::getResult(GLuint64 *params) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error QueryVk::isResultAvailable(bool *available) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.h new file mode 100755 index 000000000..7c9273400 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/QueryVk.h @@ -0,0 +1,36 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// QueryVk.h: +// Defines the class interface for QueryVk, implementing QueryImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_QUERYVK_H_ +#define LIBANGLE_RENDERER_VULKAN_QUERYVK_H_ + +#include "libANGLE/renderer/QueryImpl.h" + +namespace rx +{ + +class QueryVk : public QueryImpl +{ + public: + QueryVk(GLenum type); + ~QueryVk() override; + + gl::Error begin() override; + gl::Error end() override; + gl::Error queryCounter() override; + gl::Error getResult(GLint *params) override; + gl::Error getResult(GLuint *params) override; + gl::Error getResult(GLint64 *params) override; + gl::Error getResult(GLuint64 *params) override; + gl::Error isResultAvailable(bool *available) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_QUERYVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.cpp new file mode 100755 index 000000000..18f394700 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.cpp @@ -0,0 +1,53 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// RenderbufferVk.cpp: +// Implements the class methods for RenderbufferVk. +// + +#include "libANGLE/renderer/vulkan/RenderbufferVk.h" + +#include "common/debug.h" + +namespace rx +{ + +RenderbufferVk::RenderbufferVk() : RenderbufferImpl() +{ +} + +RenderbufferVk::~RenderbufferVk() +{ +} + +gl::Error RenderbufferVk::setStorage(GLenum internalformat, size_t width, size_t height) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error RenderbufferVk::setStorageMultisample(size_t samples, + GLenum internalformat, + size_t width, + size_t height) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error RenderbufferVk::setStorageEGLImageTarget(egl::Image *image) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error RenderbufferVk::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.h new file mode 100755 index 000000000..54c5f866e --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/RenderbufferVk.h @@ -0,0 +1,37 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// RenderbufferVk.h: +// Defines the class interface for RenderbufferVk, implementing RenderbufferImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_RENDERBUFFERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_RENDERBUFFERVK_H_ + +#include "libANGLE/renderer/RenderbufferImpl.h" + +namespace rx +{ + +class RenderbufferVk : public RenderbufferImpl +{ + public: + RenderbufferVk(); + ~RenderbufferVk() override; + + gl::Error setStorage(GLenum internalformat, size_t width, size_t height) override; + gl::Error setStorageMultisample(size_t samples, + GLenum internalformat, + size_t width, + size_t height) override; + gl::Error setStorageEGLImageTarget(egl::Image *image) override; + + gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_RENDERBUFFERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp new file mode 100755 index 000000000..a9dc1f679 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.cpp @@ -0,0 +1,66 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// RendererVk.cpp: +// Implements the class methods for RendererVk. +// + +#include "libANGLE/renderer/vulkan/RendererVk.h" + +#include "common/debug.h" + +namespace rx +{ + +RendererVk::RendererVk() : mCapsInitialized(false) +{ +} + +RendererVk::~RendererVk() +{ +} + +void RendererVk::ensureCapsInitialized() const +{ + if (!mCapsInitialized) + { + generateCaps(&mNativeCaps, &mNativeTextureCaps, &mNativeExtensions, &mNativeLimitations); + mCapsInitialized = true; + } +} + +void RendererVk::generateCaps(gl::Caps * /*outCaps*/, + gl::TextureCapsMap * /*outTextureCaps*/, + gl::Extensions * /*outExtensions*/, + gl::Limitations * /* outLimitations */) const +{ + // TODO(jmadill): Caps +} + +const gl::Caps &RendererVk::getNativeCaps() const +{ + ensureCapsInitialized(); + return mNativeCaps; +} + +const gl::TextureCapsMap &RendererVk::getNativeTextureCaps() const +{ + ensureCapsInitialized(); + return mNativeTextureCaps; +} + +const gl::Extensions &RendererVk::getNativeExtensions() const +{ + ensureCapsInitialized(); + return mNativeExtensions; +} + +const gl::Limitations &RendererVk::getNativeLimitations() const +{ + ensureCapsInitialized(); + return mNativeLimitations; +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.h new file mode 100755 index 000000000..8a7489496 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/RendererVk.h @@ -0,0 +1,46 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// RendererVk.h: +// Defines the class interface for RendererVk. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_RENDERERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_RENDERERVK_H_ + +#include "common/angleutils.h" +#include "libANGLE/Caps.h" + +namespace rx +{ + +class RendererVk : angle::NonCopyable +{ + public: + RendererVk(); + ~RendererVk(); + + const gl::Caps &getNativeCaps() const; + const gl::TextureCapsMap &getNativeTextureCaps() const; + const gl::Extensions &getNativeExtensions() const; + const gl::Limitations &getNativeLimitations() const; + + private: + void ensureCapsInitialized() const; + void generateCaps(gl::Caps *outCaps, + gl::TextureCapsMap *outTextureCaps, + gl::Extensions *outExtensions, + gl::Limitations *outLimitations) const; + + mutable bool mCapsInitialized; + mutable gl::Caps mNativeCaps; + mutable gl::TextureCapsMap mNativeTextureCaps; + mutable gl::Extensions mNativeExtensions; + mutable gl::Limitations mNativeLimitations; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_RENDERERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.cpp new file mode 100755 index 000000000..00bb81b6e --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.cpp @@ -0,0 +1,25 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// SamplerVk.cpp: +// Implements the class methods for SamplerVk. +// + +#include "libANGLE/renderer/vulkan/SamplerVk.h" + +#include "common/debug.h" + +namespace rx +{ + +SamplerVk::SamplerVk() : SamplerImpl() +{ +} + +SamplerVk::~SamplerVk() +{ +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.h new file mode 100755 index 000000000..1111f4095 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/SamplerVk.h @@ -0,0 +1,27 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// SamplerVk.h: +// Defines the class interface for SamplerVk, implementing SamplerImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_ + +#include "libANGLE/renderer/SamplerImpl.h" + +namespace rx +{ + +class SamplerVk : public SamplerImpl +{ + public: + SamplerVk(); + ~SamplerVk() override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_SAMPLERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.cpp new file mode 100755 index 000000000..8bece9b45 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.cpp @@ -0,0 +1,44 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ShaderVk.cpp: +// Implements the class methods for ShaderVk. +// + +#include "libANGLE/renderer/vulkan/ShaderVk.h" + +#include "common/debug.h" + +namespace rx +{ + +ShaderVk::ShaderVk(const gl::ShaderState &data) : ShaderImpl(data) +{ +} + +ShaderVk::~ShaderVk() +{ +} + +ShCompileOptions ShaderVk::prepareSourceAndReturnOptions(std::stringstream *sourceStream, + std::string *sourcePath) +{ + UNIMPLEMENTED(); + return int(); +} + +bool ShaderVk::postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) +{ + UNIMPLEMENTED(); + return bool(); +} + +std::string ShaderVk::getDebugInfo() const +{ + UNIMPLEMENTED(); + return std::string(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.h new file mode 100755 index 000000000..10f8fe423 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/ShaderVk.h @@ -0,0 +1,35 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// ShaderVk.h: +// Defines the class interface for ShaderVk, implementing ShaderImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_SHADERVK_H_ +#define LIBANGLE_RENDERER_VULKAN_SHADERVK_H_ + +#include "libANGLE/renderer/ShaderImpl.h" + +namespace rx +{ + +class ShaderVk : public ShaderImpl +{ + public: + ShaderVk(const gl::ShaderState &data); + ~ShaderVk() override; + + // Returns additional sh::Compile options. + ShCompileOptions prepareSourceAndReturnOptions(std::stringstream *sourceStream, + std::string *sourcePath) override; + // Returns success for compiling on the driver. Returns success. + bool postTranslateCompile(gl::Compiler *compiler, std::string *infoLog) override; + + std::string getDebugInfo() const override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_SHADERVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp new file mode 100755 index 000000000..06732c2c8 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.cpp @@ -0,0 +1,103 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// SurfaceVk.cpp: +// Implements the class methods for SurfaceVk. +// + +#include "libANGLE/renderer/vulkan/SurfaceVk.h" + +#include "common/debug.h" + +namespace rx +{ + +SurfaceVk::SurfaceVk(const egl::SurfaceState &surfaceState) : SurfaceImpl(surfaceState) +{ +} + +SurfaceVk::~SurfaceVk() +{ +} + +egl::Error SurfaceVk::initialize() +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +FramebufferImpl *SurfaceVk::createDefaultFramebuffer(const gl::FramebufferState &state) +{ + UNIMPLEMENTED(); + return static_cast<FramebufferImpl *>(0); +} + +egl::Error SurfaceVk::swap() +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error SurfaceVk::postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error SurfaceVk::querySurfacePointerANGLE(EGLint attribute, void **value) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error SurfaceVk::bindTexImage(gl::Texture *texture, EGLint buffer) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +egl::Error SurfaceVk::releaseTexImage(EGLint buffer) +{ + UNIMPLEMENTED(); + return egl::Error(EGL_BAD_ACCESS); +} + +void SurfaceVk::setSwapInterval(EGLint interval) +{ + UNIMPLEMENTED(); +} + +EGLint SurfaceVk::getWidth() const +{ + UNIMPLEMENTED(); + return EGLint(); +} + +EGLint SurfaceVk::getHeight() const +{ + UNIMPLEMENTED(); + return EGLint(); +} + +EGLint SurfaceVk::isPostSubBufferSupported() const +{ + UNIMPLEMENTED(); + return EGLint(); +} + +EGLint SurfaceVk::getSwapBehavior() const +{ + UNIMPLEMENTED(); + return EGLint(); +} + +gl::Error SurfaceVk::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h new file mode 100755 index 000000000..f7d54e4a7 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/SurfaceVk.h @@ -0,0 +1,46 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// SurfaceVk.h: +// Defines the class interface for SurfaceVk, implementing SurfaceImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_SURFACEVK_H_ +#define LIBANGLE_RENDERER_VULKAN_SURFACEVK_H_ + +#include "libANGLE/renderer/SurfaceImpl.h" + +namespace rx +{ + +class SurfaceVk : public SurfaceImpl +{ + public: + SurfaceVk(const egl::SurfaceState &surfaceState); + ~SurfaceVk() override; + + egl::Error initialize() override; + FramebufferImpl *createDefaultFramebuffer(const gl::FramebufferState &state) override; + egl::Error swap() override; + egl::Error postSubBuffer(EGLint x, EGLint y, EGLint width, EGLint height) override; + egl::Error querySurfacePointerANGLE(EGLint attribute, void **value) override; + egl::Error bindTexImage(gl::Texture *texture, EGLint buffer) override; + egl::Error releaseTexImage(EGLint buffer) override; + void setSwapInterval(EGLint interval) override; + + // width and height can change with client window resizing + EGLint getWidth() const override; + EGLint getHeight() const override; + + EGLint isPostSubBufferSupported() const override; + EGLint getSwapBehavior() const override; + + gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_SURFACEVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp new file mode 100755 index 000000000..a2220fcad --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.cpp @@ -0,0 +1,150 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// TextureVk.cpp: +// Implements the class methods for TextureVk. +// + +#include "libANGLE/renderer/vulkan/TextureVk.h" + +#include "common/debug.h" + +namespace rx +{ + +TextureVk::TextureVk(const gl::TextureState &state) : TextureImpl(state) +{ +} + +TextureVk::~TextureVk() +{ +} + +gl::Error TextureVk::setImage(GLenum target, + size_t level, + GLenum internalFormat, + const gl::Extents &size, + GLenum format, + GLenum type, + const gl::PixelUnpackState &unpack, + const uint8_t *pixels) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setSubImage(GLenum target, + size_t level, + const gl::Box &area, + GLenum format, + GLenum type, + const gl::PixelUnpackState &unpack, + const uint8_t *pixels) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setCompressedImage(GLenum target, + size_t level, + GLenum internalFormat, + const gl::Extents &size, + const gl::PixelUnpackState &unpack, + size_t imageSize, + const uint8_t *pixels) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setCompressedSubImage(GLenum target, + size_t level, + const gl::Box &area, + GLenum format, + const gl::PixelUnpackState &unpack, + size_t imageSize, + const uint8_t *pixels) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::copyImage(GLenum target, + size_t level, + const gl::Rectangle &sourceArea, + GLenum internalFormat, + const gl::Framebuffer *source) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::copySubImage(GLenum target, + size_t level, + const gl::Offset &destOffset, + const gl::Rectangle &sourceArea, + const gl::Framebuffer *source) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setStorage(GLenum target, + size_t levels, + GLenum internalFormat, + const gl::Extents &size) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setEGLImageTarget(GLenum target, egl::Image *image) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::setImageExternal(GLenum target, + egl::Stream *stream, + const egl::Stream::GLTextureDescription &desc) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +gl::Error TextureVk::generateMipmap() +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +void TextureVk::setBaseLevel(GLuint baseLevel) +{ + UNIMPLEMENTED(); +} + +void TextureVk::bindTexImage(egl::Surface *surface) +{ + UNIMPLEMENTED(); +} + +void TextureVk::releaseTexImage() +{ + UNIMPLEMENTED(); +} + +gl::Error TextureVk::getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) +{ + UNIMPLEMENTED(); + return gl::Error(GL_INVALID_OPERATION); +} + +void TextureVk::syncState(const gl::Texture::DirtyBits &dirtyBits) +{ + UNIMPLEMENTED(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.h new file mode 100755 index 000000000..d5b9106c7 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/TextureVk.h @@ -0,0 +1,92 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// TextureVk.h: +// Defines the class interface for TextureVk, implementing TextureImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_TEXTUREVK_H_ +#define LIBANGLE_RENDERER_VULKAN_TEXTUREVK_H_ + +#include "libANGLE/renderer/TextureImpl.h" + +namespace rx +{ + +class TextureVk : public TextureImpl +{ + public: + TextureVk(const gl::TextureState &state); + ~TextureVk() override; + + gl::Error setImage(GLenum target, + size_t level, + GLenum internalFormat, + const gl::Extents &size, + GLenum format, + GLenum type, + const gl::PixelUnpackState &unpack, + const uint8_t *pixels) override; + gl::Error setSubImage(GLenum target, + size_t level, + const gl::Box &area, + GLenum format, + GLenum type, + const gl::PixelUnpackState &unpack, + const uint8_t *pixels) override; + + gl::Error setCompressedImage(GLenum target, + size_t level, + GLenum internalFormat, + const gl::Extents &size, + const gl::PixelUnpackState &unpack, + size_t imageSize, + const uint8_t *pixels) override; + gl::Error setCompressedSubImage(GLenum target, + size_t level, + const gl::Box &area, + GLenum format, + const gl::PixelUnpackState &unpack, + size_t imageSize, + const uint8_t *pixels) override; + + gl::Error copyImage(GLenum target, + size_t level, + const gl::Rectangle &sourceArea, + GLenum internalFormat, + const gl::Framebuffer *source) override; + gl::Error copySubImage(GLenum target, + size_t level, + const gl::Offset &destOffset, + const gl::Rectangle &sourceArea, + const gl::Framebuffer *source) override; + + gl::Error setStorage(GLenum target, + size_t levels, + GLenum internalFormat, + const gl::Extents &size) override; + + gl::Error setEGLImageTarget(GLenum target, egl::Image *image) override; + + gl::Error setImageExternal(GLenum target, + egl::Stream *stream, + const egl::Stream::GLTextureDescription &desc) override; + + gl::Error generateMipmap() override; + + void setBaseLevel(GLuint baseLevel) override; + + void bindTexImage(egl::Surface *surface) override; + void releaseTexImage() override; + + gl::Error getAttachmentRenderTarget(const gl::FramebufferAttachment::Target &target, + FramebufferAttachmentRenderTarget **rtOut) override; + + void syncState(const gl::Texture::DirtyBits &dirtyBits) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_TEXTUREVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp new file mode 100755 index 000000000..ea445c753 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.cpp @@ -0,0 +1,57 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// TransformFeedbackVk.cpp: +// Implements the class methods for TransformFeedbackVk. +// + +#include "libANGLE/renderer/vulkan/TransformFeedbackVk.h" + +#include "common/debug.h" + +namespace rx +{ + +TransformFeedbackVk::TransformFeedbackVk(const gl::TransformFeedbackState &state) + : TransformFeedbackImpl(state) +{ +} + +TransformFeedbackVk::~TransformFeedbackVk() +{ +} + +void TransformFeedbackVk::begin(GLenum primitiveMode) +{ + UNIMPLEMENTED(); +} + +void TransformFeedbackVk::end() +{ + UNIMPLEMENTED(); +} + +void TransformFeedbackVk::pause() +{ + UNIMPLEMENTED(); +} + +void TransformFeedbackVk::resume() +{ + UNIMPLEMENTED(); +} + +void TransformFeedbackVk::bindGenericBuffer(const BindingPointer<gl::Buffer> &binding) +{ + UNIMPLEMENTED(); +} + +void TransformFeedbackVk::bindIndexedBuffer(size_t index, + const OffsetBindingPointer<gl::Buffer> &binding) +{ + UNIMPLEMENTED(); +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h new file mode 100755 index 000000000..ed8522c9c --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/TransformFeedbackVk.h @@ -0,0 +1,35 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// TransformFeedbackVk.h: +// Defines the class interface for TransformFeedbackVk, implementing TransformFeedbackImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_TRANSFORMFEEDBACKVK_H_ +#define LIBANGLE_RENDERER_VULKAN_TRANSFORMFEEDBACKVK_H_ + +#include "libANGLE/renderer/TransformFeedbackImpl.h" + +namespace rx +{ + +class TransformFeedbackVk : public TransformFeedbackImpl +{ + public: + TransformFeedbackVk(const gl::TransformFeedbackState &state); + ~TransformFeedbackVk() override; + + void begin(GLenum primitiveMode) override; + void end() override; + void pause() override; + void resume() override; + + void bindGenericBuffer(const BindingPointer<gl::Buffer> &binding) override; + void bindIndexedBuffer(size_t index, const OffsetBindingPointer<gl::Buffer> &binding) override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_TRANSFORMFEEDBACKVK_H_ diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp b/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp new file mode 100755 index 000000000..9f639b951 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.cpp @@ -0,0 +1,25 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// VertexArrayVk.cpp: +// Implements the class methods for VertexArrayVk. +// + +#include "libANGLE/renderer/vulkan/VertexArrayVk.h" + +#include "common/debug.h" + +namespace rx +{ + +VertexArrayVk::VertexArrayVk(const gl::VertexArrayState &data) : VertexArrayImpl(data) +{ +} + +VertexArrayVk::~VertexArrayVk() +{ +} + +} // namespace rx diff --git a/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h b/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h new file mode 100755 index 000000000..9340d2757 --- /dev/null +++ b/gfx/angle/src/libANGLE/renderer/vulkan/VertexArrayVk.h @@ -0,0 +1,27 @@ +// +// Copyright 2016 The ANGLE Project Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. +// +// VertexArrayVk.h: +// Defines the class interface for VertexArrayVk, implementing VertexArrayImpl. +// + +#ifndef LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_ +#define LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_ + +#include "libANGLE/renderer/VertexArrayImpl.h" + +namespace rx +{ + +class VertexArrayVk : public VertexArrayImpl +{ + public: + VertexArrayVk(const gl::VertexArrayState &data); + ~VertexArrayVk() override; +}; + +} // namespace rx + +#endif // LIBANGLE_RENDERER_VULKAN_VERTEXARRAYVK_H_ |