mirror of
https://github.com/yuzu-emu/yuzu.git
synced 2024-11-16 02:20:05 +00:00
gl_state_tracker: Implement dirty flags for point sizes
This commit is contained in:
parent
231601763c
commit
4f8d152b18
@ -1267,12 +1267,25 @@ void RasterizerOpenGL::SyncTransformFeedback() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncPointState() {
|
void RasterizerOpenGL::SyncPointState() {
|
||||||
const auto& regs = system.GPU().Maxwell3D().regs;
|
auto& gpu = system.GPU().Maxwell3D();
|
||||||
|
auto& flags = gpu.dirty.flags;
|
||||||
|
if (!flags[Dirty::PointSize]) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
flags[Dirty::PointSize] = false;
|
||||||
|
|
||||||
|
oglEnable(GL_POINT_SPRITE, gpu.regs.point_sprite_enable);
|
||||||
|
|
||||||
|
if (gpu.regs.vp_point_size.enable) {
|
||||||
|
// By definition of GL_POINT_SIZE, it only matters if GL_PROGRAM_POINT_SIZE is disabled.
|
||||||
|
glEnable(GL_PROGRAM_POINT_SIZE);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
|
// Limit the point size to 1 since nouveau sometimes sets a point size of 0 (and that's invalid
|
||||||
// in OpenGL).
|
// in OpenGL).
|
||||||
oglEnable(GL_PROGRAM_POINT_SIZE, regs.vp_point_size.enable);
|
glPointSize(std::max(1.0f, gpu.regs.point_size));
|
||||||
oglEnable(GL_POINT_SPRITE, regs.point_sprite_enable);
|
glDisable(GL_PROGRAM_POINT_SIZE);
|
||||||
glPointSize(std::max(1.0f, regs.point_size));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void RasterizerOpenGL::SyncPolygonOffset() {
|
void RasterizerOpenGL::SyncPolygonOffset() {
|
||||||
|
@ -205,6 +205,12 @@ void SetupDirtyFragmentClampColor(Tables& tables) {
|
|||||||
tables[0][OFF(frag_color_clamp)] = FragmentClampColor;
|
tables[0][OFF(frag_color_clamp)] = FragmentClampColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void SetupDirtyPointSize(Tables& tables) {
|
||||||
|
tables[0][OFF(vp_point_size)] = PointSize;
|
||||||
|
tables[0][OFF(point_size)] = PointSize;
|
||||||
|
tables[0][OFF(point_sprite_enable)] = PointSize;
|
||||||
|
}
|
||||||
|
|
||||||
void SetupDirtyMisc(Tables& tables) {
|
void SetupDirtyMisc(Tables& tables) {
|
||||||
auto& table = tables[0];
|
auto& table = tables[0];
|
||||||
|
|
||||||
@ -241,6 +247,7 @@ void StateTracker::Initialize() {
|
|||||||
SetupDirtyFramebufferSRGB(tables);
|
SetupDirtyFramebufferSRGB(tables);
|
||||||
SetupDirtyLogicOp(tables);
|
SetupDirtyLogicOp(tables);
|
||||||
SetupDirtyFragmentClampColor(tables);
|
SetupDirtyFragmentClampColor(tables);
|
||||||
|
SetupDirtyPointSize(tables);
|
||||||
SetupDirtyMisc(tables);
|
SetupDirtyMisc(tables);
|
||||||
|
|
||||||
auto& store = dirty.on_write_stores;
|
auto& store = dirty.on_write_stores;
|
||||||
|
@ -70,6 +70,7 @@ enum : u8 {
|
|||||||
FramebufferSRGB,
|
FramebufferSRGB,
|
||||||
LogicOp,
|
LogicOp,
|
||||||
FragmentClampColor,
|
FragmentClampColor,
|
||||||
|
PointSize,
|
||||||
|
|
||||||
Last
|
Last
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user