On 16 April 2013 14:48, Stefan Dösinger stefan@codeweavers.com wrote:
- if (gl_info->supported[ARB_TEXTURE_RECTANGLE])
shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n");
This may be a good idea anyway, but is this strictly required? IIRC ARB_texture_rectangle is the one special extension that's always implicitly enabled in GLSL if it's supported.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Am 2013-04-16 17:01, schrieb Henri Verbeet:
On 16 April 2013 14:48, Stefan Dösinger stefan@codeweavers.com wrote:
- if (gl_info->supported[ARB_TEXTURE_RECTANGLE]) +
shader_addline(buffer, "#extension GL_ARB_texture_rectangle : enable\n"); +
This may be a good idea anyway, but is this strictly required? IIRC ARB_texture_rectangle is the one special extension that's always implicitly enabled in GLSL if it's supported.
Yes, I get a compile error on Nvidia otherwise:
fixme:d3d_shader:print_glsl_info_log Info log received from GLSL shader #21: fixme:d3d_shader:print_glsl_info_log Fragment info fixme:d3d_shader:print_glsl_info_log ------------- fixme:d3d_shader:print_glsl_info_log 0(5) : error C7532: global type sampler2DRect requires "#version 140" or later fixme:d3d_shader:print_glsl_info_log 0(5) : error C0000: ... or #extension GL_ARB_texture_rectangle : enable fixme:d3d_shader:print_glsl_info_log 0(10) : error C7531: global function texture2DRect requires "#extension GL_ARB_texture_rectangle : enable" before use
This is on Nvidia 319.12, with ARB_texture_non_power_of_two disabled to test the RECT codepath. The d3d9 visual test uncovers this problem.
On 16 April 2013 17:10, Stefan Dösinger stefan@codeweavers.com wrote:
fixme:d3d_shader:print_glsl_info_log Info log received from GLSL shader #21: fixme:d3d_shader:print_glsl_info_log Fragment info fixme:d3d_shader:print_glsl_info_log ------------- fixme:d3d_shader:print_glsl_info_log 0(5) : error C7532: global type sampler2DRect requires "#version 140" or later fixme:d3d_shader:print_glsl_info_log 0(5) : error C0000: ... or #extension GL_ARB_texture_rectangle : enable fixme:d3d_shader:print_glsl_info_log 0(10) : error C7531: global function texture2DRect requires "#extension GL_ARB_texture_rectangle : enable" before use
This is on Nvidia 319.12, with ARB_texture_non_power_of_two disabled to test the RECT codepath. The d3d9 visual test uncovers this problem.
I think technically that's a bug in the driver (see issue 15 in the extension spec), but I suppose it makes sense for us to handle this like any other extension. (And actually it looks like there's already a comment about this in shader_glsl_generate_pshader(), originally added by 3fd0916654906d2e4d0091322ea3162c18848cd4, although it only mentions a warning.)