1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Replace size() == 0 with is_empty().

This commit is contained in:
Yufeng Ying
2025-03-20 00:07:31 +08:00
parent c7ea8614d7
commit 4f4031a675
147 changed files with 300 additions and 300 deletions

View File

@@ -282,7 +282,7 @@ void ShaderRD::_compile_variant(uint32_t p_variant, CompileData p_data) {
current_source = builder.as_string();
RD::ShaderStageSPIRVData stage;
stage.spirv = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_VERTEX, current_source, RD::SHADER_LANGUAGE_GLSL, &error);
if (stage.spirv.size() == 0) {
if (stage.spirv.is_empty()) {
build_ok = false;
} else {
stage.shader_stage = RD::SHADER_STAGE_VERTEX;
@@ -300,7 +300,7 @@ void ShaderRD::_compile_variant(uint32_t p_variant, CompileData p_data) {
current_source = builder.as_string();
RD::ShaderStageSPIRVData stage;
stage.spirv = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_FRAGMENT, current_source, RD::SHADER_LANGUAGE_GLSL, &error);
if (stage.spirv.size() == 0) {
if (stage.spirv.is_empty()) {
build_ok = false;
} else {
stage.shader_stage = RD::SHADER_STAGE_FRAGMENT;
@@ -319,7 +319,7 @@ void ShaderRD::_compile_variant(uint32_t p_variant, CompileData p_data) {
RD::ShaderStageSPIRVData stage;
stage.spirv = RD::get_singleton()->shader_compile_spirv_from_source(RD::SHADER_STAGE_COMPUTE, current_source, RD::SHADER_LANGUAGE_GLSL, &error);
if (stage.spirv.size() == 0) {
if (stage.spirv.is_empty()) {
build_ok = false;
} else {
stage.shader_stage = RD::SHADER_STAGE_COMPUTE;