<div class="gmail_quote">[snip]<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div><div>
> +static INLINE float rgb9e5_MaxOf3(float x, float y, float z)<br>
> +{<br>
> + if (x > y) {<br>
> + return MAX2(x, z);<br>
> + } else {<br>
> + return MAX2(y, z);<br>
> + }<br>
> +}<br>
<br>
</div></div>On 04/26/2011 03:57 AM, Marek Olšák wrote:<br>This could probably be a MAX3 macro defined in the same place as the<br>
existing MAX2 macro. Also, why did you implement as you did instead of<br>
<br>
MAX2(MAX2(x,y),z)<br>
<br>
Just curious...<br></blockquote><div><br>It might be faster without common subexpression elimination. Not sure what gcc can do. I haven't given it much thought.<br><br></div><blockquote class="gmail_quote" style="margin:0pt 0pt 0pt 0.8ex;border-left:1px solid rgb(204, 204, 204);padding-left:1ex">
<div><div></div><div><br>
> diff --git a/src/mesa/main/texformat.c b/src/mesa/main/texformat.c<br>
> index cbebec9..3520f24 100644<br>
> --- a/src/mesa/main/texformat.c<br>
> +++ b/src/mesa/main/texformat.c<br>
> @@ -382,6 +382,16 @@ _mesa_choose_tex_format( struct gl_context *ctx, GLint internalFormat,<br>
> }<br>
> }<br>
><br>
> + if (ctx->Extensions.EXT_texture_shared_exponent) {<br>
> + switch (internalFormat) {<br>
> + case GL_RGB9_E5:<br>
> + RETURN_IF_SUPPORTED(MESA_FORMAT_RGB9_E5_FLOAT);<br>
<br>
</div></div>I could envision the extension being enabled but the format not being<br>
supported by the hardware. This would be like the ARB_half_float_pixel<br>
code. In this case, the fallbacks should be:<br>
<br>
MESA_FORMAT_RGB_FLOAT16<br>
MESA_FORMAT_RGBA_FLOAT16<br>
MESA_FORMAT_RGB_FLOAT32<br>
MESA_FORMAT_RGBA_FLOAT32<br>
<br>
The real question is if we ever want to enable any of these "extra<br>
format" extensions without requireing real hardware support. If we<br>
don't, then these chases should assert that the format is supported.<br></blockquote><div><br>I don't think it's useful to fake the format with some other one. It's like RGTC: if hardware can't do it, let's disable it. RGB9_E5 is unsigned, and faking the "unsignedness" in the texstore path for RGBA32F would be unfun. Is there actually otherwise-GL3-capable hw which doesn't support it?<br>
<br>Marek<br></div></div>