summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorBrian Paul <[email protected]>2013-06-28 08:09:48 -0600
committerBrian Paul <[email protected]>2013-06-28 08:38:00 -0600
commitba4979810fe072bcd2a4ad110988837a7e542744 (patch)
treea1d19b67446c61ee34e3673f73c46e04cae70821 /src/gallium/drivers
parent74e8a7d1ddafc8dd465795d1fcc85709c5c4c0ba (diff)
svga: pass svga_compile_key by reference instead of value
Reviewed-by: Jose Fonseca <[email protected]>
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/svga/svga_tgsi.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/gallium/drivers/svga/svga_tgsi.c b/src/gallium/drivers/svga/svga_tgsi.c
index 56529c6487d..29fbe847e3d 100644
--- a/src/gallium/drivers/svga/svga_tgsi.c
+++ b/src/gallium/drivers/svga/svga_tgsi.c
@@ -266,7 +266,7 @@ svga_remap_generic_index(int8_t remap_table[MAX_GENERIC_VARYING],
*/
static struct svga_shader_result *
svga_tgsi_translate(const struct svga_shader *shader,
- struct svga_compile_key key, unsigned unit)
+ const struct svga_compile_key *key, unsigned unit)
{
struct svga_shader_result *result = NULL;
struct svga_shader_emitter emit;
@@ -281,17 +281,17 @@ svga_tgsi_translate(const struct svga_shader *shader,
emit.ptr = emit.buf;
emit.unit = unit;
- emit.key = key;
+ emit.key = *key;
tgsi_scan_shader(shader->tokens, &emit.info);
emit.imm_start = emit.info.file_max[TGSI_FILE_CONSTANT] + 1;
if (unit == PIPE_SHADER_FRAGMENT)
- emit.imm_start += key.fkey.num_unnormalized_coords;
+ emit.imm_start += key->fkey.num_unnormalized_coords;
if (unit == PIPE_SHADER_VERTEX) {
- emit.imm_start += key.vkey.need_prescale ? 2 : 0;
+ emit.imm_start += key->vkey.need_prescale ? 2 : 0;
}
emit.nr_hw_float_const =
@@ -324,7 +324,7 @@ svga_tgsi_translate(const struct svga_shader *shader,
result->shader = shader;
result->tokens = (const unsigned *) emit.buf;
result->nr_tokens = (emit.ptr - emit.buf) / sizeof(unsigned);
- memcpy(&result->key, &key, sizeof key);
+ memcpy(&result->key, key, sizeof(*key));
result->id = UTIL_BITMASK_INVALID_INDEX;
if (SVGA_DEBUG & DEBUG_TGSI) {
@@ -360,7 +360,7 @@ svga_translate_fragment_program(const struct svga_fragment_shader *fs,
memcpy(key.generic_remap_table, fs->generic_remap_table,
sizeof(fs->generic_remap_table));
- return svga_tgsi_translate(&fs->base, key, PIPE_SHADER_FRAGMENT);
+ return svga_tgsi_translate(&fs->base, &key, PIPE_SHADER_FRAGMENT);
}
@@ -379,7 +379,7 @@ svga_translate_vertex_program(const struct svga_vertex_shader *vs,
*/
svga_remap_generics(vkey->fs_generic_inputs, key.generic_remap_table);
- return svga_tgsi_translate(&vs->base, key, PIPE_SHADER_VERTEX);
+ return svga_tgsi_translate(&vs->base, &key, PIPE_SHADER_VERTEX);
}