diff options
author | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2015-05-26 19:43:34 +0200 |
commit | 912e881bec8b16f2331225960645c3bdf5a8ba2d (patch) | |
tree | 92afd568d4b3eaab1faf26d8d95d8c6df0173079 /mesalib/src/mesa/main/state.c | |
parent | 2e00f3764228cfc91180bbe9375a8d85e0e65a5b (diff) | |
parent | 843964ee791452b197e41dacb0146f5b456ffaa5 (diff) | |
download | vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.gz vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.tar.bz2 vcxsrv-912e881bec8b16f2331225960645c3bdf5a8ba2d.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/mapi/glapi/glapi_priv.h
mesalib/src/mesa/drivers/dri/swrast/swrast.c
xorg-server/dix/dispatch.c
xorg-server/os/utils.c
xorg-server/record/record.c
Diffstat (limited to 'mesalib/src/mesa/main/state.c')
-rw-r--r-- | mesalib/src/mesa/main/state.c | 25 |
1 files changed, 23 insertions, 2 deletions
diff --git a/mesalib/src/mesa/main/state.c b/mesalib/src/mesa/main/state.c index cc84c6148..2657c532f 100644 --- a/mesalib/src/mesa/main/state.c +++ b/mesalib/src/mesa/main/state.c @@ -101,9 +101,12 @@ update_program(struct gl_context *ctx) ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY]; struct gl_shader_program *fsProg = ctx->_Shader->CurrentProgram[MESA_SHADER_FRAGMENT]; + const struct gl_shader_program *csProg = + ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE]; const struct gl_vertex_program *prevVP = ctx->VertexProgram._Current; const struct gl_fragment_program *prevFP = ctx->FragmentProgram._Current; const struct gl_geometry_program *prevGP = ctx->GeometryProgram._Current; + const struct gl_compute_program *prevCP = ctx->ComputeProgram._Current; GLbitfield new_state = 0x0; /* @@ -199,6 +202,16 @@ update_program(struct gl_context *ctx) _mesa_reference_vertprog(ctx, &ctx->VertexProgram._Current, NULL); } + if (csProg && csProg->LinkStatus + && csProg->_LinkedShaders[MESA_SHADER_COMPUTE]) { + /* Use GLSL compute shader */ + _mesa_reference_compprog(ctx, &ctx->ComputeProgram._Current, + gl_compute_program(csProg->_LinkedShaders[MESA_SHADER_COMPUTE]->Program)); + } else { + /* no compute program */ + _mesa_reference_compprog(ctx, &ctx->ComputeProgram._Current, NULL); + } + /* Let the driver know what's happening: */ if (ctx->FragmentProgram._Current != prevFP) { @@ -225,6 +238,14 @@ update_program(struct gl_context *ctx) } } + if (ctx->ComputeProgram._Current != prevCP) { + new_state |= _NEW_PROGRAM; + if (ctx->Driver.BindProgram) { + ctx->Driver.BindProgram(ctx, GL_COMPUTE_PROGRAM_NV, + (struct gl_program *) ctx->ComputeProgram._Current); + } + } + return new_state; } @@ -368,10 +389,10 @@ _mesa_update_state_locked( struct gl_context *ctx ) update_frontbit( ctx ); if (new_state & _NEW_BUFFERS) - _mesa_update_framebuffer(ctx); + _mesa_update_framebuffer(ctx, ctx->ReadBuffer, ctx->DrawBuffer); if (new_state & (_NEW_SCISSOR | _NEW_BUFFERS | _NEW_VIEWPORT)) - _mesa_update_draw_buffer_bounds( ctx ); + _mesa_update_draw_buffer_bounds(ctx, ctx->DrawBuffer); if (new_state & _NEW_LIGHT) _mesa_update_lighting( ctx ); |