[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Public WebGL] Re: ReadPixels
- To: Gregg Tavares <email@example.com>
- Subject: Re: [Public WebGL] Re: ReadPixels
- From: Kenneth Russell <firstname.lastname@example.org>
- Date: Thu, 1 Apr 2010 15:51:45 -0700
- Cc: public webgl <email@example.com>
- Dkim-signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=google.com; s=beta; t=1270162309; bh=RyxaNig5vNmql8waob6A0OkCd5M=; h=MIME-Version:In-Reply-To:References:Date:Message-ID:Subject:From: To:Cc:Content-Type:Content-Transfer-Encoding; b=p1sY/OxbcED46ePByI8VrKcvwfAbBxkmZdIn5lvcL97y6mvqN0pBhua5gRf2gH5bv ZeaY1svWf1ICs8IBhU6Pw==
- Domainkey-signature: a=rsa-sha1; s=beta; d=google.com; c=nofws; q=dns; h=mime-version:in-reply-to:references:date:message-id:subject:from:to: cc:content-type:content-transfer-encoding:x-system-of-record; b=pcE5MnBfChgYxen2xwLbRD7g7Vw1E3P6Glfj1nf8NDzDUU3WLdFaFZdHwqdC500Vf iKDJQT1saFHvSUIPcC+Zw==
- In-reply-to: <firstname.lastname@example.org>
- References: <email@example.com> <firstname.lastname@example.org>
- Sender: email@example.com
On Wed, Mar 24, 2010 at 1:07 AM, Gregg Tavares <firstname.lastname@example.org> wrote:
> On Fri, Mar 19, 2010 at 10:30 AM, Gregg Tavares <email@example.com> wrote:
>> A couple of readPixels issues
>> 1) I noticed today that apparently some drivers require a glFlush before
>> calling glReadPixels.
>> That's seem like a bug in the driver. The question though is do we want to
>> do or say anything in the spec about this? Like a recommendation that an
>> implementation call glFlush (or glFinish?) before calling glReadPixels just
>> so we don't get inconsistent results across systems?
>> 2) the WebGL readPixels spec doesn't say what the effect of
>> pixelStorei(gl.PACK_ALIGNMENT, ...) has on the buffer returned.
> No comments by anyone on this?
Sorry, I was swamped for the last couple of weeks.
PACK_ALIGNMENT should implicitly change the size of the returned
buffer. In the WebKit WebGL implementation there are a lot of cases
currently unimplemented (basically only RGBA readbacks with
PACK_ALIGNMENT <= 4 are correct) but basically it should honor both
the pack alignment and the requested format. There's no other reason
to support PACK_ALIGNMENT as an argument to pixelStorei.
The last row should not be padded. Row starts are rounded up to the
>> Does the buffer returned have rows padded to the current PACK_ALIGNMENT
>> If so, is the last row of the buffer padded?
>> In otherwords,
>> gl.pixelStorei(gl.PACK_ALIGNMENT, 4);
>> var w = 5;
>> var h = 3;
>> var buf = gl.readPixels(0, 0, w, h, gl.RGB, gl.UNSIGNED_BYTE);
>> var bytesPerPixel = 3; // RGB
>> buf.length == w * bytesPerPixel * h ? (each row is 15 bytes)
>> buf.length == (w * bytesPerPixel + 1) * h ? (each row is 16 bytes,
>> buf.length == (w * bytesPerPixel + 1) * (h - 1) + (w * bytesPerPixel) ?
>> (all but the last row is padded)
>> Off the top of my head I feel like since unlike C the user is not passing
>> in the buffer then I'd prefer the rows to be unpadded always but maybe
>> someone else has a good reason to keep them padded?
You are currently subscribe to firstname.lastname@example.org.
To unsubscribe, send an email to email@example.com with
the following command in the body of your email: