Re: [Mesa-dev] [PATCH 04/12] mesa/format_info: Add support for the BPTC layout

2014-08-07 Thread Neil Roberts
Jason Ekstrand  writes:

> Sorry, said that just a little early.  Do we really want 4 bits for a
> floating-point format?  How many bits does nvidia report?

NVidia reports the RGB components as 8/8/8 for the two normalized
formats and 32/32/32 for the two half-float formats. I think the 8 makes
some sense because the interpolation phase of the decompression is done
on an 8-bit value so it you wanted to accurately store all of the
potential values of the decompressed image you would need 8 bits. The 32
bits is a bit more weird because the decompressor can only generate
half-float values so at most 16 bits should be needed. I don't know what
it says for the alpha components because I just now realised that I made
a mistake in the quick test code that I wrote late last night when I had
access to an NVidia card.

It also says 8/8/8 for the DXT3 and DXT5 formats of S3TC so I guess if
we wanted to copy what NVidia does we could also change the bits we
report for those formats.

Regards,
- Neil
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 04/12] mesa/format_info: Add support for the BPTC layout

2014-08-06 Thread Jason Ekstrand
Sorry, said that just a little early.  Do we really want 4 bits for a
floating-point format?  How many bits does nvidia report?
--Jason


On Wed, Aug 6, 2014 at 9:55 AM, Jason Ekstrand  wrote:

> This looks fine to me.
> Reviewed-by: Jason Ekstrand 
>
>
> On Wed, Aug 6, 2014 at 9:27 AM, Neil Roberts  wrote:
>
>> Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC
>> depend
>> on the mode but as it only has to be an approximation we can set it to 4
>> like
>> for S3TC.
>> ---
>>  src/mesa/main/format_info.py | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
>> index a0eecd3..fc40dc4 100644
>> --- a/src/mesa/main/format_info.py
>> +++ b/src/mesa/main/format_info.py
>> @@ -110,7 +110,7 @@ def get_channel_bits(fmat, chan_name):
>> if fmat.is_compressed():
>># These values are pretty-much bogus, but OpenGL requires that we
>># return an "approximate" number of bits.
>> -  if fmat.layout == 's3tc':
>> +  if fmat.layout in ('s3tc', 'bptc'):
>>   return 4 if fmat.has_channel(chan_name) else 0
>>elif fmat.layout == 'fxt1':
>>   if chan_name in 'rgb':
>> --
>> 1.9.3
>>
>> ___
>> mesa-dev mailing list
>> mesa-dev@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>>
>
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


Re: [Mesa-dev] [PATCH 04/12] mesa/format_info: Add support for the BPTC layout

2014-08-06 Thread Jason Ekstrand
This looks fine to me.
Reviewed-by: Jason Ekstrand 


On Wed, Aug 6, 2014 at 9:27 AM, Neil Roberts  wrote:

> Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC
> depend
> on the mode but as it only has to be an approximation we can set it to 4
> like
> for S3TC.
> ---
>  src/mesa/main/format_info.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
> index a0eecd3..fc40dc4 100644
> --- a/src/mesa/main/format_info.py
> +++ b/src/mesa/main/format_info.py
> @@ -110,7 +110,7 @@ def get_channel_bits(fmat, chan_name):
> if fmat.is_compressed():
># These values are pretty-much bogus, but OpenGL requires that we
># return an "approximate" number of bits.
> -  if fmat.layout == 's3tc':
> +  if fmat.layout in ('s3tc', 'bptc'):
>   return 4 if fmat.has_channel(chan_name) else 0
>elif fmat.layout == 'fxt1':
>   if chan_name in 'rgb':
> --
> 1.9.3
>
> ___
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev


[Mesa-dev] [PATCH 04/12] mesa/format_info: Add support for the BPTC layout

2014-08-06 Thread Neil Roberts
Adds the ‘bptc’ layout to get_channel_bits. The channel bits for BPTC depend
on the mode but as it only has to be an approximation we can set it to 4 like
for S3TC.
---
 src/mesa/main/format_info.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/main/format_info.py b/src/mesa/main/format_info.py
index a0eecd3..fc40dc4 100644
--- a/src/mesa/main/format_info.py
+++ b/src/mesa/main/format_info.py
@@ -110,7 +110,7 @@ def get_channel_bits(fmat, chan_name):
if fmat.is_compressed():
   # These values are pretty-much bogus, but OpenGL requires that we
   # return an "approximate" number of bits.
-  if fmat.layout == 's3tc':
+  if fmat.layout in ('s3tc', 'bptc'):
  return 4 if fmat.has_channel(chan_name) else 0
   elif fmat.layout == 'fxt1':
  if chan_name in 'rgb':
-- 
1.9.3

___
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/mesa-dev