[qfcc] Fix the subpassLoad functions

I had forgotten that subpassInput can't be used but the normal imageLoad
functions since they don't (and mustn't, by the spec) have subpassInput
as a possible type. While creating a specialized version works, I think
I need to come up with a better way of specifying intrinsics.
This commit is contained in:
Bill Currie 2025-01-14 01:21:21 +09:00
parent 341504261a
commit 2f3097aed7

View file

@ -998,18 +998,22 @@ SRC_LINE
"#define _subpassInput(x,m) __spI(,m),__spI(i,m),__spI(u,m)" "\n"
"#define gvec4 @vector(gsubpassInput.sample_type, 4)" "\n"
"#define gvec4MS @vector(gsubpassInputMS.sample_type, 4)" "\n"
"#define IMAGE_PARAMS gsubpassInput image, gsubpassInput.coord_type P" "\n"
"#define IMAGE_PARAMS_MS gsubpassInputMS image, gsubpassInputMS.coord_type P, int sample" "\n"
"@generic(gsubpassInput=[_subpassInput(,)]," "\n"
" gsubpassInputMS=[_subpassInput(,MS)]) {" "\n"
"gvec4 __imageLoad(readonly IMAGE_PARAMS) = " SPV(OpImageRead) ";" "\n"
"gvec4MS __imageLoad(readonly IMAGE_PARAMS_MS) = " SPV(OpImageRead) ";" "\n"
"gvec4 subpassLoad(gsubpassInput subpass)" "\n"
"{" "\n"
" return imageLoad(subpass," "\n"
" @construct(gsubpassInput.coord_type, 0));" "\n"
" return __imageLoad(subpass," "\n"
" @construct(gsubpassInput.coord_type, 0));" "\n"
"}" "\n"
"gvec4MS subpassLoad(gsubpassInputMS subpass, int sample)" "\n"
"{" "\n"
" return imageLoad(subpass," "\n"
" @construct(gsubpassInputMS.coord_type, 0)," "\n"
" sample);" "\n"
" return __imageLoad(subpass," "\n"
" @construct(gsubpassInputMS.coord_type, 0)," "\n"
" sample);" "\n"
"}" "\n"
"};" "\n"
"#undef uint" "\n"