From 2200d3c2e7d7af2b42f4d6fd2128c0d3e20b476f Mon Sep 17 00:00:00 2001 From: Faith Ekstrand Date: Wed, 3 May 2023 18:10:41 -0500 Subject: [PATCH] nouveau/codegen: Use a NULL format for PIPE_FORMAT_NONE for images Get rid of our own FMT_NONE and just use a NULL format in that case. We're already checking su->tex.format != NULL in a bunch of cases but none of those NULL checks are doing anything right now execpt detecting when its an actual texture op and not an image op. We'd like them to start also applying for image load/store with an unspecified format. Reviewed-by: M Henning Reviewed-by: Karol Herbst Part-of: --- src/nouveau/codegen/nv50_ir.cpp | 6 ++---- src/nouveau/codegen/nv50_ir.h | 2 -- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/src/nouveau/codegen/nv50_ir.cpp b/src/nouveau/codegen/nv50_ir.cpp index 7f0aec4..942f3a9 100644 --- a/src/nouveau/codegen/nv50_ir.cpp +++ b/src/nouveau/codegen/nv50_ir.cpp @@ -971,8 +971,6 @@ const struct TexInstruction::Target::Desc TexInstruction::Target::descTable[] = const struct TexInstruction::ImgFormatDesc TexInstruction::formatTable[] = { - { "NONE", 0, { 0, 0, 0, 0 }, UINT }, - { "RGBA32F", 4, { 32, 32, 32, 32 }, FLOAT }, { "RGBA16F", 4, { 16, 16, 16, 16 }, FLOAT }, { "RG32F", 2, { 32, 32, 0, 0 }, FLOAT }, @@ -1028,7 +1026,7 @@ TexInstruction::translateImgFormat(enum pipe_format format) case PIPE_FORMAT_ ## a: return &formatTable[nv50_ir::FMT_ ## b] switch (format) { - FMT_CASE(NONE, NONE); + case PIPE_FORMAT_NONE: return NULL; FMT_CASE(R32G32B32A32_FLOAT, RGBA32F); FMT_CASE(R16G16B16A16_FLOAT, RGBA16F); @@ -1078,7 +1076,7 @@ TexInstruction::translateImgFormat(enum pipe_format format) default: assert(!"Unexpected format"); - return &formatTable[nv50_ir::FMT_NONE]; + return NULL; } } diff --git a/src/nouveau/codegen/nv50_ir.h b/src/nouveau/codegen/nv50_ir.h index 42acbe2..fdbfec0 100644 --- a/src/nouveau/codegen/nv50_ir.h +++ b/src/nouveau/codegen/nv50_ir.h @@ -427,8 +427,6 @@ enum TexTarget enum ImgFormat { - FMT_NONE, - FMT_RGBA32F, FMT_RGBA16F, FMT_RG32F, -- 2.7.4