diff options
author | Andrzej Janik <[email protected]> | 2024-05-16 22:52:53 +0200 |
---|---|---|
committer | Andrzej Janik <[email protected]> | 2024-05-16 22:52:53 +0200 |
commit | f62930dbcb8b6d460fa598d1bf8ff0878dd7095c (patch) | |
tree | c05be8e1ffd932c8fbefa71c004dfd11abefccdc | |
parent | b413cf2351518914176eb3722efa0beaaa4b277a (diff) | |
download | ZLUDA-f62930dbcb8b6d460fa598d1bf8ff0878dd7095c.tar.gz ZLUDA-f62930dbcb8b6d460fa598d1bf8ff0878dd7095c.zip |
Backport some image fixescompat
-rw-r--r-- | ptx/src/translate.rs | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/ptx/src/translate.rs b/ptx/src/translate.rs index e00590e..5b09693 100644 --- a/ptx/src/translate.rs +++ b/ptx/src/translate.rs @@ -8195,9 +8195,9 @@ impl<T: ArgParamsEx> ast::Arg3<T> { fn texture_geometry_to_vec_length(geometry: ast::TextureGeometry) -> u8 {
match geometry {
- ast::TextureGeometry::OneD => 1u8,
- ast::TextureGeometry::TwoD | ast::TextureGeometry::Array1D => 2,
- ast::TextureGeometry::ThreeD | ast::TextureGeometry::Array2D => 4,
+ ast::TextureGeometry::OneD | ast::TextureGeometry::Array1D => 1u8,
+ ast::TextureGeometry::TwoD | ast::TextureGeometry::Array2D => 2,
+ ast::TextureGeometry::ThreeD => 4,
}
}
@@ -8271,6 +8271,14 @@ impl<T: ArgParamsEx> ast::Arg4Sust<T> { visitor: &mut V,
details: &ast::SurfaceDetails,
) -> Result<ast::Arg4Sust<U>, TranslateError> {
+ let (type_, space) = if details.direct {
+ (ast::Type::Surfref, ast::StateSpace::Global)
+ } else {
+ (
+ ast::Type::Scalar(ast::ScalarType::B64),
+ ast::StateSpace::Reg,
+ )
+ };
let image = visitor.operand(
ArgumentDescriptor {
op: self.image,
@@ -8278,8 +8286,8 @@ impl<T: ArgParamsEx> ast::Arg4Sust<T> { is_memory_access: false,
non_default_implicit_conversion: None,
},
- &ast::Type::Surfref,
- ast::StateSpace::Global,
+ &type_,
+ space,
)?;
let layer = self
.layer
@@ -9231,9 +9239,7 @@ fn should_convert_relaxed_src_wrapper( }
match should_convert_relaxed_src(operand_type, instruction_type) {
conv @ Some(_) => Ok(conv),
- None => {
- Err(TranslateError::mismatched_type())
- }
+ None => Err(TranslateError::mismatched_type()),
}
}
|