Commit 97073d12 by Geoff Lang Committed by Commit Bot

Implement CHROMIUM_copy_texture for D3D11.

BUG=angleproject:1356 Change-Id: I70246762411dbeeb3e291e317854139a68d80070 Reviewed-on: https://chromium-review.googlesource.com/339434Reviewed-by: 's avatarCorentin Wallez <cwallez@chromium.org> Commit-Queue: Geoff Lang <geofflang@chromium.org>
parent 59a334fc
Name
CHROMIUM_copy_texture
Name Strings
GL_CHROMIUM_copy_texture
Version
Last Modifed Date: July 16, 2014
Dependencies
OpenGL ES 2.0 is required.
EXT_texture_format_BGRA8888 affects the definition of this extension.
ARB_texture_rg affects the definition of this extension.
CHROMIUM_ycbcr_422_image affects the definition of this extension.
Overview
This extension expands on the functionality provided by the
glCopyTexImage2D command. A new function is exported,
glCopyTextureCHROMIUM, that performs the same copy operation as
glCopyTexImage2D.
The extension also supports copying BGRA textures and copying
EXTERNAL_OES texture to BGRA texture, which is not explicitly
granted by EXT_texture_format_BGRA8888.
New Procedures and Functions
The command
void glCopyTextureCHROMIUM (GLuint source_id,
GLuint dest_id,
GLint internal_format, GLenum dest_type,
GLboolean unpack_flip_y,
GLboolean unpack_premultiply_alpha,
GLboolean unpack_unmultiply_alpha)
Copies the contents of <source_id> texture to <dest_id> texture.
Texture level 0 is copied from the source image to level 0 of the
destination texture.
The internal format of the destination texture is converted to that
specified by <internal_format>. Must be one of the following symbolic
constants: GL_RGB, GL_RGBA
The internal format of <source_id> texture must be one of the following
symbolic constants: GL_R8, GL_ALPHA, GL_LUMINANCE, GL_LUMINANCE_ALPHA,
GL_RGB, GL_RGBA, GL_BGRA_EXT, GL_RGB_YCBCR_422_CHROMIUM
When <source_id> texture doens't contain a superset of the component
required by <internal_format>, fill the components by following rules.
source format color components
=====================================================
GL_ALPHA (0, 0, 0, A)
GL_R8 (R, 0, 0, 1)
GL_LUMINANCE (L, L, L, 1)
GL_LUMINANCE_ALPHA (L, L, L, A)
GL_RGB (R, G, B, 1)
GL_RGBA (R, G, B, A)
GL_BGRA_EXT (R, G, B, A)
GL_RGB_YCBCR_422_CHROMIUM (R, G, B, 1)
The format type of the destination texture is converted to that specified
by <dest_type>.
If <flip_y> is true, vertically flip texture image data.
If <unpack_premultiply_alpha> and <unpack_unmultiply_alpha> are true,
no alpha processing occurs. This is the equivalent of having neither flag
set.
When <source_id> refers to a stream texture, the texture matrix will be
applied as part of the copy operation.
INVALID_OPERATION is generated if <internal_format> is not one of the valid formats
described above.
INVALID_OPERATION is generated if the internal format of <source_id> is not one of
formats from the table above.
INVALID_VALUE is generated if <source_id> or <dest_id> are not valid texture
objects.
INVALID_VALUE is generated if textures corresponding to <dest_id> have not
been bound as GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB objects.
INVALID_VALUE is generated if textures corresponding to <source_id> have not
been bound as GL_TEXTURE_2D, GL_TEXTURE_RECTANGLE_ARB or
GL_TEXTURE_EXTERNAL_OES objects.
INVALID_VALUE is generated if level 0 of the source texture is not defined.
The command
void glCopySubTextureCHROMIUM (GLuint source_id,
GLuint dest_id,
GLint xoffset, GLint yoffset,
GLint x, GLint y,
GLsizei width, GLsizei height,
GLboolean unpack_flip_y,
GLboolean unpack_premultiply_alpha,
GLboolean unpack_unmultiply_alpha)
Copies the sub contents of texture referred to by <source_id> to <dest_id>
texture without redefining <dest_id> texture.
See CopyTextureCHROMIUM for the interpretation of the <flip_y>,
<premultiply_alpha>, and <unmultiply_alpha> arguments.
<xoffset> and <yoffset> specify a texel offset in the x and y direction
respectively within the destination texture.
<x> and <y> specify specify a texel offset in the x and y direction
respectively within the source texture.
<width> specifies the width of the texture subimage.
<height> specifies the width of the texture subimage.
INVALID_VALUE is generated if either <source_id> texture or <dest_id>
texture is not defined.
INVALID_OPERATION is generated if source internal_format and destination
internal_format are not one of the valid formats described above.
INVALID_OPERATION is generated if the destination texture has not been
defined.
INVALID_VALUE is generated if <dest_id> texture is not bound as
GL_TEXTURE_2D or GL_TEXTURE_RECTANGLE_ARB.
INVALID_VALUE is generated if level 0 of the source texture or
the destination texture is not defined.
INVALID_VALUE is generated if <xoffset> < 0 , or <yoffset> < 0.
INVALID_VALUE is generated if (<xoffset> + <width>) > dest_width,
or (<yoffset> + <height>) > dest_height.
Dependencies on ARB_texture_rg
If ARB_texture_rg is not supported:
* delete any reference to the R8 format.
Dependencies on CHROMIUM_ycbcr_422_image
If CHROMIUM_ycbcr_422_image is not supported:
* delete any reference to the RGB_YCBCR_422_CHROMIUM format.
Errors
None.
New Tokens
None.
New State
None.
Revision History
8/1/2011 Documented the extension
7/4/2013 Add a new parameter dest_type to glCopyTextureCHROMIUM()
16/7/2014 Add GL_TEXTURE_RECTANGLE_ARB as valid source_id target
19/6/2015 Add arguments unpack_flip_y, unpack_premultiply_alpha, and
unpack_unmultiply_alpha to both commands.
4/1/2016 Removed the argument target.
4/1/2016 Added GL_TEXTURE_RECTANGLE_ARB as valid dest_id target
...@@ -1261,6 +1261,48 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei ...@@ -1261,6 +1261,48 @@ GL_APICALL void GL_APIENTRY glGetSyncivAPPLE (GLsync sync, GLenum pname, GLsizei
#define GL_ARM_shader_framebuffer_fetch_depth_stencil 1 #define GL_ARM_shader_framebuffer_fetch_depth_stencil 1
#endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */ #endif /* GL_ARM_shader_framebuffer_fetch_depth_stencil */
#ifndef GL_CHROMIUM_copy_texture
#define GL_CHROMIUM_copy_texture 1
typedef void(GL_APIENTRYP PFNGLCOPYTEXTURECHROMIUMPROC)(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
typedef void(GL_APIENTRYP PFNGLCOPYSUBTEXTURECHROMIUMPROC)(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
#ifdef GL_GLEXT_PROTOTYPES
GL_APICALL void GL_APIENTRY glCopyTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
GL_APICALL void GL_APIENTRY glCopySubTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
#endif
#endif /* GL_CHROMIUM_copy_texture */
#ifndef GL_CHROMIUM_sync_query #ifndef GL_CHROMIUM_sync_query
#define GL_CHROMIUM_sync_query 1 #define GL_CHROMIUM_sync_query 1
#define GL_COMMANDS_COMPLETED_CHROMIUM 0x84F7 #define GL_COMMANDS_COMPLETED_CHROMIUM 0x84F7
......
...@@ -160,6 +160,7 @@ Extensions::Extensions() ...@@ -160,6 +160,7 @@ Extensions::Extensions()
lossyETCDecode(false), lossyETCDecode(false),
bindUniformLocation(false), bindUniformLocation(false),
syncQuery(false), syncQuery(false),
copyTexture(false),
colorBufferFloat(false), colorBufferFloat(false),
multisampleCompatibility(false), multisampleCompatibility(false),
framebufferMixedSamples(false), framebufferMixedSamples(false),
...@@ -238,6 +239,7 @@ std::vector<std::string> Extensions::getStrings() const ...@@ -238,6 +239,7 @@ std::vector<std::string> Extensions::getStrings() const
InsertExtensionString("GL_ANGLE_lossy_etc_decode", lossyETCDecode, &extensionStrings); InsertExtensionString("GL_ANGLE_lossy_etc_decode", lossyETCDecode, &extensionStrings);
InsertExtensionString("GL_CHROMIUM_bind_uniform_location", bindUniformLocation, &extensionStrings); InsertExtensionString("GL_CHROMIUM_bind_uniform_location", bindUniformLocation, &extensionStrings);
InsertExtensionString("GL_CHROMIUM_sync_query", syncQuery, &extensionStrings); InsertExtensionString("GL_CHROMIUM_sync_query", syncQuery, &extensionStrings);
InsertExtensionString("GL_CHROMIUM_copy_texture", copyTexture, &extensionStrings);
InsertExtensionString("GL_EXT_multisample_compatibility", multisampleCompatibility, &extensionStrings); InsertExtensionString("GL_EXT_multisample_compatibility", multisampleCompatibility, &extensionStrings);
InsertExtensionString("GL_CHROMIUM_framebuffer_mixed_samples", framebufferMixedSamples, &extensionStrings); InsertExtensionString("GL_CHROMIUM_framebuffer_mixed_samples", framebufferMixedSamples, &extensionStrings);
InsertExtensionString("GL_EXT_texture_norm16", textureNorm16, &extensionStrings); InsertExtensionString("GL_EXT_texture_norm16", textureNorm16, &extensionStrings);
......
...@@ -288,6 +288,9 @@ struct Extensions ...@@ -288,6 +288,9 @@ struct Extensions
// GL_CHROMIUM_sync_query // GL_CHROMIUM_sync_query
bool syncQuery; bool syncQuery;
// GL_CHROMIUM_copy_texture
bool copyTexture;
// ES3 Extension support // ES3 Extension support
// GL_EXT_color_buffer_float // GL_EXT_color_buffer_float
......
...@@ -2730,6 +2730,52 @@ void Context::generateMipmap(GLenum target) ...@@ -2730,6 +2730,52 @@ void Context::generateMipmap(GLenum target)
handleError(texture->generateMipmap()); handleError(texture->generateMipmap());
} }
void Context::copyTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
syncStateForTexImage();
gl::Texture *sourceTexture = getTexture(sourceId);
gl::Texture *destTexture = getTexture(destId);
handleError(destTexture->copyTexture(internalFormat, destType, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE,
unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::copySubTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
// Zero sized copies are valid but no-ops
if (width == 0 || height == 0)
{
return;
}
syncStateForTexImage();
gl::Texture *sourceTexture = getTexture(sourceId);
gl::Texture *destTexture = getTexture(destId);
Offset offset(xoffset, yoffset, 0);
Rectangle area(x, y, width, height);
handleError(destTexture->copySubTexture(offset, area, unpackFlipY == GL_TRUE,
unpackPremultiplyAlpha == GL_TRUE,
unpackUnmultiplyAlpha == GL_TRUE, sourceTexture));
}
void Context::getBufferPointerv(GLenum target, GLenum /*pname*/, void **params) void Context::getBufferPointerv(GLenum target, GLenum /*pname*/, void **params)
{ {
Buffer *buffer = mGLState.getTargetBuffer(target); Buffer *buffer = mGLState.getTargetBuffer(target);
......
...@@ -463,6 +463,24 @@ class Context final : public ValidationContext ...@@ -463,6 +463,24 @@ class Context final : public ValidationContext
GLenum format, GLenum format,
GLsizei imageSize, GLsizei imageSize,
const GLvoid *data); const GLvoid *data);
void copyTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void copySubTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
void generateMipmap(GLenum target); void generateMipmap(GLenum target);
......
...@@ -866,6 +866,39 @@ Error Texture::copySubImage(GLenum target, size_t level, const Offset &destOffse ...@@ -866,6 +866,39 @@ Error Texture::copySubImage(GLenum target, size_t level, const Offset &destOffse
return mTexture->copySubImage(target, level, destOffset, sourceArea, source); return mTexture->copySubImage(target, level, destOffset, sourceArea, source);
} }
Error Texture::copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
// Release from previous calls to eglBindTexImage, to avoid calling the Impl after
releaseTexImageInternal();
orphanImages();
ANGLE_TRY(mTexture->copyTexture(internalFormat, type, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, source));
const auto &sourceDesc = source->mState.getImageDesc(source->getTarget(), 0);
const GLenum sizedFormat = GetSizedInternalFormat(internalFormat, type);
mState.setImageDesc(getTarget(), 0, ImageDesc(sourceDesc.size, Format(sizedFormat)));
mDirtyChannel.signal();
return NoError();
}
Error Texture::copySubTexture(const Offset &destOffset,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source)
{
return mTexture->copySubTexture(destOffset, sourceArea, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, source);
}
Error Texture::setStorage(GLenum target, GLsizei levels, GLenum internalFormat, const Extents &size) Error Texture::setStorage(GLenum target, GLsizei levels, GLenum internalFormat, const Extents &size)
{ {
ASSERT(target == mState.mTarget); ASSERT(target == mState.mTarget);
......
...@@ -283,6 +283,19 @@ class Texture final : public egl::ImageSibling, ...@@ -283,6 +283,19 @@ class Texture final : public egl::ImageSibling,
const Rectangle &sourceArea, const Rectangle &sourceArea,
const Framebuffer *source); const Framebuffer *source);
Error copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source);
Error copySubTexture(const Offset &destOffset,
const Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const Texture *source);
Error setStorage(GLenum target, GLsizei levels, GLenum internalFormat, const Extents &size); Error setStorage(GLenum target, GLsizei levels, GLenum internalFormat, const Extents &size);
Error setEGLImageTarget(GLenum target, egl::Image *imageTarget); Error setEGLImageTarget(GLenum target, egl::Image *imageTarget);
......
//
// 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.
//
// TextureImpl.cpp: Defines the abstract rx::TextureImpl classes.
#include "libANGLE/renderer/TextureImpl.h"
namespace rx
{
TextureImpl::TextureImpl(const gl::TextureState &state) : mState(state)
{
}
TextureImpl::~TextureImpl()
{
}
gl::Error TextureImpl::copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
UNREACHABLE();
return gl::Error(GL_INVALID_OPERATION, "CHROMIUM_copy_texture exposed but not implemented.");
}
gl::Error TextureImpl::copySubTexture(const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
UNREACHABLE();
return gl::Error(GL_INVALID_OPERATION, "CHROMIUM_copy_texture exposed but not implemented.");
}
}
...@@ -41,8 +41,8 @@ namespace rx ...@@ -41,8 +41,8 @@ namespace rx
class TextureImpl : public FramebufferAttachmentObjectImpl class TextureImpl : public FramebufferAttachmentObjectImpl
{ {
public: public:
TextureImpl(const gl::TextureState &state) : mState(state) {} TextureImpl(const gl::TextureState &state);
virtual ~TextureImpl() {} virtual ~TextureImpl();
virtual gl::Error setImage(GLenum target, size_t level, GLenum internalFormat, const gl::Extents &size, GLenum format, GLenum type, virtual 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) = 0; const gl::PixelUnpackState &unpack, const uint8_t *pixels) = 0;
...@@ -59,6 +59,19 @@ class TextureImpl : public FramebufferAttachmentObjectImpl ...@@ -59,6 +59,19 @@ class TextureImpl : public FramebufferAttachmentObjectImpl
virtual gl::Error copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea, virtual gl::Error copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source) = 0; const gl::Framebuffer *source) = 0;
virtual gl::Error copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
virtual gl::Error copySubTexture(const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source);
virtual gl::Error setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size) = 0; virtual gl::Error setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size) = 0;
virtual gl::Error setEGLImageTarget(GLenum target, egl::Image *image) = 0; virtual gl::Error setEGLImageTarget(GLenum target, egl::Image *image) = 0;
......
...@@ -27,6 +27,14 @@ class MockTextureImpl : public TextureImpl ...@@ -27,6 +27,14 @@ class MockTextureImpl : public TextureImpl
MOCK_METHOD7(setCompressedSubImage, gl::Error(GLenum, size_t, const gl::Box &, GLenum, const gl::PixelUnpackState &, size_t, const uint8_t *)); MOCK_METHOD7(setCompressedSubImage, gl::Error(GLenum, size_t, const gl::Box &, GLenum, const gl::PixelUnpackState &, size_t, const uint8_t *));
MOCK_METHOD5(copyImage, gl::Error(GLenum, size_t, const gl::Rectangle &, GLenum, const gl::Framebuffer *)); MOCK_METHOD5(copyImage, gl::Error(GLenum, size_t, const gl::Rectangle &, GLenum, const gl::Framebuffer *));
MOCK_METHOD5(copySubImage, gl::Error(GLenum, size_t, const gl::Offset &, const gl::Rectangle &, const gl::Framebuffer *)); MOCK_METHOD5(copySubImage, gl::Error(GLenum, size_t, const gl::Offset &, const gl::Rectangle &, const gl::Framebuffer *));
MOCK_METHOD6(copyTexture, gl::Error(GLenum, GLenum, bool, bool, bool, const gl::Texture *));
MOCK_METHOD6(copySubTexture,
gl::Error(const gl::Offset &,
const gl::Rectangle &,
bool,
bool,
bool,
const gl::Texture *));
MOCK_METHOD4(setStorage, gl::Error(GLenum, size_t, GLenum, const gl::Extents &)); MOCK_METHOD4(setStorage, gl::Error(GLenum, size_t, GLenum, const gl::Extents &));
MOCK_METHOD3(setImageExternal, MOCK_METHOD3(setImageExternal,
gl::Error(GLenum, egl::Stream *, const egl::Stream::GLTextureDescription &)); gl::Error(GLenum, egl::Stream *, const egl::Stream::GLTextureDescription &));
......
...@@ -160,6 +160,17 @@ class RendererD3D : public BufferFactoryD3D ...@@ -160,6 +160,17 @@ class RendererD3D : public BufferFactoryD3D
virtual gl::Error copyImage2DArray(const gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat, virtual gl::Error copyImage2DArray(const gl::Framebuffer *framebuffer, const gl::Rectangle &sourceRect, GLenum destFormat,
const gl::Offset &destOffset, TextureStorage *storage, GLint level) = 0; const gl::Offset &destOffset, TextureStorage *storage, GLint level) = 0;
virtual gl::Error copyTexture(const gl::Texture *source,
GLint sourceLevel,
const gl::Rectangle &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha) = 0;
// RenderTarget creation // RenderTarget creation
virtual gl::Error createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT) = 0; virtual gl::Error createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT) = 0;
virtual gl::Error createRenderTargetCopy(RenderTargetD3D *source, RenderTargetD3D **outRT) = 0; virtual gl::Error createRenderTargetCopy(RenderTargetD3D *source, RenderTargetD3D **outRT) = 0;
......
...@@ -911,6 +911,63 @@ gl::Error TextureD3D_2D::copySubImage(GLenum target, ...@@ -911,6 +911,63 @@ gl::Error TextureD3D_2D::copySubImage(GLenum target,
return gl::Error(GL_NO_ERROR); return gl::Error(GL_NO_ERROR);
} }
gl::Error TextureD3D_2D::copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
GLenum sourceTarget = source->getTarget();
GLint sourceLevel = 0;
GLint destLevel = 0;
GLenum sizedInternalFormat = gl::GetSizedInternalFormat(internalFormat, type);
gl::Extents size(static_cast<int>(source->getWidth(sourceTarget, sourceLevel)),
static_cast<int>(source->getHeight(sourceTarget, sourceLevel)), 1);
redefineImage(destLevel, sizedInternalFormat, size, false);
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
gl::Rectangle sourceRect(0, 0, size.width, size.height);
gl::Offset destOffset(0, 0, 0);
ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceRect,
gl::GetInternalFormatInfo(sizedInternalFormat).format,
destOffset, mTexStorage, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
}
gl::Error TextureD3D_2D::copySubTexture(const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
GLint sourceLevel = 0;
GLint destLevel = 0;
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
ANGLE_TRY(mRenderer->copyTexture(source, sourceLevel, sourceArea,
gl::GetInternalFormatInfo(getBaseLevelInternalFormat()).format,
destOffset, mTexStorage, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
return gl::NoError();
}
gl::Error TextureD3D_2D::setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size) gl::Error TextureD3D_2D::setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size)
{ {
ASSERT(GL_TEXTURE_2D && size.depth == 1); ASSERT(GL_TEXTURE_2D && size.depth == 1);
......
...@@ -158,6 +158,19 @@ class TextureD3D_2D : public TextureD3D ...@@ -158,6 +158,19 @@ class TextureD3D_2D : public TextureD3D
gl::Error copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea, gl::Error copySubImage(GLenum target, size_t level, const gl::Offset &destOffset, const gl::Rectangle &sourceArea,
const gl::Framebuffer *source) override; const gl::Framebuffer *source) override;
gl::Error copyTexture(GLenum internalFormat,
GLenum type,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(const gl::Offset &destOffset,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size) override; gl::Error setStorage(GLenum target, size_t levels, GLenum internalFormat, const gl::Extents &size) override;
virtual void bindTexImage(egl::Surface *surface); virtual void bindTexImage(egl::Surface *surface);
......
...@@ -40,7 +40,9 @@ class Blit11 : angle::NonCopyable ...@@ -40,7 +40,9 @@ class Blit11 : angle::NonCopyable
const gl::Rectangle *scissor, const gl::Rectangle *scissor,
GLenum destFormat, GLenum destFormat,
GLenum filter, GLenum filter,
bool maskOffAlpha); bool maskOffAlpha,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha);
gl::Error copyStencil(const TextureHelper11 &source, gl::Error copyStencil(const TextureHelper11 &source,
unsigned int sourceSubresource, unsigned int sourceSubresource,
...@@ -93,8 +95,14 @@ class Blit11 : angle::NonCopyable ...@@ -93,8 +95,14 @@ class Blit11 : angle::NonCopyable
{ {
BLITSHADER_INVALID, BLITSHADER_INVALID,
BLITSHADER_2D_RGBAF, BLITSHADER_2D_RGBAF,
BLITSHADER_2D_RGBAF_PREMULTIPLY,
BLITSHADER_2D_RGBAF_UNMULTIPLY,
BLITSHADER_2D_BGRAF, BLITSHADER_2D_BGRAF,
BLITSHADER_2D_BGRAF_PREMULTIPLY,
BLITSHADER_2D_BGRAF_UNMULTIPLY,
BLITSHADER_2D_RGBF, BLITSHADER_2D_RGBF,
BLITSHADER_2D_RGBF_PREMULTIPLY,
BLITSHADER_2D_RGBF_UNMULTIPLY,
BLITSHADER_2D_RGF, BLITSHADER_2D_RGF,
BLITSHADER_2D_RF, BLITSHADER_2D_RF,
BLITSHADER_2D_ALPHA, BLITSHADER_2D_ALPHA,
...@@ -179,6 +187,8 @@ class Blit11 : angle::NonCopyable ...@@ -179,6 +187,8 @@ class Blit11 : angle::NonCopyable
static BlitShaderType GetBlitShaderType(GLenum destinationFormat, static BlitShaderType GetBlitShaderType(GLenum destinationFormat,
bool isSigned, bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
ShaderDimension dimension); ShaderDimension dimension);
static SwizzleShaderType GetSwizzleShaderType(GLenum type, D3D11_SRV_DIMENSION dimensionality); static SwizzleShaderType GetSwizzleShaderType(GLenum type, D3D11_SRV_DIMENSION dimensionality);
...@@ -230,6 +240,8 @@ class Blit11 : angle::NonCopyable ...@@ -230,6 +240,8 @@ class Blit11 : angle::NonCopyable
gl::Error getBlitShader(GLenum destFormat, gl::Error getBlitShader(GLenum destFormat,
bool isSigned, bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
ShaderDimension dimension, ShaderDimension dimension,
const Shader **shaderOut); const Shader **shaderOut);
gl::Error getSwizzleShader(GLenum type, gl::Error getSwizzleShader(GLenum type,
......
...@@ -2951,7 +2951,7 @@ gl::Error Renderer11::copyImageInternal(const gl::Framebuffer *framebuffer, ...@@ -2951,7 +2951,7 @@ gl::Error Renderer11::copyImageInternal(const gl::Framebuffer *framebuffer,
// Convert to the unsized format before calling copyTexture. // Convert to the unsized format before calling copyTexture.
const gl::InternalFormat &internalFormat = gl::GetInternalFormatInfo(destFormat); const gl::InternalFormat &internalFormat = gl::GetInternalFormatInfo(destFormat);
ANGLE_TRY(mBlit->copyTexture(source, sourceArea, sourceSize, dest, destArea, destSize, nullptr, ANGLE_TRY(mBlit->copyTexture(source, sourceArea, sourceSize, dest, destArea, destSize, nullptr,
internalFormat.format, GL_NEAREST, false)); internalFormat.format, GL_NEAREST, false, false, false));
return gl::NoError(); return gl::NoError();
} }
...@@ -3026,12 +3026,101 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const ...@@ -3026,12 +3026,101 @@ gl::Error Renderer11::copyImage2DArray(const gl::Framebuffer *framebuffer, const
ASSERT(destRenderTarget); ASSERT(destRenderTarget);
ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget)); ANGLE_TRY(copyImageInternal(framebuffer, sourceRect, destFormat, destOffset, destRenderTarget));
storage11->invalidateSwizzleCacheLevel(level); storage11->invalidateSwizzleCacheLevel(level);
return gl::NoError(); return gl::NoError();
} }
gl::Error Renderer11::copyTexture(const gl::Texture *source,
GLint sourceLevel,
const gl::Rectangle &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{
const TextureD3D *sourceD3D = GetImplAs<TextureD3D>(source);
TextureStorage *sourceStorage = nullptr;
ANGLE_TRY(const_cast<TextureD3D *>(sourceD3D)->getNativeTexture(&sourceStorage));
TextureStorage11_2D *sourceStorage11 = GetAs<TextureStorage11_2D>(sourceStorage);
ASSERT(sourceStorage11);
TextureStorage11_2D *destStorage11 = GetAs<TextureStorage11_2D>(storage);
ASSERT(destStorage11);
// Check for fast path where a CopySubresourceRegion can be used.
if (unpackPremultiplyAlpha == unpackUnmultiplyAlpha && !unpackFlipY &&
sourceStorage11->getFormatSet().texFormat == destStorage11->getFormatSet().texFormat)
{
ID3D11Resource *sourceResource = nullptr;
ANGLE_TRY(sourceStorage11->getResource(&sourceResource));
gl::ImageIndex sourceIndex = gl::ImageIndex::Make2D(sourceLevel);
UINT sourceSubresource = sourceStorage11->getSubresourceIndex(sourceIndex);
ID3D11Resource *destResource = nullptr;
ANGLE_TRY(destStorage11->getResource(&destResource));
gl::ImageIndex destIndex = gl::ImageIndex::Make2D(destLevel);
UINT destSubresource = destStorage11->getSubresourceIndex(destIndex);
D3D11_BOX sourceBox{
static_cast<UINT>(sourceRect.x),
static_cast<UINT>(sourceRect.y),
0u,
static_cast<UINT>(sourceRect.x + sourceRect.width),
static_cast<UINT>(sourceRect.y + sourceRect.height),
1u,
};
mDeviceContext->CopySubresourceRegion(destResource, destSubresource, destOffset.x,
destOffset.y, destOffset.z, sourceResource,
sourceSubresource, &sourceBox);
}
else
{
ID3D11ShaderResourceView *sourceSRV = nullptr;
ANGLE_TRY(sourceStorage11->getSRVLevels(sourceLevel, sourceLevel, &sourceSRV));
gl::ImageIndex destIndex = gl::ImageIndex::Make2D(destLevel);
RenderTargetD3D *destRenderTargetD3D = nullptr;
ANGLE_TRY(destStorage11->getRenderTarget(destIndex, &destRenderTargetD3D));
RenderTarget11 *destRenderTarget11 = GetAs<RenderTarget11>(destRenderTargetD3D);
ID3D11RenderTargetView *destRTV = destRenderTarget11->getRenderTargetView();
ASSERT(destRTV);
gl::Box sourceArea(sourceRect.x, sourceRect.y, 0, sourceRect.width, sourceRect.height, 1);
gl::Extents sourceSize(
static_cast<int>(source->getWidth(source->getTarget(), sourceLevel)),
static_cast<int>(source->getHeight(source->getTarget(), sourceLevel)), 1);
if (unpackFlipY)
{
sourceArea.y = sourceSize.height - sourceRect.y;
sourceArea.height = -sourceArea.height;
}
gl::Box destArea(destOffset.x, destOffset.y, 0, sourceRect.width, sourceRect.height, 1);
gl::Extents destSize(destRenderTarget11->getWidth(), destRenderTarget11->getHeight(), 1);
// Use nearest filtering because source and destination are the same size for the direct
// copy
ANGLE_TRY(mBlit->copyTexture(sourceSRV, sourceArea, sourceSize, destRTV, destArea, destSize,
nullptr, destFormat, GL_NEAREST, false, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha));
}
destStorage11->invalidateSwizzleCacheLevel(destLevel);
return gl::Error(GL_NO_ERROR);
}
gl::Error Renderer11::createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT) gl::Error Renderer11::createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT)
{ {
const d3d11::TextureFormat &formatInfo = d3d11::GetTextureFormatInfo(format, mRenderer11DeviceCaps); const d3d11::TextureFormat &formatInfo = d3d11::GetTextureFormatInfo(format, mRenderer11DeviceCaps);
...@@ -3974,7 +4063,8 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn, ...@@ -3974,7 +4063,8 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
bool maskOffAlpha = colorMaskingNeeded && colorMask.alpha; bool maskOffAlpha = colorMaskingNeeded && colorMask.alpha;
ASSERT(readSRV); ASSERT(readSRV);
ANGLE_TRY(mBlit->copyTexture(readSRV, readArea, readSize, drawRTV, drawArea, drawSize, ANGLE_TRY(mBlit->copyTexture(readSRV, readArea, readSize, drawRTV, drawArea, drawSize,
scissor, destFormatInfo.format, filter, maskOffAlpha)); scissor, destFormatInfo.format, filter, maskOffAlpha,
false, false));
} }
} }
......
...@@ -202,6 +202,17 @@ class Renderer11 : public RendererD3D ...@@ -202,6 +202,17 @@ class Renderer11 : public RendererD3D
TextureStorage *storage, TextureStorage *storage,
GLint level) override; GLint level) override;
gl::Error copyTexture(const gl::Texture *source,
GLint sourceLevel,
const gl::Rectangle &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha) override;
// RenderTarget creation // RenderTarget creation
gl::Error createRenderTarget(int width, gl::Error createRenderTarget(int width,
int height, int height,
......
...@@ -542,9 +542,10 @@ gl::Error TextureStorage11::generateMipmap(const gl::ImageIndex &sourceIndex, ...@@ -542,9 +542,10 @@ gl::Error TextureStorage11::generateMipmap(const gl::ImageIndex &sourceIndex,
gl::Extents destSize(dest->getWidth(), dest->getHeight(), dest->getDepth()); gl::Extents destSize(dest->getWidth(), dest->getHeight(), dest->getDepth());
Blit11 *blitter = mRenderer->getBlitter(); Blit11 *blitter = mRenderer->getBlitter();
return blitter->copyTexture( return blitter->copyTexture(sourceSRV, sourceArea, sourceSize, destRTV, destArea, destSize,
sourceSRV, sourceArea, sourceSize, destRTV, destArea, destSize, nullptr, nullptr,
gl::GetInternalFormatInfo(source->getInternalFormat()).format, GL_LINEAR, false); gl::GetInternalFormatInfo(source->getInternalFormat()).format,
GL_LINEAR, false, false, false);
} }
void TextureStorage11::verifySwizzleExists(const gl::SwizzleState &swizzleState) void TextureStorage11::verifySwizzleExists(const gl::SwizzleState &swizzleState)
......
...@@ -1239,6 +1239,7 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons ...@@ -1239,6 +1239,7 @@ void GenerateCaps(ID3D11Device *device, ID3D11DeviceContext *deviceContext, cons
extensions->packSubimage = true; extensions->packSubimage = true;
extensions->lossyETCDecode = true; extensions->lossyETCDecode = true;
extensions->syncQuery = GetEventQuerySupport(featureLevel); extensions->syncQuery = GetEventQuerySupport(featureLevel);
extensions->copyTexture = true;
// D3D11 Feature Level 10_0+ uses SV_IsFrontFace in HLSL to emulate gl_FrontFacing. // D3D11 Feature Level 10_0+ uses SV_IsFrontFace in HLSL to emulate gl_FrontFacing.
// D3D11 Feature Level 9_3 doesn't support SV_IsFrontFace, and has no equivalent, so can't support gl_FrontFacing. // D3D11 Feature Level 9_3 doesn't support SV_IsFrontFace, and has no equivalent, so can't support gl_FrontFacing.
......
...@@ -21,6 +21,23 @@ float4 PS_PassthroughRGBA2D(in float4 inPosition : SV_POSITION, in float2 inTexC ...@@ -21,6 +21,23 @@ float4 PS_PassthroughRGBA2D(in float4 inPosition : SV_POSITION, in float2 inTexC
return TextureF.Sample(Sampler, inTexCoord).rgba; return TextureF.Sample(Sampler, inTexCoord).rgba;
} }
float4 PS_PassthroughRGBAPremultiply2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
color.rgb *= color.a;
return color;
}
float4 PS_PassthroughRGBAUnmultiply2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
if (color.a > 0.0f)
{
color.rgb /= color.a;
}
return color;
}
uint4 PS_PassthroughRGBA2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 uint4 PS_PassthroughRGBA2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{ {
uint2 size; uint2 size;
...@@ -42,6 +59,23 @@ float4 PS_PassthroughRGB2D(in float4 inPosition : SV_POSITION, in float2 inTexCo ...@@ -42,6 +59,23 @@ float4 PS_PassthroughRGB2D(in float4 inPosition : SV_POSITION, in float2 inTexCo
return float4(TextureF.Sample(Sampler, inTexCoord).rgb, 1.0f); return float4(TextureF.Sample(Sampler, inTexCoord).rgb, 1.0f);
} }
float4 PS_PassthroughRGBPremultiply2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
color.rgb *= color.a;
return color;
}
float4 PS_PassthroughRGBUnmultiply2D(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
if (color.a > 0.0f)
{
color.rgb /= color.a;
}
return color;
}
uint4 PS_PassthroughRGB2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0 uint4 PS_PassthroughRGB2DUI(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{ {
uint2 size; uint2 size;
......
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_x
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mul r0.xyz, r0.w, r0
mov oC0, r0
// approximately 3 instruction slots used (1 texture, 2 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyz, r0.wwww, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 4 instruction slots used
#endif
const BYTE g_PS_PassthroughRGBAPremultiply2D[] = {
68, 88, 66, 67, 139, 254, 84, 241, 202, 33, 132, 221, 123, 19, 241, 182, 75, 155, 177,
115, 1, 0, 0, 0, 8, 3, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 180, 0,
0, 0, 88, 1, 0, 0, 212, 1, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 65,
111, 110, 57, 116, 0, 0, 0, 116, 0, 0, 0, 0, 2, 255, 255, 76, 0, 0, 0,
40, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36,
0, 0, 0, 40, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, 0, 8, 15, 160, 66,
0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0, 255, 128, 0, 0, 228, 128, 1, 0, 0, 2, 0, 8, 15,
128, 0, 0, 228, 128, 255, 255, 0, 0, 83, 72, 68, 82, 156, 0, 0, 0, 64, 0,
0, 0, 39, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88,
24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3,
50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
0, 104, 0, 0, 2, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0,
0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0,
96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 114, 32, 16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 54, 0, 0,
5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, 160, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 83, 97,
109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100,
101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48,
48, 46, 49, 54, 51, 56, 52, 0, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95,
80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171,
171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_x
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
rcp r1.w, r0.w
mul r1.xyz, r0, r1.w
cmp r0.xyz, -r0.w, r0, r1
mov oC0, r0
// approximately 5 instruction slots used (1 texture, 4 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
lt r1.x, l(0.000000), r0.w
div r1.yzw, r0.xxyz, r0.wwww
movc o0.xyz, r1.xxxx, r1.yzwy, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 6 instruction slots used
#endif
const BYTE g_PS_PassthroughRGBAUnmultiply2D[] = {
68, 88, 66, 67, 180, 87, 43, 111, 255, 135, 28, 224, 42, 85, 197, 16, 17, 172, 176,
70, 1, 0, 0, 0, 104, 3, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 212, 0,
0, 0, 184, 1, 0, 0, 52, 2, 0, 0, 220, 2, 0, 0, 52, 3, 0, 0, 65,
111, 110, 57, 148, 0, 0, 0, 148, 0, 0, 0, 0, 2, 255, 255, 108, 0, 0, 0,
40, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36,
0, 0, 0, 40, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, 0, 8, 15, 160, 66,
0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 6, 0, 0, 2,
1, 0, 8, 128, 0, 0, 255, 128, 5, 0, 0, 3, 1, 0, 7, 128, 0, 0, 228,
128, 1, 0, 255, 128, 88, 0, 0, 4, 0, 0, 7, 128, 0, 0, 255, 129, 0, 0,
228, 128, 1, 0, 228, 128, 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, 255,
255, 0, 0, 83, 72, 68, 82, 220, 0, 0, 0, 64, 0, 0, 0, 55, 0, 0, 0,
90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16,
0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 2,
0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0,
1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0,
0, 49, 0, 0, 7, 18, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, 0, 0,
0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 14, 0, 0, 7, 226, 0, 16, 0, 1,
0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 246, 15, 16, 0, 0, 0, 0, 0,
55, 0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0,
0, 150, 7, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 54, 0,
0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62,
0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, 160, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0,
4, 255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0,
0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 83,
97, 109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105, 99,
114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54,
48, 48, 46, 49, 54, 51, 56, 52, 0, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2,
0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0,
171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_x
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mul r0.xyz, r0.w, r0
mov oC0, r0
// approximately 3 instruction slots used (1 texture, 2 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 1
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
mul o0.xyz, r0.wwww, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 4 instruction slots used
#endif
const BYTE g_PS_PassthroughRGBPremultiply2D[] = {
68, 88, 66, 67, 139, 254, 84, 241, 202, 33, 132, 221, 123, 19, 241, 182, 75, 155, 177,
115, 1, 0, 0, 0, 8, 3, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 180, 0,
0, 0, 88, 1, 0, 0, 212, 1, 0, 0, 124, 2, 0, 0, 212, 2, 0, 0, 65,
111, 110, 57, 116, 0, 0, 0, 116, 0, 0, 0, 0, 2, 255, 255, 76, 0, 0, 0,
40, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36,
0, 0, 0, 40, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, 0, 8, 15, 160, 66,
0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 5, 0, 0, 3,
0, 0, 7, 128, 0, 0, 255, 128, 0, 0, 228, 128, 1, 0, 0, 2, 0, 8, 15,
128, 0, 0, 228, 128, 255, 255, 0, 0, 83, 72, 68, 82, 156, 0, 0, 0, 64, 0,
0, 0, 39, 0, 0, 0, 90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88,
24, 0, 4, 0, 112, 16, 0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3,
50, 16, 16, 0, 1, 0, 0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0,
0, 104, 0, 0, 2, 1, 0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0,
0, 0, 70, 16, 16, 0, 1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0,
96, 16, 0, 0, 0, 0, 0, 56, 0, 0, 7, 114, 32, 16, 0, 0, 0, 0, 0,
246, 15, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 54, 0, 0,
5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 4, 0, 0, 0, 1, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, 160, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0, 4,
255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0, 0,
0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 83, 97,
109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105, 99, 114,
111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97, 100,
101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54, 48,
48, 46, 49, 54, 51, 56, 52, 0, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2, 0,
0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 3,
0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86, 95,
80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0, 171,
171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0, 32,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0, 0,
15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
//
// Resource Bindings:
//
// Name Type Format Dim Slot Elements
// ------------------------------ ---------- ------- ----------- ---- --------
// Sampler sampler NA NA 0 1
// TextureF texture float4 2d 0 1
//
//
//
// Input signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_POSITION 0 xyzw 0 POS float
// TEXCOORD 0 xy 1 NONE float xy
//
//
// Output signature:
//
// Name Index Mask Register SysValue Format Used
// -------------------- ----- ------ -------- -------- ------- ------
// SV_TARGET 0 xyzw 0 TARGET float xyzw
//
//
// Sampler/Resource to DX9 shader sampler mappings:
//
// Target Sampler Source Sampler Source Resource
// -------------- --------------- ----------------
// s0 s0 t0
//
//
// Level9 shader bytecode:
//
ps_2_x
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
rcp r1.w, r0.w
mul r1.xyz, r0, r1.w
cmp r0.xyz, -r0.w, r0, r1
mov oC0, r0
// approximately 5 instruction slots used (1 texture, 4 arithmetic)
ps_4_0
dcl_sampler s0, mode_default
dcl_resource_texture2d (float,float,float,float) t0
dcl_input_ps linear v1.xy
dcl_output o0.xyzw
dcl_temps 2
sample r0.xyzw, v1.xyxx, t0.xyzw, s0
lt r1.x, l(0.000000), r0.w
div r1.yzw, r0.xxyz, r0.wwww
movc o0.xyz, r1.xxxx, r1.yzwy, r0.xyzx
mov o0.w, r0.w
ret
// Approximately 6 instruction slots used
#endif
const BYTE g_PS_PassthroughRGBUnmultiply2D[] = {
68, 88, 66, 67, 180, 87, 43, 111, 255, 135, 28, 224, 42, 85, 197, 16, 17, 172, 176,
70, 1, 0, 0, 0, 104, 3, 0, 0, 6, 0, 0, 0, 56, 0, 0, 0, 212, 0,
0, 0, 184, 1, 0, 0, 52, 2, 0, 0, 220, 2, 0, 0, 52, 3, 0, 0, 65,
111, 110, 57, 148, 0, 0, 0, 148, 0, 0, 0, 0, 2, 255, 255, 108, 0, 0, 0,
40, 0, 0, 0, 0, 0, 40, 0, 0, 0, 40, 0, 0, 0, 40, 0, 1, 0, 36,
0, 0, 0, 40, 0, 0, 0, 0, 0, 1, 2, 255, 255, 31, 0, 0, 2, 0, 0,
0, 128, 0, 0, 3, 176, 31, 0, 0, 2, 0, 0, 0, 144, 0, 8, 15, 160, 66,
0, 0, 3, 0, 0, 15, 128, 0, 0, 228, 176, 0, 8, 228, 160, 6, 0, 0, 2,
1, 0, 8, 128, 0, 0, 255, 128, 5, 0, 0, 3, 1, 0, 7, 128, 0, 0, 228,
128, 1, 0, 255, 128, 88, 0, 0, 4, 0, 0, 7, 128, 0, 0, 255, 129, 0, 0,
228, 128, 1, 0, 228, 128, 1, 0, 0, 2, 0, 8, 15, 128, 0, 0, 228, 128, 255,
255, 0, 0, 83, 72, 68, 82, 220, 0, 0, 0, 64, 0, 0, 0, 55, 0, 0, 0,
90, 0, 0, 3, 0, 96, 16, 0, 0, 0, 0, 0, 88, 24, 0, 4, 0, 112, 16,
0, 0, 0, 0, 0, 85, 85, 0, 0, 98, 16, 0, 3, 50, 16, 16, 0, 1, 0,
0, 0, 101, 0, 0, 3, 242, 32, 16, 0, 0, 0, 0, 0, 104, 0, 0, 2, 2,
0, 0, 0, 69, 0, 0, 9, 242, 0, 16, 0, 0, 0, 0, 0, 70, 16, 16, 0,
1, 0, 0, 0, 70, 126, 16, 0, 0, 0, 0, 0, 0, 96, 16, 0, 0, 0, 0,
0, 49, 0, 0, 7, 18, 0, 16, 0, 1, 0, 0, 0, 1, 64, 0, 0, 0, 0,
0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 14, 0, 0, 7, 226, 0, 16, 0, 1,
0, 0, 0, 6, 9, 16, 0, 0, 0, 0, 0, 246, 15, 16, 0, 0, 0, 0, 0,
55, 0, 0, 9, 114, 32, 16, 0, 0, 0, 0, 0, 6, 0, 16, 0, 1, 0, 0,
0, 150, 7, 16, 0, 1, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 54, 0,
0, 5, 130, 32, 16, 0, 0, 0, 0, 0, 58, 0, 16, 0, 0, 0, 0, 0, 62,
0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 6, 0, 0, 0, 2, 0, 0, 0,
0, 0, 0, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 82, 68, 69, 70, 160, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 28, 0, 0, 0, 0,
4, 255, 255, 0, 1, 0, 0, 109, 0, 0, 0, 92, 0, 0, 0, 3, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0,
0, 1, 0, 0, 0, 100, 0, 0, 0, 2, 0, 0, 0, 5, 0, 0, 0, 4, 0,
0, 0, 255, 255, 255, 255, 0, 0, 0, 0, 1, 0, 0, 0, 13, 0, 0, 0, 83,
97, 109, 112, 108, 101, 114, 0, 84, 101, 120, 116, 117, 114, 101, 70, 0, 77, 105, 99,
114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76, 32, 83, 104, 97,
100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46, 51, 46, 57, 54,
48, 48, 46, 49, 54, 51, 56, 52, 0, 171, 73, 83, 71, 78, 80, 0, 0, 0, 2,
0, 0, 0, 8, 0, 0, 0, 56, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
3, 0, 0, 0, 0, 0, 0, 0, 15, 0, 0, 0, 68, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 3, 3, 0, 0, 83, 86,
95, 80, 79, 83, 73, 84, 73, 79, 78, 0, 84, 69, 88, 67, 79, 79, 82, 68, 0,
171, 171, 171, 79, 83, 71, 78, 44, 0, 0, 0, 1, 0, 0, 0, 8, 0, 0, 0,
32, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 3, 0, 0, 0, 0, 0, 0,
0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171};
...@@ -29,6 +29,11 @@ call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2D ps_4_0_level_9_3 ...@@ -29,6 +29,11 @@ call:BuildShader Passthrough2D11.hlsl PS_PassthroughR2D ps_4_0_level_9_3
call:BuildShader Passthrough2D11.hlsl PS_PassthroughLum2D ps_4_0_level_9_3 compiled\passthroughlum2d11ps.h %debug% call:BuildShader Passthrough2D11.hlsl PS_PassthroughLum2D ps_4_0_level_9_3 compiled\passthroughlum2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughLumAlpha2D ps_4_0_level_9_3 compiled\passthroughlumalpha2d11ps.h %debug% call:BuildShader Passthrough2D11.hlsl PS_PassthroughLumAlpha2D ps_4_0_level_9_3 compiled\passthroughlumalpha2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBAPremultiply2D ps_4_0_level_9_3 compiled\passthroughrgbapremultiply2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBAUnmultiply2D ps_4_0_level_9_3 compiled\passthroughrgbaunmultiply2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBPremultiply2D ps_4_0_level_9_3 compiled\passthroughrgbpremultiply2d11ps.h %debug%
call:BuildShader Passthrough2D11.hlsl PS_PassthroughRGBUnmultiply2D ps_4_0_level_9_3 compiled\passthroughrgbunmultiply2d11ps.h %debug%
call:BuildShader Clear11.hlsl VS_ClearFloat vs_4_0_level_9_3 compiled\clearfloat11vs.h %debug% call:BuildShader Clear11.hlsl VS_ClearFloat vs_4_0_level_9_3 compiled\clearfloat11vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug% call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0 compiled\clearfloat11ps.h %debug% call:BuildShader Clear11.hlsl PS_ClearFloat ps_4_0 compiled\clearfloat11ps.h %debug%
......
...@@ -2339,6 +2339,21 @@ gl::Error Renderer9::copyImage2DArray(const gl::Framebuffer *framebuffer, const ...@@ -2339,6 +2339,21 @@ gl::Error Renderer9::copyImage2DArray(const gl::Framebuffer *framebuffer, const
return gl::Error(GL_INVALID_OPERATION); return gl::Error(GL_INVALID_OPERATION);
} }
gl::Error Renderer9::copyTexture(const gl::Texture *source,
GLint sourceLevel,
const gl::Rectangle &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{
UNIMPLEMENTED();
return gl::Error(GL_INVALID_OPERATION);
}
gl::Error Renderer9::createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT) gl::Error Renderer9::createRenderTarget(int width, int height, GLenum format, GLsizei samples, RenderTargetD3D **outRT)
{ {
const d3d9::TextureFormat &d3d9FormatInfo = d3d9::GetTextureFormatInfo(format); const d3d9::TextureFormat &d3d9FormatInfo = d3d9::GetTextureFormatInfo(format);
......
...@@ -198,6 +198,17 @@ class Renderer9 : public RendererD3D ...@@ -198,6 +198,17 @@ class Renderer9 : public RendererD3D
TextureStorage *storage, TextureStorage *storage,
GLint level) override; GLint level) override;
gl::Error copyTexture(const gl::Texture *source,
GLint sourceLevel,
const gl::Rectangle &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha) override;
// RenderTarget creation // RenderTarget creation
gl::Error createRenderTarget(int width, gl::Error createRenderTarget(int width,
int height, int height,
......
...@@ -205,6 +205,84 @@ bool ValidateInstancedPathParameters(gl::Context *context, ...@@ -205,6 +205,84 @@ bool ValidateInstancedPathParameters(gl::Context *context,
return true; return true;
} }
bool IsValidCopyTextureFormat(Context *context, GLenum internalFormat)
{
const InternalFormat &internalFormatInfo = GetInternalFormatInfo(internalFormat);
switch (internalFormatInfo.format)
{
case GL_ALPHA:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
case GL_RGB:
case GL_RGBA:
return true;
case GL_RED:
return context->getClientMajorVersion() >= 3 || context->getExtensions().textureRG;
case GL_BGRA_EXT:
return context->getExtensions().textureFormatBGRA8888;
default:
return false;
}
}
bool IsValidCopyTextureDestinationFormatType(Context *context, GLint internalFormat, GLenum type)
{
switch (internalFormat)
{
case GL_RGB:
case GL_RGBA:
break;
case GL_BGRA_EXT:
return context->getExtensions().textureFormatBGRA8888;
default:
return false;
}
switch (type)
{
case GL_UNSIGNED_BYTE:
break;
default:
return false;
}
return true;
}
bool IsValidCopyTextureDestinationTarget(Context *context, GLenum target)
{
switch (target)
{
case GL_TEXTURE_2D:
return true;
// TODO(geofflang): accept GL_TEXTURE_RECTANGLE_ARB if the texture_rectangle extension is
// supported
default:
return false;
}
}
bool IsValidCopyTextureSourceTarget(Context *context, GLenum target)
{
if (IsValidCopyTextureDestinationTarget(context, target))
{
return true;
}
// TODO(geofflang): accept GL_TEXTURE_EXTERNAL_OES if the texture_external extension is
// supported
return false;
}
} // anonymous namespace } // anonymous namespace
bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage, bool ValidateES2TexImageParameters(Context *context, GLenum target, GLint level, GLenum internalformat, bool isCompressed, bool isSubImage,
...@@ -3033,4 +3111,202 @@ bool ValidateProgramPathFragmentInputGen(Context *context, ...@@ -3033,4 +3111,202 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
return true; return true;
} }
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
if (!context->getExtensions().copyTexture)
{
context->handleError(
Error(GL_INVALID_OPERATION, "GL_CHROMIUM_copy_texture extension not available."));
return false;
}
const gl::Texture *source = context->getTexture(sourceId);
if (source == nullptr)
{
context->handleError(
Error(GL_INVALID_VALUE, "Source texture is not a valid texture object."));
return false;
}
if (!IsValidCopyTextureSourceTarget(context, source->getTarget()))
{
context->handleError(Error(GL_INVALID_VALUE, "Source texture a valid texture type."));
return false;
}
GLenum sourceTarget = source->getTarget();
ASSERT(sourceTarget != GL_TEXTURE_CUBE_MAP);
if (source->getWidth(sourceTarget, 0) == 0 || source->getHeight(sourceTarget, 0) == 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the source texture must be defined."));
return false;
}
const gl::Format &sourceFormat = source->getFormat(sourceTarget, 0);
if (!IsValidCopyTextureFormat(context, sourceFormat.format))
{
context->handleError(
Error(GL_INVALID_OPERATION, "Source texture internal format is invalid."));
return false;
}
const gl::Texture *dest = context->getTexture(destId);
if (dest == nullptr)
{
context->handleError(
Error(GL_INVALID_VALUE, "Destination texture is not a valid texture object."));
return false;
}
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget()))
{
context->handleError(Error(GL_INVALID_VALUE, "Destination texture a valid texture type."));
return false;
}
if (!IsValidCopyTextureDestinationFormatType(context, internalFormat, destType))
{
context->handleError(
Error(GL_INVALID_OPERATION,
"Destination internal format and type combination is not valid."));
return false;
}
if (dest->getImmutableFormat())
{
context->handleError(Error(GL_INVALID_OPERATION, "Destination texture is immutable."));
return false;
}
return true;
}
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
if (!context->getExtensions().copyTexture)
{
context->handleError(
Error(GL_INVALID_OPERATION, "GL_CHROMIUM_copy_texture extension not available."));
return false;
}
const gl::Texture *source = context->getTexture(sourceId);
if (source == nullptr)
{
context->handleError(
Error(GL_INVALID_VALUE, "Source texture is not a valid texture object."));
return false;
}
if (!IsValidCopyTextureSourceTarget(context, source->getTarget()))
{
context->handleError(Error(GL_INVALID_VALUE, "Source texture a valid texture type."));
return false;
}
GLenum sourceTarget = source->getTarget();
ASSERT(sourceTarget != GL_TEXTURE_CUBE_MAP);
if (source->getWidth(sourceTarget, 0) == 0 || source->getHeight(sourceTarget, 0) == 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the source texture must be defined."));
return false;
}
if (x < 0 || y < 0)
{
context->handleError(Error(GL_INVALID_VALUE, "x and y cannot be negative."));
return false;
}
if (width < 0 || height < 0)
{
context->handleError(Error(GL_INVALID_VALUE, "width and height cannot be negative."));
return false;
}
if (static_cast<size_t>(x + width) > source->getWidth(sourceTarget, 0) ||
static_cast<size_t>(y + height) > source->getHeight(sourceTarget, 0))
{
context->handleError(
Error(GL_INVALID_VALUE, "Source texture not large enough to copy from."));
return false;
}
const gl::Format &sourceFormat = source->getFormat(sourceTarget, 0);
if (!IsValidCopyTextureFormat(context, sourceFormat.format))
{
context->handleError(
Error(GL_INVALID_OPERATION, "Source texture internal format is invalid."));
return false;
}
const gl::Texture *dest = context->getTexture(destId);
if (dest == nullptr)
{
context->handleError(
Error(GL_INVALID_VALUE, "Destination texture is not a valid texture object."));
return false;
}
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget()))
{
context->handleError(Error(GL_INVALID_VALUE, "Destination texture a valid texture type."));
return false;
}
GLenum destTarget = dest->getTarget();
ASSERT(destTarget != GL_TEXTURE_CUBE_MAP);
if (dest->getWidth(sourceTarget, 0) == 0 || dest->getHeight(sourceTarget, 0) == 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the destination texture must be defined."));
return false;
}
const gl::Format &destFormat = dest->getFormat(destTarget, 0);
if (!IsValidCopyTextureDestinationFormatType(context, destFormat.format, destFormat.type))
{
context->handleError(
Error(GL_INVALID_OPERATION,
"Destination internal format and type combination is not valid."));
return false;
}
if (xoffset < 0 || yoffset < 0)
{
context->handleError(Error(GL_INVALID_VALUE, "xoffset and yoffset cannot be negative."));
return false;
}
if (static_cast<size_t>(xoffset + width) > dest->getWidth(destTarget, 0) ||
static_cast<size_t>(yoffset + height) > dest->getHeight(destTarget, 0))
{
context->handleError(
Error(GL_INVALID_VALUE, "Destination texture not large enough to copy to."));
return false;
}
return true;
}
} // namespace gl } // namespace gl
...@@ -284,6 +284,27 @@ bool ValidateProgramPathFragmentInputGen(Context *context, ...@@ -284,6 +284,27 @@ bool ValidateProgramPathFragmentInputGen(Context *context,
GLint components, GLint components,
const GLfloat *coeffs); const GLfloat *coeffs);
bool ValidateCopyTextureCHROMIUM(Context *context,
GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
bool ValidateCopySubTextureCHROMIUM(Context *context,
GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
} // namespace gl } // namespace gl
#endif // LIBANGLE_VALIDATION_ES2_H_ #endif // LIBANGLE_VALIDATION_ES2_H_
...@@ -183,6 +183,7 @@ ...@@ -183,6 +183,7 @@
'libANGLE/renderer/StreamProducerImpl.h', 'libANGLE/renderer/StreamProducerImpl.h',
'libANGLE/renderer/SurfaceImpl.cpp', 'libANGLE/renderer/SurfaceImpl.cpp',
'libANGLE/renderer/SurfaceImpl.h', 'libANGLE/renderer/SurfaceImpl.h',
'libANGLE/renderer/TextureImpl.cpp',
'libANGLE/renderer/TextureImpl.h', 'libANGLE/renderer/TextureImpl.h',
'libANGLE/renderer/TransformFeedbackImpl.h', 'libANGLE/renderer/TransformFeedbackImpl.h',
'libANGLE/renderer/VertexArrayImpl.h', 'libANGLE/renderer/VertexArrayImpl.h',
...@@ -383,12 +384,16 @@ ...@@ -383,12 +384,16 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3di11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3dui11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2d11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbpremultiply2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbunmultiply2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2di11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2dui11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb2dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3d11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3di11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3dui11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2d11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbapremultiply2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbaunmultiply2d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2di11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2dui11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3d11ps.h', 'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3d11ps.h',
......
...@@ -1468,6 +1468,10 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char * ...@@ -1468,6 +1468,10 @@ __eglMustCastToProperFunctionPointerType EGLAPIENTRY GetProcAddress(const char *
// GL_CHROMIUM_bind_uniform_location // GL_CHROMIUM_bind_uniform_location
INSERT_PROC_ADDRESS(gl, BindUniformLocationCHROMIUM); INSERT_PROC_ADDRESS(gl, BindUniformLocationCHROMIUM);
// GL_CHROMIUM_copy_texture
INSERT_PROC_ADDRESS(gl, CopyTextureCHROMIUM);
INSERT_PROC_ADDRESS(gl, CopySubTextureCHROMIUM);
// GLES3 core // GLES3 core
INSERT_PROC_ADDRESS(gl, ReadBuffer); INSERT_PROC_ADDRESS(gl, ReadBuffer);
INSERT_PROC_ADDRESS(gl, DrawRangeElements); INSERT_PROC_ADDRESS(gl, DrawRangeElements);
......
...@@ -1869,4 +1869,70 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program ...@@ -1869,4 +1869,70 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
} }
} }
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
"(GLuint sourceId = %u, GLuint destId = %u, GLint internalFormat = 0x%X, GLenum destType = "
"0x%X, GLboolean unpackFlipY = %u, GLboolean unpackPremultiplyAlpha = %u, GLboolean "
"unpackUnmultiplyAlpha = %u)",
sourceId, destId, internalFormat, destType, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCopyTextureCHROMIUM(context, sourceId, destId, internalFormat, destType,
unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha))
{
return;
}
context->copyTextureCHROMIUM(sourceId, destId, internalFormat, destType, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
}
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha)
{
EVENT(
"(GLuint sourceId = %u, GLuint destId = %u, , GLboolean unpackFlipY = %u, GLint xoffset = "
"%d, GLint yoffset = %d, GLint x = %d, GLint y = %d, GLsizei width = %d, GLsizei height = "
"%d, GLboolean unpackPremultiplyAlpha = %u, GLboolean unpackUnmultiplyAlpha = %u)",
sourceId, destId, xoffset, yoffset, x, y, width, height, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
Context *context = GetValidGlobalContext();
if (context)
{
if (!context->skipValidation() &&
!ValidateCopySubTextureCHROMIUM(context, sourceId, destId, xoffset, yoffset, x, y,
width, height, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha))
{
return;
}
context->copySubTextureCHROMIUM(sourceId, destId, xoffset, yoffset, x, y, width, height,
unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha);
}
}
} // gl } // gl
...@@ -238,6 +238,27 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program ...@@ -238,6 +238,27 @@ ANGLE_EXPORT void GL_APIENTRY ProgramPathFragmentInputGenCHROMIUM(GLuint program
GLint components, GLint components,
const GLfloat *coeffs); const GLfloat *coeffs);
// GL_CHROMIUM_copy_texture
ANGLE_EXPORT void GL_APIENTRY CopyTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint internalFormat,
GLenum destType,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
ANGLE_EXPORT void GL_APIENTRY CopySubTextureCHROMIUM(GLuint sourceId,
GLuint destId,
GLint xoffset,
GLint yoffset,
GLint x,
GLint y,
GLsizei width,
GLsizei height,
GLboolean unpackFlipY,
GLboolean unpackPremultiplyAlpha,
GLboolean unpackUnmultiplyAlpha);
} // namespace gl } // namespace gl
#endif // LIBGLESV2_ENTRYPOINTGLES20EXT_H_ #endif // LIBGLESV2_ENTRYPOINTGLES20EXT_H_
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
'<(angle_path)/src/tests/gl_tests/ClearTest.cpp', '<(angle_path)/src/tests/gl_tests/ClearTest.cpp',
'<(angle_path)/src/tests/gl_tests/ColorMaskTest.cpp', '<(angle_path)/src/tests/gl_tests/ColorMaskTest.cpp',
'<(angle_path)/src/tests/gl_tests/CopyTexImageTest.cpp', '<(angle_path)/src/tests/gl_tests/CopyTexImageTest.cpp',
'<(angle_path)/src/tests/gl_tests/CopyTextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/CubeMapTextureTest.cpp', '<(angle_path)/src/tests/gl_tests/CubeMapTextureTest.cpp',
'<(angle_path)/src/tests/gl_tests/DebugMarkerTest.cpp', '<(angle_path)/src/tests/gl_tests/DebugMarkerTest.cpp',
'<(angle_path)/src/tests/gl_tests/DebugTest.cpp', '<(angle_path)/src/tests/gl_tests/DebugTest.cpp',
......
...@@ -21,13 +21,14 @@ const GLColorRGB GLColorRGB::green(0u, 255u, 0u); ...@@ -21,13 +21,14 @@ const GLColorRGB GLColorRGB::green(0u, 255u, 0u);
const GLColorRGB GLColorRGB::red(255u, 0u, 0u); const GLColorRGB GLColorRGB::red(255u, 0u, 0u);
const GLColorRGB GLColorRGB::yellow(255u, 255u, 0); const GLColorRGB GLColorRGB::yellow(255u, 255u, 0);
const GLColor GLColor::black = GLColor(0u, 0u, 0u, 255u); const GLColor GLColor::black = GLColor(0u, 0u, 0u, 255u);
const GLColor GLColor::blue = GLColor(0u, 0u, 255u, 255u); const GLColor GLColor::blue = GLColor(0u, 0u, 255u, 255u);
const GLColor GLColor::cyan = GLColor(0u, 255u, 255u, 255u); const GLColor GLColor::cyan = GLColor(0u, 255u, 255u, 255u);
const GLColor GLColor::green = GLColor(0u, 255u, 0u, 255u); const GLColor GLColor::green = GLColor(0u, 255u, 0u, 255u);
const GLColor GLColor::red = GLColor(255u, 0u, 0u, 255u); const GLColor GLColor::red = GLColor(255u, 0u, 0u, 255u);
const GLColor GLColor::yellow = GLColor(255u, 255u, 0, 255u); const GLColor GLColor::transparentBlack = GLColor(0u, 0u, 0u, 0u);
const GLColor GLColor::white = GLColor(255u, 255u, 255u, 255u); const GLColor GLColor::white = GLColor(255u, 255u, 255u, 255u);
const GLColor GLColor::yellow = GLColor(255u, 255u, 0, 255u);
const GLColor16 GLColor16::white = GLColor16(65535u, 65535u, 65535u, 65535u); const GLColor16 GLColor16::white = GLColor16(65535u, 65535u, 65535u, 65535u);
......
...@@ -78,6 +78,7 @@ struct GLColor ...@@ -78,6 +78,7 @@ struct GLColor
static const GLColor cyan; static const GLColor cyan;
static const GLColor green; static const GLColor green;
static const GLColor red; static const GLColor red;
static const GLColor transparentBlack;
static const GLColor white; static const GLColor white;
static const GLColor yellow; static const GLColor yellow;
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment