zink: fix null buffer/surface formats

4-component formats are needed here in order to return the correct
alpha value in invalid load scenarios

cc: mesa-stable

fixes:
spec@arb_shader_image_load_store@invalid

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16167>
This commit is contained in:
Mike Blumenkrantz 2022-04-26 11:07:23 -04:00 committed by Marge Bot
parent 7767b2f7b5
commit ae369e9f6d
3 changed files with 5 additions and 9 deletions

View File

@ -343,9 +343,6 @@ spec@arb_shader_image_load_store@early-z@occlusion query test/early-z pass,Fail
spec@arb_shader_image_load_store@execution@image-array-out-of-bounds-access-load,Crash spec@arb_shader_image_load_store@execution@image-array-out-of-bounds-access-load,Crash
spec@arb_shader_image_load_store@execution@image-array-out-of-bounds-access-store,Crash spec@arb_shader_image_load_store@execution@image-array-out-of-bounds-access-store,Crash
spec@arb_shader_image_load_store@invalid,Fail
spec@arb_shader_image_load_store@invalid@imageLoad/incompatible format test/imageBuffer,Fail
spec@arb_tessellation_shader@execution@tcs-tes-levels-out-of-bounds-read,Crash spec@arb_tessellation_shader@execution@tcs-tes-levels-out-of-bounds-read,Crash
spec@arb_tessellation_shader@execution@tcs-tes-levels-out-of-bounds-write,Crash spec@arb_tessellation_shader@execution@tcs-tes-levels-out-of-bounds-write,Crash
@ -354,7 +351,6 @@ spec@khr_texture_compression_astc@array-gles@12x12 Block Dim,Fail
spec@khr_texture_compression_astc@array-gles@5x5 Block Dim,Fail spec@khr_texture_compression_astc@array-gles@5x5 Block Dim,Fail
spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3,Fail spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3,Fail
spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3@oes_egl_image_external_essl3_imageLoad,Fail spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3@oes_egl_image_external_essl3_imageLoad,Fail
spec@oes_egl_image_external_essl3@oes_egl_image_external_essl3@oes_egl_image_external_essl3_imageStore,Fail
#literally no driver can pass these #literally no driver can pass these

View File

@ -2034,7 +2034,7 @@ get_render_pass(struct zink_context *ctx)
state.msaa_expand_mask |= BITFIELD_BIT(i); state.msaa_expand_mask |= BITFIELD_BIT(i);
} }
} else { } else {
state.rts[i].format = VK_FORMAT_R8_UINT; state.rts[i].format = VK_FORMAT_R8G8B8A8_UNORM;
state.rts[i].samples = fb->samples; state.rts[i].samples = fb->samples;
} }
state.num_rts++; state.num_rts++;
@ -4321,7 +4321,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
if (!ctx->render_pass_cache) if (!ctx->render_pass_cache)
goto fail; goto fail;
const uint8_t data[] = {0}; const uint32_t data[] = {0};
ctx->dummy_vertex_buffer = pipe_buffer_create(&screen->base, ctx->dummy_vertex_buffer = pipe_buffer_create(&screen->base,
PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_SHADER_IMAGE, PIPE_USAGE_IMMUTABLE, sizeof(data)); PIPE_BIND_VERTEX_BUFFER | PIPE_BIND_SHADER_IMAGE, PIPE_USAGE_IMMUTABLE, sizeof(data));
if (!ctx->dummy_vertex_buffer) if (!ctx->dummy_vertex_buffer)
@ -4337,7 +4337,7 @@ zink_context_create(struct pipe_screen *pscreen, void *priv, unsigned flags)
if (!ctx->dummy_surface[i]) if (!ctx->dummy_surface[i])
goto fail; goto fail;
} }
VkBufferViewCreateInfo bvci = create_bvci(ctx, zink_resource(ctx->dummy_vertex_buffer), PIPE_FORMAT_R8_UNORM, 0, sizeof(data)); VkBufferViewCreateInfo bvci = create_bvci(ctx, zink_resource(ctx->dummy_vertex_buffer), PIPE_FORMAT_R8G8B8A8_UNORM, 0, sizeof(data));
ctx->dummy_bufferview = get_buffer_view(ctx, zink_resource(ctx->dummy_vertex_buffer), &bvci); ctx->dummy_bufferview = get_buffer_view(ctx, zink_resource(ctx->dummy_vertex_buffer), &bvci);
if (!ctx->dummy_bufferview) if (!ctx->dummy_bufferview)
goto fail; goto fail;

View File

@ -394,7 +394,7 @@ zink_surface_create_null(struct zink_context *ctx, enum pipe_texture_target targ
templ.width0 = width; templ.width0 = width;
templ.height0 = height; templ.height0 = height;
templ.depth0 = 1; templ.depth0 = 1;
templ.format = PIPE_FORMAT_R8_UINT; templ.format = PIPE_FORMAT_R8G8B8A8_UNORM;
templ.target = target; templ.target = target;
templ.bind = PIPE_BIND_RENDER_TARGET; templ.bind = PIPE_BIND_RENDER_TARGET;
templ.nr_samples = samples; templ.nr_samples = samples;
@ -403,7 +403,7 @@ zink_surface_create_null(struct zink_context *ctx, enum pipe_texture_target targ
if (!pres) if (!pres)
return NULL; return NULL;
surf_templ.format = PIPE_FORMAT_R8_UINT; surf_templ.format = PIPE_FORMAT_R8G8B8A8_UNORM;
surf_templ.nr_samples = 0; surf_templ.nr_samples = 0;
struct pipe_surface *psurf = ctx->base.create_surface(&ctx->base, pres, &surf_templ); struct pipe_surface *psurf = ctx->base.create_surface(&ctx->base, pres, &surf_templ);
pipe_resource_reference(&pres, NULL); pipe_resource_reference(&pres, NULL);