No functional change. Signed-off-by: Chia-I Wu <olvaffe@gmail.com> Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org> Reviewed-by: Ryan Neph <ryanneph@google.com>macos/master
parent
939991220a
commit
243cacf2bb
@ -0,0 +1,170 @@ |
||||
/*
|
||||
* Copyright 2020 Google LLC |
||||
* SPDX-License-Identifier: MIT |
||||
*/ |
||||
|
||||
#include "vkr_pipeline.h" |
||||
|
||||
#include "venus-protocol/vn_protocol_renderer_pipeline.h" |
||||
#include "venus-protocol/vn_protocol_renderer_pipeline_cache.h" |
||||
#include "venus-protocol/vn_protocol_renderer_pipeline_layout.h" |
||||
#include "venus-protocol/vn_protocol_renderer_shader_module.h" |
||||
|
||||
#include "vkr_context.h" |
||||
#include "vkr_device.h" |
||||
|
||||
static void |
||||
vkr_dispatch_vkCreateShaderModule(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkCreateShaderModule *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
CREATE_OBJECT(mod, shader_module, SHADER_MODULE, vkCreateShaderModule, pShaderModule); |
||||
|
||||
util_hash_table_set_u64(ctx->object_table, mod->base.id, mod); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkDestroyShaderModule(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkDestroyShaderModule *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
DESTROY_OBJECT(mod, shader_module, SHADER_MODULE, vkDestroyShaderModule, shaderModule); |
||||
|
||||
util_hash_table_remove_u64(ctx->object_table, mod->base.id); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkCreatePipelineLayout(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkCreatePipelineLayout *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
CREATE_OBJECT(layout, pipeline_layout, PIPELINE_LAYOUT, vkCreatePipelineLayout, |
||||
pPipelineLayout); |
||||
|
||||
util_hash_table_set_u64(ctx->object_table, layout->base.id, layout); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkDestroyPipelineLayout(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkDestroyPipelineLayout *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
DESTROY_OBJECT(layout, pipeline_layout, PIPELINE_LAYOUT, vkDestroyPipelineLayout, |
||||
pipelineLayout); |
||||
|
||||
util_hash_table_remove_u64(ctx->object_table, layout->base.id); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkCreatePipelineCache(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkCreatePipelineCache *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
CREATE_OBJECT(cache, pipeline_cache, PIPELINE_CACHE, vkCreatePipelineCache, |
||||
pPipelineCache); |
||||
|
||||
util_hash_table_set_u64(ctx->object_table, cache->base.id, cache); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkDestroyPipelineCache(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkDestroyPipelineCache *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
DESTROY_OBJECT(cache, pipeline_cache, PIPELINE_CACHE, vkDestroyPipelineCache, |
||||
pipelineCache); |
||||
|
||||
util_hash_table_remove_u64(ctx->object_table, cache->base.id); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkGetPipelineCacheData(UNUSED struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkGetPipelineCacheData *args) |
||||
{ |
||||
vn_replace_vkGetPipelineCacheData_args_handle(args); |
||||
args->ret = vkGetPipelineCacheData(args->device, args->pipelineCache, args->pDataSize, |
||||
args->pData); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkMergePipelineCaches(UNUSED struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkMergePipelineCaches *args) |
||||
{ |
||||
vn_replace_vkMergePipelineCaches_args_handle(args); |
||||
args->ret = vkMergePipelineCaches(args->device, args->dstCache, args->srcCacheCount, |
||||
args->pSrcCaches); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkCreateGraphicsPipelines(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkCreateGraphicsPipelines *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
CREATE_PIPELINE_ARRAY(vkCreateGraphicsPipelines); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkCreateComputePipelines(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkCreateComputePipelines *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
CREATE_PIPELINE_ARRAY(vkCreateComputePipelines); |
||||
} |
||||
|
||||
static void |
||||
vkr_dispatch_vkDestroyPipeline(struct vn_dispatch_context *dispatch, |
||||
struct vn_command_vkDestroyPipeline *args) |
||||
{ |
||||
struct vkr_context *ctx = dispatch->data; |
||||
|
||||
DESTROY_OBJECT(pipeline, pipeline, PIPELINE, vkDestroyPipeline, pipeline); |
||||
|
||||
util_hash_table_remove_u64(ctx->object_table, pipeline->base.id); |
||||
} |
||||
|
||||
void |
||||
vkr_context_init_shader_module_dispatch(struct vkr_context *ctx) |
||||
{ |
||||
struct vn_dispatch_context *dispatch = &ctx->dispatch; |
||||
|
||||
dispatch->dispatch_vkCreateShaderModule = vkr_dispatch_vkCreateShaderModule; |
||||
dispatch->dispatch_vkDestroyShaderModule = vkr_dispatch_vkDestroyShaderModule; |
||||
} |
||||
|
||||
void |
||||
vkr_context_init_pipeline_layout_dispatch(struct vkr_context *ctx) |
||||
{ |
||||
struct vn_dispatch_context *dispatch = &ctx->dispatch; |
||||
|
||||
dispatch->dispatch_vkCreatePipelineLayout = vkr_dispatch_vkCreatePipelineLayout; |
||||
dispatch->dispatch_vkDestroyPipelineLayout = vkr_dispatch_vkDestroyPipelineLayout; |
||||
} |
||||
|
||||
void |
||||
vkr_context_init_pipeline_cache_dispatch(struct vkr_context *ctx) |
||||
{ |
||||
struct vn_dispatch_context *dispatch = &ctx->dispatch; |
||||
|
||||
dispatch->dispatch_vkCreatePipelineCache = vkr_dispatch_vkCreatePipelineCache; |
||||
dispatch->dispatch_vkDestroyPipelineCache = vkr_dispatch_vkDestroyPipelineCache; |
||||
dispatch->dispatch_vkGetPipelineCacheData = vkr_dispatch_vkGetPipelineCacheData; |
||||
dispatch->dispatch_vkMergePipelineCaches = vkr_dispatch_vkMergePipelineCaches; |
||||
} |
||||
|
||||
void |
||||
vkr_context_init_pipeline_dispatch(struct vkr_context *ctx) |
||||
{ |
||||
struct vn_dispatch_context *dispatch = &ctx->dispatch; |
||||
|
||||
dispatch->dispatch_vkCreateGraphicsPipelines = vkr_dispatch_vkCreateGraphicsPipelines; |
||||
dispatch->dispatch_vkCreateComputePipelines = vkr_dispatch_vkCreateComputePipelines; |
||||
dispatch->dispatch_vkDestroyPipeline = vkr_dispatch_vkDestroyPipeline; |
||||
} |
Loading…
Reference in new issue