diff --git a/src/gallium/frontends/rusticl/core/gl.rs b/src/gallium/frontends/rusticl/core/gl.rs index e1e9094d4f0..5c0122012af 100644 --- a/src/gallium/frontends/rusticl/core/gl.rs +++ b/src/gallium/frontends/rusticl/core/gl.rs @@ -344,7 +344,7 @@ impl GLCtxManager { #[derive(Clone)] pub struct GLMemProps { - pub height: u16, + pub height: u32, pub depth: u16, pub width: u32, pub offset: u32, @@ -379,7 +379,7 @@ impl GLExportManager { .unwrap() }; - let mut height = self.export_out.height as u16; + let mut height = self.export_out.height; let mut depth = self.export_out.depth as u16; let mut width = self.export_out.width; let mut array_size = 1; @@ -388,7 +388,7 @@ impl GLExportManager { // some fixups match self.export_in.target { GL_TEXTURE_1D_ARRAY => { - array_size = height; + array_size = height as u16; height = 1; depth = 1; } diff --git a/src/gallium/frontends/rusticl/mesa/pipe/resource.rs b/src/gallium/frontends/rusticl/mesa/pipe/resource.rs index 8c58e10025e..32427a562f1 100644 --- a/src/gallium/frontends/rusticl/mesa/pipe/resource.rs +++ b/src/gallium/frontends/rusticl/mesa/pipe/resource.rs @@ -117,7 +117,7 @@ impl PipeResourceOwned { self.as_ref().width0 } - pub fn height(&self) -> u16 { + pub fn height(&self) -> u32 { self.as_ref().height0 } diff --git a/src/gallium/frontends/rusticl/mesa/pipe/screen.rs b/src/gallium/frontends/rusticl/mesa/pipe/screen.rs index 3527ba6ed69..ca8f94cb3d7 100644 --- a/src/gallium/frontends/rusticl/mesa/pipe/screen.rs +++ b/src/gallium/frontends/rusticl/mesa/pipe/screen.rs @@ -294,7 +294,7 @@ impl PipeScreen { pub fn resource_create_texture( &self, width: u32, - height: u16, + height: u32, depth: u16, array_size: u16, target: pipe_texture_target, @@ -324,7 +324,7 @@ impl PipeScreen { pub fn resource_create_texture_from_user( &self, width: u32, - height: u16, + height: u32, depth: u16, array_size: u16, target: pipe_texture_target, @@ -357,7 +357,7 @@ impl PipeScreen { format: pipe_format, stride: u32, width: u32, - height: u16, + height: u32, depth: u16, array_size: u16, support_image: bool, diff --git a/src/gallium/include/pipe/p_state.h b/src/gallium/include/pipe/p_state.h index a36d9972122..a2f5495a285 100644 --- a/src/gallium/include/pipe/p_state.h +++ b/src/gallium/include/pipe/p_state.h @@ -473,6 +473,7 @@ struct pipe_sampler_state }; struct pipe_tex2d_from_buf { + /* Only 32K x 32K textures are supported. */ unsigned offset; /**< offset in pixels */ uint16_t row_stride; /**< size of the image row_stride in pixels */ uint16_t width; /**< width of image provided by application */ @@ -553,7 +554,7 @@ struct pipe_resource EXCLUSIVE_CACHELINE(struct pipe_reference reference); uint32_t width0; /**< Used by both buffers and textures. */ - uint16_t height0; /* Textures: The maximum height/depth/array_size is 16k. */ + uint32_t height0; /* textures >= 64K are possible */ uint16_t depth0; uint16_t array_size; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index c63681dbed4..d64c7ac4e4e 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -1070,8 +1070,8 @@ guess_and_alloc_texture(struct st_context *st, const struct gl_texture_image *firstImage; GLuint lastLevel, width, height, depth; GLuint bindings; - unsigned ptWidth; - uint16_t ptHeight, ptDepth, ptLayers; + unsigned ptWidth, ptHeight; + uint16_t ptDepth, ptLayers; enum pipe_format fmt; bool guessed_box = false; @@ -1239,8 +1239,8 @@ st_AllocTextureImageBuffer(struct gl_context *ctx, enum pipe_format format = st_mesa_format_to_pipe_format(st, texImage->TexFormat); GLuint bindings = default_bindings(st, format); - unsigned ptWidth; - uint16_t ptHeight, ptDepth, ptLayers; + unsigned ptWidth, ptHeight; + uint16_t ptDepth, ptLayers; st_gl_texture_dims_to_pipe_dims(stObj->Target, width, height, depth, @@ -3161,8 +3161,8 @@ st_finalize_texture(struct gl_context *ctx, GLuint face; const struct gl_texture_image *firstImage; enum pipe_format firstImageFormat; - unsigned ptWidth; - uint16_t ptHeight, ptDepth, ptLayers, ptNumSamples; + unsigned ptWidth, ptHeight; + uint16_t ptDepth, ptLayers, ptNumSamples; if (tObj->Immutable) return GL_TRUE; @@ -3210,8 +3210,8 @@ st_finalize_texture(struct gl_context *ctx, /* Find size of level=0 Gallium mipmap image, plus number of texture layers */ { - unsigned width; - uint16_t height, depth; + unsigned width, height; + uint16_t depth; st_gl_texture_dims_to_pipe_dims(tObj->Target, firstImage->Width2, @@ -3441,8 +3441,8 @@ st_texture_storage(struct gl_context *ctx, struct gl_texture_image *texImage = texObj->Image[0][0]; struct st_context *st = st_context(ctx); struct pipe_screen *screen = st->screen; - unsigned ptWidth, bindings; - uint16_t ptHeight, ptDepth, ptLayers; + unsigned ptWidth, ptHeight, bindings; + uint16_t ptDepth, ptLayers; enum pipe_format fmt; GLint level; GLuint num_samples = texImage->NumSamples; @@ -3697,8 +3697,8 @@ find_mipmap_level(const struct gl_texture_image *texImage, GLint texWidth = texImage->Width; GLint texHeight = texImage->Height; GLint texDepth = texImage->Depth; - unsigned level, w; - uint16_t h, d, layers; + unsigned level, w, h; + uint16_t d, layers; st_gl_texture_dims_to_pipe_dims(target, texWidth, texHeight, texDepth, &w, &h, &d, &layers); diff --git a/src/mesa/state_tracker/st_texture.c b/src/mesa/state_tracker/st_texture.c index 18f44e6e3da..5153b25226f 100644 --- a/src/mesa/state_tracker/st_texture.c +++ b/src/mesa/state_tracker/st_texture.c @@ -120,10 +120,10 @@ st_texture_create(struct st_context *st, void st_gl_texture_dims_to_pipe_dims(GLenum texture, unsigned widthIn, - uint16_t heightIn, + unsigned heightIn, uint16_t depthIn, unsigned *widthOut, - uint16_t *heightOut, + unsigned *heightOut, uint16_t *depthOut, uint16_t *layersOut) { @@ -209,8 +209,8 @@ st_texture_match_image(struct st_context *st, const struct pipe_resource *pt, const struct gl_texture_image *image) { - unsigned ptWidth; - uint16_t ptHeight, ptDepth, ptLayers; + unsigned ptWidth, ptHeight; + uint16_t ptDepth, ptLayers; /* Images with borders are never pulled into mipmap textures. */ diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h index 8c475db945d..996ed8d12a4 100644 --- a/src/mesa/state_tracker/st_texture.h +++ b/src/mesa/state_tracker/st_texture.h @@ -148,10 +148,10 @@ st_texture_create(struct st_context *st, extern void st_gl_texture_dims_to_pipe_dims(GLenum texture, unsigned widthIn, - uint16_t heightIn, + unsigned heightIn, uint16_t depthIn, unsigned *widthOut, - uint16_t *heightOut, + unsigned *heightOut, uint16_t *depthOut, uint16_t *layersOut);