[Mesa-dev] vbo: process buffer binding state changes on draw when recording

Submitted by Ilia Mirkin on Feb. 1, 2017, 9:11 p.m.

Details

Message ID 20170201211141.23859-1-imirkin@alum.mit.edu
State Accepted
Commit e73f87fcbdcb12b0b8d28c4ca3444bfb7669bca5
Headers show
Series "vbo: process buffer binding state changes on draw when recording" ( rev: 1 ) in Mesa

Not browsing as part of any series.

Commit Message

Ilia Mirkin Feb. 1, 2017, 9:11 p.m.
The VBO module keeps track of any vbo buffers. It updates this list when
receiving an InvalidateState call, however this never happens when
recording draws right now. Make sure that we do all the usual state
updates when recording draws so that the VBO list may be kept up to
date.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99631
---
 src/mesa/vbo/vbo_save_api.c | 7 +++++++
 1 file changed, 7 insertions(+)

Patch hide | download patch | download mbox

diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
index f648ccc..f8dab0c 100644
--- a/src/mesa/vbo/vbo_save_api.c
+++ b/src/mesa/vbo/vbo_save_api.c
@@ -78,6 +78,7 @@  USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include "main/api_arrayelt.h"
 #include "main/vtxfmt.h"
 #include "main/dispatch.h"
+#include "main/state.h"
 #include "util/bitscan.h"
 
 #include "vbo_context.h"
@@ -1159,6 +1160,9 @@  _save_OBE_DrawArrays(GLenum mode, GLint start, GLsizei count)
    if (save->out_of_memory)
       return;
 
+   /* Make sure to process any VBO binding changes */
+   _mesa_update_state(ctx);
+
    _ae_map_vbos(ctx);
 
    vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK
@@ -1202,6 +1206,9 @@  _save_OBE_DrawElementsBaseVertex(GLenum mode, GLsizei count, GLenum type,
    if (save->out_of_memory)
       return;
 
+   /* Make sure to process any VBO binding changes */
+   _mesa_update_state(ctx);
+
    _ae_map_vbos(ctx);
 
    if (_mesa_is_bufferobj(indexbuf))

Comments

Reviewed-by: Marek Olšák <marek.olsak@amd.com>

On Feb 1, 2017 10:11 PM, "Ilia Mirkin" <imirkin@alum.mit.edu> wrote:

> The VBO module keeps track of any vbo buffers. It updates this list when
> receiving an InvalidateState call, however this never happens when
> recording draws right now. Make sure that we do all the usual state
> updates when recording draws so that the VBO list may be kept up to
> date.
>
> Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99631
> ---
>  src/mesa/vbo/vbo_save_api.c | 7 +++++++
>  1 file changed, 7 insertions(+)
>
> diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
> index f648ccc..f8dab0c 100644
> --- a/src/mesa/vbo/vbo_save_api.c
> +++ b/src/mesa/vbo/vbo_save_api.c
> @@ -78,6 +78,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
>  #include "main/api_arrayelt.h"
>  #include "main/vtxfmt.h"
>  #include "main/dispatch.h"
> +#include "main/state.h"
>  #include "util/bitscan.h"
>
>  #include "vbo_context.h"
> @@ -1159,6 +1160,9 @@ _save_OBE_DrawArrays(GLenum mode, GLint start,
> GLsizei count)
>     if (save->out_of_memory)
>        return;
>
> +   /* Make sure to process any VBO binding changes */
> +   _mesa_update_state(ctx);
> +
>     _ae_map_vbos(ctx);
>
>     vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK
> @@ -1202,6 +1206,9 @@ _save_OBE_DrawElementsBaseVertex(GLenum mode,
> GLsizei count, GLenum type,
>     if (save->out_of_memory)
>        return;
>
> +   /* Make sure to process any VBO binding changes */
> +   _mesa_update_state(ctx);
> +
>     _ae_map_vbos(ctx);
>
>     if (_mesa_is_bufferobj(indexbuf))
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
Looks OK to me too.

Reviewed-by: Brian Paul <brianp@vmware.com>


On 02/02/2017 01:42 AM, Marek Olšák wrote:
> Reviewed-by: Marek Olšák <marek.olsak@amd.com <mailto:marek.olsak@amd.com>>
>
> On Feb 1, 2017 10:11 PM, "Ilia Mirkin" <imirkin@alum.mit.edu
> <mailto:imirkin@alum.mit.edu>> wrote:
>
>     The VBO module keeps track of any vbo buffers. It updates this list when
>     receiving an InvalidateState call, however this never happens when
>     recording draws right now. Make sure that we do all the usual state
>     updates when recording draws so that the VBO list may be kept up to
>     date.
>
>     Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu
>     <mailto:imirkin@alum.mit.edu>>
>     Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99631
>     <https://urldefense.proofpoint.com/v2/url?u=https-3A__bugs.freedesktop.org_show-5Fbug.cgi-3Fid-3D99631&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=qzLxzA3PjqQyPea2puqnI1c8nOfttFZViGD-6FyxnYo&s=7ELFJ-H7QYzI7xwKqry_pi4zAks0_lKoed8PCzBNxa0&e=>
>     ---
>       src/mesa/vbo/vbo_save_api.c | 7 +++++++
>       1 file changed, 7 insertions(+)
>
>     diff --git a/src/mesa/vbo/vbo_save_api.c b/src/mesa/vbo/vbo_save_api.c
>     index f648ccc..f8dab0c 100644
>     --- a/src/mesa/vbo/vbo_save_api.c
>     +++ b/src/mesa/vbo/vbo_save_api.c
>     @@ -78,6 +78,7 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
>       #include "main/api_arrayelt.h"
>       #include "main/vtxfmt.h"
>       #include "main/dispatch.h"
>     +#include "main/state.h"
>       #include "util/bitscan.h"
>
>       #include "vbo_context.h"
>     @@ -1159,6 +1160,9 @@ _save_OBE_DrawArrays(GLenum mode, GLint start,
>     GLsizei count)
>          if (save->out_of_memory)
>             return;
>
>     +   /* Make sure to process any VBO binding changes */
>     +   _mesa_update_state(ctx);
>     +
>          _ae_map_vbos(ctx);
>
>          vbo_save_NotifyBegin(ctx, (mode | VBO_SAVE_PRIM_WEAK
>     @@ -1202,6 +1206,9 @@ _save_OBE_DrawElementsBaseVertex(GLenum mode,
>     GLsizei count, GLenum type,
>          if (save->out_of_memory)
>             return;
>
>     +   /* Make sure to process any VBO binding changes */
>     +   _mesa_update_state(ctx);
>     +
>          _ae_map_vbos(ctx);
>
>          if (_mesa_is_bufferobj(indexbuf))
>     --
>     2.10.2
>
>     _______________________________________________
>     mesa-dev mailing list
>     mesa-dev@lists.freedesktop.org <mailto:mesa-dev@lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>     <https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=DwMFaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=qzLxzA3PjqQyPea2puqnI1c8nOfttFZViGD-6FyxnYo&s=f_kHdvtmxmcroE2iao9QV7Hsrui-HpIPvjKAzeRY1Pg&e=>
>
>
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev@lists.freedesktop.org
> https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.freedesktop.org_mailman_listinfo_mesa-2Ddev&d=DwIGaQ&c=uilaK90D4TOVoH58JNXRgQ&r=Ie7_encNUsqxbSRbqbNgofw0ITcfE8JKfaUjIQhncGA&m=qzLxzA3PjqQyPea2puqnI1c8nOfttFZViGD-6FyxnYo&s=f_kHdvtmxmcroE2iao9QV7Hsrui-HpIPvjKAzeRY1Pg&e=
>