radv: remove useless checks around radv_CmdBindPipeline()
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com> Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
@@ -409,10 +409,8 @@ meta_emit_blit(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
unreachable(!"bad VkImageType");
|
unreachable(!"bad VkImageType");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
radv_meta_push_descriptor_set(cmd_buffer, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
device->meta_state.blit.pipeline_layout,
|
device->meta_state.blit.pipeline_layout,
|
||||||
|
@@ -186,10 +186,8 @@ bind_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
VkPipeline pipeline =
|
VkPipeline pipeline =
|
||||||
cmd_buffer->device->meta_state.blit2d.pipelines[src_type][fs_key];
|
cmd_buffer->device->meta_state.blit2d.pipelines[src_type][fs_key];
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -199,10 +197,8 @@ bind_depth_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
VkPipeline pipeline =
|
VkPipeline pipeline =
|
||||||
cmd_buffer->device->meta_state.blit2d.depth_only_pipeline[src_type];
|
cmd_buffer->device->meta_state.blit2d.depth_only_pipeline[src_type];
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -212,10 +208,8 @@ bind_stencil_pipeline(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
VkPipeline pipeline =
|
VkPipeline pipeline =
|
||||||
cmd_buffer->device->meta_state.blit2d.stencil_only_pipeline[src_type];
|
cmd_buffer->device->meta_state.blit2d.stencil_only_pipeline[src_type];
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
||||||
VK_PIPELINE_BIND_POINT_GRAPHICS, pipeline);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@@ -865,18 +865,6 @@ itob_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
itob_bind_pipeline(struct radv_cmd_buffer *cmd_buffer)
|
|
||||||
{
|
|
||||||
VkPipeline pipeline =
|
|
||||||
cmd_buffer->device->meta_state.itob.pipeline;
|
|
||||||
|
|
||||||
if (cmd_buffer->state.compute_pipeline != radv_pipeline_from_handle(pipeline)) {
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
|
radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
|
||||||
struct radv_meta_blit2d_surf *src,
|
struct radv_meta_blit2d_surf *src,
|
||||||
@@ -884,6 +872,7 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
unsigned num_rects,
|
unsigned num_rects,
|
||||||
struct radv_meta_blit2d_rect *rects)
|
struct radv_meta_blit2d_rect *rects)
|
||||||
{
|
{
|
||||||
|
VkPipeline pipeline = cmd_buffer->device->meta_state.itob.pipeline;
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
struct itob_temps temps;
|
struct itob_temps temps;
|
||||||
|
|
||||||
@@ -891,7 +880,9 @@ radv_meta_image_to_buffer(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &temps.dst_bview);
|
create_bview(cmd_buffer, dst->buffer, dst->offset, dst->format, &temps.dst_bview);
|
||||||
itob_bind_descriptors(cmd_buffer, &temps);
|
itob_bind_descriptors(cmd_buffer, &temps);
|
||||||
|
|
||||||
itob_bind_pipeline(cmd_buffer);
|
|
||||||
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||||
|
|
||||||
for (unsigned r = 0; r < num_rects; ++r) {
|
for (unsigned r = 0; r < num_rects; ++r) {
|
||||||
unsigned push_constants[3] = {
|
unsigned push_constants[3] = {
|
||||||
@@ -950,18 +941,6 @@ btoi_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
btoi_bind_pipeline(struct radv_cmd_buffer *cmd_buffer)
|
|
||||||
{
|
|
||||||
VkPipeline pipeline =
|
|
||||||
cmd_buffer->device->meta_state.btoi.pipeline;
|
|
||||||
|
|
||||||
if (cmd_buffer->state.compute_pipeline != radv_pipeline_from_handle(pipeline)) {
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
struct radv_meta_blit2d_buffer *src,
|
struct radv_meta_blit2d_buffer *src,
|
||||||
@@ -969,6 +948,7 @@ radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
unsigned num_rects,
|
unsigned num_rects,
|
||||||
struct radv_meta_blit2d_rect *rects)
|
struct radv_meta_blit2d_rect *rects)
|
||||||
{
|
{
|
||||||
|
VkPipeline pipeline = cmd_buffer->device->meta_state.btoi.pipeline;
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
struct btoi_temps temps;
|
struct btoi_temps temps;
|
||||||
|
|
||||||
@@ -976,7 +956,8 @@ radv_meta_buffer_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
create_iview(cmd_buffer, dst, &temps.dst_iview);
|
create_iview(cmd_buffer, dst, &temps.dst_iview);
|
||||||
btoi_bind_descriptors(cmd_buffer, &temps);
|
btoi_bind_descriptors(cmd_buffer, &temps);
|
||||||
|
|
||||||
btoi_bind_pipeline(cmd_buffer);
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||||
|
|
||||||
for (unsigned r = 0; r < num_rects; ++r) {
|
for (unsigned r = 0; r < num_rects; ++r) {
|
||||||
unsigned push_constants[3] = {
|
unsigned push_constants[3] = {
|
||||||
@@ -1041,18 +1022,6 @@ itoi_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
itoi_bind_pipeline(struct radv_cmd_buffer *cmd_buffer)
|
|
||||||
{
|
|
||||||
VkPipeline pipeline =
|
|
||||||
cmd_buffer->device->meta_state.itoi.pipeline;
|
|
||||||
|
|
||||||
if (cmd_buffer->state.compute_pipeline != radv_pipeline_from_handle(pipeline)) {
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
struct radv_meta_blit2d_surf *src,
|
struct radv_meta_blit2d_surf *src,
|
||||||
@@ -1060,6 +1029,7 @@ radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
unsigned num_rects,
|
unsigned num_rects,
|
||||||
struct radv_meta_blit2d_rect *rects)
|
struct radv_meta_blit2d_rect *rects)
|
||||||
{
|
{
|
||||||
|
VkPipeline pipeline = cmd_buffer->device->meta_state.itoi.pipeline;
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
struct itoi_temps temps;
|
struct itoi_temps temps;
|
||||||
|
|
||||||
@@ -1068,7 +1038,8 @@ radv_meta_image_to_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
|
|
||||||
itoi_bind_descriptors(cmd_buffer, &temps);
|
itoi_bind_descriptors(cmd_buffer, &temps);
|
||||||
|
|
||||||
itoi_bind_pipeline(cmd_buffer);
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||||
|
|
||||||
for (unsigned r = 0; r < num_rects; ++r) {
|
for (unsigned r = 0; r < num_rects; ++r) {
|
||||||
unsigned push_constants[4] = {
|
unsigned push_constants[4] = {
|
||||||
@@ -1115,30 +1086,20 @@ cleari_bind_descriptors(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
|
||||||
cleari_bind_pipeline(struct radv_cmd_buffer *cmd_buffer)
|
|
||||||
{
|
|
||||||
VkPipeline pipeline =
|
|
||||||
cmd_buffer->device->meta_state.cleari.pipeline;
|
|
||||||
|
|
||||||
if (cmd_buffer->state.compute_pipeline != radv_pipeline_from_handle(pipeline)) {
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void
|
void
|
||||||
radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
radv_meta_clear_image_cs(struct radv_cmd_buffer *cmd_buffer,
|
||||||
struct radv_meta_blit2d_surf *dst,
|
struct radv_meta_blit2d_surf *dst,
|
||||||
const VkClearColorValue *clear_color)
|
const VkClearColorValue *clear_color)
|
||||||
{
|
{
|
||||||
|
VkPipeline pipeline = cmd_buffer->device->meta_state.cleari.pipeline;
|
||||||
struct radv_device *device = cmd_buffer->device;
|
struct radv_device *device = cmd_buffer->device;
|
||||||
struct radv_image_view dst_iview;
|
struct radv_image_view dst_iview;
|
||||||
|
|
||||||
create_iview(cmd_buffer, dst, &dst_iview);
|
create_iview(cmd_buffer, dst, &dst_iview);
|
||||||
cleari_bind_descriptors(cmd_buffer, &dst_iview);
|
cleari_bind_descriptors(cmd_buffer, &dst_iview);
|
||||||
|
|
||||||
cleari_bind_pipeline(cmd_buffer);
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||||
|
|
||||||
unsigned push_constants[4] = {
|
unsigned push_constants[4] = {
|
||||||
clear_color->uint32[0],
|
clear_color->uint32[0],
|
||||||
|
@@ -374,10 +374,8 @@ emit_color_clear(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
|
|
||||||
radv_cmd_buffer_set_subpass(cmd_buffer, &clear_subpass, false);
|
radv_cmd_buffer_set_subpass(cmd_buffer, &clear_subpass, false);
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
pipeline);
|
||||||
pipeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
||||||
.x = clear_rect->rect.offset.x,
|
.x = clear_rect->rect.offset.x,
|
||||||
@@ -644,10 +642,8 @@ emit_depthstencil_clear(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
clear_rect,
|
clear_rect,
|
||||||
clear_value);
|
clear_value);
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
pipeline);
|
||||||
pipeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (depth_view_can_fast_clear(cmd_buffer, iview, aspects,
|
if (depth_view_can_fast_clear(cmd_buffer, iview, aspects,
|
||||||
subpass->depth_stencil_attachment.layout,
|
subpass->depth_stencil_attachment.layout,
|
||||||
|
@@ -269,12 +269,8 @@ emit_depth_decomp(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
{
|
{
|
||||||
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
|
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
|
||||||
|
|
||||||
RADV_FROM_HANDLE(radv_pipeline, pipeline, pipeline_h);
|
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
|
pipeline_h);
|
||||||
if (cmd_buffer->state.pipeline != pipeline) {
|
|
||||||
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
|
||||||
pipeline_h);
|
|
||||||
}
|
|
||||||
|
|
||||||
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
|
@@ -292,10 +292,8 @@ emit_fast_clear_flush(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
{
|
{
|
||||||
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
|
VkCommandBuffer cmd_buffer_h = radv_cmd_buffer_to_handle(cmd_buffer);
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != radv_pipeline_from_handle(pipeline)) {
|
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
pipeline);
|
||||||
pipeline);
|
|
||||||
}
|
|
||||||
|
|
||||||
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
||||||
.x = 0,
|
.x = 0,
|
||||||
|
@@ -268,13 +268,8 @@ emit_resolve(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
|
|
||||||
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB;
|
cmd_buffer->state.flush_bits |= RADV_CMD_FLAG_FLUSH_AND_INV_CB;
|
||||||
|
|
||||||
VkPipeline pipeline_h = device->meta_state.resolve.pipeline;
|
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
||||||
RADV_FROM_HANDLE(radv_pipeline, pipeline, pipeline_h);
|
device->meta_state.resolve.pipeline);
|
||||||
|
|
||||||
if (cmd_buffer->state.pipeline != pipeline) {
|
|
||||||
radv_CmdBindPipeline(cmd_buffer_h, VK_PIPELINE_BIND_POINT_GRAPHICS,
|
|
||||||
pipeline_h);
|
|
||||||
}
|
|
||||||
|
|
||||||
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
|
||||||
.x = dest_offset->x,
|
.x = dest_offset->x,
|
||||||
|
@@ -351,10 +351,9 @@ emit_resolve(struct radv_cmd_buffer *cmd_buffer,
|
|||||||
pipeline = device->meta_state.resolve_compute.rc[samples_log2].srgb_pipeline;
|
pipeline = device->meta_state.resolve_compute.rc[samples_log2].srgb_pipeline;
|
||||||
else
|
else
|
||||||
pipeline = device->meta_state.resolve_compute.rc[samples_log2].pipeline;
|
pipeline = device->meta_state.resolve_compute.rc[samples_log2].pipeline;
|
||||||
if (cmd_buffer->state.compute_pipeline != radv_pipeline_from_handle(pipeline)) {
|
|
||||||
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
radv_CmdBindPipeline(radv_cmd_buffer_to_handle(cmd_buffer),
|
||||||
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
VK_PIPELINE_BIND_POINT_COMPUTE, pipeline);
|
||||||
}
|
|
||||||
|
|
||||||
unsigned push_constants[4] = {
|
unsigned push_constants[4] = {
|
||||||
src_offset->x,
|
src_offset->x,
|
||||||
|
Reference in New Issue
Block a user