This commit is contained in:
luboslenco
2025-03-13 00:04:37 +01:00
parent 4d3548e474
commit b122a157cb
7 changed files with 1607 additions and 1692 deletions
-16
View File
@@ -1437,16 +1437,6 @@ void iron_gpu_shader_destroy(iron_gpu_shader_t *shader) {
free(shader->impl.data);
}
// djb2
uint32_t iron_internal_hash_name(unsigned char *str) {
unsigned long hash = 5381;
int c;
while ((c = *str++)) {
hash = hash * 33 ^ c;
}
return hash;
}
static const int heapSize = 1024;
void iron_gpu_internal_reset_textures(struct iron_gpu_command_list *list) {
@@ -1810,12 +1800,6 @@ void iron_gpu_texture_init(struct iron_gpu_texture *texture, int width, int heig
texture->format = format;
}
void iron_gpu_texture_init_non_sampled_access(struct iron_gpu_texture *texture, int width, int height, iron_image_format_t format) {
create_texture(texture, width, height, format, D3D12_RESOURCE_FLAG_ALLOW_UNORDERED_ACCESS);
texture->_uploaded = true;
texture->state = IRON_INTERNAL_RENDER_TARGET_STATE_TEXTURE;
}
void iron_gpu_texture_destroy(iron_gpu_texture_t *render_target) {
if (render_target->impl.framebuffer_index >= 0) {
framebuffer_count -= 1;
-2
View File
@@ -142,8 +142,6 @@ typedef struct {
int length;
} Shader5Impl;
uint32_t iron_internal_hash_name(unsigned char *str);
struct ID3D12Resource;
struct ID3D12DescriptorHeap;
struct ID3D12GraphicsCommandList;
-10
View File
@@ -1264,16 +1264,6 @@ void iron_gpu_texture_init_from_bytes(iron_gpu_texture_t *texture, void *data, i
bytesPerImage:iron_gpu_texture_stride(texture) * texture->height];
}
void iron_gpu_texture_init_non_sampled_access(iron_gpu_texture_t *texture, int width, int height, iron_image_format_t format) {
texture->width = width;
texture->height = height;
texture->format = format;
texture->impl.data = malloc(width * height * (format == IRON_IMAGE_FORMAT_R8 ? 1 : 4));
texture->state = IRON_INTERNAL_RENDER_TARGET_STATE_TEXTURE;
texture->framebuffer_index = -1;
create(texture, width, height, format, true);
}
void iron_gpu_texture_destroy(iron_gpu_texture_t *target) {
id<MTLTexture> tex = (__bridge_transfer id<MTLTexture>)target->impl._tex;
tex = nil;
File diff suppressed because it is too large Load Diff
+21 -1
View File
@@ -18,7 +18,27 @@ typedef struct {
uint32_t index;
} iron_internal_hash_index_t;
uint32_t iron_internal_hash_name(unsigned char *str);
struct indexed_name {
uint32_t id;
char *name;
};
struct indexed_index {
uint32_t id;
uint32_t value;
};
struct descriptor_set {
int id;
bool in_use;
VkDescriptorImageInfo tex_desc[16];
VkDescriptorSet set;
};
typedef struct inst {
iron_matrix4x4_t m;
int i;
} inst_t;
struct vk_funs {
PFN_vkGetPhysicalDeviceSurfaceSupportKHR fpGetPhysicalDeviceSurfaceSupportKHR;
-1
View File
@@ -206,7 +206,6 @@ void iron_gpu_texture_init(iron_gpu_texture_t *texture, int width, int height, i
void iron_gpu_texture_init_from_bytes(iron_gpu_texture_t *texture, void *data, int width, int height, iron_image_format_t format) {}
void iron_gpu_texture_init_from_encoded_data(iron_gpu_texture_t *texture, void *data, int size, const char *format, bool readable) {}
void iron_gpu_texture_init_from_data(iron_gpu_texture_t *texture, void *data, int width, int height, int format, bool readable) {}
void iron_gpu_texture_init_non_sampled_access(iron_gpu_texture_t *texture, int width, int height, iron_image_format_t format) {}
void iron_gpu_texture_destroy(iron_gpu_texture_t *texture) {}
int iron_gpu_texture_stride(iron_gpu_texture_t *texture) {
-1
View File
@@ -190,7 +190,6 @@ void iron_gpu_vertex_structure_add(iron_gpu_vertex_structure_t *structure, const
void iron_gpu_texture_init(iron_gpu_texture_t *texture, int width, int height, iron_image_format_t format);
void iron_gpu_texture_init_from_bytes(iron_gpu_texture_t *texture, void *data, int width, int height, iron_image_format_t format);
void iron_gpu_texture_init_non_sampled_access(iron_gpu_texture_t *texture, int width, int height, iron_image_format_t format);
void iron_gpu_texture_destroy(iron_gpu_texture_t *texture);
void iron_gpu_texture_generate_mipmaps(iron_gpu_texture_t *texture, int levels);
void iron_gpu_texture_set_mipmap(iron_gpu_texture_t *texture, iron_gpu_texture_t *mipmap, int level);