From: Dave Airlie <[email protected]>

This asserts on any double opcocde getting into the shader
assembler on gpus that don't support them. This is a better
way to find holes in the soft fp64 coverage than gpu hangs.

Signed-off-by: Dave Airlie <[email protected]>
---
 src/gallium/drivers/r600/r600_shader.c | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/src/gallium/drivers/r600/r600_shader.c 
b/src/gallium/drivers/r600/r600_shader.c
index 6b5c42f..c2f5b8d 100644
--- a/src/gallium/drivers/r600/r600_shader.c
+++ b/src/gallium/drivers/r600/r600_shader.c
@@ -402,6 +402,17 @@ static bool ctx_needs_stack_workaround_8xx(struct 
r600_shader_ctx *ctx)
        return true;
 }
 
+static bool ctx_has_doubles(struct r600_shader_ctx *ctx)
+{
+       if (ctx->bc->family == CHIP_ARUBA ||
+           ctx->bc->family == CHIP_CAYMAN ||
+           ctx->bc->family == CHIP_CYPRESS ||
+           ctx->bc->family == CHIP_HEMLOCK)
+               return true;
+       else
+               return false;
+}
+
 static int tgsi_last_instruction(unsigned writemask)
 {
        int i, lasti = 0;
@@ -4419,6 +4430,7 @@ static int tgsi_op2_64_params(struct r600_shader_ctx 
*ctx, bool singledest, bool
        int use_tmp = 0;
        int swizzle_x = inst->Src[0].Register.SwizzleX;
 
+       assert (ctx_has_doubles(ctx));
        if (singledest) {
                switch (write_mask) {
                case 0x1:
@@ -4568,6 +4580,7 @@ static int tgsi_op3_64(struct r600_shader_ctx *ctx)
        int lasti = 3;
        int tmp = r600_get_temp(ctx);
 
+       assert (ctx_has_doubles(ctx));
        for (i = 0; i < lasti + 1; i++) {
 
                memset(&alu, 0, sizeof(struct r600_bytecode_alu));
@@ -4987,6 +5000,7 @@ static int cayman_emit_double_instr(struct 
r600_shader_ctx *ctx)
        int lasti = tgsi_last_instruction(inst->Dst[0].Register.WriteMask);
        int t1 = ctx->temp_reg;
 
+       assert (ctx_has_doubles(ctx));
        /* should only be one src regs */
        assert(inst->Instruction.NumSrcRegs == 1);
 
-- 
2.9.5

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to