mirror of
https://github.com/godotengine/godot
synced 2024-09-04 22:48:26 +00:00
Rename RD texture "type" to "texture_type"
"type" isn't very descriptive for exposed code, and this variable is exposed via RD_SETGET.
This commit is contained in:
parent
19bdd01438
commit
5dddf4377a
|
@ -37,7 +37,7 @@
|
|||
</member>
|
||||
<member name="samples" type="int" setter="set_samples" getter="get_samples" enum="RenderingDevice.TextureSamples" default="0">
|
||||
</member>
|
||||
<member name="type" type="int" setter="set_type" getter="get_type" enum="RenderingDevice.TextureType" default="1">
|
||||
<member name="texture_type" type="int" setter="set_texture_type" getter="get_texture_type" enum="RenderingDevice.TextureType" default="1">
|
||||
</member>
|
||||
<member name="usage_bits" type="int" setter="set_usage_bits" getter="get_usage_bits" default="0">
|
||||
</member>
|
||||
|
|
|
@ -1692,16 +1692,16 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
|
|||
#endif
|
||||
}
|
||||
|
||||
if (p_format.type == TEXTURE_TYPE_CUBE || p_format.type == TEXTURE_TYPE_CUBE_ARRAY) {
|
||||
if (p_format.texture_type == TEXTURE_TYPE_CUBE || p_format.texture_type == TEXTURE_TYPE_CUBE_ARRAY) {
|
||||
image_create_info.flags |= VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT;
|
||||
}
|
||||
/*if (p_format.type == TEXTURE_TYPE_2D || p_format.type == TEXTURE_TYPE_2D_ARRAY) {
|
||||
image_create_info.flags |= VK_IMAGE_CREATE_2D_ARRAY_COMPATIBLE_BIT;
|
||||
}*/
|
||||
|
||||
ERR_FAIL_INDEX_V(p_format.type, TEXTURE_TYPE_MAX, RID());
|
||||
ERR_FAIL_INDEX_V(p_format.texture_type, TEXTURE_TYPE_MAX, RID());
|
||||
|
||||
image_create_info.imageType = vulkan_image_type[p_format.type];
|
||||
image_create_info.imageType = vulkan_image_type[p_format.texture_type];
|
||||
|
||||
ERR_FAIL_COND_V_MSG(p_format.width < 1, RID(), "Width must be equal or greater than 1 for all textures");
|
||||
|
||||
|
@ -1726,10 +1726,10 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
|
|||
|
||||
image_create_info.mipLevels = p_format.mipmaps;
|
||||
|
||||
if (p_format.type == TEXTURE_TYPE_1D_ARRAY || p_format.type == TEXTURE_TYPE_2D_ARRAY || p_format.type == TEXTURE_TYPE_CUBE_ARRAY || p_format.type == TEXTURE_TYPE_CUBE) {
|
||||
if (p_format.texture_type == TEXTURE_TYPE_1D_ARRAY || p_format.texture_type == TEXTURE_TYPE_2D_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE) {
|
||||
ERR_FAIL_COND_V_MSG(p_format.array_layers < 1, RID(),
|
||||
"Amount of layers must be equal or greater than 1 for arrays and cubemaps.");
|
||||
ERR_FAIL_COND_V_MSG((p_format.type == TEXTURE_TYPE_CUBE_ARRAY || p_format.type == TEXTURE_TYPE_CUBE) && (p_format.array_layers % 6) != 0, RID(),
|
||||
ERR_FAIL_COND_V_MSG((p_format.texture_type == TEXTURE_TYPE_CUBE_ARRAY || p_format.texture_type == TEXTURE_TYPE_CUBE) && (p_format.array_layers % 6) != 0, RID(),
|
||||
"Cubemap and cubemap array textures must provide a layer number that is multiple of 6");
|
||||
image_create_info.arrayLayers = p_format.array_layers;
|
||||
} else {
|
||||
|
@ -1859,7 +1859,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
|
|||
VkResult err = vmaCreateImage(allocator, &image_create_info, &allocInfo, &texture.image, &texture.allocation, &texture.allocation_info);
|
||||
ERR_FAIL_COND_V_MSG(err, RID(), "vmaCreateImage failed with error " + itos(err) + ".");
|
||||
|
||||
texture.type = p_format.type;
|
||||
texture.type = p_format.texture_type;
|
||||
texture.format = p_format.format;
|
||||
texture.width = image_create_info.extent.width;
|
||||
texture.height = image_create_info.extent.height;
|
||||
|
@ -1927,7 +1927,7 @@ RID RenderingDeviceVulkan::texture_create(const TextureFormat &p_format, const T
|
|||
VK_IMAGE_VIEW_TYPE_CUBE_ARRAY,
|
||||
};
|
||||
|
||||
image_view_create_info.viewType = view_types[p_format.type];
|
||||
image_view_create_info.viewType = view_types[p_format.texture_type];
|
||||
if (p_view.format_override == DATA_FORMAT_MAX) {
|
||||
image_view_create_info.format = image_create_info.format;
|
||||
} else {
|
||||
|
|
|
@ -543,7 +543,7 @@ void LightmapperRD::_create_acceleration_structures(RenderingDevice *rd, Size2i
|
|||
tf.width = grid_size;
|
||||
tf.height = grid_size;
|
||||
tf.depth = grid_size;
|
||||
tf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
|
||||
Vector<Vector<uint8_t>> texdata;
|
||||
|
@ -695,7 +695,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
|
|||
tf.width = atlas_size.width;
|
||||
tf.height = atlas_size.height;
|
||||
tf.array_layers = atlas_slices;
|
||||
tf.type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tf.format = RD::DATA_FORMAT_R8G8B8A8_UNORM;
|
||||
|
||||
|
@ -917,7 +917,7 @@ LightmapperRD::BakeError LightmapperRD::bake(BakeQuality p_quality, bool p_use_d
|
|||
tf.width = atlas_size.width;
|
||||
tf.height = atlas_size.height;
|
||||
tf.depth = 1;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
tf.format = RD::DATA_FORMAT_D32_SFLOAT;
|
||||
|
||||
|
|
|
@ -190,7 +190,7 @@ void LightClusterBuilder::setup(uint32_t p_width, uint32_t p_height, uint32_t p_
|
|||
{
|
||||
RD::TextureFormat tf;
|
||||
tf.format = RD::DATA_FORMAT_R32G32B32A32_UINT;
|
||||
tf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf.width = width;
|
||||
tf.height = height;
|
||||
tf.depth = depth;
|
||||
|
|
|
@ -1564,7 +1564,7 @@ void RendererCanvasRenderRD::_update_shadow_atlas() {
|
|||
|
||||
{ //texture
|
||||
RD::TextureFormat tf;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.width = state.shadow_texture_size;
|
||||
tf.height = state.max_lights_per_render * 2;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
|
@ -1575,7 +1575,7 @@ void RendererCanvasRenderRD::_update_shadow_atlas() {
|
|||
}
|
||||
{
|
||||
RD::TextureFormat tf;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.width = state.shadow_texture_size;
|
||||
tf.height = state.max_lights_per_render * 2;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
|
@ -2667,7 +2667,7 @@ RendererCanvasRenderRD::RendererCanvasRenderRD(RendererStorageRD *p_storage) {
|
|||
{
|
||||
//default shadow texture to keep uniform set happy
|
||||
RD::TextureFormat tf;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.width = 4;
|
||||
tf.height = 4;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
|
@ -2740,7 +2740,7 @@ void RendererCanvasRenderRD::set_shadow_texture_size(int p_size) {
|
|||
{
|
||||
//create a default shadow texture to keep uniform set happy (and that it gets erased when a new one is created)
|
||||
RD::TextureFormat tf;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.width = 4;
|
||||
tf.height = 4;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
|
|
|
@ -717,7 +717,7 @@ void RendererSceneRenderForward::RenderBufferDataHighEnd::configure(RID p_color_
|
|||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.width = p_width;
|
||||
tf.height = p_height;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
|
||||
RD::TextureSamples ts[RS::VIEWPORT_MSAA_MAX] = {
|
||||
|
|
|
@ -129,7 +129,7 @@ void RendererSceneRenderRD::_update_reflection_data(ReflectionData &rd, int p_si
|
|||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.width = 64; // Always 64x64
|
||||
tf.height = 64;
|
||||
tf.type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.array_layers = 6;
|
||||
tf.mipmaps = 7;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
|
@ -284,7 +284,7 @@ void RendererSceneRenderRD::sdfgi_update(RID p_render_buffers, RID p_environment
|
|||
tf_sdf.width = sdfgi->cascade_size; // Always 64x64
|
||||
tf_sdf.height = sdfgi->cascade_size;
|
||||
tf_sdf.depth = sdfgi->cascade_size;
|
||||
tf_sdf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf_sdf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf_sdf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
|
||||
{
|
||||
|
@ -341,7 +341,7 @@ void RendererSceneRenderRD::sdfgi_update(RID p_render_buffers, RID p_environment
|
|||
tf_probes.width = sdfgi->probe_axis_count * sdfgi->probe_axis_count;
|
||||
tf_probes.height = sdfgi->probe_axis_count * SDFGI::SH_SIZE;
|
||||
tf_probes.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
tf_probes.type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
tf_probes.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
|
||||
sdfgi->history_size = requested_history_size;
|
||||
|
||||
|
@ -351,7 +351,7 @@ void RendererSceneRenderRD::sdfgi_update(RID p_render_buffers, RID p_environment
|
|||
|
||||
RD::TextureFormat tf_probe_average = tf_probes;
|
||||
tf_probe_average.format = RD::DATA_FORMAT_R32G32B32A32_SINT; //signed integer because SH are signed
|
||||
tf_probe_average.type = RD::TEXTURE_TYPE_2D;
|
||||
tf_probe_average.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
sdfgi->lightprobe_history_scroll = RD::get_singleton()->texture_create(tf_probe_history, RD::TextureView());
|
||||
sdfgi->lightprobe_average_scroll = RD::get_singleton()->texture_create(tf_probe_average, RD::TextureView());
|
||||
|
@ -378,7 +378,7 @@ void RendererSceneRenderRD::sdfgi_update(RID p_render_buffers, RID p_environment
|
|||
tf_ambient.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT; //pack well with RGBE
|
||||
tf_ambient.width = sdfgi->probe_axis_count * sdfgi->probe_axis_count;
|
||||
tf_ambient.height = sdfgi->probe_axis_count;
|
||||
tf_ambient.type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
tf_ambient.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
//lightprobe texture is an octahedral texture
|
||||
sdfgi->ambient_texture = RD::get_singleton()->texture_create(tf_ambient, RD::TextureView());
|
||||
}
|
||||
|
@ -1897,7 +1897,7 @@ void RendererSceneRenderRD::_update_dirty_skys() {
|
|||
RD::TextureFormat tf;
|
||||
tf.array_layers = layers * 6;
|
||||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
tf.mipmaps = mipmaps;
|
||||
tf.width = w;
|
||||
tf.height = h;
|
||||
|
@ -1912,7 +1912,7 @@ void RendererSceneRenderRD::_update_dirty_skys() {
|
|||
RD::TextureFormat tf;
|
||||
tf.array_layers = 6;
|
||||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.mipmaps = MIN(mipmaps, layers);
|
||||
tf.width = w;
|
||||
tf.height = h;
|
||||
|
@ -1932,7 +1932,7 @@ void RendererSceneRenderRD::_update_dirty_skys() {
|
|||
tformat.width = sky->screen_size.x / 2;
|
||||
tformat.height = sky->screen_size.y / 2;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
sky->half_res_pass = RD::get_singleton()->texture_create(tformat, RD::TextureView());
|
||||
Vector<RID> texs;
|
||||
|
@ -1947,7 +1947,7 @@ void RendererSceneRenderRD::_update_dirty_skys() {
|
|||
tformat.width = sky->screen_size.x / 4;
|
||||
tformat.height = sky->screen_size.y / 4;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
sky->quarter_res_pass = RD::get_singleton()->texture_create(tformat, RD::TextureView());
|
||||
Vector<RID> texs;
|
||||
|
@ -3331,7 +3331,7 @@ bool RendererSceneRenderRD::reflection_probe_instance_begin_render(RID p_instanc
|
|||
RD::TextureFormat tf;
|
||||
tf.array_layers = 6 * atlas->count;
|
||||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
tf.mipmaps = mipmaps;
|
||||
tf.width = atlas->size;
|
||||
tf.height = atlas->size;
|
||||
|
@ -3948,7 +3948,7 @@ RendererSceneRenderRD::ShadowCubemap *RendererSceneRenderRD::_get_shadow_cubemap
|
|||
tf.format = RD::get_singleton()->texture_is_format_supported_for_usage(RD::DATA_FORMAT_D32_SFLOAT, RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT) ? RD::DATA_FORMAT_D32_SFLOAT : RD::DATA_FORMAT_X8_D24_UNORM_PACK32;
|
||||
tf.width = p_size;
|
||||
tf.height = p_size;
|
||||
tf.type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_CUBE;
|
||||
tf.array_layers = 6;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
sc.cubemap = RD::get_singleton()->texture_create(tf, RD::TextureView());
|
||||
|
@ -4062,7 +4062,7 @@ void RendererSceneRenderRD::gi_probe_update(RID p_probe, bool p_update_light_ins
|
|||
tf.width = octree_size.x;
|
||||
tf.height = octree_size.y;
|
||||
tf.depth = octree_size.z;
|
||||
tf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf.mipmaps = levels.size();
|
||||
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT;
|
||||
|
@ -4950,7 +4950,7 @@ void RendererSceneRenderRD::_allocate_blur_textures(RenderBuffers *rb) {
|
|||
tf.format = RD::DATA_FORMAT_R16G16B16A16_SFLOAT;
|
||||
tf.width = rb->width;
|
||||
tf.height = rb->height;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT;
|
||||
tf.mipmaps = mipmaps_required;
|
||||
|
||||
|
@ -5123,7 +5123,7 @@ void RendererSceneRenderRD::_process_ssr(RID p_render_buffers, RID p_dest_frameb
|
|||
tf.format = RD::DATA_FORMAT_R32_SFLOAT;
|
||||
tf.width = rb->width / 2;
|
||||
tf.height = rb->height / 2;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_STORAGE_BIT;
|
||||
|
||||
rb->ssr.depth_scaled = RD::get_singleton()->texture_create(tf, RD::TextureView());
|
||||
|
@ -5138,7 +5138,7 @@ void RendererSceneRenderRD::_process_ssr(RID p_render_buffers, RID p_dest_frameb
|
|||
tf.format = RD::DATA_FORMAT_R8_UNORM;
|
||||
tf.width = rb->width / 2;
|
||||
tf.height = rb->height / 2;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
|
||||
rb->ssr.blur_radius[0] = RD::get_singleton()->texture_create(tf, RD::TextureView());
|
||||
|
@ -6543,7 +6543,7 @@ void RendererSceneRenderRD::_update_volumetric_fog(RID p_render_buffers, RID p_e
|
|||
tf.width = target_width;
|
||||
tf.height = target_height;
|
||||
tf.depth = volumetric_fog_depth;
|
||||
tf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_STORAGE_BIT;
|
||||
|
||||
rb->volumetric_fog->light_density_map = RD::get_singleton()->texture_create(tf, RD::TextureView());
|
||||
|
|
|
@ -567,7 +567,7 @@ RID RendererStorageRD::texture_2d_create(const Ref<Image> &p_image) {
|
|||
rd_format.depth = 1;
|
||||
rd_format.array_layers = 1;
|
||||
rd_format.mipmaps = texture.mipmaps;
|
||||
rd_format.type = texture.rd_type;
|
||||
rd_format.texture_type = texture.rd_type;
|
||||
rd_format.samples = RD::TEXTURE_SAMPLES_1;
|
||||
rd_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
if (texture.rd_format_srgb != RD::DATA_FORMAT_MAX) {
|
||||
|
@ -675,7 +675,7 @@ RID RendererStorageRD::texture_2d_layered_create(const Vector<Ref<Image>> &p_lay
|
|||
rd_format.depth = 1;
|
||||
rd_format.array_layers = texture.layers;
|
||||
rd_format.mipmaps = texture.mipmaps;
|
||||
rd_format.type = texture.rd_type;
|
||||
rd_format.texture_type = texture.rd_type;
|
||||
rd_format.samples = RD::TEXTURE_SAMPLES_1;
|
||||
rd_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
if (texture.rd_format_srgb != RD::DATA_FORMAT_MAX) {
|
||||
|
@ -793,7 +793,7 @@ RID RendererStorageRD::texture_3d_create(Image::Format p_format, int p_width, in
|
|||
rd_format.depth = texture.depth;
|
||||
rd_format.array_layers = 1;
|
||||
rd_format.mipmaps = texture.mipmaps;
|
||||
rd_format.type = texture.rd_type;
|
||||
rd_format.texture_type = texture.rd_type;
|
||||
rd_format.samples = RD::TEXTURE_SAMPLES_1;
|
||||
rd_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
if (texture.rd_format_srgb != RD::DATA_FORMAT_MAX) {
|
||||
|
@ -4679,7 +4679,7 @@ RID RendererStorageRD::particles_collision_get_heightfield_framebuffer(RID p_par
|
|||
tf.format = RD::DATA_FORMAT_D32_SFLOAT;
|
||||
tf.width = size.x;
|
||||
tf.height = size.y;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_DEPTH_STENCIL_ATTACHMENT_BIT;
|
||||
|
||||
particles_collision->heightfield_texture = RD::get_singleton()->texture_create(tf, RD::TextureView());
|
||||
|
@ -5588,7 +5588,7 @@ void RendererStorageRD::gi_probe_allocate(RID p_gi_probe, const Transform &p_to_
|
|||
tf.width = gi_probe->octree_size.x;
|
||||
tf.height = gi_probe->octree_size.y;
|
||||
tf.depth = gi_probe->octree_size.z;
|
||||
tf.type = RD::TEXTURE_TYPE_3D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
Vector<Vector<uint8_t>> s;
|
||||
s.push_back(p_distance_field);
|
||||
|
@ -6122,7 +6122,7 @@ void RendererStorageRD::_update_render_target(RenderTarget *rt) {
|
|||
rd_format.depth = 1;
|
||||
rd_format.array_layers = 1;
|
||||
rd_format.mipmaps = 1;
|
||||
rd_format.type = RD::TEXTURE_TYPE_2D;
|
||||
rd_format.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
rd_format.samples = RD::TEXTURE_SAMPLES_1;
|
||||
rd_format.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_CAN_COPY_FROM_BIT;
|
||||
rd_format.shareable_formats.push_back(rt->color_format);
|
||||
|
@ -6191,7 +6191,7 @@ void RendererStorageRD::_create_render_target_backbuffer(RenderTarget *rt) {
|
|||
tf.format = rt->color_format;
|
||||
tf.width = rt->size.width;
|
||||
tf.height = rt->size.height;
|
||||
tf.type = RD::TEXTURE_TYPE_2D;
|
||||
tf.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tf.usage_bits = RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT;
|
||||
tf.mipmaps = mipmaps_required;
|
||||
|
||||
|
@ -6420,7 +6420,7 @@ RID RendererStorageRD::render_target_get_sdf_texture(RID p_render_target) {
|
|||
tformat.width = 4;
|
||||
tformat.height = 4;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
@ -6447,7 +6447,7 @@ void RendererStorageRD::_render_target_allocate_sdf(RenderTarget *rt) {
|
|||
tformat.width = size.width;
|
||||
tformat.height = size.height;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_STORAGE_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
rt->sdf_buffer_write = RD::get_singleton()->texture_create(tformat, RD::TextureView());
|
||||
|
||||
|
@ -6983,7 +6983,7 @@ void RendererStorageRD::_update_decal_atlas() {
|
|||
tformat.width = decal_atlas.size.width;
|
||||
tformat.height = decal_atlas.size.height;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_COLOR_ATTACHMENT_BIT | RD::TEXTURE_USAGE_CAN_COPY_TO_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.mipmaps = decal_atlas.mipmaps;
|
||||
tformat.shareable_formats.push_back(RD::DATA_FORMAT_R8G8B8A8_UNORM);
|
||||
tformat.shareable_formats.push_back(RD::DATA_FORMAT_R8G8B8A8_SRGB);
|
||||
|
@ -7946,7 +7946,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.width = 4;
|
||||
tformat.height = 4;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
@ -8038,7 +8038,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.height = 4;
|
||||
tformat.array_layers = 6;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_CUBE_ARRAY;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
@ -8066,7 +8066,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.height = 4;
|
||||
tformat.array_layers = 6;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_CUBE;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_CUBE;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
@ -8094,7 +8094,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.height = 4;
|
||||
tformat.array_layers = 6;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_CUBE;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_CUBE;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
@ -8122,7 +8122,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.height = 4;
|
||||
tformat.depth = 4;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_3D;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_3D;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(64 * 4);
|
||||
|
@ -8148,7 +8148,7 @@ RendererStorageRD::RendererStorageRD() {
|
|||
tformat.height = 4;
|
||||
tformat.array_layers = 1;
|
||||
tformat.usage_bits = RD::TEXTURE_USAGE_SAMPLING_BIT | RD::TEXTURE_USAGE_CAN_UPDATE_BIT;
|
||||
tformat.type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
tformat.texture_type = RD::TEXTURE_TYPE_2D_ARRAY;
|
||||
|
||||
Vector<uint8_t> pv;
|
||||
pv.resize(16 * 4);
|
||||
|
|
|
@ -392,7 +392,7 @@ public:
|
|||
uint32_t depth;
|
||||
uint32_t array_layers;
|
||||
uint32_t mipmaps;
|
||||
TextureType type;
|
||||
TextureType texture_type;
|
||||
TextureSamples samples;
|
||||
uint32_t usage_bits;
|
||||
Vector<DataFormat> shareable_formats;
|
||||
|
@ -404,7 +404,7 @@ public:
|
|||
depth = 1;
|
||||
array_layers = 1;
|
||||
mipmaps = 1;
|
||||
type = TEXTURE_TYPE_2D;
|
||||
texture_type = TEXTURE_TYPE_2D;
|
||||
samples = TEXTURE_SAMPLES_1;
|
||||
usage_bits = 0;
|
||||
}
|
||||
|
|
|
@ -64,7 +64,7 @@ public:
|
|||
RD_SETGET(uint32_t, depth)
|
||||
RD_SETGET(uint32_t, array_layers)
|
||||
RD_SETGET(uint32_t, mipmaps)
|
||||
RD_SETGET(RD::TextureType, type)
|
||||
RD_SETGET(RD::TextureType, texture_type)
|
||||
RD_SETGET(RD::TextureSamples, samples)
|
||||
RD_SETGET(uint32_t, usage_bits)
|
||||
|
||||
|
@ -79,7 +79,7 @@ protected:
|
|||
RD_BIND(Variant::INT, RDTextureFormat, depth);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, array_layers);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, mipmaps);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, type);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, texture_type);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, samples);
|
||||
RD_BIND(Variant::INT, RDTextureFormat, usage_bits);
|
||||
ClassDB::bind_method(D_METHOD("add_shareable_format", "format"), &RDTextureFormat::add_shareable_format);
|
||||
|
|
Loading…
Reference in a new issue