[Mesa-dev] [PATCH 5/7] i965: relax brw_texture_offset assert

Chris Forbes chrisf at ijw.co.nz
Tue Oct 8 02:34:59 PDT 2013


Some texturing ops are about to have nonconstant offset support; the
offset in the header in these cases should be zero.

Signed-off-by: Chris Forbes <chrisf at ijw.co.nz>
---
 src/mesa/drivers/dri/i965/brw_shader.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/mesa/drivers/dri/i965/brw_shader.cpp b/src/mesa/drivers/dri/i965/brw_shader.cpp
index 6b37f58..df7fa55 100644
--- a/src/mesa/drivers/dri/i965/brw_shader.cpp
+++ b/src/mesa/drivers/dri/i965/brw_shader.cpp
@@ -370,7 +370,7 @@ brw_math_function(enum opcode op)
 uint32_t
 brw_texture_offset(ir_constant *offset)
 {
-   assert(offset != NULL);
+   if (!offset) return 0;  /* nonconstant offset; caller will handle it. */
 
    signed char offsets[3];
    for (unsigned i = 0; i < offset->type->vector_elements; i++)
-- 
1.8.4



More information about the mesa-dev mailing list