[Mesa-dev] [PATCH 02/18] i965: Expose and refactor brw_update_renderbuffer_surfaces()
Matt Turner
mattst88 at gmail.com
Thu Apr 23 11:53:40 PDT 2015
On Wed, Apr 22, 2015 at 1:47 PM, Topi Pohjolainen
<topi.pohjolainen at intel.com> wrote:
> Note that brw_update_renderbuffer_surfaces() already had a helper
> variable which was used in parallel to direct access of the current
> draw buffer of the context.
>
> Signed-off-by: Topi Pohjolainen <topi.pohjolainen at intel.com>
> ---
> src/mesa/drivers/dri/i965/brw_state.h | 5 +++
> src/mesa/drivers/dri/i965/brw_wm_surface_state.c | 51 ++++++++++++++----------
> 2 files changed, 35 insertions(+), 21 deletions(-)
>
> diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
> index cfa67b6..83058b9 100644
> --- a/src/mesa/drivers/dri/i965/brw_state.h
> +++ b/src/mesa/drivers/dri/i965/brw_state.h
> @@ -233,6 +233,11 @@ GLuint translate_tex_format(struct brw_context *brw,
> int brw_get_texture_swizzle(const struct gl_context *ctx,
> const struct gl_texture_object *t);
>
> +void brw_update_renderbuffer_surfaces(struct brw_context *brw,
> + const struct gl_framebuffer *fb,
> + uint32_t render_target_start,
> + uint32_t *surf_offset);
> +
> /* gen7_wm_surface_state.c */
> uint32_t gen7_surface_tiling_mode(uint32_t tiling);
> uint32_t gen7_surface_msaa_bits(unsigned num_samples, enum intel_msaa_layout l);
> diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> index 959d6c2..82dd92b 100644
> --- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> +++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
> @@ -731,40 +731,49 @@ brw_update_renderbuffer_surface(struct brw_context *brw,
> /**
> * Construct SURFACE_STATE objects for renderbuffers/draw buffers.
> */
> -static void
> -brw_update_renderbuffer_surfaces(struct brw_context *brw)
> +void
> +brw_update_renderbuffer_surfaces(struct brw_context *brw,
> + const struct gl_framebuffer *fb,
> + uint32_t render_target_start,
> + uint32_t *surf_offset)
> {
> - struct gl_context *ctx = &brw->ctx;
> - /* _NEW_BUFFERS */
> - const struct gl_framebuffer *fb = ctx->DrawBuffer;
> GLuint i;
>
> - /* _NEW_BUFFERS | _NEW_COLOR */
> /* Update surfaces for drawing buffers */
> - if (ctx->DrawBuffer->_NumColorDrawBuffers >= 1) {
> - for (i = 0; i < ctx->DrawBuffer->_NumColorDrawBuffers; i++) {
> - const uint32_t surf_index =
Extra space at the end of this line.
> - brw->wm.prog_data->binding_table.render_target_start + i;
> + if (fb->_NumColorDrawBuffers >= 1) {
> + for (i = 0; i < fb->_NumColorDrawBuffers; i++) {
> + const uint32_t surf_index = render_target_start + i;
>
> - if (intel_renderbuffer(ctx->DrawBuffer->_ColorDrawBuffers[i])) {
> - brw->wm.base.surf_offset[surf_index] =
> + if (intel_renderbuffer(fb->_ColorDrawBuffers[i])) {
Remove the tab here while we're changing it.
More information about the mesa-dev
mailing list