[Mesa-dev] [PATCH] svga: replace sampler assertion with conditional

Brian Paul brianp at vmware.com
Thu Apr 3 15:58:15 PDT 2014


On 04/03/2014 10:49 AM, Roland Scheidegger wrote:
> Am 03.04.2014 16:56, schrieb Brian Paul:
>> For TEX instructions, the set of samplers and sampler views should
>> be consistent.  The XA state tracker sometimes passes an inconsistent
>> set of samplers and sampler views.  Rather than assert and die, issue
>> a warning.
>>
>> Cc: "10.0" "10.1" <mesa-stable at lists.freedesktop.org>
>> ---
>>   src/gallium/drivers/svga/svga_state_fs.c |   12 ++++++++----
>>   1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/src/gallium/drivers/svga/svga_state_fs.c b/src/gallium/drivers/svga/svga_state_fs.c
>> index dde739c..1d7e43e 100644
>> --- a/src/gallium/drivers/svga/svga_state_fs.c
>> +++ b/src/gallium/drivers/svga/svga_state_fs.c
>> @@ -235,15 +235,19 @@ make_fs_key(const struct svga_context *svga,
>>      if (svga->curr.blend->need_white_fragments) {
>>         key->white_fragments = 1;
>>      }
>> -
>> +
>> +   if (svga->curr.num_sampler_views != svga->curr.num_samplers) {
>> +      debug_warn_once("svga: mismatched number of sampler views "
>> +                      "vs. samplers\n");
>> +   }
>> +
> Note it is a pretty weak check anyway - you could have the same number
> of views and samplers and they could still be mismatched (e.g. views
> 0/1/3 and and samplers 1/2/3).

Yeah.  Actually, I am tempted to beef-up the check to look for null vs 
non-null pointers since that's the case I'm interested in addressing...

-Brian



More information about the mesa-dev mailing list