gl_rasterizer: change shadow_texture_bias from shader config var to shader uniform
Games can frequently change this register. Using it as shader config var would generates a lot of shaders
This commit is contained in:
@@ -203,6 +203,7 @@ void RasterizerOpenGL::SyncEntireState() {
|
||||
SyncProcTexNoise();
|
||||
SyncProcTexBias();
|
||||
SyncShadowBias();
|
||||
SyncShadowTextureBias();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -903,6 +904,11 @@ void RasterizerOpenGL::NotifyPicaRegisterChanged(u32 id) {
|
||||
SyncBlendColor();
|
||||
break;
|
||||
|
||||
// Shadow texture
|
||||
case PICA_REG_INDEX(texturing.shadow):
|
||||
SyncShadowTextureBias();
|
||||
break;
|
||||
|
||||
// Fog state
|
||||
case PICA_REG_INDEX(texturing.fog_color):
|
||||
SyncFogColor();
|
||||
@@ -1906,6 +1912,14 @@ void RasterizerOpenGL::SyncShadowBias() {
|
||||
}
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncShadowTextureBias() {
|
||||
GLint bias = Pica::g_state.regs.texturing.shadow.bias << 1;
|
||||
if (bias != uniform_block_data.data.shadow_texture_bias) {
|
||||
uniform_block_data.data.shadow_texture_bias = bias;
|
||||
uniform_block_data.dirty = true;
|
||||
}
|
||||
}
|
||||
|
||||
void RasterizerOpenGL::SyncAndUploadLUTs() {
|
||||
constexpr std::size_t max_size = sizeof(GLvec2) * 256 * Pica::LightingRegs::NumLightingSampler +
|
||||
sizeof(GLvec2) * 128 + // fog
|
||||
|
||||
Reference in New Issue
Block a user