/** * Creates a new CS constant buffer reflecting the current CS program's * constants, if needed by the CS program. */ static void brw_upload_cs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->cs.base; /* BRW_NEW_COMPUTE_PROGRAM */ struct brw_compute_program *cp = (struct brw_compute_program *) brw->compute_program; /* BRW_NEW_CS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->cs.prog_data->base; /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_SURFACES, &cp->program.Base, stage_state, prog_data); }
/* Creates a new VS constant buffer reflecting the current VS program's * constants, if needed by the VS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_vs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->vs.base; /* BRW_NEW_VERTEX_PROGRAM */ struct brw_vertex_program *vp = (struct brw_vertex_program *) brw->vertex_program; /* CACHE_NEW_VS_PROG */ const struct brw_stage_prog_data *prog_data = &brw->vs.prog_data->base.base; /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program.Base, stage_state, prog_data, false); }
/* Creates a new VS constant buffer reflecting the current VS program's * constants, if needed by the VS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_vs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->vs.base; /* BRW_NEW_VERTEX_PROGRAM */ struct brw_program *vp = (struct brw_program *) brw->vertex_program; /* BRW_NEW_VS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = brw->vs.base.prog_data; _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_VERTEX); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program, stage_state, prog_data); }
/* Creates a new GS constant buffer reflecting the current GS program's * constants, if needed by the GS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_gs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->gs.base; /* BRW_NEW_GEOMETRY_PROGRAM */ struct brw_geometry_program *gp = (struct brw_geometry_program *) brw->geometry_program; if (!gp) return; /* CACHE_NEW_GS_PROG */ const struct brw_stage_prog_data *prog_data = &brw->gs.prog_data->base.base; /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program.Base, stage_state, prog_data, false); }
/* Creates a new TES constant buffer reflecting the current TES program's * constants, if needed by the TES program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_tes_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->tes.base; /* BRW_NEW_TESS_PROGRAMS */ struct brw_program *dp = (struct brw_program *) brw->tess_eval_program; if (!dp) return; /* BRW_NEW_TES_PROG_DATA */ const struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data; _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_TESS_EVAL); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_TES_CONSTBUF, &dp->program, stage_state, prog_data); }
/* Creates a new VS constant buffer reflecting the current VS program's * constants, if needed by the VS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_vs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->vs.base; bool dword_pitch; /* BRW_NEW_VERTEX_PROGRAM */ struct brw_vertex_program *vp = (struct brw_vertex_program *) brw->vertex_program; /* BRW_NEW_VS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->vs.prog_data->base.base; dword_pitch = brw->vs.prog_data->base.dispatch_mode == DISPATCH_MODE_SIMD8; /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_VS_CONSTBUF, &vp->program.Base, stage_state, prog_data, dword_pitch); }
/* Creates a new TCS constant buffer reflecting the current TCS program's * constants, if needed by the TCS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_tcs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->tcs.base; /* BRW_NEW_TESS_PROGRAMS */ struct brw_tess_ctrl_program *tcp = (struct brw_tess_ctrl_program *) brw->tess_ctrl_program; if (!tcp) return; /* BRW_NEW_TCS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = &brw->tcs.prog_data->base.base; /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_TCS_CONSTBUF, &tcp->program.Base, stage_state, prog_data); }
/* Creates a new GS constant buffer reflecting the current GS program's * constants, if needed by the GS program. * * Otherwise, constants go through the CURBEs using the brw_constant_buffer * state atom. */ static void brw_upload_gs_pull_constants(struct brw_context *brw) { struct brw_stage_state *stage_state = &brw->gs.base; /* BRW_NEW_GEOMETRY_PROGRAM */ struct brw_geometry_program *gp = (struct brw_geometry_program *) brw->geometry_program; if (!gp) return; /* BRW_NEW_GS_PROG_DATA */ const struct brw_stage_prog_data *prog_data = brw->gs.base.prog_data; _mesa_shader_write_subroutine_indices(&brw->ctx, MESA_SHADER_GEOMETRY); /* _NEW_PROGRAM_CONSTANTS */ brw_upload_pull_constants(brw, BRW_NEW_GS_CONSTBUF, &gp->program.Base, stage_state, prog_data); }