<div dir="ltr">On 28 August 2013 17:12, Kenneth Graunke <span dir="ltr"><<a href="mailto:kenneth@whitecape.org" target="_blank">kenneth@whitecape.org</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">On 08/26/2013 03:12 PM, Paul Berry wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
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_<u></u>context.h | 47 ++++++++++++++----------<br>
src/mesa/drivers/dri/i965/brw_<u></u>draw.c | 3 +-<br>
src/mesa/drivers/dri/i965/brw_<u></u>misc_state.c | 6 +--<br>
src/mesa/drivers/dri/i965/brw_<u></u>vs.c | 12 +++---<br>
src/mesa/drivers/dri/i965/brw_<u></u>vs_state.c | 24 ++++++------<br>
src/mesa/drivers/dri/i965/brw_<u></u>vs_surface_state.c | 43 ++++++++++++----------<br>
src/mesa/drivers/dri/i965/brw_<u></u>vtbl.c | 2 +-<br>
src/mesa/drivers/dri/i965/brw_<u></u>wm_sampler_state.c | 8 ++--<br>
src/mesa/drivers/dri/i965/brw_<u></u>wm_surface_state.c | 4 +-<br>
src/mesa/drivers/dri/i965/<u></u>gen6_sampler_state.c | 2 +-<br>
src/mesa/drivers/dri/i965/<u></u>gen6_vs_state.c | 23 +++++++-----<br>
src/mesa/drivers/dri/i965/<u></u>gen7_vs_state.c | 18 +++++----<br>
12 files changed, 107 insertions(+), 85 deletions(-)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<u></u>brw_context.h b/src/mesa/drivers/dri/i965/<u></u>brw_context.h<br>
index dcd4c9a..9784956 100644<br>
--- a/src/mesa/drivers/dri/i965/<u></u>brw_context.h<br>
+++ b/src/mesa/drivers/dri/i965/<u></u>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_<u></u>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>
</blockquote>
<br></div></div>
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 global GL context: gl_context or a subclass like brw_context. (For ralloc, we inherited the "context" terminology from talloc, so it kind 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 particular pipeline stage. Also, other than BRW_MAX_VEC4_SURFACES, there's nothing vec4 specific about this at all. The pixel shader could use every one of these fields (and should eventually). So I dislike "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 open to other ideas.<br>
<br>
--Ken<br>
</blockquote></div><br></div><div class="gmail_extra">I'm fine with brw_shader_state. Anyone else want to jump in and bike-shed before I go and rename everything?<br></div></div>