From: Marek O. <ma...@gm...> - 2010-04-04 19:12:54
|
Hi devs, I (and Luca mostly) have made some simple patches which add GL_ARB_half_float_vertex to Gallium. Author: Marek Olšák <ma...@gm...> r300g: enable half float vertex st/mesa: query for half float vertex support Author: Luca Barbieri <lu...@lu...> st/mesa: half float vertex support Please review the commits here: http://cgit.freedesktop.org/~mareko/mesa/log/?h=half-float-vertex<http://cgit.freedesktop.org/%7Emareko/mesa/log/?h=half-float-vertex> Please let me know whether I may push this. Cheers -Marek |
From: Luca B. <luc...@gm...> - 2010-04-04 19:41:40
|
There was some talk about doing the query with a vertex buffer target for is_format_supported. After gallium-resources is merged, this should be automatically possible. BTW, the st/mesa patch originally was from Dave Airlie and was slightly changed by me. |
From: Marek O. <ma...@gm...> - 2010-04-04 20:04:53
|
On Sun, Apr 4, 2010 at 9:41 PM, Luca Barbieri <luc...@gm...>wrote: > There was some talk about doing the query with a vertex buffer target > for is_format_supported. > Does it mean there will be format fallbacks? Because dword-unaligned but still pretty common (i.e. GL1.1) vertex formats aren't supported by r300, most often we hit R16G16B16. What will happen when is_format_supported says NO to such a format? I hope it won't share the fate of PIPE_CAP_SM3, which every in-tree state tracker ignores. -Marek |
From: Luca B. <luc...@gm...> - 2010-04-04 20:28:44
|
> Does it mean there will be format fallbacks? Because dword-unaligned but > still pretty common (i.e. GL1.1) vertex formats aren't supported by r300, > most often we hit R16G16B16. What will happen when is_format_supported says > NO to such a format? I hope it won't share the fate of PIPE_CAP_SM3, which > every in-tree state tracker ignores. I'm not sure I understand correctly what you are saying. The idea is to do like you did in your patch, but instead of calling screen->get_param(screen, PIPE_CAP_HALF_FLOAT_VERTEX), calling screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16G16, PIPE_BUFFER, ..., ...). The PIPE_BUFFER target is supported in gallium-resources, but I'm not sure whether this way of querying vertex formats is supported; it would probably need to be added first. If you mean that r300 doesn't support R16G16B16, I suppose you can just use R16G16B16A16 and ignore the extra fetched w element (the vertex buffer stride will make this work properly). However, if non-dword-aligned vertex buffer strides or vertex element offsets are not supported, I think you have a serious problem, which is however independent of half float vertices since I don't think OpenGL places any alignment constraints on those values (correct me if I'm wrong). |
From: Marek O. <ma...@gm...> - 2010-04-04 20:43:45
|
On Sun, Apr 4, 2010 at 10:28 PM, Luca Barbieri <luc...@gm...>wrote: > > Does it mean there will be format fallbacks? Because dword-unaligned but > > still pretty common (i.e. GL1.1) vertex formats aren't supported by r300, > > most often we hit R16G16B16. What will happen when is_format_supported > says > > NO to such a format? I hope it won't share the fate of PIPE_CAP_SM3, > which > > every in-tree state tracker ignores. > > I'm not sure I understand correctly what you are saying. > > The idea is to do like you did in your patch, but instead of calling > screen->get_param(screen, PIPE_CAP_HALF_FLOAT_VERTEX), calling > screen->is_format_supported(screen, PIPE_FORMAT_R16G16B16G16, > PIPE_BUFFER, ..., ...). > > The PIPE_BUFFER target is supported in gallium-resources, but I'm not > sure whether this way of querying vertex formats is supported; it > would probably need to be added first. > > If you mean that r300 doesn't support R16G16B16, I suppose you can > just use R16G16B16A16 and ignore the extra fetched w element (the > vertex buffer stride will make this work properly). > I've tried to do it this way, it locks up (unless I am missing something). However, if non-dword-aligned vertex buffer strides or vertex element > offsets are not supported, I think you have a serious problem, which > is however independent of half float vertices since I don't think > OpenGL places any alignment constraints on those values (correct me if > I'm wrong). > You're right. -Marek |
From: Luca B. <luc...@gm...> - 2010-04-04 21:05:56
|
>> If you mean that r300 doesn't support R16G16B16, I suppose you can >> just use R16G16B16A16 and ignore the extra fetched w element (the >> vertex buffer stride will make this work properly). > > I've tried to do it this way, it locks up (unless I am missing something). Shouldn't there be official ATI hardware documentation for r300 describing such things? (just curious) Otherwise, I guess you could trace the ATI binary driver and see what it does... |