Implement the new formats/features of the ES3 CHROMIUM_copy_texture.

Some non-renderable texture formats remain unimplemented.

BUG=angleproject:1932

Change-Id: Id206432d6e26a70fc0e84478a4e43e9eefadcf2f
Reviewed-on: https://chromium-review.googlesource.com/491948
Commit-Queue: Geoff Lang <geofflang@chromium.org>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
This commit is contained in:
Geoff Lang 2017-05-01 16:04:35 -04:00 коммит произвёл Commit Bot
Родитель caafd890bf
Коммит 4f0e003e57
36 изменённых файлов: 1940 добавлений и 680 удалений

Просмотреть файл

@ -183,7 +183,7 @@ Additions to the OpenGL ES 2.0 Specification
RGB8
RGBA8
BGRA_EXT
BGRA8_EXT,
BGRA8_EXT
SRGB_EXT
SRGB_ALPHA_EXT
R8
@ -196,7 +196,6 @@ Additions to the OpenGL ES 2.0 Specification
SRGB8_ALPHA8
RGB5_A1
RGBA4
RGBA4
RGBA8UI
RGB9_E5
R16F
@ -225,7 +224,7 @@ Additions to the OpenGL ES 2.0 Specification
BGRA_EXT
BGRA8_EXT
RGB_YCBCR_420V_CHROMIUM
RGB_YCBCR_422_CHROMIUM.
RGB_YCBCR_422_CHROMIUM
Dependencies on ARB_texture_rg

Просмотреть файл

@ -617,6 +617,21 @@ bool IsTriangleMode(GLenum drawMode)
return false;
}
bool IsIntegerFormat(GLenum unsizedFormat)
{
switch (unsizedFormat)
{
case GL_RGBA_INTEGER:
case GL_RGB_INTEGER:
case GL_RG_INTEGER:
case GL_RED_INTEGER:
return true;
default:
return false;
}
}
// [OpenGL ES SL 3.00.4] Section 11 p. 120
// Vertex Outs/Fragment Ins packing priorities
int VariableSortOrder(GLenum type)

Просмотреть файл

@ -64,6 +64,7 @@ IndexRange ComputeIndexRange(GLenum indexType,
GLuint GetPrimitiveRestartIndex(GLenum indexType);
bool IsTriangleMode(GLenum drawMode);
bool IsIntegerFormat(GLenum unsizedFormat);
// [OpenGL ES 3.0.2] Section 2.3.1 page 14
// Data Conversion For State-Setting Commands

Просмотреть файл

@ -1053,18 +1053,24 @@ gl::Error TextureD3D_2D::copyTexture(ContextImpl *contextImpl,
static_cast<int>(source->getHeight(sourceTarget, sourceLevel)), 1);
redefineImage(destLevel, internalFormatInfo.sizedInternalFormat, size, false);
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
if (canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)))
{
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(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, static_cast<GLint>(sourceLevel), sourceRect,
internalFormatInfo.format, destOffset, mTexStorage, target,
destLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha));
gl::Rectangle sourceRect(0, 0, size.width, size.height);
gl::Offset destOffset(0, 0, 0);
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceRect,
internalFormatInfo.format, destOffset, mTexStorage, target,
destLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha));
}
else
{
ASSERT(internalFormat == GL_RGB9_E5);
UNIMPLEMENTED();
}
return gl::NoError();
}
@ -1084,16 +1090,22 @@ gl::Error TextureD3D_2D::copySubTexture(ContextImpl *contextImpl,
GLint destLevel = static_cast<GLint>(level);
ASSERT(canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)));
if (canCreateRenderTargetForImage(gl::ImageIndex::Make2D(destLevel)))
{
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidLevel(destLevel));
ANGLE_TRY(updateStorageLevel(destLevel));
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceArea,
gl::GetUnsizedFormat(getBaseLevelInternalFormat()), destOffset,
mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceArea,
gl::GetUnsizedFormat(getInternalFormat(destLevel)),
destOffset, mTexStorage, target, destLevel, unpackFlipY,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
}
else
{
ASSERT(getInternalFormat(destLevel) == GL_RGB9_E5);
UNIMPLEMENTED();
}
return gl::NoError();
}
@ -1712,6 +1724,87 @@ gl::Error TextureD3D_Cube::copySubImage(ContextImpl *contextImpl,
return gl::NoError();
}
gl::Error TextureD3D_Cube::copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
ASSERT(gl::IsCubeMapTextureTarget(target));
GLenum sourceTarget = source->getTarget();
GLint destLevel = static_cast<GLint>(level);
int faceIndex = static_cast<int>(gl::CubeMapTextureTargetToLayerIndex(target));
const gl::InternalFormat &internalFormatInfo = gl::GetInternalFormatInfo(internalFormat, type);
gl::Extents size(static_cast<int>(source->getWidth(sourceTarget, sourceLevel)),
static_cast<int>(source->getHeight(sourceTarget, sourceLevel)), 1);
redefineImage(faceIndex, destLevel, internalFormatInfo.sizedInternalFormat, size);
if (canCreateRenderTargetForImage(gl::ImageIndex::MakeCube(target, destLevel)))
{
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidFaceLevel(faceIndex, destLevel));
ANGLE_TRY(updateStorageFaceLevel(faceIndex, destLevel));
gl::Rectangle sourceRect(0, 0, size.width, size.height);
gl::Offset destOffset(0, 0, 0);
ANGLE_TRY(mRenderer->copyTexture(source, static_cast<GLint>(sourceLevel), sourceRect,
internalFormatInfo.format, destOffset, mTexStorage, target,
destLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha));
}
else
{
ASSERT(internalFormat == GL_RGB9_E5);
UNIMPLEMENTED();
}
return gl::NoError();
}
gl::Error TextureD3D_Cube::copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source)
{
ASSERT(gl::IsCubeMapTextureTarget(target));
GLint destLevel = static_cast<GLint>(level);
int faceIndex = static_cast<int>(gl::CubeMapTextureTargetToLayerIndex(target));
if (canCreateRenderTargetForImage(gl::ImageIndex::MakeCube(target, destLevel)))
{
ANGLE_TRY(ensureRenderTarget());
ASSERT(isValidFaceLevel(faceIndex, destLevel));
ANGLE_TRY(updateStorageFaceLevel(faceIndex, destLevel));
ANGLE_TRY(mRenderer->copyTexture(
source, static_cast<GLint>(sourceLevel), sourceArea,
gl::GetUnsizedFormat(getInternalFormat(destLevel, faceIndex)), destOffset, mTexStorage,
target, destLevel, unpackFlipY, unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
}
else
{
ASSERT(getInternalFormat(destLevel, faceIndex) == GL_RGB9_E5);
UNIMPLEMENTED();
}
return gl::NoError();
}
gl::Error TextureD3D_Cube::setStorage(ContextImpl *contextImpl,
GLenum target,
size_t levels,

Просмотреть файл

@ -337,6 +337,27 @@ class TextureD3D_Cube : public TextureD3D
const gl::Rectangle &sourceArea,
const gl::Framebuffer *source) override;
gl::Error copyTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
GLenum internalFormat,
GLenum type,
size_t sourceLevel,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error copySubTexture(ContextImpl *contextImpl,
GLenum target,
size_t level,
const gl::Offset &destOffset,
size_t sourceLevel,
const gl::Rectangle &sourceArea,
bool unpackFlipY,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
const gl::Texture *source) override;
gl::Error setStorage(ContextImpl *contextImpl,
GLenum target,
size_t levels,

Просмотреть файл

@ -10,11 +10,12 @@
#include <float.h>
#include "common/utilities.h"
#include "libANGLE/formatutils.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/RenderTarget11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/Renderer11.h"
#include "libANGLE/renderer/d3d/d3d11/formatutils11.h"
#include "libANGLE/renderer/d3d/d3d11/renderer11_utils.h"
#include "libANGLE/renderer/d3d/d3d11/texture_format_table.h"
#include "third_party/trace_event/trace_event.h"
@ -41,10 +42,17 @@ namespace
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2di11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba2dui11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbapremultiply2d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbaunmultiply2d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbpremultiply2d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgbunmultiply2d11ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgb_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgba_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_rgb_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_rgba_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pm_rgb_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pm_rgba_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pt_rgb_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pt_rgba_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_um_rgb_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_um_rgba_ps.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h"
#include "libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11vs.h"
@ -758,6 +766,7 @@ gl::Error Blit11::initResources()
// static
Blit11::BlitShaderType Blit11::GetBlitShaderType(GLenum destinationFormat,
GLenum sourceFormat,
bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
@ -839,19 +848,49 @@ Blit11::BlitShaderType Blit11::GetBlitShaderType(GLenum destinationFormat,
}
else
{
if (unpackPremultiplyAlpha != unpackUnmultiplyAlpha)
bool floatToIntBlit =
!gl::IsIntegerFormat(sourceFormat) && gl::IsIntegerFormat(destinationFormat);
if (unpackPremultiplyAlpha != unpackUnmultiplyAlpha || floatToIntBlit)
{
switch (destinationFormat)
{
case GL_RGBA:
case GL_BGRA_EXT:
ASSERT(!floatToIntBlit);
return unpackPremultiplyAlpha ? BLITSHADER_2D_RGBAF_PREMULTIPLY
: BLITSHADER_2D_RGBAF_UNMULTIPLY;
case GL_BGRA_EXT:
return unpackPremultiplyAlpha ? BLITSHADER_2D_BGRAF_PREMULTIPLY
: BLITSHADER_2D_BGRAF_UNMULTIPLY;
case GL_RGB:
case GL_RG:
case GL_RED:
ASSERT(!floatToIntBlit);
return unpackPremultiplyAlpha ? BLITSHADER_2D_RGBF_PREMULTIPLY
: BLITSHADER_2D_RGBF_UNMULTIPLY;
case GL_RGBA_INTEGER:
if (unpackPremultiplyAlpha == unpackUnmultiplyAlpha)
{
return BLITSHADER_2D_RGBAF_TOUI;
}
else
{
return unpackPremultiplyAlpha ? BLITSHADER_2D_RGBAF_TOUI_PREMULTIPLY
: BLITSHADER_2D_RGBAF_TOUI_UNMULTIPLY;
}
case GL_RGB_INTEGER:
case GL_RG_INTEGER:
case GL_RED_INTEGER:
if (unpackPremultiplyAlpha == unpackUnmultiplyAlpha)
{
return BLITSHADER_2D_RGBF_TOUI;
}
else
{
return unpackPremultiplyAlpha ? BLITSHADER_2D_RGBF_TOUI_PREMULTIPLY
: BLITSHADER_2D_RGBF_TOUI_UNMULTIPLY;
}
default:
UNREACHABLE();
return BLITSHADER_INVALID;
@ -1132,6 +1171,7 @@ gl::Error Blit11::swizzleTexture(const d3d11::SharedSRV &source,
gl::Error Blit11::copyTexture(const d3d11::SharedSRV &source,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
GLenum sourceFormat,
const d3d11::RenderTargetView &dest,
const gl::Box &destArea,
const gl::Extents &destSize,
@ -1162,8 +1202,8 @@ gl::Error Blit11::copyTexture(const d3d11::SharedSRV &source,
(sourceSRVDesc.ViewDimension == D3D11_SRV_DIMENSION_TEXTURE3D) ? SHADER_3D : SHADER_2D;
const Shader *shader = nullptr;
ANGLE_TRY(getBlitShader(destFormat, isSigned, unpackPremultiplyAlpha, unpackUnmultiplyAlpha,
dimension, &shader));
ANGLE_TRY(getBlitShader(destFormat, sourceFormat, isSigned, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, dimension, &shader));
const ShaderSupport &support = getShaderSupport(*shader);
@ -1642,14 +1682,16 @@ void Blit11::clearShaderMap()
}
gl::Error Blit11::getBlitShader(GLenum destFormat,
GLenum sourceFormat,
bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
ShaderDimension dimension,
const Shader **shader)
{
BlitShaderType blitShaderType = GetBlitShaderType(destFormat, isSigned, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, dimension);
BlitShaderType blitShaderType =
GetBlitShaderType(destFormat, sourceFormat, isSigned, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha, dimension);
if (blitShaderType == BLITSHADER_INVALID)
{
@ -1674,46 +1716,16 @@ gl::Error Blit11::getBlitShader(GLenum destFormat,
blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBA2D, "Blit11 2D RGBA pixel shader"));
break;
case BLITSHADER_2D_RGBAF_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBAPremultiply2D,
"Blit11 2D RGBA premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBAF_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBAUnmultiply2D,
"Blit11 2D RGBA unmultiply pixel shader"));
break;
case BLITSHADER_2D_BGRAF:
addBlitShaderToMap(
blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBA2D, "Blit11 2D BGRA pixel shader"));
break;
case BLITSHADER_2D_BGRAF_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBAPremultiply2D,
"Blit11 2D BGRA premultiply pixel shader"));
break;
case BLITSHADER_2D_BGRAF_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBAUnmultiply2D,
"Blit11 2D BGRA unmultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF:
addBlitShaderToMap(
blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGB2D, "Blit11 2D RGB pixel shader"));
break;
case BLITSHADER_2D_RGBF_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBPremultiply2D,
"Blit11 2D RGB premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_PassthroughRGBUnmultiply2D,
"Blit11 2D RGB unmultiply pixel shader"));
break;
case BLITSHADER_2D_RGF:
addBlitShaderToMap(
blitShaderType, SHADER_2D,
@ -1859,6 +1871,67 @@ gl::Error Blit11::getBlitShader(GLenum destFormat,
d3d11::CompilePS(device, g_PS_PassthroughLumAlpha3D,
"Blit11 3D luminance alpha pixel shader"));
break;
case BLITSHADER_2D_RGBAF_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoF_PM_RGBA,
"Blit11 2D RGBA premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBAF_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoF_UM_RGBA,
"Blit11 2D RGBA unmultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoF_PM_RGB,
"Blit11 2D RGB premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoF_UM_RGB,
"Blit11 2D RGB unmultiply pixel shader"));
break;
case BLITSHADER_2D_RGBAF_TOUI:
addBlitShaderToMap(
blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_PT_RGBA, "Blit11 2D RGBA to uint pixel shader"));
break;
case BLITSHADER_2D_RGBAF_TOUI_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_PM_RGBA,
"Blit11 2D RGBA to uint premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBAF_TOUI_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_UM_RGBA,
"Blit11 2D RGBA to uint unmultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF_TOUI:
addBlitShaderToMap(
blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_PT_RGB, "Blit11 2D RGB to uint pixel shader"));
break;
case BLITSHADER_2D_RGBF_TOUI_PREMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_PM_RGB,
"Blit11 2D RGB to uint premultiply pixel shader"));
break;
case BLITSHADER_2D_RGBF_TOUI_UNMULTIPLY:
addBlitShaderToMap(blitShaderType, SHADER_2D,
d3d11::CompilePS(device, g_PS_FtoU_UM_RGB,
"Blit11 2D RGB to uint unmultiply pixel shader"));
break;
default:
UNREACHABLE();
return gl::InternalError() << "Internal error";

Просмотреть файл

@ -35,6 +35,7 @@ class Blit11 : angle::NonCopyable
gl::Error copyTexture(const d3d11::SharedSRV &source,
const gl::Box &sourceArea,
const gl::Extents &sourceSize,
GLenum sourceFormat,
const d3d11::RenderTargetView &dest,
const gl::Box &destArea,
const gl::Extents &destSize,
@ -95,15 +96,11 @@ class Blit11 : angle::NonCopyable
enum BlitShaderType
{
BLITSHADER_INVALID,
// Passthrough shaders
BLITSHADER_2D_RGBAF,
BLITSHADER_2D_RGBAF_PREMULTIPLY,
BLITSHADER_2D_RGBAF_UNMULTIPLY,
BLITSHADER_2D_BGRAF,
BLITSHADER_2D_BGRAF_PREMULTIPLY,
BLITSHADER_2D_BGRAF_UNMULTIPLY,
BLITSHADER_2D_RGBF,
BLITSHADER_2D_RGBF_PREMULTIPLY,
BLITSHADER_2D_RGBF_UNMULTIPLY,
BLITSHADER_2D_RGF,
BLITSHADER_2D_RF,
BLITSHADER_2D_ALPHA,
@ -133,6 +130,21 @@ class Blit11 : angle::NonCopyable
BLITSHADER_3D_ALPHA,
BLITSHADER_3D_LUMA,
BLITSHADER_3D_LUMAALPHA,
// Multiply alpha shaders
BLITSHADER_2D_RGBAF_PREMULTIPLY,
BLITSHADER_2D_RGBAF_UNMULTIPLY,
BLITSHADER_2D_RGBF_PREMULTIPLY,
BLITSHADER_2D_RGBF_UNMULTIPLY,
BLITSHADER_2D_RGBAF_TOUI,
BLITSHADER_2D_RGBAF_TOUI_PREMULTIPLY,
BLITSHADER_2D_RGBAF_TOUI_UNMULTIPLY,
BLITSHADER_2D_RGBF_TOUI,
BLITSHADER_2D_RGBF_TOUI_PREMULTIPLY,
BLITSHADER_2D_RGBF_TOUI_UNMULTIPLY,
};
enum SwizzleShaderType
@ -186,6 +198,7 @@ class Blit11 : angle::NonCopyable
ShaderSupport getShaderSupport(const Shader &shader);
static BlitShaderType GetBlitShaderType(GLenum destinationFormat,
GLenum sourceFormat,
bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,
@ -239,6 +252,7 @@ class Blit11 : angle::NonCopyable
ID3D11PixelShader *ps);
gl::Error getBlitShader(GLenum destFormat,
GLenum sourceFormat,
bool isSigned,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha,

Просмотреть файл

@ -3280,9 +3280,10 @@ gl::Error Renderer11::copyImageInternal(const gl::Framebuffer *framebuffer,
// Use nearest filtering because source and destination are the same size for the direct copy.
// Convert to the unsized format before calling copyTexture.
ANGLE_TRY(mBlit->copyTexture(source, sourceArea, sourceSize, dest, destArea, destSize, nullptr,
gl::GetUnsizedFormat(destFormat), GL_NEAREST, false, false,
false));
GLenum sourceFormat = colorAttachment->getFormat().info->format;
ANGLE_TRY(mBlit->copyTexture(source, sourceArea, sourceSize, sourceFormat, dest, destArea,
destSize, nullptr, gl::GetUnsizedFormat(destFormat), GL_NEAREST,
false, false, false));
return gl::NoError();
}
@ -3392,15 +3393,15 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
TextureStorage *sourceStorage = nullptr;
ANGLE_TRY(const_cast<TextureD3D *>(sourceD3D)->getNativeTexture(&sourceStorage));
ASSERT(destTarget == GL_TEXTURE_2D);
TextureStorage11_2D *sourceStorage11 = GetAs<TextureStorage11_2D>(sourceStorage);
ASSERT(sourceStorage11);
TextureStorage11_2D *destStorage11 = GetAs<TextureStorage11_2D>(storage);
TextureStorage11 *destStorage11 = GetAs<TextureStorage11>(storage);
ASSERT(destStorage11);
// Check for fast path where a CopySubresourceRegion can be used.
if (unpackPremultiplyAlpha == unpackUnmultiplyAlpha && !unpackFlipY &&
source->getFormat(GL_TEXTURE_2D, sourceLevel).info->format == destFormat &&
sourceStorage11->getFormatSet().texFormat == destStorage11->getFormatSet().texFormat)
{
ID3D11Resource *sourceResource = nullptr;
@ -3412,7 +3413,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
ID3D11Resource *destResource = nullptr;
ANGLE_TRY(destStorage11->getResource(&destResource));
gl::ImageIndex destIndex = gl::ImageIndex::Make2D(destLevel);
gl::ImageIndex destIndex = gl::ImageIndex::MakeGeneric(destTarget, destLevel);
UINT destSubresource = destStorage11->getSubresourceIndex(destIndex);
D3D11_BOX sourceBox{
@ -3433,7 +3434,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
d3d11::SharedSRV sourceSRV;
ANGLE_TRY(sourceStorage11->getSRVLevels(sourceLevel, sourceLevel, &sourceSRV));
gl::ImageIndex destIndex = gl::ImageIndex::Make2D(destLevel);
gl::ImageIndex destIndex = gl::ImageIndex::MakeGeneric(destTarget, destLevel);
RenderTargetD3D *destRenderTargetD3D = nullptr;
ANGLE_TRY(destStorage11->getRenderTarget(destIndex, &destRenderTargetD3D));
@ -3448,7 +3449,7 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
static_cast<int>(source->getHeight(source->getTarget(), sourceLevel)), 1);
if (unpackFlipY)
{
sourceArea.y = sourceSize.height - sourceRect.y;
sourceArea.y += sourceArea.height;
sourceArea.height = -sourceArea.height;
}
@ -3457,9 +3458,10 @@ gl::Error Renderer11::copyTexture(const gl::Texture *source,
// 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));
GLenum sourceFormat = source->getFormat(GL_TEXTURE_2D, sourceLevel).info->format;
ANGLE_TRY(mBlit->copyTexture(sourceSRV, sourceArea, sourceSize, sourceFormat, destRTV,
destArea, destSize, nullptr, destFormat, GL_NEAREST, false,
unpackPremultiplyAlpha, unpackUnmultiplyAlpha));
}
destStorage11->markLevelDirty(destLevel);
@ -4489,9 +4491,9 @@ gl::Error Renderer11::blitRenderbufferRect(const gl::Rectangle &readRectIn,
// We don't currently support masking off any other channel than alpha
bool maskOffAlpha = colorMaskingNeeded && colorMask.alpha;
ASSERT(readSRV.valid());
ANGLE_TRY(mBlit->copyTexture(readSRV, readArea, readSize, drawRTV, drawArea, drawSize,
scissor, destFormatInfo.format, filter, maskOffAlpha,
false, false));
ANGLE_TRY(mBlit->copyTexture(readSRV, readArea, readSize, srcFormatInfo.format, drawRTV,
drawArea, drawSize, scissor, destFormatInfo.format, filter,
maskOffAlpha, false, false));
}
}

Просмотреть файл

@ -519,9 +519,9 @@ gl::Error TextureStorage11::generateMipmap(const gl::ImageIndex &sourceIndex,
gl::Extents destSize(dest->getWidth(), dest->getHeight(), dest->getDepth());
Blit11 *blitter = mRenderer->getBlitter();
return blitter->copyTexture(sourceSRV, sourceArea, sourceSize, destRTV, destArea, destSize,
nullptr, gl::GetUnsizedFormat(source->getInternalFormat()),
GL_LINEAR, false, false, false);
GLenum format = gl::GetUnsizedFormat(source->getInternalFormat());
return blitter->copyTexture(sourceSRV, sourceArea, sourceSize, format, destRTV, destArea,
destSize, nullptr, format, GL_LINEAR, false, false, false);
}
void TextureStorage11::verifySwizzleExists(const gl::SwizzleState &swizzleState)

Просмотреть файл

@ -0,0 +1,94 @@
Texture2D<float4> TextureF : register(t0);
Texture2D<uint4> TextureUI : register(t0);
SamplerState Sampler : register(s0);
// Notation:
// PM: premultiply, UM: unmulitply, PT: passthrough
// F: float, U: uint
// Float to float RGBA
float4 PS_FtoF_PM_RGBA(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_FtoF_UM_RGBA(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;
}
// Float to float RGB
float4 PS_FtoF_PM_RGB(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
color.rgb *= color.a;
color.a = 1.0f;
return color;
}
float4 PS_FtoF_UM_RGB(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;
}
color.a = 1.0f;
return color;
}
// Float to uint RGBA
uint4 PS_FtoU_PT_RGBA(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
return uint4(color * 255);
}
uint4 PS_FtoU_PM_RGBA(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
color.rgb *= color.a;
return uint4(color * 255);
}
uint4 PS_FtoU_UM_RGBA(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 uint4(color * 255);
}
// Float to uint RGB
uint4 PS_FtoU_PT_RGB(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
return uint4(color.rgb * 255, 1);
}
uint4 PS_FtoU_PM_RGB(in float4 inPosition : SV_POSITION, in float2 inTexCoord : TEXCOORD0) : SV_TARGET0
{
float4 color = TextureF.Sample(Sampler, inTexCoord).rgba;
color.rgb *= color.a;
return uint4(color.rgb * 255, 1);
}
uint4 PS_FtoU_UM_RGB(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 uint4(color.rgb * 255, 1);
}

Просмотреть файл

@ -27,23 +27,6 @@ float4 PS_PassthroughRGBA2DMS(in float4 inPosition : SV_POSITION, in float2 inTe
return TextureF_MS.sample[inSampleIndex][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
{
uint2 size;
@ -65,23 +48,6 @@ float4 PS_PassthroughRGB2D(in float4 inPosition : SV_POSITION, in float2 inTexCo
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
{
uint2 size;

Просмотреть файл

@ -0,0 +1,77 @@
#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
//
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, l(1.000000)
ret
// Approximately 4 instruction slots used
#endif
const BYTE g_PS_FtoF_PM_RGB[] = {
68, 88, 66, 67, 184, 252, 76, 134, 209, 229, 230, 149, 167, 232, 172, 33, 50, 152, 142,
84, 1, 0, 0, 0, 136, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 12, 2, 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, 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, 1,
64, 0, 0, 0, 0, 128, 63, 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};

Просмотреть файл

@ -0,0 +1,77 @@
#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
//
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_FtoF_PM_RGBA[] = {
68, 88, 66, 67, 40, 72, 131, 157, 129, 101, 255, 110, 126, 134, 111, 68, 143, 142, 219,
64, 1, 0, 0, 0, 136, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 12, 2, 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, 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};

Просмотреть файл

@ -0,0 +1,82 @@
#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
//
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, l(1.000000)
ret
// Approximately 6 instruction slots used
#endif
const BYTE g_PS_FtoF_UM_RGB[] = {
68, 88, 66, 67, 14, 170, 220, 126, 255, 181, 163, 175, 235, 22, 242, 166, 140, 110, 63,
74, 1, 0, 0, 0, 200, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 76, 2, 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, 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, 1, 64, 0, 0, 0, 0, 128, 63, 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};

Просмотреть файл

@ -0,0 +1,82 @@
#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
//
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_FtoF_UM_RGBA[] = {
68, 88, 66, 67, 186, 41, 193, 245, 39, 138, 185, 101, 12, 196, 111, 158, 103, 199, 2,
40, 1, 0, 0, 0, 200, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 76, 2, 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, 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};

Просмотреть файл

@ -0,0 +1,82 @@
#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 uint xyzw
//
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 r0.xyz, r0.wwww, r0.xyzx
mul r0.xyz, r0.xyzx, l(255.000000, 255.000000, 255.000000, 0.000000)
ftou o0.xyz, r0.xyzx
mov o0.w, l(1)
ret
// Approximately 6 instruction slots used
#endif
const BYTE g_PS_FtoU_PM_RGB[] = {
68, 88, 66, 67, 155, 36, 56, 175, 46, 138, 216, 232, 30, 0, 183, 157, 15, 83, 210,
88, 1, 0, 0, 0, 196, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 72, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 216, 0, 0, 0, 64, 0, 0, 0, 54, 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, 0, 16, 0, 0, 0, 0, 0, 246, 15, 16, 0, 0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 114, 0, 16, 0, 0, 0, 0, 0, 70,
2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 127, 67, 0, 0, 127, 67,
0, 0, 127, 67, 0, 0, 0, 0, 28, 0, 0, 5, 114, 32, 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, 1, 64, 0, 0, 1, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116,
0, 0, 0, 6, 0, 0, 0, 1, 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, 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 +1,80 @@
#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 uint xyzw
//
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 r0.xyz, r0.wwww, r0.xyzx
mul r0.xyzw, r0.xyzw, l(255.000000, 255.000000, 255.000000, 255.000000)
ftou o0.xyzw, r0.xyzw
ret
// Approximately 5 instruction slots used
#endif
const BYTE g_PS_FtoU_PM_RGBA[] = {
68, 88, 66, 67, 145, 185, 8, 222, 150, 161, 126, 192, 3, 250, 167, 200, 187, 74, 70,
211, 1, 0, 0, 0, 176, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 52, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 196, 0, 0, 0, 64, 0, 0, 0, 49, 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, 0, 16, 0, 0, 0, 0, 0, 246, 15, 16, 0, 0, 0, 0, 0, 70, 2,
16, 0, 0, 0, 0, 0, 56, 0, 0, 10, 242, 0, 16, 0, 0, 0, 0, 0, 70,
14, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0, 0, 127, 67, 0, 0, 127, 67,
0, 0, 127, 67, 0, 0, 127, 67, 28, 0, 0, 5, 242, 32, 16, 0, 0, 0, 0,
0, 70, 14, 16, 0, 0, 0, 0, 0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0,
0, 0, 5, 0, 0, 0, 1, 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, 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 +1,79 @@
#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 uint xyzw
//
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 r0.xyz, r0.xyzx, l(255.000000, 255.000000, 255.000000, 0.000000)
ftou o0.xyz, r0.xyzx
mov o0.w, l(1)
ret
// Approximately 5 instruction slots used
#endif
const BYTE g_PS_FtoU_PT_RGB[] = {
68, 88, 66, 67, 199, 233, 92, 114, 12, 127, 254, 75, 103, 144, 201, 199, 115, 189, 178,
64, 1, 0, 0, 0, 168, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 44, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 188, 0, 0, 0, 64, 0, 0, 0, 47, 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,
10, 114, 0, 16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 0, 0, 28,
0, 0, 5, 114, 32, 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, 1, 64, 0, 0, 1, 0, 0,
0, 62, 0, 0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 5, 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, 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 +1,77 @@
#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 uint xyzw
//
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 r0.xyzw, r0.xyzw, l(255.000000, 255.000000, 255.000000, 255.000000)
ftou o0.xyzw, r0.xyzw
ret
// Approximately 4 instruction slots used
#endif
const BYTE g_PS_FtoU_PT_RGBA[] = {
68, 88, 66, 67, 209, 83, 172, 72, 82, 105, 159, 134, 14, 29, 227, 217, 205, 178, 97,
208, 1, 0, 0, 0, 148, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 24, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 168, 0, 0, 0, 64, 0, 0, 0, 42, 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,
10, 242, 0, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 2, 64,
0, 0, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 28,
0, 0, 5, 242, 32, 16, 0, 0, 0, 0, 0, 70, 14, 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, 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 +1,87 @@
#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 uint xyzw
//
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 r0.xyz, r1.xxxx, r1.yzwy, r0.xyzx
mul r0.xyz, r0.xyzx, l(255.000000, 255.000000, 255.000000, 0.000000)
ftou o0.xyz, r0.xyzx
mov o0.w, l(1)
ret
// Approximately 8 instruction slots used
#endif
const BYTE g_PS_FtoU_UM_RGB[] = {
68, 88, 66, 67, 82, 251, 238, 157, 164, 167, 205, 115, 177, 233, 1, 41, 133, 200, 183,
107, 1, 0, 0, 0, 4, 3, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 136, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 24, 1, 0, 0, 64, 0, 0, 0, 70, 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, 0, 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, 56, 0, 0, 10, 114, 0,
16, 0, 0, 0, 0, 0, 70, 2, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0,
0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 0, 0, 28, 0, 0, 5,
114, 32, 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, 1, 64, 0, 0, 1, 0, 0, 0, 62, 0,
0, 1, 83, 84, 65, 84, 116, 0, 0, 0, 8, 0, 0, 0, 2, 0, 0, 0, 0,
0, 0, 0, 2, 0, 0, 0, 3, 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, 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 +1,85 @@
#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 uint xyzw
//
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 r0.xyz, r1.xxxx, r1.yzwy, r0.xyzx
mul r0.xyzw, r0.xyzw, l(255.000000, 255.000000, 255.000000, 255.000000)
ftou o0.xyzw, r0.xyzw
ret
// Approximately 7 instruction slots used
#endif
const BYTE g_PS_FtoU_UM_RGBA[] = {
68, 88, 66, 67, 43, 223, 220, 54, 150, 139, 210, 139, 116, 210, 25, 161, 205, 213, 104,
156, 1, 0, 0, 0, 240, 2, 0, 0, 5, 0, 0, 0, 52, 0, 0, 0, 220, 0,
0, 0, 52, 1, 0, 0, 104, 1, 0, 0, 116, 2, 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, 1, 0, 0, 0, 0, 0,
0, 0, 15, 0, 0, 0, 83, 86, 95, 84, 65, 82, 71, 69, 84, 0, 171, 171, 83,
72, 68, 82, 4, 1, 0, 0, 64, 0, 0, 0, 65, 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, 0, 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, 56, 0, 0, 10, 242, 0,
16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 2, 64, 0, 0, 0,
0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 0, 0, 127, 67, 28, 0, 0, 5,
242, 32, 16, 0, 0, 0, 0, 0, 70, 14, 16, 0, 0, 0, 0, 0, 62, 0, 0,
1, 83, 84, 65, 84, 116, 0, 0, 0, 7, 0, 0, 0, 2, 0, 0, 0, 0, 0,
0, 0, 2, 0, 0, 0, 3, 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, 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};

Просмотреть файл

@ -1,101 +0,0 @@
#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};

Просмотреть файл

@ -1,110 +0,0 @@
#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};

Просмотреть файл

@ -1,101 +0,0 @@
#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};

Просмотреть файл

@ -1,110 +0,0 @@
#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};

Просмотреть файл

@ -30,10 +30,16 @@ 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_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 MultiplyAlpha.hlsl PS_FtoF_PM_RGBA ps_4_0 compiled\multiplyalpha_ftof_pm_rgba_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoF_UM_RGBA ps_4_0 compiled\multiplyalpha_ftof_um_rgba_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoF_PM_RGB ps_4_0 compiled\multiplyalpha_ftof_pm_rgb_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoF_UM_RGB ps_4_0 compiled\multiplyalpha_ftof_um_rgb_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_PT_RGBA ps_4_0 compiled\multiplyalpha_ftou_pt_rgba_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_PM_RGBA ps_4_0 compiled\multiplyalpha_ftou_pm_rgba_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_UM_RGBA ps_4_0 compiled\multiplyalpha_ftou_um_rgba_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_PT_RGB ps_4_0 compiled\multiplyalpha_ftou_pt_rgb_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_PM_RGB ps_4_0 compiled\multiplyalpha_ftou_pm_rgb_ps.h %debug%
call:BuildShader MultiplyAlpha.hlsl PS_FtoU_UM_RGB ps_4_0 compiled\multiplyalpha_ftou_um_rgb_ps.h %debug%
call:BuildShader Clear11.hlsl VS_Clear_FL9 vs_4_0_level_9_3 compiled\clear11_fl9vs.h %debug%
call:BuildShader Clear11.hlsl PS_ClearFloat_FL9 ps_4_0_level_9_3 compiled\clearfloat11_fl9ps.h %debug%

Просмотреть файл

@ -307,16 +307,17 @@ gl::Error Blit9::copyCube(const gl::Framebuffer *framebuffer, const RECT &source
return result;
}
gl::Error Blit9::copyTexture2D(const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha)
gl::Error Blit9::copyTexture(const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha)
{
ANGLE_TRY(initialize());
@ -328,7 +329,7 @@ gl::Error Blit9::copyTexture2D(const gl::Texture *source,
TextureStorage9_2D *sourceStorage9 = GetAs<TextureStorage9_2D>(sourceStorage);
ASSERT(sourceStorage9);
TextureStorage9_2D *destStorage9 = GetAs<TextureStorage9_2D>(storage);
TextureStorage9 *destStorage9 = GetAs<TextureStorage9>(storage);
ASSERT(destStorage9);
ASSERT(sourceLevel == 0);
@ -339,7 +340,7 @@ gl::Error Blit9::copyTexture2D(const gl::Texture *source,
ANGLE_TRY(sourceStorage9->getSurfaceLevel(GL_TEXTURE_2D, sourceLevel, true, &sourceSurface));
IDirect3DSurface9 *destSurface = nullptr;
gl::Error error = destStorage9->getSurfaceLevel(GL_TEXTURE_2D, destLevel, true, &destSurface);
gl::Error error = destStorage9->getSurfaceLevel(destTarget, destLevel, true, &destSurface);
if (error.isError())
{
SafeRelease(sourceSurface);

Просмотреть файл

@ -45,16 +45,17 @@ class Blit9 : angle::NonCopyable
TextureStorage *storage,
GLenum target,
GLint level);
gl::Error copyTexture2D(const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error copyTexture(const gl::Texture *source,
GLint sourceLevel,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
TextureStorage *storage,
GLenum destTarget,
GLint destLevel,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
// 2x2 box filter sample from source to dest.
// Requires that source is RGB(A) and dest has the same format as source.

Просмотреть файл

@ -2579,17 +2579,15 @@ gl::Error Renderer9::copyTexture(const gl::Texture *source,
bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha)
{
ASSERT(destTarget == GL_TEXTURE_2D);
RECT rect;
rect.left = sourceRect.x;
rect.top = sourceRect.y;
rect.right = sourceRect.x + sourceRect.width;
rect.bottom = sourceRect.y + sourceRect.height;
return mBlit->copyTexture2D(source, sourceLevel, rect, destFormat, destOffset, storage,
destLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
return mBlit->copyTexture(source, sourceLevel, rect, destFormat, destOffset, storage,
destTarget, destLevel, unpackFlipY, unpackPremultiplyAlpha,
unpackUnmultiplyAlpha);
}
gl::Error Renderer9::copyCompressedTexture(const gl::Texture *source,

Просмотреть файл

@ -513,7 +513,10 @@ gl::Error BlitGL::copySubTexture(TextureGL *source,
}
gl::Error BlitGL::copyTexSubImage(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset)
{
@ -521,12 +524,13 @@ gl::Error BlitGL::copyTexSubImage(TextureGL *source,
mStateManager->bindFramebuffer(GL_FRAMEBUFFER, mScratchFBO);
mFunctions->framebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D,
source->getTextureID(), 0);
source->getTextureID(), static_cast<GLint>(sourceLevel));
mStateManager->bindTexture(dest->getTarget(), dest->getTextureID());
mFunctions->copyTexSubImage2D(dest->getTarget(), 0, destOffset.x, destOffset.y, sourceArea.x,
sourceArea.y, sourceArea.width, sourceArea.height);
mFunctions->copyTexSubImage2D(destTarget, static_cast<GLint>(destLevel), destOffset.x,
destOffset.y, sourceArea.x, sourceArea.y, sourceArea.width,
sourceArea.height);
return gl::NoError();
}

Просмотреть файл

@ -75,7 +75,10 @@ class BlitGL : angle::NonCopyable
bool unpackUnmultiplyAlpha);
gl::Error copyTexSubImage(TextureGL *source,
size_t sourceLevel,
TextureGL *dest,
GLenum destTarget,
size_t destLevel,
const gl::Rectangle &sourceArea,
const gl::Offset &destOffset);

Просмотреть файл

@ -638,7 +638,7 @@ gl::Error TextureGL::copyTexture(ContextImpl *contextImpl,
const gl::InternalFormat &internalFormatInfo = gl::GetInternalFormatInfo(internalFormat, type);
reserveTexImageToBeFilled(getTarget(), 0, internalFormatInfo.sizedInternalFormat,
sourceImageDesc.size, internalFormat, type);
sourceImageDesc.size, internalFormatInfo.format, type);
return copySubTextureHelper(target, level, gl::Offset(0, 0, 0), sourceLevel, sourceArea,
internalFormat, unpackFlipY, unpackPremultiplyAlpha,
@ -683,11 +683,12 @@ gl::Error TextureGL::copySubTextureHelper(GLenum target,
(sourceFormat == destFormat && sourceFormat != GL_BGRA_EXT) ||
(sourceFormat == GL_RGBA && destFormat == GL_RGB);
if (source->getTarget() == GL_TEXTURE_2D && getTarget() == GL_TEXTURE_2D && !unpackFlipY &&
if (source->getTarget() == GL_TEXTURE_2D && !unpackFlipY &&
unpackPremultiplyAlpha == unpackUnmultiplyAlpha && !needsLumaWorkaround &&
sourceFormatContainSupersetOfDestFormat)
{
return mBlitter->copyTexSubImage(sourceGL, this, sourceArea, destOffset);
return mBlitter->copyTexSubImage(sourceGL, sourceLevel, this, target, level, sourceArea,
destOffset);
}
// We can't use copyTexSubImage, do a manual copy

Просмотреть файл

@ -206,22 +206,73 @@ bool ValidateInstancedPathParameters(gl::Context *context,
return true;
}
bool IsValidCopyTextureFormat(Context *context, GLenum internalFormat)
bool IsValidCopyTextureSourceInternalFormatEnum(GLenum internalFormat)
{
// Table 1.1 from the CHROMIUM_copy_texture spec
switch (GetUnsizedFormat(internalFormat))
{
case GL_RED:
case GL_ALPHA:
case GL_LUMINANCE:
case GL_LUMINANCE_ALPHA:
case GL_RGB:
case GL_RGBA:
case GL_RGB8:
case GL_RGBA8:
case GL_BGRA_EXT:
case GL_BGRA8_EXT:
return true;
case GL_RED:
return context->getClientMajorVersion() >= 3 || context->getExtensions().textureRG;
default:
return false;
}
}
bool IsValidCopySubTextureSourceInternalFormat(GLenum internalFormat)
{
return IsValidCopyTextureSourceInternalFormatEnum(internalFormat);
}
bool IsValidCopySubTextureDestionationInternalFormat(GLenum internalFormat)
{
return IsValidCopyTextureSourceInternalFormatEnum(internalFormat);
}
bool IsValidCopyTextureDestinationInternalFormatEnum(GLint internalFormat)
{
// Table 1.0 from the CHROMIUM_copy_texture spec
switch (internalFormat)
{
case GL_RGB:
case GL_RGBA:
case GL_RGB8:
case GL_RGBA8:
case GL_BGRA_EXT:
return context->getExtensions().textureFormatBGRA8888;
case GL_BGRA8_EXT:
case GL_SRGB_EXT:
case GL_SRGB_ALPHA_EXT:
case GL_R8:
case GL_R8UI:
case GL_RG8:
case GL_RG8UI:
case GL_SRGB8:
case GL_RGB565:
case GL_RGB8UI:
case GL_SRGB8_ALPHA8:
case GL_RGB5_A1:
case GL_RGBA4:
case GL_RGBA8UI:
case GL_RGB9_E5:
case GL_R16F:
case GL_R32F:
case GL_RG16F:
case GL_RG32F:
case GL_RGB16F:
case GL_RGB32F:
case GL_RGBA16F:
case GL_RGBA32F:
case GL_R11F_G11F_B10F:
return true;
default:
return false;
@ -230,37 +281,34 @@ bool IsValidCopyTextureFormat(Context *context, GLenum internalFormat)
bool IsValidCopyTextureDestinationFormatType(Context *context, GLint internalFormat, GLenum type)
{
switch (internalFormat)
if (!IsValidCopyTextureDestinationInternalFormatEnum(internalFormat))
{
case GL_RGB:
case GL_RGBA:
break;
case GL_BGRA_EXT:
return context->getExtensions().textureFormatBGRA8888;
default:
return false;
return false;
}
switch (type)
const InternalFormat &internalFormatInfo = GetInternalFormatInfo(internalFormat, type);
if (!internalFormatInfo.textureSupport(context->getClientVersion(), context->getExtensions()))
{
case GL_UNSIGNED_BYTE:
break;
default:
return false;
return false;
}
return true;
}
bool IsValidCopyTextureDestinationTarget(Context *context, GLenum target)
bool IsValidCopyTextureDestinationTarget(Context *context, GLenum textureType, GLenum target)
{
switch (target)
{
case GL_TEXTURE_2D:
return true;
return textureType == GL_TEXTURE_2D;
case GL_TEXTURE_CUBE_MAP_POSITIVE_X:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_X:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Y:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Y:
case GL_TEXTURE_CUBE_MAP_POSITIVE_Z:
case GL_TEXTURE_CUBE_MAP_NEGATIVE_Z:
return textureType == GL_TEXTURE_CUBE_MAP;
// TODO(geofflang): accept GL_TEXTURE_RECTANGLE_ARB if the texture_rectangle extension is
// supported
@ -272,15 +320,72 @@ bool IsValidCopyTextureDestinationTarget(Context *context, GLenum target)
bool IsValidCopyTextureSourceTarget(Context *context, GLenum target)
{
if (IsValidCopyTextureDestinationTarget(context, target))
switch (target)
{
return true;
case GL_TEXTURE_2D:
return true;
// TODO(geofflang): accept GL_TEXTURE_RECTANGLE_ARB if the texture_rectangle extension is
// supported
// TODO(geofflang): accept GL_TEXTURE_EXTERNAL_OES if the texture_external extension is
// supported
default:
return false;
}
}
bool IsValidCopyTextureSourceLevel(Context *context, GLenum target, GLint level)
{
if (level < 0)
{
return false;
}
// TODO(geofflang): accept GL_TEXTURE_EXTERNAL_OES if the texture_external extension is
// supported
if (level > 0 && context->getClientVersion() < ES_3_0)
{
return false;
}
return false;
return true;
}
bool IsValidCopyTextureDestinationLevel(Context *context,
GLenum target,
GLint level,
GLsizei width,
GLsizei height)
{
if (level < 0)
{
return false;
}
if (level > 0 && context->getClientVersion() < ES_3_0)
{
return false;
}
const Caps &caps = context->getCaps();
if (target == GL_TEXTURE_2D)
{
if (static_cast<GLuint>(width) > (caps.max2DTextureSize >> level) ||
static_cast<GLuint>(height) > (caps.max2DTextureSize >> level))
{
return false;
}
}
else if (IsCubeMapTextureTarget(target))
{
if (static_cast<GLuint>(width) > (caps.maxCubeMapTextureSize >> level) ||
static_cast<GLuint>(height) > (caps.maxCubeMapTextureSize >> level))
{
return false;
}
}
return true;
}
bool IsValidStencilFunc(GLenum func)
@ -3386,7 +3491,7 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
return false;
}
const gl::Texture *source = context->getTexture(sourceId);
const Texture *source = context->getTexture(sourceId);
if (source == nullptr)
{
context->handleError(
@ -3402,22 +3507,31 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
GLenum sourceTarget = source->getTarget();
ASSERT(sourceTarget != GL_TEXTURE_CUBE_MAP);
if (source->getWidth(sourceTarget, 0) == 0 || source->getHeight(sourceTarget, 0) == 0)
if (!IsValidCopyTextureSourceLevel(context, source->getTarget(), sourceLevel))
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the source texture must be defined."));
context->handleError(Error(GL_INVALID_VALUE, "Source texture level is not valid."));
return false;
}
const gl::InternalFormat &sourceFormat = *source->getFormat(sourceTarget, 0).info;
if (!IsValidCopyTextureFormat(context, sourceFormat.format))
GLsizei sourceWidth = static_cast<GLsizei>(source->getWidth(sourceTarget, sourceLevel));
GLsizei sourceHeight = static_cast<GLsizei>(source->getHeight(sourceTarget, sourceLevel));
if (sourceWidth == 0 || sourceHeight == 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "The source level of the source texture must be defined."));
return false;
}
const InternalFormat &sourceFormat = *source->getFormat(sourceTarget, sourceLevel).info;
if (!IsValidCopyTextureSourceInternalFormatEnum(sourceFormat.internalFormat))
{
context->handleError(
Error(GL_INVALID_OPERATION, "Source texture internal format is invalid."));
return false;
}
const gl::Texture *dest = context->getTexture(destId);
const Texture *dest = context->getTexture(destId);
if (dest == nullptr)
{
context->handleError(
@ -3425,12 +3539,19 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
return false;
}
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget()))
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget(), destTarget))
{
context->handleError(Error(GL_INVALID_VALUE, "Destination texture a valid texture type."));
return false;
}
if (!IsValidCopyTextureDestinationLevel(context, destTarget, destLevel, sourceWidth,
sourceHeight))
{
context->handleError(Error(GL_INVALID_VALUE, "Destination texture level is not valid."));
return false;
}
if (!IsValidCopyTextureDestinationFormatType(context, internalFormat, destType))
{
context->handleError(
@ -3439,6 +3560,13 @@ bool ValidateCopyTextureCHROMIUM(Context *context,
return false;
}
if (IsCubeMapTextureTarget(destTarget) && sourceWidth != sourceHeight)
{
context->handleError(Error(
GL_INVALID_VALUE, "Destination width and height must be equal for cube map textures."));
return false;
}
if (dest->getImmutableFormat())
{
context->handleError(Error(GL_INVALID_OPERATION, "Destination texture is immutable."));
@ -3471,7 +3599,7 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
const gl::Texture *source = context->getTexture(sourceId);
const Texture *source = context->getTexture(sourceId);
if (source == nullptr)
{
context->handleError(
@ -3487,10 +3615,18 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
GLenum sourceTarget = source->getTarget();
ASSERT(sourceTarget != GL_TEXTURE_CUBE_MAP);
if (source->getWidth(sourceTarget, 0) == 0 || source->getHeight(sourceTarget, 0) == 0)
if (!IsValidCopyTextureSourceLevel(context, source->getTarget(), sourceLevel))
{
context->handleError(Error(GL_INVALID_VALUE, "Source texture level is not valid."));
return false;
}
if (source->getWidth(sourceTarget, sourceLevel) == 0 ||
source->getHeight(sourceTarget, sourceLevel) == 0)
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the source texture must be defined."));
Error(GL_INVALID_VALUE, "The source level of the source texture must be defined."));
return false;
}
@ -3506,23 +3642,23 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
if (static_cast<size_t>(x + width) > source->getWidth(sourceTarget, 0) ||
static_cast<size_t>(y + height) > source->getHeight(sourceTarget, 0))
if (static_cast<size_t>(x + width) > source->getWidth(sourceTarget, sourceLevel) ||
static_cast<size_t>(y + height) > source->getHeight(sourceTarget, sourceLevel))
{
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.info->internalFormat))
const Format &sourceFormat = source->getFormat(sourceTarget, sourceLevel);
if (!IsValidCopySubTextureSourceInternalFormat(sourceFormat.info->internalFormat))
{
context->handleError(
Error(GL_INVALID_OPERATION, "Source texture internal format is invalid."));
return false;
}
const gl::Texture *dest = context->getTexture(destId);
const Texture *dest = context->getTexture(destId);
if (dest == nullptr)
{
context->handleError(
@ -3530,22 +3666,27 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget()))
if (!IsValidCopyTextureDestinationTarget(context, dest->getTarget(), destTarget))
{
context->handleError(Error(GL_INVALID_VALUE, "Destination texture a valid texture type."));
return false;
}
ASSERT(destTarget != GL_TEXTURE_CUBE_MAP);
if (dest->getWidth(sourceTarget, 0) == 0 || dest->getHeight(sourceTarget, 0) == 0)
if (!IsValidCopyTextureDestinationLevel(context, destTarget, destLevel, width, height))
{
context->handleError(
Error(GL_INVALID_VALUE, "Level 0 of the destination texture must be defined."));
context->handleError(Error(GL_INVALID_VALUE, "Destination texture level is not valid."));
return false;
}
const gl::InternalFormat &destFormat = *dest->getFormat(destTarget, 0).info;
if (!IsValidCopyTextureDestinationFormatType(context, destFormat.format, destFormat.type))
if (dest->getWidth(destTarget, destLevel) == 0 || dest->getHeight(destTarget, destLevel) == 0)
{
context->handleError(Error(
GL_INVALID_VALUE, "The destination level of the destination texture must be defined."));
return false;
}
const InternalFormat &destFormat = *dest->getFormat(destTarget, destLevel).info;
if (!IsValidCopySubTextureDestionationInternalFormat(destFormat.internalFormat))
{
context->handleError(
Error(GL_INVALID_OPERATION,
@ -3559,8 +3700,8 @@ bool ValidateCopySubTextureCHROMIUM(Context *context,
return false;
}
if (static_cast<size_t>(xoffset + width) > dest->getWidth(destTarget, 0) ||
static_cast<size_t>(yoffset + height) > dest->getHeight(destTarget, 0))
if (static_cast<size_t>(xoffset + width) > dest->getWidth(destTarget, destLevel) ||
static_cast<size_t>(yoffset + height) > dest->getHeight(destTarget, destLevel))
{
context->handleError(
Error(GL_INVALID_VALUE, "Destination texture not large enough to copy to."));

Просмотреть файл

@ -429,6 +429,16 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearfloat11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearsint11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/clearuint11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_pm_rgb_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftof_um_rgb_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pm_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pt_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_um_rgba_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pm_rgb_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_pt_rgb_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/multiplyalpha_ftou_um_rgb_ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough2d11vs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11gs.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthrough3d11vs.h',
@ -450,16 +460,12 @@
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrg3dui11ps.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/passthroughrgb2dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3d11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3di11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgb3dui11ps.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/passthroughrgba2dui11ps.h',
'libANGLE/renderer/d3d/d3d11/shaders/compiled/passthroughrgba3d11ps.h',

Просмотреть файл

@ -8,6 +8,8 @@
#include "test_utils/ANGLETest.h"
#include "test_utils/gl_raii.h"
namespace angle
{
@ -81,6 +83,10 @@ class CopyTextureTest : public ANGLETest
PFNGLCOPYSUBTEXTURECHROMIUMPROC glCopySubTextureCHROMIUM = nullptr;
};
class CopyTextureTestES3 : public CopyTextureTest
{
};
// Test to ensure that the basic functionality of the extension works.
TEST_P(CopyTextureTest, BasicCopyTexture)
{
@ -243,47 +249,6 @@ TEST_P(CopyTextureTest, InternalFormat)
}
}
// Check that invalid internal formats return errors.
TEST_P(CopyTextureTest, InternalFormatNotSupported)
{
if (!checkExtensions())
{
return;
}
glBindTexture(GL_TEXTURE_2D, mTextures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
EXPECT_GL_NO_ERROR();
std::vector<GLint> unsupportedDestFormats;
unsupportedDestFormats.push_back(GL_ALPHA);
unsupportedDestFormats.push_back(GL_LUMINANCE);
unsupportedDestFormats.push_back(GL_LUMINANCE_ALPHA);
if (!extensionEnabled("GL_EXT_texture_format_BGRA8888"))
{
unsupportedDestFormats.push_back(GL_BGRA_EXT);
}
// Check unsupported format reports an error.
for (GLint unsupportedDestFormat : unsupportedDestFormats)
{
glCopyTextureCHROMIUM(mTextures[0], 0, GL_TEXTURE_2D, mTextures[1], 0,
unsupportedDestFormat, GL_UNSIGNED_BYTE, false, false, false);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
}
for (GLint unsupportedDestFormat : unsupportedDestFormats)
{
glBindTexture(GL_TEXTURE_2D, mTextures[1]);
glTexImage2D(GL_TEXTURE_2D, 0, unsupportedDestFormat, 1, 1, 0, unsupportedDestFormat,
GL_UNSIGNED_BYTE, nullptr);
glCopySubTextureCHROMIUM(mTextures[0], 0, GL_TEXTURE_2D, mTextures[1], 0, 0, 0, 0, 0, 1, 1,
false, false, false);
EXPECT_GL_ERROR(GL_INVALID_OPERATION);
}
}
// Test to ensure that the destination texture is redefined if the properties are different.
TEST_P(CopyTextureTest, RedefineDestinationTexture)
{
@ -645,8 +610,464 @@ TEST_P(CopyTextureTest, Alpha)
EXPECT_PIXEL_COLOR_EQ(0, 0, expectedPixels);
}
// Test that copying to cube maps works
TEST_P(CopyTextureTest, CubeMapTarget)
{
if (!checkExtensions())
{
return;
}
GLColor pixels = GLColor::red;
GLTexture textures[2];
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &pixels);
glBindTexture(GL_TEXTURE_CUBE_MAP, textures[1]);
for (GLenum face = GL_TEXTURE_CUBE_MAP_POSITIVE_X; face <= GL_TEXTURE_CUBE_MAP_NEGATIVE_Z;
face++)
{
glTexImage2D(face, 0, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
}
glCopySubTextureCHROMIUM(textures[0], 0, GL_TEXTURE_CUBE_MAP_POSITIVE_X, textures[1], 0, 0, 0,
0, 0, 1, 1, false, false, false);
EXPECT_GL_NO_ERROR();
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_CUBE_MAP_POSITIVE_X,
textures[1], 0);
// Check that FB is complete.
EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
EXPECT_PIXEL_COLOR_EQ(0, 0, pixels);
EXPECT_GL_NO_ERROR();
}
// Test that copying to non-zero mipmaps works
TEST_P(CopyTextureTestES3, CopyToMipmap)
{
if (!checkExtensions())
{
return;
}
if (IsOSX() && IsIntel())
{
std::cout << "Test skipped on Mac Intel." << std::endl;
return;
}
GLColor pixels = GLColor::red;
GLTexture textures[2];
const GLint sourceLevel = 1;
const GLint destLevel = 2;
glBindTexture(GL_TEXTURE_2D, textures[0]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, &pixels);
glBindTexture(GL_TEXTURE_2D, textures[1]);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, 4, 4, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 1, GL_RGBA, 2, 2, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glTexImage2D(GL_TEXTURE_2D, 2, GL_RGBA, 1, 1, 0, GL_RGBA, GL_UNSIGNED_BYTE, nullptr);
glCopySubTextureCHROMIUM(textures[0], sourceLevel, GL_TEXTURE_2D, textures[1], destLevel, 0, 0,
0, 0, 1, 1, false, false, false);
EXPECT_GL_NO_ERROR();
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferTexture2D(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_TEXTURE_2D, textures[1],
destLevel);
// Check that FB is complete.
EXPECT_GLENUM_EQ(GL_FRAMEBUFFER_COMPLETE, glCheckFramebufferStatus(GL_FRAMEBUFFER));
EXPECT_PIXEL_COLOR_EQ(0, 0, pixels);
EXPECT_GL_NO_ERROR();
}
// Test the newly added ES3 unorm formats
TEST_P(CopyTextureTestES3, ES3UnormFormats)
{
if (!checkExtensions())
{
return;
}
auto testOutput = [this](GLuint texture, const GLColor &expectedColor) {
const std::string vs =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(position.xy, 0.0, 1.0);\n"
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
const std::string fs =
"#version 300 es\n"
"precision mediump float;\n"
"uniform sampler2D tex;\n"
"in vec2 texcoord;\n"
"out vec4 color;\n"
"void main()\n"
"{\n"
" color = texture(tex, texcoord);\n"
"}\n";
ANGLE_GL_PROGRAM(program, vs, fs);
glUseProgram(program);
GLRenderbuffer rbo;
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8, 1, 1);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glUniform1i(glGetUniformLocation(program.get(), "tex"), 0);
drawQuad(program, "position", 0.5f, 1.0f, true);
EXPECT_PIXEL_COLOR_NEAR(0, 0, expectedColor, 1.0);
};
auto testCopyCombination = [this, testOutput](GLenum sourceInternalFormat, GLenum sourceFormat,
GLenum sourceType, const GLColor &sourceColor,
GLenum destInternalFormat, GLenum destType,
bool flipY, bool premultiplyAlpha,
bool unmultiplyAlpha,
const GLColor &expectedColor) {
GLTexture sourceTexture;
glBindTexture(GL_TEXTURE_2D, sourceTexture);
glTexImage2D(GL_TEXTURE_2D, 0, sourceInternalFormat, 1, 1, 0, sourceFormat, sourceType,
&sourceColor);
GLTexture destTexture;
glBindTexture(GL_TEXTURE_2D, destTexture);
glCopyTextureCHROMIUM(sourceTexture, 0, GL_TEXTURE_2D, destTexture, 0, destInternalFormat,
destType, flipY, premultiplyAlpha, unmultiplyAlpha);
ASSERT_GL_NO_ERROR();
testOutput(destTexture, expectedColor);
};
// New LUMA source formats
testCopyCombination(GL_LUMINANCE, GL_LUMINANCE, GL_UNSIGNED_BYTE, GLColor(128, 0, 0, 0), GL_RGB,
GL_UNSIGNED_BYTE, false, false, false, GLColor(128, 128, 128, 255));
testCopyCombination(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
GLColor(128, 64, 0, 0), GL_RGB, GL_UNSIGNED_BYTE, false, false, false,
GLColor(128, 128, 128, 255));
testCopyCombination(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
GLColor(128, 64, 0, 0), GL_RGB, GL_UNSIGNED_BYTE, false, true, false,
GLColor(32, 32, 32, 255));
testCopyCombination(GL_LUMINANCE_ALPHA, GL_LUMINANCE_ALPHA, GL_UNSIGNED_BYTE,
GLColor(128, 128, 0, 0), GL_RGB, GL_UNSIGNED_BYTE, false, false, true,
GLColor(255, 255, 255, 255));
testCopyCombination(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, GLColor(128, 0, 0, 0), GL_RGBA,
GL_UNSIGNED_BYTE, false, false, false, GLColor(0, 0, 0, 128));
testCopyCombination(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, GLColor(128, 0, 0, 0), GL_RGBA,
GL_UNSIGNED_BYTE, false, false, true, GLColor(0, 0, 0, 128));
testCopyCombination(GL_ALPHA, GL_ALPHA, GL_UNSIGNED_BYTE, GLColor(128, 0, 0, 0), GL_RGBA,
GL_UNSIGNED_BYTE, false, true, false, GLColor(0, 0, 0, 128));
// New sRGB dest formats
if (IsOpenGLES())
{
std::cout << "Skipping GL_SRGB and GL_SRGB_ALPHA because it is not implemented yet."
<< std::endl;
}
else
{
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_SRGB,
GL_UNSIGNED_BYTE, false, false, false, GLColor(128, 64, 32, 255));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_SRGB,
GL_UNSIGNED_BYTE, false, true, false, GLColor(64, 32, 16, 255));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_SRGB_ALPHA_EXT, GL_UNSIGNED_BYTE, false, false, false,
GLColor(128, 64, 32, 128));
}
}
// Test the newly added ES3 float formats
TEST_P(CopyTextureTestES3, ES3FloatFormats)
{
if (!checkExtensions())
{
return;
}
if (!extensionEnabled("GL_EXT_color_buffer_float"))
{
std::cout << "Test skipped due to missing GL_EXT_color_buffer_float." << std::endl;
return;
}
auto testOutput = [this](GLuint texture, const GLColor32F &expectedColor) {
const std::string vs =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(position.xy, 0.0, 1.0);\n"
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
const std::string fs =
"#version 300 es\n"
"precision mediump float;\n"
"uniform sampler2D tex;\n"
"in vec2 texcoord;\n"
"out vec4 color;\n"
"void main()\n"
"{\n"
" color = texture(tex, texcoord);\n"
"}\n";
ANGLE_GL_PROGRAM(program, vs, fs);
glUseProgram(program);
GLRenderbuffer rbo;
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA32F, 1, 1);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glUniform1i(glGetUniformLocation(program.get(), "tex"), 0);
drawQuad(program, "position", 0.5f, 1.0f, true);
EXPECT_PIXEL_COLOR32F_NEAR(0, 0, expectedColor, 0.05);
};
auto testCopyCombination = [this, testOutput](GLenum sourceInternalFormat, GLenum sourceFormat,
GLenum sourceType, const GLColor &sourceColor,
GLenum destInternalFormat, GLenum destType,
bool flipY, bool premultiplyAlpha,
bool unmultiplyAlpha,
const GLColor32F &expectedColor) {
GLTexture sourceTexture;
glBindTexture(GL_TEXTURE_2D, sourceTexture);
glTexImage2D(GL_TEXTURE_2D, 0, sourceInternalFormat, 1, 1, 0, sourceFormat, sourceType,
&sourceColor);
GLTexture destTexture;
glBindTexture(GL_TEXTURE_2D, destTexture);
glCopyTextureCHROMIUM(sourceTexture, 0, GL_TEXTURE_2D, destTexture, 0, destInternalFormat,
destType, flipY, premultiplyAlpha, unmultiplyAlpha);
ASSERT_GL_NO_ERROR();
testOutput(destTexture, expectedColor);
};
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA32F,
GL_FLOAT, false, false, false, GLColor32F(0.5f, 0.25f, 0.125f, 0.5f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA32F,
GL_FLOAT, false, true, false, GLColor32F(0.25f, 0.125f, 0.0625f, 0.5f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA32F,
GL_FLOAT, false, false, true, GLColor32F(1.0f, 0.5f, 0.25f, 0.5f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_R16F,
GL_FLOAT, false, false, false, GLColor32F(0.5f, 0.0f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_R16F,
GL_FLOAT, false, true, false, GLColor32F(0.25f, 0.0f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_R16F,
GL_FLOAT, false, false, true, GLColor32F(1.0f, 0.0f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG16F,
GL_FLOAT, false, false, false, GLColor32F(0.5f, 0.25f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG16F,
GL_FLOAT, false, true, false, GLColor32F(0.25f, 0.125f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG16F,
GL_FLOAT, false, false, true, GLColor32F(1.0f, 0.5f, 0.0f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB16F,
GL_FLOAT, false, false, false, GLColor32F(0.5f, 0.25f, 0.125f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB16F,
GL_FLOAT, false, true, false, GLColor32F(0.25f, 0.125f, 0.0625f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB16F,
GL_FLOAT, false, false, true, GLColor32F(1.0f, 0.5f, 0.25f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_R11F_G11F_B10F, GL_FLOAT, false, false, false,
GLColor32F(0.5f, 0.25f, 0.125f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_R11F_G11F_B10F, GL_FLOAT, false, true, false,
GLColor32F(0.25f, 0.125f, 0.0625f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_R11F_G11F_B10F, GL_FLOAT, false, false, true,
GLColor32F(1.0f, 0.5f, 0.25f, 1.0f));
if (IsD3D11() || IsOpenGL() || IsOpenGLES())
{
std::cout << "Skipping GL_RGB9_E5 because it is not implemented yet." << std::endl;
}
else
{
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_RGB9_E5, GL_FLOAT, false, false, false,
GLColor32F(0.5f, 0.25f, 0.125f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_RGB9_E5, GL_FLOAT, false, true, false,
GLColor32F(0.25f, 0.125f, 0.0625f, 1.0f));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128),
GL_RGB9_E5, GL_FLOAT, false, false, true,
GLColor32F(1.0f, 0.5f, 0.25f, 1.0f));
}
}
// Test the newly added ES3 unsigned integer formats
TEST_P(CopyTextureTestES3, ES3UintFormats)
{
if (!checkExtensions())
{
return;
}
if (IsOpenGL() || IsOpenGLES())
{
std::cout << "Test on OpenGL and OpenGLES because not all formats are implemented yet."
<< std::endl;
return;
}
using GLColor32U = std::tuple<GLuint, GLuint, GLuint, GLuint>;
auto testOutput = [this](GLuint texture, const GLColor32U &expectedColor) {
const std::string vs =
"#version 300 es\n"
"in vec4 position;\n"
"out vec2 texcoord;\n"
"void main()\n"
"{\n"
" gl_Position = vec4(position.xy, 0.0, 1.0);\n"
" texcoord = (position.xy * 0.5) + 0.5;\n"
"}\n";
std::string fs =
"#version 300 es\n"
"precision mediump float;\n"
"precision mediump usampler2D;\n"
"in vec2 texcoord;\n"
"uniform usampler2D tex;\n"
"out uvec4 color;\n"
"void main()\n"
"{\n"
" color = texture(tex, texcoord);\n"
"}\n";
ANGLE_GL_PROGRAM(program, vs, fs);
glUseProgram(program);
GLRenderbuffer rbo;
glBindRenderbuffer(GL_RENDERBUFFER, rbo);
glRenderbufferStorage(GL_RENDERBUFFER, GL_RGBA8UI, 1, 1);
GLFramebuffer fbo;
glBindFramebuffer(GL_FRAMEBUFFER, fbo);
glFramebufferRenderbuffer(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_RENDERBUFFER, rbo);
glActiveTexture(GL_TEXTURE0);
glBindTexture(GL_TEXTURE_2D, texture);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_NEAREST);
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glUniform1i(glGetUniformLocation(program.get(), "tex"), 0);
drawQuad(program, "position", 0.5f, 1.0f, true);
ASSERT_GL_NO_ERROR();
GLuint pixel[4] = {0};
glReadPixels(0, 0, 1, 1, GL_RGBA_INTEGER, GL_UNSIGNED_INT, pixel);
ASSERT_GL_NO_ERROR();
EXPECT_NEAR(std::get<0>(expectedColor), pixel[0], 1);
EXPECT_NEAR(std::get<1>(expectedColor), pixel[1], 1);
EXPECT_NEAR(std::get<2>(expectedColor), pixel[2], 1);
EXPECT_NEAR(std::get<3>(expectedColor), pixel[3], 1);
};
auto testCopyCombination = [this, testOutput](GLenum sourceInternalFormat, GLenum sourceFormat,
GLenum sourceType, const GLColor &sourceColor,
GLenum destInternalFormat, GLenum destType,
bool flipY, bool premultiplyAlpha,
bool unmultiplyAlpha,
const GLColor32U &expectedColor) {
GLTexture sourceTexture;
glBindTexture(GL_TEXTURE_2D, sourceTexture);
glTexImage2D(GL_TEXTURE_2D, 0, sourceInternalFormat, 1, 1, 0, sourceFormat, sourceType,
&sourceColor);
GLTexture destTexture;
glBindTexture(GL_TEXTURE_2D, destTexture);
glCopyTextureCHROMIUM(sourceTexture, 0, GL_TEXTURE_2D, destTexture, 0, destInternalFormat,
destType, flipY, premultiplyAlpha, unmultiplyAlpha);
ASSERT_GL_NO_ERROR();
testOutput(destTexture, expectedColor);
};
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA8UI,
GL_UNSIGNED_BYTE, false, false, false, GLColor32U(128, 64, 32, 128));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA8UI,
GL_UNSIGNED_BYTE, false, true, false, GLColor32U(64, 32, 16, 128));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGBA8UI,
GL_UNSIGNED_BYTE, false, false, true, GLColor32U(255, 128, 64, 128));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB8UI,
GL_UNSIGNED_BYTE, false, false, false, GLColor32U(128, 64, 32, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB8UI,
GL_UNSIGNED_BYTE, false, true, false, GLColor32U(64, 32, 16, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RGB8UI,
GL_UNSIGNED_BYTE, false, false, true, GLColor32U(255, 128, 64, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG8UI,
GL_UNSIGNED_BYTE, false, false, false, GLColor32U(128, 64, 0, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG8UI,
GL_UNSIGNED_BYTE, false, true, false, GLColor32U(64, 32, 0, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_RG8UI,
GL_UNSIGNED_BYTE, false, false, true, GLColor32U(255, 128, 0, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_R8UI,
GL_UNSIGNED_BYTE, false, false, false, GLColor32U(128, 0, 0, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(128, 64, 32, 128), GL_R8UI,
GL_UNSIGNED_BYTE, false, true, false, GLColor32U(64, 0, 0, 1));
testCopyCombination(GL_RGBA, GL_RGBA, GL_UNSIGNED_BYTE, GLColor(120, 64, 32, 128), GL_R8UI,
GL_UNSIGNED_BYTE, false, false, true, GLColor32U(240, 0, 0, 1));
}
// Use this to select which configurations (e.g. which renderer, which GLES major version) these
// tests should be run against.
ANGLE_INSTANTIATE_TEST(CopyTextureTest, ES2_D3D9(), ES2_D3D11(), ES2_OPENGL(), ES2_OPENGLES());
ANGLE_INSTANTIATE_TEST(CopyTextureTestES3, ES3_D3D11(), ES3_OPENGL(), ES3_OPENGLES());
} // namespace angle

Просмотреть файл

@ -182,6 +182,20 @@ GLColor32F ReadColor32F(GLint x, GLint y);
EXPECT_NEAR(expected.A, actual.A, abs_error); \
\
}
#define EXPECT_PIXEL32F_NEAR(x, y, r, g, b, a, abs_error) \
\
{ \
GLfloat pixel[4]; \
glReadPixels((x), (y), 1, 1, GL_RGBA, GL_FLOAT, pixel); \
EXPECT_GL_NO_ERROR(); \
EXPECT_NEAR((r), pixel[0], abs_error); \
EXPECT_NEAR((g), pixel[1], abs_error); \
EXPECT_NEAR((b), pixel[2], abs_error); \
EXPECT_NEAR((a), pixel[3], abs_error); \
}
#define EXPECT_PIXEL_COLOR32F_NEAR(x, y, angleColor, abs_error) \
EXPECT_PIXEL32F_NEAR(x, y, angleColor.R, angleColor.G, angleColor.B, angleColor.A, abs_error)
class EGLWindow;
class OSWindow;