summaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2016-04-29 16:54:55 -0700
committerMatt Turner <[email protected]>2016-05-03 22:33:59 -0700
commit0ff4912cf4e3d7186bbc5ba4886d00dd4d4876d3 (patch)
tree78c347e2797f164c8dc8d2628568de24196d079d /src/mesa/drivers
parent667408b889e2bf5f103340c2deeb04c4d99cb75b (diff)
i965: Actually check whether the opcode is supported.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu.c4
-rw-r--r--src/mesa/drivers/dri/i965/brw_eu_validate.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/src/mesa/drivers/dri/i965/brw_eu.c b/src/mesa/drivers/dri/i965/brw_eu.c
index 102e4ca6088..14b2da4c2c6 100644
--- a/src/mesa/drivers/dri/i965/brw_eu.c
+++ b/src/mesa/drivers/dri/i965/brw_eu.c
@@ -583,7 +583,6 @@ gen_from_devinfo(const struct brw_device_info *devinfo)
/* Return the matching opcode_desc for the specified opcode number and
* hardware generation, or NULL if the opcode is not supported by the device.
- * XXX -- Actually check whether the opcode is supported.
*/
const struct opcode_desc *
brw_opcode_desc(const struct brw_device_info *devinfo, enum opcode opcode)
@@ -591,7 +590,8 @@ brw_opcode_desc(const struct brw_device_info *devinfo, enum opcode opcode)
if (opcode >= ARRAY_SIZE(opcode_descs))
return NULL;
- if (opcode_descs[opcode].name)
+ enum gen gen = gen_from_devinfo(devinfo);
+ if ((opcode_descs[opcode].gens & gen) != 0)
return &opcode_descs[opcode];
else
return NULL;
diff --git a/src/mesa/drivers/dri/i965/brw_eu_validate.c b/src/mesa/drivers/dri/i965/brw_eu_validate.c
index 6f55df96bde..dbf75e4ef35 100644
--- a/src/mesa/drivers/dri/i965/brw_eu_validate.c
+++ b/src/mesa/drivers/dri/i965/brw_eu_validate.c
@@ -121,8 +121,7 @@ static bool
is_unsupported_inst(const struct brw_device_info *devinfo,
const brw_inst *inst)
{
- int gen = gen_from_devinfo(devinfo);
- return (opcode_descs[brw_inst_opcode(devinfo, inst)].gens & gen) == 0;
+ return brw_opcode_desc(devinfo, brw_inst_opcode(devinfo, inst)) == NULL;
}
bool