[D3D12] Integer texture comment and UpdateSystemConstantValues cleanup

This commit is contained in:
Triang3l 2018-11-14 16:45:31 +03:00
parent 8ff03bcfa0
commit 5e51306660
2 changed files with 10 additions and 8 deletions

View File

@ -1629,6 +1629,7 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
uint32_t rb_surface_info = regs[XE_GPU_REG_RB_SURFACE_INFO].u32;
uint32_t rb_colorcontrol = regs[XE_GPU_REG_RB_COLORCONTROL].u32;
uint32_t rb_alpha_ref = regs[XE_GPU_REG_RB_ALPHA_REF].u32;
uint32_t rb_color_mask = regs[XE_GPU_REG_RB_COLOR_MASK].u32;
bool dirty = false;
@ -1860,9 +1861,7 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
system_constants_.alpha_test = alpha_test;
// Color exponent bias and output index mapping or ROV writing.
uint32_t rb_color_mask = regs[XE_GPU_REG_RB_COLOR_MASK].u32;
bool colorcontrol_blend_enable =
(regs[XE_GPU_REG_RB_COLORCONTROL].u32 & 0x20) == 0;
bool colorcontrol_blend_enable = (rb_colorcontrol & 0x20) == 0;
for (uint32_t i = 0; i < 4; ++i) {
uint32_t color_info, blend_control;
switch (i) {
@ -1965,8 +1964,7 @@ void D3D12CommandProcessor::UpdateSystemConstantValues(
// Depth/stencil testing and blend constant for ROV blending.
if (IsROVUsedForEDRAM()) {
uint32_t depth_base_dwords =
(regs[XE_GPU_REG_RB_DEPTH_INFO].u32 & 0xFFF) * 1280;
uint32_t depth_base_dwords = (rb_depth_info & 0xFFF) * 1280;
dirty |= system_constants_.edram_depth_base_dwords != depth_base_dwords;
system_constants_.edram_depth_base_dwords = depth_base_dwords;

View File

@ -215,7 +215,11 @@ class TextureCache {
// created if both unsigned and signed are used.
LoadMode load_mode_snorm;
// TODO(Triang3l): Integer formats.
// Do NOT add integer DXGI formats to this - they are not filterable, can
// only be read with Load, not Sample! If any game is seen using num_format
// 1 for fixed-point formats (for floating-point, it's normally set to 1
// though), add a constant buffer containing multipliers for the
// textures and multiplication to the tfetch implementation.
// Uncompression info for when the regular host format for this texture is
// block-compressed, but the size is not block-aligned, and thus such
@ -393,8 +397,8 @@ class TextureCache {
};
// Whether the signed version of the texture has a different representation on
// the host than its unsigned version (for example, if it's a normalized or an
// integer texture emulated with a larger host pixel format).
// the host than its unsigned version (for example, if it's a fixed-point
// texture emulated with a larger host pixel format).
static inline bool IsSignedVersionSeparate(TextureFormat format) {
const HostFormat& host_format = host_formats_[uint32_t(format)];
return host_format.load_mode_snorm != LoadMode::kUnknown &&