Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
8da6950
Add all PowerVR devices to the ban list for disabling the transform f…
clayjohn Oct 6, 2025
33d385b
RenderingDevice: Add null checks when retrieving uniform sets
akien-mga Dec 15, 2025
f767a38
Create new pools when they become fragmented on Vulkan.
blueskythlikesclouds Dec 22, 2025
13bbeb8
Implement workaround for GPU driver crash on Adreno 5XX.
blueskythlikesclouds Dec 29, 2025
b362e2e
Create separate graphics queue instead of reusing the main queue when…
blueskythlikesclouds Dec 31, 2025
6c2d9c8
Always add Vulkan descriptor count for immutable samplers to descript…
DarioSamo Jan 6, 2026
97bfe49
Fix setting mesh blend shape properties in dummy mesh storage
nikitalita Dec 26, 2025
965097e
Use GL_FRAMEBUFFER instead of GL_DRAW_FRAMEBUFFER when doing final bl…
clayjohn Oct 20, 2025
a01d8c2
Clamp minimum size of 3D texture view in D3D12.
DarioSamo Sep 2, 2025
19c3e39
Fix D3D12 not checking for fullscreen clear region correctly.
blueskythlikesclouds Oct 6, 2025
5f687a2
Fix specialization constant patching on D3D12.
blueskythlikesclouds Oct 7, 2025
d82e24b
Force disable SPIRV debug info on D3D12.
blueskythlikesclouds Oct 22, 2025
13c1531
Greatly reduce shader conversion time & fix spec constant bitmasking …
blueskythlikesclouds Oct 17, 2025
a021e7a
Check for Typed UAV Load Additional Formats capability when creating …
blueskythlikesclouds Nov 20, 2025
7083143
Move D3D12's automatic texture clears to RenderingDevice.
DarioSamo Jul 22, 2025
b2c02b7
Check for pending clears in every RD texture function.
blueskythlikesclouds Nov 27, 2025
967e028
Remove amplification & mesh shader deny flags on D3D12.
blueskythlikesclouds Jan 5, 2026
43ec3e6
Fix spotlight's shadow with volumetric fog
Flarkk Aug 13, 2025
7e50ad1
Fix rounding error in clustered vertex light culling
Namey5 Sep 1, 2025
efdf224
Fix `CompositorEffect` not setting post-transparent callback on init
beicause Sep 4, 2025
1e01637
Fix fixed size flag on StandardMaterial3D when rendering in stereo
BastiaanOlij Sep 11, 2025
b1d1a2e
Use correct AABB for SpotLight3Ds when spot_angle > 90
Kaleb-Reid Sep 25, 2025
1b7d509
Clear intermediate buffers when not in use in Compatibility
Kaleb-Reid Sep 25, 2025
152fa5b
Ensure reflection atlas is valid before rendering
Kaleb-Reid Sep 24, 2025
b97b2cc
FTI - Fix `SceneTreeFTI` depth limit behaviour
lawnjelly Oct 9, 2025
1100fc4
Use correct shadow material in some cases in Mobile
Kaleb-Reid Oct 14, 2025
06acb82
fixes the lods array returned by mesh_get_surface
benbot Oct 16, 2025
bde8a7d
Use correct ndc for proximity fade in Compatibility
Kaleb-Reid Oct 8, 2025
747f69f
Fix missing mipmaps for RB_TEX_BACK_COLOR
skorpnok Nov 18, 2025
3eea415
Use Viewport's 3D Scaling in the 3D editor's Half Resolution option
Calinou Jun 21, 2024
bbba6f1
set shader path before compilation
TheDying0fLight Dec 2, 2025
f25f3e5
Use AABB center instead of origin for visibility fade
ttencate Dec 3, 2025
f0d07ef
Disable shader baker when exporting as dedicated server
Calinou Nov 3, 2025
2fd341e
Apply luminance multiplier in copy_cubemap_to_panorama
Kaleb-Reid Oct 13, 2025
acb19db
fixed tile map tiles displaying incorrectly based on visibility layer
WesleyClements Sep 16, 2025
190b6e1
Fix shader compilation errors in Compatibility when using `depth_text…
Calinou Sep 3, 2025
f3c380a
Apply PREMUL_ALPHA_FACTOR only in non-split-specular shader variants.
clayjohn Nov 15, 2025
66f2e90
Fix shader baker freezing if there are errors in the shader compilati…
jitspoe Nov 15, 2025
7b74d0d
Fixed an issue where nodes' relative positions changed when opened in…
jj11hh Sep 29, 2024
9e1d0be
VisualShader: fix new node spawning position with display scaling
MattiaZir Dec 13, 2025
a6531b8
Only check material initialization for CanvasMaterial
AdelynneBrito Dec 5, 2025
fe8d644
Fix CPUParticle3D not randomizing
QbieShay Nov 7, 2025
9cf1ddb
Fix XR tracker name changing at runtime
dsnopek Sep 19, 2025
23e3457
OpenXR: When visibility mask extension does not return a mask, don't …
BastiaanOlij Dec 19, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 7 additions & 30 deletions drivers/d3d12/rendering_device_driver_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1573,12 +1573,6 @@ RDD::TextureID RenderingDeviceDriverD3D12::texture_create(const TextureFormat &p
tex_info->view_descs.srv = srv_desc;
tex_info->view_descs.uav = uav_desc;

if (!barrier_capabilities.enhanced_barriers_supported && (p_format.usage_bits & (TEXTURE_USAGE_STORAGE_BIT | TEXTURE_USAGE_COLOR_ATTACHMENT_BIT))) {
// Fallback to clear resources when they're first used in a uniform set. Not necessary if enhanced barriers
// are supported, as the discard flag will be used instead when transitioning from an undefined layout.
textures_pending_clear.add(&tex_info->pending_clear);
}

return TextureID(tex_info);
}

Expand Down Expand Up @@ -3055,7 +3049,7 @@ D3D12_UNORDERED_ACCESS_VIEW_DESC RenderingDeviceDriverD3D12::_make_ranged_uav_fo
} break;
case D3D12_UAV_DIMENSION_TEXTURE3D: {
uav_desc.Texture3D.MipSlice = mip;
uav_desc.Texture3D.WSize >>= p_mipmap_offset;
uav_desc.Texture3D.WSize = MAX(uav_desc.Texture3D.WSize >> p_mipmap_offset, 1U);
} break;
default:
break;
Expand Down Expand Up @@ -3643,21 +3637,6 @@ void RenderingDeviceDriverD3D12::command_uniform_set_prepare_for_use(CommandBuff
return;
}

// Perform pending blackouts.
{
SelfList<TextureInfo> *E = textures_pending_clear.first();
while (E) {
TextureSubresourceRange subresources;
subresources.layer_count = E->self()->layers;
subresources.mipmap_count = E->self()->mipmaps;
command_clear_color_texture(p_cmd_buffer, TextureID(E->self()), TEXTURE_LAYOUT_UNDEFINED, Color(), subresources);

SelfList<TextureInfo> *next = E->next();
E->remove_from_list();
E = next;
}
}

CommandBufferInfo *cmd_buf_info = (CommandBufferInfo *)p_cmd_buffer.id;
const UniformSetInfo *uniform_set_info = (const UniformSetInfo *)p_uniform_set.id;
const ShaderInfo *shader_info_in = (const ShaderInfo *)p_shader.id;
Expand Down Expand Up @@ -4571,8 +4550,7 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd
p_rect.position.y,
p_rect.position.x + p_rect.size.x,
p_rect.position.y + p_rect.size.y);
cmd_buf_info->render_pass_state.region_is_all = !(
cmd_buf_info->render_pass_state.region_rect.left == 0 &&
cmd_buf_info->render_pass_state.region_is_all = (cmd_buf_info->render_pass_state.region_rect.left == 0 &&
cmd_buf_info->render_pass_state.region_rect.top == 0 &&
cmd_buf_info->render_pass_state.region_rect.right == fb_info->size.x &&
cmd_buf_info->render_pass_state.region_rect.bottom == fb_info->size.y);
Expand Down Expand Up @@ -4616,7 +4594,6 @@ void RenderingDeviceDriverD3D12::command_begin_render_pass(CommandBufferID p_cmd
if (pass_info->attachments[i].load_op == ATTACHMENT_LOAD_OP_CLEAR) {
clear.aspect.set_flag(TEXTURE_ASPECT_COLOR_BIT);
clear.color_attachment = i;
tex_info->pending_clear.remove_from_list();
}
} else if ((tex_info->desc.Flags & D3D12_RESOURCE_FLAG_ALLOW_DEPTH_STENCIL)) {
if (pass_info->attachments[i].load_op == ATTACHMENT_LOAD_OP_CLEAR) {
Expand Down Expand Up @@ -5799,6 +5776,8 @@ uint64_t RenderingDeviceDriverD3D12::api_trait_get(ApiTrait p_trait) {
return true;
case API_TRAIT_BUFFERS_REQUIRE_TRANSITIONS:
return !barrier_capabilities.enhanced_barriers_supported;
case API_TRAIT_TEXTURE_OUTPUTS_REQUIRE_CLEARS:
return true;
default:
return RenderingDeviceDriver::api_trait_get(p_trait);
}
Expand All @@ -5807,7 +5786,7 @@ uint64_t RenderingDeviceDriverD3D12::api_trait_get(ApiTrait p_trait) {
bool RenderingDeviceDriverD3D12::has_feature(Features p_feature) {
switch (p_feature) {
case SUPPORTS_HALF_FLOAT:
return shader_capabilities.native_16bit_ops && storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported;
return shader_capabilities.native_16bit_ops;
case SUPPORTS_FRAGMENT_SHADER_WITH_ONLY_SIDE_EFFECTS:
return true;
case SUPPORTS_BUFFER_DEVICE_ADDRESS:
Expand Down Expand Up @@ -6037,7 +6016,6 @@ Error RenderingDeviceDriverD3D12::_check_capabilities() {
subgroup_capabilities.wave_ops_supported = false;
shader_capabilities.shader_model = (D3D_SHADER_MODEL)0;
shader_capabilities.native_16bit_ops = false;
storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported = false;
format_capabilities.relaxed_casting_supported = false;

{
Expand Down Expand Up @@ -6078,9 +6056,8 @@ Error RenderingDeviceDriverD3D12::_check_capabilities() {

D3D12_FEATURE_DATA_D3D12_OPTIONS options = {};
res = device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS, &options, sizeof(options));
if (SUCCEEDED(res)) {
storage_buffer_capabilities.storage_buffer_16_bit_access_is_supported = options.TypedUAVLoadAdditionalFormats;
}
ERR_FAIL_COND_V_MSG(!SUCCEEDED(res), ERR_UNAVAILABLE, "CheckFeatureSupport failed with error " + vformat("0x%08ux", (uint64_t)res) + ".");
ERR_FAIL_COND_V_MSG(!options.TypedUAVLoadAdditionalFormats, ERR_UNAVAILABLE, "No support for Typed UAV Load Additional Formats has been found.");

D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1 = {};
res = device->CheckFeatureSupport(D3D12_FEATURE_D3D12_OPTIONS1, &options1, sizeof(options1));
Expand Down
7 changes: 0 additions & 7 deletions drivers/d3d12/rendering_device_driver_d3d12.h
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,6 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
bool native_16bit_ops = false;
};

struct StorageBufferCapabilities {
bool storage_buffer_16_bit_access_is_supported = false;
};

struct FormatCapabilities {
bool relaxed_casting_supported = false;
};
Expand All @@ -143,7 +139,6 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
FragmentShadingRateCapabilities fsr_capabilities;
FragmentDensityMapCapabilities fdm_capabilities;
ShaderCapabilities shader_capabilities;
StorageBufferCapabilities storage_buffer_capabilities;
FormatCapabilities format_capabilities;
BarrierCapabilities barrier_capabilities;
MiscFeaturesSupport misc_features_support;
Expand Down Expand Up @@ -360,12 +355,10 @@ class RenderingDeviceDriverD3D12 : public RenderingDeviceDriver {
TextureInfo *main_texture = nullptr;

UINT mapped_subresource = UINT_MAX;
SelfList<TextureInfo> pending_clear{ this };
#ifdef DEBUG_ENABLED
bool created_from_extension = false;
#endif
};
SelfList<TextureInfo>::List textures_pending_clear;

HashMap<DXGI_FORMAT, uint32_t> format_sample_counts_mask_cache;
Mutex format_sample_counts_mask_cache_mutex;
Expand Down
40 changes: 16 additions & 24 deletions drivers/d3d12/rendering_shader_container_d3d12.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -99,28 +99,26 @@ uint32_t RenderingDXIL::patch_specialization_constant(
const uint64_t (&p_stages_bit_offsets)[D3D12_BITCODE_OFFSETS_NUM_STAGES],
HashMap<RenderingDeviceCommons::ShaderStage, Vector<uint8_t>> &r_stages_bytecodes,
bool p_is_first_patch) {
uint32_t patch_val = 0;
int64_t patch_val = 0;
switch (p_type) {
case RenderingDeviceCommons::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_INT: {
uint32_t int_value = *((const int *)p_value);
ERR_FAIL_COND_V(int_value & (1 << 31), 0);
patch_val = int_value;
patch_val = *((const int32_t *)p_value);
} break;
case RenderingDeviceCommons::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_BOOL: {
bool bool_value = *((const bool *)p_value);
patch_val = (uint32_t)bool_value;
patch_val = (int32_t)bool_value;
} break;
case RenderingDeviceCommons::PIPELINE_SPECIALIZATION_CONSTANT_TYPE_FLOAT: {
uint32_t int_value = *((const int *)p_value);
ERR_FAIL_COND_V(int_value & (1 << 31), 0);
patch_val = (int_value >> 1);
patch_val = *((const int32_t *)p_value);
} break;
}
// For VBR encoding to encode the number of bits we expect (32), we need to set the MSB unconditionally.
// However, signed VBR moves the MSB to the LSB, so setting the MSB to 1 wouldn't help. Therefore,
// the bit we set to 1 is the one at index 30.
patch_val |= (1 << 30);
patch_val <<= 1; // What signed VBR does.

// Encode to signed VBR.
if (patch_val >= 0) {
patch_val <<= 1;
} else {
patch_val = ((-patch_val) << 1) | 1;
}

auto tamper_bits = [](uint8_t *p_start, uint64_t p_bit_offset, uint64_t p_tb_value) -> uint64_t {
uint64_t original = 0;
Expand Down Expand Up @@ -174,13 +172,13 @@ uint32_t RenderingDXIL::patch_specialization_constant(

Vector<uint8_t> &bytecode = r_stages_bytecodes[(RenderingDeviceCommons::ShaderStage)stage];
#ifdef DEV_ENABLED
uint64_t orig_patch_val = tamper_bits(bytecode.ptrw(), offset, patch_val);
uint64_t orig_patch_val = tamper_bits(bytecode.ptrw(), offset, (uint64_t)patch_val);
// Checking against the value the NIR patch should have set.
DEV_ASSERT(!p_is_first_patch || ((orig_patch_val >> 1) & GODOT_NIR_SC_SENTINEL_MAGIC_MASK) == GODOT_NIR_SC_SENTINEL_MAGIC);
uint64_t readback_patch_val = tamper_bits(bytecode.ptrw(), offset, patch_val);
DEV_ASSERT(readback_patch_val == patch_val);
uint64_t readback_patch_val = tamper_bits(bytecode.ptrw(), offset, (uint64_t)patch_val);
DEV_ASSERT(readback_patch_val == (uint64_t)patch_val);
#else
tamper_bits(bytecode.ptrw(), offset, patch_val);
tamper_bits(bytecode.ptrw(), offset, (uint64_t)patch_val);
#endif

stages_patched_mask |= (1 << stage);
Expand Down Expand Up @@ -319,10 +317,6 @@ bool RenderingShaderContainerD3D12::_convert_spirv_to_nir(const Vector<Rendering

ERR_FAIL_NULL_V_MSG(shader, false, "Shader translation (step 1) at stage " + String(RenderingDeviceCommons::SHADER_STAGE_NAMES[stage]) + " failed.");

#ifdef DEV_ENABLED
nir_validate_shader(shader, "Validate before feeding NIR to the DXIL compiler");
#endif

if (stage == RenderingDeviceCommons::SHADER_STAGE_VERTEX) {
dxil_runtime_conf.yz_flip.y_mask = 0xffff;
dxil_runtime_conf.yz_flip.mode = DXIL_SPIRV_Y_FLIP_UNCONDITIONAL;
Expand Down Expand Up @@ -621,9 +615,7 @@ bool RenderingShaderContainerD3D12::_generate_root_signature(BitField<RenderingD
D3D12_ROOT_SIGNATURE_FLAGS root_sig_flags =
D3D12_ROOT_SIGNATURE_FLAG_DENY_HULL_SHADER_ROOT_ACCESS |
D3D12_ROOT_SIGNATURE_FLAG_DENY_DOMAIN_SHADER_ROOT_ACCESS |
D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS |
D3D12_ROOT_SIGNATURE_FLAG_DENY_AMPLIFICATION_SHADER_ROOT_ACCESS |
D3D12_ROOT_SIGNATURE_FLAG_DENY_MESH_SHADER_ROOT_ACCESS;
D3D12_ROOT_SIGNATURE_FLAG_DENY_GEOMETRY_SHADER_ROOT_ACCESS;

if (!p_stages_processed.has_flag(RenderingDeviceCommons::SHADER_STAGE_VERTEX_BIT)) {
root_sig_flags |= D3D12_ROOT_SIGNATURE_FLAG_DENY_VERTEX_SHADER_ROOT_ACCESS;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/rasterizer_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -410,7 +410,7 @@ void RasterizerGLES3::_blit_render_target_to_screen(DisplayServer::WindowID p_sc
}
#endif

glBindFramebuffer(GL_DRAW_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);
glBindFramebuffer(GL_FRAMEBUFFER, GLES3::TextureStorage::system_fbo);

if (p_first) {
if (p_blit.dst_rect.position != Vector2() || p_blit.dst_rect.size != rt->size) {
Expand Down
12 changes: 6 additions & 6 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1022,12 +1022,6 @@ uniform highp mat4 world_transform;
uniform highp uint instance_offset;
uniform highp uint model_flags;

/* clang-format off */

#GLOBALS

/* clang-format on */

#define LIGHT_BAKE_DISABLED 0u
#define LIGHT_BAKE_STATIC 1u
#define LIGHT_BAKE_DYNAMIC 2u
Expand Down Expand Up @@ -1268,6 +1262,12 @@ layout(location = 0) out vec4 frag_color;

#endif // !RENDER_MATERIAL

/* clang-format off */

#GLOBALS

/* clang-format on */

vec3 F0(float metallic, float specular, vec3 albedo) {
float dielectric = 0.16 * specular * specular;
// use albedo * metallic as colored specular reflectance at 0 angle for metallic materials;
Expand Down
2 changes: 1 addition & 1 deletion drivers/gles3/storage/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ Config::Config() {
//https://github.com/godotengine/godot/issues/92662#issuecomment-2161199477
//disable_particles_workaround = false;
}
} else if (rendering_device_name == "PowerVR Rogue GE8320") {
} else if (rendering_device_name.contains("PowerVR")) {
disable_transform_feedback_shader_cache = true;
}

Expand Down
12 changes: 11 additions & 1 deletion drivers/gles3/storage/light_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,14 @@ AABB LightStorage::light_get_aabb(RID p_light) const {
switch (light->type) {
case RS::LIGHT_SPOT: {
float len = light->param[RS::LIGHT_PARAM_RANGE];
float size = Math::tan(Math::deg_to_rad(light->param[RS::LIGHT_PARAM_SPOT_ANGLE])) * len;
float angle = Math::deg_to_rad(light->param[RS::LIGHT_PARAM_SPOT_ANGLE]);

if (angle > Math::PI * 0.5) {
// Light casts backwards as well.
return AABB(Vector3(-1, -1, -1) * len, Vector3(2, 2, 2) * len);
}

float size = Math::sin(angle) * len;
return AABB(Vector3(-size, -size, -len), Vector3(size * 2, size * 2, len));
};
case RS::LIGHT_OMNI: {
Expand Down Expand Up @@ -807,6 +814,9 @@ bool LightStorage::reflection_probe_instance_begin_render(RID p_instance, RID p_

ERR_FAIL_NULL_V(atlas, false);

ERR_FAIL_COND_V_MSG(atlas->size < 4, false, "Attempted to render to a reflection atlas of invalid resolution.");
ERR_FAIL_COND_V_MSG(atlas->count < 1, false, "Attempted to render to a reflection atlas of size < 1.");

ReflectionProbeInstance *rpi = reflection_probe_instance_owner.get_or_null(p_instance);
ERR_FAIL_NULL_V(rpi, false);

Expand Down
1 change: 1 addition & 0 deletions drivers/gles3/storage/material_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2265,6 +2265,7 @@ void MaterialStorage::shader_set_code(RID p_shader, const String &p_code) {
}

if (shader->data) {
shader->data->set_path_hint(shader->path_hint);
shader->data->set_code(p_code);
}

Expand Down
4 changes: 4 additions & 0 deletions drivers/gles3/storage/render_scene_buffers_gles3.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,10 @@ void RenderSceneBuffersGLES3::_check_render_buffers() {
uint32_t depth_format_size = 4;
bool use_multiview = view_count > 1;

if (!use_internal_buffer && internal3d.color != 0) {
_clear_intermediate_buffers();
}

if ((!use_internal_buffer || internal3d.color != 0) && (msaa3d.mode == RS::VIEWPORT_MSAA_DISABLED || msaa3d.color != 0)) {
// already setup!
return;
Expand Down
Loading