diff options
| author | Juan Linietsky <reduzio@gmail.com> | 2021-08-26 10:24:48 -0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-26 10:24:48 -0300 |
| commit | 227ab247386e5561fcb369acc6d34d5f4038c1cf (patch) | |
| tree | bf110dec6a4267ec3f0624bbeb99248480625bda /drivers | |
| parent | eb940ca2a02b507fc0e98da483b5a2da9ecd912d (diff) | |
| parent | 64626cc435448037c3d0045f57771ff9912d146c (diff) | |
| download | redot-engine-227ab247386e5561fcb369acc6d34d5f4038c1cf.tar.gz | |
Merge pull request #51870 from BastiaanOlij/half_resolution_3d
Optionally render 3D content at scaled resolution
Diffstat (limited to 'drivers')
| -rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 8 | ||||
| -rw-r--r-- | drivers/vulkan/rendering_device_vulkan.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 2de8b9025c..6ad24f255f 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -2740,6 +2740,14 @@ bool RenderingDeviceVulkan::texture_is_valid(RID p_texture) { return texture_owner.owns(p_texture); } +Size2i RenderingDeviceVulkan::texture_size(RID p_texture) { + _THREAD_SAFE_METHOD_ + + Texture *tex = texture_owner.getornull(p_texture); + ERR_FAIL_COND_V(!tex, Size2i()); + return Size2i(tex->width, tex->height); +} + Error RenderingDeviceVulkan::texture_copy(RID p_from_texture, RID p_to_texture, const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_size, uint32_t p_src_mipmap, uint32_t p_dst_mipmap, uint32_t p_src_layer, uint32_t p_dst_layer, uint32_t p_post_barrier) { _THREAD_SAFE_METHOD_ diff --git a/drivers/vulkan/rendering_device_vulkan.h b/drivers/vulkan/rendering_device_vulkan.h index 5ee2ca07f2..dc1b78c1d5 100644 --- a/drivers/vulkan/rendering_device_vulkan.h +++ b/drivers/vulkan/rendering_device_vulkan.h @@ -1044,6 +1044,7 @@ public: virtual bool texture_is_format_supported_for_usage(DataFormat p_format, uint32_t p_usage) const; virtual bool texture_is_shared(RID p_texture); virtual bool texture_is_valid(RID p_texture); + virtual Size2i texture_size(RID p_texture); virtual Error texture_copy(RID p_from_texture, RID p_to_texture, const Vector3 &p_from, const Vector3 &p_to, const Vector3 &p_size, uint32_t p_src_mipmap, uint32_t p_dst_mipmap, uint32_t p_src_layer, uint32_t p_dst_layer, uint32_t p_post_barrier = BARRIER_MASK_ALL); virtual Error texture_clear(RID p_texture, const Color &p_color, uint32_t p_base_mipmap, uint32_t p_mipmaps, uint32_t p_base_layer, uint32_t p_layers, uint32_t p_post_barrier = BARRIER_MASK_ALL); |
