mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 05:18:08 +02:00
svga: Don't crash if only one of Depth or Stencil buffer is present
This piglit test arb_clear_texture-depth was crashing because we assume we always have stencil and depth buffer. Signed-off-by: Ian Forbes <ian.forbes@broadcom.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38836>
This commit is contained in:
parent
d2f336c108
commit
d75f5e0add
2 changed files with 9 additions and 10 deletions
|
|
@ -150,7 +150,7 @@ spec@!opengl es 3.0@gles-3.0-transform-feedback-uniform-buffer-object,Fail
|
|||
spec@arb_arrays_of_arrays@execution@atomic_counters@fs-indirect-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@atomic_counters@vs-indirect-index,Fail
|
||||
spec@arb_arrays_of_arrays@execution@sampler@fs-nested-struct-arrays-nonconst-nested-array,Fail
|
||||
spec@arb_clear_texture@arb_clear_texture-depth,Crash
|
||||
spec@arb_clear_texture@arb_clear_texture-depth,Fail
|
||||
spec@arb_clear_texture@arb_clear_texture-depth-stencil,Fail
|
||||
spec@arb_clear_texture@arb_clear_texture-stencil,Fail
|
||||
spec@arb_clip_control@arb_clip_control-clip-control,Fail
|
||||
|
|
|
|||
|
|
@ -289,24 +289,23 @@ svga_clear_texture(struct pipe_context *pipe,
|
|||
util_format_description(surface->format);
|
||||
|
||||
if (util_format_is_depth_or_stencil(surface->format)) {
|
||||
float depth;
|
||||
uint8_t stencil;
|
||||
float depth = 0.0f;
|
||||
uint8_t stencil = 0;
|
||||
unsigned clear_flags = 0;
|
||||
|
||||
/* If data is NULL, then set depthValue and stencilValue to zeros */
|
||||
if (data == NULL) {
|
||||
depth = 0.0;
|
||||
stencil = 0;
|
||||
} else {
|
||||
util_format_unpack_z_float(surface->format, &depth, data, 1);
|
||||
util_format_unpack_s_8uint(surface->format, &stencil, data, 1);
|
||||
}
|
||||
|
||||
if (util_format_has_depth(desc)) {
|
||||
clear_flags |= PIPE_CLEAR_DEPTH;
|
||||
if (data) {
|
||||
util_format_unpack_z_float(surface->format, &depth, data, 1);
|
||||
}
|
||||
}
|
||||
if (util_format_has_stencil(desc)) {
|
||||
clear_flags |= PIPE_CLEAR_STENCIL;
|
||||
if (data) {
|
||||
util_format_unpack_s_8uint(surface->format, &stencil, data, 1);
|
||||
}
|
||||
}
|
||||
|
||||
/* Setup depth stencil view */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue