summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2017-01-31 10:37:25 +1000
committerDave Airlie <[email protected]>2017-01-31 11:13:15 +1000
commit3882f3da22a1b12d39ed7f7c20a7009fb1b8d134 (patch)
tree740199aef34ff6b2c890a27a475b207d30bbbe9e /src/amd/vulkan/radv_device.c
parent723941bb3d8db853f48bc31df10bae3889419cb7 (diff)
radv/geom: check if esgs and gsvs ring exists before filling geom rings
There are some corner cases where you end up with an esgs ring, but no gsvs ring, test for both before dereferencing. Fixes: dEQP-VK.geometry.emit.points_emit_0_end_0 Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r--src/amd/vulkan/radv_device.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 2014ce23b8c..da67b65ef43 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1058,11 +1058,14 @@ fill_geom_rings(struct radv_queue *queue,
uint32_t gsvs_ring_size,
struct radeon_winsys_bo *gsvs_ring_bo)
{
- uint64_t esgs_va, gsvs_va;
- esgs_va = queue->device->ws->buffer_get_va(esgs_ring_bo);
- gsvs_va = queue->device->ws->buffer_get_va(gsvs_ring_bo);
+ uint64_t esgs_va = 0, gsvs_va = 0;
uint32_t *desc = &map[4];
+ if (esgs_ring_bo)
+ esgs_va = queue->device->ws->buffer_get_va(esgs_ring_bo);
+ if (gsvs_ring_bo)
+ gsvs_va = queue->device->ws->buffer_get_va(gsvs_ring_bo);
+
/* stride 0, num records - size, add tid, swizzle, elsize4,
index stride 64 */
desc[0] = esgs_va;