mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 15:38:09 +02:00
gallium: do not reset buffers for unsupported stages
There's no good reason why drivers that doesn't grok geometry, tesselation or compute shaders needs to deal with them. This fixes a crash on a lot of Piglit tests for Zink. Fixes:daaf5f1d18("gallium: Fix leak of currently bound UBOs at CSO context destruction.") Reviewed-by: Eric Anholt <eric@anholt.net> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7971> (cherry picked from commit3abac03d49)
This commit is contained in:
parent
de2bac90cc
commit
49f2b5f5e0
2 changed files with 19 additions and 1 deletions
|
|
@ -319,7 +319,7 @@
|
|||
"description": "gallium: do not reset buffers for unsupported stages",
|
||||
"nominated": true,
|
||||
"nomination_type": 1,
|
||||
"resolution": 0,
|
||||
"resolution": 1,
|
||||
"master_sha": null,
|
||||
"because_sha": "daaf5f1d1868bebec7931a51753236a850ebbd24"
|
||||
},
|
||||
|
|
|
|||
|
|
@ -376,6 +376,24 @@ void cso_destroy_context( struct cso_context *ctx )
|
|||
struct pipe_screen *scr = ctx->pipe->screen;
|
||||
enum pipe_shader_type sh;
|
||||
for (sh = 0; sh < PIPE_SHADER_TYPES; sh++) {
|
||||
switch (sh) {
|
||||
case PIPE_SHADER_GEOMETRY:
|
||||
if (!ctx->has_geometry_shader)
|
||||
continue;
|
||||
break;
|
||||
case PIPE_SHADER_TESS_CTRL:
|
||||
case PIPE_SHADER_TESS_EVAL:
|
||||
if (!ctx->has_tessellation)
|
||||
continue;
|
||||
break;
|
||||
case PIPE_SHADER_COMPUTE:
|
||||
if (!ctx->has_compute_shader)
|
||||
continue;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
int maxsam = scr->get_shader_param(scr, sh,
|
||||
PIPE_SHADER_CAP_MAX_TEXTURE_SAMPLERS);
|
||||
int maxview = scr->get_shader_param(scr, sh,
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue