Closed Bug 940959 Opened 12 years ago Closed 12 years ago

Use luminance textures instead of alpaha textures in D3D9 and D3D11 shaders.

Categories

(Core :: Graphics: Layers, defect)

x86_64
Windows Phone 7
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: nical, Assigned: nical)

References

Details

Attachments

(4 files)

Our D3D shaders are using luminance textures for the Y Cb and Cr planes, while using alpha textures for masks. This makes it impractical to refer to 8bits one-channel textures in a generic way, and does not play well with most of Gecko not making a difference between A8 and L8 (Moz2D for instance only has FORMAT_A8). Our GL shaders, on the other hand always use GL_LUMINANCE textures, so no distinction between masks and YUV planes, which is good. Let's do with D3D the same thing we do with GL.
Actually I am doing it the otherway around: YCbCr planes to use alpha textures. This is a much smaller change than switching masks to L8 because the latter requires to modify Moz2D, and the YCbCr path is more contained and easier to test so I'd rather modify it than the mask stuff.
Attachment #8335370 - Flags: review?(ncameron)
Attachment #8335373 - Flags: review?(ncameron)
Attachment #8335374 - Flags: review?(ncameron)
This is just generated code so it actually contains nothing for review.
Comment on attachment 8335370 [details] [diff] [review] D3D9: Use A8 textures for YCbCr planes Review of attachment 8335370 [details] [diff] [review]: ----------------------------------------------------------------- Please use eight lines of context for your patches, it makes it much easier to review ::: gfx/layers/d3d9/LayerManagerD3D9Shaders.hlsl @@ +13,4 @@ > sampler s2DY; > sampler s2DCb; > sampler s2DCr; > +sampler s2DMask; this seems to be a noop, please remove it
Attachment #8335370 - Flags: review?(ncameron) → review+
Comment on attachment 8335373 [details] [diff] [review] D3D10: Use A8 textures for YCbCr planes Review of attachment 8335373 [details] [diff] [review]: ----------------------------------------------------------------- I don't think we need to do this do we? We are not going to use new textures here and we'll remove it soon in any case. r=me if you really want it though
Attachment #8335373 - Flags: review?(ncameron)
Attachment #8335374 - Flags: review?(ncameron) → review+
(In reply to Nick Cameron [:nrc] from comment #7) > Comment on attachment 8335373 [details] [diff] [review] > D3D10: Use A8 textures for YCbCr planes > > Review of attachment 8335373 [details] [diff] [review]: > ----------------------------------------------------------------- > > I don't think we need to do this do we? We are not going to use new textures > here and we'll remove it soon in any case. r=me if you really want it though We don't really need to, but I think it's dangerous to leave subtle differences like this between backends. The fact that D3D was doing something different than GL where it didn't need to already lead me to spend almost a day looking in the wrong directions. The patch is simple enough, I think, that the risk of taking it is smaller than the risk of later causing bugs because there is this subtle difference that may make things fail silently.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: