mirror of
https://github.com/xenia-project/xenia.git
synced 2025-12-06 07:12:03 +01:00
Removing fetch consts from state data.
This commit is contained in:
parent
2a082ff242
commit
56a04592d5
|
|
@ -1646,7 +1646,8 @@ CommandProcessor::UpdateStatus CommandProcessor::UpdateViewportState(
|
||||||
state_data->window_offset.x = float(window_offset & 0x7FFF);
|
state_data->window_offset.x = float(window_offset & 0x7FFF);
|
||||||
state_data->window_offset.y = float((window_offset >> 16) & 0x7FFF);
|
state_data->window_offset.y = float((window_offset >> 16) & 0x7FFF);
|
||||||
} else {
|
} else {
|
||||||
state_data->window_offset.x = state_data->window_offset.y = 0;
|
state_data->window_offset.x = 0;
|
||||||
|
state_data->window_offset.y = 0;
|
||||||
}
|
}
|
||||||
uint32_t window_scissor_tl = regs[XE_GPU_REG_PA_SC_WINDOW_SCISSOR_TL].u32;
|
uint32_t window_scissor_tl = regs[XE_GPU_REG_PA_SC_WINDOW_SCISSOR_TL].u32;
|
||||||
uint32_t window_scissor_br = regs[XE_GPU_REG_PA_SC_WINDOW_SCISSOR_BR].u32;
|
uint32_t window_scissor_br = regs[XE_GPU_REG_PA_SC_WINDOW_SCISSOR_BR].u32;
|
||||||
|
|
@ -1986,10 +1987,13 @@ CommandProcessor::UpdateStatus CommandProcessor::UpdateConstants(
|
||||||
// down on state block sizes.
|
// down on state block sizes.
|
||||||
|
|
||||||
// Copy over all constants.
|
// Copy over all constants.
|
||||||
|
std::memcpy(&state_data->float_consts,
|
||||||
|
®s[XE_GPU_REG_SHADER_CONSTANT_000_X].f32,
|
||||||
|
sizeof(state_data->float_consts));
|
||||||
std::memcpy(
|
std::memcpy(
|
||||||
&state_data->float_consts, ®s[XE_GPU_REG_SHADER_CONSTANT_000_X].f32,
|
&state_data->bool_consts,
|
||||||
sizeof(state_data->float_consts) + sizeof(state_data->fetch_consts) +
|
®s[XE_GPU_REG_SHADER_CONSTANT_BOOL_000_031].f32,
|
||||||
sizeof(state_data->loop_consts) + sizeof(state_data->bool_consts));
|
sizeof(state_data->bool_consts) + sizeof(state_data->loop_consts));
|
||||||
|
|
||||||
return UpdateStatus::kCompatible;
|
return UpdateStatus::kCompatible;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -59,21 +59,22 @@ struct UniformDataBlock {
|
||||||
|
|
||||||
float4 alpha_test; // alpha test enable, func, ref, ?
|
float4 alpha_test; // alpha test enable, func, ref, ?
|
||||||
|
|
||||||
// TODO(benvanik): overlay with fetch_consts below?
|
// TODO(benvanik): pack tightly
|
||||||
uint64_t texture_samplers[32];
|
uint64_t texture_samplers[32];
|
||||||
|
|
||||||
// Register data from 0x4000 to 0x4927.
|
// Register data from 0x4000 to 0x4927.
|
||||||
|
// UpdateConstants relies on the packing of these.
|
||||||
|
struct {
|
||||||
// SHADER_CONSTANT_000_X...
|
// SHADER_CONSTANT_000_X...
|
||||||
float4 float_consts[512];
|
float4 float_consts[512];
|
||||||
// SHADER_CONSTANT_FETCH_00_0...
|
// SHADER_CONSTANT_FETCH_00_0 is omitted
|
||||||
uint32_t fetch_consts[32 * 6];
|
|
||||||
// SHADER_CONSTANT_BOOL_000_031...
|
// SHADER_CONSTANT_BOOL_000_031...
|
||||||
int32_t bool_consts[8];
|
int32_t bool_consts[8];
|
||||||
// SHADER_CONSTANT_LOOP_00...
|
// SHADER_CONSTANT_LOOP_00...
|
||||||
int32_t loop_consts[32];
|
int32_t loop_consts[32];
|
||||||
};
|
};
|
||||||
static_assert(sizeof(UniformDataBlock) <= 16 * 1024,
|
};
|
||||||
"Need <=16k uniform data");
|
static_assert(sizeof(UniformDataBlock) <= 16 * 1024, "Need <=16k uniform data");
|
||||||
|
|
||||||
// TODO(benvanik): move more of the enums in here?
|
// TODO(benvanik): move more of the enums in here?
|
||||||
struct DrawCommand {
|
struct DrawCommand {
|
||||||
|
|
@ -103,6 +104,7 @@ struct DrawCommand {
|
||||||
SamplerInput vertex_shader_samplers[32];
|
SamplerInput vertex_shader_samplers[32];
|
||||||
SamplerInput pixel_shader_samplers[32];
|
SamplerInput pixel_shader_samplers[32];
|
||||||
|
|
||||||
|
// NOTE: do not read from this - the mapped memory is likely write combined.
|
||||||
UniformDataBlock* state_data;
|
UniformDataBlock* state_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue