struct tgsi_declaration_resource dr;
dr.Resource = TGSI_BUFFER;
+ dr.Raw = 0;
return dr;
}
static struct tgsi_declaration_resource
tgsi_build_declaration_resource(unsigned texture,
+ unsigned raw,
struct tgsi_declaration *declaration,
struct tgsi_header *header)
{
dr = tgsi_default_declaration_resource();
dr.Resource = texture;
+ dr.Raw = raw;
declaration_grow(declaration, header);
size++;
*dr = tgsi_build_declaration_resource(full_decl->Resource.Resource,
+ full_decl->Resource.Raw,
declaration,
header);
}
if (decl->Declaration.File == TGSI_FILE_RESOURCE) {
TXT(", ");
ENM(decl->Resource.Resource, tgsi_texture_names);
+ if (decl->Resource.Raw)
+ TXT(", RAW");
}
if (decl->Declaration.File == TGSI_FILE_SAMPLER_VIEW) {
struct parsed_dcl_bracket brackets[2];
int num_brackets;
uint writemask;
- const char *cur;
+ const char *cur, *cur2;
uint advance;
boolean is_vs_input;
boolean is_imm_array;
return FALSE;
}
+ cur2 = cur;
+ eat_opt_white(&cur2);
+ while (*cur2 == ',') {
+ cur2++;
+ eat_opt_white(&cur2);
+ if (str_match_no_case(&cur2, "RAW") &&
+ !is_digit_alpha_underscore(cur2)) {
+ decl.Resource.Raw = 1;
+
+ } else {
+ break;
+ }
+ cur = cur2;
+ eat_opt_white(&cur2);
+ }
+
ctx->cur = cur;
} else if (file == TGSI_FILE_SAMPLER_VIEW) {
}
break;
} else {
- const char *cur2 = cur;
+ cur2 = cur;
eat_opt_white( &cur2 );
if (*cur2 == ',') {
cur2++;
Follows Declaration token if file is TGSI_FILE_RESOURCE.
- DCL RES[#], resource
+ DCL RES[#], resource [, RAW]
Declares a shader input resource and assigns it to a RES[#]
register.
resource can be one of BUFFER, 1D, 2D, 3D, CUBE, 1DArray and
2DArray.
+ If the RAW keyword is not specified, the texture data will be
+ subject to conversion, swizzling and scaling as required to yield
+ the specified data type from the physical data format of the bound
+ resource.
+
+ If the RAW keyword is specified, no channel conversion will be
+ performed: the values read for each of the channels (X,Y,Z,W) will
+ correspond to consecutive words in the same order and format
+ they're found in memory. No element-to-address conversion will be
+ performed either: the value of the provided X coordinate will be
+ interpreted in byte units instead of texel units. The result of
+ accessing a misaligned address is undefined.
+
Properties
^^^^^^^^^^^^^^^^^^^^^^^^
struct tgsi_declaration_resource {
unsigned Resource : 8; /**< one of TGSI_TEXTURE_ */
- unsigned Padding : 24;
+ unsigned Raw : 1;
+ unsigned Padding : 23;
};
struct tgsi_declaration_sampler_view {