v3dv: Drop the SPIR-V dumper

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/30875>
This commit is contained in:
Faith Ekstrand 2024-08-27 10:04:30 -05:00 committed by Marge Bot
parent c60a421f0c
commit 6e3938f45b
6 changed files with 0 additions and 84 deletions

View file

@ -82,8 +82,6 @@ static const struct debug_named_value debug_control[] = {
"Precompiles shader variant at shader state creation time (v3d only)" },
{ "ra", V3D_DEBUG_RA,
"Dump register allocation failures" },
{ "dump_spirv", V3D_DEBUG_DUMP_SPIRV,
"Dump SPIR-V code (v3dv only)" },
{ "tmu32", V3D_DEBUG_TMU_32BIT,
"Force 32-bit precision on all TMU operations" },
/* This can lead to incorrect behavior for applications that do

View file

@ -60,7 +60,6 @@ extern uint32_t v3d_mesa_debug;
#define V3D_DEBUG_CLIF (1 << 14)
#define V3D_DEBUG_PRECOMPILE (1 << 15)
#define V3D_DEBUG_RA (1 << 16)
#define V3D_DEBUG_DUMP_SPIRV (1 << 17)
#define V3D_DEBUG_TMU_32BIT (1 << 18)
#define V3D_DEBUG_TMU_16BIT (1 << 19)
#define V3D_DEBUG_NO_LOOP_UNROLL (1 << 20)

View file

@ -19,7 +19,6 @@ libv3dv_files = files(
'v3dv_bo.c',
'v3dv_cl.c',
'v3dv_cmd_buffer.c',
'v3dv_debug.c',
'v3dv_debug.h',
'v3dv_descriptor_set.c',
'v3dv_device.c',

View file

@ -1,61 +0,0 @@
/*
* Copyright © 2019 Raspberry Pi Ltd
*
* based in part on radv_debug.h which is:
* Copyright © 2017 Google.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
* IN THE SOFTWARE.
*/
#include "v3dv_debug.h"
#include "unistd.h"
#include "v3dv_debug.h"
#include <unistd.h>
void
v3dv_print_spirv(const char *data, uint32_t size, FILE *fp)
{
char path[] = "/tmp/fileXXXXXX";
char line[2048], command[128];
FILE *p;
int fd;
/* Dump the binary into a temporary file. */
fd = mkstemp(path);
if (fd < 0)
return;
if (write(fd, data, size) == -1)
goto fail;
sprintf(command, "spirv-dis %s", path);
/* Disassemble using spirv-dis if installed. */
p = popen(command, "r");
if (p) {
while (fgets(line, sizeof(line), p))
fprintf(fp, "%s", line);
pclose(p);
}
fail:
close(fd);
unlink(path);
}

View file

@ -29,10 +29,6 @@
#include "v3dv_private.h"
/* FIXME: C&P from radv, perhaps a common place?*/
void
v3dv_print_spirv(const char *data, uint32_t size, FILE *fp);
void
v3dv_print_v3d_key(struct v3d_key *key, uint32_t v3d_key_size);

View file

@ -353,21 +353,6 @@ shader_module_compile_to_nir(struct v3dv_device *device,
gl_shader_stage gl_stage = broadcom_shader_stage_to_gl(stage->stage);
if (V3D_DBG(DUMP_SPIRV)) {
char *spirv_data = NULL;
uint32_t spirv_size = 0;
if (stage->module != NULL && !stage->module->nir) {
spirv_data = (char *) stage->module->data;
spirv_size = stage->module->size;
} else if (stage->module_info) {
spirv_data = (char *) stage->module_info->pCode;
spirv_size = stage->module_info->codeSize;
}
if (spirv_data)
v3dv_print_spirv(spirv_data, spirv_size, stderr);
}
const VkPipelineShaderStageCreateInfo stage_info = {
.sType = VK_STRUCTURE_TYPE_PIPELINE_SHADER_STAGE_CREATE_INFO,
.pNext = !stage->module ? stage->module_info : NULL,