summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorJosé Fonseca <[email protected]>2013-04-17 13:32:46 +0100
committerJosé Fonseca <[email protected]>2013-04-17 16:50:52 +0100
commit35ef27d485367ffede9f478c9865515814e119b7 (patch)
tree701ee18ed6e2a21d887bb3f1011723663cb643cf /src/gallium
parent2b9ed257c0c4db879970afb2c5981c59ca70c21b (diff)
draw: Silence uninitialized var warnings.
Trivial.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/auxiliary/draw/draw_gs.c7
-rw-r--r--src/gallium/auxiliary/draw/draw_llvm.c3
2 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/auxiliary/draw/draw_gs.c b/src/gallium/auxiliary/draw/draw_gs.c
index 70db837390b..d95a4c5705b 100644
--- a/src/gallium/auxiliary/draw/draw_gs.c
+++ b/src/gallium/auxiliary/draw/draw_gs.c
@@ -643,13 +643,14 @@ draw_create_geometry_shader(struct draw_context *draw,
const struct pipe_shader_state *state)
{
#ifdef HAVE_LLVM
+ boolean use_llvm = draw_get_option_use_llvm();
struct llvm_geometry_shader *llvm_gs;
#endif
struct draw_geometry_shader *gs;
unsigned i;
#ifdef HAVE_LLVM
- if (draw_get_option_use_llvm()) {
+ if (use_llvm) {
llvm_gs = CALLOC_STRUCT(llvm_geometry_shader);
if (llvm_gs == NULL)
@@ -684,7 +685,7 @@ draw_create_geometry_shader(struct draw_context *draw,
gs->max_out_prims = 0;
#ifdef HAVE_LLVM
- if (draw_get_option_use_llvm()) {
+ if (use_llvm) {
/* TODO: change the input array to handle the following
vector length, instead of the currently hardcoded
TGSI_NUM_CHANNELS
@@ -717,7 +718,7 @@ draw_create_geometry_shader(struct draw_context *draw,
gs->machine = draw->gs.tgsi.machine;
#ifdef HAVE_LLVM
- if (draw_get_option_use_llvm()) {
+ if (use_llvm) {
int vector_size = gs->vector_length * sizeof(float);
gs->gs_input = align_malloc(sizeof(struct draw_gs_inputs), 16);
memset(gs->gs_input, 0, sizeof(struct draw_gs_inputs));
diff --git a/src/gallium/auxiliary/draw/draw_llvm.c b/src/gallium/auxiliary/draw/draw_llvm.c
index 5100ce0039c..0e349783198 100644
--- a/src/gallium/auxiliary/draw/draw_llvm.c
+++ b/src/gallium/auxiliary/draw/draw_llvm.c
@@ -1742,6 +1742,9 @@ draw_llvm_set_mapped_texture(struct draw_context *draw,
assert(sview_idx < Elements(draw->llvm->gs_jit_context.textures));
jit_tex = &draw->llvm->gs_jit_context.textures[sview_idx];
+ } else {
+ assert(0);
+ return;
}
jit_tex->width = width;