pvr: Add multi layer passthough vert shader upload in device.

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20055>
This commit is contained in:
Karmjit Mahil
2022-09-15 16:09:23 +01:00
committed by Marge Bot
parent 37e8e0a494
commit 821da19046
4 changed files with 51 additions and 1 deletions
+28 -1
View File
@@ -1778,6 +1778,29 @@ pvr_device_init_graphics_static_clear_state(struct pvr_device *device)
{ 0.0f, vf_y_max, 0.0f },
{ vf_x_max, vf_y_max, 0.0f } };
if (PVR_HAS_FEATURE(dev_info, gs_rta_support)) {
struct util_dynarray passthrough_rta_vert_shader;
util_dynarray_init(&passthrough_rta_vert_shader, NULL);
pvr_hard_code_get_passthrough_rta_vertex_shader(
dev_info,
&passthrough_rta_vert_shader);
result = pvr_gpu_upload_usc(device,
passthrough_rta_vert_shader.data,
passthrough_rta_vert_shader.size,
cache_line_size,
&state->usc_multi_layer_vertex_shader_bo);
if (result != VK_SUCCESS) {
util_dynarray_fini(&passthrough_rta_vert_shader);
return result;
}
util_dynarray_fini(&passthrough_rta_vert_shader);
} else {
state->usc_multi_layer_vertex_shader_bo = NULL;
}
pvr_hard_code_get_passthrough_vertex_shader(dev_info,
&passthrough_vert_shader);
@@ -1787,7 +1810,7 @@ pvr_device_init_graphics_static_clear_state(struct pvr_device *device)
cache_line_size,
&state->usc_vertex_shader_bo);
if (result != VK_SUCCESS)
return result;
goto err_free_usc_multi_layer_shader;
result = pvr_gpu_upload(device,
device->heaps.general_heap,
@@ -1894,6 +1917,9 @@ err_free_verices_buffer:
err_free_usc_shader:
pvr_bo_free(device, state->usc_vertex_shader_bo);
err_free_usc_multi_layer_shader:
pvr_bo_free(device, state->usc_multi_layer_vertex_shader_bo);
return result;
}
@@ -1905,6 +1931,7 @@ pvr_device_finish_graphics_static_clear_state(struct pvr_device *device)
pvr_bo_free(device, state->pds.pvr_bo);
pvr_bo_free(device, state->vertices_bo);
pvr_bo_free(device, state->usc_vertex_shader_bo);
pvr_bo_free(device, state->usc_multi_layer_vertex_shader_bo);
}
/* FIXME: We should be calculating the size when we upload the code in
+17
View File
@@ -35,6 +35,7 @@
#include "rogue/rogue.h"
#include "usc/hardcoded_apps/pvr_simple_compute.h"
#include "util/macros.h"
#include "util/u_dynarray.h"
#include "util/u_process.h"
/**
@@ -47,6 +48,9 @@
#define PVR_AXE_1_16M_BVNC PVR_BVNC_PACK(33, 15, 11, 3)
#define PVR_GX6250_BVNC PVR_BVNC_PACK(4, 40, 2, 51)
#define util_dynarray_append_mem(buf, size, mem) \
memcpy(util_dynarray_grow_bytes((buf), 1, size), mem, size)
enum pvr_hard_code_shader_type {
PVR_HARD_CODE_SHADER_TYPE_COMPUTE,
PVR_HARD_CODE_SHADER_TYPE_GRAPHICS,
@@ -363,3 +367,16 @@ void pvr_hard_code_get_passthrough_vertex_shader(
"No hard coded passthrough vertex shader. Returning empty shader.");
*program_out = &shader;
};
/* Render target array (RTA). */
void pvr_hard_code_get_passthrough_rta_vertex_shader(
const struct pvr_device_info *const dev_info,
struct util_dynarray *program_out)
{
uint32_t shader[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
util_dynarray_append_mem(program_out, ARRAY_SIZE(shader), &shader);
mesa_loge("No hard coded passthrough rta vertex shader. Returning "
"empty shader.");
}
+4
View File
@@ -30,6 +30,7 @@
#include "compiler/shader_enums.h"
#include "rogue/rogue_build_data.h"
#include "util/u_dynarray.h"
/**
* \file pvr_hardcode.h
@@ -128,5 +129,8 @@ void pvr_hard_code_get_idfwdf_program(
void pvr_hard_code_get_passthrough_vertex_shader(
const struct pvr_device_info *const dev_info,
const struct rogue_shader_binary **const program_out);
void pvr_hard_code_get_passthrough_rta_vertex_shader(
const struct pvr_device_info *const dev_info,
struct util_dynarray *program_out);
#endif /* PVR_HARDCODE_SHADERS_H */
+2
View File
@@ -418,6 +418,8 @@ struct pvr_device {
struct pvr_bo *vertices_bo;
struct pvr_pds_upload pds;
struct pvr_bo *usc_multi_layer_vertex_shader_bo;
struct pvr_static_clear_ppp_base ppp_base;
struct pvr_static_clear_ppp_template
ppp_templates[PVR_STATIC_CLEAR_VARIANT_COUNT];