[Mesa-dev] [PATCH 02/10] mesa: Add renderbuffer accessors for MESA_FORMAT_RGBA_FLOAT32.
Jose Fonseca
jfonseca at vmware.com
Mon Apr 18 14:33:49 PDT 2011
I don't want to make further comments about software rendering at this point.
But regardless, core Mesa should not have code disabled by TEXTURE_FLOAT_ENABLED, because patent doesn't apply equally to all drivers. For now we can say that svga pipe driver does not infringe. And it's possible that in the future the IHVs come forward and license the patent for their hardware that covers open source drivers. Such drivers can/should enable ARB_float_texture regardless of TEXTURE_FLOAT_ENABLED define.
Jose
----- Original Message -----
> From: "Marek Olšák" <maraeo at gmail.com>
> To: "Eric Anholt" <eric at anholt.net>, "José Fonseca"
> <jfonseca at vmware.com>
> Cc: mesa-dev at lists.freedesktop.org
> Sent: Monday, April 18, 2011 10:10:26 PM
> Subject: Re: [Mesa-dev] [PATCH 02/10] mesa: Add renderbuffer
> accessors for MESA_FORMAT_RGBA_FLOAT32.
> Hi Eric,
> I think José wanted TEXTURE_FLOAT_ENABLED to apply to hardware
> drivers only, because there is said to be prior art regarding
> software implementations. That's why I didn't use
> TEXTURE_FLOAT_ENABLED in any core components.
> Marek
> On Mon, Apr 18, 2011 at 10:37 PM, Eric Anholt < eric at anholt.net >
> wrote:
> > ---
>
> > src/mesa/main/renderbuffer.c | 33 +++++++++++++++++++++++++++++++++
>
> > 1 files changed, 33 insertions(+), 0 deletions(-)
>
> > diff --git a/src/mesa/main/renderbuffer.c
> > b/src/mesa/main/renderbuffer.c
>
> > index 4a4a917..a255ddd 100644
>
> > --- a/src/mesa/main/renderbuffer.c
>
> > +++ b/src/mesa/main/renderbuffer.c
>
> > @@ -113,6 +113,27 @@ get_row_generic(struct gl_context *ctx, struct
> > gl_renderbuffer *rb,
>
> > memcpy(values, src, count * _mesa_get_format_bytes(rb->Format));
>
> > }
>
> > +/* Only used for float textures currently, but might also be used
> > for
>
> > + * RGBA8888, RGBA16, etc.
>
> > + */
>
> > +#ifdef TEXTURE_FLOAT_ENABLED
>
> > +
>
> > +static void
>
> > +get_values_generic(struct gl_context *ctx, struct gl_renderbuffer
> > *rb,
>
> > + GLuint count, const GLint x[], const GLint y[], void *values)
>
> > +{
>
> > + int format_bytes = _mesa_get_format_bytes(rb->Format) /
> > sizeof(GLfloat);
>
> > + GLuint i;
>
> > +
>
> > + for (i = 0; i < count; i++) {
>
> > + const void *src = rb->GetPointer(ctx, rb, x[i], y[i]);
>
> > +
>
> > + memcpy(values + i * format_bytes, src, format_bytes);
>
> > + }
>
> > +}
>
> > +
>
> > +#endif /* TEXTURE_FLOAT_ENABLED */
>
> > +
>
> > /* For the GL_RED/GL_RG/GL_RGB format/DataType combinations (and
>
> > * GL_LUMINANCE/GL_INTENSITY?), the Put functions are a matter of
>
> > * storing those initial components of the value per pixel into the
>
> > @@ -1238,6 +1259,18 @@ _mesa_set_renderbuffer_accessors(struct
> > gl_renderbuffer *rb)
>
> > rb->PutMonoValues = put_mono_values_uint;
>
> > break;
>
> > +#ifdef TEXTURE_FLOAT_ENABLED
>
> > + case MESA_FORMAT_RGBA_FLOAT32:
>
> > + rb->GetRow = get_row_generic;
>
> > + rb->GetValues = get_values_generic;
>
> > + rb->PutRow = put_row_generic;
>
> > + rb->PutRowRGB = NULL;
>
> > + rb->PutMonoRow = put_mono_row_generic;
>
> > + rb->PutValues = put_values_generic;
>
> > + rb->PutMonoValues = put_mono_values_generic;
>
> > + break;
>
> > +#endif
>
> > +
>
> > default:
>
> > break;
>
> > }
>
> > --
>
> > 1.7.4.4
>
> > _______________________________________________
>
> > mesa-dev mailing list
>
> > mesa-dev at lists.freedesktop.org
>
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20110418/62c07d5b/attachment.html>
More information about the mesa-dev
mailing list