[PATCH] wined3d: Support D3DFMT_L8 format as render target when supported by GPU.

Paul Gofman gofmanp at gmail.com
Wed Mar 23 10:21:06 CDT 2016


On 03/23/2016 05:48 PM, Henri Verbeet wrote:
> On 23 March 2016 at 15:06, Paul Gofman <gofmanp at gmail.com> wrote:
>>
> How does it fail exactly? Does it fail to create a render target, or
> does it just not like the result from CheckDeviceFormat()? Is there
> any chance it would be happy with some other format instead, like e.g.
> R8_UNORM? For what it's worth, I just checked on Windows, and both L8
> and L16 seem to be supported as render targets on AMD as well.
It calls "d3d9_CheckDeviceFormat iface 0x13d108, adapter 0, device_type
0x1, adapter_format 0x16, usage 0x1, resource_type 0x3, format 0x32." in
the beginning, which checks for L8 availablity as render target. It
checks a lot of other formats the same way, most of them are OK. It just
stores the flag based on the returned value at this point. Later when it
comes to creating textures for render targets it does not attempt to
create it but writes an error message 'RenderTexture.Create failed:
format unsupported.' to stdout after checking the stored flag.

It also checks L8A8 format the same way, but claming it available as
render target did not seem to make it forget about L8 (I am not sure I
checked it all correctly though, may need to recheck). Probably the
simplest way to find out what else can it use is to find out how is it
happy on Windows, I think I can do it.

>> I know that GL spec does not suppose luminance as render target, and I
>> could not find any extension on Nvidia so far which is responsible for
>> allowing that. It just allows it, and does not give an error for
>> glGetInternalformativ.
> I'd like to avoid rendering to GL_LUMINANCE8 if we can, but GL_R8 with
> appropriate swizzles may be an alternative. We'll need that to
> implement luminance formats for core profiles anyway, and Matteo has a
> patch for that. That patch doesn't enable WINED3DFMT_FLAG_RENDERTARGET
> on WINED3DFMT_L8_UNORM yet, but it should be easy to add.
>
So I will try to find out what else can make it happy for now. If
nothing really, then I will wait for Matteo's patch to test enabling
WINED3DFMT_FLAG_RENDERTARGET for WINED3DFMT_L8_UNORM at that point.
>> I can change the whole test to use different values to have different
>> red and green channels after blending. I am just not sure how can I
>> guess "broken" values for D3DMT_L8, as I do not have any hardware which
>> has D3DFMT_L8 supported as RT and POSTPIXELSHADER_BLENDING not supported.
>>
> In theory the values should simply be the same as with
> D3DRS_ALPHABLENDENABLE disabled.
>
So maybe then I will just modify a test case for now and resend it
without touching wined3d code?





More information about the wine-devel mailing list