mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-05-06 01:50:38 +00:00
Fix tests with references to removed properties
This commit is contained in:
@@ -493,8 +493,7 @@ class Texture_Zoo():
|
||||
rd.ReplayOutputType.Texture)
|
||||
|
||||
for d in self.controller.GetRootActions():
|
||||
|
||||
if 'slice tests' in d.name:
|
||||
if 'slice tests' in d.customName:
|
||||
for sub in d.children:
|
||||
if sub.flags & rd.ActionFlags.Drawcall:
|
||||
self.controller.SetFrameEvent(sub.eventId, True)
|
||||
|
||||
@@ -36,8 +36,8 @@ class D3D11_AMD_Shader_Extensions(rdtest.TestCase):
|
||||
gpuMax = self.find_action("gpuMax")
|
||||
|
||||
# The values should be identical
|
||||
cpuMax = int(cpuMax.name[8:])
|
||||
gpuMax = int(gpuMax.name[8:])
|
||||
cpuMax = int(cpuMax.customName[8:])
|
||||
gpuMax = int(gpuMax.customName[8:])
|
||||
|
||||
if cpuMax != gpuMax or cpuMax == 0:
|
||||
raise rdtest.TestFailureException(
|
||||
|
||||
@@ -46,8 +46,8 @@ class D3D12_AMD_Shader_Extensions(rdtest.TestCase):
|
||||
gpuMax = self.find_action(pass_type + " gpuMax")
|
||||
|
||||
# The values should be identical
|
||||
cpuMax = int(cpuMax.name.split(': ')[1])
|
||||
gpuMax = int(gpuMax.name.split(': ')[1])
|
||||
cpuMax = int(cpuMax.customName.split(': ')[1])
|
||||
gpuMax = int(gpuMax.customName.split(': ')[1])
|
||||
|
||||
if cpuMax != gpuMax or cpuMax == 0:
|
||||
raise rdtest.TestFailureException(
|
||||
|
||||
@@ -40,10 +40,10 @@ class GL_Draw_Zoo(rdtest.Draw_Zoo):
|
||||
self.check(pipe.IsStripRestartEnabled())
|
||||
self.check((pipe.GetStripRestartIndex() & ((1 << (ib.byteStride*8)) - 1)) == 0xffff)
|
||||
|
||||
draw = self.find_draw("GL_ClearDepth")
|
||||
self.check(draw is not None)
|
||||
action = self.find_action("GL_ClearDepth")
|
||||
self.check(action is not None)
|
||||
|
||||
draw = draw.next
|
||||
action = action.next
|
||||
|
||||
self.check(draw.flags & (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil) == (rd.DrawFlags.Clear|rd.DrawFlags.ClearDepthStencil))
|
||||
self.check(action.flags & (rd.ActionFlags.Clear|rd.ActionFlags.ClearDepthStencil) == (rd.ActionFlags.Clear|rd.ActionFlags.ClearDepthStencil))
|
||||
|
||||
|
||||
@@ -299,14 +299,14 @@ class Iter_Test(rdtest.TestCase):
|
||||
def iter_test(self):
|
||||
# Handy tweaks when running locally to disable certain things
|
||||
|
||||
action_chance = 0.1 # Chance of doing anything at all
|
||||
test_chance = 0.1 # Chance of doing anything at all
|
||||
do_image_save = 0.25 # Chance of saving images of the outputs
|
||||
do_vert_debug = 1.0 # Chance of debugging a vertex (if valid)
|
||||
do_pixel_debug = 1.0 # Chance of doing pixel history at the current event and debugging a pixel (if valid)
|
||||
|
||||
self.props: rd.APIProperties = self.controller.GetAPIProperties()
|
||||
|
||||
actions = {
|
||||
event_tests = {
|
||||
'Image Save': {'chance': do_image_save, 'func': self.image_save},
|
||||
'Vertex Debug': {'chance': do_vert_debug, 'func': self.vert_debug},
|
||||
'Pixel History & Debug': {'chance': do_pixel_debug, 'func': self.pixel_debug},
|
||||
@@ -315,8 +315,8 @@ class Iter_Test(rdtest.TestCase):
|
||||
# To choose an action, if we're going to do one, we take random in range(0, choice_max) then check each action
|
||||
# type in turn to see which part of the range we landed in
|
||||
choice_max = 0
|
||||
for action in actions:
|
||||
choice_max += actions[action]['chance']
|
||||
for event_test in event_tests:
|
||||
choice_max += event_tests[event_test]['chance']
|
||||
|
||||
action = self.get_first_action()
|
||||
last_action = self.get_last_action()
|
||||
@@ -329,14 +329,14 @@ class Iter_Test(rdtest.TestCase):
|
||||
rdtest.log.print("Set event")
|
||||
|
||||
# If we should take an action at this event
|
||||
if random.random() < action_chance:
|
||||
if random.random() < test_chance:
|
||||
c = random.random() * choice_max
|
||||
|
||||
for action in actions:
|
||||
chance = actions[action]['chance']
|
||||
for event_test in event_tests:
|
||||
chance = event_tests[event_test]['chance']
|
||||
if c < chance:
|
||||
rdtest.log.print("Performing action '{}'".format(action))
|
||||
actions[action]['func'](action)
|
||||
rdtest.log.print("Performing test '{}' on event {}".format(event_test, action.eventId))
|
||||
event_tests[event_test]['func'](action)
|
||||
break
|
||||
else:
|
||||
c -= chance
|
||||
|
||||
Reference in New Issue
Block a user