Re: [Mesa-dev] [PATCH] st/mesa: move VS creation in bitmap code
On 02/08/2016 07:52 AM, Nicolai Hähnle wrote: On 05.02.2016 19:55, Brian Paul wrote: Do this one-time init with the other on-time inits. Since Bitmap is something that few programs use, wouldn't it be better to move in the other direction and do all the one-time inits on-demand rather than at context init? Sure, we could do that. This change is part of a longer glBitmap optimization series that I'm still working on... -Brian ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
Re: [Mesa-dev] [PATCH] st/mesa: move VS creation in bitmap code
On 05.02.2016 19:55, Brian Paul wrote: Do this one-time init with the other on-time inits. Since Bitmap is something that few programs use, wouldn't it be better to move in the other direction and do all the one-time inits on-demand rather than at context init? Cheers, Nicolai --- src/mesa/state_tracker/st_cb_bitmap.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index d8c3dbd..f39d956 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -631,19 +631,6 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y, st_validate_state(st); } - if (!st->bitmap.vs) { - /* create pass-through vertex shader now */ - const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, - TGSI_SEMANTIC_COLOR, -st->needs_texcoord_semantic ? TGSI_SEMANTIC_TEXCOORD : - TGSI_SEMANTIC_GENERIC }; - const uint semantic_indexes[] = { 0, 0, 0 }; - st->bitmap.vs = util_make_vertex_passthrough_shader(st->pipe, 3, - semantic_names, - semantic_indexes, - FALSE); - } - if (UseBitmapCache && accum_bitmap(ctx, x, y, width, height, unpack, bitmap)) return; @@ -722,6 +709,19 @@ st_init_bitmap(struct st_context *st) assert(0); } + /* Create VS for rendering bitmaps */ + { + const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, + TGSI_SEMANTIC_COLOR, +st->needs_texcoord_semantic ? TGSI_SEMANTIC_TEXCOORD : + TGSI_SEMANTIC_GENERIC }; + const uint semantic_indexes[] = { 0, 0, 0 }; + st->bitmap.vs = util_make_vertex_passthrough_shader(st->pipe, 3, + semantic_names, + semantic_indexes, + FALSE); + } + /* alloc bitmap cache object */ st->bitmap.cache = ST_CALLOC_STRUCT(bitmap_cache); ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev
[Mesa-dev] [PATCH] st/mesa: move VS creation in bitmap code
Do this one-time init with the other on-time inits. --- src/mesa/state_tracker/st_cb_bitmap.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/mesa/state_tracker/st_cb_bitmap.c b/src/mesa/state_tracker/st_cb_bitmap.c index d8c3dbd..f39d956 100644 --- a/src/mesa/state_tracker/st_cb_bitmap.c +++ b/src/mesa/state_tracker/st_cb_bitmap.c @@ -631,19 +631,6 @@ st_Bitmap(struct gl_context *ctx, GLint x, GLint y, st_validate_state(st); } - if (!st->bitmap.vs) { - /* create pass-through vertex shader now */ - const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, - TGSI_SEMANTIC_COLOR, -st->needs_texcoord_semantic ? TGSI_SEMANTIC_TEXCOORD : - TGSI_SEMANTIC_GENERIC }; - const uint semantic_indexes[] = { 0, 0, 0 }; - st->bitmap.vs = util_make_vertex_passthrough_shader(st->pipe, 3, - semantic_names, - semantic_indexes, - FALSE); - } - if (UseBitmapCache && accum_bitmap(ctx, x, y, width, height, unpack, bitmap)) return; @@ -722,6 +709,19 @@ st_init_bitmap(struct st_context *st) assert(0); } + /* Create VS for rendering bitmaps */ + { + const uint semantic_names[] = { TGSI_SEMANTIC_POSITION, + TGSI_SEMANTIC_COLOR, +st->needs_texcoord_semantic ? TGSI_SEMANTIC_TEXCOORD : + TGSI_SEMANTIC_GENERIC }; + const uint semantic_indexes[] = { 0, 0, 0 }; + st->bitmap.vs = util_make_vertex_passthrough_shader(st->pipe, 3, + semantic_names, + semantic_indexes, + FALSE); + } + /* alloc bitmap cache object */ st->bitmap.cache = ST_CALLOC_STRUCT(bitmap_cache); -- 1.9.1 ___ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev