Hi Eric,<br><br>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.<br>
<br>Marek<br><br><div class="gmail_quote">On Mon, Apr 18, 2011 at 10:37 PM, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
---<br>
src/mesa/main/renderbuffer.c | 33 +++++++++++++++++++++++++++++++++<br>
1 files changed, 33 insertions(+), 0 deletions(-)<br>
<br>
diff --git a/src/mesa/main/renderbuffer.c b/src/mesa/main/renderbuffer.c<br>
index 4a4a917..a255ddd 100644<br>
--- a/src/mesa/main/renderbuffer.c<br>
+++ b/src/mesa/main/renderbuffer.c<br>
@@ -113,6 +113,27 @@ get_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,<br>
memcpy(values, src, count * _mesa_get_format_bytes(rb->Format));<br>
}<br>
<br>
+/* Only used for float textures currently, but might also be used for<br>
+ * RGBA8888, RGBA16, etc.<br>
+ */<br>
+#ifdef TEXTURE_FLOAT_ENABLED<br>
+<br>
+static void<br>
+get_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb,<br>
+ GLuint count, const GLint x[], const GLint y[], void *values)<br>
+{<br>
+ int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat);<br>
+ GLuint i;<br>
+<br>
+ for (i = 0; i < count; i++) {<br>
+ const void *src = rb->GetPointer(ctx, rb, x[i], y[i]);<br>
+<br>
+ memcpy(values + i * format_bytes, src, format_bytes);<br>
+ }<br>
+}<br>
+<br>
+#endif /* TEXTURE_FLOAT_ENABLED */<br>
+<br>
/* For the GL_RED/GL_RG/GL_RGB format/DataType combinations (and<br>
* GL_LUMINANCE/GL_INTENSITY?), the Put functions are a matter of<br>
* storing those initial components of the value per pixel into the<br>
@@ -1238,6 +1259,18 @@ _mesa_set_renderbuffer_accessors(struct gl_renderbuffer *rb)<br>
rb->PutMonoValues = put_mono_values_uint;<br>
break;<br>
<br>
+#ifdef TEXTURE_FLOAT_ENABLED<br>
+ case MESA_FORMAT_RGBA_FLOAT32:<br>
+ rb->GetRow = get_row_generic;<br>
+ rb->GetValues = get_values_generic;<br>
+ rb->PutRow = put_row_generic;<br>
+ rb->PutRowRGB = NULL;<br>
+ rb->PutMonoRow = put_mono_row_generic;<br>
+ rb->PutValues = put_values_generic;<br>
+ rb->PutMonoValues = put_mono_values_generic;<br>
+ break;<br>
+#endif<br>
+<br>
default:<br>
break;<br>
}<br>
<font color="#888888">--<br>
1.7.4.4<br>
<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></blockquote></div><br>