nv2a: Add SHADOWCTL register to store depth func

This commit is contained in:
Matt Borgerson 2022-05-17 17:08:15 -07:00 committed by mborgerson
parent c33d96127c
commit a1f34c339a
3 changed files with 6 additions and 5 deletions

View File

@ -304,8 +304,6 @@ typedef struct PGRAPHState {
bool texture_matrix_enable[NV2A_MAX_TEXTURES];
enum PshShadowDepthFunc shadow_depth_func;
GLuint gl_framebuffer;
GLuint gl_display_buffer;

View File

@ -489,6 +489,8 @@
#define NV_PGRAPH_SHADERCTL 0x00001998
#define NV_PGRAPH_SHADERPROG 0x0000199C
#define NV_PGRAPH_SEMAPHOREOFFSET 0x000019A0
#define NV_PGRAPH_SHADOWCTL 0x000019A4
# define NV_PGRAPH_SHADOWCTL_SHADOW_ZFUNC 0x00000007
#define NV_PGRAPH_SHADOWZSLOPETHRESHOLD 0x000019A8
#define NV_PGRAPH_SPECFOGFACTOR0 0x000019AC
#define NV_PGRAPH_SPECFOGFACTOR1 0x000019B0

View File

@ -3554,7 +3554,8 @@ DEF_METHOD(NV097, SET_SHADOW_ZSLOPE_THRESHOLD)
DEF_METHOD(NV097, SET_SHADOW_DEPTH_FUNC)
{
pg->shadow_depth_func = parameter;
SET_MASK(pg->regs[NV_PGRAPH_SHADOWCTL], NV_PGRAPH_SHADOWCTL_SHADOW_ZFUNC,
parameter);
}
DEF_METHOD(NV097, SET_SHADER_STAGE_PROGRAM)
@ -3857,7 +3858,6 @@ void pgraph_init(NV2AState *d)
pg->shader_cache = g_hash_table_new(shader_hash, shader_equal);
pg->shadow_depth_func = SHADOW_DEPTH_FUNC_NEVER;
pg->material_alpha = 0.0f;
for (i=0; i<NV2A_VERTEXSHADER_ATTRIBUTES; i++) {
@ -4255,7 +4255,8 @@ static void pgraph_bind_shaders(PGRAPHState *pg)
state.psh.point_sprite = pg->regs[NV_PGRAPH_SETUPRASTER] &
NV_PGRAPH_SETUPRASTER_POINTSMOOTHENABLE;
state.psh.shadow_depth_func = pg->shadow_depth_func;
state.psh.shadow_depth_func = (enum PshShadowDepthFunc)GET_MASK(
pg->regs[NV_PGRAPH_SHADOWCTL], NV_PGRAPH_SHADOWCTL_SHADOW_ZFUNC);
state.fixed_function = fixed_function;