mirror of
https://github.com/chenasraf/redot-engine.git
synced 2026-05-18 01:39:11 +00:00
Deref Godot: drivers/
This commit is contained in:
@@ -34,7 +34,7 @@ env_thirdparty.add_source_files(thirdparty_obj, thirdparty_sources)
|
||||
|
||||
env.drivers_sources += thirdparty_obj
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
|
||||
driver_obj = []
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ Error MIDIDriverCoreMidi::open() {
|
||||
ERR_FAIL_COND_V_MSG(client || core_midi_closed, FAILED,
|
||||
"MIDIDriverCoreMidi cannot be reopened.");
|
||||
|
||||
CFStringRef name = CFStringCreateWithCString(nullptr, "Godot", kCFStringEncodingASCII);
|
||||
CFStringRef name = CFStringCreateWithCString(nullptr, "Redot", kCFStringEncodingASCII);
|
||||
OSStatus result = MIDIClientCreate(name, nullptr, nullptr, &client);
|
||||
CFRelease(name);
|
||||
if (result != noErr) {
|
||||
@@ -71,7 +71,7 @@ Error MIDIDriverCoreMidi::open() {
|
||||
return ERR_CANT_OPEN;
|
||||
}
|
||||
|
||||
result = MIDIInputPortCreate(client, CFSTR("Godot Input"), MIDIDriverCoreMidi::read, (void *)this, &port_in);
|
||||
result = MIDIInputPortCreate(client, CFSTR("Redot Input"), MIDIDriverCoreMidi::read, (void *)this, &port_in);
|
||||
if (result != noErr) {
|
||||
ERR_PRINT("MIDIInputPortCreate failed, code: " + itos(result));
|
||||
return ERR_CANT_OPEN;
|
||||
|
||||
@@ -151,7 +151,7 @@ env_d3d12_rdd.Append(CPPDEFINES=extra_defines)
|
||||
env.drivers_sources += thirdparty_obj
|
||||
|
||||
|
||||
# Godot source files.
|
||||
# Redot source files.
|
||||
|
||||
driver_obj = []
|
||||
env_d3d12_rdd.add_source_files(driver_obj, "*.cpp")
|
||||
|
||||
@@ -3527,7 +3527,7 @@ Vector<uint8_t> RenderingDeviceDriverD3D12::shader_compile_binary_from_spirv(Vec
|
||||
binptr[0] = 'G';
|
||||
binptr[1] = 'S';
|
||||
binptr[2] = 'B';
|
||||
binptr[3] = 'D'; // Godot shader binary data.
|
||||
binptr[3] = 'D'; // Redot shader binary data.
|
||||
offset += 4;
|
||||
encode_uint32(ShaderBinary::VERSION, binptr + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
|
||||
@@ -3,5 +3,5 @@ from misc.utility.scons_hints import *
|
||||
|
||||
Import("env")
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
||||
|
||||
@@ -26,5 +26,5 @@ if env["platform"] in ["macos", "windows", "linuxbsd"]:
|
||||
env_thirdparty.disable_warnings()
|
||||
env_thirdparty.add_source_files(env.drivers_sources, thirdparty_sources)
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
||||
|
||||
@@ -311,7 +311,7 @@ RasterizerGLES3::RasterizerGLES3() {
|
||||
}
|
||||
|
||||
if (callback) {
|
||||
print_line("godot: ENABLING GL DEBUG");
|
||||
print_line("redot: ENABLING GL DEBUG");
|
||||
glEnable(_EXT_DEBUG_OUTPUT_SYNCHRONOUS_ARB);
|
||||
callback((DEBUGPROCARB)_gl_debug_print, nullptr);
|
||||
glEnable(_EXT_DEBUG_OUTPUT);
|
||||
@@ -368,7 +368,7 @@ RasterizerGLES3::RasterizerGLES3() {
|
||||
canvas = memnew(RasterizerCanvasGLES3());
|
||||
scene = memnew(RasterizerSceneGLES3());
|
||||
|
||||
// Disable OpenGL linear to sRGB conversion, because Godot will always do this conversion itself.
|
||||
// Disable OpenGL linear to sRGB conversion, because Redot will always do this conversion itself.
|
||||
if (config->srgb_framebuffer_supported) {
|
||||
glDisable(GL_FRAMEBUFFER_SRGB);
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
# Metal Rendering Device
|
||||
|
||||
This document aims to describe the Metal rendering device implementation in Godot.
|
||||
This document aims to describe the Metal rendering device implementation in Redot.
|
||||
|
||||
## Future work / ideas
|
||||
|
||||
|
||||
@@ -882,7 +882,7 @@ public:
|
||||
};
|
||||
|
||||
// These functions are used to convert between Objective-C objects and
|
||||
// the RIDs used by Godot, respecting automatic reference counting.
|
||||
// the RIDs used by Redot, respecting automatic reference counting.
|
||||
namespace rid {
|
||||
|
||||
// Converts an Objective-C object to a pointer, and incrementing the
|
||||
|
||||
@@ -272,14 +272,14 @@ public:
|
||||
/** Returns whether the specified Metal MTLPixelFormat is a PVRTC format. */
|
||||
bool isPVRTCFormat(MTLPixelFormat p_format);
|
||||
|
||||
/** Returns the format type corresponding to the specified Godot pixel format, */
|
||||
/** Returns the format type corresponding to the specified Redot pixel format, */
|
||||
MTLFormatType getFormatType(DataFormat p_format);
|
||||
|
||||
/** Returns the format type corresponding to the specified Metal MTLPixelFormat, */
|
||||
MTLFormatType getFormatType(MTLPixelFormat p_formt);
|
||||
|
||||
/**
|
||||
* Returns the Metal MTLPixelFormat corresponding to the specified Godot pixel
|
||||
* Returns the Metal MTLPixelFormat corresponding to the specified Redot pixel
|
||||
* or returns MTLPixelFormatInvalid if no corresponding MTLPixelFormat exists.
|
||||
*/
|
||||
MTLPixelFormat getMTLPixelFormat(DataFormat p_format);
|
||||
@@ -291,7 +291,7 @@ public:
|
||||
DataFormat getDataFormat(MTLPixelFormat p_format);
|
||||
|
||||
/**
|
||||
* Returns the size, in bytes, of a texel block of the specified Godot pixel.
|
||||
* Returns the size, in bytes, of a texel block of the specified Redot pixel.
|
||||
* For uncompressed formats, the returned value corresponds to the size in bytes of a single texel.
|
||||
*/
|
||||
uint32_t getBytesPerBlock(DataFormat p_format);
|
||||
@@ -309,7 +309,7 @@ public:
|
||||
uint8_t getChromaSubsamplingComponentBits(DataFormat p_format);
|
||||
|
||||
/**
|
||||
* Returns the size, in bytes, of a texel of the specified Godot format.
|
||||
* Returns the size, in bytes, of a texel of the specified Redot format.
|
||||
* The returned value may be fractional for certain compressed formats.
|
||||
*/
|
||||
float getBytesPerTexel(DataFormat p_format);
|
||||
@@ -321,7 +321,7 @@ public:
|
||||
float getBytesPerTexel(MTLPixelFormat p_format);
|
||||
|
||||
/**
|
||||
* Returns the size, in bytes, of a row of texels of the specified Godot pixel format.
|
||||
* Returns the size, in bytes, of a row of texels of the specified Redot pixel format.
|
||||
*
|
||||
* For compressed formats, this takes into consideration the compression block size,
|
||||
* and p_texels_per_row should specify the width in texels, not blocks. The result is rounded
|
||||
@@ -339,7 +339,7 @@ public:
|
||||
size_t getBytesPerRow(MTLPixelFormat p_format, uint32_t p_texels_per_row);
|
||||
|
||||
/**
|
||||
* Returns the size, in bytes, of a texture layer of the specified Godot pixel format.
|
||||
* Returns the size, in bytes, of a texture layer of the specified Redot pixel format.
|
||||
*
|
||||
* For compressed formats, this takes into consideration the compression block size,
|
||||
* and p_texel_rows_per_layer should specify the height in texels, not blocks. The result is
|
||||
@@ -355,7 +355,7 @@ public:
|
||||
*/
|
||||
size_t getBytesPerLayer(MTLPixelFormat p_format, size_t p_bytes_per_row, uint32_t p_texel_rows_per_layer);
|
||||
|
||||
/** Returns the Metal format capabilities supported by the specified Godot format, without substitution. */
|
||||
/** Returns the Metal format capabilities supported by the specified Redot format, without substitution. */
|
||||
MTLFmtCaps getCapabilities(DataFormat p_format, bool p_extended = false);
|
||||
|
||||
/** Returns the Metal format capabilities supported by the specified Metal format. */
|
||||
|
||||
@@ -1011,7 +1011,7 @@ void PixelFormats::modifyMTLFormatCapabilities(id<MTLDevice> p_device) {
|
||||
addGPUMTLPixFmtCaps(Apple5, BGRA8Unorm_sRGB, All);
|
||||
|
||||
// Blending is actually supported for this format, but format channels cannot be individually write-enabled during blending.
|
||||
// Disabling blending is the least-intrusive way to handle this in a Godot-friendly way.
|
||||
// Disabling blending is the least-intrusive way to handle this in a Redot-friendly way.
|
||||
addGPUMTLPixFmtCaps(Apple5, RGB9E5Float, All);
|
||||
disableMTLPixFmtCaps(RGB9E5Float, Blend);
|
||||
|
||||
@@ -1254,7 +1254,7 @@ void PixelFormats::modifyMTLFormatCapabilities(id<MTLDevice> p_device) {
|
||||
#undef disableAllMTLPixFmtCaps
|
||||
#undef addFeatSetMTLVtxFmtCaps
|
||||
|
||||
// Populates the DataFormat lookup maps and connects Godot and Metal pixel formats to one-another.
|
||||
// Populates the DataFormat lookup maps and connects Redot and Metal pixel formats to one-another.
|
||||
void PixelFormats::buildDFFormatMaps() {
|
||||
// Iterate through the DataFormat descriptions, populate the lookup maps and back pointers,
|
||||
// and validate the Metal formats for the platform and OS.
|
||||
@@ -1262,9 +1262,9 @@ void PixelFormats::buildDFFormatMaps() {
|
||||
DataFormatDesc &dfDesc = _dataFormatDescriptions[fmtIdx];
|
||||
DataFormat dfFmt = dfDesc.dataFormat;
|
||||
if (dfFmt != RD::DATA_FORMAT_MAX) {
|
||||
// Populate the back reference from the Metal formats to the Godot format.
|
||||
// Populate the back reference from the Metal formats to the Redot format.
|
||||
// Validate the corresponding Metal formats for the platform, and clear them
|
||||
// in the Godot format if not supported.
|
||||
// in the Redot format if not supported.
|
||||
if (dfDesc.mtlPixelFormat) {
|
||||
MTLFormatDesc &mtlDesc = getMTLPixelFormatDesc(dfDesc.mtlPixelFormat);
|
||||
if (mtlDesc.dataFormat == RD::DATA_FORMAT_MAX) {
|
||||
|
||||
@@ -570,7 +570,7 @@ uint8_t *RenderingDeviceDriverMetal::texture_map(TextureID p_texture, const Text
|
||||
offset += bytes_per_layer * mipExtent.depth * (p_subresource.layer - 1);
|
||||
}
|
||||
|
||||
// TODO: Confirm with rendering team that there is no other way Godot may attempt to map a texture with multiple mipmaps or array layers.
|
||||
// TODO: Confirm with rendering team that there is no other way Redot may attempt to map a texture with multiple mipmaps or array layers.
|
||||
|
||||
// NOTE: It is not possible to create a buffer-backed texture with mipmaps or array layers,
|
||||
// as noted in the is_valid_linear function, so the offset calculation SHOULD always be zero.
|
||||
@@ -804,7 +804,7 @@ void RenderingDeviceDriverMetal::fence_free(FenceID p_fence) {
|
||||
#pragma mark - Semaphores
|
||||
|
||||
RDD::SemaphoreID RenderingDeviceDriverMetal::semaphore_create() {
|
||||
// Metal doesn't use semaphores, as their purpose within Godot is to ensure ordering of command buffer execution.
|
||||
// Metal doesn't use semaphores, as their purpose within Redot is to ensure ordering of command buffer execution.
|
||||
return SemaphoreID(1);
|
||||
}
|
||||
|
||||
@@ -3915,7 +3915,7 @@ Error RenderingDeviceDriverMetal::_create_device() {
|
||||
ERR_FAIL_NULL_V(device_queue, ERR_CANT_CREATE);
|
||||
|
||||
device_scope = [MTLCaptureManager.sharedCaptureManager newCaptureScopeWithCommandQueue:device_queue];
|
||||
device_scope.label = @"Godot Frame";
|
||||
device_scope.label = @"Redot Frame";
|
||||
[device_scope beginScope]; // Allow Xcode to capture the first frame, if desired.
|
||||
|
||||
resource_cache = std::make_unique<MDResourceCache>(this);
|
||||
@@ -3952,7 +3952,7 @@ Error RenderingDeviceDriverMetal::initialize(uint32_t p_device_index, uint32_t p
|
||||
// Check required features and abort if any of them is missing.
|
||||
if (!metal_device_properties->features.imageCubeArray) {
|
||||
// NOTE: Apple A11 (Apple4) GPUs support image cube arrays, which are devices from 2017 and newer.
|
||||
String error_string = vformat("Your Apple GPU does not support the following features which are required to use Metal-based renderers in Godot:\n\n");
|
||||
String error_string = vformat("Your Apple GPU does not support the following features which are required to use Metal-based renderers in Redot:\n\n");
|
||||
if (!metal_device_properties->features.imageCubeArray) {
|
||||
error_string += "- No support for image cube arrays.\n";
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ if env["builtin_libpng"]:
|
||||
env.drivers_sources += thirdparty_obj
|
||||
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
|
||||
driver_obj = []
|
||||
|
||||
|
||||
@@ -81,7 +81,7 @@ Ref<Image> ImageLoaderPNG::lossless_unpack_png(const Vector<uint8_t> &p_data) {
|
||||
Vector<uint8_t> ImageLoaderPNG::lossless_pack_png(const Ref<Image> &p_image) {
|
||||
Vector<uint8_t> out_buffer;
|
||||
|
||||
// add Godot's own "PNG " prefix
|
||||
// add Redot's own "PNG " prefix
|
||||
if (out_buffer.resize(4) != OK) {
|
||||
ERR_FAIL_V(Vector<uint8_t>());
|
||||
}
|
||||
|
||||
@@ -194,7 +194,7 @@ Error AudioDriverPulseAudio::init_output_device() {
|
||||
// Detect the amount of channels PulseAudio is using
|
||||
// Note: If using an even amount of channels (2, 4, etc) channels and pa_map.channels will be equal,
|
||||
// if not then pa_map.channels will have the real amount of channels PulseAudio is using and channels
|
||||
// will have the amount of channels Godot is using (in this case it's pa_map.channels + 1)
|
||||
// will have the amount of channels Redot is using (in this case it's pa_map.channels + 1)
|
||||
Error err = detect_channels();
|
||||
if (err != OK) {
|
||||
// This most likely means there are no sinks.
|
||||
|
||||
@@ -973,7 +973,7 @@ void UnixTerminalLogger::log_error(const char *p_function, const char *p_file, i
|
||||
}
|
||||
|
||||
// Disable color codes if stdout is not a TTY.
|
||||
// This prevents Godot from writing ANSI escape codes when redirecting
|
||||
// This prevents Redot from writing ANSI escape codes when redirecting
|
||||
// stdout and stderr to a file.
|
||||
const bool tty = isatty(fileno(stdout));
|
||||
const char *gray = tty ? "\E[0;90m" : "";
|
||||
|
||||
@@ -54,7 +54,7 @@ env_thirdparty_vma.add_source_files(thirdparty_obj, thirdparty_sources_vma)
|
||||
env.drivers_sources += thirdparty_obj
|
||||
|
||||
|
||||
# Godot source files
|
||||
# Redot source files
|
||||
|
||||
driver_obj = []
|
||||
|
||||
|
||||
@@ -568,7 +568,7 @@ Error RenderingDeviceDriverVulkan::_check_device_features() {
|
||||
|
||||
// Check for required features.
|
||||
if (!physical_device_features.imageCubeArray || !physical_device_features.independentBlend) {
|
||||
String error_string = vformat("Your GPU (%s) does not support the following features which are required to use Vulkan-based renderers in Godot:\n\n", context_device.name);
|
||||
String error_string = vformat("Your GPU (%s) does not support the following features which are required to use Vulkan-based renderers in Redot:\n\n", context_device.name);
|
||||
if (!physical_device_features.imageCubeArray) {
|
||||
error_string += "- No support for image cube arrays.\n";
|
||||
}
|
||||
@@ -733,7 +733,7 @@ Error RenderingDeviceDriverVulkan::_check_device_capabilities() {
|
||||
|
||||
if (use_1_2_features) {
|
||||
#ifdef MACOS_ENABLED
|
||||
ERR_FAIL_COND_V_MSG(!device_features_vk_1_2.shaderSampledImageArrayNonUniformIndexing, ERR_CANT_CREATE, "Your GPU doesn't support shaderSampledImageArrayNonUniformIndexing which is required to use the Vulkan-based renderers in Godot.");
|
||||
ERR_FAIL_COND_V_MSG(!device_features_vk_1_2.shaderSampledImageArrayNonUniformIndexing, ERR_CANT_CREATE, "Your GPU doesn't support shaderSampledImageArrayNonUniformIndexing which is required to use the Vulkan-based renderers in Redot.");
|
||||
#endif
|
||||
if (enabled_device_extension_names.has(VK_KHR_SHADER_FLOAT16_INT8_EXTENSION_NAME)) {
|
||||
shader_capabilities.shader_float16_is_supported = device_features_vk_1_2.shaderFloat16;
|
||||
@@ -2525,7 +2525,7 @@ Error RenderingDeviceDriverVulkan::command_queue_execute_and_present(CommandQueu
|
||||
|
||||
// Handling VK_SUBOPTIMAL_KHR the same as VK_SUCCESS is completely intentional.
|
||||
//
|
||||
// Godot does not currently support native rotation in Android when creating the swap chain. It intentionally uses
|
||||
// Redot does not currently support native rotation in Android when creating the swap chain. It intentionally uses
|
||||
// VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR instead of the current transform bits available in the surface capabilities.
|
||||
// Choosing the transform that leads to optimal presentation leads to distortion that makes the application unusable,
|
||||
// as the rotation of all the content is not handled at the moment.
|
||||
@@ -2866,7 +2866,7 @@ Error RenderingDeviceDriverVulkan::swap_chain_resize(CommandQueueID p_cmd_queue,
|
||||
}
|
||||
|
||||
// Prefer identity transform if it's supported, use the current transform otherwise.
|
||||
// This behavior is intended as Godot does not supported native rotation in platforms that use these bits.
|
||||
// This behavior is intended as Redot does not supported native rotation in platforms that use these bits.
|
||||
// Refer to the comment in command_queue_present() for more details.
|
||||
VkSurfaceTransformFlagBitsKHR surface_transform_bits;
|
||||
if (surface_capabilities.supportedTransforms & VK_SURFACE_TRANSFORM_IDENTITY_BIT_KHR) {
|
||||
@@ -3238,7 +3238,7 @@ Vector<uint8_t> RenderingDeviceDriverVulkan::shader_compile_binary_from_spirv(Ve
|
||||
binptr[0] = 'G';
|
||||
binptr[1] = 'S';
|
||||
binptr[2] = 'B';
|
||||
binptr[3] = 'D'; // Godot Shader Binary Data.
|
||||
binptr[3] = 'D'; // Redot Shader Binary Data.
|
||||
offset += 4;
|
||||
encode_uint32(ShaderBinary::VERSION, binptr + offset);
|
||||
offset += sizeof(uint32_t);
|
||||
|
||||
Reference in New Issue
Block a user