uint8_t param[BRW_BLORP_NUM_PUSH_CONSTANT_DWORDS];
};
+inline unsigned
+brw_blorp_get_urb_length(const struct brw_blorp_prog_data *prog_data)
+{
+ if (prog_data == NULL)
+ return 1;
+
+ /* From the BSpec: 3D Pipeline - Strips and Fans - 3DSTATE_SBE
+ *
+ * read_length = ceiling((max_source_attr+1)/2)
+ */
+ return MAX2((prog_data->num_varying_inputs + 1) / 2, 1);
+}
+
struct brw_blorp_params
{
uint32_t x0;
{
const unsigned num_varyings =
params->wm_prog_data ? params->wm_prog_data->num_varying_inputs : 0;
+ const unsigned urb_read_length =
+ brw_blorp_get_urb_length(params->wm_prog_data);
BEGIN_BATCH(20);
OUT_BATCH(_3DSTATE_SF << 16 | (20 - 2));
OUT_BATCH(num_varyings << GEN6_SF_NUM_OUTPUTS_SHIFT |
- 1 << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT |
+ urb_read_length << GEN6_SF_URB_ENTRY_READ_LENGTH_SHIFT |
BRW_SF_URB_ENTRY_READ_OFFSET <<
GEN6_SF_URB_ENTRY_READ_OFFSET_SHIFT);
OUT_BATCH(0); /* dw2 */
{
const unsigned num_varyings =
params->wm_prog_data ? params->wm_prog_data->num_varying_inputs : 0;
+ const unsigned urb_read_length =
+ brw_blorp_get_urb_length(params->wm_prog_data);
BEGIN_BATCH(14);
OUT_BATCH(_3DSTATE_SBE << 16 | (14 - 2));
* than one vec4 worth of vertex attributes are needed.
*/
OUT_BATCH(num_varyings << GEN7_SBE_NUM_OUTPUTS_SHIFT |
- 1 << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
+ urb_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
BRW_SF_URB_ENTRY_READ_OFFSET <<
GEN7_SBE_URB_ENTRY_READ_OFFSET_SHIFT);
for (int i = 0; i < 9; ++i)
const struct brw_blorp_params *params)
{
const unsigned num_varyings = params->wm_prog_data->num_varying_inputs;
+ const unsigned urb_read_length =
+ brw_blorp_get_urb_length(params->wm_prog_data);
/* 3DSTATE_SBE */
{
* than one vec4 worth of vertex attributes are needed.
*/
OUT_BATCH(num_varyings << GEN7_SBE_NUM_OUTPUTS_SHIFT |
- 1 << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
+ urb_read_length << GEN7_SBE_URB_ENTRY_READ_LENGTH_SHIFT |
BRW_SF_URB_ENTRY_READ_OFFSET <<
GEN8_SBE_URB_ENTRY_READ_OFFSET_SHIFT |
GEN8_SBE_FORCE_URB_ENTRY_READ_LENGTH |