diff --git a/docs/gallium/screen.rst b/docs/gallium/screen.rst index e8c09647bc8..1c80e31e205 100644 --- a/docs/gallium/screen.rst +++ b/docs/gallium/screen.rst @@ -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). diff --git a/src/gallium/drivers/crocus/crocus_screen.c b/src/gallium/drivers/crocus/crocus_screen.c index 556c2034796..a4d26910448 100644 --- a/src/gallium/drivers/crocus/crocus_screen.c +++ b/src/gallium/drivers/crocus/crocus_screen.c @@ -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; diff --git a/src/gallium/include/pipe/p_defines.h b/src/gallium/include/pipe/p_defines.h index f5ab0a481d2..5f9065fc89c 100644 --- a/src/gallium/include/pipe/p_defines.h +++ b/src/gallium/include/pipe/p_defines.h @@ -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; diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c index 730bfb4fb1c..be1a124d90b 100644 --- a/src/mesa/state_tracker/st_cb_texture.c +++ b/src/mesa/state_tracker/st_cb_texture.c @@ -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; }