Chris Marrin wrote:I agree that explicit sync points are needed. To really drive the point home that switching between contexts is costly, the sync points should be called waitContext("WebGL"), waitContext("2D"), etc. This naming reflects what is actually happening. It also happens to be the name used in EGL for this functionality: eglWaitAPI.I think this is close. But I'm still concerned about the implicit sync point that happens when you call one rendering API after having used the other. I think it will lead to user confusion ("why did things get so much slower when I just added a string of text to the canvas? I guess text rendering is just really slow.") and bad habits. If users do [2D call, 3D call, 2D call, 3D call] it will be very slow but it's not clear why. If they do [enable2D, 2D call, enable3D, 3D call, enable2D, 2D call, enable3D, 3D call], it will be much more clear that the better approach is [enable 2D, 2D call, 2D call, enable 3D, 3D call, 3D call]. It is a more purposeful API and is more helpful to authors. As Kenneth Waters pointed out, we don't NEED to have a synch mechanism, but I think it makes a better API. But I also agree that using getContext() for this unnecessarily overloads that call, so an explicit enable(...) call would be better. ----- ~Chris cmarrin@apple.com Regards -Mark |
begin:vcard fn:Mark Callow n:Callow;Mark org:HI Corporation;Graphics Lab, Research & Development adr:Higashiyama 1-4-4, Meguro-ku;;Meguro Higashiyama Bldg 5F;Tokyo;;153-0043;Japan email;internet:callow_mark@hicorp.co.jp title:Chief Architect tel;work:+81 3 3710 9367 x228 tel;fax:+81 3 5773 8660 x-mozilla-html:TRUE url:http://www.hicorp.co.jp, http://www.mascotcapsule.com version:2.1 end:vcard