[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Unused varyings.
- To: Steve Baker <email@example.com>
- Subject: Re: [Public WebGL] Unused varyings.
- From: Kenneth Waters <firstname.lastname@example.org>
- Date: Wed, 8 Dec 2010 10:43:21 -0800
- Cc: public webgl <email@example.com>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1291833803; bh=i9fq7I1bOe2ugc9ZdaVElSQAh0k=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type; b=RhjbVXXodpsiShPn6hhbLxJrKzf0dXtkJ4GGlRSKh5UpE91skQb4EJNJk6xlxFMRm S8j0Bx5imEKHDa301F2kg==
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=beta; h=domainkey-signature:mime-version:received:received:in-reply-to :references:date:message-id:subject:from:to:cc:content-type; bh=Sc8m/uRNtvTZexEJ2DgIrUgklHw1TPaDOz5SDeywcA8=; b=Ds7fF2d+dVLy6ddMNiyIhKdk6qRaD9FWIrwg0QqdOG9jDUanmGoimgKDa4ZVnchGE6 4E2OsIuS2FiydZTHAcHQ==
- Domainkey-signature: a=rsa-sha1; c=nofws; d=google.com; s=beta; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; b=qEX10YKIu6yppJvWNVZZwr34lnWa3GhZ6javLNXZu1ddpC9Z1KW64fSY+jgHJqexP0 Kd7lboIa3/cT8DqKW5mg==
- In-reply-to: <4CFEBB6F.firstname.lastname@example.org>
- List-id: Public WebGL Mailing List <public_webgl.khronos.org>
- References: <4CFEBB6F.email@example.com>
- Sender: firstname.lastname@example.org
Before I go off and play with testing on a bunch of different
configurations...is this actually a legal thing to do?
It is legal to have a varying that you never use. It is also "legal" for the compiler to remove it. The behavior you describe, where a removed varying causes a link error, is not legal, and possibly a Chrome or driver bug. Try and make sure that the shaders your passing into WebGL both have the varying defined.
The GL (and ES) specs doesn't talk about "active" varyings, as there is no way for the app to know what the compiler has done during link time. The spec does contain this text hinting that the compiler may drop varyings or pack them,
"A program whose shaders access more than MAX_VARYING_-
VECTORS worth of varying variables may fail to link, unless device-dependent op-
timizations are able to make the program fit within available hardware resources." -- GL-ES 2.0.24 section 2.10.4.
That said, because of the way DirectX works, you should probably try and avoid unused varyings.
For further reading about varyings you can take a look at "GL_NV_transform_feedback" and "GL_EXT_transform_feedback". In the original NVIDIA extension you had to declare that you're interested in unused varyings before link, in the EXT extension (adopted in GL 3.0) you have to declare all of your feedback data prior to link. The end result is the same in that the compiler can remove varyings at "link" time.
-- Kenneth Waters