1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* 2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Copyright (C) 2009 Nicolai Haehnle. 3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * All Rights Reserved. 5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Permission is hereby granted, free of charge, to any person obtaining 7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * a copy of this software and associated documentation files (the 8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * "Software"), to deal in the Software without restriction, including 9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * without limitation the rights to use, copy, modify, merge, publish, 10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * distribute, sublicense, and/or sell copies of the Software, and to 11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * permit persons to whom the Software is furnished to do so, subject to 12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * the following conditions: 13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * The above copyright notice and this permission notice (including the 15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * next paragraph) shall be included in all copies or substantial 16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * portions of the Software. 17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE 22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION 23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION 24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef RADEON_SWIZZLE_H 29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define RADEON_SWIZZLE_H 30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "radeon_program.h" 32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct rc_swizzle_split { 34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned char NumPhases; 35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org unsigned char Phase[4]; 36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/** 39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Describe the swizzling capability of target hardware. 40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct rc_swizzle_caps { 42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** 43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Check whether the given swizzle, absolute and negate combination 44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * can be implemented natively by the hardware for this opcode. 45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * 46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * \return 1 if the swizzle is native for the given opcode 47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org int (*IsNative)(rc_opcode opcode, struct rc_src_register reg); 49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org /** 51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Determine how to split access to the masked channels of the 52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * given source register to obtain ALU-native swizzles. 53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */ 54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org void (*Split)(struct rc_src_register reg, unsigned int mask, struct rc_swizzle_split * split); 55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org}; 56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org 57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* RADEON_SWIZZLE_H */ 58