summaryrefslogtreecommitdiffstats
path: root/src/compiler/nir/glsl_to_nir.cpp
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-10 17:10:19 -0800
committerJason Ekstrand <[email protected]>2016-02-10 17:12:11 -0800
commitf710f3ca377a4583b1fc5081cc28ee1d4aba71cb (patch)
treeab4d8226ab88b0e5ef2d9a4a6ebfdf79a244a6e2 /src/compiler/nir/glsl_to_nir.cpp
parent7ef3e47c27fb9b11b113bb699019785960d6bf9a (diff)
parent8750299a420af76cebd3067f6f603eacde06ae06 (diff)
Merge remote-tracking branch 'mesa-public/master' into vulkan
This also reverts commit 1d65abfa582a371558113f699ffbf16d60b64c90 because now NIR handles texture offsets in a much more sane way.
Diffstat (limited to 'src/compiler/nir/glsl_to_nir.cpp')
-rw-r--r--src/compiler/nir/glsl_to_nir.cpp16
1 files changed, 5 insertions, 11 deletions
diff --git a/src/compiler/nir/glsl_to_nir.cpp b/src/compiler/nir/glsl_to_nir.cpp
index 2611023c370..6671691fd06 100644
--- a/src/compiler/nir/glsl_to_nir.cpp
+++ b/src/compiler/nir/glsl_to_nir.cpp
@@ -1838,7 +1838,7 @@ nir_visitor::visit(ir_texture *ir)
num_srcs++;
if (ir->shadow_comparitor != NULL)
num_srcs++;
- if (ir->offset != NULL && ir->offset->as_constant() == NULL)
+ if (ir->offset != NULL)
num_srcs++;
nir_tex_instr *instr = nir_tex_instr_create(this->shader, num_srcs);
@@ -1895,16 +1895,10 @@ nir_visitor::visit(ir_texture *ir)
/* we don't support multiple offsets yet */
assert(ir->offset->type->is_vector() || ir->offset->type->is_scalar());
- ir_constant *const_offset = ir->offset->as_constant();
- if (const_offset != NULL) {
- for (unsigned i = 0; i < const_offset->type->vector_elements; i++)
- instr->const_offset[i] = const_offset->value.i[i];
- } else {
- instr->src[src_number].src =
- nir_src_for_ssa(evaluate_rvalue(ir->offset));
- instr->src[src_number].src_type = nir_tex_src_offset;
- src_number++;
- }
+ instr->src[src_number].src =
+ nir_src_for_ssa(evaluate_rvalue(ir->offset));
+ instr->src[src_number].src_type = nir_tex_src_offset;
+ src_number++;
}
switch (ir->op) {