<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Nov 5, 2013 at 12:22 PM, 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=""><div class="h5">On 11/05/2013 09:44 AM, Chris Forbes wrote:<br>
>> So, you can create a GL_LUMINANCE view of a GL_LUMINANCE texture. 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>
</div></div>I was just using GL_LUMINANCE as shorthand for GL_LUMINANCE4,<br>
GL_LUMINANCE8, GL_LUMINANCE12, and GL_LUMINANCE16. As far as I can 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></blockquote><div> </div><div>The spec is pickier than that. For 8bit texels the allowed internal formats are: <span style="color:rgb(0,0,0);white-space:pre-wrap"> R8UI, R8I, R8, R8_SNORM </span></div></div>I use the table specified in the ARB_texture_view to translate the target internalFormat passed to glTextureView into a VIEW_CLASS. GL_LUMINANCE8 does not have a valid VIEW_CLASS and could not match the internal format of the source texture.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">That makes me wonder, should I be trying to map the target internalformat into a driver internal format?</div><div class="gmail_extra"><br></div><div class="gmail_extra">
Courtney</div><div class="gmail_extra"><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>