Implementing one case of conditional shader execution blocks.
This commit is contained in:
parent
ff4e9c32b6
commit
613fdac71d
|
@ -2264,6 +2264,7 @@ CommandProcessor::UpdateStatus CommandProcessor::PopulateVertexBuffers() {
|
|||
fetch = &group->vertex_fetch_2;
|
||||
break;
|
||||
}
|
||||
assert_true(fetch->endian == 2);
|
||||
|
||||
// Constrain the vertex upload to just what we are interested in.
|
||||
const size_t kRangeKludge = 5; // could pick index count based on prim.
|
||||
|
|
|
@ -244,8 +244,7 @@ bool GL4Shader::PreparePixelShader(
|
|||
}
|
||||
has_prepared_ = true;
|
||||
|
||||
std::string source =
|
||||
GetHeader() +
|
||||
std::string source = GetHeader() +
|
||||
"layout(origin_upper_left) in vec4 gl_FragCoord;\n"
|
||||
"layout(location = 0) flat in uint draw_id;\n"
|
||||
"layout(location = 1) in VertexData vtx;\n"
|
||||
|
|
|
@ -1325,7 +1325,7 @@ bool GL4ShaderTranslator::TranslateExec(const instr_cf_exec_t& cf) {
|
|||
if (vc) {
|
||||
Append(" VC(0x%x)", vc);
|
||||
}
|
||||
if (cf.bool_addr) {
|
||||
if (cf.is_cond_exec()) {
|
||||
Append(" BOOL_ADDR(0x%x)", cf.bool_addr);
|
||||
}
|
||||
if (cf.address_mode == ABSOLUTE_ADDR) {
|
||||
|
@ -1337,6 +1337,10 @@ bool GL4ShaderTranslator::TranslateExec(const instr_cf_exec_t& cf) {
|
|||
Append("\n");
|
||||
|
||||
if (cf.is_cond_exec()) {
|
||||
if (cf.opc == COND_EXEC_PRED_CLEAN || cf.opc == COND_EXEC_PRED_CLEAN_END) {
|
||||
Append(" p = (state.bool_consts[%d] & (1 << %d)) != 0;\n",
|
||||
cf.bool_addr / 32, cf.bool_addr % 32);
|
||||
}
|
||||
Append(" if(%cp) {\n", cf.pred_condition ? ' ' : '!');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue