mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 17:30:12 +01:00
crocus: fix SIGSEGV crash at pbo compressed teximage
This affects piglit/bin/ext_texture_array-compressed teximage pbo -auto -fbo Routine create_surface() at src/gallium/drivers/crocus/crocus_state.c does not suppport compressed format and returns NULL in that case. Since MR https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34054 routine st_try_pbo_compressed_texsubimage() at src/mesa/state_tracker/st_cb_texture.c is missing a test via pipe->create_surface() and does not fallback to _mesa_store_compressed_texsubimage() which causes a SIGSEGV abort. Regression is solved by introducing the variable surface_no_compress at struct pipe_caps, causing the fallback. Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/13426 Signed-off-by: GKraats <vd.kraats@hccnet.nl> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37150>
This commit is contained in:
parent
ef55869dc8
commit
3b5b68dbfb
4 changed files with 7 additions and 0 deletions
|
|
@ -341,6 +341,8 @@ Capability about the features and limits of the driver/GPU.
|
|||
* ``pipe_caps.generate_mipmap``: Indicates whether pipe_context::generate_mipmap
|
||||
is supported.
|
||||
* ``pipe_caps.string_marker``: Whether pipe->emit_string_marker() is supported.
|
||||
* ``pipe_caps.surface_no_compress``: Indicates that
|
||||
pipe_context::create_surface does not support compression
|
||||
* ``pipe_caps.surface_reinterpret_blocks``: Indicates whether
|
||||
pipe_context::create_surface supports reinterpreting a texture as a surface
|
||||
of a format with different block width/height (but same block size in bits).
|
||||
|
|
|
|||
|
|
@ -281,6 +281,7 @@ crocus_init_screen_caps(struct crocus_screen *screen)
|
|||
caps->fs_position_is_sysval = true;
|
||||
caps->fs_face_is_integer_sysval = true;
|
||||
caps->invalidate_buffer = true;
|
||||
caps->surface_no_compress = true;
|
||||
caps->surface_reinterpret_blocks = true;
|
||||
caps->fence_signal = true;
|
||||
caps->demote_to_helper_invocation = true;
|
||||
|
|
|
|||
|
|
@ -926,6 +926,7 @@ struct pipe_caps {
|
|||
bool invalidate_buffer;
|
||||
bool generate_mipmap;
|
||||
bool string_marker;
|
||||
bool surface_no_compress;
|
||||
bool surface_reinterpret_blocks;
|
||||
bool compressed_surface_reinterpret_blocks_layered;
|
||||
bool query_buffer_object;
|
||||
|
|
|
|||
|
|
@ -2482,6 +2482,9 @@ st_CompressedTexSubImage(struct gl_context *ctx, GLuint dims,
|
|||
if (st_compressed_format_fallback(st, texImage->TexFormat))
|
||||
goto fallback;
|
||||
|
||||
if (screen->caps.surface_no_compress)
|
||||
goto fallback;
|
||||
|
||||
if (!dst) {
|
||||
goto fallback;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue