r500: setup fragment program constant emission atom

This commit is contained in:
Dave Airlie 2008-03-21 17:05:29 +10:00
parent ed18005a99
commit 3eb8e5871f
3 changed files with 12 additions and 7 deletions

View file

@ -398,7 +398,9 @@ void r300InitCmdBuf(r300ContextPtr r300)
if (is_r500) {
ALLOC_STATE(r500fp, variable, R300_FPI_CMDSIZE, 0);
r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0);
r300->hw.r500fp.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0, 0, 0);
ALLOC_STATE(r500fp_const, variable, R300_FPI_CMDSIZE, 0);
r300->hw.r500fp_const.cmd[R300_FPI_CMD_0] = cmdr500fp(0, 0, 1, 0);
} else {
ALLOC_STATE(fp, always, R300_FP_CMDSIZE, 0);
r300->hw.fp.cmd[R300_FP_CMD_0] = cmdpacket0(R300_PFS_CNTL_0, 3);

View file

@ -490,6 +490,7 @@ struct r300_hw_state {
struct r300_state_atom fpt; /* texi - (4620) */
struct r300_state_atom us_out_fmt; /* (46A4) */
struct r300_state_atom r500fp; /* r500 fp instructions */
struct r300_state_atom r500fp_const; /* r500 fp constants */
struct r300_state_atom fpi[4]; /* fp instructions (46C0/47C0/48C0/49C0) */
struct r300_state_atom fogs; /* fog state (4BC0) */
struct r300_state_atom fogc; /* fog color (4BC8) */

View file

@ -74,14 +74,16 @@ static inline uint32_t cmdvpu(int addr, int count)
return cmd.u;
}
static inline uint32_t cmdr500fp(int addr, int count)
static inline uint32_t cmdr500fp(int addr, int count, int type, int clamp)
{
drm_r300_cmd_header_t cmd;
cmd.vpu.cmd_type = R300_CMD_R500FP;
cmd.vpu.count = count;
cmd.vpu.adrhi = ((unsigned int)addr & 0xFF00) >> 8;
cmd.vpu.adrlo = ((unsigned int)addr & 0x00FF);
cmd.r500fp.cmd_type = R300_CMD_R500FP;
cmd.r500fp.count = count;
cmd.r500fp.adrhi_flags = ((unsigned int)addr & 0x100) >> 8;
cmd.r500fp.adrhi_flags |= type ? R500FP_CONSTANT_TYPE : 0;
cmd.r500fp.adrhi_flags |= clamp ? R500FP_CONSTANT_CLAMP : 0;
cmd.r500fp.adrlo = ((unsigned int)addr & 0x00FF);
return cmd.u;
}
@ -188,7 +190,7 @@ static inline uint32_t cmdpacify(void)
__FUNCTION__); \
cmd_reserved = _n+1; \
cmd_written =1; \
cmd[0].i = cmdr500fp((dest), _n/6); \
cmd[0].i = cmdr500fp((dest), _n/6, 0, 0); \
} while (0);
#define start_packet3(packet, count) \