mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-20 03:00:11 +01:00
pvr: build pvr_arch_*.c as a multi-arch sources
This will allow us to build this multiple times for different architectures. For now, it only defines a single architecture, because that's what we currently support. But this makes room for future architectures, that will follow relatively soon. Co-authored-by: Ashish Chauhan <ashish.chauhan@imgtec.com> Acked-by: Frank Binns <frank.binns@imgtec.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/38922>
This commit is contained in:
parent
346e365daa
commit
e762592bff
46 changed files with 993 additions and 579 deletions
|
|
@ -27,28 +27,6 @@ pvr_files = files(
|
|||
'winsys/powervr/pvr_drm_job_transfer.c',
|
||||
'winsys/pvr_winsys.c',
|
||||
'winsys/pvr_winsys_helper.c',
|
||||
'pvr_arch_border.c',
|
||||
'pvr_arch_cmd_buffer.c',
|
||||
'pvr_arch_cmd_query.c',
|
||||
'pvr_arch_csb.c',
|
||||
'pvr_arch_descriptor_set.c',
|
||||
'pvr_arch_device.c',
|
||||
'pvr_arch_formats.c',
|
||||
'pvr_arch_framebuffer.c',
|
||||
'pvr_arch_hw_pass.c',
|
||||
'pvr_arch_image.c',
|
||||
'pvr_arch_job_common.c',
|
||||
'pvr_arch_job_compute.c',
|
||||
'pvr_arch_job_context.c',
|
||||
'pvr_arch_job_render.c',
|
||||
'pvr_arch_job_transfer.c',
|
||||
'pvr_arch_mrt.c',
|
||||
'pvr_arch_pass.c',
|
||||
'pvr_arch_queue.c',
|
||||
'pvr_arch_query_compute.c',
|
||||
'pvr_arch_sampler.c',
|
||||
'pvr_arch_spm.c',
|
||||
'pvr_arch_tex_state.c',
|
||||
'pvr_bo.c',
|
||||
'pvr_csb.c',
|
||||
'pvr_descriptor_set.c',
|
||||
|
|
@ -59,7 +37,6 @@ pvr_files = files(
|
|||
'pvr_image.c',
|
||||
'pvr_instance.c',
|
||||
'pvr_physical_device.c',
|
||||
'pvr_pipeline.c',
|
||||
'pvr_transfer_frag_store.c',
|
||||
'pvr_query.c',
|
||||
'pvr_robustness.c',
|
||||
|
|
@ -114,6 +91,32 @@ common_per_arch_files = [
|
|||
sha1_h,
|
||||
]
|
||||
|
||||
common_per_arch_files += files(
|
||||
'pvr_arch_border.c',
|
||||
'pvr_arch_cmd_buffer.c',
|
||||
'pvr_arch_cmd_query.c',
|
||||
'pvr_arch_csb.c',
|
||||
'pvr_arch_descriptor_set.c',
|
||||
'pvr_arch_device.c',
|
||||
'pvr_arch_formats.c',
|
||||
'pvr_arch_framebuffer.c',
|
||||
'pvr_arch_hw_pass.c',
|
||||
'pvr_arch_pass.c',
|
||||
'pvr_arch_pipeline.c',
|
||||
'pvr_arch_image.c',
|
||||
'pvr_arch_job_common.c',
|
||||
'pvr_arch_job_compute.c',
|
||||
'pvr_arch_job_context.c',
|
||||
'pvr_arch_job_render.c',
|
||||
'pvr_arch_job_transfer.c',
|
||||
'pvr_arch_mrt.c',
|
||||
'pvr_arch_queue.c',
|
||||
'pvr_arch_query_compute.c',
|
||||
'pvr_arch_sampler.c',
|
||||
'pvr_arch_spm.c',
|
||||
'pvr_arch_tex_state.c',
|
||||
)
|
||||
|
||||
rogue_files = files(
|
||||
'rogue/pvr_blit.c',
|
||||
'rogue/pvr_clear.c',
|
||||
|
|
|
|||
|
|
@ -415,7 +415,7 @@ static inline void pvr_border_color_swizzle_to_tex_format(
|
|||
*color = swizzled_color;
|
||||
}
|
||||
|
||||
VkResult pvr_border_color_table_init(struct pvr_device *const device)
|
||||
VkResult PVR_PER_ARCH(border_color_table_init)(struct pvr_device *const device)
|
||||
{
|
||||
struct pvr_border_color_table *table = device->border_color_table =
|
||||
vk_zalloc(&device->vk.alloc,
|
||||
|
|
@ -470,7 +470,7 @@ err_out:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_border_color_table_finish(struct pvr_device *const device)
|
||||
void PVR_PER_ARCH(border_color_table_finish)(struct pvr_device *const device)
|
||||
{
|
||||
#if MESA_DEBUG
|
||||
BITSET_SET_RANGE_INSIDE_WORD(device->border_color_table->unused_entries,
|
||||
|
|
@ -593,7 +593,7 @@ err_out:
|
|||
"Failed to allocate border color table entry");
|
||||
}
|
||||
|
||||
VkResult pvr_border_color_table_get_or_create_entry(
|
||||
VkResult PVR_PER_ARCH(border_color_table_get_or_create_entry)(
|
||||
struct pvr_device *const device,
|
||||
const struct pvr_sampler *const sampler,
|
||||
struct pvr_border_color_table *const table,
|
||||
|
|
@ -612,7 +612,7 @@ VkResult pvr_border_color_table_get_or_create_entry(
|
|||
index_out);
|
||||
}
|
||||
|
||||
void pvr_border_color_table_release_entry(
|
||||
void PVR_PER_ARCH(border_color_table_release_entry)(
|
||||
struct pvr_border_color_table *const table,
|
||||
const uint32_t index)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -112,9 +112,9 @@ static void pvr_cmd_buffer_clear_values_free(struct pvr_cmd_buffer *cmd_buffer);
|
|||
|
||||
static void pvr_cmd_buffer_attachments_free(struct pvr_cmd_buffer *cmd_buffer);
|
||||
|
||||
struct pvr_renderpass_hwsetup_render *
|
||||
pvr_pass_info_get_hw_render(const struct pvr_render_pass_info *render_pass_info,
|
||||
uint32_t idx)
|
||||
struct pvr_renderpass_hwsetup_render *PVR_PER_ARCH(pass_info_get_hw_render)(
|
||||
const struct pvr_render_pass_info *render_pass_info,
|
||||
uint32_t idx)
|
||||
{
|
||||
if (render_pass_info->dr_info)
|
||||
return &render_pass_info->dr_info->hw_render;
|
||||
|
|
@ -284,10 +284,10 @@ static VkResult pvr_cmd_buffer_create(struct pvr_device *device,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_AllocateCommandBuffers(VkDevice _device,
|
||||
const VkCommandBufferAllocateInfo *pAllocateInfo,
|
||||
VkCommandBuffer *pCommandBuffers)
|
||||
VkResult PVR_PER_ARCH(AllocateCommandBuffers)(
|
||||
VkDevice _device,
|
||||
const VkCommandBufferAllocateInfo *pAllocateInfo,
|
||||
VkCommandBuffer *pCommandBuffers)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_command_pool, pool, pAllocateInfo->commandPool);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -424,11 +424,11 @@ pvr_cmd_buffer_emit_ppp_state(const struct pvr_cmd_buffer *const cmd_buffer,
|
|||
return csb->status;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_cmd_buffer_upload_general(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const void *const data,
|
||||
const size_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out)
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_upload_general)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const void *const data,
|
||||
const size_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out)
|
||||
{
|
||||
struct pvr_device *const device = cmd_buffer->device;
|
||||
const uint32_t cache_line_size =
|
||||
|
|
@ -479,15 +479,16 @@ pvr_cmd_buffer_upload_usc(struct pvr_cmd_buffer *const cmd_buffer,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_cmd_buffer_upload_pds(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const uint32_t *data,
|
||||
uint32_t data_size_dwords,
|
||||
uint32_t data_alignment,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size_dwords,
|
||||
uint32_t code_alignment,
|
||||
uint64_t min_alignment,
|
||||
struct pvr_pds_upload *const pds_upload_out)
|
||||
VkResult
|
||||
PVR_PER_ARCH(cmd_buffer_upload_pds)(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const uint32_t *data,
|
||||
uint32_t data_size_dwords,
|
||||
uint32_t data_alignment,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size_dwords,
|
||||
uint32_t code_alignment,
|
||||
uint64_t min_alignment,
|
||||
struct pvr_pds_upload *const pds_upload_out)
|
||||
{
|
||||
struct pvr_device *const device = cmd_buffer->device;
|
||||
VkResult result;
|
||||
|
|
@ -2237,9 +2238,10 @@ pvr_compute_generate_idfwdf(struct pvr_cmd_buffer *cmd_buffer,
|
|||
/* TODO: This can be pre-packed and uploaded directly. Would that provide any
|
||||
* speed up?
|
||||
*/
|
||||
void pvr_compute_generate_fence(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
bool deallocate_shareds)
|
||||
void PVR_PER_ARCH(compute_generate_fence)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
bool deallocate_shareds)
|
||||
{
|
||||
const struct pvr_pds_upload *program =
|
||||
&cmd_buffer->device->pds_compute_fence_program;
|
||||
|
|
@ -2364,7 +2366,7 @@ err_csb_finish:
|
|||
return result;
|
||||
}
|
||||
|
||||
VkResult pvr_cmd_buffer_end_sub_cmd(struct pvr_cmd_buffer *cmd_buffer)
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_end_sub_cmd)(struct pvr_cmd_buffer *cmd_buffer)
|
||||
{
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
struct pvr_sub_cmd *sub_cmd = state->current_sub_cmd;
|
||||
|
|
@ -2568,8 +2570,9 @@ VkResult pvr_cmd_buffer_end_sub_cmd(struct pvr_cmd_buffer *cmd_buffer)
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void pvr_reset_graphics_dirty_state(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
bool start_geom)
|
||||
void PVR_PER_ARCH(reset_graphics_dirty_state)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
bool start_geom)
|
||||
{
|
||||
struct vk_dynamic_graphics_state *const dynamic_state =
|
||||
&cmd_buffer->vk.dynamic_graphics_state;
|
||||
|
|
@ -2653,8 +2656,9 @@ pvr_render_pass_info_get_view_mask(const struct pvr_render_pass_info *rp_info)
|
|||
return hw_render->view_mask;
|
||||
}
|
||||
|
||||
VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
||||
enum pvr_sub_cmd_type type)
|
||||
VkResult
|
||||
PVR_PER_ARCH(cmd_buffer_start_sub_cmd)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
enum pvr_sub_cmd_type type)
|
||||
{
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
struct pvr_device *device = cmd_buffer->device;
|
||||
|
|
@ -2767,10 +2771,11 @@ VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_winsys_heap *heap,
|
||||
uint64_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out)
|
||||
VkResult
|
||||
PVR_PER_ARCH(cmd_buffer_alloc_mem)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_winsys_heap *heap,
|
||||
uint64_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out)
|
||||
{
|
||||
const uint32_t cache_line_size =
|
||||
pvr_get_slc_cache_line_size(&cmd_buffer->device->pdevice->dev_info);
|
||||
|
|
@ -2820,9 +2825,9 @@ static void pvr_cmd_bind_graphics_pipeline(
|
|||
&gfx_pipeline->dynamic_state);
|
||||
}
|
||||
|
||||
void pvr_CmdBindPipeline(VkCommandBuffer commandBuffer,
|
||||
VkPipelineBindPoint pipelineBindPoint,
|
||||
VkPipeline _pipeline)
|
||||
void PVR_PER_ARCH(CmdBindPipeline)(VkCommandBuffer commandBuffer,
|
||||
VkPipelineBindPoint pipelineBindPoint,
|
||||
VkPipeline _pipeline)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
VK_FROM_HANDLE(pvr_pipeline, pipeline, _pipeline);
|
||||
|
|
@ -2911,10 +2916,10 @@ static void check_viewport_quirk_70165(const struct pvr_device *device,
|
|||
}
|
||||
#endif
|
||||
|
||||
void pvr_CmdSetViewport(VkCommandBuffer commandBuffer,
|
||||
uint32_t firstViewport,
|
||||
uint32_t viewportCount,
|
||||
const VkViewport *pViewports)
|
||||
void PVR_PER_ARCH(CmdSetViewport)(VkCommandBuffer commandBuffer,
|
||||
uint32_t firstViewport,
|
||||
uint32_t viewportCount,
|
||||
const VkViewport *pViewports)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
const uint32_t total_count = firstViewport + viewportCount;
|
||||
|
|
@ -2938,14 +2943,14 @@ void pvr_CmdSetViewport(VkCommandBuffer commandBuffer,
|
|||
pViewports);
|
||||
}
|
||||
|
||||
void pvr_CmdSetDepthBounds(VkCommandBuffer commandBuffer,
|
||||
float minDepthBounds,
|
||||
float maxDepthBounds)
|
||||
void PVR_PER_ARCH(CmdSetDepthBounds)(VkCommandBuffer commandBuffer,
|
||||
float minDepthBounds,
|
||||
float maxDepthBounds)
|
||||
{
|
||||
mesa_logd("No support for depth bounds testing.");
|
||||
}
|
||||
|
||||
void pvr_CmdBindDescriptorSets2KHR(
|
||||
void PVR_PER_ARCH(CmdBindDescriptorSets2KHR)(
|
||||
VkCommandBuffer commandBuffer,
|
||||
const VkBindDescriptorSetsInfoKHR *pBindDescriptorSetsInfo)
|
||||
{
|
||||
|
|
@ -3003,13 +3008,13 @@ void pvr_CmdBindDescriptorSets2KHR(
|
|||
cmd_buffer->state.dirty.compute_desc_dirty = true;
|
||||
}
|
||||
|
||||
void pvr_CmdBindVertexBuffers2(VkCommandBuffer commandBuffer,
|
||||
uint32_t firstBinding,
|
||||
uint32_t bindingCount,
|
||||
const VkBuffer *pBuffers,
|
||||
const VkDeviceSize *pOffsets,
|
||||
const VkDeviceSize *pSizes,
|
||||
const VkDeviceSize *pStrides)
|
||||
void PVR_PER_ARCH(CmdBindVertexBuffers2)(VkCommandBuffer commandBuffer,
|
||||
uint32_t firstBinding,
|
||||
uint32_t bindingCount,
|
||||
const VkBuffer *pBuffers,
|
||||
const VkDeviceSize *pOffsets,
|
||||
const VkDeviceSize *pSizes,
|
||||
const VkDeviceSize *pStrides)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_vertex_binding *const vb = cmd_buffer->state.vertex_bindings;
|
||||
|
|
@ -3040,10 +3045,10 @@ void pvr_CmdBindVertexBuffers2(VkCommandBuffer commandBuffer,
|
|||
cmd_buffer->state.dirty.vertex_bindings = true;
|
||||
}
|
||||
|
||||
void pvr_CmdBindIndexBuffer(VkCommandBuffer commandBuffer,
|
||||
VkBuffer buffer,
|
||||
VkDeviceSize offset,
|
||||
VkIndexType indexType)
|
||||
void PVR_PER_ARCH(CmdBindIndexBuffer)(VkCommandBuffer commandBuffer,
|
||||
VkBuffer buffer,
|
||||
VkDeviceSize offset,
|
||||
VkIndexType indexType)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
VK_FROM_HANDLE(pvr_buffer, index_buffer, buffer);
|
||||
|
|
@ -3072,8 +3077,9 @@ static void update_push_constants(struct pvr_push_constants *push_consts,
|
|||
push_consts->dirty = true;
|
||||
}
|
||||
|
||||
void pvr_CmdPushConstants2KHR(VkCommandBuffer commandBuffer,
|
||||
const VkPushConstantsInfoKHR *pPushConstantsInfo)
|
||||
void PVR_PER_ARCH(CmdPushConstants2KHR)(
|
||||
VkCommandBuffer commandBuffer,
|
||||
const VkPushConstantsInfoKHR *pPushConstantsInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *const state = &cmd_buffer->state;
|
||||
|
|
@ -3254,7 +3260,8 @@ pvr_render_targets_init_for_render(struct pvr_device *device,
|
|||
}
|
||||
|
||||
const struct pvr_renderpass_hwsetup_subpass *
|
||||
pvr_get_hw_subpass(const struct pvr_render_pass *pass, const uint32_t subpass)
|
||||
PVR_PER_ARCH(get_hw_subpass)(const struct pvr_render_pass *pass,
|
||||
const uint32_t subpass)
|
||||
{
|
||||
const struct pvr_renderpass_hw_map *map =
|
||||
&pass->hw_setup->subpass_map[subpass];
|
||||
|
|
@ -3916,9 +3923,10 @@ pvr_resolve_unemitted_resolve_attachments(struct pvr_cmd_buffer *cmd_buffer,
|
|||
return pvr_cmd_buffer_end_sub_cmd(cmd_buffer);
|
||||
}
|
||||
|
||||
void pvr_CmdBeginRenderPass2(VkCommandBuffer commandBuffer,
|
||||
const VkRenderPassBeginInfo *pRenderPassBeginInfo,
|
||||
const VkSubpassBeginInfo *pSubpassBeginInfo)
|
||||
void PVR_PER_ARCH(CmdBeginRenderPass2)(
|
||||
VkCommandBuffer commandBuffer,
|
||||
const VkRenderPassBeginInfo *pRenderPassBeginInfo,
|
||||
const VkSubpassBeginInfo *pSubpassBeginInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_framebuffer,
|
||||
framebuffer,
|
||||
|
|
@ -4741,8 +4749,8 @@ static inline uint64_t pvr_render_pass_info_get_scratch_buffer_size(
|
|||
info->rstate->height);
|
||||
}
|
||||
|
||||
void pvr_CmdBeginRendering(VkCommandBuffer commandBuffer,
|
||||
const VkRenderingInfo *pRenderingInfo)
|
||||
void PVR_PER_ARCH(CmdBeginRendering)(VkCommandBuffer commandBuffer,
|
||||
const VkRenderingInfo *pRenderingInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -4874,7 +4882,7 @@ static VkResult
|
|||
pvr_resolve_unemitted_resolve_attachments(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_render_pass_info *info);
|
||||
|
||||
void pvr_CmdEndRendering(VkCommandBuffer commandBuffer)
|
||||
void PVR_PER_ARCH(CmdEndRendering)(VkCommandBuffer commandBuffer)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -5107,8 +5115,9 @@ static inline void pvr_cmd_buffer_state_from_render_pass_inheritance(
|
|||
pass->subpasses[inheritance_info->subpass].isp_userpass;
|
||||
}
|
||||
|
||||
VkResult pvr_BeginCommandBuffer(VkCommandBuffer commandBuffer,
|
||||
const VkCommandBufferBeginInfo *pBeginInfo)
|
||||
VkResult
|
||||
PVR_PER_ARCH(BeginCommandBuffer)(VkCommandBuffer commandBuffer,
|
||||
const VkCommandBufferBeginInfo *pBeginInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state;
|
||||
|
|
@ -5173,8 +5182,9 @@ VkResult pvr_BeginCommandBuffer(VkCommandBuffer commandBuffer,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_cmd_buffer_add_transfer_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_transfer_cmd *transfer_cmd)
|
||||
VkResult
|
||||
PVR_PER_ARCH(cmd_buffer_add_transfer_cmd)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_transfer_cmd *transfer_cmd)
|
||||
{
|
||||
struct pvr_sub_cmd_transfer *sub_cmd;
|
||||
VkResult result;
|
||||
|
|
@ -5994,7 +6004,7 @@ static void pvr_compute_update_shared(struct pvr_cmd_buffer *cmd_buffer,
|
|||
pvr_compute_generate_control_stream(csb, sub_cmd, &info);
|
||||
}
|
||||
|
||||
void pvr_compute_update_shared_private(
|
||||
void PVR_PER_ARCH(compute_update_shared_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline)
|
||||
|
|
@ -6069,7 +6079,7 @@ pvr_compute_flat_pad_workgroup_size(const struct pvr_physical_device *pdevice,
|
|||
return workgroup_size;
|
||||
}
|
||||
|
||||
void pvr_compute_update_kernel_private(
|
||||
void PVR_PER_ARCH(compute_update_kernel_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline,
|
||||
|
|
@ -6326,13 +6336,13 @@ static void pvr_cmd_dispatch(
|
|||
workgroup_size);
|
||||
}
|
||||
|
||||
void pvr_CmdDispatchBase(VkCommandBuffer commandBuffer,
|
||||
uint32_t baseGroupX,
|
||||
uint32_t baseGroupY,
|
||||
uint32_t baseGroupZ,
|
||||
uint32_t groupCountX,
|
||||
uint32_t groupCountY,
|
||||
uint32_t groupCountZ)
|
||||
void PVR_PER_ARCH(CmdDispatchBase)(VkCommandBuffer commandBuffer,
|
||||
uint32_t baseGroupX,
|
||||
uint32_t baseGroupY,
|
||||
uint32_t baseGroupZ,
|
||||
uint32_t groupCountX,
|
||||
uint32_t groupCountY,
|
||||
uint32_t groupCountZ)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
|
||||
|
|
@ -6347,9 +6357,9 @@ void pvr_CmdDispatchBase(VkCommandBuffer commandBuffer,
|
|||
(uint32_t[]){ groupCountX, groupCountY, groupCountZ });
|
||||
}
|
||||
|
||||
void pvr_CmdDispatchIndirect(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset)
|
||||
void PVR_PER_ARCH(CmdDispatchIndirect)(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
VK_FROM_HANDLE(pvr_buffer, buffer, _buffer);
|
||||
|
|
@ -7888,11 +7898,12 @@ pvr_emit_dirty_ppp_state(struct pvr_cmd_buffer *const cmd_buffer,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void pvr_calculate_vertex_cam_size(const struct pvr_device_info *dev_info,
|
||||
const uint32_t vs_output_size,
|
||||
const bool raster_enable,
|
||||
uint32_t *const cam_size_out,
|
||||
uint32_t *const vs_max_instances_out)
|
||||
void PVR_PER_ARCH(calculate_vertex_cam_size)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const uint32_t vs_output_size,
|
||||
const bool raster_enable,
|
||||
uint32_t *const cam_size_out,
|
||||
uint32_t *const vs_max_instances_out)
|
||||
{
|
||||
/* First work out the size of a vertex in the UVS and multiply by 4 for
|
||||
* column ordering.
|
||||
|
|
@ -8579,11 +8590,11 @@ static void pvr_emit_vdm_index_list(struct pvr_cmd_buffer *cmd_buffer,
|
|||
pvr_csb_clear_relocation_mark(csb);
|
||||
}
|
||||
|
||||
void pvr_CmdDraw(VkCommandBuffer commandBuffer,
|
||||
uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance)
|
||||
void PVR_PER_ARCH(CmdDraw)(VkCommandBuffer commandBuffer,
|
||||
uint32_t vertexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstVertex,
|
||||
uint32_t firstInstance)
|
||||
{
|
||||
const struct pvr_cmd_buffer_draw_state draw_state = {
|
||||
.base_vertex = firstVertex,
|
||||
|
|
@ -8618,12 +8629,12 @@ void pvr_CmdDraw(VkCommandBuffer commandBuffer,
|
|||
0U);
|
||||
}
|
||||
|
||||
void pvr_CmdDrawIndexed(VkCommandBuffer commandBuffer,
|
||||
uint32_t indexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
int32_t vertexOffset,
|
||||
uint32_t firstInstance)
|
||||
void PVR_PER_ARCH(CmdDrawIndexed)(VkCommandBuffer commandBuffer,
|
||||
uint32_t indexCount,
|
||||
uint32_t instanceCount,
|
||||
uint32_t firstIndex,
|
||||
int32_t vertexOffset,
|
||||
uint32_t firstInstance)
|
||||
{
|
||||
const struct pvr_cmd_buffer_draw_state draw_state = {
|
||||
.base_vertex = vertexOffset,
|
||||
|
|
@ -8659,11 +8670,11 @@ void pvr_CmdDrawIndexed(VkCommandBuffer commandBuffer,
|
|||
0U);
|
||||
}
|
||||
|
||||
void pvr_CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset,
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
void PVR_PER_ARCH(CmdDrawIndexedIndirect)(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset,
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
{
|
||||
const struct pvr_cmd_buffer_draw_state draw_state = {
|
||||
.draw_indirect = true,
|
||||
|
|
@ -8699,11 +8710,11 @@ void pvr_CmdDrawIndexedIndirect(VkCommandBuffer commandBuffer,
|
|||
stride);
|
||||
}
|
||||
|
||||
void pvr_CmdDrawIndirect(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset,
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
void PVR_PER_ARCH(CmdDrawIndirect)(VkCommandBuffer commandBuffer,
|
||||
VkBuffer _buffer,
|
||||
VkDeviceSize offset,
|
||||
uint32_t drawCount,
|
||||
uint32_t stride)
|
||||
{
|
||||
const struct pvr_cmd_buffer_draw_state draw_state = {
|
||||
.draw_indirect = true,
|
||||
|
|
@ -8738,8 +8749,8 @@ void pvr_CmdDrawIndirect(VkCommandBuffer commandBuffer,
|
|||
stride);
|
||||
}
|
||||
|
||||
void pvr_CmdEndRenderPass2(VkCommandBuffer commandBuffer,
|
||||
const VkSubpassEndInfo *pSubpassEndInfo)
|
||||
void PVR_PER_ARCH(CmdEndRenderPass2)(VkCommandBuffer commandBuffer,
|
||||
const VkSubpassEndInfo *pSubpassEndInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -9065,9 +9076,9 @@ pvr_execute_graphics_cmd_buffer(struct pvr_cmd_buffer *cmd_buffer,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void pvr_CmdExecuteCommands(VkCommandBuffer commandBuffer,
|
||||
uint32_t commandBufferCount,
|
||||
const VkCommandBuffer *pCommandBuffers)
|
||||
void PVR_PER_ARCH(CmdExecuteCommands)(VkCommandBuffer commandBuffer,
|
||||
uint32_t commandBufferCount,
|
||||
const VkCommandBuffer *pCommandBuffers)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -9187,9 +9198,9 @@ pvr_get_current_subpass(const struct pvr_cmd_buffer_state *const state)
|
|||
return &state->render_pass_info.pass->subpasses[subpass_idx];
|
||||
}
|
||||
|
||||
void pvr_CmdNextSubpass2(VkCommandBuffer commandBuffer,
|
||||
const VkSubpassBeginInfo *pSubpassBeginInfo,
|
||||
const VkSubpassEndInfo *pSubpassEndInfo)
|
||||
void PVR_PER_ARCH(CmdNextSubpass2)(VkCommandBuffer commandBuffer,
|
||||
const VkSubpassBeginInfo *pSubpassBeginInfo,
|
||||
const VkSubpassEndInfo *pSubpassEndInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -9473,8 +9484,8 @@ pvr_cmd_buffer_insert_barrier_event(struct pvr_cmd_buffer *cmd_buffer,
|
|||
/* This is just enough to handle vkCmdPipelineBarrier().
|
||||
* TODO: Complete?
|
||||
*/
|
||||
void pvr_CmdPipelineBarrier2(VkCommandBuffer commandBuffer,
|
||||
const VkDependencyInfo *pDependencyInfo)
|
||||
void PVR_PER_ARCH(CmdPipelineBarrier2)(VkCommandBuffer commandBuffer,
|
||||
const VkDependencyInfo *pDependencyInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *const state = &cmd_buffer->state;
|
||||
|
|
@ -9612,9 +9623,9 @@ void pvr_CmdPipelineBarrier2(VkCommandBuffer commandBuffer,
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_CmdResetEvent2(VkCommandBuffer commandBuffer,
|
||||
VkEvent _event,
|
||||
VkPipelineStageFlags2 stageMask)
|
||||
void PVR_PER_ARCH(CmdResetEvent2)(VkCommandBuffer commandBuffer,
|
||||
VkEvent _event,
|
||||
VkPipelineStageFlags2 stageMask)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
VK_FROM_HANDLE(pvr_event, event, _event);
|
||||
|
|
@ -9637,9 +9648,9 @@ void pvr_CmdResetEvent2(VkCommandBuffer commandBuffer,
|
|||
pvr_cmd_buffer_end_sub_cmd(cmd_buffer);
|
||||
}
|
||||
|
||||
void pvr_CmdSetEvent2(VkCommandBuffer commandBuffer,
|
||||
VkEvent _event,
|
||||
const VkDependencyInfo *pDependencyInfo)
|
||||
void PVR_PER_ARCH(CmdSetEvent2)(VkCommandBuffer commandBuffer,
|
||||
VkEvent _event,
|
||||
const VkDependencyInfo *pDependencyInfo)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
VK_FROM_HANDLE(pvr_event, event, _event);
|
||||
|
|
@ -9665,10 +9676,10 @@ void pvr_CmdSetEvent2(VkCommandBuffer commandBuffer,
|
|||
pvr_cmd_buffer_end_sub_cmd(cmd_buffer);
|
||||
}
|
||||
|
||||
void pvr_CmdWaitEvents2(VkCommandBuffer commandBuffer,
|
||||
uint32_t eventCount,
|
||||
const VkEvent *pEvents,
|
||||
const VkDependencyInfo *pDependencyInfos)
|
||||
void PVR_PER_ARCH(CmdWaitEvents2)(VkCommandBuffer commandBuffer,
|
||||
uint32_t eventCount,
|
||||
const VkEvent *pEvents,
|
||||
const VkDependencyInfo *pDependencyInfos)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_event **events_array;
|
||||
|
|
@ -9724,15 +9735,15 @@ void pvr_CmdWaitEvents2(VkCommandBuffer commandBuffer,
|
|||
pvr_cmd_buffer_end_sub_cmd(cmd_buffer);
|
||||
}
|
||||
|
||||
void pvr_CmdWriteTimestamp2(VkCommandBuffer commandBuffer,
|
||||
VkPipelineStageFlags2 stage,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query)
|
||||
void PVR_PER_ARCH(CmdWriteTimestamp2)(VkCommandBuffer commandBuffer,
|
||||
VkPipelineStageFlags2 stage,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query)
|
||||
{
|
||||
UNREACHABLE("Timestamp queries are not supported.");
|
||||
}
|
||||
|
||||
VkResult pvr_EndCommandBuffer(VkCommandBuffer commandBuffer)
|
||||
VkResult PVR_PER_ARCH(EndCommandBuffer)(VkCommandBuffer commandBuffer)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
|
|||
|
|
@ -11,10 +11,10 @@
|
|||
#include "pvr_pass.h"
|
||||
#include "pvr_query.h"
|
||||
|
||||
void pvr_CmdResetQueryPool(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t firstQuery,
|
||||
uint32_t queryCount)
|
||||
void PVR_PER_ARCH(CmdResetQueryPool)(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t firstQuery,
|
||||
uint32_t queryCount)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_query_info query_info;
|
||||
|
|
@ -64,14 +64,14 @@ void pvr_CmdResetQueryPool(VkCommandBuffer commandBuffer,
|
|||
};
|
||||
}
|
||||
|
||||
void pvr_CmdCopyQueryPoolResults(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t firstQuery,
|
||||
uint32_t queryCount,
|
||||
VkBuffer dstBuffer,
|
||||
VkDeviceSize dstOffset,
|
||||
VkDeviceSize stride,
|
||||
VkQueryResultFlags flags)
|
||||
void PVR_PER_ARCH(CmdCopyQueryPoolResults)(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t firstQuery,
|
||||
uint32_t queryCount,
|
||||
VkBuffer dstBuffer,
|
||||
VkDeviceSize dstOffset,
|
||||
VkDeviceSize stride,
|
||||
VkQueryResultFlags flags)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_query_info query_info;
|
||||
|
|
@ -151,10 +151,10 @@ pvr_cmd_buffer_state_get_view_count(const struct pvr_cmd_buffer_state *state)
|
|||
return view_count;
|
||||
}
|
||||
|
||||
void pvr_CmdBeginQuery(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query,
|
||||
VkQueryControlFlags flags)
|
||||
void PVR_PER_ARCH(CmdBeginQuery)(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query,
|
||||
VkQueryControlFlags flags)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
@ -208,9 +208,9 @@ void pvr_CmdBeginQuery(VkCommandBuffer commandBuffer,
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_CmdEndQuery(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query)
|
||||
void PVR_PER_ARCH(CmdEndQuery)(VkCommandBuffer commandBuffer,
|
||||
VkQueryPool queryPool,
|
||||
uint32_t query)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_cmd_buffer, cmd_buffer, commandBuffer);
|
||||
struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
|
|
|
|||
|
|
@ -188,7 +188,7 @@ static bool pvr_csb_buffer_extend(struct pvr_csb *csb)
|
|||
* \param[in] num_dwords Number of dwords to allocate.
|
||||
* \return Valid host virtual address or NULL otherwise.
|
||||
*/
|
||||
void *pvr_csb_alloc_dwords(struct pvr_csb *csb, uint32_t num_dwords)
|
||||
void *PVR_PER_ARCH(csb_alloc_dwords)(struct pvr_csb *csb, uint32_t num_dwords)
|
||||
{
|
||||
const uint32_t required_space = PVR_DW_TO_BYTES(num_dwords);
|
||||
void *p;
|
||||
|
|
@ -241,7 +241,8 @@ void *pvr_csb_alloc_dwords(struct pvr_csb *csb, uint32_t num_dwords)
|
|||
* \param[in,out] csb_dst Destination control Stream Builder object.
|
||||
* \param[in] csb_src Source Control Stream Builder object.
|
||||
*/
|
||||
VkResult pvr_csb_copy(struct pvr_csb *csb_dst, struct pvr_csb *csb_src)
|
||||
VkResult PVR_PER_ARCH(csb_copy)(struct pvr_csb *csb_dst,
|
||||
struct pvr_csb *csb_src)
|
||||
{
|
||||
const uint8_t stream_reserved_space =
|
||||
PVR_DW_TO_BYTES(pvr_cmd_length(VDMCTRL_STREAM_LINK0) +
|
||||
|
|
@ -269,7 +270,7 @@ VkResult pvr_csb_copy(struct pvr_csb *csb_dst, struct pvr_csb *csb_src)
|
|||
assert(!"CSB source buffer too large to do a full copy");
|
||||
}
|
||||
|
||||
destination = pvr_csb_alloc_dwords(csb_dst, size);
|
||||
destination = PVR_PER_ARCH(csb_alloc_dwords)(csb_dst, size);
|
||||
if (!destination) {
|
||||
assert(csb_dst->status != VK_SUCCESS);
|
||||
return csb_dst->status;
|
||||
|
|
@ -289,7 +290,9 @@ VkResult pvr_csb_copy(struct pvr_csb *csb_dst, struct pvr_csb *csb_src)
|
|||
* \param[in] ret Selects whether the sub control stream will return or
|
||||
* terminate.
|
||||
*/
|
||||
void pvr_csb_emit_link(struct pvr_csb *csb, pvr_dev_addr_t addr, bool ret)
|
||||
void PVR_PER_ARCH(csb_emit_link)(struct pvr_csb *csb,
|
||||
pvr_dev_addr_t addr,
|
||||
bool ret)
|
||||
{
|
||||
pvr_csb_set_relocation_mark(csb);
|
||||
pvr_csb_emit_link_unmarked(csb, addr, ret);
|
||||
|
|
@ -304,7 +307,7 @@ void pvr_csb_emit_link(struct pvr_csb *csb, pvr_dev_addr_t addr, bool ret)
|
|||
* \param[in] csb Control Stream Builder object to add VDMCTRL_STREAM_RETURN to.
|
||||
* \return VK_SUCCESS on success, or error code otherwise.
|
||||
*/
|
||||
VkResult pvr_csb_emit_return(struct pvr_csb *csb)
|
||||
VkResult PVR_PER_ARCH(csb_emit_return)(struct pvr_csb *csb)
|
||||
{
|
||||
/* STREAM_RETURN is only supported by graphics control stream. */
|
||||
assert(csb->stream_type == PVR_CMD_STREAM_TYPE_GRAPHICS ||
|
||||
|
|
@ -327,7 +330,7 @@ VkResult pvr_csb_emit_return(struct pvr_csb *csb)
|
|||
* \param[in] csb Control Stream Builder object to terminate.
|
||||
* \return VK_SUCCESS on success, or error code otherwise.
|
||||
*/
|
||||
VkResult pvr_csb_emit_terminate(struct pvr_csb *csb)
|
||||
VkResult PVR_PER_ARCH(csb_emit_terminate)(struct pvr_csb *csb)
|
||||
{
|
||||
pvr_csb_set_relocation_mark(csb);
|
||||
|
||||
|
|
|
|||
|
|
@ -230,7 +230,7 @@ write_buffer_view(const struct pvr_descriptor_set *set,
|
|||
memcpy(desc_mapping, &buffer_view_state, sizeof(buffer_view_state));
|
||||
}
|
||||
|
||||
void pvr_descriptor_set_write_immutable_samplers(
|
||||
void PVR_PER_ARCH(descriptor_set_write_immutable_samplers)(
|
||||
struct pvr_descriptor_set_layout *layout,
|
||||
struct pvr_descriptor_set *set)
|
||||
{
|
||||
|
|
@ -247,11 +247,12 @@ void pvr_descriptor_set_write_immutable_samplers(
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_UpdateDescriptorSets(VkDevice _device,
|
||||
uint32_t descriptorWriteCount,
|
||||
const VkWriteDescriptorSet *pDescriptorWrites,
|
||||
uint32_t descriptorCopyCount,
|
||||
const VkCopyDescriptorSet *pDescriptorCopies)
|
||||
void PVR_PER_ARCH(UpdateDescriptorSets)(
|
||||
VkDevice _device,
|
||||
uint32_t descriptorWriteCount,
|
||||
const VkWriteDescriptorSet *pDescriptorWrites,
|
||||
uint32_t descriptorCopyCount,
|
||||
const VkCopyDescriptorSet *pDescriptorCopies)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
|
||||
|
|
@ -416,7 +417,7 @@ void pvr_UpdateDescriptorSets(VkDevice _device,
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_UpdateDescriptorSetWithTemplate(
|
||||
void PVR_PER_ARCH(UpdateDescriptorSetWithTemplate)(
|
||||
VkDevice _device,
|
||||
VkDescriptorSet descriptorSet,
|
||||
VkDescriptorUpdateTemplate descriptorUpdateTemplate,
|
||||
|
|
|
|||
|
|
@ -86,7 +86,7 @@ static uint32_t pvr_get_simultaneous_num_allocs(
|
|||
return 4;
|
||||
}
|
||||
|
||||
uint32_t pvr_calc_fscommon_size_and_tiles_in_flight(
|
||||
uint32_t PVR_PER_ARCH(calc_fscommon_size_and_tiles_in_flight)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_device_runtime_info *dev_runtime_info,
|
||||
uint32_t fs_common_size,
|
||||
|
|
@ -148,7 +148,7 @@ uint32_t pvr_calc_fscommon_size_and_tiles_in_flight(
|
|||
return MIN2(num_tile_in_flight, max_tiles_in_flight);
|
||||
}
|
||||
|
||||
VkResult pvr_pds_compute_shader_create_and_upload(
|
||||
VkResult PVR_PER_ARCH(pds_compute_shader_create_and_upload)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_pds_compute_shader_program *program,
|
||||
struct pvr_pds_upload *const pds_upload_out)
|
||||
|
|
@ -688,10 +688,10 @@ static void pvr_device_init_default_sampler_state(struct pvr_device *device)
|
|||
}
|
||||
}
|
||||
|
||||
VkResult pvr_create_device(struct pvr_physical_device *pdevice,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice)
|
||||
VkResult PVR_PER_ARCH(create_device)(struct pvr_physical_device *pdevice,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice)
|
||||
{
|
||||
uint32_t initial_free_list_size = PVR_GLOBAL_FREE_LIST_INITIAL_SIZE;
|
||||
struct pvr_instance *instance = pdevice->instance;
|
||||
|
|
@ -720,8 +720,11 @@ VkResult pvr_create_device(struct pvr_physical_device *pdevice,
|
|||
}
|
||||
|
||||
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
|
||||
&pvr_device_entrypoints,
|
||||
&PVR_PER_ARCH(device_entrypoints),
|
||||
true);
|
||||
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
|
||||
&pvr_device_entrypoints,
|
||||
false);
|
||||
|
||||
vk_device_dispatch_table_from_entrypoints(&dispatch_table,
|
||||
&wsi_device_entrypoints,
|
||||
|
|
@ -920,8 +923,8 @@ err_out:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_destroy_device(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(destroy_device)(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
if (!device)
|
||||
return;
|
||||
|
|
|
|||
|
|
@ -255,14 +255,15 @@ static const struct pvr_pbe_format pvr_pbe_format_table[] = {
|
|||
#undef FORMAT
|
||||
#undef FORMAT_DEPTH_STENCIL
|
||||
|
||||
const struct pvr_format *pvr_get_format_table(unsigned *num_formats)
|
||||
const struct pvr_format *PVR_PER_ARCH(get_format_table)(unsigned *num_formats)
|
||||
{
|
||||
assert(num_formats != NULL);
|
||||
*num_formats = ARRAY_SIZE(pvr_format_table);
|
||||
return pvr_format_table;
|
||||
}
|
||||
|
||||
static inline const struct pvr_format *pvr_get_format(VkFormat vk_format)
|
||||
static inline const struct pvr_format *
|
||||
PVR_PER_ARCH(get_format)(VkFormat vk_format)
|
||||
{
|
||||
if (vk_format < ARRAY_SIZE(pvr_format_table) &&
|
||||
pvr_format_table[vk_format].bind != 0) {
|
||||
|
|
@ -283,9 +284,9 @@ pvr_get_pbe_format(VkFormat vk_format)
|
|||
return &pvr_pbe_format_table[vk_format];
|
||||
}
|
||||
|
||||
uint32_t pvr_get_tex_format(VkFormat vk_format)
|
||||
uint32_t PVR_PER_ARCH(get_tex_format)(VkFormat vk_format)
|
||||
{
|
||||
const struct pvr_format *pvr_format = pvr_get_format(vk_format);
|
||||
const struct pvr_format *pvr_format = PVR_PER_ARCH(get_format)(vk_format);
|
||||
if (pvr_format) {
|
||||
return pvr_format->tex_format;
|
||||
}
|
||||
|
|
@ -293,10 +294,10 @@ uint32_t pvr_get_tex_format(VkFormat vk_format)
|
|||
return ROGUE_TEXSTATE_FORMAT_INVALID;
|
||||
}
|
||||
|
||||
uint32_t pvr_get_tex_format_aspect(VkFormat vk_format,
|
||||
VkImageAspectFlags aspect_mask)
|
||||
uint32_t PVR_PER_ARCH(get_tex_format_aspect)(VkFormat vk_format,
|
||||
VkImageAspectFlags aspect_mask)
|
||||
{
|
||||
const struct pvr_format *pvr_format = pvr_get_format(vk_format);
|
||||
const struct pvr_format *pvr_format = PVR_PER_ARCH(get_format)(vk_format);
|
||||
if (pvr_format) {
|
||||
if (aspect_mask == VK_IMAGE_ASPECT_DEPTH_BIT)
|
||||
return pvr_format->depth_tex_format;
|
||||
|
|
@ -325,8 +326,9 @@ uint32_t pvr_get_pbe_accum_format(VkFormat vk_format)
|
|||
return pvr_get_pbe_format(vk_format)->accum_format;
|
||||
}
|
||||
|
||||
bool pvr_format_is_pbe_downscalable(const struct pvr_device_info *dev_info,
|
||||
VkFormat vk_format)
|
||||
bool PVR_PER_ARCH(format_is_pbe_downscalable)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
VkFormat vk_format)
|
||||
{
|
||||
if (vk_format_is_int(vk_format)) {
|
||||
/* PBE downscale behavior for integer formats does not match Vulkan
|
||||
|
|
@ -336,7 +338,7 @@ bool pvr_format_is_pbe_downscalable(const struct pvr_device_info *dev_info,
|
|||
return false;
|
||||
}
|
||||
|
||||
switch (pvr_get_pbe_packmode(vk_format)) {
|
||||
switch (PVR_PER_ARCH(get_pbe_packmode)(vk_format)) {
|
||||
default:
|
||||
return true;
|
||||
case ROGUE_PBESTATE_PACKMODE_F16:
|
||||
|
|
|
|||
|
|
@ -23,7 +23,6 @@
|
|||
#include "pvr_hw_pass.h"
|
||||
#include "pvr_image.h"
|
||||
#include "pvr_pass.h"
|
||||
#include "pvr_physical_device.h"
|
||||
#include "pvr_rt_dataset.h"
|
||||
#include "pvr_spm.h"
|
||||
|
||||
|
|
@ -92,12 +91,12 @@ err_mutex_destroy:
|
|||
return false;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_render_state_setup(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
struct pvr_render_state *rstate,
|
||||
uint32_t render_count,
|
||||
const struct pvr_renderpass_hwsetup_render *renders)
|
||||
VkResult PVR_PER_ARCH(render_state_setup)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
struct pvr_render_state *rstate,
|
||||
uint32_t render_count,
|
||||
const struct pvr_renderpass_hwsetup_render *renders)
|
||||
{
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state_per_render;
|
||||
struct pvr_spm_eot_state *spm_eot_state_per_render;
|
||||
|
|
@ -211,10 +210,11 @@ pvr_render_pass_get_scratch_buffer_size(struct pvr_device *device,
|
|||
rstate->height);
|
||||
}
|
||||
|
||||
VkResult pvr_CreateFramebuffer(VkDevice _device,
|
||||
const VkFramebufferCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkFramebuffer *pFramebuffer)
|
||||
VkResult
|
||||
PVR_PER_ARCH(CreateFramebuffer)(VkDevice _device,
|
||||
const VkFramebufferCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkFramebuffer *pFramebuffer)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_render_pass, pass, pCreateInfo->renderPass);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -288,9 +288,9 @@ err_free_framebuffer:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroyFramebuffer(VkDevice _device,
|
||||
VkFramebuffer _fb,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroyFramebuffer)(VkDevice _device,
|
||||
VkFramebuffer _fb,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_framebuffer, framebuffer, _fb);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
|
|||
|
|
@ -2454,8 +2454,9 @@ pvr_count_uses_in_color_output_list(struct pvr_render_subpass *subpass,
|
|||
*resolve_output_count_out = resolve_count;
|
||||
}
|
||||
|
||||
void pvr_destroy_renderpass_hwsetup(const VkAllocationCallbacks *alloc,
|
||||
struct pvr_renderpass_hwsetup *hw_setup)
|
||||
void PVR_PER_ARCH(destroy_renderpass_hwsetup)(
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_renderpass_hwsetup *hw_setup)
|
||||
{
|
||||
for (uint32_t i = 0U; i < hw_setup->render_count; i++) {
|
||||
struct pvr_renderpass_hwsetup_render *hw_render = &hw_setup->renders[i];
|
||||
|
|
@ -2481,7 +2482,7 @@ void pvr_destroy_renderpass_hwsetup(const VkAllocationCallbacks *alloc,
|
|||
vk_free(alloc, hw_setup);
|
||||
}
|
||||
|
||||
VkResult pvr_create_renderpass_hwsetup(
|
||||
VkResult PVR_PER_ARCH(create_renderpass_hwsetup)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_render_pass *pass,
|
||||
|
|
@ -2719,7 +2720,7 @@ end_create_renderpass_hwsetup:
|
|||
pvr_free_render(ctx);
|
||||
|
||||
if (hw_setup) {
|
||||
pvr_destroy_renderpass_hwsetup(alloc, hw_setup);
|
||||
PVR_PER_ARCH(destroy_renderpass_hwsetup)(alloc, hw_setup);
|
||||
hw_setup = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -41,10 +41,10 @@ static void pvr_adjust_non_compressed_view(const struct pvr_image *image,
|
|||
info->base_level = 0;
|
||||
}
|
||||
|
||||
VkResult pvr_CreateImageView(VkDevice _device,
|
||||
const VkImageViewCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkImageView *pView)
|
||||
VkResult PVR_PER_ARCH(CreateImageView)(VkDevice _device,
|
||||
const VkImageViewCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkImageView *pView)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
struct pvr_texture_state_info info = { 0 };
|
||||
|
|
@ -182,9 +182,9 @@ err_vk_image_view_destroy:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroyImageView(VkDevice _device,
|
||||
VkImageView _iview,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroyImageView)(VkDevice _device,
|
||||
VkImageView _iview,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
VK_FROM_HANDLE(pvr_image_view, iview, _iview);
|
||||
|
|
@ -195,10 +195,11 @@ void pvr_DestroyImageView(VkDevice _device,
|
|||
vk_image_view_destroy(&device->vk, pAllocator, &iview->vk);
|
||||
}
|
||||
|
||||
VkResult pvr_CreateBufferView(VkDevice _device,
|
||||
const VkBufferViewCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkBufferView *pView)
|
||||
VkResult
|
||||
PVR_PER_ARCH(CreateBufferView)(VkDevice _device,
|
||||
const VkBufferViewCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkBufferView *pView)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_buffer, buffer, pCreateInfo->buffer);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -264,9 +265,9 @@ err_vk_buffer_view_destroy:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroyBufferView(VkDevice _device,
|
||||
VkBufferView bufferView,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroyBufferView)(VkDevice _device,
|
||||
VkBufferView bufferView,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_buffer_view, bview, bufferView);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
|
|||
|
|
@ -36,11 +36,12 @@
|
|||
#include "vk_format.h"
|
||||
#include "vk_object.h"
|
||||
|
||||
void pvr_pbe_get_src_format_and_gamma(VkFormat vk_format,
|
||||
enum pvr_pbe_gamma default_gamma,
|
||||
bool with_packed_usc_channel,
|
||||
uint32_t *const src_format_out,
|
||||
enum pvr_pbe_gamma *const gamma_out)
|
||||
void PVR_PER_ARCH(pbe_get_src_format_and_gamma)(
|
||||
VkFormat vk_format,
|
||||
enum pvr_pbe_gamma default_gamma,
|
||||
bool with_packed_usc_channel,
|
||||
uint32_t *const src_format_out,
|
||||
enum pvr_pbe_gamma *const gamma_out)
|
||||
{
|
||||
const struct util_format_description *desc =
|
||||
vk_format_description(vk_format);
|
||||
|
|
@ -79,7 +80,7 @@ void pvr_pbe_get_src_format_and_gamma(VkFormat vk_format,
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_pbe_pack_state(
|
||||
void PVR_PER_ARCH(pbe_pack_state)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_pbe_surf_params *surface_params,
|
||||
const struct pvr_pbe_render_params *render_params,
|
||||
|
|
@ -301,7 +302,7 @@ void pvr_pbe_pack_state(
|
|||
* total_tiles_in_flight so that CR_ISP_CTL can be fully packed in
|
||||
* pvr_render_job_ws_fragment_state_init().
|
||||
*/
|
||||
void pvr_setup_tiles_in_flight(
|
||||
void PVR_PER_ARCH(setup_tiles_in_flight)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_device_runtime_info *dev_runtime_info,
|
||||
uint32_t msaa_mode,
|
||||
|
|
|
|||
|
|
@ -212,10 +212,10 @@ static void pvr_compute_job_ws_submit_info_init(
|
|||
pvr_submit_info_flags_init(dev_info, sub_cmd, &submit_info->flags);
|
||||
}
|
||||
|
||||
VkResult pvr_compute_job_submit(struct pvr_compute_ctx *ctx,
|
||||
struct pvr_sub_cmd_compute *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync)
|
||||
VkResult PVR_PER_ARCH(compute_job_submit)(struct pvr_compute_ctx *ctx,
|
||||
struct pvr_sub_cmd_compute *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync)
|
||||
{
|
||||
struct pvr_winsys_compute_submit_info submit_info;
|
||||
struct pvr_device *device = ctx->device;
|
||||
|
|
|
|||
|
|
@ -21,6 +21,8 @@
|
|||
* SOFTWARE.
|
||||
*/
|
||||
|
||||
#include "pvr_job_context.h"
|
||||
|
||||
#include <assert.h>
|
||||
#include <stdbool.h>
|
||||
#include <stddef.h>
|
||||
|
|
@ -34,7 +36,6 @@
|
|||
#include "pvr_common.h"
|
||||
#include "pvr_csb.h"
|
||||
#include "pvr_device.h"
|
||||
#include "pvr_job_context.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_mrt.h"
|
||||
#include "pvr_pass.h"
|
||||
|
|
@ -852,9 +853,9 @@ static void pvr_render_ctx_ws_create_info_init(
|
|||
pvr_render_ctx_ws_static_state_init(ctx, &create_info->static_state);
|
||||
}
|
||||
|
||||
VkResult pvr_render_ctx_create(struct pvr_device *device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_render_ctx **const ctx_out)
|
||||
VkResult PVR_PER_ARCH(render_ctx_create)(struct pvr_device *device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_render_ctx **const ctx_out)
|
||||
{
|
||||
const uint64_t vdm_callstack_size =
|
||||
sizeof(uint64_t) * PVR_VDM_CALLSTACK_MAX_DEPTH;
|
||||
|
|
@ -919,7 +920,7 @@ err_vk_free_ctx:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_render_ctx_destroy(struct pvr_render_ctx *ctx)
|
||||
void PVR_PER_ARCH(render_ctx_destroy)(struct pvr_render_ctx *ctx)
|
||||
{
|
||||
struct pvr_device *device = ctx->device;
|
||||
|
||||
|
|
@ -1102,9 +1103,10 @@ static void pvr_compute_ctx_ws_create_info_init(
|
|||
&create_info->static_state);
|
||||
}
|
||||
|
||||
VkResult pvr_compute_ctx_create(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_compute_ctx **const ctx_out)
|
||||
VkResult
|
||||
PVR_PER_ARCH(compute_ctx_create)(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_compute_ctx **const ctx_out)
|
||||
{
|
||||
struct pvr_winsys_compute_ctx_create_info create_info;
|
||||
struct pvr_compute_ctx *ctx;
|
||||
|
|
@ -1188,7 +1190,7 @@ err_free_ctx:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_compute_ctx_destroy(struct pvr_compute_ctx *const ctx)
|
||||
void PVR_PER_ARCH(compute_ctx_destroy)(struct pvr_compute_ctx *const ctx)
|
||||
{
|
||||
struct pvr_device *device = ctx->device;
|
||||
|
||||
|
|
@ -1303,9 +1305,10 @@ static void pvr_transfer_ctx_shaders_fini(struct pvr_device *device,
|
|||
pvr_transfer_frag_store_fini(device, &ctx->frag_store);
|
||||
}
|
||||
|
||||
VkResult pvr_transfer_ctx_create(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_transfer_ctx **const ctx_out)
|
||||
VkResult
|
||||
PVR_PER_ARCH(transfer_ctx_create)(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_transfer_ctx **const ctx_out)
|
||||
{
|
||||
struct pvr_winsys_transfer_ctx_create_info create_info;
|
||||
struct pvr_transfer_ctx *ctx;
|
||||
|
|
@ -1382,7 +1385,7 @@ err_free_ctx:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_transfer_ctx_destroy(struct pvr_transfer_ctx *const ctx)
|
||||
void PVR_PER_ARCH(transfer_ctx_destroy)(struct pvr_transfer_ctx *const ctx)
|
||||
{
|
||||
struct pvr_device *device = ctx->device;
|
||||
|
||||
|
|
|
|||
|
|
@ -108,11 +108,11 @@ static inline void pvr_get_samples_in_xy(uint32_t samples,
|
|||
}
|
||||
}
|
||||
|
||||
void pvr_rt_mtile_info_init(const struct pvr_device_info *dev_info,
|
||||
struct pvr_rt_mtile_info *info,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples)
|
||||
void PVR_PER_ARCH(rt_mtile_info_init)(const struct pvr_device_info *dev_info,
|
||||
struct pvr_rt_mtile_info *info,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples)
|
||||
{
|
||||
uint32_t samples_in_x;
|
||||
uint32_t samples_in_y;
|
||||
|
|
@ -611,13 +611,13 @@ static void pvr_rt_dataset_ws_create_info_init(
|
|||
pvr_rt_get_isp_region_size(device, mtile_info);
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_render_target_dataset_create(struct pvr_device *device,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples,
|
||||
uint32_t layers,
|
||||
struct pvr_rt_dataset **const rt_dataset_out)
|
||||
VkResult PVR_PER_ARCH(render_target_dataset_create)(
|
||||
struct pvr_device *device,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples,
|
||||
uint32_t layers,
|
||||
struct pvr_rt_dataset **const rt_dataset_out)
|
||||
{
|
||||
struct pvr_device_runtime_info *runtime_info =
|
||||
&device->pdevice->dev_runtime_info;
|
||||
|
|
@ -1452,12 +1452,12 @@ static void pvr_render_job_ws_submit_info_init(
|
|||
&submit_info->fragment_pr);
|
||||
}
|
||||
|
||||
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
||||
struct pvr_render_job *job,
|
||||
struct vk_sync *wait_geom,
|
||||
struct vk_sync *wait_frag,
|
||||
struct vk_sync *signal_sync_geom,
|
||||
struct vk_sync *signal_sync_frag)
|
||||
VkResult PVR_PER_ARCH(render_job_submit)(struct pvr_render_ctx *ctx,
|
||||
struct pvr_render_job *job,
|
||||
struct vk_sync *wait_geom,
|
||||
struct vk_sync *wait_frag,
|
||||
struct vk_sync *signal_sync_geom,
|
||||
struct vk_sync *signal_sync_frag)
|
||||
{
|
||||
struct pvr_rt_dataset *rt_dataset =
|
||||
job->view_state.rt_datasets[job->view_state.view_index];
|
||||
|
|
|
|||
|
|
@ -6012,10 +6012,10 @@ static VkResult pvr_queue_transfer(struct pvr_transfer_ctx *ctx,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_transfer_job_submit(struct pvr_transfer_ctx *ctx,
|
||||
struct pvr_sub_cmd_transfer *sub_cmd,
|
||||
struct vk_sync *wait_sync,
|
||||
struct vk_sync *signal_sync)
|
||||
VkResult PVR_PER_ARCH(transfer_job_submit)(struct pvr_transfer_ctx *ctx,
|
||||
struct pvr_sub_cmd_transfer *sub_cmd,
|
||||
struct vk_sync *wait_sync,
|
||||
struct vk_sync *signal_sync)
|
||||
{
|
||||
list_for_each_entry_safe (struct pvr_transfer_cmd,
|
||||
transfer_cmd,
|
||||
|
|
|
|||
|
|
@ -79,7 +79,7 @@ static int32_t pvr_mrt_alloc_from_buffer(const struct pvr_device_info *dev_info,
|
|||
return -1;
|
||||
}
|
||||
|
||||
void pvr_init_mrt_desc(VkFormat format, struct usc_mrt_desc *desc)
|
||||
void PVR_PER_ARCH(init_mrt_desc)(VkFormat format, struct usc_mrt_desc *desc)
|
||||
{
|
||||
uint32_t pixel_size_in_chunks;
|
||||
uint32_t pixel_size_in_bits;
|
||||
|
|
@ -187,11 +187,11 @@ static VkResult pvr_alloc_mrt(const struct pvr_device_info *dev_info,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_init_usc_mrt_setup(struct pvr_device *device,
|
||||
uint32_t attachment_count,
|
||||
const VkFormat attachment_formats[attachment_count],
|
||||
struct usc_mrt_setup *setup)
|
||||
VkResult PVR_PER_ARCH(init_usc_mrt_setup)(
|
||||
struct pvr_device *device,
|
||||
uint32_t attachment_count,
|
||||
const VkFormat attachment_formats[attachment_count],
|
||||
struct usc_mrt_setup *setup)
|
||||
{
|
||||
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
|
||||
struct pvr_mrt_alloc_ctx alloc = { 0 };
|
||||
|
|
@ -230,8 +230,8 @@ fail:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_destroy_mrt_setup(const struct pvr_device *device,
|
||||
struct usc_mrt_setup *setup)
|
||||
void PVR_PER_ARCH(destroy_mrt_setup)(const struct pvr_device *device,
|
||||
struct usc_mrt_setup *setup)
|
||||
{
|
||||
if (!setup)
|
||||
return;
|
||||
|
|
@ -328,9 +328,9 @@ static void pvr_load_op_destroy(struct pvr_device *device,
|
|||
vk_free2(&device->vk.alloc, allocator, load_op);
|
||||
}
|
||||
|
||||
void pvr_mrt_load_op_state_cleanup(const struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state *state)
|
||||
void PVR_PER_ARCH(mrt_load_op_state_cleanup)(const struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state *state)
|
||||
{
|
||||
if (!state)
|
||||
return;
|
||||
|
|
@ -441,9 +441,10 @@ pvr_mrt_add_missing_output_register_write(struct usc_mrt_setup *setup,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_mrt_load_ops_setup(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state **load_op_state)
|
||||
VkResult
|
||||
PVR_PER_ARCH(mrt_load_ops_setup)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state **load_op_state)
|
||||
{
|
||||
const struct pvr_cmd_buffer_state *state = &cmd_buffer->state;
|
||||
const struct pvr_dynamic_render_info *dr_info =
|
||||
|
|
@ -476,7 +477,7 @@ VkResult pvr_mrt_load_ops_setup(struct pvr_cmd_buffer *cmd_buffer,
|
|||
return result;
|
||||
}
|
||||
|
||||
VkResult pvr_pds_unitex_state_program_create_and_upload(
|
||||
VkResult PVR_PER_ARCH(pds_unitex_state_program_create_and_upload)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
uint32_t texture_kicks,
|
||||
|
|
@ -591,9 +592,10 @@ static VkResult pvr_pds_fragment_program_create_and_upload(
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_load_op_shader_generate(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
struct pvr_load_op *load_op)
|
||||
VkResult
|
||||
PVR_PER_ARCH(load_op_shader_generate)(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
struct pvr_load_op *load_op)
|
||||
{
|
||||
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
|
||||
const uint32_t cache_line_size = pvr_get_slc_cache_line_size(dev_info);
|
||||
|
|
|
|||
|
|
@ -750,10 +750,11 @@ err_return:
|
|||
return result;
|
||||
}
|
||||
|
||||
VkResult pvr_CreateRenderPass2(VkDevice _device,
|
||||
const VkRenderPassCreateInfo2 *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkRenderPass *pRenderPass)
|
||||
VkResult
|
||||
PVR_PER_ARCH(CreateRenderPass2)(VkDevice _device,
|
||||
const VkRenderPassCreateInfo2 *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkRenderPass *pRenderPass)
|
||||
{
|
||||
struct pvr_render_pass_attachment *attachments;
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -1058,9 +1059,9 @@ err_free_pass:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroyRenderPass(VkDevice _device,
|
||||
VkRenderPass _pass,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroyRenderPass)(VkDevice _device,
|
||||
VkRenderPass _pass,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
VK_FROM_HANDLE(pvr_render_pass, pass, _pass);
|
||||
|
|
@ -1074,14 +1075,14 @@ void pvr_DestroyRenderPass(VkDevice _device,
|
|||
allocator,
|
||||
pass,
|
||||
pass->hw_setup->render_count);
|
||||
pvr_destroy_renderpass_hwsetup(allocator, pass->hw_setup);
|
||||
PVR_PER_ARCH(destroy_renderpass_hwsetup)(allocator, pass->hw_setup);
|
||||
vk_object_base_finish(&pass->base);
|
||||
vk_free2(&device->vk.alloc, pAllocator, pass);
|
||||
}
|
||||
|
||||
void pvr_GetRenderAreaGranularity(VkDevice _device,
|
||||
VkRenderPass renderPass,
|
||||
VkExtent2D *pGranularity)
|
||||
void PVR_PER_ARCH(GetRenderAreaGranularity)(VkDevice _device,
|
||||
VkRenderPass renderPass,
|
||||
VkExtent2D *pGranularity)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@
|
|||
#include "nir/nir_lower_blend.h"
|
||||
#include "pco/pco.h"
|
||||
#include "pco/pco_data.h"
|
||||
|
||||
#include "pvr_bo.h"
|
||||
#include "pvr_csb.h"
|
||||
#include "pvr_csb_enum_helpers.h"
|
||||
|
|
@ -45,12 +46,14 @@
|
|||
#include "pvr_device.h"
|
||||
#include "pvr_entrypoints.h"
|
||||
#include "pvr_hw_pass.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_pass.h"
|
||||
#include "pvr_pds.h"
|
||||
#include "pvr_physical_device.h"
|
||||
#include "pvr_robustness.h"
|
||||
#include "pvr_types.h"
|
||||
#include "pvr_usc.h"
|
||||
|
||||
#include "util/log.h"
|
||||
#include "util/macros.h"
|
||||
#include "util/ralloc.h"
|
||||
|
|
@ -1145,13 +1148,13 @@ static void pvr_compute_pipeline_destroy(
|
|||
vk_free2(&device->vk.alloc, allocator, compute_pipeline);
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_CreateComputePipelines(VkDevice _device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t createInfoCount,
|
||||
const VkComputePipelineCreateInfo *pCreateInfos,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkPipeline *pPipelines)
|
||||
VkResult PVR_PER_ARCH(CreateComputePipelines)(
|
||||
VkDevice _device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t createInfoCount,
|
||||
const VkComputePipelineCreateInfo *pCreateInfos,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkPipeline *pPipelines)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_pipeline_cache, cache, pipelineCache);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -3179,13 +3182,13 @@ pvr_graphics_pipeline_create(struct pvr_device *device,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_CreateGraphicsPipelines(VkDevice _device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t createInfoCount,
|
||||
const VkGraphicsPipelineCreateInfo *pCreateInfos,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkPipeline *pPipelines)
|
||||
VkResult PVR_PER_ARCH(CreateGraphicsPipelines)(
|
||||
VkDevice _device,
|
||||
VkPipelineCache pipelineCache,
|
||||
uint32_t createInfoCount,
|
||||
const VkGraphicsPipelineCreateInfo *pCreateInfos,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkPipeline *pPipelines)
|
||||
{
|
||||
VK_FROM_HANDLE(vk_pipeline_cache, cache, pipelineCache);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -3211,9 +3214,9 @@ pvr_CreateGraphicsPipelines(VkDevice _device,
|
|||
Other functions
|
||||
*****************************************************************************/
|
||||
|
||||
void pvr_DestroyPipeline(VkDevice _device,
|
||||
VkPipeline _pipeline,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroyPipeline)(VkDevice _device,
|
||||
VkPipeline _pipeline,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_pipeline, pipeline, _pipeline);
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
|
@ -346,7 +346,8 @@ pvr_destroy_compute_query_program(struct pvr_device *device,
|
|||
pvr_bo_suballoc_free(program->usc_bo);
|
||||
}
|
||||
|
||||
VkResult pvr_device_create_compute_query_programs(struct pvr_device *device)
|
||||
VkResult
|
||||
PVR_PER_ARCH(device_create_compute_query_programs)(struct pvr_device *device)
|
||||
{
|
||||
VkResult result;
|
||||
|
||||
|
|
@ -388,7 +389,8 @@ err_destroy_availability_query_program:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_device_destroy_compute_query_programs(struct pvr_device *device)
|
||||
void PVR_PER_ARCH(device_destroy_compute_query_programs)(
|
||||
struct pvr_device *device)
|
||||
{
|
||||
pvr_destroy_compute_query_program(device, &device->availability_shader);
|
||||
pvr_destroy_compute_query_program(device, &device->copy_results_shader);
|
||||
|
|
@ -396,8 +398,9 @@ void pvr_device_destroy_compute_query_programs(struct pvr_device *device)
|
|||
}
|
||||
|
||||
/* TODO: Split this function into per program type functions. */
|
||||
VkResult pvr_add_query_program(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const struct pvr_query_info *query_info)
|
||||
VkResult
|
||||
PVR_PER_ARCH(add_query_program)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const struct pvr_query_info *query_info)
|
||||
{
|
||||
struct pvr_device *device = cmd_buffer->device;
|
||||
const struct pvr_compute_query_shader *query_prog;
|
||||
|
|
|
|||
|
|
@ -46,6 +46,7 @@
|
|||
#include "pvr_job_render.h"
|
||||
#include "pvr_job_transfer.h"
|
||||
#include "pvr_limits.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_physical_device.h"
|
||||
#include "pvr_pipeline.h"
|
||||
|
||||
|
|
@ -136,8 +137,8 @@ err_vk_queue_finish:
|
|||
return result;
|
||||
}
|
||||
|
||||
VkResult pvr_queues_create(struct pvr_device *device,
|
||||
const VkDeviceCreateInfo *pCreateInfo)
|
||||
VkResult PVR_PER_ARCH(queues_create)(struct pvr_device *device,
|
||||
const VkDeviceCreateInfo *pCreateInfo)
|
||||
{
|
||||
VkResult result;
|
||||
|
||||
|
|
@ -169,7 +170,7 @@ VkResult pvr_queues_create(struct pvr_device *device,
|
|||
return VK_SUCCESS;
|
||||
|
||||
err_queues_finish:
|
||||
pvr_queues_destroy(device);
|
||||
PVR_PER_ARCH(queues_destroy)(device);
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
@ -193,7 +194,7 @@ static void pvr_queue_finish(struct pvr_queue *queue)
|
|||
vk_queue_finish(&queue->vk);
|
||||
}
|
||||
|
||||
void pvr_queues_destroy(struct pvr_device *device)
|
||||
void PVR_PER_ARCH(queues_destroy)(struct pvr_device *device)
|
||||
{
|
||||
for (uint32_t q_idx = 0; q_idx < device->queue_count; q_idx++)
|
||||
pvr_queue_finish(&device->queues[q_idx]);
|
||||
|
|
@ -1014,10 +1015,10 @@ static VkResult pvr_driver_queue_submit(struct vk_queue *queue,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult pvr_QueueBindSparse(VkQueue _queue,
|
||||
uint32_t bindInfoCount,
|
||||
const VkBindSparseInfo *pBindInfo,
|
||||
VkFence fence)
|
||||
VkResult PVR_PER_ARCH(QueueBindSparse)(VkQueue _queue,
|
||||
uint32_t bindInfoCount,
|
||||
const VkBindSparseInfo *pBindInfo,
|
||||
VkFence fence)
|
||||
{
|
||||
return VK_SUCCESS;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -54,10 +54,10 @@ pvr_sampler_get_hw_addr_mode_from_vk(VkSamplerAddressMode addr_mode)
|
|||
}
|
||||
}
|
||||
|
||||
VkResult pvr_CreateSampler(VkDevice _device,
|
||||
const VkSamplerCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkSampler *pSampler)
|
||||
VkResult PVR_PER_ARCH(CreateSampler)(VkDevice _device,
|
||||
const VkSamplerCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkSampler *pSampler)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
struct pvr_sampler *sampler;
|
||||
|
|
@ -219,9 +219,9 @@ err_out:
|
|||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroySampler(VkDevice _device,
|
||||
VkSampler _sampler,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
void PVR_PER_ARCH(DestroySampler)(VkDevice _device,
|
||||
VkSampler _sampler,
|
||||
const VkAllocationCallbacks *pAllocator)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
VK_FROM_HANDLE(pvr_sampler, sampler, _sampler);
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@ struct pvr_spm_scratch_buffer {
|
|||
uint64_t size;
|
||||
};
|
||||
|
||||
uint64_t pvr_spm_scratch_buffer_calc_required_size(
|
||||
uint64_t PVR_PER_ARCH(spm_scratch_buffer_calc_required_size)(
|
||||
const struct pvr_renderpass_hwsetup_render *renders,
|
||||
uint32_t render_count,
|
||||
uint32_t sample_count,
|
||||
|
|
@ -244,7 +244,7 @@ VkResult pvr_device_init_spm_load_state(struct pvr_device *device)
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
void pvr_device_finish_spm_load_state(struct pvr_device *device)
|
||||
void PVR_PER_ARCH(device_finish_spm_load_state)(struct pvr_device *device)
|
||||
{
|
||||
pvr_bo_suballoc_free(device->spm_load_state.pds_programs);
|
||||
pvr_bo_suballoc_free(device->spm_load_state.usc_programs);
|
||||
|
|
@ -452,11 +452,11 @@ static VkResult pvr_pds_pixel_event_program_create_and_upload(
|
|||
* This sets up an EOT program to store the render pass'es on-chip and
|
||||
* off-chip tile data to the SPM scratch buffer on the EOT event.
|
||||
*/
|
||||
VkResult
|
||||
pvr_spm_init_eot_state(struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render)
|
||||
VkResult PVR_PER_ARCH(spm_init_eot_state)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render)
|
||||
{
|
||||
const VkExtent2D framebuffer_size = {
|
||||
.width = rstate->width,
|
||||
|
|
@ -746,11 +746,11 @@ static VkResult pvr_pds_bgnd_program_create_and_upload(
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
VkResult
|
||||
pvr_spm_init_bgobj_state(struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render)
|
||||
VkResult PVR_PER_ARCH(spm_init_bgobj_state)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render)
|
||||
{
|
||||
const VkExtent2D framebuffer_size = {
|
||||
.width = rstate->width,
|
||||
|
|
|
|||
|
|
@ -151,9 +151,9 @@ static uint32_t setup_pck_info(VkFormat vk_format)
|
|||
return pck_info;
|
||||
}
|
||||
|
||||
VkResult pvr_pack_tex_state(struct pvr_device *device,
|
||||
const struct pvr_texture_state_info *info,
|
||||
struct pvr_image_descriptor *state)
|
||||
VkResult PVR_PER_ARCH(pack_tex_state)(struct pvr_device *device,
|
||||
const struct pvr_texture_state_info *info,
|
||||
struct pvr_image_descriptor *state)
|
||||
{
|
||||
const struct pvr_device_info *dev_info = &device->pdevice->dev_info;
|
||||
enum pvr_memlayout mem_layout;
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "util/bitset.h"
|
||||
|
||||
#include "pvr_csb.h"
|
||||
#include "pvr_macros.h"
|
||||
|
||||
#define PVR_BORDER_COLOR_TABLE_NR_ENTRIES \
|
||||
(ROGUE_TEXSTATE_SAMPLER_WORD0_BORDERCOLOR_INDEX_MAX_SIZE + 1)
|
||||
|
|
@ -60,18 +61,29 @@ struct pvr_border_color_table {
|
|||
struct pvr_bo *table;
|
||||
};
|
||||
|
||||
VkResult pvr_border_color_table_init(struct pvr_device *const device);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
void pvr_border_color_table_finish(struct pvr_device *device);
|
||||
VkResult PVR_PER_ARCH(border_color_table_init)(struct pvr_device *const device);
|
||||
# define pvr_border_color_table_init PVR_PER_ARCH(border_color_table_init)
|
||||
|
||||
VkResult
|
||||
pvr_border_color_table_get_or_create_entry(struct pvr_device *device,
|
||||
const struct pvr_sampler *sampler,
|
||||
struct pvr_border_color_table *table,
|
||||
uint32_t *index_out);
|
||||
void PVR_PER_ARCH(border_color_table_finish)(struct pvr_device *device);
|
||||
# define pvr_border_color_table_finish PVR_PER_ARCH(border_color_table_finish)
|
||||
|
||||
void pvr_border_color_table_release_entry(struct pvr_border_color_table *table,
|
||||
uint32_t index);
|
||||
VkResult PVR_PER_ARCH(border_color_table_get_or_create_entry)(
|
||||
struct pvr_device *device,
|
||||
const struct pvr_sampler *sampler,
|
||||
struct pvr_border_color_table *table,
|
||||
uint32_t *index_out);
|
||||
# define pvr_border_color_table_get_or_create_entry \
|
||||
PVR_PER_ARCH(border_color_table_get_or_create_entry)
|
||||
|
||||
void PVR_PER_ARCH(border_color_table_release_entry)(
|
||||
struct pvr_border_color_table *table,
|
||||
uint32_t index);
|
||||
# define pvr_border_color_table_release_entry \
|
||||
PVR_PER_ARCH(border_color_table_release_entry)
|
||||
|
||||
#endif
|
||||
|
||||
static inline bool pvr_border_color_table_is_index_valid(
|
||||
const struct pvr_border_color_table *const table,
|
||||
|
|
|
|||
|
|
@ -593,64 +593,159 @@ static inline bool pvr_sub_cmd_gfx_requires_split_submit(
|
|||
} \
|
||||
} while (0)
|
||||
|
||||
VkResult pvr_cmd_buffer_add_transfer_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_transfer_cmd *transfer_cmd);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult pvr_cmd_buffer_alloc_mem(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_winsys_heap *heap,
|
||||
uint64_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out);
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_add_transfer_cmd)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_transfer_cmd *transfer_cmd);
|
||||
|
||||
# define pvr_cmd_buffer_add_transfer_cmd \
|
||||
PVR_PER_ARCH(cmd_buffer_add_transfer_cmd)
|
||||
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_alloc_mem)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_winsys_heap *heap,
|
||||
uint64_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out);
|
||||
|
||||
# define pvr_cmd_buffer_alloc_mem PVR_PER_ARCH(cmd_buffer_alloc_mem)
|
||||
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_upload_general)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const void *const data,
|
||||
const size_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out);
|
||||
|
||||
# define pvr_cmd_buffer_upload_general PVR_PER_ARCH(cmd_buffer_upload_general)
|
||||
|
||||
VkResult PVR_PER_ARCH(cmd_buffer_upload_pds)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const uint32_t *data,
|
||||
uint32_t data_size_dwords,
|
||||
uint32_t data_alignment,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size_dwords,
|
||||
uint32_t code_alignment,
|
||||
uint64_t min_alignment,
|
||||
struct pvr_pds_upload *const pds_upload_out);
|
||||
|
||||
# define pvr_cmd_buffer_upload_pds PVR_PER_ARCH(cmd_buffer_upload_pds)
|
||||
|
||||
VkResult
|
||||
pvr_cmd_buffer_upload_general(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const void *const data,
|
||||
const size_t size,
|
||||
struct pvr_suballoc_bo **const pvr_bo_out);
|
||||
VkResult pvr_cmd_buffer_upload_pds(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
const uint32_t *data,
|
||||
uint32_t data_size_dwords,
|
||||
uint32_t data_alignment,
|
||||
const uint32_t *code,
|
||||
uint32_t code_size_dwords,
|
||||
uint32_t code_alignment,
|
||||
uint64_t min_alignment,
|
||||
struct pvr_pds_upload *const pds_upload_out);
|
||||
PVR_PER_ARCH(cmd_buffer_start_sub_cmd)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
enum pvr_sub_cmd_type type);
|
||||
|
||||
VkResult pvr_cmd_buffer_start_sub_cmd(struct pvr_cmd_buffer *cmd_buffer,
|
||||
enum pvr_sub_cmd_type type);
|
||||
VkResult pvr_cmd_buffer_end_sub_cmd(struct pvr_cmd_buffer *cmd_buffer);
|
||||
# define pvr_cmd_buffer_start_sub_cmd PVR_PER_ARCH(cmd_buffer_start_sub_cmd)
|
||||
|
||||
void pvr_compute_generate_fence(struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
bool deallocate_shareds);
|
||||
void pvr_compute_update_shared_private(
|
||||
VkResult
|
||||
PVR_PER_ARCH(cmd_buffer_end_sub_cmd)(struct pvr_cmd_buffer *cmd_buffer);
|
||||
|
||||
# define pvr_cmd_buffer_end_sub_cmd PVR_PER_ARCH(cmd_buffer_end_sub_cmd)
|
||||
|
||||
void PVR_PER_ARCH(compute_generate_fence)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
bool deallocate_shareds);
|
||||
|
||||
# define pvr_compute_generate_fence PVR_PER_ARCH(compute_generate_fence)
|
||||
|
||||
void PVR_PER_ARCH(compute_update_shared_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline);
|
||||
|
||||
void pvr_compute_update_kernel_private(
|
||||
# define pvr_compute_update_shared_private \
|
||||
PVR_PER_ARCH(compute_update_shared_private)
|
||||
|
||||
void PVR_PER_ARCH(compute_update_kernel_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline,
|
||||
const uint32_t global_workgroup_size[static const PVR_WORKGROUP_DIMENSIONS]);
|
||||
|
||||
VkResult pvr_add_query_program(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const struct pvr_query_info *query_info);
|
||||
# define pvr_compute_update_kernel_private \
|
||||
PVR_PER_ARCH(compute_update_kernel_private)
|
||||
|
||||
void pvr_reset_graphics_dirty_state(struct pvr_cmd_buffer *const cmd_buffer,
|
||||
bool start_geom);
|
||||
VkResult
|
||||
PVR_PER_ARCH(add_query_program)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const struct pvr_query_info *query_info);
|
||||
|
||||
void pvr_calculate_vertex_cam_size(const struct pvr_device_info *dev_info,
|
||||
const uint32_t vs_output_size,
|
||||
const bool raster_enable,
|
||||
uint32_t *const cam_size_out,
|
||||
uint32_t *const vs_max_instances_out);
|
||||
# define pvr_add_query_program PVR_PER_ARCH(add_query_program)
|
||||
|
||||
void PVR_PER_ARCH(reset_graphics_dirty_state)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
bool start_geom);
|
||||
|
||||
# define pvr_reset_graphics_dirty_state \
|
||||
PVR_PER_ARCH(reset_graphics_dirty_state)
|
||||
|
||||
void PVR_PER_ARCH(calculate_vertex_cam_size)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const uint32_t vs_output_size,
|
||||
const bool raster_enable,
|
||||
uint32_t *const cam_size_out,
|
||||
uint32_t *const vs_max_instances_out);
|
||||
|
||||
# define pvr_cmd_buffer_end_sub_cmd PVR_PER_ARCH(cmd_buffer_end_sub_cmd)
|
||||
|
||||
void PVR_PER_ARCH(compute_generate_fence)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
bool deallocate_shareds);
|
||||
|
||||
# define pvr_compute_generate_fence PVR_PER_ARCH(compute_generate_fence)
|
||||
|
||||
void PVR_PER_ARCH(compute_update_shared_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline);
|
||||
|
||||
# define pvr_compute_update_shared_private \
|
||||
PVR_PER_ARCH(compute_update_shared_private)
|
||||
|
||||
void PVR_PER_ARCH(compute_update_kernel_private)(
|
||||
struct pvr_cmd_buffer *cmd_buffer,
|
||||
struct pvr_sub_cmd_compute *const sub_cmd,
|
||||
struct pvr_private_compute_pipeline *pipeline,
|
||||
const uint32_t global_workgroup_size[static const PVR_WORKGROUP_DIMENSIONS]);
|
||||
|
||||
# define pvr_compute_update_kernel_private \
|
||||
PVR_PER_ARCH(compute_update_kernel_private)
|
||||
|
||||
VkResult
|
||||
PVR_PER_ARCH(add_query_program)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const struct pvr_query_info *query_info);
|
||||
|
||||
# define pvr_add_query_program PVR_PER_ARCH(add_query_program)
|
||||
|
||||
void PVR_PER_ARCH(reset_graphics_dirty_state)(
|
||||
struct pvr_cmd_buffer *const cmd_buffer,
|
||||
bool start_geom);
|
||||
|
||||
# define pvr_reset_graphics_dirty_state \
|
||||
PVR_PER_ARCH(reset_graphics_dirty_state)
|
||||
|
||||
void PVR_PER_ARCH(calculate_vertex_cam_size)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const uint32_t vs_output_size,
|
||||
const bool raster_enable,
|
||||
uint32_t *const cam_size_out,
|
||||
uint32_t *const vs_max_instances_out);
|
||||
|
||||
# define pvr_calculate_vertex_cam_size PVR_PER_ARCH(calculate_vertex_cam_size)
|
||||
|
||||
const struct pvr_renderpass_hwsetup_subpass *
|
||||
pvr_get_hw_subpass(const struct pvr_render_pass *pass, const uint32_t subpass);
|
||||
PVR_PER_ARCH(get_hw_subpass)(const struct pvr_render_pass *pass,
|
||||
const uint32_t subpass);
|
||||
|
||||
struct pvr_renderpass_hwsetup_render *
|
||||
pvr_pass_info_get_hw_render(const struct pvr_render_pass_info *render_pass_info,
|
||||
uint32_t idx);
|
||||
# define pvr_get_hw_subpass PVR_PER_ARCH(get_hw_subpass)
|
||||
|
||||
struct pvr_renderpass_hwsetup_render *PVR_PER_ARCH(pass_info_get_hw_render)(
|
||||
const struct pvr_render_pass_info *render_pass_info,
|
||||
uint32_t idx);
|
||||
|
||||
# define pvr_pass_info_get_hw_render PVR_PER_ARCH(pass_info_get_hw_render)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_CMD_BUFFER_H */
|
||||
|
|
|
|||
|
|
@ -36,8 +36,10 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "pvr_bo.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_types.h"
|
||||
#include "pvr_winsys.h"
|
||||
|
||||
#include "util/list.h"
|
||||
#include "util/macros.h"
|
||||
#include "util/u_dynarray.h"
|
||||
|
|
@ -246,11 +248,33 @@ void pvr_csb_init(struct pvr_device *device,
|
|||
struct pvr_csb *csb);
|
||||
void pvr_csb_finish(struct pvr_csb *csb);
|
||||
VkResult pvr_csb_bake(struct pvr_csb *csb, struct list_head *bo_list_out);
|
||||
void *pvr_csb_alloc_dwords(struct pvr_csb *csb, uint32_t num_dwords);
|
||||
VkResult pvr_csb_copy(struct pvr_csb *csb_dst, struct pvr_csb *csb_src);
|
||||
void pvr_csb_emit_link(struct pvr_csb *csb, pvr_dev_addr_t addr, bool ret);
|
||||
VkResult pvr_csb_emit_return(struct pvr_csb *csb);
|
||||
VkResult pvr_csb_emit_terminate(struct pvr_csb *csb);
|
||||
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
void *PVR_PER_ARCH(csb_alloc_dwords)(struct pvr_csb *csb, uint32_t num_dwords);
|
||||
|
||||
# define pvr_csb_alloc_dwords PVR_PER_ARCH(csb_alloc_dwords)
|
||||
|
||||
VkResult PVR_PER_ARCH(csb_copy)(struct pvr_csb *csb_dst,
|
||||
struct pvr_csb *csb_src);
|
||||
|
||||
# define pvr_csb_copy PVR_PER_ARCH(csb_copy)
|
||||
|
||||
void PVR_PER_ARCH(csb_emit_link)(struct pvr_csb *csb,
|
||||
pvr_dev_addr_t addr,
|
||||
bool ret);
|
||||
|
||||
# define pvr_csb_emit_link PVR_PER_ARCH(csb_emit_link)
|
||||
|
||||
VkResult PVR_PER_ARCH(csb_emit_return)(struct pvr_csb *csb);
|
||||
|
||||
# define pvr_csb_emit_return PVR_PER_ARCH(csb_emit_return)
|
||||
|
||||
VkResult PVR_PER_ARCH(csb_emit_terminate)(struct pvr_csb *csb);
|
||||
|
||||
# define pvr_csb_emit_terminate PVR_PER_ARCH(csb_emit_terminate)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#ifdef PVR_BUILD_ARCH_ROGUE
|
||||
void pvr_csb_dump(const struct pvr_csb *csb,
|
||||
|
|
|
|||
|
|
@ -393,6 +393,13 @@ VkResult pvr_ResetDescriptorPool(VkDevice _device,
|
|||
return VK_SUCCESS;
|
||||
}
|
||||
|
||||
#define PER_ARCH_FUNCS(arch) \
|
||||
void pvr_##arch##_descriptor_set_write_immutable_samplers( \
|
||||
struct pvr_descriptor_set_layout *layout, \
|
||||
struct pvr_descriptor_set *set)
|
||||
|
||||
PER_ARCH_FUNCS(rogue);
|
||||
|
||||
static VkResult
|
||||
pvr_descriptor_set_create(struct pvr_device *device,
|
||||
struct pvr_descriptor_pool *pool,
|
||||
|
|
@ -430,7 +437,8 @@ pvr_descriptor_set_create(struct pvr_device *device,
|
|||
list_addtail(&set->link, &pool->desc_sets);
|
||||
|
||||
/* Setup immutable samplers. */
|
||||
pvr_descriptor_set_write_immutable_samplers(layout, set);
|
||||
enum pvr_device_arch arch = device->pdevice->dev_info.ident.arch;
|
||||
PVR_ARCH_DISPATCH(descriptor_set_write_immutable_samplers, arch, layout, set);
|
||||
|
||||
*descriptor_set_out = set;
|
||||
|
||||
|
|
|
|||
|
|
@ -20,6 +20,7 @@
|
|||
#include "vk_descriptor_set_layout.h"
|
||||
|
||||
#include "pvr_common.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_types.h"
|
||||
|
||||
struct pvr_descriptor_set_layout_binding {
|
||||
|
|
@ -124,8 +125,12 @@ vk_to_pvr_descriptor_set_layout(struct vk_descriptor_set_layout *layout)
|
|||
return container_of(layout, struct pvr_descriptor_set_layout, vk);
|
||||
}
|
||||
|
||||
void pvr_descriptor_set_write_immutable_samplers(
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
void PVR_PER_ARCH(descriptor_set_write_immutable_samplers)(
|
||||
struct pvr_descriptor_set_layout *layout,
|
||||
struct pvr_descriptor_set *set);
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PVR_DESCRIPTOR_SET_H */
|
||||
|
|
|
|||
|
|
@ -165,20 +165,6 @@ static inline struct pvr_device *vk_to_pvr_device(struct vk_device *device)
|
|||
return container_of(device, struct pvr_device, vk);
|
||||
}
|
||||
|
||||
VkResult pvr_create_device(struct pvr_physical_device *pdevice,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice);
|
||||
|
||||
void pvr_destroy_device(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
|
||||
uint32_t pvr_calc_fscommon_size_and_tiles_in_flight(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_device_runtime_info *dev_runtime_info,
|
||||
uint32_t fs_common_size,
|
||||
uint32_t min_tiles_in_flight);
|
||||
|
||||
VkResult pvr_device_tile_buffer_ensure_cap(struct pvr_device *device,
|
||||
uint32_t capacity);
|
||||
|
||||
|
|
@ -188,11 +174,6 @@ static inline void pvr_device_free_tile_buffer_state(struct pvr_device *device)
|
|||
pvr_bo_free(device, device->tile_buffer_state.buffers[i]);
|
||||
}
|
||||
|
||||
VkResult pvr_pds_compute_shader_create_and_upload(
|
||||
struct pvr_device *device,
|
||||
struct pvr_pds_compute_shader_program *program,
|
||||
struct pvr_pds_upload *const pds_upload_out);
|
||||
|
||||
VkResult pvr_bind_memory(struct pvr_device *device,
|
||||
struct pvr_device_memory *mem,
|
||||
VkDeviceSize offset,
|
||||
|
|
@ -232,4 +213,33 @@ void pvr_rstate_entry_remove(struct pvr_device *device,
|
|||
void pvr_render_targets_fini(struct pvr_render_target *render_targets,
|
||||
uint32_t render_targets_count);
|
||||
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(create_device)(struct pvr_physical_device *pdevice,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice);
|
||||
|
||||
void PVR_PER_ARCH(destroy_device)(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator);
|
||||
|
||||
uint32_t PVR_PER_ARCH(calc_fscommon_size_and_tiles_in_flight)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_device_runtime_info *dev_runtime_info,
|
||||
uint32_t fs_common_size,
|
||||
uint32_t min_tiles_in_flight);
|
||||
|
||||
# define pvr_calc_fscommon_size_and_tiles_in_flight \
|
||||
PVR_PER_ARCH(calc_fscommon_size_and_tiles_in_flight)
|
||||
|
||||
VkResult PVR_PER_ARCH(pds_compute_shader_create_and_upload)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_pds_compute_shader_program *program,
|
||||
struct pvr_pds_upload *const pds_upload_out);
|
||||
|
||||
# define pvr_pds_compute_shader_create_and_upload \
|
||||
PVR_PER_ARCH(pds_compute_shader_create_and_upload)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_DEVICE_H */
|
||||
|
|
|
|||
|
|
@ -57,7 +57,8 @@ uint32_t pvr_get_pbe_accum_format_size_in_bytes(VkFormat vk_format)
|
|||
enum pvr_pbe_accum_format pbe_accum_format;
|
||||
uint32_t nr_components;
|
||||
|
||||
pbe_accum_format = pvr_get_pbe_accum_format(vk_format);
|
||||
/* TODO: Decouple from arch-specific function */
|
||||
pbe_accum_format = pvr_rogue_get_pbe_accum_format(vk_format);
|
||||
nr_components = vk_format_get_nr_components(vk_format);
|
||||
|
||||
switch (pbe_accum_format) {
|
||||
|
|
@ -153,8 +154,9 @@ void pvr_get_hw_clear_color(
|
|||
int8_t i8[PVR_CLEAR_COLOR_ARRAY_SIZE * 4];
|
||||
} packed_val = { 0 };
|
||||
|
||||
/* TODO: Decouple from arch-specific function */
|
||||
const enum pvr_pbe_accum_format pbe_accum_format =
|
||||
pvr_get_pbe_accum_format(vk_format);
|
||||
pvr_rogue_get_pbe_accum_format(vk_format);
|
||||
|
||||
static_assert(ARRAY_SIZE(value.uint32) == PVR_CLEAR_COLOR_ARRAY_SIZE,
|
||||
"Size mismatch. Unknown/unhandled extra values.");
|
||||
|
|
@ -684,7 +686,8 @@ VkResult pvr_GetPhysicalDeviceImageFormatProperties2(
|
|||
case VK_STRUCTURE_TYPE_IMAGE_FORMAT_LIST_CREATE_INFO:
|
||||
break;
|
||||
case VK_STRUCTURE_TYPE_IMAGE_STENCIL_USAGE_CREATE_INFO:
|
||||
/* Nothing to do here, it's handled in pvr_get_image_format_properties
|
||||
/* Nothing to do here, it's handled in
|
||||
* PVR_PER_ARCH(get_image_format_properties)
|
||||
*/
|
||||
break;
|
||||
default:
|
||||
|
|
|
|||
|
|
@ -28,6 +28,9 @@
|
|||
#include <stdint.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_physical_device.h"
|
||||
|
||||
#include "util/format/u_formats.h"
|
||||
#include "vk_format.h"
|
||||
|
||||
|
|
@ -223,21 +226,13 @@ struct pvr_format {
|
|||
uint32_t bind;
|
||||
};
|
||||
|
||||
const struct pvr_format *pvr_get_format_table(unsigned *num_formats);
|
||||
|
||||
struct util_format_description;
|
||||
|
||||
const uint8_t *
|
||||
pvr_get_format_swizzle_for_tpu(const struct util_format_description *desc);
|
||||
const uint8_t *pvr_get_format_swizzle(VkFormat vk_format);
|
||||
uint32_t pvr_get_tex_format(VkFormat vk_format);
|
||||
uint32_t pvr_get_tex_format_aspect(VkFormat vk_format,
|
||||
VkImageAspectFlags aspect_mask);
|
||||
uint32_t pvr_get_pbe_packmode(VkFormat vk_format);
|
||||
uint32_t pvr_get_pbe_accum_format(VkFormat vk_format);
|
||||
uint32_t pvr_rogue_get_pbe_accum_format(VkFormat vk_format);
|
||||
uint32_t pvr_get_pbe_accum_format_size_in_bytes(VkFormat vk_format);
|
||||
bool pvr_format_is_pbe_downscalable(const struct pvr_device_info *dev_info,
|
||||
VkFormat vk_format);
|
||||
|
||||
void pvr_get_hw_clear_color(VkFormat vk_format,
|
||||
VkClearColorValue value,
|
||||
uint32_t packed_out[static const 4]);
|
||||
|
|
@ -308,4 +303,30 @@ pvr_vk_format_get_common_color_channel_count(VkFormat src_format,
|
|||
return count;
|
||||
}
|
||||
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
const struct pvr_format *PVR_PER_ARCH(get_format_table)(unsigned *num_formats);
|
||||
# define pvr_get_format_table PVR_PER_ARCH(get_format_table)
|
||||
|
||||
uint32_t PVR_PER_ARCH(get_tex_format)(VkFormat vk_format);
|
||||
# define pvr_get_tex_format PVR_PER_ARCH(get_tex_format)
|
||||
|
||||
uint32_t PVR_PER_ARCH(get_tex_format_aspect)(VkFormat vk_format,
|
||||
VkImageAspectFlags aspect_mask);
|
||||
# define pvr_get_tex_format_aspect PVR_PER_ARCH(get_tex_format_aspect)
|
||||
|
||||
uint32_t PVR_PER_ARCH(get_pbe_packmode)(VkFormat vk_format);
|
||||
# define pvr_get_pbe_packmode PVR_PER_ARCH(get_pbe_packmode)
|
||||
|
||||
uint32_t PVR_PER_ARCH(get_pbe_accum_format)(VkFormat vk_format);
|
||||
# define pvr_get_pbe_accum_format PVR_PER_ARCH(get_pbe_accum_format)
|
||||
|
||||
bool PVR_PER_ARCH(format_is_pbe_downscalable)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
VkFormat vk_format);
|
||||
# define pvr_format_is_pbe_downscalable \
|
||||
PVR_PER_ARCH(format_is_pbe_downscalable)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_FORMATS_H */
|
||||
|
|
|
|||
|
|
@ -68,12 +68,18 @@ struct pvr_framebuffer {
|
|||
struct pvr_device;
|
||||
struct pvr_renderpass_hwsetup_render;
|
||||
|
||||
VkResult
|
||||
pvr_render_state_setup(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
struct pvr_render_state *rstate,
|
||||
uint32_t render_count,
|
||||
const struct pvr_renderpass_hwsetup_render *renders);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(render_state_setup)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
struct pvr_render_state *rstate,
|
||||
uint32_t render_count,
|
||||
const struct pvr_renderpass_hwsetup_render *renders);
|
||||
|
||||
# define pvr_render_state_setup PVR_PER_ARCH(render_state_setup)
|
||||
|
||||
#endif
|
||||
|
||||
void pvr_render_state_cleanup(struct pvr_device *device,
|
||||
const struct pvr_render_state *rstate);
|
||||
|
|
|
|||
|
|
@ -28,6 +28,8 @@
|
|||
#include <stdint.h>
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "pvr_macros.h"
|
||||
|
||||
struct pvr_device;
|
||||
struct pvr_render_pass;
|
||||
|
||||
|
|
@ -218,14 +220,24 @@ struct pvr_renderpass_hwsetup {
|
|||
bool *surface_allocate;
|
||||
};
|
||||
|
||||
VkResult pvr_create_renderpass_hwsetup(
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(create_renderpass_hwsetup)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_render_pass *pass,
|
||||
bool disable_merge,
|
||||
struct pvr_renderpass_hwsetup **const hw_setup_out);
|
||||
|
||||
void pvr_destroy_renderpass_hwsetup(const VkAllocationCallbacks *alloc,
|
||||
struct pvr_renderpass_hwsetup *hw_setup);
|
||||
# define pvr_create_renderpass_hwsetup PVR_PER_ARCH(create_renderpass_hwsetup)
|
||||
|
||||
void PVR_PER_ARCH(destroy_renderpass_hwsetup)(
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_renderpass_hwsetup *hw_setup);
|
||||
|
||||
# define pvr_destroy_renderpass_hwsetup \
|
||||
PVR_PER_ARCH(destroy_renderpass_hwsetup)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PVR_HW_PASS_H */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,9 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "hwdef/rogue_hw_defs.h"
|
||||
|
||||
#include "pvr_csb_enum_helpers.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_types.h"
|
||||
|
||||
enum pvr_pbe_gamma {
|
||||
|
|
@ -110,23 +112,31 @@ struct pvr_pbe_render_params {
|
|||
uint32_t mrt_index;
|
||||
};
|
||||
|
||||
void pvr_pbe_pack_state(
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
void PVR_PER_ARCH(pbe_pack_state)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_pbe_surf_params *surface_params,
|
||||
const struct pvr_pbe_render_params *render_params,
|
||||
uint32_t pbe_cs_words[static const ROGUE_NUM_PBESTATE_STATE_WORDS],
|
||||
uint64_t pbe_reg_words[static const ROGUE_NUM_PBESTATE_REG_WORDS]);
|
||||
|
||||
# define pvr_pbe_pack_state PVR_PER_ARCH(pbe_pack_state)
|
||||
|
||||
/* Helper to calculate pvr_pbe_surf_params::gamma and
|
||||
* pvr_pbe_surf_params::source_format.
|
||||
*/
|
||||
void pvr_pbe_get_src_format_and_gamma(VkFormat vk_format,
|
||||
enum pvr_pbe_gamma default_gamma,
|
||||
bool with_packed_usc_channel,
|
||||
uint32_t *const src_format_out,
|
||||
enum pvr_pbe_gamma *const gamma_out);
|
||||
void PVR_PER_ARCH(pbe_get_src_format_and_gamma)(
|
||||
VkFormat vk_format,
|
||||
enum pvr_pbe_gamma default_gamma,
|
||||
bool with_packed_usc_channel,
|
||||
uint32_t *const src_format_out,
|
||||
enum pvr_pbe_gamma *const gamma_out);
|
||||
|
||||
void pvr_setup_tiles_in_flight(
|
||||
# define pvr_pbe_get_src_format_and_gamma \
|
||||
PVR_PER_ARCH(pbe_get_src_format_and_gamma)
|
||||
|
||||
void PVR_PER_ARCH(setup_tiles_in_flight)(
|
||||
const struct pvr_device_info *dev_info,
|
||||
const struct pvr_device_runtime_info *dev_runtime_info,
|
||||
uint32_t msaa_mode,
|
||||
|
|
@ -136,4 +146,8 @@ void pvr_setup_tiles_in_flight(
|
|||
uint32_t *const isp_ctl_out,
|
||||
uint32_t *const pixel_ctl_out);
|
||||
|
||||
# define pvr_setup_tiles_in_flight PVR_PER_ARCH(setup_tiles_in_flight)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_JOB_COMMON_H */
|
||||
|
|
|
|||
|
|
@ -31,9 +31,11 @@ struct pvr_compute_ctx;
|
|||
struct pvr_sub_cmd_compute;
|
||||
struct vk_sync;
|
||||
|
||||
VkResult pvr_compute_job_submit(struct pvr_compute_ctx *ctx,
|
||||
struct pvr_sub_cmd_compute *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync);
|
||||
VkResult PVR_PER_ARCH(compute_job_submit)(struct pvr_compute_ctx *ctx,
|
||||
struct pvr_sub_cmd_compute *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync);
|
||||
|
||||
#define pvr_compute_job_submit PVR_PER_ARCH(compute_job_submit)
|
||||
|
||||
#endif /* PVR_JOB_COMPUTE_H */
|
||||
|
|
|
|||
|
|
@ -25,6 +25,8 @@
|
|||
#define PVR_JOB_CONTEXT_H
|
||||
|
||||
#include "pvr_common.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_pds.h"
|
||||
#include "pvr_transfer_frag_store.h"
|
||||
#include "pvr_types.h"
|
||||
#include "pvr_usc.h"
|
||||
|
|
@ -157,19 +159,36 @@ struct pvr_transfer_ctx {
|
|||
Function prototypes
|
||||
******************************************************************************/
|
||||
|
||||
VkResult pvr_render_ctx_create(struct pvr_device *device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_render_ctx **const ctx_out);
|
||||
void pvr_render_ctx_destroy(struct pvr_render_ctx *ctx);
|
||||
VkResult PVR_PER_ARCH(render_ctx_create)(struct pvr_device *device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_render_ctx **const ctx_out);
|
||||
|
||||
VkResult pvr_compute_ctx_create(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_compute_ctx **const ctx_out);
|
||||
void pvr_compute_ctx_destroy(struct pvr_compute_ctx *ctx);
|
||||
#define pvr_render_ctx_create PVR_PER_ARCH(render_ctx_create)
|
||||
|
||||
VkResult pvr_transfer_ctx_create(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_transfer_ctx **const ctx_out);
|
||||
void pvr_transfer_ctx_destroy(struct pvr_transfer_ctx *const ctx);
|
||||
void PVR_PER_ARCH(render_ctx_destroy)(struct pvr_render_ctx *ctx);
|
||||
|
||||
#define pvr_render_ctx_destroy PVR_PER_ARCH(render_ctx_destroy)
|
||||
|
||||
VkResult
|
||||
PVR_PER_ARCH(compute_ctx_create)(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_compute_ctx **const ctx_out);
|
||||
|
||||
#define pvr_compute_ctx_create PVR_PER_ARCH(compute_ctx_create)
|
||||
|
||||
void PVR_PER_ARCH(compute_ctx_destroy)(struct pvr_compute_ctx *ctx);
|
||||
|
||||
#define pvr_compute_ctx_destroy PVR_PER_ARCH(compute_ctx_destroy)
|
||||
|
||||
VkResult
|
||||
PVR_PER_ARCH(transfer_ctx_create)(struct pvr_device *const device,
|
||||
enum pvr_winsys_ctx_priority priority,
|
||||
struct pvr_transfer_ctx **const ctx_out);
|
||||
|
||||
#define pvr_transfer_ctx_create PVR_PER_ARCH(transfer_ctx_create)
|
||||
|
||||
void PVR_PER_ARCH(transfer_ctx_destroy)(struct pvr_transfer_ctx *const ctx);
|
||||
|
||||
#define pvr_transfer_ctx_destroy PVR_PER_ARCH(transfer_ctx_destroy)
|
||||
|
||||
#endif /* PVR_JOB_CONTEXT_H */
|
||||
|
|
|
|||
|
|
@ -165,25 +165,36 @@ struct pvr_render_job {
|
|||
} view_state;
|
||||
};
|
||||
|
||||
void pvr_rt_mtile_info_init(const struct pvr_device_info *dev_info,
|
||||
struct pvr_rt_mtile_info *info,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult
|
||||
pvr_render_target_dataset_create(struct pvr_device *device,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples,
|
||||
uint32_t layers,
|
||||
struct pvr_rt_dataset **const rt_dataset_out);
|
||||
void PVR_PER_ARCH(rt_mtile_info_init)(const struct pvr_device_info *dev_info,
|
||||
struct pvr_rt_mtile_info *info,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples);
|
||||
|
||||
VkResult pvr_render_job_submit(struct pvr_render_ctx *ctx,
|
||||
struct pvr_render_job *job,
|
||||
struct vk_sync *wait_geom,
|
||||
struct vk_sync *wait_frag,
|
||||
struct vk_sync *signal_sync_geom,
|
||||
struct vk_sync *signal_sync_frag);
|
||||
# define pvr_rt_mtile_info_init PVR_PER_ARCH(rt_mtile_info_init)
|
||||
|
||||
VkResult PVR_PER_ARCH(render_target_dataset_create)(
|
||||
struct pvr_device *device,
|
||||
uint32_t width,
|
||||
uint32_t height,
|
||||
uint32_t samples,
|
||||
uint32_t layers,
|
||||
struct pvr_rt_dataset **const rt_dataset_out);
|
||||
|
||||
# define pvr_render_target_dataset_create \
|
||||
PVR_PER_ARCH(render_target_dataset_create)
|
||||
|
||||
VkResult PVR_PER_ARCH(render_job_submit)(struct pvr_render_ctx *ctx,
|
||||
struct pvr_render_job *job,
|
||||
struct vk_sync *wait_geom,
|
||||
struct vk_sync *wait_frag,
|
||||
struct vk_sync *signal_sync_geom,
|
||||
struct vk_sync *signal_sync_frag);
|
||||
|
||||
# define pvr_render_job_submit PVR_PER_ARCH(render_job_submit)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PVR_JOB_RENDER_H */
|
||||
|
|
|
|||
|
|
@ -43,9 +43,11 @@ struct vk_sync;
|
|||
/** Valid if doing a DS merge with depth + stencil to depth + stencil. */
|
||||
#define PVR_TRANSFER_CMD_FLAGS_PICKD 0x00000400U
|
||||
|
||||
VkResult pvr_transfer_job_submit(struct pvr_transfer_ctx *ctx,
|
||||
struct pvr_sub_cmd_transfer *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync);
|
||||
VkResult PVR_PER_ARCH(transfer_job_submit)(struct pvr_transfer_ctx *ctx,
|
||||
struct pvr_sub_cmd_transfer *sub_cmd,
|
||||
struct vk_sync *wait,
|
||||
struct vk_sync *signal_sync);
|
||||
|
||||
#define pvr_transfer_job_submit PVR_PER_ARCH(transfer_job_submit)
|
||||
|
||||
#endif /* PVR_JOB_TRANSFER_H */
|
||||
|
|
|
|||
|
|
@ -60,4 +60,32 @@
|
|||
# define pvr_assert(x)
|
||||
#endif
|
||||
|
||||
#define PVR_ARCH_NAME(name, arch) pvr_##arch##_##name
|
||||
|
||||
#define PVR_ARCH_DISPATCH(name, arch, ...) \
|
||||
do { \
|
||||
switch (arch) { \
|
||||
case PVR_DEVICE_ARCH_ROGUE: \
|
||||
PVR_ARCH_NAME(name, rogue)(__VA_ARGS__); \
|
||||
break; \
|
||||
default: \
|
||||
UNREACHABLE("Unsupported architecture"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#define PVR_ARCH_DISPATCH_RET(name, arch, ret, ...) \
|
||||
do { \
|
||||
switch (arch) { \
|
||||
case PVR_DEVICE_ARCH_ROGUE: \
|
||||
ret = PVR_ARCH_NAME(name, rogue)(__VA_ARGS__); \
|
||||
break; \
|
||||
default: \
|
||||
UNREACHABLE("Unsupported architecture"); \
|
||||
} \
|
||||
} while (0)
|
||||
|
||||
#if defined(PVR_BUILD_ARCH_ROGUE)
|
||||
# define PVR_PER_ARCH(name) PVR_ARCH_NAME(name, rogue)
|
||||
#endif
|
||||
|
||||
#endif /* PVR_MACROS_H */
|
||||
|
|
|
|||
|
|
@ -9,11 +9,15 @@
|
|||
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "pvr_common.h"
|
||||
#include "pvr_macros.h"
|
||||
|
||||
struct pvr_device;
|
||||
struct pvr_dynamic_render_info;
|
||||
struct pvr_cmd_buffer;
|
||||
|
||||
/* Specifies the location of render target writes. */
|
||||
enum usc_mrt_resource_type {
|
||||
|
|
@ -92,17 +96,6 @@ struct usc_mrt_setup {
|
|||
uint32_t hash;
|
||||
};
|
||||
|
||||
VkResult
|
||||
pvr_init_usc_mrt_setup(struct pvr_device *device,
|
||||
uint32_t attachment_count,
|
||||
const VkFormat attachment_formats[attachment_count],
|
||||
struct usc_mrt_setup *setup);
|
||||
|
||||
void pvr_destroy_mrt_setup(const struct pvr_device *device,
|
||||
struct usc_mrt_setup *setup);
|
||||
|
||||
void pvr_init_mrt_desc(VkFormat format, struct usc_mrt_desc *desc);
|
||||
|
||||
/* Max render targets for the clears loads state in load op.
|
||||
* To account for resolve attachments, double the color attachments.
|
||||
*/
|
||||
|
|
@ -150,6 +143,15 @@ struct pvr_load_op {
|
|||
uint32_t view_count;
|
||||
};
|
||||
|
||||
struct pvr_load_op_state {
|
||||
uint32_t load_op_count;
|
||||
|
||||
/* Load op array indexed by HW render view (not by the index in the view
|
||||
* mask).
|
||||
*/
|
||||
struct pvr_load_op *load_ops;
|
||||
};
|
||||
|
||||
#define CHECK_MASK_SIZE(_struct_type, _field_name, _nr_bits) \
|
||||
static_assert(sizeof(((struct _struct_type *)NULL)->_field_name) * 8 >= \
|
||||
_nr_bits, \
|
||||
|
|
@ -167,34 +169,54 @@ CHECK_MASK_SIZE(pvr_load_op,
|
|||
|
||||
#undef CHECK_MASK_SIZE
|
||||
|
||||
VkResult pvr_pds_unitex_state_program_create_and_upload(
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(init_usc_mrt_setup)(
|
||||
struct pvr_device *device,
|
||||
uint32_t attachment_count,
|
||||
const VkFormat attachment_formats[attachment_count],
|
||||
struct usc_mrt_setup *setup);
|
||||
|
||||
# define pvr_init_usc_mrt_setup PVR_PER_ARCH(init_usc_mrt_setup)
|
||||
|
||||
void PVR_PER_ARCH(destroy_mrt_setup)(const struct pvr_device *device,
|
||||
struct usc_mrt_setup *setup);
|
||||
|
||||
# define pvr_destroy_mrt_setup PVR_PER_ARCH(destroy_mrt_setup)
|
||||
|
||||
void PVR_PER_ARCH(init_mrt_desc)(VkFormat format, struct usc_mrt_desc *desc);
|
||||
|
||||
# define pvr_init_mrt_desc PVR_PER_ARCH(init_mrt_desc)
|
||||
|
||||
VkResult PVR_PER_ARCH(pds_unitex_state_program_create_and_upload)(
|
||||
struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
uint32_t texture_kicks,
|
||||
uint32_t uniform_kicks,
|
||||
struct pvr_pds_upload *const pds_upload_out);
|
||||
|
||||
VkResult pvr_load_op_shader_generate(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
struct pvr_load_op *load_op);
|
||||
# define pvr_pds_unitex_state_program_create_and_upload \
|
||||
PVR_PER_ARCH(pds_unitex_state_program_create_and_upload)
|
||||
|
||||
struct pvr_load_op_state {
|
||||
uint32_t load_op_count;
|
||||
VkResult
|
||||
PVR_PER_ARCH(load_op_shader_generate)(struct pvr_device *device,
|
||||
const VkAllocationCallbacks *allocator,
|
||||
struct pvr_load_op *load_op);
|
||||
|
||||
/* Load op array indexed by HW render view (not by the index in the view
|
||||
* mask).
|
||||
*/
|
||||
struct pvr_load_op *load_ops;
|
||||
};
|
||||
# define pvr_load_op_shader_generate PVR_PER_ARCH(load_op_shader_generate)
|
||||
|
||||
struct pvr_dynamic_render_info;
|
||||
struct pvr_cmd_buffer;
|
||||
VkResult PVR_PER_ARCH(mrt_load_ops_setup)(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state **state);
|
||||
|
||||
VkResult pvr_mrt_load_ops_setup(struct pvr_cmd_buffer *cmd_buffer,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state **state);
|
||||
void pvr_mrt_load_op_state_cleanup(const struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state *state);
|
||||
# define pvr_mrt_load_ops_setup PVR_PER_ARCH(mrt_load_ops_setup)
|
||||
|
||||
#endif
|
||||
void PVR_PER_ARCH(mrt_load_op_state_cleanup)(const struct pvr_device *device,
|
||||
const VkAllocationCallbacks *alloc,
|
||||
struct pvr_load_op_state *state);
|
||||
|
||||
# define pvr_mrt_load_op_state_cleanup PVR_PER_ARCH(mrt_load_op_state_cleanup)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_MRT_H */
|
||||
|
|
|
|||
|
|
@ -31,6 +31,7 @@
|
|||
#include "pvr_dump_info.h"
|
||||
#include "pvr_entrypoints.h"
|
||||
#include "pvr_instance.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_winsys.h"
|
||||
#include "pvr_wsi.h"
|
||||
|
||||
|
|
@ -893,12 +894,6 @@ pvr_get_cache_uuid(const struct pvr_physical_device *const pdevice,
|
|||
_mesa_sha1_final(&sha1_ctx, uuid_out);
|
||||
}
|
||||
|
||||
static void
|
||||
pvr_physical_device_setup_formats(struct pvr_physical_device *const pdevice)
|
||||
{
|
||||
pdevice->formats = pvr_get_format_table(&pdevice->num_formats);
|
||||
}
|
||||
|
||||
static void
|
||||
pvr_physical_device_setup_uuids(struct pvr_physical_device *const pdevice)
|
||||
{
|
||||
|
|
@ -965,6 +960,9 @@ static uint64_t pvr_compute_heap_size(void)
|
|||
return MAX2(available_ram, PVR_MAX_MEMORY_ALLOCATION_SIZE);
|
||||
}
|
||||
|
||||
static void
|
||||
pvr_physical_device_setup_formats(struct pvr_physical_device *const pdevice);
|
||||
|
||||
VkResult pvr_physical_device_init(struct pvr_physical_device *pdevice,
|
||||
struct pvr_instance *instance,
|
||||
drmDevicePtr drm_render_device,
|
||||
|
|
@ -1186,13 +1184,38 @@ void pvr_GetPhysicalDeviceMemoryProperties2(
|
|||
}
|
||||
}
|
||||
|
||||
#define PER_ARCH_FUNCS(arch) \
|
||||
VkResult pvr_##arch##_create_device( \
|
||||
struct pvr_physical_device *physical_device, \
|
||||
const VkDeviceCreateInfo *pCreateInfo, \
|
||||
const VkAllocationCallbacks *pAllocator, \
|
||||
VkDevice *pDevice); \
|
||||
\
|
||||
void pvr_##arch##_destroy_device(struct pvr_device *device, \
|
||||
const VkAllocationCallbacks *pAllocator); \
|
||||
\
|
||||
const struct pvr_format *pvr_##arch##_get_format_table(unsigned *num_formats)
|
||||
|
||||
PER_ARCH_FUNCS(rogue);
|
||||
|
||||
VkResult pvr_CreateDevice(VkPhysicalDevice physicalDevice,
|
||||
const VkDeviceCreateInfo *pCreateInfo,
|
||||
const VkAllocationCallbacks *pAllocator,
|
||||
VkDevice *pDevice)
|
||||
{
|
||||
VK_FROM_HANDLE(pvr_physical_device, pdevice, physicalDevice);
|
||||
return pvr_create_device(pdevice, pCreateInfo, pAllocator, pDevice);
|
||||
|
||||
enum pvr_device_arch arch = pdevice->dev_info.ident.arch;
|
||||
VkResult result = VK_ERROR_INITIALIZATION_FAILED;
|
||||
PVR_ARCH_DISPATCH_RET(create_device,
|
||||
arch,
|
||||
result,
|
||||
pdevice,
|
||||
pCreateInfo,
|
||||
pAllocator,
|
||||
pDevice);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
void pvr_DestroyDevice(VkDevice _device,
|
||||
|
|
@ -1200,7 +1223,18 @@ void pvr_DestroyDevice(VkDevice _device,
|
|||
{
|
||||
VK_FROM_HANDLE(pvr_device, device, _device);
|
||||
|
||||
pvr_destroy_device(device, pAllocator);
|
||||
enum pvr_device_arch arch = device->pdevice->dev_info.ident.arch;
|
||||
PVR_ARCH_DISPATCH(destroy_device, arch, device, pAllocator);
|
||||
}
|
||||
|
||||
static void
|
||||
pvr_physical_device_setup_formats(struct pvr_physical_device *const pdevice)
|
||||
{
|
||||
enum pvr_device_arch arch = pdevice->dev_info.ident.arch;
|
||||
PVR_ARCH_DISPATCH_RET(get_format_table,
|
||||
arch,
|
||||
pdevice->formats,
|
||||
&pdevice->num_formats);
|
||||
}
|
||||
|
||||
/* Leave this at the very end, to avoid leakage of HW-defs here */
|
||||
|
|
|
|||
|
|
@ -73,7 +73,20 @@ VK_DEFINE_NONDISP_HANDLE_CASTS(pvr_query_pool,
|
|||
VkQueryPool,
|
||||
VK_OBJECT_TYPE_QUERY_POOL)
|
||||
|
||||
VkResult pvr_device_create_compute_query_programs(struct pvr_device *device);
|
||||
void pvr_device_destroy_compute_query_programs(struct pvr_device *device);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(device_create_compute_query_programs)(
|
||||
struct pvr_device *device);
|
||||
|
||||
# define pvr_device_create_compute_query_programs \
|
||||
PVR_PER_ARCH(device_create_compute_query_programs)
|
||||
|
||||
void PVR_PER_ARCH(device_destroy_compute_query_programs)(
|
||||
struct pvr_device *device);
|
||||
|
||||
# define pvr_device_destroy_compute_query_programs \
|
||||
PVR_PER_ARCH(device_destroy_compute_query_programs)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PVR_QUERY_H*/
|
||||
|
|
|
|||
|
|
@ -14,6 +14,7 @@
|
|||
#ifndef PVR_QUEUE_H
|
||||
#define PVR_QUEUE_H
|
||||
|
||||
#include "pvr_macros.h"
|
||||
#include "vk_queue.h"
|
||||
|
||||
#include "pvr_common.h"
|
||||
|
|
@ -41,8 +42,14 @@ struct pvr_queue {
|
|||
|
||||
VK_DEFINE_HANDLE_CASTS(pvr_queue, vk.base, VkQueue, VK_OBJECT_TYPE_QUEUE)
|
||||
|
||||
VkResult pvr_queues_create(struct pvr_device *device,
|
||||
const VkDeviceCreateInfo *pCreateInfo);
|
||||
void pvr_queues_destroy(struct pvr_device *device);
|
||||
#ifdef PVR_PER_ARCH
|
||||
VkResult PVR_PER_ARCH(queues_create)(struct pvr_device *device,
|
||||
const VkDeviceCreateInfo *pCreateInfo);
|
||||
# define pvr_queues_create PVR_PER_ARCH(queues_create)
|
||||
|
||||
void PVR_PER_ARCH(queues_destroy)(struct pvr_device *device);
|
||||
# define pvr_queues_destroy PVR_PER_ARCH(queues_destroy)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_QUEUE_H */
|
||||
|
|
|
|||
|
|
@ -44,6 +44,7 @@
|
|||
|
||||
#include "hwdef/rogue_hw_defs.h"
|
||||
#include "pvr_limits.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "util/simple_mtx.h"
|
||||
|
||||
struct pvr_bo;
|
||||
|
|
@ -85,6 +86,21 @@ struct pvr_spm_bgobj_state {
|
|||
void pvr_spm_init_scratch_buffer_store(struct pvr_device *device);
|
||||
void pvr_spm_finish_scratch_buffer_store(struct pvr_device *device);
|
||||
|
||||
VkResult pvr_spm_scratch_buffer_get_buffer(
|
||||
struct pvr_device *device,
|
||||
uint64_t size,
|
||||
struct pvr_spm_scratch_buffer **const buffer_out);
|
||||
void pvr_spm_scratch_buffer_release(struct pvr_device *device,
|
||||
struct pvr_spm_scratch_buffer *buffer);
|
||||
|
||||
void pvr_spm_finish_eot_state(struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state);
|
||||
|
||||
void pvr_spm_finish_bgobj_state(struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state);
|
||||
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
/* A scratch buffer is required in various situations:
|
||||
*
|
||||
* - An MSAA workload which needs saving to a larger buffer than the output for
|
||||
|
|
@ -93,39 +109,43 @@ void pvr_spm_finish_scratch_buffer_store(struct pvr_device *device);
|
|||
* VK_ATTACHMENT_STORE_OP_NONE, not currently supported) or lazily allocated
|
||||
* attachments with no backing.
|
||||
*/
|
||||
uint64_t pvr_spm_scratch_buffer_calc_required_size(
|
||||
uint64_t PVR_PER_ARCH(spm_scratch_buffer_calc_required_size)(
|
||||
const struct pvr_renderpass_hwsetup_render *renders,
|
||||
uint32_t render_count,
|
||||
uint32_t sample_count,
|
||||
uint32_t framebuffer_width,
|
||||
uint32_t framebuffer_height);
|
||||
VkResult pvr_spm_scratch_buffer_get_buffer(
|
||||
struct pvr_device *device,
|
||||
uint64_t size,
|
||||
struct pvr_spm_scratch_buffer **const buffer_out);
|
||||
void pvr_spm_scratch_buffer_release(struct pvr_device *device,
|
||||
struct pvr_spm_scratch_buffer *buffer);
|
||||
|
||||
# define pvr_spm_scratch_buffer_calc_required_size \
|
||||
PVR_PER_ARCH(spm_scratch_buffer_calc_required_size)
|
||||
|
||||
/* The SPM load programs are needed for the SPM background object load op. */
|
||||
VkResult pvr_device_init_spm_load_state(struct pvr_device *device);
|
||||
void pvr_device_finish_spm_load_state(struct pvr_device *device);
|
||||
VkResult PVR_PER_ARCH(device_init_spm_load_state)(struct pvr_device *device);
|
||||
|
||||
VkResult
|
||||
pvr_spm_init_eot_state(struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render);
|
||||
# define pvr_device_init_spm_load_state \
|
||||
PVR_PER_ARCH(device_init_spm_load_state)
|
||||
|
||||
void pvr_spm_finish_eot_state(struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state);
|
||||
void PVR_PER_ARCH(device_finish_spm_load_state)(struct pvr_device *device);
|
||||
|
||||
VkResult
|
||||
pvr_spm_init_bgobj_state(struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render);
|
||||
# define pvr_device_finish_spm_load_state \
|
||||
PVR_PER_ARCH(device_finish_spm_load_state)
|
||||
|
||||
void pvr_spm_finish_bgobj_state(struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state);
|
||||
VkResult PVR_PER_ARCH(spm_init_eot_state)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_spm_eot_state *spm_eot_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render);
|
||||
|
||||
# define pvr_spm_init_eot_state PVR_PER_ARCH(spm_init_eot_state)
|
||||
|
||||
VkResult PVR_PER_ARCH(spm_init_bgobj_state)(
|
||||
struct pvr_device *device,
|
||||
struct pvr_spm_bgobj_state *spm_bgobj_state,
|
||||
const struct pvr_render_state *rstate,
|
||||
const struct pvr_renderpass_hwsetup_render *hw_render);
|
||||
|
||||
# define pvr_spm_init_bgobj_state PVR_PER_ARCH(spm_init_bgobj_state)
|
||||
|
||||
#endif /* PVR_PER_ARCH */
|
||||
|
||||
#endif /* PVR_SPM_H */
|
||||
|
|
|
|||
|
|
@ -28,6 +28,7 @@
|
|||
#include <vulkan/vulkan.h>
|
||||
|
||||
#include "hwdef/rogue_hw_defs.h"
|
||||
#include "pvr_macros.h"
|
||||
#include "pvr_types.h"
|
||||
#include "util/macros.h"
|
||||
|
||||
|
|
@ -108,8 +109,14 @@ struct pvr_texture_state_info {
|
|||
uint32_t z_slice;
|
||||
};
|
||||
|
||||
VkResult pvr_pack_tex_state(struct pvr_device *device,
|
||||
const struct pvr_texture_state_info *info,
|
||||
struct pvr_image_descriptor *state);
|
||||
#ifdef PVR_PER_ARCH
|
||||
|
||||
VkResult PVR_PER_ARCH(pack_tex_state)(struct pvr_device *device,
|
||||
const struct pvr_texture_state_info *info,
|
||||
struct pvr_image_descriptor *state);
|
||||
|
||||
# define pvr_pack_tex_state PVR_PER_ARCH(pack_tex_state)
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* PVR_TEX_STATE_H */
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue