Cleanup
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -142,8 +142,6 @@ typedef struct {
|
||||
int length;
|
||||
} Shader5Impl;
|
||||
|
||||
uint32_t iron_internal_hash_name(unsigned char *str);
|
||||
|
||||
struct ID3D12Resource;
|
||||
struct ID3D12DescriptorHeap;
|
||||
struct ID3D12GraphicsCommandList;
|
||||
|
||||
@@ -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;
|
||||
|
||||
+1586
-1661
File diff suppressed because it is too large
Load Diff
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user