[Mesa-dev] [PATCH 7/7] i965/gen7: Call gen7_create_constant_surface instead of brw_[...].
Kenneth Graunke
kenneth at whitecape.org
Mon Jun 6 19:08:12 PDT 2011
Fixes 17 piglit tests:
- glsl-vs-arrays-3
- glsl-vs-texturematrix-2
- glsl-vs-uniform-array-2
- arl
- nv-arl
- nv-init-zero-addr
- vp-address-01
- vp-arl-constant-array
- vp-arl-constant-array-huge
- vp-arl-constant-array-huge-offset
- vp-arl-constant-array-huge-offset-neg
- vp-arl-constant-array-huge-relative-offset
- vp-arl-constant-array-huge-varying
- vp-arl-env-array
- vp-arl-local-array
- vp-arl-neg-array
- vp-arl-neg-array-2
Fixes 4 glean tests:
- glsl1-constant array of vec4 with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader
- glsl1-constant array with variable indexing, vertex shader (2)
- vp1-ARL test
Signed-off-by: Kenneth Graunke <kenneth at whitecape.org>
---
src/mesa/drivers/dri/i965/brw_state.h | 6 ++++++
src/mesa/drivers/dri/i965/brw_vs_surface_state.c | 10 ++++++++--
src/mesa/drivers/dri/i965/gen7_wm_surface_state.c | 2 +-
3 files changed, 15 insertions(+), 3 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h
index 3aaa7c6..544ef7d 100644
--- a/src/mesa/drivers/dri/i965/brw_state.h
+++ b/src/mesa/drivers/dri/i965/brw_state.h
@@ -191,6 +191,12 @@ GLuint translate_tex_format(gl_format mesa_format,
GLenum depth_mode,
GLenum srgb_decode);
+/* gen7_wm_surface_state.c */
+void gen7_create_constant_surface(struct brw_context *brw,
+ drm_intel_bo *bo,
+ int width,
+ uint32_t *out_offset);
+
/* brw_wm_sampler_state.c */
uint32_t translate_wrap_mode(GLenum wrap, bool using_nearest);
void upload_default_color(struct brw_context *brw,
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 2b9b635..611f633 100644
--- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c
@@ -114,6 +114,7 @@ brw_update_vs_constant_surface( struct gl_context *ctx,
GLuint surf)
{
struct brw_context *brw = brw_context(ctx);
+ struct intel_context *intel = &brw->intel;
struct brw_vertex_program *vp =
(struct brw_vertex_program *) brw->vertex_program;
const struct gl_program_parameter_list *params = vp->program.Base.Parameters;
@@ -128,8 +129,13 @@ brw_update_vs_constant_surface( struct gl_context *ctx,
return;
}
- brw_create_constant_surface(brw, brw->vs.const_bo, params->NumParameters,
- &brw->vs.surf_offset[surf]);
+ if (intel->gen >= 7) {
+ gen7_create_constant_surface(brw, brw->vs.const_bo, params->NumParameters,
+ &brw->vs.surf_offset[surf]);
+ } else {
+ brw_create_constant_surface(brw, brw->vs.const_bo, params->NumParameters,
+ &brw->vs.surf_offset[surf]);
+ }
}
diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
index d4eb550..00b562f 100644
--- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c
@@ -126,7 +126,7 @@ gen7_update_texture_surface(struct gl_context *ctx, GLuint unit)
* Create the constant buffer surface. Vertex/fragment shader constants will
* be read from this buffer with Data Port Read instructions/messages.
*/
-static void
+void
gen7_create_constant_surface(struct brw_context *brw,
drm_intel_bo *bo,
int width,
--
1.7.4.4
More information about the mesa-dev
mailing list