gfx/layers/d3d10/LayerManagerD3D10.fx

Thu, 22 Jan 2015 13:21:57 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 22 Jan 2015 13:21:57 +0100
branch
TOR_BUG_9701
changeset 15
b8a032363ba2
permissions
-rw-r--r--

Incorporate requested changes from Mozilla in review:
https://bugzilla.mozilla.org/show_bug.cgi?id=1123480#c6

     1 typedef float4 rect;
     2 cbuffer PerLayer {
     3   rect vTextureCoords;
     4   rect vLayerQuad;
     5   rect vMaskQuad;
     6   float fLayerOpacity;
     7   float4x4 mLayerTransform;
     8 }
    10 cbuffer PerOccasionalLayer {
    11   float4 vRenderTargetOffset;
    12   float4 fLayerColor;
    13 }
    15 cbuffer PerLayerManager {
    16   float4x4 mProjection;
    17 }
    19 BlendState Premul
    20 {
    21   AlphaToCoverageEnable = FALSE;
    22   BlendEnable[0] = TRUE;
    23   SrcBlend = One;
    24   DestBlend = Inv_Src_Alpha;
    25   BlendOp = Add;
    26   SrcBlendAlpha = One;
    27   DestBlendAlpha = Inv_Src_Alpha;
    28   BlendOpAlpha = Add;
    29   RenderTargetWriteMask[0] = 0x0F; // All
    30 };
    32 BlendState NonPremul
    33 {
    34   AlphaToCoverageEnable = FALSE;
    35   BlendEnable[0] = TRUE;
    36   SrcBlend = Src_Alpha;
    37   DestBlend = Inv_Src_Alpha;
    38   BlendOp = Add;
    39   SrcBlendAlpha = One;
    40   DestBlendAlpha = Inv_Src_Alpha;
    41   BlendOpAlpha = Add;
    42   RenderTargetWriteMask[0] = 0x0F; // All
    43 };
    45 BlendState NoBlendDual
    46 {
    47   AlphaToCoverageEnable = FALSE;
    48   BlendEnable[0] = FALSE;
    49   BlendEnable[1] = FALSE;
    50   RenderTargetWriteMask[0] = 0x0F; // All
    51   RenderTargetWriteMask[1] = 0x0F; // All
    52 };
    54 BlendState ComponentAlphaBlend
    55 {
    56   AlphaToCoverageEnable = FALSE;
    57   BlendEnable[0] = TRUE;
    58   SrcBlend = One;
    59   DestBlend = Inv_Src1_Color;
    60   BlendOp = Add;
    61   SrcBlendAlpha = One;
    62   DestBlendAlpha = Inv_Src_Alpha;
    63   BlendOpAlpha = Add;
    64   RenderTargetWriteMask[0] = 0x0F; // All
    65 };
    67 RasterizerState LayerRast
    68 {
    69   ScissorEnable = True;
    70   CullMode = None;
    71 };
    73 Texture2D tRGB;
    74 Texture2D tY;
    75 Texture2D tCb;
    76 Texture2D tCr;
    77 Texture2D tRGBWhite;
    78 Texture2D tMask;
    80 SamplerState LayerTextureSamplerLinear
    81 {
    82     Filter = MIN_MAG_MIP_LINEAR;
    83     AddressU = Clamp;
    84     AddressV = Clamp;
    85 };
    87 SamplerState LayerTextureSamplerPoint
    88 {
    89     Filter = MIN_MAG_MIP_POINT;
    90     AddressU = Clamp;
    91     AddressV = Clamp;
    92 };
    94 struct VS_INPUT {
    95   float2 vPosition : POSITION;
    96 };
    98 struct VS_OUTPUT {
    99   float4 vPosition : SV_Position;
   100   float2 vTexCoords : TEXCOORD0;
   101 };
   103 struct VS_MASK_OUTPUT {
   104   float4 vPosition : SV_Position;
   105   float2 vTexCoords : TEXCOORD0;
   106   float2 vMaskCoords : TEXCOORD1;
   107 };
   109 struct VS_MASK_3D_OUTPUT {
   110   float4 vPosition : SV_Position;
   111   float2 vTexCoords : TEXCOORD0;
   112   float3 vMaskCoords : TEXCOORD1;
   113 };
   115 struct PS_OUTPUT {
   116   float4 vSrc;
   117   float4 vAlpha;
   118 };
   120 struct PS_DUAL_OUTPUT {
   121   float4 vOutput1 : SV_Target0;
   122   float4 vOutput2 : SV_Target1;
   123 };
   125 float2 TexCoords(const float2 aPosition)
   126 {
   127   float2 result;
   128   const float2 size = vTextureCoords.zw;
   129   result.x = vTextureCoords.x + aPosition.x * size.x;
   130   result.y = vTextureCoords.y + aPosition.y * size.y;
   132   return result;
   133 }
   135 float4 TransformedPostion(float2 aInPosition)
   136 {
   137   // the current vertex's position on the quad
   138   float4 position = float4(0, 0, 0, 1);
   140   // We use 4 component floats to uniquely describe a rectangle, by the structure
   141   // of x, y, width, height. This allows us to easily generate the 4 corners
   142   // of any rectangle from the 4 corners of the 0,0-1,1 quad that we use as the
   143   // stream source for our LayerQuad vertex shader. We do this by doing:
   144   // Xout = x + Xin * width
   145   // Yout = y + Yin * height
   146   float2 size = vLayerQuad.zw;
   147   position.x = vLayerQuad.x + aInPosition.x * size.x;
   148   position.y = vLayerQuad.y + aInPosition.y * size.y;
   150   position = mul(mLayerTransform, position);
   152   return position;
   153 }
   155 float4 VertexPosition(float4 aTransformedPosition)
   156 {
   157   float4 result;
   158   result.w = aTransformedPosition.w;
   159   result.xyz = aTransformedPosition.xyz / aTransformedPosition.w;
   160   result -= vRenderTargetOffset;
   161   result.xyz *= result.w;
   163   result = mul(mProjection, result);
   165   return result;
   166 }
   168 VS_OUTPUT LayerQuadVS(const VS_INPUT aVertex)
   169 {
   170   VS_OUTPUT outp;
   171   float4 position = TransformedPostion(aVertex.vPosition);
   173   outp.vPosition = VertexPosition(position);
   174   outp.vTexCoords = TexCoords(aVertex.vPosition.xy);
   176   return outp;
   177 }
   179 VS_MASK_OUTPUT LayerQuadMaskVS(const VS_INPUT aVertex)
   180 {
   181   VS_MASK_OUTPUT outp;
   182   float4 position = TransformedPostion(aVertex.vPosition);
   184   outp.vPosition = VertexPosition(position);
   186   // calculate the position on the mask texture
   187   outp.vMaskCoords.x = (position.x - vMaskQuad.x) / vMaskQuad.z;
   188   outp.vMaskCoords.y = (position.y - vMaskQuad.y) / vMaskQuad.w;
   190   outp.vTexCoords = TexCoords(aVertex.vPosition.xy);
   192   return outp;
   193 }
   195 VS_MASK_3D_OUTPUT LayerQuadMask3DVS(const VS_INPUT aVertex)
   196 {
   197   VS_MASK_3D_OUTPUT outp;
   198   float4 position = TransformedPostion(aVertex.vPosition);
   200   outp.vPosition = VertexPosition(position);
   202   // calculate the position on the mask texture
   203   position.xyz /= position.w;
   204   outp.vMaskCoords.x = (position.x - vMaskQuad.x) / vMaskQuad.z;
   205   outp.vMaskCoords.y = (position.y - vMaskQuad.y) / vMaskQuad.w;
   206   // We use the w coord to do non-perspective correct interpolation:
   207   // the quad might be transformed in 3D, in which case it will have some
   208   // perspective. The graphics card will do perspective-correct interpolation
   209   // of the texture, but our mask is already transformed and so we require
   210   // linear interpolation. Therefore, we must correct the interpolation
   211   // ourselves, we do this by multiplying all coords by w here, and dividing by
   212   // w in the pixel shader (post-interpolation), we pass w in outp.vMaskCoords.z.
   213   // See http://en.wikipedia.org/wiki/Texture_mapping#Perspective_correctness
   214   outp.vMaskCoords.z = 1;
   215   outp.vMaskCoords *= position.w;
   217   outp.vTexCoords = TexCoords(aVertex.vPosition.xy);
   219   return outp;
   220 }
   222 float4 RGBAShaderMask(const VS_MASK_OUTPUT aVertex, uniform sampler aSampler) : SV_Target
   223 {
   224   float2 maskCoords = aVertex.vMaskCoords;
   225   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   226   return tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity * mask;
   227 }
   229 float4 RGBAShaderLinearMask3D(const VS_MASK_3D_OUTPUT aVertex) : SV_Target
   230 {
   231   float2 maskCoords = aVertex.vMaskCoords.xy / aVertex.vMaskCoords.z;
   232   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   233   return tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) * fLayerOpacity * mask;
   234 }
   236 float4 RGBShaderMask(const VS_MASK_OUTPUT aVertex, uniform sampler aSampler) : SV_Target
   237 {
   238   float4 result;
   239   result = tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity;
   240   result.a = fLayerOpacity;
   242   float2 maskCoords = aVertex.vMaskCoords;
   243   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   244   return result * mask;
   245 }
   247 float4 CalculateYCbCrColor(const float2 aTexCoords)
   248 {
   249   float4 yuv;
   250   float4 color;
   252   yuv.r = tCr.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.5;
   253   yuv.g = tY.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.0625;
   254   yuv.b = tCb.Sample(LayerTextureSamplerLinear, aTexCoords).a - 0.5;
   256   color.r = yuv.g * 1.164 + yuv.r * 1.596;
   257   color.g = yuv.g * 1.164 - 0.813 * yuv.r - 0.391 * yuv.b;
   258   color.b = yuv.g * 1.164 + yuv.b * 2.018;
   259   color.a = 1.0f;
   261   return color;
   262 }
   264 float4 YCbCrShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
   265 {
   266   float2 maskCoords = aVertex.vMaskCoords;
   267   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   269   return CalculateYCbCrColor(aVertex.vTexCoords) * fLayerOpacity * mask;
   270 }
   272 PS_OUTPUT ComponentAlphaShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
   273 {
   274   PS_OUTPUT result;
   276   result.vSrc = tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords);
   277   result.vAlpha = 1.0 - tRGBWhite.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) + result.vSrc;
   278   result.vSrc.a = result.vAlpha.g;
   280   float2 maskCoords = aVertex.vMaskCoords;
   281   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   282   result.vSrc *= fLayerOpacity * mask;
   283   result.vAlpha *= fLayerOpacity * mask;
   285   return result;
   286 }
   288 float4 SolidColorShaderMask(const VS_MASK_OUTPUT aVertex) : SV_Target
   289 {
   290   float2 maskCoords = aVertex.vMaskCoords;
   291   float mask = tMask.Sample(LayerTextureSamplerLinear, maskCoords).a;
   292   return fLayerColor * mask;
   293 }
   295 /*
   296  *  Un-masked versions
   297  *************************************************************
   298  */
   299 float4 RGBAShader(const VS_OUTPUT aVertex, uniform sampler aSampler) : SV_Target
   300 {
   301   return tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity;
   302 }
   304 float4 RGBShader(const VS_OUTPUT aVertex, uniform sampler aSampler) : SV_Target
   305 {
   306   float4 result;
   307   result = tRGB.Sample(aSampler, aVertex.vTexCoords) * fLayerOpacity;
   308   result.a = fLayerOpacity;
   309   return result;
   310 }
   312 float4 YCbCrShader(const VS_OUTPUT aVertex) : SV_Target
   313 {
   314   return CalculateYCbCrColor(aVertex.vTexCoords) * fLayerOpacity;
   315 }
   317 PS_OUTPUT ComponentAlphaShader(const VS_OUTPUT aVertex) : SV_Target
   318 {
   319   PS_OUTPUT result;
   321   result.vSrc = tRGB.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords);
   322   result.vAlpha = 1.0 - tRGBWhite.Sample(LayerTextureSamplerLinear, aVertex.vTexCoords) + result.vSrc;
   323   result.vSrc.a = result.vAlpha.g;
   324   result.vSrc *= fLayerOpacity;
   325   result.vAlpha *= fLayerOpacity;
   326   return result;
   327 }
   329 float4 SolidColorShader(const VS_OUTPUT aVertex) : SV_Target
   330 {
   331   return fLayerColor;
   332 }
   334 PS_DUAL_OUTPUT AlphaExtractionPrepareShader(const VS_OUTPUT aVertex)
   335 {
   336   PS_DUAL_OUTPUT result;
   337   result.vOutput1 = float4(0, 0, 0, 1);
   338   result.vOutput2 = float4(1, 1, 1, 1);
   339   return result;
   340 }
   342 technique10 RenderRGBLayerPremul
   343 {
   344   pass P0
   345   {
   346     SetRasterizerState( LayerRast );
   347     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   348     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   349     SetGeometryShader( NULL );
   350     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShader(LayerTextureSamplerLinear) ) );
   351   }
   352 }
   354 technique10 RenderRGBLayerPremulPoint
   355 {
   356   pass P0
   357   {
   358     SetRasterizerState( LayerRast );
   359     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   360     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   361     SetGeometryShader( NULL );
   362     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShader(LayerTextureSamplerPoint) ) );
   363   }
   364 }
   366 technique10 RenderRGBALayerPremul
   367 {
   368   pass P0
   369   {
   370     SetRasterizerState( LayerRast );
   371     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   372     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   373     SetGeometryShader( NULL );
   374     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerLinear) ) );
   375   }
   376 }
   378 technique10 RenderRGBALayerNonPremul
   379 {
   380   pass P0
   381   {
   382     SetRasterizerState( LayerRast );
   383     SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   384     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   385     SetGeometryShader( NULL );
   386     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerLinear) ) );
   387   }
   388 }
   390 technique10 RenderRGBALayerPremulPoint
   391 {
   392   pass P0
   393   {
   394     SetRasterizerState( LayerRast );
   395     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   396     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   397     SetGeometryShader( NULL );
   398     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerPoint) ) );
   399   }
   400 }
   402 technique10 RenderRGBALayerNonPremulPoint
   403 {
   404   pass P0
   405   {
   406     SetRasterizerState( LayerRast );
   407     SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   408     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   409     SetGeometryShader( NULL );
   410     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShader(LayerTextureSamplerPoint) ) );
   411   }
   412 }
   414 technique10 RenderYCbCrLayer
   415 {
   416   pass P0
   417   {
   418     SetRasterizerState( LayerRast );
   419     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   420     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   421     SetGeometryShader( NULL );
   422     SetPixelShader( CompileShader( ps_4_0_level_9_3, YCbCrShader() ) );
   423   }
   424 }
   426 technique10 RenderComponentAlphaLayer
   427 {
   428   Pass P0
   429   {
   430     SetRasterizerState( LayerRast );
   431     SetBlendState( ComponentAlphaBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   432     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   433     SetGeometryShader( NULL );
   434     SetPixelShader( CompileShader( ps_4_0_level_9_3, ComponentAlphaShader() ) );
   435   }
   437 }
   439 technique10 RenderSolidColorLayer
   440 {
   441   pass P0
   442   {
   443     SetRasterizerState( LayerRast );
   444     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   445     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   446     SetGeometryShader( NULL );
   447     SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShader() ) );
   448   }
   449 }
   451 technique10 RenderClearLayer
   452 {
   453   pass P0
   454   {
   455     SetRasterizerState( LayerRast );
   456     SetBlendState( NoBlendDual, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   457     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   458     SetGeometryShader( NULL );
   459     SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShader() ) );
   460   }
   461 }
   463 technique10 PrepareAlphaExtractionTextures
   464 {
   465     pass P0
   466     {
   467         SetRasterizerState( LayerRast );
   468         SetBlendState( NoBlendDual, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   469         SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadVS() ) );
   470         SetGeometryShader( NULL );
   471         SetPixelShader( CompileShader( ps_4_0_level_9_3, AlphaExtractionPrepareShader() ) );
   472     }
   473 }
   475 technique10 RenderRGBLayerPremulMask
   476 {
   477   pass P0
   478   {
   479     SetRasterizerState( LayerRast );
   480     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   481     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   482     SetGeometryShader( NULL );
   483     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShaderMask(LayerTextureSamplerLinear) ) );
   484   }
   485 }
   487 technique10 RenderRGBLayerPremulPointMask
   488 {
   489   pass P0
   490   {
   491     SetRasterizerState( LayerRast );
   492     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   493     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   494     SetGeometryShader( NULL );
   495     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBShaderMask(LayerTextureSamplerPoint) ) );
   496   }
   497 }
   499 technique10 RenderRGBALayerPremulMask
   500 {
   501   pass P0
   502   {
   503     SetRasterizerState( LayerRast );
   504     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   505     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   506     SetGeometryShader( NULL );
   507     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerLinear) ) );
   508   }
   509 }
   511 technique10 RenderRGBALayerPremulMask3D
   512 {
   513   pass P0
   514   {
   515     SetRasterizerState( LayerRast );
   516     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   517     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMask3DVS() ) );
   518     SetGeometryShader( NULL );
   519     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderLinearMask3D() ) );
   520   }
   521 }
   523 technique10 RenderRGBALayerNonPremulMask
   524 {
   525   pass P0
   526   {
   527     SetRasterizerState( LayerRast );
   528     SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   529     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   530     SetGeometryShader( NULL );
   531     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerLinear) ) );
   532   }
   533 }
   535 technique10 RenderRGBALayerPremulPointMask
   536 {
   537   pass P0
   538   {
   539     SetRasterizerState( LayerRast );
   540     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   541     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   542     SetGeometryShader( NULL );
   543     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerPoint) ) );
   544   }
   545 }
   547 technique10 RenderRGBALayerNonPremulPointMask
   548 {
   549   pass P0
   550   {
   551     SetRasterizerState( LayerRast );
   552     SetBlendState( NonPremul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   553     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   554     SetGeometryShader( NULL );
   555     SetPixelShader( CompileShader( ps_4_0_level_9_3, RGBAShaderMask(LayerTextureSamplerPoint) ) );
   556   }
   557 }
   559 technique10 RenderYCbCrLayerMask
   560 {
   561   pass P0
   562   {
   563     SetRasterizerState( LayerRast );
   564     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   565     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   566     SetGeometryShader( NULL );
   567     SetPixelShader( CompileShader( ps_4_0_level_9_3, YCbCrShaderMask() ) );
   568   }
   569 }
   571 technique10 RenderComponentAlphaLayerMask
   572 {
   573   Pass P0
   574   {
   575     SetRasterizerState( LayerRast );
   576     SetBlendState( ComponentAlphaBlend, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   577     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   578     SetGeometryShader( NULL );
   579     SetPixelShader( CompileShader( ps_4_0_level_9_3, ComponentAlphaShaderMask() ) );
   580   }
   581 }
   583 technique10 RenderSolidColorLayerMask
   584 {
   585   pass P0
   586   {
   587     SetRasterizerState( LayerRast );
   588     SetBlendState( Premul, float4( 0.0f, 0.0f, 0.0f, 0.0f ), 0xFFFFFFFF );
   589     SetVertexShader( CompileShader( vs_4_0_level_9_3, LayerQuadMaskVS() ) );
   590     SetGeometryShader( NULL );
   591     SetPixelShader( CompileShader( ps_4_0_level_9_3, SolidColorShaderMask() ) );
   592   }
   593 }

mercurial