i965: Enable the GL_ARB_shader_bit_encode extension.
authorKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Jun 2012 07:11:28 +0000 (00:11 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Thu, 7 Jun 2012 07:17:21 +0000 (00:17 -0700)
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/brw_fs_visitor.cpp
src/mesa/drivers/dri/i965/brw_vec4_visitor.cpp
src/mesa/drivers/dri/intel/intel_extensions.c

index 2634b0862a01101df16e11cd6e038a4186ede1ac..12745f23102c835fa0e19b2bcdd77f9b5c73e327 100644 (file)
@@ -445,11 +445,18 @@ fs_visitor::visit(ir_expression *ir)
       emit_math(SHADER_OPCODE_RSQ, this->result, op[0]);
       break;
 
+   case ir_unop_bitcast_i2f:
+   case ir_unop_bitcast_u2f:
+      op[0].type = BRW_REGISTER_TYPE_F;
+      this->result = op[0];
+      break;
    case ir_unop_i2u:
+   case ir_unop_bitcast_f2u:
       op[0].type = BRW_REGISTER_TYPE_UD;
       this->result = op[0];
       break;
    case ir_unop_u2i:
+   case ir_unop_bitcast_f2i:
       op[0].type = BRW_REGISTER_TYPE_D;
       this->result = op[0];
       break;
index cfffef44605fe74fc214144e13b7d35d3ff14870..bde84202df501ca32ab681d35960f5c23d3c75c7 100644 (file)
@@ -1254,6 +1254,23 @@ vec4_visitor::visit(ir_expression *ir)
    case ir_unop_rsq:
       emit_math(SHADER_OPCODE_RSQ, result_dst, op[0]);
       break;
+
+   case ir_unop_bitcast_i2f:
+   case ir_unop_bitcast_u2f:
+      this->result = op[0];
+      this->result.type = BRW_REGISTER_TYPE_F;
+      break;
+
+   case ir_unop_bitcast_f2i:
+      this->result = op[0];
+      this->result.type = BRW_REGISTER_TYPE_D;
+      break;
+
+   case ir_unop_bitcast_f2u:
+      this->result = op[0];
+      this->result.type = BRW_REGISTER_TYPE_UD;
+      break;
+
    case ir_unop_i2f:
    case ir_unop_i2u:
    case ir_unop_u2i:
index 6c29aff6523d84a6e1f34bc99e4ad335c9b4347c..29da36ce7bb73a115696b90df2a082c8c00d03c1 100755 (executable)
@@ -122,6 +122,7 @@ intelInitExtensions(struct gl_context *ctx)
       ctx->Extensions.ARB_occlusion_query = true;
       ctx->Extensions.ARB_point_sprite = true;
       ctx->Extensions.ARB_seamless_cube_map = true;
+      ctx->Extensions.ARB_shader_bit_encoding = true;
       ctx->Extensions.ARB_shader_texture_lod = true;
 #ifdef TEXTURE_FLOAT_ENABLED
       ctx->Extensions.ARB_texture_float = true;