mirror of
https://github.com/Kbz-8/Pulse.git
synced 2026-01-11 15:33:34 +00:00
improve image creation tests and windows opengl ci
This commit is contained in:
@@ -92,7 +92,7 @@ PulseImage OpenGLCreateImageTryAndFail(PulseDevice device, const PulseImageCreat
|
||||
|
||||
if(image_type == GL_INVALID_ENUM)
|
||||
{
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend))
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend) && !try_and_fail)
|
||||
PulseLogErrorFmt(device->backend, "%s image type is not supported", device->backend->backend == PULSE_BACKEND_OPENGL ? "(OpenGL)" : "(OpenGL ES)");
|
||||
PulseSetInternalError(PULSE_ERROR_INITIALIZATION_FAILED);
|
||||
free(opengl_image);
|
||||
@@ -101,7 +101,7 @@ PulseImage OpenGLCreateImageTryAndFail(PulseDevice device, const PulseImageCreat
|
||||
}
|
||||
if(image_format == GL_INVALID_ENUM)
|
||||
{
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend))
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend) && !try_and_fail)
|
||||
PulseLogErrorFmt(device->backend, "%s image format is not supported", device->backend->backend == PULSE_BACKEND_OPENGL ? "(OpenGL)" : "(OpenGL ES)");
|
||||
PulseSetInternalError(PULSE_ERROR_INVALID_IMAGE_FORMAT);
|
||||
free(opengl_image);
|
||||
|
||||
@@ -215,10 +215,11 @@ PulseDevice WebGPUCreateDevice(PulseBackend backend, PulseDevice* forbiden_devic
|
||||
|
||||
#ifndef PULSE_PLAT_WASM
|
||||
WGPUFeatureName features[] = {
|
||||
WGPUNativeFeature_TextureAdapterSpecificFormatFeatures,
|
||||
(WGPUFeatureName)WGPUNativeFeature_TextureAdapterSpecificFormatFeatures,
|
||||
WGPUFeatureName_TextureCompressionBC,
|
||||
};
|
||||
descriptor.requiredFeatures = features;
|
||||
descriptor.requiredFeatureCount = 1;
|
||||
descriptor.requiredFeatureCount = PULSE_SIZEOF_ARRAY(features);
|
||||
#endif
|
||||
|
||||
WGPURequestDeviceCallbackInfo device_callback = { 0 };
|
||||
|
||||
@@ -176,26 +176,11 @@ bool WebGPUIsImageFormatValid(PulseDevice device, PulseImageFormat format, Pulse
|
||||
wgpu_usage |= WGPUTextureUsage_StorageBinding | WGPUTextureUsage_CopySrc | WGPUTextureUsage_CopyDst;
|
||||
|
||||
if(wgpu_format == WGPUTextureFormat_Undefined)
|
||||
{
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend))
|
||||
PulseLogError(device->backend, "(WebGPU) unsupported image format");
|
||||
PulseSetInternalError(PULSE_ERROR_INVALID_IMAGE_FORMAT);
|
||||
return false;
|
||||
}
|
||||
if(wgpu_usage == WGPUTextureUsage_None)
|
||||
{
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend))
|
||||
PulseLogError(device->backend, "(WebGPU) unsupported image usage");
|
||||
PulseSetInternalError(PULSE_ERROR_INVALID_IMAGE_USAGE);
|
||||
return false;
|
||||
}
|
||||
if(dimension == WGPUTextureDimension_Undefined)
|
||||
{
|
||||
if(PULSE_IS_BACKEND_LOW_LEVEL_DEBUG(device->backend))
|
||||
PulseLogError(device->backend, "(WebGPU) unsupported image type");
|
||||
PulseSetInternalError(PULSE_ERROR_INVALID_IMAGE_FORMAT);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user