Commit 437cca5a by Geoff Lang Committed by Commit Bot

Add support for CHROMIUM_copy_texture with D3D9.

BUG=angleproject:1356 Change-Id: If63779e39609083deb6bb72dc8c29eaaa90c698c Reviewed-on: https://chromium-review.googlesource.com/339813 Commit-Queue: Geoff Lang <geofflang@chromium.org> Reviewed-by: 's avatarJamie Madill <jmadill@chromium.org>
parent 76cdbd51
...@@ -17,6 +17,8 @@ ...@@ -17,6 +17,8 @@
namespace gl namespace gl
{ {
class Framebuffer; class Framebuffer;
class Texture;
struct Extents;
struct Offset; struct Offset;
} }
...@@ -36,12 +38,23 @@ class Blit9 : angle::NonCopyable ...@@ -36,12 +38,23 @@ class Blit9 : angle::NonCopyable
// Copy from source surface to dest surface. // Copy from source surface to dest surface.
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left) // sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
gl::Error copy2D(const gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, const gl::Offset &destOffset, TextureStorage *storage, GLint level); gl::Error copy2D(const gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, const gl::Offset &destOffset, TextureStorage *storage, GLint level);
gl::Error copyCube(const gl::Framebuffer *framebuffer, const RECT &sourceRect, GLenum destFormat, const gl::Offset &destOffset, TextureStorage *storage, GLenum target, GLint level); gl::Error copyCube(const gl::Framebuffer *framebuffer,
const RECT &sourceRect,
// Copy from source surface to dest surface. GLenum destFormat,
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left) const gl::Offset &destOffset,
// source is interpreted as RGBA and destFormat specifies the desired result format. For example, if destFormat = GL_RGB, the alpha channel will be forced to 0. TextureStorage *storage,
gl::Error formatConvert(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, const gl::Offset &destOffset, IDirect3DSurface9 *dest); 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);
// 2x2 box filter sample from source to dest. // 2x2 box filter sample from source to dest.
// Requires that source is RGB(A) and dest has the same format as source. // Requires that source is RGB(A) and dest has the same format as source.
...@@ -54,23 +67,56 @@ class Blit9 : angle::NonCopyable ...@@ -54,23 +67,56 @@ class Blit9 : angle::NonCopyable
IDirect3DVertexBuffer9 *mQuadVertexBuffer; IDirect3DVertexBuffer9 *mQuadVertexBuffer;
IDirect3DVertexDeclaration9 *mQuadVertexDeclaration; IDirect3DVertexDeclaration9 *mQuadVertexDeclaration;
gl::Error setFormatConvertShaders(GLenum destFormat); // Copy from source texture to dest surface.
// sourceRect, xoffset, yoffset are in D3D coordinates (0,0 in upper-left)
gl::Error copy(IDirect3DSurface9 *source, const RECT &sourceRect, GLenum destFormat, const gl::Offset &destOffset, IDirect3DSurface9 *dest); // source is interpreted as RGBA and destFormat specifies the desired result format. For
gl::Error copySurfaceToTexture(IDirect3DSurface9 *surface, const RECT &sourceRect, IDirect3DTexture9 **outTexture); // example, if destFormat = GL_RGB, the alpha channel will be forced to 0.
void setViewport(const RECT &sourceRect, const gl::Offset &offset); gl::Error formatConvert(IDirect3DBaseTexture9 *source,
const RECT &sourceRect,
const gl::Extents &sourceSize,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error setFormatConvertShaders(GLenum destFormat,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error copy(IDirect3DSurface9 *source,
IDirect3DBaseTexture9 *sourceTexture,
const RECT &sourceRect,
GLenum destFormat,
const gl::Offset &destOffset,
IDirect3DSurface9 *dest,
bool flipY,
bool premultiplyAlpha,
bool unmultiplyAlpha);
gl::Error copySurfaceToTexture(IDirect3DSurface9 *surface,
const RECT &sourceRect,
IDirect3DBaseTexture9 **outTexture);
void setViewportAndShaderConstants(const RECT &sourceRect,
const gl::Extents &sourceSize,
const gl::Offset &offset,
bool flipY);
void setCommonBlitState(); void setCommonBlitState();
RECT getSurfaceRect(IDirect3DSurface9 *surface) const; RECT getSurfaceRect(IDirect3DSurface9 *surface) const;
gl::Extents getSurfaceSize(IDirect3DSurface9 *surface) const;
// This enum is used to index mCompiledShaders and mShaderSource. // This enum is used to index mCompiledShaders and mShaderSource.
enum ShaderId enum ShaderId
{ {
SHADER_VS_STANDARD, SHADER_VS_STANDARD,
SHADER_VS_FLIPY,
SHADER_PS_PASSTHROUGH, SHADER_PS_PASSTHROUGH,
SHADER_PS_LUMINANCE, SHADER_PS_LUMINANCE,
SHADER_PS_LUMINANCE_PREMULTIPLY_ALPHA,
SHADER_PS_LUMINANCE_UNMULTIPLY_ALPHA,
SHADER_PS_COMPONENTMASK, SHADER_PS_COMPONENTMASK,
SHADER_COUNT SHADER_PS_COMPONENTMASK_PREMULTIPLY_ALPHA,
SHADER_PS_COMPONENTMASK_UNMULTIPLY_ALPHA,
SHADER_COUNT,
}; };
// This actually contains IDirect3DVertexShader9 or IDirect3DPixelShader9 casted to IUnknown. // This actually contains IDirect3DVertexShader9 or IDirect3DPixelShader9 casted to IUnknown.
......
...@@ -2460,8 +2460,15 @@ gl::Error Renderer9::copyTexture(const gl::Texture *source, ...@@ -2460,8 +2460,15 @@ gl::Error Renderer9::copyTexture(const gl::Texture *source,
bool unpackPremultiplyAlpha, bool unpackPremultiplyAlpha,
bool unpackUnmultiplyAlpha) bool unpackUnmultiplyAlpha)
{ {
UNIMPLEMENTED(); RECT rect;
return gl::Error(GL_INVALID_OPERATION); 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);
} }
gl::Error Renderer9::copyCompressedTexture(const gl::Texture *source, gl::Error Renderer9::copyCompressedTexture(const gl::Texture *source,
......
...@@ -595,6 +595,7 @@ void GenerateCaps(IDirect3D9 *d3d9, ...@@ -595,6 +595,7 @@ void GenerateCaps(IDirect3D9 *d3d9,
extensions->unpackSubimage = true; extensions->unpackSubimage = true;
extensions->packSubimage = true; extensions->packSubimage = true;
extensions->syncQuery = extensions->fence; extensions->syncQuery = extensions->fence;
extensions->copyTexture = true;
// D3D9 has no concept of separate masks and refs for front and back faces in the depth stencil // D3D9 has no concept of separate masks and refs for front and back faces in the depth stencil
// state. // state.
......
...@@ -24,6 +24,23 @@ float4 luminanceps(float4 texcoord : TEXCOORD0) : COLOR ...@@ -24,6 +24,23 @@ float4 luminanceps(float4 texcoord : TEXCOORD0) : COLOR
return (tex2D(tex, texcoord.xy).xw * mult.xw + add.xw).xxxy; return (tex2D(tex, texcoord.xy).xw * mult.xw + add.xw).xxxy;
}; };
float4 luminancepremultps(float4 texcoord : TEXCOORD0) : COLOR
{
float4 luma = (tex2D(tex, texcoord.xy).xw * mult.xw + add.xw).xxxy;
luma.rgb *= luma.a;
return luma;
};
float4 luminanceunmultps(float4 texcoord : TEXCOORD0) : COLOR
{
float4 luma = (tex2D(tex, texcoord.xy).xw * mult.xw + add.xw).xxxy;
if (luma.a > 0.0f)
{
luma.rgb /= luma.a;
}
return luma;
};
// RGB/A Component Mask Pixel Shader // RGB/A Component Mask Pixel Shader
// Performs a mad operation using the texture's RGBA data with mult.xyzw and add.xyzw. // Performs a mad operation using the texture's RGBA data with mult.xyzw and add.xyzw.
// Returns data in the form of rgba // Returns data in the form of rgba
...@@ -31,3 +48,20 @@ float4 componentmaskps(float4 texcoord : TEXCOORD0) : COLOR ...@@ -31,3 +48,20 @@ float4 componentmaskps(float4 texcoord : TEXCOORD0) : COLOR
{ {
return tex2D(tex, texcoord.xy) * mult + add; return tex2D(tex, texcoord.xy) * mult + add;
}; };
float4 componentmaskpremultps(float4 texcoord : TEXCOORD0) : COLOR
{
float4 color = tex2D(tex, texcoord.xy) * mult + add;
color.rgb *= color.a;
return color;
};
float4 componentmaskunmultps(float4 texcoord : TEXCOORD0) : COLOR
{
float4 color = tex2D(tex, texcoord.xy) * mult + add;
if (color.a > 0.0f)
{
color.rgb /= color.a;
}
return color;
};
...@@ -11,6 +11,7 @@ struct VS_OUTPUT ...@@ -11,6 +11,7 @@ struct VS_OUTPUT
}; };
uniform float4 halfPixelSize : c0; uniform float4 halfPixelSize : c0;
uniform float4 texcoordOffset : c1;
// Standard Vertex Shader // Standard Vertex Shader
// Input 0 is the homogenous position. // Input 0 is the homogenous position.
...@@ -22,22 +23,7 @@ VS_OUTPUT standardvs(in float4 position : POSITION) ...@@ -22,22 +23,7 @@ VS_OUTPUT standardvs(in float4 position : POSITION)
VS_OUTPUT Out; VS_OUTPUT Out;
Out.position = position + halfPixelSize; Out.position = position + halfPixelSize;
Out.texcoord = position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0); Out.texcoord = ((position * float4(0.5, -0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0)) * float4(texcoordOffset.zw, 1.0, 1.0)) + float4(texcoordOffset.xy, 0, 0);
return Out;
};
// Flip Y Vertex Shader
// Input 0 is the homogenous position.
// Outputs the homogenous position as-is.
// Outputs a tex coord with (0,1) in the upper-left corner of the screen and (1,0) in the bottom right.
// C0.XY must be the half-pixel width and height. C0.ZW must be 0.
VS_OUTPUT flipyvs(in float4 position : POSITION)
{
VS_OUTPUT Out;
Out.position = position + halfPixelSize;
Out.texcoord = position * float4(0.5, 0.5, 1.0, 1.0) + float4(0.5, 0.5, 0, 0);
return Out; return Out;
}; };
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// Parameters:
//
// float4 add;
// float4 mult;
// sampler2D tex;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// mult c0 1
// add c1 1
// tex s0 1
//
ps_2_0
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mov r1, c0
mad r0, r0, r1, c1
mul r0.xyz, r0.w, r0
mov oC0, r0
// approximately 5 instruction slots used (1 texture, 4 arithmetic)
#endif
const BYTE g_ps20_componentmaskpremultps[] = {
0, 2, 255, 255, 254, 255, 50, 0, 67, 84, 65, 66, 28, 0, 0, 0, 143, 0, 0,
0, 0, 2, 255, 255, 3, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 0, 136, 0,
0, 0, 88, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 92, 0, 0, 0, 0,
0, 0, 0, 108, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0,
0, 0, 0, 0, 113, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0,
0, 0, 0, 0, 0, 97, 100, 100, 0, 1, 0, 3, 0, 1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0, 109, 117, 108, 116, 0, 116, 101, 120, 0, 171, 171, 171, 4,
0, 12, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 112, 115, 95, 50,
95, 48, 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, 171, 171, 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, 1, 0, 0, 2, 1, 0, 15, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0,
15, 128, 0, 0, 228, 128, 1, 0, 228, 128, 1, 0, 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};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// Parameters:
//
// float4 add;
// float4 mult;
// sampler2D tex;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// mult c0 1
// add c1 1
// tex s0 1
//
ps_2_0
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mov r1, c0
mad r0, r0, r1, c1
rcp r1.x, r0.w
mul r1.xyz, r0, r1.x
cmp r0.xyz, -r0.w, r0, r1
mov oC0, r0
// approximately 7 instruction slots used (1 texture, 6 arithmetic)
#endif
const BYTE g_ps20_componentmaskunmultps[] = {
0, 2, 255, 255, 254, 255, 50, 0, 67, 84, 65, 66, 28, 0, 0, 0, 143, 0, 0,
0, 0, 2, 255, 255, 3, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 0, 136, 0,
0, 0, 88, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 92, 0, 0, 0, 0,
0, 0, 0, 108, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0,
0, 0, 0, 0, 113, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0,
0, 0, 0, 0, 0, 97, 100, 100, 0, 1, 0, 3, 0, 1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0, 109, 117, 108, 116, 0, 116, 101, 120, 0, 171, 171, 171, 4,
0, 12, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 112, 115, 95, 50,
95, 48, 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, 171, 171, 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, 1, 0, 0, 2, 1, 0, 15, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0,
15, 128, 0, 0, 228, 128, 1, 0, 228, 128, 1, 0, 228, 160, 6, 0, 0, 2, 1,
0, 1, 128, 0, 0, 255, 128, 5, 0, 0, 3, 1, 0, 7, 128, 0, 0, 228, 128,
1, 0, 0, 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};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// Parameters:
//
// float4 halfPixelSize;
//
//
// Registers:
//
// Name Reg Size
// ------------- ----- ----
// halfPixelSize c0 1
//
vs_2_0
def c1, 0.5, 1, 0, 0
dcl_position v0
add oPos, v0, c0
mad oT0, v0, c1.xxyy, c1.xxzz
// approximately 2 instruction slots used
#endif
const BYTE g_vs20_flipyvs[] =
{
0, 2, 254, 255, 254, 255,
36, 0, 67, 84, 65, 66,
28, 0, 0, 0, 87, 0,
0, 0, 0, 2, 254, 255,
1, 0, 0, 0, 28, 0,
0, 0, 0, 1, 0, 0,
80, 0, 0, 0, 48, 0,
0, 0, 2, 0, 0, 0,
1, 0, 0, 0, 64, 0,
0, 0, 0, 0, 0, 0,
104, 97, 108, 102, 80, 105,
120, 101, 108, 83, 105, 122,
101, 0, 171, 171, 1, 0,
3, 0, 1, 0, 4, 0,
1, 0, 0, 0, 0, 0,
0, 0, 118, 115, 95, 50,
95, 48, 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,
171, 171, 81, 0, 0, 5,
1, 0, 15, 160, 0, 0,
0, 63, 0, 0, 128, 63,
0, 0, 0, 0, 0, 0,
0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 144, 2, 0, 0, 3,
0, 0, 15, 192, 0, 0,
228, 144, 0, 0, 228, 160,
4, 0, 0, 4, 0, 0,
15, 224, 0, 0, 228, 144,
1, 0, 80, 160, 1, 0,
160, 160, 255, 255, 0, 0
};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// Parameters:
//
// float4 add;
// float4 mult;
// sampler2D tex;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// mult c0 1
// add c1 1
// tex s0 1
//
ps_2_0
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mov r1.xw, c0
mad r0.x, r0.x, r1.x, c1.x
mad r0.y, r0.w, r1.w, c1.w
mul r1.xyz, r0.y, r0.x
mov r1.w, r0.y
mov oC0, r1
// approximately 7 instruction slots used (1 texture, 6 arithmetic)
#endif
const BYTE g_ps20_luminancepremultps[] = {
0, 2, 255, 255, 254, 255, 50, 0, 67, 84, 65, 66, 28, 0, 0, 0, 143, 0, 0,
0, 0, 2, 255, 255, 3, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 0, 136, 0,
0, 0, 88, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 92, 0, 0, 0, 0,
0, 0, 0, 108, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0,
0, 0, 0, 0, 113, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0,
0, 0, 0, 0, 0, 97, 100, 100, 0, 1, 0, 3, 0, 1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0, 109, 117, 108, 116, 0, 116, 101, 120, 0, 171, 171, 171, 4,
0, 12, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 112, 115, 95, 50,
95, 48, 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, 171, 171, 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, 1, 0, 0, 2, 1, 0, 9, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0,
1, 128, 0, 0, 0, 128, 1, 0, 0, 128, 1, 0, 0, 160, 4, 0, 0, 4, 0,
0, 2, 128, 0, 0, 255, 128, 1, 0, 255, 128, 1, 0, 255, 160, 5, 0, 0, 3,
1, 0, 7, 128, 0, 0, 85, 128, 0, 0, 0, 128, 1, 0, 0, 2, 1, 0, 8,
128, 0, 0, 85, 128, 1, 0, 0, 2, 0, 8, 15, 128, 1, 0, 228, 128, 255, 255,
0, 0};
#if 0
//
// Generated by Microsoft (R) HLSL Shader Compiler 6.3.9600.16384
//
// Parameters:
//
// float4 add;
// float4 mult;
// sampler2D tex;
//
//
// Registers:
//
// Name Reg Size
// ------------ ----- ----
// mult c0 1
// add c1 1
// tex s0 1
//
ps_2_0
dcl t0.xy
dcl_2d s0
texld r0, t0, s0
mov r1.xw, c0
mad r0.x, r0.x, r1.x, c1.x
mad r0.y, r0.w, r1.w, c1.w
rcp r0.z, r0.y
mul r0.z, r0.z, r0.x
cmp r1.xyz, -r0.y, r0.x, r0.z
mov r1.w, r0.y
mov oC0, r1
// approximately 9 instruction slots used (1 texture, 8 arithmetic)
#endif
const BYTE g_ps20_luminanceunmultps[] = {
0, 2, 255, 255, 254, 255, 50, 0, 67, 84, 65, 66, 28, 0, 0, 0, 143, 0, 0,
0, 0, 2, 255, 255, 3, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 0, 136, 0,
0, 0, 88, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 92, 0, 0, 0, 0,
0, 0, 0, 108, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 92, 0, 0, 0,
0, 0, 0, 0, 113, 0, 0, 0, 3, 0, 0, 0, 1, 0, 0, 0, 120, 0, 0,
0, 0, 0, 0, 0, 97, 100, 100, 0, 1, 0, 3, 0, 1, 0, 4, 0, 1, 0,
0, 0, 0, 0, 0, 0, 109, 117, 108, 116, 0, 116, 101, 120, 0, 171, 171, 171, 4,
0, 12, 0, 1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 112, 115, 95, 50,
95, 48, 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, 171, 171, 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, 1, 0, 0, 2, 1, 0, 9, 128, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0,
1, 128, 0, 0, 0, 128, 1, 0, 0, 128, 1, 0, 0, 160, 4, 0, 0, 4, 0,
0, 2, 128, 0, 0, 255, 128, 1, 0, 255, 128, 1, 0, 255, 160, 6, 0, 0, 2,
0, 0, 4, 128, 0, 0, 85, 128, 5, 0, 0, 3, 0, 0, 4, 128, 0, 0, 170,
128, 0, 0, 0, 128, 88, 0, 0, 4, 1, 0, 7, 128, 0, 0, 85, 129, 0, 0,
0, 128, 0, 0, 170, 128, 1, 0, 0, 2, 1, 0, 8, 128, 0, 0, 85, 128, 1,
0, 0, 2, 0, 8, 15, 128, 1, 0, 228, 128, 255, 255, 0, 0};
...@@ -5,62 +5,42 @@ ...@@ -5,62 +5,42 @@
// Parameters: // Parameters:
// //
// float4 halfPixelSize; // float4 halfPixelSize;
// float4 texcoordOffset;
// //
// //
// Registers: // Registers:
// //
// Name Reg Size // Name Reg Size
// ------------- ----- ---- // -------------- ----- ----
// halfPixelSize c0 1 // halfPixelSize c0 1
// texcoordOffset c1 1
// //
vs_2_0 vs_2_0
def c1, 0.5, -0.5, 1, 0 def c2, 0.5, -0.5, 1, 0
dcl_position v0 dcl_position v0
add oPos, v0, c0 add oPos, v0, c0
mad oT0, v0, c1.xyzz, c1.xxww mad r0, v0, c2.xyzz, c2.xxww
mov oT0.zw, r0
mad oT0.xy, r0, c1.zwzw, c1
// approximately 2 instruction slots used // approximately 4 instruction slots used
#endif #endif
const BYTE g_vs20_standardvs[] = const BYTE g_vs20_standardvs[] = {
{ 0, 2, 254, 255, 254, 255, 44, 0, 67, 84, 65, 66, 28, 0, 0, 0, 122, 0, 0,
0, 2, 254, 255, 254, 255, 0, 0, 2, 254, 255, 2, 0, 0, 0, 28, 0, 0, 0, 0, 1, 0, 0, 115, 0,
36, 0, 67, 84, 65, 66, 0, 0, 68, 0, 0, 0, 2, 0, 0, 0, 1, 0, 0, 0, 84, 0, 0, 0, 0,
28, 0, 0, 0, 87, 0, 0, 0, 0, 100, 0, 0, 0, 2, 0, 1, 0, 1, 0, 0, 0, 84, 0, 0, 0,
0, 0, 0, 2, 254, 255, 0, 0, 0, 0, 104, 97, 108, 102, 80, 105, 120, 101, 108, 83, 105, 122, 101, 0, 171,
1, 0, 0, 0, 28, 0, 171, 1, 0, 3, 0, 1, 0, 4, 0, 1, 0, 0, 0, 0, 0, 0, 0, 116, 101,
0, 0, 0, 1, 0, 0, 120, 99, 111, 111, 114, 100, 79, 102, 102, 115, 101, 116, 0, 118, 115, 95, 50, 95, 48,
80, 0, 0, 0, 48, 0, 0, 77, 105, 99, 114, 111, 115, 111, 102, 116, 32, 40, 82, 41, 32, 72, 76, 83, 76,
0, 0, 2, 0, 0, 0, 32, 83, 104, 97, 100, 101, 114, 32, 67, 111, 109, 112, 105, 108, 101, 114, 32, 54, 46,
1, 0, 0, 0, 64, 0, 51, 46, 57, 54, 48, 48, 46, 49, 54, 51, 56, 52, 0, 81, 0, 0, 5, 2, 0,
0, 0, 0, 0, 0, 0, 15, 160, 0, 0, 0, 63, 0, 0, 0, 191, 0, 0, 128, 63, 0, 0, 0, 0, 31,
104, 97, 108, 102, 80, 105, 0, 0, 2, 0, 0, 0, 128, 0, 0, 15, 144, 2, 0, 0, 3, 0, 0, 15, 192,
120, 101, 108, 83, 105, 122, 0, 0, 228, 144, 0, 0, 228, 160, 4, 0, 0, 4, 0, 0, 15, 128, 0, 0, 228,
101, 0, 171, 171, 1, 0, 144, 2, 0, 164, 160, 2, 0, 240, 160, 1, 0, 0, 2, 0, 0, 12, 224, 0, 0,
3, 0, 1, 0, 4, 0, 228, 128, 4, 0, 0, 4, 0, 0, 3, 224, 0, 0, 228, 128, 1, 0, 238, 160, 1,
1, 0, 0, 0, 0, 0, 0, 228, 160, 255, 255, 0, 0};
0, 0, 118, 115, 95, 50,
95, 48, 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,
171, 171, 81, 0, 0, 5,
1, 0, 15, 160, 0, 0,
0, 63, 0, 0, 0, 191,
0, 0, 128, 63, 0, 0,
0, 0, 31, 0, 0, 2,
0, 0, 0, 128, 0, 0,
15, 144, 2, 0, 0, 3,
0, 0, 15, 192, 0, 0,
228, 144, 0, 0, 228, 160,
4, 0, 0, 4, 0, 0,
15, 224, 0, 0, 228, 144,
1, 0, 164, 160, 1, 0,
240, 160, 255, 255, 0, 0
};
...@@ -21,10 +21,13 @@ if "%1" == "release" ( ...@@ -21,10 +21,13 @@ if "%1" == "release" (
:: | Input file | Entry point | Type | Output file | Debug | :: | Input file | Entry point | Type | Output file | Debug |
call:BuildShader Blit.vs standardvs vs_2_0 compiled\standardvs.h %debug% call:BuildShader Blit.vs standardvs vs_2_0 compiled\standardvs.h %debug%
call:BuildShader Blit.vs flipyvs vs_2_0 compiled\flipyvs.h %debug%
call:BuildShader Blit.ps passthroughps ps_2_0 compiled\passthroughps.h %debug% call:BuildShader Blit.ps passthroughps ps_2_0 compiled\passthroughps.h %debug%
call:BuildShader Blit.ps luminanceps ps_2_0 compiled\luminanceps.h %debug% call:BuildShader Blit.ps luminanceps ps_2_0 compiled\luminanceps.h %debug%
call:BuildShader Blit.ps luminancepremultps ps_2_0 compiled\luminancepremultps.h %debug%
call:BuildShader Blit.ps luminanceunmultps ps_2_0 compiled\luminanceunmultps.h %debug%
call:BuildShader Blit.ps componentmaskps ps_2_0 compiled\componentmaskps.h %debug% call:BuildShader Blit.ps componentmaskps ps_2_0 compiled\componentmaskps.h %debug%
call:BuildShader Blit.ps componentmaskpremultps ps_2_0 compiled\componentmaskpremultps.h %debug%
call:BuildShader Blit.ps componentmaskunmultps ps_2_0 compiled\componentmaskunmultps.h %debug%
echo. echo.
......
...@@ -304,8 +304,11 @@ ...@@ -304,8 +304,11 @@
'libANGLE/renderer/d3d/d3d9/ShaderExecutable9.cpp', 'libANGLE/renderer/d3d/d3d9/ShaderExecutable9.cpp',
'libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h', 'libANGLE/renderer/d3d/d3d9/ShaderExecutable9.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/componentmaskps.h', 'libANGLE/renderer/d3d/d3d9/shaders/compiled/componentmaskps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/flipyvs.h', 'libANGLE/renderer/d3d/d3d9/shaders/compiled/componentmaskpremultps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/componentmaskunmultps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/luminanceps.h', 'libANGLE/renderer/d3d/d3d9/shaders/compiled/luminanceps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/luminancepremultps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/luminanceunmultps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/passthroughps.h', 'libANGLE/renderer/d3d/d3d9/shaders/compiled/passthroughps.h',
'libANGLE/renderer/d3d/d3d9/shaders/compiled/standardvs.h', 'libANGLE/renderer/d3d/d3d9/shaders/compiled/standardvs.h',
'libANGLE/renderer/d3d/d3d9/StateManager9.cpp', 'libANGLE/renderer/d3d/d3d9/StateManager9.cpp',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment