Vulkan related changes

This commit is contained in:
korenkonder
2025-05-20 12:14:51 +03:00
parent 27bff76469
commit 7f4fb269e8
3 changed files with 23 additions and 4 deletions
+3 -1
View File
@@ -1182,8 +1182,10 @@ namespace rndr {
rndr::Render* rend = render;
rend_data_ctx.state.set_viewport(0, 0, width, height);
if (Vulkan::use)
rctx->screen_buffer.Bind(rend_data_ctx.state);
#ifdef USE_OPENGL
if (!Vulkan::use && multisample && multisample_framebuffer) {
else if (multisample && multisample_framebuffer) {
rend_data_ctx.state.bind_framebuffer(multisample_framebuffer);
rend_data_ctx.state.enable_multisample();
rend_data_ctx.state.clear_color(0.0f, 0.0f, 0.0f, 0.0f);
+8 -3
View File
@@ -318,11 +318,11 @@ void texture_get_format_type_by_internal_format(GLenum internal_format, GLenum*
break;
case GL_DEPTH_COMPONENT16:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32F:
case GL_DEPTH_COMPONENT32:
_format = GL_DEPTH_COMPONENT;
_type = GL_FLOAT;
break;
case GL_R8:
case GL_R8: // Added
_format = GL_RED;
_type = GL_UNSIGNED_BYTE;
break;
@@ -334,7 +334,7 @@ void texture_get_format_type_by_internal_format(GLenum internal_format, GLenum*
_format = GL_RED;
_type = GL_FLOAT;
break;
case GL_RG16F:
case GL_RG16F: // Added
_format = GL_RG;
_type = GL_HALF_FLOAT;
break;
@@ -372,6 +372,10 @@ void texture_get_format_type_by_internal_format(GLenum internal_format, GLenum*
_format = GL_RGB;
_type = GL_UNSIGNED_INT_5_9_9_9_REV;
break;
case GL_DEPTH_COMPONENT32F:
_format = GL_DEPTH_COMPONENT;
_type = GL_FLOAT;
break;
case GL_COMPRESSED_RED_RGTC1:
_format = GL_RED;
_type = GL_ZERO;
@@ -410,6 +414,7 @@ int32_t texture_get_size(GLenum internal_format, int32_t width, int32_t height)
case GL_RGB8:
case GL_RGBA8:
case GL_DEPTH_COMPONENT24:
case GL_DEPTH_COMPONENT32:
case GL_R32F:
case GL_RG16F:
case GL_DEPTH24_STENCIL8:
+12
View File
@@ -745,6 +745,12 @@ void compile_shaders(farc* f, farc* of, const shader_table* shaders_table, const
}
void compile_all_shaders(bool debug) {
GLAD_GL_VERSION_4_1 = 1;
GLAD_GL_VERSION_4_2 = 1;
GLAD_GL_VERSION_4_3 = 1;
GLAD_GL_VERSION_4_4 = 1;
GLAD_GL_VERSION_4_5 = 1;
GLAD_GL_VERSION_4_6 = 1;
{
farc f;
f.read("rom\\ft_shaders.farc", true, false);
@@ -762,6 +768,12 @@ void compile_all_shaders(bool debug) {
compile_shaders(&f, &of, shader_dev_table, shader_dev_table_size, debug);
of.write("rom\\dev_shaders_spirv.farc", FARC_FArC, FARC_NONE, false, false);
}
GLAD_GL_VERSION_4_1 = 0;
GLAD_GL_VERSION_4_2 = 0;
GLAD_GL_VERSION_4_3 = 0;
GLAD_GL_VERSION_4_4 = 0;
GLAD_GL_VERSION_4_5 = 0;
GLAD_GL_VERSION_4_6 = 0;
}
/*void process_edit_dsc(const char* path, const char* file,