summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/dri/i965
diff options
context:
space:
mode:
authorTimothy Arceri <[email protected]>2016-11-05 23:35:11 +1100
committerTimothy Arceri <[email protected]>2017-01-06 11:21:41 +1100
commitd3b2ee6b4975bbb8eb960b20329461136a3e1a3f (patch)
tree35adfcf024301bf58b6f1d444a37a40a6356b7fb /src/mesa/drivers/dri/i965
parent9ca14f583c2613643671c1d5a8bd2b98745f4c7c (diff)
i965: pass gl_program to brw_upload_ubo_surfaces()
There is no need to pass gl_linked_shader anymore. Reviewed-by: Lionel Landwerlin <[email protected]>
Diffstat (limited to 'src/mesa/drivers/dri/i965')
-rw-r--r--src/mesa/drivers/dri/i965/brw_context.h3
-rw-r--r--src/mesa/drivers/dri/i965/brw_gs_surface_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_tcs_surface_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_tes_surface_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_vs_surface_state.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_wm_surface_state.c23
6 files changed, 20 insertions, 22 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index 628840e7cf3..ff3f861a147 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -1456,8 +1456,7 @@ brw_update_sol_surface(struct brw_context *brw,
struct gl_buffer_object *buffer_obj,
uint32_t *out_offset, unsigned num_vector_components,
unsigned stride_dwords, unsigned offset_dwords);
-void brw_upload_ubo_surfaces(struct brw_context *brw,
- struct gl_linked_shader *shader,
+void brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
struct brw_stage_state *stage_state,
struct brw_stage_prog_data *prog_data);
void brw_upload_abo_surfaces(struct brw_context *brw,
diff --git a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
index e2ef222b08c..dc064626aea 100644
--- a/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_gs_surface_state.c
@@ -75,13 +75,13 @@ brw_upload_gs_ubo_surfaces(struct brw_context *brw)
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_GEOMETRY];
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_GEOMETRY])
return;
/* BRW_NEW_GS_PROG_DATA */
struct brw_stage_prog_data *prog_data = brw->gs.base.prog_data;
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_GEOMETRY],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_GEOMETRY]->Program,
&brw->gs.base, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
index 16f0bd2f96e..083058bdf20 100644
--- a/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_tcs_surface_state.c
@@ -75,13 +75,13 @@ brw_upload_tcs_ubo_surfaces(struct brw_context *brw)
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_TESS_CTRL];
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_TESS_CTRL])
return;
/* BRW_NEW_TCS_PROG_DATA */
struct brw_stage_prog_data *prog_data = brw->tcs.base.prog_data;
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_CTRL],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_CTRL]->Program,
&brw->tcs.base, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
index f74d86961e2..03b301e6de3 100644
--- a/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_tes_surface_state.c
@@ -75,13 +75,13 @@ brw_upload_tes_ubo_surfaces(struct brw_context *brw)
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_TESS_EVAL];
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_TESS_EVAL])
return;
/* BRW_NEW_TES_PROG_DATA */
struct brw_stage_prog_data *prog_data = brw->tes.base.prog_data;
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_TESS_EVAL]->Program,
&brw->tes.base, prog_data);
}
diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
index 6c349f400ec..5665735f432 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -143,11 +143,11 @@ brw_upload_vs_ubo_surfaces(struct brw_context *brw)
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_VERTEX];
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_VERTEX])
return;
/* BRW_NEW_VS_PROG_DATA */
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_VERTEX]->Program,
&brw->vs.base, brw->vs.base.prog_data);
}
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 220e597338f..eff19de06c0 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1370,22 +1370,21 @@ const struct brw_tracked_state brw_cs_texture_surfaces = {
void
-brw_upload_ubo_surfaces(struct brw_context *brw,
- struct gl_linked_shader *shader,
+brw_upload_ubo_surfaces(struct brw_context *brw, struct gl_program *prog,
struct brw_stage_state *stage_state,
struct brw_stage_prog_data *prog_data)
{
struct gl_context *ctx = &brw->ctx;
- if (!shader)
+ if (!prog)
return;
uint32_t *ubo_surf_offsets =
&stage_state->surf_offset[prog_data->binding_table.ubo_start];
- for (int i = 0; i < shader->Program->info.num_ubos; i++) {
+ for (int i = 0; i < prog->info.num_ubos; i++) {
struct gl_uniform_buffer_binding *binding =
- &ctx->UniformBufferBindings[shader->Program->sh.UniformBlocks[i]->Binding];
+ &ctx->UniformBufferBindings[prog->sh.UniformBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &ubo_surf_offsets[i]);
@@ -1408,9 +1407,9 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
uint32_t *ssbo_surf_offsets =
&stage_state->surf_offset[prog_data->binding_table.ssbo_start];
- for (int i = 0; i < shader->Program->info.num_ssbos; i++) {
+ for (int i = 0; i < prog->info.num_ssbos; i++) {
struct gl_shader_storage_buffer_binding *binding =
- &ctx->ShaderStorageBufferBindings[shader->Program->sh.ShaderStorageBlocks[i]->Binding];
+ &ctx->ShaderStorageBufferBindings[prog->sh.ShaderStorageBlocks[i]->Binding];
if (binding->BufferObject == ctx->Shared->NullBufferObj) {
brw->vtbl.emit_null_surface_state(brw, 1, 1, 1, &ssbo_surf_offsets[i]);
@@ -1430,7 +1429,7 @@ brw_upload_ubo_surfaces(struct brw_context *brw,
}
}
- if (shader->Program->info.num_ubos || shader->Program->info.num_ssbos)
+ if (prog->info.num_ubos || prog->info.num_ssbos)
brw->ctx.NewDriverState |= BRW_NEW_SURFACES;
}
@@ -1441,11 +1440,11 @@ brw_upload_wm_ubo_surfaces(struct brw_context *brw)
/* _NEW_PROGRAM */
struct gl_shader_program *prog = ctx->_Shader->_CurrentFragmentProgram;
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_FRAGMENT])
return;
/* BRW_NEW_FS_PROG_DATA */
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_FRAGMENT],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_FRAGMENT]->Program,
&brw->wm.base, brw->wm.base.prog_data);
}
@@ -1468,11 +1467,11 @@ brw_upload_cs_ubo_surfaces(struct brw_context *brw)
struct gl_shader_program *prog =
ctx->_Shader->CurrentProgram[MESA_SHADER_COMPUTE];
- if (!prog)
+ if (!prog || !prog->_LinkedShaders[MESA_SHADER_COMPUTE])
return;
/* BRW_NEW_CS_PROG_DATA */
- brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE],
+ brw_upload_ubo_surfaces(brw, prog->_LinkedShaders[MESA_SHADER_COMPUTE]->Program,
&brw->cs.base, brw->cs.base.prog_data);
}