Skip to content
Snippets Groups Projects
Commit 2e8e8f5a authored by Allan MacKinnon's avatar Allan MacKinnon Committed by CQ bot account: commit-bot@chromium.org
Browse files

[graphics][compute] Add Spinel libs to compute build.

Tracked by SPN-22 and SPN-19.

Blocks tests SPN-17, SPN-18.

Change-Id: I4bd95681b26b81e3521c518b4d0894730e5c23ce
parent b510ca67
No related branches found
No related tags found
No related merge requests found
Showing
with 232 additions and 37 deletions
......@@ -7,5 +7,6 @@ group("compute") {
"common",
"common/vk",
"hotsort",
"spinel/platforms/vk",
]
}
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("spinel") {
public = [
"spinel.h",
"spinel_types.h",
"spinel_result.h",
"spinel_assert.h",
]
friend = [
"platforms/vk"
]
sources = [
"allocator_host.c",
"allocator_host.h",
"composition.c",
"composition.h",
"context.c",
"context.h",
"core.h",
"core_c.h",
"handle.h",
"path_builder.c",
"path_builder.h",
"platforms",
"raster_builder.c",
"raster_builder.h",
"spinel.h",
"spinel_assert.c",
"spinel_assert.h",
"spinel_result.h",
"spinel_types.h",
"state_assert.h",
"styling.c",
"styling.h",
"suballocator.c",
"suballocator.h",
"weakref.c",
"weakref.h",
]
include_dirs = [
"//src/graphics/lib/compute",
]
deps = [
"//src/graphics/lib/compute/common",
]
}
# Copyright 2019 The Fuchsia Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
source_set("vk") {
public = [
"spinel_vk.h",
"spinel_vk_types.h",
]
sources = [
"allocator_device.c",
"allocator_device.h",
"block_pool.c",
"block_pool.h",
"cb_pool.c",
"cb_pool.h",
"composition_impl.c",
"composition_impl.h",
"device.c",
"device.h",
"expand_x.h",
"extent.c",
"extent.h",
"fence_pool.c",
"fence_pool.h",
"handle_pool.c",
"handle_pool.h",
"path_builder_impl.c",
"path_builder_impl.h",
"queue_pool.c",
"queue_pool.h",
"raster_builder_impl.c",
"raster_builder_impl.h",
"render_impl.c",
"render_impl.h",
"ring.c",
"ring.h",
"semaphore_pool.c",
"semaphore_pool.h",
"spinel_vk.h",
"spinel_vk_types.h",
"styling_impl.c",
"styling_impl.h",
"target.c",
"target_config.h",
"target_config_name.h",
"target_context_remove.h",
"target.h",
"target_layouts.h",
]
include_dirs = [
"//src/graphics/lib/compute",
"//src/graphics/lib/compute/spinel",
]
deps = [
"//src/graphics/lib/compute/spinel",
"//src/graphics/lib/compute/common",
"//src/graphics/lib/compute/common/vk",
"//third_party/vulkan_loader_and_validation_layers:vulkan",
]
}
......@@ -607,6 +607,8 @@ spn_ci_block_until_unsealed_and_reseal(struct spn_composition_impl * const impl)
//
//
#ifdef SPN_DISABLE_UNTIL_INTEGRATED
static
void
spn_ci_complete_p_3(void * pfn_payload)
......@@ -635,6 +637,8 @@ spn_ci_complete_p_3(void * pfn_payload)
impl->state = SPN_CI_STATE_SEALED;
}
#endif
//
//
//
......@@ -1187,6 +1191,8 @@ spn_ci_release(struct spn_composition_impl * const impl)
//
//
#ifdef SPN_DISABLE_UNTIL_INTEGRATED
static
void
spn_ci_retain_and_lock(struct spn_composition_impl * const impl)
......@@ -1205,6 +1211,8 @@ spn_composition_unlock_and_release(struct spn_composition_impl * const impl)
spn_ci_release(impl);
}
#endif
//
//
//
......
......@@ -225,7 +225,7 @@ spn_device_lost(struct spn_device * const device)
//
spn_result
spn_context_create_vk(struct spn_context * * const context_p,
spn_context_create_vk(spn_context_t * const context_p,
struct spn_device_vk * const device_vk,
struct spn_target_image const * const target_image,
uint64_t const block_pool_size,
......
......@@ -92,21 +92,10 @@ struct spn_device
//
//
// Creation and disposal intitializes context and may rely on other
// context resources like the scheduler
// Creation and disposal intitializes the context and may rely on
// other context resources like the scheduler
//
//
// this is exposed here temporarily
//
spn_result
spn_context_create_vk(struct spn_context * * const context_p,
struct spn_device_vk * const device_vk,
struct spn_target_image const * const target_image,
uint64_t const block_pool_size,
uint32_t const handle_count);
//
// Disable device because of a fatal error
//
......
......@@ -867,10 +867,6 @@ spn_device_handle_pool_release_d(struct spn_device * const device,
refcnt.d -= 1;
*refcnt_ptr = refcnt;
#if 0
printf("%8u = { %u, %u }\n",handle,refcnt.h,refcnt.d);
#endif
if (refcnt.hd == 0) {
spn_device_handle_pool_reclaim(device,handle_pool,reclaim_type,handle);
}
......
......@@ -6,11 +6,9 @@
//
//
#include <string.h>
#include "render_impl.h"
#include "spinel.h"
#include "spinel_types_vk.h"
#include "spinel_vk_types.h"
#include "device.h"
#include "target.h"
#include "block_pool.h"
......@@ -24,6 +22,12 @@
//
//
#include <string.h>
//
//
//
struct spn_render_submit_ext_base
{
void * ext;
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPN_ONCE_SPINEL_VK
#define SPN_ONCE_SPINEL_VK
#pragma once
//
//
......@@ -13,11 +12,24 @@
#include "spinel.h"
//
//
//
#ifdef __cplusplus
extern "C" {
#endif
//
// CONTEXT CREATION: VULKAN
//
// create the vulkan context
spn_result
spn_context_create_vk(spn_context_t * const context_p,
struct spn_device_vk * const device_vk,
struct spn_target_image const * const target_image,
uint64_t const block_pool_size,
uint32_t const handle_count);
//
// RENDER EXTENSION: VULKAN BUFFER
......@@ -40,6 +52,8 @@ struct spn_render_submit_ext_vk_buffer
//
//
#ifdef __cplusplus
}
#endif
//
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPN_ONCE_SPINEL_TYPES_VK
#define SPN_ONCE_SPINEL_TYPES_VK
#pragma once
//
//
......@@ -13,6 +12,8 @@
#include "spinel_types.h"
//
// VK RENDER EXTENSIONS
//
......@@ -52,4 +53,10 @@ struct spn_render_submit_ext_vk_image
//
//
#ifdef __cplusplus
}
#endif
//
//
//
......@@ -288,6 +288,8 @@ spn_si_release(struct spn_styling_impl * const impl)
//
//
#ifdef SPN_DISABLED_UNTIL_INTEGRATED
static
void
spn_si_retain_and_lock(struct spn_styling_impl * const impl)
......@@ -306,6 +308,8 @@ spn_styling_unlock_and_release(struct spn_styling_impl * const impl)
spn_si_release(impl);
}
#endif
//
//
//
......
......@@ -730,7 +730,7 @@ spn_target_create(struct spn_device_vk * const vk,
#define SPN_TARGET_PL_CREATE(_p_idx,_p_id,...) \
{ \
const uint32_t pps = target->config.p.push_sizes.array[_p_idx]; \
uint32_t const pps = target->config.p.push_sizes.array[_p_idx]; \
\
if (pps == 0) { \
plci.pushConstantRangeCount = 0; \
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPN_ONCE_SPINEL
#define SPN_ONCE_SPINEL
#pragma once
//
//
......@@ -12,6 +11,14 @@
#include "spinel_result.h"
#include "spinel_types.h"
//
//
//
#ifdef __cplusplus
extern "C" {
#endif
//
// CONTEXT
//
......@@ -222,7 +229,7 @@ spn_composition_reset(spn_composition_t composition);
spn_result
spn_composition_get_bounds(spn_composition_t composition, int32_t bounds[4]);
#if 0
#ifdef SPN_TODO
// let's switch to a per place bounds using weakrefs -- clip 0 will be largest clip
spn_result
spn_composition_set_clip(spn_composition_t composition, int32_t const clip[4]);
......@@ -326,12 +333,12 @@ spn_styling_group_layer(spn_styling_t styling,
uint32_t const n,
spn_styling_cmd_t * * const cmds);
#if 0
//
// FIXME -- styling command encoders will be opaque
//
#ifdef SPN_DISABLE_UNTIL_INTEGRATED
void
spn_styling_layer_fill_rgba_encoder(spn_styling_cmd_t * cmds, float const rgba[4]);
......@@ -376,6 +383,8 @@ spn_render(spn_context_t context, spn_render_submit_t const * const submit);
//
//
#ifdef __cplusplus
}
#endif
//
......
......@@ -14,6 +14,14 @@
//
//
#ifdef __cplusplus
extern "C" {
#endif
//
//
//
char const *
spn_result_to_string(spn_result const result);
......@@ -50,3 +58,11 @@ spn_assert_n(char const * const file,
//
//
//
#ifdef __cplusplus
}
#endif
//
//
//
......@@ -2,8 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPN_ONCE_SPINEL_RESULT
#define SPN_ONCE_SPINEL_RESULT
#pragma once
//
//
//
#ifdef __cplusplus
extern "C" {
#endif
//
// FIXME -- harvest error codes that are no longer used
......@@ -52,6 +59,8 @@ typedef enum spn_result {
//
//
#ifdef __cplusplus
}
#endif
//
......
......@@ -2,8 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SPN_ONCE_SPINEL_TYPES
#define SPN_ONCE_SPINEL_TYPES
#pragma once
//
//
......@@ -16,6 +15,14 @@
//
//
#ifdef __cplusplus
extern "C" {
#endif
//
//
//
typedef struct spn_context * spn_context_t;
typedef struct spn_path_builder * spn_path_builder_t;
typedef struct spn_raster_builder * spn_raster_builder_t;
......@@ -75,4 +82,10 @@ typedef struct spn_render_submit
//
//
#ifdef __cplusplus
}
#endif
//
//
//
......@@ -29,7 +29,7 @@
//
//
#include "spinel.h"
#include "spinel_vk.h"
#include "spinel_assert.h"
//
......
{
"program": {
"binary": "bin/app"
},
"sandbox": {
"features": [
"vulkan"
],
"services": [
"fuchsia.sysmem.Allocator",
"fuchsia.vulkan.loader.Loader",
"fuchsia.tracelink.Registry"
]
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment