assert((((uintptr_t)buffer) & (PDS_ROGUE_TA_STATE_PDS_ADDR_ALIGNSIZE - 1)) ==
0);
- assert(gen_mode != PDS_GENERATE_DATA_SEGMENT);
+ assert((gen_mode == PDS_GENERATE_CODE_SEGMENT && buffer) ||
+ gen_mode == PDS_GENERATE_SIZES);
/* clang-format off */
/* Shape of code segment (note: clear is different)
uint32_t control_word_constant1 =
pvr_pds_get_constants(&next_constant, 2, &data_size);
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* DOUTW the clear color to the USC constants. Predicate with
* uniform loading flag (IF0).
*/
pvr_pds_get_constants(&next_constant, 2, &data_size);
color_constant4 = pvr_pds_get_constants(&next_constant, 2, &data_size);
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* DOUTW the clear color to the USSE constants. Predicate with
* uniform loading flag (IF0).
*/
control_word_last_constant =
pvr_pds_get_constants(&next_constant, 2, &data_size);
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* DOUTW the clear color to the USSE constants. Predicate with
* uniform loading flag (IF0).
*/
doutu_constant64 =
pvr_pds_get_constants(&next_constant, 2, &data_size);
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* Issue the task to the USC.
*
* dout ds1[constant_use], ds0[constant_use],
code_size += 1;
}
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* End the program. */
*instruction++ = pvr_pds_inst_encode_halt(0);
}
* it. We therefore don't need to branch when there is only a
* texture OR a uniform update program.
*/
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
uint32_t branch_address =
MAX2(1 + program->num_texture_dma_kicks, 2);
for (uint32_t dma = 0; dma < program->num_texture_dma_kicks; dma++) {
code_size += 1;
- if (gen_mode != PDS_GENERATE_CODE_SEGMENT || !instruction)
+ if (gen_mode != PDS_GENERATE_CODE_SEGMENT)
continue;
/* DMA the state into the secondary attributes. */
dma_control_constant32 += 1;
}
} else if (both_textures_and_uniforms) {
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* End the program. */
*instruction++ = pvr_pds_inst_encode_halt(0);
}
for (uint32_t dma = 0; dma < program->num_uniform_dma_kicks; dma++) {
code_size += 1;
- if (gen_mode != PDS_GENERATE_CODE_SEGMENT || !instruction)
+ if (gen_mode != PDS_GENERATE_CODE_SEGMENT)
continue;
bool last_instruction = false;
}
if (program->kick_usc) {
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* Issue the task to the USC.
*
* dout ds1[constant_use], ds0[constant_use],
code_size += 1;
} else if (program->num_uniform_dma_kicks == 0 && total_num_doutw == 0) {
- if (gen_mode == PDS_GENERATE_CODE_SEGMENT && instruction) {
+ if (gen_mode == PDS_GENERATE_CODE_SEGMENT) {
/* End the program. */
*instruction++ = pvr_pds_inst_encode_halt(0);
}