mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-23 19:50:11 +01:00
zink: use PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND
this eliminates the bespoke handling I wrote to do the same thing a while ago cc: mesa-stable Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18135>
This commit is contained in:
parent
16ae4fb8b7
commit
a4830517c2
6 changed files with 5 additions and 63 deletions
|
|
@ -136,8 +136,6 @@ spec@arb_sample_shading@samplemask 4 all@noms mask_in_one,Fail
|
||||||
spec@arb_sample_shading@samplemask 4 all@noms partition,Fail
|
spec@arb_sample_shading@samplemask 4 all@noms partition,Fail
|
||||||
spec@arb_sample_shading@samplemask 4 all@sample mask_in_one,Fail
|
spec@arb_sample_shading@samplemask 4 all@sample mask_in_one,Fail
|
||||||
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgrad,Fail
|
spec@arb_shader_texture_lod@execution@arb_shader_texture_lod-texgrad,Fail
|
||||||
spec@arb_texture_float@fbo-blending-formats,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_RGB32F,Fail
|
|
||||||
|
|
||||||
spec@egl 1.4@eglterminate then unbind context,Fail
|
spec@egl 1.4@eglterminate then unbind context,Fail
|
||||||
spec@egl_khr_gl_image@egl_khr_gl_renderbuffer_image-clear-shared-image gl_depth_component24,Fail
|
spec@egl_khr_gl_image@egl_khr_gl_renderbuffer_image-clear-shared-image gl_depth_component24,Fail
|
||||||
|
|
@ -160,10 +158,6 @@ spec@ext_framebuffer_multisample@interpolation 4 centroid-disabled,Fail
|
||||||
spec@ext_framebuffer_multisample@interpolation 4 centroid-edges,Fail
|
spec@ext_framebuffer_multisample@interpolation 4 centroid-edges,Fail
|
||||||
spec@ext_framebuffer_multisample@interpolation 4 non-centroid-deriv-disabled,Fail
|
spec@ext_framebuffer_multisample@interpolation 4 non-centroid-deriv-disabled,Fail
|
||||||
spec@ext_framebuffer_multisample@interpolation 4 non-centroid-disabled,Fail
|
spec@ext_framebuffer_multisample@interpolation 4 non-centroid-disabled,Fail
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_LUMINANCE12,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_LUMINANCE16,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB10,Fail
|
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-intel_external_sampler_only,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-intel_external_sampler_only,Fail
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_attributes,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_attributes,Fail
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_hints,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-invalid_hints,Fail
|
||||||
|
|
|
||||||
|
|
@ -239,12 +239,6 @@ spec@arb_shader_texture_lod@execution@glsl-fs-shadow2dgradarb-cumulative,Fail
|
||||||
spec@arb_shading_language_packing@execution@built-in-functions@fs-packhalf2x16,Fail
|
spec@arb_shading_language_packing@execution@built-in-functions@fs-packhalf2x16,Fail
|
||||||
spec@arb_shading_language_packing@execution@built-in-functions@vs-packhalf2x16,Fail
|
spec@arb_shading_language_packing@execution@built-in-functions@vs-packhalf2x16,Fail
|
||||||
spec@arb_tessellation_shader@arb_tessellation_shader-tes-gs-max-output -small -scan 1 50,Crash
|
spec@arb_tessellation_shader@arb_tessellation_shader-tes-gs-max-output -small -scan 1 50,Crash
|
||||||
spec@arb_texture_float@fbo-blending-formats,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_INTENSITY16F_ARB,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_INTENSITY32F_ARB,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_LUMINANCE16F_ARB,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_LUMINANCE32F_ARB,Fail
|
|
||||||
spec@arb_texture_float@fbo-blending-formats@GL_RGB32F,Fail
|
|
||||||
spec@arb_texture_float@multisample-formats 2 gl_arb_texture_float,Fail
|
spec@arb_texture_float@multisample-formats 2 gl_arb_texture_float,Fail
|
||||||
spec@arb_texture_float@multisample-formats 4 gl_arb_texture_float,Fail
|
spec@arb_texture_float@multisample-formats 4 gl_arb_texture_float,Fail
|
||||||
spec@arb_texture_float@multisample-formats 6 gl_arb_texture_float,Fail
|
spec@arb_texture_float@multisample-formats 6 gl_arb_texture_float,Fail
|
||||||
|
|
@ -297,15 +291,6 @@ spec@ext_framebuffer_multisample@sample-alpha-to-one 2,Fail
|
||||||
spec@ext_framebuffer_multisample@sample-alpha-to-one 4,Fail
|
spec@ext_framebuffer_multisample@sample-alpha-to-one 4,Fail
|
||||||
spec@ext_framebuffer_multisample@sample-alpha-to-one 6,Fail
|
spec@ext_framebuffer_multisample@sample-alpha-to-one 6,Fail
|
||||||
spec@ext_framebuffer_multisample@sample-alpha-to-one 8,Fail
|
spec@ext_framebuffer_multisample@sample-alpha-to-one 8,Fail
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_INTENSITY12,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_INTENSITY16,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_INTENSITY4,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_INTENSITY8,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_INTENSITY,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_LUMINANCE12,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_LUMINANCE16,Fail
|
|
||||||
spec@ext_framebuffer_object@fbo-blending-formats@GL_RGB10,Fail
|
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-export,Fail
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_nv12,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_nv12,Fail
|
||||||
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p010,Fail
|
spec@ext_image_dma_buf_import@ext_image_dma_buf_import-sample_p010,Fail
|
||||||
|
|
@ -325,13 +310,6 @@ spec@ext_texture_array@glsl-fs-shadow2darray-03,Fail
|
||||||
spec@ext_texture_array@glsl-fs-shadow2darray-07,Fail
|
spec@ext_texture_array@glsl-fs-shadow2darray-07,Fail
|
||||||
spec@ext_texture_array@glsl-fs-shadow2darray-08,Fail
|
spec@ext_texture_array@glsl-fs-shadow2darray-08,Fail
|
||||||
spec@ext_texture_array@glsl-fs-shadow2darray,Fail
|
spec@ext_texture_array@glsl-fs-shadow2darray,Fail
|
||||||
spec@ext_texture_snorm@fbo-blending-formats,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_INTENSITY16_SNORM,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_INTENSITY8_SNORM,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_INTENSITY_SNORM,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_LUMINANCE16_SNORM,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_LUMINANCE8_SNORM,Fail
|
|
||||||
spec@ext_texture_snorm@fbo-blending-formats@GL_LUMINANCE_SNORM,Fail
|
|
||||||
spec@ext_texture_swizzle@depth_texture_mode_and_swizzle,Fail
|
spec@ext_texture_swizzle@depth_texture_mode_and_swizzle,Fail
|
||||||
spec@glsl-1.10@execution@glsl-fs-inline-explosion,Crash
|
spec@glsl-1.10@execution@glsl-fs-inline-explosion,Crash
|
||||||
spec@glsl-1.10@execution@glsl-vs-inline-explosion,Crash
|
spec@glsl-1.10@execution@glsl-vs-inline-explosion,Crash
|
||||||
|
|
|
||||||
|
|
@ -2883,8 +2883,6 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
|
||||||
|
|
||||||
util_copy_framebuffer_state(&ctx->fb_state, state);
|
util_copy_framebuffer_state(&ctx->fb_state, state);
|
||||||
zink_update_fbfetch(ctx);
|
zink_update_fbfetch(ctx);
|
||||||
unsigned prev_void_alpha_attachments = ctx->gfx_pipeline_state.void_alpha_attachments;
|
|
||||||
ctx->gfx_pipeline_state.void_alpha_attachments = 0;
|
|
||||||
ctx->transient_attachments = 0;
|
ctx->transient_attachments = 0;
|
||||||
ctx->fb_layer_mismatch = 0;
|
ctx->fb_layer_mismatch = 0;
|
||||||
|
|
||||||
|
|
@ -2926,14 +2924,11 @@ zink_set_framebuffer_state(struct pipe_context *pctx,
|
||||||
}
|
}
|
||||||
res->fb_binds++;
|
res->fb_binds++;
|
||||||
if (util_format_has_alpha1(psurf->format)) {
|
if (util_format_has_alpha1(psurf->format)) {
|
||||||
ctx->gfx_pipeline_state.void_alpha_attachments |= BITFIELD_BIT(i);
|
|
||||||
if (!res->valid)
|
if (!res->valid)
|
||||||
ctx->void_clears |= (PIPE_CLEAR_COLOR0 << i);
|
ctx->void_clears |= (PIPE_CLEAR_COLOR0 << i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (ctx->gfx_pipeline_state.void_alpha_attachments != prev_void_alpha_attachments)
|
|
||||||
ctx->gfx_pipeline_state.dirty = true;
|
|
||||||
unsigned depth_bias_scale_factor = ctx->depth_bias_scale_factor;
|
unsigned depth_bias_scale_factor = ctx->depth_bias_scale_factor;
|
||||||
if (ctx->fb_state.zsbuf) {
|
if (ctx->fb_state.zsbuf) {
|
||||||
struct pipe_surface *psurf = ctx->fb_state.zsbuf;
|
struct pipe_surface *psurf = ctx->fb_state.zsbuf;
|
||||||
|
|
|
||||||
|
|
@ -104,7 +104,6 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
VkPipelineColorBlendAttachmentState blend_att[PIPE_MAX_COLOR_BUFS];
|
|
||||||
VkPipelineColorBlendStateCreateInfo blend_state = {0};
|
VkPipelineColorBlendStateCreateInfo blend_state = {0};
|
||||||
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
|
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
|
||||||
if (state->blend_state) {
|
if (state->blend_state) {
|
||||||
|
|
@ -113,17 +112,6 @@ zink_create_gfx_pipeline(struct zink_screen *screen,
|
||||||
state->rendering_info.colorAttachmentCount;
|
state->rendering_info.colorAttachmentCount;
|
||||||
if (state->render_pass && state->render_pass->state.have_zsbuf)
|
if (state->render_pass && state->render_pass->state.have_zsbuf)
|
||||||
num_attachments--;
|
num_attachments--;
|
||||||
if (state->void_alpha_attachments) {
|
|
||||||
for (unsigned i = 0; i < num_attachments; i++) {
|
|
||||||
blend_att[i] = state->blend_state->attachments[i];
|
|
||||||
if (state->void_alpha_attachments & BITFIELD_BIT(i)) {
|
|
||||||
blend_att[i].dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
|
|
||||||
blend_att[i].srcColorBlendFactor = clamp_void_blend_factor(blend_att[i].srcColorBlendFactor);
|
|
||||||
blend_att[i].dstColorBlendFactor = clamp_void_blend_factor(blend_att[i].dstColorBlendFactor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
blend_state.pAttachments = blend_att;
|
|
||||||
} else
|
|
||||||
blend_state.pAttachments = state->blend_state->attachments;
|
blend_state.pAttachments = state->blend_state->attachments;
|
||||||
blend_state.attachmentCount = num_attachments;
|
blend_state.attachmentCount = num_attachments;
|
||||||
blend_state.logicOpEnable = state->blend_state->logicop_enable;
|
blend_state.logicOpEnable = state->blend_state->logicop_enable;
|
||||||
|
|
@ -436,22 +424,10 @@ zink_create_gfx_pipeline_output(struct zink_screen *screen, struct zink_gfx_pipe
|
||||||
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
|
VK_GRAPHICS_PIPELINE_LIBRARY_FRAGMENT_OUTPUT_INTERFACE_BIT_EXT,
|
||||||
};
|
};
|
||||||
|
|
||||||
VkPipelineColorBlendAttachmentState blend_att[PIPE_MAX_COLOR_BUFS];
|
|
||||||
VkPipelineColorBlendStateCreateInfo blend_state = {0};
|
VkPipelineColorBlendStateCreateInfo blend_state = {0};
|
||||||
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
|
blend_state.sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO;
|
||||||
if (state->blend_state) {
|
if (state->blend_state) {
|
||||||
unsigned num_attachments = state->rendering_info.colorAttachmentCount;
|
unsigned num_attachments = state->rendering_info.colorAttachmentCount;
|
||||||
if (state->void_alpha_attachments) {
|
|
||||||
for (unsigned i = 0; i < num_attachments; i++) {
|
|
||||||
blend_att[i] = state->blend_state->attachments[i];
|
|
||||||
if (state->void_alpha_attachments & BITFIELD_BIT(i)) {
|
|
||||||
blend_att[i].dstAlphaBlendFactor = VK_BLEND_FACTOR_ZERO;
|
|
||||||
blend_att[i].srcColorBlendFactor = clamp_void_blend_factor(blend_att[i].srcColorBlendFactor);
|
|
||||||
blend_att[i].dstColorBlendFactor = clamp_void_blend_factor(blend_att[i].dstColorBlendFactor);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
blend_state.pAttachments = blend_att;
|
|
||||||
} else
|
|
||||||
blend_state.pAttachments = state->blend_state->attachments;
|
blend_state.pAttachments = state->blend_state->attachments;
|
||||||
blend_state.attachmentCount = num_attachments;
|
blend_state.attachmentCount = num_attachments;
|
||||||
blend_state.logicOpEnable = state->blend_state->logicop_enable;
|
blend_state.logicOpEnable = state->blend_state->logicop_enable;
|
||||||
|
|
|
||||||
|
|
@ -436,6 +436,7 @@ zink_get_param(struct pipe_screen *pscreen, enum pipe_cap param)
|
||||||
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
case PIPE_CAP_SEAMLESS_CUBE_MAP_PER_TEXTURE:
|
||||||
case PIPE_CAP_LOAD_CONSTBUF:
|
case PIPE_CAP_LOAD_CONSTBUF:
|
||||||
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
|
case PIPE_CAP_MULTISAMPLE_Z_RESOLVE:
|
||||||
|
case PIPE_CAP_RGB_OVERRIDE_DST_ALPHA_BLEND:
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
case PIPE_CAP_DRAW_VERTEX_STATE:
|
case PIPE_CAP_DRAW_VERTEX_STATE:
|
||||||
|
|
|
||||||
|
|
@ -629,8 +629,7 @@ struct zink_gfx_pipeline_state {
|
||||||
uint32_t _pad1 : 6;
|
uint32_t _pad1 : 6;
|
||||||
uint32_t force_persample_interp:1; //duplicated for gpl hashing
|
uint32_t force_persample_interp:1; //duplicated for gpl hashing
|
||||||
/* order matches zink_gfx_output_key: uint16_t offset */
|
/* order matches zink_gfx_output_key: uint16_t offset */
|
||||||
uint32_t rast_samples:8; //2 extra bits
|
uint32_t rast_samples:16; //10 extra bits
|
||||||
uint32_t void_alpha_attachments:PIPE_MAX_COLOR_BUFS;
|
|
||||||
VkSampleMask sample_mask;
|
VkSampleMask sample_mask;
|
||||||
unsigned rp_state;
|
unsigned rp_state;
|
||||||
uint32_t blend_id;
|
uint32_t blend_id;
|
||||||
|
|
@ -769,8 +768,7 @@ struct zink_gfx_input_key {
|
||||||
struct zink_gfx_output_key {
|
struct zink_gfx_output_key {
|
||||||
uint32_t _pad:15;
|
uint32_t _pad:15;
|
||||||
uint32_t force_persample_interp:1;
|
uint32_t force_persample_interp:1;
|
||||||
uint32_t rast_samples:8;
|
uint32_t rast_samples:16;
|
||||||
uint32_t void_alpha_attachments:PIPE_MAX_COLOR_BUFS;
|
|
||||||
VkSampleMask sample_mask;
|
VkSampleMask sample_mask;
|
||||||
|
|
||||||
unsigned rp_state;
|
unsigned rp_state;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue