[Mesa-dev] [PATCH] Match swrast modes more loosely.
Marek Olšák
maraeo at gmail.com
Thu Jul 23 13:11:14 PDT 2015
Removing the "__DRI_ATTRIB_DOUBLE_BUFFER" case fixes it.
I'm not familiar with this code. Some investigation would have to be
done to know why it broke.
Marek
On Thu, Jul 23, 2015 at 10:03 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
> Sure. It's not easy to grasp the side effects of this, so it doesn't
> surprise me.
>
> Do you know which hunk caused problems?
>
> Also, I wonder if it would be possible to make the relaxed matching specific
> to swrast. (Because for HW renderer it's pretty much guaranteed that the X
> visuals will match -- the problem is SW rendering with X servers running
> something else.)
>
> Jose
>
> On 23/07/15 20:54, Marek Olšák wrote:
>>
>> Hi Jose,
>>
>> FYI, I had to revert this, because it broke glxgears on radeonsi.
>>
>> Marek
>>
>> On Wed, Jul 15, 2015 at 3:25 PM, Jose Fonseca <jfonseca at vmware.com> wrote:
>>>
>>> From: Tom Hughes <tom at compton.nu>
>>>
>>> https://bugs.freedesktop.org/show_bug.cgi?id=90817
>>>
>>> Signed-off-by: Jose Fonseca <jfonseca at vmware.com>
>>>
>>> ---
>>> src/glx/dri_common.c | 59
>>> +++++++++++++++++++++++++++++++++++++++++++++++++++-
>>> 1 file changed, 58 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/src/glx/dri_common.c b/src/glx/dri_common.c
>>> index 63c8de3..1a62ee2 100644
>>> --- a/src/glx/dri_common.c
>>> +++ b/src/glx/dri_common.c
>>> @@ -266,6 +266,36 @@ scalarEqual(struct glx_config *mode, unsigned int
>>> attrib, unsigned int value)
>>> }
>>>
>>> static int
>>> +scalarGreaterEqual(struct glx_config *mode, unsigned int attrib,
>>> unsigned int value)
>>> +{
>>> + unsigned int glxValue;
>>> + int i;
>>> +
>>> + for (i = 0; i < ARRAY_SIZE(attribMap); i++)
>>> + if (attribMap[i].attrib == attrib) {
>>> + glxValue = *(unsigned int *) ((char *) mode +
>>> attribMap[i].offset);
>>> + return glxValue == GLX_DONT_CARE || glxValue >= value;
>>> + }
>>> +
>>> + return GL_TRUE; /* Is a non-existing attribute greater
>>> than or equal to value? */
>>> +}
>>> +
>>> +static int
>>> +booleanSupported(struct glx_config *mode, unsigned int attrib, unsigned
>>> int value)
>>> +{
>>> + unsigned int glxValue;
>>> + int i;
>>> +
>>> + for (i = 0; i < ARRAY_SIZE(attribMap); i++)
>>> + if (attribMap[i].attrib == attrib) {
>>> + glxValue = *(unsigned int *) ((char *) mode +
>>> attribMap[i].offset);
>>> + return glxValue == GLX_DONT_CARE || glxValue;
>>> + }
>>> +
>>> + return GL_TRUE; /* Is a non-existing attribute
>>> supported? */
>>> +}
>>> +
>>> +static int
>>> driConfigEqual(const __DRIcoreExtension *core,
>>> struct glx_config *config, const __DRIconfig *driConfig)
>>> {
>>> @@ -313,10 +343,37 @@ driConfigEqual(const __DRIcoreExtension *core,
>>> if (value & __DRI_ATTRIB_TEXTURE_RECTANGLE_BIT)
>>> glxValue |= GLX_TEXTURE_RECTANGLE_BIT_EXT;
>>> if (config->bindToTextureTargets != GLX_DONT_CARE &&
>>> - glxValue != config->bindToTextureTargets)
>>> + glxValue != (config->bindToTextureTargets & glxValue))
>>> + return GL_FALSE;
>>> + break;
>>> +
>>> + case __DRI_ATTRIB_STENCIL_SIZE:
>>> + case __DRI_ATTRIB_ACCUM_RED_SIZE:
>>> + case __DRI_ATTRIB_ACCUM_GREEN_SIZE:
>>> + case __DRI_ATTRIB_ACCUM_BLUE_SIZE:
>>> + case __DRI_ATTRIB_ACCUM_ALPHA_SIZE:
>>> + if (value != 0 && !scalarEqual(config, attrib, value))
>>> return GL_FALSE;
>>> break;
>>>
>>> + case __DRI_ATTRIB_DOUBLE_BUFFER:
>>> + case __DRI_ATTRIB_BIND_TO_TEXTURE_RGB:
>>> + case __DRI_ATTRIB_BIND_TO_TEXTURE_RGBA:
>>> + case __DRI_ATTRIB_BIND_TO_MIPMAP_TEXTURE:
>>> + case __DRI_ATTRIB_FRAMEBUFFER_SRGB_CAPABLE:
>>> + if (value && !booleanSupported(config, attrib, value))
>>> + return GL_FALSE;
>>> + break;
>>> +
>>> + case __DRI_ATTRIB_SAMPLE_BUFFERS:
>>> + case __DRI_ATTRIB_SAMPLES:
>>> + case __DRI_ATTRIB_AUX_BUFFERS:
>>> + case __DRI_ATTRIB_MAX_PBUFFER_WIDTH:
>>> + case __DRI_ATTRIB_MAX_PBUFFER_HEIGHT:
>>> + case __DRI_ATTRIB_MAX_PBUFFER_PIXELS:
>>> + if (!scalarGreaterEqual(config, attrib, value))
>>> + return GL_FALSE;
>>> +
>>> default:
>>> if (!scalarEqual(config, attrib, value))
>>> return GL_FALSE;
>>> --
>>> 2.1.4
>>>
>>> _______________________________________________
>>> mesa-dev mailing list
>>> mesa-dev at lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
More information about the mesa-dev
mailing list