[Mesa-dev] [PATCH v2 10/16] i965: Rename brw_vec4_prog_data to brw_vue_prog_data
Kristian Høgsberg
krh at bitplanet.net
Thu Nov 13 16:28:16 PST 2014
With scalar vertex shader coming up, we're going to reuse brw_vec4_prog_data
in the scalar backend. There's nothing vec4 specific in the struct, it's
instead common state for stages that operate on VUEs. This patch renames
the struct to brw_vue_prog_data which is more descriptive and will look a lot
less awkward when we use it in the scalar backend.
Signed-off-by: Kristian Høgsberg <krh at bitplanet.net>
---
src/mesa/drivers/dri/i965/brw_context.h | 17 ++++++++---------
src/mesa/drivers/dri/i965/brw_vec4.cpp | 6 +++---
src/mesa/drivers/dri/i965/brw_vec4.h | 18 +++++++++---------
src/mesa/drivers/dri/i965/brw_vec4_generator.cpp | 4 ++--
src/mesa/drivers/dri/i965/brw_vec4_gs.c | 4 ++--
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h | 2 +-
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp | 4 ++--
src/mesa/drivers/dri/i965/brw_vs.c | 10 +++++-----
src/mesa/drivers/dri/i965/brw_vs.h | 2 +-
src/mesa/drivers/dri/i965/gen6_gs_state.c | 2 +-
src/mesa/drivers/dri/i965/gen7_gs_state.c | 2 +-
src/mesa/drivers/dri/i965/gen8_gs_state.c | 2 +-
src/mesa/drivers/dri/i965/gen8_vs_state.c | 2 +-
14 files changed, 38 insertions(+), 39 deletions(-)
diff --git a/src/mesa/drivers/dri/i965/brw_context.h b/src/mesa/drivers/dri/i965/brw_context.h
index e7cd30f..463f3d2 100644
--- a/src/mesa/drivers/dri/i965/brw_context.h
+++ b/src/mesa/drivers/dri/i965/brw_context.h
@@ -145,7 +145,7 @@ extern "C" {
struct brw_context;
struct brw_inst;
struct brw_vs_prog_key;
-struct brw_vec4_prog_key;
+struct brw_vue_prog_key;
struct brw_wm_prog_key;
struct brw_wm_prog_data;
@@ -528,10 +528,9 @@ struct brw_ff_gs_prog_data {
};
-/* Note: brw_vec4_prog_data_compare() must be updated when adding fields to
- * this struct!
+/* Shared data for stages that operate on VUEs (vertex, geometry)
*/
-struct brw_vec4_prog_data {
+struct brw_vue_prog_data {
struct brw_stage_prog_data base;
struct brw_vue_map vue_map;
@@ -552,7 +551,7 @@ struct brw_vec4_prog_data {
* struct!
*/
struct brw_vs_prog_data {
- struct brw_vec4_prog_data base;
+ struct brw_vue_prog_data base;
GLbitfield64 inputs_read;
@@ -610,7 +609,7 @@ struct brw_vs_prog_data {
*/
struct brw_gs_prog_data
{
- struct brw_vec4_prog_data base;
+ struct brw_vue_prog_data base;
/**
* Size of an output vertex, measured in HWORDS (32 bytes).
@@ -1853,9 +1852,9 @@ void gen8_hiz_exec(struct brw_context *brw, struct intel_mipmap_tree *mt,
uint32_t get_hw_prim_for_gl_prim(int mode);
void
-brw_setup_vec4_key_clip_info(struct brw_context *brw,
- struct brw_vec4_prog_key *key,
- bool program_uses_clip_distance);
+brw_setup_vue_key_clip_info(struct brw_context *brw,
+ struct brw_vue_prog_key *key,
+ bool program_uses_clip_distance);
void
gen6_upload_push_constants(struct brw_context *brw,
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.cpp b/src/mesa/drivers/dri/i965/brw_vec4.cpp
index df589b8..280db47 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4.cpp
@@ -1911,9 +1911,9 @@ brw_vs_emit(struct brw_context *brw,
void
-brw_vec4_setup_prog_key_for_precompile(struct gl_context *ctx,
- struct brw_vec4_prog_key *key,
- GLuint id, struct gl_program *prog)
+brw_vue_setup_prog_key_for_precompile(struct gl_context *ctx,
+ struct brw_vue_prog_key *key,
+ GLuint id, struct gl_program *prog)
{
key->program_string_id = id;
key->clamp_vertex_color = ctx->API == API_OPENGL_COMPAT;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4.h b/src/mesa/drivers/dri/i965/brw_vec4.h
index 750f491..18ec8b3 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4.h
@@ -50,7 +50,7 @@ struct brw_vec4_compile {
};
-struct brw_vec4_prog_key {
+struct brw_vue_prog_key {
GLuint program_string_id;
/**
@@ -77,7 +77,7 @@ extern "C" {
void
brw_vec4_setup_prog_key_for_precompile(struct gl_context *ctx,
- struct brw_vec4_prog_key *key,
+ struct brw_vue_prog_key *key,
GLuint id, struct gl_program *prog);
#ifdef __cplusplus
@@ -210,7 +210,7 @@ public:
const src_reg &src2 = src_reg());
struct brw_reg get_dst(void);
- struct brw_reg get_src(const struct brw_vec4_prog_data *prog_data, int i);
+ struct brw_reg get_src(const struct brw_vue_prog_data *prog_data, int i);
dst_reg dst;
src_reg src[3];
@@ -252,8 +252,8 @@ public:
vec4_visitor(struct brw_context *brw,
struct brw_vec4_compile *c,
struct gl_program *prog,
- const struct brw_vec4_prog_key *key,
- struct brw_vec4_prog_data *prog_data,
+ const struct brw_vue_prog_key *key,
+ struct brw_vue_prog_data *prog_data,
struct gl_shader_program *shader_prog,
gl_shader_stage stage,
void *mem_ctx,
@@ -280,8 +280,8 @@ public:
}
struct brw_vec4_compile * const c;
- const struct brw_vec4_prog_key * const key;
- struct brw_vec4_prog_data * const prog_data;
+ const struct brw_vue_prog_key * const key;
+ struct brw_vue_prog_data * const prog_data;
unsigned int sanity_param_count;
char *fail_msg;
@@ -624,7 +624,7 @@ public:
vec4_generator(struct brw_context *brw,
struct gl_shader_program *shader_prog,
struct gl_program *prog,
- struct brw_vec4_prog_data *prog_data,
+ struct brw_vue_prog_data *prog_data,
void *mem_ctx,
bool debug_flag);
~vec4_generator();
@@ -716,7 +716,7 @@ private:
struct gl_shader_program *shader_prog;
const struct gl_program *prog;
- struct brw_vec4_prog_data *prog_data;
+ struct brw_vue_prog_data *prog_data;
void *mem_ctx;
const bool debug_flag;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
index e522567..b3b8a8d 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_generator.cpp
@@ -66,7 +66,7 @@ vec4_instruction::get_dst(void)
}
struct brw_reg
-vec4_instruction::get_src(const struct brw_vec4_prog_data *prog_data, int i)
+vec4_instruction::get_src(const struct brw_vue_prog_data *prog_data, int i)
{
struct brw_reg brw_reg;
@@ -133,7 +133,7 @@ vec4_instruction::get_src(const struct brw_vec4_prog_data *prog_data, int i)
vec4_generator::vec4_generator(struct brw_context *brw,
struct gl_shader_program *shader_prog,
struct gl_program *prog,
- struct brw_vec4_prog_data *prog_data,
+ struct brw_vue_prog_data *prog_data,
void *mem_ctx,
bool debug_flag)
: brw(brw), shader_prog(shader_prog), prog(prog), prog_data(prog_data),
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs.c b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
index c8814fe..66013e8 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs.c
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs.c
@@ -330,8 +330,8 @@ brw_upload_gs_prog(struct brw_context *brw)
memset(&key, 0, sizeof(key));
key.base.program_string_id = gp->id;
- brw_setup_vec4_key_clip_info(brw, &key.base,
- gp->program.Base.UsesClipDistanceOut);
+ brw_setup_vue_key_clip_info(brw, &key.base,
+ gp->program.Base.UsesClipDistanceOut);
/* _NEW_LIGHT | _NEW_BUFFERS */
key.base.clamp_vertex_color = ctx->Light._ClampVertexColor;
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
index db0e6cc..089f479 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.cpp
@@ -611,7 +611,7 @@ static const unsigned *
generate_assembly(struct brw_context *brw,
struct gl_shader_program *shader_prog,
struct gl_program *prog,
- struct brw_vec4_prog_data *prog_data,
+ struct brw_vue_prog_data *prog_data,
void *mem_ctx,
const cfg_t *cfg,
unsigned *final_assembly_size)
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
index 8bf11fa..6f53428 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
+++ b/src/mesa/drivers/dri/i965/brw_vec4_gs_visitor.h
@@ -35,7 +35,7 @@
struct brw_gs_prog_key
{
- struct brw_vec4_prog_key base;
+ struct brw_vue_prog_key base;
GLbitfield64 input_varyings;
};
diff --git a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
index b46879b..da4d967 100644
--- a/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
+++ b/src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
@@ -3505,8 +3505,8 @@ vec4_visitor::resolve_ud_negate(src_reg *reg)
vec4_visitor::vec4_visitor(struct brw_context *brw,
struct brw_vec4_compile *c,
struct gl_program *prog,
- const struct brw_vec4_prog_key *key,
- struct brw_vec4_prog_data *prog_data,
+ const struct brw_vue_prog_key *key,
+ struct brw_vue_prog_data *prog_data,
struct gl_shader_program *shader_prog,
gl_shader_stage stage,
void *mem_ctx,
diff --git a/src/mesa/drivers/dri/i965/brw_vs.c b/src/mesa/drivers/dri/i965/brw_vs.c
index edaa82c..c9a3883 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.c
+++ b/src/mesa/drivers/dri/i965/brw_vs.c
@@ -392,9 +392,9 @@ brw_vs_debug_recompile(struct brw_context *brw,
void
-brw_setup_vec4_key_clip_info(struct brw_context *brw,
- struct brw_vec4_prog_key *key,
- bool program_uses_clip_distance)
+brw_setup_vue_key_clip_info(struct brw_context *brw,
+ struct brw_vue_prog_key *key,
+ bool program_uses_clip_distance)
{
struct gl_context *ctx = &brw->ctx;
@@ -422,8 +422,8 @@ static void brw_upload_vs_prog(struct brw_context *brw)
* the inputs it asks for, whether they are varying or not.
*/
key.base.program_string_id = vp->id;
- brw_setup_vec4_key_clip_info(brw, &key.base,
- vp->program.Base.UsesClipDistanceOut);
+ brw_setup_vue_key_clip_info(brw, &key.base,
+ vp->program.Base.UsesClipDistanceOut);
/* _NEW_POLYGON */
if (brw->gen < 6) {
diff --git a/src/mesa/drivers/dri/i965/brw_vs.h b/src/mesa/drivers/dri/i965/brw_vs.h
index 97308a7..fe22ecd 100644
--- a/src/mesa/drivers/dri/i965/brw_vs.h
+++ b/src/mesa/drivers/dri/i965/brw_vs.h
@@ -51,7 +51,7 @@
#define BRW_ATTRIB_WA_SCALE 64 /* interpret as scaled in shader */
struct brw_vs_prog_key {
- struct brw_vec4_prog_key base;
+ struct brw_vue_prog_key base;
/*
* Per-attribute workaround flags
diff --git a/src/mesa/drivers/dri/i965/gen6_gs_state.c b/src/mesa/drivers/dri/i965/gen6_gs_state.c
index 85eb46d..145a9f8 100644
--- a/src/mesa/drivers/dri/i965/gen6_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen6_gs_state.c
@@ -90,7 +90,7 @@ upload_gs_state(struct brw_context *brw)
/* BRW_NEW_GEOMETRY_PROGRAM */
bool active = brw->geometry_program;
/* CACHE_NEW_GS_PROG */
- const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
+ const struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base;
const struct brw_stage_state *stage_state = &brw->gs.base;
if (!active || stage_state->push_const_size == 0) {
diff --git a/src/mesa/drivers/dri/i965/gen7_gs_state.c b/src/mesa/drivers/dri/i965/gen7_gs_state.c
index 4fe1354..d388518 100644
--- a/src/mesa/drivers/dri/i965/gen7_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen7_gs_state.c
@@ -35,7 +35,7 @@ upload_gs_state(struct brw_context *brw)
/* BRW_NEW_GEOMETRY_PROGRAM */
bool active = brw->geometry_program;
/* CACHE_NEW_GS_PROG */
- const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
+ const struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base;
/**
* From Graphics BSpec: 3D-Media-GPGPU Engine > 3D Pipeline Stages >
diff --git a/src/mesa/drivers/dri/i965/gen8_gs_state.c b/src/mesa/drivers/dri/i965/gen8_gs_state.c
index 927be42..4c17eb8 100644
--- a/src/mesa/drivers/dri/i965/gen8_gs_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_gs_state.c
@@ -34,7 +34,7 @@ gen8_upload_gs_state(struct brw_context *brw)
/* BRW_NEW_GEOMETRY_PROGRAM */
bool active = brw->geometry_program;
/* CACHE_NEW_GS_PROG */
- const struct brw_vec4_prog_data *prog_data = &brw->gs.prog_data->base;
+ const struct brw_vue_prog_data *prog_data = &brw->gs.prog_data->base;
if (active) {
int urb_entry_write_offset = 1;
diff --git a/src/mesa/drivers/dri/i965/gen8_vs_state.c b/src/mesa/drivers/dri/i965/gen8_vs_state.c
index 14e2995..a308545 100644
--- a/src/mesa/drivers/dri/i965/gen8_vs_state.c
+++ b/src/mesa/drivers/dri/i965/gen8_vs_state.c
@@ -37,7 +37,7 @@ upload_vs_state(struct brw_context *brw)
uint32_t floating_point_mode = 0;
/* CACHE_NEW_VS_PROG */
- const struct brw_vec4_prog_data *prog_data = &brw->vs.prog_data->base;
+ const struct brw_vue_prog_data *prog_data = &brw->vs.prog_data->base;
/* Use ALT floating point mode for ARB vertex programs, because they
* require 0^0 == 1.
--
2.1.0
More information about the mesa-dev
mailing list