diff options
author | marha <marha@users.sourceforge.net> | 2011-09-12 09:07:21 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2011-09-12 09:07:21 +0200 |
commit | 0b40f5f4b54453a77f4b09c431f8efc6875da61f (patch) | |
tree | c1f08e0dd75a6ed7876c24c7219f93f01cab3605 /mesalib/src/mesa/program/ir_to_mesa.cpp | |
parent | 75530c6eb2feebe234f7cb078c4caaf70c64981a (diff) | |
parent | 24a692ce832161d3b794110dd82b1508d38a0887 (diff) | |
download | vcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.tar.gz vcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.tar.bz2 vcxsrv-0b40f5f4b54453a77f4b09c431f8efc6875da61f.zip |
Merge remote-tracking branch 'origin/released'
Conflicts:
mesalib/src/glsl/ast_to_hir.cpp
mesalib/src/glsl/glcpp/glcpp.c
mesalib/src/mesa/drivers/dri/common/dri_util.c
mesalib/src/mesa/drivers/dri/common/spantmp2.h
mesalib/src/mesa/drivers/dri/common/utils.c
mesalib/src/mesa/drivers/dri/swrast/swrast.c
mesalib/src/mesa/program/ir_to_mesa.cpp
mesalib/src/mesa/state_tracker/st_extensions.c
mesalib/src/mesa/state_tracker/st_mesa_to_tgsi.c
pixman/configure.ac
pixman/pixman/pixman-arm-neon-asm.S
pixman/test/Makefile.am
pixman/test/utils.c
pixman/test/utils.h
Diffstat (limited to 'mesalib/src/mesa/program/ir_to_mesa.cpp')
-rw-r--r-- | mesalib/src/mesa/program/ir_to_mesa.cpp | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mesalib/src/mesa/program/ir_to_mesa.cpp b/mesalib/src/mesa/program/ir_to_mesa.cpp index a29bf31f8..29975150b 100644 --- a/mesalib/src/mesa/program/ir_to_mesa.cpp +++ b/mesalib/src/mesa/program/ir_to_mesa.cpp @@ -2156,6 +2156,8 @@ ir_to_mesa_visitor::visit(ir_texture *ir) break;
}
+ const glsl_type *sampler_type = ir->sampler->type;
+
if (ir->projector) {
if (opcode == OPCODE_TEX) {
/* Slot the projector in as the last component of the coord. */
@@ -2187,6 +2189,9 @@ ir_to_mesa_visitor::visit(ir_texture *ir) tmp_src = get_temp(glsl_type::vec4_type);
dst_reg tmp_dst = dst_reg(tmp_src);
+ /* Projective division not allowed for array samplers. */
+ assert(!sampler_type->sampler_array);
+
tmp_dst.writemask = WRITEMASK_Z;
emit(ir, OPCODE_MOV, tmp_dst, this->result);
@@ -2211,7 +2216,15 @@ ir_to_mesa_visitor::visit(ir_texture *ir) * coord.
*/
ir->shadow_comparitor->accept(this);
- coord_dst.writemask = WRITEMASK_Z;
+
+ /* XXX This will need to be updated for cubemap array samplers. */
+ if (sampler_type->sampler_dimensionality == GLSL_SAMPLER_DIM_2D &&
+ sampler_type->sampler_array) {
+ coord_dst.writemask = WRITEMASK_W;
+ } else {
+ coord_dst.writemask = WRITEMASK_Z;
+ }
+
emit(ir, OPCODE_MOV, coord_dst, this->result);
coord_dst.writemask = WRITEMASK_XYZW;
}
@@ -2235,8 +2248,6 @@ ir_to_mesa_visitor::visit(ir_texture *ir) this->shader_program,
this->prog);
- const glsl_type *sampler_type = ir->sampler->type;
-
switch (sampler_type->sampler_dimensionality) {
case GLSL_SAMPLER_DIM_1D:
inst->tex_target = (sampler_type->sampler_array)
|