unsigned index, unsigned size)
{
assert(opcode0.opcodeType);
- assert(operand0.mask);
+ assert(operand0.mask ||
+ (operand0.operandType == VGPU10_OPERAND_TYPE_OUTPUT_DEPTH) ||
+ (operand0.operandType == VGPU10_OPERAND_TYPE_OUTPUT_COVERAGE_MASK));
begin_emit_instruction(emit);
emit_dword(emit, opcode0.value);
operand0.operandType = VGPU10_OPERAND_TYPE_OUTPUT_DEPTH;
operand0.numComponents = VGPU10_OPERAND_1_COMPONENT;
operand0.indexDimension = VGPU10_OPERAND_INDEX_0D;
- operand0.mask = VGPU10_OPERAND_4_COMPONENT_MASK_ALL;
+ operand0.mask = 0;
emit_decl_instruction(emit, opcode0, operand0, name_token, 0, 1);
}
operand0.operandType = VGPU10_OPERAND_TYPE_OUTPUT_COVERAGE_MASK;
operand0.numComponents = VGPU10_OPERAND_0_COMPONENT;
operand0.indexDimension = VGPU10_OPERAND_INDEX_0D;
- operand0.mask = VGPU10_OPERAND_4_COMPONENT_MASK_ALL;
+ operand0.mask = 0;
emit_decl_instruction(emit, opcode0, operand0, name_token, 0, 1);
}
/**
- * Translate TGSI_TEXTURE_x to VGAPU10_RESOURCE_DIMENSION_x.
+ * Translate TGSI_TEXTURE_x to VGPU10_RESOURCE_DIMENSION_x.
*/
static unsigned
tgsi_texture_to_resource_dimension(enum tgsi_texture_type target,
+ unsigned num_samples,
boolean is_array)
{
+ if (target == TGSI_TEXTURE_2D_MSAA && num_samples < 2) {
+ target = TGSI_TEXTURE_2D;
+ }
+ else if (target == TGSI_TEXTURE_2D_ARRAY_MSAA && num_samples < 2) {
+ target = TGSI_TEXTURE_2D_ARRAY;
+ }
+
switch (target) {
case TGSI_TEXTURE_BUFFER:
return VGPU10_RESOURCE_DIMENSION_BUFFER;
: VGPU10_RESOURCE_DIMENSION_TEXTURE2DMS;
case TGSI_TEXTURE_CUBE_ARRAY:
case TGSI_TEXTURE_SHADOWCUBE_ARRAY:
- return VGPU10_RESOURCE_DIMENSION_TEXTURECUBEARRAY;
+ return is_array ? VGPU10_RESOURCE_DIMENSION_TEXTURECUBEARRAY
+ : VGPU10_RESOURCE_DIMENSION_TEXTURECUBE;
default:
assert(!"Unexpected resource type");
return VGPU10_RESOURCE_DIMENSION_TEXTURE2D;
opcode0.opcodeType = VGPU10_OPCODE_DCL_RESOURCE;
opcode0.resourceDimension =
tgsi_texture_to_resource_dimension(emit->sampler_target[i],
+ emit->key.tex[i].num_samples,
emit->key.tex[i].is_array);
opcode0.sampleCount = emit->key.tex[i].num_samples;
operand0.value = 0;
unsigned unit,
const struct tgsi_full_src_register *coord)
{
- if (emit->key.tex[unit].unnormalized) {
+ if (emit->sampler_view[unit] && emit->key.tex[unit].unnormalized) {
unsigned scale_index = emit->texcoord_scale_index[unit];
unsigned tmp = get_temp_index(emit);
struct tgsi_full_src_register tmp_src = make_src_temp_reg(tmp);
const struct tgsi_full_instruction *inst)
{
const uint unit = inst->Src[2].Register.Index;
- unsigned target = inst->Texture.Texture;
struct tgsi_full_src_register src;
int offsets[3];
if (!is_valid_tex_instruction(emit, inst))
return TRUE;
- if (target == TGSI_TEXTURE_CUBE_ARRAY) {
- debug_printf("TGSI_TEXTURE_CUBE_ARRAY is not supported\n");
- return TRUE;
- }
-
- /* Only single channel is supported in SM4_1.
+ /* Only a single channel is supported in SM4_1 and we report
+ * PIPE_CAP_MAX_TEXTURE_GATHER_COMPONENTS = 1.
* Only the 0th component will be gathered.
*/
switch (emit->key.tex[unit].swizzle_r) {
const struct tgsi_full_instruction *inst)
{
const uint unit = inst->Src[1].Register.Index;
- const boolean msaa = tgsi_is_msaa_target(inst->Texture.Texture);
+ const boolean msaa = tgsi_is_msaa_target(inst->Texture.Texture)
+ && emit->key.tex[unit].num_samples > 1;
int offsets[3];
struct tex_swizzle_info swz_info;
get_texel_offsets(emit, inst, offsets);
if (msaa) {
+ assert(emit->key.tex[unit].num_samples > 1);
+
/* Fetch one sample from an MSAA texture */
struct tgsi_full_src_register sampleIndex =
scalar_src(&inst->Src[0], TGSI_SWIZZLE_W);
variant->fs_shadow_compare_units = emit->fs.shadow_compare_units;
+ variant->fs_shadow_compare_units = emit->fs.shadow_compare_units;
+
if (tokens != shader->tokens) {
tgsi_free_tokens(tokens);
}