rusticl/mem: support GL_TEXTURE_BUFFER
Fixes: 2645003bdc ("rusticl: Create CL mem objects from GL")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/27385>
(cherry picked from commit 3f7b3449309b7422d99d982b189473b4daed775a)
This commit is contained in:
parent
277c905b41
commit
73c637fcfe
2 changed files with 4 additions and 3 deletions
|
|
@ -724,7 +724,7 @@
|
||||||
"description": "rusticl/mem: support GL_TEXTURE_BUFFER",
|
"description": "rusticl/mem: support GL_TEXTURE_BUFFER",
|
||||||
"nominated": true,
|
"nominated": true,
|
||||||
"nomination_type": 1,
|
"nomination_type": 1,
|
||||||
"resolution": 0,
|
"resolution": 1,
|
||||||
"main_sha": null,
|
"main_sha": null,
|
||||||
"because_sha": "2645003bdc527b5dc046366fce5e65b44b27334f",
|
"because_sha": "2645003bdc527b5dc046366fce5e65b44b27334f",
|
||||||
"notes": null
|
"notes": null
|
||||||
|
|
|
||||||
|
|
@ -310,7 +310,7 @@ impl GLCtxManager {
|
||||||
|
|
||||||
// CL_INVALID_GL_OBJECT if bufobj is not a GL buffer object or is a GL buffer
|
// CL_INVALID_GL_OBJECT if bufobj is not a GL buffer object or is a GL buffer
|
||||||
// object but does not have an existing data store or the size of the buffer is 0.
|
// object but does not have an existing data store or the size of the buffer is 0.
|
||||||
if target == GL_ARRAY_BUFFER && export_out.buf_size == 0 {
|
if [GL_ARRAY_BUFFER, GL_TEXTURE_BUFFER].contains(&target) && export_out.buf_size == 0 {
|
||||||
return Err(CL_INVALID_GL_OBJECT);
|
return Err(CL_INVALID_GL_OBJECT);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -375,7 +375,7 @@ impl GLExportManager {
|
||||||
array_size = depth;
|
array_size = depth;
|
||||||
depth = 1;
|
depth = 1;
|
||||||
}
|
}
|
||||||
GL_ARRAY_BUFFER => {
|
GL_ARRAY_BUFFER | GL_TEXTURE_BUFFER => {
|
||||||
array_size = 1;
|
array_size = 1;
|
||||||
width = self.export_out.buf_size as u32;
|
width = self.export_out.buf_size as u32;
|
||||||
offset = self.export_out.buf_offset as u32;
|
offset = self.export_out.buf_offset as u32;
|
||||||
|
|
@ -535,6 +535,7 @@ pub fn target_from_gl(target: u32) -> CLResult<(u32, u32)> {
|
||||||
// internal format does not map to a supported OpenCL image format.
|
// internal format does not map to a supported OpenCL image format.
|
||||||
Ok(match target {
|
Ok(match target {
|
||||||
GL_ARRAY_BUFFER => (CL_MEM_OBJECT_BUFFER, CL_GL_OBJECT_BUFFER),
|
GL_ARRAY_BUFFER => (CL_MEM_OBJECT_BUFFER, CL_GL_OBJECT_BUFFER),
|
||||||
|
GL_TEXTURE_BUFFER => (CL_MEM_OBJECT_IMAGE1D_BUFFER, CL_GL_OBJECT_TEXTURE_BUFFER),
|
||||||
GL_RENDERBUFFER => (CL_MEM_OBJECT_IMAGE2D, CL_GL_OBJECT_RENDERBUFFER),
|
GL_RENDERBUFFER => (CL_MEM_OBJECT_IMAGE2D, CL_GL_OBJECT_RENDERBUFFER),
|
||||||
GL_TEXTURE_1D => (CL_MEM_OBJECT_IMAGE1D, CL_GL_OBJECT_TEXTURE1D),
|
GL_TEXTURE_1D => (CL_MEM_OBJECT_IMAGE1D, CL_GL_OBJECT_TEXTURE1D),
|
||||||
GL_TEXTURE_1D_ARRAY => (CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_GL_OBJECT_TEXTURE1D_ARRAY),
|
GL_TEXTURE_1D_ARRAY => (CL_MEM_OBJECT_IMAGE1D_ARRAY, CL_GL_OBJECT_TEXTURE1D_ARRAY),
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue