nouveau: Drop tgsi support from nv50_ir_prog_info
Reviewed-by: Karol Herbst <kherbst@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24175>
This commit is contained in:
parent
38a96f79af
commit
c631635f43
7 changed files with 11 additions and 42 deletions
|
|
@ -110,8 +110,8 @@ nouveau_codegen(int chipset, int type, struct tgsi_token tokens[],
|
|||
|
||||
info.type = type;
|
||||
info.target = chipset;
|
||||
info.bin.sourceRep = PIPE_SHADER_IR_TGSI;
|
||||
info.bin.source = tokens;
|
||||
_debug_printf("TGSI no longer supported\n", chipset);
|
||||
// info.nir = ...;
|
||||
|
||||
info.io.auxCBSlot = 15;
|
||||
info.io.ucpBase = NV50_CB_AUX_UCP_OFFSET;
|
||||
|
|
|
|||
|
|
@ -340,8 +340,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
|
|||
info->type = prog->type;
|
||||
info->target = chipset;
|
||||
|
||||
info->bin.sourceRep = PIPE_SHADER_IR_NIR;
|
||||
info->bin.source = (void *)nir_shader_clone(NULL, prog->nir);
|
||||
info->bin.nir = nir_shader_clone(NULL, prog->nir);
|
||||
|
||||
info->bin.smemSize = prog->cp.smem_size;
|
||||
info->io.auxCBSlot = 15;
|
||||
|
|
@ -451,8 +450,7 @@ nv50_program_translate(struct nv50_program *prog, uint16_t chipset,
|
|||
info_out.bin.codeSize);
|
||||
|
||||
out:
|
||||
if (info->bin.sourceRep == PIPE_SHADER_IR_NIR)
|
||||
ralloc_free((void *)info->bin.source);
|
||||
ralloc_free(info->bin.nir);
|
||||
FREE(info);
|
||||
return !ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -590,8 +590,7 @@ nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
|
|||
info->type = prog->type;
|
||||
info->target = chipset;
|
||||
|
||||
info->bin.sourceRep = PIPE_SHADER_IR_NIR;
|
||||
info->bin.source = (void *)nir_shader_clone(NULL, prog->nir);
|
||||
info->bin.nir = nir_shader_clone(NULL, prog->nir);
|
||||
|
||||
#ifndef NDEBUG
|
||||
info->target = debug_get_num_option("NV50_PROG_CHIPSET", chipset);
|
||||
|
|
@ -752,8 +751,7 @@ nvc0_program_translate(struct nvc0_program *prog, uint16_t chipset,
|
|||
#endif
|
||||
|
||||
out:
|
||||
if (info->bin.sourceRep == PIPE_SHADER_IR_NIR)
|
||||
ralloc_free((void *)info->bin.source);
|
||||
ralloc_free((void *)info->bin.nir);
|
||||
FREE(info);
|
||||
return !ret;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1309,14 +1309,7 @@ nv50_ir_generate_code(struct nv50_ir_prog_info *info,
|
|||
prog->dbgFlags = info->dbgFlags;
|
||||
prog->optLevel = info->optLevel;
|
||||
|
||||
switch (info->bin.sourceRep) {
|
||||
case PIPE_SHADER_IR_NIR:
|
||||
ret = prog->makeFromNIR(info, info_out) ? 0 : -2;
|
||||
break;
|
||||
default:
|
||||
ret = -1;
|
||||
break;
|
||||
}
|
||||
ret = prog->makeFromNIR(info, info_out) ? 0 : -2;
|
||||
if (ret < 0)
|
||||
goto out;
|
||||
if (prog->dbgFlags & NV50_IR_DEBUG_VERBOSE)
|
||||
|
|
|
|||
|
|
@ -27,6 +27,7 @@
|
|||
#include "util/blob.h"
|
||||
|
||||
#define NV50_CODEGEN_MAX_VARYINGS 80
|
||||
struct nir_shader;
|
||||
struct nir_shader_compiler_options;
|
||||
|
||||
/*
|
||||
|
|
@ -93,8 +94,7 @@ struct nv50_ir_prog_info
|
|||
|
||||
struct {
|
||||
uint32_t smemSize; /* required shared memory per block */
|
||||
uint8_t sourceRep; /* PIPE_SHADER_IR_* */
|
||||
const void *source;
|
||||
struct nir_shader *nir;
|
||||
} bin;
|
||||
|
||||
union {
|
||||
|
|
|
|||
|
|
@ -3291,7 +3291,7 @@ bool
|
|||
Program::makeFromNIR(struct nv50_ir_prog_info *info,
|
||||
struct nv50_ir_prog_info_out *info_out)
|
||||
{
|
||||
nir_shader *nir = (nir_shader*)info->bin.source;
|
||||
nir_shader *nir = info->bin.nir;
|
||||
Converter converter(this, nir, info, info_out);
|
||||
bool result = converter.run();
|
||||
if (!result)
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@
|
|||
#include "nv50_ir.h"
|
||||
#include "nv50_ir_target.h"
|
||||
#include "nv50_ir_driver.h"
|
||||
#include "tgsi/tgsi_parse.h"
|
||||
#include "compiler/nir/nir_serialize.h"
|
||||
|
||||
enum FixupApplyFunc {
|
||||
|
|
@ -27,27 +26,8 @@ nv50_ir_prog_info_serialize(struct blob *blob, struct nv50_ir_prog_info *info)
|
|||
blob_write_uint8(blob, info->optLevel);
|
||||
blob_write_uint8(blob, info->dbgFlags);
|
||||
blob_write_uint8(blob, info->omitLineNum);
|
||||
blob_write_uint8(blob, info->bin.sourceRep);
|
||||
|
||||
switch(info->bin.sourceRep) {
|
||||
case PIPE_SHADER_IR_TGSI: {
|
||||
struct tgsi_token *tokens = (struct tgsi_token *)info->bin.source;
|
||||
unsigned int num_tokens = tgsi_num_tokens(tokens);
|
||||
|
||||
blob_write_uint32(blob, num_tokens);
|
||||
blob_write_bytes(blob, tokens, num_tokens * sizeof(struct tgsi_token));
|
||||
break;
|
||||
}
|
||||
case PIPE_SHADER_IR_NIR: {
|
||||
struct nir_shader *nir = (struct nir_shader *)info->bin.source;
|
||||
nir_serialize(blob, nir, true);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
ERROR("unhandled info->bin.sourceRep switch case\n");
|
||||
assert(false);
|
||||
return false;
|
||||
}
|
||||
nir_serialize(blob, info->bin.nir, true);
|
||||
|
||||
if (info->type == PIPE_SHADER_COMPUTE)
|
||||
blob_write_bytes(blob, &info->prop.cp, sizeof(info->prop.cp));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue