summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_meta_decompress.c
diff options
context:
space:
mode:
authorBas Nieuwenhuizen <[email protected]>2017-03-01 00:39:58 +0100
committerBas Nieuwenhuizen <[email protected]>2017-03-30 22:21:14 +0200
commit4083a2ddcb02a6e79bcc21b3f5b20e10dcef73b1 (patch)
tree1dc608f5ed73ec0da75437c0531cb3f4d9c04592 /src/amd/vulkan/radv_meta_decompress.c
parent42f2bccd119d12a53b61556767b77d59d5a9780f (diff)
radv: Set proper viewport & scissor for meta draws.
Signed-off-by: Bas Nieuwenhuizen <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_meta_decompress.c')
-rw-r--r--src/amd/vulkan/radv_meta_decompress.c39
1 files changed, 30 insertions, 9 deletions
diff --git a/src/amd/vulkan/radv_meta_decompress.c b/src/amd/vulkan/radv_meta_decompress.c
index 2ee27d40970..854b88a3622 100644
--- a/src/amd/vulkan/radv_meta_decompress.c
+++ b/src/amd/vulkan/radv_meta_decompress.c
@@ -178,8 +178,8 @@ create_pipeline(struct radv_device *device,
},
.pViewportState = &(VkPipelineViewportStateCreateInfo) {
.sType = VK_STRUCTURE_TYPE_PIPELINE_VIEWPORT_STATE_CREATE_INFO,
- .viewportCount = 0,
- .scissorCount = 0,
+ .viewportCount = 1,
+ .scissorCount = 1,
},
.pRasterizationState = &(VkPipelineRasterizationStateCreateInfo) {
.sType = VK_STRUCTURE_TYPE_PIPELINE_RASTERIZATION_STATE_CREATE_INFO,
@@ -210,7 +210,14 @@ create_pipeline(struct radv_device *device,
.depthBoundsTestEnable = false,
.stencilTestEnable = false,
},
- .pDynamicState = NULL,
+ .pDynamicState = &(VkPipelineDynamicStateCreateInfo) {
+ .sType = VK_STRUCTURE_TYPE_PIPELINE_DYNAMIC_STATE_CREATE_INFO,
+ .dynamicStateCount = 2,
+ .pDynamicStates = (VkDynamicState[]) {
+ VK_DYNAMIC_STATE_VIEWPORT,
+ VK_DYNAMIC_STATE_SCISSOR,
+ },
+ },
.renderPass = device->meta_state.depth_decomp.pass,
.subpass = 0,
};
@@ -317,20 +324,20 @@ emit_depth_decomp(struct radv_cmd_buffer *cmd_buffer,
const struct vertex_attrs vertex_data[3] = {
{
.position = {
- dest_offset->x,
- dest_offset->y,
+ -1.0,
+ -1.0,
},
},
{
.position = {
- dest_offset->x,
- dest_offset->y + depth_decomp_extent->height,
+ -1.0,
+ 1.0,
},
},
{
.position = {
- dest_offset->x + depth_decomp_extent->width,
- dest_offset->y,
+ 1.0,
+ -1.0,
},
},
};
@@ -358,6 +365,20 @@ emit_depth_decomp(struct radv_cmd_buffer *cmd_buffer,
pipeline_h);
}
+ radv_CmdSetViewport(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkViewport) {
+ .x = dest_offset->x,
+ .y = dest_offset->y,
+ .width = depth_decomp_extent->width,
+ .height = depth_decomp_extent->height,
+ .minDepth = 0.0f,
+ .maxDepth = 1.0f
+ });
+
+ radv_CmdSetScissor(radv_cmd_buffer_to_handle(cmd_buffer), 0, 1, &(VkRect2D) {
+ .offset = *dest_offset,
+ .extent = *depth_decomp_extent,
+ });
+
radv_CmdDraw(cmd_buffer_h, 3, 1, 0, 0);
}