<div dir="ltr">On 29 August 2013 15:46, Eric Anholt <span dir="ltr"><<a href="mailto:eric@anholt.net" target="_blank">eric@anholt.net</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="HOEnZb"><div class="h5">Kenneth Graunke <<a href="mailto:kenneth@whitecape.org">kenneth@whitecape.org</a>> writes:<br>
<br>
> On 08/26/2013 03:12 PM, Paul Berry wrote:<br>
>> This paves the way for sharing the code that will set up the vertex<br>
>> and geometry shader pipeline state.<br>
>> ---<br>
>>   src/mesa/drivers/dri/i965/brw_context.h          | 47 ++++++++++++++----------<br>
>>   src/mesa/drivers/dri/i965/brw_draw.c             |  3 +-<br>
>>   src/mesa/drivers/dri/i965/brw_misc_state.c       |  6 +--<br>
>>   src/mesa/drivers/dri/i965/brw_vs.c               | 12 +++---<br>
>>   src/mesa/drivers/dri/i965/brw_vs_state.c         | 24 ++++++------<br>
>>   src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 43 ++++++++++++----------<br>
>>   src/mesa/drivers/dri/i965/brw_vtbl.c             |  2 +-<br>
>>   src/mesa/drivers/dri/i965/brw_wm_sampler_state.c |  8 ++--<br>
>>   src/mesa/drivers/dri/i965/brw_wm_surface_state.c |  4 +-<br>
>>   src/mesa/drivers/dri/i965/gen6_sampler_state.c   |  2 +-<br>
>>   src/mesa/drivers/dri/i965/gen6_vs_state.c        | 23 +++++++-----<br>
>>   src/mesa/drivers/dri/i965/gen7_vs_state.c        | 18 +++++----<br>
>>   12 files changed, 107 insertions(+), 85 deletions(-)<br>
>><br>
>> diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h<br>
>> index dcd4c9a..9784956 100644<br>
>> --- a/src/mesa/drivers/dri/i965/brw_context.h<br>
>> +++ b/src/mesa/drivers/dri/i965/brw_context.h<br>
>> @@ -818,6 +818,32 @@ struct brw_query_object {<br>
>><br>
>><br>
>>   /**<br>
>> + * Data shared between brw_context::vs and brw_context::gs<br>
>> + */<br>
>> +struct brw_vec4_context_base<br>
>> +{<br>
>> +   drm_intel_bo *scratch_bo;<br>
>> +   drm_intel_bo *const_bo;<br>
>> +   /** Offset in the program cache to the program */<br>
>> +   uint32_t prog_offset;<br>
>> +   uint32_t state_offset;<br>
>> +<br>
>> +   uint32_t push_const_offset; /* Offset in the batchbuffer */<br>
>> +   int push_const_size; /* in 256-bit register increments */<br>
>> +<br>
>> +   uint32_t bind_bo_offset;<br>
>> +   uint32_t surf_offset[BRW_MAX_VEC4_SURFACES];<br>
>> +<br>
>> +   /** SAMPLER_STATE count and table offset */<br>
>> +   uint32_t sampler_count;<br>
>> +   uint32_t sampler_offset;<br>
>> +<br>
>> +   /** Offsets in the batch to sampler default colors (texture border color) */<br>
>> +   uint32_t sdc_offset[BRW_MAX_TEX_UNIT];<br>
>> +};<br>
><br>
> I like what this patch is doing, but I really don't like the names.<br>
><br>
> With the exception of ralloc, "context"/"ctx" generally always mean the<br>
> global GL context: gl_context or a subclass like brw_context.  (For<br>
> ralloc, we inherited the "context" terminology from talloc, so it kind<br>
> of stuck.)  vec4_ctx/brw_vec4_context_base are something totally different.<br>
><br>
> This is a structure that represents the shader program state for a<br>
> particular pipeline stage.  Also, other than BRW_MAX_VEC4_SURFACES,<br>
> there's nothing vec4 specific about this at all.  The pixel shader could<br>
> use every one of these fields (and should eventually).  So I dislike<br>
> "vec4" in the name - we're just going to have to change it.<br>
><br>
> I had suggested names like brw_shader_state or brw_pipeline_state...I'm<br>
> open to other ideas.<br>
<br>
</div></div>brw_stage_state[_base]?  "stage" is the terminology used in ARB_sso (and<br>
in our conversations), and this looks like it's the common state among<br>
all of vs/gs/fs.  pipeline is for a group of the things, for sure.<br>
<br>
On the other hand, we've been using "shader" as the variable name to<br>
store the per-stage thing, and shader_program for the whole-pipeline<br>
thing, so brw_shader_state seems fine to me too.<br>
</blockquote></div><br></div><div class="gmail_extra">Ken and I like brw_stage_state[_base].  Ken prefers without _base, I have a minor preference for _base, but we both feel like that's a detail that can be decided on the fly when I get around to doing the renaming.<br>
<br></div><div class="gmail_extra">I'll plan on changing the name to brw_state_state[_base] tomorrow morning unless I hear objections.<br></div></div>