mirror of
https://git.suyu.dev/suyu/suyu.git
synced 2024-11-27 01:02:48 +01:00
shader: Fix disabled attribute default values
This commit is contained in:
parent
c9528282d9
commit
56478bc9ac
2 changed files with 2 additions and 2 deletions
|
@ -300,7 +300,7 @@ Id EmitGetAttribute(EmitContext& ctx, IR::Attribute attr, Id vertex) {
|
||||||
const std::optional<AttrInfo> type{AttrTypes(ctx, index)};
|
const std::optional<AttrInfo> type{AttrTypes(ctx, index)};
|
||||||
if (!type) {
|
if (!type) {
|
||||||
// Attribute is disabled
|
// Attribute is disabled
|
||||||
return ctx.Const(0.0f);
|
return ctx.Const(element == 3 ? 1.0f : 0.0f);
|
||||||
}
|
}
|
||||||
if (!ctx.runtime_info.previous_stage_stores.Generic(index, element)) {
|
if (!ctx.runtime_info.previous_stage_stores.Generic(index, element)) {
|
||||||
// Varying component is not written
|
// Varying component is not written
|
||||||
|
|
|
@ -145,7 +145,7 @@ RendererOpenGL::RendererOpenGL(Core::TelemetrySession& telemetry_session_,
|
||||||
GLint max_attribs{};
|
GLint max_attribs{};
|
||||||
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_attribs);
|
glGetIntegerv(GL_MAX_VERTEX_ATTRIBS, &max_attribs);
|
||||||
for (GLint attrib = 0; attrib < max_attribs; ++attrib) {
|
for (GLint attrib = 0; attrib < max_attribs; ++attrib) {
|
||||||
glVertexAttrib4f(attrib, 0.0f, 0.0f, 0.0f, 0.0f);
|
glVertexAttrib4f(attrib, 0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
}
|
}
|
||||||
// Enable seamless cubemaps when per texture parameters are not available
|
// Enable seamless cubemaps when per texture parameters are not available
|
||||||
if (!GLAD_GL_ARB_seamless_cubemap_per_texture && !GLAD_GL_AMD_seamless_cubemap_per_texture) {
|
if (!GLAD_GL_ARB_seamless_cubemap_per_texture && !GLAD_GL_AMD_seamless_cubemap_per_texture) {
|
||||||
|
|
Loading…
Reference in a new issue