You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-[MTLDebugRenderCommandEncoder validateCommonDrawErrors:]:5782: failed assertion
'Draw Errors Validation
Fragment Function (SDL_Advanced_fragment): missing buffer binding at index 1 for decode[0]'
below code is an easy way to reproduce on m3 14'' MacBook Pro. size of the buffer and the stride is acquired from CoreVideo framework for the pixel format kCVPixelFormatType_64RGBAHalf width 1512 height 982. even though below code isn't meant to display meaningful visuals, i can replicate the issue with a real pixel buffer, it shows distorted and broken colored version of the expected output when I use SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 64, 8) but gives the aforementioned error when I use SDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 64, 8) or the pre-defined FLOAT formats. I am @kopyaçekmiyorum on SDL discord incase it may be needed.
#import <SDL3/SDL.h>
#import <SDL3/SDL_Main.h>
#include <stdlib.h>
int main(void) {
SDL_Window* win;
SDL_Renderer* ren;
SDL_CreateWindowAndRenderer("win", 1512, 982, 0, &win, &ren);
void* pb = malloc(11943936);
memset(pb, 'abcd', 11943936);
SDL_Surface* sur = SDL_CreateSurfaceFrom(1512, 982, SDL_PIXELFORMAT_RGBA64_FLOAT, pb, 12160);//SDL_PIXELFORMAT_RGBA64_FLOAT
SDL_Texture* tex = SDL_CreateTextureFromSurface(ren, sur);
SDL_Event ev;
int run = 1;
while(run){
while (SDL_PollEvent(&ev)) {
if (ev.type == SDL_EVENT_QUIT) {
run = 0;
}
}
SDL_RenderTexture(ren, tex, NULL, NULL);
SDL_RenderPresent(ren);
}
}
The text was updated successfully, but these errors were encountered:
doraorak
changed the title
SDL3, MacOS: pixel formats using SDL_PIXELTYPE_ARRAYF16 and SDL_PIXELTYPE_ARRAYF32 result in error
SDL3, MacOS: pixel formats using SDL_PIXELTYPE_ARRAYF16 and SDL_PIXELTYPE_ARRAYF32 result in metal api validation error
Dec 26, 2024
because we will not be assigning the buffer as SDL_HAVE_YUV won't be defined and conditions aren't true anyway. But i still don't understand why it only happens with float formats. Maybe float formats somehow have the advanced fragment function while other formats have copy fragment function ?
below code is an easy way to reproduce on m3 14'' MacBook Pro. size of the buffer and the stride is acquired from CoreVideo framework for the pixel format
kCVPixelFormatType_64RGBAHalf
width 1512 height 982. even though below code isn't meant to display meaningful visuals, i can replicate the issue with a real pixel buffer, it shows distorted and broken colored version of the expected output when I useSDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYU16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 64, 8)
but gives the aforementioned error when I useSDL_DEFINE_PIXELFORMAT(SDL_PIXELTYPE_ARRAYF16, SDL_PACKEDORDER_RGBA, SDL_PACKEDLAYOUT_8888, 64, 8)
or the pre-defined FLOAT formats. I am @kopyaçekmiyorum on SDL discord incase it may be needed.The text was updated successfully, but these errors were encountered: