pvr: use util_dynarray_begin() in more places

Signed-off-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21550>
This commit is contained in:
Frank Binns
2023-02-20 12:06:16 +00:00
committed by Marge Bot
parent 16a1752d34
commit 6b27b76432
2 changed files with 18 additions and 12 deletions

View File

@@ -27,6 +27,7 @@
#include "util/macros.h"
#include "util/os_file.h"
#include "util/ralloc.h"
#include "util/u_dynarray.h"
#include <getopt.h>
#include <stdbool.h>
@@ -227,8 +228,10 @@ int main(int argc, char *argv[])
goto err_free_build_context;
}
bytes_written =
fwrite(ctx->binary[opts.stage].data, 1, ctx->binary[opts.stage].size, fp);
bytes_written = fwrite(util_dynarray_begin(&ctx->binary[opts.stage]),
1,
ctx->binary[opts.stage].size,
fp);
if (bytes_written != ctx->binary[opts.stage].size) {
fprintf(
stderr,

View File

@@ -46,6 +46,7 @@
#include "util/log.h"
#include "util/macros.h"
#include "util/ralloc.h"
#include "util/u_dynarray.h"
#include "util/u_math.h"
#include "vk_alloc.h"
#include "vk_graphics_state.h"
@@ -1789,11 +1790,12 @@ pvr_graphics_pipeline_compile(struct pvr_device *const device,
}
}
result = pvr_gpu_upload_usc(device,
ctx->binary[MESA_SHADER_VERTEX].data,
ctx->binary[MESA_SHADER_VERTEX].size,
cache_line_size,
&gfx_pipeline->shader_state.vertex.bo);
result =
pvr_gpu_upload_usc(device,
util_dynarray_begin(&ctx->binary[MESA_SHADER_VERTEX]),
ctx->binary[MESA_SHADER_VERTEX].size,
cache_line_size,
&gfx_pipeline->shader_state.vertex.bo);
if (result != VK_SUCCESS)
goto err_free_build_context;
@@ -1821,11 +1823,12 @@ pvr_graphics_pipeline_compile(struct pvr_device *const device,
}
}
result = pvr_gpu_upload_usc(device,
ctx->binary[MESA_SHADER_FRAGMENT].data,
ctx->binary[MESA_SHADER_FRAGMENT].size,
cache_line_size,
&gfx_pipeline->shader_state.fragment.bo);
result = pvr_gpu_upload_usc(
device,
util_dynarray_begin(&ctx->binary[MESA_SHADER_FRAGMENT]),
ctx->binary[MESA_SHADER_FRAGMENT].size,
cache_line_size,
&gfx_pipeline->shader_state.fragment.bo);
if (result != VK_SUCCESS)
goto err_free_vertex_bo;