vrend: Reset shader_dirty and cs_shader_dirty when emitted

This results in reemitting the shaders over and over which causes a
performance hit.

Benchmarks using glbench:

Before:
@RESULT: fbofill_tex_bilinear_32                       =     942.40 mpixels_sec
@RESULT: fbofill_tex_bilinear_64                       =    3736.99 mpixels_sec

After:
@RESULT: fbofill_tex_bilinear_32                       =    1124.72 mpixels_sec
@RESULT: fbofill_tex_bilinear_64                       =    4222.07 mpixels_sec

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: <Gurchetan Singh gurchetansingh@chromium.org>
macos/master
Stéphane Marchesin 6 years ago committed by Gert Wollny
parent 0ee5a88a8f
commit 6cbf3287cf
  1. 6
      src/vrend_renderer.c

@ -3976,6 +3976,9 @@ int vrend_draw_vbo(struct vrend_context *ctx,
bool fs_dirty, vs_dirty, gs_dirty, tcs_dirty, tes_dirty; bool fs_dirty, vs_dirty, gs_dirty, tcs_dirty, tes_dirty;
bool dual_src = util_blend_state_is_dual(&ctx->sub->blend_state, 0); bool dual_src = util_blend_state_is_dual(&ctx->sub->blend_state, 0);
bool same_prog; bool same_prog;
ctx->sub->shader_dirty = false;
if (!ctx->sub->shaders[PIPE_SHADER_VERTEX] || !ctx->sub->shaders[PIPE_SHADER_FRAGMENT]) { if (!ctx->sub->shaders[PIPE_SHADER_VERTEX] || !ctx->sub->shaders[PIPE_SHADER_FRAGMENT]) {
vrend_printf("dropping rendering due to missing shaders: %s\n", ctx->debug_name); vrend_printf("dropping rendering due to missing shaders: %s\n", ctx->debug_name);
return 0; return 0;
@ -4222,6 +4225,9 @@ void vrend_launch_grid(struct vrend_context *ctx,
if (ctx->sub->cs_shader_dirty) { if (ctx->sub->cs_shader_dirty) {
struct vrend_linked_shader_program *prog; struct vrend_linked_shader_program *prog;
bool cs_dirty; bool cs_dirty;
ctx->sub->cs_shader_dirty = false;
if (!ctx->sub->shaders[PIPE_SHADER_COMPUTE]) { if (!ctx->sub->shaders[PIPE_SHADER_COMPUTE]) {
vrend_printf("dropping rendering due to missing shaders: %s\n", ctx->debug_name); vrend_printf("dropping rendering due to missing shaders: %s\n", ctx->debug_name);
return; return;

Loading…
Cancel
Save