svga: remove a couple unneeded assertions
[mesa.git] / src / gallium / drivers / llvmpipe / lp_state_fs.c
index 504a7aa290162869c0e61bd4c71ebf625a95e0c0..2f9f907edd6fcf1893d69898fa7684afecc76d6a 100644 (file)
@@ -1,7 +1,7 @@
 /**************************************************************************
  * 
  * Copyright 2009 VMware, Inc.
- * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
+ * Copyright 2007 VMware, Inc.
  * All Rights Reserved.
  * 
  * Permission is hereby granted, free of charge, to any person obtaining a
@@ -19,7 +19,7 @@
  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
- * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR
  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -1089,6 +1089,19 @@ scale_bits(struct gallivm_state *gallivm,
    return result;
 }
 
+/**
+ * If RT is a smallfloat (needing denorms) format
+ */
+static INLINE int
+have_smallfloat_format(struct lp_type dst_type,
+                       enum pipe_format format)
+{
+   return ((dst_type.floating && dst_type.width != 32) ||
+    /* due to format handling hacks this format doesn't have floating set
+     * here (and actually has width set to 32 too) so special case this. */
+    (format == PIPE_FORMAT_R11G11B10_FLOAT));
+}
+
 
 /**
  * Convert from memory format to blending format
@@ -1593,7 +1606,7 @@ generate_unswizzled_blend(struct gallivm_state *gallivm,
     * this, otherwise half-float format conversions won't work
     * (again due to llvm bug #6393).
     */
-   if (dst_type.floating && dst_type.width != 32) {
+   if (have_smallfloat_format(dst_type, out_format)) {
       /* We need to make sure that denorms are ok for half float
          conversions */
       fpstate = lp_build_fpstate_get(gallivm);
@@ -2091,7 +2104,7 @@ generate_unswizzled_blend(struct gallivm_state *gallivm,
                              dst, dst_type, dst_count, dst_alignment);
    }
 
-   if (dst_type.floating && dst_type.width != 32) {
+   if (have_smallfloat_format(dst_type, out_format)) {
       lp_build_fpstate_set(gallivm, fpstate);
    }