[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Public WebGL] maximum length of identifiers in WebGL GLSL

Hi Gregg,

As I wrote on this topic, what feels like several months ago, MAX_VARYING_FLOATS is deprecated. The translator should do

#define MIN(x,y) x > y ? y : x

  glGetIntegerv(GL_MAX_VERTEX_OUTPUT_COMPONENTS, &max_vertex_output_comps);
  glGetIntegerv(GL_MAX_FRAGMENT_INPUT_COMPONENTS, &max_fragment_input_comps);
  max_varying_vectors_  = MIN(max_vertex_output_comps, max_fragment_input_comps) / 4;



On 2010/07/30 9:25, Gregg Tavares (wrk) wrote:

Coincidently I was going to post a similar question with regards to gl_MaxVertexUniformVectors, gl_MaxFragmentUniformVectors and gl_MaxVaryingVectors ; they do not exist on GL desktop so I guess a GLSL ES to GLSL validator/translator needs to do something here.

Should the translator replace references to those with a literal value as in ES 2.0 spec (ie. 256, 256 and 15 respectively) or use a calculated value using the desktop's gl_Max**Components* with some formula to find the **Vector* equivalent ?

The translator already does this and uses values queried from GL

      GL_MAX_FRAGMENT_UNIFORM_COMPONENTS, &max_fragment_uniform_vectors_);
  max_fragment_uniform_vectors_ /= 4;

  glGetIntegerv(GL_MAX_VARYING_FLOATS, &max_varying_vectors_);
  max_varying_vectors_ /= 4;

  glGetIntegerv(GL_MAX_VERTEX_UNIFORM_COMPONENTS, &max_vertex_uniform_vectors_);
  max_vertex_uniform_vectors_ /= 4;



fn:Mark Callow
org:HI Corporation;Middleware Development
adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan
title:Chief Architect
tel;work:+81 3 3710 9367
tel;fax:+81 3 5773 8660
url:http://www.hicorp.co.jp, http://www.mascotcapsule.com