This adds a new TGSI property to represent the GLSL layout qualifier in TGSI.
"FS_COORD_ORIGIN",
"FS_COORD_PIXEL_CENTER",
"FS_COLOR0_WRITES_ALL_CBUFS",
+ "FS_DEPTH_LAYOUT"
};
static const char *tgsi_type_names[] =
unsigned char property_fs_coord_origin; /* = TGSI_FS_COORD_ORIGIN_* */
unsigned char property_fs_coord_pixel_center; /* = TGSI_FS_COORD_PIXEL_CENTER_* */
unsigned char property_fs_color0_writes_all_cbufs; /* = TGSI_FS_COLOR0_WRITES_ALL_CBUFS * */
+ unsigned char property_fs_depth_layout; /* TGSI_FS_DEPTH_LAYOUT */
unsigned nr_addrs;
unsigned nr_preds;
ureg->property_fs_color0_writes_all_cbufs = fs_color0_writes_all_cbufs;
}
+void
+ureg_property_fs_depth_layout(struct ureg_program *ureg,
+ unsigned fs_depth_layout)
+{
+ ureg->property_fs_depth_layout = fs_depth_layout;
+}
+
struct ureg_src
ureg_DECL_fs_input_cyl_centroid(struct ureg_program *ureg,
unsigned semantic_name,
ureg->property_fs_color0_writes_all_cbufs);
}
+ if (ureg->property_fs_depth_layout) {
+ assert(ureg->processor == TGSI_PROCESSOR_FRAGMENT);
+
+ emit_property(ureg,
+ TGSI_PROPERTY_FS_DEPTH_LAYOUT,
+ ureg->property_fs_depth_layout);
+ }
+
if (ureg->processor == TGSI_PROCESSOR_VERTEX) {
for (i = 0; i < UREG_MAX_INPUT; i++) {
if (ureg->vs_inputs[i/32] & (1 << (i%32))) {
ureg_property_fs_color0_writes_all_cbufs(struct ureg_program *ureg,
unsigned fs_color0_writes_all_cbufs);
+void
+ureg_property_fs_depth_layout(struct ureg_program *ureg,
+ unsigned fs_depth_layout);
+
+
/***********************************************************************
* Build shader declarations:
*/
#define TGSI_PROPERTY_FS_COORD_ORIGIN 3
#define TGSI_PROPERTY_FS_COORD_PIXEL_CENTER 4
#define TGSI_PROPERTY_FS_COLOR0_WRITES_ALL_CBUFS 5
-#define TGSI_PROPERTY_COUNT 6
+#define TGSI_PROPERTY_FS_DEPTH_LAYOUT 6
+#define TGSI_PROPERTY_COUNT 7
struct tgsi_property {
unsigned Type : 4; /**< TGSI_TOKEN_TYPE_PROPERTY */
#define TGSI_FS_COORD_PIXEL_CENTER_HALF_INTEGER 0
#define TGSI_FS_COORD_PIXEL_CENTER_INTEGER 1
+#define TGSI_FS_DEPTH_LAYOUT_NONE 0
+#define TGSI_FS_DEPTH_LAYOUT_ANY 1
+#define TGSI_FS_DEPTH_LAYOUT_GREATER 2
+#define TGSI_FS_DEPTH_LAYOUT_LESS 3
+#define TGSI_FS_DEPTH_LAYOUT_UNCHANGED 4
+
+
struct tgsi_property_data {
unsigned Data;
};
interpMode[i]);
}
+ if (program->shader_program->FragDepthLayout != FRAG_DEPTH_LAYOUT_NONE) {
+ switch (program->shader_program->FragDepthLayout) {
+ case FRAG_DEPTH_LAYOUT_ANY:
+ ureg_property_fs_depth_layout(ureg, TGSI_FS_DEPTH_LAYOUT_ANY);
+ break;
+ case FRAG_DEPTH_LAYOUT_GREATER:
+ ureg_property_fs_depth_layout(ureg, TGSI_FS_DEPTH_LAYOUT_GREATER);
+ break;
+ case FRAG_DEPTH_LAYOUT_LESS:
+ ureg_property_fs_depth_layout(ureg, TGSI_FS_DEPTH_LAYOUT_LESS);
+ break;
+ case FRAG_DEPTH_LAYOUT_UNCHANGED:
+ ureg_property_fs_depth_layout(ureg, TGSI_FS_DEPTH_LAYOUT_UNCHANGED);
+ break;
+ default:
+ assert(0);
+ }
+ }
+
if (proginfo->InputsRead & FRAG_BIT_WPOS) {
/* Must do this after setting up t->inputs, and before
* emitting constant references, below: