brw/vec4: Don't convert tex dest type to glsl_type

We were using nir_tex_instr::dest_type to a glsl_type, then passing it
to emit_texture(), only to just check the number of components. Just
pass the number of components directly. This lets us delete
brw_glsl_base_type_for_nir_type, which was asserting with
nir_texop_all_samples_equal because it didn't handle bool32.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7989>
This commit is contained in:
Connor Abbott
2021-01-20 14:57:12 +01:00
parent 3d803893da
commit 68969cbcb7
5 changed files with 5 additions and 53 deletions

View File

@@ -1482,42 +1482,6 @@ brw_type_for_nir_type(const struct gen_device_info *devinfo, nir_alu_type type)
return BRW_REGISTER_TYPE_F;
}
/* Returns the glsl_base_type corresponding to a nir_alu_type.
* This is used by both brw_vec4_nir and brw_fs_nir.
*/
enum glsl_base_type
brw_glsl_base_type_for_nir_type(nir_alu_type type)
{
switch (type) {
case nir_type_float:
case nir_type_float32:
return GLSL_TYPE_FLOAT;
case nir_type_float16:
return GLSL_TYPE_FLOAT16;
case nir_type_float64:
return GLSL_TYPE_DOUBLE;
case nir_type_int:
case nir_type_int32:
return GLSL_TYPE_INT;
case nir_type_uint:
case nir_type_uint32:
return GLSL_TYPE_UINT;
case nir_type_int16:
return GLSL_TYPE_INT16;
case nir_type_uint16:
return GLSL_TYPE_UINT16;
default:
unreachable("bad type");
}
}
nir_shader *
brw_nir_create_passthrough_tcs(void *mem_ctx, const struct brw_compiler *compiler,
const nir_shader_compiler_options *options,