[PATCH v2 3/6] wined3d: Allow wined3d_stream_info_from_declaration() to include inputs with no buffer set.

Jan Sikorski jsikorski at codeweavers.com
Fri Apr 16 10:28:15 CDT 2021


> On 16 Apr 2021, at 16:01, Henri Verbeet <hverbeet at gmail.com> wrote:
> 
> On Fri, 16 Apr 2021 at 10:45, Jan Sikorski <jsikorski at codeweavers.com> wrote:
>> /* Context activation is done by the caller. */
>> void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_info,
>> -        const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info)
>> +        const struct wined3d_state *state, const struct wined3d_d3d_info *d3d_info, bool require_buffer)
>> {
>>     /* We need to deal with frequency data! */
>>     struct wined3d_vertex_declaration *declaration = state->vertex_declaration;
>> @@ -182,7 +182,7 @@ void wined3d_stream_info_from_declaration(struct wined3d_stream_info *stream_inf
>>         TRACE("%p Element %p (%u of %u).\n", declaration->elements,
>>                 element, i + 1, declaration->element_count);
>> 
>> -        if (!stream->buffer)
>> +        if (!stream->buffer && require_buffer)
>>             continue;
> 
> Would it make sense to drop the "require_buffer" argument and just
> always behave as if it's false?

Maybe. It looked pretty annoying to do so, there would be 3 checks in wined3d_device_process_vertices() alone, and some more scattered around where struct's wined3d_context stream_info member is used. Perhaps it is slightly hacky as such, but since OpenGL handles unbound streams automatically, ignoring them early seemed adequate, plus it has the benefit of not changing existing behavior ;)
I’ll have to look at it some more to be sure, but if I’m going get this information from the shader signature instead, I don’t think this change will be necessary (i.e. ok to always require buffer here).

- Jan


More information about the wine-devel mailing list