nouveau/codegen: Use a NULL format for PIPE_FORMAT_NONE for images
authorFaith Ekstrand <faith.ekstrand@collabora.com>
Wed, 3 May 2023 23:10:41 +0000 (18:10 -0500)
committerMarge Bot <emma+marge@anholt.net>
Tue, 1 Aug 2023 18:58:03 +0000 (18:58 +0000)
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 <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24327>

src/nouveau/codegen/nv50_ir.cpp
src/nouveau/codegen/nv50_ir.h

index 7f0aec4..942f3a9 100644 (file)
@@ -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;
    }
 }
 
index 42acbe2..fdbfec0 100644 (file)
@@ -427,8 +427,6 @@ enum TexTarget
 
 enum ImgFormat
 {
-   FMT_NONE,
-
    FMT_RGBA32F,
    FMT_RGBA16F,
    FMT_RG32F,