<div dir="ltr"><br><div class="gmail_extra"><div class="gmail_quote">On Mon, Nov 11, 2013 at 11:15 AM, Ian Romanick <span dir="ltr"><<a href="mailto:idr@freedesktop.org" target="_blank">idr@freedesktop.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">On 11/05/2013 11:36 AM, Courtney Goeltzenleuchter wrote:<br>
> On Tue, Nov 5, 2013 at 12:22 PM, Ian Romanick <<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a><br>
</div><div><div class="h5">> <mailto:<a href="mailto:idr@freedesktop.org">idr@freedesktop.org</a>>> wrote:<br>
><br>
> On 11/05/2013 09:44 AM, Chris Forbes wrote:<br>
> >> So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture.<br>
> Hmm...<br>
> ><br>
> > My understanding is you can't actually, since views can only be<br>
> > created from immutable-format textures, and GL_LUMINANCE is not a<br>
> > sized internalformat, so it can't be used with TexStorage?<br>
><br>
> I was just using GL_LUMINANCE as shorthand for GL_LUMINANCE4,<br>
> GL_LUMINANCE8, GL_LUMINANCE12, and GL_LUMINANCE16. As far as I can<br>
> tell,<br>
><br>
> glGenTextures(1, &tex);<br>
> glBindTexture(GL_TEXTURE_2D, tex);<br>
> glTexStorage2D(GL_TEXTURE_2D,<br>
> 8,<br>
> GL_LUMINANCE8,<br>
> 1024, 1024);<br>
><br>
> is perfectly valid. Sayeth GL_ARB_texture_storage:<br>
><br>
> Accepted by the <internalformat> parameter of TexStorage* when<br>
> implemented on OpenGL ES:<br>
><br>
> ALPHA8_EXT 0x803C<br>
> LUMINANCE8_EXT 0x8040<br>
> LUMINANCE8_ALPHA8_EXT 0x8045<br>
><br>
> I guess that means GL_LUMINANCE4, GL_LUMINANCE12, and GL_LUMINANCE16 are<br>
> out. As are all GL_INTENSITY formats. There are still these three<br>
> legacy formats to handle.<br>
><br>
> So, if we support GL_ARB_texture_view in a compatibility profile,<br>
><br>
> glGenTextures(1, &view);<br>
> glTextureView(view,<br>
> GL_TEXTURE_2D,<br>
> tex,<br>
> GL_LUMINANCE8,<br>
> 1, 1, 1, 1);<br>
><br>
> is also valid.<br>
><br>
> Right?<br>
><br>
><br>
> The spec is pickier than that. For 8bit texels the allowed internal<br>
> formats are: R8UI, R8I, R8, R8_SNORM<br>
> I use the table specified in the ARB_texture_view to translate the<br>
> target internalFormat passed to glTextureView into a VIEW_CLASS.<br>
> GL_LUMINANCE8 does not have a valid VIEW_CLASS and could not match the<br>
> internal format of the source texture.<br>
<br>
</div></div>I don't think it matters that GL_LUMINANCE8 is missing from the table or<br>
that it doesn't have a VIEW_CLASS. The GL_ARB_texture_view spec says<br>
(emphasis mine):<br>
<div class="im"><br>
The two textures' internal formats must be compatible according to<br>
Table 3.X.2 (Compatible internal formats for TextureView) if the<br>
</div> internal format exists in that table and *the internal formats<br>
must be identical if not in that table*, or else an<br>
INVALID_OPERATION error is generated.<br>
<br>
In my above code example, the internal formats are identical. By my<br>
reading of the above quoted text, that code is legal. We should modify<br>
one of the texture_view tests to use these legacy formats, and try that<br>
test on NVIDIA with a compatibility profile.<br></blockquote><div><br></div>Good point. I'll talk with Jon about testing that if we don't already.<div><br></div><div>Courtney</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
> That makes me wonder, should I be trying to map the target<br>
> internalformat into a driver internal format?<br>
><br>
> Courtney<br>
><br>
> --<br>
> Courtney Goeltzenleuchter<br>
> LunarG<br>
<br>
</div></div></blockquote></div><br><br clear="all"><div><br></div>-- <br><div dir="ltr">Courtney Goeltzenleuchter<br><div>LunarG</div><div><img src="http://media.lunarg.com/wp-content/themes/LunarG/images/logo.png" width="96" height="65"><br>
</div></div>
</div></div>