aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2018-11-19 18:23:40 +0100
committerNicolai Hähnle <[email protected]>2018-11-29 13:18:23 +0100
commit729ebdf07e34cbd7bbb066b5896ff583cdc1ea4f (patch)
tree6f38102433932ea8739777af130adce60ff0bc95
parent058f85d41cbe3534b1a06d321fab9afb8fbadfc0 (diff)
radv: remove dependency on addrlib gfx9_enum.h
v2: - use SI_CONTEXT_REG_OFFSET Reviewed-by: Dave Airlie <[email protected]>
-rw-r--r--src/amd/common/sid.h3
-rw-r--r--src/amd/vulkan/radv_cmd_buffer.c6
-rw-r--r--src/amd/vulkan/radv_device.c9
3 files changed, 9 insertions, 9 deletions
diff --git a/src/amd/common/sid.h b/src/amd/common/sid.h
index 35782046dd5..49683f1aa5a 100644
--- a/src/amd/common/sid.h
+++ b/src/amd/common/sid.h
@@ -2436,6 +2436,9 @@
#define S_008F30_FILTER_MODE(x) (((unsigned)(x) & 0x03) << 29)
#define G_008F30_FILTER_MODE(x) (((x) >> 29) & 0x03)
#define C_008F30_FILTER_MODE 0x9FFFFFFF
+#define V_008F30_SQ_IMG_FILTER_MODE_BLEND 0x00
+#define V_008F30_SQ_IMG_FILTER_MODE_MIN 0x01
+#define V_008F30_SQ_IMG_FILTER_MODE_MAX 0x02
/* VI */
#define S_008F30_COMPAT_MODE(x) (((unsigned)(x) & 0x1) << 31)
#define G_008F30_COMPAT_MODE(x) (((x) >> 31) & 0x1)
diff --git a/src/amd/vulkan/radv_cmd_buffer.c b/src/amd/vulkan/radv_cmd_buffer.c
index a3b3d0a6f20..ccf762ead46 100644
--- a/src/amd/vulkan/radv_cmd_buffer.c
+++ b/src/amd/vulkan/radv_cmd_buffer.c
@@ -37,8 +37,6 @@
#include "ac_debug.h"
-#include "addrlib/gfx9/chip/gfx9_enum.h"
-
enum {
RADV_PREFETCH_VBO_DESCRIPTORS = (1 << 0),
RADV_PREFETCH_VS = (1 << 1),
@@ -1320,7 +1318,7 @@ radv_load_ds_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
radeon_emit(cs, PKT3(PKT3_LOAD_CONTEXT_REG, 3, 0));
radeon_emit(cs, va);
radeon_emit(cs, va >> 32);
- radeon_emit(cs, (reg >> 2) - CONTEXT_SPACE_START);
+ radeon_emit(cs, (reg - SI_CONTEXT_REG_OFFSET) >> 2);
radeon_emit(cs, reg_count);
} else {
radeon_emit(cs, PKT3(PKT3_COPY_DATA, 4, 0));
@@ -1457,7 +1455,7 @@ radv_load_color_clear_metadata(struct radv_cmd_buffer *cmd_buffer,
radeon_emit(cs, PKT3(PKT3_LOAD_CONTEXT_REG, 3, cmd_buffer->state.predicating));
radeon_emit(cs, va);
radeon_emit(cs, va >> 32);
- radeon_emit(cs, (reg >> 2) - CONTEXT_SPACE_START);
+ radeon_emit(cs, (reg - SI_CONTEXT_REG_OFFSET) >> 2);
radeon_emit(cs, 2);
} else {
/* TODO: Figure out how to use LOAD_CONTEXT_REG on SI/CIK. */
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 70084a2b605..ad057a87509 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -45,7 +45,6 @@
#include "sid.h"
#include "git_sha1.h"
#include "gfx9d.h"
-#include "addrlib/gfx9/chip/gfx9_enum.h"
#include "util/build_id.h"
#include "util/debug.h"
#include "util/mesa-sha1.h"
@@ -4526,11 +4525,11 @@ radv_tex_filter_mode(VkSamplerReductionModeEXT mode)
{
switch (mode) {
case VK_SAMPLER_REDUCTION_MODE_WEIGHTED_AVERAGE_EXT:
- return SQ_IMG_FILTER_MODE_BLEND;
+ return V_008F30_SQ_IMG_FILTER_MODE_BLEND;
case VK_SAMPLER_REDUCTION_MODE_MIN_EXT:
- return SQ_IMG_FILTER_MODE_MIN;
+ return V_008F30_SQ_IMG_FILTER_MODE_MIN;
case VK_SAMPLER_REDUCTION_MODE_MAX_EXT:
- return SQ_IMG_FILTER_MODE_MAX;
+ return V_008F30_SQ_IMG_FILTER_MODE_MAX;
default:
break;
}
@@ -4559,7 +4558,7 @@ radv_init_sampler(struct radv_device *device,
uint32_t max_aniso = radv_get_max_anisotropy(device, pCreateInfo);
uint32_t max_aniso_ratio = radv_tex_aniso_filter(max_aniso);
bool is_vi = (device->physical_device->rad_info.chip_class >= VI);
- unsigned filter_mode = SQ_IMG_FILTER_MODE_BLEND;
+ unsigned filter_mode = V_008F30_SQ_IMG_FILTER_MODE_BLEND;
const struct VkSamplerReductionModeCreateInfoEXT *sampler_reduction =
vk_find_struct_const(pCreateInfo->pNext,